@eldrajs/ui 0.0.0 → 0.1.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 (205) hide show
  1. package/CHANGELOG.md +1724 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3177 -2
  4. package/dist/VariantPicker-CKw8hmxt.js +9009 -0
  5. package/dist/componentNames.d.ts +19 -0
  6. package/dist/components/accordion/Accordion.vue.d.ts +18 -0
  7. package/dist/components/accordion/AccordionItem.vue.d.ts +26 -0
  8. package/dist/components/accordion/context.d.ts +20 -0
  9. package/dist/components/accordion/detailsExclusivity.d.ts +3 -0
  10. package/dist/components/accordion/heightTransition.d.ts +59 -0
  11. package/dist/components/accordion/types.d.ts +40 -0
  12. package/dist/components/avatar/Avatar.vue.d.ts +10 -0
  13. package/dist/components/avatar/AvatarGroup.vue.d.ts +7 -0
  14. package/dist/components/avatar/types.d.ts +61 -0
  15. package/dist/components/badge/Badge.vue.d.ts +24 -0
  16. package/dist/components/badge/StockBadge.vue.d.ts +10 -0
  17. package/dist/components/badge/types.d.ts +79 -0
  18. package/dist/components/breadcrumb/Breadcrumb.vue.d.ts +10 -0
  19. package/dist/components/breadcrumb/types.d.ts +53 -0
  20. package/dist/components/button/Button.vue.d.ts +37 -0
  21. package/dist/components/button/ButtonGroup.vue.d.ts +17 -0
  22. package/dist/components/button/types.d.ts +68 -0
  23. package/dist/components/card/ContentCard.vue.d.ts +36 -0
  24. package/dist/components/card/FeatureCard.vue.d.ts +27 -0
  25. package/dist/components/card/cueArrow.d.ts +10 -0
  26. package/dist/components/card/stretchedLink.d.ts +45 -0
  27. package/dist/components/card/types.d.ts +92 -0
  28. package/dist/components/carousel/Carousel.vue.d.ts +39 -0
  29. package/dist/components/carousel/types.d.ts +75 -0
  30. package/dist/components/carousel/useCarousel.d.ts +152 -0
  31. package/dist/components/checkbox/Checkbox.vue.d.ts +36 -0
  32. package/dist/components/checkbox/CheckboxGroup.vue.d.ts +16 -0
  33. package/dist/components/checkbox/types.d.ts +78 -0
  34. package/dist/components/chip/Chip.vue.d.ts +37 -0
  35. package/dist/components/chip/ChipGroup.vue.d.ts +21 -0
  36. package/dist/components/chip/context.d.ts +22 -0
  37. package/dist/components/chip/types.d.ts +84 -0
  38. package/dist/components/container/Container.vue.d.ts +18 -0
  39. package/dist/components/container/types.d.ts +17 -0
  40. package/dist/components/currency-input/CurrencyInput.vue.d.ts +17 -0
  41. package/dist/components/currency-input/types.d.ts +8 -0
  42. package/dist/components/dialog/Dialog.vue.d.ts +34 -0
  43. package/dist/components/dialog/types.d.ts +25 -0
  44. package/dist/components/drawer/Drawer.vue.d.ts +36 -0
  45. package/dist/components/drawer/types.d.ts +30 -0
  46. package/dist/components/empty-state/EditorPlaceholder.vue.d.ts +9 -0
  47. package/dist/components/empty-state/EmptyState.vue.d.ts +28 -0
  48. package/dist/components/empty-state/types.d.ts +59 -0
  49. package/dist/components/field-wrapper/FieldError.vue.d.ts +37 -0
  50. package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +30 -0
  51. package/dist/components/field-wrapper/context.d.ts +44 -0
  52. package/dist/components/field-wrapper/types.d.ts +38 -0
  53. package/dist/components/filter-panel/FilterGroup.vue.d.ts +48 -0
  54. package/dist/components/filter-panel/FilterPanel.vue.d.ts +77 -0
  55. package/dist/components/filter-panel/Histogram.vue.d.ts +15 -0
  56. package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +12 -0
  57. package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +12 -0
  58. package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +20 -0
  59. package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +12 -0
  60. package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +12 -0
  61. package/dist/components/filter-panel/facets/shared.d.ts +39 -0
  62. package/dist/components/filter-panel/northwind.d.ts +32 -0
  63. package/dist/components/filter-panel/swatchInk.d.ts +50 -0
  64. package/dist/components/filter-panel/types.d.ts +183 -0
  65. package/dist/components/filter-panel/useFilterPanel.d.ts +230 -0
  66. package/dist/components/form-layout/FormLayout.vue.d.ts +36 -0
  67. package/dist/components/form-layout/context.d.ts +33 -0
  68. package/dist/components/form-layout/focusInvalid.d.ts +18 -0
  69. package/dist/components/form-layout/types.d.ts +52 -0
  70. package/dist/components/icon/Icon.vue.d.ts +8 -0
  71. package/dist/components/icon/types.d.ts +29 -0
  72. package/dist/components/image/Image.vue.d.ts +21 -0
  73. package/dist/components/image/types.d.ts +81 -0
  74. package/dist/components/input/Input.vue.d.ts +47 -0
  75. package/dist/components/input/classes.d.ts +110 -0
  76. package/dist/components/input/types.d.ts +55 -0
  77. package/dist/components/internal/ValueText.vue.d.ts +7 -0
  78. package/dist/components/lightbox/Lightbox.vue.d.ts +19 -0
  79. package/dist/components/lightbox/types.d.ts +47 -0
  80. package/dist/components/link/Link.vue.d.ts +23 -0
  81. package/dist/components/link/types.d.ts +40 -0
  82. package/dist/components/load-more/LoadMore.vue.d.ts +12 -0
  83. package/dist/components/load-more/types.d.ts +21 -0
  84. package/dist/components/logo-item/LogoItem.vue.d.ts +10 -0
  85. package/dist/components/logo-item/types.d.ts +37 -0
  86. package/dist/components/pagination/Pagination.vue.d.ts +15 -0
  87. package/dist/components/pagination/types.d.ts +51 -0
  88. package/dist/components/popover/Popover.vue.d.ts +31 -0
  89. package/dist/components/popover/types.d.ts +53 -0
  90. package/dist/components/price/Price.vue.d.ts +25 -0
  91. package/dist/components/price/types.d.ts +104 -0
  92. package/dist/components/product-card/ProductCard.vue.d.ts +22 -0
  93. package/dist/components/product-card/types.d.ts +123 -0
  94. package/dist/components/quantity-stepper/QuantityStepper.vue.d.ts +26 -0
  95. package/dist/components/quantity-stepper/types.d.ts +35 -0
  96. package/dist/components/radio/RadioGroup.vue.d.ts +38 -0
  97. package/dist/components/radio/types.d.ts +39 -0
  98. package/dist/components/range-slider/RangeSlider.vue.d.ts +70 -0
  99. package/dist/components/range-slider/types.d.ts +151 -0
  100. package/dist/components/range-slider/useRangeSlider.d.ts +106 -0
  101. package/dist/components/rating/Rating.vue.d.ts +22 -0
  102. package/dist/components/rating/RatingStars.vue.d.ts +16 -0
  103. package/dist/components/rating/types.d.ts +45 -0
  104. package/dist/components/search-bar/SearchBar.vue.d.ts +47 -0
  105. package/dist/components/search-bar/SearchResultsPanel.vue.d.ts +93 -0
  106. package/dist/components/search-bar/shortcutOwner.d.ts +39 -0
  107. package/dist/components/search-bar/types.d.ts +122 -0
  108. package/dist/components/search-modal/SearchModal.vue.d.ts +53 -0
  109. package/dist/components/search-modal/types.d.ts +59 -0
  110. package/dist/components/section/Section.vue.d.ts +21 -0
  111. package/dist/components/section/context.d.ts +23 -0
  112. package/dist/components/section/types.d.ts +34 -0
  113. package/dist/components/select/MultiSelect.vue.d.ts +62 -0
  114. package/dist/components/select/Select.vue.d.ts +57 -0
  115. package/dist/components/select/SelectPanel.vue.d.ts +97 -0
  116. package/dist/components/select/openRegistry.d.ts +11 -0
  117. package/dist/components/select/panelParts.d.ts +91 -0
  118. package/dist/components/select/types.d.ts +129 -0
  119. package/dist/components/select/useListbox.d.ts +106 -0
  120. package/dist/components/select/useOptionList.d.ts +61 -0
  121. package/dist/components/select/usePopover.d.ts +147 -0
  122. package/dist/components/skeleton/Skeleton.vue.d.ts +12 -0
  123. package/dist/components/skeleton/types.d.ts +38 -0
  124. package/dist/components/spinner/Spinner.vue.d.ts +3 -0
  125. package/dist/components/switch/Switch.vue.d.ts +30 -0
  126. package/dist/components/switch/types.d.ts +20 -0
  127. package/dist/components/tabs/Tab.vue.d.ts +17 -0
  128. package/dist/components/tabs/TabPanel.vue.d.ts +16 -0
  129. package/dist/components/tabs/Tabs.vue.d.ts +28 -0
  130. package/dist/components/tabs/context.d.ts +48 -0
  131. package/dist/components/tabs/types.d.ts +63 -0
  132. package/dist/components/textarea/Textarea.vue.d.ts +27 -0
  133. package/dist/components/textarea/supportsFieldSizing.d.ts +10 -0
  134. package/dist/components/textarea/types.d.ts +32 -0
  135. package/dist/components/toast/Toast.vue.d.ts +16 -0
  136. package/dist/components/toast/Toaster.vue.d.ts +13 -0
  137. package/dist/components/toast/types.d.ts +44 -0
  138. package/dist/components/tooltip/Tooltip.vue.d.ts +9 -0
  139. package/dist/components/tooltip/supportsFocusVisible.d.ts +17 -0
  140. package/dist/components/tooltip/types.d.ts +46 -0
  141. package/dist/components/unit-input/UnitInput.vue.d.ts +55 -0
  142. package/dist/components/unit-input/types.d.ts +68 -0
  143. package/dist/components/unit-input/undo-redo.d.ts +6 -0
  144. package/dist/components/variant-picker/VariantPicker.vue.d.ts +15 -0
  145. package/dist/components/variant-picker/types.d.ts +49 -0
  146. package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +18 -0
  147. package/dist/components/visually-hidden/types.d.ts +14 -0
  148. package/dist/composables/dialogStack.d.ts +52 -0
  149. package/dist/composables/teleportTarget.d.ts +79 -0
  150. package/dist/composables/useControllableModel.d.ts +16 -0
  151. package/dist/composables/useDialog.d.ts +84 -0
  152. package/dist/composables/useFloating.d.ts +82 -0
  153. package/dist/composables/useHeadingTag.d.ts +24 -0
  154. package/dist/composables/useLocale.d.ts +81 -0
  155. package/dist/composables/useMessages.d.ts +30 -0
  156. package/dist/composables/useOverlay.d.ts +88 -0
  157. package/dist/composables/useSlotPresence.d.ts +29 -0
  158. package/dist/composables/useToast.d.ts +53 -0
  159. package/dist/icons/paths.d.ts +10 -0
  160. package/dist/index.d.ts +135 -0
  161. package/dist/index.js +12586 -0
  162. package/dist/listFormat-1UrH38f2.js +39 -0
  163. package/dist/messages/en-US.d.ts +485 -0
  164. package/dist/messages/index.d.ts +2 -0
  165. package/dist/messages/is-IS.d.ts +16 -0
  166. package/dist/messages/is-IS.js +169 -0
  167. package/dist/resolver.d.ts +43 -0
  168. package/dist/resolver.js +121 -0
  169. package/dist/style.css +5251 -0
  170. package/dist/tailwind.css +2057 -0
  171. package/dist/tokens.css +134 -0
  172. package/dist/utils/avatar.d.ts +15 -0
  173. package/dist/utils/color.d.ts +11 -0
  174. package/dist/utils/cssTiming.d.ts +40 -0
  175. package/dist/utils/cx.d.ts +31 -0
  176. package/dist/utils/date.d.ts +45 -0
  177. package/dist/utils/id.d.ts +36 -0
  178. package/dist/utils/listFormat.d.ts +22 -0
  179. package/dist/utils/mask.d.ts +48 -0
  180. package/dist/utils/number-format.d.ts +250 -0
  181. package/dist/utils/numeric-input.d.ts +42 -0
  182. package/dist/utils/rating.d.ts +26 -0
  183. package/dist/utils/ratio.d.ts +18 -0
  184. package/dist/utils/tagRecipe.d.ts +24 -0
  185. package/dist/utils/valueFade.d.ts +42 -0
  186. package/dist/vee-validate/FieldCheckbox.vue.d.ts +14 -0
  187. package/dist/vee-validate/FieldCheckboxGroup.vue.d.ts +14 -0
  188. package/dist/vee-validate/FieldCurrencyInput.vue.d.ts +14 -0
  189. package/dist/vee-validate/FieldInput.vue.d.ts +14 -0
  190. package/dist/vee-validate/FieldMultiSelect.vue.d.ts +14 -0
  191. package/dist/vee-validate/FieldQuantityStepper.vue.d.ts +14 -0
  192. package/dist/vee-validate/FieldRadioGroup.vue.d.ts +14 -0
  193. package/dist/vee-validate/FieldSearchBar.vue.d.ts +14 -0
  194. package/dist/vee-validate/FieldSelect.vue.d.ts +14 -0
  195. package/dist/vee-validate/FieldSwitch.vue.d.ts +14 -0
  196. package/dist/vee-validate/FieldTextarea.vue.d.ts +14 -0
  197. package/dist/vee-validate/FieldUnitInput.vue.d.ts +14 -0
  198. package/dist/vee-validate/FieldVariantPicker.vue.d.ts +14 -0
  199. package/dist/vee-validate/Form.vue.d.ts +27 -0
  200. package/dist/vee-validate/context.d.ts +48 -0
  201. package/dist/vee-validate/index.d.ts +27 -0
  202. package/dist/vee-validate/types.d.ts +115 -0
  203. package/dist/vee-validate/useFieldControl.d.ts +67 -0
  204. package/dist/vee-validate.js +1154 -0
  205. package/package.json +99 -2
@@ -0,0 +1,67 @@
1
+ import { ComputedRef, MaybeRef, WritableComputedRef } from 'vue';
2
+ import { FieldBinding } from './types.js';
3
+ /** The props every `Field*` passes in: its `FieldBinding`, plus the control's own `id` if it has one. */
4
+ type FieldControlProps<TValue> = FieldBinding<TValue> & {
5
+ id?: string;
6
+ };
7
+ /** The props a `Field*` keeps for itself and never forwards to the component it wraps. */
8
+ export declare const FIELD_ONLY: readonly ["path", "rules", "label", "id"];
9
+ export interface UseFieldControlOptions<TValue> {
10
+ /**
11
+ * What the control is bound to while the field itself holds `undefined` — `''`, `false`, or a
12
+ * **module-level** empty array. It must be a stable value: a fresh `[]` per read would hand the
13
+ * control a new prop identity on every render. Left out, the control is handed `undefined` and
14
+ * falls back to whatever default it documents for an unbound `modelValue`.
15
+ */
16
+ empty?: TValue;
17
+ /**
18
+ * The field's own starting value, for a control that picks one itself (a `VariantPicker` starts
19
+ * on the first available option). A `Form`'s `initialValues` still wins over it.
20
+ */
21
+ initialValue?: MaybeRef<TValue>;
22
+ /** Whether the wrapped component takes an `id` prop. `false` for the three fieldset controls. */
23
+ hasIdProp?: boolean;
24
+ }
25
+ export interface UseFieldControlReturn<TValue> {
26
+ /** The field's value, bound to the control with `v-model`. */
27
+ model: WritableComputedRef<TValue>;
28
+ /** The message to show, or `undefined` while the field has not earned one yet. */
29
+ error: ComputedRef<string | undefined>;
30
+ /** Whether the control should read `aria-invalid="true"`. */
31
+ invalid: ComputedRef<boolean>;
32
+ /**
33
+ * The same message, but only when there is **no** `FieldWrapper` above: inside one, the wrapper
34
+ * draws the error row and a control drawing a second one would say it twice.
35
+ */
36
+ ownError: ComputedRef<string | undefined>;
37
+ /** The `id` to forward to the control, or `undefined` to leave the control's own wiring alone. */
38
+ id: ComputedRef<string | undefined>;
39
+ /** Marks the field touched, which is what reveals a message it already has. */
40
+ onBlur: (event?: Event) => void;
41
+ }
42
+ /**
43
+ * The whole of what a `Field*` does, minus the one component it renders.
44
+ *
45
+ * Each `Field*` is a thin SFC over this: `useField(name, rules, { label })` for the value and the
46
+ * message, a gate that keeps a message hidden until the customer has left the field or submitted
47
+ * the form, the `id` the form's error summary links to, and the server error that stops being true
48
+ * as soon as the value changes. Keeping it here is what makes the eleven components agree on all
49
+ * of that rather than eleven files drifting apart.
50
+ *
51
+ * **The gate** is the spec's own rule (Form layout → Behaviour & motion: "Validate on submit, then
52
+ * on blur for fields that were invalid after the first submit"). vee-validate revalidates on every
53
+ * keystroke, so the field always *knows* its message; showing it only once `meta.touched` or the
54
+ * form has been submitted is what stops an error appearing under a half-typed email address.
55
+ */
56
+ export declare function useFieldControl<TValue>(props: FieldControlProps<TValue>, options: UseFieldControlOptions<TValue>): UseFieldControlReturn<TValue>;
57
+ /**
58
+ * Everything the `Field*` was given, minus what it keeps for itself — the props it forwards to the
59
+ * agnostic component underneath, typed as exactly that `Omit`.
60
+ *
61
+ * Built by walking the props object rather than by destructuring, so a prop added to any of the
62
+ * eleven components is forwarded the day it is added and nothing here has to be told about it.
63
+ * `undefined` values are forwarded too, which is exactly right: Vue applies a component's own
64
+ * `withDefaults` value for a prop that is `undefined`, so an unset prop still lands on its default.
65
+ */
66
+ export declare function useControlProps<TProps extends object, TOmit extends string>(props: TProps, omit: readonly TOmit[]): ComputedRef<Omit<TProps, TOmit>>;
67
+ export {};