luxen-ui 0.24.0 → 0.26.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/README.md +1 -0
- package/bin/cli.mjs +16 -1
- package/cdn/custom-elements.json +295 -169
- package/cdn/elements/alert-dialog/alert-dialog.d.ts +3 -2
- package/cdn/elements/alert-dialog/alert-dialog.d.ts.map +1 -1
- package/cdn/elements/alert-dialog/alert-dialog.js.map +1 -1
- package/cdn/elements/avatar/avatar.js +1 -1
- package/cdn/elements/avatar/avatar.js.map +1 -1
- package/cdn/elements/carousel/carousel.js +1 -1
- package/cdn/elements/carousel/carousel.js.map +1 -1
- package/cdn/elements/combobox/combobox.d.ts.map +1 -1
- package/cdn/elements/combobox/combobox.js +2 -1
- package/cdn/elements/combobox/combobox.js.map +1 -1
- package/cdn/elements/dialog/dialog.d.ts +2 -1
- package/cdn/elements/dialog/dialog.d.ts.map +1 -1
- package/cdn/elements/dialog/dialog.js.map +1 -1
- package/cdn/elements/dialog/dialog.styles.js +1 -1
- package/cdn/elements/dialog/dialog.styles.js.map +1 -1
- package/cdn/elements/drawer/drawer.d.ts +7 -7
- package/cdn/elements/drawer/drawer.js +1 -1
- package/cdn/elements/drawer/drawer.js.map +1 -1
- package/cdn/elements/dropdown-item/dropdown-item.js +1 -1
- package/cdn/elements/dropdown-item/dropdown-item.js.map +1 -1
- package/cdn/elements/input-otp/input-otp.d.ts +2 -2
- package/cdn/elements/input-otp/input-otp.js.map +1 -1
- package/cdn/elements/prose-editor/prose-editor.js +1 -1
- package/cdn/elements/prose-editor/prose-editor.js.map +1 -1
- package/cdn/elements/rating/rating.js +1 -1
- package/cdn/elements/rating/rating.js.map +1 -1
- package/cdn/elements/select/select.d.ts.map +1 -1
- package/cdn/elements/select/select.js +2 -1
- package/cdn/elements/select/select.js.map +1 -1
- package/cdn/elements/slider/slider.js +1 -1
- package/cdn/elements/slider/slider.js.map +1 -1
- package/cdn/elements/stories-viewer/stories-viewer.js +1 -1
- package/cdn/elements/stories-viewer/stories-viewer.js.map +1 -1
- package/cdn/elements/table/table.meta.d.ts +55 -0
- package/cdn/elements/table/table.meta.d.ts.map +1 -0
- package/cdn/elements/table/table.meta.js +0 -0
- package/cdn/elements/tag/tag.js +1 -1
- package/cdn/elements/tag/tag.js.map +1 -1
- package/cdn/elements/tree/tree.js +1 -1
- package/cdn/elements/tree/tree.js.map +1 -1
- package/cdn/elements/tree-item/tree-item.js +1 -1
- package/cdn/elements/tree-item/tree-item.js.map +1 -1
- package/cdn/shared/controllers/listbox-nav.d.ts +7 -0
- package/cdn/shared/controllers/listbox-nav.d.ts.map +1 -1
- package/cdn/shared/controllers/listbox-nav.js +1 -1
- package/cdn/shared/controllers/listbox-nav.js.map +1 -1
- package/cdn/shared/styles/button-core.styles.js +1 -1
- package/cdn/shared/styles/button-core.styles.js.map +1 -1
- package/cdn/shared/styles/checkbox-appearance.styles.js +1 -1
- package/cdn/shared/styles/checkbox-appearance.styles.js.map +1 -1
- package/cdn/shared/styles/picker-core.styles.js +1 -1
- package/cdn/shared/styles/picker-core.styles.js.map +1 -1
- package/cdn/standalone.css +392 -86
- package/cdn/standalone.js +38 -28
- package/cdn/standalone.js.map +1 -1
- package/cdn/styles/base.css +11 -0
- package/cdn/styles/elements/breadcrumb.css +2 -2
- package/cdn/styles/elements/button.css +2 -2
- package/cdn/styles/elements/checkbox.css +2 -2
- package/cdn/styles/elements/close-button/circle.css +2 -2
- package/cdn/styles/elements/close-button/ring.css +2 -2
- package/cdn/styles/elements/close-button/square.css +2 -2
- package/cdn/styles/elements/disclosure.css +2 -2
- package/cdn/styles/elements/input-otp.css +20 -4
- package/cdn/styles/elements/input-stepper/default.css +2 -2
- package/cdn/styles/elements/input-stepper/pill.css +2 -2
- package/cdn/styles/elements/input-stepper/rounded.css +2 -2
- package/cdn/styles/elements/input.css +50 -17
- package/cdn/styles/elements/prose-editor.css +26 -11
- package/cdn/styles/elements/radio-group.css +2 -2
- package/cdn/styles/elements/radio.css +2 -2
- package/cdn/styles/elements/segmented-control.css +2 -2
- package/cdn/styles/elements/select.css +26 -5
- package/cdn/styles/elements/story.css +2 -2
- package/cdn/styles/elements/switch.css +2 -2
- package/cdn/styles/elements/table.css +186 -0
- package/cdn/styles/elements/tabs/enclosed.css +4 -4
- package/cdn/styles/elements/tabs/line.css +4 -4
- package/cdn/styles/elements/textarea.css +23 -9
- package/cdn/styles/preset.css +21 -2
- package/cdn/styles/tokens/aliases.css +6 -2
- package/cdn/styles/tokens/forms.css +4 -0
- package/cdn/styles/tokens.css +10 -2
- package/dist/css/base.css +11 -0
- package/dist/css/elements/breadcrumb.css +2 -2
- package/dist/css/elements/button.css +2 -2
- package/dist/css/elements/checkbox.css +2 -2
- package/dist/css/elements/close-button/circle.css +2 -2
- package/dist/css/elements/close-button/ring.css +2 -2
- package/dist/css/elements/close-button/square.css +2 -2
- package/dist/css/elements/disclosure.css +2 -2
- package/dist/css/elements/input-otp.css +20 -4
- package/dist/css/elements/input-stepper/default.css +2 -2
- package/dist/css/elements/input-stepper/pill.css +2 -2
- package/dist/css/elements/input-stepper/rounded.css +2 -2
- package/dist/css/elements/input.css +50 -17
- package/dist/css/elements/prose-editor.css +26 -11
- package/dist/css/elements/radio-group.css +2 -2
- package/dist/css/elements/radio.css +2 -2
- package/dist/css/elements/segmented-control.css +2 -2
- package/dist/css/elements/select.css +26 -5
- package/dist/css/elements/story.css +2 -2
- package/dist/css/elements/switch.css +2 -2
- package/dist/css/elements/table.css +186 -0
- package/dist/css/elements/tabs/enclosed.css +4 -4
- package/dist/css/elements/tabs/line.css +4 -4
- package/dist/css/elements/textarea.css +23 -9
- package/dist/css/preset.css +21 -2
- package/dist/css/tokens/aliases.css +6 -2
- package/dist/css/tokens/forms.css +4 -0
- package/dist/css/tokens.css +10 -2
- package/dist/custom-elements.json +295 -169
- package/dist/elements/alert-dialog/alert-dialog.d.ts +3 -2
- package/dist/elements/alert-dialog/alert-dialog.d.ts.map +1 -1
- package/dist/elements/alert-dialog/alert-dialog.js +3 -2
- package/dist/elements/avatar/avatar.css +2 -2
- package/dist/elements/carousel/carousel.css +18 -0
- package/dist/elements/combobox/combobox.css +9 -0
- package/dist/elements/combobox/combobox.d.ts.map +1 -1
- package/dist/elements/combobox/combobox.js +1 -0
- package/dist/elements/dialog/dialog.css +12 -0
- package/dist/elements/dialog/dialog.d.ts +2 -1
- package/dist/elements/dialog/dialog.d.ts.map +1 -1
- package/dist/elements/dialog/dialog.js +2 -1
- package/dist/elements/drawer/drawer.css +11 -1
- package/dist/elements/drawer/drawer.d.ts +7 -7
- package/dist/elements/drawer/drawer.js +7 -7
- package/dist/elements/dropdown-item/dropdown-item.css +5 -4
- package/dist/elements/input-otp/input-otp.d.ts +2 -2
- package/dist/elements/input-otp/input-otp.js +2 -2
- package/dist/elements/prose-editor/prose-editor.css +5 -3
- package/dist/elements/rating/rating.css +9 -10
- package/dist/elements/select/select.css +10 -9
- package/dist/elements/select/select.d.ts.map +1 -1
- package/dist/elements/select/select.js +1 -0
- package/dist/elements/slider/slider.css +5 -1
- package/dist/elements/stories-viewer/stories-viewer.css +10 -2
- package/dist/elements/table/table.meta.d.ts +55 -0
- package/dist/elements/table/table.meta.d.ts.map +1 -0
- package/dist/elements/table/table.meta.js +65 -0
- package/dist/elements/tag/tag.css +4 -4
- package/dist/elements/tree/tree.css +3 -3
- package/dist/elements/tree-item/tree-item.css +5 -3
- package/dist/metadata/alert-dialog.json +90 -85
- package/dist/metadata/alert.json +22 -22
- package/dist/metadata/avatar.json +26 -26
- package/dist/metadata/badge.json +13 -13
- package/dist/metadata/breadcrumb.json +9 -9
- package/dist/metadata/button.json +40 -40
- package/dist/metadata/carousel.json +133 -133
- package/dist/metadata/checkbox.json +13 -13
- package/dist/metadata/close-button.json +15 -15
- package/dist/metadata/color-scheme-icon.json +13 -13
- package/dist/metadata/combobox.json +77 -94
- package/dist/metadata/dialog.json +49 -44
- package/dist/metadata/disclosure.json +17 -17
- package/dist/metadata/divider.json +12 -12
- package/dist/metadata/drawer.json +61 -61
- package/dist/metadata/dropdown-item.json +50 -50
- package/dist/metadata/dropdown.json +32 -32
- package/dist/metadata/form-field.json +15 -15
- package/dist/metadata/icon.json +8 -8
- package/dist/metadata/index.json +1761 -1765
- package/dist/metadata/input-group.json +5 -5
- package/dist/metadata/input-otp.json +17 -17
- package/dist/metadata/input-stepper.json +24 -24
- package/dist/metadata/input.json +31 -31
- package/dist/metadata/popover.json +49 -49
- package/dist/metadata/progress.json +15 -15
- package/dist/metadata/prose-editor.json +110 -116
- package/dist/metadata/radio.json +15 -15
- package/dist/metadata/rating.json +25 -47
- package/dist/metadata/segmented-control.json +24 -46
- package/dist/metadata/select.json +81 -98
- package/dist/metadata/skeleton.json +12 -12
- package/dist/metadata/slider.json +60 -78
- package/dist/metadata/spinner.json +5 -5
- package/dist/metadata/sticky-bar.json +13 -13
- package/dist/metadata/stories-viewer.json +105 -105
- package/dist/metadata/stories.json +17 -17
- package/dist/metadata/story.json +41 -41
- package/dist/metadata/switch.json +9 -9
- package/dist/metadata/table.json +88 -0
- package/dist/metadata/tabs.json +26 -26
- package/dist/metadata/tag.json +50 -50
- package/dist/metadata/textarea.json +28 -28
- package/dist/metadata/toast.json +16 -16
- package/dist/metadata/tooltip.json +49 -49
- package/dist/metadata/tree-item.json +73 -73
- package/dist/metadata/tree.json +39 -39
- package/dist/shared/controllers/listbox-nav.d.ts +7 -0
- package/dist/shared/controllers/listbox-nav.d.ts.map +1 -1
- package/dist/shared/controllers/listbox-nav.js +12 -0
- package/dist/shared/styles/button-core.css +2 -2
- package/dist/shared/styles/checkbox-appearance.css +2 -2
- package/dist/shared/styles/picker-core.css +31 -7
- package/dist/templates/elements/alert-dialog.md +19 -18
- package/dist/templates/elements/alert.md +4 -4
- package/dist/templates/elements/avatar.md +9 -9
- package/dist/templates/elements/badge.md +4 -4
- package/dist/templates/elements/breadcrumb.md +4 -4
- package/dist/templates/elements/button.md +8 -8
- package/dist/templates/elements/carousel.md +32 -32
- package/dist/templates/elements/checkbox.md +4 -4
- package/dist/templates/elements/close-button.md +2 -2
- package/dist/templates/elements/color-scheme-icon.md +13 -13
- package/dist/templates/elements/combobox.md +19 -19
- package/dist/templates/elements/dialog.md +11 -10
- package/dist/templates/elements/disclosure.md +3 -3
- package/dist/templates/elements/divider.md +2 -2
- package/dist/templates/elements/drawer.md +15 -15
- package/dist/templates/elements/dropdown.md +15 -15
- package/dist/templates/elements/form-field.md +3 -3
- package/dist/templates/elements/icon.md +1 -1
- package/dist/templates/elements/input-otp.md +5 -5
- package/dist/templates/elements/input-stepper.md +4 -4
- package/dist/templates/elements/input.md +15 -8
- package/dist/templates/elements/popover.md +8 -8
- package/dist/templates/elements/progress.md +3 -3
- package/dist/templates/elements/prose-editor.md +38 -39
- package/dist/templates/elements/radio.md +6 -6
- package/dist/templates/elements/rating.md +5 -13
- package/dist/templates/elements/segmented-control.md +4 -4
- package/dist/templates/elements/select.md +23 -23
- package/dist/templates/elements/skeleton.md +2 -2
- package/dist/templates/elements/slider.md +13 -13
- package/dist/templates/elements/spinner.md +1 -1
- package/dist/templates/elements/sticky-bar.md +2 -2
- package/dist/templates/elements/stories-viewer.md +29 -29
- package/dist/templates/elements/stories.md +4 -4
- package/dist/templates/elements/story.md +11 -11
- package/dist/templates/elements/switch.md +5 -5
- package/dist/templates/elements/table.md +210 -0
- package/dist/templates/elements/tabs.md +4 -4
- package/dist/templates/elements/tag.md +14 -14
- package/dist/templates/elements/textarea.md +8 -8
- package/dist/templates/elements/toast.md +4 -4
- package/dist/templates/elements/tooltip.md +9 -9
- package/dist/templates/elements/tree-item.md +18 -18
- package/dist/templates/elements/tree.md +13 -13
- package/dist/templates/foundations/focus.md +303 -0
- package/elements.json +9 -0
- package/package.json +1 -1
- package/postcss-plugin-prefix.js +2 -2
- package/templates/SKILL.md.tpl +1 -0
- package/templates/choosing-elements.md.tpl +1 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Table
|
|
6
|
+
|
|
7
|
+
Tables display data in rows and columns, so it is easy to scan and compare. Commonly used for lists of records, reports, and settings.
|
|
8
|
+
|
|
9
|
+
**`.l-table`** — Native HTML Element
|
|
10
|
+
|
|
11
|
+
A stylesheet, no JavaScript. The sort state it shows is written in the markup, with `aria-sort`. The same markup works in a server-rendered page and in a framework template.
|
|
12
|
+
|
|
13
|
+
## Options
|
|
14
|
+
|
|
15
|
+
### Basic
|
|
16
|
+
|
|
17
|
+
Add `class="l-table"` to a `<table>`. Name it with a `<caption>`, head each column with `<th scope="col">` and each row with the `<th scope="row">` that identifies it. Add `data-align="end"` to the header and cells of a column of figures; digits are tabular across the table, so they line up. The header sticks to the top of its scroll container. Totals go in a `<tfoot>`, set apart by a stronger rule; several `<tbody>` elements group rows.
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<table class="l-table">
|
|
21
|
+
<caption>
|
|
22
|
+
Products
|
|
23
|
+
</caption>
|
|
24
|
+
<thead>
|
|
25
|
+
<tr>
|
|
26
|
+
<th scope="col">SKU</th>
|
|
27
|
+
<th scope="col">Name</th>
|
|
28
|
+
<th
|
|
29
|
+
scope="col"
|
|
30
|
+
data-align="end"
|
|
31
|
+
>
|
|
32
|
+
In stock
|
|
33
|
+
</th>
|
|
34
|
+
</tr>
|
|
35
|
+
</thead>
|
|
36
|
+
<tbody>
|
|
37
|
+
<tr>
|
|
38
|
+
<th scope="row">SKU-1042</th>
|
|
39
|
+
<td>Desk lamp</td>
|
|
40
|
+
<td data-align="end">4,210</td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<th scope="row">SKU-2087</th>
|
|
44
|
+
<td>Office chair</td>
|
|
45
|
+
<td data-align="end">12,004</td>
|
|
46
|
+
</tr>
|
|
47
|
+
</tbody>
|
|
48
|
+
</table>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Sizes
|
|
52
|
+
|
|
53
|
+
Add `data-size="sm"` or `data-size="lg"`. Rows follow the control size scale, so an `.l-button` of the same `data-size` fits a row. A row is a minimum height: content taller than it grows the row.
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<div class="flex w-full flex-col gap-6">
|
|
57
|
+
<table
|
|
58
|
+
class="l-table"
|
|
59
|
+
data-size="sm"
|
|
60
|
+
>
|
|
61
|
+
<caption>
|
|
62
|
+
Products
|
|
63
|
+
</caption>
|
|
64
|
+
<thead>
|
|
65
|
+
<tr>
|
|
66
|
+
<th scope="col">SKU</th>
|
|
67
|
+
<th scope="col">Name</th>
|
|
68
|
+
<th
|
|
69
|
+
scope="col"
|
|
70
|
+
data-align="end"
|
|
71
|
+
>
|
|
72
|
+
In stock
|
|
73
|
+
</th>
|
|
74
|
+
</tr>
|
|
75
|
+
</thead>
|
|
76
|
+
<tbody>
|
|
77
|
+
<tr>
|
|
78
|
+
<th scope="row">SKU-1042</th>
|
|
79
|
+
<td>Desk lamp</td>
|
|
80
|
+
<td data-align="end">4,210</td>
|
|
81
|
+
</tr>
|
|
82
|
+
<tr>
|
|
83
|
+
<th scope="row">SKU-2087</th>
|
|
84
|
+
<td>Office chair</td>
|
|
85
|
+
<td data-align="end">12,004</td>
|
|
86
|
+
</tr>
|
|
87
|
+
</tbody>
|
|
88
|
+
</table>
|
|
89
|
+
<table
|
|
90
|
+
class="l-table"
|
|
91
|
+
data-size="lg"
|
|
92
|
+
>
|
|
93
|
+
<caption>
|
|
94
|
+
Products
|
|
95
|
+
</caption>
|
|
96
|
+
<thead>
|
|
97
|
+
<tr>
|
|
98
|
+
<th scope="col">SKU</th>
|
|
99
|
+
<th scope="col">Name</th>
|
|
100
|
+
<th
|
|
101
|
+
scope="col"
|
|
102
|
+
data-align="end"
|
|
103
|
+
>
|
|
104
|
+
In stock
|
|
105
|
+
</th>
|
|
106
|
+
</tr>
|
|
107
|
+
</thead>
|
|
108
|
+
<tbody>
|
|
109
|
+
<tr>
|
|
110
|
+
<th scope="row">SKU-1042</th>
|
|
111
|
+
<td>Desk lamp</td>
|
|
112
|
+
<td data-align="end">4,210</td>
|
|
113
|
+
</tr>
|
|
114
|
+
<tr>
|
|
115
|
+
<th scope="row">SKU-2087</th>
|
|
116
|
+
<td>Office chair</td>
|
|
117
|
+
<td data-align="end">12,004</td>
|
|
118
|
+
</tr>
|
|
119
|
+
</tbody>
|
|
120
|
+
</table>
|
|
121
|
+
</div>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Sortable columns
|
|
125
|
+
|
|
126
|
+
Put a `<button>` in each sortable header, and `aria-sort="ascending"` or `"descending"` on the sorted one. The stylesheet shows the state written in the markup; it does not reorder rows. When the server sorts, use a link to the sorted URL instead of the button (`<a href="?sort=-sku">`). Disable the button of a column the current query cannot sort by. Any other action in a header is an `.l-button` and keeps its own look.
|
|
127
|
+
|
|
128
|
+
```html
|
|
129
|
+
<table class="l-table">
|
|
130
|
+
<caption>
|
|
131
|
+
Products
|
|
132
|
+
</caption>
|
|
133
|
+
<thead>
|
|
134
|
+
<tr>
|
|
135
|
+
<th scope="col"><button type="button">SKU</button></th>
|
|
136
|
+
<th scope="col"><button type="button">Name</button></th>
|
|
137
|
+
<th
|
|
138
|
+
scope="col"
|
|
139
|
+
data-align="end"
|
|
140
|
+
aria-sort="descending"
|
|
141
|
+
>
|
|
142
|
+
<button type="button">In stock</button>
|
|
143
|
+
</th>
|
|
144
|
+
</tr>
|
|
145
|
+
</thead>
|
|
146
|
+
<tbody>
|
|
147
|
+
<tr>
|
|
148
|
+
<th scope="row">SKU-2087</th>
|
|
149
|
+
<td>Office chair</td>
|
|
150
|
+
<td data-align="end">12,004</td>
|
|
151
|
+
</tr>
|
|
152
|
+
<tr>
|
|
153
|
+
<th scope="row">SKU-1042</th>
|
|
154
|
+
<td>Desk lamp</td>
|
|
155
|
+
<td data-align="end">4,210</td>
|
|
156
|
+
</tr>
|
|
157
|
+
<tr>
|
|
158
|
+
<th scope="row">SKU-3110</th>
|
|
159
|
+
<td>Standing desk</td>
|
|
160
|
+
<td data-align="end">865</td>
|
|
161
|
+
</tr>
|
|
162
|
+
</tbody>
|
|
163
|
+
</table>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Accessibility
|
|
167
|
+
|
|
168
|
+
### Criteria
|
|
169
|
+
|
|
170
|
+
- **Table name** — A `<caption>` (visible or `.l-visually-hidden`) or `aria-label` names the table
|
|
171
|
+
- **Headers** — Column headers are `<th scope="col">` and each row has a `<th scope="row">`, so a screen reader announces the column and the record with every cell
|
|
172
|
+
- **Sort state** — `aria-sort` on the sorted `<th>` is announced with the header; the control is a native `<button>`, as in the APG sortable table example
|
|
173
|
+
- **Sort glyph** — The direction glyph of an unsorted column uses the tertiary text color, above 3:1 against the surface in both schemes
|
|
174
|
+
- **Focus ring** — Header buttons show the Luxen focus ring
|
|
175
|
+
|
|
176
|
+
### Rules
|
|
177
|
+
|
|
178
|
+
- Name the table with a `<caption>` or `aria-label`
|
|
179
|
+
- Use `<th scope="col">` for column headers and `<th scope="row">` for the cell that identifies each row
|
|
180
|
+
- Put the sort control in a `<button>` (or a link, when the server sorts) inside the header, and `aria-sort` on the sorted `<th>` only
|
|
181
|
+
|
|
182
|
+
### Keyboard interactions
|
|
183
|
+
|
|
184
|
+
- `Tab` — Moves through the header controls, then the controls in each row
|
|
185
|
+
- `Enter` — Activates the focused header button
|
|
186
|
+
- `Space` — Activates the focused header button
|
|
187
|
+
|
|
188
|
+
## API reference
|
|
189
|
+
|
|
190
|
+
### Importing
|
|
191
|
+
|
|
192
|
+
```css
|
|
193
|
+
@import 'luxen-ui/css/table';
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Attributes & Properties
|
|
197
|
+
|
|
198
|
+
- **aria-sort**: `ascending | descending` — On the sorted column's `<th>`, which holds a `<button>` (or a link, when the server sorts): shows the direction. A disabled button marks a column the current query cannot sort by; an `.l-button` in a header is another action and keeps its own look.
|
|
199
|
+
- **data-align**: `start | center | end` — On a column's `<th>` and `<td>`s: aligns the column. Use `end` for figures; digits are tabular across the table, so they line up. A sort button in an `end` header puts its glyph before the label, keeping the label flush with the figures.
|
|
200
|
+
- **data-size**: `sm | lg` — Row height, on the control size scale: a control of the same size fits a row. Defaults to the medium size.
|
|
201
|
+
|
|
202
|
+
### CSS classes
|
|
203
|
+
|
|
204
|
+
- `.l-table` — Applied to the `<table>`. Name it with a `<caption>` (visible or `.l-visually-hidden`) or `aria-label`; head the columns with `<th scope="col">` and each row with the `<th scope="row">` that identifies it.
|
|
205
|
+
|
|
206
|
+
### CSS custom properties
|
|
207
|
+
|
|
208
|
+
- `--background-color` (default: `var(--l-color-surface)`) — Background of the table. The sticky header repeats it, so it stays opaque over the rows scrolling under it.
|
|
209
|
+
- `--border-color` (default: `var(--l-color-divider)`) — Rules between rows. The stronger rules under the header and above the totals use `--l-color-border`.
|
|
210
|
+
- `--row-height` (default: `calc(var(--l-size-control-md) + 2 * var(--l-spacing-1))`) — Minimum row height; content taller than it grows the row.
|
|
@@ -253,10 +253,10 @@ import 'luxen-ui/tabs';
|
|
|
253
253
|
|
|
254
254
|
### Attributes & Properties
|
|
255
255
|
|
|
256
|
-
- **variant**: `TabsVariant` (default: `'line'`) — Visual variant.
|
|
257
|
-
- **value**: `string` (default: `'0'`) — Index of the active tab (0-based).
|
|
258
256
|
- **full-width**: `boolean` (default: `false`) — Stretch tabs to fill container width.
|
|
259
257
|
- **orientation**: `TabsOrientation` (default: `'horizontal'`) — Tab orientation.
|
|
258
|
+
- **value**: `string` (default: `'0'`) — Index of the active tab (0-based).
|
|
259
|
+
- **variant**: `TabsVariant` (default: `'line'`) — Visual variant.
|
|
260
260
|
|
|
261
261
|
### Events
|
|
262
262
|
|
|
@@ -264,9 +264,9 @@ import 'luxen-ui/tabs';
|
|
|
264
264
|
|
|
265
265
|
### CSS custom properties
|
|
266
266
|
|
|
267
|
+
- `--hover-color` (default: `var(--l-color-bg-state-hover)`) — `line` variant: fill of the pill that appears behind a hovered tab label.
|
|
268
|
+
- `--hover-inset` (default: `4px`) — `line` variant: block-axis gap between the hover pill and the tab edges, keeping it detached from the bottom border.
|
|
267
269
|
- `--indicator-color` (default: `var(--l-color-text-primary)`) — `line` variant: color of the active underline that slides under the selected tab.
|
|
268
270
|
- `--indicator-thickness` (default: `2px`) — `line` variant: thickness of the active underline.
|
|
269
271
|
- `--track-color` (default: `var(--l-color-border)`) — `line` variant: color of the static bottom border the tabs sit on.
|
|
270
272
|
- `--track-thickness` (default: `1px`) — `line` variant: thickness of the static bottom border.
|
|
271
|
-
- `--hover-color` (default: `var(--l-color-bg-state-hover)`) — `line` variant: fill of the pill that appears behind a hovered tab label.
|
|
272
|
-
- `--hover-inset` (default: `4px`) — `line` variant: block-axis gap between the hover pill and the tab edges, keeping it detached from the bottom border.
|
|
@@ -14,7 +14,7 @@ Tags are compact chips for tokens, filters, and selected values, with an optiona
|
|
|
14
14
|
|
|
15
15
|
> **Tag or badge?**
|
|
16
16
|
>
|
|
17
|
-
> A tag is a chip the user **operates** — selects, removes. For a chip the user only **reads**, including a categorizing one, use [`<l-badge>`](/elements/badge): it is lighter (light DOM, so it renders without its script), shorter by 2px, and it takes the same `--text-color` / `--background-color` / `--border-color` trio.
|
|
17
|
+
> A tag is a chip the user **operates** — selects, removes. For a chip the user only **reads**, including a categorizing one, use [`<l-badge>`](https://luxen-ui.com/elements/badge): it is lighter (light DOM, so it renders without its script), shorter by 2px, and it takes the same `--text-color` / `--background-color` / `--border-color` trio.
|
|
18
18
|
|
|
19
19
|
## Options
|
|
20
20
|
|
|
@@ -375,19 +375,19 @@ import 'luxen-ui/tag';
|
|
|
375
375
|
|
|
376
376
|
### Attributes & Properties
|
|
377
377
|
|
|
378
|
-
- **size**: `TagSize` (default: `'md'`) — Tag size: `sm`, `md` (default), or `lg`.
|
|
379
|
-
- **removable**: `boolean` (default: `false`) — Show a remove button (and enable Backspace/Delete removal).
|
|
380
|
-
- **selectable**: `boolean` (default: `false`) — Make the tag a filter control the user can toggle on and off.
|
|
381
|
-
- **selected**: `boolean` (default: `false`) — Whether the tag is selected. Reflected, so `[selected]` is styleable.
|
|
382
378
|
- **control**: `TagControl` (default: `'none'`) — What drives the selection: `none` (default) makes the chip itself a toggle
|
|
383
379
|
button; `checkbox` renders a checkbox inside and makes the chip its label —
|
|
384
380
|
the right choice for a multi-select facet. Implies `selectable`.
|
|
385
381
|
- **disabled**: `boolean` (default: `false`) — Disable the tag — dims it and blocks selection and removal.
|
|
382
|
+
- **removable**: `boolean` (default: `false`) — Show a remove button (and enable Backspace/Delete removal).
|
|
383
|
+
- **selectable**: `boolean` (default: `false`) — Make the tag a filter control the user can toggle on and off.
|
|
384
|
+
- **selected**: `boolean` (default: `false`) — Whether the tag is selected. Reflected, so `[selected]` is styleable.
|
|
385
|
+
- **size**: `TagSize` (default: `'md'`) — Tag size: `sm`, `md` (default), or `lg`.
|
|
386
386
|
|
|
387
387
|
### Events
|
|
388
388
|
|
|
389
|
-
- **remove** (cancelable) — Fired when the user removes the tag (× click or Backspace/Delete). Cancelable; if not prevented the tag removes itself. Not composed, does not bubble.
|
|
390
389
|
- **change** — Fired when a `selectable` tag is toggled. Not cancelable — like the platform's own `change`, and like `l-segmented-control`. Bubbles. Properties: `selected: boolean`. The chip is uncontrolled: it applies the new state before dispatching, so a host that vetoes a toggle (a "max 3 filters" rule, an async guard) sets `selected` back in the listener — the revert lands in the same render and is never painted.
|
|
390
|
+
- **remove** (cancelable) — Fired when the user removes the tag (× click or Backspace/Delete). Cancelable; if not prevented the tag removes itself. Not composed, does not bubble.
|
|
391
391
|
|
|
392
392
|
### Slots
|
|
393
393
|
|
|
@@ -398,20 +398,20 @@ the right choice for a multi-select facet. Implies `selectable`.
|
|
|
398
398
|
### CSS parts
|
|
399
399
|
|
|
400
400
|
- `base` — The chip container.
|
|
401
|
-
- `content` — The label wrapper.
|
|
402
|
-
- `toggle` — The toggle button rendered by `selectable` (not with `control="checkbox"`).
|
|
403
401
|
- `checkbox` — The native checkbox rendered by `control="checkbox"`.
|
|
402
|
+
- `content` — The label wrapper.
|
|
404
403
|
- `remove` — The remove button — a full-height segment at the end of the chip.
|
|
404
|
+
- `toggle` — The toggle button rendered by `selectable` (not with `control="checkbox"`).
|
|
405
405
|
|
|
406
406
|
### CSS custom properties
|
|
407
407
|
|
|
408
|
-
- `--text-color` — Label color.
|
|
409
408
|
- `--background-color` — Chip fill.
|
|
410
409
|
- `--border-color` — Chip border, and the rule that splits off the remove button. Defaults to a tint of `--text-color`; setting it pins the line in every state, so a token-based theme keeps its own value on hover.
|
|
411
|
-
- `--
|
|
412
|
-
- `--selected-background-color` — Chip fill when selected. Defaults to a tint of `--selected-text-color`.
|
|
413
|
-
- `--selected-border-color` — Chip border when selected. Defaults to a 45% tint of `--selected-text-color`. Selection replaces the line the same way it replaces the fill and the ink, so a chip themed with `--border-color` still gets its emphasis step; set this to theme that step too.
|
|
414
|
-
- `--height` — Chip height. Defaults to the `size` step (a selectable chip is taller, to keep a comfortable target).
|
|
410
|
+
- `--border-radius` — Corner radius. Defaults to a full pill.
|
|
415
411
|
- `--font-size` — Label size. Defaults to the `size` step — 12px, or 14px at `size="lg"`. Set it with `--height` to land between the two steps in a dense filter panel.
|
|
412
|
+
- `--height` — Chip height. Defaults to the `size` step (a selectable chip is taller, to keep a comfortable target).
|
|
416
413
|
- `--padding-inline` — Horizontal padding. Defaults to the `size` step.
|
|
417
|
-
- `--
|
|
414
|
+
- `--selected-background-color` — Chip fill when selected. Defaults to a tint of `--selected-text-color`.
|
|
415
|
+
- `--selected-border-color` — Chip border when selected. Defaults to a 45% tint of `--selected-text-color`. Selection replaces the line the same way it replaces the fill and the ink, so a chip themed with `--border-color` still gets its emphasis step; set this to theme that step too.
|
|
416
|
+
- `--selected-text-color` — Label, border, and checkbox accent when selected. Defaults to the library's form-control accent, lightened in dark mode.
|
|
417
|
+
- `--text-color` — Label color.
|
|
@@ -19,7 +19,7 @@ Textareas let users enter and edit multi-line text.
|
|
|
19
19
|
</l-form-field>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
[`l-form-field`](/elements/form-field) auto-styles a bare `<textarea>` and wires the accessibility (label, hint, error, `aria-*`). Standalone, apply `.l-textarea` to the textarea yourself.
|
|
22
|
+
[`l-form-field`](https://luxen-ui.com/elements/form-field) auto-styles a bare `<textarea>` and wires the accessibility (label, hint, error, `aria-*`). Standalone, apply `.l-textarea` to the textarea yourself.
|
|
23
23
|
|
|
24
24
|
## Options
|
|
25
25
|
|
|
@@ -187,15 +187,15 @@ The textarea is CSS-only — no JavaScript import.
|
|
|
187
187
|
|
|
188
188
|
### Attributes & Properties
|
|
189
189
|
|
|
190
|
-
- **
|
|
191
|
-
- **data-size**: `xs | sm | md | lg | xl` — Single-line min-height on the shared `--l-size-control-*` scale (default `md`). Affects only the control, not the label or hint/error.
|
|
190
|
+
- **aria-invalid** — Set to `true` to force the invalid style (otherwise applied via `:user-invalid`). `l-form-field` manages this automatically.
|
|
192
191
|
- **data-resize**: `vertical | none | both | auto` — User resize handle. Defaults to `vertical`. `auto` grows the box with its content via `field-sizing` (progressive: falls back to the `rows` height where unsupported).
|
|
193
|
-
- **
|
|
192
|
+
- **data-size**: `xs | sm | md | lg | xl` — Single-line min-height on the shared `--l-size-control-*` scale (default `md`). Affects only the control, not the label or hint/error.
|
|
194
193
|
- **disabled** — Disables the textarea.
|
|
195
|
-
- **required** — Marks the textarea as required for form submission.
|
|
196
|
-
- **readonly** — Makes the textarea read-only.
|
|
197
194
|
- **maxlength** — Native maximum character count.
|
|
198
|
-
- **
|
|
195
|
+
- **placeholder** — Native placeholder text.
|
|
196
|
+
- **readonly** — Makes the textarea read-only.
|
|
197
|
+
- **required** — Marks the textarea as required for form submission.
|
|
198
|
+
- **rows** — Number of visible text lines — sets the initial height.
|
|
199
199
|
|
|
200
200
|
### CSS classes
|
|
201
201
|
|
|
@@ -203,5 +203,5 @@ The textarea is CSS-only — no JavaScript import.
|
|
|
203
203
|
|
|
204
204
|
### CSS custom properties
|
|
205
205
|
|
|
206
|
-
- `--height` (default: `var(--l-form-control-height)`) — Single-line min-height; `rows` grows the control from here.
|
|
207
206
|
- `--border-radius` (default: `var(--l-form-control-border-radius)`) — Control border radius.
|
|
207
|
+
- `--height` (default: `var(--l-form-control-height)`) — Single-line min-height; `rows` grows the control from here.
|
|
@@ -336,8 +336,8 @@ toast({ text: 'Hello!' });
|
|
|
336
336
|
|
|
337
337
|
### Attributes & Properties
|
|
338
338
|
|
|
339
|
-
- **placement**: `ToastPlacement` (default: `'top-end'`) — Position of the toast stack on the screen.
|
|
340
339
|
- **duration**: `number` (default: `5000`) — Default auto-dismiss delay in milliseconds. 0 disables auto-dismiss.
|
|
340
|
+
- **placement**: `ToastPlacement` (default: `'top-end'`) — Position of the toast stack on the screen.
|
|
341
341
|
- **variant**: `ToastVariant | undefined` — Default variant for toast items: `info`, `success`, `warning`, `danger`.
|
|
342
342
|
|
|
343
343
|
### Methods
|
|
@@ -364,13 +364,13 @@ toast({ text: 'Hello!' });
|
|
|
364
364
|
### CSS classes
|
|
365
365
|
|
|
366
366
|
- `.l-toast-accent` — The left accent bar, colored by variant.
|
|
367
|
-
- `.l-toast-icon` — The leading icon, colored by variant (replaces the accent bar).
|
|
368
367
|
- `.l-toast-content` — The content column wrapping the heading and message.
|
|
368
|
+
- `.l-toast-icon` — The leading icon, colored by variant (replaces the accent bar).
|
|
369
369
|
- `.l-toast-timer` — The countdown progress bar (for timed toasts).
|
|
370
370
|
|
|
371
371
|
### CSS custom properties
|
|
372
372
|
|
|
373
373
|
- `--gap` — Gap between stacked toast items.
|
|
374
|
-
- `--width` — Width of the toast stack.
|
|
375
|
-
- `--show-duration` — Duration of the show animation.
|
|
376
374
|
- `--hide-duration` — Duration of the hide animation.
|
|
375
|
+
- `--show-duration` — Duration of the show animation.
|
|
376
|
+
- `--width` — Width of the toast stack.
|
|
@@ -462,33 +462,33 @@ import 'luxen-ui/tooltip';
|
|
|
462
462
|
|
|
463
463
|
### Attributes & Properties
|
|
464
464
|
|
|
465
|
-
- **for**: `string` — The HTML id of the element triggering the tooltip.
|
|
466
|
-
- **placement**: `Placement` (default: `'top'`) — The preferred placement of the tooltip.
|
|
467
465
|
- **distance**: `number` (default: `8`) — The distance in pixels from the target element.
|
|
468
|
-
- **
|
|
469
|
-
shows. Applies to `hover` only — focus shows immediately.
|
|
466
|
+
- **for**: `string` — The HTML id of the element triggering the tooltip.
|
|
470
467
|
- **hide-delay**: `number` (default: `0`) — Milliseconds to wait after the pointer leaves the trigger (and its safe
|
|
471
468
|
polygon) before hiding. Bridges a brief exit-and-return without flicker.
|
|
472
469
|
Applies to `hover` only.
|
|
473
470
|
- **open**: `boolean` (default: `false`) — Whether or not the tooltip is visible.
|
|
474
|
-
- **
|
|
471
|
+
- **placement**: `Placement` (default: `'top'`) — The preferred placement of the tooltip.
|
|
472
|
+
- **show-delay**: `number` (default: `0`) — Milliseconds the pointer must dwell on the trigger before the tooltip
|
|
473
|
+
shows. Applies to `hover` only — focus shows immediately.
|
|
475
474
|
- **trigger**: `string` (default: `'hover focus'`) — Space-separated list of trigger modes: `hover`, `focus`, `click`, `manual`.
|
|
475
|
+
- **without-arrow**: `boolean` (default: `false`) — Hide the directional arrow.
|
|
476
476
|
|
|
477
477
|
### Methods
|
|
478
478
|
|
|
479
479
|
- **show()**
|
|
480
480
|
- **hide()**
|
|
481
|
-
- **toggle()**
|
|
482
481
|
- **reposition()** — Recompute the position against the current trigger. Use it when you move
|
|
483
482
|
the anchor yourself and the tooltip has to follow. No-op when closed;
|
|
484
483
|
hides if the anchor is gone.
|
|
484
|
+
- **toggle()**
|
|
485
485
|
|
|
486
486
|
### CSS custom properties
|
|
487
487
|
|
|
488
|
+
- `--arrow-size` (default: `6px`) — Arrow size.
|
|
488
489
|
- `--background-color` — Background color for this tooltip instance. Defaults to the global `--l-tooltip-background-color` token (a neutral inverse surface, dark in light mode / light in dark mode) — override that token to re-skin every tooltip at once.
|
|
489
|
-
- `--text-color` — Text color. If unset, auto-derived from `--background-color` luminance.
|
|
490
490
|
- `--border-radius` (default: `4px`) — Border radius.
|
|
491
|
+
- `--hide-duration` (default: `150ms`) — Hide animation duration.
|
|
491
492
|
- `--max-width` (default: `180px`) — Maximum width.
|
|
492
|
-
- `--arrow-size` (default: `6px`) — Arrow size.
|
|
493
493
|
- `--show-duration` (default: `150ms`) — Show animation duration.
|
|
494
|
-
- `--
|
|
494
|
+
- `--text-color` — Text color. If unset, auto-derived from `--background-color` luminance.
|
|
@@ -4,9 +4,9 @@ outline: deep
|
|
|
4
4
|
|
|
5
5
|
# Tree item
|
|
6
6
|
|
|
7
|
-
A single node inside [`<l-tree>`](/elements/tree). Nested `<l-tree-item>` children become sub-nodes. See [Tree](/elements/tree) for examples, selection modes, and keyboard behaviour.
|
|
7
|
+
A single node inside [`<l-tree>`](https://luxen-ui.com/elements/tree). Nested `<l-tree-item>` children become sub-nodes. See [Tree](https://luxen-ui.com/elements/tree) for examples, selection modes, and keyboard behaviour.
|
|
8
8
|
|
|
9
|
-
Roles and ARIA states are set on `ElementInternals` and mirrored to DOM attributes, so both `[role="treeitem"]` and `[aria-selected]`/`[aria-expanded]`/`[aria-disabled]` selectors match. See [Tree › Selectors & testing](/elements/tree#selectors-testing).
|
|
9
|
+
Roles and ARIA states are set on `ElementInternals` and mirrored to DOM attributes, so both `[role="treeitem"]` and `[aria-selected]`/`[aria-expanded]`/`[aria-disabled]` selectors match. See [Tree › Selectors & testing](https://luxen-ui.com/elements/tree#selectors-testing).
|
|
10
10
|
|
|
11
11
|
**`<l-tree-item>`** — Custom Element · Shadow DOM
|
|
12
12
|
|
|
@@ -20,53 +20,53 @@ import 'luxen-ui/tree-item';
|
|
|
20
20
|
|
|
21
21
|
### Attributes & Properties
|
|
22
22
|
|
|
23
|
+
- **depth**: `number` — Set by `<l-tree>`: depth of the item in the tree (0 = root).
|
|
24
|
+
- **disabled**: `boolean` (default: `false`) — Whether the item is disabled.
|
|
23
25
|
- **expanded**: `boolean` (default: `false`) — Whether the item is expanded.
|
|
24
|
-
- **
|
|
26
|
+
- **hasChildren**: `boolean` — Whether this item has nested tree-item children.
|
|
25
27
|
- **indeterminate**: `boolean` (default: `false`) — Whether the checkbox is indeterminate (some descendants selected). Managed by
|
|
26
28
|
`<l-tree>` in cascade mode; set it yourself with `independent`.
|
|
27
|
-
- **disabled**: `boolean` (default: `false`) — Whether the item is disabled.
|
|
28
29
|
- **lazy**: `boolean` (default: `false`) — Marks this item as having children that will be loaded on first expand.
|
|
29
30
|
- **loading**: `boolean` (default: `false`) — Whether the item is currently loading (shows a spinner).
|
|
31
|
+
- **selected**: `boolean` (default: `false`) — Whether the item is selected.
|
|
30
32
|
- **showCheckbox**: `boolean` — Set by `<l-tree>`: whether a checkbox is shown.
|
|
31
|
-
- **depth**: `number` — Set by `<l-tree>`: depth of the item in the tree (0 = root).
|
|
32
|
-
- **hasChildren**: `boolean` — Whether this item has nested tree-item children.
|
|
33
33
|
|
|
34
34
|
### Methods
|
|
35
35
|
|
|
36
|
+
- **getChildrenItems({ includeDisabled = true }: unknown)** → `TreeItem[]` — Returns the child `<l-tree-item>` elements directly under this one.
|
|
37
|
+
- **getTextLabel()** → `string` — Returns the text label of this item.
|
|
38
|
+
- **isLeaf()** → `boolean` — Returns true if this item has no expandable children.
|
|
36
39
|
- **setPosition(level: number, posInSet: number, setSize: number)** — Set by `<l-tree>`: ARIA position within the tree. `level` is 1-based depth,
|
|
37
40
|
`posInSet`/`setSize` describe the item's rank among its siblings. These let
|
|
38
41
|
screen readers announce "level 2, 3 of 5" even when `lazy` children keep the
|
|
39
42
|
full set out of the DOM.
|
|
40
|
-
- **getChildrenItems({ includeDisabled = true }: unknown)** → `TreeItem[]` — Returns the child `<l-tree-item>` elements directly under this one.
|
|
41
|
-
- **isLeaf()** → `boolean` — Returns true if this item has no expandable children.
|
|
42
|
-
- **getTextLabel()** → `string` — Returns the text label of this item.
|
|
43
43
|
- **toggle()** — Toggle expand state. Opening a `lazy` item emits `lazy-load` (via `updated`).
|
|
44
44
|
|
|
45
45
|
### Events
|
|
46
46
|
|
|
47
|
-
- **expand** — Fired when the item is expanded.
|
|
48
47
|
- **collapse** — Fired when the item is collapsed.
|
|
48
|
+
- **expand** — Fired when the item is expanded.
|
|
49
49
|
- **lazy-load** — Fired when a lazy item is expanded for the first time. Consumers should append children and set `lazy=false`.
|
|
50
50
|
|
|
51
51
|
### Slots
|
|
52
52
|
|
|
53
53
|
- **(default)** — Label content (kept to a single row).
|
|
54
|
-
- **prefix** — Leading content before the label (e.g. icon).
|
|
55
|
-
- **suffix** — Trailing content.
|
|
56
|
-
- **expand-icon** — Icon shown when the item is collapsed.
|
|
57
54
|
- **collapse-icon** — Icon shown when the item is expanded.
|
|
58
55
|
- **content** — Block content that belongs to the item but not to its header row (e.g. comment body, action bar). Hidden when a branch is collapsed.
|
|
56
|
+
- **expand-icon** — Icon shown when the item is collapsed.
|
|
57
|
+
- **prefix** — Leading content before the label (e.g. icon).
|
|
58
|
+
- **suffix** — Trailing content.
|
|
59
59
|
|
|
60
60
|
### CSS parts
|
|
61
61
|
|
|
62
62
|
- `base` — The item row.
|
|
63
|
-
- `expand-button` — The chevron toggle area.
|
|
64
|
-
- `checkbox` — The native checkbox input.
|
|
65
|
-
- `label` — The label container.
|
|
66
63
|
- `branch` — Wrapper around the content and children slots; carries the indent guide.
|
|
67
|
-
- `
|
|
64
|
+
- `checkbox` — The native checkbox input.
|
|
68
65
|
- `children` — The nested items container.
|
|
66
|
+
- `content` — The content slot wrapper (block area between the row and the children).
|
|
67
|
+
- `expand-button` — The chevron toggle area.
|
|
68
|
+
- `label` — The label container.
|
|
69
69
|
|
|
70
70
|
### CSS custom properties
|
|
71
71
|
|
|
72
|
-
All layout tokens (`--row-height`, `--row-padding-inline`, `--chevron-size`, `--item-gap`, `--indent-*`) are declared on `<l-tree>` and cascade to every item. See [Tree › CSS custom properties](/elements/tree#css-custom-properties).
|
|
72
|
+
All layout tokens (`--row-height`, `--row-padding-inline`, `--chevron-size`, `--item-gap`, `--indent-*`) are declared on `<l-tree>` and cascade to every item. See [Tree › CSS custom properties](https://luxen-ui.com/elements/tree#css-custom-properties).
|
|
@@ -322,11 +322,6 @@ import 'luxen-ui/tree-item';
|
|
|
322
322
|
|
|
323
323
|
### Attributes & Properties
|
|
324
324
|
|
|
325
|
-
- **selection**: `TreeSelection` (default: `'single'`) — Selection behaviour:
|
|
326
|
-
- `single` (default): at most one item selected via `aria-selected`.
|
|
327
|
-
- `multiple`: any number of items selected. Checkboxes are rendered.
|
|
328
|
-
- `leaf`: only leaf items can be selected (single). Branches just toggle.
|
|
329
|
-
- `none`: purely navigable, no selection state.
|
|
330
325
|
- **independent**: `boolean` (default: `false`) — When set with `selection="multiple"`, parent and children selection are decoupled:
|
|
331
326
|
toggling a parent does NOT toggle its descendants and vice versa.
|
|
332
327
|
Without it, selection cascades both ways and branches may become indeterminate.
|
|
@@ -334,13 +329,18 @@ Without it, selection cascades both ways and branches may become indeterminate.
|
|
|
334
329
|
In independent mode the tree never writes `indeterminate`: the consumer owns
|
|
335
330
|
it (e.g. to show a partial state computed from rows not in the DOM). On
|
|
336
331
|
leaving the cascade, the tree clears only the flags its cascade wrote.
|
|
332
|
+
- **selection**: `TreeSelection` (default: `'single'`) — Selection behaviour:
|
|
333
|
+
- `single` (default): at most one item selected via `aria-selected`.
|
|
334
|
+
- `multiple`: any number of items selected. Checkboxes are rendered.
|
|
335
|
+
- `leaf`: only leaf items can be selected (single). Branches just toggle.
|
|
336
|
+
- `none`: purely navigable, no selection state.
|
|
337
337
|
|
|
338
338
|
### Methods
|
|
339
339
|
|
|
340
|
+
- **collapseAll()** — Collapses every item.
|
|
341
|
+
- **expandAll()** — Expands every item that has children.
|
|
340
342
|
- **getAllItems({ includeDisabled = true }: unknown)** → `TreeItem[]` — Returns all items in document (flat) order, including nested ones.
|
|
341
343
|
- **getSelection()** → `TreeItem[]` — Returns currently selected items.
|
|
342
|
-
- **expandAll()** — Expands every item that has children.
|
|
343
|
-
- **collapseAll()** — Collapses every item.
|
|
344
344
|
|
|
345
345
|
### Events
|
|
346
346
|
|
|
@@ -348,13 +348,13 @@ leaving the cascade, the tree clears only the flags its cascade wrote.
|
|
|
348
348
|
|
|
349
349
|
### CSS custom properties
|
|
350
350
|
|
|
351
|
-
- `--
|
|
352
|
-
- `--indent-guide-width` (default: `1px`) — Thickness of the vertical guide line between a parent and its children. Set to `0` to hide guides.
|
|
353
|
-
- `--indent-guide-style` (default: `solid`) — Line style of the guide (`solid`, `dashed`, `dotted`, `double`…).
|
|
351
|
+
- `--chevron-size` (default: `1.125rem`) — Size of the expand/collapse chevron box.
|
|
354
352
|
- `--indent-guide-color` — Color of the guide line.
|
|
353
|
+
- `--indent-guide-style` (default: `solid`) — Line style of the guide (`solid`, `dashed`, `dotted`, `double`…).
|
|
354
|
+
- `--indent-guide-width` (default: `1px`) — Thickness of the vertical guide line between a parent and its children. Set to `0` to hide guides.
|
|
355
|
+
- `--indent-size` (default: `1rem`) — Horizontal indent per depth level.
|
|
356
|
+
- `--item-gap` (default: `0.375rem`) — Horizontal gap between chevron, prefix, label and suffix on the row; also drives the content slot left indent.
|
|
355
357
|
- `--row-height` (default: `1.75rem`) — Minimum row height.
|
|
356
358
|
- `--row-padding-inline` (default: `0.25rem`) — Inner inline padding of the row; also drives the content slot left indent and the indent guide column.
|
|
357
|
-
- `--chevron-size` (default: `1.125rem`) — Size of the expand/collapse chevron box.
|
|
358
|
-
- `--item-gap` (default: `0.375rem`) — Horizontal gap between chevron, prefix, label and suffix on the row; also drives the content slot left indent.
|
|
359
359
|
|
|
360
|
-
See [`<l-tree-item>`](/elements/tree-item) for the per-item API.
|
|
360
|
+
See [`<l-tree-item>`](https://luxen-ui.com/elements/tree-item) for the per-item API.
|