@sankhyatronics/sankhya-cms 0.1.18 → 0.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 (216) hide show
  1. package/custom-elements.json +11634 -3153
  2. package/dist/attention-panel/index.js +2 -2
  3. package/dist/bar-chart/index.js +2 -2
  4. package/dist/bento-grid/index.d.ts +33 -1
  5. package/dist/bento-grid/index.js +4 -3
  6. package/dist/booking/index.d.ts +309 -0
  7. package/dist/booking/index.js +20 -0
  8. package/dist/booking/index.js.map +1 -0
  9. package/dist/card/index.d.ts +3 -4
  10. package/dist/card/index.js +2 -2
  11. package/dist/carousel/index.d.ts +20 -6
  12. package/dist/carousel/index.js +3 -3
  13. package/dist/chip/index.js +2 -2
  14. package/dist/{chunk-JQY2G4QK.js → chunk-2GTR37PU.js} +2 -2
  15. package/dist/chunk-2GTR37PU.js.map +1 -0
  16. package/dist/{chunk-FLY7TNRT.js → chunk-2HMOX253.js} +128 -25
  17. package/dist/chunk-2HMOX253.js.map +1 -0
  18. package/dist/{chunk-DH53HZPB.js → chunk-37KFBKPD.js} +32 -4
  19. package/dist/chunk-37KFBKPD.js.map +1 -0
  20. package/dist/{chunk-ALI26WOB.js → chunk-4XPKKYVZ.js} +54 -15
  21. package/dist/chunk-4XPKKYVZ.js.map +1 -0
  22. package/dist/chunk-535QAZ6A.js +236 -0
  23. package/dist/chunk-535QAZ6A.js.map +1 -0
  24. package/dist/{chunk-AKJQ345O.js → chunk-5AWGZQWU.js} +2 -2
  25. package/dist/chunk-6OZKZG5J.js +300 -0
  26. package/dist/chunk-6OZKZG5J.js.map +1 -0
  27. package/dist/chunk-AYNT7G3J.js +805 -0
  28. package/dist/chunk-AYNT7G3J.js.map +1 -0
  29. package/dist/chunk-BEWX3E6P.js +32 -0
  30. package/dist/chunk-BEWX3E6P.js.map +1 -0
  31. package/dist/chunk-CZUGPKXV.js +275 -0
  32. package/dist/chunk-CZUGPKXV.js.map +1 -0
  33. package/dist/{chunk-LEXZKGQX.js → chunk-DJFWZOZM.js} +107 -11
  34. package/dist/chunk-DJFWZOZM.js.map +1 -0
  35. package/dist/chunk-DPANTC3O.js +1714 -0
  36. package/dist/chunk-DPANTC3O.js.map +1 -0
  37. package/dist/chunk-EKZFFY45.js +426 -0
  38. package/dist/chunk-EKZFFY45.js.map +1 -0
  39. package/dist/chunk-ER7MCPDV.js +7 -0
  40. package/dist/chunk-ER7MCPDV.js.map +1 -0
  41. package/dist/chunk-EW2RK5Y6.js +383 -0
  42. package/dist/chunk-EW2RK5Y6.js.map +1 -0
  43. package/dist/{chunk-BLQV2YMO.js → chunk-EZOKT7NJ.js} +2 -2
  44. package/dist/chunk-FF2LWEF3.js +386 -0
  45. package/dist/chunk-FF2LWEF3.js.map +1 -0
  46. package/dist/chunk-FOUK3NHR.js +7 -0
  47. package/dist/chunk-FOUK3NHR.js.map +1 -0
  48. package/dist/chunk-GB4NGCZI.js +181 -0
  49. package/dist/chunk-GB4NGCZI.js.map +1 -0
  50. package/dist/{chunk-7NLZND6Q.js → chunk-GOFSMD6W.js} +35 -11
  51. package/dist/chunk-GOFSMD6W.js.map +1 -0
  52. package/dist/{chunk-6D6ROU7X.js → chunk-IGMVF3KK.js} +2 -2
  53. package/dist/{chunk-INMSEYT6.js → chunk-IVPVYVWG.js} +2 -2
  54. package/dist/chunk-JURCF4OD.js +381 -0
  55. package/dist/chunk-JURCF4OD.js.map +1 -0
  56. package/dist/{chunk-FZ36KL73.js → chunk-KZ7PMFWS.js} +11 -1
  57. package/dist/chunk-KZ7PMFWS.js.map +1 -0
  58. package/dist/{chunk-EMCQBT3S.js → chunk-LO6TZBGD.js} +129 -35
  59. package/dist/chunk-LO6TZBGD.js.map +1 -0
  60. package/dist/chunk-MFRGAT6D.js +860 -0
  61. package/dist/chunk-MFRGAT6D.js.map +1 -0
  62. package/dist/chunk-MIBVQXRU.js +1098 -0
  63. package/dist/chunk-MIBVQXRU.js.map +1 -0
  64. package/dist/{chunk-35TX3AOA.js → chunk-NABSRUXG.js} +2 -2
  65. package/dist/{chunk-R5G6KFTJ.js → chunk-NXKDZWS7.js} +44 -6
  66. package/dist/chunk-NXKDZWS7.js.map +1 -0
  67. package/dist/{chunk-KMU6ABQF.js → chunk-NXUS2CH7.js} +14 -1
  68. package/dist/chunk-NXUS2CH7.js.map +1 -0
  69. package/dist/{chunk-GJO3RGOB.js → chunk-OCPGOLVF.js} +56 -11
  70. package/dist/chunk-OCPGOLVF.js.map +1 -0
  71. package/dist/chunk-OEOE6IFY.js +628 -0
  72. package/dist/chunk-OEOE6IFY.js.map +1 -0
  73. package/dist/{chunk-SMLR736E.js → chunk-PV6OCXXN.js} +2 -2
  74. package/dist/chunk-PV6OCXXN.js.map +1 -0
  75. package/dist/chunk-Q66CJO3P.js +534 -0
  76. package/dist/chunk-Q66CJO3P.js.map +1 -0
  77. package/dist/{chunk-MG2VTZA4.js → chunk-QS3ANOWN.js} +2 -2
  78. package/dist/{chunk-ZN4LIKVG.js → chunk-QSJ543V2.js} +2 -2
  79. package/dist/chunk-QSJ543V2.js.map +1 -0
  80. package/dist/{chunk-FML6AG2V.js → chunk-RANC3OI6.js} +2 -2
  81. package/dist/chunk-T4BIN37Q.js +32 -0
  82. package/dist/chunk-T4BIN37Q.js.map +1 -0
  83. package/dist/{chunk-YVTFQHVY.js → chunk-TEAZZPDQ.js} +2 -2
  84. package/dist/chunk-TJK55CJ2.js +49 -0
  85. package/dist/chunk-TJK55CJ2.js.map +1 -0
  86. package/dist/chunk-UKIVLF7S.js +32 -0
  87. package/dist/chunk-UKIVLF7S.js.map +1 -0
  88. package/dist/chunk-V4R7PYP5.js +905 -0
  89. package/dist/chunk-V4R7PYP5.js.map +1 -0
  90. package/dist/{chunk-AG2COC64.js → chunk-VVYQ2DDS.js} +2 -2
  91. package/dist/chunk-WAMOAAMN.js +16 -0
  92. package/dist/chunk-WAMOAAMN.js.map +1 -0
  93. package/dist/chunk-WAYHHL4J.js +1234 -0
  94. package/dist/chunk-WAYHHL4J.js.map +1 -0
  95. package/dist/{chunk-YQ42EBK5.js → chunk-WH6HE6SY.js} +10 -4
  96. package/dist/chunk-WH6HE6SY.js.map +1 -0
  97. package/dist/chunk-XP6DI3VY.js +180 -0
  98. package/dist/chunk-XP6DI3VY.js.map +1 -0
  99. package/dist/{chunk-5EBWMPJS.js → chunk-XS6LNTSH.js} +76 -14
  100. package/dist/chunk-XS6LNTSH.js.map +1 -0
  101. package/dist/{chunk-WT4OATGP.js → chunk-ZKFCDVB4.js} +16 -7
  102. package/dist/chunk-ZKFCDVB4.js.map +1 -0
  103. package/dist/cms-theme.css +29 -0
  104. package/dist/contact-form/index.d.ts +220 -0
  105. package/dist/contact-form/index.js +16 -0
  106. package/dist/contact-form/index.js.map +1 -0
  107. package/dist/content-block/index.d.ts +39 -4
  108. package/dist/content-block/index.js +8 -4
  109. package/dist/cookie-consent/index.d.ts +60 -12
  110. package/dist/cookie-consent/index.js +3 -2
  111. package/dist/date-tile/index.js +2 -2
  112. package/dist/dropdown/index.d.ts +29 -11
  113. package/dist/dropdown/index.js +4 -2
  114. package/dist/feature-split/index.d.ts +6 -1
  115. package/dist/feature-split/index.js +5 -4
  116. package/dist/features-section/index.d.ts +53 -9
  117. package/dist/features-section/index.js +6 -5
  118. package/dist/flow/index.d.ts +35 -0
  119. package/dist/flow/index.js +9 -0
  120. package/dist/flow/index.js.map +1 -0
  121. package/dist/footer/index.d.ts +13 -0
  122. package/dist/footer/index.js +2 -2
  123. package/dist/header/index.d.ts +135 -16
  124. package/dist/header/index.js +3 -2
  125. package/dist/hero/index.d.ts +92 -8
  126. package/dist/hero/index.js +6 -3
  127. package/dist/icon-button/index.d.ts +7 -7
  128. package/dist/icon-button/index.js +2 -2
  129. package/dist/index.d.ts +12 -3
  130. package/dist/index.js +121 -47
  131. package/dist/items-accordion/index.d.ts +9 -0
  132. package/dist/items-accordion/index.js +4 -3
  133. package/dist/kpi-card/index.js +2 -2
  134. package/dist/markdown/index.d.ts +19 -2
  135. package/dist/markdown/index.js +3 -2
  136. package/dist/mega-menu/index.d.ts +95 -7
  137. package/dist/mega-menu/index.js +7 -2
  138. package/dist/menu-grid/index.d.ts +2 -3
  139. package/dist/menu-grid/index.js +2 -2
  140. package/dist/menu-grid-item/index.d.ts +6 -8
  141. package/dist/menu-grid-item/index.js +2 -2
  142. package/dist/menu-item/index.d.ts +11 -7
  143. package/dist/menu-item/index.js +3 -2
  144. package/dist/plan-cards/index.d.ts +69 -0
  145. package/dist/plan-cards/index.js +13 -0
  146. package/dist/plan-cards/index.js.map +1 -0
  147. package/dist/product-nav/index.d.ts +127 -0
  148. package/dist/product-nav/index.js +11 -0
  149. package/dist/product-nav/index.js.map +1 -0
  150. package/dist/promo-banner/index.d.ts +42 -4
  151. package/dist/promo-banner/index.js +6 -3
  152. package/dist/quote-dialog/index.d.ts +174 -0
  153. package/dist/quote-dialog/index.js +22 -0
  154. package/dist/quote-dialog/index.js.map +1 -0
  155. package/dist/schema/index.d.ts +11 -0
  156. package/dist/schema/index.js +9 -0
  157. package/dist/schema/index.js.map +1 -1
  158. package/dist/screenshot-tour/index.d.ts +54 -0
  159. package/dist/screenshot-tour/index.js +9 -0
  160. package/dist/screenshot-tour/index.js.map +1 -0
  161. package/dist/section/index.d.ts +3 -0
  162. package/dist/section/index.js +3 -3
  163. package/dist/segmented-control/index.js +2 -2
  164. package/dist/select/index.js +2 -2
  165. package/dist/shared/styles.d.ts +7 -1
  166. package/dist/shared/styles.js +3 -1
  167. package/dist/stats/index.js +2 -2
  168. package/dist/steps/index.d.ts +45 -0
  169. package/dist/steps/index.js +11 -0
  170. package/dist/steps/index.js.map +1 -0
  171. package/dist/tag-strip/index.d.ts +33 -0
  172. package/dist/tag-strip/index.js +9 -0
  173. package/dist/tag-strip/index.js.map +1 -0
  174. package/dist/testimonials/index.d.ts +9 -1
  175. package/dist/testimonials/index.js +3 -3
  176. package/dist/tooltip/index.js +2 -2
  177. package/package.json +38 -2
  178. package/dist/chunk-5EBWMPJS.js.map +0 -1
  179. package/dist/chunk-76AVBQUA.js +0 -252
  180. package/dist/chunk-76AVBQUA.js.map +0 -1
  181. package/dist/chunk-7NLZND6Q.js.map +0 -1
  182. package/dist/chunk-ALI26WOB.js.map +0 -1
  183. package/dist/chunk-BMHMNXIA.js +0 -158
  184. package/dist/chunk-BMHMNXIA.js.map +0 -1
  185. package/dist/chunk-DH53HZPB.js.map +0 -1
  186. package/dist/chunk-EMCQBT3S.js.map +0 -1
  187. package/dist/chunk-FLY7TNRT.js.map +0 -1
  188. package/dist/chunk-FZ36KL73.js.map +0 -1
  189. package/dist/chunk-GJO3RGOB.js.map +0 -1
  190. package/dist/chunk-J6EO4R73.js +0 -633
  191. package/dist/chunk-J6EO4R73.js.map +0 -1
  192. package/dist/chunk-JKBWZLG4.js +0 -348
  193. package/dist/chunk-JKBWZLG4.js.map +0 -1
  194. package/dist/chunk-JQY2G4QK.js.map +0 -1
  195. package/dist/chunk-KMU6ABQF.js.map +0 -1
  196. package/dist/chunk-LEXZKGQX.js.map +0 -1
  197. package/dist/chunk-MSSH3HFK.js +0 -205
  198. package/dist/chunk-MSSH3HFK.js.map +0 -1
  199. package/dist/chunk-R5G6KFTJ.js.map +0 -1
  200. package/dist/chunk-SMLR736E.js.map +0 -1
  201. package/dist/chunk-VWS53WY4.js +0 -157
  202. package/dist/chunk-VWS53WY4.js.map +0 -1
  203. package/dist/chunk-WT4OATGP.js.map +0 -1
  204. package/dist/chunk-XWB4CKDU.js +0 -708
  205. package/dist/chunk-XWB4CKDU.js.map +0 -1
  206. package/dist/chunk-YQ42EBK5.js.map +0 -1
  207. package/dist/chunk-ZN4LIKVG.js.map +0 -1
  208. /package/dist/{chunk-AKJQ345O.js.map → chunk-5AWGZQWU.js.map} +0 -0
  209. /package/dist/{chunk-BLQV2YMO.js.map → chunk-EZOKT7NJ.js.map} +0 -0
  210. /package/dist/{chunk-6D6ROU7X.js.map → chunk-IGMVF3KK.js.map} +0 -0
  211. /package/dist/{chunk-INMSEYT6.js.map → chunk-IVPVYVWG.js.map} +0 -0
  212. /package/dist/{chunk-35TX3AOA.js.map → chunk-NABSRUXG.js.map} +0 -0
  213. /package/dist/{chunk-MG2VTZA4.js.map → chunk-QS3ANOWN.js.map} +0 -0
  214. /package/dist/{chunk-FML6AG2V.js.map → chunk-RANC3OI6.js.map} +0 -0
  215. /package/dist/{chunk-YVTFQHVY.js.map → chunk-TEAZZPDQ.js.map} +0 -0
  216. /package/dist/{chunk-AG2COC64.js.map → chunk-VVYQ2DDS.js.map} +0 -0
@@ -1,708 +0,0 @@
1
- import {
2
- chevronIcon,
3
- closeIcon,
4
- menuIcon
5
- } from "./chunk-WTD2YIAA.js";
6
- import {
7
- BREAKPOINT_TABLET,
8
- buttonResetStyles,
9
- controlBaseStyles,
10
- dropdownPanelStyles,
11
- rootFontFamilyStyles
12
- } from "./chunk-KMU6ABQF.js";
13
- import {
14
- __decorateClass
15
- } from "./chunk-EUXUH3YW.js";
16
-
17
- // src/header/Header.ts
18
- import { LitElement, css, html, nothing } from "lit";
19
- import { customElement, property, state } from "lit/decorators.js";
20
- var Header = class extends LitElement {
21
- constructor() {
22
- super(...arguments);
23
- this.title = "";
24
- this.brandImageUrl = "";
25
- this.altText = "Logo";
26
- this.logoHref = "";
27
- this.logoTarget = "_self";
28
- this.logoClassName = "";
29
- this.inverted = false;
30
- this.sticky = false;
31
- this.transparent = false;
32
- this.hideOnScroll = false;
33
- this.scrollThreshold = 8;
34
- this.scrolled = false;
35
- this.scrollHidden = false;
36
- this.lastScrollY = 0;
37
- this.scrollFrame = 0;
38
- this.onScroll = () => {
39
- if (this.scrollFrame) return;
40
- this.scrollFrame = requestAnimationFrame(() => {
41
- this.scrollFrame = 0;
42
- const y = Math.max(0, window.scrollY);
43
- this.scrolled = y > this.scrollThreshold;
44
- if (this.hideOnScroll) {
45
- const delta = y - this.lastScrollY;
46
- if (Math.abs(delta) > 4) this.scrollHidden = delta > 0 && y > this.offsetHeight && !this.mobileOpen;
47
- } else {
48
- this.scrollHidden = false;
49
- }
50
- this.lastScrollY = y;
51
- });
52
- };
53
- this.languages = [];
54
- this.currentLanguageCode = "";
55
- this.languageMenuLabel = "Language";
56
- this.mobileOpen = false;
57
- this.compact = false;
58
- this.languageMenuOpen = false;
59
- this.hasUtility = false;
60
- this.hasBrandExtra = false;
61
- /** The dropdowns this header switched to `inline` — only these are switched back, so a caller's
62
- * own `inline` setting is left alone. */
63
- this.inlinedDropdowns = /* @__PURE__ */ new Set();
64
- /** While the hamburger layout is on, the dropdowns in the header open in the flow of the
65
- * full-screen panel instead of floating over it (SankhyaUI's touch-device layout). */
66
- this.syncInlineDropdowns = () => {
67
- const collapsed = this.compact || !!this.narrowQuery?.matches;
68
- const dropdowns = Array.from(this.querySelectorAll("st-dropdown"));
69
- if (collapsed) {
70
- for (const dropdown of dropdowns) {
71
- if (dropdown.inline) continue;
72
- dropdown.inline = true;
73
- this.inlinedDropdowns.add(dropdown);
74
- }
75
- } else {
76
- for (const dropdown of this.inlinedDropdowns) dropdown.inline = false;
77
- this.inlinedDropdowns.clear();
78
- }
79
- };
80
- this.onBrandExtraSlotChange = (event) => {
81
- this.hasBrandExtra = event.target.assignedElements({ flatten: true }).length > 0;
82
- this.evaluateFit();
83
- };
84
- this.onUtilitySlotChange = (event) => {
85
- this.hasUtility = event.target.assignedElements({ flatten: true }).length > 0;
86
- this.evaluateFit();
87
- };
88
- this.onMenuSlotChange = () => {
89
- this.evaluateFit();
90
- this.syncInlineDropdowns();
91
- };
92
- /** The bar width at which the menu last overflowed — the bar only expands again once it is
93
- * clearly wider than this, so it can't flip back and forth right at the threshold. */
94
- this.collapsedAtWidth = 0;
95
- /** Collapses to the hamburger layout when the slotted menu overflows its row, and expands again
96
- * once there is room. The collapsed layout hides the menu, so the room it needs can't be
97
- * measured then; the width remembered when it collapsed stands in for it. */
98
- this.evaluateFit = () => {
99
- const width = this.clientWidth;
100
- if (this.compact) {
101
- if (width > this.collapsedAtWidth + 24) {
102
- this.compact = false;
103
- this.mobileOpen = false;
104
- void this.updateComplete.then(this.evaluateFit);
105
- }
106
- return;
107
- }
108
- if (this.menuOverflows()) {
109
- this.collapsedAtWidth = width;
110
- this.compact = true;
111
- }
112
- };
113
- this.closeOnEscape = (event) => {
114
- if (this.mobileOpen && event.key === "Escape") this.mobileOpen = false;
115
- if (this.languageMenuOpen && event.key === "Escape") this.languageMenuOpen = false;
116
- };
117
- this.closeLanguageMenuOnOutsideClick = (event) => {
118
- if (this.languageMenuOpen && !event.composedPath().includes(this)) this.languageMenuOpen = false;
119
- };
120
- }
121
- updated(changed) {
122
- if (changed.has("compact")) this.syncInlineDropdowns();
123
- if (changed.has("mobileOpen") && !this.mobileOpen) {
124
- for (const dropdown of this.inlinedDropdowns) dropdown.open = false;
125
- }
126
- }
127
- /** Whether the visible menu items reach past the right edge of the menu row. Measured from the
128
- * items' own boxes (the slotted elements and their direct children), not the row's scrollWidth:
129
- * a closed dropdown's absolutely positioned panel also counts towards scrollWidth, which would
130
- * report overflow at any width. */
131
- menuOverflows() {
132
- const row = this.renderRoot.querySelector(".menu-row");
133
- const slot = this.renderRoot.querySelector('slot[name="menu"]');
134
- if (!row || !slot) return false;
135
- const limit = row.getBoundingClientRect().right + 1;
136
- let right = 0;
137
- for (const el of slot.assignedElements({ flatten: true })) {
138
- for (const box of [el, ...Array.from(el.children)]) {
139
- const rect = box.getBoundingClientRect();
140
- if (rect.width > 0) right = Math.max(right, rect.right);
141
- }
142
- }
143
- return right > limit;
144
- }
145
- firstUpdated() {
146
- this.resizeObserver = new ResizeObserver(this.evaluateFit);
147
- this.resizeObserver.observe(this);
148
- this.evaluateFit();
149
- this.syncInlineDropdowns();
150
- }
151
- connectedCallback() {
152
- super.connectedCallback();
153
- window.addEventListener("keydown", this.closeOnEscape);
154
- window.addEventListener("click", this.closeLanguageMenuOnOutsideClick);
155
- window.addEventListener("scroll", this.onScroll, { passive: true });
156
- this.onScroll();
157
- this.narrowQuery = window.matchMedia(`(max-width: ${BREAKPOINT_TABLET}px)`);
158
- this.narrowQuery.addEventListener("change", this.syncInlineDropdowns);
159
- this.lightDomObserver = new MutationObserver(this.syncInlineDropdowns);
160
- this.lightDomObserver.observe(this, { childList: true, subtree: true });
161
- }
162
- disconnectedCallback() {
163
- this.lightDomObserver?.disconnect();
164
- this.narrowQuery?.removeEventListener("change", this.syncInlineDropdowns);
165
- this.resizeObserver?.disconnect();
166
- window.removeEventListener("keydown", this.closeOnEscape);
167
- window.removeEventListener("click", this.closeLanguageMenuOnOutsideClick);
168
- window.removeEventListener("scroll", this.onScroll);
169
- if (this.scrollFrame) cancelAnimationFrame(this.scrollFrame);
170
- this.scrollFrame = 0;
171
- super.disconnectedCallback();
172
- }
173
- renderLanguageMenu() {
174
- if (this.languages.length < 2) return nothing;
175
- const current = this.languages.find((lang) => lang.code === this.currentLanguageCode);
176
- return html`
177
- <div class="lang-menu" part="language-menu">
178
- <button
179
- part="language-menu-trigger"
180
- type="button"
181
- class="lang-trigger"
182
- aria-label=${this.languageMenuLabel}
183
- aria-expanded=${this.languageMenuOpen}
184
- @click=${(event) => {
185
- event.stopPropagation();
186
- this.languageMenuOpen = !this.languageMenuOpen;
187
- }}
188
- >
189
- <span part="language-menu-current">${current?.label ?? this.languageMenuLabel}</span>
190
- ${chevronIcon("down", 10)}
191
- </button>
192
- ${this.languageMenuOpen ? html`
193
- <div part="language-dropdown" class="lang-dropdown">
194
- ${this.languages.map(
195
- (lang) => html`
196
- <button
197
- part="language-option"
198
- type="button"
199
- class="lang-option ${lang.code === this.currentLanguageCode ? "active" : ""}"
200
- aria-current=${lang.code === this.currentLanguageCode}
201
- @click=${() => this.onLanguageSelect(lang.code)}
202
- >
203
- ${lang.label}
204
- </button>
205
- `
206
- )}
207
- </div>
208
- ` : nothing}
209
- </div>
210
- `;
211
- }
212
- onLanguageSelect(code) {
213
- this.languageMenuOpen = false;
214
- if (code === this.currentLanguageCode) return;
215
- this.dispatchEvent(new CustomEvent("language-change", { detail: { code }, bubbles: true, composed: true }));
216
- }
217
- renderBrand() {
218
- const content = html`
219
- ${this.brandImageUrl ? html`<img part="brand-mark" class="brand-mark" src=${this.brandImageUrl} alt=${this.altText} /> ` : nothing}
220
- <span part="brand-title" class="brand-title">${this.title}</span>
221
- `;
222
- return this.logoHref ? html`<a part="brand" class="brand ${this.logoClassName}" href=${this.logoHref} target=${this.logoTarget}>${content}</a>` : html`<div part="brand" class="brand ${this.logoClassName}">${content}</div>`;
223
- }
224
- render() {
225
- return html`
226
- ${this.renderBrand()}
227
- <div class="brand-extra ${this.hasBrandExtra ? "" : "empty"}" part="brand-extra"><slot name="brand-extra" @slotchange=${this.onBrandExtraSlotChange}></slot></div>
228
-
229
- <div class="mobile-panel" part="mobile-panel" @click=${() => this.mobileOpen = false}>
230
- <div class="menu-row" part="menu-row"><slot name="menu" @slotchange=${this.onMenuSlotChange}></slot></div>
231
- <div class="utility-row ${this.hasUtility || this.languages.length >= 2 ? "" : "empty"}" part="utility-row">
232
- ${this.renderLanguageMenu()}<slot name="utility" @slotchange=${this.onUtilitySlotChange}></slot>
233
- </div>
234
- </div>
235
-
236
- <button
237
- part="toggle"
238
- type="button"
239
- class="toggle"
240
- aria-label=${this.mobileOpen ? "Close menu" : "Open menu"}
241
- aria-expanded=${this.mobileOpen}
242
- @click=${() => this.mobileOpen = !this.mobileOpen}
243
- >
244
- <slot name="menu-icon" ?hidden=${this.mobileOpen}>${menuIcon()}</slot>
245
- <slot name="close-icon" ?hidden=${!this.mobileOpen}>${closeIcon()}</slot>
246
- </button>
247
- `;
248
- }
249
- };
250
- Header.styles = css`
251
- ${controlBaseStyles}
252
-
253
- :host {
254
- display: flex;
255
- align-items: center;
256
- /* The containing block of an st-dropdown[mega] panel, which spans the bar. */
257
- position: relative;
258
- /* Spacing between brand, menu and utility controls is the rows' own margins (SankhyaUI's
259
- layout), not a flex gap. */
260
- gap: 0;
261
- /* !important on the box-model properties only: a shadow host's own :host rule always loses
262
- * to ANY rule the consuming page has for the same property on that element, regardless of
263
- * specificity (see st-footer's own padding/border-top for the same fix). Without
264
- * box-sizing: border-box pinned here, a page that also sets its own padding on this host
265
- * (e.g. a p-2 utility class) adds that padding on TOP of the fixed 64px height instead of
266
- * being absorbed inside it — which is exactly what happens in Template Hub, the one app that
267
- * doesn't load Tailwind Preflight (Preflight's own box-sizing: border-box reset is what
268
- * silently keeps every other app's header at the intended 64px). */
269
- box-sizing: border-box !important;
270
- padding: 0 2rem !important;
271
- height: 64px !important;
272
- background: var(--st-color-surface);
273
- border-bottom: 1px solid var(--st-color-border) !important;
274
- ${rootFontFamilyStyles}
275
- color: var(--st-color-text-strong);
276
- }
277
-
278
- :host([sticky]) {
279
- position: sticky;
280
- top: 0;
281
- z-index: 100;
282
- }
283
-
284
- /* Toggle icons: a host's slotted icon, else the built-in glyph; only the current state's shows. */
285
- .toggle slot {
286
- display: contents;
287
- }
288
-
289
- .toggle slot[hidden] {
290
- display: none;
291
- }
292
-
293
- .toggle ::slotted(*) {
294
- flex: none;
295
- width: var(--st-header-toggle-icon-size, 20px);
296
- height: var(--st-header-toggle-icon-size, 20px);
297
- }
298
-
299
- :host([inverted]) {
300
- background: var(--st-color-text-strong);
301
- color: var(--st-color-on-solid);
302
- border-bottom-color: transparent;
303
- }
304
-
305
- :host([sticky]),
306
- :host([transparent]),
307
- :host([hide-on-scroll]) {
308
- transition:
309
- background-color 0.3s ease,
310
- color 0.3s ease,
311
- box-shadow 0.3s ease,
312
- border-color 0.3s ease,
313
- transform 0.3s ease;
314
- }
315
-
316
- /* Once the page has scrolled, a sticky/fixed header lifts off the content. */
317
- :host([scrolled][sticky]),
318
- :host([scrolled][transparent]),
319
- :host([scrolled][hide-on-scroll]) {
320
- box-shadow: 0 4px 16px var(--st-shadow-color-md);
321
- border-bottom-color: transparent !important;
322
- }
323
-
324
- /* transparent: fixed over the top of the page (e.g. a dark hero), see-through until scrolled. */
325
- :host([transparent]) {
326
- position: fixed;
327
- top: 0;
328
- left: 0;
329
- right: 0;
330
- z-index: 100;
331
- }
332
-
333
- :host([transparent]:not([scrolled]):not([mobile-open])) {
334
- background: transparent;
335
- border-bottom-color: transparent !important;
336
- color: var(--st-header-transparent-color, var(--st-color-on-solid));
337
- /* Read by st-menu-item / st-dropdown triggers in the bar (their panels reset them). */
338
- --st-nav-color: var(--st-header-transparent-color, var(--st-color-on-solid));
339
- --st-nav-hover-bg: color-mix(in oklch, currentColor 14%, transparent);
340
- }
341
-
342
- :host([transparent]:not([scrolled]):not([mobile-open])) .utility-row {
343
- border-left-color: color-mix(in oklch, currentColor 35%, transparent);
344
- }
345
-
346
- :host([transparent]:not([scrolled]):not([mobile-open])) .lang-trigger {
347
- color: inherit;
348
- }
349
-
350
- :host([transparent]:not([scrolled]):not([mobile-open])) .lang-trigger:hover,
351
- :host([transparent]:not([scrolled]):not([mobile-open])) .toggle:hover {
352
- background: color-mix(in oklch, currentColor 14%, transparent);
353
- }
354
-
355
- /* hide-on-scroll: slides away while scrolling down, back as soon as the user scrolls up. */
356
- :host([hide-on-scroll]:not([sticky]):not([transparent])) {
357
- position: sticky;
358
- top: 0;
359
- z-index: 100;
360
- }
361
-
362
- :host([scroll-hidden]:not([mobile-open])) {
363
- transform: translateY(-100%);
364
- box-shadow: none;
365
- }
366
-
367
- .brand {
368
- display: flex;
369
- align-items: center;
370
- gap: var(--st-space-10);
371
- flex: none;
372
- text-decoration: none;
373
- color: inherit;
374
- }
375
-
376
- .brand-mark {
377
- width: var(--st-size-28);
378
- height: var(--st-size-28);
379
- border-radius: var(--st-radius-sm);
380
- flex: none;
381
- object-fit: contain;
382
- }
383
-
384
- .brand-title {
385
- font-size: var(--st-text-xl);
386
- font-weight: var(--st-font-weight-bold);
387
- letter-spacing: var(--st-tracking-tight);
388
- white-space: nowrap;
389
- }
390
-
391
- /* Optional slot="brand-extra" (e.g. an edition badge) right after the brand. Outside the
392
- mobile panel, so it stays beside the logo at every width; no box at all when empty. */
393
- .brand-extra {
394
- display: flex;
395
- align-items: center;
396
- gap: var(--st-space-8);
397
- flex: none;
398
- margin-left: var(--st-space-10);
399
- white-space: nowrap;
400
- }
401
-
402
- .brand-extra.empty {
403
- display: none;
404
- }
405
-
406
- /* Desktop: a transparent pass-through so .menu-row/.utility-row lay out directly as :host's
407
- own flex children. Mobile (see below) turns this into the actual overlay box. */
408
- .mobile-panel {
409
- display: contents;
410
- }
411
-
412
- /* Desktop layout from SankhyaUI's Header: the menu starts 4rem after the brand and takes the
413
- free width; the utility controls sit after a vertical divider. Between 901px and 1200px the
414
- gaps tighten so the menu still fits down to the 900px hamburger breakpoint. */
415
- .menu-row {
416
- flex: 1;
417
- display: flex;
418
- align-items: center;
419
- gap: 1.5rem;
420
- min-width: 0;
421
- margin-left: 4rem;
422
- }
423
-
424
- .utility-row {
425
- flex: none;
426
- display: flex;
427
- align-items: center;
428
- gap: 1rem;
429
- margin-left: 1.5rem;
430
- padding-left: 1.5rem;
431
- border-left: 1px solid var(--st-color-border);
432
- }
433
-
434
- :host([inverted]) .utility-row {
435
- border-left-color: currentColor;
436
- }
437
-
438
- .utility-row.empty {
439
- display: none;
440
- }
441
-
442
- @media (max-width: 1200px) {
443
- :host {
444
- padding: 0 1rem !important;
445
- }
446
-
447
- .menu-row {
448
- margin-left: 0.5rem;
449
- }
450
-
451
- .utility-row {
452
- margin-left: 0.5rem;
453
- padding-left: 0.5rem;
454
- }
455
- }
456
-
457
- @keyframes st-header-fade-in {
458
- from {
459
- opacity: 0;
460
- }
461
- to {
462
- opacity: 1;
463
- }
464
- }
465
-
466
- .toggle {
467
- display: none;
468
- align-items: center;
469
- justify-content: center;
470
- flex: none;
471
- position: relative;
472
- z-index: 1002;
473
- width: var(--st-size-32);
474
- height: var(--st-size-32);
475
- margin-left: auto;
476
- padding: 0.5rem;
477
- border: 0;
478
- border-radius: var(--st-radius-sm);
479
- background: transparent;
480
- color: inherit;
481
- cursor: pointer;
482
- }
483
-
484
- .toggle:hover {
485
- background: var(--st-color-hover);
486
- }
487
-
488
- .lang-menu {
489
- position: relative;
490
- flex: none;
491
- }
492
-
493
- .lang-trigger {
494
- ${buttonResetStyles}
495
- display: flex;
496
- align-items: center;
497
- gap: var(--st-space-4);
498
- height: var(--st-size-32);
499
- padding: 0 var(--st-space-8);
500
- border-radius: var(--st-radius-sm);
501
- font-size: var(--st-text-base);
502
- font-weight: var(--st-font-weight-semibold);
503
- color: var(--st-color-text-muted);
504
- }
505
-
506
- .lang-trigger:hover {
507
- background: var(--st-color-hover);
508
- color: var(--st-color-text-strong);
509
- }
510
-
511
- .lang-dropdown {
512
- ${dropdownPanelStyles}
513
- min-width: 140px;
514
- }
515
-
516
- .lang-option {
517
- ${buttonResetStyles}
518
- display: block;
519
- width: 100%;
520
- padding: var(--st-space-10) var(--st-space-14);
521
- font-size: var(--st-text-base);
522
- font-weight: var(--st-font-weight-semibold);
523
- text-align: left;
524
- color: inherit;
525
- }
526
-
527
- .lang-option:hover {
528
- background: var(--st-color-hover);
529
- }
530
-
531
- .lang-option.active {
532
- color: var(--st-color-accent-text);
533
- }
534
-
535
- /* Hamburger layout from SankhyaUI's Header: a full-screen layer under the toggle, menu above
536
- the utility controls, the menu's dropdowns opening in the flow (see syncInlineDropdowns). */
537
- @media (max-width: ${BREAKPOINT_TABLET}px) {
538
- :host {
539
- padding: 0 1rem !important;
540
- }
541
-
542
- .mobile-panel {
543
- display: none;
544
- }
545
-
546
- .toggle {
547
- display: inline-flex;
548
- }
549
-
550
- :host([mobile-open]) .mobile-panel {
551
- display: flex;
552
- flex-direction: column;
553
- gap: 2rem;
554
- position: fixed;
555
- inset: 0;
556
- background: var(--st-color-surface);
557
- padding: 5rem 1.5rem 2rem;
558
- overflow-y: auto;
559
- z-index: 1001;
560
- animation: st-header-fade-in 0.3s ease;
561
- }
562
-
563
- :host([mobile-open]) .menu-row,
564
- :host([mobile-open]) .utility-row {
565
- flex-direction: column;
566
- align-items: stretch;
567
- gap: 1.5rem;
568
- margin-left: 0;
569
- }
570
-
571
- :host([mobile-open]) .utility-row {
572
- padding: 1.5rem 0 0;
573
- border-left: 0;
574
- border-top: 1px solid var(--st-color-border);
575
- }
576
-
577
- /* Apps usually slot one flex-row wrapper per slot; stack its items as the source does. */
578
- :host([mobile-open]) ::slotted([slot='menu']),
579
- :host([mobile-open]) ::slotted([slot='utility']) {
580
- flex-direction: column !important;
581
- align-items: stretch !important;
582
- margin: 0 !important;
583
- }
584
- }
585
-
586
- /* The same collapsed layout, switched on by script when the menu no longer fits the bar at
587
- desktop width (see evaluateFit) — without it the menu spills over the utility controls. */
588
- :host([compact]) .mobile-panel {
589
- display: none;
590
- }
591
-
592
- :host([compact]) .toggle {
593
- display: inline-flex;
594
- }
595
-
596
- :host([compact][mobile-open]) .mobile-panel {
597
- display: flex;
598
- flex-direction: column;
599
- gap: 2rem;
600
- position: fixed;
601
- inset: 0;
602
- background: var(--st-color-surface);
603
- padding: 5rem 1.5rem 2rem;
604
- overflow-y: auto;
605
- z-index: 1001;
606
- animation: st-header-fade-in 0.3s ease;
607
- }
608
-
609
- :host([compact][mobile-open]) .menu-row,
610
- :host([compact][mobile-open]) .utility-row {
611
- flex-direction: column;
612
- align-items: stretch;
613
- gap: 1.5rem;
614
- margin-left: 0;
615
- }
616
-
617
- :host([compact][mobile-open]) .utility-row {
618
- padding: 1.5rem 0 0;
619
- border-left: 0;
620
- border-top: 1px solid var(--st-color-border);
621
- }
622
-
623
- :host([compact][mobile-open]) ::slotted([slot='menu']),
624
- :host([compact][mobile-open]) ::slotted([slot='utility']) {
625
- flex-direction: column !important;
626
- align-items: stretch !important;
627
- margin: 0 !important;
628
- }
629
-
630
- @media (prefers-reduced-motion: reduce) {
631
- :host,
632
- .mobile-panel {
633
- animation: none !important;
634
- transition: none !important;
635
- }
636
- }
637
- `;
638
- __decorateClass([
639
- property({ type: String })
640
- ], Header.prototype, "title", 2);
641
- __decorateClass([
642
- property({ type: String, attribute: "brand-image-url" })
643
- ], Header.prototype, "brandImageUrl", 2);
644
- __decorateClass([
645
- property({ type: String, attribute: "alt-text" })
646
- ], Header.prototype, "altText", 2);
647
- __decorateClass([
648
- property({ type: String })
649
- ], Header.prototype, "logoHref", 2);
650
- __decorateClass([
651
- property({ type: String, attribute: "logo-target" })
652
- ], Header.prototype, "logoTarget", 2);
653
- __decorateClass([
654
- property({ type: String, attribute: "logo-class-name" })
655
- ], Header.prototype, "logoClassName", 2);
656
- __decorateClass([
657
- property({ type: Boolean, reflect: true })
658
- ], Header.prototype, "inverted", 2);
659
- __decorateClass([
660
- property({ type: Boolean, reflect: true })
661
- ], Header.prototype, "sticky", 2);
662
- __decorateClass([
663
- property({ type: Boolean, reflect: true })
664
- ], Header.prototype, "transparent", 2);
665
- __decorateClass([
666
- property({ type: Boolean, reflect: true, attribute: "hide-on-scroll" })
667
- ], Header.prototype, "hideOnScroll", 2);
668
- __decorateClass([
669
- property({ type: Number, attribute: "scroll-threshold" })
670
- ], Header.prototype, "scrollThreshold", 2);
671
- __decorateClass([
672
- property({ type: Boolean, reflect: true })
673
- ], Header.prototype, "scrolled", 2);
674
- __decorateClass([
675
- property({ type: Boolean, reflect: true, attribute: "scroll-hidden" })
676
- ], Header.prototype, "scrollHidden", 2);
677
- __decorateClass([
678
- property({ attribute: false })
679
- ], Header.prototype, "languages", 2);
680
- __decorateClass([
681
- property({ type: String, attribute: "current-language-code" })
682
- ], Header.prototype, "currentLanguageCode", 2);
683
- __decorateClass([
684
- property({ type: String, attribute: "language-menu-label" })
685
- ], Header.prototype, "languageMenuLabel", 2);
686
- __decorateClass([
687
- property({ type: Boolean, reflect: true, attribute: "mobile-open" })
688
- ], Header.prototype, "mobileOpen", 2);
689
- __decorateClass([
690
- property({ type: Boolean, reflect: true })
691
- ], Header.prototype, "compact", 2);
692
- __decorateClass([
693
- state()
694
- ], Header.prototype, "languageMenuOpen", 2);
695
- __decorateClass([
696
- state()
697
- ], Header.prototype, "hasUtility", 2);
698
- __decorateClass([
699
- state()
700
- ], Header.prototype, "hasBrandExtra", 2);
701
- Header = __decorateClass([
702
- customElement("st-header")
703
- ], Header);
704
-
705
- export {
706
- Header
707
- };
708
- //# sourceMappingURL=chunk-XWB4CKDU.js.map