@phcdevworks/spectre-components 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +672 -49
- package/dist/accordion-item.cjs +540 -0
- package/dist/accordion-item.cjs.map +1 -0
- package/dist/accordion-item.d.cts +59 -0
- package/dist/accordion-item.d.ts +59 -0
- package/dist/accordion-item.js +537 -0
- package/dist/accordion-item.js.map +1 -0
- package/dist/accordion.cjs +468 -0
- package/dist/accordion.cjs.map +1 -0
- package/dist/accordion.d.cts +38 -0
- package/dist/accordion.d.ts +38 -0
- package/dist/accordion.js +465 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.cjs +166 -65
- package/dist/alert.cjs.map +1 -1
- package/dist/alert.d.cts +41 -8
- package/dist/alert.d.ts +41 -8
- package/dist/alert.js +168 -67
- package/dist/alert.js.map +1 -1
- package/dist/avatar.cjs +27 -1
- package/dist/avatar.cjs.map +1 -1
- package/dist/avatar.d.cts +19 -3
- package/dist/avatar.d.ts +19 -3
- package/dist/avatar.js +27 -1
- package/dist/avatar.js.map +1 -1
- package/dist/badge.cjs +35 -2
- package/dist/badge.cjs.map +1 -1
- package/dist/badge.d.cts +31 -3
- package/dist/badge.d.ts +31 -3
- package/dist/badge.js +35 -2
- package/dist/badge.js.map +1 -1
- package/dist/breadcrumb.cjs +464 -0
- package/dist/breadcrumb.cjs.map +1 -0
- package/dist/breadcrumb.d.cts +32 -0
- package/dist/breadcrumb.d.ts +32 -0
- package/dist/breadcrumb.js +461 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/button.cjs +32 -2
- package/dist/button.cjs.map +1 -1
- package/dist/button.d.cts +19 -3
- package/dist/button.d.ts +19 -3
- package/dist/button.js +32 -2
- package/dist/button.js.map +1 -1
- package/dist/card-bleed.cjs +458 -0
- package/dist/card-bleed.cjs.map +1 -0
- package/dist/card-bleed.d.cts +37 -0
- package/dist/card-bleed.d.ts +37 -0
- package/dist/card-bleed.js +455 -0
- package/dist/card-bleed.js.map +1 -0
- package/dist/card.cjs +27 -1
- package/dist/card.cjs.map +1 -1
- package/dist/card.d.cts +19 -3
- package/dist/card.d.ts +19 -3
- package/dist/card.js +27 -1
- package/dist/card.js.map +1 -1
- package/dist/carousel.cjs +655 -0
- package/dist/carousel.cjs.map +1 -0
- package/dist/carousel.d.cts +79 -0
- package/dist/carousel.d.ts +79 -0
- package/dist/carousel.js +652 -0
- package/dist/carousel.js.map +1 -0
- package/dist/checkbox.cjs +3 -1
- package/dist/checkbox.cjs.map +1 -1
- package/dist/checkbox.js +3 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/choice-card.cjs +524 -0
- package/dist/choice-card.cjs.map +1 -0
- package/dist/choice-card.d.cts +81 -0
- package/dist/choice-card.d.ts +81 -0
- package/dist/choice-card.js +521 -0
- package/dist/choice-card.js.map +1 -0
- package/dist/container.cjs +23 -6
- package/dist/container.cjs.map +1 -1
- package/dist/container.d.cts +9 -3
- package/dist/container.d.ts +9 -3
- package/dist/container.js +23 -7
- package/dist/container.js.map +1 -1
- package/dist/datepicker.cjs +580 -0
- package/dist/datepicker.cjs.map +1 -0
- package/dist/datepicker.d.cts +78 -0
- package/dist/datepicker.d.ts +78 -0
- package/dist/datepicker.js +577 -0
- package/dist/datepicker.js.map +1 -0
- package/dist/dom-CX9bgbcQ.d.cts +3 -0
- package/dist/dom-CX9bgbcQ.d.ts +3 -0
- package/dist/dropdown.cjs +24 -0
- package/dist/dropdown.cjs.map +1 -1
- package/dist/dropdown.d.cts +3 -2
- package/dist/dropdown.d.ts +3 -2
- package/dist/dropdown.js +25 -1
- package/dist/dropdown.js.map +1 -1
- package/dist/external-auth-button.cjs +494 -0
- package/dist/external-auth-button.cjs.map +1 -0
- package/dist/external-auth-button.d.cts +71 -0
- package/dist/external-auth-button.d.ts +71 -0
- package/dist/external-auth-button.js +491 -0
- package/dist/external-auth-button.js.map +1 -0
- package/dist/fieldset.cjs +3 -1
- package/dist/fieldset.cjs.map +1 -1
- package/dist/fieldset.js +3 -1
- package/dist/fieldset.js.map +1 -1
- package/dist/file-input.cjs +371 -0
- package/dist/file-input.cjs.map +1 -0
- package/dist/file-input.d.cts +96 -0
- package/dist/file-input.d.ts +96 -0
- package/dist/file-input.js +367 -0
- package/dist/file-input.js.map +1 -0
- package/dist/footer-chip.cjs +22 -2
- package/dist/footer-chip.cjs.map +1 -1
- package/dist/footer-chip.d.cts +12 -1
- package/dist/footer-chip.d.ts +12 -1
- package/dist/footer-chip.js +22 -2
- package/dist/footer-chip.js.map +1 -1
- package/dist/footer-link.cjs +19 -1
- package/dist/footer-link.cjs.map +1 -1
- package/dist/footer-link.d.cts +12 -1
- package/dist/footer-link.d.ts +12 -1
- package/dist/footer-link.js +19 -1
- package/dist/footer-link.js.map +1 -1
- package/dist/footer.cjs +30 -1
- package/dist/footer.cjs.map +1 -1
- package/dist/footer.d.cts +2 -1
- package/dist/footer.d.ts +2 -1
- package/dist/footer.js +31 -2
- package/dist/footer.js.map +1 -1
- package/dist/{form-DpPtizpY.d.cts → form-CVO7mlDa.d.cts} +38 -9
- package/dist/{form-DpPtizpY.d.ts → form-CVO7mlDa.d.ts} +38 -9
- package/dist/grid.cjs +35 -1
- package/dist/grid.cjs.map +1 -1
- package/dist/grid.d.cts +9 -3
- package/dist/grid.d.ts +9 -3
- package/dist/grid.js +35 -2
- package/dist/grid.js.map +1 -1
- package/dist/icon-box.cjs +27 -1
- package/dist/icon-box.cjs.map +1 -1
- package/dist/icon-box.d.cts +19 -3
- package/dist/icon-box.d.ts +19 -3
- package/dist/icon-box.js +27 -1
- package/dist/icon-box.js.map +1 -1
- package/dist/index.cjs +3654 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +3594 -110
- package/dist/index.js.map +1 -1
- package/dist/input-group.cjs +471 -0
- package/dist/input-group.cjs.map +1 -0
- package/dist/input-group.d.cts +31 -0
- package/dist/input-group.d.ts +31 -0
- package/dist/input-group.js +468 -0
- package/dist/input-group.js.map +1 -0
- package/dist/input.cjs +96 -4
- package/dist/input.cjs.map +1 -1
- package/dist/input.d.cts +45 -6
- package/dist/input.d.ts +45 -6
- package/dist/input.js +98 -6
- package/dist/input.js.map +1 -1
- package/dist/label.cjs +3 -1
- package/dist/label.cjs.map +1 -1
- package/dist/label.js +3 -1
- package/dist/label.js.map +1 -1
- package/dist/list-group-item.cjs +367 -0
- package/dist/list-group-item.cjs.map +1 -0
- package/dist/list-group-item.d.cts +73 -0
- package/dist/list-group-item.d.ts +73 -0
- package/dist/list-group-item.js +364 -0
- package/dist/list-group-item.js.map +1 -0
- package/dist/list-group.cjs +610 -0
- package/dist/list-group.cjs.map +1 -0
- package/dist/list-group.d.cts +58 -0
- package/dist/list-group.d.ts +58 -0
- package/dist/list-group.js +607 -0
- package/dist/list-group.js.map +1 -0
- package/dist/modal.cjs +38 -35
- package/dist/modal.cjs.map +1 -1
- package/dist/modal.d.cts +1 -3
- package/dist/modal.d.ts +1 -3
- package/dist/modal.js +38 -35
- package/dist/modal.js.map +1 -1
- package/dist/nav-item.cjs +107 -4
- package/dist/nav-item.cjs.map +1 -1
- package/dist/nav-item.d.cts +52 -2
- package/dist/nav-item.d.ts +52 -2
- package/dist/nav-item.js +108 -5
- package/dist/nav-item.js.map +1 -1
- package/dist/nav.cjs +25 -1
- package/dist/nav.cjs.map +1 -1
- package/dist/nav.d.cts +2 -1
- package/dist/nav.d.ts +2 -1
- package/dist/nav.js +26 -2
- package/dist/nav.js.map +1 -1
- package/dist/offcanvas.cjs +621 -0
- package/dist/offcanvas.cjs.map +1 -0
- package/dist/offcanvas.d.cts +61 -0
- package/dist/offcanvas.d.ts +61 -0
- package/dist/offcanvas.js +617 -0
- package/dist/offcanvas.js.map +1 -0
- package/dist/pagination.cjs +452 -0
- package/dist/pagination.cjs.map +1 -0
- package/dist/pagination.d.cts +69 -0
- package/dist/pagination.d.ts +69 -0
- package/dist/pagination.js +448 -0
- package/dist/pagination.js.map +1 -0
- package/dist/popover.cjs +534 -0
- package/dist/popover.cjs.map +1 -0
- package/dist/popover.d.cts +59 -0
- package/dist/popover.d.ts +59 -0
- package/dist/popover.js +530 -0
- package/dist/popover.js.map +1 -0
- package/dist/pricing-card.cjs +121 -64
- package/dist/pricing-card.cjs.map +1 -1
- package/dist/pricing-card.d.cts +21 -7
- package/dist/pricing-card.d.ts +21 -7
- package/dist/pricing-card.js +122 -65
- package/dist/pricing-card.js.map +1 -1
- package/dist/progress.cjs +403 -0
- package/dist/progress.cjs.map +1 -0
- package/dist/progress.d.cts +70 -0
- package/dist/progress.d.ts +70 -0
- package/dist/progress.js +398 -0
- package/dist/progress.js.map +1 -0
- package/dist/prose.cjs +425 -0
- package/dist/prose.cjs.map +1 -0
- package/dist/prose.d.cts +21 -0
- package/dist/prose.d.ts +21 -0
- package/dist/prose.js +422 -0
- package/dist/prose.js.map +1 -0
- package/dist/radio.cjs +3 -1
- package/dist/radio.cjs.map +1 -1
- package/dist/radio.js +3 -1
- package/dist/radio.js.map +1 -1
- package/dist/range.cjs +381 -0
- package/dist/range.cjs.map +1 -0
- package/dist/range.d.cts +76 -0
- package/dist/range.d.ts +76 -0
- package/dist/range.js +378 -0
- package/dist/range.js.map +1 -0
- package/dist/rating.cjs +33 -0
- package/dist/rating.cjs.map +1 -1
- package/dist/rating.d.cts +38 -3
- package/dist/rating.d.ts +38 -3
- package/dist/rating.js +33 -0
- package/dist/rating.js.map +1 -1
- package/dist/section.cjs +27 -3
- package/dist/section.cjs.map +1 -1
- package/dist/section.d.cts +16 -1
- package/dist/section.d.ts +16 -1
- package/dist/section.js +27 -4
- package/dist/section.js.map +1 -1
- package/dist/select.cjs +6 -1
- package/dist/select.cjs.map +1 -1
- package/dist/select.d.cts +7 -1
- package/dist/select.d.ts +7 -1
- package/dist/select.js +6 -1
- package/dist/select.js.map +1 -1
- package/dist/sidebar-link.cjs +19 -1
- package/dist/sidebar-link.cjs.map +1 -1
- package/dist/sidebar-link.d.cts +13 -2
- package/dist/sidebar-link.d.ts +13 -2
- package/dist/sidebar-link.js +19 -1
- package/dist/sidebar-link.js.map +1 -1
- package/dist/sidebar-toggle.cjs +3 -1
- package/dist/sidebar-toggle.cjs.map +1 -1
- package/dist/sidebar-toggle.js +3 -1
- package/dist/sidebar-toggle.js.map +1 -1
- package/dist/sidebar.cjs +33 -1
- package/dist/sidebar.cjs.map +1 -1
- package/dist/sidebar.d.cts +1 -0
- package/dist/sidebar.d.ts +1 -0
- package/dist/sidebar.js +34 -2
- package/dist/sidebar.js.map +1 -1
- package/dist/spinner.cjs +2 -1
- package/dist/spinner.cjs.map +1 -1
- package/dist/spinner.d.cts +2 -2
- package/dist/spinner.d.ts +2 -2
- package/dist/spinner.js +2 -1
- package/dist/spinner.js.map +1 -1
- package/dist/stack.cjs +4 -2
- package/dist/stack.cjs.map +1 -1
- package/dist/stack.d.cts +2 -2
- package/dist/stack.d.ts +2 -2
- package/dist/stack.js +4 -2
- package/dist/stack.js.map +1 -1
- package/dist/states-Bgzwu_XZ.d.cts +9 -0
- package/dist/states-Bgzwu_XZ.d.ts +9 -0
- package/dist/stepper.cjs +495 -0
- package/dist/stepper.cjs.map +1 -0
- package/dist/stepper.d.cts +40 -0
- package/dist/stepper.d.ts +40 -0
- package/dist/stepper.js +491 -0
- package/dist/stepper.js.map +1 -0
- package/dist/switch.cjs +492 -0
- package/dist/switch.cjs.map +1 -0
- package/dist/switch.d.cts +82 -0
- package/dist/switch.d.ts +82 -0
- package/dist/switch.js +488 -0
- package/dist/switch.js.map +1 -0
- package/dist/tab-panel.cjs +465 -0
- package/dist/tab-panel.cjs.map +1 -0
- package/dist/tab-panel.d.cts +48 -0
- package/dist/tab-panel.d.ts +48 -0
- package/dist/tab-panel.js +462 -0
- package/dist/tab-panel.js.map +1 -0
- package/dist/table.cjs +506 -0
- package/dist/table.cjs.map +1 -0
- package/dist/table.d.cts +54 -0
- package/dist/table.d.ts +54 -0
- package/dist/table.js +501 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.cjs +596 -0
- package/dist/tabs.cjs.map +1 -0
- package/dist/tabs.d.cts +65 -0
- package/dist/tabs.d.ts +65 -0
- package/dist/tabs.js +592 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tag.cjs +27 -1
- package/dist/tag.cjs.map +1 -1
- package/dist/tag.d.cts +19 -3
- package/dist/tag.d.ts +19 -3
- package/dist/tag.js +27 -1
- package/dist/tag.js.map +1 -1
- package/dist/testimonial.cjs +130 -64
- package/dist/testimonial.cjs.map +1 -1
- package/dist/testimonial.d.cts +23 -8
- package/dist/testimonial.d.ts +23 -8
- package/dist/testimonial.js +131 -65
- package/dist/testimonial.js.map +1 -1
- package/dist/text.cjs +65 -6
- package/dist/text.cjs.map +1 -1
- package/dist/text.d.cts +24 -3
- package/dist/text.d.ts +24 -3
- package/dist/text.js +64 -8
- package/dist/text.js.map +1 -1
- package/dist/textarea.cjs +3 -0
- package/dist/textarea.cjs.map +1 -1
- package/dist/textarea.d.cts +7 -1
- package/dist/textarea.d.ts +7 -1
- package/dist/textarea.js +3 -0
- package/dist/textarea.js.map +1 -1
- package/dist/toast.cjs +2 -1
- package/dist/toast.cjs.map +1 -1
- package/dist/toast.d.cts +2 -2
- package/dist/toast.d.ts +2 -2
- package/dist/toast.js +2 -1
- package/dist/toast.js.map +1 -1
- package/dist/tooltip.cjs.map +1 -1
- package/dist/tooltip.d.cts +2 -2
- package/dist/tooltip.d.ts +2 -2
- package/dist/tooltip.js.map +1 -1
- package/package.json +126 -11
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.
|
|
19
|
+
| Current version/status | 1.21.0 |
|
|
20
20
|
|
|
21
21
|
## Standard Workflow
|
|
22
22
|
|
|
@@ -36,6 +36,7 @@ consume Spectre without a framework-specific adapter.
|
|
|
36
36
|
| Codex | [CODEX.md](CODEX.md) |
|
|
37
37
|
| Copilot | [COPILOT.md](COPILOT.md) |
|
|
38
38
|
| Jules | [JULES.md](JULES.md) |
|
|
39
|
+
| Grok | [GROK.md](GROK.md) |
|
|
39
40
|
| Roadmap | [ROADMAP.md](ROADMAP.md) |
|
|
40
41
|
| Todo | [TODO.md](TODO.md) |
|
|
41
42
|
| Changelog | [CHANGELOG.md](CHANGELOG.md) |
|
|
@@ -702,22 +703,28 @@ recipe.
|
|
|
702
703
|
|
|
703
704
|
**Attributes**
|
|
704
705
|
|
|
705
|
-
| Attribute | Type
|
|
706
|
-
| ------------------------- |
|
|
707
|
-
| `variant` | `info \| success \| warning \| danger \| neutral` | `info`
|
|
708
|
-
| `size` | `sm \| md \| lg`
|
|
709
|
-
| `
|
|
710
|
-
| `
|
|
711
|
-
| `
|
|
712
|
-
| `
|
|
713
|
-
| `
|
|
714
|
-
|
|
715
|
-
|
|
706
|
+
| Attribute | Type | Default | Description |
|
|
707
|
+
| ------------------------- | ---------------------------------------------------------- | --------- | ----------------------------------------------- |
|
|
708
|
+
| `variant` | `info \| success \| warning \| danger \| neutral \| brand` | `info` | Visual style |
|
|
709
|
+
| `size` | `sm \| md \| lg` | `md` | Alert size |
|
|
710
|
+
| `dismissible` | boolean | `false` | Renders a close button that dismisses the alert |
|
|
711
|
+
| `dismiss-label` | string | `Dismiss` | Accessible name of the close button |
|
|
712
|
+
| `dismissed` | boolean | `false` | Dismissed (hidden) state |
|
|
713
|
+
| `disabled` | boolean | `false` | Disabled visual state |
|
|
714
|
+
| `loading` | boolean | `false` | Busy visual state |
|
|
715
|
+
| `full-width` | boolean | `false` | Spans full container width |
|
|
716
|
+
| `id` / `title` / `aria-*` | string | — | Forwarded to the native `<div>` |
|
|
717
|
+
|
|
718
|
+
**Content projection** — an element with `slot="icon"` renders in the leading
|
|
719
|
+
icon slot, colored by the variant; all other children become the alert content.
|
|
716
720
|
|
|
717
721
|
**Accessibility** — renders `role="alert"` and reflects the `loading` state to
|
|
718
722
|
`aria-busy`.
|
|
719
723
|
|
|
720
|
-
**
|
|
724
|
+
**Events** — `sp-dismiss` (bubbling) when the close button dismisses the alert.
|
|
725
|
+
|
|
726
|
+
**Internal targets** — `[data-sp-alert-native]` selects the native `<div>`;
|
|
727
|
+
`[data-sp-alert-dismiss]` selects the close button.
|
|
721
728
|
|
|
722
729
|
---
|
|
723
730
|
|
|
@@ -1333,6 +1340,577 @@ switches with `level` while the recipe call and styling stay the same.
|
|
|
1333
1340
|
**Internal target** — `[data-sp-text-native]` selects the rendered native
|
|
1334
1341
|
element.
|
|
1335
1342
|
|
|
1343
|
+
---
|
|
1344
|
+
|
|
1345
|
+
### sp-tabs / sp-tab-panel
|
|
1346
|
+
|
|
1347
|
+
Renders an ARIA tablist from its `sp-tab-panel` children, backed by the Spectre
|
|
1348
|
+
tabs recipes. Each panel supplies its tab's label; `sp-tabs` renders the tab
|
|
1349
|
+
buttons and owns selection.
|
|
1350
|
+
|
|
1351
|
+
```html
|
|
1352
|
+
<sp-tabs aria-label="Account settings">
|
|
1353
|
+
<sp-tab-panel label="Profile">Profile settings</sp-tab-panel>
|
|
1354
|
+
<sp-tab-panel label="Security">Security settings</sp-tab-panel>
|
|
1355
|
+
</sp-tabs>
|
|
1356
|
+
```
|
|
1357
|
+
|
|
1358
|
+
**`sp-tabs` attributes**
|
|
1359
|
+
|
|
1360
|
+
| Attribute | Type | Default | Description |
|
|
1361
|
+
| ---------------- | -------------- | ------- | ------------------------------------------------------------------------------- |
|
|
1362
|
+
| `selected-index` | number | `0` | Selected panel; a disabled or missing panel falls back to the first enabled one |
|
|
1363
|
+
| `variant` | `line \| pill` | `line` | Indicator-edge or segmented-control treatment |
|
|
1364
|
+
| `vertical` | boolean | `false` | Places the tab list beside the panels |
|
|
1365
|
+
| `full-width` | boolean | `false` | Tabs share the list width equally |
|
|
1366
|
+
| `aria-label` | string | — | Forwarded to the tablist |
|
|
1367
|
+
| `id` / `title` | string | — | Forwarded to the tabs container |
|
|
1368
|
+
|
|
1369
|
+
**`sp-tab-panel` attributes**
|
|
1370
|
+
|
|
1371
|
+
| Attribute | Type | Default | Description |
|
|
1372
|
+
| -------------- | ------- | ------- | --------------------------------------------------------------- |
|
|
1373
|
+
| `label` | string | — | Tab button text |
|
|
1374
|
+
| `disabled` | boolean | `false` | Disables the tab |
|
|
1375
|
+
| `selected` | boolean | `false` | Reflects selection; set by the parent `sp-tabs`, not by authors |
|
|
1376
|
+
| `id` / `title` | string | — | Forwarded to the native `role="tabpanel"` element |
|
|
1377
|
+
|
|
1378
|
+
**Behavior** — follows the WAI-ARIA tabs pattern with automatic activation:
|
|
1379
|
+
roving `tabindex`, `ArrowLeft`/`ArrowRight` (`ArrowUp`/`ArrowDown` when
|
|
1380
|
+
`vertical`), `Home`, and `End`, skipping disabled tabs.
|
|
1381
|
+
|
|
1382
|
+
**Events** — `sp-change` (bubbling) with `detail: { index }` when the user
|
|
1383
|
+
selects a tab.
|
|
1384
|
+
|
|
1385
|
+
**Internal targets** — `[data-sp-tabs-native]` selects the tabs container,
|
|
1386
|
+
`[data-sp-tabs-tab]` each tab button, and `[data-sp-tab-panel-native]` each
|
|
1387
|
+
panel.
|
|
1388
|
+
|
|
1389
|
+
---
|
|
1390
|
+
|
|
1391
|
+
### sp-accordion / sp-accordion-item
|
|
1392
|
+
|
|
1393
|
+
Renders a stack of disclosure items backed by the Spectre accordion recipes.
|
|
1394
|
+
|
|
1395
|
+
```html
|
|
1396
|
+
<sp-accordion>
|
|
1397
|
+
<sp-accordion-item label="Shipping" open>Ships in 2 days.</sp-accordion-item>
|
|
1398
|
+
<sp-accordion-item label="Returns">30 day returns.</sp-accordion-item>
|
|
1399
|
+
</sp-accordion>
|
|
1400
|
+
```
|
|
1401
|
+
|
|
1402
|
+
**`sp-accordion` attributes**
|
|
1403
|
+
|
|
1404
|
+
| Attribute | Type | Default | Description |
|
|
1405
|
+
| -------------- | ------- | ------- | --------------------------------------------------------------------- |
|
|
1406
|
+
| `flush` | boolean | `false` | Drops the outer border and radius |
|
|
1407
|
+
| `multiple` | boolean | `false` | Lets several items stay open; otherwise opening one closes the others |
|
|
1408
|
+
| `id` / `title` | string | — | Forwarded to the accordion container |
|
|
1409
|
+
|
|
1410
|
+
**`sp-accordion-item` attributes**
|
|
1411
|
+
|
|
1412
|
+
| Attribute | Type | Default | Description |
|
|
1413
|
+
| ------------------------- | ------- | ------- | ------------------------------ |
|
|
1414
|
+
| `label` | string | — | Header text |
|
|
1415
|
+
| `open` | boolean | `false` | Expanded state |
|
|
1416
|
+
| `disabled` | boolean | `false` | Prevents toggling |
|
|
1417
|
+
| `id` / `title` / `aria-*` | string | — | Forwarded to the header button |
|
|
1418
|
+
|
|
1419
|
+
**Content projection** — an element with `slot="header"` replaces the `label`
|
|
1420
|
+
text in the header; all other children become the panel content.
|
|
1421
|
+
|
|
1422
|
+
**Accessibility** — the header is a native `<button>` with `aria-expanded` and
|
|
1423
|
+
`aria-controls`; the panel is a `role="region"` labelled by its header.
|
|
1424
|
+
|
|
1425
|
+
**Events** — `sp-open` and `sp-close` (bubbling) from the item when the user
|
|
1426
|
+
toggles it. The single-open behavior responds to user toggles only; setting
|
|
1427
|
+
`open` programmatically does not close sibling items.
|
|
1428
|
+
|
|
1429
|
+
**Host classes** — the item host carries the `sp-accordion__item` recipe
|
|
1430
|
+
classes (author classes are preserved) so the recipe's divider between sibling
|
|
1431
|
+
items applies.
|
|
1432
|
+
|
|
1433
|
+
**Internal targets** — `[data-sp-accordion-native]`,
|
|
1434
|
+
`[data-sp-accordion-item-header]`, `[data-sp-accordion-item-panel]`.
|
|
1435
|
+
|
|
1436
|
+
---
|
|
1437
|
+
|
|
1438
|
+
### sp-breadcrumb
|
|
1439
|
+
|
|
1440
|
+
Renders a `<nav>` breadcrumb trail backed by the Spectre breadcrumb recipes.
|
|
1441
|
+
Each child element becomes one item; the last one is the current page.
|
|
1442
|
+
|
|
1443
|
+
```html
|
|
1444
|
+
<sp-breadcrumb>
|
|
1445
|
+
<a href="/">Home</a>
|
|
1446
|
+
<a href="/library">Library</a>
|
|
1447
|
+
<span>Data</span>
|
|
1448
|
+
</sp-breadcrumb>
|
|
1449
|
+
```
|
|
1450
|
+
|
|
1451
|
+
| Attribute | Type | Default | Description |
|
|
1452
|
+
| -------------- | ------ | ------------ | --------------------------------------------------------------------- |
|
|
1453
|
+
| `separator` | string | — | Replaces the built-in `/` with a decorative (`aria-hidden`) separator |
|
|
1454
|
+
| `aria-label` | string | `Breadcrumb` | Forwarded to the `<nav>` |
|
|
1455
|
+
| `id` / `title` | string | — | Forwarded to the `<nav>` |
|
|
1456
|
+
|
|
1457
|
+
**Accessibility** — renders `<nav>` › `<ol>` › `<li>`; the last item gets
|
|
1458
|
+
`aria-current="page"`. Projected `<a>` children receive the
|
|
1459
|
+
`sp-breadcrumb__link` class.
|
|
1460
|
+
|
|
1461
|
+
**Internal target** — `[data-sp-breadcrumb-native]` selects the `<nav>`.
|
|
1462
|
+
|
|
1463
|
+
---
|
|
1464
|
+
|
|
1465
|
+
### sp-list-group / sp-list-group-item
|
|
1466
|
+
|
|
1467
|
+
Renders a list group backed by the Spectre list-group recipes. Each
|
|
1468
|
+
`sp-list-group-item` becomes a native row: a `<li>` when every item is static,
|
|
1469
|
+
or an `<a>` (with `href`), `<button>` (with `interactive`), or `<div>`
|
|
1470
|
+
otherwise.
|
|
1471
|
+
|
|
1472
|
+
```html
|
|
1473
|
+
<sp-list-group aria-label="Mailboxes">
|
|
1474
|
+
<sp-list-group-item href="/inbox" active>Inbox</sp-list-group-item>
|
|
1475
|
+
<sp-list-group-item interactive>Archive</sp-list-group-item>
|
|
1476
|
+
</sp-list-group>
|
|
1477
|
+
```
|
|
1478
|
+
|
|
1479
|
+
**`sp-list-group` attributes**
|
|
1480
|
+
|
|
1481
|
+
| Attribute | Type | Default | Description |
|
|
1482
|
+
| ------------------------- | ----------------------------------------------------------------- | ------- | --------------------------------------------- |
|
|
1483
|
+
| `flush` | boolean | `false` | Drops the outer border and radius |
|
|
1484
|
+
| `horizontal` | boolean | `false` | Lays rows out in a row |
|
|
1485
|
+
| `accent` | `top \| right \| bottom \| left` | — | Optional decorative edge-rail |
|
|
1486
|
+
| `accent-color` | `neutral \| brand \| info \| success \| warning \| danger \| cta` | `brand` | Accent rail color; only applied with `accent` |
|
|
1487
|
+
| `id` / `title` / `aria-*` | string | — | Forwarded to the list container |
|
|
1488
|
+
|
|
1489
|
+
**`sp-list-group-item` attributes**
|
|
1490
|
+
|
|
1491
|
+
| Attribute | Type | Default | Description |
|
|
1492
|
+
| ----------------------------- | ------- | ------- | -------------------------------------------------- |
|
|
1493
|
+
| `href` | string | — | Renders the row as a link |
|
|
1494
|
+
| `target` | string | — | Link target |
|
|
1495
|
+
| `interactive` | boolean | `false` | Renders the row as a button |
|
|
1496
|
+
| `active` | boolean | `false` | Current item; sets `aria-current="true"` |
|
|
1497
|
+
| `selected` | boolean | `false` | Subtle checked tint, distinct from `active` |
|
|
1498
|
+
| `disabled` | boolean | `false` | Disables a button row; removes a link row's `href` |
|
|
1499
|
+
| `id` / `title` / `aria-label` | string | — | Forwarded to the rendered row |
|
|
1500
|
+
|
|
1501
|
+
**Content projection** — the item host (`display: contents`) moves inside the
|
|
1502
|
+
rendered row, so its children, including later edits, render in place. Use the
|
|
1503
|
+
`sp-list-group__heading` / `sp-list-group__text` classes for two-line rows.
|
|
1504
|
+
|
|
1505
|
+
**Events** — `sp-select` (bubbling) from the item when a link or button row is
|
|
1506
|
+
activated.
|
|
1507
|
+
|
|
1508
|
+
**Internal targets** — `[data-sp-list-group-native]` selects the list
|
|
1509
|
+
container, `[data-sp-list-group-row]` each row.
|
|
1510
|
+
|
|
1511
|
+
---
|
|
1512
|
+
|
|
1513
|
+
### sp-offcanvas
|
|
1514
|
+
|
|
1515
|
+
Renders a slide-in dialog panel and backdrop backed by the Spectre offcanvas
|
|
1516
|
+
recipes.
|
|
1517
|
+
|
|
1518
|
+
| Attribute | Type | Default | Description |
|
|
1519
|
+
| ------------------------- | ------------------------------- | ------- | ------------------------------------------ |
|
|
1520
|
+
| `open` | boolean | `false` | Open/closed state |
|
|
1521
|
+
| `placement` | `start \| end \| top \| bottom` | `start` | Viewport edge the panel slides in from |
|
|
1522
|
+
| `label` | string | — | Header title; also labels the dialog |
|
|
1523
|
+
| `close-label` | string | `Close` | Accessible name of the header close button |
|
|
1524
|
+
| `id` / `title` / `aria-*` | string | — | Forwarded to the native dialog element |
|
|
1525
|
+
|
|
1526
|
+
**Content projection** — `slot="header"` replaces the `label` title,
|
|
1527
|
+
`slot="footer"` fills the footer region, and all other children become the
|
|
1528
|
+
body.
|
|
1529
|
+
|
|
1530
|
+
**Behavior** — while open: traps `Tab`/`Shift+Tab` focus, closes on `Esc`, the
|
|
1531
|
+
close button, or a backdrop click, focuses the first focusable element once
|
|
1532
|
+
the panel is visible, and restores focus on close. The closed panel is `inert`.
|
|
1533
|
+
|
|
1534
|
+
**Events** — `sp-close` (bubbling) when the user closes it.
|
|
1535
|
+
|
|
1536
|
+
**Internal targets** — `[data-sp-offcanvas-native]` (dialog),
|
|
1537
|
+
`[data-sp-offcanvas-backdrop]`, `[data-sp-offcanvas-close]`.
|
|
1538
|
+
|
|
1539
|
+
---
|
|
1540
|
+
|
|
1541
|
+
### sp-carousel
|
|
1542
|
+
|
|
1543
|
+
Renders a slide carousel backed by the Spectre carousel recipes. Each child
|
|
1544
|
+
element becomes one slide. The viewport is a native scroll-snap track, so it
|
|
1545
|
+
stays swipeable without script.
|
|
1546
|
+
|
|
1547
|
+
```html
|
|
1548
|
+
<sp-carousel aria-label="Featured work">
|
|
1549
|
+
<img alt="Project one" src="one.jpg" />
|
|
1550
|
+
<img alt="Project two" src="two.jpg" />
|
|
1551
|
+
</sp-carousel>
|
|
1552
|
+
```
|
|
1553
|
+
|
|
1554
|
+
| Attribute | Type | Default | Description |
|
|
1555
|
+
| ----------------- | ------- | ---------------- | ----------------------------------------------- |
|
|
1556
|
+
| `index` | number | `0` | Active slide |
|
|
1557
|
+
| `fade` | boolean | `false` | Cross-fades instead of scroll-snapping |
|
|
1558
|
+
| `loop` | boolean | `false` | Wraps from the last slide to the first and back |
|
|
1559
|
+
| `hide-controls` | boolean | `false` | Hides the previous/next buttons |
|
|
1560
|
+
| `hide-indicators` | boolean | `false` | Hides the slide indicators |
|
|
1561
|
+
| `previous-label` | string | `Previous slide` | Accessible name of the previous button |
|
|
1562
|
+
| `next-label` | string | `Next slide` | Accessible name of the next button |
|
|
1563
|
+
| `aria-label` | string | `Carousel` | Forwarded to the carousel region |
|
|
1564
|
+
| `id` / `title` | string | — | Forwarded to the carousel region |
|
|
1565
|
+
|
|
1566
|
+
**Accessibility** — follows the WAI-ARIA carousel pattern: a
|
|
1567
|
+
`role="region"` with `aria-roledescription="carousel"`, slides as
|
|
1568
|
+
`role="group"` with `aria-roledescription="slide"` and an "n of N" label, and a
|
|
1569
|
+
polite live region. `ArrowLeft`/`ArrowRight` move between slides. There is no
|
|
1570
|
+
autoplay.
|
|
1571
|
+
|
|
1572
|
+
**Events** — `sp-change` (bubbling) with `detail: { index }` when the user
|
|
1573
|
+
changes slides, including by swiping.
|
|
1574
|
+
|
|
1575
|
+
**Internal targets** — `[data-sp-carousel-native]`,
|
|
1576
|
+
`[data-sp-carousel-viewport]`, `[data-sp-carousel-slide]`,
|
|
1577
|
+
`[data-sp-carousel-prev]`, `[data-sp-carousel-next]`,
|
|
1578
|
+
`[data-sp-carousel-indicator]`.
|
|
1579
|
+
|
|
1580
|
+
---
|
|
1581
|
+
|
|
1582
|
+
### sp-table
|
|
1583
|
+
|
|
1584
|
+
Styles an authored `<table>` with the Spectre table recipes and wraps it in the
|
|
1585
|
+
horizontal-scroll wrapper. The table must be authored inside the component,
|
|
1586
|
+
because the HTML parser drops table parts outside a `<table>`.
|
|
1587
|
+
|
|
1588
|
+
```html
|
|
1589
|
+
<sp-table striped aria-label="Team members">
|
|
1590
|
+
<table>
|
|
1591
|
+
<thead><tr><th scope="col">Name</th></tr></thead>
|
|
1592
|
+
<tbody><tr><td>Ada</td></tr></tbody>
|
|
1593
|
+
</table>
|
|
1594
|
+
</sp-table>
|
|
1595
|
+
```
|
|
1596
|
+
|
|
1597
|
+
| Attribute | Type | Default | Description |
|
|
1598
|
+
| -------------------------------- | ---------- | ------- | ----------------------------------------------------- |
|
|
1599
|
+
| `size` | `sm \| md` | `md` | Cell density |
|
|
1600
|
+
| `striped` | boolean | `false` | Tints alternating body rows |
|
|
1601
|
+
| `hoverable` | boolean | `false` | Tints body rows under the pointer |
|
|
1602
|
+
| `bordered` | boolean | `false` | Borders every cell |
|
|
1603
|
+
| `aria-label` / `aria-labelledby` | string | — | Makes the wrapper a focusable, labelled scroll region |
|
|
1604
|
+
| `id` / `title` | string | — | Forwarded to the wrapper |
|
|
1605
|
+
|
|
1606
|
+
Recipe classes are added to the authored `<table>` alongside its own classes.
|
|
1607
|
+
For contextual rows, use `aria-selected="true"` or the
|
|
1608
|
+
`sp-table__row--{neutral|info|success|warning|danger|selected}` classes.
|
|
1609
|
+
|
|
1610
|
+
**Internal target** — `[data-sp-table-native]` selects the wrapper.
|
|
1611
|
+
|
|
1612
|
+
---
|
|
1613
|
+
|
|
1614
|
+
### sp-pagination
|
|
1615
|
+
|
|
1616
|
+
Renders page navigation backed by the Spectre pagination recipes.
|
|
1617
|
+
|
|
1618
|
+
```html
|
|
1619
|
+
<sp-pagination total="20" page="3"></sp-pagination>
|
|
1620
|
+
<sp-pagination total="20" href-template="/posts?page={page}"></sp-pagination>
|
|
1621
|
+
```
|
|
1622
|
+
|
|
1623
|
+
| Attribute | Type | Default | Description |
|
|
1624
|
+
| ---------------- | ---------------- | ------------ | ------------------------------------------------------------- |
|
|
1625
|
+
| `page` | number | `1` | Current page, clamped to `1…total` |
|
|
1626
|
+
| `total` | number | `1` | Page count |
|
|
1627
|
+
| `siblings` | number | `1` | Pages shown either side of the current one before an ellipsis |
|
|
1628
|
+
| `size` | `sm \| md \| lg` | `md` | Item size |
|
|
1629
|
+
| `href-template` | string | — | Renders links; `{page}` is replaced with the page number |
|
|
1630
|
+
| `previous-label` | string | `Previous` | Previous control text |
|
|
1631
|
+
| `next-label` | string | `Next` | Next control text |
|
|
1632
|
+
| `aria-label` | string | `Pagination` | Forwarded to the `<nav>` |
|
|
1633
|
+
| `id` / `title` | string | — | Forwarded to the `<nav>` |
|
|
1634
|
+
|
|
1635
|
+
**Accessibility** — the current page has `aria-current="page"`, page items are
|
|
1636
|
+
labelled "Page N", and boundary controls are disabled (`aria-disabled` without
|
|
1637
|
+
`href` in link mode).
|
|
1638
|
+
|
|
1639
|
+
**Events** — `sp-change` (bubbling) with `detail: { page }` when the user picks
|
|
1640
|
+
a page. In link mode the browser still follows the link.
|
|
1641
|
+
|
|
1642
|
+
**Internal target** — `[data-sp-pagination-native]` selects the `<nav>`.
|
|
1643
|
+
|
|
1644
|
+
---
|
|
1645
|
+
|
|
1646
|
+
### sp-stepper
|
|
1647
|
+
|
|
1648
|
+
Renders a progress stepper backed by the Spectre stepper recipes. Each child
|
|
1649
|
+
element becomes one step label.
|
|
1650
|
+
|
|
1651
|
+
```html
|
|
1652
|
+
<sp-stepper aria-label="Checkout" current="1">
|
|
1653
|
+
<span>Cart</span>
|
|
1654
|
+
<span>Shipping</span>
|
|
1655
|
+
<span>Payment</span>
|
|
1656
|
+
</sp-stepper>
|
|
1657
|
+
```
|
|
1658
|
+
|
|
1659
|
+
| Attribute | Type | Default | Description |
|
|
1660
|
+
| ------------------------- | ------------------------ | ------------ | ------------------------------------------------------- |
|
|
1661
|
+
| `current` | number | `0` | Active step; earlier steps are done, later ones pending |
|
|
1662
|
+
| `orientation` | `horizontal \| vertical` | `horizontal` | Layout direction |
|
|
1663
|
+
| `id` / `title` / `aria-*` | string | — | Forwarded to the native `<ol>` |
|
|
1664
|
+
|
|
1665
|
+
**Accessibility** — renders an `<ol>`; the active step has
|
|
1666
|
+
`aria-current="step"`. Done steps show a check mark, others their number.
|
|
1667
|
+
Setting `current` to the step count marks every step done.
|
|
1668
|
+
|
|
1669
|
+
**Internal target** — `[data-sp-stepper-native]` selects the `<ol>`.
|
|
1670
|
+
|
|
1671
|
+
---
|
|
1672
|
+
|
|
1673
|
+
### sp-switch
|
|
1674
|
+
|
|
1675
|
+
Renders a native `<input type="checkbox" role="switch">` inside a `<label>`,
|
|
1676
|
+
backed by the Spectre switch recipe. It submits with its form like a checkbox.
|
|
1677
|
+
|
|
1678
|
+
| Attribute | Type | Default | Description |
|
|
1679
|
+
| ------------------------- | ---------------- | ------- | -------------------------------------------- |
|
|
1680
|
+
| `checked` | boolean | `false` | On/off state; follows user toggles |
|
|
1681
|
+
| `size` | `sm \| md \| lg` | `md` | Track size |
|
|
1682
|
+
| `label` | string | — | Visible label when no children are projected |
|
|
1683
|
+
| `name` / `value` / `form` | string | — | Native form participation (`value` is `on`) |
|
|
1684
|
+
| `disabled` / `required` | boolean | `false` | Native constraints |
|
|
1685
|
+
| `focused` | boolean | `false` | Forced focus look (see Shared Conventions) |
|
|
1686
|
+
| `id` / `title` / `aria-*` | string | — | Forwarded to the native input |
|
|
1687
|
+
|
|
1688
|
+
**Content projection** — children become the label text.
|
|
1689
|
+
|
|
1690
|
+
---
|
|
1691
|
+
|
|
1692
|
+
### sp-range
|
|
1693
|
+
|
|
1694
|
+
Renders a native `<input type="range">` backed by the Spectre range recipe. It
|
|
1695
|
+
mirrors the value into `--sp-component-range-value` so WebKit/Blink paint the
|
|
1696
|
+
filled track.
|
|
1697
|
+
|
|
1698
|
+
| Attribute | Type | Default | Description |
|
|
1699
|
+
| ------------------------- | ------- | ----------------- | ----------------------------------- |
|
|
1700
|
+
| `value` | number | `50` | Current value, clamped to `min…max` |
|
|
1701
|
+
| `min` / `max` / `step` | number | `0` / `100` / `1` | Native range bounds |
|
|
1702
|
+
| `name` / `form` | string | — | Native form participation |
|
|
1703
|
+
| `disabled` / `focused` | boolean | `false` | Disabled state / forced focus look |
|
|
1704
|
+
| `id` / `title` / `aria-*` | string | — | Forwarded to the native input |
|
|
1705
|
+
|
|
1706
|
+
---
|
|
1707
|
+
|
|
1708
|
+
### sp-file-input
|
|
1709
|
+
|
|
1710
|
+
Renders a native `<input type="file">` backed by the Spectre file-input recipe,
|
|
1711
|
+
which styles the browser's file selector button. The `files` getter returns the
|
|
1712
|
+
native `FileList`.
|
|
1713
|
+
|
|
1714
|
+
| Attribute | Type | Default | Description |
|
|
1715
|
+
| ------------------------------------- | ---------------- | ------- | ---------------------------------- |
|
|
1716
|
+
| `size` | `sm \| md \| lg` | `md` | Control size |
|
|
1717
|
+
| `invalid` / `success` | boolean | `false` | Validation state (`invalid` wins) |
|
|
1718
|
+
| `accept` / `multiple` / `required` | string / boolean | — | Native file constraints |
|
|
1719
|
+
| `name` / `form` | string | — | Native form participation |
|
|
1720
|
+
| `full-width` / `disabled` / `focused` | boolean | `false` | Width, disabled, forced focus look |
|
|
1721
|
+
| `id` / `title` / `aria-*` | string | — | Forwarded to the native input |
|
|
1722
|
+
|
|
1723
|
+
---
|
|
1724
|
+
|
|
1725
|
+
### sp-input-group
|
|
1726
|
+
|
|
1727
|
+
Fuses addons and native controls into one bordered control, backed by the
|
|
1728
|
+
Spectre input-group recipes. The recipe styles its *direct* children, so the
|
|
1729
|
+
group takes native `<input>`, `<select>`, `<button>`, and file inputs rather
|
|
1730
|
+
than `sp-*` wrappers. Controls without an `sp-*` class get their recipe class
|
|
1731
|
+
(buttons use the `secondary` variant). Children marked `slot="addon"` become
|
|
1732
|
+
addons. Authored order is preserved.
|
|
1733
|
+
|
|
1734
|
+
```html
|
|
1735
|
+
<sp-input-group aria-label="Handle">
|
|
1736
|
+
<span slot="addon">@</span>
|
|
1737
|
+
<input aria-label="Username" />
|
|
1738
|
+
<button type="button">Check</button>
|
|
1739
|
+
</sp-input-group>
|
|
1740
|
+
```
|
|
1741
|
+
|
|
1742
|
+
| Attribute | Type | Default | Description |
|
|
1743
|
+
| ------------------------- | ------- | ------- | --------------------------------------- |
|
|
1744
|
+
| `disabled` | boolean | `false` | Disabled look for the whole group |
|
|
1745
|
+
| `id` / `title` / `aria-*` | string | — | Forwarded to the `role="group"` wrapper |
|
|
1746
|
+
|
|
1747
|
+
---
|
|
1748
|
+
|
|
1749
|
+
### sp-choice-card
|
|
1750
|
+
|
|
1751
|
+
Renders a whole-card option: a `<label>` wrapping a native radio or checkbox,
|
|
1752
|
+
backed by the Spectre choice-card recipe. Selection, focus, and disabled styling
|
|
1753
|
+
follow the native input. Radio cards that share a `name` keep their `checked`
|
|
1754
|
+
properties in sync.
|
|
1755
|
+
|
|
1756
|
+
| Attribute | Type | Default | Description |
|
|
1757
|
+
| ------------------------- | ------------------- | ------- | ----------------------------- |
|
|
1758
|
+
| `type` | `radio \| checkbox` | `radio` | Native input type |
|
|
1759
|
+
| `checked` | boolean | `false` | Selection state |
|
|
1760
|
+
| `name` / `value` / `form` | string | — | Native form participation |
|
|
1761
|
+
| `disabled` / `required` | boolean | `false` | Native constraints |
|
|
1762
|
+
| `hovered` / `focused` | boolean | `false` | Forced looks |
|
|
1763
|
+
| `id` / `aria-describedby` | string | — | Forwarded to the native input |
|
|
1764
|
+
|
|
1765
|
+
**Content projection** — children become the card content (the input's label).
|
|
1766
|
+
|
|
1767
|
+
---
|
|
1768
|
+
|
|
1769
|
+
### sp-progress
|
|
1770
|
+
|
|
1771
|
+
Renders a `role="progressbar"` track and fill backed by the Spectre progress
|
|
1772
|
+
recipes.
|
|
1773
|
+
|
|
1774
|
+
| Attribute | Type | Default | Description |
|
|
1775
|
+
| ------------------------- | ---------------------------------------------------------- | ----------- | --------------------------------------------- |
|
|
1776
|
+
| `value` / `max` | number | `0` / `100` | Progress, clamped to `0…max` |
|
|
1777
|
+
| `variant` | `brand \| neutral \| info \| success \| warning \| danger` | `brand` | Fill color role |
|
|
1778
|
+
| `size` | `sm \| md \| lg` | `md` | Track height |
|
|
1779
|
+
| `indeterminate` | boolean | `false` | Animated sweep; omits `aria-valuenow` |
|
|
1780
|
+
| `label` | string | — | Visible label above the track; labels the bar |
|
|
1781
|
+
| `value-text` | string | — | `aria-valuetext` (e.g. "3 of 8 files") |
|
|
1782
|
+
| `id` / `title` / `aria-*` | string | — | Forwarded to the track |
|
|
1783
|
+
|
|
1784
|
+
---
|
|
1785
|
+
|
|
1786
|
+
### sp-popover
|
|
1787
|
+
|
|
1788
|
+
A click-toggled, non-modal `role="dialog"` anchored to its trigger, backed by
|
|
1789
|
+
the Spectre popover recipes. Unlike `sp-tooltip` it stays open for interaction.
|
|
1790
|
+
|
|
1791
|
+
| Attribute | Type | Default | Description |
|
|
1792
|
+
| --------------- | -------------------------------- | -------------- | --------------------------------------------- |
|
|
1793
|
+
| `open` | boolean | `false` | Open state |
|
|
1794
|
+
| `placement` | `top \| bottom \| left \| right` | `bottom` | Side the panel opens on |
|
|
1795
|
+
| `label` | string | — | Header title; also labels the dialog |
|
|
1796
|
+
| `trigger-label` | string | `Show details` | Trigger text when no `slot="trigger"` content |
|
|
1797
|
+
| `id` / `title` | string | — | Forwarded to the dialog panel |
|
|
1798
|
+
|
|
1799
|
+
**Content projection** — `slot="trigger"` fills the trigger button,
|
|
1800
|
+
`slot="header"` replaces the `label` title, other children fill the body.
|
|
1801
|
+
|
|
1802
|
+
**Behavior** — the trigger toggles it (`aria-expanded`/`aria-controls`); `Esc`
|
|
1803
|
+
closes it and refocuses the trigger; an outside click closes it. Without a
|
|
1804
|
+
header the dialog is labelled by its trigger.
|
|
1805
|
+
|
|
1806
|
+
**Events** — `sp-open` and `sp-close` (bubbling).
|
|
1807
|
+
|
|
1808
|
+
---
|
|
1809
|
+
|
|
1810
|
+
### sp-datepicker
|
|
1811
|
+
|
|
1812
|
+
Renders an inline calendar backed by the Spectre datepicker and day recipes.
|
|
1813
|
+
Values are local ISO dates (`YYYY-MM-DD`), with no time-zone shift.
|
|
1814
|
+
|
|
1815
|
+
| Attribute | Type | Default | Description |
|
|
1816
|
+
| ------------------------------- | ------ | ------------------------------- | ---------------------------------------------- |
|
|
1817
|
+
| `value` | string | — | Selected date; malformed dates are dropped |
|
|
1818
|
+
| `min` / `max` | string | — | Selectable range; days outside it are disabled |
|
|
1819
|
+
| `week-start` | number | `0` | First weekday (`0` Sunday … `6` Saturday) |
|
|
1820
|
+
| `locale` | string | browser locale | Month, weekday, and day-label formatting |
|
|
1821
|
+
| `name` | string | — | Submits the value through a hidden input |
|
|
1822
|
+
| `previous-label` / `next-label` | string | `Previous month` / `Next month` | Month button labels |
|
|
1823
|
+
| `aria-label` | string | month title | Labels the calendar group |
|
|
1824
|
+
|
|
1825
|
+
**Accessibility** — every day is a button labelled with its full date,
|
|
1826
|
+
`aria-pressed` on the selected day and `aria-current="date"` on today. One day
|
|
1827
|
+
is the tab stop (roving `tabindex`). Arrows move by day and week, `Home`/`End`
|
|
1828
|
+
go to the week's start and end, and `PageUp`/`PageDown` change the month
|
|
1829
|
+
(`Shift` for a year). The month title is a polite live region.
|
|
1830
|
+
|
|
1831
|
+
**Events** — `sp-change` (bubbling) with `detail: { value }`.
|
|
1832
|
+
|
|
1833
|
+
---
|
|
1834
|
+
|
|
1835
|
+
### sp-external-auth-button
|
|
1836
|
+
|
|
1837
|
+
One neutral button treatment for every third-party sign-in provider, backed by
|
|
1838
|
+
the Spectre external-auth-button recipes. It deliberately carries no provider
|
|
1839
|
+
colors. Put the provider logo in `slot="icon"` and the label in the default
|
|
1840
|
+
slot.
|
|
1841
|
+
|
|
1842
|
+
| Attribute | Type | Default | Description |
|
|
1843
|
+
| ------------------------------------- | ------------------ | -------- | ---------------------------------- |
|
|
1844
|
+
| `href` | string | — | Renders a link instead of a button |
|
|
1845
|
+
| `type` | `button \| submit` | `button` | Native button type |
|
|
1846
|
+
| `full-width` / `disabled` / `loading` | boolean | `false` | Width, disabled, busy states |
|
|
1847
|
+
| `hovered` / `focused` / `active` | boolean | `false` | Forced looks |
|
|
1848
|
+
| `id` / `title` / `aria-label` | string | — | Forwarded to the native element |
|
|
1849
|
+
|
|
1850
|
+
---
|
|
1851
|
+
|
|
1852
|
+
### sp-card-bleed
|
|
1853
|
+
|
|
1854
|
+
A band inside `sp-card` (usually media) that runs flush through the card's
|
|
1855
|
+
padding, backed by `getCardBleedClasses`.
|
|
1856
|
+
|
|
1857
|
+
| Attribute | Type | Default | Description |
|
|
1858
|
+
| --------- | ------------------------------------------------- | ------- | ----------------------------------------------------- |
|
|
1859
|
+
| `edges` | space-separated `top right bottom left`, or `all` | — | Edges to bleed through |
|
|
1860
|
+
| `padded` | `sm \| md \| lg`, or bare | — | The card padding step being escaped (bare means `md`) |
|
|
1861
|
+
|
|
1862
|
+
---
|
|
1863
|
+
|
|
1864
|
+
### sp-prose
|
|
1865
|
+
|
|
1866
|
+
Wraps authored long-form HTML (headings, lists, code, quotes, rules) in the
|
|
1867
|
+
Spectre prose surface. An `aria-label` also makes it a labelled region.
|
|
1868
|
+
|
|
1869
|
+
---
|
|
1870
|
+
|
|
1871
|
+
### Shared conventions (spectre-ui 5.3.0 parity)
|
|
1872
|
+
|
|
1873
|
+
**Forced interaction states** — components whose recipe supports them accept
|
|
1874
|
+
`hovered`, `focused`, and `active` booleans (`hovered`/`focused` only where the
|
|
1875
|
+
recipe has no pressed state). They force the look for documentation, previews,
|
|
1876
|
+
and visual tests; real interaction is still styled by native pseudo-classes.
|
|
1877
|
+
Where a component already uses `active` to mean "current" (`sp-footer-link`,
|
|
1878
|
+
`sp-sidebar-link`, `sp-list-group-item`, `sp-nav-item`), it keeps that meaning.
|
|
1879
|
+
|
|
1880
|
+
**Part markers** — class-only recipe parts are applied in place to authored
|
|
1881
|
+
elements that opt in with a `slot` marker, keeping authored order. Nothing is
|
|
1882
|
+
styled by tag name.
|
|
1883
|
+
|
|
1884
|
+
| Component | Markers |
|
|
1885
|
+
| ----------------------------------- | -------------------------------------------------------------------- |
|
|
1886
|
+
| `sp-footer` | `heading`, `text`, `muted`, `links`, `divider` (any depth) |
|
|
1887
|
+
| `sp-nav` | `links` |
|
|
1888
|
+
| `sp-sidebar` | `header`; `group` on a `<details>` (its `<summary>` is styled) |
|
|
1889
|
+
| `sp-dropdown` / `sp-nav-item` menus | `item`, `header`, `divider` |
|
|
1890
|
+
| `sp-list-group-item` | `heading`, `text` |
|
|
1891
|
+
| `sp-carousel` slides | `caption` (inside a slide) |
|
|
1892
|
+
| `sp-table` rows | `data-variant="neutral\|info\|success\|warning\|danger"` on a `<tr>` |
|
|
1893
|
+
|
|
1894
|
+
**Additions to existing components**
|
|
1895
|
+
|
|
1896
|
+
| Component | Added |
|
|
1897
|
+
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1898
|
+
| `sp-button` | `warning`, `link`, `light`, `dark` variants |
|
|
1899
|
+
| `sp-badge` | `brand` variant, `dot` notification mode, `interactive` |
|
|
1900
|
+
| `sp-spinner` / `sp-toast` | `inverse` / `neutral` variants |
|
|
1901
|
+
| `sp-alert` | `interactive` |
|
|
1902
|
+
| `sp-rating` | `interactive`, `pill`, `full-width` |
|
|
1903
|
+
| `sp-text` | `onSurface*` variants; `preset="heading \| display \| lead"` with `heading-level` (`h1`–`h6`, defaults to the element level) and `display-level` (`1`–`6`) |
|
|
1904
|
+
| `sp-container` | `padding` (`sm \| md \| lg`); `max-width` gains `none` and `wide` |
|
|
1905
|
+
| `sp-section` | `spacing` and `gap` (`sm \| md \| lg`) |
|
|
1906
|
+
| `sp-stack` | `basis="none"` |
|
|
1907
|
+
| `sp-grid` | `col-start` (`1`–`12`, or per-breakpoint JSON like `span`) |
|
|
1908
|
+
| `sp-nav-item` | `active` (current page, `aria-current`), `disabled`, and dropdown `viewport`, `full-width`, `accent`/`accent-color` |
|
|
1909
|
+
| `sp-input` | `label`, `helper-text`, `error-message` (wraps the input only when set; an error sets the error state and `aria-invalid`) |
|
|
1910
|
+
| `sp-select` / `sp-textarea` | `focused` |
|
|
1911
|
+
| `sp-pricing-card` | `badge`, `price`, `description`, `header`, `footer` slots |
|
|
1912
|
+
| `sp-testimonial` | `quote`, `author-image`, `author-name`, `author-title` slots |
|
|
1913
|
+
|
|
1336
1914
|
## Package Exports / API Surface
|
|
1337
1915
|
|
|
1338
1916
|
### Root — `@phcdevworks/spectre-components`
|
|
@@ -1408,46 +1986,91 @@ defineSpectreComponents() // registers all sp-* elements
|
|
|
1408
1986
|
`SpectreDropdownProps`, `SpectreModalProps`, `SpectreToastProps`,
|
|
1409
1987
|
`SpectreTooltipProps`
|
|
1410
1988
|
|
|
1989
|
+
**Broad component inventory**: `defineSpectreTabs`, `defineSpectreTabPanel`,
|
|
1990
|
+
`defineSpectreAccordion`, `defineSpectreAccordionItem`,
|
|
1991
|
+
`defineSpectreBreadcrumb`, `defineSpectreListGroup`,
|
|
1992
|
+
`defineSpectreListGroupItem`, `defineSpectreOffcanvas`,
|
|
1993
|
+
`defineSpectreCarousel`, `defineSpectreTable`, `defineSpectrePagination`,
|
|
1994
|
+
`defineSpectreStepper`; their element classes and `*Props` interfaces; and
|
|
1995
|
+
`spectreTabsVariants`, `spectreOffcanvasPlacements`, `spectreTableSizes`,
|
|
1996
|
+
`spectrePaginationSizes`, `spectreStepperOrientations` with the matching
|
|
1997
|
+
`SpectreTabsVariant`, `SpectreOffcanvasPlacement`, `SpectreTableSize`,
|
|
1998
|
+
`SpectrePaginationSize`, and `SpectreStepperOrientation` types
|
|
1999
|
+
|
|
2000
|
+
**spectre-ui 5.3.0 parity**: `defineSpectreSwitch`, `defineSpectreRange`,
|
|
2001
|
+
`defineSpectreFileInput`, `defineSpectreInputGroup`, `defineSpectreChoiceCard`,
|
|
2002
|
+
`defineSpectreProgress`, `defineSpectrePopover`, `defineSpectreDatepicker`,
|
|
2003
|
+
`defineSpectreExternalAuthButton`, `defineSpectreCardBleed`,
|
|
2004
|
+
`defineSpectreProse`; their element classes and `*Props` interfaces; and
|
|
2005
|
+
`spectreProgressVariants`, `spectreProgressSizes`, `spectreSwitchSizes`,
|
|
2006
|
+
`spectreFileInputSizes`, `spectrePopoverPlacements`, `spectreContainerPaddings`,
|
|
2007
|
+
`spectreSectionSpacings`, `spectreGridColStarts`, `spectreTableRowVariants`,
|
|
2008
|
+
`spectreTextPresets`, `spectreHeadingLevels`, `spectreDisplayLevels` with their
|
|
2009
|
+
matching types
|
|
2010
|
+
|
|
1411
2011
|
### Subpath entry points
|
|
1412
2012
|
|
|
1413
2013
|
Each entry point registers only that component and exports only its surface:
|
|
1414
2014
|
|
|
1415
|
-
| Entry point
|
|
1416
|
-
|
|
|
1417
|
-
| `.../button`
|
|
1418
|
-
| `.../input`
|
|
1419
|
-
| `.../textarea`
|
|
1420
|
-
| `.../select`
|
|
1421
|
-
| `.../checkbox`
|
|
1422
|
-
| `.../radio`
|
|
1423
|
-
| `.../label`
|
|
1424
|
-
| `.../fieldset`
|
|
1425
|
-
| `.../badge`
|
|
1426
|
-
| `.../card`
|
|
1427
|
-
| `.../icon-box`
|
|
1428
|
-
| `.../rating`
|
|
1429
|
-
| `.../testimonial`
|
|
1430
|
-
| `.../alert`
|
|
1431
|
-
| `.../avatar`
|
|
1432
|
-
| `.../spinner`
|
|
1433
|
-
| `.../tag`
|
|
1434
|
-
| `.../pricing-card`
|
|
1435
|
-
| `.../container`
|
|
1436
|
-
| `.../grid`
|
|
1437
|
-
| `.../section`
|
|
1438
|
-
| `.../stack`
|
|
1439
|
-
| `.../nav`
|
|
1440
|
-
| `.../nav-item`
|
|
1441
|
-
| `.../sidebar`
|
|
1442
|
-
| `.../sidebar-link`
|
|
1443
|
-
| `.../sidebar-toggle`
|
|
1444
|
-
| `.../dropdown`
|
|
1445
|
-
| `.../footer`
|
|
1446
|
-
| `.../footer-link`
|
|
1447
|
-
| `.../footer-chip`
|
|
1448
|
-
| `.../modal`
|
|
1449
|
-
| `.../toast`
|
|
1450
|
-
| `.../tooltip`
|
|
2015
|
+
| Entry point | Registers | Key exports |
|
|
2016
|
+
| -------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
2017
|
+
| `.../button` | `sp-button` | `defineSpectreButton`, `SpectreButtonElement`, button constants and types |
|
|
2018
|
+
| `.../input` | `sp-input` | `defineSpectreInput`, `SpectreInputElement`, input constants and types |
|
|
2019
|
+
| `.../textarea` | `sp-textarea` | `defineSpectreTextarea`, `SpectreTextareaElement`, `SpectreTextareaProps` |
|
|
2020
|
+
| `.../select` | `sp-select` | `defineSpectreSelect`, `SpectreSelectElement`, `SpectreSelectProps` |
|
|
2021
|
+
| `.../checkbox` | `sp-checkbox` | `defineSpectreCheckbox`, `SpectreCheckboxElement`, `SpectreCheckboxProps` |
|
|
2022
|
+
| `.../radio` | `sp-radio` | `defineSpectreRadio`, `SpectreRadioElement`, `SpectreRadioProps` |
|
|
2023
|
+
| `.../label` | `sp-label` | `defineSpectreLabel`, `SpectreLabelElement`, `SpectreLabelProps` |
|
|
2024
|
+
| `.../fieldset` | `sp-fieldset` | `defineSpectreFieldset`, `SpectreFieldsetElement`, `SpectreFieldsetProps` |
|
|
2025
|
+
| `.../badge` | `sp-badge` | `defineSpectreBadge`, `SpectreBadgeElement`, badge constants and types |
|
|
2026
|
+
| `.../card` | `sp-card` | `defineSpectreCard`, `SpectreCardElement`, card constants and types |
|
|
2027
|
+
| `.../icon-box` | `sp-icon-box` | `defineSpectreIconBox`, `SpectreIconBoxElement`, icon-box constants and types |
|
|
2028
|
+
| `.../rating` | `sp-rating` | `defineSpectreRating`, `SpectreRatingElement`, rating constants and types |
|
|
2029
|
+
| `.../testimonial` | `sp-testimonial` | `defineSpectreTestimonial`, `SpectreTestimonialElement`, testimonial constants and types |
|
|
2030
|
+
| `.../alert` | `sp-alert` | `defineSpectreAlert`, `SpectreAlertElement`, alert constants and types |
|
|
2031
|
+
| `.../avatar` | `sp-avatar` | `defineSpectreAvatar`, `SpectreAvatarElement`, avatar constants and types |
|
|
2032
|
+
| `.../spinner` | `sp-spinner` | `defineSpectreSpinner`, `SpectreSpinnerElement`, spinner constants and types |
|
|
2033
|
+
| `.../tag` | `sp-tag` | `defineSpectreTag`, `SpectreTagElement`, tag constants and types |
|
|
2034
|
+
| `.../pricing-card` | `sp-pricing-card` | `defineSpectrePricingCard`, `SpectrePricingCardElement`, `SpectrePricingCardProps` |
|
|
2035
|
+
| `.../container` | `sp-container` | `defineSpectreContainer`, `SpectreContainerElement`, container constants and types |
|
|
2036
|
+
| `.../grid` | `sp-grid` | `defineSpectreGrid`, `SpectreGridElement`, grid constants and types |
|
|
2037
|
+
| `.../section` | `sp-section` | `defineSpectreSection`, `SpectreSectionElement`, `SpectreSectionProps` |
|
|
2038
|
+
| `.../stack` | `sp-stack` | `defineSpectreStack`, `SpectreStackElement`, stack constants and types |
|
|
2039
|
+
| `.../nav` | `sp-nav` | `defineSpectreNav`, `SpectreNavElement`, `SpectreNavProps` |
|
|
2040
|
+
| `.../nav-item` | `sp-nav-item` | `defineSpectreNavItem`, `SpectreNavItemElement`, `SpectreNavItemProps` |
|
|
2041
|
+
| `.../sidebar` | `sp-sidebar` | `defineSpectreSidebar`, `SpectreSidebarElement`, `SpectreSidebarProps` |
|
|
2042
|
+
| `.../sidebar-link` | `sp-sidebar-link` | `defineSpectreSidebarLink`, `SpectreSidebarLinkElement`, `SpectreSidebarLinkProps` |
|
|
2043
|
+
| `.../sidebar-toggle` | `sp-sidebar-toggle` | `defineSpectreSidebarToggle`, `SpectreSidebarToggleElement`, `SpectreSidebarToggleProps` |
|
|
2044
|
+
| `.../dropdown` | `sp-dropdown` | `defineSpectreDropdown`, `SpectreDropdownElement`, dropdown constants and types |
|
|
2045
|
+
| `.../footer` | `sp-footer` | `defineSpectreFooter`, `SpectreFooterElement`, `SpectreFooterProps` |
|
|
2046
|
+
| `.../footer-link` | `sp-footer-link` | `defineSpectreFooterLink`, `SpectreFooterLinkElement`, `SpectreFooterLinkProps` |
|
|
2047
|
+
| `.../footer-chip` | `sp-footer-chip` | `defineSpectreFooterChip`, `SpectreFooterChipElement`, `SpectreFooterChipProps` |
|
|
2048
|
+
| `.../modal` | `sp-modal` | `defineSpectreModal`, `SpectreModalElement`, `SpectreModalProps` |
|
|
2049
|
+
| `.../toast` | `sp-toast` | `defineSpectreToast`, `SpectreToastElement`, toast constants and types |
|
|
2050
|
+
| `.../tooltip` | `sp-tooltip` | `defineSpectreTooltip`, `SpectreTooltipElement`, tooltip constants and types |
|
|
2051
|
+
| `.../tabs` | `sp-tabs` | `defineSpectreTabs`, `SpectreTabsElement`, tabs constants and types |
|
|
2052
|
+
| `.../tab-panel` | `sp-tab-panel` | `defineSpectreTabPanel`, `SpectreTabPanelElement`, `SpectreTabPanelProps` |
|
|
2053
|
+
| `.../accordion` | `sp-accordion` | `defineSpectreAccordion`, `SpectreAccordionElement`, `SpectreAccordionProps` |
|
|
2054
|
+
| `.../accordion-item` | `sp-accordion-item` | `defineSpectreAccordionItem`, `SpectreAccordionItemElement`, `SpectreAccordionItemProps` |
|
|
2055
|
+
| `.../breadcrumb` | `sp-breadcrumb` | `defineSpectreBreadcrumb`, `SpectreBreadcrumbElement`, `SpectreBreadcrumbProps` |
|
|
2056
|
+
| `.../list-group` | `sp-list-group` | `defineSpectreListGroup`, `SpectreListGroupElement`, `SpectreListGroupProps` |
|
|
2057
|
+
| `.../list-group-item` | `sp-list-group-item` | `defineSpectreListGroupItem`, `SpectreListGroupItemElement`, `SpectreListGroupItemProps` |
|
|
2058
|
+
| `.../offcanvas` | `sp-offcanvas` | `defineSpectreOffcanvas`, `SpectreOffcanvasElement`, offcanvas constants and types |
|
|
2059
|
+
| `.../carousel` | `sp-carousel` | `defineSpectreCarousel`, `SpectreCarouselElement`, `SpectreCarouselProps` |
|
|
2060
|
+
| `.../table` | `sp-table` | `defineSpectreTable`, `SpectreTableElement`, table constants and types |
|
|
2061
|
+
| `.../pagination` | `sp-pagination` | `defineSpectrePagination`, `SpectrePaginationElement`, pagination constants and types |
|
|
2062
|
+
| `.../stepper` | `sp-stepper` | `defineSpectreStepper`, `SpectreStepperElement`, stepper constants and types |
|
|
2063
|
+
| `.../card-bleed` | `sp-card-bleed` | `defineSpectreCardBleed`, `SpectreCardBleedElement`, `SpectreCardBleedProps` |
|
|
2064
|
+
| `.../prose` | `sp-prose` | `defineSpectreProse`, `SpectreProseElement`, `SpectreProseProps` |
|
|
2065
|
+
| `.../progress` | `sp-progress` | `defineSpectreProgress`, `SpectreProgressElement`, progress constants and types |
|
|
2066
|
+
| `.../switch` | `sp-switch` | `defineSpectreSwitch`, `SpectreSwitchElement`, switch constants and types |
|
|
2067
|
+
| `.../range` | `sp-range` | `defineSpectreRange`, `SpectreRangeElement`, `SpectreRangeProps` |
|
|
2068
|
+
| `.../file-input` | `sp-file-input` | `defineSpectreFileInput`, `SpectreFileInputElement`, file-input constants and types |
|
|
2069
|
+
| `.../external-auth-button` | `sp-external-auth-button` | `defineSpectreExternalAuthButton`, `SpectreExternalAuthButtonElement`, `SpectreExternalAuthButtonProps` |
|
|
2070
|
+
| `.../choice-card` | `sp-choice-card` | `defineSpectreChoiceCard`, `SpectreChoiceCardElement`, `SpectreChoiceCardProps` |
|
|
2071
|
+
| `.../input-group` | `sp-input-group` | `defineSpectreInputGroup`, `SpectreInputGroupElement`, `SpectreInputGroupProps` |
|
|
2072
|
+
| `.../popover` | `sp-popover` | `defineSpectrePopover`, `SpectrePopoverElement`, popover constants and types |
|
|
2073
|
+
| `.../datepicker` | `sp-datepicker` | `defineSpectreDatepicker`, `SpectreDatepickerElement`, `SpectreDatepickerProps` |
|
|
1451
2074
|
|
|
1452
2075
|
Size constants are shared between input, textarea, and select. Import
|
|
1453
2076
|
`spectreInputSizes` / `SpectreInputSize` from `.../input` when needed alongside
|