@redvars/peacock 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/dist/{BaseField-_unSNU5x.js → BaseField-CHBcjVc2.js} +3 -3
  2. package/dist/{BaseField-_unSNU5x.js.map → BaseField-CHBcjVc2.js.map} +1 -1
  3. package/dist/{BaseInput-DtZH0fPJ.js → BaseInput-DZp2O8Gh.js} +2 -2
  4. package/dist/{BaseInput-DtZH0fPJ.js.map → BaseInput-DZp2O8Gh.js.map} +1 -1
  5. package/dist/ai-badge.js +2 -2
  6. package/dist/ai-summary.js +2 -2
  7. package/dist/alert.js +2 -2
  8. package/dist/anchor-nav.js +2 -2
  9. package/dist/app-shell.js +2 -2
  10. package/dist/assistant-panel.js +2 -2
  11. package/dist/assistant-step.js +2 -2
  12. package/dist/assistant-steps.js +2 -2
  13. package/dist/avatar-group.js +2 -2
  14. package/dist/banner.js +2 -2
  15. package/dist/{base-progress-D7Nmfh1s.js → base-progress-CKQ32Ruw.js} +2 -2
  16. package/dist/{base-progress-D7Nmfh1s.js.map → base-progress-CKQ32Ruw.js.map} +1 -1
  17. package/dist/bottom-sheet.js +2 -2
  18. package/dist/breadcrumb.js +2 -2
  19. package/dist/calendar.js +2 -2
  20. package/dist/{canvas-base-CWQ4rQ2s.js → canvas-base-BoKef3yr.js} +2 -2
  21. package/dist/{canvas-base-CWQ4rQ2s.js.map → canvas-base-BoKef3yr.js.map} +1 -1
  22. package/dist/carousel.js +644 -0
  23. package/dist/carousel.js.map +1 -0
  24. package/dist/{cartesian-chart-CS5yRLfE.js → cartesian-chart-DqZxnoG1.js} +2 -2
  25. package/dist/{cartesian-chart-CS5yRLfE.js.map → cartesian-chart-DqZxnoG1.js.map} +1 -1
  26. package/dist/{cb-group-base-CO30uFQZ.js → cb-group-base-Bf7iOIGS.js} +2 -2
  27. package/dist/{cb-group-base-CO30uFQZ.js.map → cb-group-base-Bf7iOIGS.js.map} +1 -1
  28. package/dist/cb-group.js +3 -3
  29. package/dist/cb-rule.js +3 -3
  30. package/dist/chart-area.js +4 -4
  31. package/dist/chart-bar.js +4 -4
  32. package/dist/{chart-base-C_XKVyhf.js → chart-base-ByCJM_9C.js} +2 -2
  33. package/dist/{chart-base-C_XKVyhf.js.map → chart-base-ByCJM_9C.js.map} +1 -1
  34. package/dist/chart-doughnut.js +3 -3
  35. package/dist/chart-line.js +4 -4
  36. package/dist/chart-pie.js +3 -3
  37. package/dist/chat-event.js +2 -2
  38. package/dist/chat-message.js +2 -2
  39. package/dist/chat-thread.js +2 -2
  40. package/dist/checkbox-group.js +3 -3
  41. package/dist/checkbox.js +3 -3
  42. package/dist/chip-set.js +2 -2
  43. package/dist/chip.js +2 -2
  44. package/dist/circular-progress.js +3 -3
  45. package/dist/citation.js +2 -2
  46. package/dist/code-editor.js +3 -3
  47. package/dist/code-highlighter.js +2 -2
  48. package/dist/color-field.js +4 -4
  49. package/dist/color-picker.js +2 -2
  50. package/dist/command-palette.js +2 -2
  51. package/dist/comment-composer.js +24 -12
  52. package/dist/comment-composer.js.map +1 -1
  53. package/dist/condition-builder.js +3 -3
  54. package/dist/confirm-dialog.js +2 -2
  55. package/dist/copy-button.js +2 -2
  56. package/dist/currency-field.js +4 -4
  57. package/dist/custom-elements-jsdocs.json +936 -56
  58. package/dist/custom-elements.json +3486 -554
  59. package/dist/date-field.js +5 -5
  60. package/dist/date-picker.js +2 -2
  61. package/dist/date-range-field.js +5 -5
  62. package/dist/datetime-field.js +5 -5
  63. package/dist/dependency-map.js +3 -3
  64. package/dist/description-item.js +2 -2
  65. package/dist/description-list.js +2 -2
  66. package/dist/{diagram-Va096vj9.js → diagram-Cnrj-4y3.js} +2 -2
  67. package/dist/{diagram-Va096vj9.js.map → diagram-Cnrj-4y3.js.map} +1 -1
  68. package/dist/diagram-controls.js +2 -2
  69. package/dist/diagram-minimap.js +2 -2
  70. package/dist/diagram.js +4 -4
  71. package/dist/diff-viewer.js +2 -2
  72. package/dist/discussion-activity.js +2 -2
  73. package/dist/discussion-comment.js +2 -2
  74. package/dist/discussion.js +4 -4
  75. package/dist/{document-editor-Dc8JeFVB.js → document-editor-C8ThjDQ7.js} +22 -10
  76. package/dist/{document-editor-Dc8JeFVB.js.map → document-editor-C8ThjDQ7.js.map} +1 -1
  77. package/dist/document-editor.js +3 -3
  78. package/dist/draft-card.js +2 -2
  79. package/dist/erd.js +3 -3
  80. package/dist/file-upload.js +3 -3
  81. package/dist/filter-bar.js +2 -2
  82. package/dist/flow.js +4 -4
  83. package/dist/form.js +2 -2
  84. package/dist/{generative-view-BKlcuujw.js → generative-view-CQ8-g1wY.js} +2 -2
  85. package/dist/{generative-view-BKlcuujw.js.map → generative-view-CQ8-g1wY.js.map} +1 -1
  86. package/dist/generative-view.js +3 -3
  87. package/dist/highlight-Be0wu7kh.js +252 -0
  88. package/dist/highlight-Be0wu7kh.js.map +1 -0
  89. package/dist/highlight.js +6 -0
  90. package/dist/highlight.js.map +1 -0
  91. package/dist/html-editor.js +29 -12
  92. package/dist/html-editor.js.map +1 -1
  93. package/dist/{i18n-controller-DJHsE1YH.js → i18n-controller-DLJcJ5gO.js} +2 -2
  94. package/dist/{i18n-controller-DJHsE1YH.js.map → i18n-controller-DLJcJ5gO.js.map} +1 -1
  95. package/dist/image.js +2 -2
  96. package/dist/index.js +26 -16
  97. package/dist/index.js.map +1 -1
  98. package/dist/inline-edit.js +2 -2
  99. package/dist/input.js +3 -3
  100. package/dist/json-viewer.js +2 -2
  101. package/dist/kanban.js +2 -2
  102. package/dist/kbd.js +2 -2
  103. package/dist/linear-progress.js +3 -3
  104. package/dist/listbox.js +2 -2
  105. package/dist/loader-full.js +19 -9
  106. package/dist/loader-full.js.map +1 -1
  107. package/dist/loader.js +46 -9
  108. package/dist/loader.js.map +1 -1
  109. package/dist/markdown-editor.js +29 -12
  110. package/dist/markdown-editor.js.map +1 -1
  111. package/dist/mention-input.js +4 -4
  112. package/dist/modal.js +2 -2
  113. package/dist/navigation-bar.js +2 -2
  114. package/dist/navigation-drawer.js +2 -2
  115. package/dist/navigation-rail.js +2 -2
  116. package/dist/notification-center.js +2 -2
  117. package/dist/number-field.js +4 -4
  118. package/dist/page-header.js +2 -2
  119. package/dist/pagination.js +2 -2
  120. package/dist/password-field.js +4 -4
  121. package/dist/password-rules.js +2 -2
  122. package/dist/phone-field.js +4 -4
  123. package/dist/{picker-field-CUI05sWc.js → picker-field-B5xOFc3-.js} +3 -3
  124. package/dist/{picker-field-CUI05sWc.js.map → picker-field-B5xOFc3-.js.map} +1 -1
  125. package/dist/pin-input.js +4 -4
  126. package/dist/presence-indicator.js +2 -2
  127. package/dist/prompt-input.js +24 -12
  128. package/dist/prompt-input.js.map +1 -1
  129. package/dist/radio.js +3 -3
  130. package/dist/rating.js +3 -3
  131. package/dist/redvars-loader.js +2 -2
  132. package/dist/relative-time.js +2 -2
  133. package/dist/resizable-panels.js +2 -2
  134. package/dist/{rich-text-input-N_hqnXej.js → rich-text-input-C4B9D6oD.js} +21 -18
  135. package/dist/rich-text-input-C4B9D6oD.js.map +1 -0
  136. package/dist/{schema-Dy0z-80u.js → schema-CPhNrjrx.js} +2 -2
  137. package/dist/{schema-Dy0z-80u.js.map → schema-CPhNrjrx.js.map} +1 -1
  138. package/dist/search.js +3 -3
  139. package/dist/select.js +4 -4
  140. package/dist/side-sheet.js +2 -2
  141. package/dist/signature-pad.js +3 -3
  142. package/dist/site-footer-group.js +142 -0
  143. package/dist/site-footer-group.js.map +1 -0
  144. package/dist/site-footer.js +338 -0
  145. package/dist/site-footer.js.map +1 -0
  146. package/dist/site-header.js +774 -0
  147. package/dist/site-header.js.map +1 -0
  148. package/dist/site-nav-group.js +123 -0
  149. package/dist/site-nav-group.js.map +1 -0
  150. package/dist/site-nav-link.js +321 -0
  151. package/dist/site-nav-link.js.map +1 -0
  152. package/dist/site-nav-menu.js +506 -0
  153. package/dist/site-nav-menu.js.map +1 -0
  154. package/dist/site-nav-shared-BDR2HG8e.js +23 -0
  155. package/dist/site-nav-shared-BDR2HG8e.js.map +1 -0
  156. package/dist/slider.js +3 -3
  157. package/dist/snackbar.js +2 -2
  158. package/dist/sparkline.js +2 -2
  159. package/dist/split-button.js +2 -2
  160. package/dist/src/__internal/i18n/strings.d.ts +24 -1
  161. package/dist/src/__internal/rich-text/rich-text-input.d.ts +6 -1
  162. package/dist/src/carousel/carousel.d.ts +135 -0
  163. package/dist/src/carousel/index.d.ts +1 -0
  164. package/dist/src/highlight/highlight.d.ts +56 -0
  165. package/dist/src/highlight/index.d.ts +2 -0
  166. package/dist/src/highlight/matches.d.ts +9 -0
  167. package/dist/src/html-editor/html-editor.d.ts +5 -0
  168. package/dist/src/index.d.ts +9 -0
  169. package/dist/src/markdown-editor/markdown-editor.d.ts +5 -0
  170. package/dist/src/site-footer/index.d.ts +2 -0
  171. package/dist/src/site-footer/site-footer-group.d.ts +34 -0
  172. package/dist/src/site-footer/site-footer.d.ts +74 -0
  173. package/dist/src/site-header/index.d.ts +4 -0
  174. package/dist/src/site-header/site-header.d.ts +170 -0
  175. package/dist/src/site-header/site-nav-group.d.ts +32 -0
  176. package/dist/src/site-header/site-nav-link.d.ts +65 -0
  177. package/dist/src/site-header/site-nav-menu.d.ts +104 -0
  178. package/dist/src/site-header/site-nav-shared.d.ts +13 -0
  179. package/dist/src/video/index.d.ts +2 -0
  180. package/dist/src/video/video-source.d.ts +12 -0
  181. package/dist/src/video/video.d.ts +80 -0
  182. package/dist/stat.js +2 -2
  183. package/dist/status-indicator.js +2 -2
  184. package/dist/step.js +2 -2
  185. package/dist/stepper.js +2 -2
  186. package/dist/{strings-DnYjGbbc.js → strings-MXyrGrNs.js} +28 -2
  187. package/dist/strings-MXyrGrNs.js.map +1 -0
  188. package/dist/svg.js +2 -2
  189. package/dist/switch.js +3 -3
  190. package/dist/table.js +2 -2
  191. package/dist/test/carousel.test.d.ts +1 -0
  192. package/dist/test/highlight.test.d.ts +1 -0
  193. package/dist/test/site-footer.test.d.ts +1 -0
  194. package/dist/test/site-header.test.d.ts +1 -0
  195. package/dist/test/video.test.d.ts +1 -0
  196. package/dist/textarea.js +4 -4
  197. package/dist/time-field.js +5 -5
  198. package/dist/time-picker.js +2 -2
  199. package/dist/timeline-item.js +2 -2
  200. package/dist/timeline.js +2 -2
  201. package/dist/{toggle-base-CXmFSp3b.js → toggle-base-I1wE_fVe.js} +2 -2
  202. package/dist/{toggle-base-CXmFSp3b.js.map → toggle-base-I1wE_fVe.js.map} +1 -1
  203. package/dist/tour.js +2 -2
  204. package/dist/transfer-list.js +3 -3
  205. package/dist/tree-chart.js +3 -3
  206. package/dist/tree-item.js +2 -2
  207. package/dist/tree.js +2 -2
  208. package/dist/tsconfig.tsbuildinfo +1 -1
  209. package/dist/typing-indicator.js +2 -2
  210. package/dist/url-field.js +4 -4
  211. package/dist/user-menu.js +2 -2
  212. package/dist/video-IwNmHyft.js +509 -0
  213. package/dist/video-IwNmHyft.js.map +1 -0
  214. package/dist/video.js +12 -0
  215. package/dist/video.js.map +1 -0
  216. package/dist/virtual-list.js +2 -2
  217. package/dist/workflow-timeline.js +2 -2
  218. package/dist/workflow.js +3 -3
  219. package/dist/workspace-switcher.js +2 -2
  220. package/package.json +1 -1
  221. package/readme.md +5 -0
  222. package/src/__internal/i18n/strings.ts +31 -1
  223. package/src/__internal/rich-text/editor-chrome.scss +27 -10
  224. package/src/__internal/rich-text/rich-text-input.ts +17 -16
  225. package/src/carousel/carousel.scss +124 -0
  226. package/src/carousel/carousel.ts +547 -0
  227. package/src/carousel/index.ts +1 -0
  228. package/src/highlight/highlight.scss +25 -0
  229. package/src/highlight/highlight.ts +123 -0
  230. package/src/highlight/index.ts +2 -0
  231. package/src/highlight/matches.ts +94 -0
  232. package/src/html-editor/html-editor.ts +5 -0
  233. package/src/index.ts +18 -0
  234. package/src/loader.ts +36 -0
  235. package/src/markdown-editor/markdown-editor.ts +5 -0
  236. package/src/site-footer/index.ts +2 -0
  237. package/src/site-footer/site-footer-group.scss +53 -0
  238. package/src/site-footer/site-footer-group.ts +52 -0
  239. package/src/site-footer/site-footer.scss +171 -0
  240. package/src/site-footer/site-footer.ts +151 -0
  241. package/src/site-header/index.ts +8 -0
  242. package/src/site-header/site-header.scss +238 -0
  243. package/src/site-header/site-header.ts +565 -0
  244. package/src/site-header/site-nav-group.scss +29 -0
  245. package/src/site-header/site-nav-group.ts +57 -0
  246. package/src/site-header/site-nav-link.scss +154 -0
  247. package/src/site-header/site-nav-link.ts +140 -0
  248. package/src/site-header/site-nav-menu.scss +182 -0
  249. package/src/site-header/site-nav-menu.ts +336 -0
  250. package/src/site-header/site-nav-shared.ts +27 -0
  251. package/src/video/index.ts +2 -0
  252. package/src/video/video-source.ts +80 -0
  253. package/src/video/video.scss +183 -0
  254. package/src/video/video.ts +246 -0
  255. package/dist/rich-text-input-N_hqnXej.js.map +0 -1
  256. package/dist/strings-DnYjGbbc.js.map +0 -1
@@ -0,0 +1,154 @@
1
+ @use '../../scss/mixin';
2
+
3
+ @include mixin.base-styles;
4
+
5
+ // The link's colour lives on the host: the link reset makes `:link` and `:visited` inherit it.
6
+ :host {
7
+ display: block;
8
+ flex: none;
9
+ color: var(--color-on-surface-variant);
10
+ }
11
+
12
+ :host([data-in-menu]:not([data-collapsed])) {
13
+ color: var(--color-on-surface);
14
+ }
15
+
16
+ .link {
17
+ @include mixin.reset-link-styles;
18
+
19
+ position: relative;
20
+ display: flex;
21
+ align-items: center;
22
+ gap: var(--spacing-150);
23
+ box-sizing: border-box;
24
+ border-radius: var(--_shape, var(--shape-corner-full));
25
+
26
+ // The ring follows the link's shape, which differs in the bar, a panel and the drawer.
27
+ .focus-ring {
28
+ --focus-ring-container-shape-start-start: var(
29
+ --_shape,
30
+ var(--shape-corner-full)
31
+ );
32
+ --focus-ring-container-shape-start-end: var(
33
+ --_shape,
34
+ var(--shape-corner-full)
35
+ );
36
+ --focus-ring-container-shape-end-start: var(
37
+ --_shape,
38
+ var(--shape-corner-full)
39
+ );
40
+ --focus-ring-container-shape-end-end: var(
41
+ --_shape,
42
+ var(--shape-corner-full)
43
+ );
44
+ }
45
+
46
+ &:hover {
47
+ color: var(--color-on-surface);
48
+ background-color: var(--color-surface-container-high);
49
+ }
50
+ }
51
+
52
+ .icon {
53
+ display: none;
54
+ flex: none;
55
+ color: var(--color-primary);
56
+ --icon-size: 1.375rem;
57
+ --icon-color: currentColor;
58
+ }
59
+
60
+ .text {
61
+ display: flex;
62
+ flex-direction: column;
63
+ min-inline-size: 0;
64
+ }
65
+
66
+ .label {
67
+ @include mixin.get-typography(label-large);
68
+ }
69
+
70
+ .description {
71
+ @include mixin.get-typography(body-small);
72
+
73
+ color: var(--color-on-surface-variant);
74
+ }
75
+
76
+ // ── In the bar ────────────────────────────────────────────────────────────
77
+
78
+ :host(:not([data-in-menu]):not([data-collapsed])) {
79
+ .link {
80
+ block-size: 2.5rem;
81
+ padding-inline: var(--spacing-150);
82
+ white-space: nowrap;
83
+ }
84
+
85
+ .description {
86
+ display: none;
87
+ }
88
+
89
+ [aria-current='page'] {
90
+ color: var(--color-primary);
91
+
92
+ &::after {
93
+ content: '';
94
+ position: absolute;
95
+ inset-inline: var(--spacing-150);
96
+ inset-block-end: 0.125rem;
97
+ block-size: 0.1875rem;
98
+ border-radius: var(--shape-corner-full);
99
+ background-color: currentColor;
100
+ }
101
+ }
102
+ }
103
+
104
+ // ── In a menu's panel ─────────────────────────────────────────────────────
105
+
106
+ :host([data-in-menu]:not([data-collapsed])) {
107
+ .link {
108
+ align-items: flex-start;
109
+ padding: var(--spacing-100) var(--spacing-150);
110
+ --_shape: var(--shape-corner-medium);
111
+ }
112
+
113
+ .has-icon .icon {
114
+ display: inline-flex;
115
+ margin-block-start: 0.125rem;
116
+ }
117
+
118
+ .label {
119
+ @include mixin.get-typography(title-small);
120
+ }
121
+
122
+ [aria-current='page'] {
123
+ background-color: var(--color-secondary-container);
124
+ color: var(--color-on-secondary-container);
125
+ }
126
+ }
127
+
128
+ // ── In the drawer ─────────────────────────────────────────────────────────
129
+
130
+ :host([data-collapsed]) {
131
+ .link {
132
+ min-block-size: 3rem;
133
+ padding-inline: var(--spacing-200);
134
+ }
135
+
136
+ .description {
137
+ display: none;
138
+ }
139
+
140
+ [aria-current='page'] {
141
+ background-color: var(--color-secondary-container);
142
+ color: var(--color-on-secondary-container);
143
+ }
144
+ }
145
+
146
+ :host([data-collapsed][data-in-menu]) .link {
147
+ padding-inline-start: var(--spacing-400);
148
+ }
149
+
150
+ @media (forced-colors: active) {
151
+ [aria-current='page'] {
152
+ outline: 2px solid Highlight;
153
+ }
154
+ }
@@ -0,0 +1,140 @@
1
+ import { html, LitElement, nothing, type PropertyValues } from 'lit';
2
+ import { property, query, state } from 'lit/decorators.js';
3
+ import { classMap } from 'lit/directives/class-map.js';
4
+ import { ifDefined } from 'lit/directives/if-defined.js';
5
+ import IndividualComponent from '@/IndividualComponent.js';
6
+ import { adoptCollapsed, NAV_PARTS } from './site-nav-shared.js';
7
+ import styles from './site-nav-link.scss';
8
+
9
+ /**
10
+ * @label Site Nav Link
11
+ * @tag wc-site-nav-link
12
+ * @rawTag site-nav-link
13
+ *
14
+ * @summary A destination in a site header, in the bar or in a menu's panel.
15
+ * @overview
16
+ * <p>A link of a <code>wc-site-header</code>. In the bar it is a compact text link; inside a
17
+ * <code>wc-site-nav-menu</code> it is a row that can show an icon and a description. Mark the page
18
+ * the person is on with <code>current</code>, which sets <code>aria-current="page"</code>.</p>
19
+ * <p>It renders a real <code>&lt;a&gt;</code>, so middle-click, Open in new tab and a router that
20
+ * listens for clicks on links all work.</p>
21
+ *
22
+ * @slot - The link's text.
23
+ * @slot icon - An optional icon, shown in a menu's panel.
24
+ *
25
+ * @csspart link - The `<a>` element.
26
+ * @csspart description - The description text.
27
+ *
28
+ * @example
29
+ * ```html
30
+ * <wc-site-nav-link href="/docs" current>Docs</wc-site-nav-link>
31
+ * ```
32
+ * @example
33
+ * ```html
34
+ * <wc-site-nav-link href="/rules" description="Business logic without servers">
35
+ * <wc-icon slot="icon" name="rule"></wc-icon>
36
+ * Rules
37
+ * </wc-site-nav-link>
38
+ * ```
39
+ * @tags navigation
40
+ */
41
+ @IndividualComponent
42
+ export class SiteNavLink extends LitElement {
43
+ // ── Static ───────────────────────────────────────────────────────────────
44
+
45
+ static override shadowRootOptions = {
46
+ ...LitElement.shadowRootOptions,
47
+ delegatesFocus: true,
48
+ };
49
+
50
+ static styles = [styles];
51
+
52
+ // ── Properties ───────────────────────────────────────────────────────────
53
+
54
+ /** The link's address. */
55
+ @property() href = '';
56
+
57
+ /** Where to open the link, as on `<a>`. */
58
+ @property() target?: string;
59
+
60
+ /** Relationship to the linked page, as on `<a>`. */
61
+ @property() rel?: string;
62
+
63
+ /** Marks the page the person is on (`aria-current="page"`). */
64
+ @property({ type: Boolean, reflect: true }) current = false;
65
+
66
+ /** A line under the label, shown in a menu's panel. */
67
+ @property() description = '';
68
+
69
+ // ── State ────────────────────────────────────────────────────────────────
70
+
71
+ /** True when the `icon` slot has content. */
72
+ @state() private hasIcon = false;
73
+
74
+ // ── Queries ──────────────────────────────────────────────────────────────
75
+
76
+ @query('a') private linkElement?: HTMLAnchorElement;
77
+
78
+ // ── Lifecycle ────────────────────────────────────────────────────────────
79
+
80
+ override connectedCallback() {
81
+ super.connectedCallback();
82
+ adoptCollapsed(this);
83
+ this.toggleAttribute(
84
+ 'data-in-menu',
85
+ !!this.parentElement?.closest(NAV_PARTS.menu),
86
+ );
87
+ }
88
+
89
+ protected override updated(changed: PropertyValues<this>) {
90
+ // A menu marks itself current when it holds the current page.
91
+ if (changed.has('current')) {
92
+ const menu = this.closest(NAV_PARTS.menu) as LitElement | null;
93
+ menu?.requestUpdate();
94
+ }
95
+ }
96
+
97
+ // ── Public methods ───────────────────────────────────────────────────────
98
+
99
+ override focus() {
100
+ this.linkElement?.focus();
101
+ }
102
+
103
+ override blur() {
104
+ this.linkElement?.blur();
105
+ }
106
+
107
+ // ── Private methods ──────────────────────────────────────────────────────
108
+
109
+ private handleIconSlotChange(event: Event) {
110
+ this.hasIcon =
111
+ (event.target as HTMLSlotElement).assignedElements().length > 0;
112
+ }
113
+
114
+ // ── Render ───────────────────────────────────────────────────────────────
115
+
116
+ render() {
117
+ return html`<a
118
+ id="link"
119
+ class=${classMap({ link: true, 'has-icon': this.hasIcon })}
120
+ part="link"
121
+ href=${this.href}
122
+ target=${ifDefined(this.target)}
123
+ rel=${ifDefined(this.rel)}
124
+ aria-current=${this.current ? 'page' : nothing}
125
+ >
126
+ <wc-focus-ring class="focus-ring" for="link"></wc-focus-ring>
127
+ <span class="icon"
128
+ ><slot name="icon" @slotchange=${this.handleIconSlotChange}></slot
129
+ ></span>
130
+ <span class="text">
131
+ <span class="label"><slot></slot></span>
132
+ ${this.description
133
+ ? html`<span class="description" part="description"
134
+ >${this.description}</span
135
+ >`
136
+ : nothing}
137
+ </span>
138
+ </a>`;
139
+ }
140
+ }
@@ -0,0 +1,182 @@
1
+ @use '../../scss/mixin';
2
+
3
+ @include mixin.base-styles;
4
+
5
+ :host {
6
+ display: block;
7
+ flex: none;
8
+ }
9
+
10
+ // A list panel sits under its button; a columns panel spans the header's content box.
11
+ :host([layout='list']:not([data-collapsed])) {
12
+ position: relative;
13
+ }
14
+
15
+ .trigger {
16
+ @include mixin.reset-button-styles;
17
+ @include mixin.get-typography(label-large);
18
+
19
+ position: relative;
20
+ display: inline-flex;
21
+ align-items: center;
22
+ gap: var(--spacing-050);
23
+ block-size: 2.5rem;
24
+ padding-inline: var(--spacing-150) var(--spacing-100);
25
+ border-radius: var(--shape-corner-full);
26
+ color: var(--color-on-surface-variant);
27
+ cursor: pointer;
28
+ white-space: nowrap;
29
+
30
+ .focus-ring {
31
+ --focus-ring-container-shape-start-start: var(--shape-corner-full);
32
+ --focus-ring-container-shape-start-end: var(--shape-corner-full);
33
+ --focus-ring-container-shape-end-start: var(--shape-corner-full);
34
+ --focus-ring-container-shape-end-end: var(--shape-corner-full);
35
+ }
36
+
37
+ &:hover {
38
+ color: var(--color-on-surface);
39
+ background-color: var(--color-surface-container-high);
40
+ }
41
+ }
42
+
43
+ .chevron {
44
+ --icon-size: 1.125rem;
45
+ --icon-color: currentColor;
46
+
47
+ transition: transform var(--duration-short4, 200ms)
48
+ var(--easing-standard, ease);
49
+ }
50
+
51
+ .open .chevron {
52
+ transform: rotate(180deg);
53
+ }
54
+
55
+ .open .trigger {
56
+ background-color: var(--color-secondary-container);
57
+ color: var(--color-on-secondary-container);
58
+ }
59
+
60
+ .current .trigger {
61
+ color: var(--color-primary);
62
+ }
63
+
64
+ .panel {
65
+ position: absolute;
66
+ inset-block-start: calc(100% + var(--spacing-100));
67
+ z-index: 1;
68
+ box-sizing: border-box;
69
+ padding: var(--spacing-100);
70
+ border: 1px solid var(--color-outline-variant);
71
+ border-radius: var(--shape-corner-large);
72
+ background-color: var(--color-surface-container-lowest);
73
+ color: var(--color-on-surface);
74
+ box-shadow: var(--elevation-level2);
75
+
76
+ &[hidden] {
77
+ display: none;
78
+ }
79
+ }
80
+
81
+ :host([layout='list']) .panel {
82
+ inset-inline-start: 0;
83
+ inline-size: var(--site-nav-menu-panel-width, 16rem);
84
+ }
85
+
86
+ :host([layout='list']) .content {
87
+ display: flex;
88
+ flex-direction: column;
89
+ gap: var(--spacing-025);
90
+ }
91
+
92
+ :host([layout='columns']) .panel {
93
+ inset-block-start: calc(100% - var(--spacing-050));
94
+ inset-inline: var(--spacing-400);
95
+ display: grid;
96
+ grid-template-columns: 1fr;
97
+ gap: var(--spacing-200);
98
+ max-inline-size: var(--site-nav-menu-columns-max-width, 60rem);
99
+ margin-inline: auto;
100
+ padding: var(--spacing-200);
101
+
102
+ &.has-feature {
103
+ grid-template-columns: 1fr minmax(12rem, 16rem);
104
+ }
105
+
106
+ &[hidden] {
107
+ display: none;
108
+ }
109
+ }
110
+
111
+ :host([layout='columns']) .content {
112
+ display: grid;
113
+ grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
114
+ gap: var(--spacing-200);
115
+ }
116
+
117
+ .feature {
118
+ display: flex;
119
+ flex-direction: column;
120
+ align-self: start;
121
+
122
+ &[hidden] {
123
+ display: none;
124
+ }
125
+ }
126
+
127
+ // ── In the drawer ─────────────────────────────────────────────────────────
128
+
129
+ :host([data-collapsed]) {
130
+ .trigger {
131
+ display: flex;
132
+ justify-content: space-between;
133
+ inline-size: 100%;
134
+ min-block-size: 3rem;
135
+ padding-inline: var(--spacing-200);
136
+ }
137
+
138
+ .open .trigger {
139
+ background-color: transparent;
140
+ color: var(--color-on-surface);
141
+ }
142
+
143
+ .panel,
144
+ .panel.has-feature {
145
+ position: static;
146
+ display: block;
147
+ inline-size: auto;
148
+ max-inline-size: none;
149
+ margin: 0;
150
+ padding: 0;
151
+ border: none;
152
+ border-radius: 0;
153
+ background: none;
154
+ box-shadow: none;
155
+
156
+ &[hidden] {
157
+ display: none;
158
+ }
159
+ }
160
+
161
+ .content {
162
+ display: flex;
163
+ flex-direction: column;
164
+ gap: var(--spacing-025);
165
+ }
166
+
167
+ .feature {
168
+ display: none;
169
+ }
170
+ }
171
+
172
+ @media (prefers-reduced-motion: reduce) {
173
+ .chevron {
174
+ transition: none;
175
+ }
176
+ }
177
+
178
+ @media (forced-colors: active) {
179
+ .panel {
180
+ border-color: CanvasText;
181
+ }
182
+ }