@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
@@ -16,6 +16,13 @@ export interface UseDialogOptions {
16
16
  * it is focused only when it is a text field or marked `autofocus`; otherwise the dialog itself takes focus.
17
17
  */
18
18
  initialFocus?: Ref<HTMLElement | null>;
19
+ /**
20
+ * Whether the dialog may move focus to its first control on its own. Default `true`. With
21
+ * `false` it focuses the dialog itself however it opened, unless `initialFocus` or a control
22
+ * marked `autofocus` names a target: a form dialog then opens without focusing (and, on blur,
23
+ * validating) a field the user has not reached yet.
24
+ */
25
+ focusFirstControl?: boolean;
19
26
  /** Ran when `Esc` is pressed (the native `cancel` event), before the dialog actually closes. */
20
27
  onCancel?: () => void;
21
28
  }
@@ -52,7 +59,8 @@ export interface UseDialogReturn {
52
59
  * composable): the page behind does not scroll while the stack is non-empty (released only once
53
60
  * every open modal has closed), and `TOAST_HOST_KEY` tracks the **topmost** dialog a `Toaster`
54
61
  * should render into.
55
- * - **Initial focus**: `initialFocus`, else a reachable control marked `autofocus`, else the first
62
+ * - **Initial focus**: `initialFocus`, else a reachable control marked `autofocus`, else (unless
63
+ * `focusFirstControl: false`, which focuses the dialog itself instead) the first
56
64
  * meaningful control (never the close button — see `firstMeaningfulControl` above), else the close
57
65
  * button itself as a last resort, else whatever the platform already focused. Opened by a tap or
58
66
  * click, the dialog focuses itself instead unless that target is a text field or marked
@@ -2,9 +2,8 @@ import { InjectionKey } from 'vue';
2
2
  /** The injection key `provideEldraScope` provides under. */
3
3
  export declare const ELDRA_SCOPE_KEY: InjectionKey<string>;
4
4
  /**
5
- * Opts every component of this package rendered below the caller into `@eldrajs/ui/scoped.css`,
6
- * the stylesheet for embedding these components in another Tailwind app (see the README,
7
- * "Embedding in another Tailwind app"). Call it in `setup()` of a wrapper or an app root.
5
+ * Names a theming scope for every component of this package rendered below the caller (see the
6
+ * README, "Theming a subtree"). Call it in `setup()` of a wrapper or an app root.
8
7
  *
9
8
  * Each component then renders `data-eldra-scope="<name>"` on its root and on every part it
10
9
  * teleports (panels, dialogs, toasts). The name is free; the consumer's own variable overrides
@@ -13,12 +12,11 @@ export declare const ELDRA_SCOPE_KEY: InjectionKey<string>;
13
12
  */
14
13
  export declare function provideEldraScope(name?: string): void;
15
14
  /**
16
- * Internal: what a component of this package binds for `scoped.css`. `scope` goes on every root,
17
- * teleported root and kit-owned element sitting directly in a slot host (so it is a scope root of
18
- * its own and stays styled below the host's limit); it is `undefined` without a provider.
19
- * `slotHost(...names)` is `data-eldra-slot`, on the element holding those slots, where `scoped.css`
20
- * stops styling. It renders whenever one of the slots has content, provider or not (it changes no
21
- * style without `scoped.css`), and never for a fallback, which is the kit's own markup.
15
+ * Internal: the theming hooks a component of this package binds. `scope` goes on every root,
16
+ * teleported root and kit-owned element sitting directly in a slot host, so a scope's variables
17
+ * reach it; it is `undefined` without a provider. `slotHost(...names)` is `data-eldra-slot`, on
18
+ * the element holding those slots, a hook for consumer CSS. It renders whenever one of the slots
19
+ * has content, provider or not, and never for a fallback, which is the kit's own markup.
22
20
  */
23
21
  export declare function useEldraScope(): {
24
22
  scope: string | undefined;
package/dist/index.d.ts CHANGED
@@ -68,7 +68,7 @@ export type { ButtonGroupPart, ButtonGroupProps, ButtonPart, ButtonProps, Button
68
68
  export type { CarouselControls, CarouselPart, CarouselPerViewBreakpoints, CarouselProps, } from './components/carousel/types.js';
69
69
  export type { CheckboxGroupLayout, CheckboxGroupOption, CheckboxGroupPart, CheckboxGroupProps, CheckboxPart, CheckboxProps, CheckboxSize, } from './components/checkbox/types.js';
70
70
  export type { ChipGroupPart, ChipGroupProps, ChipPart, ChipProps, ChipSize, } from './components/chip/types.js';
71
- export type { ContainerPart, ContainerProps, ContainerWidth } from './components/container/types.js';
71
+ export type { ContainerProps, ContainerWidth } from './components/container/types.js';
72
72
  export type { ContentCardPart, ContentCardProps, ContentCardRatio, ContentCardVariant, FeatureCardPart, FeatureCardProps, FeatureCardVariant, } from './components/card/types.js';
73
73
  export type { CurrencyInputPart, CurrencyInputProps } from './components/currency-input/types.js';
74
74
  export type { DialogPart, DialogProps, DialogSize } from './components/dialog/types.js';
@@ -76,7 +76,7 @@ export type { DrawerPart, DrawerProps, DrawerSide } from './components/drawer/ty
76
76
  export type { EditorPlaceholderPart, EditorPlaceholderProps, EmptyStatePart, EmptyStateProps, EmptyStateVariant, } from './components/empty-state/types.js';
77
77
  export type { FieldWrapperCounter, FieldWrapperPart, FieldWrapperProps, } from './components/field-wrapper/types.js';
78
78
  export type { FormLayoutHeadingLevel, FormLayoutPart, FormLayoutProps, FormLayoutSubmitPayload, FormLayoutVariant, } from './components/form-layout/types.js';
79
- export type { IconComponent, IconPart, IconProps, IconSize } from './components/icon/types.js';
79
+ export type { IconComponent, IconProps, IconSize } from './components/icon/types.js';
80
80
  export type { ImageCrop, ImageMedia, ImagePart, ImageProps, ImageRatio, } from './components/image/types.js';
81
81
  export type { InputPart, InputProps, InputSize, InputType } from './components/input/types.js';
82
82
  export type { LightboxImage, LightboxPart, LightboxProps } from './components/lightbox/types.js';
@@ -95,18 +95,18 @@ export type { RangeSliderEnd, RangeSliderInputsSlotProps, RangeSliderPart, Range
95
95
  export type { RatingPart, RatingProps, RatingSize } from './components/rating/types.js';
96
96
  export type { SearchBarPart, SearchBarProps, SearchBarSize, SearchResultItem, SearchResultType, SearchResults, SearchRow, SearchSection, SearchSelectType, } from './components/search-bar/types.js';
97
97
  export type { SearchModalPart, SearchModalProps } from './components/search-modal/types.js';
98
- export type { SectionBackground, SectionPart, SectionProps, SectionSpacing, } from './components/section/types.js';
98
+ export type { SectionBackground, SectionProps, SectionSpacing } from './components/section/types.js';
99
99
  export type { SiteFormClient, SiteFormDefinition, SiteFormFailure, SiteFormFailureReason, SiteFormField, SiteFormLayout, SiteFormPart, SiteFormProps, SiteFormStatus, SiteFormSubmitOutcome, SiteFormSuccess, SiteFormValue, } from './components/site-form/types.js';
100
100
  export type { SkeletonPart, SkeletonProps, SkeletonVariant } from './components/skeleton/types.js';
101
101
  export type { SwitchPart, SwitchProps, SwitchSize, SwitchSlotProps, } from './components/switch/types.js';
102
102
  export type { TabPanelPart, TabPanelProps, TabPart, TabProps, TabsActivation, TabsItem, TabsPart, TabsProps, TabsVariant, } from './components/tabs/types.js';
103
- export type { TablerIconPart, TablerIconProps } from './components/tabler-icon/types.js';
103
+ export type { TablerIconProps } from './components/tabler-icon/types.js';
104
104
  export type { TextareaPart, TextareaProps } from './components/textarea/types.js';
105
105
  export type { ToastAction, ToastPart, ToastProps, ToastVariant, ToasterPart, ToasterPosition, ToasterProps, ToasterToast, } from './components/toast/types.js';
106
106
  export type { TooltipAlign, TooltipPart, TooltipPlacement, TooltipProps, TooltipRole, } from './components/tooltip/types.js';
107
107
  export type { UnitInputPart, UnitInputProps } from './components/unit-input/types.js';
108
108
  export type { VariantPickerOption, VariantPickerPart, VariantPickerProps, VariantPickerType, } from './components/variant-picker/types.js';
109
- export type { VisuallyHiddenPart, VisuallyHiddenProps } from './components/visually-hidden/types.js';
109
+ export type { VisuallyHiddenProps } from './components/visually-hidden/types.js';
110
110
  export { defaultMessages, enUS } from './messages/index.js';
111
111
  export { MESSAGES_KEY, provideEldraUiMessages, useMessages, type UiMessages, } from './composables/useMessages.js';
112
112
  export { CURRENCY_KEY, DEFAULT_UI_LOCALE, LOCALE_KEY, provideEldraUiCurrency, provideEldraUiLocale, useEldraUiCurrency, useEldraUiLocale, } from './composables/useLocale.js';
@@ -135,7 +135,6 @@ export { SECTION_KEY } from './components/section/context.js';
135
135
  export { CHIP_GROUP_KEY, type ChipGroupContext } from './components/chip/context.js';
136
136
  export { ACCORDION_KEY, type AccordionContext } from './components/accordion/context.js';
137
137
  export { TABS_KEY, type TabsContext, type TabsEntry } from './components/tabs/context.js';
138
- export { cx, partClass, type ClassValue } from './utils/cx.js';
139
138
  export { mixToward } from './utils/color.js';
140
139
  export { joinIds, useUiId } from './utils/id.js';
141
140
  export { applyMask, defaultCharacterMeaning, stripMask } from './utils/mask.js';