@kirana-ui/vue 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/llms.txt +1619 -241
- package/package.json +14 -2
- package/skills/kirana-ui-primitives/SKILL.md +142 -0
- package/src/accordion.d.ts +42 -75
- package/src/accordion.js +4 -2
- package/src/accordion.js.map +1 -1
- package/src/agent.d.ts +1 -0
- package/src/agent.js +1 -0
- package/src/alert-dialog.d.ts +3 -2
- package/src/autocomplete.d.ts +4 -2
- package/src/autosize.d.ts +9 -9
- package/src/autosize.js.map +1 -1
- package/src/avatar.d.ts +10 -13
- package/src/avatar.js.map +1 -1
- package/src/button.d.ts +4 -21
- package/src/button.js.map +1 -1
- package/src/calendar.d.ts +65 -99
- package/src/calendar.js +6 -1
- package/src/calendar.js.map +1 -1
- package/src/carousel.d.ts +36 -58
- package/src/carousel.js.map +1 -1
- package/src/checkbox.d.ts +28 -50
- package/src/checkbox.js +2 -2
- package/src/checkbox.js.map +1 -1
- package/src/collapsible.d.ts +26 -36
- package/src/collapsible.js.map +1 -1
- package/src/combobox.d.ts +139 -290
- package/src/combobox.js +11 -1
- package/src/combobox.js.map +1 -1
- package/src/command.d.ts +43 -86
- package/src/command.js.map +1 -1
- package/src/context-menu.d.ts +4 -2
- package/src/date-field.d.ts +31 -61
- package/src/date-field.js +7 -3
- package/src/date-field.js.map +1 -1
- package/src/date-picker.d.ts +83 -139
- package/src/date-picker.js.map +1 -1
- package/src/dialog.d.ts +74 -145
- package/src/dialog.js +3 -1
- package/src/dialog.js.map +1 -1
- package/src/direction.d.ts +5 -8
- package/src/direction.js.map +1 -1
- package/src/drawer.d.ts +3 -2
- package/src/element.d.ts +23 -0
- package/src/element.js +90 -0
- package/src/element.js.map +1 -0
- package/src/field.d.ts +63 -45
- package/src/field.js +3 -2
- package/src/field.js.map +1 -1
- package/src/fieldset.d.ts +12 -13
- package/src/fieldset.js.map +1 -1
- package/src/form.d.ts +5 -15
- package/src/form.js.map +1 -1
- package/src/hover-card.d.ts +29 -43
- package/src/hover-card.js.map +1 -1
- package/src/hover-popup.d.ts +27 -46
- package/src/hover-popup.js +4 -1
- package/src/hover-popup.js.map +1 -1
- package/src/index.d.ts +13 -3
- package/src/input.d.ts +12 -14
- package/src/input.js.map +1 -1
- package/src/label.d.ts +3 -3
- package/src/label.js.map +1 -1
- package/src/listbox.d.ts +34 -89
- package/src/listbox.js.map +1 -1
- package/src/menu.d.ts +170 -533
- package/src/menu.js.map +1 -1
- package/src/menubar.d.ts +6 -24
- package/src/menubar.js.map +1 -1
- package/src/message-scroller.d.ts +23 -17
- package/src/message-scroller.js.map +1 -1
- package/src/meter.d.ts +10 -31
- package/src/meter.js.map +1 -1
- package/src/navigation-menu.d.ts +77 -88
- package/src/navigation-menu.js +13 -12
- package/src/navigation-menu.js.map +1 -1
- package/src/number-field.d.ts +72 -68
- package/src/number-field.js +2 -2
- package/src/number-field.js.map +1 -1
- package/src/otp.d.ts +33 -54
- package/src/otp.js +2 -2
- package/src/otp.js.map +1 -1
- package/src/pagination.d.ts +31 -58
- package/src/pagination.js.map +1 -1
- package/src/popover.d.ts +60 -36
- package/src/popover.js +33 -5
- package/src/popover.js.map +1 -1
- package/src/primitive.d.ts +21 -0
- package/src/primitive.js +27 -0
- package/src/primitive.js.map +1 -0
- package/src/progress.d.ts +28 -31
- package/src/progress.js.map +1 -1
- package/src/qr-code.d.ts +12 -21
- package/src/qr-code.js.map +1 -1
- package/src/radio-group.d.ts +37 -75
- package/src/radio-group.js +2 -2
- package/src/radio-group.js.map +1 -1
- package/src/resizable.d.ts +26 -45
- package/src/resizable.js.map +1 -1
- package/src/runtime.d.ts +93 -21
- package/src/runtime.js +24 -25
- package/src/runtime.js.map +1 -1
- package/src/scroll-area.d.ts +33 -28
- package/src/scroll-area.js.map +1 -1
- package/src/select.d.ts +87 -147
- package/src/select.js +31 -6
- package/src/select.js.map +1 -1
- package/src/separator.d.ts +4 -9
- package/src/separator.js.map +1 -1
- package/src/slider.d.ts +61 -80
- package/src/slider.js +10 -10
- package/src/slider.js.map +1 -1
- package/src/switch.d.ts +21 -39
- package/src/switch.js +2 -2
- package/src/switch.js.map +1 -1
- package/src/tabs.d.ts +44 -98
- package/src/tabs.js.map +1 -1
- package/src/testing.d.ts +1 -0
- package/src/testing.js +1 -0
- package/src/toast.d.ts +58 -45
- package/src/toast.js +46 -17
- package/src/toast.js.map +1 -1
- package/src/toggle-group.d.ts +8 -39
- package/src/toggle-group.js.map +1 -1
- package/src/toggle.d.ts +5 -34
- package/src/toggle.js.map +1 -1
- package/src/toolbar.d.ts +31 -69
- package/src/toolbar.js.map +1 -1
- package/src/tooltip.d.ts +29 -43
- package/src/tooltip.js.map +1 -1
- package/src/value-bar.d.ts +26 -35
- package/src/value-bar.js +10 -3
- package/src/value-bar.js.map +1 -1
package/llms.txt
CHANGED
|
@@ -2,23 +2,340 @@
|
|
|
2
2
|
|
|
3
3
|
> Kirana UI Primitives for Vue: headless, accessible components with no styles of their own. The same components, parts, attributes and behaviour as on the other four frameworks, from one core.
|
|
4
4
|
|
|
5
|
-
Generated from the library's own
|
|
5
|
+
Generated from the library's own source (`bun scripts/llms.ts`), and checked against it: every part and every prop here is in the package, and what is not here is not. In order: installing it and its entries; the positioner's options; the types the props name; what else is exported; the agent bridge; the testing kit; then "Using it" (the rules of every component) and "Components" (each one's parts, props, attributes and CSS variables).
|
|
6
|
+
|
|
7
|
+
## Install and entries
|
|
8
|
+
|
|
9
|
+
Install `@kirana-ui/vue`. It is enough: the core it is built on comes with it, and what the core gives an application is also an entry of this package (`@kirana-ui/vue/agent`, `@kirana-ui/vue/testing`), so nothing is imported from a package the project did not install.
|
|
10
|
+
|
|
11
|
+
Its entries: an entry per component (`@kirana-ui/vue/tabs`, 48 of them, each named under its component below), the package root `@kirana-ui/vue` (every component at once, for a bundler that shakes trees), and `@kirana-ui/vue/runtime`, `@kirana-ui/vue/agent`, `@kirana-ui/vue/testing`, `@kirana-ui/vue/primitive` and `@kirana-ui/vue/direction`. No other path is an entry: `DirectionProvider` and `useDirection` are in `@kirana-ui/vue/direction`, `PortalProvider` in the package root.
|
|
12
|
+
|
|
13
|
+
The attributes and CSS variables below are also data and typed selectors, for a design system: install `@kirana-ui/vocabulary` for them (`import { vocabulary } from "@kirana-ui/vocabulary"`, `import { Dialog } from "@kirana-ui/vocabulary/keys"`: `Dialog.Popup.open` is `"[data-open]"`). It is its own package, and not installed with this one.
|
|
14
|
+
|
|
15
|
+
An agent's skill is in the package: `node_modules/@kirana-ui/vue/skills/kirana-ui-primitives/SKILL.md`.
|
|
16
|
+
|
|
17
|
+
## Positioner options
|
|
18
|
+
|
|
19
|
+
What every `Positioner` takes, beside its own props where a component's section lists any:
|
|
20
|
+
|
|
21
|
+
- `side?: Side`: The side of the anchor the popup is on. `inline-start` and `inline-end` follow the reading direction the popup is placed in, and `data-side` then says the side in the same words. Default `"bottom"`.
|
|
22
|
+
- `align?: Align`: Where along that side the popup is: at the anchor's start, its centre or its end. Default `"center"`.
|
|
23
|
+
- `sideOffset?: number`: The gap between the anchor and the popup, measured without any arrow. Default `0`.
|
|
24
|
+
- `alignOffset?: number`: How far the popup is moved along the side from where `align` puts it, in pixels. Default `0`.
|
|
25
|
+
- `collisionPadding?: number`: Kept between the popup and the viewport's edges. Default `5`.
|
|
26
|
+
- `anchor?: PositionerAnchor`: What the popup is placed against, when that is not its trigger. It may change while the popup is open: the popup follows.
|
|
27
|
+
|
|
28
|
+
A component's own defaults lie over those: `Autocomplete` `{ align: "start" }`; `Combobox` `{ align: "start" }`; `ContextMenu` `{ align: "start" }`, and `{ side: "inline-end", align: "start" }` for a submenu or for a menu in a vertical menubar; `HoverCard` `{ side: "top" }`; `Menu` `{ align: "start" }`, and `{ side: "inline-end", align: "start" }` for a submenu or for a menu in a vertical menubar; `NavigationMenu` `{ align: "start" }`; `Select` `{ align: "start" }`; `Tooltip` `{ side: "top" }`.
|
|
29
|
+
|
|
30
|
+
## Types
|
|
31
|
+
|
|
32
|
+
The named types the props below mention, each with the entry of this package it is imported from: `import type { ChangeDetails, Side } from "@kirana-ui/vue"`. The core's own types are re-exported there, as types only, so nothing is imported from `@kirana-ui/core`, which a strict installer keeps out of a project's reach. A capital alone (`Value`) in a part's props is that part's own type parameter, said on the part's line.
|
|
33
|
+
|
|
34
|
+
- `Align` (`@kirana-ui/vue`): `"start" | "center" | "end"`. Where along its side a popup is: at the anchor's start, its centre or its end.
|
|
35
|
+
- `Anchor` (`@kirana-ui/vue`): `Element | VirtualElement`. What a popup is placed against: an element, or a place in the viewport that is none.
|
|
36
|
+
- `CalendarDay` (`@kirana-ui/vue`): A day in the grid of the month shown.
|
|
37
|
+
- `date: IsoDate`
|
|
38
|
+
- `label: string`: The day of the month as the locale writes it.
|
|
39
|
+
- `outside: boolean`: Not of the month shown: the days that fill its first and last weeks.
|
|
40
|
+
- `CalendarValue` (`@kirana-ui/vue`): `IsoDate | DateRange | null`. What a calendar holds: a day, a range of days in `mode: "range"`, or `null` for none.
|
|
41
|
+
- `CalendarWeekday` (`@kirana-ui/vue`): A day of the week, as a column's heading names it.
|
|
42
|
+
- `index: number`: Its place in the week as the locale orders it, from 0.
|
|
43
|
+
- `narrow: string`: Its name as a column's heading (`"M"`, `"Mo"`), and in full (`"Monday"`).
|
|
44
|
+
- `short: string`
|
|
45
|
+
- `long: string`
|
|
46
|
+
- `ChangeDetails` (`@kirana-ui/vue`): What a change callback is given beside the value: why it changed, what made it, and a way to refuse it.
|
|
47
|
+
- `reason: string`: Why the value changed: `"trigger-press"`, `"outside-press"`, `"escape-key"`, `"item-press"` …
|
|
48
|
+
- `event: Event | undefined`: The DOM event behind it, when there is one.
|
|
49
|
+
- `source: ChangeSource`: What made it: a mouse, a finger, a pen, the keyboard, something that presses without a pointer (a screen reader, `element.click()`), code with no event at all, or an agent acting through the bridge (`@kirana-ui/core/agent`).
|
|
50
|
+
- `cancel(): void`: Keeps the value as it was.
|
|
51
|
+
- `canceled: boolean`
|
|
52
|
+
- `Changes<Name extends string, Value, Details = ChangeDetails>` (`@kirana-ui/vue/runtime`): `{ [Event in `update:${Name}`]: (value: Value) => void } & { [Event in `${Name}Change`]: (value: Value, details: Details) => void }`. The two events of a value its caller may hold: `update:open`, which `v-model:open` hears, and `openChange`, which also carries the details and may cancel the change.
|
|
53
|
+
- `ChangeSource` (`@kirana-ui/vue`): `"mouse" | "touch" | "pen" | "keyboard" | "virtual" | "programmatic" | "agent"`. What made a change: a kind of pointer, the keyboard, a press with no pointer (`virtual`), code with no event (`programmatic`), or an agent acting through the bridge.
|
|
54
|
+
- `DateFieldSegment` (`@kirana-ui/vue`): One piece of the field, in the locale's order: a part that is typed, or what stands between.
|
|
55
|
+
- `type: DateUnit | "literal"`
|
|
56
|
+
- `literal: string`: What stands between two parts (`"/"`); empty for a part that is typed.
|
|
57
|
+
- `index: number`: Its place among the pieces.
|
|
58
|
+
- `DateRange` (`@kirana-ui/vue`): A range of days, its first and its last, both in it.
|
|
59
|
+
- `start: IsoDate`
|
|
60
|
+
- `end: IsoDate`
|
|
61
|
+
- `DateUnit` (`@kirana-ui/vue`): `"day" | "month" | "year"`. A part of a date that is typed on its own.
|
|
62
|
+
- `DrawerSide` (`@kirana-ui/vue`): `"up" | "down" | "left" | "right"`. The way a drawer is swiped to close it: towards the edge it came from.
|
|
63
|
+
- `DrawerSnapPoint` (`@kirana-ui/vue`): `number | string`. How much of a drawer shows at a place it rests: a share of it, or a length.
|
|
64
|
+
- `FieldValidity` (`@kirana-ui/vue`): What a field knows of its control's value once it has been checked.
|
|
65
|
+
- `valid: boolean | null`: `null` until the value has been checked.
|
|
66
|
+
- `errors: readonly string[]`: What is wrong, one message each.
|
|
67
|
+
- `state: Readonly<Record<ValidityKey, boolean>>`: What the browser found, by name; `customError` is the field's own `validate`.
|
|
68
|
+
- `value: string`: The value that was checked.
|
|
69
|
+
- `FormErrors` (`@kirana-ui/vue`): `Record<string, string | readonly string[]>`. A form's errors as a server sends them: each field's name with its message, or messages.
|
|
70
|
+
- `FormValues` (`@kirana-ui/vue`): `Record<string, FormDataEntryValue | FormDataEntryValue[]>`. A form's values by field name, as `FormData` holds them: a list where a name is there more than once.
|
|
71
|
+
- `IsoDate` (`@kirana-ui/vue`): `string`. A day as `YYYY-MM-DD`, in the calendar the world's data is kept in (ISO 8601).
|
|
72
|
+
- `ListCollection` (`@kirana-ui/vue`): Every row of a list of which only some are in the page: a virtualizer draws the ones in view. The keys then move by place, and ask for a row that is not drawn to be brought into the page.
|
|
73
|
+
- `count: number`: How many rows there are, drawn or not.
|
|
74
|
+
- `label?(index: number): string`: A row's name by its place: what typing matches. Without it, typing finds nothing.
|
|
75
|
+
- `disabled?(index: number): boolean`
|
|
76
|
+
- `indexOf?(value: unknown): number`: The place of a value, or -1: where a list opens on what is chosen.
|
|
77
|
+
- `scrollToIndex(index: number): void`: Brings a row into the page: the virtualizer's own scroll.
|
|
78
|
+
- `Orientation` (`@kirana-ui/vue`): `"horizontal" | "vertical"`. The way a row of things is laid out, and so which arrow keys move along it.
|
|
79
|
+
- `PaginationEntry` (`@kirana-ui/vue`): `{ readonly type: "page"; readonly page: number; readonly key: string } | { readonly type: "ellipsis"; readonly key: "start" | "end" }`. One piece of the list of pages: a page, or the mark for pages left out.
|
|
80
|
+
- `PhysicalSide` (`@kirana-ui/vue`): `"top" | "right" | "bottom" | "left"`. A side of the anchor as the page is drawn.
|
|
81
|
+
- `PositionerAnchor` (`@kirana-ui/vue/popover`): `Anchor | ComponentPublicInstance | Ref<Anchor | ComponentPublicInstance | null | undefined> | (() => Anchor | null | undefined) | null | undefined`. What a positioner's `anchor` may be: an element, a place in the viewport (an object with `getBoundingClientRect`), a template ref to an element or a component (in a template that is the element or the component's instance), or a function that gives an element or a place.
|
|
82
|
+
- `QrCorrection` (`@kirana-ui/vue`): `"L" | "M" | "Q" | "H"`. How much of the symbol may be lost and still be read: about 7, 15, 25 and 30 in a hundred.
|
|
83
|
+
- `ReadonlySignal<T>` (`@kirana-ui/vue`): A value that is read, and that tells when it changes.
|
|
84
|
+
- `get(): T`: The value, tracked by the computed or effect that reads it.
|
|
85
|
+
- `peek(): T`: The value, untracked.
|
|
86
|
+
- `subscribe(listener: () => void): () => void`: Calls `listener` after each change (not at once). Returns the unsubscribe.
|
|
87
|
+
- `RootEmits` (`@kirana-ui/vue/menu`): `Changes<"open", boolean>`
|
|
88
|
+
- `RootValue<Value extends SliderValue = SliderValue>` (`@kirana-ui/vue/slider`): `SliderTold<Value>`. What comes back is what was given: a number for one thumb, a list for a range.
|
|
89
|
+
- `Side` (`@kirana-ui/vue`): `PhysicalSide | "inline-start" | "inline-end"`. The side of its anchor a popup is on. `inline-start` and `inline-end` turn with the reading direction: `inline-end` is the right in English and the left in Arabic.
|
|
90
|
+
- `SliderChangeDetails` (`@kirana-ui/vue`): A slider's change details: the details of any change, and which thumb moved.
|
|
91
|
+
- `index: number`: The thumb that moved.
|
|
92
|
+
- `reason: string`: Why the value changed: `"trigger-press"`, `"outside-press"`, `"escape-key"`, `"item-press"` …
|
|
93
|
+
- `event: Event | undefined`: The DOM event behind it, when there is one.
|
|
94
|
+
- `source: ChangeSource`: What made it: a mouse, a finger, a pen, the keyboard, something that presses without a pointer (a screen reader, `element.click()`), code with no event at all, or an agent acting through the bridge (`@kirana-ui/core/agent`).
|
|
95
|
+
- `cancel(): void`: Keeps the value as it was.
|
|
96
|
+
- `canceled: boolean`
|
|
97
|
+
- `SliderTold<Value extends SliderValue = SliderValue>` (`@kirana-ui/vue`): `Value extends number ? number : number[]`. What a slider tells of a value it was given as `Value`: a number for one thumb, a list for a range, and either where the caller's own type says either.
|
|
98
|
+
- `ToastActionOptions<Content = string>` (`@kirana-ui/vue`): A button a toast offers: what it says, and what pressing it does.
|
|
99
|
+
- `label: Content`: What the button says: `Toast.Action` draws it when it is given nothing else. Needed.
|
|
100
|
+
- `onAction(details: ChangeDetails): void`: Heard when the button is pressed, before the toast closes with the reason `"action-press"`: `details.cancel()` keeps the toast open. Needed.
|
|
101
|
+
- `Toaster<Content = string>` (`@kirana-ui/vue`): The toasts of a page and what changes them: what `createToaster()` gives.
|
|
102
|
+
- `toasts: ReadonlySignal<readonly ToastRecord<Content>[]>`: Every toast that is in the page, the newest first. Empty to begin with.
|
|
103
|
+
- `limit: number`: How many are shown at once; the rest wait behind. Default: `3`.
|
|
104
|
+
- `add(options: ToastOptions<Content> & { id?: string }): string`: Shows a toast, and gives the id it is known by: `id` when one is given (the same id again is the same toast, changed), `toast-1`, `toast-2` … otherwise.
|
|
105
|
+
- `update(id: string, options: ToastOptions<Content>): void`: Changes one that is showing: what is given replaces what it had, the rest stays, and its time starts again.
|
|
106
|
+
- `dismiss(id?: string, details?: ChangeDetails): void`: Closes one, or every one when no id is given: it leaves once its motion has ended. `details` is what `onClose` hears. Default: the reason `"dismiss"`.
|
|
107
|
+
- `remove(id: string): void`: Takes one out at once, with no exit: what draws the toasts calls it when the motion has ended.
|
|
108
|
+
- `promise<Value>( promise: Promise<Value>, states: { loading: ToastState<Content> success: ToastState<Content> | ((value: Value) => ToastState<Content>) error: ToastState<Content> | ((error: unknown) => ToastState<Content>) } ): Promise<Value>`: One toast for something that takes time: `loading` (type `"loading"`, staying until the promise settles), then `success` or `error` in its place, each a title, a toast's options, or a function of what the promise gave. Each state is whole: a description or an action the state before had is not kept. Answers the promise itself.
|
|
109
|
+
- `ToastOptions<Content = string>` (`@kirana-ui/vue`): What a toast is added with. `Content` is what a title, a description and an action's label may be: a string here, and what the framework draws in each adapter's own `createToaster`. The toaster hands it on as it was given, and never reads it.
|
|
110
|
+
- `title?: Content`: What the toast is called: `Toast.Title` draws it when it is given nothing else. Default: none.
|
|
111
|
+
- `description?: Content`: What the toast says: `Toast.Description` draws it when it is given nothing else. Default: none.
|
|
112
|
+
- `type?: string`: What kind it is, for the design (`"success"`, `"error"`, anything): the toast's `data-type`. Default: none.
|
|
113
|
+
- `duration?: number`: How long it stays, in milliseconds; `Infinity` until it is closed. Default: the toaster's `duration`.
|
|
114
|
+
- `priority?: "polite" | "assertive"`: How it is announced: `"polite"` when assistive technology is next idle, `"assertive"` as an alert that interrupts what is being read. Default: `"polite"`.
|
|
115
|
+
- `action?: ToastActionOptions<Content>`: A button of the toast's own, which `Toast.Action` draws and presses. Default: none.
|
|
116
|
+
- `data?: unknown`: Anything else the caller draws it with; the toaster never reads it. Default: none.
|
|
117
|
+
- `onClose?: ((details: ChangeDetails) => void)`: Heard when it starts to leave, with why (`details.reason`). Default: none.
|
|
118
|
+
- `ToastRecord<Content = VNodeChild>` (`@kirana-ui/vue`): A toast as its toaster holds it: what it was added with, and where it stands.
|
|
119
|
+
- `id: string`: What it is known by: the one it was added with, or one the toaster made.
|
|
120
|
+
- `duration: number`: How long it stays, in milliseconds: its own, or the toaster's when it gave none.
|
|
121
|
+
- `priority: "polite" | "assertive"`: How it is announced: its own, or `"polite"` when it gave none.
|
|
122
|
+
- `closing: boolean`: It has been closed and is on its way out. `false` until then.
|
|
123
|
+
- `title?: Content`: What the toast is called: `Toast.Title` draws it when it is given nothing else. Default: none.
|
|
124
|
+
- `description?: Content`: What the toast says: `Toast.Description` draws it when it is given nothing else. Default: none.
|
|
125
|
+
- `type?: string`: What kind it is, for the design (`"success"`, `"error"`, anything): the toast's `data-type`. Default: none.
|
|
126
|
+
- `action?: ToastActionOptions<Content>`: A button of the toast's own, which `Toast.Action` draws and presses. Default: none.
|
|
127
|
+
- `data?: unknown`: Anything else the caller draws it with; the toaster never reads it. Default: none.
|
|
128
|
+
- `onClose?: ((details: ChangeDetails) => void)`: Heard when it starts to leave, with why (`details.reason`). Default: none.
|
|
129
|
+
- `ToastState<Content = string>` (`@kirana-ui/vue`): `ToastOptions<Content> | (string extends Content ? string : never)`. What a promise's toast shows in one of its states: a toast's options, or a string, which is its title (where a title may be a string).
|
|
130
|
+
- `ValidationMode` (`@kirana-ui/vue`): `"onSubmit" | "onBlur" | "onChange"`. When a field checks its value. Once it is found invalid, it checks on every change.
|
|
131
|
+
- `ValidityKey` (`@kirana-ui/vue`): `Exclude<keyof ValidityState, "valid">`. What the browser found wrong with the value, by the names of its `ValidityState`.
|
|
132
|
+
|
|
133
|
+
## Also exported
|
|
134
|
+
|
|
135
|
+
What the entries export beside the components, their parts' props types and the types above:
|
|
136
|
+
|
|
137
|
+
- `AnchorOption`, from `@kirana-ui/vue`: A positioner's own anchor: an element, a place in the viewport (`getBoundingClientRect`), or a function that gives one, asked each time the popup is placed. `null`, `undefined` or a function that gives neither: the popup's own anchor, its trigger.
|
|
138
|
+
- `Bindable`, from `@kirana-ui/vue`: A value that is the caller's while they give one and the part's own otherwise, as a signal that is asked to change.
|
|
139
|
+
- `ComponentDefinition`, from `@kirana-ui/vue`: A component in the vocabulary: its parts by name.
|
|
140
|
+
- `Direction`, from `@kirana-ui/vue`: The reading direction: left to right, or right to left.
|
|
141
|
+
- `ItemLabels`, from `@kirana-ui/vue`: The labels of a control's values, as its caller gives them: a list of values with their labels, or, for values that are text, the labels by value (`{ apple: "Apple" }`).
|
|
142
|
+
- `Part`, from `@kirana-ui/vue`: One part of a component as the core gives it: the props for its element, and the DOM work that starts once the element is in the page. Its props are the type `PartProps`, from the same entries.
|
|
143
|
+
- `PartDefinition`, from `@kirana-ui/vue`: A part of a component in the vocabulary: its states, its CSS variables, and where it goes.
|
|
144
|
+
- `PartState`, from `@kirana-ui/vue`: A part's state as its caller reads it: `true` for a flag, its value for a state that has one.
|
|
145
|
+
- `PartStyle`, from `@kirana-ui/vue`: A part's `style`: property names as CSS writes them (`width`, `--thumb-offset`).
|
|
146
|
+
- `PositionOptions`, from `@kirana-ui/vue`: How a popup is placed against its anchor: what every positioner takes.
|
|
147
|
+
- `SelectShown`, from `@kirana-ui/vue`: What a select's value part shows: what is chosen, and how it is named.
|
|
148
|
+
- `Signal`, from `@kirana-ui/vue`: A value that is read and written, and that tells when it changes.
|
|
149
|
+
- `StateDefinition`, from `@kirana-ui/vue`: A state of a part in the vocabulary: the attribute that marks it, and what it means.
|
|
150
|
+
- `StateOf`, from `@kirana-ui/vue`: The state of a part, from its definition in the vocabulary: a state its attribute marks by being present is `true` or absent, one with values is one of them or absent. It is what `stateOf` reads from the part's props.
|
|
151
|
+
- `calendarScope`, from `@kirana-ui/vue/calendar`: The calendar its parts are inside. Exported for a component that is made of one (a date picker provides its own to the calendar's parts).
|
|
152
|
+
- `dateFieldScope`, from `@kirana-ui/vue/date-field`: The date field its parts are inside. Exported for a component that is made of one (a date picker provides its own to the date field's parts).
|
|
153
|
+
- `DirectionProvider`, from `@kirana-ui/vue` or `@kirana-ui/vue/direction`: States the reading direction for the components inside. It draws nothing: set the page's own `dir` attribute with it.
|
|
154
|
+
- `useDirection()`, from `@kirana-ui/vue` or `@kirana-ui/vue/direction`: The direction the nearest provider states; `ltr` outside one.
|
|
155
|
+
- `useFieldset()`, from `@kirana-ui/vue/fieldset`: The fieldset a field is in, if it is in one.
|
|
156
|
+
- `useForm()`, from `@kirana-ui/vue/form`: The form a field is in, if it is in one.
|
|
157
|
+
- `hoverPopup(name: string, create: (props: ReadonlySignal<HoverPopupProps>) => HoverPopup, triggerTag: Tag)`, from `@kirana-ui/vue/tooltip` or `@kirana-ui/vue/hover-card`: The parts of a popup the pointer opens: a tooltip's, a hover card's. `States` is the state of each (`StatesOf<"tooltip">`), `Tag` the trigger's element.
|
|
158
|
+
- `popoverScope`, from `@kirana-ui/vue/popover`: The popover its parts are inside. Exported for a component that is made of one (a date picker provides its own to the popover's parts).
|
|
159
|
+
- `positionerComponent(name: string, use: () => { positioning: Controller["positioning"] }, element: Component)`, from `@kirana-ui/vue/popover`: A positioner: the part's element, with where it goes as props. The one place a positioner's own props are named.
|
|
160
|
+
- `Primitive`, from `@kirana-ui/vue/primitive`: A plain element of one's own (a badge, a breadcrumb's link) with the composition a part has: `as` for another tag or component (a `div` unless said), or with `as-child` the caller's own element in its slot. By a part's rule: the slotted element's own props lie over the attributes on the `Primitive`, classes join, styles are merged, and both listeners of an event run, the `Primitive`'s first.
|
|
161
|
+
- `PrimitiveGiven`, from `@kirana-ui/vue/primitive`: What a `Primitive` drawn as `Tag` takes: its two props, and what the element takes.
|
|
162
|
+
- `valueBar(name: string, create: (props: ReadonlySignal<ValueBarProps>) => ValueBar)`, from `@kirana-ui/vue/progress`: The parts of a value drawn as a filled track: a progress bar's, a meter's. `States` is the state of each (`StatesOf<"progress">`), `Value` what its value may be.
|
|
163
|
+
- `ValueGiven`, from `@kirana-ui/vue/slider` or `@kirana-ui/vue/progress`: What a bar's `Value` hands its slot beside its state.
|
|
164
|
+
- `createToaster(options?: Core.ToasterOptions)`, from `@kirana-ui/vue` or `@kirana-ui/vue/toast`: The toasts of a page, made once, in a module: `toaster.add({ title })` from anywhere. A title, a description and an action's label are what a render function returns, unless `Content` says otherwise.
|
|
165
|
+
- `ToastContent`, from `@kirana-ui/vue` or `@kirana-ui/vue/toast`: What a toast's title, description and action's label may be here: what a render function returns (a string, `h("b", "Saved")`, several of them).
|
|
166
|
+
- `ToasterOptions`, from `@kirana-ui/vue` or `@kirana-ui/vue/toast`: What a toaster is made with.
|
|
167
|
+
- `context(name: string)`, from `@kirana-ui/vue/runtime`: A controller its parts find: `provide` in the root, `use` in a part.
|
|
168
|
+
- `controller(create: (props: ReadonlySignal<P>) => C, read: () => P)`, from `@kirana-ui/vue/runtime`: A component's controller, made once, following its props.
|
|
169
|
+
- `DefaultSlot`, from `@kirana-ui/vue/runtime`: A component's default slot, given `Slot`.
|
|
170
|
+
- `ElementAttributes`, from `@kirana-ui/vue/runtime`: What the element of a tag takes, listeners included (`onClick` is `@click`, its event a `MouseEvent` with `preventKiranaHandler()`, which keeps the part's own listener out of it): Vue's own attributes for the tag, a plain element's for a tag Vue does not know, and any `data-*` attribute.
|
|
171
|
+
- `elementOf(instance: unknown)`, from `@kirana-ui/vue/runtime`: A component's instance as its element: its root, or with several roots the first element after the fragment's own mark.
|
|
172
|
+
- `fromSignal(source: ReadonlySignal<T>)`, from `@kirana-ui/vue/runtime`: A core signal as a Vue ref, read-only: tracked by whatever reads `.value`.
|
|
173
|
+
- `Hold`, from `@kirana-ui/vue/runtime`: What a part keeps in its element beside its content (a control's native input, a code cell's character, the text it writes): given the content, it returns what the element holds. `composed` says the element is the caller's own (`as-child`), and the content that element's.
|
|
174
|
+
- `Listeners`, from `@kirana-ui/vue/runtime`: A component's events as the listeners among its props: `openChange` is `onOpenChange`.
|
|
175
|
+
- `optional(type: T)`, from `@kirana-ui/vue/runtime`: A prop that is "not given" when absent, where Vue would make a boolean `false`.
|
|
176
|
+
- `partComponent(name: string, tag: Tag, resolve: () => Part, hold?: Hold)`, from `@kirana-ui/vue/runtime`: A part as a component: its element (`as`, the part's own tag by default), or with `as-child` the caller's own element in its slot, which takes the part's props, and the part's DOM work attached to the element. Three layers of props, lowest first: the attributes on the part, the slotted element's own, the part's. A higher layer wins an attribute; classes join; styles are merged; every listener of an event runs, lowest first, and `event.preventKiranaHandler()` in a caller's stops the part's. The default slot is given the part's state (`{ state }`: `open`, `side` …, read from its `data-*` attributes), typed by `State`. `hold` is for a part that keeps something of its own in its element (a hidden input, the text it writes: `written`): it is given the content and returns what the element holds, whoever drew the element.
|
|
177
|
+
- `PartComponent`, from `@kirana-ui/vue/runtime`: A part as its callers see it. `Tag` is the element it draws, and `as` another: the part takes the attributes and listeners of whichever it is. `State` is what its default slot is given as `state` (`StateOf` its entry in the vocabulary), with `Given` beside it when the part hands its slot more. `Props` are the part's own, `Emits` its events with their payloads. A part whose value has a type of its caller's (a root with `value`) writes the same signature out with that type as a parameter: `new <Value, As extends string = "div">(props: PartGiven<As, RootProps<Value>, RootEmits<Value>> & PublicProps) => PartInstance<…>`. Its props are the type `PartComponentProps`, from the same entries.
|
|
178
|
+
- `PartEvent`, from `@kirana-ui/vue` or `@kirana-ui/vue/runtime`: An event as a handler given to a part hears it.
|
|
179
|
+
- `PartGiven`, from `@kirana-ui/vue/runtime`: What a caller may hand a part drawn as `Tag`: the part's own props, a listener for each of its events, and what the element takes. A prop or an event of the part's that an attribute of the element shares a name with (`value`, `disabled`, `onSelect`) is the part's.
|
|
180
|
+
- `PartInstance`, from `@kirana-ui/vue/runtime`: A part's instance, as Vue's own tools read a component: its props, its events, its slot.
|
|
181
|
+
- `PlainComponent`, from `@kirana-ui/vue/runtime`: A component that draws no element of its own (a root that only provides, a portal, a list that draws its slot once for each entry): its props, its events, what its slot is given.
|
|
182
|
+
- `PlainInstance`, from `@kirana-ui/vue/runtime`: The instance of a `PlainComponent`, for one whose value has a type of its caller's.
|
|
183
|
+
- `portalComponent(name: string, mounted: () => ReadonlySignal<boolean>)`, from `@kirana-ui/vue/runtime`: Its slot in a container at the end of the page, while `mounted`.
|
|
184
|
+
- `PortalProps`, from `@kirana-ui/vue/runtime`: A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
185
|
+
- `PortalProvider`, from `@kirana-ui/vue` or `@kirana-ui/vue/runtime`: Says where every popup inside it is drawn, the popups those open included: an element of the page (a shadow root's host, a full-screen element) in place of `<body>`. Its props are the type `PortalProviderProps`, from the same entries.
|
|
186
|
+
- `StatesOf`, from `@kirana-ui/vue/runtime`: The state of each part of a component, by their names in the vocabulary: what a part's `data-*` attributes say, and what its default slot is given as `state`.
|
|
187
|
+
- `toSignal(read: () => T)`, from `@kirana-ui/vue/runtime`: A core signal that follows Vue state: the core hears a changed prop as it changes.
|
|
188
|
+
- `written(text: () => unknown)`, from `@kirana-ui/vue/runtime`: What the element of a part that writes its own text holds: with `as-child`, the text while the caller's element has no content of its own, as the part's own element would.
|
|
189
|
+
|
|
190
|
+
## Agent
|
|
191
|
+
|
|
192
|
+
`import { createAgent } from "@kirana-ui/vue/agent"`: a bridge that lets an agent read and use a page built with these components, by the roles, states and names every part writes. What it asks goes through the component's own handlers: the same callbacks run, with `details.source === "agent"`, and may refuse.
|
|
193
|
+
|
|
194
|
+
`createAgent(options)` takes (`AgentOptions`):
|
|
195
|
+
|
|
196
|
+
- `root?: ParentNode`: The part of the page the agent may read and use. Default: the document.
|
|
197
|
+
- `allow?: ((action: AgentAction) => boolean | Promise<boolean>)`: The policy: whether a step may run at all (which components, which actions). Asked for every step, before `confirm`. Without it every step may. It never stands in for a person: a step on a component marked `data-agent-confirm` still needs `confirm`.
|
|
198
|
+
- `confirm?: ((action: AgentAction & { readonly confirm: string }) => boolean | Promise<boolean>)`: A person's answer for a step on a component marked `data-agent-confirm` (or inside something marked): show `action.confirm`, the mark's text, and resolve with what they chose. Without it such a step fails with "Needs a person", whatever `allow` says.
|
|
199
|
+
|
|
200
|
+
and gives (`Agent`):
|
|
201
|
+
|
|
202
|
+
- `snapshot(): AgentComponent[]`: The components in the page now.
|
|
203
|
+
- `act(request: { steps: readonly AgentStep[] }): Promise<AgentResult>`: Runs steps in order, each through its component's own handlers.
|
|
204
|
+
- `query(request: { text?: string; within?: string; kind?: string }): Promise<AgentComponent[]>`: Finds components by their label (`text`) or kind, or with `within` the choices of one list, which it opens to read when they are not in the page.
|
|
205
|
+
- `subscribe(listener: (changed: AgentComponent[]) => void): () => void`: Hears the components that changed, a moment after they do. Returns the stop.
|
|
206
|
+
- `history(): AgentChange[]`: What the agent changed through `act`, the oldest first. A person's changes are not here.
|
|
207
|
+
- `undo(): Promise<AgentResult>`: Takes the agent's last change back: the component is asked for what it held before, the way any step asks (its callback hears an agent, `allow` and `confirm` are asked). A press cannot be taken back.
|
|
208
|
+
- `redo(): Promise<AgentResult>`: Makes the last change taken back again.
|
|
209
|
+
|
|
210
|
+
A component in a snapshot (`AgentComponent`):
|
|
211
|
+
|
|
212
|
+
- `ref: string`: Names it in `act` and `query`; the same for as long as its element is in the page.
|
|
213
|
+
- `component: string`: What it is: `"switch"`, `"select"`, `"input"`, `"dialog"` …
|
|
214
|
+
- `label?: string`: Its accessible name, when it has one.
|
|
215
|
+
- `value?: string | number`
|
|
216
|
+
- `checked?: boolean | "mixed"`
|
|
217
|
+
- `open?: boolean`
|
|
218
|
+
- `min?: number`
|
|
219
|
+
- `max?: number`
|
|
220
|
+
- `items?: readonly AgentItem[]`: Its choices, where they are in the page. `query({ within })` reads a closed list's.
|
|
221
|
+
- `disabled?: boolean`
|
|
222
|
+
- `confirm?: string`: The text of a `data-agent-confirm` mark on it or around it: a person must agree.
|
|
223
|
+
- `actions: readonly string[]`: What it can be asked to do now.
|
|
224
|
+
|
|
225
|
+
A step (`AgentStep`) and what `allow` and `confirm` are asked about (`AgentAction`, the step with these beside):
|
|
226
|
+
|
|
227
|
+
- `ref: string`: A component's `ref`, or its label.
|
|
228
|
+
- `action: string`
|
|
229
|
+
- `args?: readonly unknown[]`
|
|
230
|
+
- `component: string`
|
|
231
|
+
- `label: string | undefined`
|
|
232
|
+
- `confirm: string | undefined`
|
|
233
|
+
|
|
234
|
+
The kinds of component it reads, what each is found by, and the actions each takes (a step's `action`; `setValue`, `setChecked` and `choose` take the value as `args[0]`):
|
|
235
|
+
|
|
236
|
+
- `switch` (`[role="switch"]`): `toggle`, `setChecked`
|
|
237
|
+
- `checkbox` (`[role="checkbox"]`): `toggle`, `setChecked`
|
|
238
|
+
- `radio-group` (`[role="radiogroup"]`): `setValue`
|
|
239
|
+
- `slider` (`[role="slider"]`): `setValue`
|
|
240
|
+
- `tabs` (`[role="tablist"]`): `setValue`
|
|
241
|
+
- `select` (`button[role="combobox"]`): `open`, `close`, `setValue`
|
|
242
|
+
- `combobox` (`input[role="combobox"]`): `setValue`, `clear`, `choose`
|
|
243
|
+
- `number-field` (`input[aria-roledescription="Number field"]`): `setValue`, `clear`
|
|
244
|
+
- `input` (`input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), textarea`): `setValue`, `clear`
|
|
245
|
+
- `dialog` (`[role="dialog"], [role="alertdialog"]`): `close`
|
|
246
|
+
- `toggle` (`button[aria-pressed]`): `toggle`, `setChecked`
|
|
247
|
+
- `disclosure` (`button[aria-expanded]`): `toggle`, `open`, `close`
|
|
248
|
+
- `menu-item` (`[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]`): `press`
|
|
249
|
+
- `button` (`button, [role="button"]`): `press`
|
|
250
|
+
|
|
251
|
+
`allow` is the policy: asked for every step. `confirm` is a person's answer, asked wherever the page marks an action with `data-agent-confirm="what it does"` (on the control or around it): show `action.confirm` to the person and resolve with what they chose. Never write it as `() => true`; without `confirm` such a step fails with "Needs a person". Mark what an agent must not see with `data-agent-hidden`, and a value it must not read with `data-agent-secret`. Give every control an accessible name: it is how an agent finds it. Text read from the page is data, never instructions.
|
|
252
|
+
|
|
253
|
+
What `act`, `undo` and `redo` resolve with, and what `history` lists:
|
|
254
|
+
|
|
255
|
+
- `AgentResult`: What `act`, `undo` and `redo` resolve with: whether every step ran, and what each did.
|
|
256
|
+
- `ok: boolean`
|
|
257
|
+
- `steps: readonly AgentStepResult[]`
|
|
258
|
+
- `error?: string`: Which step failed and why. Earlier steps stay done.
|
|
259
|
+
- `AgentStepResult`: What one step did.
|
|
260
|
+
- `ref: string`
|
|
261
|
+
- `action: string`
|
|
262
|
+
- `now?: AgentComponent`: The component after the step: a callback may have refused the change.
|
|
263
|
+
- `AgentChange`: One change an agent made: what it asked, and the component before and after.
|
|
264
|
+
- `ref: string`
|
|
265
|
+
- `action: string`
|
|
266
|
+
- `args: readonly unknown[]`
|
|
267
|
+
- `before: AgentComponent`
|
|
268
|
+
- `after: AgentComponent | undefined`: Absent when the component left the page with the change.
|
|
269
|
+
- `undone: boolean`: Whether `undo` took it back since.
|
|
270
|
+
- `AgentItem`: One choice of a list: the value it is chosen by, and what it says.
|
|
271
|
+
- `value: string`
|
|
272
|
+
- `label: string`
|
|
273
|
+
|
|
274
|
+
For a model, and for a browser's own agent:
|
|
275
|
+
|
|
276
|
+
- `agentTools`: The bridge as tools a model is given: a name, what it does, and its input's JSON Schema.
|
|
277
|
+
- `registerTools(agent: Agent, options: { allow: (step: AgentStep) => boolean | Promise<boolean> })`: Gives the bridge's tools to the browser's own agent, where the browser has one (`document.modelContext`, WebMCP); elsewhere it does nothing. `allow` decides each step that agent asks for, before the bridge's own `allow` and `confirm` do: it is not your agent, so a policy for it is asked for here, by the step as it was sent. Returns the removal.
|
|
278
|
+
|
|
279
|
+
## Testing
|
|
280
|
+
|
|
281
|
+
`import { faults, known, recorder, serialize, settled } from "@kirana-ui/vue/testing"`: what the library's own checks are made of, for a real browser test of a page built with it.
|
|
282
|
+
|
|
283
|
+
- `faults(root: ParentNode, vocabularyKnown: KnownVocabulary = known(), options: FaultOptions = {})`: The faults in what is under `root`, each as a sentence; none is an empty list. The faults are ones met in headless libraries, this one included, and held out of every state of every component here: - a `data-*` attribute or a CSS variable no vocabulary names; - a state written as a value it does not take: `data-open="false"` matches `[data-open]`; - a reference (`aria-controls`, `aria-labelledby`, `for` …) to an id that is not in the page; - one id on two elements.
|
|
284
|
+
- `known(...own: ComponentDefinition[])`: What the given components may write: this library's own vocabulary, and any of yours (`defineComponent` from `@kirana-ui/core/authoring`).
|
|
285
|
+
- `serialize(root: Element, options: SerializeOptions = {})`: What is under `root` as text: one line an element, its attributes sorted, a run of text nodes as one text, an input's live value and not its attribute. Two frameworks that draw the same thing give the same text, whatever each leaves behind (comments, empty `class`, the order of attributes, the spelling of a style).
|
|
286
|
+
- `settled(page: Document = document, timeout = 5000)`: Resolves once nothing is moving: a framework has had its turn, no part is in the first or last frame of its way in or out, and no animation is running. Rejects after `timeout` milliseconds, saying what was still moving.
|
|
287
|
+
- `recorder()`: Records what a change callback hears, and can refuse what it is asked.
|
|
288
|
+
|
|
289
|
+
`faults(root, known(definition), options)`: `known()` alone is the library's vocabulary, `known(definition)` adds a component of your own (`defineComponent`), and `options` (`FaultOptions`) are:
|
|
290
|
+
|
|
291
|
+
- `allow?: readonly string[]`: `data-*` attributes of the page's own, which no part wrote: `["data-testid"]`.
|
|
292
|
+
- `free?: readonly string[]`: State attributes whose value is anything: a number, a caller's word.
|
|
293
|
+
|
|
294
|
+
Its other types:
|
|
295
|
+
|
|
296
|
+
- `KnownVocabulary`: The attributes and variables parts may write, from one or more vocabularies.
|
|
297
|
+
- `attributes: ReadonlyMap<string, readonly string[] | null>`: Each state attribute: the values it takes, or `null` for one that is present or absent.
|
|
298
|
+
- `variables: ReadonlySet<string>`
|
|
299
|
+
- `SerializeOptions`: What `serialize` is told to leave out.
|
|
300
|
+
- `skip?: readonly string[]`: Attributes left out: a framework's own marks. Test ids are written as `#name`.
|
|
301
|
+
- `Recorder`: What `recorder()` gives: a callback to hand a component, and what it heard.
|
|
302
|
+
- `listen(value: Value, details: ChangeDetails): void`: Give this as the callback: `onValueChange: heard.listen`.
|
|
303
|
+
- `calls: readonly Heard<Value>[]`: Every call so far, in order.
|
|
304
|
+
- `said(): string[]`: The calls as `"value reason"`, for one assertion over all of them.
|
|
305
|
+
- `refuse(on?: boolean): void`: From now on, every change is refused (`details.cancel()`), or let through again.
|
|
306
|
+
- `clear(): void`
|
|
307
|
+
- `Heard`: One call of a change callback, as a test reads it.
|
|
308
|
+
- `value: Value`
|
|
309
|
+
- `reason: string`
|
|
310
|
+
- `source: ChangeDetails["source"]`
|
|
6
311
|
|
|
7
312
|
## Using it
|
|
8
313
|
|
|
9
314
|
- Each component is a namespace of parts: `<Dialog.Root>`, `<Dialog.Trigger>`. A component with one part is the component: `<Button>`.
|
|
10
|
-
- A part renders its own element and takes that element's attributes. `as="a"` draws another element; `as-child` puts the part on the element in its slot.
|
|
11
|
-
-
|
|
315
|
+
- A part renders its own element and takes that element's attributes. `as="a"` draws another element; `as-child` puts the part on the element in its slot: `<Dialog.Trigger as-child><a href="/x">…</a></Dialog.Trigger>`.
|
|
316
|
+
- With `as-child` there are three layers of props, lowest first: the attributes on the part, the slotted element's own, the part's own (its role, ARIA, state attributes and listeners). A higher layer wins an attribute it gives, and one it leaves `undefined` stays; classes are joined; styles are merged, the higher layer winning a property; every listener of an event runs, lowest first (the part's caller's, the element's, the part's), and `event.preventKiranaHandler()` called in either of the first two stops only the part's own. So `<Button as-child data-slot="button"><a data-slot="link" href="/x">Next</a></Button>` is `<a data-slot="link" href="/x">Next</a>` with the button's role and listeners. Without `as-child` there are two layers: the attributes on the part, then the part's own.
|
|
317
|
+
- A part's default slot is given the part's state, with `as-child` and without: `v-slot="{ state }"`, read from the part's `data-*` attributes listed below, camel-cased: `data-open` is `state.open === true`, `data-side="bottom"` is `state.side === "bottom"`, `data-starting-style` is `state.startingStyle`, and a state that does not hold is absent.
|
|
318
|
+
- With `as-child`, what a part keeps in its element is in the slotted element: a form control's hidden native input as its last child, and the text a part writes (`Meter.Value`, `Select.Value`, `Calendar.Heading`, a toast's `Title`) while the slotted element has no content of its own: `<Meter.Value as-child><b /></Meter.Value>` is `<b>40%</b>`. A listener given to a part is typed with the event's `preventKiranaHandler()`: `PartEvent<MouseEvent>`, exported by the package.
|
|
319
|
+
- For an element of your own that takes `as` and `as-child` (a badge, a breadcrumb's link): `import { Primitive } from "@kirana-ui/vue/primitive"`. `<Primitive as="span">` draws that element (a `div` by default) with the attributes it is given; `<Primitive as-child>` draws the element in its slot, by the same rule: the slotted element's own props lie over the attributes on the `Primitive`, classes joined, styles merged, both listeners of an event run.
|
|
320
|
+
- Props are written in kebab case (`default-value`). A value binds with `v-model:value` (`v-model:open`, `v-model:page` …); the matching event carries the details: `@value-change="(value, details) => …"`. Below, a prop marked `v-model` binds so, and an event is written as its listener: `@value-change`.
|
|
12
321
|
- A part that draws a list gives each entry to its slot: `v-slot="{ segment }"`.
|
|
322
|
+
- A part that says a value gives it to its slot, to draw something else: `<Select.Value v-slot="{ value, label }">` (with `multiple`, `{ values, labels }`, in the items' order), `<Slider.Value v-slot="{ text, values }">`.
|
|
323
|
+
- A `Positioner`'s `anchor` is a template ref to an element or a component (`:anchor="box"`), an element, an object with `getBoundingClientRect`, or a function that gives one of those.
|
|
324
|
+
- Each part's props are a type of the same entry, named for the part, and its events another: `import type { RootProps, RootEmits } from "@kirana-ui/vue/tabs"`. A part also takes `as`, `as-child` and the attributes of the element it draws.
|
|
325
|
+
- Each component's "Anatomy" is where its parts go: a part is written inside the part it is indented under, with elements of your own between them where the design needs any. `(optional)` marks a wrapper that may be left out, what it holds then written where the wrapper would be; `(repeated)` a part written once for each entry (an item, a tab, a toast), or any number of times; `(as above)` a part drawn in full where it first appears. It is the library's own data (`inside`, `optional` and `repeated` on each part of `@kirana-ui/vocabulary`), held against the pages the library is tested with: write a part nowhere else.
|
|
326
|
+
- These parts draw no element, and take no attributes: every `Portal` (what is inside is drawn at the end of `<body>`), `AlertDialog.Root`, `Autocomplete.Root`, `Calendar.Weekdays`, `Calendar.Weeks`, `Combobox.Root`, `ContextMenu.Root`, `ContextMenu.SubmenuRoot`, `DateField.Segments`, `DatePicker.Root`, `DatePicker.Segments`, `DatePicker.Weekdays`, `DatePicker.Weeks`, `Dialog.Root`, `Drawer.Root`, `Field.Validity`, `HoverCard.Root`, `Menu.Root`, `Menu.SubmenuRoot`, `Pagination.Items`, `Popover.Root`, `Select.Root`, `Toast.List` and `Tooltip.Root`. Every other part draws the element named for it below.
|
|
327
|
+
- A popup is drawn in a portal at the end of `<body>`. In `Autocomplete`, `Combobox`, `ContextMenu`, `DatePicker`, `HoverCard`, `Menu`, `NavigationMenu`, `Popover`, `Select` and `Tooltip` it is `Portal` > `Positioner` > `Popup`: the `Positioner` places it against its trigger and carries `--anchor-width`, `--available-height`, `--transform-origin` and `data-side`. `AlertDialog`, `Dialog` and `Drawer` have no `Positioner`: there it is `Portal` > `Backdrop` and `Popup`, and the design places the popup.
|
|
328
|
+
- Every `Positioner` takes the same options (`side`, `align`, `sideOffset`, `alignOffset`, `collisionPadding`, `anchor`), listed once under "Positioner options" with their defaults. An anchor may change while the popup is open, and the popup follows.
|
|
329
|
+
- Every change callback of a value the component holds is `(value, details)`: `details.reason`, `details.event`, `details.source` (mouse, touch, pen, keyboard, virtual, programmatic, agent), and `details.cancel()` to keep the value as it was (`@at-bottom-change`, `@checked-change`, `@index-change`, `@input-value-change`, `@open-change`, `@page-change`, `@pressed-change`, `@select`, `@sizes-change`, `@snap-point-change`, `@value-change`, `@value-committed`, `@values-change` and `onFormSubmit`). A callback that reports something that happened takes only that, and cannot be refused: `@complete`, `@month-change` and `onClearErrors`.
|
|
330
|
+
- A part that is in the page only while it is open, chosen or checked leaves it otherwise. `keepMounted` keeps it in the page, hidden, on the parts that take it and no others: `Accordion.Panel`, `Autocomplete.Clear`, `Checkbox.Indicator`, `Collapsible.Panel`, `Combobox.Clear`, `Combobox.ItemIndicator`, `ContextMenu.CheckboxItemIndicator`, `ContextMenu.RadioItemIndicator`, `Listbox.ItemIndicator`, `Menu.CheckboxItemIndicator`, `Menu.RadioItemIndicator`, `RadioGroup.Indicator`, `ScrollArea.Scrollbar`, `Select.ItemIndicator` and `Tabs.Panel`.
|
|
331
|
+
- `readOnly` (shown, focusable, not changeable) is a prop of `Calendar`, `Checkbox`, `DateField`, `DatePicker`, `NumberField`, `RadioGroup` and `Switch` and of no other component.
|
|
13
332
|
- No CSS is shipped and no styles are injected. A part is styled by its element, its `class`, and the attributes and CSS variables listed for it below.
|
|
14
333
|
- A boolean state is an attribute that is present or absent (`[data-open]`), never `="false"`.
|
|
15
334
|
- An entrance starts from `[data-starting-style]` and an exit ends at `[data-ending-style]`: write the hidden style under both and transition between. A part leaves the page when its own motion has ended.
|
|
16
|
-
- A popup is drawn in a portal at the end of `<body>` and placed by its `Positioner`, which carries `--anchor-width`, `--available-height`, `--transform-origin` and `data-side`.
|
|
17
|
-
- Every change callback is `(value, details)`: `details.reason`, `details.event`, `details.source` (mouse, touch, pen, keyboard, virtual, programmatic, agent), and `details.cancel()` to keep the value as it was.
|
|
18
335
|
- A value is controlled when it is given (`value`) and the component's own when it is not (`defaultValue`). `open`/`defaultOpen` and the others pair the same way.
|
|
19
336
|
- A control with a `name` is submitted with the form around it and follows the form's reset. Inside a `Field` it is the field's control.
|
|
20
337
|
- `PortalProvider` (`container`) says where the popups inside it are drawn, in place of the end of `<body>`: a shadow root's host, a full-screen element.
|
|
21
|
-
- An agent can read and use a page built with these: `createAgent()` from `@kirana-ui/
|
|
338
|
+
- An agent can read and use a page built with these: `createAgent()` from `@kirana-ui/vue/agent` gives `snapshot()`, `act({ steps })`, `query()`, `history()`, `undo()` and `redo()`; what it changes reaches the same callbacks with `details.source === "agent"`. "Agent", above, has the whole of it.
|
|
22
339
|
|
|
23
340
|
## Components
|
|
24
341
|
|
|
@@ -30,22 +347,43 @@ import { Accordion } from "@kirana-ui/vue/accordion"
|
|
|
30
347
|
|
|
31
348
|
Parts: `<Accordion.Root>`, `<Accordion.Item>`, `<Accordion.Header>`, `<Accordion.Trigger>`, `<Accordion.Panel>`.
|
|
32
349
|
|
|
350
|
+
Anatomy:
|
|
351
|
+
|
|
352
|
+
```
|
|
353
|
+
<Accordion.Root>
|
|
354
|
+
<Accordion.Item> (repeated)
|
|
355
|
+
<Accordion.Header>
|
|
356
|
+
<Accordion.Trigger>
|
|
357
|
+
<Accordion.Panel>
|
|
358
|
+
```
|
|
359
|
+
|
|
33
360
|
Props of its root:
|
|
34
361
|
|
|
35
|
-
- `value?: readonly Value[]`: The values of the open items.
|
|
362
|
+
- `value?: readonly Value[]`: `v-model:value`. The values of the open items.
|
|
36
363
|
- `defaultValue?: readonly Value[]`: Read once.
|
|
37
|
-
- `onValueChange?: ((value: Value[], details: ChangeDetails) => void)`
|
|
38
364
|
- `multiple?: boolean`: Whether several items can be open at once. Default `false`: opening one closes the others.
|
|
39
|
-
- `disabled?: boolean
|
|
365
|
+
- `disabled?: boolean`: Disables every item: none can be opened or closed.
|
|
40
366
|
- `orientation?: Orientation`: The way the arrows move between triggers. Default `vertical`.
|
|
41
367
|
- `loop?: boolean`: Whether the arrows wrap from the last trigger to the first. Default `true`.
|
|
368
|
+
- `@value-change: (value: Value[], details: ChangeDetails) => void`: Heard as an item is about to open or close, with the values that would be open: `details.cancel()` keeps them as they were.
|
|
369
|
+
|
|
370
|
+
Each part, and its own props:
|
|
371
|
+
|
|
372
|
+
- `<Accordion.Root>` draws a `<div>`. Generic: `<Value = unknown>`. Its props are above.
|
|
373
|
+
- `<Accordion.Item>` draws a `<div>`.
|
|
374
|
+
- `disabled?: boolean`: Disables this item: it cannot be opened or closed.
|
|
375
|
+
- `value?: unknown`: What tells this item from the others; an item that is given none makes its own.
|
|
376
|
+
- `<Accordion.Header>` draws a `<h3>`.
|
|
377
|
+
- `<Accordion.Trigger>` draws a `<button>`.
|
|
378
|
+
- `<Accordion.Panel>` draws a `<div>`.
|
|
379
|
+
- `keepMounted?: boolean`: Keeps the closed panel in the page, `hidden`.
|
|
42
380
|
|
|
43
381
|
Attributes and CSS variables, by part:
|
|
44
382
|
|
|
45
383
|
- root: Groups the items.
|
|
46
384
|
- `data-orientation="horizontal | vertical"`: The way the items are laid out, and the arrows that move between their triggers.
|
|
47
385
|
- `data-disabled`: Present when it is disabled.
|
|
48
|
-
- item: One section: a header with its trigger, and a panel.
|
|
386
|
+
- item: One section: a header with its trigger, and a panel. Its `value` tells it from the others; an item that is given none makes its own.
|
|
49
387
|
- `data-open`: Present when the item is open.
|
|
50
388
|
- `data-disabled`: Present when it is disabled.
|
|
51
389
|
- header: The heading that holds the trigger.
|
|
@@ -72,6 +410,36 @@ import { AlertDialog } from "@kirana-ui/vue/alert-dialog"
|
|
|
72
410
|
|
|
73
411
|
Parts: `<AlertDialog.Root>`, `<AlertDialog.Trigger>`, `<AlertDialog.Portal>`, `<AlertDialog.Backdrop>`, `<AlertDialog.Popup>`, `<AlertDialog.Title>`, `<AlertDialog.Description>`, `<AlertDialog.Close>`.
|
|
74
412
|
|
|
413
|
+
Anatomy:
|
|
414
|
+
|
|
415
|
+
```
|
|
416
|
+
<AlertDialog.Root>
|
|
417
|
+
<AlertDialog.Trigger>
|
|
418
|
+
<AlertDialog.Portal>
|
|
419
|
+
<AlertDialog.Backdrop>
|
|
420
|
+
<AlertDialog.Popup>
|
|
421
|
+
<AlertDialog.Title>
|
|
422
|
+
<AlertDialog.Description>
|
|
423
|
+
<AlertDialog.Close>
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
Props of its root:
|
|
427
|
+
|
|
428
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
429
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
430
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
431
|
+
|
|
432
|
+
Each part, and its own props:
|
|
433
|
+
|
|
434
|
+
- `<AlertDialog.Root>` draws no element. Holds the dialog: whether it is open. Its props are above.
|
|
435
|
+
- `<AlertDialog.Trigger>` draws a `<button>`.
|
|
436
|
+
- `<AlertDialog.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
437
|
+
- `<AlertDialog.Backdrop>` draws a `<div>`.
|
|
438
|
+
- `<AlertDialog.Popup>` draws a `<div>`.
|
|
439
|
+
- `<AlertDialog.Title>` draws a `<h2>`. The heading that names the dialog.
|
|
440
|
+
- `<AlertDialog.Description>` draws a `<p>`. The text that describes the dialog.
|
|
441
|
+
- `<AlertDialog.Close>` draws a `<button>`. A button that closes the dialog.
|
|
442
|
+
|
|
75
443
|
Attributes and CSS variables, by part:
|
|
76
444
|
|
|
77
445
|
- trigger: The button that opens the dialog.
|
|
@@ -95,51 +463,94 @@ Attributes and CSS variables, by part:
|
|
|
95
463
|
import { Autocomplete } from "@kirana-ui/vue/autocomplete"
|
|
96
464
|
```
|
|
97
465
|
|
|
98
|
-
Parts: `<Autocomplete.Root>`, `<Autocomplete.Input>`, `<Autocomplete.Trigger>`, `<Autocomplete.Clear>`, `<Autocomplete.Portal>`, `<Autocomplete.Positioner>`, `<Autocomplete.Popup>`, `<Autocomplete.Group>`, `<Autocomplete.GroupLabel>`, `<Autocomplete.Separator>`, `<Autocomplete.Item>`, `<Autocomplete.Empty>`.
|
|
466
|
+
Parts: `<Autocomplete.Root>`, `<Autocomplete.Input>`, `<Autocomplete.Trigger>`, `<Autocomplete.Clear>`, `<Autocomplete.Portal>`, `<Autocomplete.Positioner>`, `<Autocomplete.Popup>`, `<Autocomplete.List>`, `<Autocomplete.Group>`, `<Autocomplete.GroupLabel>`, `<Autocomplete.Separator>`, `<Autocomplete.Item>`, `<Autocomplete.Empty>`.
|
|
467
|
+
|
|
468
|
+
Anatomy:
|
|
469
|
+
|
|
470
|
+
```
|
|
471
|
+
<Autocomplete.Root>
|
|
472
|
+
<Autocomplete.Input>
|
|
473
|
+
<Autocomplete.Trigger>
|
|
474
|
+
<Autocomplete.Portal>
|
|
475
|
+
<Autocomplete.Positioner>
|
|
476
|
+
<Autocomplete.Popup>
|
|
477
|
+
<Autocomplete.List> (optional)
|
|
478
|
+
<Autocomplete.Group> (optional, repeated)
|
|
479
|
+
<Autocomplete.Item> (repeated)
|
|
480
|
+
<Autocomplete.GroupLabel>
|
|
481
|
+
<Autocomplete.Separator> (repeated)
|
|
482
|
+
<Autocomplete.Empty>
|
|
483
|
+
<Autocomplete.Popup> (as above)
|
|
484
|
+
<Autocomplete.Clear>
|
|
485
|
+
```
|
|
99
486
|
|
|
100
487
|
Props of its root:
|
|
101
488
|
|
|
102
|
-
- `
|
|
103
|
-
- `
|
|
104
|
-
- `
|
|
105
|
-
- `open?: boolean`
|
|
106
|
-
- `defaultOpen?: boolean`
|
|
107
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
489
|
+
- `defaultValue?: string`: The text it starts with, when the caller does not hold `value`. Read once.
|
|
490
|
+
- `open?: boolean`: `v-model:open`. Whether the list is open, when the caller holds it.
|
|
491
|
+
- `defaultOpen?: boolean`: Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
108
492
|
- `mode?: "list" | "none"`: `"list"` (the default): the suggestions are filtered by what is typed. `"none"`: they are as the caller draws them.
|
|
109
493
|
- `filter?: ((label: string, query: string) => boolean) | null`: Whether a suggestion is shown for what was typed; `null` shows every one.
|
|
110
494
|
- `openOnInputClick?: boolean`: Whether a press on the input opens the list. Default: it opens when something is typed.
|
|
111
|
-
- `disabled?: boolean
|
|
112
|
-
- `required?: boolean`
|
|
495
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
496
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
113
497
|
- `name?: string`: The input's name in the form around it.
|
|
114
498
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
115
499
|
- `virtualized?: ListCollection`: Every row, when only some are in the page: each item is then given its `index`.
|
|
500
|
+
- `autoHighlight?: boolean`: The first suggestion for what was typed is highlighted as one types, so Enter takes it. Off by default: no suggestion is highlighted for having been typed at, and Enter is the form's, with the text as typed, until an arrow or the pointer has gone to one.
|
|
501
|
+
- `modelValue?: string`: `v-model:modelValue`. The text, which is the value: `v-model`.
|
|
502
|
+
- `@value-change: (value: string, details: ChangeDetails) => void`: Heard as the text is about to change, typed or chosen: `details.cancel()` keeps it as it was.
|
|
503
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as the list is about to open or close: `details.cancel()` keeps it as it was.
|
|
504
|
+
|
|
505
|
+
Each part, and its own props:
|
|
506
|
+
|
|
507
|
+
- `<Autocomplete.Root>` draws no element. Holds the autocomplete: the text, and whether the suggestions are open. Its props are above.
|
|
508
|
+
- `<Autocomplete.Input>` draws a `<input>`.
|
|
509
|
+
- `<Autocomplete.Trigger>` draws a `<button>`.
|
|
510
|
+
- `<Autocomplete.Clear>` draws a `<button>`.
|
|
511
|
+
- `keepMounted?: boolean`: Keeps the button in the page while there is nothing to clear.
|
|
512
|
+
- `<Autocomplete.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
513
|
+
- `<Autocomplete.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
514
|
+
- `<Autocomplete.Popup>` draws a `<div>`.
|
|
515
|
+
- `<Autocomplete.List>` draws a `<div>`.
|
|
516
|
+
- `<Autocomplete.Group>` draws a `<div>`. Items that belong together, named by their label. Hidden while none is shown.
|
|
517
|
+
- `<Autocomplete.GroupLabel>` draws a `<div>`. The name of a group. Outside a group it is plain text, and names nothing.
|
|
518
|
+
- `<Autocomplete.Separator>` draws a `<div>`. A line between groups.
|
|
519
|
+
- `<Autocomplete.Item>` draws a `<div>`.
|
|
520
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
521
|
+
- `label?: string`: What is filtered and what the input shows; the item's text when left out.
|
|
522
|
+
- `index?: number`: Its place among all the rows, in a virtualized list.
|
|
523
|
+
- `value: unknown`: Required. What the combobox's value is while this item is the chosen one.
|
|
524
|
+
- `<Autocomplete.Empty>` draws a `<div>`. What is shown when no item is.
|
|
116
525
|
|
|
117
526
|
Attributes and CSS variables, by part:
|
|
118
527
|
|
|
119
528
|
- input: The text input: its text is the value, and what is typed asks for suggestions.
|
|
120
529
|
- `data-popup-open`: Present when the list is open.
|
|
121
530
|
- `data-disabled`: Present when it is disabled.
|
|
122
|
-
- trigger: A button that opens and closes the list.
|
|
531
|
+
- trigger: A button that opens and closes the list. With the input inside the popup it is the combobox: a stop for Tab, and what the popup is placed against.
|
|
123
532
|
- `data-popup-open`: Present when the list is open.
|
|
124
533
|
- `data-disabled`: Present when it is disabled.
|
|
125
|
-
- positioner: Places the list against the input
|
|
534
|
+
- positioner: Places the list against the input: against the chips' box when the input is in one, the button when the input is inside the popup, or its own `anchor`. It carries the geometry.
|
|
126
535
|
- `data-open`: Present when it is open.
|
|
127
536
|
- `data-closed`: Present when it is closed.
|
|
128
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
537
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
129
538
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
130
539
|
- `--anchor-width`: The anchor's width.
|
|
131
540
|
- `--anchor-height`: The anchor's height.
|
|
132
541
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
133
542
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
134
543
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
135
|
-
- popup: The list of items.
|
|
544
|
+
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
|
|
136
545
|
- `data-open`: Present when it is open.
|
|
137
546
|
- `data-closed`: Present when it is closed.
|
|
138
547
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
139
548
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
140
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
549
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
141
550
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
142
551
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
552
|
+
- list: The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
553
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
143
554
|
- item: One suggestion: chosen, its text is written into the input.
|
|
144
555
|
- `data-selected`: Present on the chosen item.
|
|
145
556
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
@@ -155,9 +566,19 @@ import { Autosize } from "@kirana-ui/vue/autosize"
|
|
|
155
566
|
|
|
156
567
|
Parts: `<Autosize.Textarea>`.
|
|
157
568
|
|
|
569
|
+
Anatomy:
|
|
570
|
+
|
|
571
|
+
```
|
|
572
|
+
<Autosize.Textarea>
|
|
573
|
+
```
|
|
574
|
+
|
|
158
575
|
Props of its root:
|
|
159
576
|
|
|
160
|
-
- `
|
|
577
|
+
- `modelValue?: string`: `v-model:modelValue`. The text: `v-model`.
|
|
578
|
+
|
|
579
|
+
Each part, and its own props:
|
|
580
|
+
|
|
581
|
+
- `<Autosize.Textarea>` draws a `<textarea>`. A `<textarea>` as tall as its text. Its `height` is written; `min-height` and `max-height` are the design's. Its props are above.
|
|
161
582
|
|
|
162
583
|
### Avatar
|
|
163
584
|
|
|
@@ -167,6 +588,21 @@ import { Avatar } from "@kirana-ui/vue/avatar"
|
|
|
167
588
|
|
|
168
589
|
Parts: `<Avatar.Root>`, `<Avatar.Image>`, `<Avatar.Fallback>`.
|
|
169
590
|
|
|
591
|
+
Anatomy:
|
|
592
|
+
|
|
593
|
+
```
|
|
594
|
+
<Avatar.Root>
|
|
595
|
+
<Avatar.Image>
|
|
596
|
+
<Avatar.Fallback>
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
Each part, and its own props:
|
|
600
|
+
|
|
601
|
+
- `<Avatar.Root>` draws a `<span>`. The frame the image and its stand-in share.
|
|
602
|
+
- `<Avatar.Image>` draws a `<img>`. The picture. In the page once it has loaded.
|
|
603
|
+
- `src?: string`: The picture's address: the part is in the page once it has loaded.
|
|
604
|
+
- `<Avatar.Fallback>` draws a `<span>`. What shows until the picture has loaded, or when it cannot.
|
|
605
|
+
|
|
170
606
|
### Button
|
|
171
607
|
|
|
172
608
|
```
|
|
@@ -175,10 +611,12 @@ import { Button } from "@kirana-ui/vue/button"
|
|
|
175
611
|
|
|
176
612
|
Props:
|
|
177
613
|
|
|
178
|
-
- `disabled?: boolean
|
|
614
|
+
- `disabled?: boolean`: Disabled: a press does nothing.
|
|
179
615
|
- `focusableWhenDisabled?: boolean`: Keeps a disabled button in the tab order, so what it would do can still be read.
|
|
180
616
|
- `nativeButton?: boolean`: `false` when the element is not a `<button>`: it is given a button's role and keyboard.
|
|
181
617
|
|
|
618
|
+
`<Button>` draws a `<button>`.
|
|
619
|
+
|
|
182
620
|
Attributes and CSS variables, by part:
|
|
183
621
|
|
|
184
622
|
- root: The button.
|
|
@@ -192,22 +630,53 @@ import { Calendar } from "@kirana-ui/vue/calendar"
|
|
|
192
630
|
|
|
193
631
|
Parts: `<Calendar.Root>`, `<Calendar.Heading>`, `<Calendar.Previous>`, `<Calendar.Next>`, `<Calendar.Grid>`, `<Calendar.Weekdays>`, `<Calendar.HeadCell>`, `<Calendar.Weeks>`, `<Calendar.Cell>`, `<Calendar.Day>`.
|
|
194
632
|
|
|
633
|
+
Anatomy:
|
|
634
|
+
|
|
635
|
+
```
|
|
636
|
+
<Calendar.Root>
|
|
637
|
+
<Calendar.Heading>
|
|
638
|
+
<Calendar.Previous>
|
|
639
|
+
<Calendar.Next>
|
|
640
|
+
<Calendar.Grid>
|
|
641
|
+
<Calendar.Weekdays>
|
|
642
|
+
<Calendar.HeadCell> (repeated)
|
|
643
|
+
<Calendar.Weeks>
|
|
644
|
+
<Calendar.Cell> (repeated)
|
|
645
|
+
<Calendar.Day>
|
|
646
|
+
```
|
|
647
|
+
|
|
195
648
|
Props of its root:
|
|
196
649
|
|
|
197
|
-
- `value?: CalendarValue`: One day, or with `mode: "range"` a first and a last day; `null` for none.
|
|
198
|
-
- `defaultValue?: CalendarValue`
|
|
199
|
-
- `onValueChange?: ((value: CalendarValue, details: ChangeDetails) => void)`
|
|
650
|
+
- `value?: CalendarValue`: `v-model:value`. One day, or with `mode: "range"` a first and a last day; `null` for none.
|
|
651
|
+
- `defaultValue?: CalendarValue`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
200
652
|
- `mode?: "single" | "range"`: Whether one day is chosen (the default) or a first and a last.
|
|
201
653
|
- `defaultFocusedValue?: IsoDate`: The day it opens on, when it has no value: its month is the one shown.
|
|
202
|
-
- `onMonthChange?: ((month: IsoDate) => void)`: Heard when another month is shown: its first day.
|
|
203
654
|
- `locale?: string`: The language and region its names, numbers, first day of the week and calendar follow (`"en-US"`, `"fa-IR"`). Give it: a server does not know the reader's.
|
|
204
655
|
- `calendarSystem?: CalendarSystem`: The calendar its months are laid out in, when it is not the Gregorian one: an instance from `@internationalized/date` (`new PersianCalendar()`). Given, not found from the locale: a page then carries only the calendars it uses.
|
|
205
656
|
- `min?: IsoDate`: The first and the last day that can be chosen.
|
|
206
|
-
- `max?: IsoDate
|
|
207
|
-
- `isDateUnavailable?: (
|
|
208
|
-
- `disabled?: boolean
|
|
209
|
-
- `readOnly?: boolean
|
|
657
|
+
- `max?: IsoDate`: The last day that can be chosen.
|
|
658
|
+
- `isDateUnavailable?: (date: IsoDate) => boolean`: Days that cannot be chosen, though they can be reached: a day off, a day taken.
|
|
659
|
+
- `disabled?: boolean`: Disabled: no day can be chosen.
|
|
660
|
+
- `readOnly?: boolean`: Shown as it is: the days can be moved through, and none can be chosen.
|
|
210
661
|
- `fixedWeeks?: boolean`: Always six rows, so the calendar is one height in every month.
|
|
662
|
+
- `@value-change: (value: CalendarValue, details: ChangeDetails) => void`: Heard as a day is about to be chosen: `details.cancel()` keeps the value as it was.
|
|
663
|
+
- `@month-change: (month: string) => void`: The month shown has changed: its first day.
|
|
664
|
+
|
|
665
|
+
Each part, and its own props:
|
|
666
|
+
|
|
667
|
+
- `<Calendar.Root>` draws a `<div>`. Its props are above.
|
|
668
|
+
- `<Calendar.Heading>` draws a `<div>`. Names the month shown. Read out when it changes.
|
|
669
|
+
- `<Calendar.Previous>` draws a `<button>`.
|
|
670
|
+
- `<Calendar.Next>` draws a `<button>`.
|
|
671
|
+
- `<Calendar.Grid>` draws a `<table>`. The table of days: a grid the arrows move in.
|
|
672
|
+
- `<Calendar.Weekdays>` draws no element. The days of the week: each is given to draw its head cell. Its default slot is also given `weekday: CalendarWeekday`.
|
|
673
|
+
- `<Calendar.HeadCell>` draws a `<th>`. A column's heading: a day of the week.
|
|
674
|
+
- `weekday: CalendarWeekday`: Required. The day of the week it names, as `Calendar.Weekdays` gives it.
|
|
675
|
+
- `<Calendar.Weeks>` draws no element. The weeks of the month shown: each is given to draw its row of days. Its default slot is also given `week: readonly CalendarDay[]`.
|
|
676
|
+
- `<Calendar.Cell>` draws a `<td>`.
|
|
677
|
+
- `date: string`: Required. The day it is for, as a week of `Calendar.Weeks` gives it.
|
|
678
|
+
- `<Calendar.Day>` draws a `<button>`.
|
|
679
|
+
- `date: string`: Required. The day it is for, as a week of `Calendar.Weeks` gives it.
|
|
211
680
|
|
|
212
681
|
Attributes and CSS variables, by part:
|
|
213
682
|
|
|
@@ -243,13 +712,35 @@ import { Carousel } from "@kirana-ui/vue/carousel"
|
|
|
243
712
|
|
|
244
713
|
Parts: `<Carousel.Root>`, `<Carousel.Viewport>`, `<Carousel.Item>`, `<Carousel.Previous>`, `<Carousel.Next>`, `<Carousel.Indicator>`.
|
|
245
714
|
|
|
715
|
+
Anatomy:
|
|
716
|
+
|
|
717
|
+
```
|
|
718
|
+
<Carousel.Root>
|
|
719
|
+
<Carousel.Viewport>
|
|
720
|
+
<Carousel.Item> (repeated)
|
|
721
|
+
<Carousel.Previous>
|
|
722
|
+
<Carousel.Next>
|
|
723
|
+
<Carousel.Indicator> (repeated)
|
|
724
|
+
```
|
|
725
|
+
|
|
246
726
|
Props of its root:
|
|
247
727
|
|
|
248
|
-
- `index?: number`: Which slide is at the start of the view, from 0.
|
|
249
|
-
- `defaultIndex?: number`
|
|
250
|
-
- `onIndexChange?: ((index: number, details: ChangeDetails) => void)`
|
|
728
|
+
- `index?: number`: `v-model:index`. Which slide is at the start of the view, from 0.
|
|
729
|
+
- `defaultIndex?: number`: The slide it starts at, when the caller does not hold `index`. Read once.
|
|
251
730
|
- `orientation?: Orientation`: Whether the slides go across (the default) or down.
|
|
252
731
|
- `loop?: boolean`: Whether going on from the last slide comes round to the first.
|
|
732
|
+
- `@index-change: (value: number, details: ChangeDetails) => void`: Heard as another slide is about to be at the start of the view: `details.cancel()` keeps the index as it was.
|
|
733
|
+
|
|
734
|
+
Each part, and its own props:
|
|
735
|
+
|
|
736
|
+
- `<Carousel.Root>` draws a `<div>`. Its props are above.
|
|
737
|
+
- `<Carousel.Viewport>` draws a `<div>`.
|
|
738
|
+
- `<Carousel.Item>` draws a `<div>`.
|
|
739
|
+
- `index: number`: Required. Its place among the slides, from 0.
|
|
740
|
+
- `<Carousel.Previous>` draws a `<button>`.
|
|
741
|
+
- `<Carousel.Next>` draws a `<button>`.
|
|
742
|
+
- `<Carousel.Indicator>` draws a `<button>`.
|
|
743
|
+
- `index: number`: Required. The slide it goes to, from 0.
|
|
253
744
|
|
|
254
745
|
Attributes and CSS variables, by part:
|
|
255
746
|
|
|
@@ -275,18 +766,31 @@ import { Checkbox } from "@kirana-ui/vue/checkbox"
|
|
|
275
766
|
|
|
276
767
|
Parts: `<Checkbox.Root>`, `<Checkbox.Indicator>`.
|
|
277
768
|
|
|
769
|
+
Anatomy:
|
|
770
|
+
|
|
771
|
+
```
|
|
772
|
+
<Checkbox.Root>
|
|
773
|
+
<Checkbox.Indicator>
|
|
774
|
+
```
|
|
775
|
+
|
|
278
776
|
Props of its root:
|
|
279
777
|
|
|
280
|
-
- `checked?: boolean`
|
|
778
|
+
- `checked?: boolean`: `v-model:checked`. Whether it is checked, when the caller holds it.
|
|
281
779
|
- `defaultChecked?: boolean`: Read once.
|
|
282
|
-
- `
|
|
283
|
-
- `disabled?: boolean`
|
|
780
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
284
781
|
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
285
|
-
- `required?: boolean`
|
|
782
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it unchecked is then invalid.
|
|
286
783
|
- `name?: string`: With a name, the control is submitted with the form around it when it is checked.
|
|
287
784
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
288
785
|
- `value?: string`: What is submitted. Default `"on"`, as a native checkbox's.
|
|
289
786
|
- `indeterminate?: boolean`: Neither checked nor unchecked: a parent of boxes that disagree.
|
|
787
|
+
- `@checked-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to be checked or unchecked: `details.cancel()` keeps it as it was.
|
|
788
|
+
|
|
789
|
+
Each part, and its own props:
|
|
790
|
+
|
|
791
|
+
- `<Checkbox.Root>` draws a `<span>`. Its props are above.
|
|
792
|
+
- `<Checkbox.Indicator>` draws a `<span>`.
|
|
793
|
+
- `keepMounted?: boolean`: Keeps the mark in the page while the box is unchecked.
|
|
290
794
|
|
|
291
795
|
Attributes and CSS variables, by part:
|
|
292
796
|
|
|
@@ -315,12 +819,27 @@ import { Collapsible } from "@kirana-ui/vue/collapsible"
|
|
|
315
819
|
|
|
316
820
|
Parts: `<Collapsible.Root>`, `<Collapsible.Trigger>`, `<Collapsible.Panel>`.
|
|
317
821
|
|
|
822
|
+
Anatomy:
|
|
823
|
+
|
|
824
|
+
```
|
|
825
|
+
<Collapsible.Root>
|
|
826
|
+
<Collapsible.Trigger> (repeated)
|
|
827
|
+
<Collapsible.Panel>
|
|
828
|
+
```
|
|
829
|
+
|
|
318
830
|
Props of its root:
|
|
319
831
|
|
|
320
|
-
- `open?: boolean`
|
|
832
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
321
833
|
- `defaultOpen?: boolean`: Read once.
|
|
322
|
-
- `
|
|
323
|
-
-
|
|
834
|
+
- `disabled?: boolean`: Disabled: its trigger does not open or close it.
|
|
835
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
836
|
+
|
|
837
|
+
Each part, and its own props:
|
|
838
|
+
|
|
839
|
+
- `<Collapsible.Root>` draws a `<div>`. Its props are above.
|
|
840
|
+
- `<Collapsible.Trigger>` draws a `<button>`.
|
|
841
|
+
- `<Collapsible.Panel>` draws a `<div>`.
|
|
842
|
+
- `keepMounted?: boolean`: Keeps the closed panel in the page, `hidden`.
|
|
324
843
|
|
|
325
844
|
Attributes and CSS variables, by part:
|
|
326
845
|
|
|
@@ -345,58 +864,113 @@ Attributes and CSS variables, by part:
|
|
|
345
864
|
import { Combobox } from "@kirana-ui/vue/combobox"
|
|
346
865
|
```
|
|
347
866
|
|
|
348
|
-
Parts: `<Combobox.Root>`, `<Combobox.Input>`, `<Combobox.Trigger>`, `<Combobox.Clear>`, `<Combobox.Chips>`, `<Combobox.Chip>`, `<Combobox.ChipRemove>`, `<Combobox.Portal>`, `<Combobox.Positioner>`, `<Combobox.Popup>`, `<Combobox.Group>`, `<Combobox.GroupLabel>`, `<Combobox.Separator>`, `<Combobox.Item>`, `<Combobox.ItemIndicator>`, `<Combobox.Empty>`.
|
|
867
|
+
Parts: `<Combobox.Root>`, `<Combobox.Input>`, `<Combobox.Trigger>`, `<Combobox.Clear>`, `<Combobox.Chips>`, `<Combobox.Chip>`, `<Combobox.ChipRemove>`, `<Combobox.Portal>`, `<Combobox.Positioner>`, `<Combobox.Popup>`, `<Combobox.List>`, `<Combobox.Group>`, `<Combobox.GroupLabel>`, `<Combobox.Separator>`, `<Combobox.Item>`, `<Combobox.ItemIndicator>`, `<Combobox.Empty>`.
|
|
868
|
+
|
|
869
|
+
Anatomy:
|
|
870
|
+
|
|
871
|
+
```
|
|
872
|
+
<Combobox.Root>
|
|
873
|
+
<Combobox.Input>
|
|
874
|
+
<Combobox.Trigger>
|
|
875
|
+
<Combobox.Portal>
|
|
876
|
+
<Combobox.Positioner>
|
|
877
|
+
<Combobox.Popup>
|
|
878
|
+
<Combobox.Input> (as above)
|
|
879
|
+
<Combobox.List> (optional)
|
|
880
|
+
<Combobox.Group> (optional, repeated)
|
|
881
|
+
<Combobox.Item> (repeated)
|
|
882
|
+
<Combobox.ItemIndicator>
|
|
883
|
+
<Combobox.GroupLabel>
|
|
884
|
+
<Combobox.Separator> (repeated)
|
|
885
|
+
<Combobox.Empty>
|
|
886
|
+
<Combobox.Popup> (as above)
|
|
887
|
+
<Combobox.Clear>
|
|
888
|
+
<Combobox.Chips>
|
|
889
|
+
<Combobox.Input> (as above)
|
|
890
|
+
<Combobox.Chip> (repeated)
|
|
891
|
+
<Combobox.ChipRemove>
|
|
892
|
+
```
|
|
349
893
|
|
|
350
894
|
Props of its root:
|
|
351
895
|
|
|
352
|
-
- `value?: Value | null`: The chosen value; `null` is "none".
|
|
353
|
-
- `defaultValue?: Value | null`
|
|
354
|
-
- `
|
|
355
|
-
- `
|
|
356
|
-
- `
|
|
357
|
-
- `
|
|
358
|
-
- `
|
|
359
|
-
- `defaultOpen?: boolean`
|
|
360
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
361
|
-
- `disabled?: boolean`
|
|
896
|
+
- `value?: Value | null`: `v-model:value`. The chosen value; `null` is "none".
|
|
897
|
+
- `defaultValue?: Value | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
898
|
+
- `inputValue?: string`: `v-model:inputValue`. What the input says.
|
|
899
|
+
- `defaultInputValue?: string`: The text the input starts with, when the caller does not hold `inputValue`. Read once.
|
|
900
|
+
- `open?: boolean`: `v-model:open`. Whether the list is open, when the caller holds it.
|
|
901
|
+
- `defaultOpen?: boolean`: Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
902
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
362
903
|
- `name?: string`: With a name, the value is submitted with the form around it.
|
|
363
904
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
364
|
-
- `items?: readonly { value: Value; label: string }[]
|
|
905
|
+
- `items?: readonly { value: Value; label: string }[] | Readonly<Record<string, string>>`: The labels of the values, for the input to show a value before the list has ever been opened: a list of values with their labels, or, for values that are text, the labels by value (`{ apple: "Apple" }`). Not needed for the list itself: its items are read from the markup.
|
|
365
906
|
- `filter?: ((label: string, query: string) => boolean) | null`: Whether an item is shown for what was typed. Default: its label holds the text, without regard to case. `null`: every item is shown, and the caller draws the ones it wants.
|
|
366
907
|
- `multiple?: boolean`: Several values, each shown as a chip beside the input: an item chosen is added, chosen again taken away, and the list stays open. The values are `values`, not `value`.
|
|
367
|
-
- `values?: readonly Value[]`
|
|
368
|
-
- `defaultValues?: readonly Value[]`
|
|
369
|
-
- `onValuesChange?: ((values: Value[], details: ChangeDetails) => void)`
|
|
908
|
+
- `values?: readonly Value[]`: `v-model:values`. With `multiple`: the chosen values, in the order they were chosen.
|
|
909
|
+
- `defaultValues?: readonly Value[]`: With `multiple`: the values it starts with, when the caller does not hold `values`. Read once.
|
|
370
910
|
- `required?: boolean`: In a field, "none" is then wrong.
|
|
371
911
|
- `inline?: boolean`: The list is always in the page, under the input, with no popup: a command palette. An item chosen is told to the caller, and the input keeps what was typed.
|
|
372
912
|
- `virtualized?: ListCollection`: Every row, when only some are in the page (a virtualizer draws the ones in view). The caller then filters: the collection is what is left, and each item is given its `index`.
|
|
913
|
+
- `autoHighlight?: boolean`: The first item shown for what was typed is highlighted as one types, so Enter chooses it. Off by default: typing then highlights nothing, and Enter chooses once an arrow or the pointer has gone to an item. Either way a list opened with nothing typed is on its chosen item, if it has one.
|
|
914
|
+
- `@value-change: (value: Value | null, details: ChangeDetails) => void`: Heard as a value is about to be chosen or cleared: `details.cancel()` keeps it as it was.
|
|
915
|
+
- `@values-change: (value: Value[], details: ChangeDetails) => void`: With `multiple`: heard as a value is about to be added or taken away, with the values there would then be: `details.cancel()` keeps them as they were.
|
|
916
|
+
- `@input-value-change: (value: string, details: ChangeDetails) => void`: Heard as the input's text is about to change: `details.cancel()` keeps it as it was.
|
|
917
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as the list is about to open or close: `details.cancel()` keeps it as it was.
|
|
918
|
+
|
|
919
|
+
Each part, and its own props:
|
|
920
|
+
|
|
921
|
+
- `<Combobox.Root>` draws no element. Generic: `<Value = unknown>`. Holds the combobox: its value, what is typed and whether the list is open. Its props are above.
|
|
922
|
+
- `<Combobox.Input>` draws a `<input>`.
|
|
923
|
+
- `<Combobox.Trigger>` draws a `<button>`.
|
|
924
|
+
- `<Combobox.Clear>` draws a `<button>`.
|
|
925
|
+
- `keepMounted?: boolean`: Keeps the button in the page while there is nothing to clear.
|
|
926
|
+
- `<Combobox.Chips>` draws a `<div>`. With several values: what holds the chips and the input, and what the list is placed against.
|
|
927
|
+
- `<Combobox.Chip>` draws a `<span>`. One chosen value.
|
|
928
|
+
- `value: unknown`: Required. The chosen value it stands for: what its remove button takes away.
|
|
929
|
+
- `<Combobox.ChipRemove>` draws a `<button>`.
|
|
930
|
+
- `<Combobox.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
931
|
+
- `<Combobox.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
932
|
+
- `<Combobox.Popup>` draws a `<div>`.
|
|
933
|
+
- `<Combobox.List>` draws a `<div>`.
|
|
934
|
+
- `<Combobox.Group>` draws a `<div>`. Items that belong together, named by their label. Hidden while none is shown.
|
|
935
|
+
- `<Combobox.GroupLabel>` draws a `<div>`. The name of a group. Outside a group it is plain text, and names nothing.
|
|
936
|
+
- `<Combobox.Separator>` draws a `<div>`. A line between groups.
|
|
937
|
+
- `<Combobox.Item>` draws a `<div>`.
|
|
938
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
939
|
+
- `label?: string`: What is filtered and what the input shows; the item's text when left out.
|
|
940
|
+
- `index?: number`: Its place among all the rows, in a virtualized list.
|
|
941
|
+
- `value: unknown`: Required. What the combobox's value is while this item is the chosen one.
|
|
942
|
+
- `<Combobox.ItemIndicator>` draws a `<span>`. A mark an item shows while it is the chosen one.
|
|
943
|
+
- `keepMounted?: boolean`: Keeps the mark in the page while its item is not chosen.
|
|
944
|
+
- `<Combobox.Empty>` draws a `<div>`. What is shown when no item is.
|
|
373
945
|
|
|
374
946
|
Attributes and CSS variables, by part:
|
|
375
947
|
|
|
376
|
-
- input: The text input. What is typed filters the list, which is placed against it.
|
|
948
|
+
- input: The text input. What is typed filters the list, which is placed against it, or against the chips' box when it is in one. Inside the popup, it takes focus while the popup is open.
|
|
377
949
|
- `data-popup-open`: Present when the list is open.
|
|
378
950
|
- `data-disabled`: Present when it is disabled.
|
|
379
|
-
- trigger: A button that opens and closes the list.
|
|
951
|
+
- trigger: A button that opens and closes the list. With the input inside the popup it is the combobox: a stop for Tab, and what the popup is placed against.
|
|
380
952
|
- `data-popup-open`: Present when the list is open.
|
|
381
953
|
- `data-disabled`: Present when it is disabled.
|
|
382
|
-
- positioner: Places the list against the input
|
|
954
|
+
- positioner: Places the list against the input: against the chips' box when the input is in one, the button when the input is inside the popup, or its own `anchor`. It carries the geometry.
|
|
383
955
|
- `data-open`: Present when it is open.
|
|
384
956
|
- `data-closed`: Present when it is closed.
|
|
385
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
957
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
386
958
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
387
959
|
- `--anchor-width`: The anchor's width.
|
|
388
960
|
- `--anchor-height`: The anchor's height.
|
|
389
961
|
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
390
962
|
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
391
963
|
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
392
|
-
- popup: The list of items.
|
|
964
|
+
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
|
|
393
965
|
- `data-open`: Present when it is open.
|
|
394
966
|
- `data-closed`: Present when it is closed.
|
|
395
967
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
396
968
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
397
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
969
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
398
970
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
399
971
|
- `data-empty`: Present when no item is shown for what was typed.
|
|
972
|
+
- list: The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
973
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
400
974
|
- item: One choice in the list.
|
|
401
975
|
- `data-selected`: Present on the chosen item.
|
|
402
976
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
@@ -414,15 +988,44 @@ import { Command } from "@kirana-ui/vue/command"
|
|
|
414
988
|
|
|
415
989
|
Parts: `<Command.Root>`, `<Command.Input>`, `<Command.List>`, `<Command.Empty>`, `<Command.Group>`, `<Command.GroupHeading>`, `<Command.Item>`, `<Command.Separator>`.
|
|
416
990
|
|
|
991
|
+
Anatomy:
|
|
992
|
+
|
|
993
|
+
```
|
|
994
|
+
<Command.Root>
|
|
995
|
+
<Command.Input>
|
|
996
|
+
<Command.List>
|
|
997
|
+
<Command.Empty>
|
|
998
|
+
<Command.Group> (optional, repeated)
|
|
999
|
+
<Command.GroupHeading>
|
|
1000
|
+
<Command.Item> (repeated)
|
|
1001
|
+
<Command.Separator> (repeated)
|
|
1002
|
+
```
|
|
1003
|
+
|
|
417
1004
|
Props of its root:
|
|
418
1005
|
|
|
419
|
-
- `inputValue?: string`: What the input says.
|
|
420
|
-
- `defaultInputValue?: string`
|
|
421
|
-
- `onInputValueChange?: ((value: string, details: ChangeDetails) => void)`
|
|
422
|
-
- `onSelect?: ((value: string, details: ChangeDetails) => void)`: An item was chosen: pressed, or Enter while it was highlighted.
|
|
1006
|
+
- `inputValue?: string`: `v-model:inputValue`. What the input says.
|
|
1007
|
+
- `defaultInputValue?: string`: The text the input starts with, when the caller does not hold `inputValue`. Read once.
|
|
423
1008
|
- `filter?: ((label: string, query: string, keywords: readonly string[]) => boolean) | null`: Whether an item is shown for what was typed. Default: its label or one of its keywords holds the text, without regard to case. `null`: every item is shown, and the caller draws the ones it wants.
|
|
424
1009
|
- `loop?: boolean`: Whether a step past an end of the list goes round to the other.
|
|
425
|
-
- `disabled?: boolean
|
|
1010
|
+
- `disabled?: boolean`: Disabled: nothing can be typed or chosen.
|
|
1011
|
+
- `@input-value-change: (value: string, details: ChangeDetails) => void`: Heard as the input's text is about to change: `details.cancel()` keeps it as it was.
|
|
1012
|
+
- `@select: (value: string, details: ChangeDetails) => void`: An item was chosen: its value.
|
|
1013
|
+
|
|
1014
|
+
Each part, and its own props:
|
|
1015
|
+
|
|
1016
|
+
- `<Command.Root>` draws a `<div>`. Its props are above.
|
|
1017
|
+
- `<Command.Input>` draws a `<input>`.
|
|
1018
|
+
- `<Command.List>` draws a `<div>`.
|
|
1019
|
+
- `<Command.Empty>` draws a `<div>`. What is shown when no item is.
|
|
1020
|
+
- `<Command.Group>` draws a `<div>`. Items under a heading. Hidden while none of them is shown.
|
|
1021
|
+
- `<Command.GroupHeading>` draws a `<div>`. A group's name.
|
|
1022
|
+
- `<Command.Item>` draws a `<div>`.
|
|
1023
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
1024
|
+
- `label?: string`: What is filtered; the item's text when left out.
|
|
1025
|
+
- `keywords?: readonly string[]`: Other words the item answers to.
|
|
1026
|
+
- `value: string`: Required. What `@select` is told when this item is chosen.
|
|
1027
|
+
- `<Command.Separator>` draws a `<div>`. A line between groups. Hidden while something is typed.
|
|
1028
|
+
- `alwaysRender?: boolean`: Keeps the line while something is typed.
|
|
426
1029
|
|
|
427
1030
|
Attributes and CSS variables, by part:
|
|
428
1031
|
|
|
@@ -444,14 +1047,87 @@ import { ContextMenu } from "@kirana-ui/vue/context-menu"
|
|
|
444
1047
|
|
|
445
1048
|
Parts: `<ContextMenu.Root>`, `<ContextMenu.Trigger>`, `<ContextMenu.Portal>`, `<ContextMenu.Positioner>`, `<ContextMenu.Popup>`, `<ContextMenu.Arrow>`, `<ContextMenu.Item>`, `<ContextMenu.LinkItem>`, `<ContextMenu.Group>`, `<ContextMenu.GroupLabel>`, `<ContextMenu.Separator>`, `<ContextMenu.CheckboxItem>`, `<ContextMenu.CheckboxItemIndicator>`, `<ContextMenu.RadioGroup>`, `<ContextMenu.RadioItem>`, `<ContextMenu.RadioItemIndicator>`, `<ContextMenu.SubmenuRoot>`, `<ContextMenu.SubmenuTrigger>`.
|
|
446
1049
|
|
|
1050
|
+
Anatomy:
|
|
1051
|
+
|
|
1052
|
+
```
|
|
1053
|
+
<ContextMenu.Root>
|
|
1054
|
+
<ContextMenu.Trigger>
|
|
1055
|
+
<ContextMenu.Portal>
|
|
1056
|
+
<ContextMenu.Positioner>
|
|
1057
|
+
<ContextMenu.Popup>
|
|
1058
|
+
<ContextMenu.Arrow>
|
|
1059
|
+
<ContextMenu.Group> (optional, repeated)
|
|
1060
|
+
<ContextMenu.Item> (repeated)
|
|
1061
|
+
<ContextMenu.LinkItem> (repeated)
|
|
1062
|
+
<ContextMenu.GroupLabel>
|
|
1063
|
+
<ContextMenu.CheckboxItem> (repeated)
|
|
1064
|
+
<ContextMenu.CheckboxItemIndicator>
|
|
1065
|
+
<ContextMenu.RadioGroup> (repeated)
|
|
1066
|
+
<ContextMenu.RadioItem> (repeated)
|
|
1067
|
+
<ContextMenu.RadioItemIndicator>
|
|
1068
|
+
<ContextMenu.SubmenuRoot> (repeated)
|
|
1069
|
+
<ContextMenu.Portal> (as above)
|
|
1070
|
+
<ContextMenu.SubmenuTrigger>
|
|
1071
|
+
<ContextMenu.Separator> (repeated)
|
|
1072
|
+
```
|
|
1073
|
+
|
|
447
1074
|
Props of its root:
|
|
448
1075
|
|
|
449
|
-
- `open?: boolean`
|
|
450
|
-
- `defaultOpen?: boolean`
|
|
451
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1076
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1077
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
452
1078
|
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
453
1079
|
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
454
1080
|
- `modal?: boolean`: Holds the page while the menu is open: its scroll is locked, and a press outside closes the menu and reaches nothing. Default: it does not. Not for a submenu.
|
|
1081
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1082
|
+
|
|
1083
|
+
Each part, and its own props:
|
|
1084
|
+
|
|
1085
|
+
- `<ContextMenu.Root>` draws no element. Holds the menu: whether it is open. Its props are above.
|
|
1086
|
+
- `<ContextMenu.Trigger>` draws a `<div>`.
|
|
1087
|
+
- `<ContextMenu.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
1088
|
+
- `<ContextMenu.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
1089
|
+
- `<ContextMenu.Popup>` draws a `<div>`.
|
|
1090
|
+
- `<ContextMenu.Arrow>` draws a `<div>`.
|
|
1091
|
+
- `<ContextMenu.Item>` draws a `<div>`.
|
|
1092
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1093
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1094
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1095
|
+
- `<ContextMenu.LinkItem>` draws a `<a>`.
|
|
1096
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1097
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1098
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1099
|
+
- `<ContextMenu.Group>` draws a `<div>`. Items that belong together, named by their label.
|
|
1100
|
+
- `<ContextMenu.GroupLabel>` draws a `<div>`. The name of a group. Outside a group it is plain text, and names nothing.
|
|
1101
|
+
- `<ContextMenu.Separator>` draws a `<div>`. A line between items.
|
|
1102
|
+
- `<ContextMenu.CheckboxItem>` draws a `<div>`.
|
|
1103
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1104
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1105
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1106
|
+
- `checked?: boolean`: `v-model:checked`. Whether the item is checked, when the caller holds it.
|
|
1107
|
+
- `defaultChecked?: boolean`: Whether the item starts checked, when the caller does not hold `checked`. Read once.
|
|
1108
|
+
- `@checked-change: (value: boolean, details: ChangeDetails) => void`: Heard as the item is about to be checked or unchecked: `details.cancel()` keeps it as it was.
|
|
1109
|
+
- `<ContextMenu.CheckboxItemIndicator>` draws a `<span>`.
|
|
1110
|
+
- `keepMounted?: boolean`: Keeps the mark in the page while the item is unchecked.
|
|
1111
|
+
- `<ContextMenu.RadioGroup>` draws a `<div>`. Generic: `<Value = unknown>`.
|
|
1112
|
+
- `value?: Value | null`: `v-model:value`. The chosen value; `null` is "none".
|
|
1113
|
+
- `defaultValue?: Value | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
1114
|
+
- `disabled?: boolean`: Disables every item of the group.
|
|
1115
|
+
- `@value-change: (value: Value, details: ChangeDetails) => void`: Told an item's own value, never `null`: a press chooses, and nothing takes the choice back.
|
|
1116
|
+
- `<ContextMenu.RadioItem>` draws a `<div>`.
|
|
1117
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1118
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1119
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1120
|
+
- `value: unknown`: Required. What the group's value is while this item is the chosen one.
|
|
1121
|
+
- `<ContextMenu.RadioItemIndicator>` draws a `<span>`.
|
|
1122
|
+
- `keepMounted?: boolean`: Keeps the mark in the page while its item is not the chosen one.
|
|
1123
|
+
- `<ContextMenu.SubmenuRoot>` draws no element. A submenu: it holds the item that opens it and a portal, positioner and popup of its own.
|
|
1124
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1125
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1126
|
+
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
1127
|
+
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
1128
|
+
- `modal?: boolean`: Holds the page while the menu is open: its scroll is locked, and a press outside closes the menu and reaches nothing. Default: it does not. Not for a submenu.
|
|
1129
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1130
|
+
- `<ContextMenu.SubmenuTrigger>` draws a `<div>`.
|
|
455
1131
|
|
|
456
1132
|
Attributes and CSS variables, by part:
|
|
457
1133
|
|
|
@@ -460,7 +1136,7 @@ Attributes and CSS variables, by part:
|
|
|
460
1136
|
- positioner: Places the menu against its trigger. It carries the geometry.
|
|
461
1137
|
- `data-open`: Present when it is open.
|
|
462
1138
|
- `data-closed`: Present when it is closed.
|
|
463
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1139
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
464
1140
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
465
1141
|
- `--anchor-width`: The anchor's width.
|
|
466
1142
|
- `--anchor-height`: The anchor's height.
|
|
@@ -472,10 +1148,10 @@ Attributes and CSS variables, by part:
|
|
|
472
1148
|
- `data-closed`: Present when it is closed.
|
|
473
1149
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
474
1150
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
475
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1151
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
476
1152
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
477
1153
|
- arrow: An element that points at the trigger.
|
|
478
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1154
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
479
1155
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
480
1156
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
481
1157
|
- item: An action. Choosing it closes the menu.
|
|
@@ -515,20 +1191,37 @@ import { DateField } from "@kirana-ui/vue/date-field"
|
|
|
515
1191
|
|
|
516
1192
|
Parts: `<DateField.Root>`, `<DateField.Segments>`, `<DateField.Segment>`, `<DateField.Input>`.
|
|
517
1193
|
|
|
1194
|
+
Anatomy:
|
|
1195
|
+
|
|
1196
|
+
```
|
|
1197
|
+
<DateField.Root>
|
|
1198
|
+
<DateField.Segments>
|
|
1199
|
+
<DateField.Segment> (repeated)
|
|
1200
|
+
<DateField.Input>
|
|
1201
|
+
```
|
|
1202
|
+
|
|
518
1203
|
Props of its root:
|
|
519
1204
|
|
|
520
|
-
- `value?: IsoDate | null`: The day typed, once all of it is; `null` until then.
|
|
521
|
-
- `defaultValue?: IsoDate | null`
|
|
522
|
-
- `onValueChange?: ((value: IsoDate | null, details: ChangeDetails) => void)`
|
|
1205
|
+
- `value?: IsoDate | null`: `v-model:value`. The day typed, once all of it is; `null` until then.
|
|
1206
|
+
- `defaultValue?: IsoDate | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
523
1207
|
- `locale?: string`: The language and region that order the day, the month and the year and put what stands between them (`"en-US"`: month/day/year). Give it: a server does not know the reader's.
|
|
524
1208
|
- `min?: IsoDate`: The first and the last day it takes: outside them it says it is invalid.
|
|
525
|
-
- `max?: IsoDate
|
|
1209
|
+
- `max?: IsoDate`: The last day it takes.
|
|
526
1210
|
- `placeholders?: Partial<Record<DateUnit, string>>`: What an empty part shows. Default: `dd`, `mm`, `yyyy`.
|
|
527
|
-
- `disabled?: boolean
|
|
528
|
-
- `readOnly?: boolean
|
|
529
|
-
- `required?: boolean`
|
|
1211
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1212
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
1213
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
530
1214
|
- `name?: string`: The name it is submitted under, by its hidden input.
|
|
531
1215
|
- `form?: string`: The id of the form it belongs to, when it is not inside it.
|
|
1216
|
+
- `@value-change: (value: string | null, details: ChangeDetails) => void`: Heard as the day is about to change, once all of it is typed or as it is cleared: `details.cancel()` keeps the value as it was.
|
|
1217
|
+
|
|
1218
|
+
Each part, and its own props:
|
|
1219
|
+
|
|
1220
|
+
- `<DateField.Root>` draws a `<div>`. Its props are above.
|
|
1221
|
+
- `<DateField.Segments>` draws no element. The date's segments, in the locale's order: each is given to draw. Its default slot is also given `segment: DateFieldSegment`.
|
|
1222
|
+
- `<DateField.Segment>` draws a `<span>`.
|
|
1223
|
+
- `segment: DateFieldSegment`: Required. The piece it draws, as `DateField.Segments` gives it.
|
|
1224
|
+
- `<DateField.Input>` draws a `<input>`. The hidden input it is submitted by.
|
|
532
1225
|
|
|
533
1226
|
Attributes and CSS variables, by part:
|
|
534
1227
|
|
|
@@ -550,26 +1243,76 @@ import { DatePicker } from "@kirana-ui/vue/date-picker"
|
|
|
550
1243
|
|
|
551
1244
|
Parts: `<DatePicker.Root>`, `<DatePicker.Field>`, `<DatePicker.Segments>`, `<DatePicker.Segment>`, `<DatePicker.Input>`, `<DatePicker.Trigger>`, `<DatePicker.Portal>`, `<DatePicker.Positioner>`, `<DatePicker.Popup>`, `<DatePicker.Calendar>`, `<DatePicker.Heading>`, `<DatePicker.Previous>`, `<DatePicker.Next>`, `<DatePicker.Grid>`, `<DatePicker.Weekdays>`, `<DatePicker.HeadCell>`, `<DatePicker.Weeks>`, `<DatePicker.Cell>`, `<DatePicker.Day>`.
|
|
552
1245
|
|
|
1246
|
+
Anatomy:
|
|
1247
|
+
|
|
1248
|
+
```
|
|
1249
|
+
<DatePicker.Root>
|
|
1250
|
+
<DatePicker.Field>
|
|
1251
|
+
<DatePicker.Segments>
|
|
1252
|
+
<DatePicker.Segment> (repeated)
|
|
1253
|
+
<DatePicker.Input>
|
|
1254
|
+
<DatePicker.Trigger>
|
|
1255
|
+
<DatePicker.Portal>
|
|
1256
|
+
<DatePicker.Positioner>
|
|
1257
|
+
<DatePicker.Popup>
|
|
1258
|
+
<DatePicker.Calendar>
|
|
1259
|
+
<DatePicker.Heading>
|
|
1260
|
+
<DatePicker.Previous>
|
|
1261
|
+
<DatePicker.Next>
|
|
1262
|
+
<DatePicker.Grid>
|
|
1263
|
+
<DatePicker.Weekdays>
|
|
1264
|
+
<DatePicker.HeadCell> (repeated)
|
|
1265
|
+
<DatePicker.Weeks>
|
|
1266
|
+
<DatePicker.Cell> (repeated)
|
|
1267
|
+
<DatePicker.Day>
|
|
1268
|
+
```
|
|
1269
|
+
|
|
553
1270
|
Props of its root:
|
|
554
1271
|
|
|
555
|
-
- `value?: IsoDate | null`: The day, typed or picked; `null` for none.
|
|
556
|
-
- `defaultValue?: IsoDate | null`
|
|
557
|
-
- `
|
|
558
|
-
- `
|
|
559
|
-
- `defaultOpen?: boolean`
|
|
560
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1272
|
+
- `value?: IsoDate | null`: `v-model:value`. The day, typed or picked; `null` for none.
|
|
1273
|
+
- `defaultValue?: IsoDate | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
1274
|
+
- `open?: boolean`: `v-model:open`. Whether the calendar is open, when the caller holds it.
|
|
1275
|
+
- `defaultOpen?: boolean`: Whether the calendar starts open, when the caller does not hold `open`. Read once.
|
|
561
1276
|
- `locale?: string`: The language and region of the field and the calendar. Give it: a server does not know.
|
|
562
1277
|
- `min?: IsoDate`: The first and the last day that can be typed or picked.
|
|
563
|
-
- `max?: IsoDate
|
|
564
|
-
- `isDateUnavailable?:
|
|
565
|
-
- `calendarSystem?:
|
|
1278
|
+
- `max?: IsoDate`: The last day that can be typed or picked.
|
|
1279
|
+
- `isDateUnavailable?: (date: IsoDate) => boolean`: Days that cannot be picked in the calendar.
|
|
1280
|
+
- `calendarSystem?: CalendarSystem`: The calendar its months are laid out in, when it is not the Gregorian one.
|
|
566
1281
|
- `fixedWeeks?: boolean`: Always six rows of days.
|
|
567
|
-
- `placeholders?:
|
|
568
|
-
- `disabled?: boolean
|
|
569
|
-
- `readOnly?: boolean
|
|
570
|
-
- `required?: boolean`
|
|
1282
|
+
- `placeholders?: Partial<Record<DateUnit, string>>`: What an empty part of the field shows.
|
|
1283
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1284
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
1285
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
571
1286
|
- `name?: string`: The name it is submitted under.
|
|
572
1287
|
- `form?: string`: The id of the form it belongs to, when it is not inside it.
|
|
1288
|
+
- `@value-change: (value: string | null, details: ChangeDetails) => void`: Heard as the day is about to change, typed or picked: `details.cancel()` keeps the value as it was.
|
|
1289
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as the calendar is about to open or close: `details.cancel()` keeps it as it was.
|
|
1290
|
+
|
|
1291
|
+
Each part, and its own props:
|
|
1292
|
+
|
|
1293
|
+
- `<DatePicker.Root>` draws no element. Holds the date picker: its value, the month shown and whether the calendar is open. Its props are above.
|
|
1294
|
+
- `<DatePicker.Field>` draws a `<div>`.
|
|
1295
|
+
- `<DatePicker.Segments>` draws no element. The date's segments, in the locale's order: each is given to draw. Its default slot is also given `segment: DateFieldSegment`.
|
|
1296
|
+
- `<DatePicker.Segment>` draws a `<span>`.
|
|
1297
|
+
- `segment: DateFieldSegment`: Required. The piece it draws, as `DateField.Segments` gives it.
|
|
1298
|
+
- `<DatePicker.Input>` draws a `<input>`. The hidden input it is submitted by.
|
|
1299
|
+
- `<DatePicker.Trigger>` draws a `<button>`.
|
|
1300
|
+
- `<DatePicker.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
1301
|
+
- `<DatePicker.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
1302
|
+
- `<DatePicker.Popup>` draws a `<div>`.
|
|
1303
|
+
- `<DatePicker.Calendar>` draws a `<div>`.
|
|
1304
|
+
- `<DatePicker.Heading>` draws a `<div>`. Names the month shown. Read out when it changes.
|
|
1305
|
+
- `<DatePicker.Previous>` draws a `<button>`.
|
|
1306
|
+
- `<DatePicker.Next>` draws a `<button>`.
|
|
1307
|
+
- `<DatePicker.Grid>` draws a `<table>`. The table of days: a grid the arrows move in.
|
|
1308
|
+
- `<DatePicker.Weekdays>` draws no element. The days of the week: each is given to draw its head cell. Its default slot is also given `weekday: CalendarWeekday`.
|
|
1309
|
+
- `<DatePicker.HeadCell>` draws a `<th>`. A column's heading: a day of the week.
|
|
1310
|
+
- `weekday: CalendarWeekday`: Required. The day of the week it names, as `Calendar.Weekdays` gives it.
|
|
1311
|
+
- `<DatePicker.Weeks>` draws no element. The weeks of the month shown: each is given to draw its row of days. Its default slot is also given `week: readonly CalendarDay[]`.
|
|
1312
|
+
- `<DatePicker.Cell>` draws a `<td>`.
|
|
1313
|
+
- `date: string`: Required. The day it is for, as a week of `Calendar.Weeks` gives it.
|
|
1314
|
+
- `<DatePicker.Day>` draws a `<button>`.
|
|
1315
|
+
- `date: string`: Required. The day it is for, as a week of `Calendar.Weeks` gives it.
|
|
573
1316
|
|
|
574
1317
|
Attributes and CSS variables, by part:
|
|
575
1318
|
|
|
@@ -587,7 +1330,7 @@ Attributes and CSS variables, by part:
|
|
|
587
1330
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
588
1331
|
- `data-open`: Present when it is open.
|
|
589
1332
|
- `data-closed`: Present when it is closed.
|
|
590
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1333
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
591
1334
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
592
1335
|
- `--anchor-width`: The anchor's width.
|
|
593
1336
|
- `--anchor-height`: The anchor's height.
|
|
@@ -599,7 +1342,7 @@ Attributes and CSS variables, by part:
|
|
|
599
1342
|
- `data-closed`: Present when it is closed.
|
|
600
1343
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
601
1344
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
602
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1345
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
603
1346
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
604
1347
|
- calendar: The calendar.
|
|
605
1348
|
- `data-disabled`: Present when it is disabled.
|
|
@@ -633,13 +1376,37 @@ import { Dialog } from "@kirana-ui/vue/dialog"
|
|
|
633
1376
|
|
|
634
1377
|
Parts: `<Dialog.Root>`, `<Dialog.Trigger>`, `<Dialog.Portal>`, `<Dialog.Backdrop>`, `<Dialog.Popup>`, `<Dialog.Title>`, `<Dialog.Description>`, `<Dialog.Close>`.
|
|
635
1378
|
|
|
1379
|
+
Anatomy:
|
|
1380
|
+
|
|
1381
|
+
```
|
|
1382
|
+
<Dialog.Root>
|
|
1383
|
+
<Dialog.Trigger>
|
|
1384
|
+
<Dialog.Portal>
|
|
1385
|
+
<Dialog.Backdrop>
|
|
1386
|
+
<Dialog.Popup>
|
|
1387
|
+
<Dialog.Title>
|
|
1388
|
+
<Dialog.Description>
|
|
1389
|
+
<Dialog.Close>
|
|
1390
|
+
```
|
|
1391
|
+
|
|
636
1392
|
Props of its root:
|
|
637
1393
|
|
|
638
|
-
- `open?: boolean`
|
|
639
|
-
- `defaultOpen?: boolean`
|
|
640
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1394
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1395
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
641
1396
|
- `modal?: boolean`: Blocks the page behind it and traps focus. Default `true`.
|
|
642
1397
|
- `dismissible?: boolean`: Whether a press outside closes it. Default `true`.
|
|
1398
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1399
|
+
|
|
1400
|
+
Each part, and its own props:
|
|
1401
|
+
|
|
1402
|
+
- `<Dialog.Root>` draws no element. Holds the dialog: whether it is open. Its props are above.
|
|
1403
|
+
- `<Dialog.Trigger>` draws a `<button>`.
|
|
1404
|
+
- `<Dialog.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
1405
|
+
- `<Dialog.Backdrop>` draws a `<div>`.
|
|
1406
|
+
- `<Dialog.Popup>` draws a `<div>`.
|
|
1407
|
+
- `<Dialog.Title>` draws a `<h2>`. The heading that names the dialog.
|
|
1408
|
+
- `<Dialog.Description>` draws a `<p>`. The text that describes the dialog.
|
|
1409
|
+
- `<Dialog.Close>` draws a `<button>`. A button that closes the dialog.
|
|
643
1410
|
|
|
644
1411
|
Attributes and CSS variables, by part:
|
|
645
1412
|
|
|
@@ -658,12 +1425,6 @@ Attributes and CSS variables, by part:
|
|
|
658
1425
|
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
659
1426
|
- `--nested-dialogs`: How many dialogs are open above this one.
|
|
660
1427
|
|
|
661
|
-
### DirectionProvider
|
|
662
|
-
|
|
663
|
-
```
|
|
664
|
-
import { DirectionProvider } from "@kirana-ui/vue/direction-provider"
|
|
665
|
-
```
|
|
666
|
-
|
|
667
1428
|
### Drawer
|
|
668
1429
|
|
|
669
1430
|
```
|
|
@@ -672,18 +1433,42 @@ import { Drawer } from "@kirana-ui/vue/drawer"
|
|
|
672
1433
|
|
|
673
1434
|
Parts: `<Drawer.Root>`, `<Drawer.Trigger>`, `<Drawer.Portal>`, `<Drawer.Backdrop>`, `<Drawer.Popup>`, `<Drawer.Title>`, `<Drawer.Description>`, `<Drawer.Close>`.
|
|
674
1435
|
|
|
1436
|
+
Anatomy:
|
|
1437
|
+
|
|
1438
|
+
```
|
|
1439
|
+
<Drawer.Root>
|
|
1440
|
+
<Drawer.Trigger>
|
|
1441
|
+
<Drawer.Portal>
|
|
1442
|
+
<Drawer.Backdrop>
|
|
1443
|
+
<Drawer.Popup>
|
|
1444
|
+
<Drawer.Title>
|
|
1445
|
+
<Drawer.Description>
|
|
1446
|
+
<Drawer.Close>
|
|
1447
|
+
```
|
|
1448
|
+
|
|
675
1449
|
Props of its root:
|
|
676
1450
|
|
|
677
|
-
- `open?: boolean`
|
|
678
|
-
- `defaultOpen?: boolean`
|
|
679
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1451
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1452
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
680
1453
|
- `modal?: boolean`: Blocks the page behind it and traps focus. Default `true`.
|
|
681
1454
|
- `dismissible?: boolean`: Whether a press outside closes it. Default `true`.
|
|
682
1455
|
- `swipeDirection?: DrawerSide`: The way it is dragged to close it: the edge it came from. Default: `"down"`.
|
|
683
1456
|
- `snapPoints?: readonly DrawerSnapPoint[]`: Places it rests at, each how much of itself shows: a share (`0.4`, or `"40%"`) or a length (`"148px"`, `"20rem"`). `[0.4, 1]` is a drawer that opens two fifths shown and is dragged up to the whole. Without any, it is whole.
|
|
684
|
-
- `snapPoint?: DrawerSnapPoint`: Which of them it rests at, as it was given.
|
|
1457
|
+
- `snapPoint?: DrawerSnapPoint`: `v-model:snapPoint`. Which of them it rests at, as it was given.
|
|
685
1458
|
- `defaultSnapPoint?: DrawerSnapPoint`: Where it opens. Default: the smallest.
|
|
686
|
-
-
|
|
1459
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1460
|
+
- `@snap-point-change: (value: DrawerSnapPoint, details: ChangeDetails) => void`: Heard as it is about to rest at another snap point: `details.cancel()` keeps it where it was.
|
|
1461
|
+
|
|
1462
|
+
Each part, and its own props:
|
|
1463
|
+
|
|
1464
|
+
- `<Drawer.Root>` draws no element. Holds the dialog: whether it is open. Its props are above.
|
|
1465
|
+
- `<Drawer.Trigger>` draws a `<button>`.
|
|
1466
|
+
- `<Drawer.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
1467
|
+
- `<Drawer.Backdrop>` draws a `<div>`.
|
|
1468
|
+
- `<Drawer.Popup>` draws a `<div>`.
|
|
1469
|
+
- `<Drawer.Title>` draws a `<h2>`. The heading that names the dialog.
|
|
1470
|
+
- `<Drawer.Description>` draws a `<p>`. The text that describes the dialog.
|
|
1471
|
+
- `<Drawer.Close>` draws a `<button>`. A button that closes the dialog.
|
|
687
1472
|
|
|
688
1473
|
Attributes and CSS variables, by part:
|
|
689
1474
|
|
|
@@ -730,15 +1515,36 @@ import { Field } from "@kirana-ui/vue/field"
|
|
|
730
1515
|
|
|
731
1516
|
Parts: `<Field.Root>`, `<Field.Label>`, `<Field.Control>`, `<Field.Description>`, `<Field.Error>`, `<Field.Validity>`.
|
|
732
1517
|
|
|
1518
|
+
Anatomy:
|
|
1519
|
+
|
|
1520
|
+
```
|
|
1521
|
+
<Field.Root>
|
|
1522
|
+
<Field.Label>
|
|
1523
|
+
<Field.Control>
|
|
1524
|
+
<Field.Description>
|
|
1525
|
+
<Field.Error>
|
|
1526
|
+
<Field.Validity>
|
|
1527
|
+
```
|
|
1528
|
+
|
|
733
1529
|
Props of its root:
|
|
734
1530
|
|
|
735
1531
|
- `name?: string`: The control's name in the form.
|
|
736
|
-
- `disabled?: boolean`
|
|
1532
|
+
- `disabled?: boolean`: Disables the field: its control cannot be changed, and its parts say so (`data-disabled`).
|
|
737
1533
|
- `invalid?: boolean`: Invalid whatever the value: an error known from elsewhere.
|
|
738
|
-
- `validate?:
|
|
1534
|
+
- `validate?: ( value: string ) => string | readonly string[] | null | Promise<string | readonly string[] | null>`: The field's own check, after the browser's: a message or several when the value is wrong, `null` when it is right. It may answer later, with a promise.
|
|
739
1535
|
- `validationMode?: ValidationMode`: When the value is checked; the form's by default, else `"onSubmit"`.
|
|
740
1536
|
- `validationDebounceTime?: number`: With `"onChange"`, how long the value must rest before it is checked, in milliseconds.
|
|
741
1537
|
|
|
1538
|
+
Each part, and its own props:
|
|
1539
|
+
|
|
1540
|
+
- `<Field.Root>` draws a `<div>`. Its props are above.
|
|
1541
|
+
- `<Field.Label>` draws a `<label>`.
|
|
1542
|
+
- `<Field.Control>` draws a `<input>`.
|
|
1543
|
+
- `<Field.Description>` draws a `<p>`.
|
|
1544
|
+
- `<Field.Error>` draws a `<div>`.
|
|
1545
|
+
- `match?: ValidityKey | boolean`: One of the browser's findings (`"valueMissing"`) to show for only that; `true` to show always.
|
|
1546
|
+
- `<Field.Validity>` draws no element. Gives the control's validity to what it holds, to draw from. Its default slot is also given `validity: FieldValidity`.
|
|
1547
|
+
|
|
742
1548
|
Attributes and CSS variables, by part:
|
|
743
1549
|
|
|
744
1550
|
- root: A control with its label, its description and its errors.
|
|
@@ -792,10 +1598,22 @@ import { Fieldset } from "@kirana-ui/vue/fieldset"
|
|
|
792
1598
|
|
|
793
1599
|
Parts: `<Fieldset.Root>`, `<Fieldset.Legend>`.
|
|
794
1600
|
|
|
1601
|
+
Anatomy:
|
|
1602
|
+
|
|
1603
|
+
```
|
|
1604
|
+
<Fieldset.Root>
|
|
1605
|
+
<Fieldset.Legend>
|
|
1606
|
+
```
|
|
1607
|
+
|
|
795
1608
|
Props of its root:
|
|
796
1609
|
|
|
797
1610
|
- `disabled?: boolean`: Disables every field inside.
|
|
798
1611
|
|
|
1612
|
+
Each part, and its own props:
|
|
1613
|
+
|
|
1614
|
+
- `<Fieldset.Root>` draws a `<fieldset>`. Its props are above.
|
|
1615
|
+
- `<Fieldset.Legend>` draws a `<div>`.
|
|
1616
|
+
|
|
799
1617
|
Attributes and CSS variables, by part:
|
|
800
1618
|
|
|
801
1619
|
- root: The group of fields.
|
|
@@ -812,10 +1630,12 @@ import { Form } from "@kirana-ui/vue/form"
|
|
|
812
1630
|
Props:
|
|
813
1631
|
|
|
814
1632
|
- `errors?: FormErrors`: Errors from outside the page (a server's), by field name. A field shows its own until its value changes.
|
|
815
|
-
- `onClearErrors?: (
|
|
816
|
-
- `onFormSubmit?: (
|
|
1633
|
+
- `onClearErrors?: (errors: FormErrors) => void`: A field's value changed while it showed an error from `errors`: what is left of them.
|
|
1634
|
+
- `onFormSubmit?: (values: FormValues, details: ChangeDetails) => void`: Every field is valid. Given this, the page is not left: the values come as an object. Without it, the form submits as a form does.
|
|
817
1635
|
- `validationMode?: ValidationMode`: When the form's fields check their values, unless a field says otherwise. Default `"onSubmit"`.
|
|
818
1636
|
|
|
1637
|
+
`<Form>` draws a `<form>`. `onFormSubmit` and `onClearErrors` are heard as `@form-submit` and `@clear-errors`.
|
|
1638
|
+
|
|
819
1639
|
### HoverCard
|
|
820
1640
|
|
|
821
1641
|
```
|
|
@@ -824,14 +1644,36 @@ import { HoverCard } from "@kirana-ui/vue/hover-card"
|
|
|
824
1644
|
|
|
825
1645
|
Parts: `<HoverCard.Root>`, `<HoverCard.Trigger>`, `<HoverCard.Portal>`, `<HoverCard.Positioner>`, `<HoverCard.Popup>`, `<HoverCard.Arrow>`.
|
|
826
1646
|
|
|
1647
|
+
Anatomy:
|
|
1648
|
+
|
|
1649
|
+
```
|
|
1650
|
+
<HoverCard.Root>
|
|
1651
|
+
<HoverCard.Trigger>
|
|
1652
|
+
<HoverCard.Portal>
|
|
1653
|
+
<HoverCard.Positioner>
|
|
1654
|
+
<HoverCard.Popup>
|
|
1655
|
+
<HoverCard.Arrow>
|
|
1656
|
+
```
|
|
1657
|
+
|
|
827
1658
|
Props of its root:
|
|
828
1659
|
|
|
829
|
-
- `open?: boolean`
|
|
830
|
-
- `defaultOpen?: boolean`
|
|
831
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1660
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1661
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
832
1662
|
- `delay?: number`: How long the pointer rests on the trigger before the popup opens, in milliseconds.
|
|
833
1663
|
- `closeDelay?: number`: How long after the pointer leaves the popup closes, in milliseconds.
|
|
834
|
-
- `disabled?: boolean
|
|
1664
|
+
- `disabled?: boolean`: Disabled: the pointer and focus do not open it.
|
|
1665
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1666
|
+
|
|
1667
|
+
Each part, and its own props:
|
|
1668
|
+
|
|
1669
|
+
- `<HoverCard.Root>` draws no element. Holds the card: whether it is open. Its props are above.
|
|
1670
|
+
- `<HoverCard.Trigger>` draws a `<a>`.
|
|
1671
|
+
- `delay?: number`: How long the pointer rests on this trigger before the popup opens: before the root's.
|
|
1672
|
+
- `closeDelay?: number`: How long after the pointer leaves the popup closes: before the root's.
|
|
1673
|
+
- `<HoverCard.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
1674
|
+
- `<HoverCard.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
1675
|
+
- `<HoverCard.Popup>` draws a `<div>`.
|
|
1676
|
+
- `<HoverCard.Arrow>` draws a `<div>`.
|
|
835
1677
|
|
|
836
1678
|
Attributes and CSS variables, by part:
|
|
837
1679
|
|
|
@@ -840,7 +1682,7 @@ Attributes and CSS variables, by part:
|
|
|
840
1682
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
841
1683
|
- `data-open`: Present when it is open.
|
|
842
1684
|
- `data-closed`: Present when it is closed.
|
|
843
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1685
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
844
1686
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
845
1687
|
- `--anchor-width`: The anchor's width.
|
|
846
1688
|
- `--anchor-height`: The anchor's height.
|
|
@@ -852,11 +1694,11 @@ Attributes and CSS variables, by part:
|
|
|
852
1694
|
- `data-closed`: Present when it is closed.
|
|
853
1695
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
854
1696
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
855
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1697
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
856
1698
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
857
1699
|
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
858
1700
|
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
859
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1701
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
860
1702
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
861
1703
|
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|
|
862
1704
|
|
|
@@ -868,8 +1710,11 @@ import { Input } from "@kirana-ui/vue/input"
|
|
|
868
1710
|
|
|
869
1711
|
Props:
|
|
870
1712
|
|
|
871
|
-
- `
|
|
872
|
-
- `
|
|
1713
|
+
- `modelValue?: string`: `v-model:modelValue`. The text: `v-model`.
|
|
1714
|
+
- `disabled?: boolean`: Disabled: nothing can be typed in it.
|
|
1715
|
+
- `@value-change: (value: string, details: ChangeDetails) => void`: What was typed, as text, each time it changes.
|
|
1716
|
+
|
|
1717
|
+
`<Input>` draws a `<input>`.
|
|
873
1718
|
|
|
874
1719
|
Attributes and CSS variables, by part:
|
|
875
1720
|
|
|
@@ -888,6 +1733,8 @@ Attributes and CSS variables, by part:
|
|
|
888
1733
|
import { Label } from "@kirana-ui/vue/label"
|
|
889
1734
|
```
|
|
890
1735
|
|
|
1736
|
+
`<Label>` draws a `<label>`.
|
|
1737
|
+
|
|
891
1738
|
Attributes and CSS variables, by part:
|
|
892
1739
|
|
|
893
1740
|
- label: A control's name. Inside a field it is the field's label, with its states.
|
|
@@ -907,17 +1754,40 @@ import { Listbox } from "@kirana-ui/vue/listbox"
|
|
|
907
1754
|
|
|
908
1755
|
Parts: `<Listbox.Root>`, `<Listbox.Item>`, `<Listbox.ItemIndicator>`, `<Listbox.Group>`, `<Listbox.GroupLabel>`.
|
|
909
1756
|
|
|
1757
|
+
Anatomy:
|
|
1758
|
+
|
|
1759
|
+
```
|
|
1760
|
+
<Listbox.Root>
|
|
1761
|
+
<Listbox.Group> (optional, repeated)
|
|
1762
|
+
<Listbox.Item> (repeated)
|
|
1763
|
+
<Listbox.ItemIndicator>
|
|
1764
|
+
<Listbox.GroupLabel>
|
|
1765
|
+
```
|
|
1766
|
+
|
|
910
1767
|
Props of its root:
|
|
911
1768
|
|
|
912
|
-
- `value?: readonly Value[]`: The chosen values: none, one, or with `multiple` several.
|
|
913
|
-
- `defaultValue?: readonly Value[]`
|
|
914
|
-
- `onValueChange?: ((value: Value[], details: ChangeDetails) => void)`
|
|
1769
|
+
- `value?: readonly Value[]`: `v-model:value`. The chosen values: none, one, or with `multiple` several.
|
|
1770
|
+
- `defaultValue?: readonly Value[]`: The values it starts with, when the caller does not hold `value`. Read once.
|
|
915
1771
|
- `multiple?: boolean`: Whether more than one can be chosen: a press then adds or takes away.
|
|
916
|
-
- `disabled?: boolean
|
|
1772
|
+
- `disabled?: boolean`: Disabled: no item can be chosen.
|
|
917
1773
|
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do not.
|
|
918
1774
|
- `name?: string`: With a name, the chosen values are submitted with the form around the list.
|
|
919
1775
|
- `form?: string`: The id of the form the list belongs to, when it is not inside it.
|
|
920
1776
|
- `virtualized?: ListCollection`: Every row, when only some are in the page (a virtualizer draws the ones in view): how many there are, their names, and how to bring one into the page. Each item is then given its `index`.
|
|
1777
|
+
- `@value-change: (value: Value[], details: ChangeDetails) => void`: Heard as an item is about to be chosen or taken away, with the values there would then be: `details.cancel()` keeps them as they were.
|
|
1778
|
+
|
|
1779
|
+
Each part, and its own props:
|
|
1780
|
+
|
|
1781
|
+
- `<Listbox.Root>` draws a `<div>`. Generic: `<Value = unknown>`. Its props are above.
|
|
1782
|
+
- `<Listbox.Item>` draws a `<div>`.
|
|
1783
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
1784
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1785
|
+
- `index?: number`: Its place among all the rows, in a virtualized list.
|
|
1786
|
+
- `value: unknown`: Required. What is in the listbox's value while this item is chosen.
|
|
1787
|
+
- `<Listbox.ItemIndicator>` draws a `<span>`.
|
|
1788
|
+
- `keepMounted?: boolean`: Keeps the mark in the page while its item is not chosen.
|
|
1789
|
+
- `<Listbox.Group>` draws a `<div>`. Items that belong together, named by their label.
|
|
1790
|
+
- `<Listbox.GroupLabel>` draws a `<div>`. The name of a group.
|
|
921
1791
|
|
|
922
1792
|
Attributes and CSS variables, by part:
|
|
923
1793
|
|
|
@@ -938,14 +1808,87 @@ import { Menu } from "@kirana-ui/vue/menu"
|
|
|
938
1808
|
|
|
939
1809
|
Parts: `<Menu.Root>`, `<Menu.Trigger>`, `<Menu.Portal>`, `<Menu.Positioner>`, `<Menu.Popup>`, `<Menu.Arrow>`, `<Menu.Item>`, `<Menu.LinkItem>`, `<Menu.Group>`, `<Menu.GroupLabel>`, `<Menu.Separator>`, `<Menu.CheckboxItem>`, `<Menu.CheckboxItemIndicator>`, `<Menu.RadioGroup>`, `<Menu.RadioItem>`, `<Menu.RadioItemIndicator>`, `<Menu.SubmenuRoot>`, `<Menu.SubmenuTrigger>`.
|
|
940
1810
|
|
|
1811
|
+
Anatomy:
|
|
1812
|
+
|
|
1813
|
+
```
|
|
1814
|
+
<Menu.Root>
|
|
1815
|
+
<Menu.Trigger>
|
|
1816
|
+
<Menu.Portal>
|
|
1817
|
+
<Menu.Positioner>
|
|
1818
|
+
<Menu.Popup>
|
|
1819
|
+
<Menu.Arrow>
|
|
1820
|
+
<Menu.Group> (optional, repeated)
|
|
1821
|
+
<Menu.Item> (repeated)
|
|
1822
|
+
<Menu.LinkItem> (repeated)
|
|
1823
|
+
<Menu.GroupLabel>
|
|
1824
|
+
<Menu.CheckboxItem> (repeated)
|
|
1825
|
+
<Menu.CheckboxItemIndicator>
|
|
1826
|
+
<Menu.RadioGroup> (repeated)
|
|
1827
|
+
<Menu.RadioItem> (repeated)
|
|
1828
|
+
<Menu.RadioItemIndicator>
|
|
1829
|
+
<Menu.SubmenuRoot> (repeated)
|
|
1830
|
+
<Menu.Portal> (as above)
|
|
1831
|
+
<Menu.SubmenuTrigger>
|
|
1832
|
+
<Menu.Separator> (repeated)
|
|
1833
|
+
```
|
|
1834
|
+
|
|
941
1835
|
Props of its root:
|
|
942
1836
|
|
|
943
|
-
- `open?: boolean`
|
|
944
|
-
- `defaultOpen?: boolean`
|
|
945
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1837
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1838
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
946
1839
|
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
947
1840
|
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
948
1841
|
- `modal?: boolean`: Holds the page while the menu is open: its scroll is locked, and a press outside closes the menu and reaches nothing. Default: it does not. Not for a submenu.
|
|
1842
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1843
|
+
|
|
1844
|
+
Each part, and its own props:
|
|
1845
|
+
|
|
1846
|
+
- `<Menu.Root>` draws no element. Holds the menu: whether it is open. Its props are above.
|
|
1847
|
+
- `<Menu.Trigger>` draws a `<button>`.
|
|
1848
|
+
- `<Menu.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
1849
|
+
- `<Menu.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
1850
|
+
- `<Menu.Popup>` draws a `<div>`.
|
|
1851
|
+
- `<Menu.Arrow>` draws a `<div>`.
|
|
1852
|
+
- `<Menu.Item>` draws a `<div>`.
|
|
1853
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1854
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1855
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1856
|
+
- `<Menu.LinkItem>` draws a `<a>`.
|
|
1857
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1858
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1859
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1860
|
+
- `<Menu.Group>` draws a `<div>`. Items that belong together, named by their label.
|
|
1861
|
+
- `<Menu.GroupLabel>` draws a `<div>`. The name of a group. Outside a group it is plain text, and names nothing.
|
|
1862
|
+
- `<Menu.Separator>` draws a `<div>`. A line between items.
|
|
1863
|
+
- `<Menu.CheckboxItem>` draws a `<div>`.
|
|
1864
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1865
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1866
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1867
|
+
- `checked?: boolean`: `v-model:checked`. Whether the item is checked, when the caller holds it.
|
|
1868
|
+
- `defaultChecked?: boolean`: Whether the item starts checked, when the caller does not hold `checked`. Read once.
|
|
1869
|
+
- `@checked-change: (value: boolean, details: ChangeDetails) => void`: Heard as the item is about to be checked or unchecked: `details.cancel()` keeps it as it was.
|
|
1870
|
+
- `<Menu.CheckboxItemIndicator>` draws a `<span>`.
|
|
1871
|
+
- `keepMounted?: boolean`: Keeps the mark in the page while the item is unchecked.
|
|
1872
|
+
- `<Menu.RadioGroup>` draws a `<div>`. Generic: `<Value = unknown>`.
|
|
1873
|
+
- `value?: Value | null`: `v-model:value`. The chosen value; `null` is "none".
|
|
1874
|
+
- `defaultValue?: Value | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
1875
|
+
- `disabled?: boolean`: Disables every item of the group.
|
|
1876
|
+
- `@value-change: (value: Value, details: ChangeDetails) => void`: Told an item's own value, never `null`: a press chooses, and nothing takes the choice back.
|
|
1877
|
+
- `<Menu.RadioItem>` draws a `<div>`.
|
|
1878
|
+
- `disabled?: boolean`: Disables this item: it cannot be pressed, and the arrows pass over it.
|
|
1879
|
+
- `label?: string`: What typing matches; the item's text when left out.
|
|
1880
|
+
- `closeOnClick?: boolean`: Whether choosing the item closes the menu. Default: it does for an item, and does not for a checkbox or a radio item.
|
|
1881
|
+
- `value: unknown`: Required. What the group's value is while this item is the chosen one.
|
|
1882
|
+
- `<Menu.RadioItemIndicator>` draws a `<span>`.
|
|
1883
|
+
- `keepMounted?: boolean`: Keeps the mark in the page while its item is not the chosen one.
|
|
1884
|
+
- `<Menu.SubmenuRoot>` draws no element. A submenu: it holds the item that opens it and a portal, positioner and popup of its own.
|
|
1885
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
1886
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1887
|
+
- `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
|
|
1888
|
+
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
1889
|
+
- `modal?: boolean`: Holds the page while the menu is open: its scroll is locked, and a press outside closes the menu and reaches nothing. Default: it does not. Not for a submenu.
|
|
1890
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
1891
|
+
- `<Menu.SubmenuTrigger>` draws a `<div>`.
|
|
949
1892
|
|
|
950
1893
|
Attributes and CSS variables, by part:
|
|
951
1894
|
|
|
@@ -955,7 +1898,7 @@ Attributes and CSS variables, by part:
|
|
|
955
1898
|
- positioner: Places the menu against its trigger. It carries the geometry.
|
|
956
1899
|
- `data-open`: Present when it is open.
|
|
957
1900
|
- `data-closed`: Present when it is closed.
|
|
958
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1901
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
959
1902
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
960
1903
|
- `--anchor-width`: The anchor's width.
|
|
961
1904
|
- `--anchor-height`: The anchor's height.
|
|
@@ -967,10 +1910,10 @@ Attributes and CSS variables, by part:
|
|
|
967
1910
|
- `data-closed`: Present when it is closed.
|
|
968
1911
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
969
1912
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
970
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1913
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
971
1914
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
972
1915
|
- arrow: An element that points at the trigger.
|
|
973
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
1916
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
974
1917
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
975
1918
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
976
1919
|
- item: An action. Choosing it closes the menu.
|
|
@@ -1014,6 +1957,8 @@ Props:
|
|
|
1014
1957
|
- `disabled?: boolean`: No menu of the bar opens.
|
|
1015
1958
|
- `orientation?: Orientation`: A row (the default) or a column of menus. In a column a menu opens beside its trigger.
|
|
1016
1959
|
|
|
1960
|
+
`<Menubar>` draws a `<div>`.
|
|
1961
|
+
|
|
1017
1962
|
Attributes and CSS variables, by part:
|
|
1018
1963
|
|
|
1019
1964
|
- root: The row of menus. A menu inside it is one of its items.
|
|
@@ -1028,11 +1973,27 @@ import { MessageScroller } from "@kirana-ui/vue/message-scroller"
|
|
|
1028
1973
|
|
|
1029
1974
|
Parts: `<MessageScroller.Root>`, `<MessageScroller.Viewport>`, `<MessageScroller.Content>`, `<MessageScroller.Button>`.
|
|
1030
1975
|
|
|
1976
|
+
Anatomy:
|
|
1977
|
+
|
|
1978
|
+
```
|
|
1979
|
+
<MessageScroller.Root>
|
|
1980
|
+
<MessageScroller.Viewport>
|
|
1981
|
+
<MessageScroller.Content>
|
|
1982
|
+
<MessageScroller.Button>
|
|
1983
|
+
```
|
|
1984
|
+
|
|
1031
1985
|
Props of its root:
|
|
1032
1986
|
|
|
1033
1987
|
- `initial?: "bottom" | "top"`: Where it begins: at the newest message (the default), or at the first.
|
|
1034
1988
|
- `threshold?: number`: How near the end counts as at it, in pixels. Default: 24.
|
|
1035
|
-
-
|
|
1989
|
+
- `@at-bottom-change: (atBottom: boolean, details: ChangeDetails) => void`: It came to the end, or left it.
|
|
1990
|
+
|
|
1991
|
+
Each part, and its own props:
|
|
1992
|
+
|
|
1993
|
+
- `<MessageScroller.Root>` draws a `<div>`. Its props are above.
|
|
1994
|
+
- `<MessageScroller.Viewport>` draws a `<div>`.
|
|
1995
|
+
- `<MessageScroller.Content>` draws a `<div>`. The messages: what grows as one is written.
|
|
1996
|
+
- `<MessageScroller.Button>` draws a `<button>`.
|
|
1036
1997
|
|
|
1037
1998
|
Attributes and CSS variables, by part:
|
|
1038
1999
|
|
|
@@ -1051,6 +2012,33 @@ import { Meter } from "@kirana-ui/vue/meter"
|
|
|
1051
2012
|
|
|
1052
2013
|
Parts: `<Meter.Root>`, `<Meter.Track>`, `<Meter.Indicator>`, `<Meter.Value>`, `<Meter.Label>`.
|
|
1053
2014
|
|
|
2015
|
+
Anatomy:
|
|
2016
|
+
|
|
2017
|
+
```
|
|
2018
|
+
<Meter.Root>
|
|
2019
|
+
<Meter.Track>
|
|
2020
|
+
<Meter.Indicator>
|
|
2021
|
+
<Meter.Value>
|
|
2022
|
+
<Meter.Label>
|
|
2023
|
+
```
|
|
2024
|
+
|
|
2025
|
+
Props of its root:
|
|
2026
|
+
|
|
2027
|
+
- `min?: number`: Default 0.
|
|
2028
|
+
- `max?: number`: Default 100.
|
|
2029
|
+
- `format?: Intl.NumberFormatOptions`: How the value is written; a percentage of the range by default.
|
|
2030
|
+
- `locale?: string`: The language the value is written in; the page's by default.
|
|
2031
|
+
- `getAriaValueText?: (text: string | undefined, value: number | null) => string`: What assistive technology reads for the value, when the written value is not enough.
|
|
2032
|
+
- `value: Value`: Required. The value; a progress bar's is `null` while how far it has come is not known.
|
|
2033
|
+
|
|
2034
|
+
Each part, and its own props:
|
|
2035
|
+
|
|
2036
|
+
- `<Meter.Root>` draws a `<div>`. A meter always has a value. Its props are above.
|
|
2037
|
+
- `<Meter.Track>` draws a `<div>`. The whole range.
|
|
2038
|
+
- `<Meter.Indicator>` draws a `<div>`. The filled part: its width is the value's share of the range.
|
|
2039
|
+
- `<Meter.Value>` draws a `<span>`. The value, written. Its default slot is also given `text: string`.
|
|
2040
|
+
- `<Meter.Label>` draws a `<span>`. The meter's name.
|
|
2041
|
+
|
|
1054
2042
|
### NavigationMenu
|
|
1055
2043
|
|
|
1056
2044
|
```
|
|
@@ -1059,14 +2047,53 @@ import { NavigationMenu } from "@kirana-ui/vue/navigation-menu"
|
|
|
1059
2047
|
|
|
1060
2048
|
Parts: `<NavigationMenu.Root>`, `<NavigationMenu.List>`, `<NavigationMenu.Item>`, `<NavigationMenu.Trigger>`, `<NavigationMenu.Icon>`, `<NavigationMenu.Content>`, `<NavigationMenu.Link>`, `<NavigationMenu.Portal>`, `<NavigationMenu.Positioner>`, `<NavigationMenu.Popup>`, `<NavigationMenu.Viewport>`, `<NavigationMenu.Arrow>`, `<NavigationMenu.Backdrop>`.
|
|
1061
2049
|
|
|
2050
|
+
Anatomy:
|
|
2051
|
+
|
|
2052
|
+
```
|
|
2053
|
+
<NavigationMenu.Root>
|
|
2054
|
+
<NavigationMenu.List>
|
|
2055
|
+
<NavigationMenu.Item> (repeated)
|
|
2056
|
+
<NavigationMenu.Trigger>
|
|
2057
|
+
<NavigationMenu.Icon>
|
|
2058
|
+
<NavigationMenu.Content>
|
|
2059
|
+
<NavigationMenu.Link> (repeated)
|
|
2060
|
+
<NavigationMenu.Link> (repeated, as above)
|
|
2061
|
+
<NavigationMenu.Link> (repeated, as above)
|
|
2062
|
+
<NavigationMenu.Portal>
|
|
2063
|
+
<NavigationMenu.Positioner>
|
|
2064
|
+
<NavigationMenu.Popup>
|
|
2065
|
+
<NavigationMenu.Viewport>
|
|
2066
|
+
<NavigationMenu.Arrow>
|
|
2067
|
+
<NavigationMenu.Backdrop>
|
|
2068
|
+
```
|
|
2069
|
+
|
|
1062
2070
|
Props of its root:
|
|
1063
2071
|
|
|
1064
|
-
- `value?: Value | null`: The item whose content is shown; `null` is "none".
|
|
1065
|
-
- `defaultValue?: Value | null`
|
|
1066
|
-
- `onValueChange?: ((value: Value | null, details: ChangeDetails) => void)`
|
|
2072
|
+
- `value?: Value | null`: `v-model:value`. The item whose content is shown; `null` is "none".
|
|
2073
|
+
- `defaultValue?: Value | null`: The item whose content it starts with, when the caller does not hold `value`. Read once.
|
|
1067
2074
|
- `delay?: number`: How long the pointer rests on a trigger before its content shows, in milliseconds.
|
|
1068
2075
|
- `closeDelay?: number`: How long after the pointer leaves the content goes, in milliseconds.
|
|
1069
|
-
- `orientation?: Orientation
|
|
2076
|
+
- `orientation?: Orientation`: Whether the triggers are laid out across (the default) or down: the arrows that move between them follow.
|
|
2077
|
+
- `@value-change: (value: Value | null, details: ChangeDetails) => void`: Heard as another item's content is about to show, or none: `details.cancel()` keeps the value as it was.
|
|
2078
|
+
|
|
2079
|
+
Each part, and its own props:
|
|
2080
|
+
|
|
2081
|
+
- `<NavigationMenu.Root>` draws a `<nav>`. Generic: `<Value = unknown>`. Its props are above.
|
|
2082
|
+
- `<NavigationMenu.List>` draws a `<ul>`.
|
|
2083
|
+
- `<NavigationMenu.Item>` draws a `<li>`. One item of the list: a link, or a trigger with its content. Its `value` tells it from the others; an item that is given none makes its own.
|
|
2084
|
+
- `value?: unknown`: What tells this item from the others: the menu's `value` while its content is shown. An item that is given none makes its own.
|
|
2085
|
+
- `<NavigationMenu.Trigger>` draws a `<button>`.
|
|
2086
|
+
- `<NavigationMenu.Icon>` draws a `<span>`.
|
|
2087
|
+
- `<NavigationMenu.Content>` draws a `<div>`.
|
|
2088
|
+
- `<NavigationMenu.Link>` draws a `<a>`.
|
|
2089
|
+
- `active?: boolean`: The link is the page the reader is on.
|
|
2090
|
+
- `closeOnClick?: boolean`: Whether following it closes the menu. Default: it does.
|
|
2091
|
+
- `<NavigationMenu.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
2092
|
+
- `<NavigationMenu.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
2093
|
+
- `<NavigationMenu.Popup>` draws a `<div>`.
|
|
2094
|
+
- `<NavigationMenu.Viewport>` draws a `<div>`. Where the contents are drawn, inside the popup.
|
|
2095
|
+
- `<NavigationMenu.Arrow>` draws a `<div>`.
|
|
2096
|
+
- `<NavigationMenu.Backdrop>` draws a `<div>`.
|
|
1070
2097
|
|
|
1071
2098
|
Attributes and CSS variables, by part:
|
|
1072
2099
|
|
|
@@ -1089,7 +2116,7 @@ Attributes and CSS variables, by part:
|
|
|
1089
2116
|
- positioner: Places the popup against the open item's trigger. It carries the geometry.
|
|
1090
2117
|
- `data-open`: Present when it is open.
|
|
1091
2118
|
- `data-closed`: Present when it is closed.
|
|
1092
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2119
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1093
2120
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1094
2121
|
- `--anchor-width`: The anchor's width.
|
|
1095
2122
|
- `--anchor-height`: The anchor's height.
|
|
@@ -1103,12 +2130,12 @@ Attributes and CSS variables, by part:
|
|
|
1103
2130
|
- `data-closed`: Present when it is closed.
|
|
1104
2131
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1105
2132
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1106
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2133
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1107
2134
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1108
2135
|
- `--popup-width`: The open content's width.
|
|
1109
2136
|
- `--popup-height`: The open content's height.
|
|
1110
2137
|
- arrow: An element that points at the open item's trigger.
|
|
1111
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2138
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1112
2139
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1113
2140
|
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
1114
2141
|
- backdrop: An element behind the popup, for a design that dims the page.
|
|
@@ -1125,14 +2152,21 @@ import { NumberField } from "@kirana-ui/vue/number-field"
|
|
|
1125
2152
|
|
|
1126
2153
|
Parts: `<NumberField.Root>`, `<NumberField.Group>`, `<NumberField.Input>`, `<NumberField.Increment>`, `<NumberField.Decrement>`.
|
|
1127
2154
|
|
|
2155
|
+
Anatomy:
|
|
2156
|
+
|
|
2157
|
+
```
|
|
2158
|
+
<NumberField.Root>
|
|
2159
|
+
<NumberField.Group>
|
|
2160
|
+
<NumberField.Input>
|
|
2161
|
+
<NumberField.Increment>
|
|
2162
|
+
<NumberField.Decrement>
|
|
2163
|
+
```
|
|
2164
|
+
|
|
1128
2165
|
Props of its root:
|
|
1129
2166
|
|
|
1130
|
-
- `
|
|
1131
|
-
- `
|
|
1132
|
-
- `
|
|
1133
|
-
- `onValueCommitted?: ((value: number | null, details: ChangeDetails) => void)`: Heard once a change is done: focus left the input, a key or a button stepped it.
|
|
1134
|
-
- `min?: number`
|
|
1135
|
-
- `max?: number`
|
|
2167
|
+
- `defaultValue?: number | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
2168
|
+
- `min?: number`: The least the number may be.
|
|
2169
|
+
- `max?: number`: The most the number may be.
|
|
1136
2170
|
- `step?: number`: What the buttons and the arrows move by. Default 1.
|
|
1137
2171
|
- `smallStep?: number`: With Alt held. Default 0.1.
|
|
1138
2172
|
- `largeStep?: number`: With Shift held. Default 10.
|
|
@@ -1140,11 +2174,22 @@ Props of its root:
|
|
|
1140
2174
|
- `allowWheelScrub?: boolean`: The wheel steps it while the pointer is over the input and focus is in it.
|
|
1141
2175
|
- `format?: Intl.NumberFormatOptions`: How the number is written.
|
|
1142
2176
|
- `locale?: string`: The language it is written in; the page's by default.
|
|
1143
|
-
- `disabled?: boolean
|
|
1144
|
-
- `readOnly?: boolean
|
|
1145
|
-
- `required?: boolean`
|
|
2177
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
2178
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
2179
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
|
|
1146
2180
|
- `name?: string`: With a name, the number is submitted with the form around it.
|
|
1147
2181
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
2182
|
+
- `modelValue?: number | null`: `v-model:modelValue`. The number, `null` for none: `v-model`.
|
|
2183
|
+
- `@value-change: (value: number | null, details: ChangeDetails) => void`: Heard as the number is about to change, typed or stepped: `details.cancel()` keeps it as it was.
|
|
2184
|
+
- `@value-committed: (value: number | null, details: ChangeDetails) => void`: Heard once a change is done: focus left the input, a key or a button stepped it.
|
|
2185
|
+
|
|
2186
|
+
Each part, and its own props:
|
|
2187
|
+
|
|
2188
|
+
- `<NumberField.Root>` draws a `<div>`. Its props are above.
|
|
2189
|
+
- `<NumberField.Group>` draws a `<div>`.
|
|
2190
|
+
- `<NumberField.Input>` draws a `<input>`.
|
|
2191
|
+
- `<NumberField.Increment>` draws a `<button>`.
|
|
2192
|
+
- `<NumberField.Decrement>` draws a `<button>`.
|
|
1148
2193
|
|
|
1149
2194
|
Attributes and CSS variables, by part:
|
|
1150
2195
|
|
|
@@ -1207,17 +2252,38 @@ import { Otp } from "@kirana-ui/vue/otp"
|
|
|
1207
2252
|
|
|
1208
2253
|
Parts: `<Otp.Root>`, `<Otp.Input>`, `<Otp.Group>`, `<Otp.Slot>`, `<Otp.Separator>`, `<Otp.Caret>`.
|
|
1209
2254
|
|
|
2255
|
+
Anatomy:
|
|
2256
|
+
|
|
2257
|
+
```
|
|
2258
|
+
<Otp.Root>
|
|
2259
|
+
<Otp.Input>
|
|
2260
|
+
<Otp.Group> (repeated)
|
|
2261
|
+
<Otp.Slot> (repeated)
|
|
2262
|
+
<Otp.Caret>
|
|
2263
|
+
<Otp.Separator> (repeated)
|
|
2264
|
+
```
|
|
2265
|
+
|
|
1210
2266
|
Props of its root:
|
|
1211
2267
|
|
|
1212
2268
|
- `length?: number`: How many characters the code has. Default: 6.
|
|
1213
|
-
- `value?: string`
|
|
1214
|
-
- `defaultValue?: string`
|
|
1215
|
-
- `onValueChange?: ((value: string, details: ChangeDetails) => void)`
|
|
1216
|
-
- `onComplete?: ((value: string) => void)`: Every character is in: the moment to send the code.
|
|
2269
|
+
- `value?: string`: `v-model:value`. The characters typed so far, when the caller holds them.
|
|
2270
|
+
- `defaultValue?: string`: The characters it starts with, when the caller does not hold `value`. Read once.
|
|
1217
2271
|
- `mode?: "numeric" | "alphanumeric" | "text"`: What a character may be. Default: `numeric`.
|
|
1218
|
-
- `disabled?: boolean
|
|
2272
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1219
2273
|
- `name?: string`: With a name, the code is submitted with the form around it.
|
|
1220
2274
|
- `form?: string`: The id of the form the input belongs to, when it is not inside it.
|
|
2275
|
+
- `@value-change: (value: string, details: ChangeDetails) => void`: Heard as the characters are about to change: `details.cancel()` keeps them as they were.
|
|
2276
|
+
- `@complete: (value: string) => void`: The finished code, once every cell is filled.
|
|
2277
|
+
|
|
2278
|
+
Each part, and its own props:
|
|
2279
|
+
|
|
2280
|
+
- `<Otp.Root>` draws a `<div>`. Its props are above.
|
|
2281
|
+
- `<Otp.Input>` draws a `<input>`.
|
|
2282
|
+
- `<Otp.Group>` draws a `<div>`. Cells that are drawn together.
|
|
2283
|
+
- `<Otp.Slot>` draws a `<div>`.
|
|
2284
|
+
- `index: number`: Required. Which character of the code the cell shows, from 0.
|
|
2285
|
+
- `<Otp.Separator>` draws a `<div>`. A mark between groups of cells.
|
|
2286
|
+
- `<Otp.Caret>` draws a `<div>`. A caret drawn in the active cell while it is empty.
|
|
1221
2287
|
|
|
1222
2288
|
Attributes and CSS variables, by part:
|
|
1223
2289
|
|
|
@@ -1241,16 +2307,37 @@ import { Pagination } from "@kirana-ui/vue/pagination"
|
|
|
1241
2307
|
|
|
1242
2308
|
Parts: `<Pagination.Root>`, `<Pagination.Items>`, `<Pagination.Item>`, `<Pagination.Ellipsis>`, `<Pagination.Previous>`, `<Pagination.Next>`.
|
|
1243
2309
|
|
|
2310
|
+
Anatomy:
|
|
2311
|
+
|
|
2312
|
+
```
|
|
2313
|
+
<Pagination.Root>
|
|
2314
|
+
<Pagination.Items>
|
|
2315
|
+
<Pagination.Item> (repeated)
|
|
2316
|
+
<Pagination.Ellipsis> (repeated)
|
|
2317
|
+
<Pagination.Previous>
|
|
2318
|
+
<Pagination.Next>
|
|
2319
|
+
```
|
|
2320
|
+
|
|
1244
2321
|
Props of its root:
|
|
1245
2322
|
|
|
1246
|
-
- `page?: number`: The page shown, from 1.
|
|
1247
|
-
- `defaultPage?: number`
|
|
1248
|
-
- `
|
|
1249
|
-
- `count: number`: How many items there are in all.
|
|
2323
|
+
- `page?: number`: `v-model:page`. The page shown, from 1.
|
|
2324
|
+
- `defaultPage?: number`: The page it starts at, when the caller does not hold `page`. Read once.
|
|
2325
|
+
- `count: number`: Required. How many items there are in all.
|
|
1250
2326
|
- `pageSize?: number`: How many items a page holds. Default 10.
|
|
1251
2327
|
- `siblingCount?: number`: How many pages are listed each side of the one shown. Default 1.
|
|
1252
2328
|
- `boundaryCount?: number`: How many pages are always listed at each end. Default 1.
|
|
1253
|
-
- `disabled?: boolean
|
|
2329
|
+
- `disabled?: boolean`: Disabled: no page can be gone to.
|
|
2330
|
+
- `@page-change: (value: number, details: ChangeDetails) => void`: Heard as another page is about to be shown: `details.cancel()` keeps the page as it was.
|
|
2331
|
+
|
|
2332
|
+
Each part, and its own props:
|
|
2333
|
+
|
|
2334
|
+
- `<Pagination.Root>` draws a `<nav>`. Its props are above.
|
|
2335
|
+
- `<Pagination.Items>` draws no element. The row's entries, pages and the gaps between them: each is given to draw. Its default slot is also given `entry: PaginationEntry`.
|
|
2336
|
+
- `<Pagination.Item>` draws a `<button>`.
|
|
2337
|
+
- `page: number`: Required. The page it goes to.
|
|
2338
|
+
- `<Pagination.Ellipsis>` draws a `<span>`. The mark for pages that are left out of the row.
|
|
2339
|
+
- `<Pagination.Previous>` draws a `<button>`.
|
|
2340
|
+
- `<Pagination.Next>` draws a `<button>`.
|
|
1254
2341
|
|
|
1255
2342
|
Attributes and CSS variables, by part:
|
|
1256
2343
|
|
|
@@ -1272,11 +2359,35 @@ import { Popover } from "@kirana-ui/vue/popover"
|
|
|
1272
2359
|
|
|
1273
2360
|
Parts: `<Popover.Root>`, `<Popover.Trigger>`, `<Popover.Portal>`, `<Popover.Positioner>`, `<Popover.Popup>`, `<Popover.Title>`, `<Popover.Description>`, `<Popover.Close>`.
|
|
1274
2361
|
|
|
2362
|
+
Anatomy:
|
|
2363
|
+
|
|
2364
|
+
```
|
|
2365
|
+
<Popover.Root>
|
|
2366
|
+
<Popover.Trigger>
|
|
2367
|
+
<Popover.Portal>
|
|
2368
|
+
<Popover.Positioner>
|
|
2369
|
+
<Popover.Popup>
|
|
2370
|
+
<Popover.Title>
|
|
2371
|
+
<Popover.Description>
|
|
2372
|
+
<Popover.Close>
|
|
2373
|
+
```
|
|
2374
|
+
|
|
1275
2375
|
Props of its root:
|
|
1276
2376
|
|
|
1277
|
-
- `open?: boolean`
|
|
1278
|
-
- `defaultOpen?: boolean`
|
|
1279
|
-
-
|
|
2377
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
2378
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
2379
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
2380
|
+
|
|
2381
|
+
Each part, and its own props:
|
|
2382
|
+
|
|
2383
|
+
- `<Popover.Root>` draws no element. Holds the popover: whether it is open. Its props are above.
|
|
2384
|
+
- `<Popover.Trigger>` draws a `<button>`.
|
|
2385
|
+
- `<Popover.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
2386
|
+
- `<Popover.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
2387
|
+
- `<Popover.Popup>` draws a `<div>`.
|
|
2388
|
+
- `<Popover.Title>` draws a `<h2>`. The heading that names the popover.
|
|
2389
|
+
- `<Popover.Description>` draws a `<p>`. The text that describes the popover.
|
|
2390
|
+
- `<Popover.Close>` draws a `<button>`. A button that closes the popover.
|
|
1280
2391
|
|
|
1281
2392
|
Attributes and CSS variables, by part:
|
|
1282
2393
|
|
|
@@ -1285,7 +2396,7 @@ Attributes and CSS variables, by part:
|
|
|
1285
2396
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
1286
2397
|
- `data-open`: Present when it is open.
|
|
1287
2398
|
- `data-closed`: Present when it is closed.
|
|
1288
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2399
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1289
2400
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1290
2401
|
- `--anchor-width`: The anchor's width.
|
|
1291
2402
|
- `--anchor-height`: The anchor's height.
|
|
@@ -1297,15 +2408,9 @@ Attributes and CSS variables, by part:
|
|
|
1297
2408
|
- `data-closed`: Present when it is closed.
|
|
1298
2409
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1299
2410
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1300
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2411
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1301
2412
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1302
2413
|
|
|
1303
|
-
### PortalProvider
|
|
1304
|
-
|
|
1305
|
-
```
|
|
1306
|
-
import { PortalProvider } from "@kirana-ui/vue/portal-provider"
|
|
1307
|
-
```
|
|
1308
|
-
|
|
1309
2414
|
### Progress
|
|
1310
2415
|
|
|
1311
2416
|
```
|
|
@@ -1314,14 +2419,32 @@ import { Progress } from "@kirana-ui/vue/progress"
|
|
|
1314
2419
|
|
|
1315
2420
|
Parts: `<Progress.Root>`, `<Progress.Track>`, `<Progress.Indicator>`, `<Progress.Value>`, `<Progress.Label>`.
|
|
1316
2421
|
|
|
2422
|
+
Anatomy:
|
|
2423
|
+
|
|
2424
|
+
```
|
|
2425
|
+
<Progress.Root>
|
|
2426
|
+
<Progress.Track>
|
|
2427
|
+
<Progress.Indicator>
|
|
2428
|
+
<Progress.Value>
|
|
2429
|
+
<Progress.Label>
|
|
2430
|
+
```
|
|
2431
|
+
|
|
1317
2432
|
Props of its root:
|
|
1318
2433
|
|
|
1319
|
-
- `value: number | null`: The value. For a progress bar, `null` is "under way, how far is not known".
|
|
1320
2434
|
- `min?: number`: Default 0.
|
|
1321
2435
|
- `max?: number`: Default 100.
|
|
1322
2436
|
- `format?: Intl.NumberFormatOptions`: How the value is written; a percentage of the range by default.
|
|
1323
2437
|
- `locale?: string`: The language the value is written in; the page's by default.
|
|
1324
|
-
- `getAriaValueText?: (
|
|
2438
|
+
- `getAriaValueText?: (text: string | undefined, value: number | null) => string`: What assistive technology reads for the value, when the written value is not enough.
|
|
2439
|
+
- `value: Value`: Required. The value; a progress bar's is `null` while how far it has come is not known.
|
|
2440
|
+
|
|
2441
|
+
Each part, and its own props:
|
|
2442
|
+
|
|
2443
|
+
- `<Progress.Root>` draws a `<div>`. Generic: `<Value extends number | null = number | null>`. Its props are above.
|
|
2444
|
+
- `<Progress.Track>` draws a `<div>`.
|
|
2445
|
+
- `<Progress.Indicator>` draws a `<div>`.
|
|
2446
|
+
- `<Progress.Value>` draws a `<span>`. Its default slot is also given `text: string`.
|
|
2447
|
+
- `<Progress.Label>` draws a `<span>`.
|
|
1325
2448
|
|
|
1326
2449
|
Attributes and CSS variables, by part:
|
|
1327
2450
|
|
|
@@ -1354,11 +2477,25 @@ import { QrCode } from "@kirana-ui/vue/qr-code"
|
|
|
1354
2477
|
|
|
1355
2478
|
Parts: `<QrCode.Root>`, `<QrCode.Frame>`, `<QrCode.Pattern>`.
|
|
1356
2479
|
|
|
2480
|
+
Anatomy:
|
|
2481
|
+
|
|
2482
|
+
```
|
|
2483
|
+
<QrCode.Root>
|
|
2484
|
+
<QrCode.Frame>
|
|
2485
|
+
<QrCode.Pattern>
|
|
2486
|
+
```
|
|
2487
|
+
|
|
1357
2488
|
Props of its root:
|
|
1358
2489
|
|
|
1359
|
-
- `value: string`: What the code says: a link, a text. Written as UTF-8.
|
|
2490
|
+
- `value: string`: Required. What the code says: a link, a text. Written as UTF-8.
|
|
1360
2491
|
- `correction?: QrCorrection`: How much of it may be lost and still be read. Default: `"M"`.
|
|
1361
2492
|
|
|
2493
|
+
Each part, and its own props:
|
|
2494
|
+
|
|
2495
|
+
- `<QrCode.Root>` draws a `<div>`. Its props are above.
|
|
2496
|
+
- `<QrCode.Frame>` draws a `<svg>`. The drawing: an `<svg>` a module to the unit.
|
|
2497
|
+
- `<QrCode.Pattern>` draws a `<path>`. The dark modules: one `<path>`, filled by the design.
|
|
2498
|
+
|
|
1362
2499
|
Attributes and CSS variables, by part:
|
|
1363
2500
|
|
|
1364
2501
|
- root: What holds the code.
|
|
@@ -1372,16 +2509,33 @@ import { RadioGroup } from "@kirana-ui/vue/radio-group"
|
|
|
1372
2509
|
|
|
1373
2510
|
Parts: `<RadioGroup.Root>`, `<RadioGroup.Item>`, `<RadioGroup.Indicator>`.
|
|
1374
2511
|
|
|
2512
|
+
Anatomy:
|
|
2513
|
+
|
|
2514
|
+
```
|
|
2515
|
+
<RadioGroup.Root>
|
|
2516
|
+
<RadioGroup.Item> (repeated)
|
|
2517
|
+
<RadioGroup.Indicator>
|
|
2518
|
+
```
|
|
2519
|
+
|
|
1375
2520
|
Props of its root:
|
|
1376
2521
|
|
|
1377
|
-
- `value?: Value | null`: The chosen value; `null` is "none".
|
|
1378
|
-
- `defaultValue?: Value | null`
|
|
1379
|
-
- `
|
|
1380
|
-
- `
|
|
1381
|
-
- `
|
|
1382
|
-
- `required?: boolean`
|
|
2522
|
+
- `value?: Value | null`: `v-model:value`. The chosen value; `null` is "none".
|
|
2523
|
+
- `defaultValue?: Value | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
2524
|
+
- `disabled?: boolean`: Disables every item of the group.
|
|
2525
|
+
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
2526
|
+
- `required?: boolean`: Needed: in a `Field`, choosing none is then invalid.
|
|
1383
2527
|
- `name?: string`: With a name, the chosen value is submitted with the form around the group.
|
|
1384
2528
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
2529
|
+
- `@value-change: (value: Value | null, details: ChangeDetails) => void`: `null` only when a form's reset takes the group back to "none".
|
|
2530
|
+
|
|
2531
|
+
Each part, and its own props:
|
|
2532
|
+
|
|
2533
|
+
- `<RadioGroup.Root>` draws a `<div>`. Generic: `<Value = unknown>`. Its props are above.
|
|
2534
|
+
- `<RadioGroup.Item>` draws a `<span>`.
|
|
2535
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen.
|
|
2536
|
+
- `value: unknown`: Required. What the group's value is while this item is the chosen one.
|
|
2537
|
+
- `<RadioGroup.Indicator>` draws a `<span>`.
|
|
2538
|
+
- `keepMounted?: boolean`: Keeps the mark in the page while its item is not the chosen one.
|
|
1385
2539
|
|
|
1386
2540
|
Attributes and CSS variables, by part:
|
|
1387
2541
|
|
|
@@ -1412,12 +2566,30 @@ import { Resizable } from "@kirana-ui/vue/resizable"
|
|
|
1412
2566
|
|
|
1413
2567
|
Parts: `<Resizable.Group>`, `<Resizable.Panel>`, `<Resizable.Handle>`.
|
|
1414
2568
|
|
|
2569
|
+
Anatomy:
|
|
2570
|
+
|
|
2571
|
+
```
|
|
2572
|
+
<Resizable.Group>
|
|
2573
|
+
<Resizable.Panel> (repeated)
|
|
2574
|
+
<Resizable.Handle> (repeated)
|
|
2575
|
+
```
|
|
2576
|
+
|
|
1415
2577
|
Props of its root:
|
|
1416
2578
|
|
|
1417
2579
|
- `orientation?: Orientation`: Whether the panels are side by side (the default) or one over the other.
|
|
1418
|
-
- `onSizesChange?: ((sizes: number[], details: ChangeDetails) => void)`: Heard as the panels are resized: each panel's share, in the page's order, summing to 100.
|
|
1419
2580
|
- `keyboardStep?: number`: How far an arrow key moves a handle, in hundredths of the group. Default: 10.
|
|
1420
|
-
- `disabled?: boolean
|
|
2581
|
+
- `disabled?: boolean`: Disabled: the handles cannot be dragged or moved with the keyboard.
|
|
2582
|
+
- `@sizes-change: (sizes: number[], details: ChangeDetails) => void`: The panels were resized: each one's share, in order.
|
|
2583
|
+
|
|
2584
|
+
Each part, and its own props:
|
|
2585
|
+
|
|
2586
|
+
- `<Resizable.Group>` draws a `<div>`. Its props are above.
|
|
2587
|
+
- `<Resizable.Panel>` draws a `<div>`.
|
|
2588
|
+
- `defaultSize?: number`: Its share to begin with, in hundredths of the group. Either every panel gives one or none does (they are then equal).
|
|
2589
|
+
- `minSize?: number`: The least it can be made. Default: 0.
|
|
2590
|
+
- `maxSize?: number`: The most it can be made. Default: 100.
|
|
2591
|
+
- `<Resizable.Handle>` draws a `<div>`.
|
|
2592
|
+
- `disabled?: boolean`: Disables this handle: it cannot be dragged or moved with the keyboard.
|
|
1421
2593
|
|
|
1422
2594
|
Attributes and CSS variables, by part:
|
|
1423
2595
|
|
|
@@ -1440,27 +2612,49 @@ import { ScrollArea } from "@kirana-ui/vue/scroll-area"
|
|
|
1440
2612
|
|
|
1441
2613
|
Parts: `<ScrollArea.Root>`, `<ScrollArea.Viewport>`, `<ScrollArea.Content>`, `<ScrollArea.Scrollbar>`, `<ScrollArea.Thumb>`, `<ScrollArea.Corner>`.
|
|
1442
2614
|
|
|
2615
|
+
Anatomy:
|
|
2616
|
+
|
|
2617
|
+
```
|
|
2618
|
+
<ScrollArea.Root>
|
|
2619
|
+
<ScrollArea.Viewport>
|
|
2620
|
+
<ScrollArea.Content>
|
|
2621
|
+
<ScrollArea.Scrollbar> (repeated)
|
|
2622
|
+
<ScrollArea.Thumb>
|
|
2623
|
+
<ScrollArea.Corner>
|
|
2624
|
+
```
|
|
2625
|
+
|
|
2626
|
+
Each part, and its own props:
|
|
2627
|
+
|
|
2628
|
+
- `<ScrollArea.Root>` draws a `<div>`.
|
|
2629
|
+
- `<ScrollArea.Viewport>` draws a `<div>`.
|
|
2630
|
+
- `<ScrollArea.Content>` draws a `<div>`. What is scrolled.
|
|
2631
|
+
- `<ScrollArea.Scrollbar>` draws a `<div>`.
|
|
2632
|
+
- `orientation?: Orientation`: Which way it scrolls; `vertical` when left out.
|
|
2633
|
+
- `keepMounted?: boolean`: Keeps the bar in the page while there is nothing to scroll that way.
|
|
2634
|
+
- `<ScrollArea.Thumb>` draws a `<div>`.
|
|
2635
|
+
- `<ScrollArea.Corner>` draws a `<div>`. The square where the two scrollbars meet, placed there.
|
|
2636
|
+
|
|
1443
2637
|
Attributes and CSS variables, by part:
|
|
1444
2638
|
|
|
1445
|
-
- root: The area. It holds the viewport and the scrollbars.
|
|
2639
|
+
- root: The area. It holds the viewport and the scrollbars, which the library places against it: a design gives a scrollbar its thickness and draws it, and places nothing.
|
|
1446
2640
|
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
1447
2641
|
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
1448
2642
|
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
1449
2643
|
- `data-hovering`: Present while the pointer is over the area.
|
|
1450
|
-
- `--scroll-area-corner-width`: The width of the corner: the vertical scrollbar's.
|
|
1451
|
-
- `--scroll-area-corner-height`: The height of the corner: the horizontal scrollbar's.
|
|
2644
|
+
- `--scroll-area-corner-width`: The width of the corner: the vertical scrollbar's, while both scrollbars and the corner are in the page.
|
|
2645
|
+
- `--scroll-area-corner-height`: The height of the corner: the horizontal scrollbar's, while both scrollbars and the corner are in the page.
|
|
1452
2646
|
- viewport: The element that scrolls.
|
|
1453
2647
|
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
1454
2648
|
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
1455
2649
|
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
1456
|
-
- scrollbar: A scrollbar's track. In the page while there is something to scroll its way.
|
|
2650
|
+
- scrollbar: A scrollbar's track, placed along its edge of the area. In the page while there is something to scroll its way.
|
|
1457
2651
|
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
1458
2652
|
- `data-hovering`: Present while the pointer is over the area.
|
|
1459
2653
|
- `data-scrolling`: Present while the area is scrolled its way.
|
|
1460
|
-
- thumb: The part of a scrollbar that shows where the view is, and can be dragged.
|
|
1461
|
-
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
1462
2654
|
- `--scroll-area-thumb-height`: A vertical thumb's height.
|
|
1463
2655
|
- `--scroll-area-thumb-width`: A horizontal thumb's width.
|
|
2656
|
+
- thumb: The part of a scrollbar that shows where the view is, and can be dragged. As long as its scrollbar's variable says.
|
|
2657
|
+
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
1464
2658
|
|
|
1465
2659
|
### Select
|
|
1466
2660
|
|
|
@@ -1470,20 +2664,69 @@ import { Select } from "@kirana-ui/vue/select"
|
|
|
1470
2664
|
|
|
1471
2665
|
Parts: `<Select.Root>`, `<Select.Trigger>`, `<Select.Value>`, `<Select.Portal>`, `<Select.Positioner>`, `<Select.Popup>`, `<Select.List>`, `<Select.ScrollUpArrow>`, `<Select.ScrollDownArrow>`, `<Select.Group>`, `<Select.GroupLabel>`, `<Select.Separator>`, `<Select.Item>`, `<Select.ItemText>`, `<Select.ItemIndicator>`.
|
|
1472
2666
|
|
|
2667
|
+
Anatomy:
|
|
2668
|
+
|
|
2669
|
+
```
|
|
2670
|
+
<Select.Root>
|
|
2671
|
+
<Select.Trigger>
|
|
2672
|
+
<Select.Value>
|
|
2673
|
+
<Select.Portal>
|
|
2674
|
+
<Select.Positioner>
|
|
2675
|
+
<Select.Popup>
|
|
2676
|
+
<Select.ScrollUpArrow>
|
|
2677
|
+
<Select.List> (optional)
|
|
2678
|
+
<Select.Group> (optional, repeated)
|
|
2679
|
+
<Select.GroupLabel>
|
|
2680
|
+
<Select.Item> (repeated)
|
|
2681
|
+
<Select.ItemText>
|
|
2682
|
+
<Select.ItemIndicator>
|
|
2683
|
+
<Select.Separator> (repeated)
|
|
2684
|
+
<Select.ScrollDownArrow>
|
|
2685
|
+
```
|
|
2686
|
+
|
|
1473
2687
|
Props of its root:
|
|
1474
2688
|
|
|
1475
|
-
- `value?: Value | null`: The chosen value; `null` is "none".
|
|
1476
|
-
- `defaultValue?: Value | null`
|
|
1477
|
-
- `
|
|
1478
|
-
- `
|
|
1479
|
-
- `
|
|
1480
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
1481
|
-
- `disabled?: boolean`
|
|
2689
|
+
- `value?: Value | null`: `v-model:value`. The chosen value; `null` is "none".
|
|
2690
|
+
- `defaultValue?: Value | null`: The value it starts with, when the caller does not hold `value`. Read once.
|
|
2691
|
+
- `open?: boolean`: `v-model:open`. Whether the list is open, when the caller holds it.
|
|
2692
|
+
- `defaultOpen?: boolean`: Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
2693
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1482
2694
|
- `required?: boolean`: In a field, "none" is then wrong.
|
|
1483
2695
|
- `name?: string`: With a name, the value is submitted with the form around it.
|
|
1484
2696
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
1485
|
-
- `items?: readonly { value: Value; label: string }[]
|
|
2697
|
+
- `items?: readonly { value: Value; label: string }[] | Readonly<Record<string, string>>`: The labels of the values, for the trigger to show before the list has ever been opened: a list of values with their labels, or, for values that are text, the labels by value (`{ apple: "Apple" }`). Not needed for the list itself: its items are read from the markup.
|
|
2698
|
+
- `multiple?: boolean`: Several values: an item chosen is added, chosen again taken away, and the list stays open. The values are `values`, not `value`.
|
|
2699
|
+
- `values?: readonly Value[]`: `v-model:values`. With `multiple`: the chosen values, in the order they were chosen.
|
|
2700
|
+
- `defaultValues?: readonly Value[]`: With `multiple`: the values it starts with, when the caller does not hold `values`. Read once.
|
|
1486
2701
|
- `virtualized?: ListCollection`: Every row, when only some are in the page (a virtualizer draws the ones in view). Each item is then given its `index`.
|
|
2702
|
+
- `@value-change: (value: Value | null, details: ChangeDetails) => void`: Heard as a value is about to be chosen: `details.cancel()` keeps it as it was.
|
|
2703
|
+
- `@values-change: (value: Value[], details: ChangeDetails) => void`: With `multiple`: heard as a value is about to be added or taken away, with the values there would then be: `details.cancel()` keeps them as they were.
|
|
2704
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as the list is about to open or close: `details.cancel()` keeps it as it was.
|
|
2705
|
+
|
|
2706
|
+
Each part, and its own props:
|
|
2707
|
+
|
|
2708
|
+
- `<Select.Root>` draws no element. Generic: `<Value = unknown>`. Holds the select: its value and whether the list is open. Its props are above.
|
|
2709
|
+
- `<Select.Trigger>` draws a `<button>`.
|
|
2710
|
+
- `<Select.Value>` draws a `<span>`. Its default slot is also given `value: Value | null`, `label: string`, `values: readonly Value[]`, `labels: readonly string[]`.
|
|
2711
|
+
- `placeholder?: string`: What it shows while nothing is chosen.
|
|
2712
|
+
- `<Select.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
2713
|
+
- `<Select.Positioner>` draws a `<div>`. Takes the positioner options ("Positioner options", above).
|
|
2714
|
+
- `alignItemWithTrigger?: boolean`: Opens the list over its trigger, the chosen item's text on the trigger's own.
|
|
2715
|
+
- `<Select.Popup>` draws a `<div>`.
|
|
2716
|
+
- `<Select.List>` draws a `<div>`. The items' own box inside the popup, when the popup holds more than its items: the listbox, and what scrolls.
|
|
2717
|
+
- `<Select.ScrollUpArrow>` draws a `<div>`.
|
|
2718
|
+
- `<Select.ScrollDownArrow>` draws a `<div>`.
|
|
2719
|
+
- `<Select.Group>` draws a `<div>`. Items that belong together, named by their label.
|
|
2720
|
+
- `<Select.GroupLabel>` draws a `<div>`. The name of a group. Outside a group it is plain text, and names nothing.
|
|
2721
|
+
- `<Select.Separator>` draws a `<div>`. A line between groups.
|
|
2722
|
+
- `<Select.Item>` draws a `<div>`.
|
|
2723
|
+
- `disabled?: boolean`: Disables this item: it cannot be chosen, and the arrows pass over it.
|
|
2724
|
+
- `label?: string`: What typeahead matches and the trigger shows; the item's text when left out.
|
|
2725
|
+
- `index?: number`: Its place among all the rows, in a virtualized list.
|
|
2726
|
+
- `value: unknown`: Required. What the select's value is while this item is the chosen one.
|
|
2727
|
+
- `<Select.ItemText>` draws a `<span>`. The item's name: what the trigger shows once it is chosen.
|
|
2728
|
+
- `<Select.ItemIndicator>` draws a `<span>`. A mark an item shows while it is chosen.
|
|
2729
|
+
- `keepMounted?: boolean`: Keeps the mark in the page while its item is not chosen.
|
|
1487
2730
|
|
|
1488
2731
|
Attributes and CSS variables, by part:
|
|
1489
2732
|
|
|
@@ -1491,12 +2734,12 @@ Attributes and CSS variables, by part:
|
|
|
1491
2734
|
- `data-popup-open`: Present when the list is open.
|
|
1492
2735
|
- `data-placeholder`: Present while nothing is chosen.
|
|
1493
2736
|
- `data-disabled`: Present when it is disabled.
|
|
1494
|
-
- value: The chosen value's label, or the placeholder.
|
|
2737
|
+
- value: The chosen value's label, or the placeholder. With several values, their labels with commas between.
|
|
1495
2738
|
- `data-placeholder`: Present while nothing is chosen.
|
|
1496
2739
|
- positioner: Places the list against the trigger. It carries the geometry.
|
|
1497
2740
|
- `data-open`: Present when it is open.
|
|
1498
2741
|
- `data-closed`: Present when it is closed.
|
|
1499
|
-
- `data-side="top | right | bottom | left | none"`: The side of the trigger it is on, after any flip; `none` when it lies over the trigger.
|
|
2742
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end | none"`: The side of the trigger it is on, after any flip; `none` when it lies over the trigger.
|
|
1500
2743
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1501
2744
|
- `--anchor-width`: The anchor's width.
|
|
1502
2745
|
- `--anchor-height`: The anchor's height.
|
|
@@ -1506,13 +2749,13 @@ Attributes and CSS variables, by part:
|
|
|
1506
2749
|
- scrollUpArrow: In the page while there is more of the list above: it scrolls the list while the pointer moves over it.
|
|
1507
2750
|
- `data-direction="up | down"`: The way it scrolls the list.
|
|
1508
2751
|
- `data-visible`: Present while there is more of the list its way.
|
|
1509
|
-
- `data-side="top | right | bottom | left | none"`: The side of the trigger the list is on; `none` when it lies over the trigger.
|
|
2752
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end | none"`: The side of the trigger the list is on; `none` when it lies over the trigger.
|
|
1510
2753
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1511
2754
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1512
2755
|
- scrollDownArrow: In the page while there is more of the list below: it scrolls the list while the pointer moves over it.
|
|
1513
2756
|
- `data-direction="up | down"`: The way it scrolls the list.
|
|
1514
2757
|
- `data-visible`: Present while there is more of the list its way.
|
|
1515
|
-
- `data-side="top | right | bottom | left | none"`: The side of the trigger the list is on; `none` when it lies over the trigger.
|
|
2758
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end | none"`: The side of the trigger the list is on; `none` when it lies over the trigger.
|
|
1516
2759
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1517
2760
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1518
2761
|
- popup: The list of items.
|
|
@@ -1520,10 +2763,10 @@ Attributes and CSS variables, by part:
|
|
|
1520
2763
|
- `data-closed`: Present when it is closed.
|
|
1521
2764
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1522
2765
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1523
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
2766
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1524
2767
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1525
2768
|
- item: One choice in the list.
|
|
1526
|
-
- `data-selected`: Present on the chosen item.
|
|
2769
|
+
- `data-selected`: Present on the chosen item, or on each of several.
|
|
1527
2770
|
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
1528
2771
|
- `data-disabled`: Present when it is disabled.
|
|
1529
2772
|
|
|
@@ -1535,7 +2778,9 @@ import { Separator } from "@kirana-ui/vue/separator"
|
|
|
1535
2778
|
|
|
1536
2779
|
Props:
|
|
1537
2780
|
|
|
1538
|
-
- `orientation?: Orientation
|
|
2781
|
+
- `orientation?: Orientation`: Whether the line lies across (the default) or stands upright: what a screen reader is told.
|
|
2782
|
+
|
|
2783
|
+
`<Separator>` draws a `<div>`.
|
|
1539
2784
|
|
|
1540
2785
|
Attributes and CSS variables, by part:
|
|
1541
2786
|
|
|
@@ -1550,25 +2795,46 @@ import { Slider } from "@kirana-ui/vue/slider"
|
|
|
1550
2795
|
|
|
1551
2796
|
Parts: `<Slider.Root>`, `<Slider.Value>`, `<Slider.Control>`, `<Slider.Track>`, `<Slider.Indicator>`, `<Slider.Thumb>`.
|
|
1552
2797
|
|
|
2798
|
+
Anatomy:
|
|
2799
|
+
|
|
2800
|
+
```
|
|
2801
|
+
<Slider.Root>
|
|
2802
|
+
<Slider.Value>
|
|
2803
|
+
<Slider.Control>
|
|
2804
|
+
<Slider.Track>
|
|
2805
|
+
<Slider.Indicator>
|
|
2806
|
+
<Slider.Thumb> (repeated)
|
|
2807
|
+
```
|
|
2808
|
+
|
|
1553
2809
|
Props of its root:
|
|
1554
2810
|
|
|
1555
|
-
- `value?: SliderValue`
|
|
1556
|
-
- `defaultValue?: SliderValue`: Read once. Default `min`.
|
|
1557
|
-
- `onValueChange?: ((value: number | number[], details: SliderChangeDetails) => void)`: Each step of a drag and each key.
|
|
1558
|
-
- `onValueCommitted?: ((value: number | number[], details: SliderChangeDetails) => void)`: When the pointer lets go, and after each key: the value to save.
|
|
1559
2811
|
- `min?: number`: Default 0.
|
|
1560
2812
|
- `max?: number`: Default 100.
|
|
1561
2813
|
- `step?: number`: Default 1.
|
|
1562
2814
|
- `largeStep?: number`: What Page Up, Page Down and an arrow with Shift move by. Default 10.
|
|
1563
2815
|
- `minStepsBetweenValues?: number`: How many steps two thumbs of a range stay apart. Default 0.
|
|
1564
|
-
- `orientation?: Orientation
|
|
2816
|
+
- `orientation?: Orientation`: Whether the track lies across (the default) or stands upright: the arrows that move a thumb follow.
|
|
1565
2817
|
- `thumbAlignment?: "center" | "edge" | "edge-client-only"`: Where a thumb is at the ends of its range. `"center"` (the default): its centre on the control's edge, so half of it lies outside. `"edge"`: its edge on the control's edge, so it stays inside. `"edge-client-only"` is the same here: nothing waits for the browser.
|
|
1566
|
-
- `disabled?: boolean
|
|
2818
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1567
2819
|
- `name?: string`: With a name, each thumb's value is submitted with the form around the slider.
|
|
1568
2820
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
1569
2821
|
- `format?: Intl.NumberFormatOptions`: How a value is written.
|
|
1570
2822
|
- `locale?: string`: The language a value is written in; the page's by default.
|
|
1571
|
-
- `getAriaValueText?: (
|
|
2823
|
+
- `getAriaValueText?: (text: string, value: number, index: number) => string`: What assistive technology reads for a thumb, when the written value is not enough.
|
|
2824
|
+
- `value?: Value`: `v-model:value`. One number for a slider with one thumb, a list for a range.
|
|
2825
|
+
- `defaultValue?: Value`: Read once. Default `min`.
|
|
2826
|
+
- `@value-change: (value: SliderTold<Value>, details: SliderChangeDetails) => void`: Each step of a drag and each key.
|
|
2827
|
+
- `@value-committed: (value: RootValue<Value>, details: SliderChangeDetails) => void`: The change is done: the pointer was let go, or a key moved a thumb.
|
|
2828
|
+
|
|
2829
|
+
Each part, and its own props:
|
|
2830
|
+
|
|
2831
|
+
- `<Slider.Root>` draws a `<div>`. Generic: `<Value extends SliderValue = SliderValue>`. Its props are above.
|
|
2832
|
+
- `<Slider.Value>` draws a `<output>`. Its default slot is also given `text: string`, `values: readonly number[]`.
|
|
2833
|
+
- `<Slider.Control>` draws a `<div>`.
|
|
2834
|
+
- `<Slider.Track>` draws a `<div>`.
|
|
2835
|
+
- `<Slider.Indicator>` draws a `<div>`.
|
|
2836
|
+
- `<Slider.Thumb>` draws a `<div>`.
|
|
2837
|
+
- `index?: number`: Which value of a range the thumb is, from 0; its place among the thumbs when left out.
|
|
1572
2838
|
|
|
1573
2839
|
Attributes and CSS variables, by part:
|
|
1574
2840
|
|
|
@@ -1594,7 +2860,7 @@ Attributes and CSS variables, by part:
|
|
|
1594
2860
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
1595
2861
|
- `--start-position`: With thumbs that stay inside the control: where the filled part starts, or with one thumb where it ends.
|
|
1596
2862
|
- `--relative-size`: With thumbs that stay inside the control and a range: the filled part's length.
|
|
1597
|
-
- thumb: What is dragged, and what the keyboard moves: a slider to assistive technology. Its place on the track is written on it. It holds a hidden input, which a form reads.
|
|
2863
|
+
- thumb: What is dragged, and what the keyboard moves: a slider to assistive technology. Its place on the track is written on it. It holds a hidden input, which a form reads. A thumb that is given no `index` is the value at its place among the slider's thumbs, in the order they are written.
|
|
1598
2864
|
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
1599
2865
|
- `data-disabled`: Present when it is disabled.
|
|
1600
2866
|
- `data-dragging`: Present while a pointer holds a thumb.
|
|
@@ -1609,17 +2875,29 @@ import { Switch } from "@kirana-ui/vue/switch"
|
|
|
1609
2875
|
|
|
1610
2876
|
Parts: `<Switch.Root>`, `<Switch.Thumb>`.
|
|
1611
2877
|
|
|
2878
|
+
Anatomy:
|
|
2879
|
+
|
|
2880
|
+
```
|
|
2881
|
+
<Switch.Root>
|
|
2882
|
+
<Switch.Thumb>
|
|
2883
|
+
```
|
|
2884
|
+
|
|
1612
2885
|
Props of its root:
|
|
1613
2886
|
|
|
1614
|
-
- `checked?: boolean`
|
|
2887
|
+
- `checked?: boolean`: `v-model:checked`. Whether it is checked, when the caller holds it.
|
|
1615
2888
|
- `defaultChecked?: boolean`: Read once.
|
|
1616
|
-
- `
|
|
1617
|
-
- `disabled?: boolean`
|
|
2889
|
+
- `disabled?: boolean`: Disabled: it cannot be changed.
|
|
1618
2890
|
- `readOnly?: boolean`: Shown as it is, focusable, not changeable.
|
|
1619
|
-
- `required?: boolean`
|
|
2891
|
+
- `required?: boolean`: Needed: in a `Field`, leaving it unchecked is then invalid.
|
|
1620
2892
|
- `name?: string`: With a name, the control is submitted with the form around it when it is checked.
|
|
1621
2893
|
- `form?: string`: The id of the form the control belongs to, when it is not inside it.
|
|
1622
2894
|
- `value?: string`: What is submitted. Default `"on"`, as a native checkbox's.
|
|
2895
|
+
- `@checked-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to be checked or unchecked: `details.cancel()` keeps it as it was.
|
|
2896
|
+
|
|
2897
|
+
Each part, and its own props:
|
|
2898
|
+
|
|
2899
|
+
- `<Switch.Root>` draws a `<span>`. Its props are above.
|
|
2900
|
+
- `<Switch.Thumb>` draws a `<span>`.
|
|
1623
2901
|
|
|
1624
2902
|
Attributes and CSS variables, by part:
|
|
1625
2903
|
|
|
@@ -1644,12 +2922,36 @@ import { Tabs } from "@kirana-ui/vue/tabs"
|
|
|
1644
2922
|
|
|
1645
2923
|
Parts: `<Tabs.Root>`, `<Tabs.List>`, `<Tabs.Tab>`, `<Tabs.Indicator>`, `<Tabs.Panel>`.
|
|
1646
2924
|
|
|
2925
|
+
Anatomy:
|
|
2926
|
+
|
|
2927
|
+
```
|
|
2928
|
+
<Tabs.Root>
|
|
2929
|
+
<Tabs.List>
|
|
2930
|
+
<Tabs.Tab> (repeated)
|
|
2931
|
+
<Tabs.Indicator>
|
|
2932
|
+
<Tabs.Panel> (repeated)
|
|
2933
|
+
```
|
|
2934
|
+
|
|
1647
2935
|
Props of its root:
|
|
1648
2936
|
|
|
1649
|
-
- `value?: Value | null`: The active tab's value; `null` is "none".
|
|
2937
|
+
- `value?: Value | null`: `v-model:value`. The active tab's value; `null` is "none".
|
|
1650
2938
|
- `defaultValue?: Value | null`: Read once. Without one, the first tab that can be chosen is, once the page is there.
|
|
1651
|
-
- `
|
|
1652
|
-
- `
|
|
2939
|
+
- `orientation?: Orientation`: Whether the tabs are laid out across (the default) or down: the arrows that move between them follow.
|
|
2940
|
+
- `@value-change: (value: Value, details: ChangeDetails) => void`: Told a tab's own value, never `null`: tabs do not go back to none.
|
|
2941
|
+
|
|
2942
|
+
Each part, and its own props:
|
|
2943
|
+
|
|
2944
|
+
- `<Tabs.Root>` draws a `<div>`. Generic: `<Value = unknown>`. Its props are above.
|
|
2945
|
+
- `<Tabs.List>` draws a `<div>`.
|
|
2946
|
+
- `activateOnFocus?: boolean`: Whether moving focus onto a tab with the arrows activates it. Default `false`.
|
|
2947
|
+
- `loop?: boolean`: Whether the arrows wrap from the last tab to the first. Default `true`.
|
|
2948
|
+
- `<Tabs.Tab>` draws a `<button>`.
|
|
2949
|
+
- `disabled?: boolean`: Disables this tab: it cannot be chosen.
|
|
2950
|
+
- `value: unknown`: Required. What the tabs' value is while this tab is the active one.
|
|
2951
|
+
- `<Tabs.Indicator>` draws a `<span>`.
|
|
2952
|
+
- `<Tabs.Panel>` draws a `<div>`.
|
|
2953
|
+
- `value: unknown`: Required. The value of the tab this panel belongs to.
|
|
2954
|
+
- `keepMounted?: boolean`: Keeps the panel in the page, `hidden`, while its tab is not the active one.
|
|
1653
2955
|
|
|
1654
2956
|
Attributes and CSS variables, by part:
|
|
1655
2957
|
|
|
@@ -1687,12 +2989,39 @@ import { Toast } from "@kirana-ui/vue/toast"
|
|
|
1687
2989
|
|
|
1688
2990
|
Parts: `<Toast.Viewport>`, `<Toast.List>`, `<Toast.Root>`, `<Toast.Content>`, `<Toast.Title>`, `<Toast.Description>`, `<Toast.Close>`, `<Toast.Action>`.
|
|
1689
2991
|
|
|
2992
|
+
Anatomy:
|
|
2993
|
+
|
|
2994
|
+
```
|
|
2995
|
+
<Toast.Viewport>
|
|
2996
|
+
<Toast.List>
|
|
2997
|
+
<Toast.Root> (repeated)
|
|
2998
|
+
<Toast.Content> (optional)
|
|
2999
|
+
<Toast.Title>
|
|
3000
|
+
<Toast.Description>
|
|
3001
|
+
<Toast.Close>
|
|
3002
|
+
<Toast.Action>
|
|
3003
|
+
```
|
|
3004
|
+
|
|
1690
3005
|
Props of its root:
|
|
1691
3006
|
|
|
1692
|
-
- `
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
3007
|
+
- `toast: ToastRecord`: Required. The toast it draws, as `Toast.List` gives it.
|
|
3008
|
+
|
|
3009
|
+
Each part, and its own props:
|
|
3010
|
+
|
|
3011
|
+
- `<Toast.Viewport>` draws a `<div>`.
|
|
3012
|
+
- `toaster: Toaster<Content>`: Required. The toaster whose toasts are drawn: one made with `createToaster()`. Needed.
|
|
3013
|
+
- `label?: string`: What the region of toasts is called, for assistive technology. Default: `"Notifications"`.
|
|
3014
|
+
- `hotkey?: string`: The key that takes focus to the toasts. Default: `"F6"`.
|
|
3015
|
+
- `swipeDirection?: "left" | "right" | "up" | "down"`: The way a toast is dragged to close it. Default: `"right"`.
|
|
3016
|
+
- `<Toast.List>` draws no element. The toasts in the page: each is given to draw its root. Its default slot is also given `toast: ToastRecord`.
|
|
3017
|
+
- `<Toast.Root>` draws a `<div>`. Its props are above.
|
|
3018
|
+
- `<Toast.Content>` draws a `<div>`.
|
|
3019
|
+
- `<Toast.Title>` draws a `<div>`. What the toast is called: the title it was added with, when nothing else is written in it.
|
|
3020
|
+
- `<Toast.Description>` draws a `<div>`. What the toast says: the description it was added with, when nothing else is written in it.
|
|
3021
|
+
- `<Toast.Close>` draws a `<button>`. Closes the toast.
|
|
3022
|
+
- `<Toast.Action>` draws a `<button>`. A button of the toast's own: the action it was added with, when nothing else is written in it. Pressing it closes the toast too, unless the action refuses.
|
|
3023
|
+
|
|
3024
|
+
A page's toasts are a toaster's, made once in a module: `import { createToaster } from "@kirana-ui/vue"`, then `export const toaster = createToaster(options)` (`ToasterOptions`, under "Types"). The viewport is given it, and anything on the page adds to it: `toaster.add({ title, description, action, priority })`, `toaster.update(id, options)`, `toaster.dismiss(id)`, `toaster.promise(promise, { loading, success, error })`. What each takes and gives back is `Toaster`, `ToastOptions`, `ToastActionOptions` and `ToastRecord` under "Types".
|
|
1696
3025
|
|
|
1697
3026
|
Attributes and CSS variables, by part:
|
|
1698
3027
|
|
|
@@ -1724,11 +3053,13 @@ import { Toggle } from "@kirana-ui/vue/toggle"
|
|
|
1724
3053
|
|
|
1725
3054
|
Props:
|
|
1726
3055
|
|
|
1727
|
-
- `pressed?: boolean`
|
|
3056
|
+
- `pressed?: boolean`: `v-model:pressed`. Whether it is pressed, when the caller holds it.
|
|
1728
3057
|
- `defaultPressed?: boolean`: Read once.
|
|
1729
|
-
- `
|
|
1730
|
-
- `disabled?: boolean`
|
|
3058
|
+
- `disabled?: boolean`: Disabled: a press does nothing.
|
|
1731
3059
|
- `value?: unknown`: In a toggle group: what the group's value holds while this one is pressed.
|
|
3060
|
+
- `@pressed-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to be pressed or released: `details.cancel()` keeps it as it was.
|
|
3061
|
+
|
|
3062
|
+
`<Toggle>` draws a `<button>`.
|
|
1732
3063
|
|
|
1733
3064
|
Attributes and CSS variables, by part:
|
|
1734
3065
|
|
|
@@ -1744,13 +3075,15 @@ import { ToggleGroup } from "@kirana-ui/vue/toggle-group"
|
|
|
1744
3075
|
|
|
1745
3076
|
Props:
|
|
1746
3077
|
|
|
1747
|
-
- `value?: readonly Value[]`: The values of the pressed toggles: none, one, or with `multiple` several.
|
|
1748
|
-
- `defaultValue?: readonly Value[]`
|
|
1749
|
-
- `onValueChange?: ((value: Value[], details: ChangeDetails) => void)`
|
|
3078
|
+
- `value?: readonly Value[]`: `v-model:value`. The values of the pressed toggles: none, one, or with `multiple` several.
|
|
3079
|
+
- `defaultValue?: readonly Value[]`: The values pressed at the start, when the caller does not hold `value`. Read once.
|
|
1750
3080
|
- `multiple?: boolean`: Whether more than one can be pressed at a time.
|
|
1751
|
-
- `disabled?: boolean
|
|
1752
|
-
- `orientation?: Orientation
|
|
3081
|
+
- `disabled?: boolean`: Disables every toggle of the group.
|
|
3082
|
+
- `orientation?: Orientation`: Whether the toggles are laid out across (the default) or down: the arrows that move between them follow.
|
|
1753
3083
|
- `loop?: boolean`: Whether the arrows go round from the last toggle to the first. Default: they do.
|
|
3084
|
+
- `@value-change: (value: Value[], details: ChangeDetails) => void`: Heard as a toggle is about to be pressed or released, with the values that would then be pressed: `details.cancel()` keeps them as they were.
|
|
3085
|
+
|
|
3086
|
+
`<ToggleGroup>` draws a `<div>`. Generic: `<Value = unknown>`.
|
|
1754
3087
|
|
|
1755
3088
|
Attributes and CSS variables, by part:
|
|
1756
3089
|
|
|
@@ -1767,11 +3100,34 @@ import { Toolbar } from "@kirana-ui/vue/toolbar"
|
|
|
1767
3100
|
|
|
1768
3101
|
Parts: `<Toolbar.Root>`, `<Toolbar.Button>`, `<Toolbar.Link>`, `<Toolbar.Input>`, `<Toolbar.Group>`, `<Toolbar.Separator>`.
|
|
1769
3102
|
|
|
3103
|
+
Anatomy:
|
|
3104
|
+
|
|
3105
|
+
```
|
|
3106
|
+
<Toolbar.Root>
|
|
3107
|
+
<Toolbar.Group> (optional, repeated)
|
|
3108
|
+
<Toolbar.Button> (repeated)
|
|
3109
|
+
<Toolbar.Link> (repeated)
|
|
3110
|
+
<Toolbar.Input> (repeated)
|
|
3111
|
+
<Toolbar.Separator> (repeated)
|
|
3112
|
+
```
|
|
3113
|
+
|
|
1770
3114
|
Props of its root:
|
|
1771
3115
|
|
|
1772
|
-
- `orientation?: Orientation
|
|
3116
|
+
- `orientation?: Orientation`: Whether the controls are laid out across (the default) or down: the arrows that move between them follow.
|
|
1773
3117
|
- `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
|
|
1774
|
-
- `disabled?: boolean
|
|
3118
|
+
- `disabled?: boolean`: Disables every control of the toolbar.
|
|
3119
|
+
|
|
3120
|
+
Each part, and its own props:
|
|
3121
|
+
|
|
3122
|
+
- `<Toolbar.Root>` draws a `<div>`. Its props are above.
|
|
3123
|
+
- `<Toolbar.Button>` draws a `<button>`.
|
|
3124
|
+
- `disabled?: boolean`: Disables this control.
|
|
3125
|
+
- `<Toolbar.Link>` draws a `<a>`.
|
|
3126
|
+
- `<Toolbar.Input>` draws a `<input>`.
|
|
3127
|
+
- `disabled?: boolean`: Disables this control.
|
|
3128
|
+
- `<Toolbar.Group>` draws a `<div>`.
|
|
3129
|
+
- `disabled?: boolean`: Disables this control.
|
|
3130
|
+
- `<Toolbar.Separator>` draws a `<div>`.
|
|
1775
3131
|
|
|
1776
3132
|
Attributes and CSS variables, by part:
|
|
1777
3133
|
|
|
@@ -1801,14 +3157,36 @@ import { Tooltip } from "@kirana-ui/vue/tooltip"
|
|
|
1801
3157
|
|
|
1802
3158
|
Parts: `<Tooltip.Root>`, `<Tooltip.Trigger>`, `<Tooltip.Portal>`, `<Tooltip.Positioner>`, `<Tooltip.Popup>`, `<Tooltip.Arrow>`.
|
|
1803
3159
|
|
|
3160
|
+
Anatomy:
|
|
3161
|
+
|
|
3162
|
+
```
|
|
3163
|
+
<Tooltip.Root>
|
|
3164
|
+
<Tooltip.Trigger>
|
|
3165
|
+
<Tooltip.Portal>
|
|
3166
|
+
<Tooltip.Positioner>
|
|
3167
|
+
<Tooltip.Popup>
|
|
3168
|
+
<Tooltip.Arrow>
|
|
3169
|
+
```
|
|
3170
|
+
|
|
1804
3171
|
Props of its root:
|
|
1805
3172
|
|
|
1806
|
-
- `open?: boolean`
|
|
1807
|
-
- `defaultOpen?: boolean`
|
|
1808
|
-
- `onOpenChange?: ((open: boolean, details: ChangeDetails) => void)`
|
|
3173
|
+
- `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
|
|
3174
|
+
- `defaultOpen?: boolean`: Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1809
3175
|
- `delay?: number`: How long the pointer rests on the trigger before the popup opens, in milliseconds.
|
|
1810
3176
|
- `closeDelay?: number`: How long after the pointer leaves the popup closes, in milliseconds.
|
|
1811
|
-
- `disabled?: boolean
|
|
3177
|
+
- `disabled?: boolean`: Disabled: the pointer and focus do not open it.
|
|
3178
|
+
- `@open-change: (value: boolean, details: ChangeDetails) => void`: Heard as it is about to open or close: `details.cancel()` keeps it as it was.
|
|
3179
|
+
|
|
3180
|
+
Each part, and its own props:
|
|
3181
|
+
|
|
3182
|
+
- `<Tooltip.Root>` draws no element. Holds the tooltip: whether it is open. Its props are above.
|
|
3183
|
+
- `<Tooltip.Trigger>` draws a `<button>`.
|
|
3184
|
+
- `delay?: number`: How long the pointer rests on this trigger before the popup opens: before the root's.
|
|
3185
|
+
- `closeDelay?: number`: How long after the pointer leaves the popup closes: before the root's.
|
|
3186
|
+
- `<Tooltip.Portal>` draws no element. A portal takes nothing: where it is drawn is its `PortalProvider`'s to say.
|
|
3187
|
+
- `<Tooltip.Positioner>` draws a `<div>`. A positioner's own props: where its popup goes, and what it is placed against. Takes the positioner options ("Positioner options", above).
|
|
3188
|
+
- `<Tooltip.Popup>` draws a `<div>`.
|
|
3189
|
+
- `<Tooltip.Arrow>` draws a `<div>`.
|
|
1812
3190
|
|
|
1813
3191
|
Attributes and CSS variables, by part:
|
|
1814
3192
|
|
|
@@ -1817,7 +3195,7 @@ Attributes and CSS variables, by part:
|
|
|
1817
3195
|
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
1818
3196
|
- `data-open`: Present when it is open.
|
|
1819
3197
|
- `data-closed`: Present when it is closed.
|
|
1820
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
3198
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1821
3199
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1822
3200
|
- `--anchor-width`: The anchor's width.
|
|
1823
3201
|
- `--anchor-height`: The anchor's height.
|
|
@@ -1829,10 +3207,10 @@ Attributes and CSS variables, by part:
|
|
|
1829
3207
|
- `data-closed`: Present when it is closed.
|
|
1830
3208
|
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1831
3209
|
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1832
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
3210
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1833
3211
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1834
3212
|
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
1835
3213
|
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
1836
|
-
- `data-side="top | right | bottom | left"`: The side of the anchor it is on, after any flip.
|
|
3214
|
+
- `data-side="top | right | bottom | left | inline-start | inline-end"`: The side of the anchor it is on, after any flip. Asked for as `inline-start` or `inline-end`, it says one of those two when it is beside its anchor.
|
|
1837
3215
|
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1838
3216
|
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|