@phcdevworks/spectre-components 1.14.0 → 1.15.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 (100) hide show
  1. package/README.md +165 -80
  2. package/dist/alert.cjs.map +1 -1
  3. package/dist/alert.js.map +1 -1
  4. package/dist/avatar.cjs.map +1 -1
  5. package/dist/avatar.js.map +1 -1
  6. package/dist/badge.cjs.map +1 -1
  7. package/dist/badge.js.map +1 -1
  8. package/dist/button.cjs.map +1 -1
  9. package/dist/button.js.map +1 -1
  10. package/dist/card.cjs.map +1 -1
  11. package/dist/card.js.map +1 -1
  12. package/dist/container.cjs +17 -1
  13. package/dist/container.cjs.map +1 -1
  14. package/dist/container.d.cts +7 -0
  15. package/dist/container.d.ts +7 -0
  16. package/dist/container.js +17 -1
  17. package/dist/container.js.map +1 -1
  18. package/dist/dropdown.cjs +10 -1
  19. package/dist/dropdown.cjs.map +1 -1
  20. package/dist/dropdown.d.cts +6 -0
  21. package/dist/dropdown.d.ts +6 -0
  22. package/dist/dropdown.js +10 -1
  23. package/dist/dropdown.js.map +1 -1
  24. package/dist/footer.cjs +18 -2
  25. package/dist/footer.cjs.map +1 -1
  26. package/dist/footer.d.cts +7 -0
  27. package/dist/footer.d.ts +7 -0
  28. package/dist/footer.js +18 -2
  29. package/dist/footer.js.map +1 -1
  30. package/dist/grid.cjs +17 -1
  31. package/dist/grid.cjs.map +1 -1
  32. package/dist/grid.d.cts +7 -0
  33. package/dist/grid.d.ts +7 -0
  34. package/dist/grid.js +17 -1
  35. package/dist/grid.js.map +1 -1
  36. package/dist/icon-box.cjs.map +1 -1
  37. package/dist/icon-box.js.map +1 -1
  38. package/dist/index.cjs +222 -20
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +1 -0
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.js +222 -22
  43. package/dist/index.js.map +1 -1
  44. package/dist/input.cjs.map +1 -1
  45. package/dist/input.js.map +1 -1
  46. package/dist/nav-item.cjs +7 -1
  47. package/dist/nav-item.cjs.map +1 -1
  48. package/dist/nav-item.d.cts +6 -0
  49. package/dist/nav-item.d.ts +6 -0
  50. package/dist/nav-item.js +7 -1
  51. package/dist/nav-item.js.map +1 -1
  52. package/dist/nav.cjs +17 -1
  53. package/dist/nav.cjs.map +1 -1
  54. package/dist/nav.d.cts +7 -0
  55. package/dist/nav.d.ts +7 -0
  56. package/dist/nav.js +17 -1
  57. package/dist/nav.js.map +1 -1
  58. package/dist/rating.cjs.map +1 -1
  59. package/dist/rating.js.map +1 -1
  60. package/dist/section.cjs +22 -1
  61. package/dist/section.cjs.map +1 -1
  62. package/dist/section.d.cts +9 -0
  63. package/dist/section.d.ts +9 -0
  64. package/dist/section.js +22 -1
  65. package/dist/section.js.map +1 -1
  66. package/dist/select.cjs.map +1 -1
  67. package/dist/select.js.map +1 -1
  68. package/dist/sidebar-toggle.cjs +465 -0
  69. package/dist/sidebar-toggle.cjs.map +1 -0
  70. package/dist/sidebar-toggle.d.cts +44 -0
  71. package/dist/sidebar-toggle.d.ts +44 -0
  72. package/dist/sidebar-toggle.js +462 -0
  73. package/dist/sidebar-toggle.js.map +1 -0
  74. package/dist/sidebar.cjs +15 -10
  75. package/dist/sidebar.cjs.map +1 -1
  76. package/dist/sidebar.d.cts +7 -0
  77. package/dist/sidebar.d.ts +7 -0
  78. package/dist/sidebar.js +15 -10
  79. package/dist/sidebar.js.map +1 -1
  80. package/dist/spinner.cjs.map +1 -1
  81. package/dist/spinner.js.map +1 -1
  82. package/dist/stack.cjs +18 -2
  83. package/dist/stack.cjs.map +1 -1
  84. package/dist/stack.d.cts +7 -0
  85. package/dist/stack.d.ts +7 -0
  86. package/dist/stack.js +18 -2
  87. package/dist/stack.js.map +1 -1
  88. package/dist/tag.cjs.map +1 -1
  89. package/dist/tag.js.map +1 -1
  90. package/dist/testimonial.cjs.map +1 -1
  91. package/dist/testimonial.js.map +1 -1
  92. package/dist/text.cjs.map +1 -1
  93. package/dist/text.js.map +1 -1
  94. package/dist/textarea.cjs.map +1 -1
  95. package/dist/textarea.js.map +1 -1
  96. package/dist/toast.cjs.map +1 -1
  97. package/dist/toast.js.map +1 -1
  98. package/dist/tooltip.cjs.map +1 -1
  99. package/dist/tooltip.js.map +1 -1
  100. package/package.json +14 -9
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.14.0 |
19
+ | Current version/status | 1.15.0 |
20
20
 
21
21
  ## Standard Workflow
22
22
 
@@ -812,16 +812,41 @@ price, feature list, call-to-action, etc.).
812
812
 
813
813
  ---
814
814
 
815
+ ### Layout components
816
+
817
+ `sp-container`, `sp-grid`, `sp-section`, `sp-stack`, `sp-footer`, and `sp-nav`
818
+ share two contracts:
819
+
820
+ - **Host display** — the host element defaults to `display: block` (set via
821
+ inline style in `connectedCallback`, so a consumer's own
822
+ `style="display: ..."` always wins) instead of the browser's default inline
823
+ custom-element box. This keeps backgrounds, margins, and full-width inner
824
+ content from being trapped inside an inline box.
825
+ - **`inner-class`** — an `inner-class` attribute (`innerClass` JS property)
826
+ appends consumer-supplied Spectre utility classes to the native inner element
827
+ the component's recipe classes render on, without touching the host's own
828
+ `class` attribute. Host `class` and `inner-class` are distinct targets: host
829
+ `class` affects the custom-element box itself, `inner-class` affects the
830
+ styled element inside it. Only tokens matching `sp-*` (Spectre utility class
831
+ syntax) are applied; anything else is silently dropped.
832
+
833
+ ```html
834
+ <sp-stack class="my-host-hook" inner-class="sp-bg-primary-500 sp-p-8">
835
+ ...
836
+ </sp-stack>
837
+ ```
838
+
815
839
  ### sp-container
816
840
 
817
841
  Renders a `<div>` layout container backed by the Spectre container recipe.
818
842
 
819
843
  **Attributes**
820
844
 
821
- | Attribute | Type | Default | Description |
822
- | ------------------------- | ------- | ------- | --------------------------------- |
823
- | `max-width` | `prose` | — | Constrains content to a max width |
824
- | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
845
+ | Attribute | Type | Default | Description |
846
+ | ------------------------- | ------- | ------- | ----------------------------------------------------- |
847
+ | `max-width` | `prose` | — | Constrains content to a max width |
848
+ | `inner-class` | string | — | Spectre utility classes applied to the native `<div>` |
849
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
825
850
 
826
851
  **Content projection** — children become the container content.
827
852
 
@@ -840,6 +865,7 @@ Renders a `<div>` grid layout backed by the Spectre grid recipe.
840
865
  | `columns` | `1 \| 2 \| 3 \| 4 \| 6 \| 12` | `1` | Number of grid columns |
841
866
  | `gap` | `sm \| md \| lg` | `md` | Gap between grid items |
842
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>` |
843
869
  | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
844
870
 
845
871
  **Content projection** — children become grid items.
@@ -854,9 +880,10 @@ Renders a `<section>` layout wrapper backed by the Spectre section recipe.
854
880
 
855
881
  **Attributes**
856
882
 
857
- | Attribute | Type | Default | Description |
858
- | ------------------------- | ------ | ------- | ----------------------------------- |
859
- | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<section>` |
883
+ | Attribute | Type | Default | Description |
884
+ | ------------------------- | ------ | ------- | --------------------------------------------------------- |
885
+ | `inner-class` | string | — | Spectre utility classes applied to the native `<section>` |
886
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<section>` |
860
887
 
861
888
  **Content projection** — children become the section content.
862
889
 
@@ -870,12 +897,13 @@ Renders a `<div>` flex stack backed by the Spectre stack recipe.
870
897
 
871
898
  **Attributes**
872
899
 
873
- | Attribute | Type | Default | Description |
874
- | ------------------------- | ------------------------ | ---------- | ------------------------------------- |
875
- | `direction` | `vertical \| horizontal` | `vertical` | Stack axis |
876
- | `basis` | `sidebar` | — | Reserves sidebar-sized basis on items |
877
- | `align` | `center \| stretch` | `center` | Cross-axis alignment |
878
- | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
900
+ | Attribute | Type | Default | Description |
901
+ | ------------------------- | ------------------------ | ---------- | ----------------------------------------------------- |
902
+ | `direction` | `vertical \| horizontal` | `vertical` | Stack axis |
903
+ | `basis` | `sidebar` | — | Reserves sidebar-sized basis on items |
904
+ | `align` | `center \| stretch` | `center` | Cross-axis alignment |
905
+ | `inner-class` | string | — | Spectre utility classes applied to the native `<div>` |
906
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
879
907
 
880
908
  **Content projection** — children become stack items.
881
909
 
@@ -889,11 +917,12 @@ Renders a `<footer>` backed by the Spectre footer recipe.
889
917
 
890
918
  **Attributes**
891
919
 
892
- | Attribute | Type | Default | Description |
893
- | ------------------------- | ------- | ------- | ---------------------------------- |
894
- | `bordered` | boolean | `false` | Adds a top border |
895
- | `full-width` | boolean | `false` | Spans full container width |
896
- | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<footer>` |
920
+ | Attribute | Type | Default | Description |
921
+ | ------------------------- | ------- | ------- | -------------------------------------------------------- |
922
+ | `bordered` | boolean | `false` | Adds a top border |
923
+ | `full-width` | boolean | `false` | Spans full container width |
924
+ | `inner-class` | string | — | Spectre utility classes applied to the native `<footer>` |
925
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<footer>` |
897
926
 
898
927
  **Content projection** — children become the footer content (links, legal text,
899
928
  etc.).
@@ -908,12 +937,13 @@ Renders a `<nav>` backed by the Spectre nav recipe.
908
937
 
909
938
  **Attributes**
910
939
 
911
- | Attribute | Type | Default | Description |
912
- | ------------------------- | ------- | ------- | ------------------------------- |
913
- | `bordered` | boolean | `false` | Adds a bottom border |
914
- | `sticky` | boolean | `false` | Sticks the nav to the viewport |
915
- | `full-width` | boolean | `false` | Spans full container width |
916
- | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<nav>` |
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>` |
917
947
 
918
948
  **Content projection** — children become the nav content (links, brand mark,
919
949
  etc.).
@@ -930,14 +960,15 @@ alongside plain `<a>` links.
930
960
 
931
961
  **Attributes**
932
962
 
933
- | Attribute | Type | Default | Description |
934
- | ------------------------- | ------- | ---------------- | ------------------------------------------------------------------- |
935
- | `dropdown` | boolean | `false` | Renders a dropdown trigger + menu instead of a plain `<a>` |
936
- | `href` | string | — | Link target when `dropdown` is `false` |
937
- | `label` | string | — | Trigger/link text when no content is projected |
938
- | `open` | boolean | `false` | Open/closed menu state (dropdown mode only) |
939
- | `placement` | string | `'bottom-start'` | Menu position: `bottom-start`, `bottom-end`, `top-start`, `top-end` |
940
- | `id` / `title` / `aria-*` | string | — | Forwarded to the rendered `<a>` or trigger `<button>` |
963
+ | Attribute | Type | Default | Description |
964
+ | ------------------------- | ------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------ |
965
+ | `dropdown` | boolean | `false` | Renders a dropdown trigger + menu instead of a plain `<a>` |
966
+ | `href` | string | — | Link target when `dropdown` is `false` |
967
+ | `label` | string | — | Trigger/link text when no content is projected |
968
+ | `mega` | boolean | `false` | Anchors the menu to the nearest positioned ancestor instead of the trigger, spanning its full width (dropdown mode only) |
969
+ | `open` | boolean | `false` | Open/closed menu state (dropdown mode only) |
970
+ | `placement` | string | `'bottom-start'` | Menu position: `bottom-start`, `bottom-end`, `top-start`, `top-end` |
971
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the rendered `<a>` or trigger `<button>` |
941
972
 
942
973
  **Content projection** — in dropdown mode, children become the menu content; a
943
974
  child with `slot="trigger"` becomes the trigger content instead of `label`. Menu
@@ -959,9 +990,20 @@ layout. In link mode, children become the link's content.
959
990
  <div>Column three</div>
960
991
  </sp-grid>
961
992
  </sp-nav-item>
993
+ <sp-nav-item dropdown mega label="Solutions">
994
+ <sp-grid columns="4" gap="lg">
995
+ <div>Column one</div>
996
+ <div>Column two</div>
997
+ <div>Column three</div>
998
+ <div>Column four</div>
999
+ </sp-grid>
1000
+ </sp-nav-item>
962
1001
  </sp-nav>
963
1002
  ```
964
1003
 
1004
+ `mega` requires a positioned ancestor to anchor against — `sp-nav` is a
1005
+ positioning context by default, so nesting inside it is sufficient.
1006
+
965
1007
  ---
966
1008
 
967
1009
  ### sp-sidebar
@@ -971,12 +1013,13 @@ Spectre sidebar recipe.
971
1013
 
972
1014
  **Attributes**
973
1015
 
974
- | Attribute | Type | Default | Description |
975
- | ------------------------- | ------- | ---------------- | -------------------------------------- |
976
- | `bordered` | boolean | `false` | Adds a trailing border |
977
- | `open` | boolean | `false` | Open/closed off-canvas state |
978
- | `toggle-label` | string | `Toggle sidebar` | Accessible label for the toggle button |
979
- | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<aside>` |
1016
+ | Attribute | Type | Default | Description |
1017
+ | ------------------------- | ------- | ---------------- | ------------------------------------------------------------------------------------- |
1018
+ | `bordered` | boolean | `false` | Adds a trailing border |
1019
+ | `hide-toggle` | boolean | `false` | Suppresses the built-in toggle button (e.g. when using `sp-sidebar-toggle` elsewhere) |
1020
+ | `open` | boolean | `false` | Open/closed off-canvas state |
1021
+ | `toggle-label` | string | `Toggle sidebar` | Accessible label for the built-in toggle button |
1022
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<aside>` |
980
1023
 
981
1024
  **Content projection** — children become the sidebar content (links, navigation
982
1025
  groups, etc.).
@@ -993,6 +1036,45 @@ hide the off-canvas panel and backdrop.
993
1036
 
994
1037
  ---
995
1038
 
1039
+ ### sp-sidebar-toggle
1040
+
1041
+ Renders a standalone trigger button that opens/closes a remote `sp-sidebar`,
1042
+ backed by the Spectre sidebar-toggle recipe. Use it to place a toggle somewhere
1043
+ other than inside the sidebar itself (a header, a nav bar) — pair it with
1044
+ `hide-toggle` on the target `sp-sidebar` to suppress that sidebar's own built-in
1045
+ toggle, or leave both in place to control the same sidebar from two triggers.
1046
+
1047
+ **Attributes**
1048
+
1049
+ | Attribute | Type | Default | Description |
1050
+ | ------------------------- | ------ | ---------------- | ------------------------------------------------------------------------------------------------ |
1051
+ | `for` | string | — | `id` of the target `sp-sidebar`'s native content (the id set on the `sp-sidebar` element itself) |
1052
+ | `label` | string | `Toggle sidebar` | Accessible label when no icon content is projected |
1053
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the native `<button>` |
1054
+
1055
+ **Content projection** — children become the button's icon content; falls back
1056
+ to a default `☰` glyph when empty.
1057
+
1058
+ **Behavior** — clicking the button toggles the target `sp-sidebar`'s `open`
1059
+ property and mirrors its own `aria-expanded` state, including staying in sync
1060
+ when the target is opened/closed by another trigger (its own built-in toggle,
1061
+ the backdrop, `Esc`, or a second `sp-sidebar-toggle`).
1062
+
1063
+ ```html
1064
+ <sp-nav>
1065
+ <sp-sidebar-toggle for="app-sidebar"></sp-sidebar-toggle>
1066
+ </sp-nav>
1067
+
1068
+ <sp-sidebar id="app-sidebar" hide-toggle>
1069
+ <a href="/dashboard">Dashboard</a>
1070
+ </sp-sidebar>
1071
+ ```
1072
+
1073
+ **Internal target** — `[data-sp-sidebar-toggle-native]` selects the native
1074
+ `<button>`.
1075
+
1076
+ ---
1077
+
996
1078
  ### sp-dropdown
997
1079
 
998
1080
  Renders a trigger button and a menu container, backed by the Spectre dropdown
@@ -1000,13 +1082,14 @@ recipes.
1000
1082
 
1001
1083
  **Attributes**
1002
1084
 
1003
- | Attribute | Type | Default | Description |
1004
- | ------------------------- | ---------------------------------------------------- | -------------- | ----------------------------------------------------------------------------- |
1005
- | `open` | boolean | `false` | Open/closed menu state |
1006
- | `placement` | `bottom-start \| bottom-end \| top-start \| top-end` | `bottom-start` | Menu position relative to trigger |
1007
- | `full-width` | boolean | `false` | Spans full container width |
1008
- | `trigger-label` | string | `Toggle menu` | Visible/accessible trigger text when no `slot="trigger"` content is projected |
1009
- | `id` / `title` / `aria-*` | string | — | Forwarded to the trigger button |
1085
+ | Attribute | Type | Default | Description |
1086
+ | ------------------------- | ---------------------------------------------------- | -------------- | --------------------------------------------------------------------------------------------------- |
1087
+ | `open` | boolean | `false` | Open/closed menu state |
1088
+ | `placement` | `bottom-start \| bottom-end \| top-start \| top-end` | `bottom-start` | Menu position relative to trigger |
1089
+ | `full-width` | boolean | `false` | Spans full container width |
1090
+ | `mega` | boolean | `false` | Anchors the menu to the nearest positioned ancestor instead of the trigger, spanning its full width |
1091
+ | `trigger-label` | string | `Toggle menu` | Visible/accessible trigger text when no `slot="trigger"` content is projected |
1092
+ | `id` / `title` / `aria-*` | string | — | Forwarded to the trigger button |
1010
1093
 
1011
1094
  **Content projection** — an element with `slot="trigger"` becomes the trigger
1012
1095
  button content; all other children become the menu content.
@@ -1196,45 +1279,47 @@ defineSpectreComponents() // registers all sp-* elements
1196
1279
  **Interactive constants and types**: `spectreDropdownPlacements`,
1197
1280
  `spectreToastVariants`, `spectreTooltipPlacements`, `SpectreDropdownPlacement`,
1198
1281
  `SpectreToastVariant`, `SpectreTooltipPlacement`, `SpectreFooterProps`,
1199
- `SpectreNavProps`, `SpectreSidebarProps`, `SpectreDropdownProps`,
1200
- `SpectreModalProps`, `SpectreToastProps`, `SpectreTooltipProps`
1282
+ `SpectreNavProps`, `SpectreSidebarProps`, `SpectreSidebarToggleProps`,
1283
+ `SpectreDropdownProps`, `SpectreModalProps`, `SpectreToastProps`,
1284
+ `SpectreTooltipProps`
1201
1285
 
1202
1286
  ### Subpath entry points
1203
1287
 
1204
1288
  Each entry point registers only that component and exports only its surface:
1205
1289
 
1206
- | Entry point | Registers | Key exports |
1207
- | ------------------ | ----------------- | ---------------------------------------------------------------------------------------- |
1208
- | `.../button` | `sp-button` | `defineSpectreButton`, `SpectreButtonElement`, button constants and types |
1209
- | `.../input` | `sp-input` | `defineSpectreInput`, `SpectreInputElement`, input constants and types |
1210
- | `.../textarea` | `sp-textarea` | `defineSpectreTextarea`, `SpectreTextareaElement`, `SpectreTextareaProps` |
1211
- | `.../select` | `sp-select` | `defineSpectreSelect`, `SpectreSelectElement`, `SpectreSelectProps` |
1212
- | `.../checkbox` | `sp-checkbox` | `defineSpectreCheckbox`, `SpectreCheckboxElement`, `SpectreCheckboxProps` |
1213
- | `.../radio` | `sp-radio` | `defineSpectreRadio`, `SpectreRadioElement`, `SpectreRadioProps` |
1214
- | `.../label` | `sp-label` | `defineSpectreLabel`, `SpectreLabelElement`, `SpectreLabelProps` |
1215
- | `.../fieldset` | `sp-fieldset` | `defineSpectreFieldset`, `SpectreFieldsetElement`, `SpectreFieldsetProps` |
1216
- | `.../badge` | `sp-badge` | `defineSpectreBadge`, `SpectreBadgeElement`, badge constants and types |
1217
- | `.../card` | `sp-card` | `defineSpectreCard`, `SpectreCardElement`, card constants and types |
1218
- | `.../icon-box` | `sp-icon-box` | `defineSpectreIconBox`, `SpectreIconBoxElement`, icon-box constants and types |
1219
- | `.../rating` | `sp-rating` | `defineSpectreRating`, `SpectreRatingElement`, rating constants and types |
1220
- | `.../testimonial` | `sp-testimonial` | `defineSpectreTestimonial`, `SpectreTestimonialElement`, testimonial constants and types |
1221
- | `.../alert` | `sp-alert` | `defineSpectreAlert`, `SpectreAlertElement`, alert constants and types |
1222
- | `.../avatar` | `sp-avatar` | `defineSpectreAvatar`, `SpectreAvatarElement`, avatar constants and types |
1223
- | `.../spinner` | `sp-spinner` | `defineSpectreSpinner`, `SpectreSpinnerElement`, spinner constants and types |
1224
- | `.../tag` | `sp-tag` | `defineSpectreTag`, `SpectreTagElement`, tag constants and types |
1225
- | `.../pricing-card` | `sp-pricing-card` | `defineSpectrePricingCard`, `SpectrePricingCardElement`, `SpectrePricingCardProps` |
1226
- | `.../container` | `sp-container` | `defineSpectreContainer`, `SpectreContainerElement`, container constants and types |
1227
- | `.../grid` | `sp-grid` | `defineSpectreGrid`, `SpectreGridElement`, grid constants and types |
1228
- | `.../section` | `sp-section` | `defineSpectreSection`, `SpectreSectionElement`, `SpectreSectionProps` |
1229
- | `.../stack` | `sp-stack` | `defineSpectreStack`, `SpectreStackElement`, stack constants and types |
1230
- | `.../nav` | `sp-nav` | `defineSpectreNav`, `SpectreNavElement`, `SpectreNavProps` |
1231
- | `.../nav-item` | `sp-nav-item` | `defineSpectreNavItem`, `SpectreNavItemElement`, `SpectreNavItemProps` |
1232
- | `.../sidebar` | `sp-sidebar` | `defineSpectreSidebar`, `SpectreSidebarElement`, `SpectreSidebarProps` |
1233
- | `.../dropdown` | `sp-dropdown` | `defineSpectreDropdown`, `SpectreDropdownElement`, dropdown constants and types |
1234
- | `.../footer` | `sp-footer` | `defineSpectreFooter`, `SpectreFooterElement`, `SpectreFooterProps` |
1235
- | `.../modal` | `sp-modal` | `defineSpectreModal`, `SpectreModalElement`, `SpectreModalProps` |
1236
- | `.../toast` | `sp-toast` | `defineSpectreToast`, `SpectreToastElement`, toast constants and types |
1237
- | `.../tooltip` | `sp-tooltip` | `defineSpectreTooltip`, `SpectreTooltipElement`, tooltip constants and types |
1290
+ | Entry point | Registers | Key exports |
1291
+ | -------------------- | ------------------- | ---------------------------------------------------------------------------------------- |
1292
+ | `.../button` | `sp-button` | `defineSpectreButton`, `SpectreButtonElement`, button constants and types |
1293
+ | `.../input` | `sp-input` | `defineSpectreInput`, `SpectreInputElement`, input constants and types |
1294
+ | `.../textarea` | `sp-textarea` | `defineSpectreTextarea`, `SpectreTextareaElement`, `SpectreTextareaProps` |
1295
+ | `.../select` | `sp-select` | `defineSpectreSelect`, `SpectreSelectElement`, `SpectreSelectProps` |
1296
+ | `.../checkbox` | `sp-checkbox` | `defineSpectreCheckbox`, `SpectreCheckboxElement`, `SpectreCheckboxProps` |
1297
+ | `.../radio` | `sp-radio` | `defineSpectreRadio`, `SpectreRadioElement`, `SpectreRadioProps` |
1298
+ | `.../label` | `sp-label` | `defineSpectreLabel`, `SpectreLabelElement`, `SpectreLabelProps` |
1299
+ | `.../fieldset` | `sp-fieldset` | `defineSpectreFieldset`, `SpectreFieldsetElement`, `SpectreFieldsetProps` |
1300
+ | `.../badge` | `sp-badge` | `defineSpectreBadge`, `SpectreBadgeElement`, badge constants and types |
1301
+ | `.../card` | `sp-card` | `defineSpectreCard`, `SpectreCardElement`, card constants and types |
1302
+ | `.../icon-box` | `sp-icon-box` | `defineSpectreIconBox`, `SpectreIconBoxElement`, icon-box constants and types |
1303
+ | `.../rating` | `sp-rating` | `defineSpectreRating`, `SpectreRatingElement`, rating constants and types |
1304
+ | `.../testimonial` | `sp-testimonial` | `defineSpectreTestimonial`, `SpectreTestimonialElement`, testimonial constants and types |
1305
+ | `.../alert` | `sp-alert` | `defineSpectreAlert`, `SpectreAlertElement`, alert constants and types |
1306
+ | `.../avatar` | `sp-avatar` | `defineSpectreAvatar`, `SpectreAvatarElement`, avatar constants and types |
1307
+ | `.../spinner` | `sp-spinner` | `defineSpectreSpinner`, `SpectreSpinnerElement`, spinner constants and types |
1308
+ | `.../tag` | `sp-tag` | `defineSpectreTag`, `SpectreTagElement`, tag constants and types |
1309
+ | `.../pricing-card` | `sp-pricing-card` | `defineSpectrePricingCard`, `SpectrePricingCardElement`, `SpectrePricingCardProps` |
1310
+ | `.../container` | `sp-container` | `defineSpectreContainer`, `SpectreContainerElement`, container constants and types |
1311
+ | `.../grid` | `sp-grid` | `defineSpectreGrid`, `SpectreGridElement`, grid constants and types |
1312
+ | `.../section` | `sp-section` | `defineSpectreSection`, `SpectreSectionElement`, `SpectreSectionProps` |
1313
+ | `.../stack` | `sp-stack` | `defineSpectreStack`, `SpectreStackElement`, stack constants and types |
1314
+ | `.../nav` | `sp-nav` | `defineSpectreNav`, `SpectreNavElement`, `SpectreNavProps` |
1315
+ | `.../nav-item` | `sp-nav-item` | `defineSpectreNavItem`, `SpectreNavItemElement`, `SpectreNavItemProps` |
1316
+ | `.../sidebar` | `sp-sidebar` | `defineSpectreSidebar`, `SpectreSidebarElement`, `SpectreSidebarProps` |
1317
+ | `.../sidebar-toggle` | `sp-sidebar-toggle` | `defineSpectreSidebarToggle`, `SpectreSidebarToggleElement`, `SpectreSidebarToggleProps` |
1318
+ | `.../dropdown` | `sp-dropdown` | `defineSpectreDropdown`, `SpectreDropdownElement`, dropdown constants and types |
1319
+ | `.../footer` | `sp-footer` | `defineSpectreFooter`, `SpectreFooterElement`, `SpectreFooterProps` |
1320
+ | `.../modal` | `sp-modal` | `defineSpectreModal`, `SpectreModalElement`, `SpectreModalProps` |
1321
+ | `.../toast` | `sp-toast` | `defineSpectreToast`, `SpectreToastElement`, toast constants and types |
1322
+ | `.../tooltip` | `sp-tooltip` | `defineSpectreTooltip`, `SpectreTooltipElement`, tooltip constants and types |
1238
1323
 
1239
1324
  Size constants are shared between input, textarea, and select. Import
1240
1325
  `spectreInputSizes` / `SpectreInputSize` from `.../input` when needed alongside
@@ -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,EAA5C,WAAA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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","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;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,I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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"]}