@eldrajs/ui 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/README.md +324 -161
- package/dist/{VariantPicker-CjWUVhlm.js → VariantPicker-C-9sMXGI.js} +3275 -2040
- package/dist/componentNames.d.ts +1 -1
- package/dist/components/accordion/Accordion.vue.d.ts +1 -2
- package/dist/components/accordion/AccordionItem.vue.d.ts +1 -1
- package/dist/components/accordion/types.d.ts +6 -7
- package/dist/components/avatar/Avatar.vue.d.ts +1 -1
- package/dist/components/avatar/types.d.ts +6 -4
- package/dist/components/badge/types.d.ts +6 -4
- package/dist/components/breadcrumb/types.d.ts +5 -2
- package/dist/components/button/Button.vue.d.ts +6 -3
- package/dist/components/button/ButtonGroup.vue.d.ts +0 -1
- package/dist/components/button/types.d.ts +39 -9
- package/dist/components/card/ContentCard.vue.d.ts +2 -2
- package/dist/components/card/FeatureCard.vue.d.ts +1 -1
- package/dist/components/card/stretchedLink.d.ts +3 -3
- package/dist/components/card/types.d.ts +6 -4
- package/dist/components/carousel/types.d.ts +7 -3
- package/dist/components/checkbox/Checkbox.vue.d.ts +5 -3
- package/dist/components/checkbox/CheckboxGroup.vue.d.ts +1 -1
- package/dist/components/checkbox/types.d.ts +21 -4
- package/dist/components/chip/Chip.vue.d.ts +5 -4
- package/dist/components/chip/ChipGroup.vue.d.ts +0 -1
- package/dist/components/chip/types.d.ts +5 -6
- package/dist/components/container/Container.vue.d.ts +0 -1
- package/dist/components/container/types.d.ts +0 -4
- package/dist/components/dialog/Dialog.vue.d.ts +13 -8
- package/dist/components/dialog/types.d.ts +16 -4
- package/dist/components/drawer/Drawer.vue.d.ts +2 -1
- package/dist/components/drawer/types.d.ts +5 -2
- package/dist/components/empty-state/EmptyState.vue.d.ts +1 -1
- package/dist/components/empty-state/types.d.ts +7 -6
- package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +4 -1
- package/dist/components/field-wrapper/RequiredMark.vue.d.ts +15 -0
- package/dist/components/field-wrapper/context.d.ts +8 -0
- package/dist/components/field-wrapper/types.d.ts +17 -6
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +1 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +7 -6
- package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +1 -0
- package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +1 -0
- package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +2 -1
- package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +1 -0
- package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +1 -0
- package/dist/components/filter-panel/facets/shared.d.ts +4 -4
- package/dist/components/filter-panel/types.d.ts +5 -2
- package/dist/components/form-layout/FormLayout.vue.d.ts +1 -1
- package/dist/components/form-layout/types.d.ts +5 -2
- package/dist/components/icon/Icon.vue.d.ts +1 -2
- package/dist/components/icon/types.d.ts +0 -4
- package/dist/components/image/types.d.ts +3 -2
- package/dist/components/input/Input.vue.d.ts +13 -8
- package/dist/components/input/classes.d.ts +33 -18
- package/dist/components/input/reassertValue.d.ts +13 -0
- package/dist/components/input/types.d.ts +18 -6
- package/dist/components/input/useAdornmentRoom.d.ts +15 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +2 -1
- package/dist/components/lightbox/types.d.ts +5 -2
- package/dist/components/link/Link.vue.d.ts +1 -1
- package/dist/components/link/types.d.ts +5 -2
- package/dist/components/load-more/types.d.ts +4 -3
- package/dist/components/logo-item/LogoItem.vue.d.ts +1 -1
- package/dist/components/logo-item/types.d.ts +2 -1
- package/dist/components/nav-menu/NavMenu.vue.d.ts +2 -1
- package/dist/components/nav-menu/navLinks.d.ts +1 -1
- package/dist/components/nav-menu/types.d.ts +3 -3
- package/dist/components/pagination/Pagination.vue.d.ts +154 -0
- package/dist/components/pagination/types.d.ts +36 -2
- package/dist/components/popover/Popover.vue.d.ts +29 -2
- package/dist/components/popover/types.d.ts +62 -9
- package/dist/components/price/types.d.ts +3 -2
- package/dist/components/product-card/ProductCard.vue.d.ts +2 -2
- package/dist/components/product-card/types.d.ts +3 -2
- package/dist/components/quantity-stepper/QuantityStepper.vue.d.ts +4 -4
- package/dist/components/quantity-stepper/types.d.ts +5 -2
- package/dist/components/radio/Radio.vue.d.ts +33 -0
- package/dist/components/radio/RadioGroup.vue.d.ts +6 -2
- package/dist/components/radio/recipes.d.ts +41 -0
- package/dist/components/radio/types.d.ts +71 -4
- package/dist/components/range-slider/RangeSlider.vue.d.ts +2 -1
- package/dist/components/range-slider/types.d.ts +5 -2
- package/dist/components/rating/Rating.vue.d.ts +1 -1
- package/dist/components/rating/types.d.ts +3 -2
- package/dist/components/search-bar/SearchBar.vue.d.ts +4 -3
- package/dist/components/search-bar/SearchResultsPanel.vue.d.ts +1 -1
- package/dist/components/search-bar/types.d.ts +5 -2
- package/dist/components/search-modal/SearchModal.vue.d.ts +3 -2
- package/dist/components/search-modal/types.d.ts +7 -4
- package/dist/components/section/Section.vue.d.ts +0 -1
- package/dist/components/section/types.d.ts +0 -4
- package/dist/components/select/MultiSelect.vue.d.ts +53 -6
- package/dist/components/select/Select.vue.d.ts +24 -4
- package/dist/components/select/SelectPanel.vue.d.ts +25 -2
- package/dist/components/select/SelectTags.vue.d.ts +50 -0
- package/dist/components/select/openRegistry.d.ts +14 -4
- package/dist/components/select/panelParts.d.ts +45 -18
- package/dist/components/select/types.d.ts +54 -10
- package/dist/components/select/useOptionList.d.ts +31 -4
- package/dist/components/select/usePopover.d.ts +36 -39
- package/dist/components/select/useSummaryFit.d.ts +21 -0
- package/dist/components/select/useTagRows.d.ts +17 -0
- package/dist/components/site-form/SiteForm.vue.d.ts +3 -2
- package/dist/components/site-form/types.d.ts +6 -2
- package/dist/components/skeleton/Skeleton.vue.d.ts +2 -2
- package/dist/components/skeleton/types.d.ts +4 -4
- package/dist/components/switch/Switch.vue.d.ts +17 -10
- package/dist/components/switch/types.d.ts +29 -2
- package/dist/components/tabler-icon/TablerIcon.vue.d.ts +2 -3
- package/dist/components/tabler-icon/types.d.ts +0 -4
- package/dist/components/tabs/Tab.vue.d.ts +2 -1
- package/dist/components/tabs/TabPanel.vue.d.ts +1 -3
- package/dist/components/tabs/Tabs.vue.d.ts +1 -1
- package/dist/components/tabs/context.d.ts +6 -2
- package/dist/components/tabs/types.d.ts +22 -11
- package/dist/components/textarea/Textarea.vue.d.ts +23 -3
- package/dist/components/textarea/types.d.ts +15 -3
- package/dist/components/toast/Toast.vue.d.ts +2 -0
- package/dist/components/toast/Toaster.vue.d.ts +7 -1
- package/dist/components/toast/types.d.ts +52 -5
- package/dist/components/tooltip/types.d.ts +4 -3
- package/dist/components/unit-input/UnitInput.vue.d.ts +7 -7
- package/dist/components/unit-input/types.d.ts +5 -2
- package/dist/components/variant-picker/VariantPicker.vue.d.ts +1 -1
- package/dist/components/variant-picker/types.d.ts +3 -2
- package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +0 -1
- package/dist/components/visually-hidden/types.d.ts +0 -4
- package/dist/components.css +1556 -2145
- package/dist/composables/useDialog.d.ts +7 -3
- package/dist/composables/useEldraScope.d.ts +24 -0
- package/dist/composables/useFloating.d.ts +21 -8
- package/dist/composables/useOverlay.d.ts +10 -5
- package/dist/composables/useToast.d.ts +3 -0
- package/dist/index.d.ts +12 -10
- package/dist/index.js +2553 -1185
- package/dist/messages/en-US.d.ts +2 -0
- package/dist/messages/is-IS.js +1 -0
- package/dist/resolver.js +1 -0
- package/dist/style.css +1561 -2150
- package/dist/tailwind.css +11 -2203
- package/dist/theme.css +108 -0
- package/dist/tokens.css +1 -0
- package/dist/useMessages-B5nzZghs.js +592 -0
- package/dist/utilities.css +2160 -0
- package/dist/utils/mergeClass.d.ts +3 -0
- package/dist/utils/tagRecipe.d.ts +3 -3
- package/dist/vee-validate.js +42 -6
- package/dist/vue-i18n/index.d.ts +50 -0
- package/dist/vue-i18n/shapes.d.ts +40 -0
- package/dist/vue-i18n.js +289 -0
- package/package.json +17 -3
- package/dist/utils/cx.d.ts +0 -31
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Accessible Vue 3 core components for Eldra storefronts, themed through CSS desig
|
|
|
5
5
|
The components are built to
|
|
6
6
|
[`eldra-starter-spec/01-core-components.md`](../../eldra-starter-spec/01-core-components.md) (WCAG
|
|
7
7
|
2.2 AA). Plan 1 — foundations, actions and forms (`Button`/`ButtonGroup`, `Link`, `Input`,
|
|
8
|
-
`Textarea`, `FieldWrapper`, `FormLayout`, `Checkbox`/`CheckboxGroup`, `RadioGroup`, `Switch`,
|
|
8
|
+
`Textarea`, `FieldWrapper`, `FormLayout`, `Checkbox`/`CheckboxGroup`, `Radio`/`RadioGroup`, `Switch`,
|
|
9
9
|
`Select`/`MultiSelect`, `QuantityStepper`, `VariantPicker`, `SearchBar`) — is complete, plus
|
|
10
10
|
`UnitInput` and `CurrencyInput`, which the spec has no equivalent of; display, commerce, layout, overlays, navigation
|
|
11
11
|
and feedback components land in the two sub-projects that follow, in the same delivery order the
|
|
@@ -27,47 +27,24 @@ entry needs it, and nothing else in the package imports it.
|
|
|
27
27
|
|
|
28
28
|
## Styles
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
The components come **prebuilt**: an app never compiles this package's styles and needs no Tailwind
|
|
31
|
+
of its own to use them. Every class a component renders is `eldra:`-prefixed (`eldra:px-4`,
|
|
32
|
+
`eldra:hover:bg-primary`), compiled with Tailwind's `prefix(eldra)`, and every theme variable it
|
|
33
|
+
reads is `--eldra-*`. Nothing in the package's CSS uses a name an app's own Tailwind build uses, so
|
|
34
|
+
the two never restyle each other's markup.
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
the spec's defaults, plus a
|
|
37
|
-
`@media (prefers-reduced-motion: reduce)` rule that zeroes every duration variable.
|
|
38
|
-
- **`@eldrajs/ui/tailwind.css`** — `tokens.css`, then a Tailwind v4 `@theme` block mapping its own
|
|
39
|
-
namespaces onto those variables (`--color-primary: var(--eldra-color-primary)`, `--radius-md`,
|
|
40
|
-
`--font-heading`, `--spacing-*`, `--shadow-*`, `--ease-*`) plus the package's custom utilities
|
|
41
|
-
(control heights, the `eldra-focus` ring, the type styles, motion and layer utilities) and a
|
|
42
|
-
`@source "../dist"` so a consumer's own Tailwind build scans the package's _compiled_ components.
|
|
43
|
-
For a project that already runs Tailwind v4, `main.css` (or equivalent) becomes:
|
|
36
|
+
Five CSS entries ship. Every one starts from the same `--eldra-*` variables, so none is a different
|
|
37
|
+
theme, only a different delivery shape.
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
@import '@eldrajs/ui/tailwind.css';
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
The type styles (`text-body`, `text-h2`, …) set longhands, never the `font` shorthand, and read
|
|
51
|
-
their weight as `var(--tw-font-weight, <token>)`, the declaration Tailwind writes for its own
|
|
52
|
-
`--text-*--font-weight`. So a `font-medium`/`font-semibold` beside one wins whatever order the two
|
|
53
|
-
compile in, and a `tabular-nums` beside one is no longer reset. A base-layer
|
|
54
|
-
`@apply font-*` sets `--tw-font-weight` as well, so it reaches a type style on the same element.
|
|
55
|
-
Line height and tracking are plain longhands on purpose: the starter's own base rule
|
|
56
|
-
(`h1`–`h4` `@apply leading-[1.1] tracking-tight`) would otherwise override every heading's type
|
|
57
|
-
style.
|
|
58
|
-
|
|
59
|
-
- **`@eldrajs/ui/style.css`** — the package's own compiled build of `tailwind.css` plus every
|
|
60
|
-
component's utilities, for a consumer with no Tailwind build of their own:
|
|
39
|
+
- **`@eldrajs/ui/style.css`** — the tokens, Tailwind's preflight and every component's styles, for
|
|
40
|
+
a page built from this package:
|
|
61
41
|
|
|
62
42
|
```css
|
|
63
43
|
@import '@eldrajs/ui/style.css';
|
|
64
44
|
```
|
|
65
45
|
|
|
66
|
-
This is also what a project whose own Tailwind build cannot share this package's utility prefix
|
|
67
|
-
(a `ui:`-prefixed theme, for example) reaches for.
|
|
68
|
-
|
|
69
46
|
- **`@eldrajs/ui/components.css`** — `style.css` without Tailwind's preflight, for a site that has
|
|
70
|
-
its own stylesheet
|
|
47
|
+
its own stylesheet (or its own Tailwind) and adds components to it:
|
|
71
48
|
|
|
72
49
|
```css
|
|
73
50
|
@import '@eldrajs/ui/components.css';
|
|
@@ -85,23 +62,91 @@ delivery shape.
|
|
|
85
62
|
`src/styles/__tests__/componentsCss.browser.spec.ts` renders every component family under both,
|
|
86
63
|
the overlays open, and requires identical pixels.
|
|
87
64
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
65
|
+
- **`@eldrajs/ui/tokens.css`** — the `--eldra-*` variables only (colours, radii, spacing, type,
|
|
66
|
+
motion, z-index, and the one opacity — `--eldra-revalidating-opacity`), declared on `:root` with
|
|
67
|
+
the spec's defaults, plus a `@media (prefers-reduced-motion: reduce)` rule that zeroes every
|
|
68
|
+
duration variable.
|
|
69
|
+
|
|
70
|
+
- **`@eldrajs/ui/tailwind.css`** — for an app that runs Tailwind v4 and wants its **own** markup
|
|
71
|
+
on the same design tokens: `tokens.css`, then a `@theme` block mapping Tailwind's namespaces
|
|
72
|
+
onto those variables (`--color-primary: var(--eldra-color-primary)`, `--radius-md`,
|
|
73
|
+
`--font-heading`, `--spacing-*`, `--shadow-*`, `--ease-*`) and the package's custom utilities
|
|
74
|
+
(control heights, the `eldra-focus` ring, the type styles, motion and layer utilities). It builds
|
|
75
|
+
none of the components; import the prebuilt ones beside it. `theme.css` (the `@theme` block) and
|
|
76
|
+
`utilities.css` (the utilities) ship on their own too.
|
|
77
|
+
|
|
78
|
+
```css
|
|
79
|
+
@import 'tailwindcss';
|
|
80
|
+
@import '@eldrajs/ui/tailwind.css';
|
|
81
|
+
@import '@eldrajs/ui/components.css';
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The type styles (`text-body`, `text-h2`, …) set longhands, never the `font` shorthand, and read
|
|
85
|
+
their weight as `var(--tw-font-weight, <token>)`, the declaration Tailwind writes for its own
|
|
86
|
+
`--text-*--font-weight`. So a `font-medium`/`font-semibold` beside one wins whatever order the two
|
|
87
|
+
compile in, and a `tabular-nums` beside one is no longer reset. A base-layer
|
|
88
|
+
`@apply font-*` sets `--tw-font-weight` as well, so it reaches a type style on the same element.
|
|
89
|
+
Line height and tracking are plain longhands on purpose: the starter's own base rule
|
|
90
|
+
(`h1`–`h4` `@apply leading-[1.1] tracking-tight`) would otherwise override every heading's type
|
|
91
|
+
style.
|
|
92
|
+
|
|
93
|
+
### Overriding a component's classes
|
|
94
|
+
|
|
95
|
+
The components' styles sit in `@layer components`, below Tailwind's `@layer utilities`, and both
|
|
96
|
+
`style.css` and `components.css` declare the standard order (`properties, theme, base, components,
|
|
97
|
+
utilities`), so it holds whichever stylesheet loads first. A class you put on a component, with
|
|
98
|
+
`class` (its outermost element) or a part of `classes` (an element inside it), is not prefixed and
|
|
99
|
+
is added to the component's own classes; it wins by layer, whatever its specificity. Nothing is
|
|
100
|
+
merged or removed at runtime: the components bind their classes the plain Vue way, one class per
|
|
101
|
+
concern on each element.
|
|
102
|
+
|
|
103
|
+
```vue
|
|
104
|
+
<Button class="px-8">Checkout</Button>
|
|
105
|
+
<!-- renders class="eldra:control-h eldra:px-4.5 … px-8": px-8 wins -->
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- It wins in every state: a plain `bg-red-600` on a `Button` replaces its hover and active fills
|
|
109
|
+
too, because a utilities-layer rule beats any components-layer one. Write the states you want
|
|
110
|
+
(`bg-red-600 hover:bg-red-700`).
|
|
111
|
+
- Your app's own Tailwind must generate the class (it is in your source, so it does). Without a
|
|
112
|
+
Tailwind of your own, any CSS of yours that is unlayered or in a layer declared after
|
|
113
|
+
`components` wins the same way.
|
|
114
|
+
|
|
115
|
+
### The `data-eldra-ui` marker
|
|
116
|
+
|
|
117
|
+
Every component's outermost element carries `data-eldra-ui`, and so does every element a component
|
|
118
|
+
renders outside it: a `Select` or `MultiSelect` panel, a `SearchBar` results panel, a `Popover`
|
|
119
|
+
panel, a `Tooltip` bubble and the `Toaster` region, each teleported out of its component.
|
|
120
|
+
`components.css`'s reset reaches exactly those elements and the `data-part` elements inside them,
|
|
121
|
+
`:where([data-eldra-ui], [data-eldra-ui] [data-part])`, at zero specificity. `data-part` alone is
|
|
122
|
+
not enough, because it is not this package's name: a site's own `<h2 data-part="title">`, or any
|
|
123
|
+
Ark UI or Zag component (which put `data-part` on every element they render), keeps the browser's
|
|
124
|
+
defaults. The attribute is public and stable, so a site can use it as a hook too
|
|
125
|
+
(`a:not([data-eldra-ui], [data-eldra-ui] *)` keeps a site's global link rule out of the
|
|
126
|
+
components). One case stays inside the scope: an element carrying its own `data-part` that the site
|
|
127
|
+
passes into a component's slot (an Ark UI widget inside a `Dialog`, say) is a `data-part` element
|
|
128
|
+
inside a marked root, so it gets the reset as well.
|
|
129
|
+
|
|
130
|
+
A site's **unlayered** element rules beat the package's layered ones regardless of specificity: a
|
|
131
|
+
global `a { color: … }` or `button { font: … }` restyles those elements inside the components too.
|
|
132
|
+
Scope such rules (`.prose a`) or put them in a layer.
|
|
133
|
+
|
|
134
|
+
### Theming a subtree
|
|
135
|
+
|
|
136
|
+
`provideEldraScope(name)`, called in the `setup()` of a wrapper or an app root, makes every
|
|
137
|
+
component below it render `data-eldra-scope="<name>"` on its root and on every part it teleports
|
|
138
|
+
(panels, bubbles, dialogs, toasts), so the `--eldra-*` variables can be set for those components
|
|
139
|
+
alone, teleported parts included:
|
|
140
|
+
|
|
141
|
+
```css
|
|
142
|
+
[data-eldra-scope='studio'] {
|
|
143
|
+
--eldra-color-primary: #0b5cad;
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Every element holding slot content you passed in also carries `data-eldra-slot` (a `Button`'s
|
|
148
|
+
label, a `Dialog`'s title, body and footer, a `Popover` panel…), whenever the slot has content and
|
|
149
|
+
never for a fallback, as a hook for your own CSS.
|
|
105
150
|
|
|
106
151
|
## Fonts
|
|
107
152
|
|
|
@@ -128,68 +173,69 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
128
173
|
token, a component-specific corner radius. Each one is documented on the component's own
|
|
129
174
|
Storybook docs page; the variables currently declared:
|
|
130
175
|
|
|
131
|
-
| Component | CSS variables
|
|
132
|
-
| ------------------- |
|
|
133
|
-
| `Accordion` | none — the top divider is a stock `border-t`, no per-component variable
|
|
134
|
-
| `AccordionItem` | `--eldra-accordion-title-line` (default `1.4`) — the label's line ratio, no token of its own
|
|
135
|
-
| `Avatar` | `--eldra-avatar-initials-size-{sm,md,lg,xl}` (defaults `0.76rem`/`0.95rem`/`1.33rem`/`2.28rem`, "38% of diameter" — no token of its own), `--eldra-avatar-initials-tracking` (default `0.02em`), `--eldra-avatar-icon-size-{sm,md,lg,xl}` (defaults `0.857rem`/`1.071rem`/`1.5rem`/`2.571rem`, the spec's own lg number scaled proportionally to the other three diameters)
|
|
136
|
-
| `AvatarGroup` | none — the overlap and stack order are plain Tailwind, no per-component variable
|
|
137
|
-
| `Badge` | `--eldra-badge-line-height` (default `1`) — the badge text's line ratio, no token of its own
|
|
138
|
-
| `Breadcrumb` | none — the collapse threshold reads `--container-tablet` (`Container`'s own 48rem gutter breakpoint), and the link/ellipsis boxes reuse `target-min`/`eldra-link-radius`/`radius-sm`, no per-component variable of its own
|
|
139
|
-
| `Button` | `--eldra-button-radius` (default `var(--eldra-radius-md)`), `--eldra-button-line-height` (default `1.2`), `--eldra-button-font-size-lg` (default `1.0625rem`, the one button size with no type token of its own)
|
|
140
|
-
| `ButtonGroup` | none — reads only the shared tokens from layer 1
|
|
141
|
-
| `Carousel` | `--eldra-carousel-per-view-base`/`-md`/`-lg` (bound as an inline style on the track by `carouselPerViewStyle`, resolved into `--eldra-carousel-per-view` per container-query breakpoint by the `eldra-carousel-track` utility, no default of its own — a slide with none set stays full width) and `--eldra-carousel-gap` (default `var(--eldra-space-4)`), both read by the `eldra-carousel-slide` utility's width formula; `--eldra-carousel-dot-size` (default `0.5rem`) and `--eldra-carousel-dot-ring` (default `1.5px`), read by `eldra-carousel-dot`; `--eldra-carousel-bleed` (default `0px`) — the inline gutter the track bleeds out to, as its own padding, the negative margin that cancels that padding and its scroll padding at once, each `max()`-ed with the focus ring's reach so a bleed never costs the ring the room the track reserves for it (set it per breakpoint through `classes.track`, never a `px-*`/`-mx-*`/`scroll-px-*` utility of your own — those replace the reservation on that axis instead of composing with it)
|
|
142
|
-
| `Checkbox` | `--eldra-checkbox-radius` (default `var(--eldra-radius-sm)`), `--eldra-checkbox-border-width` (default `1.5px`), `--eldra-checkbox-border-width-invalid` (default `2px`)
|
|
143
|
-
| `CheckboxGroup` | none — reads only the shared tokens from layer 1
|
|
144
|
-
| `Chip` | none — the selected/hover fills are `color-mix()` over shared `--eldra-color-*` tokens, no per-component variable
|
|
145
|
-
| `ChipGroup` | none — reads only the shared tokens from layer 1
|
|
146
|
-
| `Container` | none — the gutter widths (`--eldra-gutter-{mobile,tablet,desktop}`) are shared tokens, also read by `Section`; the three finite `width` values likewise read the shared `--eldra-container-{narrow,content,wide}` tokens directly, through `Container`'s own `eldra-container-{narrow,content,wide}` utilities rather than Tailwind's `max-w-narrow`/`-content`/`-wide` — see the Deviations entry below
|
|
147
|
-
| `ContentCard` | `--eldra-content-card-title-size` (default `1.25rem`) and `--eldra-content-card-title-line` (default `1.3`) — the title's own size and line ratio, no token of its own; `--eldra-content-card-excerpt-size` (default `0.9375rem`) and `--eldra-content-card-excerpt-line` (default `1.5`) — the excerpt's own size and line ratio, shared by `FeatureCard`'s `body` (`text-content-card-excerpt` in `tailwind.css`), since both read the same spec number
|
|
148
|
-
| `CurrencyInput` | `UnitInput`'s exactly (it renders a `UnitInput` with `isCurrency` always on) — see the `UnitInput` row
|
|
149
|
-
| `Dialog` | `--eldra-dialog-title-size` (default `1.25rem`), `--eldra-dialog-title-line` (default `1.3`) — the title's own size/line, no token of its own; `--eldra-dialog-width` (default `32rem`), `--eldra-dialog-width-sm` (default `24rem`) — the panel's own width, always capped at `100vw - 2rem` inside the utility itself; `--eldra-dialog-max-height` (default `calc(100vh - 4rem)`)
|
|
150
|
-
| `Drawer` | `--eldra-drawer-title-size` (default `1.25rem`), `--eldra-drawer-title-line` (default `1.3`) — the title's own size/line, no token of its own (the same numbers as `Dialog`'s, but its own variable pair); `--eldra-drawer-width` (default `28rem`) — the panel's own maximum width, capped at the viewport inside the utility itself, which also carries the full-screen-below-a-48rem-_viewport_ media query; `--eldra-drawer-header-height` (default `4rem`) — the header row's least height, with `--eldra-drawer-header-padding` (default `var(--eldra-space-4)`) — its top and bottom padding, `0px` to centre the row's content in exactly that height, such as a site header's; `--eldra-drawer-gutter` (default `1.5rem`) — the header's, body's and footer's side padding. The device's safe areas (`env(safe-area-inset-*)`) are added around both, so a full-screen drawer clears a notch and the home indicator on a page with `viewport-fit=cover`
|
|
151
|
-
| `EditorPlaceholder` | `--eldra-editor-placeholder-border-width` (default `1.5px`) — the dashed boundary's width, distinct from `EmptyState`'s own stock `border` (1px)
|
|
152
|
-
| `EmptyState` | `--eldra-empty-state-title-size` (default `1.25rem`) and `--eldra-empty-state-title-line` (default `1.3`) — the title's own size and line ratio, no token of its own
|
|
153
|
-
| `FeatureCard` | Shares `ContentCard`'s `--eldra-content-card-excerpt-size`/`-line` for its own `body` text (`text-content-card-excerpt`); its `title` reads `text-h4` directly, no variable of its own
|
|
154
|
-
| `FieldWrapper` | `--eldra-field-note-line-height` (default `1.45`) — the line the help and error text share
|
|
155
|
-
| `FilterPanel` | `--eldra-filter-subheading-tracking` (default `0.06em`, a size-system sub-heading's letter spacing — the overline token's own 0.12em pushes "SOCKS (EU)" onto two lines in a 15rem sidebar), `--eldra-filter-swatch-edge-width` (default `1px`) and `--eldra-filter-swatch-ring-width` (default `1.5px`) for a colour swatch's edge and the ring it gains when picked, and `--eldra-filter-histogram-bar-min` / `--eldra-filter-histogram-bar-radius` (defaults `2px` / `1px`) for one histogram bar's minimum height and its two top corners. Everything else is a shared token or comes from the components it composes (`Checkbox`, `Switch`, `Chip`, `Badge`, `Input`, `Button`, `CurrencyInput`, `RangeSlider`), each restyled through its own row
|
|
156
|
-
| `FormLayout` | `--eldra-form-summary-radius` (default `var(--eldra-radius-md)`) — the status summary box's corner radius
|
|
157
|
-
| `Icon` | none — reads only the shared tokens from layer 1
|
|
158
|
-
| `Image` | `--eldra-image-hatch-gap` (default `0.75rem`) — the live "No image" placeholder's diagonal-line repeat distance
|
|
159
|
-
| `Input` | `--eldra-input-radius` (default `var(--eldra-radius-md)`), `--eldra-control-font-size` (default `0.9375rem`), `--eldra-control-font-size-mobile` (default `1rem`), `--eldra-control-line-height` (default `1.5rem`), `--eldra-field-border-width` (default `1px`)
|
|
160
|
-
| `Lightbox` | none of its own — the entrance keyframe (`eldra-lightbox-in`) and every size are either shared tokens or literal component-specific classes (`px-16`, `size-11`/`max-md:size-11`), the same "no dedicated variable" shape as `AvatarGroup`/`ButtonGroup`
|
|
161
|
-
| `Link` | `--eldra-link-radius` (default `2px`) — the focus ring's corner radius on every variant
|
|
162
|
-
| `LoadMore` | none — the status/meter/button sizes all reuse shared tokens (`text-body-sm`, `control-h`, `text-button-md`), no per-component variable
|
|
163
|
-
| `LogoItem` | `--eldra-logo-image-max-height` (default `2.5rem`), `--eldra-logo-image-max-width` (default `9rem`) — the logo image's contain box; `--eldra-logo-wordmark-size` (default `1.25rem`) — the wordmark fallback's font size (its weight, line-height and letter-spacing reuse `h2`/`h3` tokens directly, see `text-logo-wordmark` in `tailwind.css`)
|
|
164
|
-
| `NavMenu` | `--eldra-nav-menu-offset` (default `var(--eldra-space-2)`) — the gap between the bar and a panel, drawn as the panel's own top padding so a hovering pointer never leaves the menu; `--eldra-nav-menu-dropdown-min`/`-max` (defaults `14rem`/`24rem`, capped at `100vw - 2rem`) — a dropdown panel's width; `--eldra-nav-menu-column-min` (default `12rem`) — the narrowest a mega panel's column gets before the grid wraps (`classes.columns: 'grid-cols-5'` fixes the count instead). `--eldra-nav-menu-drawer-row-height` (default `3.5rem`) — every top-level row in the drawer, link, accordion row or section heading; `--eldra-nav-menu-drawer-indent` (default `var(--eldra-space-4)`) — how far a panel's links sit in from their row. The drawer itself and the badges are `Drawer` and `Badge`, each restyled through its own row
|
|
165
|
-
| `MultiSelect` | everything `Select` reads, plus `--eldra-select-pill-line` (the "+N" pill's line box) and `--eldra-checkbox-radius`/`--eldra-checkbox-border-width`, shared with `Checkbox` so a consumer restyles both at once
|
|
166
|
-
| `Pagination` | none — every size (the 2.5rem page link/`control-h` previous-next, the `target-touch` compact arrows, the 0.9375rem `text-control` compact status) reuses a shared token or a shared arbitrary spacing multiple, no per-component variable
|
|
167
|
-
| `Popover` | `--eldra-z-popover` (default `30`), shared with the other popover panels
|
|
168
|
-
| `Price` | `--eldra-price-current-sm-size` (default `0.9375rem`), `--eldra-price-current-lg-size` (default `1.5rem`) — only `sm`/`lg` need one: `md`'s current price inherits the surrounding text, and `compareAt`/`from`/`unit` scale off whichever size the root sets (`0.9em`, a literal ratio the spec itself gives, and a fixed `0.8125rem`), so neither needs a variable of its own
|
|
169
|
-
| `ProductCard` | none of its own — it composes `Image`/`Badge`/`StockBadge`/`Price`/`Button`, each restyled through its own row above
|
|
170
|
-
| `QuantityStepper` | `--eldra-stepper-radius` (default `var(--eldra-radius-md)`)
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
177
|
-
| `
|
|
178
|
-
| `
|
|
179
|
-
| `
|
|
180
|
-
| `
|
|
181
|
-
| `
|
|
182
|
-
| `
|
|
183
|
-
| `
|
|
184
|
-
| `
|
|
185
|
-
| `
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
188
|
-
| `
|
|
189
|
-
| `
|
|
190
|
-
| `
|
|
191
|
-
| `
|
|
192
|
-
| `
|
|
176
|
+
| Component | CSS variables |
|
|
177
|
+
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
178
|
+
| `Accordion` | none — the top divider is a stock `border-t`, no per-component variable |
|
|
179
|
+
| `AccordionItem` | `--eldra-accordion-title-line` (default `1.4`) — the label's line ratio, no token of its own |
|
|
180
|
+
| `Avatar` | `--eldra-avatar-initials-size-{sm,md,lg,xl}` (defaults `0.76rem`/`0.95rem`/`1.33rem`/`2.28rem`, "38% of diameter" — no token of its own), `--eldra-avatar-initials-tracking` (default `0.02em`), `--eldra-avatar-icon-size-{sm,md,lg,xl}` (defaults `0.857rem`/`1.071rem`/`1.5rem`/`2.571rem`, the spec's own lg number scaled proportionally to the other three diameters) |
|
|
181
|
+
| `AvatarGroup` | none — the overlap and stack order are plain Tailwind, no per-component variable |
|
|
182
|
+
| `Badge` | `--eldra-badge-line-height` (default `1`) — the badge text's line ratio, no token of its own |
|
|
183
|
+
| `Breadcrumb` | none — the collapse threshold reads `--container-tablet` (`Container`'s own 48rem gutter breakpoint), and the link/ellipsis boxes reuse `target-min`/`eldra-link-radius`/`radius-sm`, no per-component variable of its own |
|
|
184
|
+
| `Button` | `--eldra-button-radius` (default `var(--eldra-radius-md)`), `--eldra-button-border-width` (default `1px`; the height stays the same, and an attached `ButtonGroup` overlaps by this width), `--eldra-button-line-height` (default `1.2`), `--eldra-button-font-size-lg` (default `1.0625rem`, the one button size with no type token of its own) |
|
|
185
|
+
| `ButtonGroup` | none — reads only the shared tokens from layer 1 |
|
|
186
|
+
| `Carousel` | `--eldra-carousel-per-view-base`/`-md`/`-lg` (bound as an inline style on the track by `carouselPerViewStyle`, resolved into `--eldra-carousel-per-view` per container-query breakpoint by the `eldra-carousel-track` utility, no default of its own — a slide with none set stays full width) and `--eldra-carousel-gap` (default `var(--eldra-space-4)`), both read by the `eldra-carousel-slide` utility's width formula; `--eldra-carousel-dot-size` (default `0.5rem`) and `--eldra-carousel-dot-ring` (default `1.5px`), read by `eldra-carousel-dot`; `--eldra-carousel-bleed` (default `0px`) — the inline gutter the track bleeds out to, as its own padding, the negative margin that cancels that padding and its scroll padding at once, each `max()`-ed with the focus ring's reach so a bleed never costs the ring the room the track reserves for it (set it per breakpoint through `classes.track`, never a `px-*`/`-mx-*`/`scroll-px-*` utility of your own — those replace the reservation on that axis instead of composing with it) |
|
|
187
|
+
| `Checkbox` | `--eldra-checkbox-radius` (default `var(--eldra-radius-sm)`), `--eldra-checkbox-border-width` (default `1.5px`), `--eldra-checkbox-border-width-invalid` (default `2px`) |
|
|
188
|
+
| `CheckboxGroup` | none — reads only the shared tokens from layer 1 |
|
|
189
|
+
| `Chip` | none — the selected/hover fills are `color-mix()` over shared `--eldra-color-*` tokens, no per-component variable |
|
|
190
|
+
| `ChipGroup` | none — reads only the shared tokens from layer 1 |
|
|
191
|
+
| `Container` | none — the gutter widths (`--eldra-gutter-{mobile,tablet,desktop}`) are shared tokens, also read by `Section`; the three finite `width` values likewise read the shared `--eldra-container-{narrow,content,wide}` tokens directly, through `Container`'s own `eldra-container-{narrow,content,wide}` utilities rather than Tailwind's `max-w-narrow`/`-content`/`-wide` — see the Deviations entry below |
|
|
192
|
+
| `ContentCard` | `--eldra-content-card-title-size` (default `1.25rem`) and `--eldra-content-card-title-line` (default `1.3`) — the title's own size and line ratio, no token of its own; `--eldra-content-card-excerpt-size` (default `0.9375rem`) and `--eldra-content-card-excerpt-line` (default `1.5`) — the excerpt's own size and line ratio, shared by `FeatureCard`'s `body` (`text-content-card-excerpt` in `tailwind.css`), since both read the same spec number |
|
|
193
|
+
| `CurrencyInput` | `UnitInput`'s exactly (it renders a `UnitInput` with `isCurrency` always on) — see the `UnitInput` row |
|
|
194
|
+
| `Dialog` | `--eldra-dialog-title-size` (default `1.25rem`), `--eldra-dialog-title-line` (default `1.3`) — the title's own size/line, no token of its own; `--eldra-dialog-width` (default `32rem`), `--eldra-dialog-width-sm` (default `24rem`) — the panel's own width, always capped at `100vw - 2rem` inside the utility itself; `--eldra-dialog-max-height` (default `calc(100vh - 4rem)`); `--eldra-dialog-background` (default `var(--color-background)`), `--eldra-dialog-border` (default `var(--color-border)`), `--eldra-dialog-text` (default `var(--color-text)`, also the close button's hover and press tint), `--eldra-dialog-muted` (default `var(--color-muted)`, the description) and `--eldra-dialog-backdrop` (default `var(--color-overlay)`) — the chrome's own colours, read by the dialog's parts only, so setting them on the `<dialog>` (`class`) recolours it without re-theming the slotted content the way redefining `--eldra-color-*` there would |
|
|
195
|
+
| `Drawer` | `--eldra-drawer-title-size` (default `1.25rem`), `--eldra-drawer-title-line` (default `1.3`) — the title's own size/line, no token of its own (the same numbers as `Dialog`'s, but its own variable pair); `--eldra-drawer-width` (default `28rem`) — the panel's own maximum width, capped at the viewport inside the utility itself, which also carries the full-screen-below-a-48rem-_viewport_ media query; `--eldra-drawer-header-height` (default `4rem`) — the header row's least height, with `--eldra-drawer-header-padding` (default `var(--eldra-space-4)`) — its top and bottom padding, `0px` to centre the row's content in exactly that height, such as a site header's; `--eldra-drawer-gutter` (default `1.5rem`) — the header's, body's and footer's side padding. The device's safe areas (`env(safe-area-inset-*)`) are added around both, so a full-screen drawer clears a notch and the home indicator on a page with `viewport-fit=cover` |
|
|
196
|
+
| `EditorPlaceholder` | `--eldra-editor-placeholder-border-width` (default `1.5px`) — the dashed boundary's width, distinct from `EmptyState`'s own stock `border` (1px) |
|
|
197
|
+
| `EmptyState` | `--eldra-empty-state-title-size` (default `1.25rem`) and `--eldra-empty-state-title-line` (default `1.3`) — the title's own size and line ratio, no token of its own |
|
|
198
|
+
| `FeatureCard` | Shares `ContentCard`'s `--eldra-content-card-excerpt-size`/`-line` for its own `body` text (`text-content-card-excerpt`); its `title` reads `text-h4` directly, no variable of its own |
|
|
199
|
+
| `FieldWrapper` | `--eldra-field-note-line-height` (default `1.45`) — the line the help and error text share |
|
|
200
|
+
| `FilterPanel` | `--eldra-filter-subheading-tracking` (default `0.06em`, a size-system sub-heading's letter spacing — the overline token's own 0.12em pushes "SOCKS (EU)" onto two lines in a 15rem sidebar), `--eldra-filter-swatch-edge-width` (default `1px`) and `--eldra-filter-swatch-ring-width` (default `1.5px`) for a colour swatch's edge and the ring it gains when picked, and `--eldra-filter-histogram-bar-min` / `--eldra-filter-histogram-bar-radius` (defaults `2px` / `1px`) for one histogram bar's minimum height and its two top corners. Everything else is a shared token or comes from the components it composes (`Checkbox`, `Switch`, `Chip`, `Badge`, `Input`, `Button`, `CurrencyInput`, `RangeSlider`), each restyled through its own row |
|
|
201
|
+
| `FormLayout` | `--eldra-form-summary-radius` (default `var(--eldra-radius-md)`) — the status summary box's corner radius |
|
|
202
|
+
| `Icon` | none — reads only the shared tokens from layer 1 |
|
|
203
|
+
| `Image` | `--eldra-image-hatch-gap` (default `0.75rem`) — the live "No image" placeholder's diagonal-line repeat distance |
|
|
204
|
+
| `Input` | `--eldra-input-radius` (default `var(--eldra-radius-md)`), `--eldra-control-font-size` (default `0.9375rem`), `--eldra-control-font-size-mobile` (default `1rem`), `--eldra-control-line-height` (default `1.5rem`), `--eldra-field-border-width` (default `1px`) |
|
|
205
|
+
| `Lightbox` | none of its own — the entrance keyframe (`eldra-lightbox-in`) and every size are either shared tokens or literal component-specific classes (`px-16`, `size-11`/`max-md:size-11`), the same "no dedicated variable" shape as `AvatarGroup`/`ButtonGroup` |
|
|
206
|
+
| `Link` | `--eldra-link-radius` (default `2px`) — the focus ring's corner radius on every variant |
|
|
207
|
+
| `LoadMore` | none — the status/meter/button sizes all reuse shared tokens (`text-body-sm`, `control-h`, `text-button-md`), no per-component variable |
|
|
208
|
+
| `LogoItem` | `--eldra-logo-image-max-height` (default `2.5rem`), `--eldra-logo-image-max-width` (default `9rem`) — the logo image's contain box; `--eldra-logo-wordmark-size` (default `1.25rem`) — the wordmark fallback's font size (its weight, line-height and letter-spacing reuse `h2`/`h3` tokens directly, see `text-logo-wordmark` in `tailwind.css`) |
|
|
209
|
+
| `NavMenu` | `--eldra-nav-menu-offset` (default `var(--eldra-space-2)`) — the gap between the bar and a panel, drawn as the panel's own top padding so a hovering pointer never leaves the menu; `--eldra-nav-menu-dropdown-min`/`-max` (defaults `14rem`/`24rem`, capped at `100vw - 2rem`) — a dropdown panel's width; `--eldra-nav-menu-column-min` (default `12rem`) — the narrowest a mega panel's column gets before the grid wraps (`classes.columns: 'grid-cols-5'` fixes the count instead). `--eldra-nav-menu-drawer-row-height` (default `3.5rem`) — every top-level row in the drawer, link, accordion row or section heading; `--eldra-nav-menu-drawer-indent` (default `var(--eldra-space-4)`) — how far a panel's links sit in from their row. The drawer itself and the badges are `Drawer` and `Badge`, each restyled through its own row |
|
|
210
|
+
| `MultiSelect` | everything `Select` reads, plus `--eldra-select-pill-line` (the "+N" pill's line box) and `--eldra-checkbox-radius`/`--eldra-checkbox-border-width`, shared with `Checkbox` so a consumer restyles both at once; the tags' own colours `--eldra-select-tag-background` (default `var(--color-surface-strong)`), `--eldra-select-tag-text` (default `var(--color-text)`, also the remove button's hover colour and tint) and `--eldra-select-tag-muted` (default `var(--color-muted)`, the remove button at rest) — read by the tag and remove-button parts only, so `Chip` and a `tag` slot's content keep the theme |
|
|
211
|
+
| `Pagination` | none — every size (the 2.5rem page link/`control-h` previous-next, the `target-touch` compact arrows, the 0.9375rem `text-control` compact status) reuses a shared token or a shared arbitrary spacing multiple, no per-component variable |
|
|
212
|
+
| `Popover` | `--eldra-z-popover` (default `30`), shared with the other popover panels; `--eldra-popover-background` (default `var(--color-background)`), `--eldra-popover-border` (default `var(--color-border)`) and `--eldra-popover-text` (no default: unset, the panel inherits its colour as before) — the panel chrome's own colours, read by the `panel` part only, so setting them recolours it without re-theming the slotted content the way redefining `--eldra-color-*` there would. No size variable: it has no fixed size to clamp, unlike `Select`'s panel |
|
|
213
|
+
| `Price` | `--eldra-price-current-sm-size` (default `0.9375rem`), `--eldra-price-current-lg-size` (default `1.5rem`) — only `sm`/`lg` need one: `md`'s current price inherits the surrounding text, and `compareAt`/`from`/`unit` scale off whichever size the root sets (`0.9em`, a literal ratio the spec itself gives, and a fixed `0.8125rem`), so neither needs a variable of its own |
|
|
214
|
+
| `ProductCard` | none of its own — it composes `Image`/`Badge`/`StockBadge`/`Price`/`Button`, each restyled through its own row above |
|
|
215
|
+
| `QuantityStepper` | `--eldra-stepper-radius` (default `var(--eldra-radius-md)`) |
|
|
216
|
+
| `Radio` | the radio circle reads `--eldra-checkbox-border-width`/`-invalid`, shared with `Checkbox` and `RadioGroup` |
|
|
217
|
+
| `RadioGroup` | `--eldra-radio-card-border-width` (default `1px`) and `--eldra-radio-card-radius` (default `radius-md`) for the card boundary; `--eldra-checkbox-border-width`/`-invalid` for the radio circle itself, shared with `Checkbox` |
|
|
218
|
+
| `RangeSlider` | `--eldra-range-thumb-size` (default `1.25rem`), `--eldra-range-thumb-border-width` (default `1.5px`), `--eldra-range-thumb-halo` (default `0.25rem`, the hover/dragging ring drawn outside the thumb) and `--eldra-range-track-height` (default `0.375rem`), read by the `eldra-range-thumb`/`-track`/`-gutter` utilities — the gutter that keeps a thumb, its focus ring **and** its pointer target inside the control is the larger of the ring's reach and half the target, `calc()`-ed from those variables (and switched on the same 48rem container edge the target is), so enlarging any of them moves the reservation with it |
|
|
219
|
+
| `Rating` | none — the half-star overlay (`eldra-rating-half`) is a fixed `clip-path`, no per-component variable |
|
|
220
|
+
| `SearchBar` | `--eldra-search-panel-max-height` (default `32rem`, clamped to `70vh`), `--eldra-search-text-line`, `--eldra-search-empty-line`, `--eldra-search-kbd-line`, `--eldra-input-radius`, `--eldra-field-border-width`, `--eldra-z-popover`, and `--eldra-popover-origin` (set by the panel itself from the placement it resolved to: `top left` below the field, `bottom left` above it); and `Select`'s `--eldra-select-panel-background`/`-border`/`-text`/`-muted`/`-active` (same defaults) for the results panel's surface, edge and hairlines, rows and chips, headings, minor rows, icons and no-results advice, and the active row and chip fill |
|
|
221
|
+
| `SearchModal` | `--eldra-search-modal-width` (default `40rem`), `--eldra-search-modal-max-height` (default `40rem`) — both clamped to the viewport inside their own utility, which also carries the full-screen-below-a-48rem-_viewport_ media query; `--eldra-search-modal-field-size` (default `1.0625rem`), `--eldra-search-modal-foot-size`/`-line` (defaults `0.75rem`/`1.4`), `--eldra-search-modal-kbd-size` (default `0.6875rem`) — none with a token of their own; plus everything `SearchBar`'s reused `SearchResultsPanel` reads (`--eldra-search-text-line`, `--eldra-search-empty-line`, `--eldra-control-line-height`) |
|
|
222
|
+
| `Section` | none — the vertical rhythm (`--eldra-section-{sm,md,lg}`) and the gutters it shares with `Container` are shared tokens |
|
|
223
|
+
| `Select` | `--eldra-select-panel-max-height` (default `20rem`), `--eldra-select-panel-max-width` (default `22rem`, clamped to `90vw`), `--eldra-z-popover` (default `30`), `--eldra-field-radius`, `--eldra-field-border-width`, `--eldra-select-group-tracking`, `--eldra-select-option-line`, `--eldra-select-swatch-edge`, the `--eldra-select-match-*` trio, and `--eldra-popover-origin` (`top left` / `bottom left`, set by the panel from the placement it resolved to); and the panel chrome's own colours, the `--eldra-select-panel-*` family `MultiSelect` and `SearchBar` read too: `--eldra-select-panel-background` (default `var(--color-background)`; the panel, `MultiSelect`'s footer and an unchosen option box), `--eldra-select-panel-border` (default `var(--color-border)`; the panel's edge, the search field's divider, group and create-row hairlines, the footer's top line), `--eldra-select-panel-text` (default `var(--color-text)` on the search field, the option and create rows; unset, the panel itself inherits its colour as before), `--eldra-select-panel-muted` (default `var(--color-muted)`; the search icon and placeholder, group headings, disabled rows, hints, untoned meta, the empty and loading rows, the footer count), `--eldra-select-panel-active` (default `var(--color-surface-strong)`; the active row's fill), `--eldra-select-panel-check` (the selected mark: default `var(--color-text)` for `Select`'s check, `var(--color-primary)` for `MultiSelect`'s filled box), `--eldra-select-panel-check-contrast` (default `var(--color-primary-contrast)`, `MultiSelect`'s tick) and `--eldra-select-panel-check-border` (default `var(--color-border-strong)`, an unchosen box's edge) — read by the panel's parts only, so setting them on `:root` or the teleport target recolours the panel without re-theming slotted option content the way redefining `--eldra-color-*` there would |
|
|
224
|
+
| `SiteForm` | none of its own: it composes `FormLayout`, `FieldWrapper`, `Input`, `Textarea`, `Select`, `Checkbox` and `Button`, each restyled through its own row; its `classes` reach their parts (see [Site forms](#site-forms)) |
|
|
225
|
+
| `Skeleton` | none — `width` sets an inline style directly (see the Deviations entry), no CSS variable involved |
|
|
226
|
+
| `StockBadge` | `--eldra-stock-status-line` (default `1.4`) — the status line text's line ratio, no token of its own |
|
|
227
|
+
| `Switch` | `--eldra-switch-radius` (default `var(--eldra-radius-full)`), `--eldra-switch-track-border-width` (default `1.5px`), `--eldra-switch-thumb-offset` (default `0.1875rem`, the thumb's rest inset from the track's start edge) |
|
|
228
|
+
| `Tab` | none — reads only the shared tokens from layer 1, plus `VariantPicker`'s `text-variant-pill` type style (no per-component variable of its own; see that component's row) |
|
|
229
|
+
| `TabPanel` | none — reads only the shared tokens from layer 1 |
|
|
230
|
+
| `TablerIcon` | none — reads only the shared tokens from layer 1, the same as `Icon` |
|
|
231
|
+
| `Tabs` | none — reads only the shared tokens from layer 1; the `eldra-scrollbar-hide` utility the tab list uses has no variable of its own. The pills list's own padding, the negative margin that cancels it and its scroll padding are all `calc(var(--eldra-focus-offset) + var(--eldra-focus-width))` — the focus ring's own reach, so raising either ring token widens the room the scrolling list keeps for a focused pill's ring instead of letting it clip (the underline variant reserves nothing: its tabs ring _inside_ their own box, per the design spec, and padding that list vertically would push its hairline off the tabs). Set a gutter through `classes.list` only if it is wider than that reach — a `px-*`/`-mx-*`/`scroll-px-*` utility of your own replaces the reservation on that axis rather than composing with it, the way `--eldra-carousel-bleed` does for the carousel |
|
|
232
|
+
| `Textarea` | `--eldra-textarea-radius` (default `var(--eldra-radius-md)`), `--eldra-textarea-min-height` (set from the `minHeight` prop, default `5rem`), `--eldra-counter-line-height` (default `1.5`) |
|
|
233
|
+
| `Toast` | `--eldra-toast-title-size` (default `0.9375rem`), `--eldra-toast-title-line` (default `1.4`) — the title's own size/line, sitting between two type-scale steps with no token of its own |
|
|
234
|
+
| `Toaster` | `--eldra-toast-width` (default `24rem`) — the fixed region's own width, always capped at `100vw - 2rem` inside the utility itself, the same shape as `Dialog`'s own width variables |
|
|
235
|
+
| `Tooltip` | `--eldra-tooltip-arrow-size` (default `0.3125rem`) — the arrow's side length, no token of its own; `--eldra-z-popover` (default `30`), shared with the popover panels |
|
|
236
|
+
| `UnitInput` | `Input`'s exactly, because it draws `Input`'s box: `--eldra-input-radius`, `--eldra-control-font-size`, `--eldra-control-font-size-mobile`, `--eldra-control-line-height`, `--eldra-field-border-width` (`CurrencyInput` is a `UnitInput`, so the same) |
|
|
237
|
+
| `VariantPicker` | `--eldra-variant-legend-line` (default `1.4`), `--eldra-variant-pill-border-width` (default `1px`), `--eldra-variant-pill-selected-color` (default `var(--eldra-color-text)`), `--eldra-variant-pill-radius` (default `var(--eldra-radius-md)`), `--eldra-variant-swatch-ring-width` (default `2px`), `--eldra-variant-swatch-edge-width` (default `1px`) |
|
|
238
|
+
| `VisuallyHidden` | none — reads only the shared tokens from layer 1 (it renders no visible box at all) |
|
|
193
239
|
|
|
194
240
|
Every component this package ships has a row above; `src/__tests__/readmeCoverage.spec.ts`
|
|
195
241
|
fails the build if `src/componentNames.ts` gains a name this table has not. "None" means the
|
|
@@ -207,13 +253,11 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
207
253
|
3. **A `classes` prop**, typed `Partial<Record<Part, string>>` where `Part` is the union of that
|
|
208
254
|
component's `data-part` names from the design spec's anatomy (`container`, `label`,
|
|
209
255
|
`leadingIcon`, `trailingIcon`, `spinner` for `Button`; see each component's exported
|
|
210
|
-
`<Name>Part` type and its Storybook docs page for the exact list).
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
`eldra-button-radius
|
|
214
|
-
|
|
215
|
-
same way, and a weight is never a conflict with a type style: `classes.label: 'font-bold'` keeps
|
|
216
|
-
`text-body-sm` and changes only the weight.
|
|
256
|
+
`<Name>Part` type and its Storybook docs page for the exact list). The outermost element has no
|
|
257
|
+
key: style it with `class`. A part's value is added to that part's own classes and wins by layer
|
|
258
|
+
(see "Overriding a component's classes"), so `class="rounded-full"` on a `Button` beats
|
|
259
|
+
`eldra-button-radius`, and `classes.label: 'font-bold'` keeps `text-body-sm` and changes only
|
|
260
|
+
the weight.
|
|
217
261
|
4. **A slot for every part that holds content** (`label`, `description`, `error`, `leading`,
|
|
218
262
|
`trailing`, `empty`, `header`, `footer`, `item`, …), named after the part it replaces.
|
|
219
263
|
5. **`as`**, on the components whose spec allows a different rendered _root_ element (`Button`,
|
|
@@ -255,6 +299,7 @@ inside one needs no wiring at all:
|
|
|
255
299
|
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
256
300
|
| `id` | Takes it as its own `id`, so the wrapper's `<label for>` names it |
|
|
257
301
|
| `labelId` | The label element's own id, for a control a `<label for>` cannot name (`Select`'s `<button>` trigger uses it as `aria-labelledby`) |
|
|
302
|
+
| `labelled` | `false` when the wrapper draws no label (no `label` prop or slot), so nothing points at `labelId`; the control is named by its own `aria-label` |
|
|
258
303
|
| `describedBy` | The wrapper's error, help and counter ids, in that order |
|
|
259
304
|
| `invalid` | Mirrors it as `aria-invalid="true"` |
|
|
260
305
|
| `required` | Mirrors it as native `required` |
|
|
@@ -315,6 +360,46 @@ import { isIS } from '@eldrajs/ui/messages/is-IS';
|
|
|
315
360
|
app.provide(MESSAGES_KEY, isIS);
|
|
316
361
|
```
|
|
317
362
|
|
|
363
|
+
### With vue-i18n
|
|
364
|
+
|
|
365
|
+
The optional `@eldrajs/ui/vue-i18n` entry reads every message through the app's vue-i18n, so the
|
|
366
|
+
kit is translated where the rest of the app is, and follows a locale switch. `vue-i18n ^11` is an
|
|
367
|
+
optional peer; nothing else in the package imports it.
|
|
368
|
+
|
|
369
|
+
```ts
|
|
370
|
+
import { createI18n } from 'vue-i18n';
|
|
371
|
+
import { enUS } from '@eldrajs/ui';
|
|
372
|
+
import { isIS } from '@eldrajs/ui/messages/is-IS';
|
|
373
|
+
import { icelandicPluralRule, toVueI18nMessages, useEldraUiI18n } from '@eldrajs/ui/vue-i18n';
|
|
374
|
+
|
|
375
|
+
const i18n = createI18n({
|
|
376
|
+
legacy: false,
|
|
377
|
+
locale: 'is-IS',
|
|
378
|
+
fallbackLocale: 'en-US',
|
|
379
|
+
pluralRules: { 'is-IS': icelandicPluralRule }, // 21 is singular in Icelandic
|
|
380
|
+
messages: {
|
|
381
|
+
'en-US': { eldraUi: toVueI18nMessages(enUS) },
|
|
382
|
+
'is-IS': { eldraUi: toVueI18nMessages(isIS) },
|
|
383
|
+
},
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
// in the root component's setup(); or app.provide(MESSAGES_KEY, eldraUiI18nMessages(i18n.global))
|
|
387
|
+
useEldraUiI18n();
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
- **Keys** live under `eldraUi` (option `prefix`): `eldraUi.close`, `eldraUi.createOption`, …
|
|
391
|
+
`toVueI18nMessages` turns any complete message set into them, so start a new language from
|
|
392
|
+
`toVueI18nMessages(enUS)` and translate the values.
|
|
393
|
+
- **Values** are vue-i18n messages: `createOption` is `Create “{query}”`, `resultsCount` is
|
|
394
|
+
`{n} result | {n} results` (plural forms, picked by the count).
|
|
395
|
+
- **Branches** that are not a count get a suffixed key of their own: `pageN` / `pageN_current`,
|
|
396
|
+
`resultsCount` / `resultsCount_query`, `viewAllResults_query`, `stockLow_unknown`,
|
|
397
|
+
`stockPreorder_date`, and `avatarGroup_more` (the "N more" entry the names list ends with).
|
|
398
|
+
- **A key you leave out** falls back to the English default (option `fallback`), so a partial
|
|
399
|
+
translation is fine. The vue-i18n locale's own fallback chain is honoured first.
|
|
400
|
+
- It needs vue-i18n's message compiler (the default build): the messages are strings merged at
|
|
401
|
+
runtime.
|
|
402
|
+
|
|
318
403
|
## Site forms
|
|
319
404
|
|
|
320
405
|
`SiteForm` draws any form a merchant builds in Studio (Settings › Forms) from its public definition,
|
|
@@ -511,10 +596,12 @@ a consumer whose control needs the same six things rather than reassembling them
|
|
|
511
596
|
told not to;
|
|
512
597
|
- **the label-forwarded-click latch** — a `<label for>` naming the trigger forwards its click to
|
|
513
598
|
it, and the spec is explicit that clicking a field's label focuses the control **without**
|
|
514
|
-
opening it. A forwarded click
|
|
515
|
-
|
|
516
|
-
`
|
|
517
|
-
|
|
599
|
+
opening it. A forwarded click differs from a real one in that no pointer was pressed and its
|
|
600
|
+
`detail` is 0, so `onTriggerPointerDown`/`onTriggerClick` (bound to the trigger) arm a latch on
|
|
601
|
+
`pointerdown` and release it on whichever `pointerup`/`pointercancel` follows, wherever it lands.
|
|
602
|
+
A programmatic `element.click()` has the same shape and still toggles: a click counts as
|
|
603
|
+
forwarded when a `<label>` whose control is the trigger was clicked in the same task, or when it
|
|
604
|
+
is trusted, or when it is not a `PointerEvent` (what `click()` dispatches).
|
|
518
605
|
|
|
519
606
|
What stays with each control is what actually differs: which rows there are, what choosing one
|
|
520
607
|
does, and which element the popup is anchored to. See `src/components/select/usePopover.ts` for
|
|
@@ -540,7 +627,8 @@ const { close, isTop } = useDialog({
|
|
|
540
627
|
dialog,
|
|
541
628
|
dismissable: () => !formIsDirty.value, // default true; read on every backdrop click
|
|
542
629
|
initialFocus: someRef, // else the first control that is not `[data-part="close"]`
|
|
543
|
-
onCancel: () => emit('cancel'), // Esc
|
|
630
|
+
onCancel: () => emit('cancel'), // Esc closes — this is a notification, not a guard
|
|
631
|
+
closeOnEscape: true, // default true; false ignores Esc (no onCancel, no close)
|
|
544
632
|
});
|
|
545
633
|
```
|
|
546
634
|
|
|
@@ -577,9 +665,11 @@ spec's own non-negotiable 2):
|
|
|
577
665
|
underneath, so closing the top one lands focus back there instead of on the page;
|
|
578
666
|
- **`Esc`** (the native `cancel` event) — closes the dialog, never gated by `dismissable`, but only
|
|
579
667
|
while it is the top of the stack; `onCancel` is a plain callback with nothing to call
|
|
580
|
-
`preventDefault()` on, so it cannot keep the dialog open
|
|
581
|
-
-
|
|
582
|
-
|
|
668
|
+
`preventDefault()` on, so it cannot keep the dialog open. `closeOnEscape: false` is the one
|
|
669
|
+
opt-out: `Esc` is then ignored (no `onCancel`, no close);
|
|
670
|
+
- **backdrop click** — a `click` whose `target` is the `<dialog>` element itself (not a descendant,
|
|
671
|
+
and not a press that began inside the panel and was released on the backdrop), closing it when
|
|
672
|
+
`dismissable` reads `true` **and** it is the top of the stack.
|
|
583
673
|
|
|
584
674
|
`close(returnValue?)` is exposed so a consumer can close with an action value of their own — a
|
|
585
675
|
`Dialog`'s exposed `close` (`<Dialog ref="dialogRef">` then `dialogRef.value.close('remove')`) is
|
|
@@ -625,6 +715,15 @@ renders: `TOAST_HOST_KEY` (see `useDialog` above) if a modal `Dialog` is open, `
|
|
|
625
715
|
the same hand-off `Dialog`, `Drawer`, `Lightbox` and `SearchModal` already share, so a toast raised
|
|
626
716
|
during a modal flow is never inert behind it.
|
|
627
717
|
|
|
718
|
+
An app with a toast queue of its own renders it through the same `Toaster`: pass it as `toasts`
|
|
719
|
+
(`ToasterToast[]`: `id`, `title`, optional `variant`, `text`, `action`, `closable`, `duration`) and
|
|
720
|
+
the `useToast` store is left alone. Closing a toast, or its `duration` running out, only emits
|
|
721
|
+
`dismiss(id, reason)`; the owner removes it. With no `duration` the owner keeps the time.
|
|
722
|
+
`position` (`top-left` … `bottom-right`, default `bottom-right`), `maxVisible` (the newest kept),
|
|
723
|
+
`newestOnTop` (default `false`) and `teleportTo` (default `body`; an open `Dialog` still wins)
|
|
724
|
+
apply either way. Every toast's root carries `data-variant="success|warning|danger|info"`, so a
|
|
725
|
+
consumer maps per-variant colours with an attribute selector (`[data-eldra-ui][data-variant='info']`).
|
|
726
|
+
|
|
628
727
|
`useCarousel` is the scroll-snap carousel's whole behaviour with no rendering of its own — index
|
|
629
728
|
tracking, previous/next/`goTo`, edge detection for the arrows, and autoplay with the spec's pause
|
|
630
729
|
rules — so `Carousel` renders the markup around it and `Lightbox` (its own track reuses this file
|
|
@@ -1159,6 +1258,22 @@ during development, outside this repository's own history.
|
|
|
1159
1258
|
Things this package ships that design spec 1 does not name at all. Each is listed here so a reader
|
|
1160
1259
|
comparing the package against the spec can tell an addition from a drift.
|
|
1161
1260
|
|
|
1261
|
+
- **Wrapper hooks** (operator decision, 2026-11-08): options that let the private component library
|
|
1262
|
+
render these components as designed instead of keeping copies of them. Each is opt-in, and output
|
|
1263
|
+
is unchanged without it; see the changelog for the details. `Input`/`Textarea`: exposed `control`
|
|
1264
|
+
and `focus()`, a caller's `aria-invalid` kept while valid, `inputmode: false`; an interactive
|
|
1265
|
+
`prefix` slot on `Input`; `clearable` (with `clear`) and `prefix`/`suffix` slots on `Textarea`;
|
|
1266
|
+
measured prefix/suffix room on both. `Dialog`: `--eldra-dialog-*` chrome colours, `title`
|
|
1267
|
+
slot, optional `title`, `closeButton`, `closeOnEscape`. `FieldWrapper`:
|
|
1268
|
+
optional `label`, `labelSuffix` slot, `counter` without `max`. `RadioGroup`: `invalid`, per-option
|
|
1269
|
+
`optionAttrs`/`inputAttrs`, `input`/`dot` parts, optional `legend`, `requiredMark`; and a standalone
|
|
1270
|
+
`Radio`. `Toast`: `info`, `closable`, `data-variant` on the root. `Pagination`: `fixedLength`, `disabled`,
|
|
1271
|
+
`responsive`, `showSinglePage`, `messages`. `Popover`: offset, reference, close and focus
|
|
1272
|
+
switches, `exclusive`, left/right placements. `Select`/`MultiSelect`: `keywords`, `loading`,
|
|
1273
|
+
`creatable`, `renderBatch`, `optionContent`/`leading`/`loading`/`tagItem` slots; `MultiSelect`
|
|
1274
|
+
`tagPlacement: 'inside'` with `maxTagRows`, and `maxSummary: 'fit'`. `Tab`: `disabled`.
|
|
1275
|
+
`Switch`: `thumb`/`trackStart`/`trackEnd` slots, `invalid`. `Checkbox`: box alone without a
|
|
1276
|
+
label. `Button`: pressed fill on `ghost`, a static string `as` tag, `keepNameWhileLoading`.
|
|
1162
1277
|
- **`SiteForm` and `useSiteForm`**: a form from the platform's Forms API, drawn from its public
|
|
1163
1278
|
definition with this package's own controls, checked by the platform's rules and submitted
|
|
1164
1279
|
through `@eldrajs/sdk`. The spec has form controls and a form layout but no platform form; see
|
|
@@ -1181,7 +1296,7 @@ aria-pressed>` that fills `primary`/`primary-contrast` when `selected`, the same
|
|
|
1181
1296
|
`remove`; `Enter`/`Space` toggle a selectable chip through the native `<button>`'s own behaviour,
|
|
1182
1297
|
with no separate keydown handler that could double-toggle. `icon` draws directly (Badge's own
|
|
1183
1298
|
reasoning: neither chip size's icon dimension or stroke is one of `Icon.vue`'s four); `avatar`
|
|
1184
|
-
draws through `Avatar` at the chip's own icon size via `
|
|
1299
|
+
draws through `Avatar` at the chip's own icon size via `class` — no built-in `Avatar` size
|
|
1185
1300
|
is small enough to sit inside either chip size, so it is drawn undersized rather than left at
|
|
1186
1301
|
`Avatar`'s own smallest, `sm`.
|
|
1187
1302
|
|
|
@@ -1346,7 +1461,9 @@ aria-pressed>` that fills `primary`/`primary-contrast` when `selected`, the same
|
|
|
1346
1461
|
|
|
1347
1462
|
Its `trigger` is not drawn by the component at all: a scoped slot (`{ open, toggle, attrs }`,
|
|
1348
1463
|
mirroring the private library's own Studio-documented `#trigger="{ triggerAttrs }"` shape) hands
|
|
1349
|
-
the consumer everything to spread (`v-bind="attrs"`) onto whatever element they render
|
|
1464
|
+
the consumer everything to spread (`v-bind="attrs"`) onto whatever element they render (the
|
|
1465
|
+
first element found, looking through fragments, so a wrapper can forward its own `<slot>` into
|
|
1466
|
+
it) — `id`,
|
|
1350
1467
|
`type: 'button'`, `aria-haspopup`, `aria-expanded`, `aria-controls`, a `class` built from
|
|
1351
1468
|
`classes.trigger`, and the click/pointerdown pair — because a generic popover cannot know whether
|
|
1352
1469
|
its trigger should be a `<button>`, an `<a>`, or a table row the way `Select`'s always-a-button
|
|
@@ -1377,7 +1494,7 @@ aria-pressed>` that fills `primary`/`primary-contrast` when `selected`, the same
|
|
|
1377
1494
|
order, and a modified key or a key typed into a field is left alone. `Enter`/`Space` stay the
|
|
1378
1495
|
button's own. Panels are never teleported:
|
|
1379
1496
|
a `dropdown` hangs under its own item, a `mega` panel spans the menu's root, and a site whose
|
|
1380
|
-
header should be the panel's width makes the root `static` (`
|
|
1497
|
+
header should be the panel's width makes the root `static` (`class`) and its header
|
|
1381
1498
|
`relative` (or `contents`, which makes the bar and the menu button cells of the header's own
|
|
1382
1499
|
grid). A closing panel fades out over `--eldra-duration-fast`, unclickable while it does.
|
|
1383
1500
|
`openOnHover` adds a resting mouse pointer to the ways of opening: a panel opens after the
|
|
@@ -1615,6 +1732,29 @@ children?, layout?, groups? }`, one level of children. Children sharing a `group
|
|
|
1615
1732
|
|
|
1616
1733
|
Additions and departures from the design spec, and why.
|
|
1617
1734
|
|
|
1735
|
+
- **Colour changes fade over `duration-base` with `ease-in-out`, not `duration-fast` `ease-out`**
|
|
1736
|
+
(operator decision, 2026-11-10). At 150ms on an ease-out curve a hover colour is 85% of the way
|
|
1737
|
+
there after 67ms and reads as a switch. `eldra-focus` and `eldra-focus-inset` now give colour,
|
|
1738
|
+
background, border and underline changes 200ms eased at both ends (`--eldra-ease-in-out`); the
|
|
1739
|
+
press scale and translate stay `duration-fast` `ease-out`, so a press still feels immediate.
|
|
1740
|
+
Elements with no focus utility that change colour on hover (card title links, a facet row, a
|
|
1741
|
+
radio card) carry `eldra-transition-colors`, the same timing. `Switch` keeps `duration-fast`, so
|
|
1742
|
+
its track fills in step with the thumb.
|
|
1743
|
+
- **A `Button` fits its content (`w-fit`)**, also as a flex-column or grid item, where it used to
|
|
1744
|
+
stretch to the full width. `block` is the full-width form; a `w-full` (or any width) in `class`
|
|
1745
|
+
wins over `w-fit` by layer.
|
|
1746
|
+
|
|
1747
|
+
- **A `Select`/`MultiSelect` panel's search field draws no focus ring** (operator decision,
|
|
1748
|
+
2026-11-09). The spec asks for the inset ring, but the field holds focus for as long as the panel
|
|
1749
|
+
is open, so the ring framed it permanently and read as a stray border. The caret, the divider
|
|
1750
|
+
under the field and the active row (`aria-activedescendant`) show where focus is; `SearchModal`'s
|
|
1751
|
+
field and `FilterPanel`'s keep their rings.
|
|
1752
|
+
- **A disabled `Select`/`MultiSelect` option is muted, not struck through** (operator decision,
|
|
1753
|
+
2026-11-08). The row keeps the spec's `muted` text and `not-allowed` cursor; the strike is gone,
|
|
1754
|
+
because a disabled option is as often a fixed, always-on choice as a sold-out one, and the strike
|
|
1755
|
+
read as "removed". A multi-select's disabled _selected_ box is `Checkbox`'s disabled checked box
|
|
1756
|
+
(`muted` fill and border, tick kept) rather than the `primary` fill, and its tag has no remove
|
|
1757
|
+
button. A sold-out reason still goes in `hint` or `meta`.
|
|
1618
1758
|
- **A `FilterPanel`'s applied chips put one more stop in the tab order than the spec's own table
|
|
1619
1759
|
lists.** The spec's Keyboard row reads "head **Clear all**, active chips' remove buttons, then
|
|
1620
1760
|
each group trigger …", and what a shopper actually meets is _chip, remove button, chip, remove
|
|
@@ -1712,7 +1852,7 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
1712
1852
|
sibling selector) zeroes a `Section`'s own top padding whenever the **previous** sibling
|
|
1713
1853
|
`Section` shares its background, and wins over _any_ layered `pt-*`/`py-*` class regardless of
|
|
1714
1854
|
specificity or source order (CSS Cascade Layers) — not only `spacing`'s own default, but a
|
|
1715
|
-
consumer's `
|
|
1855
|
+
consumer's `class="pt-12"` too, since a class from any source still compiles into the
|
|
1716
1856
|
same layered `@layer utilities`. The escape hatch is one of the two things this rule does not
|
|
1717
1857
|
touch: give the two `Section`s different `background` values (the rule only fires on a match), or
|
|
1718
1858
|
reach for an unlayered override of your own (`!pt-12`, which Tailwind never puts in a layer).
|
|
@@ -1891,9 +2031,11 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
1891
2031
|
`Link`'s, and the spec's "Customisation layers" §5 lists `as` on `Button`. It applies to the link
|
|
1892
2032
|
form only: with `href` set and `as` a component (`NuxtLink`, `RouterLink`), the component receives
|
|
1893
2033
|
the destination as `to`, matching those components' own prop contract; with `as` a plain string it
|
|
1894
|
-
stays a tag (or custom element) that still receives `href`.
|
|
1895
|
-
|
|
1896
|
-
|
|
2034
|
+
stays a tag (or custom element) that still receives `href`. A destination `href` cannot hold (a
|
|
2035
|
+
route object) goes in `to` instead, which a component `as` receives as its own `to`; while
|
|
2036
|
+
disabled it stays the component, `aria-disabled="true"` and `tabindex="-1"`, and its click is
|
|
2037
|
+
cancelled in the capture phase, before the router link's own handler. With neither `href` nor
|
|
2038
|
+
`to` there is no destination to route, so `as` is ignored and this is a `<button>`. Everything else is unchanged: icon-only
|
|
1897
2039
|
and loading naming, `aria-pressed`'s link rule, and the disabled-link semantics below all behave
|
|
1898
2040
|
exactly as they do on a native `<a>`.
|
|
1899
2041
|
- **A disabled `Button` with a component `as` renders a plain `<a href>`, not the router link.**
|
|
@@ -1906,6 +2048,21 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
1906
2048
|
which `href`-implies-link makes unreachable today). Everything else is unchanged — the `href`
|
|
1907
2049
|
stays so it keeps `role="link"`, with `aria-disabled="true"` and `tabindex="-1"` — and it routes
|
|
1908
2050
|
again the moment it is enabled, with no change from the caller.
|
|
2051
|
+
- **`Button`'s slot content and spinner.** A default slot holding elements (an icon beside the
|
|
2052
|
+
text) makes the label a flex row in the button's own `gap`; plain text renders as before.
|
|
2053
|
+
`spinnerPlacement: 'start'` draws the loading spinner in the leading icon's place with the label
|
|
2054
|
+
still visible, and the visible label keeps naming the button (no `aria-label` from `label`).
|
|
2055
|
+
`keepNameWhileLoading` keeps the overlay-hidden label in the accessibility tree (`opacity-0`
|
|
2056
|
+
rather than `invisible`), so slot content still names a loading button with no `label`.
|
|
2057
|
+
- **`Button` as a static tag.** A string `as` other than `'button'`/`'a'` with no `href` renders
|
|
2058
|
+
that tag (`<span>`, `<div>`) with the button look and nothing interactive: no `type`,
|
|
2059
|
+
`disabled`, `tabindex`, `aria-pressed`, `aria-disabled` or `aria-label`, since a generic element
|
|
2060
|
+
takes none of them. It is for a part that only looks like a button inside a control that is
|
|
2061
|
+
itself the button; its name is its own text, and an icon-only one is decorative.
|
|
2062
|
+
- **The focus ring composes with Tailwind shadows.** `eldra-focus` ends its `box-shadow` with
|
|
2063
|
+
`--tw-inset-shadow`, `--tw-inset-ring-shadow`, `--tw-ring-offset-shadow`, `--tw-ring-shadow` and
|
|
2064
|
+
`--tw-shadow`, each empty by default, so a `shadow-*` or `ring-*` on the same element is drawn
|
|
2065
|
+
beneath the ring rather than dropped.
|
|
1909
2066
|
- **`Button` disabled link button keeps its `href`.** A disabled `<a>` that also drops `href`
|
|
1910
2067
|
becomes a generic element and stops exposing `role="link"` — a screen reader stops naming what it
|
|
1911
2068
|
is at the exact moment it needs to say "unavailable". `href` stays, and `aria-disabled="true"`,
|
|
@@ -1970,9 +2127,11 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
1970
2127
|
- **`Input`'s `suffix` slot and the clear button share one end-anchored row**, `data-part="suffix"`,
|
|
1971
2128
|
rather than two independently positioned elements. This keeps both on one row at any size and
|
|
1972
2129
|
gives the keyboard table's "`Tab` reaches the clear button next" order for free, since the row
|
|
1973
|
-
follows the input in DOM order.
|
|
1974
|
-
|
|
1975
|
-
|
|
2130
|
+
follows the input in DOM order. The input's end padding is the spec's 2.5rem for one trailing
|
|
2131
|
+
item; a row wider than that (a spinner, the clear button and a password toggle) is measured once
|
|
2132
|
+
mounted, through a `ResizeObserver`, and the end padding grows to the row's width plus the same
|
|
2133
|
+
0.5rem, as an inline `padding-inline-end` set only then. The `prefix` row does the same at the
|
|
2134
|
+
start. Server-rendered output and the first paint carry the class padding alone.
|
|
1976
2135
|
- **`Input`'s `clearable`/`invalid`/`required`/`describedBy` default to `undefined`, not `false`.**
|
|
1977
2136
|
They fall back to a `FieldWrapper`'s context when there is one, and `false` there would be an
|
|
1978
2137
|
answer rather than "no opinion". (`describedBy` **composes** with the context rather than
|
|
@@ -2122,10 +2281,11 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
2122
2281
|
- **`Select` distinguishes a label's forwarded click from a real one.** "Clicking the Field
|
|
2123
2282
|
wrapper's label focuses the trigger (it doesn't open it)" — but a `<label for>` naming a
|
|
2124
2283
|
`<button>` forwards its click to it, and a forwarded click is otherwise indistinguishable from a
|
|
2125
|
-
real one. The trigger therefore opens
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
`
|
|
2284
|
+
real one. The trigger therefore opens for a click with a pointer press behind it (or a non-zero
|
|
2285
|
+
`detail`) — a press that ends anywhere but the trigger releases the latch, so a drag off the
|
|
2286
|
+
control cannot arm the next click — or for a programmatic `element.click()` (an untrusted
|
|
2287
|
+
`PointerEvent` with no label clicked in the same task), and focuses without opening otherwise.
|
|
2288
|
+
Keyboard activation never goes through a click at
|
|
2129
2289
|
all, because `useListbox` consumes `Enter` and `Space` itself.
|
|
2130
2290
|
- **`Select`'s `disabled` is the native `disabled` attribute.** The spec writes the state as
|
|
2131
2291
|
`tabindex="-1"` plus `aria-disabled="true"`; a real `<button disabled>` is already unfocusable
|
|
@@ -2136,9 +2296,9 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
2136
2296
|
consequence in a browser: a `hidden` control that fails constraint validation cannot be focused
|
|
2137
2297
|
to report the problem, so the form is blocked and the browser logs it rather than showing a
|
|
2138
2298
|
bubble. Pair it with the `FieldWrapper`'s own `error` for a visible message.
|
|
2139
|
-
- **`Select`'s `placement` is read once.** `useFloating`
|
|
2140
|
-
|
|
2141
|
-
change. It is a layout decision — "the footer's selectors use `above`" — not state.
|
|
2299
|
+
- **`Select`'s `placement` is read once.** `Select` hands `useFloating` the value, not a getter
|
|
2300
|
+
(`Popover` follows its `placement` while open), so a select that has to change placement at
|
|
2301
|
+
runtime needs a `:key` change. It is a layout decision — "the footer's selectors use `above`" — not state.
|
|
2142
2302
|
- **The popover panels are teleported, and positioned against the viewport** (operator decision,
|
|
2143
2303
|
2026-09-25). They used to be rendered in place, positioned absolutely inside the component's own
|
|
2144
2304
|
root, on the strength of the spec's own "Don't place a select inside a container that clips
|
|
@@ -2189,7 +2349,20 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
2189
2349
|
- **`MultiSelect`'s `value` slot takes `{ options }`** (the chosen ones, in the order they were
|
|
2190
2350
|
chosen) and fills the `summary` part, and the `tag` slot takes `{ option }` and replaces a chip's
|
|
2191
2351
|
**label**, leaving its remove button in place — a consumer restyling a chip should not have to
|
|
2192
|
-
rebuild the control that empties it.
|
|
2352
|
+
rebuild the control that empties it. A consumer that draws its own whole chip uses the
|
|
2353
|
+
`tagItem` slot instead (`{ option, remove, removable, removeLabel }`): it replaces the chip and
|
|
2354
|
+
its remove button inside the `<li data-part="tag">`, which then draws nothing of its own. The
|
|
2355
|
+
consumer owns the remove control then: render it only while `removable` (false when `disabled` or
|
|
2356
|
+
`readonly`), as a real `<button type="button">` named `removeLabel` ("Remove <label>"), calling
|
|
2357
|
+
`remove`, which deselects and returns focus to the trigger.
|
|
2358
|
+
- **`MultiSelect`'s tags can sit inside the field (`tagPlacement: 'inside'`).** The field then
|
|
2359
|
+
draws the trigger box (the `field` part) and wraps the tags and the trigger, growing a row at a
|
|
2360
|
+
time; the trigger is the rest of the last row, or a row of its own, and the panel matches the
|
|
2361
|
+
field's width. Past `maxTagRows` rows (default 2, `0` for no cap) the rest collapse into a "+N"
|
|
2362
|
+
tag (`tagMore`). `Backspace` on the closed trigger removes the last tag there, where it sits
|
|
2363
|
+
like a chip input's caret; `Delete` still clears. The tag list keeps `role="list"` and its name
|
|
2364
|
+
while `display: contents` lays its chips into the field. `showTags` and `maxSummary` apply to the
|
|
2365
|
+
default `'below'` placement only.
|
|
2193
2366
|
- **`QuantityStepper`'s field is `type="text"`, not the spec anatomy's literal
|
|
2194
2367
|
`<input type="number">`.** A native number input's DOM value can only ever be the US-style,
|
|
2195
2368
|
ungrouped floating-point grammar (digits and a single `.`); it cannot hold a locale-grouped
|
|
@@ -2295,7 +2468,7 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
2295
2468
|
bare `/` and is `aria-hidden`, so the full sentence ("Press / to search") has nowhere to be
|
|
2296
2469
|
announced; it is the chip's tooltip, and the field carries `aria-keyshortcuts="/"`.
|
|
2297
2470
|
- **A row's active arrow is not animated.** The spec's Sizes table only says "visible only on the
|
|
2298
|
-
active row"; the package's own Motion conventions give hover/colour changes `duration-
|
|
2471
|
+
active row"; the package's own Motion conventions give hover/colour changes `duration-base`, and
|
|
2299
2472
|
other components carry their own `transition-*` for a similarly momentary reveal (Link's arrow,
|
|
2300
2473
|
Switch's thumb and track) — but here `itemArrow` is a plain `v-if="isActive(row)"`, so the arrow
|
|
2301
2474
|
appears and disappears with the row's active state, not a fade. Nothing in the spec's own text
|
|
@@ -2463,7 +2636,7 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
2463
2636
|
- **`rounded`** (`'none' | 'lg' | 'xl'`, default `'none'`) forwards straight to `Image`'s own
|
|
2464
2637
|
`rounded` prop.
|
|
2465
2638
|
- **`fill`** (`boolean`, default `false`) is for a background image that has to cover its
|
|
2466
|
-
positioned ancestor: `ratio="auto"` plus `absolute inset-0 h-full w-full` on
|
|
2639
|
+
positioned ancestor: `ratio="auto"` plus `absolute inset-0 h-full w-full` on the root (`class`) and
|
|
2467
2640
|
`h-full w-full` on `classes.frame`, so the frame's height comes from the ancestor via the
|
|
2468
2641
|
`inset-0`/`h-full` chain instead of needing `media.width`/`height` (which this wrapper never
|
|
2469
2642
|
has). Used by the hero block's `image-background` variant.
|
|
@@ -2514,7 +2687,7 @@ more"` — has no comma before "and". Icelandic's own pattern already has no suc
|
|
|
2514
2687
|
cell's own box. Linked, the box (and the `eldra-focus` ring — 2.5.8 needs the _target_ itself at
|
|
2515
2688
|
least 4rem tall, not just a gutter around it) moves to the `<a>`/`as` cell, and the outer `<li>`
|
|
2516
2689
|
is bare — no class list, no `data-part`, nothing `classes` can reach, because it carries nothing
|
|
2517
|
-
visual to restyle. `
|
|
2690
|
+
visual to restyle. `class` always reaches the one element that is actually the cell,
|
|
2518
2691
|
whichever tag that turns out to be.
|
|
2519
2692
|
- **No `external` prop; whether the hidden link context appears is judged from `href` itself.**
|
|
2520
2693
|
`LogoItemProps` (the API contract) has no `external` boolean the way `LinkProps` does, but the spec's
|
|
@@ -3395,7 +3568,7 @@ flex items-center target-min` frame `linkClass` gives its sibling, so a non-wrap
|
|
|
3395
3568
|
(`eldra-search-modal-width`/`-max-height`/`-position`), the same technique `eldra-drawer-width`
|
|
3396
3569
|
already documents**, rather than one utility or a class-level arbitrary value — width, max-height
|
|
3397
3570
|
and position are three different CSS properties a consumer can restyle independently through
|
|
3398
|
-
`
|
|
3571
|
+
`class`, but each one's own desktop number and its full-screen override must travel
|
|
3399
3572
|
together, the same reasoning `eldra-drawer-width` gives for its own single bundled rule.
|
|
3400
3573
|
- **The radius/border/shadow removed below 48rem is plain `max-md:rounded-none`/`border-0`/
|
|
3401
3574
|
`shadow-none` on the root, not a fourth bundled utility.** Unlike the three geometry numbers
|
|
@@ -3417,7 +3590,7 @@ flex items-center target-min` frame `linkClass` gives its sibling, so a non-wrap
|
|
|
3417
3590
|
(2026-09-27). The component used to build interpolated arbitrary-property classes
|
|
3418
3591
|
(`` `[--eldra-carousel-per-view:${n}]` ``, plus `@tablet:`/`@content:` steps), and Tailwind has no
|
|
3419
3592
|
runtime: it scans source _text_ for class names, and an interpolated value is never in that text.
|
|
3420
|
-
A consumer's build (
|
|
3593
|
+
A consumer's build (which then compiled the components from `dist/*.js`; they ship prebuilt now)
|
|
3421
3594
|
therefore emitted no rule for any of the three, `eldra-carousel-slide`'s width formula fell back
|
|
3422
3595
|
to its own `1`, and every carousel rendered one full-width slide — the starter's testimonials,
|
|
3423
3596
|
product row, `split-carousel` hero and `carousel` gallery all at once. The package's own Storybook
|
|
@@ -3436,16 +3609,6 @@ flex items-center target-min` frame `linkClass` gives its sibling, so a non-wrap
|
|
|
3436
3609
|
rather than a throw. Before this (fixed 2026-09-27) the ref was cast straight to `HTMLElement`,
|
|
3437
3610
|
which reached a component's `focus` only when that component happened to expose one and did
|
|
3438
3611
|
nothing at all otherwise: the guarantee was silently the consumer's, not the package's.
|
|
3439
|
-
- **A `classes` part given an array is flattened, and warned about once per component and part in
|
|
3440
|
-
dev.** `classes` is one class string per part, and TypeScript says so — but a JavaScript consumer,
|
|
3441
|
-
a `v-bind` of an untyped object and a value out of JSON all reach `partClass` anyway, and
|
|
3442
|
-
`Object.entries(['flex', 'gap-4'])` reads an array's _indices_, so an array used to render
|
|
3443
|
-
`class="0 1"`: two classes that style nothing, in place of the two that were written. `cx` now
|
|
3444
|
-
flattens one the way Vue's own `:class` array syntax does, and `partClass` names the component and
|
|
3445
|
-
the part in a single dev `console.warn` (`import.meta.env.DEV`, so production carries neither the
|
|
3446
|
-
message nor the check). The component name comes from `getCurrentInstance()`, which is set while a
|
|
3447
|
-
component renders — where every `classes` computed is first evaluated — so no call site had to
|
|
3448
|
-
change.
|
|
3449
3612
|
- **`formatDate` takes an `Intl.DateTimeFormatOptions` subset as a third argument**
|
|
3450
3613
|
(`FormatDateOptions`: `day`, `month`, `year`, `weekday`), with every omitted key keeping the
|
|
3451
3614
|
spec's own `12 Sep 2026` default rather than dropping that part from the output — so
|