@kirana-ui/web 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/llms.txt +3000 -0
- package/package.json +10 -2
- package/skills/kirana-ui-primitives/SKILL.md +142 -0
- package/src/accordion.d.ts +18 -3
- package/src/accordion.js +5 -4
- package/src/accordion.js.map +1 -1
- package/src/agent.d.ts +1 -0
- package/src/agent.js +1 -0
- package/src/alert-dialog.d.ts +12 -1
- package/src/alert-dialog.js.map +1 -1
- package/src/around.d.ts +19 -3
- package/src/around.js +45 -3
- package/src/around.js.map +1 -1
- package/src/autocomplete.d.ts +13 -2
- package/src/autocomplete.js +2 -1
- package/src/autocomplete.js.map +1 -1
- package/src/autosize.d.ts +10 -1
- package/src/autosize.js.map +1 -1
- package/src/avatar.d.ts +13 -1
- package/src/avatar.js.map +1 -1
- package/src/button.d.ts +10 -1
- package/src/button.js.map +1 -1
- package/src/calendar.d.ts +11 -1
- package/src/calendar.js.map +1 -1
- package/src/carousel.d.ts +10 -1
- package/src/carousel.js.map +1 -1
- package/src/checkbox.d.ts +12 -1
- package/src/checkbox.js.map +1 -1
- package/src/collapsible.d.ts +10 -1
- package/src/collapsible.js.map +1 -1
- package/src/combobox.d.ts +23 -6
- package/src/combobox.js +10 -11
- package/src/combobox.js.map +1 -1
- package/src/command.d.ts +11 -1
- package/src/command.js.map +1 -1
- package/src/context-menu.d.ts +12 -1
- package/src/context-menu.js.map +1 -1
- package/src/date-field.d.ts +10 -1
- package/src/date-field.js.map +1 -1
- package/src/date-picker.d.ts +13 -1
- package/src/date-picker.js +2 -8
- package/src/date-picker.js.map +1 -1
- package/src/dialog.d.ts +12 -1
- package/src/dialog.js.map +1 -1
- package/src/drawer.d.ts +17 -1
- package/src/drawer.js.map +1 -1
- package/src/field.d.ts +8 -1
- package/src/field.js.map +1 -1
- package/src/fieldset.d.ts +10 -1
- package/src/fieldset.js.map +1 -1
- package/src/form.d.ts +13 -1
- package/src/form.js.map +1 -1
- package/src/hover-card.d.ts +9 -1
- package/src/hover-card.js.map +1 -1
- package/src/hover-popup.d.ts +2 -1
- package/src/hover-popup.js +2 -8
- package/src/hover-popup.js.map +1 -1
- package/src/index.d.ts +56 -1
- package/src/input.d.ts +12 -1
- package/src/input.js.map +1 -1
- package/src/label.d.ts +9 -1
- package/src/label.js.map +1 -1
- package/src/listbox.d.ts +15 -1
- package/src/listbox.js.map +1 -1
- package/src/menu.d.ts +14 -4
- package/src/menu.js +2 -8
- package/src/menu.js.map +1 -1
- package/src/menubar.d.ts +10 -1
- package/src/menubar.js.map +1 -1
- package/src/message-scroller.d.ts +10 -1
- package/src/message-scroller.js.map +1 -1
- package/src/meter.d.ts +10 -1
- package/src/meter.js.map +1 -1
- package/src/navigation-menu.d.ts +14 -4
- package/src/navigation-menu.js +7 -13
- package/src/navigation-menu.js.map +1 -1
- package/src/number-field.d.ts +13 -1
- package/src/number-field.js.map +1 -1
- package/src/otp.d.ts +11 -1
- package/src/otp.js.map +1 -1
- package/src/pagination.d.ts +10 -1
- package/src/pagination.js.map +1 -1
- package/src/popover.d.ts +14 -2
- package/src/popover.js +4 -9
- package/src/popover.js.map +1 -1
- package/src/progress.d.ts +10 -1
- package/src/progress.js.map +1 -1
- package/src/qr-code.d.ts +8 -1
- package/src/qr-code.js.map +1 -1
- package/src/radio-group.d.ts +10 -1
- package/src/radio-group.js.map +1 -1
- package/src/resizable.d.ts +10 -1
- package/src/resizable.js.map +1 -1
- package/src/runtime.d.ts +35 -2
- package/src/runtime.js +28 -3
- package/src/runtime.js.map +1 -1
- package/src/scroll-area.d.ts +13 -2
- package/src/scroll-area.js +3 -1
- package/src/scroll-area.js.map +1 -1
- package/src/select.d.ts +25 -5
- package/src/select.js +35 -11
- package/src/select.js.map +1 -1
- package/src/separator.d.ts +10 -1
- package/src/separator.js.map +1 -1
- package/src/slider.d.ts +18 -3
- package/src/slider.js +6 -6
- package/src/slider.js.map +1 -1
- package/src/switch.d.ts +12 -1
- package/src/switch.js.map +1 -1
- package/src/tabs.d.ts +10 -1
- package/src/tabs.js.map +1 -1
- package/src/testing.d.ts +1 -0
- package/src/testing.js +1 -0
- package/src/toast.d.ts +20 -7
- package/src/toast.js +28 -7
- package/src/toast.js.map +1 -1
- package/src/toggle-group.d.ts +16 -1
- package/src/toggle-group.js.map +1 -1
- package/src/toggle.d.ts +12 -1
- package/src/toggle.js.map +1 -1
- package/src/toolbar.d.ts +10 -1
- package/src/toolbar.js.map +1 -1
- package/src/tooltip.d.ts +9 -1
- package/src/tooltip.js.map +1 -1
package/llms.txt
ADDED
|
@@ -0,0 +1,3000 @@
|
|
|
1
|
+
# @kirana-ui/web
|
|
2
|
+
|
|
3
|
+
> Kirana UI Primitives as custom elements, for a page with no framework: headless, accessible components with no styles of their own. The same components, parts, attributes and behaviour as on React, Vue, Svelte, Solid and Angular, from one core.
|
|
4
|
+
|
|
5
|
+
Generated from the library's own source (`bun scripts/llms.ts`), and checked against it: every element, attribute, event and part here is in the package, and what is not here is not.
|
|
6
|
+
|
|
7
|
+
## Install and entries
|
|
8
|
+
|
|
9
|
+
Install `@kirana-ui/web`. 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/web/agent`, `@kirana-ui/web/testing`).
|
|
10
|
+
|
|
11
|
+
Its entries: an entry per element (`@kirana-ui/web/tabs`, 48 of them), the package root `@kirana-ui/web` (every element at once), `@kirana-ui/web/runtime` (`defineElement`, for an element of your own), `@kirana-ui/web/agent` and `@kirana-ui/web/testing` (the agent bridge and the testing kit: what they give is the same on every framework, and written out in each framework package's `llms.txt`).
|
|
12
|
+
|
|
13
|
+
The attributes and CSS variables below are also data and typed selectors, for a design system: install `@kirana-ui/vocabulary` for them. It is its own package, and not installed with this one.
|
|
14
|
+
|
|
15
|
+
## Using it
|
|
16
|
+
|
|
17
|
+
- Importing an entry defines its element: `import "@kirana-ui/web/dialog"`. `import "@kirana-ui/web"` defines them all.
|
|
18
|
+
- The custom element (`<kui-dialog>`) holds the component and draws nothing: it takes no room (`display: contents`) and has no shadow root. Every part, the root among them, is an element of the page's own inside it, named by `kui-part`: `<button kui-part="trigger">`. So a trigger is a real button, and the page is the page the other adapters draw.
|
|
19
|
+
- A prop is an attribute in kebab case on the custom element (`default-open`), and a property in camel case (`element.defaultOpen`, `element.open = true`). A prop that is a function or an object is a property only, listed for its element.
|
|
20
|
+
- A change is an event on the custom element, named for its callback (`open-change`, `value-change`): `event.detail` holds the value under its prop's name (`detail.open`) and `detail.details` (`reason`, `event`, `source`, `cancel()`). `event.preventDefault()` keeps the value as it was. The element then holds the value: it is controlled by writing the property back.
|
|
21
|
+
- What a part needs of its own is a `kui-` attribute on the part's element: `kui-value`, `kui-disabled`, `kui-index`, `kui-label`, a positioner's `kui-side`, `kui-align`, `kui-side-offset`, `kui-align-offset`, `kui-collision-padding` and `kui-anchor` (the id of the element the popup is placed against, when that is not its trigger). An `id` for the component is `kui-id` on the custom element.
|
|
22
|
+
- A part that is in the page only some of the time (a closed panel, a popup) is taken out of the page while it is not, and put back where it was; `kui-keep-mounted` on the part keeps it. A portal part (`kui-part="portal"`) is moved to the end of `<body>`.
|
|
23
|
+
- A list the component draws is written once, as a `<template kui-each="name">` where the list goes: it is stamped for each entry, `{field}` in its text and attributes filled from the entry, and an element with `kui-when` kept only for entries of that type.
|
|
24
|
+
- A component inside another's custom element is that one's own: a `<kui-menu>` inside a `<kui-menu>` is its submenu, a control inside a `<kui-field>` is the field's control.
|
|
25
|
+
- TypeScript knows each element by its tag (`document.querySelector("kui-dialog")`): its props as properties and its events with their `detail`.
|
|
26
|
+
- The types an event's `detail` and a property name (`ChangeDetails`, `Side`, `IsoDate` …) are exported by the package root, as types only: `import type { ChangeDetails } from "@kirana-ui/web"`. Nothing is imported from `@kirana-ui/core`, which a strict installer keeps out of a project's reach.
|
|
27
|
+
- 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. There the first line is the custom element, which holds a root that draws nothing; a `<template kui-each>` is a list; a `<kui-menu>` inside a menu's popup is its submenu.
|
|
28
|
+
- 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.
|
|
29
|
+
- A boolean state is an attribute that is present or absent (`[data-open]`), never `="false"`.
|
|
30
|
+
- 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.
|
|
31
|
+
- 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.
|
|
32
|
+
- 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.
|
|
33
|
+
|
|
34
|
+
## Elements
|
|
35
|
+
|
|
36
|
+
### Accordion
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
import "@kirana-ui/web/accordion"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`<kui-accordion>`: `<kui-accordion>` around `kui-part="root"` and its `item`s, each with a `header`, a `trigger` button and a `panel` that is in the page while its item is open. An item's `kui-value` tells it from the others; an item that is given none makes its own. `value` and `default-value` (the open items, with commas between), `multiple`, `disabled`, `orientation`, `loop`; it tells `value-change`.
|
|
43
|
+
|
|
44
|
+
Attributes of the element (each also a property, in camel case):
|
|
45
|
+
|
|
46
|
+
- `value` (string): The values of the open items.
|
|
47
|
+
- `default-value` (string): Read once.
|
|
48
|
+
- `multiple` (boolean): Whether several items can be open at once. Default `false`: opening one closes the others.
|
|
49
|
+
- `disabled` (boolean): Disables every item: none can be opened or closed.
|
|
50
|
+
- `orientation` (string): The way the arrows move between triggers. Default `vertical`.
|
|
51
|
+
- `loop` (boolean): Whether the arrows wrap from the last trigger to the first. Default `true`.
|
|
52
|
+
|
|
53
|
+
Events:
|
|
54
|
+
|
|
55
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
56
|
+
|
|
57
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
58
|
+
|
|
59
|
+
- `root`
|
|
60
|
+
- `item`: `kui-disabled`, `kui-value`
|
|
61
|
+
- `header`: `kui-disabled`, `kui-value`
|
|
62
|
+
- `trigger`: `kui-disabled`, `kui-value`
|
|
63
|
+
- `panel`: `kui-disabled`, `kui-value`
|
|
64
|
+
|
|
65
|
+
Anatomy:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
<kui-accordion>
|
|
69
|
+
root
|
|
70
|
+
item (repeated)
|
|
71
|
+
header
|
|
72
|
+
trigger
|
|
73
|
+
panel
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Attributes and CSS variables, by part:
|
|
77
|
+
|
|
78
|
+
- root: Groups the items.
|
|
79
|
+
- `data-orientation="horizontal | vertical"`: The way the items are laid out, and the arrows that move between their triggers.
|
|
80
|
+
- `data-disabled`: Present when it is disabled.
|
|
81
|
+
- 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.
|
|
82
|
+
- `data-open`: Present when the item is open.
|
|
83
|
+
- `data-disabled`: Present when it is disabled.
|
|
84
|
+
- header: The heading that holds the trigger.
|
|
85
|
+
- `data-open`: Present when the item is open.
|
|
86
|
+
- `data-disabled`: Present when it is disabled.
|
|
87
|
+
- trigger: The button that opens and closes the item's panel.
|
|
88
|
+
- `data-panel-open`: Present when the item's panel is open.
|
|
89
|
+
- `data-disabled`: Present when it is disabled.
|
|
90
|
+
- panel: The item's content. In the page while open, and through its exit's motion.
|
|
91
|
+
- `data-open`: Present when it is open.
|
|
92
|
+
- `data-closed`: Present when it is closed.
|
|
93
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
94
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
95
|
+
- `data-disabled`: Present when it is disabled.
|
|
96
|
+
- `data-orientation="horizontal | vertical"`: The way the items are laid out, and the arrows that move between their triggers.
|
|
97
|
+
- `--accordion-panel-height`: The panel's content height while it opens or closes, `auto` once it is open.
|
|
98
|
+
- `--accordion-panel-width`: The panel's content width while it opens or closes, `auto` once it is open.
|
|
99
|
+
|
|
100
|
+
### AlertDialog
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
import "@kirana-ui/web/alert-dialog"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`<kui-alert-dialog>`: `<kui-alert-dialog>`: a dialog that asks, with the dialog's parts. A press outside does not close it. `open`, `default-open`; it tells `open-change`.
|
|
107
|
+
|
|
108
|
+
Attributes of the element (each also a property, in camel case):
|
|
109
|
+
|
|
110
|
+
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
111
|
+
- `default-open` (boolean): Whether it starts open, when the caller does not hold `open`. Read once.
|
|
112
|
+
|
|
113
|
+
Events:
|
|
114
|
+
|
|
115
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
116
|
+
|
|
117
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
118
|
+
|
|
119
|
+
- `trigger`
|
|
120
|
+
- `backdrop`
|
|
121
|
+
- `popup`
|
|
122
|
+
- `title`
|
|
123
|
+
- `description`
|
|
124
|
+
- `close`
|
|
125
|
+
|
|
126
|
+
Anatomy:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
<kui-alert-dialog>
|
|
130
|
+
trigger
|
|
131
|
+
portal
|
|
132
|
+
backdrop
|
|
133
|
+
popup
|
|
134
|
+
title
|
|
135
|
+
description
|
|
136
|
+
close
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Attributes and CSS variables, by part:
|
|
140
|
+
|
|
141
|
+
- trigger: The button that opens the dialog.
|
|
142
|
+
- `data-popup-open`: Present when the dialog is open.
|
|
143
|
+
- backdrop: The layer over the page behind the dialog.
|
|
144
|
+
- `data-open`: Present when it is open.
|
|
145
|
+
- `data-closed`: Present when it is closed.
|
|
146
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
147
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
148
|
+
- popup: The dialog itself.
|
|
149
|
+
- `data-open`: Present when it is open.
|
|
150
|
+
- `data-closed`: Present when it is closed.
|
|
151
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
152
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
153
|
+
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
154
|
+
- `--nested-dialogs`: How many dialogs are open above this one.
|
|
155
|
+
|
|
156
|
+
### Autocomplete
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
import "@kirana-ui/web/autocomplete"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
`<kui-autocomplete>`: `<kui-autocomplete>`: a combobox whose text is the value, with a combobox's parts: the list only suggests. `value`, `default-value`, `open`, `default-open`, `mode`, `open-on-input-click`, `auto-highlight`, `disabled`, `required`, `name`, `form`; `filter` as a property; it tells `value-change` and `open-change`.
|
|
163
|
+
|
|
164
|
+
Attributes of the element (each also a property, in camel case):
|
|
165
|
+
|
|
166
|
+
- `value` (string): What the input says: the text is the value.
|
|
167
|
+
- `default-value` (string): The text it starts with, when the caller does not hold `value`. Read once.
|
|
168
|
+
- `open` (boolean): Whether the list is open, when the caller holds it.
|
|
169
|
+
- `default-open` (boolean): Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
170
|
+
- `mode` (string): `"list"` (the default): the suggestions are filtered by what is typed. `"none"`: they are as the caller draws them.
|
|
171
|
+
- `open-on-input-click` (boolean): Whether a press on the input opens the list. Default: it opens when something is typed.
|
|
172
|
+
- `auto-highlight` (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.
|
|
173
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
174
|
+
- `required` (boolean): Needed: in a `Field`, leaving it empty is then invalid.
|
|
175
|
+
- `name` (string): The input's name in the form around it.
|
|
176
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
177
|
+
|
|
178
|
+
Properties only:
|
|
179
|
+
|
|
180
|
+
- `filter`: Whether a suggestion is shown for what was typed; `null` shows every one.
|
|
181
|
+
|
|
182
|
+
Events:
|
|
183
|
+
|
|
184
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
185
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
186
|
+
|
|
187
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
188
|
+
|
|
189
|
+
- `input`
|
|
190
|
+
- `trigger`
|
|
191
|
+
- `clear`
|
|
192
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
193
|
+
- `popup`
|
|
194
|
+
- `list`
|
|
195
|
+
- `empty`
|
|
196
|
+
- `group`: `kui-id`
|
|
197
|
+
- `group-label`
|
|
198
|
+
- `separator`
|
|
199
|
+
- `item`: `kui-disabled`, `kui-id`, `kui-label`, `kui-value`
|
|
200
|
+
- `chips`
|
|
201
|
+
- `chip`
|
|
202
|
+
- `chip-remove`
|
|
203
|
+
- `item-indicator`: `kui-value`
|
|
204
|
+
|
|
205
|
+
Anatomy:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
<kui-autocomplete>
|
|
209
|
+
input
|
|
210
|
+
trigger
|
|
211
|
+
portal
|
|
212
|
+
positioner
|
|
213
|
+
popup
|
|
214
|
+
list (optional)
|
|
215
|
+
group (optional, repeated)
|
|
216
|
+
item (repeated)
|
|
217
|
+
group-label
|
|
218
|
+
separator (repeated)
|
|
219
|
+
empty
|
|
220
|
+
popup (as above)
|
|
221
|
+
clear
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Attributes and CSS variables, by part:
|
|
225
|
+
|
|
226
|
+
- input: The text input: its text is the value, and what is typed asks for suggestions.
|
|
227
|
+
- `data-popup-open`: Present when the list is open.
|
|
228
|
+
- `data-disabled`: Present when it is disabled.
|
|
229
|
+
- 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.
|
|
230
|
+
- `data-popup-open`: Present when the list is open.
|
|
231
|
+
- `data-disabled`: Present when it is disabled.
|
|
232
|
+
- 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.
|
|
233
|
+
- `data-open`: Present when it is open.
|
|
234
|
+
- `data-closed`: Present when it is closed.
|
|
235
|
+
- `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.
|
|
236
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
237
|
+
- `--anchor-width`: The anchor's width.
|
|
238
|
+
- `--anchor-height`: The anchor's height.
|
|
239
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
240
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
241
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
242
|
+
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
|
|
243
|
+
- `data-open`: Present when it is open.
|
|
244
|
+
- `data-closed`: Present when it is closed.
|
|
245
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
246
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
247
|
+
- `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.
|
|
248
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
249
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
250
|
+
- list: The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
251
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
252
|
+
- item: One suggestion: chosen, its text is written into the input.
|
|
253
|
+
- `data-selected`: Present on the chosen item.
|
|
254
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
255
|
+
- `data-disabled`: Present when it is disabled.
|
|
256
|
+
- clear: A button that empties the input and the value.
|
|
257
|
+
- `data-disabled`: Present when it is disabled.
|
|
258
|
+
|
|
259
|
+
### Autosize
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
import "@kirana-ui/web/autosize"
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
`<kui-autosize>`: `<kui-autosize>` around a `kui-part="root"` textarea, which is as tall as what is written in it. `value` as a property, for a caller that holds the text: set, it is measured again.
|
|
266
|
+
|
|
267
|
+
Properties only:
|
|
268
|
+
|
|
269
|
+
- `value`
|
|
270
|
+
|
|
271
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
272
|
+
|
|
273
|
+
- `root`
|
|
274
|
+
|
|
275
|
+
Anatomy:
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
<kui-autosize>
|
|
279
|
+
root
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Avatar
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
import "@kirana-ui/web/avatar"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
`<kui-avatar>`: `<kui-avatar>` around `kui-part="root"`, an `image` (an `<img>`, in the page once the picture has loaded) and a `fallback`, in the page until then. `src`: the picture's address, on the component, since the image is not in the page to be given one.
|
|
289
|
+
|
|
290
|
+
Attributes of the element (each also a property, in camel case):
|
|
291
|
+
|
|
292
|
+
- `src` (string)
|
|
293
|
+
|
|
294
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
295
|
+
|
|
296
|
+
- `root`
|
|
297
|
+
- `image`
|
|
298
|
+
- `fallback`
|
|
299
|
+
|
|
300
|
+
Anatomy:
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
<kui-avatar>
|
|
304
|
+
root
|
|
305
|
+
image
|
|
306
|
+
fallback
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Button
|
|
310
|
+
|
|
311
|
+
```
|
|
312
|
+
import "@kirana-ui/web/button"
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
`<kui-button>`: `<kui-button>` around a `kui-part="root"` button, or with `native-button="false"` another element that acts as one. `disabled`, `focusable-when-disabled`, `native-button`.
|
|
316
|
+
|
|
317
|
+
Attributes of the element (each also a property, in camel case):
|
|
318
|
+
|
|
319
|
+
- `disabled` (boolean): Disabled: a press does nothing.
|
|
320
|
+
- `focusable-when-disabled` (boolean): Keeps a disabled button in the tab order, so what it would do can still be read.
|
|
321
|
+
- `native-button` (boolean): `false` when the element is not a `<button>`: it is given a button's role and keyboard.
|
|
322
|
+
|
|
323
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
324
|
+
|
|
325
|
+
- `root`
|
|
326
|
+
|
|
327
|
+
Anatomy:
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
<kui-button>
|
|
331
|
+
root
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Attributes and CSS variables, by part:
|
|
335
|
+
|
|
336
|
+
- root: The button.
|
|
337
|
+
- `data-disabled`: Present when it is disabled.
|
|
338
|
+
|
|
339
|
+
### Calendar
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
import "@kirana-ui/web/calendar"
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
`<kui-calendar>`: `<kui-calendar>` around `kui-part="root"`, with `previous` and `next` buttons, a `heading` (it says the month) and a `grid` table. The table's head row holds a `<template kui-each="weekdays">` with a `head-cell` (`{short}`, `{narrow}`, `{long}`); its body a `<template kui-each="weeks">` with a row, which holds a `<template kui-each="days">` with a `cell` and its `day` button (`{date}`, `{label}`). `value` and `default-value` (a day as `2026-03-14`; several with commas between), `mode`, `default-focused-value`, `locale`, `calendar-system`, `min`, `max`, `disabled`, `read-only`, `fixed-weeks`; `isDateUnavailable` as a property; it tells `value-change` and `month-change`.
|
|
346
|
+
|
|
347
|
+
Attributes of the element (each also a property, in camel case):
|
|
348
|
+
|
|
349
|
+
- `value` (string): One day, or with `mode: "range"` a first and a last day; `null` for none.
|
|
350
|
+
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
351
|
+
- `mode` (string): Whether one day is chosen (the default) or a first and a last.
|
|
352
|
+
- `default-focused-value` (string): The day it opens on, when it has no value: its month is the one shown.
|
|
353
|
+
- `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.
|
|
354
|
+
- `calendar-system` (string): 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.
|
|
355
|
+
- `min` (string): The first and the last day that can be chosen.
|
|
356
|
+
- `max` (string): The last day that can be chosen.
|
|
357
|
+
- `disabled` (boolean): Disabled: no day can be chosen.
|
|
358
|
+
- `read-only` (boolean): Shown as it is: the days can be moved through, and none can be chosen.
|
|
359
|
+
- `fixed-weeks` (boolean): Always six rows, so the calendar is one height in every month.
|
|
360
|
+
|
|
361
|
+
Properties only:
|
|
362
|
+
|
|
363
|
+
- `isDateUnavailable`: Days that cannot be chosen, though they can be reached: a day off, a day taken.
|
|
364
|
+
|
|
365
|
+
Events:
|
|
366
|
+
|
|
367
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
368
|
+
- `month-change`: `event.detail.month`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
369
|
+
|
|
370
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
371
|
+
|
|
372
|
+
- `root`
|
|
373
|
+
- `heading`
|
|
374
|
+
- `previous`
|
|
375
|
+
- `next`
|
|
376
|
+
- `grid`
|
|
377
|
+
- `head-cell`
|
|
378
|
+
- `cell`
|
|
379
|
+
- `day`
|
|
380
|
+
|
|
381
|
+
Lists (`<template kui-each="…">`): `weekdays`, `weeks`, `days`.
|
|
382
|
+
|
|
383
|
+
Anatomy:
|
|
384
|
+
|
|
385
|
+
```
|
|
386
|
+
<kui-calendar>
|
|
387
|
+
root
|
|
388
|
+
heading
|
|
389
|
+
previous
|
|
390
|
+
next
|
|
391
|
+
grid
|
|
392
|
+
<template kui-each="weekdays">
|
|
393
|
+
head-cell (repeated)
|
|
394
|
+
<template kui-each="weeks">
|
|
395
|
+
<template kui-each="days">
|
|
396
|
+
cell (repeated)
|
|
397
|
+
day
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
Attributes and CSS variables, by part:
|
|
401
|
+
|
|
402
|
+
- root: The calendar.
|
|
403
|
+
- `data-disabled`: Present when it is disabled.
|
|
404
|
+
- `data-readonly`: Present when its value cannot be changed.
|
|
405
|
+
- previous: Shows the month before.
|
|
406
|
+
- `data-disabled`: Present when it is disabled.
|
|
407
|
+
- next: Shows the month after.
|
|
408
|
+
- `data-disabled`: Present when it is disabled.
|
|
409
|
+
- cell: A day's cell.
|
|
410
|
+
- `data-selected`: Present on a chosen day, and on every day of a chosen range.
|
|
411
|
+
- `data-today`: Present on today.
|
|
412
|
+
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
413
|
+
- `data-disabled`: Present when it is disabled.
|
|
414
|
+
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
415
|
+
- `data-range-start`: Present on the first day of a range.
|
|
416
|
+
- `data-range-end`: Present on the last day of a range.
|
|
417
|
+
- day: The button for a day.
|
|
418
|
+
- `data-selected`: Present on a chosen day, and on every day of a chosen range.
|
|
419
|
+
- `data-today`: Present on today.
|
|
420
|
+
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
421
|
+
- `data-disabled`: Present when it is disabled.
|
|
422
|
+
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
423
|
+
- `data-range-start`: Present on the first day of a range.
|
|
424
|
+
- `data-range-end`: Present on the last day of a range.
|
|
425
|
+
|
|
426
|
+
### Carousel
|
|
427
|
+
|
|
428
|
+
```
|
|
429
|
+
import "@kirana-ui/web/carousel"
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
`<kui-carousel>`: `<kui-carousel>` around `kui-part="root"`, a `viewport` with an `item` for each slide (`kui-index`, from 0), `previous` and `next` buttons, and an `indicator` button for a slide (`kui-index`). `index`, `default-index`, `orientation`, `loop`; it tells `index-change`.
|
|
433
|
+
|
|
434
|
+
Attributes of the element (each also a property, in camel case):
|
|
435
|
+
|
|
436
|
+
- `index` (number): Which slide is at the start of the view, from 0.
|
|
437
|
+
- `default-index` (number): The slide it starts at, when the caller does not hold `index`. Read once.
|
|
438
|
+
- `orientation` (string): Whether the slides go across (the default) or down.
|
|
439
|
+
- `loop` (boolean): Whether going on from the last slide comes round to the first.
|
|
440
|
+
|
|
441
|
+
Events:
|
|
442
|
+
|
|
443
|
+
- `index-change`: `event.detail.index`, with `event.detail.details`. `preventDefault()` keeps `index` as it was.
|
|
444
|
+
|
|
445
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
446
|
+
|
|
447
|
+
- `root`
|
|
448
|
+
- `viewport`
|
|
449
|
+
- `item`: `kui-index`
|
|
450
|
+
- `previous`
|
|
451
|
+
- `next`
|
|
452
|
+
- `indicator`: `kui-index`
|
|
453
|
+
|
|
454
|
+
Anatomy:
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
<kui-carousel>
|
|
458
|
+
root
|
|
459
|
+
viewport
|
|
460
|
+
item (repeated)
|
|
461
|
+
previous
|
|
462
|
+
next
|
|
463
|
+
indicator (repeated)
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
Attributes and CSS variables, by part:
|
|
467
|
+
|
|
468
|
+
- root: The carousel: a region, named by the caller.
|
|
469
|
+
- `data-orientation="horizontal | vertical"`: Whether the slides go across or down.
|
|
470
|
+
- viewport: What scrolls. The slides are its children; the design snaps them (`scroll-snap-type`) and says whether a step glides (`scroll-behavior`).
|
|
471
|
+
- `data-orientation="horizontal | vertical"`: Whether the slides go across or down.
|
|
472
|
+
- item: One slide.
|
|
473
|
+
- `data-orientation="horizontal | vertical"`: Whether the slides go across or down.
|
|
474
|
+
- `data-current`: Present on the slide the view is at, and on its button.
|
|
475
|
+
- previous: Goes back a slide.
|
|
476
|
+
- `data-disabled`: Present when it is disabled.
|
|
477
|
+
- next: Goes on a slide.
|
|
478
|
+
- `data-disabled`: Present when it is disabled.
|
|
479
|
+
- indicator: A button for one slide.
|
|
480
|
+
- `data-current`: Present on the slide the view is at, and on its button.
|
|
481
|
+
|
|
482
|
+
### Checkbox
|
|
483
|
+
|
|
484
|
+
```
|
|
485
|
+
import "@kirana-ui/web/checkbox"
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
`<kui-checkbox>`: `<kui-checkbox>` around a `kui-part="root"` button with an `indicator` inside, which is in the page while the box is checked or indeterminate. The root draws the hidden native input a form and a label reach. `checked`, `default-checked`, `indeterminate`, `disabled`, `read-only`, `required`, `name`, `form`, `value`; it tells `checked-change`.
|
|
489
|
+
|
|
490
|
+
Attributes of the element (each also a property, in camel case):
|
|
491
|
+
|
|
492
|
+
- `checked` (boolean): Whether it is checked, when the caller holds it.
|
|
493
|
+
- `default-checked` (boolean): Read once.
|
|
494
|
+
- `indeterminate` (boolean): Neither checked nor unchecked: a parent of boxes that disagree.
|
|
495
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
496
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
497
|
+
- `required` (boolean): Needed: in a `Field`, leaving it unchecked is then invalid.
|
|
498
|
+
- `name` (string): With a name, the control is submitted with the form around it when it is checked.
|
|
499
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
500
|
+
- `value` (string): What is submitted. Default `"on"`, as a native checkbox's.
|
|
501
|
+
|
|
502
|
+
Events:
|
|
503
|
+
|
|
504
|
+
- `checked-change`: `event.detail.checked`, with `event.detail.details`. `preventDefault()` keeps `checked` as it was.
|
|
505
|
+
|
|
506
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
507
|
+
|
|
508
|
+
- `root`
|
|
509
|
+
- `indicator`
|
|
510
|
+
|
|
511
|
+
Anatomy:
|
|
512
|
+
|
|
513
|
+
```
|
|
514
|
+
<kui-checkbox>
|
|
515
|
+
root
|
|
516
|
+
indicator
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
Attributes and CSS variables, by part:
|
|
520
|
+
|
|
521
|
+
- root: The box. It holds a hidden native checkbox, which a form and a label reach.
|
|
522
|
+
- `data-checked`: Present when it is checked.
|
|
523
|
+
- `data-unchecked`: Present when it is not checked.
|
|
524
|
+
- `data-indeterminate`: Present when it is neither checked nor unchecked.
|
|
525
|
+
- `data-disabled`: Present when it is disabled.
|
|
526
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
527
|
+
- `data-required`: Present when the form needs it.
|
|
528
|
+
- indicator: The mark. In the page while the box is checked or indeterminate.
|
|
529
|
+
- `data-checked`: Present when it is checked.
|
|
530
|
+
- `data-unchecked`: Present when it is not checked.
|
|
531
|
+
- `data-indeterminate`: Present when it is neither checked nor unchecked.
|
|
532
|
+
- `data-disabled`: Present when it is disabled.
|
|
533
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
534
|
+
- `data-required`: Present when the form needs it.
|
|
535
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
536
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
537
|
+
|
|
538
|
+
### Collapsible
|
|
539
|
+
|
|
540
|
+
```
|
|
541
|
+
import "@kirana-ui/web/collapsible"
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
`<kui-collapsible>`: `<kui-collapsible>` around `kui-part="root"`, a `trigger` button and a `panel`, which is in the page while it is open (`kui-keep-mounted` keeps it). `open`, `default-open`, `disabled`; it tells `open-change`.
|
|
545
|
+
|
|
546
|
+
Attributes of the element (each also a property, in camel case):
|
|
547
|
+
|
|
548
|
+
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
549
|
+
- `default-open` (boolean): Read once.
|
|
550
|
+
- `disabled` (boolean): Disabled: its trigger does not open or close it.
|
|
551
|
+
|
|
552
|
+
Events:
|
|
553
|
+
|
|
554
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
555
|
+
|
|
556
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
557
|
+
|
|
558
|
+
- `root`
|
|
559
|
+
- `trigger`
|
|
560
|
+
- `panel`
|
|
561
|
+
|
|
562
|
+
Anatomy:
|
|
563
|
+
|
|
564
|
+
```
|
|
565
|
+
<kui-collapsible>
|
|
566
|
+
root
|
|
567
|
+
trigger (repeated)
|
|
568
|
+
panel
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
Attributes and CSS variables, by part:
|
|
572
|
+
|
|
573
|
+
- root: Groups the trigger and the panel.
|
|
574
|
+
- `data-open`: Present when it is open.
|
|
575
|
+
- `data-closed`: Present when it is closed.
|
|
576
|
+
- `data-disabled`: Present when it is disabled.
|
|
577
|
+
- trigger: The button that opens and closes the panel.
|
|
578
|
+
- `data-panel-open`: Present when the panel is open.
|
|
579
|
+
- `data-disabled`: Present when it is disabled.
|
|
580
|
+
- panel: The content. In the page while open, and through its exit's motion.
|
|
581
|
+
- `data-open`: Present when it is open.
|
|
582
|
+
- `data-closed`: Present when it is closed.
|
|
583
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
584
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
585
|
+
- `--collapsible-panel-height`: The panel's content height while it opens or closes, `auto` once it is open.
|
|
586
|
+
- `--collapsible-panel-width`: The panel's content width while it opens or closes, `auto` once it is open.
|
|
587
|
+
|
|
588
|
+
### Combobox
|
|
589
|
+
|
|
590
|
+
```
|
|
591
|
+
import "@kirana-ui/web/combobox"
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
`<kui-combobox>`: `<kui-combobox>` around an `input`, with a `trigger` and a `clear` button if it has them, and a `portal` with a `positioner` (`kui-side` … and `kui-anchor`, an element's id) around the `popup`, which holds an `item` for each `kui-value` (`kui-disabled`, `kui-label`, `kui-id`) with an `item-indicator`, in `group`s with a `group-label` and `separator`s if it has them, and an `empty` part drawn while nothing matches. The `input` may be inside the `popup`, the items then in a `list` part: the popup is placed against the `trigger`, and the input has focus while it is open. With `multiple`, the input is in a `chips` part with a `<template kui-each="chips">` holding a `chip` (`{value}`) and its `chip-remove` button. With a name it draws the hidden input a form reads. `value`, `default-value`, `input-value`, `default-input-value`, `open`, `default-open`, `disabled`, `required`, `inline`, `auto-highlight`, `multiple`, `values` and `default-values` (with commas between), `name`, `form`; `items` and `filter` as properties; it tells `value-change`, `values-change`, `input-value-change` and `open-change`.
|
|
595
|
+
|
|
596
|
+
Attributes of the element (each also a property, in camel case):
|
|
597
|
+
|
|
598
|
+
- `value` (string): The chosen value; `null` is "none".
|
|
599
|
+
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
600
|
+
- `input-value` (string): What the input says.
|
|
601
|
+
- `default-input-value` (string): The text the input starts with, when the caller does not hold `inputValue`. Read once.
|
|
602
|
+
- `open` (boolean): Whether the list is open, when the caller holds it.
|
|
603
|
+
- `default-open` (boolean): Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
604
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
605
|
+
- `required` (boolean): In a field, "none" is then wrong.
|
|
606
|
+
- `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.
|
|
607
|
+
- `auto-highlight` (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.
|
|
608
|
+
- `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`.
|
|
609
|
+
- `values` (string): With `multiple`: the chosen values, in the order they were chosen.
|
|
610
|
+
- `default-values` (string): With `multiple`: the values it starts with, when the caller does not hold `values`. Read once.
|
|
611
|
+
- `name` (string): With a name, the value is submitted with the form around it.
|
|
612
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
613
|
+
|
|
614
|
+
Properties only:
|
|
615
|
+
|
|
616
|
+
- `items`: 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.
|
|
617
|
+
- `filter`: 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.
|
|
618
|
+
|
|
619
|
+
Events:
|
|
620
|
+
|
|
621
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
622
|
+
- `values-change`: `event.detail.values`, with `event.detail.details`. `preventDefault()` keeps `values` as it was.
|
|
623
|
+
- `input-value-change`: `event.detail.inputValue`, with `event.detail.details`. `preventDefault()` keeps `inputValue` as it was.
|
|
624
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
625
|
+
|
|
626
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
627
|
+
|
|
628
|
+
- `input`
|
|
629
|
+
- `trigger`
|
|
630
|
+
- `clear`
|
|
631
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
632
|
+
- `popup`
|
|
633
|
+
- `list`
|
|
634
|
+
- `empty`
|
|
635
|
+
- `group`: `kui-id`
|
|
636
|
+
- `group-label`
|
|
637
|
+
- `separator`
|
|
638
|
+
- `item`: `kui-disabled`, `kui-id`, `kui-label`, `kui-value`
|
|
639
|
+
- `chips`
|
|
640
|
+
- `chip`
|
|
641
|
+
- `chip-remove`
|
|
642
|
+
- `item-indicator`: `kui-value`
|
|
643
|
+
|
|
644
|
+
Lists (`<template kui-each="…">`): `chips`.
|
|
645
|
+
|
|
646
|
+
Anatomy:
|
|
647
|
+
|
|
648
|
+
```
|
|
649
|
+
<kui-combobox>
|
|
650
|
+
input
|
|
651
|
+
trigger
|
|
652
|
+
portal
|
|
653
|
+
positioner
|
|
654
|
+
popup
|
|
655
|
+
input (as above)
|
|
656
|
+
list (optional)
|
|
657
|
+
group (optional, repeated)
|
|
658
|
+
item (repeated)
|
|
659
|
+
item-indicator
|
|
660
|
+
group-label
|
|
661
|
+
separator (repeated)
|
|
662
|
+
empty
|
|
663
|
+
popup (as above)
|
|
664
|
+
clear
|
|
665
|
+
chips
|
|
666
|
+
input (as above)
|
|
667
|
+
chip (repeated)
|
|
668
|
+
chip-remove
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
Attributes and CSS variables, by part:
|
|
672
|
+
|
|
673
|
+
- 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.
|
|
674
|
+
- `data-popup-open`: Present when the list is open.
|
|
675
|
+
- `data-disabled`: Present when it is disabled.
|
|
676
|
+
- 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.
|
|
677
|
+
- `data-popup-open`: Present when the list is open.
|
|
678
|
+
- `data-disabled`: Present when it is disabled.
|
|
679
|
+
- 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.
|
|
680
|
+
- `data-open`: Present when it is open.
|
|
681
|
+
- `data-closed`: Present when it is closed.
|
|
682
|
+
- `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.
|
|
683
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
684
|
+
- `--anchor-width`: The anchor's width.
|
|
685
|
+
- `--anchor-height`: The anchor's height.
|
|
686
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
687
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
688
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
689
|
+
- popup: The list of items. With a `list` inside, what holds it: a dialog around an input and the list.
|
|
690
|
+
- `data-open`: Present when it is open.
|
|
691
|
+
- `data-closed`: Present when it is closed.
|
|
692
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
693
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
694
|
+
- `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.
|
|
695
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
696
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
697
|
+
- list: The items' own box inside the popup, when the popup holds more than items (an input): it is then the listbox.
|
|
698
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
699
|
+
- item: One choice in the list.
|
|
700
|
+
- `data-selected`: Present on the chosen item.
|
|
701
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
702
|
+
- `data-disabled`: Present when it is disabled.
|
|
703
|
+
- clear: A button that empties the input and the value.
|
|
704
|
+
- `data-disabled`: Present when it is disabled.
|
|
705
|
+
- chipRemove: A chip's button that takes its value away.
|
|
706
|
+
- `data-disabled`: Present when it is disabled.
|
|
707
|
+
|
|
708
|
+
### Command
|
|
709
|
+
|
|
710
|
+
```
|
|
711
|
+
import "@kirana-ui/web/command"
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
`<kui-command>`: `<kui-command>` around `kui-part="root"`, an `input` and a `list` of `item`s (`kui-value`, `kui-disabled`, `kui-label`, `kui-keywords` with commas between, `kui-id`), in `group`s with a `group-heading` and `separator`s (`kui-always-render`) if it has them, and an `empty` part drawn while nothing matches. What is typed filters the list; Enter or a press runs an item. `input-value`, `default-input-value`, `loop`, `disabled`; `filter` as a property; it tells `input-value-change` and `select`.
|
|
715
|
+
|
|
716
|
+
Attributes of the element (each also a property, in camel case):
|
|
717
|
+
|
|
718
|
+
- `input-value` (string): What the input says.
|
|
719
|
+
- `default-input-value` (string): The text the input starts with, when the caller does not hold `inputValue`. Read once.
|
|
720
|
+
- `loop` (boolean): Whether a step past an end of the list goes round to the other.
|
|
721
|
+
- `disabled` (boolean): Disabled: nothing can be typed or chosen.
|
|
722
|
+
|
|
723
|
+
Properties only:
|
|
724
|
+
|
|
725
|
+
- `filter`: 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.
|
|
726
|
+
|
|
727
|
+
Events:
|
|
728
|
+
|
|
729
|
+
- `input-value-change`: `event.detail.inputValue`, with `event.detail.details`. `preventDefault()` keeps `inputValue` as it was.
|
|
730
|
+
- `select`: `event.detail.value`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
731
|
+
|
|
732
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
733
|
+
|
|
734
|
+
- `root`
|
|
735
|
+
- `input`
|
|
736
|
+
- `list`
|
|
737
|
+
- `empty`
|
|
738
|
+
- `group`: `kui-id`
|
|
739
|
+
- `group-heading`
|
|
740
|
+
- `item`: `kui-disabled`, `kui-id`, `kui-keywords`, `kui-label`, `kui-value`
|
|
741
|
+
- `separator`: `kui-always-render`
|
|
742
|
+
|
|
743
|
+
Anatomy:
|
|
744
|
+
|
|
745
|
+
```
|
|
746
|
+
<kui-command>
|
|
747
|
+
root
|
|
748
|
+
input
|
|
749
|
+
list
|
|
750
|
+
empty
|
|
751
|
+
group (optional, repeated)
|
|
752
|
+
group-heading
|
|
753
|
+
item (repeated)
|
|
754
|
+
separator (repeated)
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
Attributes and CSS variables, by part:
|
|
758
|
+
|
|
759
|
+
- root: A list of commands with the input that filters it.
|
|
760
|
+
- `data-disabled`: Present when it is disabled.
|
|
761
|
+
- input: The text input. What is typed filters the list; focus stays in it.
|
|
762
|
+
- `data-disabled`: Present when it is disabled.
|
|
763
|
+
- list: The commands.
|
|
764
|
+
- `data-empty`: Present when no item is shown for what was typed.
|
|
765
|
+
- item: One command.
|
|
766
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
767
|
+
- `data-disabled`: Present when it is disabled.
|
|
768
|
+
|
|
769
|
+
### ContextMenu
|
|
770
|
+
|
|
771
|
+
```
|
|
772
|
+
import "@kirana-ui/web/context-menu"
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
`<kui-context-menu>`: `<kui-context-menu>`: a menu for an area of the page, opened at the pointer by a secondary press, or a long one on a touch screen. Its `kui-part="trigger"` is the area; the rest are a menu's parts.
|
|
776
|
+
|
|
777
|
+
Events:
|
|
778
|
+
|
|
779
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
780
|
+
|
|
781
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
782
|
+
|
|
783
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
784
|
+
- `popup`
|
|
785
|
+
- `arrow`
|
|
786
|
+
- `separator`
|
|
787
|
+
- `item`: `kui-close-on-click`, `kui-disabled`, `kui-label`
|
|
788
|
+
- `group`: `kui-id`
|
|
789
|
+
- `group-label`
|
|
790
|
+
- `checkbox-item`
|
|
791
|
+
- `checkbox-item-indicator`
|
|
792
|
+
- `radio-group`
|
|
793
|
+
- `radio-item`: `kui-close-on-click`, `kui-disabled`, `kui-label`, `kui-value`
|
|
794
|
+
- `radio-item-indicator`: `kui-value`
|
|
795
|
+
- `trigger`
|
|
796
|
+
|
|
797
|
+
Anatomy:
|
|
798
|
+
|
|
799
|
+
```
|
|
800
|
+
<kui-context-menu>
|
|
801
|
+
trigger
|
|
802
|
+
portal
|
|
803
|
+
positioner
|
|
804
|
+
popup
|
|
805
|
+
arrow
|
|
806
|
+
group (optional, repeated)
|
|
807
|
+
item (repeated)
|
|
808
|
+
group-label
|
|
809
|
+
checkbox-item (repeated)
|
|
810
|
+
checkbox-item-indicator
|
|
811
|
+
radio-group (repeated)
|
|
812
|
+
radio-item (repeated)
|
|
813
|
+
radio-item-indicator
|
|
814
|
+
<kui-context-menu> (repeated)
|
|
815
|
+
portal (as above)
|
|
816
|
+
trigger
|
|
817
|
+
separator (repeated)
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
Attributes and CSS variables, by part:
|
|
821
|
+
|
|
822
|
+
- trigger: The area a secondary press, or a long press on a touch screen, opens the menu in.
|
|
823
|
+
- `data-popup-open`: Present when the menu is open.
|
|
824
|
+
- positioner: Places the menu against its trigger. It carries the geometry.
|
|
825
|
+
- `data-open`: Present when it is open.
|
|
826
|
+
- `data-closed`: Present when it is closed.
|
|
827
|
+
- `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.
|
|
828
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
829
|
+
- `--anchor-width`: The anchor's width.
|
|
830
|
+
- `--anchor-height`: The anchor's height.
|
|
831
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
832
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
833
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
834
|
+
- popup: The menu itself: the list of items.
|
|
835
|
+
- `data-open`: Present when it is open.
|
|
836
|
+
- `data-closed`: Present when it is closed.
|
|
837
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
838
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
839
|
+
- `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.
|
|
840
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
841
|
+
- arrow: An element that points at the trigger.
|
|
842
|
+
- `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.
|
|
843
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
844
|
+
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
845
|
+
- item: An action. Choosing it closes the menu.
|
|
846
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
847
|
+
- `data-disabled`: Present when it is disabled.
|
|
848
|
+
- linkItem: An item that is a link. Choosing it follows the link and closes the menu.
|
|
849
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
850
|
+
- `data-disabled`: Present when it is disabled.
|
|
851
|
+
- checkboxItem: An item that is checked or not. Choosing it leaves the menu open.
|
|
852
|
+
- `data-checked`: Present when it is checked.
|
|
853
|
+
- `data-unchecked`: Present when it is not checked.
|
|
854
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
855
|
+
- `data-disabled`: Present when it is disabled.
|
|
856
|
+
- checkboxItemIndicator: A mark a checkbox item shows while it is checked.
|
|
857
|
+
- `data-checked`: Present when it is checked.
|
|
858
|
+
- `data-unchecked`: Present when it is not checked.
|
|
859
|
+
- radioGroup: Radio items of which one is chosen.
|
|
860
|
+
- `data-disabled`: Present when it is disabled.
|
|
861
|
+
- radioItem: One choice of a radio group. Choosing it leaves the menu open.
|
|
862
|
+
- `data-checked`: Present when it is checked.
|
|
863
|
+
- `data-unchecked`: Present when it is not checked.
|
|
864
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
865
|
+
- `data-disabled`: Present when it is disabled.
|
|
866
|
+
- radioItemIndicator: A mark a radio item shows while it is the chosen one.
|
|
867
|
+
- `data-checked`: Present when it is checked.
|
|
868
|
+
- `data-unchecked`: Present when it is not checked.
|
|
869
|
+
- submenuTrigger: An item that opens a menu beside it.
|
|
870
|
+
- `data-popup-open`: Present when its menu is open.
|
|
871
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
872
|
+
- `data-disabled`: Present when it is disabled.
|
|
873
|
+
|
|
874
|
+
### DateField
|
|
875
|
+
|
|
876
|
+
```
|
|
877
|
+
import "@kirana-ui/web/date-field"
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
`<kui-date-field>`: `<kui-date-field>` around `kui-part="root"`, which holds a `<template kui-each="segments">` with the `segment` each part of the date is typed in (`{type}` and `{index}` say which), and the hidden `input` a form reads. `value`, `default-value`, `locale`, `min`, `max`, `disabled`, `read-only`, `required`, `name`, `form`; `placeholders` as a property; it tells `value-change`.
|
|
881
|
+
|
|
882
|
+
Attributes of the element (each also a property, in camel case):
|
|
883
|
+
|
|
884
|
+
- `value` (string): The day typed, once all of it is; `null` until then.
|
|
885
|
+
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
886
|
+
- `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.
|
|
887
|
+
- `min` (string): The first and the last day it takes: outside them it says it is invalid.
|
|
888
|
+
- `max` (string): The last day it takes.
|
|
889
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
890
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
891
|
+
- `required` (boolean): Needed: in a `Field`, leaving it empty is then invalid.
|
|
892
|
+
- `name` (string): The name it is submitted under, by its hidden input.
|
|
893
|
+
- `form` (string): The id of the form it belongs to, when it is not inside it.
|
|
894
|
+
|
|
895
|
+
Properties only:
|
|
896
|
+
|
|
897
|
+
- `placeholders`: What an empty part shows. Default: `dd`, `mm`, `yyyy`.
|
|
898
|
+
|
|
899
|
+
Events:
|
|
900
|
+
|
|
901
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
902
|
+
|
|
903
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
904
|
+
|
|
905
|
+
- `root`
|
|
906
|
+
- `segment`
|
|
907
|
+
- `input`
|
|
908
|
+
|
|
909
|
+
Lists (`<template kui-each="…">`): `segments`.
|
|
910
|
+
|
|
911
|
+
Anatomy:
|
|
912
|
+
|
|
913
|
+
```
|
|
914
|
+
<kui-date-field>
|
|
915
|
+
root
|
|
916
|
+
<template kui-each="segments">
|
|
917
|
+
segment (repeated)
|
|
918
|
+
input
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
Attributes and CSS variables, by part:
|
|
922
|
+
|
|
923
|
+
- root: The field: a group of the date's parts.
|
|
924
|
+
- `data-disabled`: Present when it is disabled.
|
|
925
|
+
- `data-readonly`: Present when its value cannot be changed.
|
|
926
|
+
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
927
|
+
- segment: One piece of the date: a part that is typed, or what stands between two.
|
|
928
|
+
- `data-segment="day | month | year | literal"`: Which piece it is.
|
|
929
|
+
- `data-placeholder`: Present on a part that is empty.
|
|
930
|
+
- `data-disabled`: Present when it is disabled.
|
|
931
|
+
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
932
|
+
|
|
933
|
+
### DatePicker
|
|
934
|
+
|
|
935
|
+
```
|
|
936
|
+
import "@kirana-ui/web/date-picker"
|
|
937
|
+
```
|
|
938
|
+
|
|
939
|
+
`<kui-date-picker>`: `<kui-date-picker>`: a date field and a calendar in a popover that are one value. A `kui-part="field"` with a date field's `segments` template and `input`; a `trigger` button; and a `portal` with a `positioner` around the `popup`, which holds the `calendar` with a calendar's parts and templates. `value`, `default-value`, `open`, `default-open`, `locale`, `min`, `max`, `calendar-system`, `fixed-weeks`, `disabled`, `read-only`, `required`, `name`, `form`; `isDateUnavailable` and `placeholders` as properties; it tells `value-change` and `open-change`.
|
|
940
|
+
|
|
941
|
+
Attributes of the element (each also a property, in camel case):
|
|
942
|
+
|
|
943
|
+
- `value` (string): The day, typed or picked; `null` for none.
|
|
944
|
+
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
945
|
+
- `open` (boolean): Whether the calendar is open, when the caller holds it.
|
|
946
|
+
- `default-open` (boolean): Whether the calendar starts open, when the caller does not hold `open`. Read once.
|
|
947
|
+
- `locale` (string): The language and region of the field and the calendar. Give it: a server does not know.
|
|
948
|
+
- `min` (string): The first and the last day that can be typed or picked.
|
|
949
|
+
- `max` (string): The last day that can be typed or picked.
|
|
950
|
+
- `calendar-system` (string): The calendar its months are laid out in, when it is not the Gregorian one.
|
|
951
|
+
- `fixed-weeks` (boolean): Always six rows of days.
|
|
952
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
953
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
954
|
+
- `required` (boolean): Needed: in a `Field`, leaving it empty is then invalid.
|
|
955
|
+
- `name` (string): The name it is submitted under.
|
|
956
|
+
- `form` (string): The id of the form it belongs to, when it is not inside it.
|
|
957
|
+
|
|
958
|
+
Properties only:
|
|
959
|
+
|
|
960
|
+
- `isDateUnavailable`: Days that cannot be picked in the calendar.
|
|
961
|
+
- `placeholders`: What an empty part of the field shows.
|
|
962
|
+
|
|
963
|
+
Events:
|
|
964
|
+
|
|
965
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
966
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
967
|
+
|
|
968
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
969
|
+
|
|
970
|
+
- `field`
|
|
971
|
+
- `segment`
|
|
972
|
+
- `input`
|
|
973
|
+
- `trigger`
|
|
974
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
975
|
+
- `popup`
|
|
976
|
+
- `calendar`
|
|
977
|
+
- `heading`
|
|
978
|
+
- `previous`
|
|
979
|
+
- `next`
|
|
980
|
+
- `grid`
|
|
981
|
+
- `head-cell`
|
|
982
|
+
- `cell`
|
|
983
|
+
- `day`
|
|
984
|
+
|
|
985
|
+
Lists (`<template kui-each="…">`): `segments`, `weekdays`, `weeks`, `days`.
|
|
986
|
+
|
|
987
|
+
Anatomy:
|
|
988
|
+
|
|
989
|
+
```
|
|
990
|
+
<kui-date-picker>
|
|
991
|
+
field
|
|
992
|
+
<template kui-each="segments">
|
|
993
|
+
segment (repeated)
|
|
994
|
+
input
|
|
995
|
+
trigger
|
|
996
|
+
portal
|
|
997
|
+
positioner
|
|
998
|
+
popup
|
|
999
|
+
calendar
|
|
1000
|
+
heading
|
|
1001
|
+
previous
|
|
1002
|
+
next
|
|
1003
|
+
grid
|
|
1004
|
+
<template kui-each="weekdays">
|
|
1005
|
+
head-cell (repeated)
|
|
1006
|
+
<template kui-each="weeks">
|
|
1007
|
+
<template kui-each="days">
|
|
1008
|
+
cell (repeated)
|
|
1009
|
+
day
|
|
1010
|
+
```
|
|
1011
|
+
|
|
1012
|
+
Attributes and CSS variables, by part:
|
|
1013
|
+
|
|
1014
|
+
- field: The field: a group of the date's parts.
|
|
1015
|
+
- `data-disabled`: Present when it is disabled.
|
|
1016
|
+
- `data-readonly`: Present when its value cannot be changed.
|
|
1017
|
+
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
1018
|
+
- segment: One piece of the date: a part that is typed, or what stands between two.
|
|
1019
|
+
- `data-segment="day | month | year | literal"`: Which piece it is.
|
|
1020
|
+
- `data-placeholder`: Present on a part that is empty.
|
|
1021
|
+
- `data-disabled`: Present when it is disabled.
|
|
1022
|
+
- `data-invalid`: Present when the date is outside what it takes, or is asked for and half typed.
|
|
1023
|
+
- trigger: The button that opens the popover, and what it is placed against.
|
|
1024
|
+
- `data-popup-open`: Present when the popover is open.
|
|
1025
|
+
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
1026
|
+
- `data-open`: Present when it is open.
|
|
1027
|
+
- `data-closed`: Present when it is closed.
|
|
1028
|
+
- `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.
|
|
1029
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1030
|
+
- `--anchor-width`: The anchor's width.
|
|
1031
|
+
- `--anchor-height`: The anchor's height.
|
|
1032
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1033
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1034
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
1035
|
+
- popup: The popover itself.
|
|
1036
|
+
- `data-open`: Present when it is open.
|
|
1037
|
+
- `data-closed`: Present when it is closed.
|
|
1038
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1039
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1040
|
+
- `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.
|
|
1041
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1042
|
+
- calendar: The calendar.
|
|
1043
|
+
- `data-disabled`: Present when it is disabled.
|
|
1044
|
+
- `data-readonly`: Present when its value cannot be changed.
|
|
1045
|
+
- previous: Shows the month before.
|
|
1046
|
+
- `data-disabled`: Present when it is disabled.
|
|
1047
|
+
- next: Shows the month after.
|
|
1048
|
+
- `data-disabled`: Present when it is disabled.
|
|
1049
|
+
- cell: A day's cell.
|
|
1050
|
+
- `data-selected`: Present on a chosen day, and on every day of a chosen range.
|
|
1051
|
+
- `data-today`: Present on today.
|
|
1052
|
+
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
1053
|
+
- `data-disabled`: Present when it is disabled.
|
|
1054
|
+
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
1055
|
+
- `data-range-start`: Present on the first day of a range.
|
|
1056
|
+
- `data-range-end`: Present on the last day of a range.
|
|
1057
|
+
- day: The button for a day.
|
|
1058
|
+
- `data-selected`: Present on a chosen day, and on every day of a chosen range.
|
|
1059
|
+
- `data-today`: Present on today.
|
|
1060
|
+
- `data-outside-month`: Present on the days of the month before and after that fill the first and last weeks.
|
|
1061
|
+
- `data-disabled`: Present when it is disabled.
|
|
1062
|
+
- `data-unavailable`: Present on a day that cannot be chosen.
|
|
1063
|
+
- `data-range-start`: Present on the first day of a range.
|
|
1064
|
+
- `data-range-end`: Present on the last day of a range.
|
|
1065
|
+
|
|
1066
|
+
### Dialog
|
|
1067
|
+
|
|
1068
|
+
```
|
|
1069
|
+
import "@kirana-ui/web/dialog"
|
|
1070
|
+
```
|
|
1071
|
+
|
|
1072
|
+
`<kui-dialog>`: `<kui-dialog>` around a `kui-part="trigger"` button and a `portal`, which is drawn at the end of the page while the dialog is open and holds its `backdrop` and its `popup`, with a `title`, a `description` and a `close` button. `open`, `default-open`, `modal`, `dismissible`; it tells `open-change`.
|
|
1073
|
+
|
|
1074
|
+
Attributes of the element (each also a property, in camel case):
|
|
1075
|
+
|
|
1076
|
+
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
1077
|
+
- `default-open` (boolean): Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1078
|
+
- `modal` (boolean): Blocks the page behind it and traps focus. Default `true`.
|
|
1079
|
+
- `dismissible` (boolean): Whether a press outside closes it. Default `true`.
|
|
1080
|
+
|
|
1081
|
+
Events:
|
|
1082
|
+
|
|
1083
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
1084
|
+
|
|
1085
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1086
|
+
|
|
1087
|
+
- `trigger`
|
|
1088
|
+
- `backdrop`
|
|
1089
|
+
- `popup`
|
|
1090
|
+
- `title`
|
|
1091
|
+
- `description`
|
|
1092
|
+
- `close`
|
|
1093
|
+
|
|
1094
|
+
Anatomy:
|
|
1095
|
+
|
|
1096
|
+
```
|
|
1097
|
+
<kui-dialog>
|
|
1098
|
+
trigger
|
|
1099
|
+
portal
|
|
1100
|
+
backdrop
|
|
1101
|
+
popup
|
|
1102
|
+
title
|
|
1103
|
+
description
|
|
1104
|
+
close
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
Attributes and CSS variables, by part:
|
|
1108
|
+
|
|
1109
|
+
- trigger: The button that opens the dialog.
|
|
1110
|
+
- `data-popup-open`: Present when the dialog is open.
|
|
1111
|
+
- backdrop: The layer over the page behind the dialog.
|
|
1112
|
+
- `data-open`: Present when it is open.
|
|
1113
|
+
- `data-closed`: Present when it is closed.
|
|
1114
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1115
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1116
|
+
- popup: The dialog itself.
|
|
1117
|
+
- `data-open`: Present when it is open.
|
|
1118
|
+
- `data-closed`: Present when it is closed.
|
|
1119
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1120
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1121
|
+
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
1122
|
+
- `--nested-dialogs`: How many dialogs are open above this one.
|
|
1123
|
+
|
|
1124
|
+
### Drawer
|
|
1125
|
+
|
|
1126
|
+
```
|
|
1127
|
+
import "@kirana-ui/web/drawer"
|
|
1128
|
+
```
|
|
1129
|
+
|
|
1130
|
+
`<kui-drawer>`: `<kui-drawer>`: a dialog that comes from an edge and is dragged back to it, with the dialog's parts. `open`, `default-open`, `modal`, `dismissible`, `swipe-direction`, `snap-points` (with commas between: `0.4,1` or `200px,1`), `snap-point`, `default-snap-point`; it tells `open-change` and `snap-point-change`.
|
|
1131
|
+
|
|
1132
|
+
Attributes of the element (each also a property, in camel case):
|
|
1133
|
+
|
|
1134
|
+
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
1135
|
+
- `default-open` (boolean): Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1136
|
+
- `modal` (boolean): Blocks the page behind it and traps focus. Default `true`.
|
|
1137
|
+
- `dismissible` (boolean): Whether a press outside closes it. Default `true`.
|
|
1138
|
+
- `swipe-direction` (string): The way it is dragged to close it: the edge it came from. Default: `"down"`.
|
|
1139
|
+
- `snap-points` (string): 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.
|
|
1140
|
+
- `snap-point` (string): Which of them it rests at, as it was given.
|
|
1141
|
+
- `default-snap-point` (string): Where it opens. Default: the smallest.
|
|
1142
|
+
|
|
1143
|
+
Events:
|
|
1144
|
+
|
|
1145
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
1146
|
+
- `snap-point-change`: `event.detail.snapPoint`, with `event.detail.details`. `preventDefault()` keeps `snapPoint` as it was.
|
|
1147
|
+
|
|
1148
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1149
|
+
|
|
1150
|
+
- `trigger`
|
|
1151
|
+
- `backdrop`
|
|
1152
|
+
- `popup`
|
|
1153
|
+
- `title`
|
|
1154
|
+
- `description`
|
|
1155
|
+
- `close`
|
|
1156
|
+
|
|
1157
|
+
Anatomy:
|
|
1158
|
+
|
|
1159
|
+
```
|
|
1160
|
+
<kui-drawer>
|
|
1161
|
+
trigger
|
|
1162
|
+
portal
|
|
1163
|
+
backdrop
|
|
1164
|
+
popup
|
|
1165
|
+
title
|
|
1166
|
+
description
|
|
1167
|
+
close
|
|
1168
|
+
```
|
|
1169
|
+
|
|
1170
|
+
Attributes and CSS variables, by part:
|
|
1171
|
+
|
|
1172
|
+
- trigger: The button that opens the dialog.
|
|
1173
|
+
- `data-popup-open`: Present when the dialog is open.
|
|
1174
|
+
- backdrop: The layer over the page behind the dialog.
|
|
1175
|
+
- `data-open`: Present when it is open.
|
|
1176
|
+
- `data-closed`: Present when it is closed.
|
|
1177
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1178
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1179
|
+
- `data-swiping`: Present while the drawer is dragged.
|
|
1180
|
+
- `--drawer-swipe-movement-x`: How far it has been dragged across.
|
|
1181
|
+
- `--drawer-swipe-movement-y`: How far it has been dragged up or down.
|
|
1182
|
+
- `--drawer-swipe-progress`: How far it has been dragged, of its own size: 0 to 1.
|
|
1183
|
+
- `--drawer-snap-point-offset`: How far from whole it rests, towards the edge it closes at: 0px at its largest snap point.
|
|
1184
|
+
- popup: The drawer. A design moves it by what it says of the drag, and gives it `touch-action: none` where a finger drags it.
|
|
1185
|
+
- `data-open`: Present when it is open.
|
|
1186
|
+
- `data-closed`: Present when it is closed.
|
|
1187
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1188
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1189
|
+
- `data-nested-dialog-open`: Present when another dialog is open above this one.
|
|
1190
|
+
- `data-swiping`: Present while the drawer is dragged.
|
|
1191
|
+
- `data-swipe-direction="up | down | left | right"`: The way it is dragged to close it.
|
|
1192
|
+
- `data-swipe-dismiss`: Present once a drag has closed it.
|
|
1193
|
+
- `data-expanded`: Present while it rests whole, of several snap points.
|
|
1194
|
+
- `data-nested-drawer-open`: Present while another drawer is open over it.
|
|
1195
|
+
- `data-nested-drawer-swiping`: Present while a drawer over it is dragged.
|
|
1196
|
+
- `--nested-dialogs`: How many dialogs are open above this one.
|
|
1197
|
+
- `--drawer-swipe-movement-x`: How far it has been dragged across.
|
|
1198
|
+
- `--drawer-swipe-movement-y`: How far it has been dragged up or down.
|
|
1199
|
+
- `--drawer-swipe-progress`: How far it has been dragged, of its own size: 0 to 1.
|
|
1200
|
+
- `--drawer-snap-point-offset`: How far from whole it rests, towards the edge it closes at: 0px at its largest snap point.
|
|
1201
|
+
- `--drawer-height`: Its height.
|
|
1202
|
+
- `--nested-drawers`: How many drawers are open over it.
|
|
1203
|
+
- `--drawer-frontmost-height`: The height of the drawer in front of every other, while this one is open.
|
|
1204
|
+
- `--drawer-swipe-strength`: Once let go: 0.1 to 1, the share of the design's own time it should take to come to rest. A drawer thrown hard arrives sooner.
|
|
1205
|
+
- `--drawer-width`: Its width.
|
|
1206
|
+
|
|
1207
|
+
### Field
|
|
1208
|
+
|
|
1209
|
+
```
|
|
1210
|
+
import "@kirana-ui/web/field"
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
`<kui-field>`: `<kui-field>` around `kui-part="root"`, a `label`, a `control` (an input, a textarea or a select), a `description` and an `error`, which is in the page while something is wrong and says what, unless the page gave it something to say (`kui-match="valueMissing"` for one finding of the browser's, `kui-match` alone for always). `name`, `disabled`, `invalid`, `validation-mode`, `validation-debounce-time`; `validate` as a property.
|
|
1214
|
+
|
|
1215
|
+
Attributes of the element (each also a property, in camel case):
|
|
1216
|
+
|
|
1217
|
+
- `name` (string): The control's name in the form.
|
|
1218
|
+
- `disabled` (boolean): Disables the field: its control cannot be changed, and its parts say so (`data-disabled`).
|
|
1219
|
+
- `invalid` (boolean): Invalid whatever the value: an error known from elsewhere.
|
|
1220
|
+
- `validation-mode` (string): When the value is checked; the form's by default, else `"onSubmit"`.
|
|
1221
|
+
- `validation-debounce-time` (number): With `"onChange"`, how long the value must rest before it is checked, in milliseconds.
|
|
1222
|
+
|
|
1223
|
+
Properties only:
|
|
1224
|
+
|
|
1225
|
+
- `validate`: 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.
|
|
1226
|
+
|
|
1227
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1228
|
+
|
|
1229
|
+
- `root`
|
|
1230
|
+
- `label`
|
|
1231
|
+
- `control`
|
|
1232
|
+
- `description`
|
|
1233
|
+
- `error`: `kui-match`
|
|
1234
|
+
|
|
1235
|
+
Anatomy:
|
|
1236
|
+
|
|
1237
|
+
```
|
|
1238
|
+
<kui-field>
|
|
1239
|
+
root
|
|
1240
|
+
label
|
|
1241
|
+
control
|
|
1242
|
+
description
|
|
1243
|
+
error
|
|
1244
|
+
```
|
|
1245
|
+
|
|
1246
|
+
Attributes and CSS variables, by part:
|
|
1247
|
+
|
|
1248
|
+
- root: A control with its label, its description and its errors.
|
|
1249
|
+
- `data-disabled`: Present when it is disabled.
|
|
1250
|
+
- `data-touched`: Present once focus has left the control.
|
|
1251
|
+
- `data-dirty`: Present while the value is not the one it started with.
|
|
1252
|
+
- `data-filled`: Present while the control has a value.
|
|
1253
|
+
- `data-focused`: Present while the control has focus.
|
|
1254
|
+
- `data-valid`: Present once the value has been checked and found right.
|
|
1255
|
+
- `data-invalid`: Present while the value is wrong.
|
|
1256
|
+
- label: The control's name: a press on it reaches the control.
|
|
1257
|
+
- `data-disabled`: Present when it is disabled.
|
|
1258
|
+
- `data-touched`: Present once focus has left the control.
|
|
1259
|
+
- `data-dirty`: Present while the value is not the one it started with.
|
|
1260
|
+
- `data-filled`: Present while the control has a value.
|
|
1261
|
+
- `data-focused`: Present while the control has focus.
|
|
1262
|
+
- `data-valid`: Present once the value has been checked and found right.
|
|
1263
|
+
- `data-invalid`: Present while the value is wrong.
|
|
1264
|
+
- control: The control: an input, a textarea or a select.
|
|
1265
|
+
- `data-disabled`: Present when it is disabled.
|
|
1266
|
+
- `data-touched`: Present once focus has left the control.
|
|
1267
|
+
- `data-dirty`: Present while the value is not the one it started with.
|
|
1268
|
+
- `data-filled`: Present while the control has a value.
|
|
1269
|
+
- `data-focused`: Present while the control has focus.
|
|
1270
|
+
- `data-valid`: Present once the value has been checked and found right.
|
|
1271
|
+
- `data-invalid`: Present while the value is wrong.
|
|
1272
|
+
- description: More about the control, said after its name.
|
|
1273
|
+
- `data-disabled`: Present when it is disabled.
|
|
1274
|
+
- `data-touched`: Present once focus has left the control.
|
|
1275
|
+
- `data-dirty`: Present while the value is not the one it started with.
|
|
1276
|
+
- `data-filled`: Present while the control has a value.
|
|
1277
|
+
- `data-focused`: Present while the control has focus.
|
|
1278
|
+
- `data-valid`: Present once the value has been checked and found right.
|
|
1279
|
+
- `data-invalid`: Present while the value is wrong.
|
|
1280
|
+
- error: What is wrong with the value. In the page while it applies.
|
|
1281
|
+
- `data-disabled`: Present when it is disabled.
|
|
1282
|
+
- `data-touched`: Present once focus has left the control.
|
|
1283
|
+
- `data-dirty`: Present while the value is not the one it started with.
|
|
1284
|
+
- `data-filled`: Present while the control has a value.
|
|
1285
|
+
- `data-focused`: Present while the control has focus.
|
|
1286
|
+
- `data-valid`: Present once the value has been checked and found right.
|
|
1287
|
+
- `data-invalid`: Present while the value is wrong.
|
|
1288
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1289
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1290
|
+
|
|
1291
|
+
### Fieldset
|
|
1292
|
+
|
|
1293
|
+
```
|
|
1294
|
+
import "@kirana-ui/web/fieldset"
|
|
1295
|
+
```
|
|
1296
|
+
|
|
1297
|
+
`<kui-fieldset>`: `<kui-fieldset>` around a `kui-part="root"` fieldset and its `legend`. `disabled`.
|
|
1298
|
+
|
|
1299
|
+
Attributes of the element (each also a property, in camel case):
|
|
1300
|
+
|
|
1301
|
+
- `disabled` (boolean): Disables every field inside.
|
|
1302
|
+
|
|
1303
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1304
|
+
|
|
1305
|
+
- `root`
|
|
1306
|
+
- `legend`
|
|
1307
|
+
|
|
1308
|
+
Anatomy:
|
|
1309
|
+
|
|
1310
|
+
```
|
|
1311
|
+
<kui-fieldset>
|
|
1312
|
+
root
|
|
1313
|
+
legend
|
|
1314
|
+
```
|
|
1315
|
+
|
|
1316
|
+
Attributes and CSS variables, by part:
|
|
1317
|
+
|
|
1318
|
+
- root: The group of fields.
|
|
1319
|
+
- `data-disabled`: Present when it is disabled.
|
|
1320
|
+
- legend: The group's name.
|
|
1321
|
+
- `data-disabled`: Present when it is disabled.
|
|
1322
|
+
|
|
1323
|
+
### Form
|
|
1324
|
+
|
|
1325
|
+
```
|
|
1326
|
+
import "@kirana-ui/web/form"
|
|
1327
|
+
```
|
|
1328
|
+
|
|
1329
|
+
`<kui-form>`: `<kui-form>` around a `kui-part="root"` form. Its fields are checked when it is submitted; valid, it tells `form-submit` with their values and the page is not left. `validation-mode`; `errors` (from outside the page, by field name) as a property; it tells `clear-errors`.
|
|
1330
|
+
|
|
1331
|
+
Attributes of the element (each also a property, in camel case):
|
|
1332
|
+
|
|
1333
|
+
- `validation-mode` (string): When the form's fields check their values, unless a field says otherwise. Default `"onSubmit"`.
|
|
1334
|
+
|
|
1335
|
+
Properties only:
|
|
1336
|
+
|
|
1337
|
+
- `errors`: Errors from outside the page (a server's), by field name. A field shows its own until its value changes.
|
|
1338
|
+
|
|
1339
|
+
Events:
|
|
1340
|
+
|
|
1341
|
+
- `form-submit`: `event.detail.values`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
1342
|
+
- `clear-errors`: `event.detail.errors`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
1343
|
+
|
|
1344
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1345
|
+
|
|
1346
|
+
- `root`
|
|
1347
|
+
|
|
1348
|
+
Anatomy:
|
|
1349
|
+
|
|
1350
|
+
```
|
|
1351
|
+
<kui-form>
|
|
1352
|
+
root
|
|
1353
|
+
```
|
|
1354
|
+
|
|
1355
|
+
### HoverCard
|
|
1356
|
+
|
|
1357
|
+
```
|
|
1358
|
+
import "@kirana-ui/web/hover-card"
|
|
1359
|
+
```
|
|
1360
|
+
|
|
1361
|
+
`<kui-hover-card>`: `<kui-hover-card>` around a `kui-part="trigger"` link and a `portal` with a `positioner` around the `popup`, which the pointer may enter. `open`, `default-open`, `delay`, `close-delay`, `disabled`; it tells `open-change`.
|
|
1362
|
+
|
|
1363
|
+
Attributes of the element (each also a property, in camel case):
|
|
1364
|
+
|
|
1365
|
+
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
1366
|
+
- `default-open` (boolean): Whether it starts open, when the caller does not hold `open`. Read once.
|
|
1367
|
+
- `delay` (number): How long the pointer rests on the trigger before the popup opens, in milliseconds.
|
|
1368
|
+
- `close-delay` (number): How long after the pointer leaves the popup closes, in milliseconds.
|
|
1369
|
+
- `disabled` (boolean): Disabled: the pointer and focus do not open it.
|
|
1370
|
+
|
|
1371
|
+
Events:
|
|
1372
|
+
|
|
1373
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
1374
|
+
|
|
1375
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1376
|
+
|
|
1377
|
+
- `trigger`: `kui-close-delay`, `kui-delay`
|
|
1378
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
1379
|
+
- `popup`
|
|
1380
|
+
- `arrow`
|
|
1381
|
+
|
|
1382
|
+
Anatomy:
|
|
1383
|
+
|
|
1384
|
+
```
|
|
1385
|
+
<kui-hover-card>
|
|
1386
|
+
trigger
|
|
1387
|
+
portal
|
|
1388
|
+
positioner
|
|
1389
|
+
popup
|
|
1390
|
+
arrow
|
|
1391
|
+
```
|
|
1392
|
+
|
|
1393
|
+
Attributes and CSS variables, by part:
|
|
1394
|
+
|
|
1395
|
+
- trigger: The link the card previews.
|
|
1396
|
+
- `data-popup-open`: Present when the card is open.
|
|
1397
|
+
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
1398
|
+
- `data-open`: Present when it is open.
|
|
1399
|
+
- `data-closed`: Present when it is closed.
|
|
1400
|
+
- `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.
|
|
1401
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1402
|
+
- `--anchor-width`: The anchor's width.
|
|
1403
|
+
- `--anchor-height`: The anchor's height.
|
|
1404
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1405
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1406
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
1407
|
+
- popup: The card itself.
|
|
1408
|
+
- `data-open`: Present when it is open.
|
|
1409
|
+
- `data-closed`: Present when it is closed.
|
|
1410
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1411
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1412
|
+
- `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.
|
|
1413
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1414
|
+
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
1415
|
+
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
1416
|
+
- `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.
|
|
1417
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1418
|
+
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|
|
1419
|
+
|
|
1420
|
+
### Input
|
|
1421
|
+
|
|
1422
|
+
```
|
|
1423
|
+
import "@kirana-ui/web/input"
|
|
1424
|
+
```
|
|
1425
|
+
|
|
1426
|
+
`<kui-input>`: `<kui-input>` around a `kui-part="root"` input or textarea: it says its state, and inside a `<kui-field>` it is the field's control. `disabled`; it tells `value-change`.
|
|
1427
|
+
|
|
1428
|
+
Attributes of the element (each also a property, in camel case):
|
|
1429
|
+
|
|
1430
|
+
- `disabled` (boolean): Disabled: nothing can be typed in it.
|
|
1431
|
+
|
|
1432
|
+
Events:
|
|
1433
|
+
|
|
1434
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
1435
|
+
|
|
1436
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1437
|
+
|
|
1438
|
+
- `root`
|
|
1439
|
+
|
|
1440
|
+
Anatomy:
|
|
1441
|
+
|
|
1442
|
+
```
|
|
1443
|
+
<kui-input>
|
|
1444
|
+
root
|
|
1445
|
+
```
|
|
1446
|
+
|
|
1447
|
+
Attributes and CSS variables, by part:
|
|
1448
|
+
|
|
1449
|
+
- input: A text input. Inside a field it is the field's control.
|
|
1450
|
+
- `data-disabled`: Present when it is disabled.
|
|
1451
|
+
- `data-touched`: Present once focus has left the input.
|
|
1452
|
+
- `data-dirty`: Present while the value is not the one it started with.
|
|
1453
|
+
- `data-filled`: Present while the input has a value.
|
|
1454
|
+
- `data-focused`: Present while the input has focus.
|
|
1455
|
+
- `data-valid`: In a field: present once the value was checked and found right.
|
|
1456
|
+
- `data-invalid`: In a field: present while the value is wrong.
|
|
1457
|
+
|
|
1458
|
+
### Label
|
|
1459
|
+
|
|
1460
|
+
```
|
|
1461
|
+
import "@kirana-ui/web/label"
|
|
1462
|
+
```
|
|
1463
|
+
|
|
1464
|
+
`<kui-label>`: `<kui-label>` around a `kui-part="root"` label. Inside a `<kui-field>` it is the field's.
|
|
1465
|
+
|
|
1466
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1467
|
+
|
|
1468
|
+
- `root`
|
|
1469
|
+
|
|
1470
|
+
Anatomy:
|
|
1471
|
+
|
|
1472
|
+
```
|
|
1473
|
+
<kui-label>
|
|
1474
|
+
root
|
|
1475
|
+
```
|
|
1476
|
+
|
|
1477
|
+
Attributes and CSS variables, by part:
|
|
1478
|
+
|
|
1479
|
+
- label: A control's name. Inside a field it is the field's label, with its states.
|
|
1480
|
+
- `data-disabled`: Present when it is disabled.
|
|
1481
|
+
- `data-touched`: Present once focus has left the control.
|
|
1482
|
+
- `data-dirty`: Present while the value is not the one it started with.
|
|
1483
|
+
- `data-filled`: Present while the control has a value.
|
|
1484
|
+
- `data-focused`: Present while the control has focus.
|
|
1485
|
+
- `data-valid`: Present once the value has been checked and found right.
|
|
1486
|
+
- `data-invalid`: Present while the value is wrong.
|
|
1487
|
+
|
|
1488
|
+
### Listbox
|
|
1489
|
+
|
|
1490
|
+
```
|
|
1491
|
+
import "@kirana-ui/web/listbox"
|
|
1492
|
+
```
|
|
1493
|
+
|
|
1494
|
+
`<kui-listbox>`: `<kui-listbox>` around `kui-part="root"` and an `item` for each `kui-value` (`kui-disabled`, `kui-label`), which may hold an `indicator`, in the page while the item is chosen. Items may be in a `group` with its `group-label`. `value` and `default-value` (with commas between), `multiple`, `disabled`, `loop`, `name`, `form`; it tells `value-change`.
|
|
1495
|
+
|
|
1496
|
+
Attributes of the element (each also a property, in camel case):
|
|
1497
|
+
|
|
1498
|
+
- `value` (string): The chosen values: none, one, or with `multiple` several.
|
|
1499
|
+
- `default-value` (string): The values it starts with, when the caller does not hold `value`. Read once.
|
|
1500
|
+
- `multiple` (boolean): Whether more than one can be chosen: a press then adds or takes away.
|
|
1501
|
+
- `disabled` (boolean): Disabled: no item can be chosen.
|
|
1502
|
+
- `loop` (boolean): Whether the arrows go round from the last item to the first. Default: they do not.
|
|
1503
|
+
- `name` (string): With a name, the chosen values are submitted with the form around the list.
|
|
1504
|
+
- `form` (string): The id of the form the list belongs to, when it is not inside it.
|
|
1505
|
+
|
|
1506
|
+
Events:
|
|
1507
|
+
|
|
1508
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
1509
|
+
|
|
1510
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1511
|
+
|
|
1512
|
+
- `root`
|
|
1513
|
+
- `item`: `kui-disabled`, `kui-label`, `kui-value`
|
|
1514
|
+
- `indicator`: `kui-value`
|
|
1515
|
+
- `group`: `kui-id`
|
|
1516
|
+
- `group-label`: `kui-id`
|
|
1517
|
+
|
|
1518
|
+
Anatomy:
|
|
1519
|
+
|
|
1520
|
+
```
|
|
1521
|
+
<kui-listbox>
|
|
1522
|
+
root
|
|
1523
|
+
group (optional, repeated)
|
|
1524
|
+
item (repeated)
|
|
1525
|
+
indicator
|
|
1526
|
+
group-label
|
|
1527
|
+
```
|
|
1528
|
+
|
|
1529
|
+
Attributes and CSS variables, by part:
|
|
1530
|
+
|
|
1531
|
+
- root: The list. It is one stop for Tab.
|
|
1532
|
+
- `data-disabled`: Present when it is disabled.
|
|
1533
|
+
- item: One choice in the list.
|
|
1534
|
+
- `data-selected`: Present on a chosen item.
|
|
1535
|
+
- `data-highlighted`: Present on the item the keyboard is on.
|
|
1536
|
+
- `data-disabled`: Present when it is disabled.
|
|
1537
|
+
- itemIndicator: A mark an item shows while it is chosen.
|
|
1538
|
+
- `data-selected`: Present on a chosen item.
|
|
1539
|
+
|
|
1540
|
+
### Menu
|
|
1541
|
+
|
|
1542
|
+
```
|
|
1543
|
+
import "@kirana-ui/web/menu"
|
|
1544
|
+
```
|
|
1545
|
+
|
|
1546
|
+
`<kui-menu>`: `<kui-menu>` around a `kui-part="trigger"` and a `portal` with a `positioner` (its `kui-side` and the like) around the `popup`, which holds its `item`s (`kui-disabled`, `kui-label`, `kui-close-on-click="false"`), `separator`s, `group`s with a `group-label`, `checkbox-item`s (`kui-checked`, `kui-default-checked`; it tells `checked-change`) with a `checkbox-item-indicator`, and a `radio-group` (`kui-value`, `kui-default-value`; it tells `value-change`) of `radio-item`s (`kui-value`) with a `radio-item-indicator`. A `<kui-menu>` inside a menu is its submenu, its trigger an item of the menu; inside a `<kui-menubar>`, one of the bar's. `open`, `default-open`, `disabled`, `loop`, `modal`; it tells `open-change`.
|
|
1547
|
+
|
|
1548
|
+
Events:
|
|
1549
|
+
|
|
1550
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
1551
|
+
|
|
1552
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1553
|
+
|
|
1554
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
1555
|
+
- `popup`
|
|
1556
|
+
- `arrow`
|
|
1557
|
+
- `separator`
|
|
1558
|
+
- `item`: `kui-close-on-click`, `kui-disabled`, `kui-label`
|
|
1559
|
+
- `group`: `kui-id`
|
|
1560
|
+
- `group-label`
|
|
1561
|
+
- `checkbox-item`
|
|
1562
|
+
- `checkbox-item-indicator`
|
|
1563
|
+
- `radio-group`
|
|
1564
|
+
- `radio-item`: `kui-close-on-click`, `kui-disabled`, `kui-label`, `kui-value`
|
|
1565
|
+
- `radio-item-indicator`: `kui-value`
|
|
1566
|
+
- `trigger`
|
|
1567
|
+
|
|
1568
|
+
Anatomy:
|
|
1569
|
+
|
|
1570
|
+
```
|
|
1571
|
+
<kui-menu>
|
|
1572
|
+
trigger
|
|
1573
|
+
portal
|
|
1574
|
+
positioner
|
|
1575
|
+
popup
|
|
1576
|
+
arrow
|
|
1577
|
+
group (optional, repeated)
|
|
1578
|
+
item (repeated)
|
|
1579
|
+
group-label
|
|
1580
|
+
checkbox-item (repeated)
|
|
1581
|
+
checkbox-item-indicator
|
|
1582
|
+
radio-group (repeated)
|
|
1583
|
+
radio-item (repeated)
|
|
1584
|
+
radio-item-indicator
|
|
1585
|
+
<kui-menu> (repeated)
|
|
1586
|
+
portal (as above)
|
|
1587
|
+
trigger
|
|
1588
|
+
separator (repeated)
|
|
1589
|
+
```
|
|
1590
|
+
|
|
1591
|
+
Attributes and CSS variables, by part:
|
|
1592
|
+
|
|
1593
|
+
- trigger: The button that opens the menu, and what it is placed against.
|
|
1594
|
+
- `data-popup-open`: Present when the menu is open.
|
|
1595
|
+
- `data-disabled`: Present when it is disabled.
|
|
1596
|
+
- positioner: Places the menu against its trigger. It carries the geometry.
|
|
1597
|
+
- `data-open`: Present when it is open.
|
|
1598
|
+
- `data-closed`: Present when it is closed.
|
|
1599
|
+
- `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.
|
|
1600
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1601
|
+
- `--anchor-width`: The anchor's width.
|
|
1602
|
+
- `--anchor-height`: The anchor's height.
|
|
1603
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1604
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1605
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
1606
|
+
- popup: The menu itself: the list of items.
|
|
1607
|
+
- `data-open`: Present when it is open.
|
|
1608
|
+
- `data-closed`: Present when it is closed.
|
|
1609
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1610
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1611
|
+
- `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.
|
|
1612
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1613
|
+
- arrow: An element that points at the trigger.
|
|
1614
|
+
- `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.
|
|
1615
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1616
|
+
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
1617
|
+
- item: An action. Choosing it closes the menu.
|
|
1618
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
1619
|
+
- `data-disabled`: Present when it is disabled.
|
|
1620
|
+
- linkItem: An item that is a link. Choosing it follows the link and closes the menu.
|
|
1621
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
1622
|
+
- `data-disabled`: Present when it is disabled.
|
|
1623
|
+
- checkboxItem: An item that is checked or not. Choosing it leaves the menu open.
|
|
1624
|
+
- `data-checked`: Present when it is checked.
|
|
1625
|
+
- `data-unchecked`: Present when it is not checked.
|
|
1626
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
1627
|
+
- `data-disabled`: Present when it is disabled.
|
|
1628
|
+
- checkboxItemIndicator: A mark a checkbox item shows while it is checked.
|
|
1629
|
+
- `data-checked`: Present when it is checked.
|
|
1630
|
+
- `data-unchecked`: Present when it is not checked.
|
|
1631
|
+
- radioGroup: Radio items of which one is chosen.
|
|
1632
|
+
- `data-disabled`: Present when it is disabled.
|
|
1633
|
+
- radioItem: One choice of a radio group. Choosing it leaves the menu open.
|
|
1634
|
+
- `data-checked`: Present when it is checked.
|
|
1635
|
+
- `data-unchecked`: Present when it is not checked.
|
|
1636
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
1637
|
+
- `data-disabled`: Present when it is disabled.
|
|
1638
|
+
- radioItemIndicator: A mark a radio item shows while it is the chosen one.
|
|
1639
|
+
- `data-checked`: Present when it is checked.
|
|
1640
|
+
- `data-unchecked`: Present when it is not checked.
|
|
1641
|
+
- submenuTrigger: An item that opens a menu beside it.
|
|
1642
|
+
- `data-popup-open`: Present when its menu is open.
|
|
1643
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
1644
|
+
- `data-disabled`: Present when it is disabled.
|
|
1645
|
+
|
|
1646
|
+
### Menubar
|
|
1647
|
+
|
|
1648
|
+
```
|
|
1649
|
+
import "@kirana-ui/web/menubar"
|
|
1650
|
+
```
|
|
1651
|
+
|
|
1652
|
+
`<kui-menubar>`: `<kui-menubar>` around `kui-part="root"` and its `<kui-menu>`s, which work as one: the arrows move between them, and with one open the pointer opens the next. `loop`, `disabled`, `orientation`.
|
|
1653
|
+
|
|
1654
|
+
Attributes of the element (each also a property, in camel case):
|
|
1655
|
+
|
|
1656
|
+
- `loop` (boolean): Whether the arrows go round from the last menu to the first. Default: they do.
|
|
1657
|
+
- `disabled` (boolean): No menu of the bar opens.
|
|
1658
|
+
- `orientation` (string): A row (the default) or a column of menus. In a column a menu opens beside its trigger.
|
|
1659
|
+
|
|
1660
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1661
|
+
|
|
1662
|
+
- `root`
|
|
1663
|
+
|
|
1664
|
+
Anatomy:
|
|
1665
|
+
|
|
1666
|
+
```
|
|
1667
|
+
<kui-menubar>
|
|
1668
|
+
root
|
|
1669
|
+
```
|
|
1670
|
+
|
|
1671
|
+
Attributes and CSS variables, by part:
|
|
1672
|
+
|
|
1673
|
+
- root: The row of menus. A menu inside it is one of its items.
|
|
1674
|
+
- `data-disabled`: Present when it is disabled.
|
|
1675
|
+
- `data-orientation="horizontal | vertical"`: Whether its menus are in a row or a column.
|
|
1676
|
+
|
|
1677
|
+
### MessageScroller
|
|
1678
|
+
|
|
1679
|
+
```
|
|
1680
|
+
import "@kirana-ui/web/message-scroller"
|
|
1681
|
+
```
|
|
1682
|
+
|
|
1683
|
+
`<kui-message-scroller>`: `<kui-message-scroller>` around `kui-part="root"`, a `viewport` with its `content`, and a `button` that goes back to the newest. It stays at the bottom as content comes, unless the reader has scrolled away. `initial`, `threshold`; it tells `at-bottom-change`.
|
|
1684
|
+
|
|
1685
|
+
Attributes of the element (each also a property, in camel case):
|
|
1686
|
+
|
|
1687
|
+
- `initial` (string): Where it begins: at the newest message (the default), or at the first.
|
|
1688
|
+
- `threshold` (number): How near the end counts as at it, in pixels. Default: 24.
|
|
1689
|
+
|
|
1690
|
+
Events:
|
|
1691
|
+
|
|
1692
|
+
- `at-bottom-change`: `event.detail.atBottom`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
1693
|
+
|
|
1694
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1695
|
+
|
|
1696
|
+
- `root`
|
|
1697
|
+
- `viewport`
|
|
1698
|
+
- `content`
|
|
1699
|
+
- `button`
|
|
1700
|
+
|
|
1701
|
+
Anatomy:
|
|
1702
|
+
|
|
1703
|
+
```
|
|
1704
|
+
<kui-message-scroller>
|
|
1705
|
+
root
|
|
1706
|
+
viewport
|
|
1707
|
+
content
|
|
1708
|
+
button
|
|
1709
|
+
```
|
|
1710
|
+
|
|
1711
|
+
Attributes and CSS variables, by part:
|
|
1712
|
+
|
|
1713
|
+
- root: What holds the conversation and its button.
|
|
1714
|
+
- `data-at-bottom`: Present while the newest message is in view.
|
|
1715
|
+
- viewport: What scrolls: a log, reached by the keyboard.
|
|
1716
|
+
- `data-at-bottom`: Present while the newest message is in view.
|
|
1717
|
+
- button: Goes to the newest message. Inert while that is in view.
|
|
1718
|
+
- `data-at-bottom`: Present while the newest message is in view.
|
|
1719
|
+
|
|
1720
|
+
### Meter
|
|
1721
|
+
|
|
1722
|
+
```
|
|
1723
|
+
import "@kirana-ui/web/meter"
|
|
1724
|
+
```
|
|
1725
|
+
|
|
1726
|
+
`<kui-meter>`: `<kui-meter>` around `kui-part="root"`, a `label`, a `track` with its `indicator`, and a `value`, which says the value as it is written unless the page gave it something to say. `value`, `min`, `max`, `locale`; `format` and `getAriaValueText` as properties.
|
|
1727
|
+
|
|
1728
|
+
Attributes of the element (each also a property, in camel case):
|
|
1729
|
+
|
|
1730
|
+
- `value` (number): The measure, between `min` and `max`. A meter always has one.
|
|
1731
|
+
- `min` (number): Default 0.
|
|
1732
|
+
- `max` (number): Default 100.
|
|
1733
|
+
- `locale` (string): The language the value is written in; the page's by default.
|
|
1734
|
+
|
|
1735
|
+
Properties only:
|
|
1736
|
+
|
|
1737
|
+
- `format`: How the value is written; a percentage of the range by default.
|
|
1738
|
+
- `getAriaValueText`: What assistive technology reads for the value, when the written value is not enough.
|
|
1739
|
+
|
|
1740
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1741
|
+
|
|
1742
|
+
- `root`
|
|
1743
|
+
- `label`
|
|
1744
|
+
- `track`
|
|
1745
|
+
- `indicator`
|
|
1746
|
+
- `value`
|
|
1747
|
+
|
|
1748
|
+
Anatomy:
|
|
1749
|
+
|
|
1750
|
+
```
|
|
1751
|
+
<kui-meter>
|
|
1752
|
+
root
|
|
1753
|
+
track
|
|
1754
|
+
indicator
|
|
1755
|
+
value
|
|
1756
|
+
label
|
|
1757
|
+
```
|
|
1758
|
+
|
|
1759
|
+
### NavigationMenu
|
|
1760
|
+
|
|
1761
|
+
```
|
|
1762
|
+
import "@kirana-ui/web/navigation-menu"
|
|
1763
|
+
```
|
|
1764
|
+
|
|
1765
|
+
`<kui-navigation-menu>`: `<kui-navigation-menu>` around a `kui-part="root"` nav with its `list`. An `item` has a `trigger` (with an `icon` if it has one) and a `content`, which is drawn in the menu's one `viewport` while its item is open; its `kui-value` tells it from the others, and an item that is given none makes its own. A `link` is a link (`kui-active`, `kui-close-on-click="false"`). The viewport is in a `portal` with a `positioner` around the `popup`, with an `arrow` and a `backdrop` if it has them. `value`, `default-value`, `delay`, `close-delay`, `orientation`; it tells `value-change`.
|
|
1766
|
+
|
|
1767
|
+
Attributes of the element (each also a property, in camel case):
|
|
1768
|
+
|
|
1769
|
+
- `value` (string): The item whose content is shown; `null` is "none".
|
|
1770
|
+
- `default-value` (string): The item whose content it starts with, when the caller does not hold `value`. Read once.
|
|
1771
|
+
- `delay` (number): How long the pointer rests on a trigger before its content shows, in milliseconds.
|
|
1772
|
+
- `close-delay` (number): How long after the pointer leaves the content goes, in milliseconds.
|
|
1773
|
+
- `orientation` (string): Whether the triggers are laid out across (the default) or down: the arrows that move between them follow.
|
|
1774
|
+
|
|
1775
|
+
Events:
|
|
1776
|
+
|
|
1777
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
1778
|
+
|
|
1779
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1780
|
+
|
|
1781
|
+
- `root`
|
|
1782
|
+
- `list`
|
|
1783
|
+
- `item`: `kui-value`
|
|
1784
|
+
- `trigger`: `kui-value`
|
|
1785
|
+
- `icon`: `kui-value`
|
|
1786
|
+
- `content`: `kui-value`
|
|
1787
|
+
- `link`: `kui-active`, `kui-close-on-click`
|
|
1788
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
1789
|
+
- `popup`
|
|
1790
|
+
- `viewport`
|
|
1791
|
+
- `arrow`
|
|
1792
|
+
- `backdrop`
|
|
1793
|
+
|
|
1794
|
+
Anatomy:
|
|
1795
|
+
|
|
1796
|
+
```
|
|
1797
|
+
<kui-navigation-menu>
|
|
1798
|
+
root
|
|
1799
|
+
list
|
|
1800
|
+
item (repeated)
|
|
1801
|
+
trigger
|
|
1802
|
+
icon
|
|
1803
|
+
content
|
|
1804
|
+
link (repeated)
|
|
1805
|
+
link (repeated, as above)
|
|
1806
|
+
link (repeated, as above)
|
|
1807
|
+
portal
|
|
1808
|
+
positioner
|
|
1809
|
+
popup
|
|
1810
|
+
viewport
|
|
1811
|
+
arrow
|
|
1812
|
+
backdrop
|
|
1813
|
+
```
|
|
1814
|
+
|
|
1815
|
+
Attributes and CSS variables, by part:
|
|
1816
|
+
|
|
1817
|
+
- root: The navigation.
|
|
1818
|
+
- `data-orientation="horizontal | vertical"`: Whether the list is a row or a column.
|
|
1819
|
+
- list: The row of items.
|
|
1820
|
+
- `data-orientation="horizontal | vertical"`: Whether the list is a row or a column.
|
|
1821
|
+
- trigger: The button that shows an item's content.
|
|
1822
|
+
- `data-popup-open`: Present while the item's content is shown.
|
|
1823
|
+
- icon: A mark on a trigger that shows whether its content is open.
|
|
1824
|
+
- `data-popup-open`: Present while the item's content is shown.
|
|
1825
|
+
- content: What an item shows. It is drawn in the viewport every item shares.
|
|
1826
|
+
- `data-open`: Present when it is open.
|
|
1827
|
+
- `data-closed`: Present when it is closed.
|
|
1828
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1829
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1830
|
+
- `data-activation-direction="left | right"`: Which way it came from: the item before it, or after.
|
|
1831
|
+
- link: A link, in the list or in an item's content.
|
|
1832
|
+
- `data-active`: Present on the link of the page the reader is on.
|
|
1833
|
+
- positioner: Places the popup against the open item's trigger. It carries the geometry.
|
|
1834
|
+
- `data-open`: Present when it is open.
|
|
1835
|
+
- `data-closed`: Present when it is closed.
|
|
1836
|
+
- `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
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1838
|
+
- `--anchor-width`: The anchor's width.
|
|
1839
|
+
- `--anchor-height`: The anchor's height.
|
|
1840
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
1841
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
1842
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
1843
|
+
- `--positioner-width`: The open content's width.
|
|
1844
|
+
- `--positioner-height`: The open content's height.
|
|
1845
|
+
- popup: The panel every item's content is shown in.
|
|
1846
|
+
- `data-open`: Present when it is open.
|
|
1847
|
+
- `data-closed`: Present when it is closed.
|
|
1848
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1849
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1850
|
+
- `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.
|
|
1851
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1852
|
+
- `--popup-width`: The open content's width.
|
|
1853
|
+
- `--popup-height`: The open content's height.
|
|
1854
|
+
- arrow: An element that points at the open item's trigger.
|
|
1855
|
+
- `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.
|
|
1856
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
1857
|
+
- `data-uncentered`: Present when the arrow cannot sit at the trigger's centre.
|
|
1858
|
+
- backdrop: An element behind the popup, for a design that dims the page.
|
|
1859
|
+
- `data-open`: Present when it is open.
|
|
1860
|
+
- `data-closed`: Present when it is closed.
|
|
1861
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
1862
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
1863
|
+
|
|
1864
|
+
### NumberField
|
|
1865
|
+
|
|
1866
|
+
```
|
|
1867
|
+
import "@kirana-ui/web/number-field"
|
|
1868
|
+
```
|
|
1869
|
+
|
|
1870
|
+
`<kui-number-field>`: `<kui-number-field>` around `kui-part="root"`, a `group`, an `input`, and `increment` and `decrement` buttons. With a name, the root draws the hidden input a form reads. `value`, `default-value`, `min`, `max`, `step`, `small-step`, `large-step`, `snap-on-step`, `allow-wheel-scrub`, `locale`, `disabled`, `read-only`, `required`, `name`, `form`; `format` as a property; it tells `value-change` and `value-committed`.
|
|
1871
|
+
|
|
1872
|
+
Attributes of the element (each also a property, in camel case):
|
|
1873
|
+
|
|
1874
|
+
- `value` (number): The number; `null` is "none".
|
|
1875
|
+
- `default-value` (number): The value it starts with, when the caller does not hold `value`. Read once.
|
|
1876
|
+
- `min` (number): The least the number may be.
|
|
1877
|
+
- `max` (number): The most the number may be.
|
|
1878
|
+
- `step` (number): What the buttons and the arrows move by. Default 1.
|
|
1879
|
+
- `small-step` (number): With Alt held. Default 0.1.
|
|
1880
|
+
- `large-step` (number): With Shift held. Default 10.
|
|
1881
|
+
- `snap-on-step` (boolean): A step lands on a multiple of the step, counted from `min`.
|
|
1882
|
+
- `allow-wheel-scrub` (boolean): The wheel steps it while the pointer is over the input and focus is in it.
|
|
1883
|
+
- `locale` (string): The language it is written in; the page's by default.
|
|
1884
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
1885
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
1886
|
+
- `required` (boolean): Needed: in a `Field`, leaving it empty is then invalid.
|
|
1887
|
+
- `name` (string): With a name, the number is submitted with the form around it.
|
|
1888
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
1889
|
+
|
|
1890
|
+
Properties only:
|
|
1891
|
+
|
|
1892
|
+
- `format`: How the number is written.
|
|
1893
|
+
|
|
1894
|
+
Events:
|
|
1895
|
+
|
|
1896
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
1897
|
+
- `value-committed`: `event.detail.value`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
1898
|
+
|
|
1899
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1900
|
+
|
|
1901
|
+
- `root`
|
|
1902
|
+
- `group`
|
|
1903
|
+
- `input`
|
|
1904
|
+
- `increment`
|
|
1905
|
+
- `decrement`
|
|
1906
|
+
|
|
1907
|
+
Anatomy:
|
|
1908
|
+
|
|
1909
|
+
```
|
|
1910
|
+
<kui-number-field>
|
|
1911
|
+
root
|
|
1912
|
+
group
|
|
1913
|
+
input
|
|
1914
|
+
increment
|
|
1915
|
+
decrement
|
|
1916
|
+
```
|
|
1917
|
+
|
|
1918
|
+
Attributes and CSS variables, by part:
|
|
1919
|
+
|
|
1920
|
+
- root: Groups the number field's parts.
|
|
1921
|
+
- `data-disabled`: Present when it is disabled.
|
|
1922
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
1923
|
+
- `data-required`: Present when a number must be given.
|
|
1924
|
+
- `data-touched`: Present once focus has left the input.
|
|
1925
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
1926
|
+
- `data-filled`: Present while there is a number.
|
|
1927
|
+
- `data-focused`: Present while the input has focus.
|
|
1928
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1929
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
1930
|
+
- group: What holds the input and its buttons, as one control.
|
|
1931
|
+
- `data-disabled`: Present when it is disabled.
|
|
1932
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
1933
|
+
- `data-required`: Present when a number must be given.
|
|
1934
|
+
- `data-touched`: Present once focus has left the input.
|
|
1935
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
1936
|
+
- `data-filled`: Present while there is a number.
|
|
1937
|
+
- `data-focused`: Present while the input has focus.
|
|
1938
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1939
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
1940
|
+
- input: The text input: it takes what its locale writes a number with.
|
|
1941
|
+
- `data-disabled`: Present when it is disabled.
|
|
1942
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
1943
|
+
- `data-required`: Present when a number must be given.
|
|
1944
|
+
- `data-touched`: Present once focus has left the input.
|
|
1945
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
1946
|
+
- `data-filled`: Present while there is a number.
|
|
1947
|
+
- `data-focused`: Present while the input has focus.
|
|
1948
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1949
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
1950
|
+
- increment: A button that steps the number up. Held, it goes on.
|
|
1951
|
+
- `data-disabled`: Present when it is disabled.
|
|
1952
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
1953
|
+
- `data-required`: Present when a number must be given.
|
|
1954
|
+
- `data-touched`: Present once focus has left the input.
|
|
1955
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
1956
|
+
- `data-filled`: Present while there is a number.
|
|
1957
|
+
- `data-focused`: Present while the input has focus.
|
|
1958
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1959
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
1960
|
+
- decrement: A button that steps the number down. Held, it goes on.
|
|
1961
|
+
- `data-disabled`: Present when it is disabled.
|
|
1962
|
+
- `data-readonly`: Present when the number cannot be changed.
|
|
1963
|
+
- `data-required`: Present when a number must be given.
|
|
1964
|
+
- `data-touched`: Present once focus has left the input.
|
|
1965
|
+
- `data-dirty`: Present while the number is not the one it started with.
|
|
1966
|
+
- `data-filled`: Present while there is a number.
|
|
1967
|
+
- `data-focused`: Present while the input has focus.
|
|
1968
|
+
- `data-valid`: In a field: present once the number was checked and found right.
|
|
1969
|
+
- `data-invalid`: In a field: present while the number is wrong.
|
|
1970
|
+
|
|
1971
|
+
### Otp
|
|
1972
|
+
|
|
1973
|
+
```
|
|
1974
|
+
import "@kirana-ui/web/otp"
|
|
1975
|
+
```
|
|
1976
|
+
|
|
1977
|
+
`<kui-otp>`: `<kui-otp>` around `kui-part="root"`, the one `input` that is typed in, and a `slot` for each character (`kui-index`, from 0), which says its character and may hold a `caret`, in the page while the next character goes there. Slots may be in `group`s with a `separator` between. `length`, `value`, `default-value`, `mode`, `disabled`, `name`, `form`; it tells `value-change` and `complete`.
|
|
1978
|
+
|
|
1979
|
+
Attributes of the element (each also a property, in camel case):
|
|
1980
|
+
|
|
1981
|
+
- `length` (number): How many characters the code has. Default: 6.
|
|
1982
|
+
- `value` (string): The characters typed so far, when the caller holds them.
|
|
1983
|
+
- `default-value` (string): The characters it starts with, when the caller does not hold `value`. Read once.
|
|
1984
|
+
- `mode` (string): What a character may be. Default: `numeric`.
|
|
1985
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
1986
|
+
- `name` (string): With a name, the code is submitted with the form around it.
|
|
1987
|
+
- `form` (string): The id of the form the input belongs to, when it is not inside it.
|
|
1988
|
+
|
|
1989
|
+
Events:
|
|
1990
|
+
|
|
1991
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
1992
|
+
- `complete`: `event.detail.value`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
1993
|
+
|
|
1994
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
1995
|
+
|
|
1996
|
+
- `root`
|
|
1997
|
+
- `input`
|
|
1998
|
+
- `group`
|
|
1999
|
+
- `separator`
|
|
2000
|
+
- `slot`: `kui-index`
|
|
2001
|
+
- `caret`: `kui-index`
|
|
2002
|
+
|
|
2003
|
+
Anatomy:
|
|
2004
|
+
|
|
2005
|
+
```
|
|
2006
|
+
<kui-otp>
|
|
2007
|
+
root
|
|
2008
|
+
input
|
|
2009
|
+
group (repeated)
|
|
2010
|
+
slot (repeated)
|
|
2011
|
+
caret
|
|
2012
|
+
separator (repeated)
|
|
2013
|
+
```
|
|
2014
|
+
|
|
2015
|
+
Attributes and CSS variables, by part:
|
|
2016
|
+
|
|
2017
|
+
- root: The code: the input and its cells.
|
|
2018
|
+
- `data-disabled`: Present when it is disabled.
|
|
2019
|
+
- `data-focused`: Present while the input has focus.
|
|
2020
|
+
- `data-complete`: Present when every character is in.
|
|
2021
|
+
- input: The one input the code is typed in. A design lays it over the cells, unseen.
|
|
2022
|
+
- `data-disabled`: Present when it is disabled.
|
|
2023
|
+
- slot: One cell of the code.
|
|
2024
|
+
- `data-index`: The cell's place, from 0.
|
|
2025
|
+
- `data-active`: Present on the cell the next character goes in, or that is selected.
|
|
2026
|
+
- `data-filled`: Present when the cell has its character.
|
|
2027
|
+
- `data-disabled`: Present when it is disabled.
|
|
2028
|
+
|
|
2029
|
+
### Pagination
|
|
2030
|
+
|
|
2031
|
+
```
|
|
2032
|
+
import "@kirana-ui/web/pagination"
|
|
2033
|
+
```
|
|
2034
|
+
|
|
2035
|
+
`<kui-pagination>`: `<kui-pagination>` around a `kui-part="root"` nav with `previous` and `next` buttons and, between them, a `<template kui-each="items">` holding an `item` button for a page (`kui-when="page"`; `{page}` is its number) and an `ellipsis` for a gap (`kui-when="ellipsis"`; `{key}` is `start` or `end`). `page`, `default-page`, `count`, `page-size`, `sibling-count`, `boundary-count`, `disabled`; it tells `page-change`.
|
|
2036
|
+
|
|
2037
|
+
Attributes of the element (each also a property, in camel case):
|
|
2038
|
+
|
|
2039
|
+
- `page` (number): The page shown, from 1.
|
|
2040
|
+
- `default-page` (number): The page it starts at, when the caller does not hold `page`. Read once.
|
|
2041
|
+
- `count` (number): How many items there are in all.
|
|
2042
|
+
- `page-size` (number): How many items a page holds. Default 10.
|
|
2043
|
+
- `sibling-count` (number): How many pages are listed each side of the one shown. Default 1.
|
|
2044
|
+
- `boundary-count` (number): How many pages are always listed at each end. Default 1.
|
|
2045
|
+
- `disabled` (boolean): Disabled: no page can be gone to.
|
|
2046
|
+
|
|
2047
|
+
Events:
|
|
2048
|
+
|
|
2049
|
+
- `page-change`: `event.detail.page`, with `event.detail.details`. `preventDefault()` keeps `page` as it was.
|
|
2050
|
+
|
|
2051
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2052
|
+
|
|
2053
|
+
- `root`
|
|
2054
|
+
- `previous`
|
|
2055
|
+
- `next`
|
|
2056
|
+
- `ellipsis`
|
|
2057
|
+
- `item`
|
|
2058
|
+
|
|
2059
|
+
Lists (`<template kui-each="…">`): `items`.
|
|
2060
|
+
|
|
2061
|
+
Anatomy:
|
|
2062
|
+
|
|
2063
|
+
```
|
|
2064
|
+
<kui-pagination>
|
|
2065
|
+
root
|
|
2066
|
+
<template kui-each="items">
|
|
2067
|
+
item (repeated)
|
|
2068
|
+
ellipsis (repeated)
|
|
2069
|
+
previous
|
|
2070
|
+
next
|
|
2071
|
+
```
|
|
2072
|
+
|
|
2073
|
+
Attributes and CSS variables, by part:
|
|
2074
|
+
|
|
2075
|
+
- root: The pages of a list, as a navigation.
|
|
2076
|
+
- `data-disabled`: Present when it is disabled.
|
|
2077
|
+
- item: A page: pressed, it is the one shown.
|
|
2078
|
+
- `data-selected`: Present on the page that is shown.
|
|
2079
|
+
- `data-disabled`: Present when it is disabled.
|
|
2080
|
+
- previous: Goes to the page before.
|
|
2081
|
+
- `data-disabled`: Present when it is disabled.
|
|
2082
|
+
- next: Goes to the page after.
|
|
2083
|
+
- `data-disabled`: Present when it is disabled.
|
|
2084
|
+
|
|
2085
|
+
### Popover
|
|
2086
|
+
|
|
2087
|
+
```
|
|
2088
|
+
import "@kirana-ui/web/popover"
|
|
2089
|
+
```
|
|
2090
|
+
|
|
2091
|
+
`<kui-popover>`: `<kui-popover>` around a `kui-part="trigger"` button and a `portal`, drawn at the end of the page while it is open, with a `positioner` (`kui-side`, `kui-align`, `kui-side-offset`, `kui-align-offset`, `kui-collision-padding`, and `kui-anchor`: the id of the element it is placed against, when that is not the trigger) around the `popup`, which may hold a `title`, a `description` and a `close` button. `open`, `default-open`; it tells `open-change`.
|
|
2092
|
+
|
|
2093
|
+
Attributes of the element (each also a property, in camel case):
|
|
2094
|
+
|
|
2095
|
+
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
2096
|
+
- `default-open` (boolean): Whether it starts open, when the caller does not hold `open`. Read once.
|
|
2097
|
+
|
|
2098
|
+
Events:
|
|
2099
|
+
|
|
2100
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
2101
|
+
|
|
2102
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2103
|
+
|
|
2104
|
+
- `trigger`
|
|
2105
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
2106
|
+
- `popup`
|
|
2107
|
+
- `title`
|
|
2108
|
+
- `description`
|
|
2109
|
+
- `close`
|
|
2110
|
+
|
|
2111
|
+
Anatomy:
|
|
2112
|
+
|
|
2113
|
+
```
|
|
2114
|
+
<kui-popover>
|
|
2115
|
+
trigger
|
|
2116
|
+
portal
|
|
2117
|
+
positioner
|
|
2118
|
+
popup
|
|
2119
|
+
title
|
|
2120
|
+
description
|
|
2121
|
+
close
|
|
2122
|
+
```
|
|
2123
|
+
|
|
2124
|
+
Attributes and CSS variables, by part:
|
|
2125
|
+
|
|
2126
|
+
- trigger: The button that opens the popover, and what it is placed against.
|
|
2127
|
+
- `data-popup-open`: Present when the popover is open.
|
|
2128
|
+
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
2129
|
+
- `data-open`: Present when it is open.
|
|
2130
|
+
- `data-closed`: Present when it is closed.
|
|
2131
|
+
- `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.
|
|
2132
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2133
|
+
- `--anchor-width`: The anchor's width.
|
|
2134
|
+
- `--anchor-height`: The anchor's height.
|
|
2135
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
2136
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
2137
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
2138
|
+
- popup: The popover itself.
|
|
2139
|
+
- `data-open`: Present when it is open.
|
|
2140
|
+
- `data-closed`: Present when it is closed.
|
|
2141
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2142
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2143
|
+
- `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.
|
|
2144
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2145
|
+
|
|
2146
|
+
### Progress
|
|
2147
|
+
|
|
2148
|
+
```
|
|
2149
|
+
import "@kirana-ui/web/progress"
|
|
2150
|
+
```
|
|
2151
|
+
|
|
2152
|
+
`<kui-progress>`: `<kui-progress>` around `kui-part="root"`, a `label`, a `track` with its `indicator`, and a `value`, which says the value as it is written unless the page gave it something to say. `value` (left out: not known yet), `min`, `max`, `locale`; `format` and `getAriaValueText` as properties.
|
|
2153
|
+
|
|
2154
|
+
Attributes of the element (each also a property, in camel case):
|
|
2155
|
+
|
|
2156
|
+
- `value` (number): The value. For a progress bar, `null` is "under way, how far is not known".
|
|
2157
|
+
- `min` (number): Default 0.
|
|
2158
|
+
- `max` (number): Default 100.
|
|
2159
|
+
- `locale` (string): The language the value is written in; the page's by default.
|
|
2160
|
+
|
|
2161
|
+
Properties only:
|
|
2162
|
+
|
|
2163
|
+
- `format`: How the value is written; a percentage of the range by default.
|
|
2164
|
+
- `getAriaValueText`: What assistive technology reads for the value, when the written value is not enough.
|
|
2165
|
+
|
|
2166
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2167
|
+
|
|
2168
|
+
- `root`
|
|
2169
|
+
- `label`
|
|
2170
|
+
- `track`
|
|
2171
|
+
- `indicator`
|
|
2172
|
+
- `value`
|
|
2173
|
+
|
|
2174
|
+
Anatomy:
|
|
2175
|
+
|
|
2176
|
+
```
|
|
2177
|
+
<kui-progress>
|
|
2178
|
+
root
|
|
2179
|
+
track
|
|
2180
|
+
indicator
|
|
2181
|
+
value
|
|
2182
|
+
label
|
|
2183
|
+
```
|
|
2184
|
+
|
|
2185
|
+
Attributes and CSS variables, by part:
|
|
2186
|
+
|
|
2187
|
+
- root: The progress bar: it says the value to assistive technology.
|
|
2188
|
+
- `data-progressing`: Present while the task is under way.
|
|
2189
|
+
- `data-complete`: Present once the value has reached the end of the range.
|
|
2190
|
+
- `data-indeterminate`: Present while how far the task has come is not known.
|
|
2191
|
+
- track: The whole range.
|
|
2192
|
+
- `data-progressing`: Present while the task is under way.
|
|
2193
|
+
- `data-complete`: Present once the value has reached the end of the range.
|
|
2194
|
+
- `data-indeterminate`: Present while how far the task has come is not known.
|
|
2195
|
+
- indicator: The filled part: its width is the value's share of the range.
|
|
2196
|
+
- `data-progressing`: Present while the task is under way.
|
|
2197
|
+
- `data-complete`: Present once the value has reached the end of the range.
|
|
2198
|
+
- `data-indeterminate`: Present while how far the task has come is not known.
|
|
2199
|
+
- value: The value, written.
|
|
2200
|
+
- `data-progressing`: Present while the task is under way.
|
|
2201
|
+
- `data-complete`: Present once the value has reached the end of the range.
|
|
2202
|
+
- `data-indeterminate`: Present while how far the task has come is not known.
|
|
2203
|
+
- label: The bar's name.
|
|
2204
|
+
- `data-progressing`: Present while the task is under way.
|
|
2205
|
+
- `data-complete`: Present once the value has reached the end of the range.
|
|
2206
|
+
- `data-indeterminate`: Present while how far the task has come is not known.
|
|
2207
|
+
|
|
2208
|
+
### QrCode
|
|
2209
|
+
|
|
2210
|
+
```
|
|
2211
|
+
import "@kirana-ui/web/qr-code"
|
|
2212
|
+
```
|
|
2213
|
+
|
|
2214
|
+
`<kui-qr-code>`: `<kui-qr-code>` around `kui-part="root"`, a `frame` (an `<svg>`) and its `pattern` (a `<path>`). `value`, `correction`.
|
|
2215
|
+
|
|
2216
|
+
Attributes of the element (each also a property, in camel case):
|
|
2217
|
+
|
|
2218
|
+
- `value` (string): What the code says: a link, a text. Written as UTF-8.
|
|
2219
|
+
- `correction` (string): How much of it may be lost and still be read. Default: `"M"`.
|
|
2220
|
+
|
|
2221
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2222
|
+
|
|
2223
|
+
- `root`
|
|
2224
|
+
- `frame`
|
|
2225
|
+
- `pattern`
|
|
2226
|
+
|
|
2227
|
+
Anatomy:
|
|
2228
|
+
|
|
2229
|
+
```
|
|
2230
|
+
<kui-qr-code>
|
|
2231
|
+
root
|
|
2232
|
+
frame
|
|
2233
|
+
pattern
|
|
2234
|
+
```
|
|
2235
|
+
|
|
2236
|
+
Attributes and CSS variables, by part:
|
|
2237
|
+
|
|
2238
|
+
- root: What holds the code.
|
|
2239
|
+
- `data-invalid`: Present when the value is longer than a code holds.
|
|
2240
|
+
|
|
2241
|
+
### RadioGroup
|
|
2242
|
+
|
|
2243
|
+
```
|
|
2244
|
+
import "@kirana-ui/web/radio-group"
|
|
2245
|
+
```
|
|
2246
|
+
|
|
2247
|
+
`<kui-radio-group>`: `<kui-radio-group>` around `kui-part="root"` and an `item` button for each `value`, with an `indicator` inside that is in the page while its item is the chosen one. An item draws the hidden native radio a form and a label reach. `value`, `default-value`, `disabled`, `read-only`, `required`, `name`, `form`; it tells `value-change`.
|
|
2248
|
+
|
|
2249
|
+
Attributes of the element (each also a property, in camel case):
|
|
2250
|
+
|
|
2251
|
+
- `value` (string): The chosen value; `null` is "none".
|
|
2252
|
+
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
2253
|
+
- `disabled` (boolean): Disables every item of the group.
|
|
2254
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
2255
|
+
- `required` (boolean): Needed: in a `Field`, choosing none is then invalid.
|
|
2256
|
+
- `name` (string): With a name, the chosen value is submitted with the form around the group.
|
|
2257
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
2258
|
+
|
|
2259
|
+
Events:
|
|
2260
|
+
|
|
2261
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
2262
|
+
|
|
2263
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2264
|
+
|
|
2265
|
+
- `root`
|
|
2266
|
+
- `item`: `kui-disabled`, `kui-value`
|
|
2267
|
+
- `indicator`: `kui-value`
|
|
2268
|
+
|
|
2269
|
+
Anatomy:
|
|
2270
|
+
|
|
2271
|
+
```
|
|
2272
|
+
<kui-radio-group>
|
|
2273
|
+
root
|
|
2274
|
+
item (repeated)
|
|
2275
|
+
indicator
|
|
2276
|
+
```
|
|
2277
|
+
|
|
2278
|
+
Attributes and CSS variables, by part:
|
|
2279
|
+
|
|
2280
|
+
- root: Groups the items: one of them is chosen at most.
|
|
2281
|
+
- `data-disabled`: Present when it is disabled.
|
|
2282
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2283
|
+
- `data-required`: Present when the form needs it.
|
|
2284
|
+
- item: One choice. It holds a hidden native radio, which a form and a label reach.
|
|
2285
|
+
- `data-checked`: Present when it is checked.
|
|
2286
|
+
- `data-unchecked`: Present when it is not checked.
|
|
2287
|
+
- `data-disabled`: Present when it is disabled.
|
|
2288
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2289
|
+
- `data-required`: Present when the form needs it.
|
|
2290
|
+
- indicator: The mark. In the page while its item is the chosen one.
|
|
2291
|
+
- `data-checked`: Present when it is checked.
|
|
2292
|
+
- `data-unchecked`: Present when it is not checked.
|
|
2293
|
+
- `data-disabled`: Present when it is disabled.
|
|
2294
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2295
|
+
- `data-required`: Present when the form needs it.
|
|
2296
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2297
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2298
|
+
|
|
2299
|
+
### Resizable
|
|
2300
|
+
|
|
2301
|
+
```
|
|
2302
|
+
import "@kirana-ui/web/resizable"
|
|
2303
|
+
```
|
|
2304
|
+
|
|
2305
|
+
`<kui-resizable>`: `<kui-resizable>` around `kui-part="group"`, its `panel`s (`kui-default-size`, `kui-min-size`, `kui-max-size`, in shares of a hundred) and a `handle` between two (`kui-disabled`). `orientation`, `keyboard-step`, `disabled`; it tells `sizes-change`.
|
|
2306
|
+
|
|
2307
|
+
Attributes of the element (each also a property, in camel case):
|
|
2308
|
+
|
|
2309
|
+
- `orientation` (string): Whether the panels are side by side (the default) or one over the other.
|
|
2310
|
+
- `keyboard-step` (number): How far an arrow key moves a handle, in hundredths of the group. Default: 10.
|
|
2311
|
+
- `disabled` (boolean): Disabled: the handles cannot be dragged or moved with the keyboard.
|
|
2312
|
+
|
|
2313
|
+
Events:
|
|
2314
|
+
|
|
2315
|
+
- `sizes-change`: `event.detail.sizes`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
2316
|
+
|
|
2317
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2318
|
+
|
|
2319
|
+
- `group`
|
|
2320
|
+
- `panel`
|
|
2321
|
+
- `handle`: `kui-disabled`
|
|
2322
|
+
|
|
2323
|
+
Anatomy:
|
|
2324
|
+
|
|
2325
|
+
```
|
|
2326
|
+
<kui-resizable>
|
|
2327
|
+
group
|
|
2328
|
+
panel (repeated)
|
|
2329
|
+
handle (repeated)
|
|
2330
|
+
```
|
|
2331
|
+
|
|
2332
|
+
Attributes and CSS variables, by part:
|
|
2333
|
+
|
|
2334
|
+
- group: The panels and the bars between them. A design lays it out as a flex box.
|
|
2335
|
+
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
2336
|
+
- `data-disabled`: Present when it is disabled.
|
|
2337
|
+
- panel: One panel. It carries its share of the group.
|
|
2338
|
+
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
2339
|
+
- `--panel-size`: The panel's share, in hundredths of the group.
|
|
2340
|
+
- handle: The bar between two panels: dragged, or moved with the arrows.
|
|
2341
|
+
- `data-orientation="horizontal | vertical"`: Whether the panels are side by side or one over the other.
|
|
2342
|
+
- `data-dragging`: Present while the bar is dragged.
|
|
2343
|
+
- `data-disabled`: Present when it is disabled.
|
|
2344
|
+
|
|
2345
|
+
### ScrollArea
|
|
2346
|
+
|
|
2347
|
+
```
|
|
2348
|
+
import "@kirana-ui/web/scroll-area"
|
|
2349
|
+
```
|
|
2350
|
+
|
|
2351
|
+
`<kui-scroll-area>`: `<kui-scroll-area>` around `kui-part="root"`, a `viewport` with its `content`, a `scrollbar` for each way (`kui-orientation="horizontal"` for the one across) with its `thumb`, and a `corner`. A scrollbar is in the page while there is something to scroll its way. The library places the scrollbars and the corner against the root; the page gives a scrollbar its thickness and draws it.
|
|
2352
|
+
|
|
2353
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2354
|
+
|
|
2355
|
+
- `root`
|
|
2356
|
+
- `viewport`
|
|
2357
|
+
- `content`
|
|
2358
|
+
- `scrollbar`: `kui-orientation`
|
|
2359
|
+
- `thumb`: `kui-orientation`
|
|
2360
|
+
- `corner`
|
|
2361
|
+
|
|
2362
|
+
Anatomy:
|
|
2363
|
+
|
|
2364
|
+
```
|
|
2365
|
+
<kui-scroll-area>
|
|
2366
|
+
root
|
|
2367
|
+
viewport
|
|
2368
|
+
content
|
|
2369
|
+
scrollbar (repeated)
|
|
2370
|
+
thumb
|
|
2371
|
+
corner
|
|
2372
|
+
```
|
|
2373
|
+
|
|
2374
|
+
Attributes and CSS variables, by part:
|
|
2375
|
+
|
|
2376
|
+
- 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.
|
|
2377
|
+
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
2378
|
+
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
2379
|
+
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
2380
|
+
- `data-hovering`: Present while the pointer is over the area.
|
|
2381
|
+
- `--scroll-area-corner-width`: The width of the corner: the vertical scrollbar's, while both scrollbars and the corner are in the page.
|
|
2382
|
+
- `--scroll-area-corner-height`: The height of the corner: the horizontal scrollbar's, while both scrollbars and the corner are in the page.
|
|
2383
|
+
- viewport: The element that scrolls.
|
|
2384
|
+
- `data-has-overflow-x`: Present when there is more to see sideways.
|
|
2385
|
+
- `data-has-overflow-y`: Present when there is more to see up or down.
|
|
2386
|
+
- `data-scrolling`: Present while it is being scrolled, and a moment after.
|
|
2387
|
+
- scrollbar: A scrollbar's track, placed along its edge of the area. In the page while there is something to scroll its way.
|
|
2388
|
+
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
2389
|
+
- `data-hovering`: Present while the pointer is over the area.
|
|
2390
|
+
- `data-scrolling`: Present while the area is scrolled its way.
|
|
2391
|
+
- `--scroll-area-thumb-height`: A vertical thumb's height.
|
|
2392
|
+
- `--scroll-area-thumb-width`: A horizontal thumb's width.
|
|
2393
|
+
- thumb: The part of a scrollbar that shows where the view is, and can be dragged. As long as its scrollbar's variable says.
|
|
2394
|
+
- `data-orientation="horizontal | vertical"`: Which way the scrollbar scrolls.
|
|
2395
|
+
|
|
2396
|
+
### Select
|
|
2397
|
+
|
|
2398
|
+
```
|
|
2399
|
+
import "@kirana-ui/web/select"
|
|
2400
|
+
```
|
|
2401
|
+
|
|
2402
|
+
`<kui-select>`: `<kui-select>` around a `kui-part="trigger"` button holding a `value` (it says the chosen item's text, or its `kui-placeholder`; with `multiple`, the chosen items' texts with commas between), and a `portal` with a `positioner` (its `kui-side` and the like, and `kui-align-item-with-trigger`) around the `popup`. The popup holds an `item` for each `kui-value` (`kui-disabled`, `kui-label`), each with an `item-text` and an `item-indicator`; items may be in a `group` with a `group-label`, with `separator`s between, and in a `list` between a `scroll-up-arrow` and a `scroll-down-arrow`. With a name it draws the hidden input a form reads. A `value` part that holds something says what the page wrote there: a `<template kui-each="values">` in it is drawn for each chosen value (`{value}`, `{label}`), in the items' order. `value`, `default-value`, `open`, `default-open`, `disabled`, `required`, `multiple`, `values` and `default-values` (with commas between), `name`, `form`; `items` as a property; it tells `value-change`, `values-change` and `open-change`.
|
|
2403
|
+
|
|
2404
|
+
Attributes of the element (each also a property, in camel case):
|
|
2405
|
+
|
|
2406
|
+
- `value` (string): The chosen value; `null` is "none".
|
|
2407
|
+
- `default-value` (string): The value it starts with, when the caller does not hold `value`. Read once.
|
|
2408
|
+
- `open` (boolean): Whether the list is open, when the caller holds it.
|
|
2409
|
+
- `default-open` (boolean): Whether the list starts open, when the caller does not hold `open`. Read once.
|
|
2410
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
2411
|
+
- `required` (boolean): In a field, "none" is then wrong.
|
|
2412
|
+
- `multiple` (boolean): Several values: an item chosen is added, chosen again taken away, and the list stays open. The values are `values`, not `value`.
|
|
2413
|
+
- `values` (string): With `multiple`: the chosen values, in the order they were chosen.
|
|
2414
|
+
- `default-values` (string): With `multiple`: the values it starts with, when the caller does not hold `values`. Read once.
|
|
2415
|
+
- `name` (string): With a name, the value is submitted with the form around it.
|
|
2416
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
2417
|
+
|
|
2418
|
+
Properties only:
|
|
2419
|
+
|
|
2420
|
+
- `items`: 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.
|
|
2421
|
+
|
|
2422
|
+
Events:
|
|
2423
|
+
|
|
2424
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
2425
|
+
- `values-change`: `event.detail.values`, with `event.detail.details`. `preventDefault()` keeps `values` as it was.
|
|
2426
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
2427
|
+
|
|
2428
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2429
|
+
|
|
2430
|
+
- `trigger`
|
|
2431
|
+
- `value`: `kui-placeholder`
|
|
2432
|
+
- `positioner`: `kui-align`, `kui-align-item-with-trigger`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
2433
|
+
- `popup`
|
|
2434
|
+
- `list`
|
|
2435
|
+
- `scroll-up-arrow`
|
|
2436
|
+
- `scroll-down-arrow`
|
|
2437
|
+
- `group`: `kui-id`
|
|
2438
|
+
- `group-label`
|
|
2439
|
+
- `separator`
|
|
2440
|
+
- `item`: `kui-disabled`, `kui-label`, `kui-value`
|
|
2441
|
+
- `item-text`: `kui-value`
|
|
2442
|
+
- `item-indicator`: `kui-value`
|
|
2443
|
+
|
|
2444
|
+
Lists (`<template kui-each="…">`): `values`.
|
|
2445
|
+
|
|
2446
|
+
Anatomy:
|
|
2447
|
+
|
|
2448
|
+
```
|
|
2449
|
+
<kui-select>
|
|
2450
|
+
trigger
|
|
2451
|
+
value
|
|
2452
|
+
<template kui-each="values"> (optional)
|
|
2453
|
+
portal
|
|
2454
|
+
positioner
|
|
2455
|
+
popup
|
|
2456
|
+
scroll-up-arrow
|
|
2457
|
+
list (optional)
|
|
2458
|
+
group (optional, repeated)
|
|
2459
|
+
group-label
|
|
2460
|
+
item (repeated)
|
|
2461
|
+
item-text
|
|
2462
|
+
item-indicator
|
|
2463
|
+
separator (repeated)
|
|
2464
|
+
scroll-down-arrow
|
|
2465
|
+
```
|
|
2466
|
+
|
|
2467
|
+
Attributes and CSS variables, by part:
|
|
2468
|
+
|
|
2469
|
+
- trigger: The button that shows the value and opens the list.
|
|
2470
|
+
- `data-popup-open`: Present when the list is open.
|
|
2471
|
+
- `data-placeholder`: Present while nothing is chosen.
|
|
2472
|
+
- `data-disabled`: Present when it is disabled.
|
|
2473
|
+
- value: The chosen value's label, or the placeholder. With several values, their labels with commas between.
|
|
2474
|
+
- `data-placeholder`: Present while nothing is chosen.
|
|
2475
|
+
- positioner: Places the list against the trigger. It carries the geometry.
|
|
2476
|
+
- `data-open`: Present when it is open.
|
|
2477
|
+
- `data-closed`: Present when it is closed.
|
|
2478
|
+
- `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.
|
|
2479
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2480
|
+
- `--anchor-width`: The anchor's width.
|
|
2481
|
+
- `--anchor-height`: The anchor's height.
|
|
2482
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
2483
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
2484
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
2485
|
+
- scrollUpArrow: In the page while there is more of the list above: it scrolls the list while the pointer moves over it.
|
|
2486
|
+
- `data-direction="up | down"`: The way it scrolls the list.
|
|
2487
|
+
- `data-visible`: Present while there is more of the list its way.
|
|
2488
|
+
- `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.
|
|
2489
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2490
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2491
|
+
- scrollDownArrow: In the page while there is more of the list below: it scrolls the list while the pointer moves over it.
|
|
2492
|
+
- `data-direction="up | down"`: The way it scrolls the list.
|
|
2493
|
+
- `data-visible`: Present while there is more of the list its way.
|
|
2494
|
+
- `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.
|
|
2495
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2496
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2497
|
+
- popup: The list of items.
|
|
2498
|
+
- `data-open`: Present when it is open.
|
|
2499
|
+
- `data-closed`: Present when it is closed.
|
|
2500
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2501
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2502
|
+
- `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.
|
|
2503
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2504
|
+
- item: One choice in the list.
|
|
2505
|
+
- `data-selected`: Present on the chosen item, or on each of several.
|
|
2506
|
+
- `data-highlighted`: Present on the item the pointer or the keyboard is on.
|
|
2507
|
+
- `data-disabled`: Present when it is disabled.
|
|
2508
|
+
|
|
2509
|
+
### Separator
|
|
2510
|
+
|
|
2511
|
+
```
|
|
2512
|
+
import "@kirana-ui/web/separator"
|
|
2513
|
+
```
|
|
2514
|
+
|
|
2515
|
+
`<kui-separator>`: `<kui-separator>` around `kui-part="root"`. `orientation`.
|
|
2516
|
+
|
|
2517
|
+
Attributes of the element (each also a property, in camel case):
|
|
2518
|
+
|
|
2519
|
+
- `orientation` (string): Whether the line lies across (the default) or stands upright: what a screen reader is told.
|
|
2520
|
+
|
|
2521
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2522
|
+
|
|
2523
|
+
- `root`
|
|
2524
|
+
|
|
2525
|
+
Anatomy:
|
|
2526
|
+
|
|
2527
|
+
```
|
|
2528
|
+
<kui-separator>
|
|
2529
|
+
root
|
|
2530
|
+
```
|
|
2531
|
+
|
|
2532
|
+
Attributes and CSS variables, by part:
|
|
2533
|
+
|
|
2534
|
+
- root: The line.
|
|
2535
|
+
- `data-orientation="horizontal | vertical"`: The way the line runs.
|
|
2536
|
+
|
|
2537
|
+
### Slider
|
|
2538
|
+
|
|
2539
|
+
```
|
|
2540
|
+
import "@kirana-ui/web/slider"
|
|
2541
|
+
```
|
|
2542
|
+
|
|
2543
|
+
`<kui-slider>`: `<kui-slider>` around `kui-part="root"`, a `value` (which says the value as it is written), a `control` with its `track`, `indicator` and a `thumb` for each value, in the values' order (or each with its `kui-index`). A thumb draws the hidden input a form reads. `value` and `default-value` (a range with a comma), `min`, `max`, `step`, `large-step`, `min-steps-between-values`, `thumb-alignment`, `orientation`, `disabled`, `name`, `form`, `locale`; it tells `value-change` and `value-committed`.
|
|
2544
|
+
|
|
2545
|
+
Attributes of the element (each also a property, in camel case):
|
|
2546
|
+
|
|
2547
|
+
- `value` (string): The value, when the caller holds it: a number, or a list of numbers for a range.
|
|
2548
|
+
- `default-value` (string): Read once. Default `min`.
|
|
2549
|
+
- `min` (number): Default 0.
|
|
2550
|
+
- `max` (number): Default 100.
|
|
2551
|
+
- `step` (number): Default 1.
|
|
2552
|
+
- `large-step` (number): What Page Up, Page Down and an arrow with Shift move by. Default 10.
|
|
2553
|
+
- `min-steps-between-values` (number): How many steps two thumbs of a range stay apart. Default 0.
|
|
2554
|
+
- `thumb-alignment` (string): 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.
|
|
2555
|
+
- `orientation` (string): Whether the track lies across (the default) or stands upright: the arrows that move a thumb follow.
|
|
2556
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
2557
|
+
- `name` (string): With a name, each thumb's value is submitted with the form around the slider.
|
|
2558
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
2559
|
+
- `locale` (string): The language a value is written in; the page's by default.
|
|
2560
|
+
|
|
2561
|
+
Properties only:
|
|
2562
|
+
|
|
2563
|
+
- `format`: How a value is written.
|
|
2564
|
+
- `getAriaValueText`: What assistive technology reads for a thumb, when the written value is not enough.
|
|
2565
|
+
|
|
2566
|
+
Events:
|
|
2567
|
+
|
|
2568
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
2569
|
+
- `value-committed`: `event.detail.value`, with `event.detail.details`. It reports something that happened: there is nothing to keep.
|
|
2570
|
+
|
|
2571
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2572
|
+
|
|
2573
|
+
- `root`
|
|
2574
|
+
- `value`
|
|
2575
|
+
- `control`
|
|
2576
|
+
- `track`
|
|
2577
|
+
- `indicator`
|
|
2578
|
+
- `thumb`: `kui-index`
|
|
2579
|
+
|
|
2580
|
+
Anatomy:
|
|
2581
|
+
|
|
2582
|
+
```
|
|
2583
|
+
<kui-slider>
|
|
2584
|
+
root
|
|
2585
|
+
value
|
|
2586
|
+
control
|
|
2587
|
+
track
|
|
2588
|
+
indicator
|
|
2589
|
+
thumb (repeated)
|
|
2590
|
+
```
|
|
2591
|
+
|
|
2592
|
+
Attributes and CSS variables, by part:
|
|
2593
|
+
|
|
2594
|
+
- root: Groups the slider's parts.
|
|
2595
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2596
|
+
- `data-disabled`: Present when it is disabled.
|
|
2597
|
+
- `data-dragging`: Present while a pointer holds a thumb.
|
|
2598
|
+
- value: The value, written.
|
|
2599
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2600
|
+
- `data-disabled`: Present when it is disabled.
|
|
2601
|
+
- `data-dragging`: Present while a pointer holds a thumb.
|
|
2602
|
+
- control: What a pointer presses and drags on. It holds the track and the thumbs.
|
|
2603
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2604
|
+
- `data-disabled`: Present when it is disabled.
|
|
2605
|
+
- `data-dragging`: Present while a pointer holds a thumb.
|
|
2606
|
+
- track: The whole range.
|
|
2607
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2608
|
+
- `data-disabled`: Present when it is disabled.
|
|
2609
|
+
- `data-dragging`: Present while a pointer holds a thumb.
|
|
2610
|
+
- indicator: The filled part: up to the thumb, or from the first thumb to the last. Its place and length are written on it.
|
|
2611
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2612
|
+
- `data-disabled`: Present when it is disabled.
|
|
2613
|
+
- `data-dragging`: Present while a pointer holds a thumb.
|
|
2614
|
+
- `--start-position`: With thumbs that stay inside the control: where the filled part starts, or with one thumb where it ends.
|
|
2615
|
+
- `--relative-size`: With thumbs that stay inside the control and a range: the filled part's length.
|
|
2616
|
+
- 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.
|
|
2617
|
+
- `data-orientation="horizontal | vertical"`: The way the track runs.
|
|
2618
|
+
- `data-disabled`: Present when it is disabled.
|
|
2619
|
+
- `data-dragging`: Present while a pointer holds a thumb.
|
|
2620
|
+
- `data-index`: Which thumb it is, from 0.
|
|
2621
|
+
- `--position`: With thumbs that stay inside the control: where the thumb's centre is.
|
|
2622
|
+
|
|
2623
|
+
### Switch
|
|
2624
|
+
|
|
2625
|
+
```
|
|
2626
|
+
import "@kirana-ui/web/switch"
|
|
2627
|
+
```
|
|
2628
|
+
|
|
2629
|
+
`<kui-switch>`: `<kui-switch>` around a `kui-part="root"` button with a `thumb` inside. The root draws the hidden native input a form and a label reach. `checked`, `default-checked`, `disabled`, `read-only`, `required`, `name`, `form`, `value`; it tells `checked-change`.
|
|
2630
|
+
|
|
2631
|
+
Attributes of the element (each also a property, in camel case):
|
|
2632
|
+
|
|
2633
|
+
- `checked` (boolean): Whether it is checked, when the caller holds it.
|
|
2634
|
+
- `default-checked` (boolean): Read once.
|
|
2635
|
+
- `disabled` (boolean): Disabled: it cannot be changed.
|
|
2636
|
+
- `read-only` (boolean): Shown as it is, focusable, not changeable.
|
|
2637
|
+
- `required` (boolean): Needed: in a `Field`, leaving it unchecked is then invalid.
|
|
2638
|
+
- `name` (string): With a name, the control is submitted with the form around it when it is checked.
|
|
2639
|
+
- `form` (string): The id of the form the control belongs to, when it is not inside it.
|
|
2640
|
+
- `value` (string): What is submitted. Default `"on"`, as a native checkbox's.
|
|
2641
|
+
|
|
2642
|
+
Events:
|
|
2643
|
+
|
|
2644
|
+
- `checked-change`: `event.detail.checked`, with `event.detail.details`. `preventDefault()` keeps `checked` as it was.
|
|
2645
|
+
|
|
2646
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2647
|
+
|
|
2648
|
+
- `root`
|
|
2649
|
+
- `thumb`
|
|
2650
|
+
|
|
2651
|
+
Anatomy:
|
|
2652
|
+
|
|
2653
|
+
```
|
|
2654
|
+
<kui-switch>
|
|
2655
|
+
root
|
|
2656
|
+
thumb
|
|
2657
|
+
```
|
|
2658
|
+
|
|
2659
|
+
Attributes and CSS variables, by part:
|
|
2660
|
+
|
|
2661
|
+
- root: The track. It holds a hidden native checkbox, which a form and a label reach.
|
|
2662
|
+
- `data-checked`: Present when it is checked.
|
|
2663
|
+
- `data-unchecked`: Present when it is not checked.
|
|
2664
|
+
- `data-disabled`: Present when it is disabled.
|
|
2665
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2666
|
+
- `data-required`: Present when the form needs it.
|
|
2667
|
+
- thumb: The knob that moves along the track.
|
|
2668
|
+
- `data-checked`: Present when it is checked.
|
|
2669
|
+
- `data-unchecked`: Present when it is not checked.
|
|
2670
|
+
- `data-disabled`: Present when it is disabled.
|
|
2671
|
+
- `data-readonly`: Present when it can be read but not changed.
|
|
2672
|
+
- `data-required`: Present when the form needs it.
|
|
2673
|
+
|
|
2674
|
+
### Tabs
|
|
2675
|
+
|
|
2676
|
+
```
|
|
2677
|
+
import "@kirana-ui/web/tabs"
|
|
2678
|
+
```
|
|
2679
|
+
|
|
2680
|
+
`<kui-tabs>`: `<kui-tabs>` around `kui-part="root"`, a `list` with a `tab` for each `value` and an `indicator`, and a `panel` for each `value`, in the page while its tab is the active one. `value`, `default-value`, `orientation`; it tells `value-change`.
|
|
2681
|
+
|
|
2682
|
+
Attributes of the element (each also a property, in camel case):
|
|
2683
|
+
|
|
2684
|
+
- `value` (string): The active tab's value; `null` is "none".
|
|
2685
|
+
- `default-value` (string): Read once. Without one, the first tab that can be chosen is, once the page is there.
|
|
2686
|
+
- `orientation` (string): Whether the tabs are laid out across (the default) or down: the arrows that move between them follow.
|
|
2687
|
+
|
|
2688
|
+
Events:
|
|
2689
|
+
|
|
2690
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
2691
|
+
|
|
2692
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2693
|
+
|
|
2694
|
+
- `root`
|
|
2695
|
+
- `list`
|
|
2696
|
+
- `indicator`
|
|
2697
|
+
- `tab`: `kui-disabled`, `kui-value`
|
|
2698
|
+
- `panel`: `kui-value`
|
|
2699
|
+
|
|
2700
|
+
Anatomy:
|
|
2701
|
+
|
|
2702
|
+
```
|
|
2703
|
+
<kui-tabs>
|
|
2704
|
+
root
|
|
2705
|
+
list
|
|
2706
|
+
tab (repeated)
|
|
2707
|
+
indicator
|
|
2708
|
+
panel (repeated)
|
|
2709
|
+
```
|
|
2710
|
+
|
|
2711
|
+
Attributes and CSS variables, by part:
|
|
2712
|
+
|
|
2713
|
+
- root: Groups the tabs and their panels.
|
|
2714
|
+
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
2715
|
+
- `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
|
|
2716
|
+
- list: The row of tabs. The arrows move between them.
|
|
2717
|
+
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
2718
|
+
- `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
|
|
2719
|
+
- tab: A button that shows its panel.
|
|
2720
|
+
- `data-active`: Present on the tab whose panel is shown.
|
|
2721
|
+
- `data-disabled`: Present when it is disabled.
|
|
2722
|
+
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
2723
|
+
- indicator: A mark for the active tab: it carries that tab's position and size.
|
|
2724
|
+
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
2725
|
+
- `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
|
|
2726
|
+
- `--active-tab-left`: The active tab's distance from the list's left edge.
|
|
2727
|
+
- `--active-tab-right`: The active tab's distance from the list's right edge.
|
|
2728
|
+
- `--active-tab-top`: The active tab's distance from the list's top edge.
|
|
2729
|
+
- `--active-tab-bottom`: The active tab's distance from the list's bottom edge.
|
|
2730
|
+
- `--active-tab-width`: The active tab's width.
|
|
2731
|
+
- `--active-tab-height`: The active tab's height.
|
|
2732
|
+
- panel: A tab's content. In the page while its tab is active, and through its exit.
|
|
2733
|
+
- `data-hidden`: Present while its tab is not the active one.
|
|
2734
|
+
- `data-orientation="horizontal | vertical"`: The way the tabs are laid out.
|
|
2735
|
+
- `data-activation-direction="left | right | up | down | none"`: Where the newly active tab is from the one before, for a panel or a mark that slides.
|
|
2736
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2737
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2738
|
+
|
|
2739
|
+
### Toast
|
|
2740
|
+
|
|
2741
|
+
```
|
|
2742
|
+
import "@kirana-ui/web/toast"
|
|
2743
|
+
```
|
|
2744
|
+
|
|
2745
|
+
`<kui-toast>`: `<kui-toast>` around a `kui-part="viewport"`, which holds a `<template kui-each="toasts">` with a `toast` for each message (`{id}`, `{type}`), its `content` with a `title` and a `description`, and a `close` and an `action` button. A `title`, a `description` and an `action` written empty say what the toast was added with, and are in the page only for a toast that has one; one written with something in it (`{title}`) is always there. `label`, `hotkey`, `swipe-direction`; `duration` and `limit` for the toaster it makes, or `toaster` as a property for one of the page's own. A title, a description and an action's label are strings.
|
|
2746
|
+
|
|
2747
|
+
Attributes of the element (each also a property, in camel case):
|
|
2748
|
+
|
|
2749
|
+
- `label` (string)
|
|
2750
|
+
- `hotkey` (string)
|
|
2751
|
+
- `swipe-direction` (string)
|
|
2752
|
+
- `duration` (number)
|
|
2753
|
+
- `limit` (number)
|
|
2754
|
+
|
|
2755
|
+
Properties only:
|
|
2756
|
+
|
|
2757
|
+
- `toaster`
|
|
2758
|
+
|
|
2759
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2760
|
+
|
|
2761
|
+
- `viewport`
|
|
2762
|
+
- `toast`
|
|
2763
|
+
- `content`
|
|
2764
|
+
- `title`
|
|
2765
|
+
- `description`
|
|
2766
|
+
- `close`
|
|
2767
|
+
- `action`
|
|
2768
|
+
|
|
2769
|
+
Lists (`<template kui-each="…">`): `toasts`.
|
|
2770
|
+
|
|
2771
|
+
Anatomy:
|
|
2772
|
+
|
|
2773
|
+
```
|
|
2774
|
+
<kui-toast>
|
|
2775
|
+
viewport
|
|
2776
|
+
<template kui-each="toasts">
|
|
2777
|
+
toast (repeated)
|
|
2778
|
+
content (optional)
|
|
2779
|
+
title
|
|
2780
|
+
description
|
|
2781
|
+
close
|
|
2782
|
+
action
|
|
2783
|
+
```
|
|
2784
|
+
|
|
2785
|
+
Attributes and CSS variables, by part:
|
|
2786
|
+
|
|
2787
|
+
- viewport: Where the toasts are drawn: a region that is always in the page.
|
|
2788
|
+
- `data-expanded`: Present while the pointer or focus is on the stack: the toasts are spread out, and wait.
|
|
2789
|
+
- `--toast-frontmost-height`: The height of the newest toast.
|
|
2790
|
+
- root: One toast.
|
|
2791
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2792
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2793
|
+
- `data-expanded`: Present while the pointer or focus is on the stack: the toasts are spread out, and wait.
|
|
2794
|
+
- `data-type`: The kind the toast was added as.
|
|
2795
|
+
- `data-limited`: Present on a toast behind as many as are shown at once.
|
|
2796
|
+
- `data-swiping`: Present while the toast is dragged.
|
|
2797
|
+
- `data-swipe-direction="left | right | up | down"`: The way the toast was dragged out, once it has been.
|
|
2798
|
+
- `--toast-index`: Its place in the stack: 0 for the newest.
|
|
2799
|
+
- `--toast-height`: Its height.
|
|
2800
|
+
- `--toast-offset-y`: The height of the toasts in front of it.
|
|
2801
|
+
- `--toast-swipe-movement-x`: How far it has been dragged across.
|
|
2802
|
+
- `--toast-swipe-movement-y`: How far it has been dragged up or down.
|
|
2803
|
+
- content: What holds a toast's contents, when the design sizes the toast itself.
|
|
2804
|
+
- `data-behind`: Present on a toast that is behind the newest.
|
|
2805
|
+
- `data-expanded`: Present while the pointer or focus is on the stack: the toasts are spread out, and wait.
|
|
2806
|
+
|
|
2807
|
+
### Toggle
|
|
2808
|
+
|
|
2809
|
+
```
|
|
2810
|
+
import "@kirana-ui/web/toggle"
|
|
2811
|
+
```
|
|
2812
|
+
|
|
2813
|
+
`<kui-toggle>`: `<kui-toggle>` around a `kui-part="root"` button. Inside a `<kui-toggle-group>` it is one of the group's, by its `value`; inside a `<kui-toolbar>`, one of its items. `pressed`, `default-pressed`, `disabled`, `value`; it tells `pressed-change`.
|
|
2814
|
+
|
|
2815
|
+
Attributes of the element (each also a property, in camel case):
|
|
2816
|
+
|
|
2817
|
+
- `pressed` (boolean): Whether it is pressed, when the caller holds it.
|
|
2818
|
+
- `default-pressed` (boolean): Read once.
|
|
2819
|
+
- `disabled` (boolean): Disabled: a press does nothing.
|
|
2820
|
+
- `value` (string): In a toggle group: what the group's value holds while this one is pressed.
|
|
2821
|
+
|
|
2822
|
+
Events:
|
|
2823
|
+
|
|
2824
|
+
- `pressed-change`: `event.detail.pressed`, with `event.detail.details`. `preventDefault()` keeps `pressed` as it was.
|
|
2825
|
+
|
|
2826
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2827
|
+
|
|
2828
|
+
- `root`
|
|
2829
|
+
|
|
2830
|
+
Anatomy:
|
|
2831
|
+
|
|
2832
|
+
```
|
|
2833
|
+
<kui-toggle>
|
|
2834
|
+
root
|
|
2835
|
+
```
|
|
2836
|
+
|
|
2837
|
+
Attributes and CSS variables, by part:
|
|
2838
|
+
|
|
2839
|
+
- root: The button. It stays pressed until it is pressed again.
|
|
2840
|
+
- `data-pressed`: Present while it is pressed.
|
|
2841
|
+
- `data-disabled`: Present when it is disabled.
|
|
2842
|
+
|
|
2843
|
+
### ToggleGroup
|
|
2844
|
+
|
|
2845
|
+
```
|
|
2846
|
+
import "@kirana-ui/web/toggle-group"
|
|
2847
|
+
```
|
|
2848
|
+
|
|
2849
|
+
`<kui-toggle-group>`: `<kui-toggle-group>` around `kui-part="root"` and its `<kui-toggle>`s, each with a `value`. `value` and `default-value` (the pressed ones, with commas between), `multiple`, `disabled`, `orientation`, `loop`; it tells `value-change`.
|
|
2850
|
+
|
|
2851
|
+
Attributes of the element (each also a property, in camel case):
|
|
2852
|
+
|
|
2853
|
+
- `value` (string): The values of the pressed toggles: none, one, or with `multiple` several.
|
|
2854
|
+
- `default-value` (string): The values pressed at the start, when the caller does not hold `value`. Read once.
|
|
2855
|
+
- `multiple` (boolean): Whether more than one can be pressed at a time.
|
|
2856
|
+
- `disabled` (boolean): Disables every toggle of the group.
|
|
2857
|
+
- `orientation` (string): Whether the toggles are laid out across (the default) or down: the arrows that move between them follow.
|
|
2858
|
+
- `loop` (boolean): Whether the arrows go round from the last toggle to the first. Default: they do.
|
|
2859
|
+
|
|
2860
|
+
Events:
|
|
2861
|
+
|
|
2862
|
+
- `value-change`: `event.detail.value`, with `event.detail.details`. `preventDefault()` keeps `value` as it was.
|
|
2863
|
+
|
|
2864
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2865
|
+
|
|
2866
|
+
- `root`
|
|
2867
|
+
|
|
2868
|
+
Anatomy:
|
|
2869
|
+
|
|
2870
|
+
```
|
|
2871
|
+
<kui-toggle-group>
|
|
2872
|
+
root
|
|
2873
|
+
```
|
|
2874
|
+
|
|
2875
|
+
Attributes and CSS variables, by part:
|
|
2876
|
+
|
|
2877
|
+
- root: The group. A toggle inside it with a `value` is one of its toggles.
|
|
2878
|
+
- `data-orientation="horizontal | vertical"`: Whether its toggles are in a row or a column.
|
|
2879
|
+
- `data-multiple`: Present when several can be pressed at a time.
|
|
2880
|
+
- `data-disabled`: Present when it is disabled.
|
|
2881
|
+
|
|
2882
|
+
### Toolbar
|
|
2883
|
+
|
|
2884
|
+
```
|
|
2885
|
+
import "@kirana-ui/web/toolbar"
|
|
2886
|
+
```
|
|
2887
|
+
|
|
2888
|
+
`<kui-toolbar>`: `<kui-toolbar>` around `kui-part="root"` and its items: a `button`, a `link`, an `input`, a `group`, a `separator` (`kui-disabled` on one that is off), and `<kui-toggle>`s and `<kui-toggle-group>`s, which are the toolbar's items too. One stop for Tab; the arrows move between them. `orientation`, `loop`, `disabled`.
|
|
2889
|
+
|
|
2890
|
+
Attributes of the element (each also a property, in camel case):
|
|
2891
|
+
|
|
2892
|
+
- `orientation` (string): Whether the controls are laid out across (the default) or down: the arrows that move between them follow.
|
|
2893
|
+
- `loop` (boolean): Whether the arrows go round from the last item to the first. Default: they do.
|
|
2894
|
+
- `disabled` (boolean): Disables every control of the toolbar.
|
|
2895
|
+
|
|
2896
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2897
|
+
|
|
2898
|
+
- `root`
|
|
2899
|
+
- `button`: `kui-disabled`, `kui-label`
|
|
2900
|
+
- `input`: `kui-disabled`, `kui-label`
|
|
2901
|
+
- `group`: `kui-disabled`, `kui-label`
|
|
2902
|
+
- `link`
|
|
2903
|
+
- `separator`
|
|
2904
|
+
|
|
2905
|
+
Anatomy:
|
|
2906
|
+
|
|
2907
|
+
```
|
|
2908
|
+
<kui-toolbar>
|
|
2909
|
+
root
|
|
2910
|
+
group (optional, repeated)
|
|
2911
|
+
button (repeated)
|
|
2912
|
+
link (repeated)
|
|
2913
|
+
input (repeated)
|
|
2914
|
+
separator (repeated)
|
|
2915
|
+
```
|
|
2916
|
+
|
|
2917
|
+
Attributes and CSS variables, by part:
|
|
2918
|
+
|
|
2919
|
+
- root: The toolbar. It is one stop for Tab.
|
|
2920
|
+
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
2921
|
+
- `data-disabled`: Present when it is disabled.
|
|
2922
|
+
- button: A button of the toolbar.
|
|
2923
|
+
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
2924
|
+
- `data-disabled`: Present when it is disabled.
|
|
2925
|
+
- link: A link of the toolbar.
|
|
2926
|
+
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
2927
|
+
- `data-disabled`: Present when it is disabled.
|
|
2928
|
+
- input: A text input of the toolbar. The arrows are its own until the caret is at an end.
|
|
2929
|
+
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
2930
|
+
- `data-disabled`: Present when it is disabled.
|
|
2931
|
+
- group: Items that belong together.
|
|
2932
|
+
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
2933
|
+
- `data-disabled`: Present when it is disabled.
|
|
2934
|
+
- separator: A line between items, across the toolbar.
|
|
2935
|
+
- `data-orientation="horizontal | vertical"`: Whether the toolbar is a row or a column.
|
|
2936
|
+
|
|
2937
|
+
### Tooltip
|
|
2938
|
+
|
|
2939
|
+
```
|
|
2940
|
+
import "@kirana-ui/web/tooltip"
|
|
2941
|
+
```
|
|
2942
|
+
|
|
2943
|
+
`<kui-tooltip>`: `<kui-tooltip>` around a `kui-part="trigger"` and a `portal` with a `positioner` (its `kui-side` and the like) around the `popup`, which may hold an `arrow`. `open`, `default-open`, `delay`, `close-delay`, `disabled`; it tells `open-change`.
|
|
2944
|
+
|
|
2945
|
+
Attributes of the element (each also a property, in camel case):
|
|
2946
|
+
|
|
2947
|
+
- `open` (boolean): Whether it is open, when the caller holds it.
|
|
2948
|
+
- `default-open` (boolean): Whether it starts open, when the caller does not hold `open`. Read once.
|
|
2949
|
+
- `delay` (number): How long the pointer rests on the trigger before the popup opens, in milliseconds.
|
|
2950
|
+
- `close-delay` (number): How long after the pointer leaves the popup closes, in milliseconds.
|
|
2951
|
+
- `disabled` (boolean): Disabled: the pointer and focus do not open it.
|
|
2952
|
+
|
|
2953
|
+
Events:
|
|
2954
|
+
|
|
2955
|
+
- `open-change`: `event.detail.open`, with `event.detail.details`. `preventDefault()` keeps `open` as it was.
|
|
2956
|
+
|
|
2957
|
+
Parts (`kui-part`), each with the `kui-` attributes its element is read for:
|
|
2958
|
+
|
|
2959
|
+
- `trigger`: `kui-close-delay`, `kui-delay`
|
|
2960
|
+
- `positioner`: `kui-align`, `kui-align-offset`, `kui-anchor`, `kui-collision-padding`, `kui-side`, `kui-side-offset`
|
|
2961
|
+
- `popup`
|
|
2962
|
+
- `arrow`
|
|
2963
|
+
|
|
2964
|
+
Anatomy:
|
|
2965
|
+
|
|
2966
|
+
```
|
|
2967
|
+
<kui-tooltip>
|
|
2968
|
+
trigger
|
|
2969
|
+
portal
|
|
2970
|
+
positioner
|
|
2971
|
+
popup
|
|
2972
|
+
arrow
|
|
2973
|
+
```
|
|
2974
|
+
|
|
2975
|
+
Attributes and CSS variables, by part:
|
|
2976
|
+
|
|
2977
|
+
- trigger: The element the tooltip describes.
|
|
2978
|
+
- `data-popup-open`: Present when the tooltip is open.
|
|
2979
|
+
- positioner: Places the popup against the trigger. It carries the geometry.
|
|
2980
|
+
- `data-open`: Present when it is open.
|
|
2981
|
+
- `data-closed`: Present when it is closed.
|
|
2982
|
+
- `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.
|
|
2983
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2984
|
+
- `--anchor-width`: The anchor's width.
|
|
2985
|
+
- `--anchor-height`: The anchor's height.
|
|
2986
|
+
- `--available-width`: The width between the anchor and the edge of the viewport.
|
|
2987
|
+
- `--available-height`: The height between the anchor and the edge of the viewport.
|
|
2988
|
+
- `--transform-origin`: The point of the popup nearest its anchor, to scale from.
|
|
2989
|
+
- popup: The tooltip itself.
|
|
2990
|
+
- `data-open`: Present when it is open.
|
|
2991
|
+
- `data-closed`: Present when it is closed.
|
|
2992
|
+
- `data-starting-style`: Present for the first style of its entrance: what it animates in from.
|
|
2993
|
+
- `data-ending-style`: Present through its exit: what it animates out to. It leaves the page when the motion ends.
|
|
2994
|
+
- `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.
|
|
2995
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
2996
|
+
- `data-instant="delay | focus | dismiss"`: Present when it opened or closed without its usual wait, for a design that skips the motion then.
|
|
2997
|
+
- arrow: An element that points at the trigger, placed along the popup's edge.
|
|
2998
|
+
- `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.
|
|
2999
|
+
- `data-align="start | center | end"`: How it is aligned with the anchor.
|
|
3000
|
+
- `data-uncentered`: Present when the popup was pushed along its edge, so the arrow is not at the trigger's centre.
|