|
3 | 3 | @isCollapsed={{@isCollapsed}}
|
4 | 4 | @toggleCollapsed={{@toggleCollapsed}}
|
5 | 5 | @userHasScrolled={{this.userHasScrolled}}
|
| 6 | + @shareButtonIsShown={{this.shareButtonIsShown}} |
| 7 | + @shareButtonTooltipText={{this.temporaryShareButtonTooltipText}} |
| 8 | + @shareButtonIcon={{this.temporaryShareButtonIcon}} |
6 | 9 | />
|
7 | 10 |
|
8 | 11 | {{#unless @isCollapsed}}
|
9 | 12 | <div
|
10 | 13 | class="sidebar-body"
|
11 | 14 | {{on "scroll" this.onScroll}}
|
12 |
| - {{did-insert this.registerBody}} |
| 15 | + {{did-insert this.didInsertBody}} |
13 | 16 | >
|
14 | 17 | {{#let (get-product-id this.product) as |productIcon|}}
|
15 | 18 | {{#if productIcon}}
|
|
24 | 27 | {{/let}}
|
25 | 28 |
|
26 | 29 | <div class="sidebar-body-container">
|
27 |
| - <div class="flex flex-col items-start space-y-2"> |
28 |
| - {{#if (is-empty @document.docNumber)}} |
29 |
| - <small class="hds-typography-body-100 hds-foreground-faint">{{#unless |
30 |
| - (is-empty @document.docType) |
31 |
| - }}{{@document.docType}}{{/unless}} |
32 |
| - </small> |
33 |
| - {{else}} |
34 |
| - <small class="hds-typography-body-100 hds-foreground-faint">{{#unless |
35 |
| - (is-empty @document.docType) |
36 |
| - }}{{@document.docType}}{{/unless}} |
37 |
| - • |
38 |
| - <span data-test-sidebar-doc-number> |
39 |
| - {{@document.docNumber}} |
40 |
| - </span> |
41 |
| - </small> |
42 |
| - {{/if}} |
| 30 | + <div> |
| 31 | + {{! div to break the parent's space-y styles }} |
| 32 | + <div |
| 33 | + class="flex items-center space-x-1.5 |
| 34 | + {{if this.isDraft 'mb-4 -mt-2' 'mb-2'}}" |
| 35 | + > |
| 36 | + <Hds::Badge |
| 37 | + data-test-sidebar-title-badge |
| 38 | + @text={{if this.isDraft "Draft" @document.docNumber}} |
| 39 | + class="uppercase !rounded-[3px] |
| 40 | + {{if |
| 41 | + @document.isDraft |
| 42 | + '!bg-color-palette-neutral-500 !text-white' |
| 43 | + '!bg-transparent pl-0 !text-color-foreground-faint' |
| 44 | + }} |
| 45 | + " |
| 46 | + /> |
| 47 | + {{#if this.isDraft}} |
| 48 | + <X::DropdownList |
| 49 | + data-test-draft-visibility-dropdown |
| 50 | + @items={{this.draftVisibilityOptions}} |
| 51 | + @selected={{this.draftVisibility}} |
| 52 | + @renderOut={{true}} |
| 53 | + @offset={{hash mainAxis=0 crossAxis=-7}} |
| 54 | + class="w-[350px]" |
| 55 | + > |
| 56 | + <:anchor as |dd|> |
| 57 | + <dd.ToggleAction |
| 58 | + data-test-draft-visibility-toggle |
| 59 | + data-test-icon={{this.draftVisibilityIcon}} |
| 60 | + data-test-chevron-direction={{if |
| 61 | + dd.contentIsShown |
| 62 | + "up" |
| 63 | + "down" |
| 64 | + }} |
| 65 | + class="flex items-center text-color-foreground-faint sidebar-header-button draft-visibility-button" |
| 66 | + {{tooltip |
| 67 | + this.toggleDraftVisibilityTooltipText |
| 68 | + placement="bottom" |
| 69 | + }} |
| 70 | + > |
| 71 | + <FlightIcon @name={{this.draftVisibilityIcon}} /> |
| 72 | + <FlightIcon |
| 73 | + @name={{if dd.contentIsShown "chevron-up" "chevron-down"}} |
| 74 | + /> |
| 75 | + </dd.ToggleAction> |
| 76 | + </:anchor> |
| 77 | + <:item as |dd|> |
| 78 | + <dd.Action |
| 79 | + data-test-draft-visibility-option |
| 80 | + data-test-is-checked={{dd.isSelected}} |
| 81 | + data-test-value={{dd.value}} |
| 82 | + class="flex items-start gap-3 py-2.5 pl-4 pr-6" |
| 83 | + {{on "click" (perform this.setDraftVisibility dd.value)}} |
| 84 | + > |
| 85 | + <FlightIcon @name={{dd.attrs.icon}} class="shrink-0 mt-0.5" /> |
| 86 | + <div class="w-full"> |
| 87 | + <h4>{{dd.attrs.title}}</h4> |
| 88 | + <p>{{dd.attrs.description}}</p> |
| 89 | + </div> |
| 90 | + <FlightIcon |
| 91 | + @name="check" |
| 92 | + class="check shrink-0 mt-0.5 |
| 93 | + {{if dd.isSelected 'visible' 'invisible'}}" |
| 94 | + /> |
| 95 | + </dd.Action> |
| 96 | + </:item> |
| 97 | + </X::DropdownList> |
| 98 | + {{/if}} |
| 99 | + </div> |
43 | 100 | {{#if this.editingIsDisabled}}
|
44 | 101 | <h1
|
45 | 102 | class="hds-typography-display-300 hds-font-weight-semibold hds-foreground-strong"
|
46 | 103 | >{{this.title}}</h1>
|
47 | 104 | {{else}}
|
48 |
| - <EditableField |
49 |
| - @value={{this.title}} |
50 |
| - @onChange={{perform this.save "title"}} |
51 |
| - @loading={{this.save.isRunning}} |
52 |
| - @disabled={{this.editingIsDisabled}} |
53 |
| - > |
54 |
| - <:default> |
55 |
| - {{#unless (is-empty this.title)}} |
56 |
| - <h1 |
57 |
| - class="hds-typography-display-300 hds-font-weight-semibold hds-foreground-strong" |
58 |
| - >{{this.title}}</h1> |
59 |
| - {{else}} |
60 |
| - <h1 |
61 |
| - class="hds-typography-display-300 hds-font-weight-semibold hds-foreground-faint" |
62 |
| - >Enter a title here.</h1> |
63 |
| - {{/unless}} |
64 |
| - </:default> |
65 |
| - <:editing as |F|> |
66 |
| - <Hds::Form::Textarea::Field |
67 |
| - {{auto-height-textarea}} |
68 |
| - @value={{F.value}} |
69 |
| - class="primary-textarea" |
70 |
| - name="title" |
71 |
| - {{on "blur" F.update}} |
72 |
| - as |F| |
73 |
| - /> |
74 |
| - </:editing> |
75 |
| - </EditableField> |
| 105 | + <div class="mb-8"> |
| 106 | + <EditableField |
| 107 | + @value={{this.title}} |
| 108 | + @onChange={{perform this.save "title"}} |
| 109 | + @loading={{this.save.isRunning}} |
| 110 | + @disabled={{this.editingIsDisabled}} |
| 111 | + > |
| 112 | + <:default> |
| 113 | + {{#unless (is-empty this.title)}} |
| 114 | + <h1 |
| 115 | + class="hds-typography-display-300 hds-font-weight-semibold hds-foreground-strong" |
| 116 | + >{{this.title}}</h1> |
| 117 | + {{else}} |
| 118 | + <h1 |
| 119 | + class="hds-typography-display-300 hds-font-weight-semibold hds-foreground-faint" |
| 120 | + >Enter a title here.</h1> |
| 121 | + {{/unless}} |
| 122 | + </:default> |
| 123 | + <:editing as |F|> |
| 124 | + <Hds::Form::Textarea::Field |
| 125 | + {{auto-height-textarea}} |
| 126 | + @value={{F.value}} |
| 127 | + class="primary-textarea" |
| 128 | + name="title" |
| 129 | + {{on "blur" F.update}} |
| 130 | + as |F| |
| 131 | + /> |
| 132 | + </:editing> |
| 133 | + </EditableField> |
| 134 | + </div> |
76 | 135 | {{/if}}
|
77 | 136 | </div>
|
78 | 137 |
|
79 | 138 | <hr class="border-0 border-b hds-border-faint" />
|
80 | 139 |
|
81 |
| - <div class="flex flex-col items-start space-y-2"> |
82 |
| - <Document::Sidebar::SectionHeader @title="Summary" /> |
| 140 | + {{! Summary }} |
| 141 | + <div class="mb-5"> |
| 142 | + <Document::Sidebar::SectionHeader @title="Summary" class="mb-2" /> |
83 | 143 | {{#if this.editingIsDisabled}}
|
84 | 144 | <p
|
85 | 145 | class="hds-typography-body-200 hds-font-weight-medium hds-foreground-primary"
|
|
120 | 180 |
|
121 | 181 | <div class="flex flex-col items-start space-y-2">
|
122 | 182 | <Document::Sidebar::SectionHeader @title="Status" />
|
123 |
| - <Doc::State @state={{@document.status}} @hideProgress={{true}} /> |
| 183 | + <div class="flex space-x-1"> |
| 184 | + <Doc::State @state={{@document.status}} @hideProgress={{true}} /> |
| 185 | + <Hds::Badge @text={{@document.docType}} /> |
| 186 | + </div> |
124 | 187 | </div>
|
125 | 188 |
|
126 | 189 | <div class="flex flex-col items-start space-y-2">
|
|
0 commit comments