@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.
- package/CHANGELOG.md +1724 -0
- package/LICENSE +21 -0
- package/README.md +3177 -2
- package/dist/VariantPicker-CKw8hmxt.js +9009 -0
- package/dist/componentNames.d.ts +19 -0
- package/dist/components/accordion/Accordion.vue.d.ts +18 -0
- package/dist/components/accordion/AccordionItem.vue.d.ts +26 -0
- package/dist/components/accordion/context.d.ts +20 -0
- package/dist/components/accordion/detailsExclusivity.d.ts +3 -0
- package/dist/components/accordion/heightTransition.d.ts +59 -0
- package/dist/components/accordion/types.d.ts +40 -0
- package/dist/components/avatar/Avatar.vue.d.ts +10 -0
- package/dist/components/avatar/AvatarGroup.vue.d.ts +7 -0
- package/dist/components/avatar/types.d.ts +61 -0
- package/dist/components/badge/Badge.vue.d.ts +24 -0
- package/dist/components/badge/StockBadge.vue.d.ts +10 -0
- package/dist/components/badge/types.d.ts +79 -0
- package/dist/components/breadcrumb/Breadcrumb.vue.d.ts +10 -0
- package/dist/components/breadcrumb/types.d.ts +53 -0
- package/dist/components/button/Button.vue.d.ts +37 -0
- package/dist/components/button/ButtonGroup.vue.d.ts +17 -0
- package/dist/components/button/types.d.ts +68 -0
- package/dist/components/card/ContentCard.vue.d.ts +36 -0
- package/dist/components/card/FeatureCard.vue.d.ts +27 -0
- package/dist/components/card/cueArrow.d.ts +10 -0
- package/dist/components/card/stretchedLink.d.ts +45 -0
- package/dist/components/card/types.d.ts +92 -0
- package/dist/components/carousel/Carousel.vue.d.ts +39 -0
- package/dist/components/carousel/types.d.ts +75 -0
- package/dist/components/carousel/useCarousel.d.ts +152 -0
- package/dist/components/checkbox/Checkbox.vue.d.ts +36 -0
- package/dist/components/checkbox/CheckboxGroup.vue.d.ts +16 -0
- package/dist/components/checkbox/types.d.ts +78 -0
- package/dist/components/chip/Chip.vue.d.ts +37 -0
- package/dist/components/chip/ChipGroup.vue.d.ts +21 -0
- package/dist/components/chip/context.d.ts +22 -0
- package/dist/components/chip/types.d.ts +84 -0
- package/dist/components/container/Container.vue.d.ts +18 -0
- package/dist/components/container/types.d.ts +17 -0
- package/dist/components/currency-input/CurrencyInput.vue.d.ts +17 -0
- package/dist/components/currency-input/types.d.ts +8 -0
- package/dist/components/dialog/Dialog.vue.d.ts +34 -0
- package/dist/components/dialog/types.d.ts +25 -0
- package/dist/components/drawer/Drawer.vue.d.ts +36 -0
- package/dist/components/drawer/types.d.ts +30 -0
- package/dist/components/empty-state/EditorPlaceholder.vue.d.ts +9 -0
- package/dist/components/empty-state/EmptyState.vue.d.ts +28 -0
- package/dist/components/empty-state/types.d.ts +59 -0
- package/dist/components/field-wrapper/FieldError.vue.d.ts +37 -0
- package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +30 -0
- package/dist/components/field-wrapper/context.d.ts +44 -0
- package/dist/components/field-wrapper/types.d.ts +38 -0
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +48 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +77 -0
- package/dist/components/filter-panel/Histogram.vue.d.ts +15 -0
- package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +20 -0
- package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/shared.d.ts +39 -0
- package/dist/components/filter-panel/northwind.d.ts +32 -0
- package/dist/components/filter-panel/swatchInk.d.ts +50 -0
- package/dist/components/filter-panel/types.d.ts +183 -0
- package/dist/components/filter-panel/useFilterPanel.d.ts +230 -0
- package/dist/components/form-layout/FormLayout.vue.d.ts +36 -0
- package/dist/components/form-layout/context.d.ts +33 -0
- package/dist/components/form-layout/focusInvalid.d.ts +18 -0
- package/dist/components/form-layout/types.d.ts +52 -0
- package/dist/components/icon/Icon.vue.d.ts +8 -0
- package/dist/components/icon/types.d.ts +29 -0
- package/dist/components/image/Image.vue.d.ts +21 -0
- package/dist/components/image/types.d.ts +81 -0
- package/dist/components/input/Input.vue.d.ts +47 -0
- package/dist/components/input/classes.d.ts +110 -0
- package/dist/components/input/types.d.ts +55 -0
- package/dist/components/internal/ValueText.vue.d.ts +7 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +19 -0
- package/dist/components/lightbox/types.d.ts +47 -0
- package/dist/components/link/Link.vue.d.ts +23 -0
- package/dist/components/link/types.d.ts +40 -0
- package/dist/components/load-more/LoadMore.vue.d.ts +12 -0
- package/dist/components/load-more/types.d.ts +21 -0
- package/dist/components/logo-item/LogoItem.vue.d.ts +10 -0
- package/dist/components/logo-item/types.d.ts +37 -0
- package/dist/components/pagination/Pagination.vue.d.ts +15 -0
- package/dist/components/pagination/types.d.ts +51 -0
- package/dist/components/popover/Popover.vue.d.ts +31 -0
- package/dist/components/popover/types.d.ts +53 -0
- package/dist/components/price/Price.vue.d.ts +25 -0
- package/dist/components/price/types.d.ts +104 -0
- package/dist/components/product-card/ProductCard.vue.d.ts +22 -0
- package/dist/components/product-card/types.d.ts +123 -0
- package/dist/components/quantity-stepper/QuantityStepper.vue.d.ts +26 -0
- package/dist/components/quantity-stepper/types.d.ts +35 -0
- package/dist/components/radio/RadioGroup.vue.d.ts +38 -0
- package/dist/components/radio/types.d.ts +39 -0
- package/dist/components/range-slider/RangeSlider.vue.d.ts +70 -0
- package/dist/components/range-slider/types.d.ts +151 -0
- package/dist/components/range-slider/useRangeSlider.d.ts +106 -0
- package/dist/components/rating/Rating.vue.d.ts +22 -0
- package/dist/components/rating/RatingStars.vue.d.ts +16 -0
- package/dist/components/rating/types.d.ts +45 -0
- package/dist/components/search-bar/SearchBar.vue.d.ts +47 -0
- package/dist/components/search-bar/SearchResultsPanel.vue.d.ts +93 -0
- package/dist/components/search-bar/shortcutOwner.d.ts +39 -0
- package/dist/components/search-bar/types.d.ts +122 -0
- package/dist/components/search-modal/SearchModal.vue.d.ts +53 -0
- package/dist/components/search-modal/types.d.ts +59 -0
- package/dist/components/section/Section.vue.d.ts +21 -0
- package/dist/components/section/context.d.ts +23 -0
- package/dist/components/section/types.d.ts +34 -0
- package/dist/components/select/MultiSelect.vue.d.ts +62 -0
- package/dist/components/select/Select.vue.d.ts +57 -0
- package/dist/components/select/SelectPanel.vue.d.ts +97 -0
- package/dist/components/select/openRegistry.d.ts +11 -0
- package/dist/components/select/panelParts.d.ts +91 -0
- package/dist/components/select/types.d.ts +129 -0
- package/dist/components/select/useListbox.d.ts +106 -0
- package/dist/components/select/useOptionList.d.ts +61 -0
- package/dist/components/select/usePopover.d.ts +147 -0
- package/dist/components/skeleton/Skeleton.vue.d.ts +12 -0
- package/dist/components/skeleton/types.d.ts +38 -0
- package/dist/components/spinner/Spinner.vue.d.ts +3 -0
- package/dist/components/switch/Switch.vue.d.ts +30 -0
- package/dist/components/switch/types.d.ts +20 -0
- package/dist/components/tabs/Tab.vue.d.ts +17 -0
- package/dist/components/tabs/TabPanel.vue.d.ts +16 -0
- package/dist/components/tabs/Tabs.vue.d.ts +28 -0
- package/dist/components/tabs/context.d.ts +48 -0
- package/dist/components/tabs/types.d.ts +63 -0
- package/dist/components/textarea/Textarea.vue.d.ts +27 -0
- package/dist/components/textarea/supportsFieldSizing.d.ts +10 -0
- package/dist/components/textarea/types.d.ts +32 -0
- package/dist/components/toast/Toast.vue.d.ts +16 -0
- package/dist/components/toast/Toaster.vue.d.ts +13 -0
- package/dist/components/toast/types.d.ts +44 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +9 -0
- package/dist/components/tooltip/supportsFocusVisible.d.ts +17 -0
- package/dist/components/tooltip/types.d.ts +46 -0
- package/dist/components/unit-input/UnitInput.vue.d.ts +55 -0
- package/dist/components/unit-input/types.d.ts +68 -0
- package/dist/components/unit-input/undo-redo.d.ts +6 -0
- package/dist/components/variant-picker/VariantPicker.vue.d.ts +15 -0
- package/dist/components/variant-picker/types.d.ts +49 -0
- package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +18 -0
- package/dist/components/visually-hidden/types.d.ts +14 -0
- package/dist/composables/dialogStack.d.ts +52 -0
- package/dist/composables/teleportTarget.d.ts +79 -0
- package/dist/composables/useControllableModel.d.ts +16 -0
- package/dist/composables/useDialog.d.ts +84 -0
- package/dist/composables/useFloating.d.ts +82 -0
- package/dist/composables/useHeadingTag.d.ts +24 -0
- package/dist/composables/useLocale.d.ts +81 -0
- package/dist/composables/useMessages.d.ts +30 -0
- package/dist/composables/useOverlay.d.ts +88 -0
- package/dist/composables/useSlotPresence.d.ts +29 -0
- package/dist/composables/useToast.d.ts +53 -0
- package/dist/icons/paths.d.ts +10 -0
- package/dist/index.d.ts +135 -0
- package/dist/index.js +12586 -0
- package/dist/listFormat-1UrH38f2.js +39 -0
- package/dist/messages/en-US.d.ts +485 -0
- package/dist/messages/index.d.ts +2 -0
- package/dist/messages/is-IS.d.ts +16 -0
- package/dist/messages/is-IS.js +169 -0
- package/dist/resolver.d.ts +43 -0
- package/dist/resolver.js +121 -0
- package/dist/style.css +5251 -0
- package/dist/tailwind.css +2057 -0
- package/dist/tokens.css +134 -0
- package/dist/utils/avatar.d.ts +15 -0
- package/dist/utils/color.d.ts +11 -0
- package/dist/utils/cssTiming.d.ts +40 -0
- package/dist/utils/cx.d.ts +31 -0
- package/dist/utils/date.d.ts +45 -0
- package/dist/utils/id.d.ts +36 -0
- package/dist/utils/listFormat.d.ts +22 -0
- package/dist/utils/mask.d.ts +48 -0
- package/dist/utils/number-format.d.ts +250 -0
- package/dist/utils/numeric-input.d.ts +42 -0
- package/dist/utils/rating.d.ts +26 -0
- package/dist/utils/ratio.d.ts +18 -0
- package/dist/utils/tagRecipe.d.ts +24 -0
- package/dist/utils/valueFade.d.ts +42 -0
- package/dist/vee-validate/FieldCheckbox.vue.d.ts +14 -0
- package/dist/vee-validate/FieldCheckboxGroup.vue.d.ts +14 -0
- package/dist/vee-validate/FieldCurrencyInput.vue.d.ts +14 -0
- package/dist/vee-validate/FieldInput.vue.d.ts +14 -0
- package/dist/vee-validate/FieldMultiSelect.vue.d.ts +14 -0
- package/dist/vee-validate/FieldQuantityStepper.vue.d.ts +14 -0
- package/dist/vee-validate/FieldRadioGroup.vue.d.ts +14 -0
- package/dist/vee-validate/FieldSearchBar.vue.d.ts +14 -0
- package/dist/vee-validate/FieldSelect.vue.d.ts +14 -0
- package/dist/vee-validate/FieldSwitch.vue.d.ts +14 -0
- package/dist/vee-validate/FieldTextarea.vue.d.ts +14 -0
- package/dist/vee-validate/FieldUnitInput.vue.d.ts +14 -0
- package/dist/vee-validate/FieldVariantPicker.vue.d.ts +14 -0
- package/dist/vee-validate/Form.vue.d.ts +27 -0
- package/dist/vee-validate/context.d.ts +48 -0
- package/dist/vee-validate/index.d.ts +27 -0
- package/dist/vee-validate/types.d.ts +115 -0
- package/dist/vee-validate/useFieldControl.d.ts +67 -0
- package/dist/vee-validate.js +1154 -0
- package/package.json +99 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { SelectOption } from './types.js';
|
|
3
|
+
/** The label split into the run before the match, the match itself, and the run after it. */
|
|
4
|
+
export interface MatchParts {
|
|
5
|
+
before: string;
|
|
6
|
+
match: string;
|
|
7
|
+
after: string;
|
|
8
|
+
}
|
|
9
|
+
/** One block of the panel's list: an `<optgroup>`-like heading and the rows under it. */
|
|
10
|
+
export interface PanelSection {
|
|
11
|
+
key: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
labelId?: string;
|
|
14
|
+
options: SelectOption[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Where a query matches inside a label, in **code points of the original string**.
|
|
18
|
+
*
|
|
19
|
+
* Matching is case- and diacritic-insensitive (the spec's "'island' finds 'Ísland'"), so the
|
|
20
|
+
* comparison happens on a normalised copy — and the match has to be reported back in the original
|
|
21
|
+
* string's own offsets, or the bold-and-underlined run would land on the wrong characters for any
|
|
22
|
+
* label holding an accent. Hence the per-character walk: each original code point contributes zero
|
|
23
|
+
* (a combining mark) or more normalised characters, and `positions` maps back.
|
|
24
|
+
*/
|
|
25
|
+
export declare function matchRange(label: string, rawQuery: string): {
|
|
26
|
+
start: number;
|
|
27
|
+
end: number;
|
|
28
|
+
} | null;
|
|
29
|
+
/**
|
|
30
|
+
* Options bucketed by `group`, in the order each group first appears — so a "Most used" group
|
|
31
|
+
* written first stays first, which is exactly the spec's advice ("Put the 3 to 5 most likely
|
|
32
|
+
* answers first"). Options with no `group` form an unlabelled section of their own.
|
|
33
|
+
*/
|
|
34
|
+
export declare function groupOptions(list: SelectOption[], idPrefix: string, controlId: string): PanelSection[];
|
|
35
|
+
export interface UseOptionListOptions {
|
|
36
|
+
/** Every option the control was given, in the order the consumer wrote them. */
|
|
37
|
+
options: () => SelectOption[];
|
|
38
|
+
/** The current search query. Ignored entirely when `searchable` says no. */
|
|
39
|
+
query: () => string;
|
|
40
|
+
searchable: () => boolean;
|
|
41
|
+
/** The control's own id, which the group headings' ids are built from. */
|
|
42
|
+
controlId: () => string;
|
|
43
|
+
}
|
|
44
|
+
export interface UseOptionListReturn {
|
|
45
|
+
/** The visible options bucketed into the panel's sections. */
|
|
46
|
+
sections: ComputedRef<PanelSection[]>;
|
|
47
|
+
/** *Every* option bucketed, for the hidden native select's `<optgroup>`s. */
|
|
48
|
+
nativeSections: ComputedRef<PanelSection[]>;
|
|
49
|
+
/** The visible rows in DOM order — the section order, not the prop order, once groups interleave. */
|
|
50
|
+
listOptions: ComputedRef<SelectOption[]>;
|
|
51
|
+
hasOptions: ComputedRef<boolean>;
|
|
52
|
+
/** Per option value, where the query matched its label — or `null` when it did not. */
|
|
53
|
+
highlights: ComputedRef<Map<string, MatchParts | null>>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The list a select panel shows: filtering, grouping and match highlighting.
|
|
57
|
+
*
|
|
58
|
+
* Shared by `Select` and `MultiSelect`, which differ in what choosing a row *does* and in nothing
|
|
59
|
+
* about which rows there are. Pure derivation — no DOM, no state of its own.
|
|
60
|
+
*/
|
|
61
|
+
export declare function useOptionList(options: UseOptionListOptions): UseOptionListReturn;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { FloatingPlacement } from '../../composables/useFloating.js';
|
|
3
|
+
export interface UsePopoverOptions {
|
|
4
|
+
/** The control that opens the popup, and the element focus goes back to. */
|
|
5
|
+
trigger: Ref<HTMLElement | null>;
|
|
6
|
+
/** The popup element itself. A `computed` over a child component's exposed root is fine. */
|
|
7
|
+
content: Ref<HTMLElement | null> | ComputedRef<HTMLElement | null>;
|
|
8
|
+
/** Whether the control may open at all (a disabled or read-only field may not). Default `true`. */
|
|
9
|
+
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;
|
|
14
|
+
/** Give the panel a `minWidth` equal to the control's — and, under `'exact'`, a `maxWidth` too. */
|
|
15
|
+
matchWidth?: boolean | 'exact';
|
|
16
|
+
/**
|
|
17
|
+
* Where the panel is rendered. Read once, like every `useFloating` option.
|
|
18
|
+
*
|
|
19
|
+
* - `true` (the default) — through a `<Teleport>` to `document.body`, or to the nearest **open
|
|
20
|
+
* native `<dialog>`** above the trigger when there is one (see `teleportTo` below).
|
|
21
|
+
* - a string — a CSS selector, passed to `<Teleport to>` verbatim.
|
|
22
|
+
* - `false` — no teleport: the panel stays where the consumer renders it, positioned
|
|
23
|
+
* `absolute`ly, which is what this package did before.
|
|
24
|
+
*
|
|
25
|
+
* The default is `true` because a panel rendered inside its own control is at the mercy of
|
|
26
|
+
* everything above it: an ancestor with `overflow: hidden` (a card, a table cell, a carousel
|
|
27
|
+
* track) clips it, and any later sibling that starts a stacking context (a sticky header with a
|
|
28
|
+
* `z-index`, a section with `isolate`) paints over it however high the panel's own `z-index` is.
|
|
29
|
+
* On `body` neither can happen, and `z-popover` is then measured against the page.
|
|
30
|
+
*/
|
|
31
|
+
teleport?: boolean | string;
|
|
32
|
+
/**
|
|
33
|
+
* Keep the panel in the `Tab` walk while it is teleported. Read on every keystroke, so a control
|
|
34
|
+
* whose panel only sometimes holds focusables can answer per state.
|
|
35
|
+
*
|
|
36
|
+
* Sequential focus follows the **DOM**, and a teleported panel is no longer after its control in
|
|
37
|
+
* it — so `Tab` from the control would step past the panel to whatever comes next on the page,
|
|
38
|
+
* and the popup would close with its own controls never reached. Two of this package's panels
|
|
39
|
+
* have real tab stops in them (a multi-select's footer Clear and Done; whatever a consumer puts
|
|
40
|
+
* in the `SearchBar`'s row slot), and the design spec's Multi-select Keyboard table is explicit
|
|
41
|
+
* that `Tab` walks "from the search field (or the trigger) to the footer's Clear, then Done, with
|
|
42
|
+
* the popover still open".
|
|
43
|
+
*
|
|
44
|
+
* Turn this on and `usePopover` restores exactly that walk, and nothing more:
|
|
45
|
+
*
|
|
46
|
+
* - `Tab` on the **last** tab stop the control still holds — its trigger, or the clear button
|
|
47
|
+
* beside it when one is rendered, or whatever else claims the panel's id with
|
|
48
|
+
* `data-eldra-overlay-owner` — moves focus to the panel's **first** focusable. The steps
|
|
49
|
+
* *within* the control are untouched: those elements are still siblings in the DOM, so the
|
|
50
|
+
* browser walks trigger → clear button on its own, and only the step that would leave the
|
|
51
|
+
* control is redirected;
|
|
52
|
+
* - `Shift+Tab` on the panel's first focusable moves it back to that same last stop — the clear
|
|
53
|
+
* button when there is one, else the trigger — from which the browser's own reverse order
|
|
54
|
+
* finishes the walk;
|
|
55
|
+
* - `Tab` on the panel's **last** focusable is left alone — focus leaves for the next thing on
|
|
56
|
+
* the page, and `useOverlay` closes the popup behind it.
|
|
57
|
+
*
|
|
58
|
+
* That last one is what keeps this a redirect rather than a focus trap: there is an exit forward
|
|
59
|
+
* (past the last row) and an exit backward (`Shift+Tab` to the trigger, then on), so WCAG 2.1.2
|
|
60
|
+
* is satisfied — a keyboard user is never held anywhere. It is also why nothing here is a
|
|
61
|
+
* `focusin` correction: only the two boundary keystrokes are touched, and every other `Tab`
|
|
62
|
+
* inside the panel is the browser's own.
|
|
63
|
+
*
|
|
64
|
+
* Off by default, and inert while the panel is not teleported (in place, the DOM order is
|
|
65
|
+
* already right) or holds no focusable at all.
|
|
66
|
+
*/
|
|
67
|
+
tabRedirect?: boolean | (() => boolean);
|
|
68
|
+
/** Ran while opening, after the registry slot is claimed: reset state, emit `open`. */
|
|
69
|
+
onOpen?: () => void;
|
|
70
|
+
/** Ran while closing, after the registry slot is released: reset state, emit `close`. */
|
|
71
|
+
onClose?: () => void;
|
|
72
|
+
/** Ran a tick after an open that was actually a *change*: move focus into the panel. */
|
|
73
|
+
afterOpen?: () => void | Promise<void>;
|
|
74
|
+
/** What a pointer press on the trigger should open, when the popup is closed. */
|
|
75
|
+
openFromPointer?: () => void;
|
|
76
|
+
}
|
|
77
|
+
export interface UsePopoverReturn {
|
|
78
|
+
/** Whether the popup is showing. Written only through the functions below. */
|
|
79
|
+
isOpen: Ref<boolean>;
|
|
80
|
+
/** Open or close, with the registry and the two hooks. Ignores a no-op. */
|
|
81
|
+
setOpen(next: boolean): void;
|
|
82
|
+
/**
|
|
83
|
+
* Open, then make something active (the caller's listbox), then run `afterOpen` — the last one
|
|
84
|
+
* only when this call is what opened it, so re-opening an open panel never re-focuses it.
|
|
85
|
+
*/
|
|
86
|
+
open(activate?: (wasOpen: boolean) => void): void;
|
|
87
|
+
/** Close, putting focus back on the trigger unless told not to. */
|
|
88
|
+
close(returnFocus?: boolean): void;
|
|
89
|
+
/** `useFloating`'s position plus the entrance origin the keyframes read. */
|
|
90
|
+
panelStyle: ComputedRef<Record<string, string>>;
|
|
91
|
+
/** The placement actually used, after flipping. */
|
|
92
|
+
placement: ComputedRef<string>;
|
|
93
|
+
/**
|
|
94
|
+
* `<Teleport to>`: the open `<dialog>` the trigger sits in, or `document.body`, or the
|
|
95
|
+
* consumer's own selector. An **element** rather than a selector wherever one is known, so two
|
|
96
|
+
* open dialogs cannot both answer the same query.
|
|
97
|
+
*/
|
|
98
|
+
teleportTo: ComputedRef<HTMLElement | string>;
|
|
99
|
+
/**
|
|
100
|
+
* `<Teleport disabled>`: `true` until this component is mounted, and for good when
|
|
101
|
+
* `teleport: false`.
|
|
102
|
+
*
|
|
103
|
+
* The mounted flag is what makes the teleport SSR-safe. `<Teleport>` renders its content into a
|
|
104
|
+
* separate buffer on the server, and hydration then has to find it somewhere the server never
|
|
105
|
+
* put it; `disabled` renders in place on both sides instead, and the real teleport happens once,
|
|
106
|
+
* after mount, when Vue simply moves the nodes. (These popups also start closed, so a server
|
|
107
|
+
* render emits no panel at all — this is the second lock on the same door.)
|
|
108
|
+
*/
|
|
109
|
+
teleportDisabled: ComputedRef<boolean>;
|
|
110
|
+
/** Put these two on the trigger to get the label-forwarded-click rule (see below). */
|
|
111
|
+
onTriggerPointerDown(): void;
|
|
112
|
+
onTriggerClick(event: MouseEvent): void;
|
|
113
|
+
}
|
|
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
|
+
export declare function usePopover(options: UsePopoverOptions): UsePopoverReturn;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SkeletonPart, SkeletonProps, SkeletonVariant } from './types.js';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<SkeletonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
|
|
3
|
+
size: string;
|
|
4
|
+
classes: Partial<Record<SkeletonPart, string>>;
|
|
5
|
+
variant: SkeletonVariant;
|
|
6
|
+
width: string;
|
|
7
|
+
ratio: import('../../index.js').ImageRatio;
|
|
8
|
+
lines: number;
|
|
9
|
+
busyLabel: string | null;
|
|
10
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ImageRatio } from '../image/types.js';
|
|
2
|
+
/** Spec "Skeleton" → Properties/Variants, `variant` row: the five shape primitives. */
|
|
3
|
+
export type SkeletonVariant = 'text' | 'title' | 'circle' | 'media' | 'btn';
|
|
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';
|
|
8
|
+
export interface SkeletonProps {
|
|
9
|
+
/** The shape. Defaults to `'text'`. */
|
|
10
|
+
variant?: SkeletonVariant;
|
|
11
|
+
/** Number of text lines. `text` only — every other variant always renders one shape. */
|
|
12
|
+
lines?: number;
|
|
13
|
+
/**
|
|
14
|
+
* An explicit width for the whole component, e.g. `'12rem'`. Unset (the default), the root is
|
|
15
|
+
* `block w-full` — see `Skeleton.vue`'s own comment for why a percentage-width shape inside an
|
|
16
|
+
* `inline-flex`/shrink-to-fit ancestor needs this escape hatch. When set, every shape inside
|
|
17
|
+
* renders at the root's full (now definite) width instead of its own default percentage.
|
|
18
|
+
*/
|
|
19
|
+
width?: string;
|
|
20
|
+
/** The frame's aspect preset. `media` only. Defaults to `'4x5'` (spec "Skeleton" → Sizes,
|
|
21
|
+
* `media` row — matches the product card's own ratio). See `src/utils/ratio.ts`. */
|
|
22
|
+
ratio?: ImageRatio;
|
|
23
|
+
/** The circle's diameter (width = height). `circle` only. Defaults to `'2.5rem'`. */
|
|
24
|
+
size?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Names the root as a live busy region (spec "Skeleton" → Anatomy, part 1: "Busy region: the
|
|
27
|
+
* element being filled, with `aria-busy=\"true\"` and a visually hidden 'Loading products…'
|
|
28
|
+
* text"; region-level `busyLabel`, default `"Loading products…"`). With a label, the root gets
|
|
29
|
+
* `role="status"`, `aria-busy="true"` and `aria-label` set to it, and every shape is individually
|
|
30
|
+
* `aria-hidden`. `null`/omitted (the default) leaves the root itself `aria-hidden`, as it always
|
|
31
|
+
* was — the right shape for a `Skeleton` composed *inside* another component's own already-named
|
|
32
|
+
* busy region (`ProductCard`'s loading root, for one), where naming this root too would give the
|
|
33
|
+
* region two competing accessible names.
|
|
34
|
+
*/
|
|
35
|
+
busyLabel?: string | null;
|
|
36
|
+
/** Per-part class overrides, merged over the component's own classes with `tailwind-merge`. */
|
|
37
|
+
classes?: Partial<Record<SkeletonPart, string>>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SwitchProps, SwitchSize } from './types.js';
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
} & {
|
|
6
|
+
description?: (props: typeof __VLS_3) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import('vue').DefineComponent<SwitchProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
"update:modelValue": (checked: boolean) => any;
|
|
10
|
+
change: (checked: boolean) => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<SwitchProps> & Readonly<{
|
|
12
|
+
"onUpdate:modelValue"?: ((checked: boolean) => any) | undefined;
|
|
13
|
+
onChange?: ((checked: boolean) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
size: SwitchSize;
|
|
16
|
+
name: string;
|
|
17
|
+
classes: Partial<Record<import('./types.js').SwitchPart, string>>;
|
|
18
|
+
modelValue: boolean;
|
|
19
|
+
id: string;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
description: string;
|
|
22
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
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';
|
|
3
|
+
/** The spec's two sizes: the default and the filter-bar/dense-list compact one. */
|
|
4
|
+
export type SwitchSize = 'md' | 'sm';
|
|
5
|
+
export interface SwitchProps {
|
|
6
|
+
/** On/off (two-way). Reflected as `aria-checked`. */
|
|
7
|
+
modelValue?: boolean;
|
|
8
|
+
/** Track 2.75 × 1.5rem (`md`, the default) or 2.25 × 1.25rem (`sm`, filter bars). */
|
|
9
|
+
size?: SwitchSize;
|
|
10
|
+
/** A second line under the label, linked with `aria-describedby` rather than in the name. */
|
|
11
|
+
description?: string;
|
|
12
|
+
/** Native `disabled`. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** The control's id. Comes from the `FieldWrapper` when there is one; this wins over it. */
|
|
15
|
+
id?: string;
|
|
16
|
+
/** Native form field name, carried by the hidden mirror `<input type="checkbox">`. */
|
|
17
|
+
name?: string;
|
|
18
|
+
/** Per-part class overrides, merged with `tailwind-merge`. */
|
|
19
|
+
classes?: Partial<Record<SwitchPart, string>>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TabProps } from './types.js';
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import('vue').DefineComponent<TabProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TabProps> & Readonly<{}>, {
|
|
7
|
+
title: string;
|
|
8
|
+
classes: Partial<Record<import('./types.js').TabPart, string>>;
|
|
9
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TabPanelProps } from './types.js';
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import('vue').DefineComponent<TabPanelProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TabPanelProps> & Readonly<{}>, {
|
|
7
|
+
classes: Partial<Record<import('./types.js').TabPanelPart, string>>;
|
|
8
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TabsProps } from './types.js';
|
|
2
|
+
declare var __VLS_6: {}, __VLS_14: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
tabs?: (props: typeof __VLS_6) => any;
|
|
5
|
+
} & {
|
|
6
|
+
default?: (props: typeof __VLS_14) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import('vue').DefineComponent<TabsProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
"update:modelValue": (value: string) => any;
|
|
10
|
+
change: (value: string) => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<TabsProps> & Readonly<{
|
|
12
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
13
|
+
onChange?: ((value: string) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
classes: Partial<Record<import('./types.js').TabsPart, string>>;
|
|
16
|
+
modelValue: string;
|
|
17
|
+
variant: import('./types.js').TabsVariant;
|
|
18
|
+
items: import('./types.js').TabsItem[];
|
|
19
|
+
activation: import('./types.js').TabsActivation;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
import { TabsActivation, TabsVariant } from './types.js';
|
|
3
|
+
/** What a mounted `Tab` gives the `Tabs` root that owns it, so the root can move focus to it and
|
|
4
|
+
* place it in the registration order without owning any of its DOM itself. */
|
|
5
|
+
export interface TabsEntry {
|
|
6
|
+
value: string;
|
|
7
|
+
/** Moves real DOM focus to this tab's `<button>`. */
|
|
8
|
+
focus: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What `Tabs` provides, and every `Tab`/`TabPanel` injects.
|
|
12
|
+
*
|
|
13
|
+
* `Tabs` does not render its children when the slots API is used — a consumer places `<Tab>`s in
|
|
14
|
+
* the `tabs` slot and `<TabPanel>`s in the default slot, the same shape `ChipGroup` and
|
|
15
|
+
* `ButtonGroup` already use for theirs — so this context is the only channel a child has to the
|
|
16
|
+
* selected value, the activation model, the variant, and the keyboard table's cross-tab moves.
|
|
17
|
+
*
|
|
18
|
+
* **Registration, not a DOM query.** Arrow-key navigation and the spec's "defaults to the first
|
|
19
|
+
* tab" rule (see `TabsProps.modelValue`) both need to know the tabs' order, but `Tabs` cannot see
|
|
20
|
+
* its own children's `value`s or order through props alone — the slots API hands it opaque vnodes,
|
|
21
|
+
* and the `items` API is rendered through this exact same `Tab` component (see `Tabs.vue`), so one
|
|
22
|
+
* mechanism has to serve both. Each `Tab` calls `register` in its own `onMounted` and the matching
|
|
23
|
+
* unregister function in `onBeforeUnmount`; Vue mounts sibling components in document order, so the
|
|
24
|
+
* array `Tabs.vue` builds from these calls is DOM order without either side ever touching the DOM
|
|
25
|
+
* to find out.
|
|
26
|
+
*/
|
|
27
|
+
export interface TabsContext {
|
|
28
|
+
/** The selected value, or `undefined` before any `Tab` has registered. */
|
|
29
|
+
selectedValue: ComputedRef<string | undefined>;
|
|
30
|
+
activation: ComputedRef<TabsActivation>;
|
|
31
|
+
variant: ComputedRef<TabsVariant>;
|
|
32
|
+
isSelected: (value: string) => boolean;
|
|
33
|
+
/** Selects `value` and emits `update:modelValue`/`change`. */
|
|
34
|
+
select: (value: string) => void;
|
|
35
|
+
/** Adds a `Tab` to the registration order. Returns the function that removes it again. */
|
|
36
|
+
register: (entry: TabsEntry) => () => void;
|
|
37
|
+
/** `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. */
|
|
39
|
+
moveFocus: (current: string, delta: 1 | -1) => void;
|
|
40
|
+
/** `Home` (`'first'`) / `End` (`'last'`): same as `moveFocus`, but to an end of the list. */
|
|
41
|
+
focusEdge: (edge: 'first' | 'last') => void;
|
|
42
|
+
/** The `id` a `Tab` with this value renders, and what its `TabPanel`'s `aria-labelledby` reads. */
|
|
43
|
+
tabId: (value: string) => string;
|
|
44
|
+
/** The `id` a `TabPanel` with this value renders, and what its `Tab`'s `aria-controls` reads. */
|
|
45
|
+
panelId: (value: string) => string;
|
|
46
|
+
}
|
|
47
|
+
/** The key `Tabs` provides its `TabsContext` on. */
|
|
48
|
+
export declare const TABS_KEY: InjectionKey<TabsContext>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** The parts a consumer can restyle through `Tabs`' `classes`, named as the spec's anatomy names
|
|
2
|
+
* them. `tab`, `indicator` and `panel` are drawn by the `Tab`/`TabPanel` children — in items mode
|
|
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';
|
|
7
|
+
/** Underline (default): a bar under the selected tab, sitting on the list's hairline. Pills: a
|
|
8
|
+
* filled, fully-rounded button — the fill itself is the "indicator". */
|
|
9
|
+
export type TabsVariant = 'underline' | 'pills';
|
|
10
|
+
/** `auto`: arrow keys select immediately. `manual`: arrow keys move focus only, `Enter`/`Space`
|
|
11
|
+
* selects — use only when a panel loads slowly. */
|
|
12
|
+
export type TabsActivation = 'auto' | 'manual';
|
|
13
|
+
/** One tab and its panel, for the data-driven `items` API. Equivalent to a `<Tab>`/`<TabPanel>`
|
|
14
|
+
* pair in the slots API — `Tabs` renders exactly that pair internally for each item. */
|
|
15
|
+
export interface TabsItem {
|
|
16
|
+
/** The value selected, and the one `modelValue` holds when this tab is chosen. */
|
|
17
|
+
value: string;
|
|
18
|
+
/** The visible tab label. One to three words (spec "Tabs" → Properties, `items` row). */
|
|
19
|
+
title: string;
|
|
20
|
+
/** The panel's plain-text content. Use the slots API instead for richer panel content. */
|
|
21
|
+
content?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TabsProps {
|
|
24
|
+
/** The selected tab's value (two-way). Defaults to the first tab — the first `Tab` to register,
|
|
25
|
+
* in DOM order, or `items[0]` in the data-driven API (the same thing, since `items` renders as
|
|
26
|
+
* `Tab`s internally — see `context.ts`). */
|
|
27
|
+
modelValue?: string;
|
|
28
|
+
/** `underline` (default) or `pills`. */
|
|
29
|
+
variant?: TabsVariant;
|
|
30
|
+
/** The tab list's accessible name (spec "Tabs" → Properties, `label` row: "Product
|
|
31
|
+
* information"), put on `role="tablist"` as `aria-label`. Package convention: an
|
|
32
|
+
* accessible-name-only prop is named `ariaLabel`, never `label` (visible text is `title`). */
|
|
33
|
+
ariaLabel: string;
|
|
34
|
+
/** `auto` (default) or `manual`. */
|
|
35
|
+
activation?: TabsActivation;
|
|
36
|
+
/** The tabs and their panels, 1–5 of them (spec's own guidance). Renders internally as the same
|
|
37
|
+
* `Tab`/`TabPanel` pair a consumer would place through the slots API — omit this and use the
|
|
38
|
+
* `tabs` slot (for `Tab`s) and the default slot (for `TabPanel`s) instead for panel content
|
|
39
|
+
* richer than plain text. */
|
|
40
|
+
items?: TabsItem[];
|
|
41
|
+
/** Per-part class overrides, merged with `tailwind-merge`. */
|
|
42
|
+
classes?: Partial<Record<TabsPart, string>>;
|
|
43
|
+
}
|
|
44
|
+
/** The parts a consumer can restyle through a standalone `<Tab>`'s `classes`. */
|
|
45
|
+
export type TabPart = 'tab' | 'indicator';
|
|
46
|
+
export interface TabProps {
|
|
47
|
+
/** This tab's value — what `Tabs`' `modelValue` holds when it is selected, and what
|
|
48
|
+
* `aria-controls`/the matching `TabPanel`'s `value` are keyed by. */
|
|
49
|
+
value: string;
|
|
50
|
+
/** The visible label. Also the default slot's fallback, the same shape `Button`'s `label` and
|
|
51
|
+
* default slot follow. */
|
|
52
|
+
title?: string;
|
|
53
|
+
/** Per-part class overrides, merged with `tailwind-merge`. */
|
|
54
|
+
classes?: Partial<Record<TabPart, string>>;
|
|
55
|
+
}
|
|
56
|
+
/** The one part a consumer can restyle through a standalone `<TabPanel>`'s `classes`. */
|
|
57
|
+
export type TabPanelPart = 'panel';
|
|
58
|
+
export interface TabPanelProps {
|
|
59
|
+
/** The `Tab` this panel belongs to — must match that tab's own `value`. */
|
|
60
|
+
value: string;
|
|
61
|
+
/** Per-part class overrides, merged with `tailwind-merge`. */
|
|
62
|
+
classes?: Partial<Record<TabPanelPart, string>>;
|
|
63
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TextareaProps } from './types.js';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<TextareaProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
+
input: (value: string) => any;
|
|
4
|
+
"update:modelValue": (value: string) => any;
|
|
5
|
+
change: (value: string) => any;
|
|
6
|
+
}, string, import('vue').PublicProps, Readonly<TextareaProps> & Readonly<{
|
|
7
|
+
onInput?: ((value: string) => any) | undefined;
|
|
8
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
9
|
+
onChange?: ((value: string) => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
counter: boolean;
|
|
12
|
+
name: string;
|
|
13
|
+
classes: Partial<Record<import('./types.js').TextareaPart, string>>;
|
|
14
|
+
modelValue: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
placeholder: string;
|
|
17
|
+
id: string;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
invalid: boolean;
|
|
20
|
+
describedBy: string;
|
|
21
|
+
readonly: boolean;
|
|
22
|
+
maxLength: number;
|
|
23
|
+
hardLimit: boolean;
|
|
24
|
+
minHeight: string;
|
|
25
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether this runtime grows a `<textarea>` to its content on its own (spec "Textarea" →
|
|
3
|
+
* Variants, Auto-grow: "CSS `field-sizing: content` where supported").
|
|
4
|
+
*
|
|
5
|
+
* A named export of its own, rather than an inline check in `Textarea.vue`, so a test can stub it
|
|
6
|
+
* directly (`vi.spyOn`) to exercise the measured fallback — some DOM test environments expose
|
|
7
|
+
* `CSS` as an accessor that hands back a fresh object on every read, which makes monkey-patching
|
|
8
|
+
* `CSS.supports` itself unreliable.
|
|
9
|
+
*/
|
|
10
|
+
export declare function supportsFieldSizing(): boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
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';
|
|
3
|
+
export interface TextareaProps {
|
|
4
|
+
/** The text (two-way). */
|
|
5
|
+
modelValue?: string;
|
|
6
|
+
/** An example of a good answer. Format hints belong in the field's help text. */
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/** The character limit shown by the counter. With no `counter`, this alone shows nothing. */
|
|
9
|
+
maxLength?: number;
|
|
10
|
+
/** Shows "n / maxLength" in the foot row. */
|
|
11
|
+
counter?: boolean;
|
|
12
|
+
/** Also sets the native `maxlength`, so typing stops at the limit. */
|
|
13
|
+
hardLimit?: boolean;
|
|
14
|
+
/** Size to the expected answer, in rem. Defaults to `5rem` (about 3 lines). */
|
|
15
|
+
minHeight?: string;
|
|
16
|
+
/** Sets `aria-invalid="true"`. Comes from the `FieldWrapper` otherwise. */
|
|
17
|
+
invalid?: boolean;
|
|
18
|
+
/** Native `required`. Comes from the `FieldWrapper` otherwise. */
|
|
19
|
+
required?: boolean;
|
|
20
|
+
/** Native `readonly`. The value stays focusable and selectable. */
|
|
21
|
+
readonly?: boolean;
|
|
22
|
+
/** Native `disabled`. */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** The control's id. Comes from the `FieldWrapper` when there is one; this wins over it. */
|
|
25
|
+
id?: string;
|
|
26
|
+
/** The form field name. */
|
|
27
|
+
name?: string;
|
|
28
|
+
/** `aria-describedby` ids, error id first. Comes from the `FieldWrapper` otherwise. */
|
|
29
|
+
describedBy?: string;
|
|
30
|
+
/** Per-part class overrides, merged with `tailwind-merge`. */
|
|
31
|
+
classes?: Partial<Record<TextareaPart, string>>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ToastProps, ToastVariant } from './types.js';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<ToastProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
+
close: (reason: "button" | "escape") => any;
|
|
4
|
+
action: () => any;
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<ToastProps> & Readonly<{
|
|
6
|
+
onClose?: ((reason: "button" | "escape") => any) | undefined;
|
|
7
|
+
onAction?: (() => any) | undefined;
|
|
8
|
+
}>, {
|
|
9
|
+
text: string;
|
|
10
|
+
classes: Partial<Record<import('./types.js').ToastPart, string>>;
|
|
11
|
+
variant: ToastVariant;
|
|
12
|
+
messages: Partial<import('../../index.js').UiMessages>;
|
|
13
|
+
action: import('./types.js').ToastAction;
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ToasterProps } from './types.js';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<ToasterProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
+
action: (id: string) => any;
|
|
4
|
+
dismiss: (id: string, reason: "button" | "escape" | "timeout") => any;
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<ToasterProps> & Readonly<{
|
|
6
|
+
onAction?: ((id: string) => any) | undefined;
|
|
7
|
+
onDismiss?: ((id: string, reason: "button" | "escape" | "timeout") => any) | undefined;
|
|
8
|
+
}>, {
|
|
9
|
+
classes: Partial<Record<import('./types.js').ToasterPart, string>>;
|
|
10
|
+
messages: Partial<import('../../index.js').UiMessages>;
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|