@kirana-ui/react 0.1.1 → 0.2.0

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