@kirana-ui/vue 0.1.0 → 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.
Files changed (160) hide show
  1. package/llms.txt +3216 -0
  2. package/package.json +124 -2
  3. package/skills/kirana-ui-primitives/SKILL.md +142 -0
  4. package/src/accordion.d.ts +42 -75
  5. package/src/accordion.js +4 -2
  6. package/src/accordion.js.map +1 -1
  7. package/src/agent.d.ts +1 -0
  8. package/src/agent.js +1 -0
  9. package/src/alert-dialog.d.ts +3 -2
  10. package/src/autocomplete.d.ts +4 -0
  11. package/src/autocomplete.js +1 -0
  12. package/src/autosize.d.ts +12 -0
  13. package/src/autosize.js +24 -0
  14. package/src/autosize.js.map +1 -0
  15. package/src/avatar.d.ts +10 -13
  16. package/src/avatar.js.map +1 -1
  17. package/src/button.d.ts +4 -21
  18. package/src/button.js.map +1 -1
  19. package/src/calendar.d.ts +73 -0
  20. package/src/calendar.js +130 -0
  21. package/src/calendar.js.map +1 -0
  22. package/src/carousel.d.ts +39 -0
  23. package/src/carousel.js +75 -0
  24. package/src/carousel.js.map +1 -0
  25. package/src/checkbox.d.ts +28 -48
  26. package/src/checkbox.js +4 -2
  27. package/src/checkbox.js.map +1 -1
  28. package/src/collapsible.d.ts +26 -36
  29. package/src/collapsible.js.map +1 -1
  30. package/src/combobox.d.ts +147 -0
  31. package/src/combobox.js +296 -0
  32. package/src/combobox.js.map +1 -0
  33. package/src/command.d.ts +46 -0
  34. package/src/command.js +129 -0
  35. package/src/command.js.map +1 -0
  36. package/src/context-menu.d.ts +4 -0
  37. package/src/context-menu.js +1 -0
  38. package/src/date-field.d.ts +40 -0
  39. package/src/date-field.js +81 -0
  40. package/src/date-field.js.map +1 -0
  41. package/src/date-picker.d.ts +89 -0
  42. package/src/date-picker.js +82 -0
  43. package/src/date-picker.js.map +1 -0
  44. package/src/dialog.d.ts +77 -78
  45. package/src/dialog.js +58 -1
  46. package/src/dialog.js.map +1 -1
  47. package/src/direction.d.ts +5 -8
  48. package/src/direction.js.map +1 -1
  49. package/src/drawer.d.ts +3 -0
  50. package/src/drawer.js +1 -0
  51. package/src/element.d.ts +23 -0
  52. package/src/element.js +90 -0
  53. package/src/element.js.map +1 -0
  54. package/src/field.d.ts +63 -45
  55. package/src/field.js +3 -2
  56. package/src/field.js.map +1 -1
  57. package/src/fieldset.d.ts +12 -13
  58. package/src/fieldset.js.map +1 -1
  59. package/src/form.d.ts +5 -15
  60. package/src/form.js.map +1 -1
  61. package/src/hover-card.d.ts +29 -35
  62. package/src/hover-card.js.map +1 -1
  63. package/src/hover-popup.d.ts +27 -38
  64. package/src/hover-popup.js +45 -26
  65. package/src/hover-popup.js.map +1 -1
  66. package/src/index.d.ts +37 -2
  67. package/src/index.js +26 -2
  68. package/src/input.d.ts +17 -0
  69. package/src/input.js +36 -0
  70. package/src/input.js.map +1 -0
  71. package/src/label.d.ts +5 -0
  72. package/src/label.js +18 -0
  73. package/src/label.js.map +1 -0
  74. package/src/listbox.d.ts +37 -0
  75. package/src/listbox.js +104 -0
  76. package/src/listbox.js.map +1 -0
  77. package/src/menu.d.ts +179 -0
  78. package/src/menu.js +235 -0
  79. package/src/menu.js.map +1 -0
  80. package/src/menubar-context.d.ts +5 -0
  81. package/src/menubar-context.js +6 -0
  82. package/src/menubar-context.js.map +1 -0
  83. package/src/menubar.d.ts +8 -0
  84. package/src/menubar.js +34 -0
  85. package/src/menubar.js.map +1 -0
  86. package/src/message-scroller.d.ts +26 -0
  87. package/src/message-scroller.js +34 -0
  88. package/src/message-scroller.js.map +1 -0
  89. package/src/meter.d.ts +10 -31
  90. package/src/meter.js.map +1 -1
  91. package/src/navigation-menu.d.ts +80 -0
  92. package/src/navigation-menu.js +118 -0
  93. package/src/navigation-menu.js.map +1 -0
  94. package/src/number-field.d.ts +75 -0
  95. package/src/number-field.js +81 -0
  96. package/src/number-field.js.map +1 -0
  97. package/src/otp.d.ts +37 -0
  98. package/src/otp.js +86 -0
  99. package/src/otp.js.map +1 -0
  100. package/src/pagination.d.ts +34 -0
  101. package/src/pagination.js +70 -0
  102. package/src/pagination.js.map +1 -0
  103. package/src/popover.d.ts +64 -35
  104. package/src/popover.js +34 -6
  105. package/src/popover.js.map +1 -1
  106. package/src/primitive.d.ts +21 -0
  107. package/src/primitive.js +27 -0
  108. package/src/primitive.js.map +1 -0
  109. package/src/progress.d.ts +28 -31
  110. package/src/progress.js.map +1 -1
  111. package/src/qr-code.d.ts +15 -0
  112. package/src/qr-code.js +34 -0
  113. package/src/qr-code.js.map +1 -0
  114. package/src/radio-group.d.ts +37 -73
  115. package/src/radio-group.js +4 -2
  116. package/src/radio-group.js.map +1 -1
  117. package/src/resizable.d.ts +29 -0
  118. package/src/resizable.js +62 -0
  119. package/src/resizable.js.map +1 -0
  120. package/src/runtime.d.ts +97 -6
  121. package/src/runtime.js +43 -25
  122. package/src/runtime.js.map +1 -1
  123. package/src/scroll-area.d.ts +37 -0
  124. package/src/scroll-area.js +63 -0
  125. package/src/scroll-area.js.map +1 -0
  126. package/src/select.d.ts +91 -116
  127. package/src/select.js +99 -10
  128. package/src/select.js.map +1 -1
  129. package/src/separator.d.ts +4 -9
  130. package/src/separator.js.map +1 -1
  131. package/src/slider.d.ts +61 -76
  132. package/src/slider.js +12 -10
  133. package/src/slider.js.map +1 -1
  134. package/src/switch.d.ts +21 -37
  135. package/src/switch.js +4 -2
  136. package/src/switch.js.map +1 -1
  137. package/src/tabs.d.ts +44 -98
  138. package/src/tabs.js.map +1 -1
  139. package/src/testing.d.ts +1 -0
  140. package/src/testing.js +1 -0
  141. package/src/toast.d.ts +61 -0
  142. package/src/toast.js +95 -0
  143. package/src/toast.js.map +1 -0
  144. package/src/toggle-group.d.ts +10 -0
  145. package/src/toggle-group.js +46 -0
  146. package/src/toggle-group.js.map +1 -0
  147. package/src/toggle.d.ts +9 -25
  148. package/src/toggle.js +19 -4
  149. package/src/toggle.js.map +1 -1
  150. package/src/toolbar-context.d.ts +8 -0
  151. package/src/toolbar-context.js +8 -0
  152. package/src/toolbar-context.js.map +1 -0
  153. package/src/toolbar.d.ts +34 -0
  154. package/src/toolbar.js +55 -0
  155. package/src/toolbar.js.map +1 -0
  156. package/src/tooltip.d.ts +29 -35
  157. package/src/tooltip.js.map +1 -1
  158. package/src/value-bar.d.ts +26 -35
  159. package/src/value-bar.js +10 -3
  160. package/src/value-bar.js.map +1 -1
package/llms.txt ADDED
@@ -0,0 +1,3216 @@
1
+ # @kirana-ui/vue
2
+
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
+
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"]`
311
+
312
+ ## Using it
313
+
314
+ - Each component is a namespace of parts: `<Dialog.Root>`, `<Dialog.Trigger>`. A component with one part is the component: `<Button>`.
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`.
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.
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.
333
+ - A boolean state is an attribute that is present or absent (`[data-open]`), never `="false"`.
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.
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.
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.
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.
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.
339
+
340
+ ## Components
341
+
342
+ ### Accordion
343
+
344
+ ```
345
+ import { Accordion } from "@kirana-ui/vue/accordion"
346
+ ```
347
+
348
+ Parts: `<Accordion.Root>`, `<Accordion.Item>`, `<Accordion.Header>`, `<Accordion.Trigger>`, `<Accordion.Panel>`.
349
+
350
+ Anatomy:
351
+
352
+ ```
353
+ <Accordion.Root>
354
+ <Accordion.Item> (repeated)
355
+ <Accordion.Header>
356
+ <Accordion.Trigger>
357
+ <Accordion.Panel>
358
+ ```
359
+
360
+ Props of its root:
361
+
362
+ - `value?: readonly Value[]`: `v-model:value`. The values of the open items.
363
+ - `defaultValue?: readonly Value[]`: Read once.
364
+ - `multiple?: boolean`: Whether several items can be open at once. Default `false`: opening one closes the others.
365
+ - `disabled?: boolean`: Disables every item: none can be opened or closed.
366
+ - `orientation?: Orientation`: The way the arrows move between triggers. Default `vertical`.
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`.
380
+
381
+ Attributes and CSS variables, by part:
382
+
383
+ - root: Groups the items.
384
+ - `data-orientation="horizontal | vertical"`: The way the items are laid out, and the arrows that move between their triggers.
385
+ - `data-disabled`: Present when it is disabled.
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.
387
+ - `data-open`: Present when the item is open.
388
+ - `data-disabled`: Present when it is disabled.
389
+ - header: The heading that holds the trigger.
390
+ - `data-open`: Present when the item is open.
391
+ - `data-disabled`: Present when it is disabled.
392
+ - trigger: The button that opens and closes the item's panel.
393
+ - `data-panel-open`: Present when the item's panel is open.
394
+ - `data-disabled`: Present when it is disabled.
395
+ - panel: The item's content. In the page while open, and through its exit's motion.
396
+ - `data-open`: Present when it is open.
397
+ - `data-closed`: Present when it is closed.
398
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
399
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
400
+ - `data-disabled`: Present when it is disabled.
401
+ - `data-orientation="horizontal | vertical"`: The way the items are laid out, and the arrows that move between their triggers.
402
+ - `--accordion-panel-height`: The panel's content height while it opens or closes, `auto` once it is open.
403
+ - `--accordion-panel-width`: The panel's content width while it opens or closes, `auto` once it is open.
404
+
405
+ ### AlertDialog
406
+
407
+ ```
408
+ import { AlertDialog } from "@kirana-ui/vue/alert-dialog"
409
+ ```
410
+
411
+ Parts: `<AlertDialog.Root>`, `<AlertDialog.Trigger>`, `<AlertDialog.Portal>`, `<AlertDialog.Backdrop>`, `<AlertDialog.Popup>`, `<AlertDialog.Title>`, `<AlertDialog.Description>`, `<AlertDialog.Close>`.
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
+
443
+ Attributes and CSS variables, by part:
444
+
445
+ - trigger: The button that opens the dialog.
446
+ - `data-popup-open`: Present when the dialog is open.
447
+ - backdrop: The layer over the page behind the dialog.
448
+ - `data-open`: Present when it is open.
449
+ - `data-closed`: Present when it is closed.
450
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
451
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
452
+ - popup: The dialog itself.
453
+ - `data-open`: Present when it is open.
454
+ - `data-closed`: Present when it is closed.
455
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
456
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
457
+ - `data-nested-dialog-open`: Present when another dialog is open above this one.
458
+ - `--nested-dialogs`: How many dialogs are open above this one.
459
+
460
+ ### Autocomplete
461
+
462
+ ```
463
+ import { Autocomplete } from "@kirana-ui/vue/autocomplete"
464
+ ```
465
+
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
+ ```
486
+
487
+ Props of its root:
488
+
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.
492
+ - `mode?: "list" | "none"`: `"list"` (the default): the suggestions are filtered by what is typed. `"none"`: they are as the caller draws them.
493
+ - `filter?: ((label: string, query: string) => boolean) | null`: Whether a suggestion is shown for what was typed; `null` shows every one.
494
+ - `openOnInputClick?: boolean`: Whether a press on the input opens the list. Default: it opens when something is typed.
495
+ - `disabled?: boolean`: Disabled: it cannot be changed.
496
+ - `required?: boolean`: Needed: in a `Field`, leaving it empty is then invalid.
497
+ - `name?: string`: The input's name in the form around it.
498
+ - `form?: string`: The id of the form the control belongs to, when it is not inside it.
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.
525
+
526
+ Attributes and CSS variables, by part:
527
+
528
+ - input: The text input: its text is the value, and what is typed asks for suggestions.
529
+ - `data-popup-open`: Present when the list is open.
530
+ - `data-disabled`: Present when it is disabled.
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.
532
+ - `data-popup-open`: Present when the list is open.
533
+ - `data-disabled`: Present when it is disabled.
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.
535
+ - `data-open`: Present when it is open.
536
+ - `data-closed`: Present when it is closed.
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.
538
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
539
+ - `--anchor-width`: The anchor's width.
540
+ - `--anchor-height`: The anchor's height.
541
+ - `--available-width`: The width between the anchor and the edge of the viewport.
542
+ - `--available-height`: The height between the anchor and the edge of the viewport.
543
+ - `--transform-origin`: The point of the popup nearest its anchor, to scale from.
544
+ - popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
545
+ - `data-open`: Present when it is open.
546
+ - `data-closed`: Present when it is closed.
547
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
548
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
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.
550
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
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.
554
+ - item: One suggestion: chosen, its text is written into the input.
555
+ - `data-selected`: Present on the chosen item.
556
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
557
+ - `data-disabled`: Present when it is disabled.
558
+ - clear: A button that empties the input and the value.
559
+ - `data-disabled`: Present when it is disabled.
560
+
561
+ ### Autosize
562
+
563
+ ```
564
+ import { Autosize } from "@kirana-ui/vue/autosize"
565
+ ```
566
+
567
+ Parts: `<Autosize.Textarea>`.
568
+
569
+ Anatomy:
570
+
571
+ ```
572
+ <Autosize.Textarea>
573
+ ```
574
+
575
+ Props of its root:
576
+
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.
582
+
583
+ ### Avatar
584
+
585
+ ```
586
+ import { Avatar } from "@kirana-ui/vue/avatar"
587
+ ```
588
+
589
+ Parts: `<Avatar.Root>`, `<Avatar.Image>`, `<Avatar.Fallback>`.
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
+
606
+ ### Button
607
+
608
+ ```
609
+ import { Button } from "@kirana-ui/vue/button"
610
+ ```
611
+
612
+ Props:
613
+
614
+ - `disabled?: boolean`: Disabled: a press does nothing.
615
+ - `focusableWhenDisabled?: boolean`: Keeps a disabled button in the tab order, so what it would do can still be read.
616
+ - `nativeButton?: boolean`: `false` when the element is not a `<button>`: it is given a button's role and keyboard.
617
+
618
+ `<Button>` draws a `<button>`.
619
+
620
+ Attributes and CSS variables, by part:
621
+
622
+ - root: The button.
623
+ - `data-disabled`: Present when it is disabled.
624
+
625
+ ### Calendar
626
+
627
+ ```
628
+ import { Calendar } from "@kirana-ui/vue/calendar"
629
+ ```
630
+
631
+ Parts: `<Calendar.Root>`, `<Calendar.Heading>`, `<Calendar.Previous>`, `<Calendar.Next>`, `<Calendar.Grid>`, `<Calendar.Weekdays>`, `<Calendar.HeadCell>`, `<Calendar.Weeks>`, `<Calendar.Cell>`, `<Calendar.Day>`.
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
+
648
+ Props of its root:
649
+
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.
652
+ - `mode?: "single" | "range"`: Whether one day is chosen (the default) or a first and a last.
653
+ - `defaultFocusedValue?: IsoDate`: The day it opens on, when it has no value: its month is the one shown.
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.
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.
656
+ - `min?: IsoDate`: The first and the last day that can be chosen.
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.
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.
680
+
681
+ Attributes and CSS variables, by part:
682
+
683
+ - root: The calendar.
684
+ - `data-disabled`: Present when it is disabled.
685
+ - `data-readonly`: Present when its value cannot be changed.
686
+ - previous: Shows the month before.
687
+ - `data-disabled`: Present when it is disabled.
688
+ - next: Shows the month after.
689
+ - `data-disabled`: Present when it is disabled.
690
+ - cell: A day's cell.
691
+ - `data-selected`: Present on a chosen day, and on every day of a chosen range.
692
+ - `data-today`: Present on today.
693
+ - `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
694
+ - `data-disabled`: Present when it is disabled.
695
+ - `data-unavailable`: Present on a day that cannot be chosen.
696
+ - `data-range-start`: Present on the first day of a range.
697
+ - `data-range-end`: Present on the last day of a range.
698
+ - day: The button for a day.
699
+ - `data-selected`: Present on a chosen day, and on every day of a chosen range.
700
+ - `data-today`: Present on today.
701
+ - `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
702
+ - `data-disabled`: Present when it is disabled.
703
+ - `data-unavailable`: Present on a day that cannot be chosen.
704
+ - `data-range-start`: Present on the first day of a range.
705
+ - `data-range-end`: Present on the last day of a range.
706
+
707
+ ### Carousel
708
+
709
+ ```
710
+ import { Carousel } from "@kirana-ui/vue/carousel"
711
+ ```
712
+
713
+ Parts: `<Carousel.Root>`, `<Carousel.Viewport>`, `<Carousel.Item>`, `<Carousel.Previous>`, `<Carousel.Next>`, `<Carousel.Indicator>`.
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
+
726
+ Props of its root:
727
+
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.
730
+ - `orientation?: Orientation`: Whether the slides go across (the default) or down.
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.
744
+
745
+ Attributes and CSS variables, by part:
746
+
747
+ - root: The carousel: a region, named by the caller.
748
+ - `data-orientation="horizontal | vertical"`: Whether the slides go across or down.
749
+ - viewport: What scrolls. The slides are its children; the design snaps them (`scroll-snap-type`) and says whether a step glides (`scroll-behavior`).
750
+ - `data-orientation="horizontal | vertical"`: Whether the slides go across or down.
751
+ - item: One slide.
752
+ - `data-orientation="horizontal | vertical"`: Whether the slides go across or down.
753
+ - `data-current`: Present on the slide the view is at, and on its button.
754
+ - previous: Goes back a slide.
755
+ - `data-disabled`: Present when it is disabled.
756
+ - next: Goes on a slide.
757
+ - `data-disabled`: Present when it is disabled.
758
+ - indicator: A button for one slide.
759
+ - `data-current`: Present on the slide the view is at, and on its button.
760
+
761
+ ### Checkbox
762
+
763
+ ```
764
+ import { Checkbox } from "@kirana-ui/vue/checkbox"
765
+ ```
766
+
767
+ Parts: `<Checkbox.Root>`, `<Checkbox.Indicator>`.
768
+
769
+ Anatomy:
770
+
771
+ ```
772
+ <Checkbox.Root>
773
+ <Checkbox.Indicator>
774
+ ```
775
+
776
+ Props of its root:
777
+
778
+ - `checked?: boolean`: `v-model:checked`. Whether it is checked, when the caller holds it.
779
+ - `defaultChecked?: boolean`: Read once.
780
+ - `disabled?: boolean`: Disabled: it cannot be changed.
781
+ - `readOnly?: boolean`: Shown as it is, focusable, not changeable.
782
+ - `required?: boolean`: Needed: in a `Field`, leaving it unchecked is then invalid.
783
+ - `name?: string`: With a name, the control is submitted with the form around it when it is checked.
784
+ - `form?: string`: The id of the form the control belongs to, when it is not inside it.
785
+ - `value?: string`: What is submitted. Default `"on"`, as a native checkbox's.
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.
794
+
795
+ Attributes and CSS variables, by part:
796
+
797
+ - root: The box. It holds a hidden native checkbox, which a form and a label reach.
798
+ - `data-checked`: Present when it is checked.
799
+ - `data-unchecked`: Present when it is not checked.
800
+ - `data-indeterminate`: Present when it is neither checked nor unchecked.
801
+ - `data-disabled`: Present when it is disabled.
802
+ - `data-readonly`: Present when it can be read but not changed.
803
+ - `data-required`: Present when the form needs it.
804
+ - indicator: The mark. In the page while the box is checked or indeterminate.
805
+ - `data-checked`: Present when it is checked.
806
+ - `data-unchecked`: Present when it is not checked.
807
+ - `data-indeterminate`: Present when it is neither checked nor unchecked.
808
+ - `data-disabled`: Present when it is disabled.
809
+ - `data-readonly`: Present when it can be read but not changed.
810
+ - `data-required`: Present when the form needs it.
811
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
812
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
813
+
814
+ ### Collapsible
815
+
816
+ ```
817
+ import { Collapsible } from "@kirana-ui/vue/collapsible"
818
+ ```
819
+
820
+ Parts: `<Collapsible.Root>`, `<Collapsible.Trigger>`, `<Collapsible.Panel>`.
821
+
822
+ Anatomy:
823
+
824
+ ```
825
+ <Collapsible.Root>
826
+ <Collapsible.Trigger> (repeated)
827
+ <Collapsible.Panel>
828
+ ```
829
+
830
+ Props of its root:
831
+
832
+ - `open?: boolean`: `v-model:open`. Whether it is open, when the caller holds it.
833
+ - `defaultOpen?: boolean`: Read once.
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`.
843
+
844
+ Attributes and CSS variables, by part:
845
+
846
+ - root: Groups the trigger and the panel.
847
+ - `data-open`: Present when it is open.
848
+ - `data-closed`: Present when it is closed.
849
+ - `data-disabled`: Present when it is disabled.
850
+ - trigger: The button that opens and closes the panel.
851
+ - `data-panel-open`: Present when the panel is open.
852
+ - `data-disabled`: Present when it is disabled.
853
+ - panel: The content. In the page while open, and through its exit's motion.
854
+ - `data-open`: Present when it is open.
855
+ - `data-closed`: Present when it is closed.
856
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
857
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
858
+ - `--collapsible-panel-height`: The panel's content height while it opens or closes, `auto` once it is open.
859
+ - `--collapsible-panel-width`: The panel's content width while it opens or closes, `auto` once it is open.
860
+
861
+ ### Combobox
862
+
863
+ ```
864
+ import { Combobox } from "@kirana-ui/vue/combobox"
865
+ ```
866
+
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
+ ```
893
+
894
+ Props of its root:
895
+
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.
903
+ - `name?: string`: With a name, the value is submitted with the form around it.
904
+ - `form?: string`: The id of the form the control belongs to, when it is not inside it.
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.
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.
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`.
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.
910
+ - `required?: boolean`: In a field, "none" is then wrong.
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.
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.
945
+
946
+ Attributes and CSS variables, by part:
947
+
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.
949
+ - `data-popup-open`: Present when the list is open.
950
+ - `data-disabled`: Present when it is disabled.
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.
952
+ - `data-popup-open`: Present when the list is open.
953
+ - `data-disabled`: Present when it is disabled.
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.
955
+ - `data-open`: Present when it is open.
956
+ - `data-closed`: Present when it is closed.
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.
958
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
959
+ - `--anchor-width`: The anchor's width.
960
+ - `--anchor-height`: The anchor's height.
961
+ - `--available-width`: The width between the anchor and the edge of the viewport.
962
+ - `--available-height`: The height between the anchor and the edge of the viewport.
963
+ - `--transform-origin`: The point of the popup nearest its anchor, to scale from.
964
+ - popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
965
+ - `data-open`: Present when it is open.
966
+ - `data-closed`: Present when it is closed.
967
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
968
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
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.
970
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
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.
974
+ - item: One choice in the list.
975
+ - `data-selected`: Present on the chosen item.
976
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
977
+ - `data-disabled`: Present when it is disabled.
978
+ - clear: A button that empties the input and the value.
979
+ - `data-disabled`: Present when it is disabled.
980
+ - chipRemove: A chip's button that takes its value away.
981
+ - `data-disabled`: Present when it is disabled.
982
+
983
+ ### Command
984
+
985
+ ```
986
+ import { Command } from "@kirana-ui/vue/command"
987
+ ```
988
+
989
+ Parts: `<Command.Root>`, `<Command.Input>`, `<Command.List>`, `<Command.Empty>`, `<Command.Group>`, `<Command.GroupHeading>`, `<Command.Item>`, `<Command.Separator>`.
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
+
1004
+ Props of its root:
1005
+
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.
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.
1009
+ - `loop?: boolean`: Whether a step past an end of the list goes round to the other.
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.
1029
+
1030
+ Attributes and CSS variables, by part:
1031
+
1032
+ - root: A list of commands with the input that filters it.
1033
+ - `data-disabled`: Present when it is disabled.
1034
+ - input: The text input. What is typed filters the list; focus stays in it.
1035
+ - `data-disabled`: Present when it is disabled.
1036
+ - list: The commands.
1037
+ - `data-empty`: Present when no item is shown for what was typed.
1038
+ - item: One command.
1039
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1040
+ - `data-disabled`: Present when it is disabled.
1041
+
1042
+ ### ContextMenu
1043
+
1044
+ ```
1045
+ import { ContextMenu } from "@kirana-ui/vue/context-menu"
1046
+ ```
1047
+
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>`.
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
+
1074
+ Props of its root:
1075
+
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.
1078
+ - `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
1079
+ - `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
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>`.
1131
+
1132
+ Attributes and CSS variables, by part:
1133
+
1134
+ - trigger: The area a secondary press, or a long press on a touch screen, opens the menu in.
1135
+ - `data-popup-open`: Present when the menu is open.
1136
+ - positioner: Places the menu against its trigger. It carries the geometry.
1137
+ - `data-open`: Present when it is open.
1138
+ - `data-closed`: Present when it is closed.
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.
1140
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1141
+ - `--anchor-width`: The anchor's width.
1142
+ - `--anchor-height`: The anchor's height.
1143
+ - `--available-width`: The width between the anchor and the edge of the viewport.
1144
+ - `--available-height`: The height between the anchor and the edge of the viewport.
1145
+ - `--transform-origin`: The point of the popup nearest its anchor, to scale from.
1146
+ - popup: The menu itself: the list of items.
1147
+ - `data-open`: Present when it is open.
1148
+ - `data-closed`: Present when it is closed.
1149
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
1150
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
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.
1152
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1153
+ - arrow: An element that points at the trigger.
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.
1155
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1156
+ - `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
1157
+ - item: An action. Choosing it closes the menu.
1158
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1159
+ - `data-disabled`: Present when it is disabled.
1160
+ - linkItem: An item that is a link. Choosing it follows the link and closes the menu.
1161
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1162
+ - `data-disabled`: Present when it is disabled.
1163
+ - checkboxItem: An item that is checked or not. Choosing it leaves the menu open.
1164
+ - `data-checked`: Present when it is checked.
1165
+ - `data-unchecked`: Present when it is not checked.
1166
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1167
+ - `data-disabled`: Present when it is disabled.
1168
+ - checkboxItemIndicator: A mark a checkbox item shows while it is checked.
1169
+ - `data-checked`: Present when it is checked.
1170
+ - `data-unchecked`: Present when it is not checked.
1171
+ - radioGroup: Radio items of which one is chosen.
1172
+ - `data-disabled`: Present when it is disabled.
1173
+ - radioItem: One choice of a radio group. Choosing it leaves the menu open.
1174
+ - `data-checked`: Present when it is checked.
1175
+ - `data-unchecked`: Present when it is not checked.
1176
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1177
+ - `data-disabled`: Present when it is disabled.
1178
+ - radioItemIndicator: A mark a radio item shows while it is the chosen one.
1179
+ - `data-checked`: Present when it is checked.
1180
+ - `data-unchecked`: Present when it is not checked.
1181
+ - submenuTrigger: An item that opens a menu beside it.
1182
+ - `data-popup-open`: Present when its menu is open.
1183
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1184
+ - `data-disabled`: Present when it is disabled.
1185
+
1186
+ ### DateField
1187
+
1188
+ ```
1189
+ import { DateField } from "@kirana-ui/vue/date-field"
1190
+ ```
1191
+
1192
+ Parts: `<DateField.Root>`, `<DateField.Segments>`, `<DateField.Segment>`, `<DateField.Input>`.
1193
+
1194
+ Anatomy:
1195
+
1196
+ ```
1197
+ <DateField.Root>
1198
+ <DateField.Segments>
1199
+ <DateField.Segment> (repeated)
1200
+ <DateField.Input>
1201
+ ```
1202
+
1203
+ Props of its root:
1204
+
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.
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.
1208
+ - `min?: IsoDate`: The first and the last day it takes: outside them it says it is invalid.
1209
+ - `max?: IsoDate`: The last day it takes.
1210
+ - `placeholders?: Partial<Record<DateUnit, string>>`: What an empty part shows. Default: `dd`, `mm`, `yyyy`.
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.
1214
+ - `name?: string`: The name it is submitted under, by its hidden input.
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.
1225
+
1226
+ Attributes and CSS variables, by part:
1227
+
1228
+ - root: The field: a group of the date's parts.
1229
+ - `data-disabled`: Present when it is disabled.
1230
+ - `data-readonly`: Present when its value cannot be changed.
1231
+ - `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
1232
+ - segment: One piece of the date: a part that is typed, or what stands between two.
1233
+ - `data-segment="day | month | year | literal"`: Which piece it is.
1234
+ - `data-placeholder`: Present on a part that is empty.
1235
+ - `data-disabled`: Present when it is disabled.
1236
+ - `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
1237
+
1238
+ ### DatePicker
1239
+
1240
+ ```
1241
+ import { DatePicker } from "@kirana-ui/vue/date-picker"
1242
+ ```
1243
+
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>`.
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
+
1270
+ Props of its root:
1271
+
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.
1276
+ - `locale?: string`: The language and region of the field and the calendar. Give it: a server does not know.
1277
+ - `min?: IsoDate`: The first and the last day that can be typed or picked.
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.
1281
+ - `fixedWeeks?: boolean`: Always six rows of days.
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.
1286
+ - `name?: string`: The name it is submitted under.
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.
1316
+
1317
+ Attributes and CSS variables, by part:
1318
+
1319
+ - field: The field: a group of the date's parts.
1320
+ - `data-disabled`: Present when it is disabled.
1321
+ - `data-readonly`: Present when its value cannot be changed.
1322
+ - `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
1323
+ - segment: One piece of the date: a part that is typed, or what stands between two.
1324
+ - `data-segment="day | month | year | literal"`: Which piece it is.
1325
+ - `data-placeholder`: Present on a part that is empty.
1326
+ - `data-disabled`: Present when it is disabled.
1327
+ - `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
1328
+ - trigger: The button that opens the popover, and what it is placed against.
1329
+ - `data-popup-open`: Present when the popover is open.
1330
+ - positioner: Places the popup against the trigger. It carries the geometry.
1331
+ - `data-open`: Present when it is open.
1332
+ - `data-closed`: Present when it is closed.
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.
1334
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1335
+ - `--anchor-width`: The anchor's width.
1336
+ - `--anchor-height`: The anchor's height.
1337
+ - `--available-width`: The width between the anchor and the edge of the viewport.
1338
+ - `--available-height`: The height between the anchor and the edge of the viewport.
1339
+ - `--transform-origin`: The point of the popup nearest its anchor, to scale from.
1340
+ - popup: The popover itself.
1341
+ - `data-open`: Present when it is open.
1342
+ - `data-closed`: Present when it is closed.
1343
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
1344
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
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.
1346
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1347
+ - calendar: The calendar.
1348
+ - `data-disabled`: Present when it is disabled.
1349
+ - `data-readonly`: Present when its value cannot be changed.
1350
+ - previous: Shows the month before.
1351
+ - `data-disabled`: Present when it is disabled.
1352
+ - next: Shows the month after.
1353
+ - `data-disabled`: Present when it is disabled.
1354
+ - cell: A day's cell.
1355
+ - `data-selected`: Present on a chosen day, and on every day of a chosen range.
1356
+ - `data-today`: Present on today.
1357
+ - `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
1358
+ - `data-disabled`: Present when it is disabled.
1359
+ - `data-unavailable`: Present on a day that cannot be chosen.
1360
+ - `data-range-start`: Present on the first day of a range.
1361
+ - `data-range-end`: Present on the last day of a range.
1362
+ - day: The button for a day.
1363
+ - `data-selected`: Present on a chosen day, and on every day of a chosen range.
1364
+ - `data-today`: Present on today.
1365
+ - `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
1366
+ - `data-disabled`: Present when it is disabled.
1367
+ - `data-unavailable`: Present on a day that cannot be chosen.
1368
+ - `data-range-start`: Present on the first day of a range.
1369
+ - `data-range-end`: Present on the last day of a range.
1370
+
1371
+ ### Dialog
1372
+
1373
+ ```
1374
+ import { Dialog } from "@kirana-ui/vue/dialog"
1375
+ ```
1376
+
1377
+ Parts: `<Dialog.Root>`, `<Dialog.Trigger>`, `<Dialog.Portal>`, `<Dialog.Backdrop>`, `<Dialog.Popup>`, `<Dialog.Title>`, `<Dialog.Description>`, `<Dialog.Close>`.
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
+
1392
+ Props of its root:
1393
+
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.
1396
+ - `modal?: boolean`: Blocks the page behind it and traps focus. Default `true`.
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.
1410
+
1411
+ Attributes and CSS variables, by part:
1412
+
1413
+ - trigger: The button that opens the dialog.
1414
+ - `data-popup-open`: Present when the dialog is open.
1415
+ - backdrop: The layer over the page behind the dialog.
1416
+ - `data-open`: Present when it is open.
1417
+ - `data-closed`: Present when it is closed.
1418
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
1419
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
1420
+ - popup: The dialog itself.
1421
+ - `data-open`: Present when it is open.
1422
+ - `data-closed`: Present when it is closed.
1423
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
1424
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
1425
+ - `data-nested-dialog-open`: Present when another dialog is open above this one.
1426
+ - `--nested-dialogs`: How many dialogs are open above this one.
1427
+
1428
+ ### Drawer
1429
+
1430
+ ```
1431
+ import { Drawer } from "@kirana-ui/vue/drawer"
1432
+ ```
1433
+
1434
+ Parts: `<Drawer.Root>`, `<Drawer.Trigger>`, `<Drawer.Portal>`, `<Drawer.Backdrop>`, `<Drawer.Popup>`, `<Drawer.Title>`, `<Drawer.Description>`, `<Drawer.Close>`.
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
+
1449
+ Props of its root:
1450
+
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.
1453
+ - `modal?: boolean`: Blocks the page behind it and traps focus. Default `true`.
1454
+ - `dismissible?: boolean`: Whether a press outside closes it. Default `true`.
1455
+ - `swipeDirection?: DrawerSide`: The way it is dragged to close it: the edge it came from. Default: `"down"`.
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.
1457
+ - `snapPoint?: DrawerSnapPoint`: `v-model:snapPoint`. Which of them it rests at, as it was given.
1458
+ - `defaultSnapPoint?: DrawerSnapPoint`: Where it opens. Default: the smallest.
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.
1472
+
1473
+ Attributes and CSS variables, by part:
1474
+
1475
+ - trigger: The button that opens the dialog.
1476
+ - `data-popup-open`: Present when the dialog is open.
1477
+ - backdrop: The layer over the page behind the dialog.
1478
+ - `data-open`: Present when it is open.
1479
+ - `data-closed`: Present when it is closed.
1480
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
1481
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
1482
+ - `data-swiping`: Present while the drawer is dragged.
1483
+ - `--drawer-swipe-movement-x`: How far it has been dragged across.
1484
+ - `--drawer-swipe-movement-y`: How far it has been dragged up or down.
1485
+ - `--drawer-swipe-progress`: How far it has been dragged, of its own size: 0 to 1.
1486
+ - `--drawer-snap-point-offset`: How far from whole it rests, towards the edge it closes at: 0px at its largest snap point.
1487
+ - popup: The drawer. A design moves it by what it says of the drag, and gives it `touch-action: none` where a finger drags it.
1488
+ - `data-open`: Present when it is open.
1489
+ - `data-closed`: Present when it is closed.
1490
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
1491
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
1492
+ - `data-nested-dialog-open`: Present when another dialog is open above this one.
1493
+ - `data-swiping`: Present while the drawer is dragged.
1494
+ - `data-swipe-direction="up | down | left | right"`: The way it is dragged to close it.
1495
+ - `data-swipe-dismiss`: Present once a drag has closed it.
1496
+ - `data-expanded`: Present while it rests whole, of several snap points.
1497
+ - `data-nested-drawer-open`: Present while another drawer is open over it.
1498
+ - `data-nested-drawer-swiping`: Present while a drawer over it is dragged.
1499
+ - `--nested-dialogs`: How many dialogs are open above this one.
1500
+ - `--drawer-swipe-movement-x`: How far it has been dragged across.
1501
+ - `--drawer-swipe-movement-y`: How far it has been dragged up or down.
1502
+ - `--drawer-swipe-progress`: How far it has been dragged, of its own size: 0 to 1.
1503
+ - `--drawer-snap-point-offset`: How far from whole it rests, towards the edge it closes at: 0px at its largest snap point.
1504
+ - `--drawer-height`: Its height.
1505
+ - `--nested-drawers`: How many drawers are open over it.
1506
+ - `--drawer-frontmost-height`: The height of the drawer in front of every other, while this one is open.
1507
+ - `--drawer-swipe-strength`: Once let go: 0.1 to 1, the share of the design's own time it should take to come to rest. A drawer thrown hard arrives sooner.
1508
+ - `--drawer-width`: Its width.
1509
+
1510
+ ### Field
1511
+
1512
+ ```
1513
+ import { Field } from "@kirana-ui/vue/field"
1514
+ ```
1515
+
1516
+ Parts: `<Field.Root>`, `<Field.Label>`, `<Field.Control>`, `<Field.Description>`, `<Field.Error>`, `<Field.Validity>`.
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
+
1529
+ Props of its root:
1530
+
1531
+ - `name?: string`: The control's name in the form.
1532
+ - `disabled?: boolean`: Disables the field: its control cannot be changed, and its parts say so (`data-disabled`).
1533
+ - `invalid?: boolean`: Invalid whatever the value: an error known from elsewhere.
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.
1535
+ - `validationMode?: ValidationMode`: When the value is checked; the form's by default, else `"onSubmit"`.
1536
+ - `validationDebounceTime?: number`: With `"onChange"`, how long the value must rest before it is checked, in milliseconds.
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
+
1548
+ Attributes and CSS variables, by part:
1549
+
1550
+ - root: A control with its label, its description and its errors.
1551
+ - `data-disabled`: Present when it is disabled.
1552
+ - `data-touched`: Present once focus has left the control.
1553
+ - `data-dirty`: Present while the value is not the one it started with.
1554
+ - `data-filled`: Present while the control has a value.
1555
+ - `data-focused`: Present while the control has focus.
1556
+ - `data-valid`: Present once the value has been checked and found right.
1557
+ - `data-invalid`: Present while the value is wrong.
1558
+ - label: The control's name: a press on it reaches the control.
1559
+ - `data-disabled`: Present when it is disabled.
1560
+ - `data-touched`: Present once focus has left the control.
1561
+ - `data-dirty`: Present while the value is not the one it started with.
1562
+ - `data-filled`: Present while the control has a value.
1563
+ - `data-focused`: Present while the control has focus.
1564
+ - `data-valid`: Present once the value has been checked and found right.
1565
+ - `data-invalid`: Present while the value is wrong.
1566
+ - control: The control: an input, a textarea or a select.
1567
+ - `data-disabled`: Present when it is disabled.
1568
+ - `data-touched`: Present once focus has left the control.
1569
+ - `data-dirty`: Present while the value is not the one it started with.
1570
+ - `data-filled`: Present while the control has a value.
1571
+ - `data-focused`: Present while the control has focus.
1572
+ - `data-valid`: Present once the value has been checked and found right.
1573
+ - `data-invalid`: Present while the value is wrong.
1574
+ - description: More about the control, said after its name.
1575
+ - `data-disabled`: Present when it is disabled.
1576
+ - `data-touched`: Present once focus has left the control.
1577
+ - `data-dirty`: Present while the value is not the one it started with.
1578
+ - `data-filled`: Present while the control has a value.
1579
+ - `data-focused`: Present while the control has focus.
1580
+ - `data-valid`: Present once the value has been checked and found right.
1581
+ - `data-invalid`: Present while the value is wrong.
1582
+ - error: What is wrong with the value. In the page while it applies.
1583
+ - `data-disabled`: Present when it is disabled.
1584
+ - `data-touched`: Present once focus has left the control.
1585
+ - `data-dirty`: Present while the value is not the one it started with.
1586
+ - `data-filled`: Present while the control has a value.
1587
+ - `data-focused`: Present while the control has focus.
1588
+ - `data-valid`: Present once the value has been checked and found right.
1589
+ - `data-invalid`: Present while the value is wrong.
1590
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
1591
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
1592
+
1593
+ ### Fieldset
1594
+
1595
+ ```
1596
+ import { Fieldset } from "@kirana-ui/vue/fieldset"
1597
+ ```
1598
+
1599
+ Parts: `<Fieldset.Root>`, `<Fieldset.Legend>`.
1600
+
1601
+ Anatomy:
1602
+
1603
+ ```
1604
+ <Fieldset.Root>
1605
+ <Fieldset.Legend>
1606
+ ```
1607
+
1608
+ Props of its root:
1609
+
1610
+ - `disabled?: boolean`: Disables every field inside.
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
+
1617
+ Attributes and CSS variables, by part:
1618
+
1619
+ - root: The group of fields.
1620
+ - `data-disabled`: Present when it is disabled.
1621
+ - legend: The group's name.
1622
+ - `data-disabled`: Present when it is disabled.
1623
+
1624
+ ### Form
1625
+
1626
+ ```
1627
+ import { Form } from "@kirana-ui/vue/form"
1628
+ ```
1629
+
1630
+ Props:
1631
+
1632
+ - `errors?: FormErrors`: Errors from outside the page (a server's), by field name. A field shows its own until its value changes.
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.
1635
+ - `validationMode?: ValidationMode`: When the form's fields check their values, unless a field says otherwise. Default `"onSubmit"`.
1636
+
1637
+ `<Form>` draws a `<form>`. `onFormSubmit` and `onClearErrors` are heard as `@form-submit` and `@clear-errors`.
1638
+
1639
+ ### HoverCard
1640
+
1641
+ ```
1642
+ import { HoverCard } from "@kirana-ui/vue/hover-card"
1643
+ ```
1644
+
1645
+ Parts: `<HoverCard.Root>`, `<HoverCard.Trigger>`, `<HoverCard.Portal>`, `<HoverCard.Positioner>`, `<HoverCard.Popup>`, `<HoverCard.Arrow>`.
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
+
1658
+ Props of its root:
1659
+
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.
1662
+ - `delay?: number`: How long the pointer rests on the trigger before the popup opens, in milliseconds.
1663
+ - `closeDelay?: number`: How long after the pointer leaves the popup closes, in milliseconds.
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>`.
1677
+
1678
+ Attributes and CSS variables, by part:
1679
+
1680
+ - trigger: The link the card previews.
1681
+ - `data-popup-open`: Present when the card is open.
1682
+ - positioner: Places the popup against the trigger. It carries the geometry.
1683
+ - `data-open`: Present when it is open.
1684
+ - `data-closed`: Present when it is closed.
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.
1686
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1687
+ - `--anchor-width`: The anchor's width.
1688
+ - `--anchor-height`: The anchor's height.
1689
+ - `--available-width`: The width between the anchor and the edge of the viewport.
1690
+ - `--available-height`: The height between the anchor and the edge of the viewport.
1691
+ - `--transform-origin`: The point of the popup nearest its anchor, to scale from.
1692
+ - popup: The card itself.
1693
+ - `data-open`: Present when it is open.
1694
+ - `data-closed`: Present when it is closed.
1695
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
1696
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
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.
1698
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1699
+ - `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
1700
+ - arrow: An element that points at the trigger, placed along the popup's edge.
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.
1702
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1703
+ - `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
1704
+
1705
+ ### Input
1706
+
1707
+ ```
1708
+ import { Input } from "@kirana-ui/vue/input"
1709
+ ```
1710
+
1711
+ Props:
1712
+
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>`.
1718
+
1719
+ Attributes and CSS variables, by part:
1720
+
1721
+ - input: A text input. Inside a field it is the field's control.
1722
+ - `data-disabled`: Present when it is disabled.
1723
+ - `data-touched`: Present once focus has left the input.
1724
+ - `data-dirty`: Present while the value is not the one it started with.
1725
+ - `data-filled`: Present while the input has a value.
1726
+ - `data-focused`: Present while the input has focus.
1727
+ - `data-valid`: In a field: present once the value was checked and found right.
1728
+ - `data-invalid`: In a field: present while the value is wrong.
1729
+
1730
+ ### Label
1731
+
1732
+ ```
1733
+ import { Label } from "@kirana-ui/vue/label"
1734
+ ```
1735
+
1736
+ `<Label>` draws a `<label>`.
1737
+
1738
+ Attributes and CSS variables, by part:
1739
+
1740
+ - label: A control's name. Inside a field it is the field's label, with its states.
1741
+ - `data-disabled`: Present when it is disabled.
1742
+ - `data-touched`: Present once focus has left the control.
1743
+ - `data-dirty`: Present while the value is not the one it started with.
1744
+ - `data-filled`: Present while the control has a value.
1745
+ - `data-focused`: Present while the control has focus.
1746
+ - `data-valid`: Present once the value has been checked and found right.
1747
+ - `data-invalid`: Present while the value is wrong.
1748
+
1749
+ ### Listbox
1750
+
1751
+ ```
1752
+ import { Listbox } from "@kirana-ui/vue/listbox"
1753
+ ```
1754
+
1755
+ Parts: `<Listbox.Root>`, `<Listbox.Item>`, `<Listbox.ItemIndicator>`, `<Listbox.Group>`, `<Listbox.GroupLabel>`.
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
+
1767
+ Props of its root:
1768
+
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.
1771
+ - `multiple?: boolean`: Whether more than one can be chosen: a press then adds or takes away.
1772
+ - `disabled?: boolean`: Disabled: no item can be chosen.
1773
+ - `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do not.
1774
+ - `name?: string`: With a name, the chosen values are submitted with the form around the list.
1775
+ - `form?: string`: The id of the form the list belongs to, when it is not inside it.
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.
1791
+
1792
+ Attributes and CSS variables, by part:
1793
+
1794
+ - root: The list. It is one stop for Tab.
1795
+ - `data-disabled`: Present when it is disabled.
1796
+ - item: One choice in the list.
1797
+ - `data-selected`: Present on a chosen item.
1798
+ - `data-highlighted`: Present on the item the keyboard is on.
1799
+ - `data-disabled`: Present when it is disabled.
1800
+ - itemIndicator: A mark an item shows while it is chosen.
1801
+ - `data-selected`: Present on a chosen item.
1802
+
1803
+ ### Menu
1804
+
1805
+ ```
1806
+ import { Menu } from "@kirana-ui/vue/menu"
1807
+ ```
1808
+
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>`.
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
+
1835
+ Props of its root:
1836
+
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.
1839
+ - `disabled?: boolean`: The trigger cannot be pressed; a submenu's is passed over.
1840
+ - `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
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>`.
1892
+
1893
+ Attributes and CSS variables, by part:
1894
+
1895
+ - trigger: The button that opens the menu, and what it is placed against.
1896
+ - `data-popup-open`: Present when the menu is open.
1897
+ - `data-disabled`: Present when it is disabled.
1898
+ - positioner: Places the menu against its trigger. It carries the geometry.
1899
+ - `data-open`: Present when it is open.
1900
+ - `data-closed`: Present when it is closed.
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.
1902
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1903
+ - `--anchor-width`: The anchor's width.
1904
+ - `--anchor-height`: The anchor's height.
1905
+ - `--available-width`: The width between the anchor and the edge of the viewport.
1906
+ - `--available-height`: The height between the anchor and the edge of the viewport.
1907
+ - `--transform-origin`: The point of the popup nearest its anchor, to scale from.
1908
+ - popup: The menu itself: the list of items.
1909
+ - `data-open`: Present when it is open.
1910
+ - `data-closed`: Present when it is closed.
1911
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
1912
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
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.
1914
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1915
+ - arrow: An element that points at the trigger.
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.
1917
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
1918
+ - `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
1919
+ - item: An action. Choosing it closes the menu.
1920
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1921
+ - `data-disabled`: Present when it is disabled.
1922
+ - linkItem: An item that is a link. Choosing it follows the link and closes the menu.
1923
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1924
+ - `data-disabled`: Present when it is disabled.
1925
+ - checkboxItem: An item that is checked or not. Choosing it leaves the menu open.
1926
+ - `data-checked`: Present when it is checked.
1927
+ - `data-unchecked`: Present when it is not checked.
1928
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1929
+ - `data-disabled`: Present when it is disabled.
1930
+ - checkboxItemIndicator: A mark a checkbox item shows while it is checked.
1931
+ - `data-checked`: Present when it is checked.
1932
+ - `data-unchecked`: Present when it is not checked.
1933
+ - radioGroup: Radio items of which one is chosen.
1934
+ - `data-disabled`: Present when it is disabled.
1935
+ - radioItem: One choice of a radio group. Choosing it leaves the menu open.
1936
+ - `data-checked`: Present when it is checked.
1937
+ - `data-unchecked`: Present when it is not checked.
1938
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1939
+ - `data-disabled`: Present when it is disabled.
1940
+ - radioItemIndicator: A mark a radio item shows while it is the chosen one.
1941
+ - `data-checked`: Present when it is checked.
1942
+ - `data-unchecked`: Present when it is not checked.
1943
+ - submenuTrigger: An item that opens a menu beside it.
1944
+ - `data-popup-open`: Present when its menu is open.
1945
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
1946
+ - `data-disabled`: Present when it is disabled.
1947
+
1948
+ ### Menubar
1949
+
1950
+ ```
1951
+ import { Menubar } from "@kirana-ui/vue/menubar"
1952
+ ```
1953
+
1954
+ Props:
1955
+
1956
+ - `loop?: boolean`: Whether the arrows go round from the last menu to the first. Default: they do.
1957
+ - `disabled?: boolean`: No menu of the bar opens.
1958
+ - `orientation?: Orientation`: A row (the default) or a column of menus. In a column a menu opens beside its trigger.
1959
+
1960
+ `<Menubar>` draws a `<div>`.
1961
+
1962
+ Attributes and CSS variables, by part:
1963
+
1964
+ - root: The row of menus. A menu inside it is one of its items.
1965
+ - `data-disabled`: Present when it is disabled.
1966
+ - `data-orientation="horizontal | vertical"`: Whether its menus are in a row or a column.
1967
+
1968
+ ### MessageScroller
1969
+
1970
+ ```
1971
+ import { MessageScroller } from "@kirana-ui/vue/message-scroller"
1972
+ ```
1973
+
1974
+ Parts: `<MessageScroller.Root>`, `<MessageScroller.Viewport>`, `<MessageScroller.Content>`, `<MessageScroller.Button>`.
1975
+
1976
+ Anatomy:
1977
+
1978
+ ```
1979
+ <MessageScroller.Root>
1980
+ <MessageScroller.Viewport>
1981
+ <MessageScroller.Content>
1982
+ <MessageScroller.Button>
1983
+ ```
1984
+
1985
+ Props of its root:
1986
+
1987
+ - `initial?: "bottom" | "top"`: Where it begins: at the newest message (the default), or at the first.
1988
+ - `threshold?: number`: How near the end counts as at it, in pixels. Default: 24.
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>`.
1997
+
1998
+ Attributes and CSS variables, by part:
1999
+
2000
+ - root: What holds the conversation and its button.
2001
+ - `data-at-bottom`: Present while the newest message is in view.
2002
+ - viewport: What scrolls: a log, reached by the keyboard.
2003
+ - `data-at-bottom`: Present while the newest message is in view.
2004
+ - button: Goes to the newest message. Inert while that is in view.
2005
+ - `data-at-bottom`: Present while the newest message is in view.
2006
+
2007
+ ### Meter
2008
+
2009
+ ```
2010
+ import { Meter } from "@kirana-ui/vue/meter"
2011
+ ```
2012
+
2013
+ Parts: `<Meter.Root>`, `<Meter.Track>`, `<Meter.Indicator>`, `<Meter.Value>`, `<Meter.Label>`.
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
+
2042
+ ### NavigationMenu
2043
+
2044
+ ```
2045
+ import { NavigationMenu } from "@kirana-ui/vue/navigation-menu"
2046
+ ```
2047
+
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>`.
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
+
2070
+ Props of its root:
2071
+
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.
2074
+ - `delay?: number`: How long the pointer rests on a trigger before its content shows, in milliseconds.
2075
+ - `closeDelay?: number`: How long after the pointer leaves the content goes, in milliseconds.
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>`.
2097
+
2098
+ Attributes and CSS variables, by part:
2099
+
2100
+ - root: The navigation.
2101
+ - `data-orientation="horizontal | vertical"`: Whether the list is a row or a column.
2102
+ - list: The row of items.
2103
+ - `data-orientation="horizontal | vertical"`: Whether the list is a row or a column.
2104
+ - trigger: The button that shows an item's content.
2105
+ - `data-popup-open`: Present while the item's content is shown.
2106
+ - icon: A mark on a trigger that shows whether its content is open.
2107
+ - `data-popup-open`: Present while the item's content is shown.
2108
+ - content: What an item shows. It is drawn in the viewport every item shares.
2109
+ - `data-open`: Present when it is open.
2110
+ - `data-closed`: Present when it is closed.
2111
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
2112
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
2113
+ - `data-activation-direction="left | right"`: Which way it came from: the item before it, or after.
2114
+ - link: A link, in the list or in an item's content.
2115
+ - `data-active`: Present on the link of the page the reader is on.
2116
+ - positioner: Places the popup against the open item's trigger. It carries the geometry.
2117
+ - `data-open`: Present when it is open.
2118
+ - `data-closed`: Present when it is closed.
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.
2120
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
2121
+ - `--anchor-width`: The anchor's width.
2122
+ - `--anchor-height`: The anchor's height.
2123
+ - `--available-width`: The width between the anchor and the edge of the viewport.
2124
+ - `--available-height`: The height between the anchor and the edge of the viewport.
2125
+ - `--transform-origin`: The point of the popup nearest its anchor, to scale from.
2126
+ - `--positioner-width`: The open content's width.
2127
+ - `--positioner-height`: The open content's height.
2128
+ - popup: The panel every item's content is shown in.
2129
+ - `data-open`: Present when it is open.
2130
+ - `data-closed`: Present when it is closed.
2131
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
2132
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
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.
2134
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
2135
+ - `--popup-width`: The open content's width.
2136
+ - `--popup-height`: The open content's height.
2137
+ - arrow: An element that points at the open item's trigger.
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.
2139
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
2140
+ - `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
2141
+ - backdrop: An element behind the popup, for a design that dims the page.
2142
+ - `data-open`: Present when it is open.
2143
+ - `data-closed`: Present when it is closed.
2144
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
2145
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
2146
+
2147
+ ### NumberField
2148
+
2149
+ ```
2150
+ import { NumberField } from "@kirana-ui/vue/number-field"
2151
+ ```
2152
+
2153
+ Parts: `<NumberField.Root>`, `<NumberField.Group>`, `<NumberField.Input>`, `<NumberField.Increment>`, `<NumberField.Decrement>`.
2154
+
2155
+ Anatomy:
2156
+
2157
+ ```
2158
+ <NumberField.Root>
2159
+ <NumberField.Group>
2160
+ <NumberField.Input>
2161
+ <NumberField.Increment>
2162
+ <NumberField.Decrement>
2163
+ ```
2164
+
2165
+ Props of its root:
2166
+
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.
2170
+ - `step?: number`: What the buttons and the arrows move by. Default 1.
2171
+ - `smallStep?: number`: With Alt held. Default 0.1.
2172
+ - `largeStep?: number`: With Shift held. Default 10.
2173
+ - `snapOnStep?: boolean`: A step lands on a multiple of the step, counted from `min`.
2174
+ - `allowWheelScrub?: boolean`: The wheel steps it while the pointer is over the input and focus is in it.
2175
+ - `format?: Intl.NumberFormatOptions`: How the number is written.
2176
+ - `locale?: string`: The language it is written in; the page's by default.
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.
2180
+ - `name?: string`: With a name, the number is submitted with the form around it.
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>`.
2193
+
2194
+ Attributes and CSS variables, by part:
2195
+
2196
+ - root: Groups the number field's parts.
2197
+ - `data-disabled`: Present when it is disabled.
2198
+ - `data-readonly`: Present when the number cannot be changed.
2199
+ - `data-required`: Present when a number must be given.
2200
+ - `data-touched`: Present once focus has left the input.
2201
+ - `data-dirty`: Present while the number is not the one it started with.
2202
+ - `data-filled`: Present while there is a number.
2203
+ - `data-focused`: Present while the input has focus.
2204
+ - `data-valid`: In a field: present once the number was checked and found right.
2205
+ - `data-invalid`: In a field: present while the number is wrong.
2206
+ - group: What holds the input and its buttons, as one control.
2207
+ - `data-disabled`: Present when it is disabled.
2208
+ - `data-readonly`: Present when the number cannot be changed.
2209
+ - `data-required`: Present when a number must be given.
2210
+ - `data-touched`: Present once focus has left the input.
2211
+ - `data-dirty`: Present while the number is not the one it started with.
2212
+ - `data-filled`: Present while there is a number.
2213
+ - `data-focused`: Present while the input has focus.
2214
+ - `data-valid`: In a field: present once the number was checked and found right.
2215
+ - `data-invalid`: In a field: present while the number is wrong.
2216
+ - input: The text input: it takes what its locale writes a number with.
2217
+ - `data-disabled`: Present when it is disabled.
2218
+ - `data-readonly`: Present when the number cannot be changed.
2219
+ - `data-required`: Present when a number must be given.
2220
+ - `data-touched`: Present once focus has left the input.
2221
+ - `data-dirty`: Present while the number is not the one it started with.
2222
+ - `data-filled`: Present while there is a number.
2223
+ - `data-focused`: Present while the input has focus.
2224
+ - `data-valid`: In a field: present once the number was checked and found right.
2225
+ - `data-invalid`: In a field: present while the number is wrong.
2226
+ - increment: A button that steps the number up. Held, it goes on.
2227
+ - `data-disabled`: Present when it is disabled.
2228
+ - `data-readonly`: Present when the number cannot be changed.
2229
+ - `data-required`: Present when a number must be given.
2230
+ - `data-touched`: Present once focus has left the input.
2231
+ - `data-dirty`: Present while the number is not the one it started with.
2232
+ - `data-filled`: Present while there is a number.
2233
+ - `data-focused`: Present while the input has focus.
2234
+ - `data-valid`: In a field: present once the number was checked and found right.
2235
+ - `data-invalid`: In a field: present while the number is wrong.
2236
+ - decrement: A button that steps the number down. Held, it goes on.
2237
+ - `data-disabled`: Present when it is disabled.
2238
+ - `data-readonly`: Present when the number cannot be changed.
2239
+ - `data-required`: Present when a number must be given.
2240
+ - `data-touched`: Present once focus has left the input.
2241
+ - `data-dirty`: Present while the number is not the one it started with.
2242
+ - `data-filled`: Present while there is a number.
2243
+ - `data-focused`: Present while the input has focus.
2244
+ - `data-valid`: In a field: present once the number was checked and found right.
2245
+ - `data-invalid`: In a field: present while the number is wrong.
2246
+
2247
+ ### Otp
2248
+
2249
+ ```
2250
+ import { Otp } from "@kirana-ui/vue/otp"
2251
+ ```
2252
+
2253
+ Parts: `<Otp.Root>`, `<Otp.Input>`, `<Otp.Group>`, `<Otp.Slot>`, `<Otp.Separator>`, `<Otp.Caret>`.
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
+
2266
+ Props of its root:
2267
+
2268
+ - `length?: number`: How many characters the code has. Default: 6.
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.
2271
+ - `mode?: "numeric" | "alphanumeric" | "text"`: What a character may be. Default: `numeric`.
2272
+ - `disabled?: boolean`: Disabled: it cannot be changed.
2273
+ - `name?: string`: With a name, the code is submitted with the form around it.
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.
2287
+
2288
+ Attributes and CSS variables, by part:
2289
+
2290
+ - root: The code: the input and its cells.
2291
+ - `data-disabled`: Present when it is disabled.
2292
+ - `data-focused`: Present while the input has focus.
2293
+ - `data-complete`: Present when every character is in.
2294
+ - input: The one input the code is typed in. A design lays it over the cells, unseen.
2295
+ - `data-disabled`: Present when it is disabled.
2296
+ - slot: One cell of the code.
2297
+ - `data-index`: The cell's place, from 0.
2298
+ - `data-active`: Present on the cell the next character goes in, or that is selected.
2299
+ - `data-filled`: Present when the cell has its character.
2300
+ - `data-disabled`: Present when it is disabled.
2301
+
2302
+ ### Pagination
2303
+
2304
+ ```
2305
+ import { Pagination } from "@kirana-ui/vue/pagination"
2306
+ ```
2307
+
2308
+ Parts: `<Pagination.Root>`, `<Pagination.Items>`, `<Pagination.Item>`, `<Pagination.Ellipsis>`, `<Pagination.Previous>`, `<Pagination.Next>`.
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
+
2321
+ Props of its root:
2322
+
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.
2326
+ - `pageSize?: number`: How many items a page holds. Default 10.
2327
+ - `siblingCount?: number`: How many pages are listed each side of the one shown. Default 1.
2328
+ - `boundaryCount?: number`: How many pages are always listed at each end. Default 1.
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>`.
2341
+
2342
+ Attributes and CSS variables, by part:
2343
+
2344
+ - root: The pages of a list, as a navigation.
2345
+ - `data-disabled`: Present when it is disabled.
2346
+ - item: A page: pressed, it is the one shown.
2347
+ - `data-selected`: Present on the page that is shown.
2348
+ - `data-disabled`: Present when it is disabled.
2349
+ - previous: Goes to the page before.
2350
+ - `data-disabled`: Present when it is disabled.
2351
+ - next: Goes to the page after.
2352
+ - `data-disabled`: Present when it is disabled.
2353
+
2354
+ ### Popover
2355
+
2356
+ ```
2357
+ import { Popover } from "@kirana-ui/vue/popover"
2358
+ ```
2359
+
2360
+ Parts: `<Popover.Root>`, `<Popover.Trigger>`, `<Popover.Portal>`, `<Popover.Positioner>`, `<Popover.Popup>`, `<Popover.Title>`, `<Popover.Description>`, `<Popover.Close>`.
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
+
2375
+ Props of its root:
2376
+
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.
2391
+
2392
+ Attributes and CSS variables, by part:
2393
+
2394
+ - trigger: The button that opens the popover, and what it is placed against.
2395
+ - `data-popup-open`: Present when the popover is open.
2396
+ - positioner: Places the popup against the trigger. It carries the geometry.
2397
+ - `data-open`: Present when it is open.
2398
+ - `data-closed`: Present when it is closed.
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.
2400
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
2401
+ - `--anchor-width`: The anchor's width.
2402
+ - `--anchor-height`: The anchor's height.
2403
+ - `--available-width`: The width between the anchor and the edge of the viewport.
2404
+ - `--available-height`: The height between the anchor and the edge of the viewport.
2405
+ - `--transform-origin`: The point of the popup nearest its anchor, to scale from.
2406
+ - popup: The popover itself.
2407
+ - `data-open`: Present when it is open.
2408
+ - `data-closed`: Present when it is closed.
2409
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
2410
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
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.
2412
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
2413
+
2414
+ ### Progress
2415
+
2416
+ ```
2417
+ import { Progress } from "@kirana-ui/vue/progress"
2418
+ ```
2419
+
2420
+ Parts: `<Progress.Root>`, `<Progress.Track>`, `<Progress.Indicator>`, `<Progress.Value>`, `<Progress.Label>`.
2421
+
2422
+ Anatomy:
2423
+
2424
+ ```
2425
+ <Progress.Root>
2426
+ <Progress.Track>
2427
+ <Progress.Indicator>
2428
+ <Progress.Value>
2429
+ <Progress.Label>
2430
+ ```
2431
+
2432
+ Props of its root:
2433
+
2434
+ - `min?: number`: Default 0.
2435
+ - `max?: number`: Default 100.
2436
+ - `format?: Intl.NumberFormatOptions`: How the value is written; a percentage of the range by default.
2437
+ - `locale?: string`: The language the value is written in; the page's by default.
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>`.
2448
+
2449
+ Attributes and CSS variables, by part:
2450
+
2451
+ - root: The progress bar: it says the value to assistive technology.
2452
+ - `data-progressing`: Present while the task is under way.
2453
+ - `data-complete`: Present once the value has reached the end of the range.
2454
+ - `data-indeterminate`: Present while how far the task has come is not known.
2455
+ - track: The whole range.
2456
+ - `data-progressing`: Present while the task is under way.
2457
+ - `data-complete`: Present once the value has reached the end of the range.
2458
+ - `data-indeterminate`: Present while how far the task has come is not known.
2459
+ - indicator: The filled part: its width is the value's share of the range.
2460
+ - `data-progressing`: Present while the task is under way.
2461
+ - `data-complete`: Present once the value has reached the end of the range.
2462
+ - `data-indeterminate`: Present while how far the task has come is not known.
2463
+ - value: The value, written.
2464
+ - `data-progressing`: Present while the task is under way.
2465
+ - `data-complete`: Present once the value has reached the end of the range.
2466
+ - `data-indeterminate`: Present while how far the task has come is not known.
2467
+ - label: The bar's name.
2468
+ - `data-progressing`: Present while the task is under way.
2469
+ - `data-complete`: Present once the value has reached the end of the range.
2470
+ - `data-indeterminate`: Present while how far the task has come is not known.
2471
+
2472
+ ### QrCode
2473
+
2474
+ ```
2475
+ import { QrCode } from "@kirana-ui/vue/qr-code"
2476
+ ```
2477
+
2478
+ Parts: `<QrCode.Root>`, `<QrCode.Frame>`, `<QrCode.Pattern>`.
2479
+
2480
+ Anatomy:
2481
+
2482
+ ```
2483
+ <QrCode.Root>
2484
+ <QrCode.Frame>
2485
+ <QrCode.Pattern>
2486
+ ```
2487
+
2488
+ Props of its root:
2489
+
2490
+ - `value: string`: Required. What the code says: a link, a text. Written as UTF-8.
2491
+ - `correction?: QrCorrection`: How much of it may be lost and still be read. Default: `"M"`.
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
+
2499
+ Attributes and CSS variables, by part:
2500
+
2501
+ - root: What holds the code.
2502
+ - `data-invalid`: Present when the value is longer than a code holds.
2503
+
2504
+ ### RadioGroup
2505
+
2506
+ ```
2507
+ import { RadioGroup } from "@kirana-ui/vue/radio-group"
2508
+ ```
2509
+
2510
+ Parts: `<RadioGroup.Root>`, `<RadioGroup.Item>`, `<RadioGroup.Indicator>`.
2511
+
2512
+ Anatomy:
2513
+
2514
+ ```
2515
+ <RadioGroup.Root>
2516
+ <RadioGroup.Item> (repeated)
2517
+ <RadioGroup.Indicator>
2518
+ ```
2519
+
2520
+ Props of its root:
2521
+
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.
2527
+ - `name?: string`: With a name, the chosen value is submitted with the form around the group.
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.
2539
+
2540
+ Attributes and CSS variables, by part:
2541
+
2542
+ - root: Groups the items: one of them is chosen at most.
2543
+ - `data-disabled`: Present when it is disabled.
2544
+ - `data-readonly`: Present when it can be read but not changed.
2545
+ - `data-required`: Present when the form needs it.
2546
+ - item: One choice. It holds a hidden native radio, which a form and a label reach.
2547
+ - `data-checked`: Present when it is checked.
2548
+ - `data-unchecked`: Present when it is not checked.
2549
+ - `data-disabled`: Present when it is disabled.
2550
+ - `data-readonly`: Present when it can be read but not changed.
2551
+ - `data-required`: Present when the form needs it.
2552
+ - indicator: The mark. In the page while its item is the chosen one.
2553
+ - `data-checked`: Present when it is checked.
2554
+ - `data-unchecked`: Present when it is not checked.
2555
+ - `data-disabled`: Present when it is disabled.
2556
+ - `data-readonly`: Present when it can be read but not changed.
2557
+ - `data-required`: Present when the form needs it.
2558
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
2559
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
2560
+
2561
+ ### Resizable
2562
+
2563
+ ```
2564
+ import { Resizable } from "@kirana-ui/vue/resizable"
2565
+ ```
2566
+
2567
+ Parts: `<Resizable.Group>`, `<Resizable.Panel>`, `<Resizable.Handle>`.
2568
+
2569
+ Anatomy:
2570
+
2571
+ ```
2572
+ <Resizable.Group>
2573
+ <Resizable.Panel> (repeated)
2574
+ <Resizable.Handle> (repeated)
2575
+ ```
2576
+
2577
+ Props of its root:
2578
+
2579
+ - `orientation?: Orientation`: Whether the panels are side by side (the default) or one over the other.
2580
+ - `keyboardStep?: number`: How far an arrow key moves a handle, in hundredths of the group. Default: 10.
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.
2593
+
2594
+ Attributes and CSS variables, by part:
2595
+
2596
+ - group: The panels and the bars between them. A design lays it out as a flex box.
2597
+ - `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
2598
+ - `data-disabled`: Present when it is disabled.
2599
+ - panel: One panel. It carries its share of the group.
2600
+ - `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
2601
+ - `--panel-size`: The panel's share, in hundredths of the group.
2602
+ - handle: The bar between two panels: dragged, or moved with the arrows.
2603
+ - `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
2604
+ - `data-dragging`: Present while the bar is dragged.
2605
+ - `data-disabled`: Present when it is disabled.
2606
+
2607
+ ### ScrollArea
2608
+
2609
+ ```
2610
+ import { ScrollArea } from "@kirana-ui/vue/scroll-area"
2611
+ ```
2612
+
2613
+ Parts: `<ScrollArea.Root>`, `<ScrollArea.Viewport>`, `<ScrollArea.Content>`, `<ScrollArea.Scrollbar>`, `<ScrollArea.Thumb>`, `<ScrollArea.Corner>`.
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
+
2637
+ Attributes and CSS variables, by part:
2638
+
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.
2640
+ - `data-has-overflow-x`: Present when there is more to see sideways.
2641
+ - `data-has-overflow-y`: Present when there is more to see up or down.
2642
+ - `data-scrolling`: Present while it is being scrolled, and a moment after.
2643
+ - `data-hovering`: Present while the pointer is over the area.
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.
2646
+ - viewport: The element that scrolls.
2647
+ - `data-has-overflow-x`: Present when there is more to see sideways.
2648
+ - `data-has-overflow-y`: Present when there is more to see up or down.
2649
+ - `data-scrolling`: Present while it is being scrolled, and a moment after.
2650
+ - scrollbar: A scrollbar's track, placed along its edge of the area. In the page while there is something to scroll its way.
2651
+ - `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
2652
+ - `data-hovering`: Present while the pointer is over the area.
2653
+ - `data-scrolling`: Present while the area is scrolled its way.
2654
+ - `--scroll-area-thumb-height`: A vertical thumb's height.
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.
2658
+
2659
+ ### Select
2660
+
2661
+ ```
2662
+ import { Select } from "@kirana-ui/vue/select"
2663
+ ```
2664
+
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>`.
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
+
2687
+ Props of its root:
2688
+
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.
2694
+ - `required?: boolean`: In a field, "none" is then wrong.
2695
+ - `name?: string`: With a name, the value is submitted with the form around it.
2696
+ - `form?: string`: The id of the form the control belongs to, when it is not inside it.
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.
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.
2730
+
2731
+ Attributes and CSS variables, by part:
2732
+
2733
+ - trigger: The button that shows the value and opens the list.
2734
+ - `data-popup-open`: Present when the list is open.
2735
+ - `data-placeholder`: Present while nothing is chosen.
2736
+ - `data-disabled`: Present when it is disabled.
2737
+ - value: The chosen value's label, or the placeholder. With several values, their labels with commas between.
2738
+ - `data-placeholder`: Present while nothing is chosen.
2739
+ - positioner: Places the list against the trigger. It carries the geometry.
2740
+ - `data-open`: Present when it is open.
2741
+ - `data-closed`: Present when it is closed.
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.
2743
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
2744
+ - `--anchor-width`: The anchor's width.
2745
+ - `--anchor-height`: The anchor's height.
2746
+ - `--available-width`: The width between the anchor and the edge of the viewport.
2747
+ - `--available-height`: The height between the anchor and the edge of the viewport.
2748
+ - `--transform-origin`: The point of the popup nearest its anchor, to scale from.
2749
+ - scrollUpArrow: In the page while there is more of the list above: it scrolls the list while the pointer moves over it.
2750
+ - `data-direction="up | down"`: The way it scrolls the list.
2751
+ - `data-visible`: Present while there is more of the list its way.
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.
2753
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
2754
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
2755
+ - scrollDownArrow: In the page while there is more of the list below: it scrolls the list while the pointer moves over it.
2756
+ - `data-direction="up | down"`: The way it scrolls the list.
2757
+ - `data-visible`: Present while there is more of the list its way.
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.
2759
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
2760
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
2761
+ - popup: The list of items.
2762
+ - `data-open`: Present when it is open.
2763
+ - `data-closed`: Present when it is closed.
2764
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
2765
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
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.
2767
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
2768
+ - item: One choice in the list.
2769
+ - `data-selected`: Present on the chosen item, or on each of several.
2770
+ - `data-highlighted`: Present on the item the pointer or the keyboard is on.
2771
+ - `data-disabled`: Present when it is disabled.
2772
+
2773
+ ### Separator
2774
+
2775
+ ```
2776
+ import { Separator } from "@kirana-ui/vue/separator"
2777
+ ```
2778
+
2779
+ Props:
2780
+
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>`.
2784
+
2785
+ Attributes and CSS variables, by part:
2786
+
2787
+ - root: The line.
2788
+ - `data-orientation="horizontal | vertical"`: The way the line runs.
2789
+
2790
+ ### Slider
2791
+
2792
+ ```
2793
+ import { Slider } from "@kirana-ui/vue/slider"
2794
+ ```
2795
+
2796
+ Parts: `<Slider.Root>`, `<Slider.Value>`, `<Slider.Control>`, `<Slider.Track>`, `<Slider.Indicator>`, `<Slider.Thumb>`.
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
+
2809
+ Props of its root:
2810
+
2811
+ - `min?: number`: Default 0.
2812
+ - `max?: number`: Default 100.
2813
+ - `step?: number`: Default 1.
2814
+ - `largeStep?: number`: What Page Up, Page Down and an arrow with Shift move by. Default 10.
2815
+ - `minStepsBetweenValues?: number`: How many steps two thumbs of a range stay apart. Default 0.
2816
+ - `orientation?: Orientation`: Whether the track lies across (the default) or stands upright: the arrows that move a thumb follow.
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.
2818
+ - `disabled?: boolean`: Disabled: it cannot be changed.
2819
+ - `name?: string`: With a name, each thumb's value is submitted with the form around the slider.
2820
+ - `form?: string`: The id of the form the control belongs to, when it is not inside it.
2821
+ - `format?: Intl.NumberFormatOptions`: How a value is written.
2822
+ - `locale?: string`: The language a value is written in; the page's by default.
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.
2838
+
2839
+ Attributes and CSS variables, by part:
2840
+
2841
+ - root: Groups the slider's parts.
2842
+ - `data-orientation="horizontal | vertical"`: The way the track runs.
2843
+ - `data-disabled`: Present when it is disabled.
2844
+ - `data-dragging`: Present while a pointer holds a thumb.
2845
+ - value: The value, written.
2846
+ - `data-orientation="horizontal | vertical"`: The way the track runs.
2847
+ - `data-disabled`: Present when it is disabled.
2848
+ - `data-dragging`: Present while a pointer holds a thumb.
2849
+ - control: What a pointer presses and drags on. It holds the track and the thumbs.
2850
+ - `data-orientation="horizontal | vertical"`: The way the track runs.
2851
+ - `data-disabled`: Present when it is disabled.
2852
+ - `data-dragging`: Present while a pointer holds a thumb.
2853
+ - track: The whole range.
2854
+ - `data-orientation="horizontal | vertical"`: The way the track runs.
2855
+ - `data-disabled`: Present when it is disabled.
2856
+ - `data-dragging`: Present while a pointer holds a thumb.
2857
+ - indicator: The filled part: up to the thumb, or from the first thumb to the last. Its place and length are written on it.
2858
+ - `data-orientation="horizontal | vertical"`: The way the track runs.
2859
+ - `data-disabled`: Present when it is disabled.
2860
+ - `data-dragging`: Present while a pointer holds a thumb.
2861
+ - `--start-position`: With thumbs that stay inside the control: where the filled part starts, or with one thumb where it ends.
2862
+ - `--relative-size`: With thumbs that stay inside the control and a range: the filled part's length.
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.
2864
+ - `data-orientation="horizontal | vertical"`: The way the track runs.
2865
+ - `data-disabled`: Present when it is disabled.
2866
+ - `data-dragging`: Present while a pointer holds a thumb.
2867
+ - `data-index`: Which thumb it is, from 0.
2868
+ - `--position`: With thumbs that stay inside the control: where the thumb's centre is.
2869
+
2870
+ ### Switch
2871
+
2872
+ ```
2873
+ import { Switch } from "@kirana-ui/vue/switch"
2874
+ ```
2875
+
2876
+ Parts: `<Switch.Root>`, `<Switch.Thumb>`.
2877
+
2878
+ Anatomy:
2879
+
2880
+ ```
2881
+ <Switch.Root>
2882
+ <Switch.Thumb>
2883
+ ```
2884
+
2885
+ Props of its root:
2886
+
2887
+ - `checked?: boolean`: `v-model:checked`. Whether it is checked, when the caller holds it.
2888
+ - `defaultChecked?: boolean`: Read once.
2889
+ - `disabled?: boolean`: Disabled: it cannot be changed.
2890
+ - `readOnly?: boolean`: Shown as it is, focusable, not changeable.
2891
+ - `required?: boolean`: Needed: in a `Field`, leaving it unchecked is then invalid.
2892
+ - `name?: string`: With a name, the control is submitted with the form around it when it is checked.
2893
+ - `form?: string`: The id of the form the control belongs to, when it is not inside it.
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>`.
2901
+
2902
+ Attributes and CSS variables, by part:
2903
+
2904
+ - root: The track. It holds a hidden native checkbox, which a form and a label reach.
2905
+ - `data-checked`: Present when it is checked.
2906
+ - `data-unchecked`: Present when it is not checked.
2907
+ - `data-disabled`: Present when it is disabled.
2908
+ - `data-readonly`: Present when it can be read but not changed.
2909
+ - `data-required`: Present when the form needs it.
2910
+ - thumb: The knob that moves along the track.
2911
+ - `data-checked`: Present when it is checked.
2912
+ - `data-unchecked`: Present when it is not checked.
2913
+ - `data-disabled`: Present when it is disabled.
2914
+ - `data-readonly`: Present when it can be read but not changed.
2915
+ - `data-required`: Present when the form needs it.
2916
+
2917
+ ### Tabs
2918
+
2919
+ ```
2920
+ import { Tabs } from "@kirana-ui/vue/tabs"
2921
+ ```
2922
+
2923
+ Parts: `<Tabs.Root>`, `<Tabs.List>`, `<Tabs.Tab>`, `<Tabs.Indicator>`, `<Tabs.Panel>`.
2924
+
2925
+ Anatomy:
2926
+
2927
+ ```
2928
+ <Tabs.Root>
2929
+ <Tabs.List>
2930
+ <Tabs.Tab> (repeated)
2931
+ <Tabs.Indicator>
2932
+ <Tabs.Panel> (repeated)
2933
+ ```
2934
+
2935
+ Props of its root:
2936
+
2937
+ - `value?: Value | null`: `v-model:value`. The active tab's value; `null` is "none".
2938
+ - `defaultValue?: Value | null`: Read once. Without one, the first tab that can be chosen is, once the page is there.
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.
2955
+
2956
+ Attributes and CSS variables, by part:
2957
+
2958
+ - root: Groups the tabs and their panels.
2959
+ - `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
2960
+ - `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
2961
+ - list: The row of tabs. The arrows move between them.
2962
+ - `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
2963
+ - `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
2964
+ - tab: A button that shows its panel.
2965
+ - `data-active`: Present on the tab whose panel is shown.
2966
+ - `data-disabled`: Present when it is disabled.
2967
+ - `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
2968
+ - indicator: A mark for the active tab: it carries that tab's position and size.
2969
+ - `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
2970
+ - `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
2971
+ - `--active-tab-left`: The active tab's distance from the list's left edge.
2972
+ - `--active-tab-right`: The active tab's distance from the list's right edge.
2973
+ - `--active-tab-top`: The active tab's distance from the list's top edge.
2974
+ - `--active-tab-bottom`: The active tab's distance from the list's bottom edge.
2975
+ - `--active-tab-width`: The active tab's width.
2976
+ - `--active-tab-height`: The active tab's height.
2977
+ - panel: A tab's content. In the page while its tab is active, and through its exit.
2978
+ - `data-hidden`: Present while its tab is not the active one.
2979
+ - `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
2980
+ - `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
2981
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
2982
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
2983
+
2984
+ ### Toast
2985
+
2986
+ ```
2987
+ import { Toast } from "@kirana-ui/vue/toast"
2988
+ ```
2989
+
2990
+ Parts: `<Toast.Viewport>`, `<Toast.List>`, `<Toast.Root>`, `<Toast.Content>`, `<Toast.Title>`, `<Toast.Description>`, `<Toast.Close>`, `<Toast.Action>`.
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
+
3005
+ Props of its root:
3006
+
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".
3025
+
3026
+ Attributes and CSS variables, by part:
3027
+
3028
+ - viewport: Where the toasts are drawn: a region that is always in the page.
3029
+ - `data-expanded`: Present while the pointer or focus is on the stack: the toasts are spread out, and wait.
3030
+ - `--toast-frontmost-height`: The height of the newest toast.
3031
+ - root: One toast.
3032
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
3033
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
3034
+ - `data-expanded`: Present while the pointer or focus is on the stack: the toasts are spread out, and wait.
3035
+ - `data-type`: The kind the toast was added as.
3036
+ - `data-limited`: Present on a toast behind as many as are shown at once.
3037
+ - `data-swiping`: Present while the toast is dragged.
3038
+ - `data-swipe-direction="left | right | up | down"`: The way the toast was dragged out, once it has been.
3039
+ - `--toast-index`: Its place in the stack: 0 for the newest.
3040
+ - `--toast-height`: Its height.
3041
+ - `--toast-offset-y`: The height of the toasts in front of it.
3042
+ - `--toast-swipe-movement-x`: How far it has been dragged across.
3043
+ - `--toast-swipe-movement-y`: How far it has been dragged up or down.
3044
+ - content: What holds a toast's contents, when the design sizes the toast itself.
3045
+ - `data-behind`: Present on a toast that is behind the newest.
3046
+ - `data-expanded`: Present while the pointer or focus is on the stack: the toasts are spread out, and wait.
3047
+
3048
+ ### Toggle
3049
+
3050
+ ```
3051
+ import { Toggle } from "@kirana-ui/vue/toggle"
3052
+ ```
3053
+
3054
+ Props:
3055
+
3056
+ - `pressed?: boolean`: `v-model:pressed`. Whether it is pressed, when the caller holds it.
3057
+ - `defaultPressed?: boolean`: Read once.
3058
+ - `disabled?: boolean`: Disabled: a press does nothing.
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>`.
3063
+
3064
+ Attributes and CSS variables, by part:
3065
+
3066
+ - root: The button. It stays pressed until it is pressed again.
3067
+ - `data-pressed`: Present while it is pressed.
3068
+ - `data-disabled`: Present when it is disabled.
3069
+
3070
+ ### ToggleGroup
3071
+
3072
+ ```
3073
+ import { ToggleGroup } from "@kirana-ui/vue/toggle-group"
3074
+ ```
3075
+
3076
+ Props:
3077
+
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.
3080
+ - `multiple?: boolean`: Whether more than one can be pressed at a time.
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.
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>`.
3087
+
3088
+ Attributes and CSS variables, by part:
3089
+
3090
+ - root: The group. A toggle inside it with a `value` is one of its toggles.
3091
+ - `data-orientation="horizontal | vertical"`: Whether its toggles are in a row or a column.
3092
+ - `data-multiple`: Present when several can be pressed at a time.
3093
+ - `data-disabled`: Present when it is disabled.
3094
+
3095
+ ### Toolbar
3096
+
3097
+ ```
3098
+ import { Toolbar } from "@kirana-ui/vue/toolbar"
3099
+ ```
3100
+
3101
+ Parts: `<Toolbar.Root>`, `<Toolbar.Button>`, `<Toolbar.Link>`, `<Toolbar.Input>`, `<Toolbar.Group>`, `<Toolbar.Separator>`.
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
+
3114
+ Props of its root:
3115
+
3116
+ - `orientation?: Orientation`: Whether the controls are laid out across (the default) or down: the arrows that move between them follow.
3117
+ - `loop?: boolean`: Whether the arrows go round from the last item to the first. Default: they do.
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>`.
3131
+
3132
+ Attributes and CSS variables, by part:
3133
+
3134
+ - root: The toolbar. It is one stop for Tab.
3135
+ - `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
3136
+ - `data-disabled`: Present when it is disabled.
3137
+ - button: A button of the toolbar.
3138
+ - `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
3139
+ - `data-disabled`: Present when it is disabled.
3140
+ - link: A link of the toolbar.
3141
+ - `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
3142
+ - `data-disabled`: Present when it is disabled.
3143
+ - input: A text input of the toolbar. The arrows are its own until the caret is at an end.
3144
+ - `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
3145
+ - `data-disabled`: Present when it is disabled.
3146
+ - group: Items that belong together.
3147
+ - `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
3148
+ - `data-disabled`: Present when it is disabled.
3149
+ - separator: A line between items, across the toolbar.
3150
+ - `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
3151
+
3152
+ ### Tooltip
3153
+
3154
+ ```
3155
+ import { Tooltip } from "@kirana-ui/vue/tooltip"
3156
+ ```
3157
+
3158
+ Parts: `<Tooltip.Root>`, `<Tooltip.Trigger>`, `<Tooltip.Portal>`, `<Tooltip.Positioner>`, `<Tooltip.Popup>`, `<Tooltip.Arrow>`.
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
+
3171
+ Props of its root:
3172
+
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.
3175
+ - `delay?: number`: How long the pointer rests on the trigger before the popup opens, in milliseconds.
3176
+ - `closeDelay?: number`: How long after the pointer leaves the popup closes, in milliseconds.
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>`.
3190
+
3191
+ Attributes and CSS variables, by part:
3192
+
3193
+ - trigger: The element the tooltip describes.
3194
+ - `data-popup-open`: Present when the tooltip is open.
3195
+ - positioner: Places the popup against the trigger. It carries the geometry.
3196
+ - `data-open`: Present when it is open.
3197
+ - `data-closed`: Present when it is closed.
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.
3199
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
3200
+ - `--anchor-width`: The anchor's width.
3201
+ - `--anchor-height`: The anchor's height.
3202
+ - `--available-width`: The width between the anchor and the edge of the viewport.
3203
+ - `--available-height`: The height between the anchor and the edge of the viewport.
3204
+ - `--transform-origin`: The point of the popup nearest its anchor, to scale from.
3205
+ - popup: The tooltip itself.
3206
+ - `data-open`: Present when it is open.
3207
+ - `data-closed`: Present when it is closed.
3208
+ - `data-starting-style`: Present for the first style of its entrance: what it animates in from.
3209
+ - `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
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.
3211
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
3212
+ - `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
3213
+ - arrow: An element that points at the trigger, placed along the popup's edge.
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.
3215
+ - `data-align="start | center | end"`: How it is aligned with the anchor.
3216
+ - `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.