@eldrajs/ui 0.0.0 → 0.1.2
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 +1725 -0
- package/LICENSE +21 -0
- package/README.md +3177 -2
- package/dist/VariantPicker-CKw8hmxt.js +9009 -0
- package/dist/componentNames.d.ts +19 -0
- package/dist/components/accordion/Accordion.vue.d.ts +18 -0
- package/dist/components/accordion/AccordionItem.vue.d.ts +26 -0
- package/dist/components/accordion/context.d.ts +20 -0
- package/dist/components/accordion/detailsExclusivity.d.ts +3 -0
- package/dist/components/accordion/heightTransition.d.ts +59 -0
- package/dist/components/accordion/types.d.ts +40 -0
- package/dist/components/avatar/Avatar.vue.d.ts +10 -0
- package/dist/components/avatar/AvatarGroup.vue.d.ts +7 -0
- package/dist/components/avatar/types.d.ts +61 -0
- package/dist/components/badge/Badge.vue.d.ts +24 -0
- package/dist/components/badge/StockBadge.vue.d.ts +10 -0
- package/dist/components/badge/types.d.ts +79 -0
- package/dist/components/breadcrumb/Breadcrumb.vue.d.ts +10 -0
- package/dist/components/breadcrumb/types.d.ts +53 -0
- package/dist/components/button/Button.vue.d.ts +37 -0
- package/dist/components/button/ButtonGroup.vue.d.ts +17 -0
- package/dist/components/button/types.d.ts +68 -0
- package/dist/components/card/ContentCard.vue.d.ts +36 -0
- package/dist/components/card/FeatureCard.vue.d.ts +27 -0
- package/dist/components/card/cueArrow.d.ts +10 -0
- package/dist/components/card/stretchedLink.d.ts +45 -0
- package/dist/components/card/types.d.ts +92 -0
- package/dist/components/carousel/Carousel.vue.d.ts +39 -0
- package/dist/components/carousel/types.d.ts +75 -0
- package/dist/components/carousel/useCarousel.d.ts +152 -0
- package/dist/components/checkbox/Checkbox.vue.d.ts +36 -0
- package/dist/components/checkbox/CheckboxGroup.vue.d.ts +16 -0
- package/dist/components/checkbox/types.d.ts +78 -0
- package/dist/components/chip/Chip.vue.d.ts +37 -0
- package/dist/components/chip/ChipGroup.vue.d.ts +21 -0
- package/dist/components/chip/context.d.ts +22 -0
- package/dist/components/chip/types.d.ts +84 -0
- package/dist/components/container/Container.vue.d.ts +18 -0
- package/dist/components/container/types.d.ts +17 -0
- package/dist/components/currency-input/CurrencyInput.vue.d.ts +17 -0
- package/dist/components/currency-input/types.d.ts +8 -0
- package/dist/components/dialog/Dialog.vue.d.ts +34 -0
- package/dist/components/dialog/types.d.ts +25 -0
- package/dist/components/drawer/Drawer.vue.d.ts +36 -0
- package/dist/components/drawer/types.d.ts +30 -0
- package/dist/components/empty-state/EditorPlaceholder.vue.d.ts +9 -0
- package/dist/components/empty-state/EmptyState.vue.d.ts +28 -0
- package/dist/components/empty-state/types.d.ts +59 -0
- package/dist/components/field-wrapper/FieldError.vue.d.ts +37 -0
- package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +30 -0
- package/dist/components/field-wrapper/context.d.ts +44 -0
- package/dist/components/field-wrapper/types.d.ts +38 -0
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +48 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +77 -0
- package/dist/components/filter-panel/Histogram.vue.d.ts +15 -0
- package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +20 -0
- package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/shared.d.ts +39 -0
- package/dist/components/filter-panel/northwind.d.ts +32 -0
- package/dist/components/filter-panel/swatchInk.d.ts +50 -0
- package/dist/components/filter-panel/types.d.ts +183 -0
- package/dist/components/filter-panel/useFilterPanel.d.ts +230 -0
- package/dist/components/form-layout/FormLayout.vue.d.ts +36 -0
- package/dist/components/form-layout/context.d.ts +33 -0
- package/dist/components/form-layout/focusInvalid.d.ts +18 -0
- package/dist/components/form-layout/types.d.ts +52 -0
- package/dist/components/icon/Icon.vue.d.ts +8 -0
- package/dist/components/icon/types.d.ts +29 -0
- package/dist/components/image/Image.vue.d.ts +21 -0
- package/dist/components/image/types.d.ts +81 -0
- package/dist/components/input/Input.vue.d.ts +47 -0
- package/dist/components/input/classes.d.ts +110 -0
- package/dist/components/input/types.d.ts +55 -0
- package/dist/components/internal/ValueText.vue.d.ts +7 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +19 -0
- package/dist/components/lightbox/types.d.ts +47 -0
- package/dist/components/link/Link.vue.d.ts +23 -0
- package/dist/components/link/types.d.ts +40 -0
- package/dist/components/load-more/LoadMore.vue.d.ts +12 -0
- package/dist/components/load-more/types.d.ts +21 -0
- package/dist/components/logo-item/LogoItem.vue.d.ts +10 -0
- package/dist/components/logo-item/types.d.ts +37 -0
- package/dist/components/pagination/Pagination.vue.d.ts +15 -0
- package/dist/components/pagination/types.d.ts +51 -0
- package/dist/components/popover/Popover.vue.d.ts +31 -0
- package/dist/components/popover/types.d.ts +53 -0
- package/dist/components/price/Price.vue.d.ts +25 -0
- package/dist/components/price/types.d.ts +104 -0
- package/dist/components/product-card/ProductCard.vue.d.ts +22 -0
- package/dist/components/product-card/types.d.ts +123 -0
- package/dist/components/quantity-stepper/QuantityStepper.vue.d.ts +26 -0
- package/dist/components/quantity-stepper/types.d.ts +35 -0
- package/dist/components/radio/RadioGroup.vue.d.ts +38 -0
- package/dist/components/radio/types.d.ts +39 -0
- package/dist/components/range-slider/RangeSlider.vue.d.ts +70 -0
- package/dist/components/range-slider/types.d.ts +151 -0
- package/dist/components/range-slider/useRangeSlider.d.ts +106 -0
- package/dist/components/rating/Rating.vue.d.ts +22 -0
- package/dist/components/rating/RatingStars.vue.d.ts +16 -0
- package/dist/components/rating/types.d.ts +45 -0
- package/dist/components/search-bar/SearchBar.vue.d.ts +47 -0
- package/dist/components/search-bar/SearchResultsPanel.vue.d.ts +93 -0
- package/dist/components/search-bar/shortcutOwner.d.ts +39 -0
- package/dist/components/search-bar/types.d.ts +122 -0
- package/dist/components/search-modal/SearchModal.vue.d.ts +53 -0
- package/dist/components/search-modal/types.d.ts +59 -0
- package/dist/components/section/Section.vue.d.ts +21 -0
- package/dist/components/section/context.d.ts +23 -0
- package/dist/components/section/types.d.ts +34 -0
- package/dist/components/select/MultiSelect.vue.d.ts +62 -0
- package/dist/components/select/Select.vue.d.ts +57 -0
- package/dist/components/select/SelectPanel.vue.d.ts +97 -0
- package/dist/components/select/openRegistry.d.ts +11 -0
- package/dist/components/select/panelParts.d.ts +91 -0
- package/dist/components/select/types.d.ts +129 -0
- package/dist/components/select/useListbox.d.ts +106 -0
- package/dist/components/select/useOptionList.d.ts +61 -0
- package/dist/components/select/usePopover.d.ts +147 -0
- package/dist/components/skeleton/Skeleton.vue.d.ts +12 -0
- package/dist/components/skeleton/types.d.ts +38 -0
- package/dist/components/spinner/Spinner.vue.d.ts +3 -0
- package/dist/components/switch/Switch.vue.d.ts +30 -0
- package/dist/components/switch/types.d.ts +20 -0
- package/dist/components/tabs/Tab.vue.d.ts +17 -0
- package/dist/components/tabs/TabPanel.vue.d.ts +16 -0
- package/dist/components/tabs/Tabs.vue.d.ts +28 -0
- package/dist/components/tabs/context.d.ts +48 -0
- package/dist/components/tabs/types.d.ts +63 -0
- package/dist/components/textarea/Textarea.vue.d.ts +27 -0
- package/dist/components/textarea/supportsFieldSizing.d.ts +10 -0
- package/dist/components/textarea/types.d.ts +32 -0
- package/dist/components/toast/Toast.vue.d.ts +16 -0
- package/dist/components/toast/Toaster.vue.d.ts +13 -0
- package/dist/components/toast/types.d.ts +44 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +9 -0
- package/dist/components/tooltip/supportsFocusVisible.d.ts +17 -0
- package/dist/components/tooltip/types.d.ts +46 -0
- package/dist/components/unit-input/UnitInput.vue.d.ts +55 -0
- package/dist/components/unit-input/types.d.ts +68 -0
- package/dist/components/unit-input/undo-redo.d.ts +6 -0
- package/dist/components/variant-picker/VariantPicker.vue.d.ts +15 -0
- package/dist/components/variant-picker/types.d.ts +49 -0
- package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +18 -0
- package/dist/components/visually-hidden/types.d.ts +14 -0
- package/dist/composables/dialogStack.d.ts +52 -0
- package/dist/composables/teleportTarget.d.ts +79 -0
- package/dist/composables/useControllableModel.d.ts +16 -0
- package/dist/composables/useDialog.d.ts +84 -0
- package/dist/composables/useFloating.d.ts +82 -0
- package/dist/composables/useHeadingTag.d.ts +24 -0
- package/dist/composables/useLocale.d.ts +81 -0
- package/dist/composables/useMessages.d.ts +30 -0
- package/dist/composables/useOverlay.d.ts +88 -0
- package/dist/composables/useSlotPresence.d.ts +29 -0
- package/dist/composables/useToast.d.ts +53 -0
- package/dist/icons/paths.d.ts +10 -0
- package/dist/index.d.ts +135 -0
- package/dist/index.js +12587 -0
- package/dist/listFormat-1UrH38f2.js +39 -0
- package/dist/messages/en-US.d.ts +485 -0
- package/dist/messages/index.d.ts +2 -0
- package/dist/messages/is-IS.d.ts +16 -0
- package/dist/messages/is-IS.js +169 -0
- package/dist/resolver.d.ts +43 -0
- package/dist/resolver.js +121 -0
- package/dist/style.css +5259 -0
- package/dist/tailwind.css +2057 -0
- package/dist/tokens.css +134 -0
- package/dist/utils/avatar.d.ts +15 -0
- package/dist/utils/color.d.ts +11 -0
- package/dist/utils/cssTiming.d.ts +40 -0
- package/dist/utils/cx.d.ts +31 -0
- package/dist/utils/date.d.ts +45 -0
- package/dist/utils/id.d.ts +36 -0
- package/dist/utils/listFormat.d.ts +22 -0
- package/dist/utils/mask.d.ts +48 -0
- package/dist/utils/number-format.d.ts +250 -0
- package/dist/utils/numeric-input.d.ts +42 -0
- package/dist/utils/rating.d.ts +26 -0
- package/dist/utils/ratio.d.ts +18 -0
- package/dist/utils/tagRecipe.d.ts +24 -0
- package/dist/utils/valueFade.d.ts +42 -0
- package/dist/vee-validate/FieldCheckbox.vue.d.ts +14 -0
- package/dist/vee-validate/FieldCheckboxGroup.vue.d.ts +14 -0
- package/dist/vee-validate/FieldCurrencyInput.vue.d.ts +14 -0
- package/dist/vee-validate/FieldInput.vue.d.ts +14 -0
- package/dist/vee-validate/FieldMultiSelect.vue.d.ts +14 -0
- package/dist/vee-validate/FieldQuantityStepper.vue.d.ts +14 -0
- package/dist/vee-validate/FieldRadioGroup.vue.d.ts +14 -0
- package/dist/vee-validate/FieldSearchBar.vue.d.ts +14 -0
- package/dist/vee-validate/FieldSelect.vue.d.ts +14 -0
- package/dist/vee-validate/FieldSwitch.vue.d.ts +14 -0
- package/dist/vee-validate/FieldTextarea.vue.d.ts +14 -0
- package/dist/vee-validate/FieldUnitInput.vue.d.ts +14 -0
- package/dist/vee-validate/FieldVariantPicker.vue.d.ts +14 -0
- package/dist/vee-validate/Form.vue.d.ts +27 -0
- package/dist/vee-validate/context.d.ts +48 -0
- package/dist/vee-validate/index.d.ts +27 -0
- package/dist/vee-validate/types.d.ts +115 -0
- package/dist/vee-validate/useFieldControl.d.ts +67 -0
- package/dist/vee-validate.js +1154 -0
- package/package.json +99 -2
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Where the panel goes.
|
|
4
|
+
*
|
|
5
|
+
* `auto` and `above` are the design spec's own words (Select and Multi-select take
|
|
6
|
+
* `placement: "auto" | "above"`): `auto` opens below and flips above when there is no room, and
|
|
7
|
+
* `above` always opens above — the footer's selectors, where below is off-screen by definition. The
|
|
8
|
+
* remaining values are `@floating-ui/dom` placements for anything that wants to be explicit —
|
|
9
|
+
* `top-end`/`bottom-end` are `Tooltip`'s own `align="end"`, added alongside the `-start` pair
|
|
10
|
+
* already here for `align="start"`.
|
|
11
|
+
*/
|
|
12
|
+
export type FloatingPlacement = 'auto' | 'above' | 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end';
|
|
13
|
+
export interface UseFloatingOptions {
|
|
14
|
+
/** Default `'auto'` — below, flipping above when it does not fit. */
|
|
15
|
+
placement?: FloatingPlacement;
|
|
16
|
+
/** Gap between the reference and the panel, in pixels. Default `4` (the spec's 0.25rem). */
|
|
17
|
+
offset?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Tie the panel's width to the reference's.
|
|
20
|
+
*
|
|
21
|
+
* `true` adds a `minWidth` equal to the reference's, so a panel is never narrower than the
|
|
22
|
+
* control it belongs to — a *minimum* rather than a fixed width, because that is what the Select
|
|
23
|
+
* spec asks for: "Min width = trigger, grows to fit its content up to min(22rem, 90vw)", where
|
|
24
|
+
* the upper clamp is the panel's own `max-width` rather than anything this composable sets.
|
|
25
|
+
*
|
|
26
|
+
* `'exact'` adds a `maxWidth` to match, for a panel whose spec says it *matches* its control —
|
|
27
|
+
* the Search bar's results panel ("Matches the field's width"). It has to be said rather than
|
|
28
|
+
* inherited: a panel positioned against the viewport has the viewport as its containing block,
|
|
29
|
+
* so nothing else would stop it growing to the full width of the window.
|
|
30
|
+
*/
|
|
31
|
+
matchWidth?: boolean | 'exact';
|
|
32
|
+
/** Override the flipping that the placement implies: on for `auto`, off for `above`. */
|
|
33
|
+
flip?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Which coordinate space the returned `top`/`left` are in, and the `position` they come with.
|
|
36
|
+
* Default `'absolute'` — the panel is positioned against its nearest positioned ancestor, which
|
|
37
|
+
* is what a panel rendered inside its own control needs.
|
|
38
|
+
*
|
|
39
|
+
* `'fixed'` is for a panel that has been moved out of the control's subtree (a `<Teleport>` to
|
|
40
|
+
* `body`): coordinates are then relative to the **viewport**, so nothing between the control and
|
|
41
|
+
* the page root — a scrolled column, a transformed card — can shift the panel off its trigger.
|
|
42
|
+
* `autoUpdate` keeps it aligned either way: it observes every scrollable ancestor of the
|
|
43
|
+
* reference (`ancestorScroll`), the window (`ancestorResize`), and both elements' own sizes,
|
|
44
|
+
* so a panel fixed to the viewport still follows a trigger that scrolls under it.
|
|
45
|
+
*/
|
|
46
|
+
strategy?: 'absolute' | 'fixed';
|
|
47
|
+
}
|
|
48
|
+
export interface UseFloatingReturn {
|
|
49
|
+
/**
|
|
50
|
+
* Inline styles for the panel: `position`, `top`, `left`, and — under `matchWidth` — `minWidth`,
|
|
51
|
+
* plus `maxWidth` when it is `'exact'`.
|
|
52
|
+
*/
|
|
53
|
+
styles: ComputedRef<Record<string, string>>;
|
|
54
|
+
/** The placement actually used, after flipping. */
|
|
55
|
+
placement: ComputedRef<string>;
|
|
56
|
+
/** Reposition now. Positions are kept current automatically while both elements are mounted. */
|
|
57
|
+
update(): void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Positions a floating panel against the element that opened it — the one piece of every popup in
|
|
61
|
+
* this package that has to measure the page.
|
|
62
|
+
*
|
|
63
|
+
* It is a thin wrap of `@floating-ui/vue`: `autoUpdate` keeps the position current while both
|
|
64
|
+
* elements are mounted (scrolling, resizing, an ancestor moving), `offset` sets the gap, `flip`
|
|
65
|
+
* turns the panel above the trigger when there is no room below, `shift` keeps it inside the
|
|
66
|
+
* viewport, and `size` measures the trigger for `matchWidth` (a floor on the panel's width — the
|
|
67
|
+
* spec lets a select's panel grow past its trigger up to its own `max-width` — or a floor and a
|
|
68
|
+
* ceiling under `'exact'`). What the wrap adds is the design spec's vocabulary (`auto` / `above`)
|
|
69
|
+
* and a plain style object rather than a transform, so a consumer writes `<div :style="styles">`
|
|
70
|
+
* and nothing else.
|
|
71
|
+
*
|
|
72
|
+
* `top` and `left` are used instead of the default `transform`, because a panel positioned by
|
|
73
|
+
* transform is blurry on fractional pixels and, more to the point, cannot then use `transform` for
|
|
74
|
+
* the spec's own open animation (fade + 0.25rem slide + a vertical scale from the top edge).
|
|
75
|
+
*
|
|
76
|
+
* ```ts
|
|
77
|
+
* const trigger = ref<HTMLElement | null>(null);
|
|
78
|
+
* const panel = ref<HTMLElement | null>(null);
|
|
79
|
+
* const { styles, placement } = useFloating(trigger, panel, { matchWidth: true });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function useFloating(reference: Ref<HTMLElement | null>, floating: Ref<HTMLElement | null>, options?: UseFloatingOptions): UseFloatingReturn;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* The heading levels a component's own title can take under whatever heading its surrounding
|
|
4
|
+
* block already put on the page (spec: "follows the block") — `2` through `6`, never `1`: a
|
|
5
|
+
* component never claims the page's own top-level heading for itself. Shared by every component
|
|
6
|
+
* whose `headingLevel` prop picks a `<component :is="\`h${level}\`">` tag: `ContentCard`,
|
|
7
|
+
* `FeatureCard`, `ProductCard`, `EmptyState`. `FormLayout`'s own `FormLayoutHeadingLevel` (`2 | 3 |
|
|
8
|
+
* 4`, narrower — a form's own title realistically never sits six levels deep) is declared as a
|
|
9
|
+
* subtype of this one rather than a separate, unrelated union.
|
|
10
|
+
*/
|
|
11
|
+
export type HeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
12
|
+
/**
|
|
13
|
+
* Turns a `headingLevel` prop into the tag name `<component :is>` renders — pulled out of the five
|
|
14
|
+
* components that each redeclared the identical `computed(() => \`h${props.headingLevel}\`)`
|
|
15
|
+
* (`ContentCard`, `FeatureCard`, `ProductCard`, `EmptyState`, `FormLayout`) so the one-line mapping
|
|
16
|
+
* lives once. Takes a ref/getter, not the level itself, so the returned tag name stays reactive to
|
|
17
|
+
* a `headingLevel` prop changing after mount, the same way each component's own inline `computed`
|
|
18
|
+
* already did.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* const headingTag = useHeadingTag(() => props.headingLevel);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function useHeadingTag(level: MaybeRefOrGetter<HeadingLevel>): ComputedRef<`h${HeadingLevel}`>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* The number locale the components format with, as a provide/inject pair — the same shape as
|
|
4
|
+
* `useMessages`, and deliberately separate from it: the *strings* a component renders and the
|
|
5
|
+
* *locale its numbers are formatted in* are two different decisions, and a store that accepts the
|
|
6
|
+
* English defaults may still be an Icelandic shop.
|
|
7
|
+
*
|
|
8
|
+
* It is an ambient default, never an answer: every component that reads it also takes a `locale`
|
|
9
|
+
* prop, and the prop wins. With nothing provided the components format in `en-US`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_UI_LOCALE = "en-US";
|
|
12
|
+
/**
|
|
13
|
+
* The injection key the locale provider writes to. Exported so an app can set the locale from
|
|
14
|
+
* outside a `setup()` scope — and so it can provide a **getter**, which is what makes a locale
|
|
15
|
+
* switch reactive without an effect that outlives a server request:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { LOCALE_KEY } from '@eldrajs/ui';
|
|
19
|
+
* app.provide(LOCALE_KEY, () => store.locale);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const LOCALE_KEY: InjectionKey<MaybeRefOrGetter<string | undefined>>;
|
|
23
|
+
/**
|
|
24
|
+
* Set the number locale for this component and everything below it.
|
|
25
|
+
*
|
|
26
|
+
* Wraps Vue's `provide`, so it must be called during `setup()`. Use
|
|
27
|
+
* `app.provide(LOCALE_KEY, locale)` for the app-wide case.
|
|
28
|
+
*/
|
|
29
|
+
export declare function provideEldraUiLocale(locale: MaybeRefOrGetter<string | undefined>): void;
|
|
30
|
+
/**
|
|
31
|
+
* The locale a component should format numbers in: whatever an ancestor provided, else `en-US`.
|
|
32
|
+
* A ref or a getter is unwrapped on every read, so the value follows a locale switch.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useEldraUiLocale(): ComputedRef<string>;
|
|
35
|
+
/**
|
|
36
|
+
* The injection key the store currency is provided under (spec "Price" → Properties, `currency`
|
|
37
|
+
* row: "store currency") — the same provide/inject shape as `LOCALE_KEY` and deliberately separate
|
|
38
|
+
* from it: a store's number locale and its currency are two different decisions (an
|
|
39
|
+
* `en-US`-formatted store may still sell in `ISK`). It is an ambient default, never an answer:
|
|
40
|
+
* every component that reads it also takes a `currency` prop, and the prop wins. **With nothing
|
|
41
|
+
* provided there is no currency at all** — see `useEldraUiCurrency` for what the components then
|
|
42
|
+
* render, and why this pair has no default code.
|
|
43
|
+
*
|
|
44
|
+
* Exported so an app can set the currency from
|
|
45
|
+
* outside a `setup()` scope — and so it can provide a **getter**, which is what makes a currency
|
|
46
|
+
* switch reactive without an effect that outlives a server request:
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { CURRENCY_KEY } from '@eldrajs/ui';
|
|
50
|
+
* app.provide(CURRENCY_KEY, () => store.currency);
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* Providing `undefined` is meaningful and different from not providing at all: it says the store
|
|
54
|
+
* has **no** currency, which is the answer a platform that has not been told one must be able to
|
|
55
|
+
* give. Vue's `inject` consults `key in provides`, so the two cases stay distinguishable (see
|
|
56
|
+
* `useEldraUiCurrency`).
|
|
57
|
+
*/
|
|
58
|
+
export declare const CURRENCY_KEY: InjectionKey<MaybeRefOrGetter<string | undefined>>;
|
|
59
|
+
/**
|
|
60
|
+
* Set the store currency for this component and everything below it.
|
|
61
|
+
*
|
|
62
|
+
* Wraps Vue's `provide`, so it must be called during `setup()`. Use
|
|
63
|
+
* `app.provide(CURRENCY_KEY, currency)` for the app-wide case.
|
|
64
|
+
*/
|
|
65
|
+
export declare function provideEldraUiCurrency(currency: MaybeRefOrGetter<string | undefined>): void;
|
|
66
|
+
/**
|
|
67
|
+
* The currency a component should format money in: whatever an ancestor provided, else **nothing**.
|
|
68
|
+
* A ref or a getter is unwrapped on every read, so the value follows a currency switch.
|
|
69
|
+
*
|
|
70
|
+
* **There is no default code.** A component library installed by a shop of any kind cannot guess
|
|
71
|
+
* one: a `USD` fallback puts a dollar sign in front of krónur, and a wrong price is worse than an
|
|
72
|
+
* incomplete one. So `undefined` comes back whenever there is no currency to name, and a component
|
|
73
|
+
* reading it formats the amount as a plain number through the same `Intl` path, with no symbol and
|
|
74
|
+
* no code (`Price` does exactly that). The empty string is read as "no currency" too: it is not a
|
|
75
|
+
* code `Intl` accepts, and it was the only way to decline one while this composable still defaulted.
|
|
76
|
+
*
|
|
77
|
+
* Two ways to arrive at `undefined`, and only one of them is a mistake. A provider that supplies
|
|
78
|
+
* `undefined` (or `''`) has *answered* — this store has no currency — and nothing is logged. Having
|
|
79
|
+
* no provider at all is unwired, and warns once per session in dev.
|
|
80
|
+
*/
|
|
81
|
+
export declare function useEldraUiCurrency(): ComputedRef<string | undefined>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { UiMessages } from '../messages/en-US.js';
|
|
3
|
+
export type { UiMessages };
|
|
4
|
+
/**
|
|
5
|
+
* The injection key the messages provider writes to. Exported so an app can
|
|
6
|
+
* set the messages from outside a `setup()` scope:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { MESSAGES_KEY } from '@eldrajs/ui';
|
|
10
|
+
* import { isIS } from '@eldrajs/ui/messages/is-IS';
|
|
11
|
+
* app.provide(MESSAGES_KEY, isIS);
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const MESSAGES_KEY: InjectionKey<Partial<UiMessages>>;
|
|
15
|
+
/**
|
|
16
|
+
* Set the message overrides for this component and everything below it.
|
|
17
|
+
*
|
|
18
|
+
* Wraps Vue's `provide`, so it must be called during `setup()`. Use
|
|
19
|
+
* `app.provide(MESSAGES_KEY, messages)` for the app-wide case.
|
|
20
|
+
*/
|
|
21
|
+
export declare function provideEldraUiMessages(messages: Partial<UiMessages>): void;
|
|
22
|
+
/**
|
|
23
|
+
* The messages a component should render, resolved in precedence order:
|
|
24
|
+
* the English defaults, then whatever an ancestor provided, then the
|
|
25
|
+
* component's own `messages` prop.
|
|
26
|
+
*
|
|
27
|
+
* No i18n library is involved; a store either accepts English, imports
|
|
28
|
+
* `@eldrajs/ui/messages/is-IS`, or passes its own strings.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useMessages(override?: MaybeRefOrGetter<Partial<UiMessages> | undefined>): ComputedRef<UiMessages>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Marks an element that belongs to an overlay whose content element has this `id`.
|
|
4
|
+
*
|
|
5
|
+
* Exported for `usePopover`, which has to find those elements rather than only recognise one it is
|
|
6
|
+
* handed: a teleported panel's `Tab` walk runs through them (see its `tabRedirect` option).
|
|
7
|
+
*/
|
|
8
|
+
export declare const OVERLAY_OWNER_ATTRIBUTE = "data-eldra-overlay-owner";
|
|
9
|
+
export interface UseOverlayOptions {
|
|
10
|
+
/** Whether the overlay is showing. Owned by the consumer; this composable only reads it. */
|
|
11
|
+
open: Ref<boolean>;
|
|
12
|
+
/** The element that opens the overlay, and the element focus goes back to. */
|
|
13
|
+
trigger: Ref<HTMLElement | null>;
|
|
14
|
+
/** The popup itself. Give it an `id` if any part of it is teleported (see below). */
|
|
15
|
+
content: Ref<HTMLElement | null>;
|
|
16
|
+
/** Asked to close. The consumer writes `open`; nothing here does. */
|
|
17
|
+
setOpen: (open: boolean) => void;
|
|
18
|
+
/** Close when a pointer press, or focus, lands outside the overlay. Default `true`. */
|
|
19
|
+
closeOnOutsideClick?: boolean;
|
|
20
|
+
/** Close on `Escape`. Default `true`. */
|
|
21
|
+
closeOnEscape?: boolean;
|
|
22
|
+
/** Put focus back on the trigger when closing would otherwise lose it. Default `true`. */
|
|
23
|
+
returnFocus?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface UseOverlayReturn {
|
|
26
|
+
/** Ask the consumer to close. */
|
|
27
|
+
close(): void;
|
|
28
|
+
/** Focus the first focusable element inside the content, if there is one. */
|
|
29
|
+
focusFirst(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Every element in the tab sequence inside `root`, in document order, plus `root` itself when it
|
|
32
|
+
* is one. Defaults to the content, which is what `focusFirst` walks.
|
|
33
|
+
*
|
|
34
|
+
* The argument is for an overlay whose parts are not all in one element — a teleported panel and
|
|
35
|
+
* the trigger-side controls that belong to it — so that one answer to "what is a tab stop" serves
|
|
36
|
+
* both halves.
|
|
37
|
+
*/
|
|
38
|
+
focusables(root?: HTMLElement | null): HTMLElement[];
|
|
39
|
+
/**
|
|
40
|
+
* Whether a node counts as part of this overlay: the trigger, the content, or anything under an
|
|
41
|
+
* element carrying `data-eldra-overlay-owner="<the content's id>"`.
|
|
42
|
+
*
|
|
43
|
+
* The same question the closing rules ask themselves, exposed because a consumer moving focus
|
|
44
|
+
* around a teleported overlay has to ask it too — `usePopover`'s `Tab` walk decides from it
|
|
45
|
+
* whether focus is still inside the control or has left it.
|
|
46
|
+
*/
|
|
47
|
+
isInside(node: EventTarget | null): boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The closing and focus rules shared by every **non-modal** popup in this package — the Select and
|
|
51
|
+
* Multi-select panels, the Search bar's results panel, menus.
|
|
52
|
+
*
|
|
53
|
+
* Non-modal is the whole point. The design spec's non-negotiables put every *modal* surface in a
|
|
54
|
+
* native `<dialog>` opened with `showModal()`, and say in the same breath that these popups are not
|
|
55
|
+
* dialogs: "Non-modal popups (select panels, search results panel, mega-menus, tooltips) are **not**
|
|
56
|
+
* dialogs." So there is no focus trap here and no `Tab` cycling — `Tab` simply moves on, and focus
|
|
57
|
+
* landing outside is what closes the popup (WCAG 2.1.2: no keyboard trap). Everything this
|
|
58
|
+
* composable does is close at the right moment and leave focus somewhere sensible.
|
|
59
|
+
*
|
|
60
|
+
* What it listens for, and only while `open` is `true`:
|
|
61
|
+
*
|
|
62
|
+
* - **A pointer press outside** (`pointerdown`, captured, so a handler inside the page that stops
|
|
63
|
+
* propagation cannot hide the press from us). Inside is the trigger, the content, and anything
|
|
64
|
+
* under an element carrying `data-eldra-overlay-owner="<the content's id>"` — which is how a
|
|
65
|
+
* panel rendered through a `<Teleport>` still counts as part of the overlay. Closing this way
|
|
66
|
+
* never moves focus: the user is pressing something else, and pulling focus back to the trigger
|
|
67
|
+
* would take it off whatever they just pressed.
|
|
68
|
+
* - **Focus leaving** (`focusout`). If the new focus owner is outside the overlay, the popup
|
|
69
|
+
* closes and focus stays where the user sent it. If focus went *nowhere* (`relatedTarget` is
|
|
70
|
+
* `null` — the content is about to be removed from under it), `returnFocus` puts it back on the
|
|
71
|
+
* trigger rather than letting it fall to `<body>`.
|
|
72
|
+
* - **`Escape`** (`keydown`, bubbling, so a component that wants the first go at `Escape` — the
|
|
73
|
+
* Select clears its search query before it closes — can handle it and stop propagation). It
|
|
74
|
+
* closes, returns focus to the trigger, and both `preventDefault()`s and stops propagation: a
|
|
75
|
+
* popup inside a native `<dialog>` must consume the key, or the dialog closes behind it.
|
|
76
|
+
*
|
|
77
|
+
* Listeners go on `document` when the overlay opens and come off when it closes or the scope is
|
|
78
|
+
* disposed, so a closed overlay costs nothing and an unmounted one leaves nothing behind. Nothing
|
|
79
|
+
* touches the DOM during SSR.
|
|
80
|
+
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* const open = ref(false);
|
|
83
|
+
* const trigger = ref<HTMLElement | null>(null);
|
|
84
|
+
* const content = ref<HTMLElement | null>(null);
|
|
85
|
+
* const overlay = useOverlay({ open, trigger, content, setOpen: (next) => (open.value = next) });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function useOverlay(options: UseOverlayOptions): UseOverlayReturn;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ShallowRef, Slots } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Which of the named slots the component currently has content for — reactively.
|
|
4
|
+
*
|
|
5
|
+
* **Slots are not reactive in Vue.** `instance.slots` is a plain object the parent mutates in
|
|
6
|
+
* place, so `computed(() => slots.error !== undefined)` caches whatever was true when it first ran
|
|
7
|
+
* and never invalidates. A `<template #error v-if="failed">` toggled after mount therefore left a
|
|
8
|
+
* `FieldWrapper` describing a state the markup no longer had — the field stayed valid while the
|
|
9
|
+
* error was on screen — and the same defect was sitting, unnoticed, in `FormLayout`'s
|
|
10
|
+
* `hasActions`/`hasErrorSummary`.
|
|
11
|
+
*
|
|
12
|
+
* Reading them in the template (`$slots.error`) fixes the `v-if` and nothing else: anything the
|
|
13
|
+
* component *derives* from a slot — an `aria-describedby`, a provided context — still needs a
|
|
14
|
+
* reactive source. So the presence of each named slot is re-read from the live slots object in
|
|
15
|
+
* `onBeforeUpdate`, which Vue runs after it has swapped the new slots in and before the component
|
|
16
|
+
* renders: the template and everything derived from it see the slots this render actually has.
|
|
17
|
+
*
|
|
18
|
+
* The write is guarded on a real change, so a re-render for any other reason costs nothing.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* const slots = useSlots();
|
|
22
|
+
* const present = useSlotPresence(slots, ['error', 'help'] as const);
|
|
23
|
+
* const hasError = computed(() => Boolean(props.error) || present.value.error);
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Internal: every component in this package that branches on a slot uses it, so the defect cannot
|
|
27
|
+
* be reintroduced one component at a time. Like every composable it must be called from `setup()`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useSlotPresence<Name extends string>(slots: Slots, names: readonly Name[]): Readonly<ShallowRef<Record<Name, boolean>>>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ToastAction, ToastVariant } from '../components/toast/types.js';
|
|
3
|
+
export interface ToastOptions {
|
|
4
|
+
/** Icon, colour and default auto-dismiss timing. Default `"success"`. */
|
|
5
|
+
variant?: ToastVariant;
|
|
6
|
+
/** The message. Required — the meaning is always in this text. */
|
|
7
|
+
title: string;
|
|
8
|
+
/** One supporting line. */
|
|
9
|
+
text?: string;
|
|
10
|
+
/** One action: a link (`{ label, href }`) or a button (`{ label, onActivate }`). */
|
|
11
|
+
action?: ToastAction;
|
|
12
|
+
/** Auto-dismiss time in ms; `0` stays until closed. Ignored for `variant: "danger"` — it is
|
|
13
|
+
* always `0` (spec "Toast" -> Properties, `duration` row: "Danger is always `0`."). Defaults to
|
|
14
|
+
* the variant's own timing (see `DEFAULT_DURATION` below) when omitted. */
|
|
15
|
+
duration?: number;
|
|
16
|
+
/** Dedupe key: a new toast raised with an `id` already in the queue replaces that toast in
|
|
17
|
+
* place (same position, a fresh full-length timer) rather than adding a second one. */
|
|
18
|
+
id?: string;
|
|
19
|
+
}
|
|
20
|
+
/** A resolved, queued toast — what `Toaster`/`Toast` actually render. Every optional field of
|
|
21
|
+
* `ToastOptions` this carries forward stays optional; `id`, `variant` and `duration` are always
|
|
22
|
+
* resolved (never `undefined`) by the time an item reaches the queue. */
|
|
23
|
+
export interface ToastItem {
|
|
24
|
+
id: string;
|
|
25
|
+
variant: ToastVariant;
|
|
26
|
+
title: string;
|
|
27
|
+
text?: string;
|
|
28
|
+
action?: ToastAction;
|
|
29
|
+
duration: number;
|
|
30
|
+
}
|
|
31
|
+
export interface UseToastReturn {
|
|
32
|
+
/** Raises a toast, returning its id (generated unless `options.id` is given) — hand it to a
|
|
33
|
+
* later `dismiss` to close it early, e.g. once the "Try again" it offered has finished. */
|
|
34
|
+
show(options: ToastOptions): string;
|
|
35
|
+
/** Closes a toast immediately, if it is still in the queue. */
|
|
36
|
+
dismiss(id: string): void;
|
|
37
|
+
/** Empties the queue. */
|
|
38
|
+
clear(): void;
|
|
39
|
+
/** The live queue `Toaster` renders — read-only from here; `Toaster` alone removes a toast
|
|
40
|
+
* whose own timer has run out (see its doc comment). */
|
|
41
|
+
toasts: Readonly<Ref<ToastItem[]>>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The toast queue (design spec "Toast"). `show`/`dismiss`/`clear` mutate the one module-level
|
|
45
|
+
* queue every call to `useToast()` shares — see the store's own comment above for why this is not
|
|
46
|
+
* a `provide`d instance. `toasts` is what a `Toaster` renders.
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* const toast = useToast();
|
|
50
|
+
* toast.show({ variant: 'success', title: 'Added to cart', action: { label: 'View cart (3)', href: '/cart' } });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function useToast(): UseToastReturn;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline SVG path data for a handful of Tabler icons this package draws directly rather than
|
|
3
|
+
* depending on `@tabler/icons-vue` at runtime (the same decision `StockBadge.vue`'s own comment
|
|
4
|
+
* records for `Button`'s spinner) — copied verbatim from `@tabler/icons-vue`'s "outline" 24x24
|
|
5
|
+
* viewBox icons, MIT licensed. Each consumer keeps its own stroke width; only the path data (the
|
|
6
|
+
* one thing that must stay byte-identical to read as the same icon) lives here, shared rather than
|
|
7
|
+
* duplicated — `StockBadge`'s `low`/`error` icon and `EmptyState`'s own `error` default icon are
|
|
8
|
+
* the same `alert-triangle` glyph.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ALERT_TRIANGLE_PATHS: string[];
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export { default as Accordion } from './components/accordion/Accordion.vue.js';
|
|
2
|
+
export { default as AccordionItem } from './components/accordion/AccordionItem.vue.js';
|
|
3
|
+
export { default as Avatar } from './components/avatar/Avatar.vue.js';
|
|
4
|
+
export { default as AvatarGroup } from './components/avatar/AvatarGroup.vue.js';
|
|
5
|
+
export { default as Badge } from './components/badge/Badge.vue.js';
|
|
6
|
+
export { default as Breadcrumb } from './components/breadcrumb/Breadcrumb.vue.js';
|
|
7
|
+
export { default as Button } from './components/button/Button.vue.js';
|
|
8
|
+
export { default as ButtonGroup } from './components/button/ButtonGroup.vue.js';
|
|
9
|
+
export { default as Carousel } from './components/carousel/Carousel.vue.js';
|
|
10
|
+
export { default as Checkbox } from './components/checkbox/Checkbox.vue.js';
|
|
11
|
+
export { default as CheckboxGroup } from './components/checkbox/CheckboxGroup.vue.js';
|
|
12
|
+
export { default as Chip } from './components/chip/Chip.vue.js';
|
|
13
|
+
export { default as ChipGroup } from './components/chip/ChipGroup.vue.js';
|
|
14
|
+
export { default as Container } from './components/container/Container.vue.js';
|
|
15
|
+
export { default as ContentCard } from './components/card/ContentCard.vue.js';
|
|
16
|
+
export { default as CurrencyInput } from './components/currency-input/CurrencyInput.vue.js';
|
|
17
|
+
export { default as Dialog } from './components/dialog/Dialog.vue.js';
|
|
18
|
+
export { default as Drawer } from './components/drawer/Drawer.vue.js';
|
|
19
|
+
export { default as EditorPlaceholder } from './components/empty-state/EditorPlaceholder.vue.js';
|
|
20
|
+
export { default as EmptyState } from './components/empty-state/EmptyState.vue.js';
|
|
21
|
+
export { default as FeatureCard } from './components/card/FeatureCard.vue.js';
|
|
22
|
+
export { default as FieldWrapper } from './components/field-wrapper/FieldWrapper.vue.js';
|
|
23
|
+
export { default as FilterPanel } from './components/filter-panel/FilterPanel.vue.js';
|
|
24
|
+
export { default as FormLayout } from './components/form-layout/FormLayout.vue.js';
|
|
25
|
+
export { default as Icon } from './components/icon/Icon.vue.js';
|
|
26
|
+
export { default as Image } from './components/image/Image.vue.js';
|
|
27
|
+
export { default as Input } from './components/input/Input.vue.js';
|
|
28
|
+
export { default as Lightbox } from './components/lightbox/Lightbox.vue.js';
|
|
29
|
+
export { default as Link } from './components/link/Link.vue.js';
|
|
30
|
+
export { default as LoadMore } from './components/load-more/LoadMore.vue.js';
|
|
31
|
+
export { default as LogoItem } from './components/logo-item/LogoItem.vue.js';
|
|
32
|
+
export { default as MultiSelect } from './components/select/MultiSelect.vue.js';
|
|
33
|
+
export { default as Pagination } from './components/pagination/Pagination.vue.js';
|
|
34
|
+
export { default as Popover } from './components/popover/Popover.vue.js';
|
|
35
|
+
export { default as Price } from './components/price/Price.vue.js';
|
|
36
|
+
export { default as ProductCard } from './components/product-card/ProductCard.vue.js';
|
|
37
|
+
export { default as QuantityStepper } from './components/quantity-stepper/QuantityStepper.vue.js';
|
|
38
|
+
export { default as RadioGroup } from './components/radio/RadioGroup.vue.js';
|
|
39
|
+
export { default as RangeSlider } from './components/range-slider/RangeSlider.vue.js';
|
|
40
|
+
export { default as Rating } from './components/rating/Rating.vue.js';
|
|
41
|
+
export { default as SearchBar } from './components/search-bar/SearchBar.vue.js';
|
|
42
|
+
export { default as SearchModal } from './components/search-modal/SearchModal.vue.js';
|
|
43
|
+
export { default as Section } from './components/section/Section.vue.js';
|
|
44
|
+
export { default as Select } from './components/select/Select.vue.js';
|
|
45
|
+
export { default as Skeleton } from './components/skeleton/Skeleton.vue.js';
|
|
46
|
+
export { default as StockBadge } from './components/badge/StockBadge.vue.js';
|
|
47
|
+
export { default as Switch } from './components/switch/Switch.vue.js';
|
|
48
|
+
export { default as Tab } from './components/tabs/Tab.vue.js';
|
|
49
|
+
export { default as TabPanel } from './components/tabs/TabPanel.vue.js';
|
|
50
|
+
export { default as Tabs } from './components/tabs/Tabs.vue.js';
|
|
51
|
+
export { default as Textarea } from './components/textarea/Textarea.vue.js';
|
|
52
|
+
export { default as Toast } from './components/toast/Toast.vue.js';
|
|
53
|
+
export { default as Toaster } from './components/toast/Toaster.vue.js';
|
|
54
|
+
export { default as Tooltip } from './components/tooltip/Tooltip.vue.js';
|
|
55
|
+
export { default as UnitInput } from './components/unit-input/UnitInput.vue.js';
|
|
56
|
+
export { default as VariantPicker } from './components/variant-picker/VariantPicker.vue.js';
|
|
57
|
+
export { default as VisuallyHidden } from './components/visually-hidden/VisuallyHidden.vue.js';
|
|
58
|
+
export type { AccordionItemHeadingLevel, AccordionItemPart, AccordionItemProps, AccordionPart, AccordionProps, } from './components/accordion/types.js';
|
|
59
|
+
export type { AppliedFilter, FilterFacet, FilterFacetLayout, FilterFacetSelection, FilterFacetType, FilterFacetValue, FilterPanelMode, FilterPanelPart, FilterPanelProps, FilterRemoval, FilterSelection, } from './components/filter-panel/types.js';
|
|
60
|
+
export type { AvatarGroupPart, AvatarGroupPerson, AvatarGroupProps, AvatarPart, AvatarProps, AvatarSize, } from './components/avatar/types.js';
|
|
61
|
+
export type { BadgePart, BadgeProps, BadgeTone, BadgeVariant, StockBadgePart, StockBadgeProps, StockLevel, } from './components/badge/types.js';
|
|
62
|
+
export type { BreadcrumbItem, BreadcrumbPart, BreadcrumbProps, } from './components/breadcrumb/types.js';
|
|
63
|
+
export type { ButtonGroupPart, ButtonGroupProps, ButtonPart, ButtonProps, ButtonSize, ButtonVariant, } from './components/button/types.js';
|
|
64
|
+
export type { CarouselControls, CarouselPart, CarouselPerViewBreakpoints, CarouselProps, } from './components/carousel/types.js';
|
|
65
|
+
export type { CheckboxGroupLayout, CheckboxGroupOption, CheckboxGroupPart, CheckboxGroupProps, CheckboxPart, CheckboxProps, CheckboxSize, } from './components/checkbox/types.js';
|
|
66
|
+
export type { ChipGroupPart, ChipGroupProps, ChipPart, ChipProps, ChipSize, } from './components/chip/types.js';
|
|
67
|
+
export type { ContainerPart, ContainerProps, ContainerWidth } from './components/container/types.js';
|
|
68
|
+
export type { ContentCardPart, ContentCardProps, ContentCardRatio, ContentCardVariant, FeatureCardPart, FeatureCardProps, FeatureCardVariant, } from './components/card/types.js';
|
|
69
|
+
export type { CurrencyInputPart, CurrencyInputProps } from './components/currency-input/types.js';
|
|
70
|
+
export type { DialogPart, DialogProps, DialogSize } from './components/dialog/types.js';
|
|
71
|
+
export type { DrawerPart, DrawerProps, DrawerSide } from './components/drawer/types.js';
|
|
72
|
+
export type { EditorPlaceholderPart, EditorPlaceholderProps, EmptyStatePart, EmptyStateProps, EmptyStateVariant, } from './components/empty-state/types.js';
|
|
73
|
+
export type { FieldWrapperCounter, FieldWrapperPart, FieldWrapperProps, } from './components/field-wrapper/types.js';
|
|
74
|
+
export type { FormLayoutHeadingLevel, FormLayoutPart, FormLayoutProps, FormLayoutSubmitPayload, FormLayoutVariant, } from './components/form-layout/types.js';
|
|
75
|
+
export type { IconComponent, IconPart, IconProps, IconSize } from './components/icon/types.js';
|
|
76
|
+
export type { ImageMedia, ImagePart, ImageProps, ImageRatio } from './components/image/types.js';
|
|
77
|
+
export type { InputPart, InputProps, InputSize, InputType } from './components/input/types.js';
|
|
78
|
+
export type { LightboxImage, LightboxPart, LightboxProps } from './components/lightbox/types.js';
|
|
79
|
+
export type { LinkPart, LinkProps, LinkTone, LinkVariant } from './components/link/types.js';
|
|
80
|
+
export type { LoadMorePart, LoadMoreProps } from './components/load-more/types.js';
|
|
81
|
+
export type { LogoItemPart, LogoItemProps } from './components/logo-item/types.js';
|
|
82
|
+
export type { MultiSelectPart, MultiSelectProps, SelectOption, SelectPart, SelectPlacement, SelectProps, SelectSize, } from './components/select/types.js';
|
|
83
|
+
export type { PaginationPart, PaginationProps } from './components/pagination/types.js';
|
|
84
|
+
export type { PopoverPart, PopoverProps } from './components/popover/types.js';
|
|
85
|
+
export type { PricePart, PriceProps, PriceSize } from './components/price/types.js';
|
|
86
|
+
export type { ProductCardPart, ProductCardProduct, ProductCardProps, ProductCardRatio, } from './components/product-card/types.js';
|
|
87
|
+
export type { QuantityStepperPart, QuantityStepperProps, QuantityStepperSize, } from './components/quantity-stepper/types.js';
|
|
88
|
+
export type { RadioGroupLayout, RadioGroupOption, RadioGroupPart, RadioGroupProps, RadioGroupSize, } from './components/radio/types.js';
|
|
89
|
+
export type { RangeSliderEnd, RangeSliderInputsSlotProps, RangeSliderPart, RangeSliderProps, RangeSliderThumb, RangeSliderTrackSlotProps, RangeSliderValue, } from './components/range-slider/types.js';
|
|
90
|
+
export type { RatingPart, RatingProps, RatingSize } from './components/rating/types.js';
|
|
91
|
+
export type { SearchBarPart, SearchBarProps, SearchBarSize, SearchResultItem, SearchResultType, SearchResults, SearchRow, SearchSection, SearchSelectType, } from './components/search-bar/types.js';
|
|
92
|
+
export type { SearchModalPart, SearchModalProps } from './components/search-modal/types.js';
|
|
93
|
+
export type { SectionBackground, SectionPart, SectionProps, SectionSpacing, } from './components/section/types.js';
|
|
94
|
+
export type { SkeletonPart, SkeletonProps, SkeletonVariant } from './components/skeleton/types.js';
|
|
95
|
+
export type { SwitchPart, SwitchProps, SwitchSize } from './components/switch/types.js';
|
|
96
|
+
export type { TabPanelPart, TabPanelProps, TabPart, TabProps, TabsActivation, TabsItem, TabsPart, TabsProps, TabsVariant, } from './components/tabs/types.js';
|
|
97
|
+
export type { TextareaPart, TextareaProps } from './components/textarea/types.js';
|
|
98
|
+
export type { ToastAction, ToastPart, ToastProps, ToastVariant, ToasterPart, ToasterProps, } from './components/toast/types.js';
|
|
99
|
+
export type { TooltipAlign, TooltipPart, TooltipPlacement, TooltipProps, TooltipRole, } from './components/tooltip/types.js';
|
|
100
|
+
export type { UnitInputPart, UnitInputProps } from './components/unit-input/types.js';
|
|
101
|
+
export type { VariantPickerOption, VariantPickerPart, VariantPickerProps, VariantPickerType, } from './components/variant-picker/types.js';
|
|
102
|
+
export type { VisuallyHiddenPart, VisuallyHiddenProps } from './components/visually-hidden/types.js';
|
|
103
|
+
export { defaultMessages, enUS } from './messages/index.js';
|
|
104
|
+
export { MESSAGES_KEY, provideEldraUiMessages, useMessages, type UiMessages, } from './composables/useMessages.js';
|
|
105
|
+
export { CURRENCY_KEY, DEFAULT_UI_LOCALE, LOCALE_KEY, provideEldraUiCurrency, provideEldraUiLocale, useEldraUiCurrency, useEldraUiLocale, } from './composables/useLocale.js';
|
|
106
|
+
export { useControllableModel } from './composables/useControllableModel.js';
|
|
107
|
+
export { closeDialog, currentDialog, isOpenDialog, openDialog, TOAST_HOST_KEY, } from './composables/dialogStack.js';
|
|
108
|
+
export { useDialog, type UseDialogOptions, type UseDialogReturn } from './composables/useDialog.js';
|
|
109
|
+
export { useToast, type ToastItem, type ToastOptions, type UseToastReturn, } from './composables/useToast.js';
|
|
110
|
+
export { useFloating, type FloatingPlacement, type UseFloatingOptions, type UseFloatingReturn, } from './composables/useFloating.js';
|
|
111
|
+
export { useHeadingTag, type HeadingLevel } from './composables/useHeadingTag.js';
|
|
112
|
+
export { useOverlay, type UseOverlayOptions, type UseOverlayReturn, } from './composables/useOverlay.js';
|
|
113
|
+
export { normalizeText, useListbox, type ListboxOption, type UseListboxOptions, type UseListboxReturn, } from './components/select/useListbox.js';
|
|
114
|
+
export { usePopover, type UsePopoverOptions, type UsePopoverReturn, } from './components/select/usePopover.js';
|
|
115
|
+
export { useSlotPresence } from './composables/useSlotPresence.js';
|
|
116
|
+
export { clampRangeThumb, fractionDigits, nearestRangeThumb, normalizeRangeValue, rangeKeyTransition, rangePositionToValue, rangeStepDigits, rangeThumbLimits, rangeValueToPercent, snapToRangeStep, type RangeSliderMath, } from './components/range-slider/useRangeSlider.js';
|
|
117
|
+
export { carouselPerViewStyle, prefersReducedMotion, resolveCarouselPerView, useCarousel, type UseCarouselOptions, type UseCarouselReturn, } from './components/carousel/useCarousel.js';
|
|
118
|
+
export { FILTER_SEARCH_FROM, FILTER_VALUES_SHOWN, appliedFilters, clearedSelection, dropOmittedFacets, facetCanShowAll, facetHasHiddenValues, facetIsRenderable, facetIsSearchable, facetRows, facetSelectedCount, facetStartsOpen, facetSummaryLabels, facetValues, foldForSearch, hasSelection, histogramBarInRange, isRangeAtLimits, isRangeSelection, isValueDisabled, isValueSelected, matchesSearch, rangeLimits, rangeOf, removeValue, renderableFacets, selectedValues, setRange, sizeSystemGroups, toggleValue, visibleFacetValues, type FacetListState, type FacetRow, type SizeSystemGroup, } from './components/filter-panel/useFilterPanel.js';
|
|
119
|
+
export { SWATCH_INK_LUMINANCE_THRESHOLD, swatchInk, swatchLuminance, type SwatchInk, } from './components/filter-panel/swatchInk.js';
|
|
120
|
+
export { FORM_LAYOUT_KEY, FORM_SUBMITTING_KEY } from './components/form-layout/context.js';
|
|
121
|
+
export { FIELD_KEY, type FieldContext } from './components/field-wrapper/context.js';
|
|
122
|
+
export { SECTION_KEY } from './components/section/context.js';
|
|
123
|
+
export { CHIP_GROUP_KEY, type ChipGroupContext } from './components/chip/context.js';
|
|
124
|
+
export { ACCORDION_KEY, type AccordionContext } from './components/accordion/context.js';
|
|
125
|
+
export { TABS_KEY, type TabsContext, type TabsEntry } from './components/tabs/context.js';
|
|
126
|
+
export { cx, partClass, type ClassValue } from './utils/cx.js';
|
|
127
|
+
export { mixToward } from './utils/color.js';
|
|
128
|
+
export { joinIds, useUiId } from './utils/id.js';
|
|
129
|
+
export { applyMask, defaultCharacterMeaning, stripMask } from './utils/mask.js';
|
|
130
|
+
export { createNumberFormat, currencyFractionDigits, currencySymbol, defaultUnitFormat, formatCurrency, formatNumber, formatUnit, localeSeparators, parseLocaleNumber, type NumberFormatOptions, type UnitFormatOptions, } from './utils/number-format.js';
|
|
131
|
+
export { filterNumericBeforeInput, type NumericInputFilterOptions } from './utils/numeric-input.js';
|
|
132
|
+
export { frameAspectRatio } from './utils/ratio.js';
|
|
133
|
+
export { formatDate, type FormatDateOptions } from './utils/date.js';
|
|
134
|
+
export { ratingStarStates, roundRatingToHalf, type RatingStarState } from './utils/rating.js';
|
|
135
|
+
export { initialsFromName } from './utils/avatar.js';
|