@eldrajs/ui 0.3.0 → 0.3.1
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 +6 -0
- package/README.md +58 -29
- package/dist/{VariantPicker-C-9sMXGI.js → VariantPicker-DDFlMvgJ.js} +53 -54
- package/dist/components/skeleton/Skeleton.vue.d.ts +1 -0
- package/dist/components/skeleton/types.d.ts +13 -3
- package/dist/components.css +82 -55
- package/dist/composables/useDialog.d.ts +9 -1
- package/dist/index.js +27 -8
- package/dist/style.css +82 -55
- package/dist/utilities.css +142 -74
- package/dist/vee-validate.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,8 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
7
7
|
|
|
8
8
|
### Added
|
|
9
9
|
|
|
10
|
+
- **`Skeleton`'s `box` variant and `height` prop**: one plain shimmering shape that is the component itself, sized by `width` / `height` or by classes on it (`<Skeleton variant="box" width="12rem" height="3rem" />`, `<Skeleton variant="box" class="h-24 rounded-full" />`). Unsized, it is full width and `--eldra-skeleton-box-height` tall (default `1rem`).
|
|
11
|
+
- **`Skeleton` CSS variables**: `--eldra-skeleton-line-height`, `--eldra-skeleton-line-gap` and `--eldra-skeleton-title-height` size the `text` and `title` rows (defaults `0.875rem`, `0.3rem`, `1.5rem`, as before); `--eldra-skeleton-color`, `--eldra-skeleton-highlight` and `--eldra-skeleton-duration` set the fill, the glare and the shimmer's cycle. They apply to `Price`'s loading state too.
|
|
10
12
|
- **`--eldra-button-border-width`** (default `1px`) sets the border width of every `Button` variant except `link`, at the same height; an attached `ButtonGroup` overlaps its buttons by the same width, so they still share one line.
|
|
11
13
|
- **`@eldrajs/ui/vue-i18n`** — the kit's messages read through an app's vue-i18n (`useEldraUiI18n()`, or `eldraUiI18nMessages(i18n.global)` for `MESSAGES_KEY`), so the kit is translated with the rest of the app and follows a locale switch. Keys live under `eldraUi.*`; `toVueI18nMessages(enUS | isIS | yours)` produces them (named values, plural forms, a suffixed key per non-count branch such as `pageN_current`); `icelandicPluralRule` for vue-i18n's `pluralRules`. A missing key falls back to English. `vue-i18n ^11` is a new optional peer, imported by this entry only.
|
|
12
14
|
- **`topLayerDialog(anchor)`** is exported: the open modal `<dialog>` a popup anchored to `anchor` must be teleported into (`body` would paint it behind the top layer), or `null`. The same answer `Select`, `Popover` and `Tooltip` use, for a consumer's own teleported popup.
|
|
@@ -70,6 +72,9 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
70
72
|
|
|
71
73
|
### Changed
|
|
72
74
|
|
|
75
|
+
- **The skeleton shimmer is slower and softer**: one sweep over the first 1.8s of a 3s cycle, eased at both ends, then a rest, with the glare a soft band rather than a wash the width of the shape. It was a 1.4s `ease-out` sweep, back to back.
|
|
76
|
+
- **`Dialog` focuses itself on open, not its first control**, from the keyboard as from a tap, so a form dialog no longer opens with the caret (and, on leaving it, the blur validation) in its first field. `Tab` reaches the first control; mark a field `autofocus` to focus it instead. `useDialog` takes the same behaviour as `focusFirstControl: false`; `Drawer`, `Lightbox` and `SearchModal` are unchanged.
|
|
77
|
+
- **The focus ring moves out from the border as it fades in**, instead of fading in at full size: at rest it is a 1px transparent band against the border, and on focus it travels out past the 2px `focus-inner` infill to the 2px ring, over `duration-base`. The end state is unchanged. Drawn with `box-shadow` spreads, which render at fractional sizes, so the move is smooth.
|
|
73
78
|
- **Breaking: the components ship prebuilt, with `eldra:`-prefixed classes, below the app's utilities.** Every class a component renders is `eldra:`-prefixed (`eldra:px-4`, `eldra:hover:bg-primary`), and `style.css` / `components.css` put them in `@layer components`, below Tailwind's `utilities`. A class you set on a component (`class`, `classes`) is added beside the component's own and wins by layer, in every state (a plain `bg-*` also replaces the hover fill). An app's own Tailwind no longer restyles a component through a same-named utility or theme variable. `tailwind.css` no longer builds the components (its `@source` is gone): a Tailwind app imports `@eldrajs/ui/components.css` beside it. New entries `theme.css` and `utilities.css` (the two halves of `tailwind.css`'s Tailwind part). A test or stylesheet that selects a component by one of its utility classes must use the prefixed name (`.eldra\:px-4`); `data-part` is the stable hook.
|
|
74
79
|
- **Breaking: `cx`, `partClass` and `ClassValue` are no longer exported.** The components bind their classes with Vue's own `class`/`:class`, one class per concern on each element, and a consumer's class is added beside the component's own (it wins by layer) rather than merged. Use Vue's `:class` in your own markup, and `tailwind-merge` directly if you need to merge your own classes.
|
|
75
80
|
- **Breaking: the outermost element is styled with `class`, not `classes`.** The `classes` key for the element `class` already reaches is removed: `root` on almost every component, `Button`'s `container`, `Tab`'s `tab`, `Radio`'s `option`; write `class="…"` instead. `Container`, `Section`, `Icon`, `TablerIcon`, `VisuallyHidden`, `ChipGroup`, `ButtonGroup`, `TabPanel` and `Accordion` had no other part, so they no longer take `classes` (`ContainerPart`, `IconPart`, `SectionPart`, `TablerIconPart` and `VisuallyHiddenPart` are no longer exported). `Toaster` (teleported) and `LogoItem` (a linked one's root part is the inner `<a>`) keep `root`, and `NavMenu` keeps `drawerRoot`. On `Input`, `Textarea`, `UnitInput`, `CurrencyInput`, `QuantityStepper`, `Select`, `MultiSelect`, `SearchBar`, `SearchModal`, `Checkbox` and `Radio`, `class` now styles the root instead of the native control or trigger; every other attribute still goes to the control, and `classes.control` (or the trigger part) styles it. `Popover`'s `class` stays on the panel, with its other attributes.
|
|
@@ -146,6 +151,7 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
146
151
|
|
|
147
152
|
### Fixed
|
|
148
153
|
|
|
154
|
+
- **A field's 2px error boundary no longer splits into two lines at 90%, 110% or 125% zoom.** `Input`, `Textarea`, `UnitInput`, `Select`, `MultiSelect` (and `SearchBar`, `CurrencyInput` through them) draw the second line as the focus ring's resting band in `danger`, a `box-shadow` against the outside of the border, instead of a pseudo-element inset on the field's root. `eldra-field-invalid` now sits on the control (the input, textarea, select trigger, or the `MultiSelect` field holding inside tags), and `--eldra-field-invalid-radius` is gone. On focus the line moves out to become the focus ring.
|
|
149
155
|
- **`scoped.css` leaves a `Popover` or `Tooltip` trigger to the consumer.** The root is the slot host (`data-eldra-slot`) while the trigger is filled, so the consumer's own element keeps its border, padding and background instead of the kit's reset and utilities.
|
|
150
156
|
- **`Popover` finds its trigger inside a fragment**, so a wrapper can forward its own `<slot>` into `trigger`.
|
|
151
157
|
- **A dialog opened by a tap or click focuses itself, not its first control** (`Dialog`, `Drawer`, `Lightbox`, `SearchModal`, and `NavMenu`'s phone menu). Safari draws a focus ring on a control that script focuses after a tap, so opening the phone menu ringed its first link (or a logo in its header) as if the keyboard had moved there. A tap or click now focuses the dialog itself, ringed by nothing, and `Tab` goes on from there; a text field or a control marked `autofocus` still takes focus, and a dialog opened from the keyboard focuses its first control as before.
|
package/README.md
CHANGED
|
@@ -222,7 +222,7 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
222
222
|
| `Section` | none — the vertical rhythm (`--eldra-section-{sm,md,lg}`) and the gutters it shares with `Container` are shared tokens |
|
|
223
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
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` |
|
|
225
|
+
| `Skeleton` | `--eldra-skeleton-line-height` (default `0.875rem`) and `--eldra-skeleton-line-gap` (default `0.3rem`, above and below) for `text` rows, `--eldra-skeleton-title-height` (default `1.5rem`), `--eldra-skeleton-box-height` (default `1rem`, an unsized `box`), `--eldra-skeleton-color` (default `surface-strong`, the shape's fill), `--eldra-skeleton-highlight` (default `background` at 60%, the glare) and `--eldra-skeleton-duration` (default `3s`, one sweep and its rest; the sweep is its first 60%); `width` still sets an inline style (see the Deviations entry) |
|
|
226
226
|
| `StockBadge` | `--eldra-stock-status-line` (default `1.4`) — the status line text's line ratio, no token of its own |
|
|
227
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
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) |
|
|
@@ -241,14 +241,14 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
241
241
|
fails the build if `src/componentNames.ts` gains a name this table has not. "None" means the
|
|
242
242
|
component reads only the shared tokens from layer 1 above, with no CSS variable of its own.
|
|
243
243
|
|
|
244
|
-
|
|
245
|
-
by the `eldra-field-invalid` utility on the
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
244
|
+
Four variables are **derived, not knobs**: `--eldra-focus-rest-width`, `-color` and `-forced`
|
|
245
|
+
are declared by the `eldra-field-invalid` utility on the control that carries the 2px error
|
|
246
|
+
boundary (`Input`, `UnitInput`, `Select`, `MultiSelect`, `Textarea`, `SearchBar`), from
|
|
247
|
+
`--eldra-field-border-width` and `--eldra-color-danger`, and `--eldra-focus-rest-offset` (0px)
|
|
248
|
+
is the resting band's offset on every control; the focus ring reads all four (see the
|
|
249
|
+
Deviations entries on the ring and the error line). They do not inherit. Set
|
|
250
|
+
`--eldra-field-border-width`, `--eldra-color-danger` and the ring's own `--eldra-focus-width` /
|
|
251
|
+
`--eldra-focus-offset` instead.
|
|
252
252
|
|
|
253
253
|
3. **A `classes` prop**, typed `Partial<Record<Part, string>>` where `Part` is the union of that
|
|
254
254
|
component's `data-part` names from the design spec's anatomy (`container`, `label`,
|
|
@@ -652,7 +652,7 @@ spec's own non-negotiable 2):
|
|
|
652
652
|
tree, and `provide`/`inject` cannot connect two siblings, so the hand-off is a plain shared
|
|
653
653
|
reference both sides read and write, exactly the same reasoning `usePopover`'s `topLayerDialog()`
|
|
654
654
|
already uses to teleport a panel into a dialog it did not render;
|
|
655
|
-
- **initial focus** — `initialFocus`, else a reachable `[autofocus]` control, else the first focusable that is not `[data-part="close"]`
|
|
655
|
+
- **initial focus** — `initialFocus`, else a reachable `[autofocus]` control, else (with `focusFirstControl: false`, which `Dialog` sets, the dialog itself) the first focusable that is not `[data-part="close"]`
|
|
656
656
|
(this package's own "every part carries `data-part`" convention doubling as the composable's
|
|
657
657
|
exclusion rule, so any modal built on this contract needs no second constant to stay in sync),
|
|
658
658
|
else the close button itself, applied a tick after `showModal()` so slot content mounted alongside
|
|
@@ -1809,6 +1809,18 @@ Additions and departures from the design spec, and why.
|
|
|
1809
1809
|
— so `<Skeleton width="12rem" variant="title" />` still renders a 12rem-wide bar, just sized from
|
|
1810
1810
|
the root down rather than the shape up, and works inside a shrink-to-fit container the literal
|
|
1811
1811
|
reading would not fix.
|
|
1812
|
+
- **`Skeleton` has a sixth variant, `box`** (operator request, 2026-11-10), beside the spec's five
|
|
1813
|
+
shape primitives: one plain shape that is the component's root itself, with no lines inside, for
|
|
1814
|
+
a placeholder of any size (a chart, a table cell, a thumbnail). `width` and the new `height` prop
|
|
1815
|
+
set inline sizes, and classes on the component (`h-24`, `rounded-full`) size and round it
|
|
1816
|
+
directly; unsized it is `--eldra-skeleton-box-height` tall (default `1rem`) and full width.
|
|
1817
|
+
`classes.line` applies to it, as the one shape it draws.
|
|
1818
|
+
- **`Skeleton`'s shimmer sweeps for 1.8s of a 3s cycle, eased at both ends, then rests** (operator
|
|
1819
|
+
review, 2026-11-10). The spec's Behaviour & motion row asks for a 1.4s `ease-out` sweep, repeated
|
|
1820
|
+
back to back; in Storybook and Studio that lunged across the shape, slowed, and jumped straight
|
|
1821
|
+
back to the start, which read as fast and mechanical. The glare is also a soft band across the
|
|
1822
|
+
middle of the sweep rather than a wash the width of the shape. `--eldra-skeleton-duration` sets
|
|
1823
|
+
the cycle.
|
|
1812
1824
|
- **`Skeleton`'s `btn` variant takes `--eldra-control-height` (2.5rem), not the spec's literal
|
|
1813
1825
|
2.75rem.** The Sizes table gives `btn` a fixed `2.75rem` — the same figure as `target-touch`,
|
|
1814
1826
|
which `Button`'s own `md` size only grows to below a 48rem **container** (a container query this
|
|
@@ -1992,25 +2004,43 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
1992
2004
|
in sync and closing fades the ring back out over the transition `eldra-focus` already owns. The
|
|
1993
2005
|
`SearchBar` never needed it: its trigger is a text field, and text fields carry
|
|
1994
2006
|
`eldra-focus-always`.
|
|
1995
|
-
- **
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2007
|
+
- **A field's error line is the focus ring at rest, outside the border, not an inset line.** The
|
|
2008
|
+
spec's Error row reads "2px `danger` (1px border + 1px inset line)". The inset line was a
|
|
2009
|
+
pseudo-element on the field's root, inset by the border width; a browser snaps a border's width
|
|
2010
|
+
to whole device pixels but not that offset, so at 90%, 110% and 125% zoom a sliver of background
|
|
2011
|
+
showed between the two lines. Now the ring's own resting band (a `box-shadow` spread, see the
|
|
2012
|
+
next entry) is `danger`, as wide as the border, against its outer edge: both start from the one
|
|
2013
|
+
edge the border is drawn from, so they stay one 2px line at every zoom (checked in Chromium at
|
|
2014
|
+
90/100/110/125%). The boundary is 1px wider outward than the spec's. On focus the band travels out
|
|
2015
|
+
past the `focus-inner` infill to become the ring, the border reading 1px `danger` inside it.
|
|
2016
|
+
- **`Dialog` focuses itself when it opens, not its first control** (operator decision,
|
|
2017
|
+
2026-11-10). The shared modal rule focuses the first meaningful control from the keyboard; on a
|
|
2018
|
+
form dialog that put the caret in the first field, and leaving it ran that field's blur
|
|
2019
|
+
validation before the user had reached it. `Dialog` now focuses the `<dialog>` (which draws no
|
|
2020
|
+
ring), however it opened; `Tab` reaches the first control. Mark a field `autofocus` (or pass
|
|
2021
|
+
`initialFocus` to a `useDialog` of your own) to focus it instead. `Drawer`, `Lightbox` and
|
|
2022
|
+
`SearchModal` keep the shared rule.
|
|
2023
|
+
- **The focus ring moves out from the border as it fades in.** The design spec's Focus ring
|
|
2024
|
+
section says the ring and its infill "grow from 0 to 2px over `duration-base`". This package
|
|
2025
|
+
first shipped that as an animated `outline-width` and `box-shadow` spread and it read as a 1 fps
|
|
2026
|
+
stagger, then drew the ring at full size and faded only its opacity. The stagger was the outline:
|
|
2027
|
+
a browser draws an outline's width and offset only at whole device pixels (3 distinct frames
|
|
2028
|
+
across a 2px move at 2x in Chromium), while a `box-shadow` spread renders at any fraction (9 of 9).
|
|
2029
|
+
So the ring is two spreads off the border edge, both driven by the one animated
|
|
2030
|
+
`--eldra-focus-alpha`: at rest a 1px band against the border (transparent, or `danger` on an
|
|
2031
|
+
invalid field), on focus a 2px `focus-inner` infill with a 2px ring outside it, the band moving
|
|
2032
|
+
out and widening while its colour fades to `focus`. The end state, the thing every contrast
|
|
2033
|
+
requirement in the spec is about, is unchanged.
|
|
2005
2034
|
|
|
2006
2035
|
Mechanically: `--eldra-focus-alpha` is registered with `@property` (`syntax: '<number>'`) so the
|
|
2007
|
-
engine can interpolate it
|
|
2008
|
-
`color-mix(in srgb,
|
|
2009
|
-
keep it safe rather than clever — an engine without `color-mix` gets the whole ring at
|
|
2010
|
-
through an `@supports not` rule, an engine without `@property` switches the alpha 0 → 1 with
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
full size; only the
|
|
2036
|
+
engine can interpolate it; the spreads are `calc()`s of it and the colours
|
|
2037
|
+
`color-mix(in srgb, <resting colour>, <role> calc(var(--eldra-focus-alpha) * 100%))`. Two
|
|
2038
|
+
fallbacks keep it safe rather than clever — an engine without `color-mix` gets the whole ring at
|
|
2039
|
+
once through an `@supports not` rule, an engine without `@property` switches the alpha 0 → 1 with
|
|
2040
|
+
no motion, and forced-colours mode gets a static `outline` in the system `Highlight` colour (and
|
|
2041
|
+
a field's error line in `CanvasText`), because `box-shadow` is dropped there by the UA. In every
|
|
2042
|
+
one of those paths the ring is present at full size; only the motion is lost, which is exactly
|
|
2043
|
+
what `prefers-reduced-motion` asks for anyway.
|
|
2014
2044
|
|
|
2015
2045
|
- **`Button` `text-button-{sm,md,lg}` utilities, and the `lg` font size as a per-component
|
|
2016
2046
|
variable.** The spec's Sizes table gives `lg` a 1.0625rem font, between `body` (1rem) and
|
|
@@ -2213,8 +2243,7 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
2213
2243
|
numbers (1.5px, 2px in error) as the Checkbox box, so `eldra-checkbox-border`/`-invalid` are
|
|
2214
2244
|
shared rather than duplicated as `eldra-radio-*`. The **card** itself is a different element with
|
|
2215
2245
|
its own 1px number, so it gets `eldra-radio-card-border` of its own.
|
|
2216
|
-
- **A card's selected boundary is a real border plus an inset line
|
|
2217
|
-
`eldra-field-invalid` uses for a field's error state: the spec spells it out ("2px `primary` (1px
|
|
2246
|
+
- **A card's selected boundary is a real border plus an inset line**: the spec spells it out ("2px `primary` (1px
|
|
2218
2247
|
border + 1px inset line)"), so growing the real border to 2px — which would shift the card's
|
|
2219
2248
|
neighbours — is not what it asks for. `eldra-radio-card-selected` reads
|
|
2220
2249
|
`--eldra-radio-card-selected-color` so the same utility draws the `danger` version too, for a
|
|
@@ -184,7 +184,9 @@ var kitMerge = extendTailwindMerge({
|
|
|
184
184
|
"control-h",
|
|
185
185
|
"control-h-sm",
|
|
186
186
|
"control-h-lg",
|
|
187
|
-
"eldra-range-track"
|
|
187
|
+
"eldra-range-track",
|
|
188
|
+
"eldra-skeleton-title",
|
|
189
|
+
"eldra-skeleton-box"
|
|
188
190
|
],
|
|
189
191
|
"min-h": [
|
|
190
192
|
"eldra-range-rail",
|
|
@@ -259,6 +261,7 @@ var kitMerge = extendTailwindMerge({
|
|
|
259
261
|
],
|
|
260
262
|
opacity: ["eldra-revalidating"],
|
|
261
263
|
"eldra-skeleton": ["eldra-skeleton"],
|
|
264
|
+
"eldra-skeleton-text": ["eldra-skeleton-text"],
|
|
262
265
|
"eldra-rating-half": ["eldra-rating-half"],
|
|
263
266
|
"eldra-image-placeholder-hatch": ["eldra-image-placeholder-hatch"],
|
|
264
267
|
"eldra-tooltip-arrow": ["eldra-tooltip-arrow"],
|
|
@@ -2056,8 +2059,8 @@ var FIELD_ACTION_PAIR_SIZE = {
|
|
|
2056
2059
|
/**
|
|
2057
2060
|
* States (spec "Input" → States). Disabled and read-only replace the live colours outright rather
|
|
2058
2061
|
* than layering over them, so a `:hover` rule can never win back a live boundary on a dead field.
|
|
2059
|
-
* The error row's second 1px line is
|
|
2060
|
-
*
|
|
2062
|
+
* The error row's second 1px line is the ring's own outline at rest (`eldra-field-invalid`, on the
|
|
2063
|
+
* control beside this recipe). Each recipe carries the
|
|
2061
2064
|
* fill, the text colour and the boundary, so a field renders exactly one of each: `fieldState`
|
|
2062
2065
|
* picks the one recipe a field is in.
|
|
2063
2066
|
*/
|
|
@@ -2202,7 +2205,7 @@ var VALUE_DRAG_PIXELS_PER_STEP = 8;
|
|
|
2202
2205
|
* into every consumer's bundle — importing `Button` alone pulled this file in with it.
|
|
2203
2206
|
*/
|
|
2204
2207
|
var MAX_SAFE_VALUE = 9007199254740991;
|
|
2205
|
-
var rootClass$
|
|
2208
|
+
var rootClass$6 = "eldra:block eldra:w-full";
|
|
2206
2209
|
// src/components/unit-input/UnitInput.vue
|
|
2207
2210
|
var UnitInput_default = /* @__PURE__ */ defineComponent({
|
|
2208
2211
|
inheritAttrs: false,
|
|
@@ -2738,11 +2741,7 @@ var UnitInput_default = /* @__PURE__ */ defineComponent({
|
|
|
2738
2741
|
/** The same rule as `Input`'s: a disabled field keeps its dead boundary and drops the danger one. */
|
|
2739
2742
|
const showsInvalid = computed(() => isInvalid.value && !props.disabled);
|
|
2740
2743
|
const labelClass = computed(() => mergeClass("eldra:text-label eldra:text-text eldra:mb-1 eldra:block", props.classes?.label));
|
|
2741
|
-
const fieldClass = computed(() => [
|
|
2742
|
-
"eldra:relative eldra:block eldra:w-full",
|
|
2743
|
-
showsInvalid.value && "eldra:eldra-field-invalid",
|
|
2744
|
-
props.classes?.field
|
|
2745
|
-
]);
|
|
2744
|
+
const fieldClass = computed(() => ["eldra:relative eldra:block eldra:w-full", props.classes?.field]);
|
|
2746
2745
|
const controlClass = computed(() => [
|
|
2747
2746
|
FIELD_BASE,
|
|
2748
2747
|
FIELD_SIZE[props.size],
|
|
@@ -2754,6 +2753,7 @@ var UnitInput_default = /* @__PURE__ */ defineComponent({
|
|
|
2754
2753
|
readonly: props.readonly,
|
|
2755
2754
|
invalid: showsInvalid.value
|
|
2756
2755
|
}),
|
|
2756
|
+
showsInvalid.value && "eldra:eldra-field-invalid",
|
|
2757
2757
|
props.classes?.control
|
|
2758
2758
|
]);
|
|
2759
2759
|
const leadingIconClass = computed(() => [FIELD_LEADING_ICON, props.classes?.leadingIcon]);
|
|
@@ -2783,7 +2783,7 @@ var UnitInput_default = /* @__PURE__ */ defineComponent({
|
|
|
2783
2783
|
"data-eldra-ui": "",
|
|
2784
2784
|
"data-eldra-scope": unref(eldra).scope,
|
|
2785
2785
|
"data-part": "root",
|
|
2786
|
-
class: normalizeClass([rootClass$
|
|
2786
|
+
class: normalizeClass([rootClass$6, _ctx.$attrs.class])
|
|
2787
2787
|
}, [showOwnLabel.value ? (openBlock(), createElementBlock("label", {
|
|
2788
2788
|
key: 0,
|
|
2789
2789
|
"data-part": "label",
|
|
@@ -3175,6 +3175,7 @@ var _hoisted_4$11 = [
|
|
|
3175
3175
|
];
|
|
3176
3176
|
var _hoisted_5$9 = ["data-eldra-slot"];
|
|
3177
3177
|
var _hoisted_6$7 = ["data-eldra-scope", "aria-label"];
|
|
3178
|
+
var rootClass$5 = "eldra:relative eldra:block eldra:w-full";
|
|
3178
3179
|
// src/components/input/Input.vue
|
|
3179
3180
|
var Input_default = /* @__PURE__ */ defineComponent({
|
|
3180
3181
|
inheritAttrs: false,
|
|
@@ -3290,11 +3291,10 @@ var Input_default = /* @__PURE__ */ defineComponent({
|
|
|
3290
3291
|
* disabled field is out of the conversation, so it keeps its dead grey boundary and drops the
|
|
3291
3292
|
* danger one (`aria-invalid` stays: the field is still invalid, it just cannot be fixed here). A
|
|
3292
3293
|
* read-only field keeps it — the value is shown, cannot be edited in place, and is still wrong.
|
|
3293
|
-
* The
|
|
3294
|
-
* the spec's 2px boundary
|
|
3294
|
+
* The border colour and `eldra-field-invalid` (the outline beside it) both read it, so the 1px
|
|
3295
|
+
* border and the 1px line that make up the spec's 2px boundary never appear one without the other.
|
|
3295
3296
|
*/
|
|
3296
3297
|
const showsInvalid = computed(() => isInvalid.value && !props.disabled);
|
|
3297
|
-
const rootClass = computed(() => ["eldra:relative eldra:block eldra:w-full", showsInvalid.value && "eldra:eldra-field-invalid"]);
|
|
3298
3298
|
const controlClass = computed(() => [
|
|
3299
3299
|
FIELD_BASE,
|
|
3300
3300
|
FIELD_SIZE[props.size],
|
|
@@ -3308,6 +3308,7 @@ var Input_default = /* @__PURE__ */ defineComponent({
|
|
|
3308
3308
|
readonly: props.readonly,
|
|
3309
3309
|
invalid: showsInvalid.value
|
|
3310
3310
|
}),
|
|
3311
|
+
showsInvalid.value && "eldra:eldra-field-invalid",
|
|
3311
3312
|
props.classes?.control
|
|
3312
3313
|
]);
|
|
3313
3314
|
const leadingIconClass = computed(() => [FIELD_LEADING_ICON, props.classes?.leadingIcon]);
|
|
@@ -3377,7 +3378,7 @@ var Input_default = /* @__PURE__ */ defineComponent({
|
|
|
3377
3378
|
"data-eldra-ui": "",
|
|
3378
3379
|
"data-eldra-scope": unref(eldra).scope,
|
|
3379
3380
|
"data-part": "root",
|
|
3380
|
-
class: normalizeClass([rootClass
|
|
3381
|
+
class: normalizeClass([rootClass$5, _ctx.$attrs.class])
|
|
3381
3382
|
}, [
|
|
3382
3383
|
hasPrefix.value ? (openBlock(), createElementBlock("span", {
|
|
3383
3384
|
key: 0,
|
|
@@ -6011,6 +6012,12 @@ var _hoisted_12$2 = ["label"];
|
|
|
6011
6012
|
var _hoisted_13$1 = ["value", "disabled"];
|
|
6012
6013
|
var _hoisted_14$1 = ["value", "disabled"];
|
|
6013
6014
|
var SUMMARY_MEASURE = "eldra:pointer-events-none eldra:invisible eldra:absolute eldra:start-0 eldra:top-0 eldra:flex eldra:items-center eldra:gap-2 eldra:overflow-hidden";
|
|
6015
|
+
var rootClass$4 = "eldra:relative eldra:block eldra:w-full";
|
|
6016
|
+
/**
|
|
6017
|
+
* The trigger box: the same box as `Select`'s, which is the same box as `Input`'s — including
|
|
6018
|
+
* `eldra-focus-open`, which keeps the ring on while the popover is open (see `Select.vue`'s own
|
|
6019
|
+
* comment for why a pointer-opened trigger needs it).
|
|
6020
|
+
*/
|
|
6014
6021
|
var TRIGGER_BASE$1 = "eldra:flex eldra:w-full eldra:min-w-0 eldra:items-center eldra:gap-2 eldra:text-start eldra:eldra-field-border eldra:rounded-[var(--eldra-field-radius,var(--eldra-radius-md))] eldra:eldra-focus eldra:eldra-focus-open";
|
|
6015
6022
|
var LIVE_FILL$2 = "eldra:bg-background eldra:text-text eldra:cursor-pointer";
|
|
6016
6023
|
var REST$1 = "eldra:border-border-strong eldra:hover:border-text";
|
|
@@ -6399,12 +6406,6 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
6399
6406
|
listbox.activateFrom(void 0);
|
|
6400
6407
|
});
|
|
6401
6408
|
const showsInvalid = computed(() => isInvalid.value && !props.disabled);
|
|
6402
|
-
const rootClass = computed(() => ["eldra:relative eldra:block eldra:w-full", showsInvalid.value && "eldra:eldra-field-invalid"]);
|
|
6403
|
-
/**
|
|
6404
|
-
* The trigger box: the same box as `Select`'s, which is the same box as `Input`'s — including
|
|
6405
|
-
* `eldra-focus-open`, which keeps the ring on while the popover is open (see `Select.vue`'s own
|
|
6406
|
-
* comment for why a pointer-opened trigger needs it).
|
|
6407
|
-
*/
|
|
6408
6409
|
const SIZE = {
|
|
6409
6410
|
sm: "eldra:control-h-sm eldra:ps-2.25 eldra:pe-2.5 eldra:text-control-sm",
|
|
6410
6411
|
md: "eldra:control-h eldra:ps-2.75 eldra:pe-2.5 eldra:text-control eldra:max-md:text-control-mobile",
|
|
@@ -6425,6 +6426,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
6425
6426
|
TRIGGER_BASE$1,
|
|
6426
6427
|
SIZE[props.size],
|
|
6427
6428
|
boxState(),
|
|
6429
|
+
showsInvalid.value && "eldra:eldra-field-invalid",
|
|
6428
6430
|
props.classes?.trigger
|
|
6429
6431
|
]);
|
|
6430
6432
|
/**
|
|
@@ -6445,6 +6447,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
6445
6447
|
FIELD_SIZE[props.size],
|
|
6446
6448
|
showClear.value ? "eldra:pe-15" : "eldra:pe-9",
|
|
6447
6449
|
boxState(),
|
|
6450
|
+
showsInvalid.value && "eldra:eldra-field-invalid",
|
|
6448
6451
|
props.classes?.field
|
|
6449
6452
|
] : "eldra:relative");
|
|
6450
6453
|
/** Inside, the trigger: under the tags across the field, or the placeholder's row with none. */
|
|
@@ -6510,7 +6513,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
6510
6513
|
"data-eldra-ui": "",
|
|
6511
6514
|
"data-eldra-scope": unref(eldra).scope,
|
|
6512
6515
|
"data-part": "root",
|
|
6513
|
-
class: normalizeClass([rootClass
|
|
6516
|
+
class: normalizeClass([rootClass$4, _ctx.$attrs.class])
|
|
6514
6517
|
}, [
|
|
6515
6518
|
createElementVNode("div", {
|
|
6516
6519
|
ref_key: "fieldRef",
|
|
@@ -8147,7 +8150,7 @@ var RECENT_KEY = "eldra-ui:recent-searches";
|
|
|
8147
8150
|
var RECENT_MAX = 5;
|
|
8148
8151
|
var LOADING_DELAY_MS = 300;
|
|
8149
8152
|
var ANNOUNCE_DELAY_MS = 400;
|
|
8150
|
-
var rootClass$
|
|
8153
|
+
var rootClass$3 = "eldra:relative eldra:block eldra:w-full";
|
|
8151
8154
|
// src/components/search-bar/SearchBar.vue
|
|
8152
8155
|
var SearchBar_default = /* @__PURE__ */ defineComponent({
|
|
8153
8156
|
inheritAttrs: false,
|
|
@@ -8776,7 +8779,7 @@ var SearchBar_default = /* @__PURE__ */ defineComponent({
|
|
|
8776
8779
|
"data-eldra-ui": "",
|
|
8777
8780
|
"data-eldra-scope": unref(eldra).scope,
|
|
8778
8781
|
"data-part": "root",
|
|
8779
|
-
class: normalizeClass([rootClass$
|
|
8782
|
+
class: normalizeClass([rootClass$3, _ctx.$attrs.class])
|
|
8780
8783
|
}, [
|
|
8781
8784
|
createElementVNode("form", {
|
|
8782
8785
|
"data-part": "form",
|
|
@@ -8954,6 +8957,20 @@ var _hoisted_9 = { value: "" };
|
|
|
8954
8957
|
var _hoisted_10 = ["label"];
|
|
8955
8958
|
var _hoisted_11 = ["value", "disabled"];
|
|
8956
8959
|
var _hoisted_12 = ["value", "disabled"];
|
|
8960
|
+
var rootClass$2 = "eldra:relative eldra:block eldra:w-full";
|
|
8961
|
+
/**
|
|
8962
|
+
* The trigger box (spec "Select" → Sizes): the same box as `Input`, "so selects and text fields
|
|
8963
|
+
* line up in a row". `eldra-focus` without `-always`: a trigger is a button, and the focus-ring
|
|
8964
|
+
* foundation's pointer-focus exception is for *text fields*, "because a caret alone is easy to
|
|
8965
|
+
* miss". No `transition-*` utility here — `eldra-focus` owns this element's transition list,
|
|
8966
|
+
* including the `duration-fast` border-colour change (see `src/styles/tailwind.css`).
|
|
8967
|
+
*
|
|
8968
|
+
* `eldra-focus-open` is the exception the operator asked for on top of that: a trigger opened with
|
|
8969
|
+
* the pointer is focused but not `:focus-visible`, so the ring stayed hidden while an open popover
|
|
8970
|
+
* hung off it — the control gave no sign that it was the thing the keyboard was about to act on.
|
|
8971
|
+
* The utility keys the ring to this element's own `aria-expanded`, so it needs nothing kept in
|
|
8972
|
+
* sync and closing fades it back out over `eldra-focus`'s own transition.
|
|
8973
|
+
*/
|
|
8957
8974
|
var TRIGGER_BASE = "eldra:flex eldra:w-full eldra:min-w-0 eldra:items-center eldra:gap-2 eldra:text-start eldra:eldra-field-border eldra:rounded-[var(--eldra-field-radius,var(--eldra-radius-md))] eldra:eldra-focus eldra:eldra-focus-open";
|
|
8958
8975
|
var LIVE_FILL$1 = "eldra:bg-background eldra:text-text eldra:cursor-pointer";
|
|
8959
8976
|
var REST = "eldra:border-border-strong eldra:hover:border-text";
|
|
@@ -9258,26 +9275,12 @@ var Select_default = /* @__PURE__ */ defineComponent({
|
|
|
9258
9275
|
listbox.activateFrom(void 0);
|
|
9259
9276
|
});
|
|
9260
9277
|
/**
|
|
9261
|
-
* Spec "Select" → States, Error row: "2px `danger`
|
|
9262
|
-
*
|
|
9263
|
-
*
|
|
9278
|
+
* Spec "Select" → States, Error row: "2px `danger`". The same shape as `Input`: the 1px border
|
|
9279
|
+
* stays on the trigger in every state so the value never moves, and the second line is the
|
|
9280
|
+
* trigger's ring outline at rest (`eldra-field-invalid`). A disabled field drops it — it
|
|
9264
9281
|
* cannot be corrected here — while a read-only one keeps it.
|
|
9265
9282
|
*/
|
|
9266
9283
|
const showsInvalid = computed(() => isInvalid.value && !props.disabled);
|
|
9267
|
-
const rootClass = computed(() => ["eldra:relative eldra:block eldra:w-full", showsInvalid.value && "eldra:eldra-field-invalid"]);
|
|
9268
|
-
/**
|
|
9269
|
-
* The trigger box (spec "Select" → Sizes): the same box as `Input`, "so selects and text fields
|
|
9270
|
-
* line up in a row". `eldra-focus` without `-always`: a trigger is a button, and the focus-ring
|
|
9271
|
-
* foundation's pointer-focus exception is for *text fields*, "because a caret alone is easy to
|
|
9272
|
-
* miss". No `transition-*` utility here — `eldra-focus` owns this element's transition list,
|
|
9273
|
-
* including the `duration-fast` border-colour change (see `src/styles/tailwind.css`).
|
|
9274
|
-
*
|
|
9275
|
-
* `eldra-focus-open` is the exception the operator asked for on top of that: a trigger opened with
|
|
9276
|
-
* the pointer is focused but not `:focus-visible`, so the ring stayed hidden while an open popover
|
|
9277
|
-
* hung off it — the control gave no sign that it was the thing the keyboard was about to act on.
|
|
9278
|
-
* The utility keys the ring to this element's own `aria-expanded`, so it needs nothing kept in
|
|
9279
|
-
* sync and closing fades it back out over `eldra-focus`'s own transition.
|
|
9280
|
-
*/
|
|
9281
9284
|
const SIZE = {
|
|
9282
9285
|
sm: "eldra:control-h-sm eldra:ps-2.25 eldra:pe-2.5 eldra:text-control-sm",
|
|
9283
9286
|
md: "eldra:control-h eldra:ps-2.75 eldra:pe-2.5 eldra:text-control eldra:max-md:text-control-mobile",
|
|
@@ -9299,6 +9302,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
|
|
|
9299
9302
|
TRIGGER_BASE,
|
|
9300
9303
|
SIZE[props.size],
|
|
9301
9304
|
triggerState(),
|
|
9305
|
+
showsInvalid.value && "eldra:eldra-field-invalid",
|
|
9302
9306
|
props.classes?.trigger
|
|
9303
9307
|
]);
|
|
9304
9308
|
const leadingIconClass = computed(() => ["eldra:flex eldra:size-4.5 eldra:shrink-0 eldra:items-center eldra:justify-center eldra:text-muted", props.classes?.leadingIcon]);
|
|
@@ -9343,7 +9347,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
|
|
|
9343
9347
|
"data-eldra-ui": "",
|
|
9344
9348
|
"data-eldra-scope": unref(eldra).scope,
|
|
9345
9349
|
"data-part": "root",
|
|
9346
|
-
class: normalizeClass([rootClass
|
|
9350
|
+
class: normalizeClass([rootClass$2, _ctx.$attrs.class])
|
|
9347
9351
|
}, [
|
|
9348
9352
|
createElementVNode("button", mergeProps({
|
|
9349
9353
|
ref_key: "triggerRef",
|
|
@@ -9605,6 +9609,12 @@ var LIVE_FILL = "eldra:bg-background eldra:text-text";
|
|
|
9605
9609
|
var READONLY_FILL = "eldra:bg-surface eldra:text-text";
|
|
9606
9610
|
var INVALID = "eldra:border-danger eldra:hover:border-danger eldra:focus:border-danger";
|
|
9607
9611
|
var DISABLED = "eldra:bg-surface-strong eldra:border-border eldra:border-dashed eldra:text-muted eldra:cursor-not-allowed";
|
|
9612
|
+
var rootClass$1 = "eldra:relative eldra:block eldra:w-full";
|
|
9613
|
+
/**
|
|
9614
|
+
* `Input`'s prefix and suffix rows, pinned to the first line rather than centred: 0.25rem from the
|
|
9615
|
+
* top puts a 2rem action's middle on the first line's middle (0.5rem padding plus half a 1.5rem
|
|
9616
|
+
* line). The control reserves one action's room on that side, as `Input`'s `md` size does.
|
|
9617
|
+
*/
|
|
9608
9618
|
var ROW = "eldra:absolute eldra:top-1 eldra:flex eldra:h-8 eldra:items-center eldra:gap-1";
|
|
9609
9619
|
// src/components/textarea/Textarea.vue
|
|
9610
9620
|
var Textarea_default = /* @__PURE__ */ defineComponent({
|
|
@@ -9746,18 +9756,6 @@ var Textarea_default = /* @__PURE__ */ defineComponent({
|
|
|
9746
9756
|
const READONLY = `${READONLY_FILL} eldra:border-border`;
|
|
9747
9757
|
/** See Input.vue: the danger boundary drops on a disabled field and stays on a read-only one. */
|
|
9748
9758
|
const showsInvalid = computed(() => isInvalid.value && !props.disabled);
|
|
9749
|
-
/**
|
|
9750
|
-
* `eldra-field-invalid` draws its inset line at the *field's* radius, which it reads from
|
|
9751
|
-
* `--eldra-field-radius` (falling back to the Input's own `--eldra-input-radius`, then to
|
|
9752
|
-
* `radius-md`). A Textarea rounds by `--eldra-textarea-radius`, so it points the line's radius at
|
|
9753
|
-
* that one here rather than letting the line and the border round differently.
|
|
9754
|
-
*/
|
|
9755
|
-
const rootClass = computed(() => ["eldra:relative eldra:block eldra:w-full eldra:[--eldra-field-radius:var(--eldra-textarea-radius,var(--eldra-radius-md))]", showsInvalid.value && "eldra:eldra-field-invalid"]);
|
|
9756
|
-
/**
|
|
9757
|
-
* `Input`'s prefix and suffix rows, pinned to the first line rather than centred: 0.25rem from the
|
|
9758
|
-
* top puts a 2rem action's middle on the first line's middle (0.5rem padding plus half a 1.5rem
|
|
9759
|
-
* line). The control reserves one action's room on that side, as `Input`'s `md` size does.
|
|
9760
|
-
*/
|
|
9761
9759
|
const hasPrefix = computed(() => slots.prefix !== void 0);
|
|
9762
9760
|
/** Shown while there is a value, and never on a field that cannot be edited — as `Input`'s is. */
|
|
9763
9761
|
const showClear = computed(() => props.clearable && !props.disabled && !props.readonly && model.value.length > 0);
|
|
@@ -9786,6 +9784,7 @@ var Textarea_default = /* @__PURE__ */ defineComponent({
|
|
|
9786
9784
|
hasPrefix.value && "eldra:ps-10",
|
|
9787
9785
|
hasSuffix.value && "eldra:pe-10",
|
|
9788
9786
|
props.disabled ? DISABLED : props.readonly ? showsInvalid.value ? `${READONLY_FILL} ${INVALID}` : READONLY : showsInvalid.value ? `${LIVE_FILL} ${INVALID}` : LIVE,
|
|
9787
|
+
showsInvalid.value && "eldra:eldra-field-invalid",
|
|
9789
9788
|
props.classes?.control
|
|
9790
9789
|
]);
|
|
9791
9790
|
/** Spec "Textarea" → Properties, `counter`: shows only once there is something to count against. */
|
|
@@ -9872,7 +9871,7 @@ var Textarea_default = /* @__PURE__ */ defineComponent({
|
|
|
9872
9871
|
"data-eldra-ui": "",
|
|
9873
9872
|
"data-eldra-scope": unref(eldra).scope,
|
|
9874
9873
|
"data-part": "root",
|
|
9875
|
-
class: normalizeClass([rootClass
|
|
9874
|
+
class: normalizeClass([rootClass$1, _ctx.$attrs.class])
|
|
9876
9875
|
}, [
|
|
9877
9876
|
hasPrefix.value ? (openBlock(), createElementBlock("span", {
|
|
9878
9877
|
key: 0,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SkeletonProps, SkeletonVariant } from './types.js';
|
|
2
2
|
declare const __VLS_export: import('vue').DefineComponent<SkeletonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
|
|
3
3
|
size: string;
|
|
4
|
+
height: string;
|
|
4
5
|
classes: Partial<Record<"line", string>>;
|
|
5
6
|
variant: SkeletonVariant;
|
|
6
7
|
width: string;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { ImageRatio } from '../image/types.js';
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Spec "Skeleton" → Properties/Variants, `variant` row: the five shape primitives, plus `box`, one
|
|
4
|
+
* plain shape that is the component itself, for a placeholder of any size (sized by `width`,
|
|
5
|
+
* `height`, `class` or `style`).
|
|
6
|
+
*/
|
|
7
|
+
export type SkeletonVariant = 'text' | 'title' | 'circle' | 'media' | 'btn' | 'box';
|
|
4
8
|
/** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them:
|
|
5
9
|
* the shimmering shape(s) inside the region wrapper — one `line` per text row, or one for every
|
|
6
|
-
* other variant
|
|
10
|
+
* other variant but `box`, which has none (the root is the shape). The root is styled with `class`. */
|
|
7
11
|
export type SkeletonPart = 'line';
|
|
8
12
|
export interface SkeletonProps {
|
|
9
13
|
/** The shape. Defaults to `'text'`. */
|
|
@@ -17,6 +21,12 @@ export interface SkeletonProps {
|
|
|
17
21
|
* renders at the root's full (now definite) width instead of its own default percentage.
|
|
18
22
|
*/
|
|
19
23
|
width?: string;
|
|
24
|
+
/**
|
|
25
|
+
* An explicit height for the whole component, e.g. `'3rem'`. Meant for `box`, whose root is the
|
|
26
|
+
* shape: unset, a box is `--eldra-skeleton-box-height` tall (default `1rem`). On the other
|
|
27
|
+
* variants it sizes the region wrapper only; their shapes keep their own heights.
|
|
28
|
+
*/
|
|
29
|
+
height?: string;
|
|
20
30
|
/** The frame's aspect preset. `media` only. Defaults to `'4x5'` (spec "Skeleton" → Sizes,
|
|
21
31
|
* `media` row — matches the product card's own ratio). See `src/utils/ratio.ts`. */
|
|
22
32
|
ratio?: ImageRatio;
|