@eldrajs/ui 0.2.9 → 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 +13 -0
- package/README.md +171 -151
- package/dist/{VariantPicker-Da41_oGA.js → VariantPicker-DDFlMvgJ.js} +1222 -833
- 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 +3 -3
- package/dist/components/button/ButtonGroup.vue.d.ts +0 -1
- package/dist/components/button/types.d.ts +7 -6
- package/dist/components/card/ContentCard.vue.d.ts +1 -1
- 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 +3 -3
- package/dist/components/checkbox/CheckboxGroup.vue.d.ts +1 -1
- package/dist/components/checkbox/types.d.ts +10 -4
- package/dist/components/chip/Chip.vue.d.ts +1 -1
- 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 +2 -2
- package/dist/components/dialog/types.d.ts +5 -2
- package/dist/components/drawer/Drawer.vue.d.ts +1 -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 +1 -1
- package/dist/components/field-wrapper/types.d.ts +5 -2
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +4 -4
- 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 +6 -6
- package/dist/components/input/classes.d.ts +25 -19
- package/dist/components/input/types.d.ts +5 -2
- package/dist/components/lightbox/Lightbox.vue.d.ts +1 -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 +1 -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/types.d.ts +5 -2
- package/dist/components/popover/Popover.vue.d.ts +1 -1
- package/dist/components/popover/types.d.ts +5 -6
- package/dist/components/price/types.d.ts +3 -2
- package/dist/components/product-card/ProductCard.vue.d.ts +1 -1
- 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 +3 -3
- package/dist/components/radio/RadioGroup.vue.d.ts +3 -3
- package/dist/components/radio/recipes.d.ts +11 -7
- package/dist/components/radio/types.d.ts +11 -5
- package/dist/components/range-slider/RangeSlider.vue.d.ts +1 -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 +3 -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 +2 -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 +5 -5
- package/dist/components/select/Select.vue.d.ts +4 -4
- package/dist/components/select/SelectPanel.vue.d.ts +2 -2
- package/dist/components/select/panelParts.d.ts +21 -20
- package/dist/components/select/types.d.ts +10 -4
- package/dist/components/site-form/SiteForm.vue.d.ts +1 -1
- package/dist/components/site-form/types.d.ts +6 -2
- package/dist/components/skeleton/Skeleton.vue.d.ts +3 -2
- package/dist/components/skeleton/types.d.ts +16 -6
- package/dist/components/switch/Switch.vue.d.ts +2 -2
- package/dist/components/switch/types.d.ts +5 -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 +1 -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/types.d.ts +13 -11
- package/dist/components/textarea/Textarea.vue.d.ts +4 -4
- package/dist/components/textarea/types.d.ts +5 -2
- package/dist/components/toast/types.d.ts +9 -3
- 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 +1481 -2342
- package/dist/composables/useDialog.d.ts +9 -1
- package/dist/composables/useEldraScope.d.ts +7 -9
- package/dist/index.d.ts +5 -6
- package/dist/index.js +1380 -884
- package/dist/style.css +1487 -2348
- package/dist/tailwind.css +11 -2234
- package/dist/theme.css +108 -0
- package/dist/tokens.css +1 -0
- package/dist/utilities.css +2228 -0
- package/dist/utils/mergeClass.d.ts +3 -0
- package/dist/utils/tagRecipe.d.ts +3 -3
- package/dist/vee-validate.js +1 -1
- package/package.json +4 -3
- package/dist/scoped.css +0 -4623
- package/dist/utils/cx.d.ts +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,9 @@ 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.
|
|
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.
|
|
10
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.
|
|
11
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.
|
|
12
15
|
- **`MultiSelect` `tagPlacement: 'inside'`** draws the removable tags in the field, which wraps and grows, with `maxTagRows` (default 2) collapsing the rest into a "+N" tag; new `field` and `tagMore` parts. The default stays `'below'`.
|
|
@@ -69,6 +72,15 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
69
72
|
|
|
70
73
|
### Changed
|
|
71
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.
|
|
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.
|
|
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.
|
|
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.
|
|
81
|
+
- **Breaking: `@eldrajs/ui/scoped.css` is removed**; `components.css` now shares nothing with an app's Tailwind on its own. `provideEldraScope` stays: `data-eldra-scope` and `data-eldra-slot` are theming hooks.
|
|
82
|
+
- **`Button` fits its content by default (`w-fit`).** In a flex column or a grid cell it no longer stretches to the full width; pass `block` for that, or a width class (`w-full`, `w-auto`) in `class`, which wins over `w-fit`. `SiteForm`'s stacked submit keeps its full width below `@two-col`.
|
|
83
|
+
- **Colour changes fade instead of switching.** Hover, selection and other colour changes on every control with a focus ring now run over `--eldra-duration-base` (200ms) with the new `--eldra-ease-in-out` token, instead of `duration-fast` `ease-out`; the press scale stays `duration-fast`. Card title links, facet rows, radio cards, tab indicators and logo wordmarks get the same timing through the new `eldra-transition-colors` utility.
|
|
72
84
|
- **A controlled `Input` or `Textarea` shows its `modelValue`, not what was typed.** After an input event, and after every render, the native value is written back when it differs from the bound value (`Input`'s masked text), so a parent that refuses a keystroke or strips it (`'12a'` → `'12'`), now or on the next tick, sees the field match its model; the caret keeps its distance from the end. A `modelValue` bound without an `update:modelValue` handler now holds the field still, as a native controlled input does. Like `Checkbox`'s and `RadioGroup`'s `checked`.
|
|
73
85
|
- **`ToastVariant` gains `info`**: an exhaustive `Record<ToastVariant, …>` or `switch` over it needs an `info` case.
|
|
74
86
|
- **A ghost `Button` with `pressed`** draws the toggle fill (`surface-strong`, `border-strong`), as `outline` does.
|
|
@@ -139,6 +151,7 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
139
151
|
|
|
140
152
|
### Fixed
|
|
141
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.
|
|
142
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.
|
|
143
156
|
- **`Popover` finds its trigger inside a fragment**, so a wrapper can forward its own `<slot>` into `trigger`.
|
|
144
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.
|