@phcdevworks/spectre-components 1.19.0 → 1.21.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 (352) hide show
  1. package/README.md +770 -125
  2. package/dist/accordion-item.cjs +540 -0
  3. package/dist/accordion-item.cjs.map +1 -0
  4. package/dist/accordion-item.d.cts +59 -0
  5. package/dist/accordion-item.d.ts +59 -0
  6. package/dist/accordion-item.js +537 -0
  7. package/dist/accordion-item.js.map +1 -0
  8. package/dist/accordion.cjs +468 -0
  9. package/dist/accordion.cjs.map +1 -0
  10. package/dist/accordion.d.cts +38 -0
  11. package/dist/accordion.d.ts +38 -0
  12. package/dist/accordion.js +465 -0
  13. package/dist/accordion.js.map +1 -0
  14. package/dist/alert.cjs +166 -65
  15. package/dist/alert.cjs.map +1 -1
  16. package/dist/alert.d.cts +41 -8
  17. package/dist/alert.d.ts +41 -8
  18. package/dist/alert.js +168 -67
  19. package/dist/alert.js.map +1 -1
  20. package/dist/avatar.cjs +27 -1
  21. package/dist/avatar.cjs.map +1 -1
  22. package/dist/avatar.d.cts +19 -3
  23. package/dist/avatar.d.ts +19 -3
  24. package/dist/avatar.js +27 -1
  25. package/dist/avatar.js.map +1 -1
  26. package/dist/badge.cjs +83 -3
  27. package/dist/badge.cjs.map +1 -1
  28. package/dist/badge.d.cts +51 -3
  29. package/dist/badge.d.ts +51 -3
  30. package/dist/badge.js +83 -3
  31. package/dist/badge.js.map +1 -1
  32. package/dist/breadcrumb.cjs +464 -0
  33. package/dist/breadcrumb.cjs.map +1 -0
  34. package/dist/breadcrumb.d.cts +32 -0
  35. package/dist/breadcrumb.d.ts +32 -0
  36. package/dist/breadcrumb.js +461 -0
  37. package/dist/breadcrumb.js.map +1 -0
  38. package/dist/button.cjs +32 -2
  39. package/dist/button.cjs.map +1 -1
  40. package/dist/button.d.cts +19 -3
  41. package/dist/button.d.ts +19 -3
  42. package/dist/button.js +32 -2
  43. package/dist/button.js.map +1 -1
  44. package/dist/card-bleed.cjs +458 -0
  45. package/dist/card-bleed.cjs.map +1 -0
  46. package/dist/card-bleed.d.cts +37 -0
  47. package/dist/card-bleed.d.ts +37 -0
  48. package/dist/card-bleed.js +455 -0
  49. package/dist/card-bleed.js.map +1 -0
  50. package/dist/card.cjs +61 -1
  51. package/dist/card.cjs.map +1 -1
  52. package/dist/card.d.cts +33 -4
  53. package/dist/card.d.ts +33 -4
  54. package/dist/card.js +60 -2
  55. package/dist/card.js.map +1 -1
  56. package/dist/carousel.cjs +655 -0
  57. package/dist/carousel.cjs.map +1 -0
  58. package/dist/carousel.d.cts +79 -0
  59. package/dist/carousel.d.ts +79 -0
  60. package/dist/carousel.js +652 -0
  61. package/dist/carousel.js.map +1 -0
  62. package/dist/checkbox.cjs +3 -1
  63. package/dist/checkbox.cjs.map +1 -1
  64. package/dist/checkbox.js +3 -1
  65. package/dist/checkbox.js.map +1 -1
  66. package/dist/choice-card.cjs +524 -0
  67. package/dist/choice-card.cjs.map +1 -0
  68. package/dist/choice-card.d.cts +81 -0
  69. package/dist/choice-card.d.ts +81 -0
  70. package/dist/choice-card.js +521 -0
  71. package/dist/choice-card.js.map +1 -0
  72. package/dist/container.cjs +23 -6
  73. package/dist/container.cjs.map +1 -1
  74. package/dist/container.d.cts +9 -3
  75. package/dist/container.d.ts +9 -3
  76. package/dist/container.js +23 -7
  77. package/dist/container.js.map +1 -1
  78. package/dist/datepicker.cjs +580 -0
  79. package/dist/datepicker.cjs.map +1 -0
  80. package/dist/datepicker.d.cts +78 -0
  81. package/dist/datepicker.d.ts +78 -0
  82. package/dist/datepicker.js +577 -0
  83. package/dist/datepicker.js.map +1 -0
  84. package/dist/dom-CX9bgbcQ.d.cts +3 -0
  85. package/dist/dom-CX9bgbcQ.d.ts +3 -0
  86. package/dist/dropdown.cjs +66 -3
  87. package/dist/dropdown.cjs.map +1 -1
  88. package/dist/dropdown.d.cts +22 -2
  89. package/dist/dropdown.d.ts +22 -2
  90. package/dist/dropdown.js +67 -4
  91. package/dist/dropdown.js.map +1 -1
  92. package/dist/external-auth-button.cjs +494 -0
  93. package/dist/external-auth-button.cjs.map +1 -0
  94. package/dist/external-auth-button.d.cts +71 -0
  95. package/dist/external-auth-button.d.ts +71 -0
  96. package/dist/external-auth-button.js +491 -0
  97. package/dist/external-auth-button.js.map +1 -0
  98. package/dist/fieldset.cjs +3 -1
  99. package/dist/fieldset.cjs.map +1 -1
  100. package/dist/fieldset.js +3 -1
  101. package/dist/fieldset.js.map +1 -1
  102. package/dist/file-input.cjs +371 -0
  103. package/dist/file-input.cjs.map +1 -0
  104. package/dist/file-input.d.cts +96 -0
  105. package/dist/file-input.d.ts +96 -0
  106. package/dist/file-input.js +367 -0
  107. package/dist/file-input.js.map +1 -0
  108. package/dist/footer-chip.cjs +22 -2
  109. package/dist/footer-chip.cjs.map +1 -1
  110. package/dist/footer-chip.d.cts +12 -1
  111. package/dist/footer-chip.d.ts +12 -1
  112. package/dist/footer-chip.js +22 -2
  113. package/dist/footer-chip.js.map +1 -1
  114. package/dist/footer-link.cjs +19 -1
  115. package/dist/footer-link.cjs.map +1 -1
  116. package/dist/footer-link.d.cts +12 -1
  117. package/dist/footer-link.d.ts +12 -1
  118. package/dist/footer-link.js +19 -1
  119. package/dist/footer-link.js.map +1 -1
  120. package/dist/footer.cjs +62 -1
  121. package/dist/footer.cjs.map +1 -1
  122. package/dist/footer.d.cts +15 -0
  123. package/dist/footer.d.ts +15 -0
  124. package/dist/footer.js +63 -2
  125. package/dist/footer.js.map +1 -1
  126. package/dist/{form-TvtLcoW0.d.cts → form-CVO7mlDa.d.cts} +42 -9
  127. package/dist/{form-TvtLcoW0.d.ts → form-CVO7mlDa.d.ts} +42 -9
  128. package/dist/grid.cjs +35 -1
  129. package/dist/grid.cjs.map +1 -1
  130. package/dist/grid.d.cts +9 -3
  131. package/dist/grid.d.ts +9 -3
  132. package/dist/grid.js +35 -2
  133. package/dist/grid.js.map +1 -1
  134. package/dist/icon-box.cjs +27 -1
  135. package/dist/icon-box.cjs.map +1 -1
  136. package/dist/icon-box.d.cts +19 -3
  137. package/dist/icon-box.d.ts +19 -3
  138. package/dist/icon-box.js +27 -1
  139. package/dist/icon-box.js.map +1 -1
  140. package/dist/index.cjs +3849 -109
  141. package/dist/index.cjs.map +1 -1
  142. package/dist/index.d.cts +26 -1
  143. package/dist/index.d.ts +26 -1
  144. package/dist/index.js +3787 -112
  145. package/dist/index.js.map +1 -1
  146. package/dist/input-group.cjs +471 -0
  147. package/dist/input-group.cjs.map +1 -0
  148. package/dist/input-group.d.cts +31 -0
  149. package/dist/input-group.d.ts +31 -0
  150. package/dist/input-group.js +468 -0
  151. package/dist/input-group.js.map +1 -0
  152. package/dist/input.cjs +96 -4
  153. package/dist/input.cjs.map +1 -1
  154. package/dist/input.d.cts +45 -6
  155. package/dist/input.d.ts +45 -6
  156. package/dist/input.js +98 -6
  157. package/dist/input.js.map +1 -1
  158. package/dist/label.cjs +3 -1
  159. package/dist/label.cjs.map +1 -1
  160. package/dist/label.js +3 -1
  161. package/dist/label.js.map +1 -1
  162. package/dist/list-group-item.cjs +367 -0
  163. package/dist/list-group-item.cjs.map +1 -0
  164. package/dist/list-group-item.d.cts +73 -0
  165. package/dist/list-group-item.d.ts +73 -0
  166. package/dist/list-group-item.js +364 -0
  167. package/dist/list-group-item.js.map +1 -0
  168. package/dist/list-group.cjs +610 -0
  169. package/dist/list-group.cjs.map +1 -0
  170. package/dist/list-group.d.cts +58 -0
  171. package/dist/list-group.d.ts +58 -0
  172. package/dist/list-group.js +607 -0
  173. package/dist/list-group.js.map +1 -0
  174. package/dist/modal.cjs +70 -35
  175. package/dist/modal.cjs.map +1 -1
  176. package/dist/modal.d.cts +14 -2
  177. package/dist/modal.d.ts +14 -2
  178. package/dist/modal.js +70 -35
  179. package/dist/modal.js.map +1 -1
  180. package/dist/nav-item.cjs +107 -4
  181. package/dist/nav-item.cjs.map +1 -1
  182. package/dist/nav-item.d.cts +52 -2
  183. package/dist/nav-item.d.ts +52 -2
  184. package/dist/nav-item.js +108 -5
  185. package/dist/nav-item.js.map +1 -1
  186. package/dist/nav.cjs +57 -1
  187. package/dist/nav.cjs.map +1 -1
  188. package/dist/nav.d.cts +15 -1
  189. package/dist/nav.d.ts +15 -1
  190. package/dist/nav.js +58 -2
  191. package/dist/nav.js.map +1 -1
  192. package/dist/offcanvas.cjs +621 -0
  193. package/dist/offcanvas.cjs.map +1 -0
  194. package/dist/offcanvas.d.cts +61 -0
  195. package/dist/offcanvas.d.ts +61 -0
  196. package/dist/offcanvas.js +617 -0
  197. package/dist/offcanvas.js.map +1 -0
  198. package/dist/pagination.cjs +452 -0
  199. package/dist/pagination.cjs.map +1 -0
  200. package/dist/pagination.d.cts +69 -0
  201. package/dist/pagination.d.ts +69 -0
  202. package/dist/pagination.js +448 -0
  203. package/dist/pagination.js.map +1 -0
  204. package/dist/popover.cjs +534 -0
  205. package/dist/popover.cjs.map +1 -0
  206. package/dist/popover.d.cts +59 -0
  207. package/dist/popover.d.ts +59 -0
  208. package/dist/popover.js +530 -0
  209. package/dist/popover.js.map +1 -0
  210. package/dist/pricing-card.cjs +153 -64
  211. package/dist/pricing-card.cjs.map +1 -1
  212. package/dist/pricing-card.d.cts +34 -6
  213. package/dist/pricing-card.d.ts +34 -6
  214. package/dist/pricing-card.js +154 -65
  215. package/dist/pricing-card.js.map +1 -1
  216. package/dist/progress.cjs +403 -0
  217. package/dist/progress.cjs.map +1 -0
  218. package/dist/progress.d.cts +70 -0
  219. package/dist/progress.d.ts +70 -0
  220. package/dist/progress.js +398 -0
  221. package/dist/progress.js.map +1 -0
  222. package/dist/prose.cjs +425 -0
  223. package/dist/prose.cjs.map +1 -0
  224. package/dist/prose.d.cts +21 -0
  225. package/dist/prose.d.ts +21 -0
  226. package/dist/prose.js +422 -0
  227. package/dist/prose.js.map +1 -0
  228. package/dist/radio.cjs +3 -1
  229. package/dist/radio.cjs.map +1 -1
  230. package/dist/radio.js +3 -1
  231. package/dist/radio.js.map +1 -1
  232. package/dist/range.cjs +381 -0
  233. package/dist/range.cjs.map +1 -0
  234. package/dist/range.d.cts +76 -0
  235. package/dist/range.d.ts +76 -0
  236. package/dist/range.js +378 -0
  237. package/dist/range.js.map +1 -0
  238. package/dist/rating.cjs +33 -0
  239. package/dist/rating.cjs.map +1 -1
  240. package/dist/rating.d.cts +38 -3
  241. package/dist/rating.d.ts +38 -3
  242. package/dist/rating.js +33 -0
  243. package/dist/rating.js.map +1 -1
  244. package/dist/section.cjs +27 -3
  245. package/dist/section.cjs.map +1 -1
  246. package/dist/section.d.cts +16 -1
  247. package/dist/section.d.ts +16 -1
  248. package/dist/section.js +27 -4
  249. package/dist/section.js.map +1 -1
  250. package/dist/select.cjs +6 -1
  251. package/dist/select.cjs.map +1 -1
  252. package/dist/select.d.cts +7 -1
  253. package/dist/select.d.ts +7 -1
  254. package/dist/select.js +6 -1
  255. package/dist/select.js.map +1 -1
  256. package/dist/sidebar-link.cjs +19 -1
  257. package/dist/sidebar-link.cjs.map +1 -1
  258. package/dist/sidebar-link.d.cts +13 -2
  259. package/dist/sidebar-link.d.ts +13 -2
  260. package/dist/sidebar-link.js +19 -1
  261. package/dist/sidebar-link.js.map +1 -1
  262. package/dist/sidebar-toggle.cjs +3 -1
  263. package/dist/sidebar-toggle.cjs.map +1 -1
  264. package/dist/sidebar-toggle.js +3 -1
  265. package/dist/sidebar-toggle.js.map +1 -1
  266. package/dist/sidebar.cjs +33 -1
  267. package/dist/sidebar.cjs.map +1 -1
  268. package/dist/sidebar.d.cts +1 -0
  269. package/dist/sidebar.d.ts +1 -0
  270. package/dist/sidebar.js +34 -2
  271. package/dist/sidebar.js.map +1 -1
  272. package/dist/spinner.cjs +2 -1
  273. package/dist/spinner.cjs.map +1 -1
  274. package/dist/spinner.d.cts +2 -2
  275. package/dist/spinner.d.ts +2 -2
  276. package/dist/spinner.js +2 -1
  277. package/dist/spinner.js.map +1 -1
  278. package/dist/stack.cjs +4 -2
  279. package/dist/stack.cjs.map +1 -1
  280. package/dist/stack.d.cts +2 -2
  281. package/dist/stack.d.ts +2 -2
  282. package/dist/stack.js +4 -2
  283. package/dist/stack.js.map +1 -1
  284. package/dist/states-Bgzwu_XZ.d.cts +9 -0
  285. package/dist/states-Bgzwu_XZ.d.ts +9 -0
  286. package/dist/stepper.cjs +495 -0
  287. package/dist/stepper.cjs.map +1 -0
  288. package/dist/stepper.d.cts +40 -0
  289. package/dist/stepper.d.ts +40 -0
  290. package/dist/stepper.js +491 -0
  291. package/dist/stepper.js.map +1 -0
  292. package/dist/switch.cjs +492 -0
  293. package/dist/switch.cjs.map +1 -0
  294. package/dist/switch.d.cts +82 -0
  295. package/dist/switch.d.ts +82 -0
  296. package/dist/switch.js +488 -0
  297. package/dist/switch.js.map +1 -0
  298. package/dist/tab-panel.cjs +465 -0
  299. package/dist/tab-panel.cjs.map +1 -0
  300. package/dist/tab-panel.d.cts +48 -0
  301. package/dist/tab-panel.d.ts +48 -0
  302. package/dist/tab-panel.js +462 -0
  303. package/dist/tab-panel.js.map +1 -0
  304. package/dist/table.cjs +506 -0
  305. package/dist/table.cjs.map +1 -0
  306. package/dist/table.d.cts +54 -0
  307. package/dist/table.d.ts +54 -0
  308. package/dist/table.js +501 -0
  309. package/dist/table.js.map +1 -0
  310. package/dist/tabs.cjs +596 -0
  311. package/dist/tabs.cjs.map +1 -0
  312. package/dist/tabs.d.cts +65 -0
  313. package/dist/tabs.d.ts +65 -0
  314. package/dist/tabs.js +592 -0
  315. package/dist/tabs.js.map +1 -0
  316. package/dist/tag.cjs +27 -1
  317. package/dist/tag.cjs.map +1 -1
  318. package/dist/tag.d.cts +19 -3
  319. package/dist/tag.d.ts +19 -3
  320. package/dist/tag.js +27 -1
  321. package/dist/tag.js.map +1 -1
  322. package/dist/testimonial.cjs +162 -64
  323. package/dist/testimonial.cjs.map +1 -1
  324. package/dist/testimonial.d.cts +36 -8
  325. package/dist/testimonial.d.ts +36 -8
  326. package/dist/testimonial.js +163 -65
  327. package/dist/testimonial.js.map +1 -1
  328. package/dist/text.cjs +65 -6
  329. package/dist/text.cjs.map +1 -1
  330. package/dist/text.d.cts +24 -3
  331. package/dist/text.d.ts +24 -3
  332. package/dist/text.js +64 -8
  333. package/dist/text.js.map +1 -1
  334. package/dist/textarea.cjs +3 -0
  335. package/dist/textarea.cjs.map +1 -1
  336. package/dist/textarea.d.cts +7 -1
  337. package/dist/textarea.d.ts +7 -1
  338. package/dist/textarea.js +3 -0
  339. package/dist/textarea.js.map +1 -1
  340. package/dist/toast.cjs +34 -1
  341. package/dist/toast.cjs.map +1 -1
  342. package/dist/toast.d.cts +15 -2
  343. package/dist/toast.d.ts +15 -2
  344. package/dist/toast.js +34 -1
  345. package/dist/toast.js.map +1 -1
  346. package/dist/tooltip.cjs +32 -0
  347. package/dist/tooltip.cjs.map +1 -1
  348. package/dist/tooltip.d.cts +15 -2
  349. package/dist/tooltip.d.ts +15 -2
  350. package/dist/tooltip.js +32 -0
  351. package/dist/tooltip.js.map +1 -1
  352. package/package.json +130 -15
package/dist/nav-item.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LitElement, html, nothing } from 'lit';
2
2
  import { ifDefined } from 'lit/directives/if-defined.js';
3
- import { getDropdownClasses, getDropdownMenuClasses, getNavLinkClasses } from '@phcdevworks/spectre-ui';
3
+ import { getDropdownItemClasses, getDropdownHeaderClasses, getDropdownDividerClasses, getDropdownClasses, getDropdownMenuClasses, getNavLinkClasses } from '@phcdevworks/spectre-ui';
4
4
 
5
5
  // src/components/nav-item/sp-nav-item.ts
6
6
  var SpectreBaseElement = class extends LitElement {
@@ -278,6 +278,38 @@ function hasMeaningfulContent(nodes) {
278
278
  return false;
279
279
  });
280
280
  }
281
+
282
+ // src/utils/parts.ts
283
+ function applyPartClasses(elements, parts) {
284
+ for (const element of elements) {
285
+ const part = element.getAttribute("slot");
286
+ const classes = part ? parts[part] : void 0;
287
+ if (classes) {
288
+ element.classList.add(...classes.split(/\s+/).filter(Boolean));
289
+ }
290
+ }
291
+ }
292
+ function childElements(nodes) {
293
+ return nodes.filter(
294
+ (node) => node.nodeType === Node.ELEMENT_NODE
295
+ );
296
+ }
297
+ var spectreAccentEdges = ["top", "right", "bottom", "left"];
298
+ function isAccentEdge(value) {
299
+ return spectreAccentEdges.includes(value);
300
+ }
301
+ var spectreAccentColors = [
302
+ "neutral",
303
+ "brand",
304
+ "info",
305
+ "success",
306
+ "warning",
307
+ "danger",
308
+ "cta"
309
+ ];
310
+ function isAccentColor(value) {
311
+ return spectreAccentColors.includes(value);
312
+ }
281
313
  var spectreDropdownPlacements = [
282
314
  "bottom-start",
283
315
  "bottom-end",
@@ -289,15 +321,35 @@ function isDropdownPlacement(value) {
289
321
  value
290
322
  );
291
323
  }
324
+
325
+ // src/utils/states.ts
326
+ var hoverFocusStateProperties = {
327
+ focused: { type: Boolean, reflect: true },
328
+ hovered: { type: Boolean, reflect: true }
329
+ };
330
+ function hoverFocusStates(element) {
331
+ return {
332
+ focused: element.focused ?? false,
333
+ hovered: element.hovered ?? false
334
+ };
335
+ }
292
336
  var SpectreNavItemElement = class extends SpectreBaseElement {
293
337
  constructor() {
294
338
  super(...arguments);
339
+ this.focused = false;
340
+ this.hovered = false;
341
+ this.accent = void 0;
342
+ this.accentColor = void 0;
343
+ this.active = false;
344
+ this.disabled = false;
295
345
  this.dropdown = false;
346
+ this.fullWidth = false;
296
347
  this.href = void 0;
297
348
  this.label = void 0;
298
349
  this.mega = false;
299
350
  this.open = false;
300
351
  this.placement = "bottom-start";
352
+ this.viewport = false;
301
353
  this.triggerContent = [];
302
354
  this.menuContent = [];
303
355
  this.handleDocumentClick = (event) => {
@@ -395,6 +447,24 @@ var SpectreNavItemElement = class extends SpectreBaseElement {
395
447
  this.contentObserver = void 0;
396
448
  }
397
449
  willUpdate(changedProperties) {
450
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
451
+ this.accent = void 0;
452
+ }
453
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
454
+ this.accentColor = void 0;
455
+ }
456
+ if (changedProperties.has("active") && this.active == null) {
457
+ this.active = false;
458
+ }
459
+ if (changedProperties.has("disabled") && this.disabled == null) {
460
+ this.disabled = false;
461
+ }
462
+ if (changedProperties.has("fullWidth") && this.fullWidth == null) {
463
+ this.fullWidth = false;
464
+ }
465
+ if (changedProperties.has("viewport") && this.viewport == null) {
466
+ this.viewport = false;
467
+ }
398
468
  if (changedProperties.has("dropdown") && this.dropdown == null) {
399
469
  this.dropdown = false;
400
470
  }
@@ -408,6 +478,14 @@ var SpectreNavItemElement = class extends SpectreBaseElement {
408
478
  this.placement = "bottom-start";
409
479
  }
410
480
  }
481
+ updated(changedProperties) {
482
+ super.updated(changedProperties);
483
+ applyPartClasses(childElements(this.menuContent), {
484
+ divider: getDropdownDividerClasses(),
485
+ header: getDropdownHeaderClasses(),
486
+ item: getDropdownItemClasses()
487
+ });
488
+ }
411
489
  get triggerElement() {
412
490
  return this.querySelector("[data-sp-nav-item-trigger]");
413
491
  }
@@ -433,23 +511,40 @@ var SpectreNavItemElement = class extends SpectreBaseElement {
433
511
  this.dispatchEvent(new CustomEvent("sp-close", { bubbles: true }));
434
512
  }
435
513
  get wrapperClasses() {
436
- return getDropdownClasses({ mega: this.mega ?? false });
514
+ return getDropdownClasses({
515
+ fullWidth: this.fullWidth ?? false,
516
+ mega: this.mega ?? false,
517
+ viewport: this.viewport ?? false
518
+ });
437
519
  }
438
520
  get menuClasses() {
439
521
  return getDropdownMenuClasses({
522
+ ...this.accent !== void 0 && {
523
+ accent: this.accent
524
+ },
525
+ ...this.accentColor !== void 0 && {
526
+ accentColor: this.accentColor
527
+ },
440
528
  mega: this.mega ?? false,
529
+ viewport: this.viewport ?? false,
441
530
  open: this.open ?? false,
442
531
  placement: this.placement
443
532
  });
444
533
  }
445
534
  get navLinkClasses() {
446
- return getNavLinkClasses();
535
+ return getNavLinkClasses({
536
+ ...hoverFocusStates(this),
537
+ active: this.active ?? false,
538
+ disabled: this.disabled ?? false
539
+ });
447
540
  }
448
541
  renderLink() {
449
542
  return html`<a
543
+ aria-current="${ifDefined(this.active ? "page" : void 0)}"
544
+ aria-disabled="${ifDefined(this.disabled ? "true" : void 0)}"
450
545
  aria-label="${ifDefined(this.forwardedAriaLabel)}"
451
546
  class="${this.navLinkClasses}"
452
- href="${ifDefined(this.href)}"
547
+ href="${ifDefined(this.disabled ? void 0 : this.href)}"
453
548
  id="${ifDefined(this.id || void 0)}"
454
549
  title="${ifDefined(this.title || void 0)}"
455
550
  >${this.hasMenuContent ? this.menuContent : this.label}</a
@@ -467,6 +562,7 @@ var SpectreNavItemElement = class extends SpectreBaseElement {
467
562
  aria-label="${ifDefined(this.forwardedAriaLabel ?? this.label)}"
468
563
  class="${this.navLinkClasses}"
469
564
  data-sp-nav-item-trigger
565
+ ?disabled="${this.disabled ?? false}"
470
566
  type="button"
471
567
  @click="${() => this.toggle()}"
472
568
  >
@@ -482,12 +578,19 @@ var SpectreNavItemElement = class extends SpectreBaseElement {
482
578
  }
483
579
  };
484
580
  SpectreNavItemElement.properties = {
581
+ ...hoverFocusStateProperties,
582
+ accent: { type: String, reflect: true },
583
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
584
+ active: { type: Boolean, reflect: true },
585
+ disabled: { type: Boolean, reflect: true },
485
586
  dropdown: { type: Boolean, reflect: true },
587
+ fullWidth: { attribute: "full-width", type: Boolean, reflect: true },
486
588
  href: { type: String },
487
589
  label: { type: String },
488
590
  mega: { type: Boolean, reflect: true },
489
591
  open: { type: Boolean, reflect: true },
490
- placement: { type: String, reflect: true }
592
+ placement: { type: String, reflect: true },
593
+ viewport: { type: Boolean, reflect: true }
491
594
  };
492
595
  function defineSpectreNavItem(tagName = "sp-nav-item") {
493
596
  const existingElement = customElements.get(tagName);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/base.ts","../src/utils/dom.ts","../src/utils/form.ts","../src/components/nav-item/sp-nav-item.ts"],"names":[],"mappings":";;;;;AAEO,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tB,IAAA,EAAM,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EACrC,IAAA,EAAM,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EACrC,SAAA,EAAW,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAS,IAAA;AACtC,CAAA;AA+OK,SAAS,oBAAA,CACd,UAAU,aAAA,EACoB;AAC9B,EAAA,MAAM,eAAA,GAAkB,cAAA,CAAe,GAAA,CAAI,OAAO,CAAA;AAElD,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA,OAAO,eAAA;AAAA,EACT;AAEA,EAAA,cAAA,CAAe,MAAA,CAAO,SAAS,qBAAqB,CAAA;AACpD,EAAA,OAAO,qBAAA;AACT","file":"nav-item.js","sourcesContent":["import { LitElement, type PropertyDeclarations } from 'lit'\n\nexport class SpectreBaseElement extends LitElement {\n static properties: PropertyDeclarations = {}\n\n private _ariaLabel: string | null = null\n private _ariaLabelledBy: string | null = null\n private _ariaDescribedBy: string | null = null\n private _autocapitalize = ''\n private _autofocus = false\n private _spellcheck: boolean | null = null\n private _title = ''\n private _id = ''\n\n get ariaLabel(): string | null {\n return this._ariaLabel\n }\n\n set ariaLabel(value: string | null) {\n if (this._ariaLabel === value) {\n return\n }\n this._ariaLabel = value\n this._removeHostAttribute('aria-label')\n this.requestUpdate()\n }\n\n get ariaLabelledBy(): string | null {\n return this._ariaLabelledBy\n }\n\n set ariaLabelledBy(value: string | null) {\n if (this._ariaLabelledBy === value) {\n return\n }\n this._ariaLabelledBy = value\n this._removeHostAttribute('aria-labelledby')\n this.requestUpdate()\n }\n\n get ariaDescribedBy(): string | null {\n return this._ariaDescribedBy\n }\n\n set ariaDescribedBy(value: string | null) {\n if (this._ariaDescribedBy === value) {\n return\n }\n this._ariaDescribedBy = value\n this._removeHostAttribute('aria-describedby')\n this.requestUpdate()\n }\n\n override get autocapitalize(): string {\n return this._autocapitalize\n }\n\n override set autocapitalize(value: string | undefined | null) {\n const normalizedValue = value ?? ''\n if (this._autocapitalize === normalizedValue) {\n return\n }\n this._autocapitalize = normalizedValue\n this._removeHostAttribute('autocapitalize')\n this.requestUpdate()\n }\n\n override get spellcheck(): boolean {\n return this._spellcheck ?? super.spellcheck\n }\n\n override set spellcheck(value: boolean | undefined | null) {\n if (this._spellcheck === value) {\n return\n }\n this._spellcheck = value ?? null\n this._removeHostAttribute('spellcheck')\n this.requestUpdate()\n }\n\n override get title(): string {\n return this._title\n }\n\n override set title(value: string | undefined | null) {\n const normalizedValue = value ?? ''\n if (this._title === normalizedValue) {\n return\n }\n this._title = normalizedValue\n this._removeHostAttribute('title')\n this.requestUpdate()\n }\n\n override get id(): string {\n return this._id\n }\n\n override set id(value: string | undefined | null) {\n const normalizedValue = value ?? ''\n if (this._id === normalizedValue) {\n return\n }\n this._id = normalizedValue\n this._removeHostAttribute('id')\n this.requestUpdate()\n }\n\n override get autofocus(): boolean {\n return this._autofocus\n }\n\n override set autofocus(value: boolean | undefined | null) {\n const normalizedValue = !!value\n if (this._autofocus === normalizedValue) {\n return\n }\n this._autofocus = normalizedValue\n this._removeHostAttribute('autofocus')\n this.requestUpdate()\n }\n\n // Spectre components intentionally render in light DOM so the global\n // `@phcdevworks/spectre-ui` styling contract can apply directly.\n createRenderRoot(): this {\n return this\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n\n const proxiedAttributes = [\n 'id',\n 'title',\n 'autocapitalize',\n 'autofocus',\n 'spellcheck',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby'\n ]\n\n proxiedAttributes.forEach((attr) => {\n const value = super.getAttribute(attr)\n if (value !== null) {\n this.setAttribute(attr, value)\n }\n })\n }\n\n override getAttribute(qualifiedName: string): string | null {\n switch (qualifiedName) {\n case 'id':\n return this.id || null\n case 'title':\n return this.title || null\n case 'autocapitalize':\n return this.autocapitalize || null\n case 'autofocus':\n return this.autofocus ? '' : null\n case 'spellcheck':\n return this._spellcheck !== null ? String(this._spellcheck) : null\n case 'aria-label':\n return this.ariaLabel\n case 'aria-labelledby':\n return this.ariaLabelledBy\n case 'aria-describedby':\n return this.ariaDescribedBy\n default:\n return super.getAttribute(qualifiedName)\n }\n }\n\n override hasAttribute(qualifiedName: string): boolean {\n switch (qualifiedName) {\n case 'id':\n return this.id !== ''\n case 'title':\n return this.title !== ''\n case 'autocapitalize':\n return this.autocapitalize !== ''\n case 'autofocus':\n return this.autofocus\n case 'spellcheck':\n return this._spellcheck !== null\n case 'aria-label':\n return this.ariaLabel !== null\n case 'aria-labelledby':\n return this.ariaLabelledBy !== null\n case 'aria-describedby':\n return this.ariaDescribedBy !== null\n default:\n return super.hasAttribute(qualifiedName)\n }\n }\n\n override setAttribute(qualifiedName: string, value: string): void {\n switch (qualifiedName) {\n case 'id':\n this.id = value\n break\n case 'title':\n this.title = value\n break\n case 'autocapitalize':\n this.autocapitalize = value\n break\n case 'autofocus':\n this.autofocus = true\n break\n case 'spellcheck':\n this.spellcheck = value !== 'false'\n break\n case 'aria-label':\n this.ariaLabel = value\n break\n case 'aria-labelledby':\n this.ariaLabelledBy = value\n break\n case 'aria-describedby':\n this.ariaDescribedBy = value\n break\n default:\n super.setAttribute(qualifiedName, value)\n }\n }\n\n override removeAttribute(qualifiedName: string): void {\n switch (qualifiedName) {\n case 'id':\n this.id = ''\n break\n case 'title':\n this.title = ''\n break\n case 'autocapitalize':\n this.autocapitalize = ''\n break\n case 'autofocus':\n this.autofocus = false\n break\n case 'spellcheck':\n this.spellcheck = null\n break\n case 'aria-label':\n this.ariaLabel = null\n break\n case 'aria-labelledby':\n this.ariaLabelledBy = null\n break\n case 'aria-describedby':\n this.ariaDescribedBy = null\n break\n default:\n super.removeAttribute(qualifiedName)\n }\n }\n\n private _removeHostAttribute(name: string): void {\n const host = this as unknown as HTMLElement\n if (HTMLElement.prototype.hasAttribute.call(host, name)) {\n // Use the native removeAttribute to avoid our own overridden version\n // which would reset the internal state.\n HTMLElement.prototype.removeAttribute.call(host, name)\n }\n }\n\n protected get forwardedAriaLabel(): string | undefined {\n const value = this.ariaLabel?.trim()\n return value ? value : undefined\n }\n\n protected get forwardedAriaLabelledBy(): string | undefined {\n const value = this.ariaLabelledBy?.trim()\n return value ? value : undefined\n }\n\n protected get forwardedAriaDescribedBy(): string | undefined {\n const value = this.ariaDescribedBy?.trim()\n return value ? value : undefined\n }\n\n // Subclasses that expose `disabled`/`loading` properties get this disabled\n // calculation for free instead of redeclaring it per component.\n protected get isDisabled(): boolean {\n const self = this as unknown as { disabled?: boolean; loading?: boolean }\n return (self.disabled ?? false) || (self.loading ?? false)\n }\n\n // Subclasses get this for free instead of redeclaring it per component.\n protected get hasForwardedLabel(): boolean {\n return Boolean(this.forwardedAriaLabel || this.forwardedAriaLabelledBy)\n }\n}\n","export function hasMeaningfulContent(nodes: readonly Node[]): boolean {\n return nodes.some((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n return (node.textContent?.trim().length ?? 0) > 0;\n }\n\n return false;\n });\n}\n","import {\n type ButtonSize,\n type ButtonVariant,\n type InputSize\n} from '@phcdevworks/spectre-ui'\n\nexport const spectreInputSizes = ['sm', 'md', 'lg'] as const\nexport type SpectreInputSize = (typeof spectreInputSizes)[number]\n\nexport function isInputSize(value: unknown): value is InputSize | ButtonSize {\n return (spectreInputSizes as readonly string[]).includes(value as string)\n}\n\nexport const spectreButtonVariants = [\n 'primary',\n 'secondary',\n 'ghost',\n 'danger',\n 'success',\n 'cta',\n 'accent',\n 'inverse'\n] as const\n\nexport type SpectreButtonVariant = (typeof spectreButtonVariants)[number]\n\nexport function isButtonVariant(value: unknown): value is ButtonVariant {\n return (spectreButtonVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreButtonTypes = ['button', 'submit', 'reset'] as const\n\nexport type SpectreButtonType = (typeof spectreButtonTypes)[number]\n\nexport function isButtonType(value: unknown): value is SpectreButtonType {\n return (spectreButtonTypes as readonly string[]).includes(value as string)\n}\n\nexport const spectreInputTypes = [\n 'text',\n 'email',\n 'password',\n 'search',\n 'tel',\n 'url',\n 'number',\n 'date',\n 'datetime-local',\n 'month',\n 'time',\n 'week'\n] as const\n\nexport type SpectreInputType = (typeof spectreInputTypes)[number]\n\nexport function isInputType(value: unknown): value is SpectreInputType {\n return (spectreInputTypes as readonly string[]).includes(value as string)\n}\n\nexport const spectreBadgeVariants = [\n 'primary',\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n 'neutral',\n 'info',\n 'ghost',\n 'outline',\n 'accent',\n 'cta',\n 'inverse'\n] as const\n\nexport type SpectreBadgeVariant = (typeof spectreBadgeVariants)[number]\n\nexport function isBadgeVariant(value: unknown): value is SpectreBadgeVariant {\n return (spectreBadgeVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreAlertVariants = [\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'neutral'\n] as const\n\nexport type SpectreAlertVariant = (typeof spectreAlertVariants)[number]\n\nexport function isAlertVariant(value: unknown): value is SpectreAlertVariant {\n return (spectreAlertVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreCardVariants = [\n 'elevated',\n 'flat',\n 'outline',\n 'ghost'\n] as const\n\nexport type SpectreCardVariant = (typeof spectreCardVariants)[number]\n\nexport function isCardVariant(value: unknown): value is SpectreCardVariant {\n return (spectreCardVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreCardPaddingSizes = ['sm', 'md', 'lg'] as const\n\nexport type SpectreCardPaddingSize = (typeof spectreCardPaddingSizes)[number]\n\nexport function isCardPaddingSize(\n value: unknown\n): value is SpectreCardPaddingSize {\n return (spectreCardPaddingSizes as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreIconBoxVariants = [\n 'primary',\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n 'info',\n 'neutral',\n 'ghost',\n 'accent',\n 'cta',\n 'outline'\n] as const\n\nexport type SpectreIconBoxVariant = (typeof spectreIconBoxVariants)[number]\n\nexport function isIconBoxVariant(\n value: unknown\n): value is SpectreIconBoxVariant {\n return (spectreIconBoxVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreTestimonialVariants = [\n 'elevated',\n 'flat',\n 'outline',\n 'ghost'\n] as const\n\nexport type SpectreTestimonialVariant =\n (typeof spectreTestimonialVariants)[number]\n\nexport function isTestimonialVariant(\n value: unknown\n): value is SpectreTestimonialVariant {\n return (spectreTestimonialVariants as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreSpinnerVariants = [\n 'primary',\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n 'info',\n 'neutral',\n 'accent',\n 'cta'\n] as const\n\nexport type SpectreSpinnerVariant = (typeof spectreSpinnerVariants)[number]\n\nexport function isSpinnerVariant(\n value: unknown\n): value is SpectreSpinnerVariant {\n return (spectreSpinnerVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreTagVariants = [\n 'default',\n 'primary',\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n 'info',\n 'neutral',\n 'accent',\n 'cta',\n 'outline',\n 'ghost'\n] as const\n\nexport type SpectreTagVariant = (typeof spectreTagVariants)[number]\n\nexport function isTagVariant(value: unknown): value is SpectreTagVariant {\n return (spectreTagVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreAvatarSizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const\n\nexport type SpectreAvatarSize = (typeof spectreAvatarSizes)[number]\n\nexport function isAvatarSize(value: unknown): value is SpectreAvatarSize {\n return (spectreAvatarSizes as readonly string[]).includes(value as string)\n}\n\nexport const spectreAvatarShapes = ['circle', 'square'] as const\n\nexport type SpectreAvatarShape = (typeof spectreAvatarShapes)[number]\n\nexport function isAvatarShape(value: unknown): value is SpectreAvatarShape {\n return (spectreAvatarShapes as readonly string[]).includes(value as string)\n}\n\nexport const spectreContainerMaxWidths = ['prose'] as const\n\nexport type SpectreContainerMaxWidth =\n (typeof spectreContainerMaxWidths)[number]\n\nexport function isContainerMaxWidth(\n value: unknown\n): value is SpectreContainerMaxWidth {\n return (spectreContainerMaxWidths as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreGridColumns = [1, 2, 3, 4, 6, 12] as const\n\nexport type SpectreGridColumns = (typeof spectreGridColumns)[number]\n\nexport function isGridColumns(value: unknown): value is SpectreGridColumns {\n return (spectreGridColumns as readonly number[]).includes(value as number)\n}\n\nexport const spectreGridGaps = ['sm', 'md', 'lg'] as const\n\nexport type SpectreGridGap = (typeof spectreGridGaps)[number]\n\nexport function isGridGap(value: unknown): value is SpectreGridGap {\n return (spectreGridGaps as readonly string[]).includes(value as string)\n}\n\nexport const spectreGridAligns = [\n 'start',\n 'center',\n 'end',\n 'baseline',\n 'stretch'\n] as const\n\nexport type SpectreGridAlign = (typeof spectreGridAligns)[number]\n\nexport function isGridAlign(value: unknown): value is SpectreGridAlign {\n return (spectreGridAligns as readonly string[]).includes(value as string)\n}\n\nexport const spectreGridSpans = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 'full'\n] as const\n\nexport type SpectreGridSpan = (typeof spectreGridSpans)[number]\n\nexport function isGridSpan(value: unknown): value is SpectreGridSpan {\n return (spectreGridSpans as readonly (number | string)[]).includes(\n value as number | string\n )\n}\n\nexport interface SpectreGridSpanOptions {\n base?: SpectreGridSpan\n md?: SpectreGridSpan\n lg?: SpectreGridSpan\n}\n\nexport function isGridSpanOptions(\n value: unknown\n): value is SpectreGridSpanOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n (candidate.base === undefined || isGridSpan(candidate.base)) &&\n (candidate.md === undefined || isGridSpan(candidate.md)) &&\n (candidate.lg === undefined || isGridSpan(candidate.lg))\n )\n}\n\nexport const spectreGridOffsets = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11\n] as const\n\nexport type SpectreGridOffset = (typeof spectreGridOffsets)[number]\n\nexport function isGridOffset(value: unknown): value is SpectreGridOffset {\n return (spectreGridOffsets as readonly number[]).includes(value as number)\n}\n\nexport interface SpectreGridOffsetOptions {\n base?: SpectreGridOffset\n md?: SpectreGridOffset\n lg?: SpectreGridOffset\n}\n\nexport function isGridOffsetOptions(\n value: unknown\n): value is SpectreGridOffsetOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n (candidate.base === undefined || isGridOffset(candidate.base)) &&\n (candidate.md === undefined || isGridOffset(candidate.md)) &&\n (candidate.lg === undefined || isGridOffset(candidate.lg))\n )\n}\n\nexport const spectreGridOrders = [\n 'first',\n 'last',\n 'none',\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12\n] as const\n\nexport type SpectreGridOrder = (typeof spectreGridOrders)[number]\n\nexport function isGridOrder(value: unknown): value is SpectreGridOrder {\n return (spectreGridOrders as readonly (number | string)[]).includes(\n value as number | string\n )\n}\n\nexport interface SpectreGridOrderOptions {\n base?: SpectreGridOrder\n md?: SpectreGridOrder\n lg?: SpectreGridOrder\n}\n\nexport function isGridOrderOptions(\n value: unknown\n): value is SpectreGridOrderOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n (candidate.base === undefined || isGridOrder(candidate.base)) &&\n (candidate.md === undefined || isGridOrder(candidate.md)) &&\n (candidate.lg === undefined || isGridOrder(candidate.lg))\n )\n}\n\nexport const spectreGridLeadingWeights = [1.5, 1.6, 2, 2.5, 3] as const\n\nexport type SpectreGridLeadingWeight =\n (typeof spectreGridLeadingWeights)[number]\n\nexport function isGridLeadingWeight(\n value: unknown\n): value is SpectreGridLeadingWeight {\n return (spectreGridLeadingWeights as readonly number[]).includes(\n value as number\n )\n}\n\nexport interface SpectreGridLeadingWeightOptions {\n base?: SpectreGridLeadingWeight\n md?: SpectreGridLeadingWeight\n lg?: SpectreGridLeadingWeight\n}\n\nexport function isGridLeadingWeightOptions(\n value: unknown\n): value is SpectreGridLeadingWeightOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n (candidate.base === undefined || isGridLeadingWeight(candidate.base)) &&\n (candidate.md === undefined || isGridLeadingWeight(candidate.md)) &&\n (candidate.lg === undefined || isGridLeadingWeight(candidate.lg))\n )\n}\n\nexport interface SpectreGridLeadingTracksOptions {\n weight: SpectreGridLeadingWeight | SpectreGridLeadingWeightOptions\n}\n\nexport function isGridLeadingTracksOptions(\n value: unknown\n): value is SpectreGridLeadingTracksOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n isGridLeadingWeight(candidate.weight) ||\n isGridLeadingWeightOptions(candidate.weight)\n )\n}\n\nexport const spectreGridFixedTrackCounts = [1, 2, 3, 4] as const\n\nexport type SpectreGridFixedTrackCount =\n (typeof spectreGridFixedTrackCounts)[number]\n\nexport function isGridFixedTrackCount(\n value: unknown\n): value is SpectreGridFixedTrackCount {\n return (spectreGridFixedTrackCounts as readonly number[]).includes(\n value as number\n )\n}\n\nexport interface SpectreGridFixedTracksOptions {\n count: SpectreGridFixedTrackCount\n}\n\nexport function isGridFixedTracksOptions(\n value: unknown\n): value is SpectreGridFixedTracksOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return isGridFixedTrackCount(candidate.count)\n}\n\nexport const spectreGridTemplates = [\n 'edge-fluid-edge',\n 'label-fluid-fluid'\n] as const\n\nexport type SpectreGridTemplate = (typeof spectreGridTemplates)[number]\n\nexport function isGridTemplate(value: unknown): value is SpectreGridTemplate {\n return (spectreGridTemplates as readonly string[]).includes(value as string)\n}\n\nexport interface SpectreGridExplicitTemplateOptions {\n template: SpectreGridTemplate\n weight?: SpectreGridLeadingWeight\n}\n\nexport function isGridExplicitTemplateOptions(\n value: unknown\n): value is SpectreGridExplicitTemplateOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n isGridTemplate(candidate.template) &&\n (candidate.weight === undefined || isGridLeadingWeight(candidate.weight))\n )\n}\n\nexport const spectreStackDirections = ['vertical', 'horizontal'] as const\n\nexport type SpectreStackDirection = (typeof spectreStackDirections)[number]\n\nexport function isStackDirection(\n value: unknown\n): value is SpectreStackDirection {\n return (spectreStackDirections as readonly string[]).includes(value as string)\n}\n\nexport const spectreStackBases = ['sidebar'] as const\n\nexport type SpectreStackBasis = (typeof spectreStackBases)[number]\n\nexport function isStackBasis(value: unknown): value is SpectreStackBasis {\n return (spectreStackBases as readonly string[]).includes(value as string)\n}\n\nexport const spectreNavAligns = ['start', 'center', 'end'] as const\n\nexport type SpectreNavAlign = (typeof spectreNavAligns)[number]\n\nexport function isNavAlign(value: unknown): value is SpectreNavAlign {\n return (spectreNavAligns as readonly string[]).includes(value as string)\n}\n\nexport const spectreStackAligns = ['center', 'stretch'] as const\n\nexport type SpectreStackAlign = (typeof spectreStackAligns)[number]\n\nexport function isStackAlign(value: unknown): value is SpectreStackAlign {\n return (spectreStackAligns as readonly string[]).includes(value as string)\n}\n\nexport const spectreStackGaps = ['sm', 'md', 'lg'] as const\n\nexport type SpectreStackGap = (typeof spectreStackGaps)[number]\n\nexport function isStackGap(value: unknown): value is SpectreStackGap {\n return (spectreStackGaps as readonly string[]).includes(value as string)\n}\n\nexport const spectreDropdownPlacements = [\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end'\n] as const\n\nexport type SpectreDropdownPlacement =\n (typeof spectreDropdownPlacements)[number]\n\nexport function isDropdownPlacement(\n value: unknown\n): value is SpectreDropdownPlacement {\n return (spectreDropdownPlacements as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreToastVariants = [\n 'info',\n 'success',\n 'warning',\n 'danger'\n] as const\n\nexport type SpectreToastVariant = (typeof spectreToastVariants)[number]\n\nexport function isToastVariant(value: unknown): value is SpectreToastVariant {\n return (spectreToastVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreSidebarLinkLevels = ['parent', 'child'] as const\n\nexport type SpectreSidebarLinkLevel = (typeof spectreSidebarLinkLevels)[number]\n\nexport function isSidebarLinkLevel(\n value: unknown\n): value is SpectreSidebarLinkLevel {\n return (spectreSidebarLinkLevels as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreTooltipPlacements = [\n 'top',\n 'bottom',\n 'left',\n 'right'\n] as const\n\nexport type SpectreTooltipPlacement = (typeof spectreTooltipPlacements)[number]\n\nexport function isTooltipPlacement(\n value: unknown\n): value is SpectreTooltipPlacement {\n return (spectreTooltipPlacements as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreTextSizes = [\n 'xs',\n 'sm',\n 'md',\n 'lg',\n 'xl',\n '2xl',\n '3xl',\n '4xl',\n '5xl',\n '6xl'\n] as const\n\nexport type SpectreTextSize = (typeof spectreTextSizes)[number]\n\nexport function isTextSize(value: unknown): value is SpectreTextSize {\n return (spectreTextSizes as readonly string[]).includes(value as string)\n}\n\nexport const spectreTextVariants = [\n 'default',\n 'muted',\n 'subtle',\n 'meta',\n 'brand',\n 'onInverse',\n 'onInverseMuted'\n] as const\n\nexport type SpectreTextVariant = (typeof spectreTextVariants)[number]\n\nexport function isTextVariant(value: unknown): value is SpectreTextVariant {\n return (spectreTextVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreTextFamilies = ['sans', 'serif', 'mono'] as const\n\nexport type SpectreTextFamily = (typeof spectreTextFamilies)[number]\n\nexport function isTextFamily(value: unknown): value is SpectreTextFamily {\n return (spectreTextFamilies as readonly string[]).includes(value as string)\n}\n\nexport const spectreTextLevels = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'p',\n 'span'\n] as const\n\nexport type SpectreTextLevel = (typeof spectreTextLevels)[number]\n\nexport function isTextLevel(value: unknown): value is SpectreTextLevel {\n return (spectreTextLevels as readonly string[]).includes(value as string)\n}\n\nexport const spectreTextTransforms = [\n 'none',\n 'uppercase',\n 'lowercase',\n 'capitalize'\n] as const\n\nexport type SpectreTextTransform = (typeof spectreTextTransforms)[number]\n\nexport function isTextTransform(value: unknown): value is SpectreTextTransform {\n return (spectreTextTransforms as readonly string[]).includes(value as string)\n}\n\nexport function normalizeInt(\n value: unknown,\n fallback: number | undefined,\n min = 0\n): number | undefined {\n if (\n value == null ||\n typeof value !== 'number' ||\n !Number.isInteger(value) ||\n value < min\n ) {\n return fallback\n }\n return value\n}\n\nconst spectreUtilityClassPattern =\n /^sp-[a-z0-9]+(?:-[a-z0-9]+)*(?:__[a-z0-9]+(?:-[a-z0-9]+)*)?(?:--[a-z0-9]+(?:-[a-z0-9]+)*)?$/\n\nexport function sanitizeUtilityClasses(\n value: string | null | undefined\n): string {\n if (!value) {\n return ''\n }\n return value\n .split(/\\s+/)\n .filter((token) => spectreUtilityClassPattern.test(token))\n .join(' ')\n}\n","import { html, nothing } from 'lit'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { SpectreBaseElement } from '../../utils/base'\nimport { hasMeaningfulContent } from '../../utils/dom'\nimport {\n isDropdownPlacement,\n type SpectreDropdownPlacement\n} from '../../utils/form'\n\nimport {\n getDropdownClasses,\n getDropdownMenuClasses,\n getNavLinkClasses\n} from '@phcdevworks/spectre-ui'\n\nexport interface SpectreNavItemProps {\n ariaLabel?: string | null\n dropdown?: boolean | undefined\n href?: string | undefined\n id?: string | null | undefined\n label?: string | undefined\n mega?: boolean | undefined\n open?: boolean | undefined\n placement?: SpectreDropdownPlacement | undefined\n title?: string | null | undefined\n}\n\nexport class SpectreNavItemElement\n extends SpectreBaseElement\n implements SpectreNavItemProps\n{\n static properties = {\n dropdown: { type: Boolean, reflect: true },\n href: { type: String },\n label: { type: String },\n mega: { type: Boolean, reflect: true },\n open: { type: Boolean, reflect: true },\n placement: { type: String, reflect: true }\n }\n\n dropdown: boolean | undefined = false\n href: string | undefined = undefined\n label: string | undefined = undefined\n mega: boolean | undefined = false\n open: boolean | undefined = false\n placement: SpectreDropdownPlacement | undefined = 'bottom-start'\n\n private triggerContent: Node[] = []\n private menuContent: Node[] = []\n private contentObserver?: MutationObserver | undefined\n\n override get id(): string {\n return super.id\n }\n\n override set id(value: string | null | undefined) {\n super.id = value\n }\n\n override get title(): string {\n return super.title\n }\n\n override set title(value: string | null | undefined) {\n super.title = value\n }\n\n private isInternalNode(node: Node): boolean {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false\n }\n const el = node as Element\n return (\n el.hasAttribute('data-sp-nav-item-menu') ||\n el.hasAttribute('data-sp-nav-item-trigger')\n )\n }\n\n private syncProjectedContent(): boolean {\n const nextTriggerContent: Node[] = []\n const nextMenuContent: Node[] = []\n\n this.childNodes.forEach((node) => {\n if (this.isInternalNode(node)) {\n return\n }\n const isTriggerSlot =\n node.nodeType === Node.ELEMENT_NODE &&\n (node as Element).getAttribute('slot') === 'trigger'\n if (isTriggerSlot) {\n nextTriggerContent.push(node)\n } else {\n nextMenuContent.push(node)\n }\n })\n\n const changed =\n nextTriggerContent.length !== this.triggerContent.length ||\n nextTriggerContent.some((n, i) => n !== this.triggerContent[i]) ||\n nextMenuContent.length !== this.menuContent.length ||\n nextMenuContent.some((n, i) => n !== this.menuContent[i])\n\n if (changed) {\n this.triggerContent = nextTriggerContent\n this.menuContent = nextMenuContent\n }\n\n return changed\n }\n\n private get hasTriggerContent(): boolean {\n return hasMeaningfulContent(this.triggerContent)\n }\n\n private get hasMenuContent(): boolean {\n return hasMeaningfulContent(this.menuContent)\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n this.syncProjectedContent()\n this.startContentObserver()\n document.addEventListener('click', this.handleDocumentClick)\n document.addEventListener('keydown', this.handleDocumentKeydown)\n }\n\n override disconnectedCallback(): void {\n this.stopContentObserver()\n document.removeEventListener('click', this.handleDocumentClick)\n document.removeEventListener('keydown', this.handleDocumentKeydown)\n super.disconnectedCallback()\n }\n\n protected override update(\n changedProperties: Map<PropertyKey, unknown>\n ): void {\n this.stopContentObserver()\n super.update(changedProperties)\n this.startContentObserver()\n }\n\n private startContentObserver(): void {\n if (this.contentObserver) {\n return\n }\n this.contentObserver = new MutationObserver(() => {\n if (this.syncProjectedContent()) {\n this.requestUpdate()\n }\n })\n this.contentObserver.observe(this, { childList: true })\n }\n\n private stopContentObserver(): void {\n this.contentObserver?.disconnect()\n this.contentObserver = undefined\n }\n\n protected override willUpdate(\n changedProperties: Map<PropertyKey, unknown>\n ): void {\n if (changedProperties.has('dropdown') && this.dropdown == null) {\n this.dropdown = false\n }\n if (changedProperties.has('mega') && this.mega == null) {\n this.mega = false\n }\n if (changedProperties.has('open') && this.open == null) {\n this.open = false\n }\n if (\n changedProperties.has('placement') &&\n (this.placement == null || !isDropdownPlacement(this.placement))\n ) {\n this.placement = 'bottom-start'\n }\n }\n\n private handleDocumentClick = (event: MouseEvent): void => {\n if (!this.open) {\n return\n }\n if (!event.composedPath().includes(this)) {\n this.close()\n }\n }\n\n private handleDocumentKeydown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape' && this.open) {\n this.close()\n this.triggerElement?.focus()\n }\n }\n\n private get triggerElement(): HTMLButtonElement | null {\n return this.querySelector('[data-sp-nav-item-trigger]')\n }\n\n private toggle(): void {\n if (this.open) {\n this.close()\n } else {\n this.openMenu()\n }\n }\n\n private openMenu(): void {\n if (this.open) {\n return\n }\n this.open = true\n this.dispatchEvent(new CustomEvent('sp-open', { bubbles: true }))\n }\n\n private close(): void {\n if (!this.open) {\n return\n }\n this.open = false\n this.dispatchEvent(new CustomEvent('sp-close', { bubbles: true }))\n }\n\n private get wrapperClasses(): string {\n return getDropdownClasses({ mega: this.mega ?? false })\n }\n\n private get menuClasses(): string {\n return getDropdownMenuClasses({\n mega: this.mega ?? false,\n open: this.open ?? false,\n placement: this.placement as SpectreDropdownPlacement\n })\n }\n\n private get navLinkClasses(): string {\n return getNavLinkClasses()\n }\n\n private renderLink() {\n return html`<a\n aria-label=\"${ifDefined(this.forwardedAriaLabel)}\"\n class=\"${this.navLinkClasses}\"\n href=\"${ifDefined(this.href)}\"\n id=\"${ifDefined(this.id || undefined)}\"\n title=\"${ifDefined(this.title || undefined)}\"\n >${this.hasMenuContent ? this.menuContent : this.label}</a\n >`\n }\n\n private renderDropdown() {\n return html`<div\n class=\"${this.wrapperClasses}\"\n id=\"${ifDefined(this.id || undefined)}\"\n title=\"${ifDefined(this.title || undefined)}\"\n >\n <button\n aria-expanded=\"${this.open ? 'true' : 'false'}\"\n aria-haspopup=\"true\"\n aria-label=\"${ifDefined(this.forwardedAriaLabel ?? this.label)}\"\n class=\"${this.navLinkClasses}\"\n data-sp-nav-item-trigger\n type=\"button\"\n @click=\"${() => this.toggle()}\"\n >\n ${this.hasTriggerContent ? this.triggerContent : this.label}\n </button>\n <div class=\"${this.menuClasses}\" data-sp-nav-item-menu>\n ${this.hasMenuContent ? this.menuContent : nothing}\n </div>\n </div>`\n }\n\n override render() {\n return this.dropdown ? this.renderDropdown() : this.renderLink()\n }\n}\n\nexport function defineSpectreNavItem(\n tagName = 'sp-nav-item'\n): typeof SpectreNavItemElement {\n const existingElement = customElements.get(tagName)\n\n if (existingElement) {\n return existingElement as unknown as typeof SpectreNavItemElement\n }\n\n customElements.define(tagName, SpectreNavItemElement)\n return SpectreNavItemElement\n}\n"]}
1
+ {"version":3,"sources":["../src/utils/base.ts","../src/utils/dom.ts","../src/utils/parts.ts","../src/utils/form.ts","../src/utils/states.ts","../src/components/nav-item/sp-nav-item.ts"],"names":[],"mappings":";;;;;AAEO,IAAM,kBAAA,GAAN,cAAiC,UAAA,CAAW;AAAA,EAA5C,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AAGL,IAAA,IAAA,CAAQ,UAAA,GAA4B,IAAA;AACpC,IAAA,IAAA,CAAQ,eAAA,GAAiC,IAAA;AACzC,IAAA,IAAA,CAAQ,gBAAA,GAAkC,IAAA;AAC1C,IAAA,IAAA,CAAQ,eAAA,GAAkB,EAAA;AAC1B,IAAA,IAAA,CAAQ,UAAA,GAAa,KAAA;AACrB,IAAA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AAA,EAAO;AAAA,EACtB,IAAA,EAAM,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EACrC,IAAA,EAAM,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EACrC,SAAA,EAAW,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAS,IAAA,EAAK;AAAA,EACzC,QAAA,EAAU,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA;AACtC,CAAA;AA+SK,SAAS,oBAAA,CACd,UAAU,aAAA,EACoB;AAC9B,EAAA,MAAM,eAAA,GAAkB,cAAA,CAAe,GAAA,CAAI,OAAO,CAAA;AAElD,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA,OAAO,eAAA;AAAA,EACT;AAEA,EAAA,cAAA,CAAe,MAAA,CAAO,SAAS,qBAAqB,CAAA;AACpD,EAAA,OAAO,qBAAA;AACT","file":"nav-item.js","sourcesContent":["import { LitElement, type PropertyDeclarations } from 'lit'\n\nexport class SpectreBaseElement extends LitElement {\n static properties: PropertyDeclarations = {}\n\n private _ariaLabel: string | null = null\n private _ariaLabelledBy: string | null = null\n private _ariaDescribedBy: string | null = null\n private _autocapitalize = ''\n private _autofocus = false\n private _spellcheck: boolean | null = null\n private _title = ''\n private _id = ''\n\n get ariaLabel(): string | null {\n return this._ariaLabel\n }\n\n set ariaLabel(value: string | null) {\n if (this._ariaLabel === value) {\n return\n }\n this._ariaLabel = value\n this._removeHostAttribute('aria-label')\n this.requestUpdate()\n }\n\n get ariaLabelledBy(): string | null {\n return this._ariaLabelledBy\n }\n\n set ariaLabelledBy(value: string | null) {\n if (this._ariaLabelledBy === value) {\n return\n }\n this._ariaLabelledBy = value\n this._removeHostAttribute('aria-labelledby')\n this.requestUpdate()\n }\n\n get ariaDescribedBy(): string | null {\n return this._ariaDescribedBy\n }\n\n set ariaDescribedBy(value: string | null) {\n if (this._ariaDescribedBy === value) {\n return\n }\n this._ariaDescribedBy = value\n this._removeHostAttribute('aria-describedby')\n this.requestUpdate()\n }\n\n override get autocapitalize(): string {\n return this._autocapitalize\n }\n\n override set autocapitalize(value: string | undefined | null) {\n const normalizedValue = value ?? ''\n if (this._autocapitalize === normalizedValue) {\n return\n }\n this._autocapitalize = normalizedValue\n this._removeHostAttribute('autocapitalize')\n this.requestUpdate()\n }\n\n override get spellcheck(): boolean {\n return this._spellcheck ?? super.spellcheck\n }\n\n override set spellcheck(value: boolean | undefined | null) {\n if (this._spellcheck === value) {\n return\n }\n this._spellcheck = value ?? null\n this._removeHostAttribute('spellcheck')\n this.requestUpdate()\n }\n\n override get title(): string {\n return this._title\n }\n\n override set title(value: string | undefined | null) {\n const normalizedValue = value ?? ''\n if (this._title === normalizedValue) {\n return\n }\n this._title = normalizedValue\n this._removeHostAttribute('title')\n this.requestUpdate()\n }\n\n override get id(): string {\n return this._id\n }\n\n override set id(value: string | undefined | null) {\n const normalizedValue = value ?? ''\n if (this._id === normalizedValue) {\n return\n }\n this._id = normalizedValue\n this._removeHostAttribute('id')\n this.requestUpdate()\n }\n\n override get autofocus(): boolean {\n return this._autofocus\n }\n\n override set autofocus(value: boolean | undefined | null) {\n const normalizedValue = !!value\n if (this._autofocus === normalizedValue) {\n return\n }\n this._autofocus = normalizedValue\n this._removeHostAttribute('autofocus')\n this.requestUpdate()\n }\n\n // Spectre components intentionally render in light DOM so the global\n // `@phcdevworks/spectre-ui` styling contract can apply directly.\n createRenderRoot(): this {\n return this\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n\n const proxiedAttributes = [\n 'id',\n 'title',\n 'autocapitalize',\n 'autofocus',\n 'spellcheck',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby'\n ]\n\n proxiedAttributes.forEach((attr) => {\n const value = super.getAttribute(attr)\n if (value !== null) {\n this.setAttribute(attr, value)\n }\n })\n }\n\n override getAttribute(qualifiedName: string): string | null {\n switch (qualifiedName) {\n case 'id':\n return this.id || null\n case 'title':\n return this.title || null\n case 'autocapitalize':\n return this.autocapitalize || null\n case 'autofocus':\n return this.autofocus ? '' : null\n case 'spellcheck':\n return this._spellcheck !== null ? String(this._spellcheck) : null\n case 'aria-label':\n return this.ariaLabel\n case 'aria-labelledby':\n return this.ariaLabelledBy\n case 'aria-describedby':\n return this.ariaDescribedBy\n default:\n return super.getAttribute(qualifiedName)\n }\n }\n\n override hasAttribute(qualifiedName: string): boolean {\n switch (qualifiedName) {\n case 'id':\n return this.id !== ''\n case 'title':\n return this.title !== ''\n case 'autocapitalize':\n return this.autocapitalize !== ''\n case 'autofocus':\n return this.autofocus\n case 'spellcheck':\n return this._spellcheck !== null\n case 'aria-label':\n return this.ariaLabel !== null\n case 'aria-labelledby':\n return this.ariaLabelledBy !== null\n case 'aria-describedby':\n return this.ariaDescribedBy !== null\n default:\n return super.hasAttribute(qualifiedName)\n }\n }\n\n override setAttribute(qualifiedName: string, value: string): void {\n switch (qualifiedName) {\n case 'id':\n this.id = value\n break\n case 'title':\n this.title = value\n break\n case 'autocapitalize':\n this.autocapitalize = value\n break\n case 'autofocus':\n this.autofocus = true\n break\n case 'spellcheck':\n this.spellcheck = value !== 'false'\n break\n case 'aria-label':\n this.ariaLabel = value\n break\n case 'aria-labelledby':\n this.ariaLabelledBy = value\n break\n case 'aria-describedby':\n this.ariaDescribedBy = value\n break\n default:\n super.setAttribute(qualifiedName, value)\n }\n }\n\n override removeAttribute(qualifiedName: string): void {\n switch (qualifiedName) {\n case 'id':\n this.id = ''\n break\n case 'title':\n this.title = ''\n break\n case 'autocapitalize':\n this.autocapitalize = ''\n break\n case 'autofocus':\n this.autofocus = false\n break\n case 'spellcheck':\n this.spellcheck = null\n break\n case 'aria-label':\n this.ariaLabel = null\n break\n case 'aria-labelledby':\n this.ariaLabelledBy = null\n break\n case 'aria-describedby':\n this.ariaDescribedBy = null\n break\n default:\n super.removeAttribute(qualifiedName)\n }\n }\n\n private _removeHostAttribute(name: string): void {\n const host = this as unknown as HTMLElement\n if (HTMLElement.prototype.hasAttribute.call(host, name)) {\n // Use the native removeAttribute to avoid our own overridden version\n // which would reset the internal state.\n HTMLElement.prototype.removeAttribute.call(host, name)\n }\n }\n\n protected get forwardedAriaLabel(): string | undefined {\n const value = this.ariaLabel?.trim()\n return value ? value : undefined\n }\n\n protected get forwardedAriaLabelledBy(): string | undefined {\n const value = this.ariaLabelledBy?.trim()\n return value ? value : undefined\n }\n\n protected get forwardedAriaDescribedBy(): string | undefined {\n const value = this.ariaDescribedBy?.trim()\n return value ? value : undefined\n }\n\n // Subclasses that expose `disabled`/`loading` properties get this disabled\n // calculation for free instead of redeclaring it per component.\n protected get isDisabled(): boolean {\n const self = this as unknown as { disabled?: boolean; loading?: boolean }\n return (self.disabled ?? false) || (self.loading ?? false)\n }\n\n // Subclasses get this for free instead of redeclaring it per component.\n protected get hasForwardedLabel(): boolean {\n return Boolean(this.forwardedAriaLabel || this.forwardedAriaLabelledBy)\n }\n}\n","export function hasMeaningfulContent(nodes: readonly Node[]): boolean {\n return nodes.some((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n return (node.textContent?.trim().length ?? 0) > 0\n }\n\n return false\n })\n}\n\nlet idCounter = 0\n\nexport function createUniqueId(prefix: string): string {\n idCounter += 1\n return `${prefix}-${idCounter}`\n}\n\n// Swaps the recipe classes this component previously applied to `element`\n// without touching classes the author set.\nexport function replaceClasses(\n element: Element,\n previous: string,\n next: string\n): void {\n const nextTokens = next.split(/\\s+/).filter(Boolean)\n previous\n .split(/\\s+/)\n .filter((token) => token && !nextTokens.includes(token))\n .forEach((token) => element.classList.remove(token))\n element.classList.add(...nextTokens)\n}\n\n// Parent/child component pairs identify each other through a global symbol\n// rather than `instanceof`, because every subpath entry bundles its own copy\n// of the child class.\nexport const spectreKindKey: unique symbol = Symbol.for(\n 'phcdevworks.spectre-components.kind'\n)\n\nexport function isSpectreKind<T extends Element>(\n node: Node,\n kind: string\n): node is T {\n return (node as { [spectreKindKey]?: string })[spectreKindKey] === kind\n}\n","// Adds a recipe's part classes to authored elements that opt in with\n// `slot=\"<part>\"`. The elements stay where they were authored, so free-form\n// layouts (footer columns, menu groups) keep their order.\nexport function applyPartClasses(\n elements: Iterable<Element>,\n parts: Readonly<Record<string, string>>\n): void {\n for (const element of elements) {\n const part = element.getAttribute('slot')\n const classes = part ? parts[part] : undefined\n if (classes) {\n element.classList.add(...classes.split(/\\s+/).filter(Boolean))\n }\n }\n}\n\nexport function childElements(nodes: readonly Node[]): Element[] {\n return nodes.filter(\n (node): node is Element => node.nodeType === Node.ELEMENT_NODE\n )\n}\n","import {\n type ButtonSize,\n type ButtonVariant,\n type InputSize\n} from '@phcdevworks/spectre-ui'\n\nexport const spectreInputSizes = ['sm', 'md', 'lg'] as const\nexport type SpectreInputSize = (typeof spectreInputSizes)[number]\n\nexport function isInputSize(value: unknown): value is InputSize | ButtonSize {\n return (spectreInputSizes as readonly string[]).includes(value as string)\n}\n\nexport const spectreButtonVariants = [\n 'primary',\n 'secondary',\n 'ghost',\n 'danger',\n 'success',\n 'cta',\n 'accent',\n 'inverse',\n 'warning',\n 'link',\n 'light',\n 'dark'\n] as const\n\nexport type SpectreButtonVariant = (typeof spectreButtonVariants)[number]\n\nexport function isButtonVariant(value: unknown): value is ButtonVariant {\n return (spectreButtonVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreButtonTypes = ['button', 'submit', 'reset'] as const\n\nexport type SpectreButtonType = (typeof spectreButtonTypes)[number]\n\nexport function isButtonType(value: unknown): value is SpectreButtonType {\n return (spectreButtonTypes as readonly string[]).includes(value as string)\n}\n\nexport const spectreInputTypes = [\n 'text',\n 'email',\n 'password',\n 'search',\n 'tel',\n 'url',\n 'number',\n 'date',\n 'datetime-local',\n 'month',\n 'time',\n 'week'\n] as const\n\nexport type SpectreInputType = (typeof spectreInputTypes)[number]\n\nexport function isInputType(value: unknown): value is SpectreInputType {\n return (spectreInputTypes as readonly string[]).includes(value as string)\n}\n\nexport const spectreBadgeVariants = [\n 'primary',\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n 'neutral',\n 'info',\n 'ghost',\n 'outline',\n 'accent',\n 'cta',\n 'inverse',\n 'brand'\n] as const\n\nexport type SpectreBadgeVariant = (typeof spectreBadgeVariants)[number]\n\nexport function isBadgeVariant(value: unknown): value is SpectreBadgeVariant {\n return (spectreBadgeVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreAlertVariants = [\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'neutral',\n 'brand'\n] as const\n\nexport type SpectreAlertVariant = (typeof spectreAlertVariants)[number]\n\nexport function isAlertVariant(value: unknown): value is SpectreAlertVariant {\n return (spectreAlertVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreCardVariants = [\n 'elevated',\n 'flat',\n 'outline',\n 'ghost'\n] as const\n\nexport type SpectreCardVariant = (typeof spectreCardVariants)[number]\n\nexport function isCardVariant(value: unknown): value is SpectreCardVariant {\n return (spectreCardVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreCardPaddingSizes = ['sm', 'md', 'lg'] as const\n\nexport type SpectreCardPaddingSize = (typeof spectreCardPaddingSizes)[number]\n\nexport function isCardPaddingSize(\n value: unknown\n): value is SpectreCardPaddingSize {\n return (spectreCardPaddingSizes as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreAccentEdges = ['top', 'right', 'bottom', 'left'] as const\n\nexport type SpectreAccentEdge = (typeof spectreAccentEdges)[number]\n\nexport function isAccentEdge(value: unknown): value is SpectreAccentEdge {\n return (spectreAccentEdges as readonly string[]).includes(value as string)\n}\n\nexport const spectreAccentColors = [\n 'neutral',\n 'brand',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'cta'\n] as const\n\nexport type SpectreAccentColor = (typeof spectreAccentColors)[number]\n\nexport function isAccentColor(value: unknown): value is SpectreAccentColor {\n return (spectreAccentColors as readonly string[]).includes(value as string)\n}\n\nexport const spectreIconBoxVariants = [\n 'primary',\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n 'info',\n 'neutral',\n 'ghost',\n 'accent',\n 'cta',\n 'outline'\n] as const\n\nexport type SpectreIconBoxVariant = (typeof spectreIconBoxVariants)[number]\n\nexport function isIconBoxVariant(\n value: unknown\n): value is SpectreIconBoxVariant {\n return (spectreIconBoxVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreTestimonialVariants = [\n 'elevated',\n 'flat',\n 'outline',\n 'ghost'\n] as const\n\nexport type SpectreTestimonialVariant =\n (typeof spectreTestimonialVariants)[number]\n\nexport function isTestimonialVariant(\n value: unknown\n): value is SpectreTestimonialVariant {\n return (spectreTestimonialVariants as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreSpinnerVariants = [\n 'primary',\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n 'info',\n 'neutral',\n 'accent',\n 'cta',\n 'inverse'\n] as const\n\nexport type SpectreSpinnerVariant = (typeof spectreSpinnerVariants)[number]\n\nexport function isSpinnerVariant(\n value: unknown\n): value is SpectreSpinnerVariant {\n return (spectreSpinnerVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreTagVariants = [\n 'default',\n 'primary',\n 'secondary',\n 'success',\n 'warning',\n 'danger',\n 'info',\n 'neutral',\n 'accent',\n 'cta',\n 'outline',\n 'ghost'\n] as const\n\nexport type SpectreTagVariant = (typeof spectreTagVariants)[number]\n\nexport function isTagVariant(value: unknown): value is SpectreTagVariant {\n return (spectreTagVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreAvatarSizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const\n\nexport type SpectreAvatarSize = (typeof spectreAvatarSizes)[number]\n\nexport function isAvatarSize(value: unknown): value is SpectreAvatarSize {\n return (spectreAvatarSizes as readonly string[]).includes(value as string)\n}\n\nexport const spectreAvatarShapes = ['circle', 'square'] as const\n\nexport type SpectreAvatarShape = (typeof spectreAvatarShapes)[number]\n\nexport function isAvatarShape(value: unknown): value is SpectreAvatarShape {\n return (spectreAvatarShapes as readonly string[]).includes(value as string)\n}\n\nexport const spectreContainerMaxWidths = ['none', 'prose', 'wide'] as const\n\nexport type SpectreContainerMaxWidth =\n (typeof spectreContainerMaxWidths)[number]\n\nexport function isContainerMaxWidth(\n value: unknown\n): value is SpectreContainerMaxWidth {\n return (spectreContainerMaxWidths as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreGridColumns = [1, 2, 3, 4, 6, 12] as const\n\nexport type SpectreGridColumns = (typeof spectreGridColumns)[number]\n\nexport function isGridColumns(value: unknown): value is SpectreGridColumns {\n return (spectreGridColumns as readonly number[]).includes(value as number)\n}\n\nexport const spectreGridGaps = ['sm', 'md', 'lg'] as const\n\nexport type SpectreGridGap = (typeof spectreGridGaps)[number]\n\nexport function isGridGap(value: unknown): value is SpectreGridGap {\n return (spectreGridGaps as readonly string[]).includes(value as string)\n}\n\nexport const spectreGridAligns = [\n 'start',\n 'center',\n 'end',\n 'baseline',\n 'stretch'\n] as const\n\nexport type SpectreGridAlign = (typeof spectreGridAligns)[number]\n\nexport function isGridAlign(value: unknown): value is SpectreGridAlign {\n return (spectreGridAligns as readonly string[]).includes(value as string)\n}\n\nexport const spectreGridSpans = [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 'full'\n] as const\n\nexport type SpectreGridSpan = (typeof spectreGridSpans)[number]\n\nexport function isGridSpan(value: unknown): value is SpectreGridSpan {\n return (spectreGridSpans as readonly (number | string)[]).includes(\n value as number | string\n )\n}\n\nexport interface SpectreGridSpanOptions {\n base?: SpectreGridSpan\n md?: SpectreGridSpan\n lg?: SpectreGridSpan\n}\n\nexport function isGridSpanOptions(\n value: unknown\n): value is SpectreGridSpanOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n (candidate.base === undefined || isGridSpan(candidate.base)) &&\n (candidate.md === undefined || isGridSpan(candidate.md)) &&\n (candidate.lg === undefined || isGridSpan(candidate.lg))\n )\n}\n\nexport const spectreGridOffsets = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11\n] as const\n\nexport type SpectreGridOffset = (typeof spectreGridOffsets)[number]\n\nexport function isGridOffset(value: unknown): value is SpectreGridOffset {\n return (spectreGridOffsets as readonly number[]).includes(value as number)\n}\n\nexport interface SpectreGridOffsetOptions {\n base?: SpectreGridOffset\n md?: SpectreGridOffset\n lg?: SpectreGridOffset\n}\n\nexport function isGridOffsetOptions(\n value: unknown\n): value is SpectreGridOffsetOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n (candidate.base === undefined || isGridOffset(candidate.base)) &&\n (candidate.md === undefined || isGridOffset(candidate.md)) &&\n (candidate.lg === undefined || isGridOffset(candidate.lg))\n )\n}\n\nexport const spectreGridOrders = [\n 'first',\n 'last',\n 'none',\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12\n] as const\n\nexport type SpectreGridOrder = (typeof spectreGridOrders)[number]\n\nexport function isGridOrder(value: unknown): value is SpectreGridOrder {\n return (spectreGridOrders as readonly (number | string)[]).includes(\n value as number | string\n )\n}\n\nexport interface SpectreGridOrderOptions {\n base?: SpectreGridOrder\n md?: SpectreGridOrder\n lg?: SpectreGridOrder\n}\n\nexport function isGridOrderOptions(\n value: unknown\n): value is SpectreGridOrderOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n (candidate.base === undefined || isGridOrder(candidate.base)) &&\n (candidate.md === undefined || isGridOrder(candidate.md)) &&\n (candidate.lg === undefined || isGridOrder(candidate.lg))\n )\n}\n\nexport const spectreGridLeadingWeights = [1.5, 1.6, 2, 2.5, 3] as const\n\nexport type SpectreGridLeadingWeight =\n (typeof spectreGridLeadingWeights)[number]\n\nexport function isGridLeadingWeight(\n value: unknown\n): value is SpectreGridLeadingWeight {\n return (spectreGridLeadingWeights as readonly number[]).includes(\n value as number\n )\n}\n\nexport interface SpectreGridLeadingWeightOptions {\n base?: SpectreGridLeadingWeight\n md?: SpectreGridLeadingWeight\n lg?: SpectreGridLeadingWeight\n}\n\nexport function isGridLeadingWeightOptions(\n value: unknown\n): value is SpectreGridLeadingWeightOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n (candidate.base === undefined || isGridLeadingWeight(candidate.base)) &&\n (candidate.md === undefined || isGridLeadingWeight(candidate.md)) &&\n (candidate.lg === undefined || isGridLeadingWeight(candidate.lg))\n )\n}\n\nexport interface SpectreGridLeadingTracksOptions {\n weight: SpectreGridLeadingWeight | SpectreGridLeadingWeightOptions\n}\n\nexport function isGridLeadingTracksOptions(\n value: unknown\n): value is SpectreGridLeadingTracksOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n isGridLeadingWeight(candidate.weight) ||\n isGridLeadingWeightOptions(candidate.weight)\n )\n}\n\nexport const spectreGridFixedTrackCounts = [1, 2, 3, 4] as const\n\nexport type SpectreGridFixedTrackCount =\n (typeof spectreGridFixedTrackCounts)[number]\n\nexport function isGridFixedTrackCount(\n value: unknown\n): value is SpectreGridFixedTrackCount {\n return (spectreGridFixedTrackCounts as readonly number[]).includes(\n value as number\n )\n}\n\nexport interface SpectreGridFixedTracksOptions {\n count: SpectreGridFixedTrackCount\n}\n\nexport function isGridFixedTracksOptions(\n value: unknown\n): value is SpectreGridFixedTracksOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return isGridFixedTrackCount(candidate.count)\n}\n\nexport const spectreGridTemplates = [\n 'edge-fluid-edge',\n 'label-fluid-fluid'\n] as const\n\nexport type SpectreGridTemplate = (typeof spectreGridTemplates)[number]\n\nexport function isGridTemplate(value: unknown): value is SpectreGridTemplate {\n return (spectreGridTemplates as readonly string[]).includes(value as string)\n}\n\nexport interface SpectreGridExplicitTemplateOptions {\n template: SpectreGridTemplate\n weight?: SpectreGridLeadingWeight\n}\n\nexport function isGridExplicitTemplateOptions(\n value: unknown\n): value is SpectreGridExplicitTemplateOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n isGridTemplate(candidate.template) &&\n (candidate.weight === undefined || isGridLeadingWeight(candidate.weight))\n )\n}\n\nexport const spectreStackDirections = ['vertical', 'horizontal'] as const\n\nexport type SpectreStackDirection = (typeof spectreStackDirections)[number]\n\nexport function isStackDirection(\n value: unknown\n): value is SpectreStackDirection {\n return (spectreStackDirections as readonly string[]).includes(value as string)\n}\n\nexport const spectreStackBases = ['none', 'sidebar'] as const\n\nexport type SpectreStackBasis = (typeof spectreStackBases)[number]\n\nexport function isStackBasis(value: unknown): value is SpectreStackBasis {\n return (spectreStackBases as readonly string[]).includes(value as string)\n}\n\nexport const spectreNavAligns = ['start', 'center', 'end'] as const\n\nexport type SpectreNavAlign = (typeof spectreNavAligns)[number]\n\nexport function isNavAlign(value: unknown): value is SpectreNavAlign {\n return (spectreNavAligns as readonly string[]).includes(value as string)\n}\n\nexport const spectreStackAligns = ['center', 'stretch'] as const\n\nexport type SpectreStackAlign = (typeof spectreStackAligns)[number]\n\nexport function isStackAlign(value: unknown): value is SpectreStackAlign {\n return (spectreStackAligns as readonly string[]).includes(value as string)\n}\n\nexport const spectreStackGaps = ['sm', 'md', 'lg'] as const\n\nexport type SpectreStackGap = (typeof spectreStackGaps)[number]\n\nexport function isStackGap(value: unknown): value is SpectreStackGap {\n return (spectreStackGaps as readonly string[]).includes(value as string)\n}\n\nexport const spectreDropdownPlacements = [\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end'\n] as const\n\nexport type SpectreDropdownPlacement =\n (typeof spectreDropdownPlacements)[number]\n\nexport function isDropdownPlacement(\n value: unknown\n): value is SpectreDropdownPlacement {\n return (spectreDropdownPlacements as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreToastVariants = [\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'neutral'\n] as const\n\nexport type SpectreToastVariant = (typeof spectreToastVariants)[number]\n\nexport function isToastVariant(value: unknown): value is SpectreToastVariant {\n return (spectreToastVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreSidebarLinkLevels = ['parent', 'child'] as const\n\nexport type SpectreSidebarLinkLevel = (typeof spectreSidebarLinkLevels)[number]\n\nexport function isSidebarLinkLevel(\n value: unknown\n): value is SpectreSidebarLinkLevel {\n return (spectreSidebarLinkLevels as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreTooltipPlacements = [\n 'top',\n 'bottom',\n 'left',\n 'right'\n] as const\n\nexport type SpectreTooltipPlacement = (typeof spectreTooltipPlacements)[number]\n\nexport function isTooltipPlacement(\n value: unknown\n): value is SpectreTooltipPlacement {\n return (spectreTooltipPlacements as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreTextSizes = [\n 'xs',\n 'sm',\n 'md',\n 'lg',\n 'xl',\n '2xl',\n '3xl',\n '4xl',\n '5xl',\n '6xl'\n] as const\n\nexport type SpectreTextSize = (typeof spectreTextSizes)[number]\n\nexport function isTextSize(value: unknown): value is SpectreTextSize {\n return (spectreTextSizes as readonly string[]).includes(value as string)\n}\n\nexport const spectreTextVariants = [\n 'default',\n 'muted',\n 'subtle',\n 'meta',\n 'brand',\n 'onInverse',\n 'onInverseMuted',\n 'onSurface',\n 'onSurfaceMuted',\n 'onSurfaceSubtle',\n 'onSurfaceMeta',\n 'onSurfaceBrand'\n] as const\n\nexport type SpectreTextVariant = (typeof spectreTextVariants)[number]\n\nexport function isTextVariant(value: unknown): value is SpectreTextVariant {\n return (spectreTextVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreTextFamilies = ['sans', 'serif', 'mono'] as const\n\nexport type SpectreTextFamily = (typeof spectreTextFamilies)[number]\n\nexport function isTextFamily(value: unknown): value is SpectreTextFamily {\n return (spectreTextFamilies as readonly string[]).includes(value as string)\n}\n\nexport const spectreTextLevels = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'p',\n 'span'\n] as const\n\nexport type SpectreTextLevel = (typeof spectreTextLevels)[number]\n\nexport function isTextLevel(value: unknown): value is SpectreTextLevel {\n return (spectreTextLevels as readonly string[]).includes(value as string)\n}\n\nexport const spectreTextTransforms = [\n 'none',\n 'uppercase',\n 'lowercase',\n 'capitalize'\n] as const\n\nexport type SpectreTextTransform = (typeof spectreTextTransforms)[number]\n\nexport function isTextTransform(value: unknown): value is SpectreTextTransform {\n return (spectreTextTransforms as readonly string[]).includes(value as string)\n}\n\nexport const spectreTabsVariants = ['line', 'pill'] as const\n\nexport type SpectreTabsVariant = (typeof spectreTabsVariants)[number]\n\nexport function isTabsVariant(value: unknown): value is SpectreTabsVariant {\n return (spectreTabsVariants as readonly string[]).includes(value as string)\n}\n\nexport const spectreOffcanvasPlacements = [\n 'start',\n 'end',\n 'top',\n 'bottom'\n] as const\n\nexport type SpectreOffcanvasPlacement =\n (typeof spectreOffcanvasPlacements)[number]\n\nexport function isOffcanvasPlacement(\n value: unknown\n): value is SpectreOffcanvasPlacement {\n return (spectreOffcanvasPlacements as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreTableSizes = ['sm', 'md'] as const\n\nexport type SpectreTableSize = (typeof spectreTableSizes)[number]\n\nexport function isTableSize(value: unknown): value is SpectreTableSize {\n return (spectreTableSizes as readonly string[]).includes(value as string)\n}\n\nexport const spectreStepperOrientations = ['horizontal', 'vertical'] as const\n\nexport type SpectreStepperOrientation =\n (typeof spectreStepperOrientations)[number]\n\nexport function isStepperOrientation(\n value: unknown\n): value is SpectreStepperOrientation {\n return (spectreStepperOrientations as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreSpacingScale = ['sm', 'md', 'lg'] as const\n\nexport type SpectreSpacingStep = (typeof spectreSpacingScale)[number]\n\nexport function isSpacingStep(value: unknown): value is SpectreSpacingStep {\n return (spectreSpacingScale as readonly string[]).includes(value as string)\n}\n\nexport const spectreGridColStarts = [\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12\n] as const\n\nexport type SpectreGridColStart = (typeof spectreGridColStarts)[number]\n\nexport function isGridColStart(value: unknown): value is SpectreGridColStart {\n return (spectreGridColStarts as readonly number[]).includes(value as number)\n}\n\nexport interface SpectreGridColStartOptions {\n base?: SpectreGridColStart\n md?: SpectreGridColStart\n lg?: SpectreGridColStart\n}\n\nexport function isGridColStartOptions(\n value: unknown\n): value is SpectreGridColStartOptions {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const candidate = value as Record<string, unknown>\n return (\n (candidate.base === undefined || isGridColStart(candidate.base)) &&\n (candidate.md === undefined || isGridColStart(candidate.md)) &&\n (candidate.lg === undefined || isGridColStart(candidate.lg))\n )\n}\n\nexport const spectrePopoverPlacements = [\n 'top',\n 'bottom',\n 'left',\n 'right'\n] as const\n\nexport type SpectrePopoverPlacement = (typeof spectrePopoverPlacements)[number]\n\nexport function isPopoverPlacement(\n value: unknown\n): value is SpectrePopoverPlacement {\n return (spectrePopoverPlacements as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreProgressVariants = [\n 'brand',\n 'neutral',\n 'info',\n 'success',\n 'warning',\n 'danger'\n] as const\n\nexport type SpectreProgressVariant = (typeof spectreProgressVariants)[number]\n\nexport function isProgressVariant(\n value: unknown\n): value is SpectreProgressVariant {\n return (spectreProgressVariants as readonly string[]).includes(\n value as string\n )\n}\n\nexport const spectreTextPresets = ['heading', 'display', 'lead'] as const\n\nexport type SpectreTextPreset = (typeof spectreTextPresets)[number]\n\nexport function isTextPreset(value: unknown): value is SpectreTextPreset {\n return (spectreTextPresets as readonly string[]).includes(value as string)\n}\n\nexport const spectreHeadingLevels = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6'\n] as const\n\nexport type SpectreHeadingLevel = (typeof spectreHeadingLevels)[number]\n\nexport function isHeadingLevel(value: unknown): value is SpectreHeadingLevel {\n return (spectreHeadingLevels as readonly string[]).includes(value as string)\n}\n\nexport const spectreDisplayLevels = [1, 2, 3, 4, 5, 6] as const\n\nexport type SpectreDisplayLevel = (typeof spectreDisplayLevels)[number]\n\nexport function isDisplayLevel(value: unknown): value is SpectreDisplayLevel {\n return (spectreDisplayLevels as readonly number[]).includes(value as number)\n}\n\nexport const spectreTableRowVariants = [\n 'neutral',\n 'info',\n 'success',\n 'warning',\n 'danger'\n] as const\n\nexport type SpectreTableRowVariant = (typeof spectreTableRowVariants)[number]\n\nexport function isTableRowVariant(\n value: unknown\n): value is SpectreTableRowVariant {\n return (spectreTableRowVariants as readonly string[]).includes(\n value as string\n )\n}\n\nexport function normalizeInt(\n value: unknown,\n fallback: number | undefined,\n min = 0\n): number | undefined {\n if (\n value == null ||\n typeof value !== 'number' ||\n !Number.isInteger(value) ||\n value < min\n ) {\n return fallback\n }\n return value\n}\n\nconst spectreUtilityClassPattern =\n /^sp-[a-z0-9]+(?:-[a-z0-9]+)*(?:__[a-z0-9]+(?:-[a-z0-9]+)*)?(?:--[a-z0-9]+(?:-[a-z0-9]+)*)?$/\n\nexport function sanitizeUtilityClasses(\n value: string | null | undefined\n): string {\n if (!value) {\n return ''\n }\n return value\n .split(/\\s+/)\n .filter((token) => spectreUtilityClassPattern.test(token))\n .join(' ')\n}\n","// Recipe-forced interaction states. Real interaction is styled by native\n// pseudo-classes; these force the look for documentation, previews, and\n// visual tests.\nexport const hoverFocusStateProperties = {\n focused: { type: Boolean, reflect: true },\n hovered: { type: Boolean, reflect: true }\n} as const\n\nexport const interactionStateProperties = {\n ...hoverFocusStateProperties,\n active: { type: Boolean, reflect: true }\n} as const\n\nexport interface SpectreHoverFocusStateProps {\n focused?: boolean | undefined\n hovered?: boolean | undefined\n}\n\nexport interface SpectreInteractionStateProps extends SpectreHoverFocusStateProps {\n active?: boolean | undefined\n}\n\nexport function hoverFocusStates(element: SpectreHoverFocusStateProps): {\n focused: boolean\n hovered: boolean\n} {\n return {\n focused: element.focused ?? false,\n hovered: element.hovered ?? false\n }\n}\n\nexport function interactionStates(element: SpectreInteractionStateProps): {\n active: boolean\n focused: boolean\n hovered: boolean\n} {\n return { ...hoverFocusStates(element), active: element.active ?? false }\n}\n","import { html, nothing } from 'lit'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { SpectreBaseElement } from '../../utils/base'\nimport { hasMeaningfulContent } from '../../utils/dom'\nimport { applyPartClasses, childElements } from '../../utils/parts'\nimport {\n isAccentColor,\n isAccentEdge,\n isDropdownPlacement,\n type SpectreAccentColor,\n type SpectreAccentEdge,\n type SpectreDropdownPlacement\n} from '../../utils/form'\nimport {\n hoverFocusStateProperties,\n hoverFocusStates,\n type SpectreHoverFocusStateProps\n} from '../../utils/states'\n\nimport {\n getDropdownClasses,\n getDropdownDividerClasses,\n getDropdownHeaderClasses,\n getDropdownItemClasses,\n getDropdownMenuClasses,\n getNavLinkClasses,\n type DropdownAccentColor,\n type DropdownAccentEdge\n} from '@phcdevworks/spectre-ui'\n\nexport interface SpectreNavItemProps extends SpectreHoverFocusStateProps {\n accent?: SpectreAccentEdge | undefined\n accentColor?: SpectreAccentColor | undefined\n active?: boolean | undefined\n ariaLabel?: string | null\n disabled?: boolean | undefined\n dropdown?: boolean | undefined\n fullWidth?: boolean | undefined\n href?: string | undefined\n id?: string | null | undefined\n label?: string | undefined\n mega?: boolean | undefined\n open?: boolean | undefined\n placement?: SpectreDropdownPlacement | undefined\n title?: string | null | undefined\n viewport?: boolean | undefined\n}\n\nexport class SpectreNavItemElement\n extends SpectreBaseElement\n implements SpectreNavItemProps\n{\n static properties = {\n ...hoverFocusStateProperties,\n accent: { type: String, reflect: true },\n accentColor: { attribute: 'accent-color', type: String, reflect: true },\n active: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n dropdown: { type: Boolean, reflect: true },\n fullWidth: { attribute: 'full-width', type: Boolean, reflect: true },\n href: { type: String },\n label: { type: String },\n mega: { type: Boolean, reflect: true },\n open: { type: Boolean, reflect: true },\n placement: { type: String, reflect: true },\n viewport: { type: Boolean, reflect: true }\n }\n\n focused: boolean | undefined = false\n hovered: boolean | undefined = false\n\n accent: SpectreAccentEdge | undefined = undefined\n accentColor: SpectreAccentColor | undefined = undefined\n active: boolean | undefined = false\n disabled: boolean | undefined = false\n dropdown: boolean | undefined = false\n fullWidth: boolean | undefined = false\n href: string | undefined = undefined\n label: string | undefined = undefined\n mega: boolean | undefined = false\n open: boolean | undefined = false\n placement: SpectreDropdownPlacement | undefined = 'bottom-start'\n viewport: boolean | undefined = false\n\n private triggerContent: Node[] = []\n private menuContent: Node[] = []\n private contentObserver?: MutationObserver | undefined\n\n override get id(): string {\n return super.id\n }\n\n override set id(value: string | null | undefined) {\n super.id = value\n }\n\n override get title(): string {\n return super.title\n }\n\n override set title(value: string | null | undefined) {\n super.title = value\n }\n\n private isInternalNode(node: Node): boolean {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false\n }\n const el = node as Element\n return (\n el.hasAttribute('data-sp-nav-item-menu') ||\n el.hasAttribute('data-sp-nav-item-trigger')\n )\n }\n\n private syncProjectedContent(): boolean {\n const nextTriggerContent: Node[] = []\n const nextMenuContent: Node[] = []\n\n this.childNodes.forEach((node) => {\n if (this.isInternalNode(node)) {\n return\n }\n const isTriggerSlot =\n node.nodeType === Node.ELEMENT_NODE &&\n (node as Element).getAttribute('slot') === 'trigger'\n if (isTriggerSlot) {\n nextTriggerContent.push(node)\n } else {\n nextMenuContent.push(node)\n }\n })\n\n const changed =\n nextTriggerContent.length !== this.triggerContent.length ||\n nextTriggerContent.some((n, i) => n !== this.triggerContent[i]) ||\n nextMenuContent.length !== this.menuContent.length ||\n nextMenuContent.some((n, i) => n !== this.menuContent[i])\n\n if (changed) {\n this.triggerContent = nextTriggerContent\n this.menuContent = nextMenuContent\n }\n\n return changed\n }\n\n private get hasTriggerContent(): boolean {\n return hasMeaningfulContent(this.triggerContent)\n }\n\n private get hasMenuContent(): boolean {\n return hasMeaningfulContent(this.menuContent)\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n this.syncProjectedContent()\n this.startContentObserver()\n document.addEventListener('click', this.handleDocumentClick)\n document.addEventListener('keydown', this.handleDocumentKeydown)\n }\n\n override disconnectedCallback(): void {\n this.stopContentObserver()\n document.removeEventListener('click', this.handleDocumentClick)\n document.removeEventListener('keydown', this.handleDocumentKeydown)\n super.disconnectedCallback()\n }\n\n protected override update(\n changedProperties: Map<PropertyKey, unknown>\n ): void {\n this.stopContentObserver()\n super.update(changedProperties)\n this.startContentObserver()\n }\n\n private startContentObserver(): void {\n if (this.contentObserver) {\n return\n }\n this.contentObserver = new MutationObserver(() => {\n if (this.syncProjectedContent()) {\n this.requestUpdate()\n }\n })\n this.contentObserver.observe(this, { childList: true })\n }\n\n private stopContentObserver(): void {\n this.contentObserver?.disconnect()\n this.contentObserver = undefined\n }\n\n protected override willUpdate(\n changedProperties: Map<PropertyKey, unknown>\n ): void {\n if (\n changedProperties.has('accent') &&\n this.accent != null &&\n !isAccentEdge(this.accent)\n ) {\n this.accent = undefined\n }\n if (\n changedProperties.has('accentColor') &&\n this.accentColor != null &&\n !isAccentColor(this.accentColor)\n ) {\n this.accentColor = undefined\n }\n if (changedProperties.has('active') && this.active == null) {\n this.active = false\n }\n if (changedProperties.has('disabled') && this.disabled == null) {\n this.disabled = false\n }\n if (changedProperties.has('fullWidth') && this.fullWidth == null) {\n this.fullWidth = false\n }\n if (changedProperties.has('viewport') && this.viewport == null) {\n this.viewport = false\n }\n if (changedProperties.has('dropdown') && this.dropdown == null) {\n this.dropdown = false\n }\n if (changedProperties.has('mega') && this.mega == null) {\n this.mega = false\n }\n if (changedProperties.has('open') && this.open == null) {\n this.open = false\n }\n if (\n changedProperties.has('placement') &&\n (this.placement == null || !isDropdownPlacement(this.placement))\n ) {\n this.placement = 'bottom-start'\n }\n }\n\n protected override updated(\n changedProperties: Map<PropertyKey, unknown>\n ): void {\n super.updated(changedProperties)\n applyPartClasses(childElements(this.menuContent), {\n divider: getDropdownDividerClasses(),\n header: getDropdownHeaderClasses(),\n item: getDropdownItemClasses()\n })\n }\n\n private handleDocumentClick = (event: MouseEvent): void => {\n if (!this.open) {\n return\n }\n if (!event.composedPath().includes(this)) {\n this.close()\n }\n }\n\n private handleDocumentKeydown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape' && this.open) {\n this.close()\n this.triggerElement?.focus()\n }\n }\n\n private get triggerElement(): HTMLButtonElement | null {\n return this.querySelector('[data-sp-nav-item-trigger]')\n }\n\n private toggle(): void {\n if (this.open) {\n this.close()\n } else {\n this.openMenu()\n }\n }\n\n private openMenu(): void {\n if (this.open) {\n return\n }\n this.open = true\n this.dispatchEvent(new CustomEvent('sp-open', { bubbles: true }))\n }\n\n private close(): void {\n if (!this.open) {\n return\n }\n this.open = false\n this.dispatchEvent(new CustomEvent('sp-close', { bubbles: true }))\n }\n\n private get wrapperClasses(): string {\n return getDropdownClasses({\n fullWidth: this.fullWidth ?? false,\n mega: this.mega ?? false,\n viewport: this.viewport ?? false\n })\n }\n\n private get menuClasses(): string {\n return getDropdownMenuClasses({\n ...(this.accent !== undefined && {\n accent: this.accent as DropdownAccentEdge\n }),\n ...(this.accentColor !== undefined && {\n accentColor: this.accentColor as DropdownAccentColor\n }),\n mega: this.mega ?? false,\n viewport: this.viewport ?? false,\n open: this.open ?? false,\n placement: this.placement as SpectreDropdownPlacement\n })\n }\n\n private get navLinkClasses(): string {\n return getNavLinkClasses({\n ...hoverFocusStates(this),\n active: this.active ?? false,\n disabled: this.disabled ?? false\n })\n }\n\n private renderLink() {\n return html`<a\n aria-current=\"${ifDefined(this.active ? 'page' : undefined)}\"\n aria-disabled=\"${ifDefined(this.disabled ? 'true' : undefined)}\"\n aria-label=\"${ifDefined(this.forwardedAriaLabel)}\"\n class=\"${this.navLinkClasses}\"\n href=\"${ifDefined(this.disabled ? undefined : this.href)}\"\n id=\"${ifDefined(this.id || undefined)}\"\n title=\"${ifDefined(this.title || undefined)}\"\n >${this.hasMenuContent ? this.menuContent : this.label}</a\n >`\n }\n\n private renderDropdown() {\n return html`<div\n class=\"${this.wrapperClasses}\"\n id=\"${ifDefined(this.id || undefined)}\"\n title=\"${ifDefined(this.title || undefined)}\"\n >\n <button\n aria-expanded=\"${this.open ? 'true' : 'false'}\"\n aria-haspopup=\"true\"\n aria-label=\"${ifDefined(this.forwardedAriaLabel ?? this.label)}\"\n class=\"${this.navLinkClasses}\"\n data-sp-nav-item-trigger\n ?disabled=\"${this.disabled ?? false}\"\n type=\"button\"\n @click=\"${() => this.toggle()}\"\n >\n ${this.hasTriggerContent ? this.triggerContent : this.label}\n </button>\n <div class=\"${this.menuClasses}\" data-sp-nav-item-menu>\n ${this.hasMenuContent ? this.menuContent : nothing}\n </div>\n </div>`\n }\n\n override render() {\n return this.dropdown ? this.renderDropdown() : this.renderLink()\n }\n}\n\nexport function defineSpectreNavItem(\n tagName = 'sp-nav-item'\n): typeof SpectreNavItemElement {\n const existingElement = customElements.get(tagName)\n\n if (existingElement) {\n return existingElement as unknown as typeof SpectreNavItemElement\n }\n\n customElements.define(tagName, SpectreNavItemElement)\n return SpectreNavItemElement\n}\n"]}
package/dist/nav.cjs CHANGED
@@ -5,6 +5,22 @@ var ifDefined_js = require('lit/directives/if-defined.js');
5
5
  var spectreUi = require('@phcdevworks/spectre-ui');
6
6
 
7
7
  // src/components/nav/sp-nav.ts
8
+
9
+ // src/utils/parts.ts
10
+ function applyPartClasses(elements, parts) {
11
+ for (const element of elements) {
12
+ const part = element.getAttribute("slot");
13
+ const classes = part ? parts[part] : void 0;
14
+ if (classes) {
15
+ element.classList.add(...classes.split(/\s+/).filter(Boolean));
16
+ }
17
+ }
18
+ }
19
+ function childElements(nodes) {
20
+ return nodes.filter(
21
+ (node) => node.nodeType === Node.ELEMENT_NODE
22
+ );
23
+ }
8
24
  var SpectreBaseElement = class extends lit.LitElement {
9
25
  constructor() {
10
26
  super(...arguments);
@@ -315,7 +331,9 @@ var SpectreProjectableElement = class extends SpectreBaseElement {
315
331
  nextProjectedContent.push(node);
316
332
  }
317
333
  });
318
- const hasChanged = nextProjectedContent.length !== this.projectedContent.length || nextProjectedContent.some((node, index) => node !== this.projectedContent[index]);
334
+ const hasChanged = nextProjectedContent.length !== this.projectedContent.length || nextProjectedContent.some(
335
+ (node, index) => node !== this.projectedContent[index]
336
+ );
319
337
  if (hasChanged) {
320
338
  this.projectedContent = nextProjectedContent;
321
339
  }
@@ -345,6 +363,22 @@ var SpectreProjectableElement = class extends SpectreBaseElement {
345
363
  this.contentObserver = void 0;
346
364
  }
347
365
  };
366
+ var spectreAccentEdges = ["top", "right", "bottom", "left"];
367
+ function isAccentEdge(value) {
368
+ return spectreAccentEdges.includes(value);
369
+ }
370
+ var spectreAccentColors = [
371
+ "neutral",
372
+ "brand",
373
+ "info",
374
+ "success",
375
+ "warning",
376
+ "danger",
377
+ "cta"
378
+ ];
379
+ function isAccentColor(value) {
380
+ return spectreAccentColors.includes(value);
381
+ }
348
382
  var spectreNavAligns = ["start", "center", "end"];
349
383
  function isNavAlign(value) {
350
384
  return spectreNavAligns.includes(value);
@@ -359,6 +393,8 @@ function sanitizeUtilityClasses(value) {
359
393
  var SpectreNavElement = class extends SpectreProjectableElement {
360
394
  constructor() {
361
395
  super(...arguments);
396
+ this.accent = void 0;
397
+ this.accentColor = void 0;
362
398
  this.align = void 0;
363
399
  this.bordered = false;
364
400
  this.fullWidth = false;
@@ -393,6 +429,12 @@ var SpectreNavElement = class extends SpectreProjectableElement {
393
429
  return el.hasAttribute("data-sp-nav-native");
394
430
  }
395
431
  willUpdate(changedProperties) {
432
+ if (changedProperties.has("accent") && this.accent != null && !isAccentEdge(this.accent)) {
433
+ this.accent = void 0;
434
+ }
435
+ if (changedProperties.has("accentColor") && this.accentColor != null && !isAccentColor(this.accentColor)) {
436
+ this.accentColor = void 0;
437
+ }
396
438
  if (changedProperties.has("bordered") && this.bordered == null) {
397
439
  this.bordered = false;
398
440
  }
@@ -408,6 +450,12 @@ var SpectreNavElement = class extends SpectreProjectableElement {
408
450
  }
409
451
  get navClasses() {
410
452
  const recipeClasses = spectreUi.getNavClasses({
453
+ ...this.accent !== void 0 && {
454
+ accent: this.accent
455
+ },
456
+ ...this.accentColor !== void 0 && {
457
+ accentColor: this.accentColor
458
+ },
411
459
  bordered: this.bordered ?? false,
412
460
  fullWidth: this.fullWidth ?? false,
413
461
  sticky: this.sticky ?? false,
@@ -416,6 +464,12 @@ var SpectreNavElement = class extends SpectreProjectableElement {
416
464
  const utilityClasses = sanitizeUtilityClasses(this.innerClass);
417
465
  return utilityClasses ? `${recipeClasses} ${utilityClasses}` : recipeClasses;
418
466
  }
467
+ updated(changedProperties) {
468
+ super.updated(changedProperties);
469
+ applyPartClasses(childElements(this.projectedContent), {
470
+ links: spectreUi.getNavLinksClasses()
471
+ });
472
+ }
419
473
  render() {
420
474
  return lit.html`<nav
421
475
  aria-label="${ifDefined_js.ifDefined(this.forwardedAriaLabel)}"
@@ -429,6 +483,8 @@ var SpectreNavElement = class extends SpectreProjectableElement {
429
483
  }
430
484
  };
431
485
  SpectreNavElement.properties = {
486
+ accent: { type: String, reflect: true },
487
+ accentColor: { attribute: "accent-color", type: String, reflect: true },
432
488
  align: { type: String, reflect: true },
433
489
  bordered: { type: Boolean, reflect: true },
434
490
  fullWidth: { attribute: "full-width", type: Boolean, reflect: true },