@phcdevworks/spectre-components 1.15.0 → 1.17.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 (138) hide show
  1. package/README.md +129 -29
  2. package/dist/alert.cjs.map +1 -1
  3. package/dist/alert.d.cts +2 -2
  4. package/dist/alert.d.ts +2 -2
  5. package/dist/alert.js.map +1 -1
  6. package/dist/avatar.cjs.map +1 -1
  7. package/dist/avatar.d.cts +2 -2
  8. package/dist/avatar.d.ts +2 -2
  9. package/dist/avatar.js.map +1 -1
  10. package/dist/badge.cjs.map +1 -1
  11. package/dist/badge.d.cts +2 -2
  12. package/dist/badge.d.ts +2 -2
  13. package/dist/badge.js.map +1 -1
  14. package/dist/button.cjs +18 -1
  15. package/dist/button.cjs.map +1 -1
  16. package/dist/button.d.cts +14 -2
  17. package/dist/button.d.ts +14 -2
  18. package/dist/button.js +18 -1
  19. package/dist/button.js.map +1 -1
  20. package/dist/card.cjs +21 -2
  21. package/dist/card.cjs.map +1 -1
  22. package/dist/card.d.cts +12 -3
  23. package/dist/card.d.ts +12 -3
  24. package/dist/card.js +21 -2
  25. package/dist/card.js.map +1 -1
  26. package/dist/container.cjs +1 -1
  27. package/dist/container.cjs.map +1 -1
  28. package/dist/container.d.cts +2 -2
  29. package/dist/container.d.ts +2 -2
  30. package/dist/container.js +1 -1
  31. package/dist/container.js.map +1 -1
  32. package/dist/dropdown.cjs.map +1 -1
  33. package/dist/dropdown.d.cts +2 -2
  34. package/dist/dropdown.d.ts +2 -2
  35. package/dist/dropdown.js.map +1 -1
  36. package/dist/footer-chip.cjs +411 -0
  37. package/dist/footer-chip.cjs.map +1 -0
  38. package/dist/footer-chip.d.cts +32 -0
  39. package/dist/footer-chip.d.ts +32 -0
  40. package/dist/footer-chip.js +408 -0
  41. package/dist/footer-chip.js.map +1 -0
  42. package/dist/footer-link.cjs +424 -0
  43. package/dist/footer-link.cjs.map +1 -0
  44. package/dist/footer-link.d.cts +43 -0
  45. package/dist/footer-link.d.ts +43 -0
  46. package/dist/footer-link.js +421 -0
  47. package/dist/footer-link.js.map +1 -0
  48. package/dist/footer.cjs +1 -1
  49. package/dist/footer.cjs.map +1 -1
  50. package/dist/footer.js +1 -1
  51. package/dist/footer.js.map +1 -1
  52. package/dist/{form-BGQjgJrL.d.cts → form-CVRAWo0Q.d.cts} +44 -1
  53. package/dist/{form-BGQjgJrL.d.ts → form-CVRAWo0Q.d.ts} +44 -1
  54. package/dist/grid.cjs +184 -1
  55. package/dist/grid.cjs.map +1 -1
  56. package/dist/grid.d.cts +63 -3
  57. package/dist/grid.d.ts +63 -3
  58. package/dist/grid.js +184 -2
  59. package/dist/grid.js.map +1 -1
  60. package/dist/icon-box.cjs.map +1 -1
  61. package/dist/icon-box.d.cts +2 -2
  62. package/dist/icon-box.d.ts +2 -2
  63. package/dist/icon-box.js.map +1 -1
  64. package/dist/index.cjs +457 -11
  65. package/dist/index.cjs.map +1 -1
  66. package/dist/index.d.cts +4 -1
  67. package/dist/index.d.ts +4 -1
  68. package/dist/index.js +451 -13
  69. package/dist/index.js.map +1 -1
  70. package/dist/input.cjs.map +1 -1
  71. package/dist/input.d.cts +2 -2
  72. package/dist/input.d.ts +2 -2
  73. package/dist/input.js.map +1 -1
  74. package/dist/nav-item.cjs.map +1 -1
  75. package/dist/nav-item.d.cts +1 -1
  76. package/dist/nav-item.d.ts +1 -1
  77. package/dist/nav-item.js.map +1 -1
  78. package/dist/nav.cjs +12 -2
  79. package/dist/nav.cjs.map +1 -1
  80. package/dist/nav.d.cts +7 -0
  81. package/dist/nav.d.ts +7 -0
  82. package/dist/nav.js +12 -2
  83. package/dist/nav.js.map +1 -1
  84. package/dist/rating.cjs.map +1 -1
  85. package/dist/rating.d.cts +2 -2
  86. package/dist/rating.d.ts +2 -2
  87. package/dist/rating.js.map +1 -1
  88. package/dist/section.cjs +1 -1
  89. package/dist/section.cjs.map +1 -1
  90. package/dist/section.js +1 -1
  91. package/dist/section.js.map +1 -1
  92. package/dist/select.cjs.map +1 -1
  93. package/dist/select.d.cts +1 -1
  94. package/dist/select.d.ts +1 -1
  95. package/dist/select.js.map +1 -1
  96. package/dist/sidebar-link.cjs +436 -0
  97. package/dist/sidebar-link.cjs.map +1 -0
  98. package/dist/sidebar-link.d.cts +50 -0
  99. package/dist/sidebar-link.d.ts +50 -0
  100. package/dist/sidebar-link.js +433 -0
  101. package/dist/sidebar-link.js.map +1 -0
  102. package/dist/spinner.cjs.map +1 -1
  103. package/dist/spinner.d.cts +2 -2
  104. package/dist/spinner.d.ts +2 -2
  105. package/dist/spinner.js.map +1 -1
  106. package/dist/stack.cjs +13 -4
  107. package/dist/stack.cjs.map +1 -1
  108. package/dist/stack.d.cts +9 -3
  109. package/dist/stack.d.ts +9 -3
  110. package/dist/stack.js +13 -5
  111. package/dist/stack.js.map +1 -1
  112. package/dist/tag.cjs.map +1 -1
  113. package/dist/tag.d.cts +2 -2
  114. package/dist/tag.d.ts +2 -2
  115. package/dist/tag.js.map +1 -1
  116. package/dist/testimonial.cjs.map +1 -1
  117. package/dist/testimonial.d.cts +2 -2
  118. package/dist/testimonial.d.ts +2 -2
  119. package/dist/testimonial.js.map +1 -1
  120. package/dist/text.cjs +1 -3
  121. package/dist/text.cjs.map +1 -1
  122. package/dist/text.d.cts +2 -2
  123. package/dist/text.d.ts +2 -2
  124. package/dist/text.js +1 -3
  125. package/dist/text.js.map +1 -1
  126. package/dist/textarea.cjs.map +1 -1
  127. package/dist/textarea.d.cts +1 -1
  128. package/dist/textarea.d.ts +1 -1
  129. package/dist/textarea.js.map +1 -1
  130. package/dist/toast.cjs.map +1 -1
  131. package/dist/toast.d.cts +2 -2
  132. package/dist/toast.d.ts +2 -2
  133. package/dist/toast.js.map +1 -1
  134. package/dist/tooltip.cjs.map +1 -1
  135. package/dist/tooltip.d.cts +2 -2
  136. package/dist/tooltip.d.ts +2 -2
  137. package/dist/tooltip.js.map +1 -1
  138. package/package.json +25 -10
package/README.md CHANGED
@@ -16,7 +16,7 @@ consume Spectre without a framework-specific adapter.
16
16
  | Project team | `project-design` |
17
17
  | Repository role | Spectre L3a Lit web component layer |
18
18
  | Package/artifact | `@phcdevworks/spectre-components` |
19
- | Current version/status | 1.15.0 |
19
+ | Current version/status | 1.17.0 |
20
20
 
21
21
  ## Standard Workflow
22
22
 
@@ -347,6 +347,8 @@ when the button needs to navigate rather than submit/act.
347
347
  | `disabled` | boolean | `false` | Disables the button; if `href` is also set, still renders `<button disabled>` |
348
348
  | `full-width` | boolean | `false` | Spans full container width |
349
349
  | `pill` | boolean | `false` | Pill / fully-rounded corners |
350
+ | `compact` | boolean | `false` | Denser padding/height variant |
351
+ | `inner-class` | string | — | Spectre utility classes applied to the native `<button>`/`<a>` |
350
352
  | `name` | string | — | Form field name |
351
353
  | `value` | string | `''` | Submitted value |
352
354
  | `form` | string | — | Associates with a form by ID |
@@ -601,15 +603,16 @@ Renders a `<div>` container backed by the Spectre card recipe.
601
603
 
602
604
  **Attributes**
603
605
 
604
- | Attribute | Type | Default | Description |
605
- | ------------------------- | -------------------------------------- | ---------- | ------------------------------- |
606
- | `variant` | `elevated \| flat \| outline \| ghost` | `elevated` | Visual style |
607
- | `padded` | boolean | `true` | Applies card padding |
608
- | `full-height` | boolean | `false` | Spans full container height |
609
- | `interactive` | boolean | `false` | Applies interactive styling |
610
- | `disabled` | boolean | `false` | Disabled visual state |
611
- | `loading` | boolean | `false` | Busy visual state |
612
- | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
606
+ | Attribute | Type | Default | Description |
607
+ | ------------------------- | -------------------------------------- | ---------- | ----------------------------------------------------------- |
608
+ | `variant` | `elevated \| flat \| outline \| ghost` | `elevated` | Visual style |
609
+ | `padded` | boolean | `true` | Applies card padding; `padded="false"` opts out from markup |
610
+ | `full-height` | boolean | `false` | Spans full container height |
611
+ | `interactive` | boolean | `false` | Applies interactive styling |
612
+ | `disabled` | boolean | `false` | Disabled visual state |
613
+ | `loading` | boolean | `false` | Busy visual state |
614
+ | `inner-class` | string | — | Spectre utility classes applied to the native `<div>` |
615
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
613
616
 
614
617
  **Content projection** — children become the card content.
615
618
 
@@ -860,13 +863,27 @@ Renders a `<div>` grid layout backed by the Spectre grid recipe.
860
863
 
861
864
  **Attributes**
862
865
 
863
- | Attribute | Type | Default | Description |
864
- | ------------------------- | ------------------------------------------------------------ | ------- | ----------------------------------------------------------- |
865
- | `columns` | `1 \| 2 \| 3 \| 4 \| 6 \| 12` | `1` | Number of grid columns |
866
- | `gap` | `sm \| md \| lg` | `md` | Gap between grid items |
867
- | `span` | `1-12 \| 'full'` or `{ base?, md?, lg? }` (JS property only) | — | Column span for a grid item, single value or per-breakpoint |
868
- | `inner-class` | string | — | Spectre utility classes applied to the native `<div>` |
869
- | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
866
+ | Attribute | Type | Default | Description |
867
+ | ------------------------- | ---------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------- |
868
+ | `columns` | `1 \| 2 \| 3 \| 4 \| 6 \| 12` | `1` | Number of grid columns |
869
+ | `gap` | `sm \| md \| lg` | `md` | Gap between grid items |
870
+ | `align` | `start \| center \| end \| baseline \| stretch` | — | Cross-axis alignment of grid items |
871
+ | `span` | `1-12 \| 'full'` or `{ base?, md?, lg? }` (JS property only) | — | Column span for a grid item, single value or per-breakpoint |
872
+ | `column-gap` | `sm \| md \| lg` (JS: `columnGap`) | — | Overrides `gap` on the column axis only |
873
+ | `row-gap` | `sm \| md \| lg` (JS: `rowGap`) | — | Overrides `gap` on the row axis only |
874
+ | `offset` | `0-11` or `{ base?, md?, lg? }` (JS property only) | — | Column offset for a grid item, single value or per-breakpoint |
875
+ | `row-span` | `1-12 \| 'full'` or `{ base?, md?, lg? }` (JS: `rowSpan`) | — | Row span for a grid item, single value or per-breakpoint |
876
+ | `row-offset` | `0-11` or `{ base?, md?, lg? }` (JS: `rowOffset`) | — | Row offset for a grid item, single value or per-breakpoint |
877
+ | `order` | `'first' \| 'last' \| 'none' \| 1-12` or `{ base?, md?, lg? }` (JS property only) | — | Reorders a grid item independent of source order |
878
+ | `leading-tracks` | `{ weight: 1.5\|1.6\|2\|2.5\|3 \| { base?, md?, lg? } }` (JS: `leadingTracks`) | — | One wider leading column plus `columns - 1` equal columns |
879
+ | `fixed-tracks` | `{ count: 1\|2\|3\|4 }` (JS: `fixedTracks`) | — | Fixed-width repeated tracks (`--sp-space-240`), replaces `columns` |
880
+ | `explicit-template` | `{ template: 'edge-fluid-edge'\|'label-fluid-fluid', weight? }` (JS: `explicitTemplate`) | — | Named asymmetric column shape; replaces `columns`/`leadingTracks`/`fixedTracks` |
881
+ | `inner-class` | string | — | Spectre utility classes applied to the native `<div>` |
882
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
883
+
884
+ `leading-tracks`, `fixed-tracks`, `explicit-template`, and any per-breakpoint
885
+ `{ base?, md?, lg? }` shape are JS-property-only (set via the DOM property, not
886
+ an HTML attribute string).
870
887
 
871
888
  **Content projection** — children become grid items.
872
889
 
@@ -902,6 +919,7 @@ Renders a `<div>` flex stack backed by the Spectre stack recipe.
902
919
  | `direction` | `vertical \| horizontal` | `vertical` | Stack axis |
903
920
  | `basis` | `sidebar` | — | Reserves sidebar-sized basis on items |
904
921
  | `align` | `center \| stretch` | `center` | Cross-axis alignment |
922
+ | `gap` | `sm \| md \| lg` | `md` | Gap between stack items |
905
923
  | `inner-class` | string | — | Spectre utility classes applied to the native `<div>` |
906
924
  | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
907
925
 
@@ -931,19 +949,66 @@ etc.).
931
949
 
932
950
  ---
933
951
 
952
+ ### sp-footer-link
953
+
954
+ Renders an `<a>` link styled for `sp-footer` content, backed by the Spectre
955
+ footer link recipe.
956
+
957
+ **Attributes**
958
+
959
+ | Attribute | Type | Default | Description |
960
+ | ------------------------- | ------- | ------- | --------------------------------------------------------------- |
961
+ | `href` | string | — | Link target (dropped when `disabled`) |
962
+ | `active` | boolean | `false` | Marks the link as the current page (`aria-current="page"`) |
963
+ | `disabled` | boolean | `false` | Disables the link (`aria-disabled`, `tabindex="-1"`, no `href`) |
964
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<a>` |
965
+
966
+ **Content projection** — children become the link text.
967
+
968
+ **Internal target** — `[data-sp-footer-link-native]` selects the native `<a>`.
969
+
970
+ ```html
971
+ <sp-footer>
972
+ <sp-footer-link href="/privacy">Privacy</sp-footer-link>
973
+ <sp-footer-link href="/terms" active>Terms</sp-footer-link>
974
+ </sp-footer>
975
+ ```
976
+
977
+ ---
978
+
979
+ ### sp-footer-chip
980
+
981
+ Renders a `<span>` chip styled for `sp-footer` content (e.g. a version or status
982
+ badge), backed by the Spectre footer chip recipe.
983
+
984
+ **Attributes**
985
+
986
+ | Attribute | Type | Default | Description |
987
+ | ------------------------- | ------- | ------- | --------------------------------------- |
988
+ | `disabled` | boolean | `false` | Disabled visual state (`aria-disabled`) |
989
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<span>` |
990
+
991
+ **Content projection** — children become the chip text.
992
+
993
+ **Internal target** — `[data-sp-footer-chip-native]` selects the native
994
+ `<span>`.
995
+
996
+ ---
997
+
934
998
  ### sp-nav
935
999
 
936
1000
  Renders a `<nav>` backed by the Spectre nav recipe.
937
1001
 
938
1002
  **Attributes**
939
1003
 
940
- | Attribute | Type | Default | Description |
941
- | ------------------------- | ------- | ------- | ----------------------------------------------------- |
942
- | `bordered` | boolean | `false` | Adds a bottom border |
943
- | `sticky` | boolean | `false` | Sticks the nav to the viewport |
944
- | `full-width` | boolean | `false` | Spans full container width |
945
- | `inner-class` | string | — | Spectre utility classes applied to the native `<nav>` |
946
- | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<nav>` |
1004
+ | Attribute | Type | Default | Description |
1005
+ | ------------------------- | ------------------------ | ------- | ----------------------------------------------------- |
1006
+ | `bordered` | boolean | `false` | Adds a bottom border |
1007
+ | `sticky` | boolean | `false` | Sticks the nav to the viewport |
1008
+ | `full-width` | boolean | `false` | Spans full container width |
1009
+ | `align` | `start \| center \| end` | — | Horizontal alignment of nav content within the bar |
1010
+ | `inner-class` | string | — | Spectre utility classes applied to the native `<nav>` |
1011
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<nav>` |
947
1012
 
948
1013
  **Content projection** — children become the nav content (links, brand mark,
949
1014
  etc.).
@@ -1036,6 +1101,37 @@ hide the off-canvas panel and backdrop.
1036
1101
 
1037
1102
  ---
1038
1103
 
1104
+ ### sp-sidebar-link
1105
+
1106
+ Renders an `<a>` link styled for `sp-sidebar` navigation content, backed by the
1107
+ Spectre sidebar link recipe.
1108
+
1109
+ **Attributes**
1110
+
1111
+ | Attribute | Type | Default | Description |
1112
+ | ------------------------- | ----------------- | -------- | --------------------------------------------------------------- |
1113
+ | `href` | string | — | Link target (dropped when `disabled`) |
1114
+ | `active` | boolean | `false` | Marks the link as the current page (`aria-current="page"`) |
1115
+ | `disabled` | boolean | `false` | Disables the link (`aria-disabled`, `tabindex="-1"`, no `href`) |
1116
+ | `level` | `parent \| child` | `parent` | Indents/styles the link as a nested (`child`) sidebar link |
1117
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<a>` |
1118
+
1119
+ **Content projection** — children become the link text.
1120
+
1121
+ **Internal target** — `[data-sp-sidebar-link-native]` selects the native `<a>`.
1122
+
1123
+ ```html
1124
+ <sp-sidebar>
1125
+ <sp-sidebar-link href="/dashboard" active>Dashboard</sp-sidebar-link>
1126
+ <sp-sidebar-link href="/settings">Settings</sp-sidebar-link>
1127
+ <sp-sidebar-link href="/settings/billing" level="child"
1128
+ >Billing</sp-sidebar-link
1129
+ >
1130
+ </sp-sidebar>
1131
+ ```
1132
+
1133
+ ---
1134
+
1039
1135
  ### sp-sidebar-toggle
1040
1136
 
1041
1137
  Renders a standalone trigger button that opens/closes a remote `sp-sidebar`,
@@ -1270,10 +1366,11 @@ defineSpectreComponents() // registers all sp-* elements
1270
1366
  `SpectreTagProps`, `SpectrePricingCardProps`
1271
1367
 
1272
1368
  **Layout constants and types**: `spectreContainerMaxWidths`,
1273
- `spectreGridColumns`, `spectreGridGaps`, `spectreStackAligns`,
1274
- `spectreStackBases`, `spectreStackDirections`, `SpectreContainerMaxWidth`,
1275
- `SpectreGridColumns`, `SpectreGridGap`, `SpectreStackAlign`,
1276
- `SpectreStackBasis`, `SpectreStackDirection`, `SpectreContainerProps`,
1369
+ `spectreGridColumns`, `spectreGridGaps`, `spectreGridAligns`,
1370
+ `spectreStackAligns`, `spectreStackBases`, `spectreStackDirections`,
1371
+ `spectreStackGaps`, `SpectreContainerMaxWidth`, `SpectreGridColumns`,
1372
+ `SpectreGridGap`, `SpectreGridAlign`, `SpectreStackAlign`, `SpectreStackBasis`,
1373
+ `SpectreStackDirection`, `SpectreStackGap`, `SpectreContainerProps`,
1277
1374
  `SpectreGridProps`, `SpectreSectionProps`, `SpectreStackProps`
1278
1375
 
1279
1376
  **Interactive constants and types**: `spectreDropdownPlacements`,
@@ -1314,9 +1411,12 @@ Each entry point registers only that component and exports only its surface:
1314
1411
  | `.../nav` | `sp-nav` | `defineSpectreNav`, `SpectreNavElement`, `SpectreNavProps` |
1315
1412
  | `.../nav-item` | `sp-nav-item` | `defineSpectreNavItem`, `SpectreNavItemElement`, `SpectreNavItemProps` |
1316
1413
  | `.../sidebar` | `sp-sidebar` | `defineSpectreSidebar`, `SpectreSidebarElement`, `SpectreSidebarProps` |
1414
+ | `.../sidebar-link` | `sp-sidebar-link` | `defineSpectreSidebarLink`, `SpectreSidebarLinkElement`, `SpectreSidebarLinkProps` |
1317
1415
  | `.../sidebar-toggle` | `sp-sidebar-toggle` | `defineSpectreSidebarToggle`, `SpectreSidebarToggleElement`, `SpectreSidebarToggleProps` |
1318
1416
  | `.../dropdown` | `sp-dropdown` | `defineSpectreDropdown`, `SpectreDropdownElement`, dropdown constants and types |
1319
1417
  | `.../footer` | `sp-footer` | `defineSpectreFooter`, `SpectreFooterElement`, `SpectreFooterProps` |
1418
+ | `.../footer-link` | `sp-footer-link` | `defineSpectreFooterLink`, `SpectreFooterLinkElement`, `SpectreFooterLinkProps` |
1419
+ | `.../footer-chip` | `sp-footer-chip` | `defineSpectreFooterChip`, `SpectreFooterChipElement`, `SpectreFooterChipProps` |
1320
1420
  | `.../modal` | `sp-modal` | `defineSpectreModal`, `SpectreModalElement`, `SpectreModalProps` |
1321
1421
  | `.../toast` | `sp-toast` | `defineSpectreToast`, `SpectreToastElement`, toast constants and types |
1322
1422
  | `.../tooltip` | `sp-tooltip` | `defineSpectreTooltip`, `SpectreTooltipElement`, tooltip constants and types |
@@ -1347,7 +1447,7 @@ npm install
1347
1447
  npm run check # full release validation gate
1348
1448
  ```
1349
1449
 
1350
- Requires Node.js `^22.13.0 || >=24.0.0` and npm `11.16.0`.
1450
+ Requires Node.js `^22.13.0 || >=24.0.0` and npm `12.0.2`.
1351
1451
 
1352
1452
  | Command | Purpose |
1353
1453
  | -------------------------- | ----------------------------------------------------------------------------------------------------- |
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/form.ts","../src/utils/base.ts","../src/utils/dom.ts","../src/utils/projectable.ts","../src/components/alert/sp-alert.ts"],"names":["LitElement","getAlertClasses","html","ifDefined","nothing"],"mappings":";;;;;;;AAMO,IAAM,iBAAA,GAAoB,CAAC,IAAA,EAAM,IAAA,EAAM,IAAI;AAG3C,SAAS,YAAY,KAAA,EAAiD;AAC3E,EAAA,OAAQ,iBAAA,CAAwC,SAAS,KAAe,CAAA;AAC1E;AAmEO,IAAM,oBAAA,GAAuB;AAAA,EAClC,MAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AAIO,SAAS,eAAe,KAAA,EAA8C;AAC3E,EAAA,OAAQ,oBAAA,CAA2C,SAAS,KAAe,CAAA;AAC7E;ACxFO,IAAM,kBAAA,GAAN,cAAiCA,cAAA,CAAW;AAAA,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IAAA,CAAK,mBAAA,GAAsB,IAAA,CAAK,gBAAA,GAAmBC,WAAO;AAAA,UAAA,CAAA;AAAA,EAEhE;AACF;AAvGa,mBAAA,CAIJ,UAAA,GAAa;AAAA,EAClB,SAAA,EAAW,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EAC1C,QAAA,EAAU,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EACzC,WAAW,EAAE,SAAA,EAAW,cAAc,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EACnE,OAAA,EAAS,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EACxC,IAAA,EAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAS,IAAA,EAAK;AAAA,EACpC,OAAA,EAAS,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAS,IAAA;AACpC,CAAA;AA8FK,SAAS,kBAAA,CACd,UAAU,UAAA,EACkB;AAC5B,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,mBAAmB,CAAA;AAClD,EAAA,OAAO,mBAAA;AACT","file":"alert.cjs","sourcesContent":["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] 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] 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 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 spectreGridSpans = [\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, '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 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(\n value as string\n )\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 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 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 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] 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(\n value: unknown\n): value is SpectreTextTransform {\n return (spectreTextTransforms 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 = /^sp-[a-z0-9]+(?:-[a-z0-9]+)*$/\n\nexport function sanitizeUtilityClasses(value: string | null | undefined): string {\n if (!value) {\n return ''\n }\n return value\n .split(/\\s+/)\n .filter((token) => spectreUtilityClassPattern.test(token))\n .join(' ')\n}\n","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 { SpectreBaseElement } from './base';\nimport { hasMeaningfulContent } from './dom';\n\nexport abstract class SpectreProjectableElement extends SpectreBaseElement {\n protected projectedContent: Node[] = [];\n private contentObserver?: MutationObserver | undefined;\n\n // Return the native container whose existing children are also treated as\n // projected content sources (e.g. the rendered <button>, <select>, <label>).\n protected abstract getContentContainer(): Element | null;\n\n // Return true if the node was rendered by this component and should not be\n // treated as external projected content.\n protected abstract isInternalNode(node: Node): boolean;\n\n protected get hasProjectedContent(): boolean {\n return hasMeaningfulContent(this.projectedContent);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.syncProjectedContent();\n this.startContentObserver();\n }\n\n override disconnectedCallback(): void {\n this.stopContentObserver();\n super.disconnectedCallback();\n }\n\n protected override update(changedProperties: Map<PropertyKey, unknown>): void {\n this.stopContentObserver();\n super.update(changedProperties);\n this.startContentObserver();\n }\n\n protected syncProjectedContent(): boolean {\n const nextProjectedContent: Node[] = [];\n const sourceNodes = [\n ...this.childNodes,\n ...(this.getContentContainer()?.childNodes ?? []),\n ];\n\n sourceNodes.forEach((node) => {\n if (!this.isInternalNode(node) && !nextProjectedContent.includes(node)) {\n nextProjectedContent.push(node);\n }\n });\n\n const hasChanged =\n nextProjectedContent.length !== this.projectedContent.length ||\n nextProjectedContent.some((node, index) => node !== this.projectedContent[index]);\n\n if (hasChanged) {\n this.projectedContent = nextProjectedContent;\n }\n\n return hasChanged;\n }\n\n private startContentObserver(): void {\n if (this.contentObserver) {\n return;\n }\n\n this.contentObserver = new MutationObserver((mutations) => {\n const isInternalMovement = mutations.every((mutation) =>\n [...mutation.removedNodes].every(\n (node) => this.isInternalNode(node) || this.contains(node),\n ) &&\n [...mutation.addedNodes].every((node) => this.isInternalNode(node)),\n );\n\n if (isInternalMovement) {\n return;\n }\n\n if (this.syncProjectedContent()) {\n this.requestUpdate();\n }\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","import { html, nothing } from 'lit'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { SpectreProjectableElement } from '../../utils/projectable'\nimport {\n isAlertVariant,\n isInputSize,\n type SpectreAlertVariant,\n type SpectreInputSize\n} from '../../utils/form'\n\nimport {\n getAlertClasses,\n type AlertVariant,\n type AlertSize\n} from '@phcdevworks/spectre-ui'\n\nexport interface SpectreAlertProps {\n ariaLabel?: string | null\n ariaLabelledBy?: string | null\n ariaDescribedBy?: string | null\n dismissed?: boolean | undefined\n disabled?: boolean | undefined\n fullWidth?: boolean | undefined\n id?: string | null | undefined\n loading?: boolean | undefined\n size?: SpectreInputSize | undefined\n title?: string | null | undefined\n variant?: SpectreAlertVariant | undefined\n}\n\nexport class SpectreAlertElement\n extends SpectreProjectableElement\n implements SpectreAlertProps\n{\n static properties = {\n dismissed: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n fullWidth: { attribute: 'full-width', type: Boolean, reflect: true },\n loading: { type: Boolean, reflect: true },\n size: { type: String, reflect: true },\n variant: { type: String, reflect: true }\n }\n\n dismissed: boolean | undefined = false\n disabled: boolean | undefined = false\n fullWidth: boolean | undefined = false\n loading: boolean | undefined = false\n size: SpectreInputSize | undefined = 'md'\n variant: SpectreAlertVariant | undefined = 'info'\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 protected override getContentContainer(): Element | null {\n return this.querySelector('[data-sp-alert-native]')\n }\n\n protected override isInternalNode(node: Node): boolean {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false\n }\n const el = node as Element\n return el.hasAttribute('data-sp-alert-native')\n }\n\n protected override willUpdate(\n changedProperties: Map<PropertyKey, unknown>\n ): void {\n if (changedProperties.has('dismissed') && this.dismissed == null) {\n this.dismissed = 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('loading') && this.loading == null) {\n this.loading = false\n }\n if (\n changedProperties.has('variant') &&\n (this.variant == null || !isAlertVariant(this.variant))\n ) {\n this.variant = 'info'\n }\n if (\n changedProperties.has('size') &&\n (this.size == null || !isInputSize(this.size))\n ) {\n this.size = 'md'\n }\n }\n\n private get alertClasses(): string {\n return getAlertClasses({\n disabled: this.isDisabled,\n dismissed: this.dismissed ?? false,\n fullWidth: this.fullWidth ?? false,\n loading: this.loading ?? false,\n size: this.size as AlertSize,\n variant: this.variant as AlertVariant\n })\n }\n\n override render() {\n return html`<div\n aria-busy=\"${this.loading ? 'true' : 'false'}\"\n aria-describedby=\"${ifDefined(this.forwardedAriaDescribedBy)}\"\n aria-label=\"${ifDefined(this.forwardedAriaLabel)}\"\n aria-labelledby=\"${ifDefined(this.forwardedAriaLabelledBy)}\"\n class=\"${this.alertClasses}\"\n data-sp-alert-native\n id=\"${ifDefined(this.id || undefined)}\"\n role=\"alert\"\n title=\"${ifDefined(this.title || undefined)}\"\n >\n ${this.hasProjectedContent ? this.projectedContent : nothing}\n </div>`\n }\n}\n\nexport function defineSpectreAlert(\n tagName = 'sp-alert'\n): typeof SpectreAlertElement {\n const existingElement = customElements.get(tagName)\n\n if (existingElement) {\n return existingElement as unknown as typeof SpectreAlertElement\n }\n\n customElements.define(tagName, SpectreAlertElement)\n return SpectreAlertElement\n}\n"]}
1
+ {"version":3,"sources":["../src/utils/form.ts","../src/utils/base.ts","../src/utils/dom.ts","../src/utils/projectable.ts","../src/components/alert/sp-alert.ts"],"names":["LitElement","getAlertClasses","html","ifDefined","nothing"],"mappings":";;;;;;;AAMO,IAAM,iBAAA,GAAoB,CAAC,IAAA,EAAM,IAAA,EAAM,IAAI;AAG3C,SAAS,YAAY,KAAA,EAAiD;AAC3E,EAAA,OAAQ,iBAAA,CAAwC,SAAS,KAAe,CAAA;AAC1E;AAmEO,IAAM,oBAAA,GAAuB;AAAA,EAClC,MAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AAIO,SAAS,eAAe,KAAA,EAA8C;AAC3E,EAAA,OAAQ,oBAAA,CAA2C,SAAS,KAAe,CAAA;AAC7E;ACxFO,IAAM,kBAAA,GAAN,cAAiCA,cAAA,CAAW;AAAA,EAA5C,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AAGL,IAAA,IAAA,CAAQ,UAAA,GAA4B,IAAA;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AAA,CAIJ,UAAA,GAAa;AAAA,EAClB,SAAA,EAAW,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EAC1C,QAAA,EAAU,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EACzC,WAAW,EAAE,SAAA,EAAW,cAAc,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EACnE,OAAA,EAAS,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,IAAA,EAAK;AAAA,EACxC,IAAA,EAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAS,IAAA,EAAK;AAAA,EACpC,OAAA,EAAS,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAS,IAAA;AACpC,CAAA;AA8FK,SAAS,kBAAA,CACd,UAAU,UAAA,EACkB;AAC5B,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,mBAAmB,CAAA;AAClD,EAAA,OAAO,mBAAA;AACT","file":"alert.cjs","sourcesContent":["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] 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] 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 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] 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 { 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 { SpectreBaseElement } from './base';\nimport { hasMeaningfulContent } from './dom';\n\nexport abstract class SpectreProjectableElement extends SpectreBaseElement {\n protected projectedContent: Node[] = [];\n private contentObserver?: MutationObserver | undefined;\n\n // Return the native container whose existing children are also treated as\n // projected content sources (e.g. the rendered <button>, <select>, <label>).\n protected abstract getContentContainer(): Element | null;\n\n // Return true if the node was rendered by this component and should not be\n // treated as external projected content.\n protected abstract isInternalNode(node: Node): boolean;\n\n protected get hasProjectedContent(): boolean {\n return hasMeaningfulContent(this.projectedContent);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.syncProjectedContent();\n this.startContentObserver();\n }\n\n override disconnectedCallback(): void {\n this.stopContentObserver();\n super.disconnectedCallback();\n }\n\n protected override update(changedProperties: Map<PropertyKey, unknown>): void {\n this.stopContentObserver();\n super.update(changedProperties);\n this.startContentObserver();\n }\n\n protected syncProjectedContent(): boolean {\n const nextProjectedContent: Node[] = [];\n const sourceNodes = [\n ...this.childNodes,\n ...(this.getContentContainer()?.childNodes ?? []),\n ];\n\n sourceNodes.forEach((node) => {\n if (!this.isInternalNode(node) && !nextProjectedContent.includes(node)) {\n nextProjectedContent.push(node);\n }\n });\n\n const hasChanged =\n nextProjectedContent.length !== this.projectedContent.length ||\n nextProjectedContent.some((node, index) => node !== this.projectedContent[index]);\n\n if (hasChanged) {\n this.projectedContent = nextProjectedContent;\n }\n\n return hasChanged;\n }\n\n private startContentObserver(): void {\n if (this.contentObserver) {\n return;\n }\n\n this.contentObserver = new MutationObserver((mutations) => {\n const isInternalMovement = mutations.every((mutation) =>\n [...mutation.removedNodes].every(\n (node) => this.isInternalNode(node) || this.contains(node),\n ) &&\n [...mutation.addedNodes].every((node) => this.isInternalNode(node)),\n );\n\n if (isInternalMovement) {\n return;\n }\n\n if (this.syncProjectedContent()) {\n this.requestUpdate();\n }\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","import { html, nothing } from 'lit'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { SpectreProjectableElement } from '../../utils/projectable'\nimport {\n isAlertVariant,\n isInputSize,\n type SpectreAlertVariant,\n type SpectreInputSize\n} from '../../utils/form'\n\nimport {\n getAlertClasses,\n type AlertVariant,\n type AlertSize\n} from '@phcdevworks/spectre-ui'\n\nexport interface SpectreAlertProps {\n ariaLabel?: string | null\n ariaLabelledBy?: string | null\n ariaDescribedBy?: string | null\n dismissed?: boolean | undefined\n disabled?: boolean | undefined\n fullWidth?: boolean | undefined\n id?: string | null | undefined\n loading?: boolean | undefined\n size?: SpectreInputSize | undefined\n title?: string | null | undefined\n variant?: SpectreAlertVariant | undefined\n}\n\nexport class SpectreAlertElement\n extends SpectreProjectableElement\n implements SpectreAlertProps\n{\n static properties = {\n dismissed: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n fullWidth: { attribute: 'full-width', type: Boolean, reflect: true },\n loading: { type: Boolean, reflect: true },\n size: { type: String, reflect: true },\n variant: { type: String, reflect: true }\n }\n\n dismissed: boolean | undefined = false\n disabled: boolean | undefined = false\n fullWidth: boolean | undefined = false\n loading: boolean | undefined = false\n size: SpectreInputSize | undefined = 'md'\n variant: SpectreAlertVariant | undefined = 'info'\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 protected override getContentContainer(): Element | null {\n return this.querySelector('[data-sp-alert-native]')\n }\n\n protected override isInternalNode(node: Node): boolean {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false\n }\n const el = node as Element\n return el.hasAttribute('data-sp-alert-native')\n }\n\n protected override willUpdate(\n changedProperties: Map<PropertyKey, unknown>\n ): void {\n if (changedProperties.has('dismissed') && this.dismissed == null) {\n this.dismissed = 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('loading') && this.loading == null) {\n this.loading = false\n }\n if (\n changedProperties.has('variant') &&\n (this.variant == null || !isAlertVariant(this.variant))\n ) {\n this.variant = 'info'\n }\n if (\n changedProperties.has('size') &&\n (this.size == null || !isInputSize(this.size))\n ) {\n this.size = 'md'\n }\n }\n\n private get alertClasses(): string {\n return getAlertClasses({\n disabled: this.isDisabled,\n dismissed: this.dismissed ?? false,\n fullWidth: this.fullWidth ?? false,\n loading: this.loading ?? false,\n size: this.size as AlertSize,\n variant: this.variant as AlertVariant\n })\n }\n\n override render() {\n return html`<div\n aria-busy=\"${this.loading ? 'true' : 'false'}\"\n aria-describedby=\"${ifDefined(this.forwardedAriaDescribedBy)}\"\n aria-label=\"${ifDefined(this.forwardedAriaLabel)}\"\n aria-labelledby=\"${ifDefined(this.forwardedAriaLabelledBy)}\"\n class=\"${this.alertClasses}\"\n data-sp-alert-native\n id=\"${ifDefined(this.id || undefined)}\"\n role=\"alert\"\n title=\"${ifDefined(this.title || undefined)}\"\n >\n ${this.hasProjectedContent ? this.projectedContent : nothing}\n </div>`\n }\n}\n\nexport function defineSpectreAlert(\n tagName = 'sp-alert'\n): typeof SpectreAlertElement {\n const existingElement = customElements.get(tagName)\n\n if (existingElement) {\n return existingElement as unknown as typeof SpectreAlertElement\n }\n\n customElements.define(tagName, SpectreAlertElement)\n return SpectreAlertElement\n}\n"]}
package/dist/alert.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SpectreInputSize, a as SpectreAlertVariant } from './form-BGQjgJrL.cjs';
2
- export { z as spectreAlertSizes, A as spectreAlertVariants } from './form-BGQjgJrL.cjs';
1
+ import { S as SpectreInputSize, a as SpectreAlertVariant } from './form-CVRAWo0Q.cjs';
2
+ export { B as spectreAlertSizes, C as spectreAlertVariants } from './form-CVRAWo0Q.cjs';
3
3
  import * as lit_html from 'lit-html';
4
4
  import { S as SpectreProjectableElement } from './projectable-DLOn6eaW.cjs';
5
5
  import './base-D0s95V2v.cjs';
package/dist/alert.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SpectreInputSize, a as SpectreAlertVariant } from './form-BGQjgJrL.js';
2
- export { z as spectreAlertSizes, A as spectreAlertVariants } from './form-BGQjgJrL.js';
1
+ import { S as SpectreInputSize, a as SpectreAlertVariant } from './form-CVRAWo0Q.js';
2
+ export { B as spectreAlertSizes, C as spectreAlertVariants } from './form-CVRAWo0Q.js';
3
3
  import * as lit_html from 'lit-html';
4
4
  import { S as SpectreProjectableElement } from './projectable-D9YCo9NY.js';
5
5
  import './base-D0s95V2v.js';