@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,4 +1,5 @@
1
- import { ComputedRef, Ref } from 'vue';
1
+ import { ReferenceElement } from '@floating-ui/vue';
2
+ import { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';
2
3
  import { FloatingPlacement } from '../../composables/useFloating.js';
3
4
  export interface UsePopoverOptions {
4
5
  /** The control that opens the popup, and the element focus goes back to. */
@@ -7,14 +8,37 @@ export interface UsePopoverOptions {
7
8
  content: Ref<HTMLElement | null> | ComputedRef<HTMLElement | null>;
8
9
  /** Whether the control may open at all (a disabled or read-only field may not). Default `true`. */
9
10
  canOpen?: () => boolean;
10
- /** Read once, like every `useFloating` option. Default `'auto'`. */
11
- placement?: FloatingPlacement;
12
- /** The gap between the control and the panel, in pixels. Default `4` (0.25rem). */
13
- offset?: number;
11
+ /** Default `'auto'`. A ref or getter is followed, as `useFloating` follows it. */
12
+ placement?: MaybeRefOrGetter<FloatingPlacement>;
13
+ /** The gap between the control and the panel, in pixels. Default `4` (0.25rem). Followed. */
14
+ offset?: MaybeRefOrGetter<number | undefined>;
15
+ /** The least room kept between the panel and the viewport edge, in pixels. Default `8`. */
16
+ padding?: MaybeRefOrGetter<number | undefined>;
17
+ /**
18
+ * What the panel is positioned against, when not the trigger: another element, or a Floating UI
19
+ * virtual element (a caret, a pointer position). `null` (the default) means the trigger.
20
+ * Focus still returns to the trigger, and the teleport target is still looked up from it — or
21
+ * from this element, when there is no trigger.
22
+ */
23
+ anchor?: Readonly<Ref<ReferenceElement | null>>;
24
+ /**
25
+ * Take part in "only one open at a time" (`openRegistry`). Default `true`. A getter is asked on
26
+ * every open. `false` opens without closing any other popup, and no other popup's opening
27
+ * closes this one.
28
+ */
29
+ exclusive?: boolean | (() => boolean);
30
+ /** Passed to `useOverlay`. Default `true`. */
31
+ closeOnOutsideClick?: boolean | (() => boolean);
32
+ /** Passed to `useOverlay`. Default: whatever `closeOnOutsideClick` is. */
33
+ closeOnFocusOutside?: boolean | (() => boolean);
34
+ /** Passed to `useOverlay`. Default `true`. */
35
+ closeOnEscape?: boolean | (() => boolean);
36
+ /** Passed to `useOverlay`: return focus to the trigger on `Esc`. Default `true`. */
37
+ returnFocus?: boolean | (() => boolean);
14
38
  /** Give the panel a `minWidth` equal to the control's — and, under `'exact'`, a `maxWidth` too. */
15
39
  matchWidth?: boolean | 'exact';
16
40
  /**
17
- * Where the panel is rendered. Read once, like every `useFloating` option.
41
+ * Where the panel is rendered. Read once.
18
42
  *
19
43
  * - `true` (the default) — through a `<Teleport>` to `document.body`, or to the nearest **open
20
44
  * native `<dialog>`** above the trigger when there is one (see `teleportTo` below).
@@ -110,38 +134,11 @@ export interface UsePopoverReturn {
110
134
  /** Put these two on the trigger to get the label-forwarded-click rule (see below). */
111
135
  onTriggerPointerDown(): void;
112
136
  onTriggerClick(event: MouseEvent): void;
137
+ /** Focus the panel's first tab stop, if it has one. */
138
+ focusFirst(): void;
139
+ /** Whether a node belongs to this popup (`useOverlay`'s `isInside`). */
140
+ isInside(node: EventTarget | null): boolean;
141
+ /** Reposition now — after a virtual `anchor` has moved. */
142
+ update(): void;
113
143
  }
114
- /**
115
- * The open/closed life of a **non-modal popup** anchored to a control: `Select`'s panel,
116
- * `MultiSelect`'s, and the `SearchBar`'s results panel.
117
- *
118
- * Every one of them needs the same six things, and before this composable the first two controls
119
- * held a line-identical copy of all of them:
120
- *
121
- * - **"Only one open at a time"** (`openRegistry`): opening claims a module-level slot and closes
122
- * whatever held it. The handle is stable per instance, so a late close cannot blank out the
123
- * popup that took its place.
124
- * - **Closing** (`useOverlay`): an outside pointer press, focus leaving, `Escape`. Non-modal, so
125
- * nothing is trapped and `Tab` always moves on.
126
- * - **Getting out of the way of the page** (`teleport`): the panel is rendered through a
127
- * `<Teleport>` to `body` — or to the modal `<dialog>` the trigger is in, which is the one place
128
- * `body` would be *behind* — and positioned with floating-ui's `fixed` strategy, so no ancestor's
129
- * `overflow: hidden` clips it and no later stacking context paints over it. `tabRedirect` puts a
130
- * panel that has real tab stops back into the `Tab` walk it left with its place in the DOM.
131
- * - **Positioning** (`useFloating`), plus the `--eldra-popover-origin` the entrance keyframes read,
132
- * so a panel that flips after floating-ui measures changes a custom property rather than its
133
- * `animation-name` (which would replay the entrance).
134
- * - **The open sequence**: open, make a row active, and — only when the call actually changed the
135
- * state — run `afterOpen` a tick later, which is where focus moves into the panel.
136
- * - **The label-forwarded-click latch**: a `<label for>` naming the trigger forwards its click to
137
- * it, and the spec is explicit that clicking a field's label focuses the control **without**
138
- * opening it. A forwarded click is indistinguishable from a real one except that no pointer was
139
- * pressed on the trigger and its `detail` is 0 — the same shape as a programmatic
140
- * `element.click()`. The latch is armed on `pointerdown` and released on the `pointerup` or
141
- * `pointercancel` that follows, wherever it lands: a press that ends off the trigger (a drag, a
142
- * cancelled touch) would otherwise leave the latch standing and arm the *next* click.
143
- *
144
- * What stays with each control is what actually differs: which rows there are, what choosing one
145
- * does, and which element the popup is anchored to.
146
- */
147
144
  export declare function usePopover(options: UsePopoverOptions): UsePopoverReturn;
@@ -0,0 +1,21 @@
1
+ import { Ref } from 'vue';
2
+ /** How many labels a summary lists before the trigger has been measured (server, first paint). */
3
+ export declare const UNMEASURED_SUMMARY = 2;
4
+ /**
5
+ * How many of a multi-select's chosen labels fit in its trigger beside the "+N" pill.
6
+ *
7
+ * `box` is the summary cell, whose width is set by the trigger alone (it carries
8
+ * `contain: inline-size`, so its labels never widen it and the count cannot feed back into the
9
+ * width it is measured against). `run` is an invisible copy of every label, each in its own
10
+ * `[data-label]` span, laid out on one line; `pill` is an invisible pill holding the widest count.
11
+ * The count is the most labels whose run, plus the gap and the pill when any are left over, fits
12
+ * the cell's content box; never fewer than one, which then truncates with an ellipsis.
13
+ *
14
+ * Client only, re-measured whenever the cell resizes or `labels` change. On the server, before the
15
+ * first measurement, and where layout reports no width (a test DOM), it is `UNMEASURED_SUMMARY`.
16
+ */
17
+ export declare function useSummaryFit(box: Ref<HTMLElement | null>, run: Ref<HTMLElement | null>, pill: Ref<HTMLElement | null>, labels: () => readonly string[]): {
18
+ count: Ref<number>;
19
+ mounted: Ref<boolean>;
20
+ measure: () => void;
21
+ };
@@ -0,0 +1,17 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * How many chips an inside tag list shows before `maxRows` would be exceeded, or `null` for all.
4
+ *
5
+ * Every chip is rendered and its row read from its top. When they take more than `maxRows` rows,
6
+ * the chips on the rows allowed are kept and the "+N" chip added, then one chip at a time is
7
+ * dropped until the "+N" fits on those rows as well (never below one chip).
8
+ *
9
+ * Re-measured when `watched` changes (the selection) and when the field's **width** changes; a height change alone is ignored, because hiding chips is what changes the
10
+ * height, and reacting to it would loop.
11
+ *
12
+ * Client only. On the server and wherever layout reports no boxes, every chip shows.
13
+ */
14
+ export declare function useTagRows(field: Ref<HTMLElement | null>, maxRows: () => number, enabled: () => boolean, watched: () => unknown): {
15
+ visible: Ref<number | null>;
16
+ measure: () => Promise<void>;
17
+ };
@@ -21,9 +21,8 @@ declare const __VLS_base: import('vue').DefineComponent<SiteFormProps, {}, {}, {
21
21
  onError?: ((failure: SiteFormFailure) => any) | undefined;
22
22
  onSuccess?: ((success: SiteFormSuccess) => any) | undefined;
23
23
  }>, {
24
- classes: Partial<Record<import('./types.js').SiteFormPart, string>>;
25
24
  headingLevel: import('../../index.js').FormLayoutHeadingLevel;
26
- layout: import('./types.js').SiteFormLayout;
25
+ classes: Partial<Record<import('./types.js').SiteFormPart, string>>;
27
26
  messages: Partial<{
28
27
  clear: string;
29
28
  close: string;
@@ -42,6 +41,7 @@ declare const __VLS_base: import('vue').DefineComponent<SiteFormProps, {}, {}, {
42
41
  noResults: string;
43
42
  noResultsFor: (query: string) => string;
44
43
  noMatchesFor: (query: string) => string;
44
+ createOption: (query: string) => string;
45
45
  moreSelected: (n: number) => string;
46
46
  removeTag: (label: string) => string;
47
47
  selected: string;
@@ -173,6 +173,7 @@ declare const __VLS_base: import('vue').DefineComponent<SiteFormProps, {}, {}, {
173
173
  formPendingTitle: string;
174
174
  formPendingMessage: string;
175
175
  }>;
176
+ layout: import('./types.js').SiteFormLayout;
176
177
  heading: string;
177
178
  definition: import('@eldrajs/sdk').EldraFormDefinition | null;
178
179
  formKey: string;
@@ -64,8 +64,11 @@ export type SiteFormSubmitOutcome = {
64
64
  kind: 'ignored';
65
65
  };
66
66
  export type SiteFormLayout = 'single' | 'two' | 'inline';
67
- /** The parts `classes` restyles; which inner component each reaches is in the README, "Site forms". */
68
- export type SiteFormPart = 'root' | 'notice' | 'form' | 'heading' | 'errorSummary' | 'fields' | 'actions' | 'field' | 'label' | 'requiredMark' | 'optionalText' | 'error' | 'control' | 'checkbox' | 'turnstile' | 'consentText' | 'submit' | 'success' | 'successTitle' | 'successMessage';
67
+ /**
68
+ * The parts `classes` restyles; which inner component each reaches is in the README, "Site forms".
69
+ * The root is styled with `class`.
70
+ */
71
+ export type SiteFormPart = 'notice' | 'form' | 'heading' | 'errorSummary' | 'fields' | 'actions' | 'field' | 'label' | 'requiredMark' | 'optionalText' | 'error' | 'control' | 'checkbox' | 'turnstile' | 'consentText' | 'submit' | 'success' | 'successTitle' | 'successMessage';
69
72
  export interface SiteFormProps {
70
73
  /** As `client.forms.get(key)` answers it, read in your data loader so the form is server-rendered. */
71
74
  definition?: EldraFormDefinition | null;
@@ -87,5 +90,6 @@ export interface SiteFormProps {
87
90
  /** Follows a site-path redirect (`navigateTo`); an absolute one always uses `location.assign`. */
88
91
  navigate?: (path: string) => void;
89
92
  messages?: Partial<UiMessages>;
93
+ /** Per-part classes, appended to the part's own (a consumer class wins by cascade layer). */
90
94
  classes?: Partial<Record<SiteFormPart, string>>;
91
95
  }
@@ -1,7 +1,7 @@
1
- import { SkeletonPart, SkeletonProps, SkeletonVariant } from './types.js';
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
- classes: Partial<Record<SkeletonPart, string>>;
4
+ classes: Partial<Record<"line", string>>;
5
5
  variant: SkeletonVariant;
6
6
  width: string;
7
7
  ratio: import('../../index.js').ImageRatio;
@@ -2,9 +2,9 @@ import { ImageRatio } from '../image/types.js';
2
2
  /** Spec "Skeleton" → Properties/Variants, `variant` row: the five shape primitives. */
3
3
  export type SkeletonVariant = 'text' | 'title' | 'circle' | 'media' | 'btn';
4
4
  /** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them:
5
- * the region wrapper, and the shimmering shape(s) inside it — one `line` per text row, or one for
6
- * every other variant. */
7
- export type SkeletonPart = 'root' | 'line';
5
+ * the shimmering shape(s) inside the region wrapper — one `line` per text row, or one for every
6
+ * other variant. The region wrapper itself is styled with `class`. */
7
+ export type SkeletonPart = 'line';
8
8
  export interface SkeletonProps {
9
9
  /** The shape. Defaults to `'text'`. */
10
10
  variant?: SkeletonVariant;
@@ -33,6 +33,6 @@ export interface SkeletonProps {
33
33
  * region two competing accessible names.
34
34
  */
35
35
  busyLabel?: string | null;
36
- /** Per-part class overrides, merged over the component's own classes with `tailwind-merge`. */
36
+ /** Per-part classes, appended to the part's own (they win by cascade layer). */
37
37
  classes?: Partial<Record<SkeletonPart, string>>;
38
38
  }
@@ -1,12 +1,16 @@
1
- import { SwitchProps, SwitchSize } from './types.js';
2
- declare const __VLS_template: () => {
3
- __VLS_Slots: {
4
- default?: (props: {}) => any;
5
- } & {
6
- description?: (props: {}) => any;
7
- };
1
+ import { SwitchProps, SwitchSize, SwitchSlotProps } from './types.js';
2
+ type __VLS_Slots = {
3
+ /** The label. */
4
+ default?: () => unknown;
5
+ /** The second line under the label; `description` is its fallback. */
6
+ description?: () => unknown;
7
+ /** Replaces what the thumb draws (the check icon when on, nothing when off). */
8
+ thumb?: (props: SwitchSlotProps) => unknown;
9
+ /** Drawn on the track where the thumb rests when off, so it shows while the switch is on. */
10
+ trackStart?: (props: SwitchSlotProps) => unknown;
11
+ /** Drawn on the track where the thumb rests when on, so it shows while the switch is off. */
12
+ trackEnd?: (props: SwitchSlotProps) => unknown;
8
13
  };
9
- type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
10
14
  declare const __VLS_base: import('vue').DefineComponent<SwitchProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
15
  "update:modelValue": (checked: boolean) => any;
12
16
  change: (checked: boolean) => any;
@@ -14,12 +18,15 @@ declare const __VLS_base: import('vue').DefineComponent<SwitchProps, {}, {}, {},
14
18
  "onUpdate:modelValue"?: ((checked: boolean) => any) | undefined;
15
19
  onChange?: ((checked: boolean) => any) | undefined;
16
20
  }>, {
17
- size: SwitchSize;
18
21
  name: string;
19
- classes: Partial<Record<import('./types.js').SwitchPart, string>>;
22
+ size: SwitchSize;
20
23
  modelValue: boolean;
24
+ classes: Partial<Record<import('./types.js').SwitchPart, string>>;
25
+ error: string;
21
26
  id: string;
22
27
  disabled: boolean;
28
+ invalid: boolean;
29
+ requiredMark: boolean;
23
30
  description: string;
24
31
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
32
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,5 +1,13 @@
1
1
  /** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them. */
2
- export type SwitchPart = 'root' | 'track' | 'thumb' | 'label' | 'description';
2
+ export type SwitchPart = 'track' | 'thumb' | 'label' | 'description' | 'trackStart' | 'trackEnd' | 'requiredMark' | 'error' | 'errorIcon';
3
+ /** What the `thumb`, `trackStart` and `trackEnd` slots are handed. Their content is decorative
4
+ * (`aria-hidden`): the switch's name and `aria-checked` carry the meaning. */
5
+ export interface SwitchSlotProps {
6
+ /** On or off. */
7
+ checked: boolean;
8
+ /** Whether the switch is disabled. */
9
+ disabled: boolean;
10
+ }
3
11
  /** The spec's two sizes: the default and the filter-bar/dense-list compact one. */
4
12
  export type SwitchSize = 'md' | 'sm';
5
13
  export interface SwitchProps {
@@ -11,10 +19,29 @@ export interface SwitchProps {
11
19
  description?: string;
12
20
  /** Native `disabled`. */
13
21
  disabled?: boolean;
22
+ /**
23
+ * Shows `FieldWrapper`'s `*` after the label text, with the visually hidden "Required" message
24
+ * (a switch has no native `required` to announce it). Default `false`.
25
+ */
26
+ requiredMark?: boolean;
27
+ /**
28
+ * An error message drawn under the switch in `FieldWrapper`'s error row, linked first in
29
+ * `aria-describedby`, and `aria-invalid="true"` on the switch. The row is a sibling after it.
30
+ */
31
+ error?: string;
32
+ /**
33
+ * `aria-invalid="true"` on the switch without an error row, for a caller that shows its own
34
+ * message, like `RadioGroup`'s `invalid`. The Switch design draws no danger state on the track,
35
+ * so `error` and `invalid` change nothing visual on the control. Default `false`.
36
+ */
37
+ invalid?: boolean;
14
38
  /** The control's id. Comes from the `FieldWrapper` when there is one; this wins over it. */
15
39
  id?: string;
16
40
  /** Native form field name, carried by the hidden mirror `<input type="checkbox">`. */
17
41
  name?: string;
18
- /** Per-part class overrides, merged with `tailwind-merge`. */
42
+ /**
43
+ * Per-part classes, appended to the part's own (a consumer class wins by cascade layer). The
44
+ * root (the `<button>`) is styled with `class`.
45
+ */
19
46
  classes?: Partial<Record<SwitchPart, string>>;
20
47
  }
@@ -1,9 +1,8 @@
1
1
  import { TablerIconProps } from './types.js';
2
2
  declare const __VLS_export: import('vue').DefineComponent<TablerIconProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TablerIconProps> & Readonly<{}>, {
3
- size: import('../../index.js').IconSize;
4
- label: string;
5
3
  name: string | null;
6
- classes: Partial<Record<"root", string>>;
4
+ label: string;
5
+ size: import('../../index.js').IconSize;
7
6
  strokeWidth: number;
8
7
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
9
8
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,4 @@
1
1
  import { IconSize } from '../icon/types.js';
2
- /** The parts a consumer can restyle through `classes`. */
3
- export type TablerIconPart = 'root';
4
2
  export interface TablerIconProps {
5
3
  /** A `tabler-icon` field value: Tabler's kebab-case name (`cash-register`), which Studio and the MCP store, or the older export name (`IconCashRegister`) that content saved before 17 Oct 2026 may hold. Empty renders nothing. */
6
4
  name?: string | null;
@@ -10,6 +8,4 @@ export interface TablerIconProps {
10
8
  label?: string;
11
9
  /** The outline stroke width. Defaults to the spec's 1.75; a filled icon has no stroke. */
12
10
  strokeWidth?: number;
13
- /** Per-part class overrides, merged with `tailwind-merge`. */
14
- classes?: Partial<Record<TablerIconPart, string>>;
15
11
  }
@@ -7,7 +7,8 @@ declare const __VLS_template: () => {
7
7
  type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
8
8
  declare const __VLS_base: import('vue').DefineComponent<TabProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TabProps> & Readonly<{}>, {
9
9
  title: string;
10
- classes: Partial<Record<import('./types.js').TabPart, string>>;
10
+ classes: Partial<Record<"indicator", string>>;
11
+ disabled: boolean;
11
12
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
13
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
14
  declare const _default: typeof __VLS_export;
@@ -5,9 +5,7 @@ declare const __VLS_template: () => {
5
5
  };
6
6
  };
7
7
  type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
8
- declare const __VLS_base: import('vue').DefineComponent<TabPanelProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TabPanelProps> & Readonly<{}>, {
9
- classes: Partial<Record<"panel", string>>;
10
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
8
+ declare const __VLS_base: import('vue').DefineComponent<TabPanelProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TabPanelProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
9
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
10
  declare const _default: typeof __VLS_export;
13
11
  export default _default;
@@ -14,8 +14,8 @@ declare const __VLS_base: import('vue').DefineComponent<TabsProps, {}, {}, {}, {
14
14
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
15
15
  onChange?: ((value: string) => any) | undefined;
16
16
  }>, {
17
- classes: Partial<Record<import('./types.js').TabsPart, string>>;
18
17
  modelValue: string;
18
+ classes: Partial<Record<import('./types.js').TabsPart, string>>;
19
19
  variant: import('./types.js').TabsVariant;
20
20
  items: import('./types.js').TabsItem[];
21
21
  activation: import('./types.js').TabsActivation;
@@ -6,6 +6,9 @@ export interface TabsEntry {
6
6
  value: string;
7
7
  /** Moves real DOM focus to this tab's `<button>`. */
8
8
  focus: () => void;
9
+ /** Whether the tab is disabled now: skipped by the arrow keys and never the default selection.
10
+ * Optional, so an entry registered without it reads as enabled. */
11
+ disabled?: () => boolean;
9
12
  }
10
13
  /**
11
14
  * What `Tabs` provides, and every `Tab`/`TabPanel` injects.
@@ -35,9 +38,10 @@ export interface TabsContext {
35
38
  /** Adds a `Tab` to the registration order. Returns the function that removes it again. */
36
39
  register: (entry: TabsEntry) => () => void;
37
40
  /** `ArrowRight` (`delta` 1) / `ArrowLeft` (`delta` -1) from `current`: moves focus to the next
38
- * tab, wrapping at the ends, and — under automatic activation — selects it too. */
41
+ * tab that is not disabled, wrapping at the ends, and — under automatic activation — selects it too. */
39
42
  moveFocus: (current: string, delta: 1 | -1) => void;
40
- /** `Home` (`'first'`) / `End` (`'last'`): same as `moveFocus`, but to an end of the list. */
43
+ /** `Home` (`'first'`) / `End` (`'last'`): same as `moveFocus`, but to the first / last tab that
44
+ * is not disabled. */
41
45
  focusEdge: (edge: 'first' | 'last') => void;
42
46
  /** The `id` a `Tab` with this value renders, and what its `TabPanel`'s `aria-labelledby` reads. */
43
47
  tabId: (value: string) => string;
@@ -1,9 +1,9 @@
1
1
  /** The parts a consumer can restyle through `Tabs`' `classes`, named as the spec's anatomy names
2
2
  * them. `tab`, `indicator` and `panel` are drawn by the `Tab`/`TabPanel` children — in items mode
3
3
  * `Tabs` forwards its own `classes.tab`/`.indicator`/`.panel` down to the children it renders; in
4
- * slots mode a consumer restyles a single `Tab`/`TabPanel` through that component's own `classes`
5
- * instead (see `TabPart`/`TabPanelPart` below). */
6
- export type TabsPart = 'root' | 'list' | 'tab' | 'indicator' | 'panel';
4
+ * slots mode a consumer restyles a single `Tab`/`TabPanel` through that component's own `class`
5
+ * (and a `Tab`'s `classes.indicator`) instead. */
6
+ export type TabsPart = 'list' | 'tab' | 'indicator' | 'panel';
7
7
  /** Underline (default): a bar under the selected tab, sitting on the list's hairline. Pills: a
8
8
  * filled, fully-rounded button — the fill itself is the "indicator". */
9
9
  export type TabsVariant = 'underline' | 'pills';
@@ -19,6 +19,8 @@ export interface TabsItem {
19
19
  title: string;
20
20
  /** The panel's plain-text content. Use the slots API instead for richer panel content. */
21
21
  content?: string;
22
+ /** Not selectable, skipped by the arrow keys and `Home`/`End`. See `TabProps.disabled`. */
23
+ disabled?: boolean;
22
24
  }
23
25
  export interface TabsProps {
24
26
  /** The selected tab's value (two-way). Defaults to the first tab — the first `Tab` to register,
@@ -38,11 +40,15 @@ export interface TabsProps {
38
40
  * `tabs` slot (for `Tab`s) and the default slot (for `TabPanel`s) instead for panel content
39
41
  * richer than plain text. */
40
42
  items?: TabsItem[];
41
- /** Per-part class overrides, merged with `tailwind-merge`. */
43
+ /**
44
+ * Per-part classes, appended to the part's own (they win by cascade layer). Style the root
45
+ * itself with `class`.
46
+ */
42
47
  classes?: Partial<Record<TabsPart, string>>;
43
48
  }
44
- /** The parts a consumer can restyle through a standalone `<Tab>`'s `classes`. */
45
- export type TabPart = 'tab' | 'indicator';
49
+ /** The part a consumer can restyle through a standalone `<Tab>`'s `classes`; the tab itself takes
50
+ * `class`. */
51
+ export type TabPart = 'indicator';
46
52
  export interface TabProps {
47
53
  /** This tab's value — what `Tabs`' `modelValue` holds when it is selected, and what
48
54
  * `aria-controls`/the matching `TabPanel`'s `value` are keyed by. */
@@ -50,14 +56,19 @@ export interface TabProps {
50
56
  /** The visible label. Also the default slot's fallback, the same shape `Button`'s `label` and
51
57
  * default slot follow. */
52
58
  title?: string;
53
- /** Per-part class overrides, merged with `tailwind-merge`. */
59
+ /**
60
+ * The tab cannot be selected: a click does nothing, the arrow keys and `Home`/`End` skip it, and
61
+ * it carries `aria-disabled="true"` rather than native `disabled`, so a disabled tab that is
62
+ * already selected stays the list's one tab stop. The default selection is the first tab that is
63
+ * not disabled. Defaults to `false`.
64
+ */
65
+ disabled?: boolean;
66
+ /** Per-part classes, appended to the part's own (they win by cascade layer). */
54
67
  classes?: Partial<Record<TabPart, string>>;
55
68
  }
56
- /** The one part a consumer can restyle through a standalone `<TabPanel>`'s `classes`. */
57
- export type TabPanelPart = 'panel';
69
+ /** `TabPanel` has no inner parts: style the panel itself with `class`. */
70
+ export type TabPanelPart = never;
58
71
  export interface TabPanelProps {
59
72
  /** The `Tab` this panel belongs to — must match that tab's own `value`. */
60
73
  value: string;
61
- /** Per-part class overrides, merged with `tailwind-merge`. */
62
- classes?: Partial<Record<TabPanelPart, string>>;
63
74
  }
@@ -1,27 +1,47 @@
1
1
  import { TextareaProps } from './types.js';
2
- declare const __VLS_export: import('vue').DefineComponent<TextareaProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
2
+ declare const __VLS_template: () => {
3
+ __VLS_Slots: {
4
+ prefix?: (props: {}) => any;
5
+ } & {
6
+ suffix?: (props: {}) => any;
7
+ };
8
+ };
9
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
10
+ declare const __VLS_base: import('vue').DefineComponent<TextareaProps, {
11
+ control: import('vue').Ref<HTMLTextAreaElement | null, HTMLTextAreaElement | null>;
12
+ focus: () => void | undefined;
13
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
14
  input: (value: string) => any;
4
15
  "update:modelValue": (value: string) => any;
16
+ clear: () => any;
5
17
  change: (value: string) => any;
6
18
  }, string, import('vue').PublicProps, Readonly<TextareaProps> & Readonly<{
7
19
  onInput?: ((value: string) => any) | undefined;
8
20
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
21
+ onClear?: (() => any) | undefined;
9
22
  onChange?: ((value: string) => any) | undefined;
10
23
  }>, {
11
- counter: boolean;
12
24
  name: string;
13
- classes: Partial<Record<import('./types.js').TextareaPart, string>>;
25
+ counter: boolean;
14
26
  modelValue: string;
27
+ classes: Partial<Record<import('./types.js').TextareaPart, string>>;
15
28
  required: boolean;
16
29
  placeholder: string;
17
30
  id: string;
18
31
  disabled: boolean;
19
32
  invalid: boolean;
20
33
  describedBy: string;
34
+ clearable: boolean;
21
35
  readonly: boolean;
22
36
  maxLength: number;
23
37
  hardLimit: boolean;
24
38
  minHeight: string;
25
39
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
40
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
41
  declare const _default: typeof __VLS_export;
27
42
  export default _default;
43
+ type __VLS_WithSlots<T, S> = T & {
44
+ new (): {
45
+ $slots: S;
46
+ };
47
+ };
@@ -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 TextareaPart = 'root' | 'control' | 'foot' | 'counter';
2
+ export type TextareaPart = 'prefix' | 'control' | 'clearButton' | 'suffix' | 'foot' | 'counter';
3
3
  export interface TextareaProps {
4
4
  /** The text (two-way). */
5
5
  modelValue?: string;
@@ -11,9 +11,18 @@ export interface TextareaProps {
11
11
  counter?: boolean;
12
12
  /** Also sets the native `maxlength`, so typing stops at the limit. */
13
13
  hardLimit?: boolean;
14
+ /**
15
+ * Shows `Input`'s clear button at the end of the first line while there is a value and the field
16
+ * can be edited. Clicking it empties the field, emits `clear` and returns focus. Defaults to
17
+ * `false`.
18
+ */
19
+ clearable?: boolean;
14
20
  /** Size to the expected answer, in rem. Defaults to `5rem` (about 3 lines). */
15
21
  minHeight?: string;
16
- /** Sets `aria-invalid="true"`. Comes from the `FieldWrapper` otherwise. */
22
+ /**
23
+ * Sets `aria-invalid="true"`. Comes from the `FieldWrapper` otherwise. While it is not invalid,
24
+ * an `aria-invalid` attribute the caller passes is kept.
25
+ */
17
26
  invalid?: boolean;
18
27
  /** Native `required`. Comes from the `FieldWrapper` otherwise. */
19
28
  required?: boolean;
@@ -27,6 +36,9 @@ export interface TextareaProps {
27
36
  name?: string;
28
37
  /** `aria-describedby` ids, error id first. Comes from the `FieldWrapper` otherwise. */
29
38
  describedBy?: string;
30
- /** Per-part class overrides, merged with `tailwind-merge`. */
39
+ /**
40
+ * Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
41
+ * `class`.
42
+ */
31
43
  classes?: Partial<Record<TextareaPart, string>>;
32
44
  }
@@ -27,6 +27,7 @@ declare const __VLS_export: import('vue').DefineComponent<ToastProps, {}, {}, {}
27
27
  noResults: string;
28
28
  noResultsFor: (query: string) => string;
29
29
  noMatchesFor: (query: string) => string;
30
+ createOption: (query: string) => string;
30
31
  moreSelected: (n: number) => string;
31
32
  removeTag: (label: string) => string;
32
33
  selected: string;
@@ -159,6 +160,7 @@ declare const __VLS_export: import('vue').DefineComponent<ToastProps, {}, {}, {}
159
160
  formPendingMessage: string;
160
161
  }>;
161
162
  action: import('./types.js').ToastAction;
163
+ closable: boolean;
162
164
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
163
165
  declare const _default: typeof __VLS_export;
164
166
  export default _default;
@@ -1,4 +1,4 @@
1
- import { ToasterProps } from './types.js';
1
+ import { ToasterPosition, ToasterProps, ToasterToast } from './types.js';
2
2
  declare const __VLS_export: import('vue').DefineComponent<ToasterProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
3
  action: (id: string) => any;
4
4
  dismiss: (id: string, reason: "button" | "escape" | "timeout") => any;
@@ -6,6 +6,7 @@ declare const __VLS_export: import('vue').DefineComponent<ToasterProps, {}, {},
6
6
  onAction?: ((id: string) => any) | undefined;
7
7
  onDismiss?: ((id: string, reason: "button" | "escape" | "timeout") => any) | undefined;
8
8
  }>, {
9
+ position: ToasterPosition;
9
10
  classes: Partial<Record<import('./types.js').ToasterPart, string>>;
10
11
  messages: Partial<{
11
12
  clear: string;
@@ -25,6 +26,7 @@ declare const __VLS_export: import('vue').DefineComponent<ToasterProps, {}, {},
25
26
  noResults: string;
26
27
  noResultsFor: (query: string) => string;
27
28
  noMatchesFor: (query: string) => string;
29
+ createOption: (query: string) => string;
28
30
  moreSelected: (n: number) => string;
29
31
  removeTag: (label: string) => string;
30
32
  selected: string;
@@ -156,6 +158,10 @@ declare const __VLS_export: import('vue').DefineComponent<ToasterProps, {}, {},
156
158
  formPendingTitle: string;
157
159
  formPendingMessage: string;
158
160
  }>;
161
+ teleportTo: string | HTMLElement;
162
+ toasts: ToasterToast[];
163
+ maxVisible: number;
164
+ newestOnTop: boolean;
159
165
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
160
166
  declare const _default: typeof __VLS_export;
161
167
  export default _default;