@eldrajs/ui 0.2.9 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +171 -151
  3. package/dist/{VariantPicker-Da41_oGA.js → VariantPicker-DDFlMvgJ.js} +1222 -833
  4. package/dist/components/accordion/Accordion.vue.d.ts +1 -2
  5. package/dist/components/accordion/AccordionItem.vue.d.ts +1 -1
  6. package/dist/components/accordion/types.d.ts +6 -7
  7. package/dist/components/avatar/Avatar.vue.d.ts +1 -1
  8. package/dist/components/avatar/types.d.ts +6 -4
  9. package/dist/components/badge/types.d.ts +6 -4
  10. package/dist/components/breadcrumb/types.d.ts +5 -2
  11. package/dist/components/button/Button.vue.d.ts +3 -3
  12. package/dist/components/button/ButtonGroup.vue.d.ts +0 -1
  13. package/dist/components/button/types.d.ts +7 -6
  14. package/dist/components/card/ContentCard.vue.d.ts +1 -1
  15. package/dist/components/card/FeatureCard.vue.d.ts +1 -1
  16. package/dist/components/card/stretchedLink.d.ts +3 -3
  17. package/dist/components/card/types.d.ts +6 -4
  18. package/dist/components/carousel/types.d.ts +7 -3
  19. package/dist/components/checkbox/Checkbox.vue.d.ts +3 -3
  20. package/dist/components/checkbox/CheckboxGroup.vue.d.ts +1 -1
  21. package/dist/components/checkbox/types.d.ts +10 -4
  22. package/dist/components/chip/Chip.vue.d.ts +1 -1
  23. package/dist/components/chip/ChipGroup.vue.d.ts +0 -1
  24. package/dist/components/chip/types.d.ts +5 -6
  25. package/dist/components/container/Container.vue.d.ts +0 -1
  26. package/dist/components/container/types.d.ts +0 -4
  27. package/dist/components/dialog/Dialog.vue.d.ts +2 -2
  28. package/dist/components/dialog/types.d.ts +5 -2
  29. package/dist/components/drawer/Drawer.vue.d.ts +1 -1
  30. package/dist/components/drawer/types.d.ts +5 -2
  31. package/dist/components/empty-state/EmptyState.vue.d.ts +1 -1
  32. package/dist/components/empty-state/types.d.ts +7 -6
  33. package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +1 -1
  34. package/dist/components/field-wrapper/types.d.ts +5 -2
  35. package/dist/components/filter-panel/FilterPanel.vue.d.ts +4 -4
  36. package/dist/components/filter-panel/facets/shared.d.ts +4 -4
  37. package/dist/components/filter-panel/types.d.ts +5 -2
  38. package/dist/components/form-layout/FormLayout.vue.d.ts +1 -1
  39. package/dist/components/form-layout/types.d.ts +5 -2
  40. package/dist/components/icon/Icon.vue.d.ts +1 -2
  41. package/dist/components/icon/types.d.ts +0 -4
  42. package/dist/components/image/types.d.ts +3 -2
  43. package/dist/components/input/Input.vue.d.ts +6 -6
  44. package/dist/components/input/classes.d.ts +25 -19
  45. package/dist/components/input/types.d.ts +5 -2
  46. package/dist/components/lightbox/Lightbox.vue.d.ts +1 -1
  47. package/dist/components/lightbox/types.d.ts +5 -2
  48. package/dist/components/link/Link.vue.d.ts +1 -1
  49. package/dist/components/link/types.d.ts +5 -2
  50. package/dist/components/load-more/types.d.ts +4 -3
  51. package/dist/components/logo-item/LogoItem.vue.d.ts +1 -1
  52. package/dist/components/logo-item/types.d.ts +2 -1
  53. package/dist/components/nav-menu/NavMenu.vue.d.ts +1 -1
  54. package/dist/components/nav-menu/navLinks.d.ts +1 -1
  55. package/dist/components/nav-menu/types.d.ts +3 -3
  56. package/dist/components/pagination/types.d.ts +5 -2
  57. package/dist/components/popover/Popover.vue.d.ts +1 -1
  58. package/dist/components/popover/types.d.ts +5 -6
  59. package/dist/components/price/types.d.ts +3 -2
  60. package/dist/components/product-card/ProductCard.vue.d.ts +1 -1
  61. package/dist/components/product-card/types.d.ts +3 -2
  62. package/dist/components/quantity-stepper/QuantityStepper.vue.d.ts +4 -4
  63. package/dist/components/quantity-stepper/types.d.ts +5 -2
  64. package/dist/components/radio/Radio.vue.d.ts +3 -3
  65. package/dist/components/radio/RadioGroup.vue.d.ts +3 -3
  66. package/dist/components/radio/recipes.d.ts +11 -7
  67. package/dist/components/radio/types.d.ts +11 -5
  68. package/dist/components/range-slider/RangeSlider.vue.d.ts +1 -1
  69. package/dist/components/range-slider/types.d.ts +5 -2
  70. package/dist/components/rating/Rating.vue.d.ts +1 -1
  71. package/dist/components/rating/types.d.ts +3 -2
  72. package/dist/components/search-bar/SearchBar.vue.d.ts +3 -3
  73. package/dist/components/search-bar/SearchResultsPanel.vue.d.ts +1 -1
  74. package/dist/components/search-bar/types.d.ts +5 -2
  75. package/dist/components/search-modal/SearchModal.vue.d.ts +2 -2
  76. package/dist/components/search-modal/types.d.ts +7 -4
  77. package/dist/components/section/Section.vue.d.ts +0 -1
  78. package/dist/components/section/types.d.ts +0 -4
  79. package/dist/components/select/MultiSelect.vue.d.ts +5 -5
  80. package/dist/components/select/Select.vue.d.ts +4 -4
  81. package/dist/components/select/SelectPanel.vue.d.ts +2 -2
  82. package/dist/components/select/panelParts.d.ts +21 -20
  83. package/dist/components/select/types.d.ts +10 -4
  84. package/dist/components/site-form/SiteForm.vue.d.ts +1 -1
  85. package/dist/components/site-form/types.d.ts +6 -2
  86. package/dist/components/skeleton/Skeleton.vue.d.ts +3 -2
  87. package/dist/components/skeleton/types.d.ts +16 -6
  88. package/dist/components/switch/Switch.vue.d.ts +2 -2
  89. package/dist/components/switch/types.d.ts +5 -2
  90. package/dist/components/tabler-icon/TablerIcon.vue.d.ts +2 -3
  91. package/dist/components/tabler-icon/types.d.ts +0 -4
  92. package/dist/components/tabs/Tab.vue.d.ts +1 -1
  93. package/dist/components/tabs/TabPanel.vue.d.ts +1 -3
  94. package/dist/components/tabs/Tabs.vue.d.ts +1 -1
  95. package/dist/components/tabs/types.d.ts +13 -11
  96. package/dist/components/textarea/Textarea.vue.d.ts +4 -4
  97. package/dist/components/textarea/types.d.ts +5 -2
  98. package/dist/components/toast/types.d.ts +9 -3
  99. package/dist/components/tooltip/types.d.ts +4 -3
  100. package/dist/components/unit-input/UnitInput.vue.d.ts +7 -7
  101. package/dist/components/unit-input/types.d.ts +5 -2
  102. package/dist/components/variant-picker/VariantPicker.vue.d.ts +1 -1
  103. package/dist/components/variant-picker/types.d.ts +3 -2
  104. package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +0 -1
  105. package/dist/components/visually-hidden/types.d.ts +0 -4
  106. package/dist/components.css +1481 -2342
  107. package/dist/composables/useDialog.d.ts +9 -1
  108. package/dist/composables/useEldraScope.d.ts +7 -9
  109. package/dist/index.d.ts +5 -6
  110. package/dist/index.js +1380 -884
  111. package/dist/style.css +1487 -2348
  112. package/dist/tailwind.css +11 -2234
  113. package/dist/theme.css +108 -0
  114. package/dist/tokens.css +1 -0
  115. package/dist/utilities.css +2228 -0
  116. package/dist/utils/mergeClass.d.ts +3 -0
  117. package/dist/utils/tagRecipe.d.ts +3 -3
  118. package/dist/vee-validate.js +1 -1
  119. package/package.json +4 -3
  120. package/dist/scoped.css +0 -4623
  121. package/dist/utils/cx.d.ts +0 -31
@@ -1,7 +1,7 @@
1
1
  /** The parts a consumer can restyle through `classes`, named as this package's own contract names
2
2
  * them (spec "Quantity stepper" → Anatomy draws the same four controls plus the error row every
3
3
  * other field in this package shows the same way). */
4
- export type QuantityStepperPart = 'root' | 'decrease' | 'input' | 'increase' | 'error';
4
+ export type QuantityStepperPart = 'decrease' | 'input' | 'increase' | 'error';
5
5
  /** The spec's two sizes (spec "Quantity stepper" → Sizes): the default and the cart-line/filter
6
6
  * compact one. */
7
7
  export type QuantityStepperSize = 'md' | 'sm';
@@ -30,6 +30,9 @@ export interface QuantityStepperProps {
30
30
  * whatever `provideEldraUiLocale` set for the app, and to `"en-US"` with nothing provided.
31
31
  */
32
32
  locale?: string;
33
- /** Per-part class overrides, merged with `tailwind-merge`. */
33
+ /**
34
+ * Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
35
+ * `class`.
36
+ */
34
37
  classes?: Partial<Record<QuantityStepperPart, string>>;
35
38
  }
@@ -14,11 +14,11 @@ declare const __VLS_base: import('vue').DefineComponent<RadioProps, {}, {}, {},
14
14
  "onUpdate:modelValue"?: ((value: RadioValue) => any) | undefined;
15
15
  onChange?: ((value: RadioValue) => any) | undefined;
16
16
  }>, {
17
- size: import('./types.js').RadioGroupSize;
18
- label: string;
19
17
  name: string;
20
- classes: Partial<Record<import('./types.js').RadioPart, string>>;
18
+ label: string;
19
+ size: import('./types.js').RadioGroupSize;
21
20
  modelValue: RadioValue;
21
+ classes: Partial<Record<import('./types.js').RadioPart, string>>;
22
22
  disabled: boolean;
23
23
  invalid: boolean;
24
24
  hint: string;
@@ -22,12 +22,12 @@ declare const __VLS_base: import('vue').DefineComponent<RadioGroupProps, {}, {},
22
22
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
23
23
  onChange?: ((value: string) => any) | undefined;
24
24
  }>, {
25
- size: RadioGroupSize;
26
- name: string;
27
25
  help: string;
28
- classes: Partial<Record<import('./types.js').RadioGroupPart, string>>;
26
+ name: string;
29
27
  legend: string;
28
+ size: RadioGroupSize;
30
29
  modelValue: string;
30
+ classes: Partial<Record<import('./types.js').RadioGroupPart, string>>;
31
31
  required: boolean;
32
32
  error: string;
33
33
  invalid: boolean;
@@ -9,7 +9,11 @@ import { RadioGroupSize } from './types.js';
9
9
  * row never renders `meta`, so it only ever fills the first two columns; see `Checkbox.vue` for
10
10
  * the two-column version this is built from.
11
11
  */
12
- export declare const PLAIN_OPTION = "group grid w-fit max-w-full grid-cols-[auto_1fr] items-start gap-x-2.5 gap-y-0.5 target-min";
12
+ export declare const PLAIN_OPTION = "eldra:group eldra:grid eldra:w-fit eldra:max-w-full eldra:items-start eldra:gap-y-0.5 eldra:target-min";
13
+ /** The radio and its text column. */
14
+ export declare const PLAIN_COLUMNS = "eldra:grid-cols-[auto_1fr] eldra:gap-x-2.5";
15
+ /** A radio with no label and no hint: the circle alone. */
16
+ export declare const PLAIN_BOX_ONLY = "eldra:grid-cols-[auto] eldra:gap-x-0";
13
17
  /** The cursor a row (or card) shows: the whole option is the label, so it is the target. */
14
18
  export declare function optionCursor(disabled: boolean | undefined): string;
15
19
  export interface RadioState {
@@ -17,21 +21,21 @@ export interface RadioState {
17
21
  disabled?: boolean;
18
22
  invalid?: boolean;
19
23
  }
20
- /** The drawn circle, before `classes.radio` is merged in. */
21
- export declare function radioRecipe(size: RadioGroupSize, state: RadioState): string;
24
+ /** The drawn circle, before `classes.radio` is appended. */
25
+ export declare function radioRecipe(size: RadioGroupSize, state: RadioState): string[];
22
26
  /**
23
27
  * The dot (spec "Radio group" → Sizes: "0.5rem dot"). One fixed size regardless of `size`, the
24
28
  * same choice `Checkbox` makes for its tick — only the circle around it grows. No `data-part` of
25
29
  * its own: the API contract's part list has no entry for it, unlike `Checkbox`'s `check`.
26
30
  */
27
- export declare function dotRecipe(selected: boolean): string;
31
+ export declare function dotRecipe(selected: boolean): string[];
28
32
  /** The native radio: invisible but hit-testable, stretched over the drawn circle. */
29
- export declare const INPUT = "absolute inset-0 m-0 size-full cursor-pointer appearance-none opacity-0 disabled:cursor-not-allowed";
33
+ export declare const INPUT = "eldra:absolute eldra:inset-0 eldra:m-0 eldra:size-full eldra:cursor-pointer eldra:appearance-none eldra:opacity-0 eldra:disabled:cursor-not-allowed";
30
34
  /**
31
35
  * Spec "Radio group" → Sizes: "Plain row … 0.9375rem / 1.5rem text" for plain layouts, "Card title
32
36
  * … 1rem 600 (line-height 1.4)" for cards — the same two type utilities `Checkbox`'s label and the
33
37
  * `text-card-title` utility (see `tailwind.css`) already give those numbers.
34
38
  */
35
- export declare function labelRecipe(card: boolean, disabled: boolean | undefined): string;
39
+ export declare function labelRecipe(card: boolean, disabled: boolean | undefined): string[];
36
40
  /** Spec "Radio group" → Sizes: the hint is `muted` in every layout, under the label's column. */
37
- export declare const HINT = "text-body-sm text-muted col-start-2 min-w-0";
41
+ export declare const HINT = "eldra:text-body-sm eldra:text-muted eldra:col-start-2 eldra:min-w-0";
@@ -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 RadioGroupPart = 'root' | 'legend' | 'requiredMark' | 'options' | 'option' | 'radio' | 'input' | 'dot' | 'label' | 'hint' | 'meta' | 'help' | 'error' | 'errorIcon';
2
+ export type RadioGroupPart = 'legend' | 'requiredMark' | 'options' | 'option' | 'radio' | 'input' | 'dot' | 'label' | 'hint' | 'meta' | 'help' | 'error' | 'errorIcon';
3
3
  /** The spec's two radio sizes: 1.125rem or 1.5rem. Plain layouts only — a card's radio is fixed. */
4
4
  export type RadioGroupSize = 'md' | 'lg';
5
5
  /** `vertical` (default), `row` (wraps, for short labels) or `cards` (the whole option is a card). */
@@ -67,11 +67,17 @@ export interface RadioGroupProps {
67
67
  * a caller that shows its own message. `error` implies it.
68
68
  */
69
69
  invalid?: boolean;
70
- /** Per-part class overrides, merged with `tailwind-merge`. */
70
+ /**
71
+ * Per-part classes, appended to the part's own (a consumer class wins by cascade layer). The
72
+ * root (the `<fieldset>`) is styled with `class`.
73
+ */
71
74
  classes?: Partial<Record<RadioGroupPart, string>>;
72
75
  }
73
- /** The parts of a standalone `Radio`: the same names as one `RadioGroup` option's parts. */
74
- export type RadioPart = 'option' | 'radio' | 'input' | 'dot' | 'label' | 'hint';
76
+ /**
77
+ * The parts of a standalone `Radio`: the same names as one `RadioGroup` option's parts. The root
78
+ * `<label>` (the `option` part) is styled with `class`.
79
+ */
80
+ export type RadioPart = 'radio' | 'input' | 'dot' | 'label' | 'hint';
75
81
  /** The values a standalone `Radio` and its group's model hold. */
76
82
  export type RadioValue = string | number;
77
83
  export interface RadioProps {
@@ -95,6 +101,6 @@ export interface RadioProps {
95
101
  disabled?: boolean;
96
102
  /** Draws the error state and sets `aria-invalid="true"`. */
97
103
  invalid?: boolean;
98
- /** Per-part class overrides, merged with `tailwind-merge`. */
104
+ /** Per-part classes, appended to the part's own (a consumer class wins by cascade layer). */
99
105
  classes?: Partial<Record<RadioPart, string>>;
100
106
  }
@@ -23,8 +23,8 @@ declare const __VLS_base: import('vue').DefineComponent<RangeSliderProps, {}, {}
23
23
  onChange?: ((value: RangeSliderValue) => any) | undefined;
24
24
  }>, {
25
25
  label: string;
26
- classes: Partial<Record<import('./types.js').RangeSliderPart, string>>;
27
26
  modelValue: RangeSliderValue;
27
+ classes: Partial<Record<import('./types.js').RangeSliderPart, string>>;
28
28
  max: number;
29
29
  step: number;
30
30
  disabled: boolean;
@@ -5,7 +5,7 @@ import { UiMessages } from '../../messages/en-US.js';
5
5
  * one class string styles the pair, and each element carries a `data-thumb` / `data-input`
6
6
  * attribute of `"min"` or `"max"` for the rare rule that has to tell them apart.
7
7
  */
8
- export type RangeSliderPart = 'root' | 'label' | 'group' | 'rail' | 'track' | 'range' | 'thumb' | 'inputs' | 'input' | 'separator';
8
+ export type RangeSliderPart = 'label' | 'group' | 'rail' | 'track' | 'range' | 'thumb' | 'inputs' | 'input' | 'separator';
9
9
  /** Which end of the range a value, a thumb or a field belongs to. */
10
10
  export type RangeSliderThumb = 'min' | 'max';
11
11
  /**
@@ -144,7 +144,10 @@ export interface RangeSliderProps {
144
144
  * nothing left to render at all, which is this prop's business to allow, not to guard against.
145
145
  */
146
146
  trackVisible?: boolean;
147
- /** Per-part class overrides, merged with `tailwind-merge`. */
147
+ /**
148
+ * Per-part classes, appended to the part's own (a consumer class wins by cascade layer). The
149
+ * root is styled with `class`.
150
+ */
148
151
  classes?: Partial<Record<RangeSliderPart, string>>;
149
152
  /** Overrides for the strings this component renders itself (the thumb names, the word "to"). */
150
153
  messages?: Partial<UiMessages>;
@@ -7,8 +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<RatingProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<RatingProps> & Readonly<{}>, {
9
9
  size: import('./types.js').RatingSize;
10
- classes: Partial<Record<import('./types.js').RatingPart, string>>;
11
10
  href: string | null;
11
+ classes: Partial<Record<import('./types.js').RatingPart, string>>;
12
12
  as: string | import('vue').Component;
13
13
  count: number;
14
14
  showValue: boolean;
@@ -8,7 +8,7 @@ export type RatingSize = 'md' | 'lg';
8
8
  * `link` (the anchor the linked variant wraps its content in — see `Rating.vue`'s own comment on
9
9
  * why that is a second element rather than the root itself changing tag).
10
10
  */
11
- export type RatingPart = 'root' | 'stars' | 'star' | 'value' | 'count' | 'empty' | 'link';
11
+ export type RatingPart = 'stars' | 'star' | 'value' | 'count' | 'empty' | 'link';
12
12
  export interface RatingProps {
13
13
  /**
14
14
  * Average rating, 0–5. Rounded to the nearest half star for both the stars and the visible
@@ -40,6 +40,7 @@ export interface RatingProps {
40
40
  * receives the destination as `to` instead of `href` — the same contract as `Link`'s `as`.
41
41
  */
42
42
  as?: string | Component;
43
- /** Per-part class overrides, merged with `tailwind-merge`. */
43
+ /** Per-part classes, appended to the kit's own (they win by cascade layer). The root is styled
44
+ * with `class`. */
44
45
  classes?: Partial<Record<RatingPart, string>>;
45
46
  }
@@ -1,4 +1,4 @@
1
- import { SearchBarPart, SearchBarProps, SearchBarSize, SearchResultItem, SearchResultType, SearchSelectType } from './types.js';
1
+ import { SearchBarProps, SearchBarSize, SearchResultItem, SearchResultType, SearchSelectType } from './types.js';
2
2
  declare const __VLS_template: () => {
3
3
  __VLS_Slots: {
4
4
  item?: (props: {
@@ -21,10 +21,10 @@ declare const __VLS_base: import('vue').DefineComponent<SearchBarProps, {}, {},
21
21
  onClearRecent?: (() => any) | undefined;
22
22
  onSubmit?: ((query: string) => any) | undefined;
23
23
  }>, {
24
- size: SearchBarSize;
25
24
  label: string;
26
- classes: Partial<Record<SearchBarPart, string>>;
25
+ size: SearchBarSize;
27
26
  modelValue: string;
27
+ classes: Partial<Record<import('./types.js').SearchBarPart, string>>;
28
28
  placeholder: string;
29
29
  results: import('./types.js').SearchResults;
30
30
  loading: boolean;
@@ -78,8 +78,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
78
78
  onSelect?: ((row: SearchRow, event: MouseEvent) => any) | undefined;
79
79
  onActivate?: ((value: string) => any) | undefined;
80
80
  }>, {
81
- classes: Partial<Record<SearchBarPart, string>>;
82
81
  flat: boolean;
82
+ classes: Partial<Record<SearchBarPart, string>>;
83
83
  placement: string;
84
84
  activeValue: string;
85
85
  panelStyle: Record<string, string>;
@@ -45,7 +45,7 @@ export type SearchSelectType = SearchResultType | 'viewAll';
45
45
  * `clearRecent` (the idle view's "Clear recent searches" row) and `liveRegion` (anatomy item 11).
46
46
  * `itemArrow` is the Sizes table's "Active arrow".
47
47
  */
48
- export type SearchBarPart = 'root' | 'form' | 'field' | 'leadingIcon' | 'clearButton' | 'busy' | 'shortcutHint' | 'panel' | 'listbox' | 'section' | 'sectionHeading' | 'item' | 'itemImage' | 'itemTitle' | 'itemMeta' | 'itemArrow' | 'recent' | 'clearRecent' | 'popular' | 'chip' | 'viewAll' | 'loading' | 'empty' | 'liveRegion';
48
+ export type SearchBarPart = 'form' | 'field' | 'leadingIcon' | 'clearButton' | 'busy' | 'shortcutHint' | 'panel' | 'listbox' | 'section' | 'sectionHeading' | 'item' | 'itemImage' | 'itemTitle' | 'itemMeta' | 'itemArrow' | 'recent' | 'clearRecent' | 'popular' | 'chip' | 'viewAll' | 'loading' | 'empty' | 'liveRegion';
49
49
  /** The spec's two search-bar sizes: 2.5rem in a header or toolbar, 3rem on the Search page. */
50
50
  export type SearchBarSize = 'md' | 'lg';
51
51
  export interface SearchBarProps {
@@ -89,7 +89,10 @@ export interface SearchBarProps {
89
89
  teleport?: boolean | string;
90
90
  /** Message overrides for this control alone. */
91
91
  messages?: Partial<UiMessages>;
92
- /** Per-part class overrides, merged with `tailwind-merge`. */
92
+ /**
93
+ * Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
94
+ * `class`.
95
+ */
93
96
  classes?: Partial<Record<SearchBarPart, string>>;
94
97
  }
95
98
  /**
@@ -1,4 +1,4 @@
1
- import { SearchModalPart, SearchModalProps, SearchResultItem, SearchResultType, SearchSelectType } from './types.js';
1
+ import { SearchModalProps, SearchResultItem, SearchResultType, SearchSelectType } from './types.js';
2
2
  declare const __VLS_template: () => {
3
3
  __VLS_Slots: {
4
4
  item?: (props: {
@@ -30,8 +30,8 @@ declare const __VLS_base: import('vue').DefineComponent<SearchModalProps, {
30
30
  onSubmit?: ((query: string) => any) | undefined;
31
31
  "onUpdate:query"?: ((value: string) => any) | undefined;
32
32
  }>, {
33
- classes: Partial<Record<SearchModalPart, string>>;
34
33
  modelValue: boolean;
34
+ classes: Partial<Record<import('./types.js').SearchModalPart, string>>;
35
35
  placeholder: string;
36
36
  results: import('./types.js').SearchResults;
37
37
  loading: boolean;
@@ -3,7 +3,8 @@ import { SearchBarPart, SearchResultItem, SearchResultType, SearchResults, Searc
3
3
  export type { SearchResultItem, SearchResultType, SearchResults, SearchRow, SearchSection, SearchSelectType, };
4
4
  /**
5
5
  * The parts a consumer can restyle through `classes`. The seven the modal's own frame draws
6
- * (`root`, `form`, `field`, `leadingIcon`, `clear`, `close`, `results`, `footer`), plus every part
6
+ * (`form`, `field`, `leadingIcon`, `clear`, `close`, `results`, `footer`; the root takes `class`),
7
+ * plus every part
7
8
  * of the reused `SearchResultsPanel` (`panel`, `listbox`, `section`, … `liveRegion`) — `classes` is
8
9
  * forwarded straight into that child, so a consumer restyles the frame and the rows through one
9
10
  * prop, the rows named exactly as `SearchBar`'s own anatomy already names them (controller decision:
@@ -14,7 +15,7 @@ export type { SearchResultItem, SearchResultType, SearchResults, SearchRow, Sear
14
15
  * is the exact same element `SearchBar`'s popup uses, just drawn `flat` (see `SearchResultsPanel`'s
15
16
  * own `flat` prop).
16
17
  */
17
- export type SearchModalPart = 'root' | 'form' | 'field' | 'leadingIcon' | 'clear' | 'close' | 'results' | 'footer' | SearchBarPart;
18
+ export type SearchModalPart = 'form' | 'field' | 'leadingIcon' | 'clear' | 'close' | 'results' | 'footer' | SearchBarPart;
18
19
  export interface SearchModalProps {
19
20
  /** Shows the modal with `showModal()` when `true`, closes it when `false` (two-way). */
20
21
  modelValue?: boolean;
@@ -53,7 +54,9 @@ export interface SearchModalProps {
53
54
  shortcut?: boolean;
54
55
  /** Message overrides for this control alone. */
55
56
  messages?: Partial<UiMessages>;
56
- /** Per-part class overrides, merged with `tailwind-merge`. Forwarded to the reused
57
- * `SearchResultsPanel` for every part that is its own. */
57
+ /**
58
+ * Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
59
+ * `class`. Forwarded to the reused `SearchResultsPanel` for every part that is its own.
60
+ */
58
61
  classes?: Partial<Record<SearchModalPart, string>>;
59
62
  }
@@ -7,7 +7,6 @@ declare const __VLS_template: () => {
7
7
  type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
8
8
  declare const __VLS_base: import('vue').DefineComponent<SectionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SectionProps> & Readonly<{}>, {
9
9
  spacing: SectionSpacing;
10
- classes: Partial<Record<"root", string>>;
11
10
  as: string;
12
11
  ariaLabel: string | null;
13
12
  background: SectionBackground;
@@ -2,8 +2,6 @@
2
2
  export type SectionBackground = 'none' | 'surface' | 'surface-strong' | 'primary' | 'accent';
3
3
  /** Vertical padding steps (spec "Container and section" → Sizes, Section spacing table). */
4
4
  export type SectionSpacing = 'none' | 'sm' | 'md' | 'lg';
5
- /** The parts a consumer can restyle through `classes`. Section has only the one. */
6
- export type SectionPart = 'root';
7
5
  export interface SectionProps {
8
6
  /** Section ground. Defaults to `none`. */
9
7
  background?: SectionBackground;
@@ -23,8 +21,6 @@ export interface SectionProps {
23
21
  * package — see the README's "`ariaLabel` is always an accessible name" rule).
24
22
  */
25
23
  ariaLabel?: string | null;
26
- /** Per-part class overrides, merged with `tailwind-merge`. */
27
- classes?: Partial<Record<SectionPart, string>>;
28
24
  /**
29
25
  * Render as a different tag instead of the automatic `<section>`/`<div>` choice — a `<header>` for
30
26
  * the site header, a `<footer>` for the site footer, both already unique landmarks that need no
@@ -1,4 +1,4 @@
1
- import { MultiSelectPart, MultiSelectProps, SelectOption, SelectSize } from './types.js';
1
+ import { MultiSelectProps, SelectOption, SelectSize } from './types.js';
2
2
  declare const __VLS_template: () => {
3
3
  __VLS_Slots: {
4
4
  leading?: (props: {
@@ -59,26 +59,26 @@ declare const __VLS_template: () => {
59
59
  };
60
60
  type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
61
61
  declare const __VLS_base: import('vue').DefineComponent<MultiSelectProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
62
- clear: () => any;
63
62
  search: (query: string) => any;
64
63
  "update:modelValue": (value: string[]) => any;
64
+ clear: () => any;
65
65
  open: () => any;
66
66
  close: () => any;
67
67
  change: (value: string[]) => any;
68
68
  create: (query: string) => any;
69
69
  }, string, import('vue').PublicProps, Readonly<MultiSelectProps> & Readonly<{
70
- onClear?: (() => any) | undefined;
71
70
  onSearch?: ((query: string) => any) | undefined;
72
71
  "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
72
+ onClear?: (() => any) | undefined;
73
73
  onOpen?: (() => any) | undefined;
74
74
  onClose?: (() => any) | undefined;
75
75
  onChange?: ((value: string[]) => any) | undefined;
76
76
  onCreate?: ((query: string) => any) | undefined;
77
77
  }>, {
78
- size: SelectSize;
79
78
  name: string;
80
- classes: Partial<Record<MultiSelectPart, string>>;
79
+ size: SelectSize;
81
80
  modelValue: string[];
81
+ classes: Partial<Record<import('./types.js').MultiSelectPart, string>>;
82
82
  required: boolean;
83
83
  placeholder: string;
84
84
  loading: boolean;
@@ -30,26 +30,26 @@ declare const __VLS_template: () => {
30
30
  };
31
31
  type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
32
32
  declare const __VLS_base: import('vue').DefineComponent<SelectProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
33
- clear: () => any;
34
33
  search: (query: string) => any;
35
34
  "update:modelValue": (value: string) => any;
35
+ clear: () => any;
36
36
  open: () => any;
37
37
  close: () => any;
38
38
  change: (value: string) => any;
39
39
  create: (query: string) => any;
40
40
  }, string, import('vue').PublicProps, Readonly<SelectProps> & Readonly<{
41
- onClear?: (() => any) | undefined;
42
41
  onSearch?: ((query: string) => any) | undefined;
43
42
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
43
+ onClear?: (() => any) | undefined;
44
44
  onOpen?: (() => any) | undefined;
45
45
  onClose?: (() => any) | undefined;
46
46
  onChange?: ((value: string) => any) | undefined;
47
47
  onCreate?: ((query: string) => any) | undefined;
48
48
  }>, {
49
- size: SelectSize;
50
49
  name: string;
51
- classes: Partial<Record<import('./types.js').SelectPart, string>>;
50
+ size: SelectSize;
52
51
  modelValue: string;
52
+ classes: Partial<Record<import('./types.js').SelectPart, string>>;
53
53
  required: boolean;
54
54
  placeholder: string;
55
55
  loading: boolean;
@@ -88,14 +88,14 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
88
88
  root: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
89
89
  searchInput: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
90
90
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
91
- select: (option: SelectOption) => any;
92
91
  search: (query: string) => any;
92
+ select: (option: SelectOption) => any;
93
93
  keydown: (event: KeyboardEvent) => any;
94
94
  activate: (value: string) => any;
95
95
  scrollEnd: () => any;
96
96
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
97
- onSelect?: ((option: SelectOption) => any) | undefined;
98
97
  onSearch?: ((query: string) => any) | undefined;
98
+ onSelect?: ((option: SelectOption) => any) | undefined;
99
99
  onKeydown?: ((event: KeyboardEvent) => any) | undefined;
100
100
  onActivate?: ((value: string) => any) | undefined;
101
101
  onScrollEnd?: (() => any) | undefined;
@@ -7,14 +7,15 @@ import { SelectOption, SelectPart } from './types.js';
7
7
  * which is the point: a consumer styles `option` once and both controls take it.
8
8
  */
9
9
  export type PanelClasses = Partial<Record<SelectPart, string>>;
10
+ /** What every function below returns: a Vue `class` value. */
11
+ export type PanelClassValue = ReadonlyArray<string | false | undefined>;
10
12
  /**
11
13
  * Every class the **panel** of a select draws, in one place, because `Select` and `MultiSelect`
12
14
  * draw the same panel. They are plain functions rather than computeds so that both `SelectPanel`
13
15
  * (which renders the panel) and a trigger (which reuses an option's swatch and icon for the chosen
14
16
  * option's mark) can call them.
15
17
  *
16
- * Each ends in `partClass`, so a consumer's per-part override merges over ours through
17
- * `tailwind-merge` rather than landing beside it.
18
+ * Each returns a Vue class value with the consumer's per-part classes appended last.
18
19
  */
19
20
  /**
20
21
  * The popover (spec "Select" → Sizes, Popover row). Not a dialog: it is a non-modal popup
@@ -33,16 +34,16 @@ export type PanelClasses = Partial<Record<SelectPart, string>>;
33
34
  * not**, and neither do custom properties set on a wrapper: set `--eldra-*` overrides on `:root`
34
35
  * (or on the teleport target), which is what the README's Customisation section already asks for.
35
36
  */
36
- export declare function panelClass(classes: PanelClasses | undefined): string;
37
+ export declare function panelClass(classes: PanelClasses | undefined): PanelClassValue;
37
38
  /**
38
39
  * Spec "Select" → Sizes, Search field: 2.5rem tall, text from 2.125rem. No focus ring (a README
39
40
  * Deviation): focus sits here whenever the panel is open, so the caret and the active row show it.
40
41
  */
41
- export declare function searchClass(classes: PanelClasses | undefined): string;
42
- export declare function listboxClass(classes: PanelClasses | undefined, hasOptions: boolean): string;
42
+ export declare function searchClass(classes: PanelClasses | undefined): PanelClassValue;
43
+ export declare function listboxClass(classes: PanelClasses | undefined, hasOptions: boolean): PanelClassValue;
43
44
  /** Spec: "Every group after the first gets a 1px `border` hairline and 0.25rem gap above it." */
44
- export declare function groupClass(classes: PanelClasses | undefined, index: number): string;
45
- export declare function groupLabelClass(classes: PanelClasses | undefined, index: number): string;
45
+ export declare function groupClass(classes: PanelClasses | undefined, index: number): PanelClassValue;
46
+ export declare function groupLabelClass(classes: PanelClasses | undefined, index: number): PanelClassValue;
46
47
  /**
47
48
  * Spec "Select" → Sizes, Option row, and → States for active / selected / disabled.
48
49
  *
@@ -54,15 +55,15 @@ export declare function optionClass(classes: PanelClasses | undefined, option: S
54
55
  active: boolean;
55
56
  selected: boolean;
56
57
  multiple: boolean;
57
- }): string;
58
+ }): PanelClassValue;
58
59
  /** A disabled row reads as disabled through the row's `muted` text and cursor, like `Checkbox`. */
59
- export declare function optionLabelClass(classes: PanelClasses | undefined): string;
60
- export declare function optionHintClass(classes: PanelClasses | undefined): string;
61
- export declare function optionMetaClass(classes: PanelClasses | undefined, option: SelectOption): string;
62
- export declare function optionSwatchClass(classes: PanelClasses | undefined): string;
63
- export declare function optionIconClass(classes: PanelClasses | undefined): string;
60
+ export declare function optionLabelClass(classes: PanelClasses | undefined): PanelClassValue;
61
+ export declare function optionHintClass(classes: PanelClasses | undefined): PanelClassValue;
62
+ export declare function optionMetaClass(classes: PanelClasses | undefined, option: SelectOption): PanelClassValue;
63
+ export declare function optionSwatchClass(classes: PanelClasses | undefined): PanelClassValue;
64
+ export declare function optionIconClass(classes: PanelClasses | undefined): PanelClassValue;
64
65
  /** Spec "Select" → States, Option selected: "check mark in `text` (never colour alone)". */
65
- export declare function optionCheckClass(classes: PanelClasses | undefined): string;
66
+ export declare function optionCheckClass(classes: PanelClasses | undefined): PanelClassValue;
66
67
  /**
67
68
  * A multi-select option's checkbox (spec "Multi-select" → Sizes, "Checkbox in option"): "1rem
68
69
  * square, 1.5px `border-strong`, 0.25rem radius, `background` fill. Checked: `primary` fill and
@@ -76,14 +77,14 @@ export declare function optionCheckClass(classes: PanelClasses | undefined): str
76
77
  export declare function optionBoxClass(classes: PanelClasses | undefined, state: {
77
78
  selected: boolean;
78
79
  disabled: boolean;
79
- }): string;
80
+ }): PanelClassValue;
80
81
  /** Spec "Select" → Sizes, Empty state: "0.875rem, `muted`, centred, padding 1rem 0.75rem". */
81
- export declare function emptyClass(classes: PanelClasses | undefined): string;
82
+ export declare function emptyClass(classes: PanelClasses | undefined): PanelClassValue;
82
83
  /**
83
84
  * The loading row: the empty state's box, with the shared spinner before its text. It stands in
84
85
  * for the list and the empty state while a `loading` control's options are being fetched.
85
86
  */
86
- export declare function loadingClass(classes: PanelClasses | undefined): string;
87
+ export declare function loadingClass(classes: PanelClasses | undefined): PanelClassValue;
87
88
  /**
88
89
  * The "Create “query”" row of a `creatable` control: an option row's own box and active fill, with
89
90
  * a `plus` where a row draws its mark. After other rows it sits under a group's hairline (drawn
@@ -91,7 +92,7 @@ export declare function loadingClass(classes: PanelClasses | undefined): string;
91
92
  */
92
93
  export declare function createOptionClass(classes: PanelClasses | undefined, state: {
93
94
  active: boolean;
94
- }): string;
95
+ }): PanelClassValue;
95
96
  /**
96
97
  * The tick inside that box (spec "Multi-select" → Sizes: "a `primary-contrast` tick (0.25 × 0.5rem,
97
98
  * 2px stroke)").
@@ -105,7 +106,7 @@ export declare function createOptionClass(classes: PanelClasses | undefined, sta
105
106
  * It is always rendered and scaled from 0, rather than added and removed, so it can grow in over
106
107
  * `duration-fast` the way `Checkbox`'s does.
107
108
  */
108
- export declare function optionTickClass(selected: boolean): string;
109
+ export declare function optionTickClass(selected: boolean): PanelClassValue;
109
110
  /**
110
111
  * The cell a trigger stacks its chosen value in, with an invisible copy of the placeholder
111
112
  * (`data-placeholder`, drawn by `::after`) in the same grid cell: a content-sized trigger keeps at
@@ -114,4 +115,4 @@ export declare function optionTickClass(selected: boolean): string;
114
115
  */
115
116
  export declare const TRIGGER_VALUE_STACK: string;
116
117
  /** The chosen value inside `TRIGGER_VALUE_STACK`, in the cell the placeholder copy shares. */
117
- export declare const TRIGGER_VALUE_CELL = "col-start-1 row-start-1";
118
+ export declare const TRIGGER_VALUE_CELL = "eldra:col-start-1 eldra:row-start-1";
@@ -42,10 +42,10 @@ export interface SelectOption {
42
42
  * is styled once wherever it appears.
43
43
  *
44
44
  * `native` is the odd one out: it marks the hidden native `<select>` with a `data-part` so a test
45
- * or a form helper can find it, but the element is `hidden`, so `classes.native` merges onto
45
+ * or a form helper can find it, but the element is `hidden`, so `classes.native` lands on
46
46
  * nothing and has no effect. Every other part takes classes.
47
47
  */
48
- export type SelectPart = 'root' | 'trigger' | 'leadingIcon' | 'value' | 'placeholder' | 'chevron' | 'clearButton' | 'panel' | 'search' | 'listbox' | 'group' | 'groupLabel' | 'option' | 'optionLabel' | 'optionHint' | 'optionMeta' | 'optionSwatch' | 'optionIcon' | 'optionCheck' | 'empty' | 'loading' | 'createOption' | 'native';
48
+ export type SelectPart = 'trigger' | 'leadingIcon' | 'value' | 'placeholder' | 'chevron' | 'clearButton' | 'panel' | 'search' | 'listbox' | 'group' | 'groupLabel' | 'option' | 'optionLabel' | 'optionHint' | 'optionMeta' | 'optionSwatch' | 'optionIcon' | 'optionCheck' | 'empty' | 'loading' | 'createOption' | 'native';
49
49
  /** The shared control box, exactly as `Input`'s: 2rem, 2.5rem or 3rem tall. */
50
50
  export type SelectSize = 'sm' | 'md' | 'lg';
51
51
  /**
@@ -115,7 +115,10 @@ export interface SelectProps {
115
115
  renderBatch?: number;
116
116
  /** Message overrides for this control alone. */
117
117
  messages?: Partial<UiMessages>;
118
- /** Per-part class overrides, merged with `tailwind-merge`. */
118
+ /**
119
+ * Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
120
+ * `class`.
121
+ */
119
122
  classes?: Partial<Record<SelectPart, string>>;
120
123
  }
121
124
  /**
@@ -162,6 +165,9 @@ export interface MultiSelectProps extends Omit<SelectProps, 'modelValue' | 'plac
162
165
  * exactly that many.
163
166
  */
164
167
  maxSummary?: number | 'fit';
165
- /** Per-part class overrides, merged with `tailwind-merge`. */
168
+ /**
169
+ * Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
170
+ * `class`.
171
+ */
166
172
  classes?: Partial<Record<MultiSelectPart, string>>;
167
173
  }
@@ -21,8 +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;
25
+ classes: Partial<Record<import('./types.js').SiteFormPart, string>>;
26
26
  messages: Partial<{
27
27
  clear: string;
28
28
  close: 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,8 @@
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
+ height: string;
5
+ classes: Partial<Record<"line", string>>;
5
6
  variant: SkeletonVariant;
6
7
  width: string;
7
8
  ratio: import('../../index.js').ImageRatio;