@eldrajs/ui 0.2.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +324 -161
  3. package/dist/{VariantPicker-CjWUVhlm.js → VariantPicker-C-9sMXGI.js} +3275 -2040
  4. package/dist/componentNames.d.ts +1 -1
  5. package/dist/components/accordion/Accordion.vue.d.ts +1 -2
  6. package/dist/components/accordion/AccordionItem.vue.d.ts +1 -1
  7. package/dist/components/accordion/types.d.ts +6 -7
  8. package/dist/components/avatar/Avatar.vue.d.ts +1 -1
  9. package/dist/components/avatar/types.d.ts +6 -4
  10. package/dist/components/badge/types.d.ts +6 -4
  11. package/dist/components/breadcrumb/types.d.ts +5 -2
  12. package/dist/components/button/Button.vue.d.ts +6 -3
  13. package/dist/components/button/ButtonGroup.vue.d.ts +0 -1
  14. package/dist/components/button/types.d.ts +39 -9
  15. package/dist/components/card/ContentCard.vue.d.ts +2 -2
  16. package/dist/components/card/FeatureCard.vue.d.ts +1 -1
  17. package/dist/components/card/stretchedLink.d.ts +3 -3
  18. package/dist/components/card/types.d.ts +6 -4
  19. package/dist/components/carousel/types.d.ts +7 -3
  20. package/dist/components/checkbox/Checkbox.vue.d.ts +5 -3
  21. package/dist/components/checkbox/CheckboxGroup.vue.d.ts +1 -1
  22. package/dist/components/checkbox/types.d.ts +21 -4
  23. package/dist/components/chip/Chip.vue.d.ts +5 -4
  24. package/dist/components/chip/ChipGroup.vue.d.ts +0 -1
  25. package/dist/components/chip/types.d.ts +5 -6
  26. package/dist/components/container/Container.vue.d.ts +0 -1
  27. package/dist/components/container/types.d.ts +0 -4
  28. package/dist/components/dialog/Dialog.vue.d.ts +13 -8
  29. package/dist/components/dialog/types.d.ts +16 -4
  30. package/dist/components/drawer/Drawer.vue.d.ts +2 -1
  31. package/dist/components/drawer/types.d.ts +5 -2
  32. package/dist/components/empty-state/EmptyState.vue.d.ts +1 -1
  33. package/dist/components/empty-state/types.d.ts +7 -6
  34. package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +4 -1
  35. package/dist/components/field-wrapper/RequiredMark.vue.d.ts +15 -0
  36. package/dist/components/field-wrapper/context.d.ts +8 -0
  37. package/dist/components/field-wrapper/types.d.ts +17 -6
  38. package/dist/components/filter-panel/FilterGroup.vue.d.ts +1 -0
  39. package/dist/components/filter-panel/FilterPanel.vue.d.ts +7 -6
  40. package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +1 -0
  41. package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +1 -0
  42. package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +2 -1
  43. package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +1 -0
  44. package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +1 -0
  45. package/dist/components/filter-panel/facets/shared.d.ts +4 -4
  46. package/dist/components/filter-panel/types.d.ts +5 -2
  47. package/dist/components/form-layout/FormLayout.vue.d.ts +1 -1
  48. package/dist/components/form-layout/types.d.ts +5 -2
  49. package/dist/components/icon/Icon.vue.d.ts +1 -2
  50. package/dist/components/icon/types.d.ts +0 -4
  51. package/dist/components/image/types.d.ts +3 -2
  52. package/dist/components/input/Input.vue.d.ts +13 -8
  53. package/dist/components/input/classes.d.ts +33 -18
  54. package/dist/components/input/reassertValue.d.ts +13 -0
  55. package/dist/components/input/types.d.ts +18 -6
  56. package/dist/components/input/useAdornmentRoom.d.ts +15 -0
  57. package/dist/components/lightbox/Lightbox.vue.d.ts +2 -1
  58. package/dist/components/lightbox/types.d.ts +5 -2
  59. package/dist/components/link/Link.vue.d.ts +1 -1
  60. package/dist/components/link/types.d.ts +5 -2
  61. package/dist/components/load-more/types.d.ts +4 -3
  62. package/dist/components/logo-item/LogoItem.vue.d.ts +1 -1
  63. package/dist/components/logo-item/types.d.ts +2 -1
  64. package/dist/components/nav-menu/NavMenu.vue.d.ts +2 -1
  65. package/dist/components/nav-menu/navLinks.d.ts +1 -1
  66. package/dist/components/nav-menu/types.d.ts +3 -3
  67. package/dist/components/pagination/Pagination.vue.d.ts +154 -0
  68. package/dist/components/pagination/types.d.ts +36 -2
  69. package/dist/components/popover/Popover.vue.d.ts +29 -2
  70. package/dist/components/popover/types.d.ts +62 -9
  71. package/dist/components/price/types.d.ts +3 -2
  72. package/dist/components/product-card/ProductCard.vue.d.ts +2 -2
  73. package/dist/components/product-card/types.d.ts +3 -2
  74. package/dist/components/quantity-stepper/QuantityStepper.vue.d.ts +4 -4
  75. package/dist/components/quantity-stepper/types.d.ts +5 -2
  76. package/dist/components/radio/Radio.vue.d.ts +33 -0
  77. package/dist/components/radio/RadioGroup.vue.d.ts +6 -2
  78. package/dist/components/radio/recipes.d.ts +41 -0
  79. package/dist/components/radio/types.d.ts +71 -4
  80. package/dist/components/range-slider/RangeSlider.vue.d.ts +2 -1
  81. package/dist/components/range-slider/types.d.ts +5 -2
  82. package/dist/components/rating/Rating.vue.d.ts +1 -1
  83. package/dist/components/rating/types.d.ts +3 -2
  84. package/dist/components/search-bar/SearchBar.vue.d.ts +4 -3
  85. package/dist/components/search-bar/SearchResultsPanel.vue.d.ts +1 -1
  86. package/dist/components/search-bar/types.d.ts +5 -2
  87. package/dist/components/search-modal/SearchModal.vue.d.ts +3 -2
  88. package/dist/components/search-modal/types.d.ts +7 -4
  89. package/dist/components/section/Section.vue.d.ts +0 -1
  90. package/dist/components/section/types.d.ts +0 -4
  91. package/dist/components/select/MultiSelect.vue.d.ts +53 -6
  92. package/dist/components/select/Select.vue.d.ts +24 -4
  93. package/dist/components/select/SelectPanel.vue.d.ts +25 -2
  94. package/dist/components/select/SelectTags.vue.d.ts +50 -0
  95. package/dist/components/select/openRegistry.d.ts +14 -4
  96. package/dist/components/select/panelParts.d.ts +45 -18
  97. package/dist/components/select/types.d.ts +54 -10
  98. package/dist/components/select/useOptionList.d.ts +31 -4
  99. package/dist/components/select/usePopover.d.ts +36 -39
  100. package/dist/components/select/useSummaryFit.d.ts +21 -0
  101. package/dist/components/select/useTagRows.d.ts +17 -0
  102. package/dist/components/site-form/SiteForm.vue.d.ts +3 -2
  103. package/dist/components/site-form/types.d.ts +6 -2
  104. package/dist/components/skeleton/Skeleton.vue.d.ts +2 -2
  105. package/dist/components/skeleton/types.d.ts +4 -4
  106. package/dist/components/switch/Switch.vue.d.ts +17 -10
  107. package/dist/components/switch/types.d.ts +29 -2
  108. package/dist/components/tabler-icon/TablerIcon.vue.d.ts +2 -3
  109. package/dist/components/tabler-icon/types.d.ts +0 -4
  110. package/dist/components/tabs/Tab.vue.d.ts +2 -1
  111. package/dist/components/tabs/TabPanel.vue.d.ts +1 -3
  112. package/dist/components/tabs/Tabs.vue.d.ts +1 -1
  113. package/dist/components/tabs/context.d.ts +6 -2
  114. package/dist/components/tabs/types.d.ts +22 -11
  115. package/dist/components/textarea/Textarea.vue.d.ts +23 -3
  116. package/dist/components/textarea/types.d.ts +15 -3
  117. package/dist/components/toast/Toast.vue.d.ts +2 -0
  118. package/dist/components/toast/Toaster.vue.d.ts +7 -1
  119. package/dist/components/toast/types.d.ts +52 -5
  120. package/dist/components/tooltip/types.d.ts +4 -3
  121. package/dist/components/unit-input/UnitInput.vue.d.ts +7 -7
  122. package/dist/components/unit-input/types.d.ts +5 -2
  123. package/dist/components/variant-picker/VariantPicker.vue.d.ts +1 -1
  124. package/dist/components/variant-picker/types.d.ts +3 -2
  125. package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +0 -1
  126. package/dist/components/visually-hidden/types.d.ts +0 -4
  127. package/dist/components.css +1556 -2145
  128. package/dist/composables/useDialog.d.ts +7 -3
  129. package/dist/composables/useEldraScope.d.ts +24 -0
  130. package/dist/composables/useFloating.d.ts +21 -8
  131. package/dist/composables/useOverlay.d.ts +10 -5
  132. package/dist/composables/useToast.d.ts +3 -0
  133. package/dist/index.d.ts +12 -10
  134. package/dist/index.js +2553 -1185
  135. package/dist/messages/en-US.d.ts +2 -0
  136. package/dist/messages/is-IS.js +1 -0
  137. package/dist/resolver.js +1 -0
  138. package/dist/style.css +1561 -2150
  139. package/dist/tailwind.css +11 -2203
  140. package/dist/theme.css +108 -0
  141. package/dist/tokens.css +1 -0
  142. package/dist/useMessages-B5nzZghs.js +592 -0
  143. package/dist/utilities.css +2160 -0
  144. package/dist/utils/mergeClass.d.ts +3 -0
  145. package/dist/utils/tagRecipe.d.ts +3 -3
  146. package/dist/vee-validate.js +42 -6
  147. package/dist/vue-i18n/index.d.ts +50 -0
  148. package/dist/vue-i18n/shapes.d.ts +40 -0
  149. package/dist/vue-i18n.js +289 -0
  150. package/package.json +17 -3
  151. package/dist/utils/cx.d.ts +0 -31
@@ -1,6 +1,7 @@
1
1
  import { UiMessages } from '../../composables/useMessages.js';
2
2
  /** Spec "Toast" -> Variants: icon, colour and timing all key off this. */
3
- export type ToastVariant = 'success' | 'warning' | 'danger';
3
+ /** `info` is neutral news: the text colour, polite, timed like `success`. */
4
+ export type ToastVariant = 'success' | 'info' | 'warning' | 'danger';
4
5
  /**
5
6
  * One action a toast offers (spec "Toast" -> Properties, `action` row): "One action: a link
6
7
  * ('View cart (3)') or a button ('Try again')." A discriminated union rather than one interface
@@ -15,10 +16,10 @@ export type ToastAction = {
15
16
  onActivate: () => void;
16
17
  };
17
18
  /** The parts a consumer can restyle through `classes` (spec "Toast" -> Anatomy). */
18
- export type ToastPart = 'root' | 'icon' | 'title' | 'text' | 'action' | 'close';
19
+ export type ToastPart = 'icon' | 'title' | 'text' | 'action' | 'close';
19
20
  export interface ToastProps {
20
21
  /** Icon, colour and auto-dismiss timing (see `useToast`'s `DEFAULT_DURATION`). Default
21
- * `"success"`. */
22
+ * `"success"`. Also on the root as `data-variant`, for a consumer's per-variant selector. */
22
23
  variant?: ToastVariant;
23
24
  /** The message. The meaning is always in this text — colour and icon are extras (1.4.1). */
24
25
  title: string;
@@ -26,19 +27,65 @@ export interface ToastProps {
26
27
  text?: string;
27
28
  /** One action: a link or a link-style button. */
28
29
  action?: ToastAction;
30
+ /**
31
+ * Shows the close button and closes on `Escape`. Default `true`. `false` is for a toast that must
32
+ * stay until its own timer or the app removes it.
33
+ */
34
+ closable?: boolean;
29
35
  /** Message overrides (only `dismissNotification` applies here). See `useMessages`. */
30
36
  messages?: Partial<UiMessages>;
31
- /** Per-part class overrides, merged with `tailwind-merge`. */
37
+ /**
38
+ * Per-part classes, appended to the part's own (they win by cascade layer). Style the toast
39
+ * itself with `class`.
40
+ */
32
41
  classes?: Partial<Record<ToastPart, string>>;
33
42
  }
34
43
  /** The parts a consumer can restyle through `classes` (`Toaster`'s own anatomy: the fixed region
35
44
  * and the polite status list inside it — see `Toaster.vue`'s own doc comment for why a danger
36
45
  * toast is not inside `list`). */
37
46
  export type ToasterPart = 'root' | 'list';
47
+ /** Where the stack sits in the viewport. */
48
+ export type ToasterPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
49
+ /**
50
+ * One toast in an externally owned list (`Toaster`'s `toasts`). `useToast`'s `ToastItem` is one;
51
+ * `variant` defaults to `"success"`, and with no `duration` (or `0`) the toast keeps no timer of
52
+ * the `Toaster`'s own, so the list's owner decides when it leaves.
53
+ */
54
+ export interface ToasterToast {
55
+ id: string;
56
+ title: string;
57
+ variant?: ToastVariant;
58
+ text?: string;
59
+ action?: ToastAction;
60
+ closable?: boolean;
61
+ /** Auto-dismiss time in ms, after which `dismiss(id, "timeout")` fires. Ignored for `danger`. */
62
+ duration?: number;
63
+ }
38
64
  export interface ToasterProps {
65
+ /**
66
+ * An externally owned queue to render instead of `useToast`'s. Given, the `Toaster` never touches
67
+ * the `useToast` store: closing a toast (or its timer running out) only emits `dismiss`, and the
68
+ * owner removes it from the list. Default: the `useToast` queue.
69
+ */
70
+ toasts?: ToasterToast[];
71
+ /** Where the stack sits. Default `"bottom-right"`. */
72
+ position?: ToasterPosition;
73
+ /** Renders at most this many toasts, the newest kept. Default: every toast in the queue
74
+ * (`useToast` itself keeps three). */
75
+ maxVisible?: number;
76
+ /** Draws the newest toast first, at the top of the stack. Default `false`: newest at the bottom. */
77
+ newestOnTop?: boolean;
78
+ /**
79
+ * Where the region is teleported while no modal dialog is open. Default `"body"`. An open
80
+ * `Dialog` still wins, since a toast outside a modal dialog cannot be reached.
81
+ */
82
+ teleportTo?: string | HTMLElement;
39
83
  /** Message overrides, passed through to every `Toast` this renders and to the region's own
40
84
  * `aria-label`. See `useMessages`. */
41
85
  messages?: Partial<UiMessages>;
42
- /** Per-part class overrides, merged with `tailwind-merge`. */
86
+ /**
87
+ * Per-part classes, appended to the part's own (they win by cascade layer). `root` is a part
88
+ * here: the region is teleported, so a `class` on `Toaster` has no element to land on.
89
+ */
43
90
  classes?: Partial<Record<ToasterPart, string>>;
44
91
  }
@@ -8,8 +8,9 @@ export type TooltipAlign = 'start' | 'center' | 'end';
8
8
  * has a visible label (`aria-describedby`).
9
9
  */
10
10
  export type TooltipRole = 'label' | 'description';
11
- /** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them. */
12
- export type TooltipPart = 'root' | 'bubble' | 'arrow';
11
+ /** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them. The
12
+ * root is styled with `class`. */
13
+ export type TooltipPart = 'bubble' | 'arrow';
13
14
  /**
14
15
  * The default slot's first element is the trigger `Tooltip` names or describes. **It must be a
15
16
  * plain element, or a component whose focusable root receives `$attrs`** — an `aria-labelledby` or
@@ -41,6 +42,6 @@ export interface TooltipProps {
41
42
  * `label`.
42
43
  */
43
44
  role?: TooltipRole;
44
- /** Per-part class overrides, merged with `tailwind-merge`. */
45
+ /** Per-part classes, appended to the part's own (they win by cascade layer). */
45
46
  classes?: Partial<Record<TooltipPart, string>>;
46
47
  }
@@ -11,23 +11,23 @@ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
11
11
  declare const __VLS_base: import('vue').DefineComponent<UnitInputProps, {
12
12
  formatValue: typeof formatValue;
13
13
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
- blur: (event: FocusEvent) => any;
15
- clear: () => any;
16
14
  "update:modelValue": (value: number | null) => any;
15
+ clear: () => any;
16
+ blur: (event: FocusEvent) => any;
17
17
  focus: (event: FocusEvent) => any;
18
18
  "update:formattedValue": (value: string) => any;
19
19
  }, string, import('vue').PublicProps, Readonly<UnitInputProps> & Readonly<{
20
- onBlur?: ((event: FocusEvent) => any) | undefined;
21
- onClear?: (() => any) | undefined;
22
20
  "onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
21
+ onClear?: (() => any) | undefined;
22
+ onBlur?: ((event: FocusEvent) => any) | undefined;
23
23
  onFocus?: ((event: FocusEvent) => any) | undefined;
24
24
  "onUpdate:formattedValue"?: ((value: string) => any) | undefined;
25
25
  }>, {
26
- size: import('../../index.js').InputSize;
27
- label: string;
28
26
  name: string;
29
- classes: Partial<Record<import('./types.js').UnitInputPart, string>>;
27
+ label: string;
28
+ size: import('../../index.js').InputSize;
30
29
  modelValue: string | number | null;
30
+ classes: Partial<Record<import('./types.js').UnitInputPart, string>>;
31
31
  required: boolean;
32
32
  unit: string;
33
33
  max: number;
@@ -7,7 +7,7 @@ import { InputSize } from '../input/types.js';
7
7
  * `UnitInputProps.label`), so the field box is one element deeper than `Input`'s — the decorations
8
8
  * are positioned against `field`, never against a `root` that may also hold a label.
9
9
  */
10
- export type UnitInputPart = 'root' | 'label' | 'field' | 'leadingIcon' | 'control' | 'suffix' | 'dragHandle' | 'clearButton';
10
+ export type UnitInputPart = 'label' | 'field' | 'leadingIcon' | 'control' | 'suffix' | 'dragHandle' | 'clearButton';
11
11
  export interface UnitInputProps {
12
12
  /**
13
13
  * The value (two-way), as a **number** — never the string in the field. A numeric string is
@@ -63,6 +63,9 @@ export interface UnitInputProps {
63
63
  readonly?: boolean;
64
64
  /** Native `disabled`. */
65
65
  disabled?: boolean;
66
- /** Per-part class overrides, merged with `tailwind-merge`. */
66
+ /**
67
+ * Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
68
+ * `class`.
69
+ */
67
70
  classes?: Partial<Record<UnitInputPart, string>>;
68
71
  }
@@ -6,10 +6,10 @@ declare const __VLS_export: import('vue').DefineComponent<VariantPickerProps, {}
6
6
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
7
7
  onChange?: ((value: string) => any) | undefined;
8
8
  }>, {
9
- classes: Partial<Record<import('./types.js').VariantPickerPart, string>>;
10
9
  type: import('./types.js').VariantPickerType;
11
10
  legend: string;
12
11
  modelValue: string;
12
+ classes: Partial<Record<import('./types.js').VariantPickerPart, string>>;
13
13
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: typeof __VLS_export;
15
15
  export default _default;
@@ -1,5 +1,5 @@
1
1
  /** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them. */
2
- export type VariantPickerPart = 'root' | 'legend' | 'legendValue' | 'options' | 'option' | 'radio' | 'label' | 'swatch' | 'soldOutLine';
2
+ export type VariantPickerPart = 'legend' | 'legendValue' | 'options' | 'option' | 'radio' | 'label' | 'swatch' | 'soldOutLine';
3
3
  /** Pills for text values (sizes, capacities), swatches for colours and glazes. */
4
4
  export type VariantPickerType = 'pills' | 'swatches';
5
5
  /**
@@ -44,6 +44,7 @@ export interface VariantPickerProps {
44
44
  type?: VariantPickerType;
45
45
  /** The options. `swatch` colours are the one allowed per-item colour, set as an inline style. */
46
46
  options: VariantPickerOption[];
47
- /** Per-part class overrides, merged with `tailwind-merge`. */
47
+ /** Per-part classes, appended to the kit's own (they win by cascade layer). The root is styled
48
+ * with `class`. */
48
49
  classes?: Partial<Record<VariantPickerPart, string>>;
49
50
  }
@@ -6,7 +6,6 @@ declare const __VLS_template: () => {
6
6
  };
7
7
  type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
8
8
  declare const __VLS_base: import('vue').DefineComponent<VisuallyHiddenProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<VisuallyHiddenProps> & Readonly<{}>, {
9
- classes: Partial<Record<"root", string>>;
10
9
  focusable: boolean;
11
10
  as: string;
12
11
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,5 +1,3 @@
1
- /** The parts a consumer can restyle through `classes`. */
2
- export type VisuallyHiddenPart = 'root';
3
1
  export interface VisuallyHiddenProps {
4
2
  /** The element to render. Defaults to `span`. */
5
3
  as?: string;
@@ -9,6 +7,4 @@ export interface VisuallyHiddenProps {
9
7
  * control's name).
10
8
  */
11
9
  focusable?: boolean;
12
- /** Per-part class overrides, merged with `tailwind-merge`. */
13
- classes?: Partial<Record<VisuallyHiddenPart, string>>;
14
10
  }