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
|
@@ -63,12 +63,36 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/* Focus: border takes the ring color plus the soft halo, matching l-input. The
|
|
66
|
-
halo is mixed here rather than read from a :root token, so a --l-focus-ring
|
|
67
|
-
re-themed on an ancestor recolors the halo as well as the border.
|
|
66
|
+
halo is mixed here rather than read from a :root token, so a --l-focus-ring-color
|
|
67
|
+
re-themed on an ancestor recolors the halo as well as the border.
|
|
68
|
+
The --l-form-control-focus-border-width stroke is an outline drawn inward
|
|
69
|
+
over the border, so the field, its text and its end actions never move (0 by
|
|
70
|
+
default: nothing drawn).
|
|
71
|
+
An outline, not an inset box-shadow: it paints above the clear button and
|
|
72
|
+
the chevron, whose hover wash reaches the border, and it leaves box-shadow to
|
|
73
|
+
the halo alone, 0 wide (--l-form-control-focus-halo-width: 0) painting
|
|
74
|
+
nothing. The search box in l-select's panel is a text field too: same
|
|
75
|
+
recipe (its row's padding leaves room for the halo). */
|
|
68
76
|
.control:has(.input:focus-visible),
|
|
69
|
-
.trigger:focus-visible
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
.trigger:focus-visible,
|
|
78
|
+
.search:focus-visible {
|
|
79
|
+
border-color: var(--l-focus-ring-color);
|
|
80
|
+
outline: var(--l-form-control-focus-border-width) solid var(--l-focus-ring-color);
|
|
81
|
+
outline-offset: calc(var(--l-form-control-focus-border-width) * -1);
|
|
82
|
+
box-shadow: 0 0 0 var(--l-form-control-focus-halo-width)
|
|
83
|
+
color-mix(in oklab, var(--l-focus-ring-color) 22%, transparent);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Forced colors: the system palette overrides border-color and drops the halo.
|
|
87
|
+
A transparent outline is forced to a visible system color: it is the
|
|
88
|
+
indicator there. */
|
|
89
|
+
@media (forced-colors: active) {
|
|
90
|
+
.control:has(.input:focus-visible),
|
|
91
|
+
.trigger:focus-visible,
|
|
92
|
+
.search:focus-visible {
|
|
93
|
+
outline: var(--l-focus-ring-width) solid transparent;
|
|
94
|
+
outline-offset: var(--l-focus-ring-offset);
|
|
95
|
+
}
|
|
72
96
|
}
|
|
73
97
|
|
|
74
98
|
/* End actions — the clear button and the chevron each take a square as tall as
|
|
@@ -145,8 +169,8 @@
|
|
|
145
169
|
}
|
|
146
170
|
|
|
147
171
|
.clear-button:focus-visible {
|
|
148
|
-
outline:
|
|
149
|
-
outline-offset: -
|
|
172
|
+
outline: var(--l-focus-ring-width) solid var(--l-focus-ring-color);
|
|
173
|
+
outline-offset: calc(var(--l-focus-ring-width) * -1);
|
|
150
174
|
}
|
|
151
175
|
|
|
152
176
|
/*
|
|
@@ -195,14 +195,14 @@ import 'luxen-ui/alert-dialog';
|
|
|
195
195
|
|
|
196
196
|
### Attributes & Properties
|
|
197
197
|
|
|
198
|
-
- **confirm-text**: `string` (default: `'Confirm'`) — Label for the confirm action.
|
|
199
198
|
- **cancel-text**: `string` (default: `'Cancel'`) — Label for the cancel action.
|
|
200
|
-
- **
|
|
199
|
+
- **confirm-text**: `string` (default: `'Confirm'`) — Label for the confirm action.
|
|
200
|
+
- **light-dismiss**: `boolean` (default: `false`) — Close when the backdrop is clicked.
|
|
201
201
|
- **loading**: `boolean` (default: `false`) — Show a busy state on the confirm action (spinner + `aria-disabled`); the
|
|
202
202
|
cancel action stays operable as an escape hatch.
|
|
203
|
-
- **title**: `string` — Dialog title rendered in the header and used as the dialog's accessible name.
|
|
204
203
|
- **open**: `boolean` (default: `false`) — Whether the dialog is open.
|
|
205
|
-
- **
|
|
204
|
+
- **title**: `string` — Dialog title rendered in the header and used as the dialog's accessible name.
|
|
205
|
+
- **tone**: `'danger' | undefined` — Visual tone. `danger` renders the confirm action as destructive.
|
|
206
206
|
- **without-header**: `boolean` (default: `false`) — Hide the header entirely (title and close slot).
|
|
207
207
|
|
|
208
208
|
### Commands
|
|
@@ -214,40 +214,41 @@ Open and close the dialog by toggling its `open` property, or via the [Invoker C
|
|
|
214
214
|
|
|
215
215
|
### Events
|
|
216
216
|
|
|
217
|
-
- **confirm** (cancelable) — Fired when the user accepts. Cancelable — `preventDefault()` keeps it open for async work.
|
|
218
|
-
- **cancel** (cancelable) — Fired when the user dismisses (cancel action, Escape). Cancelable — `preventDefault()` keeps it open.
|
|
219
217
|
- **show** (cancelable) — Fired when the dialog is about to open. Cancelable.
|
|
220
|
-
- **hide** (cancelable) — Fired when the dialog is about to close via the `open` property. Cancelable. (The confirm, cancel, and Escape paths close natively and emit `confirm`/`cancel` instead of `hide`.)
|
|
221
218
|
- **after-show** — Fired after the open animation completes. Not cancelable.
|
|
219
|
+
- **hide** (cancelable) — Fired when the dialog is about to close via the `open` property. Cancelable. (The confirm, cancel, and Escape paths close natively and emit `confirm`/`cancel` instead of `hide`.)
|
|
222
220
|
- **after-hide** — Fired after the close animation completes. Not cancelable.
|
|
221
|
+
- **cancel** (cancelable) — Fired when the user dismisses (cancel action, Escape). Cancelable — `preventDefault()` keeps it open.
|
|
222
|
+
- **confirm** (cancelable) — Fired when the user accepts. Cancelable — `preventDefault()` keeps it open for async work.
|
|
223
223
|
|
|
224
224
|
### Slots
|
|
225
225
|
|
|
226
226
|
- **(default)** — Description text. Provides the dialog's accessible description.
|
|
227
|
-
- **title** — Custom heading element. Overrides the default `<h2>` rendered from the `title` property. Also provides the dialog's accessible name.
|
|
228
227
|
- **cancel** — Replaces the built-in cancel action (e.g. a link). Keep it focusable.
|
|
229
|
-
- **confirm** — Replaces the built-in confirm action.
|
|
230
228
|
- **close** — Close button (typically `<button class="l-close">`).
|
|
229
|
+
- **confirm** — Replaces the built-in confirm action.
|
|
231
230
|
- **footer** — Footer actions.
|
|
231
|
+
- **title** — Custom heading element. Overrides the default `<h2>` rendered from the `title` property. Also provides the dialog's accessible name.
|
|
232
232
|
|
|
233
233
|
### CSS parts
|
|
234
234
|
|
|
235
|
-
- `dialog` — The native `<dialog>` element.
|
|
236
|
-
- `header` — The header wrapper containing the title.
|
|
237
|
-
- `title` — The dialog title heading.
|
|
238
235
|
- `body` — The body wrapper around the description.
|
|
239
|
-
- `footer` — The footer wrapper around the actions.
|
|
240
236
|
- `button` — Both built-in action buttons.
|
|
241
237
|
- `cancel` — The built-in cancel button.
|
|
242
238
|
- `confirm` — The built-in confirm button.
|
|
239
|
+
- `dialog` — The native `<dialog>` element.
|
|
240
|
+
- `footer` — The footer wrapper around the actions.
|
|
241
|
+
- `header` — The header wrapper containing the title.
|
|
242
|
+
- `title` — The dialog title heading.
|
|
243
243
|
|
|
244
244
|
### CSS custom properties
|
|
245
245
|
|
|
246
|
-
- `--
|
|
246
|
+
- `--backdrop` (default: `var(--l-backdrop-strong)`) — Backdrop color.
|
|
247
|
+
- `--backdrop-blur` (default: `2px`) — Backdrop blur amount (any CSS length).
|
|
247
248
|
- `--border-radius` (default: `6px`) — Dialog border radius.
|
|
249
|
+
- `--easing` (default: `cubic-bezier(0.32, 0.72, 0, 1)`) — Timing function of the open and close transitions, backdrop included.
|
|
250
|
+
- `--hide-duration` (default: `200ms`) — Close transition duration.
|
|
248
251
|
- `--padding` (default: `1.5rem`) — Padding applied to the header, footer, and inline-padding of the body.
|
|
252
|
+
- `--shadow` (default: `none`) — Drop shadow of the dialog panel (any `box-shadow` value). Raise it when the backdrop is light, where the panel edge would otherwise fade into the page.
|
|
249
253
|
- `--show-duration` (default: `200ms`) — Open transition duration.
|
|
250
|
-
- `--
|
|
251
|
-
- `--easing` (default: `cubic-bezier(0.32, 0.72, 0, 1)`) — Timing function of the open and close transitions, backdrop included.
|
|
252
|
-
- `--backdrop` — Backdrop color.
|
|
253
|
-
- `--backdrop-blur` (default: `0`) — Backdrop blur amount (any CSS length).
|
|
254
|
+
- `--width` (default: `31rem`) — Dialog width.
|
|
@@ -125,10 +125,10 @@ import 'luxen-ui/alert';
|
|
|
125
125
|
|
|
126
126
|
### Attributes & Properties
|
|
127
127
|
|
|
128
|
-
- **
|
|
128
|
+
- **dismissible**: `boolean` (default: `false`) — Show a close button that dismisses the alert when clicked.
|
|
129
129
|
- **icon**: `string | undefined` — Iconify icon name (e.g. `lucide:bell`) overriding the variant's default icon.
|
|
130
|
+
- **variant**: `AlertVariant | undefined` — Semantic variant: `info`, `success`, `warning`, or `danger`. Default is neutral.
|
|
130
131
|
- **without-icon**: `boolean` (default: `false`) — Hide the leading icon entirely.
|
|
131
|
-
- **dismissible**: `boolean` (default: `false`) — Show a close button that dismisses the alert when clicked.
|
|
132
132
|
|
|
133
133
|
### Events
|
|
134
134
|
|
|
@@ -137,12 +137,12 @@ import 'luxen-ui/alert';
|
|
|
137
137
|
|
|
138
138
|
### CSS classes
|
|
139
139
|
|
|
140
|
-
- `.l-alert-icon` — The leading icon, colored by variant (auto-injected).
|
|
141
140
|
- `.l-alert-content` — Wrapper the authored children are moved into; stacks them vertically (auto-injected).
|
|
141
|
+
- `.l-alert-icon` — The leading icon, colored by variant (auto-injected).
|
|
142
142
|
- `.l-alert-title` — Optional bold heading placed above the body content. Use a real heading element (e.g. `<h3 class="l-alert-title">`) when the alert is a section callout so it is reachable by heading navigation.
|
|
143
143
|
|
|
144
144
|
### CSS custom properties
|
|
145
145
|
|
|
146
|
+
- `--border-radius` (default: `8px`) — Corner radius.
|
|
146
147
|
- `--gap` (default: `0.75rem`) — Gap between the icon, content, and close button.
|
|
147
148
|
- `--padding` (default: `1rem`) — Inner padding.
|
|
148
|
-
- `--border-radius` (default: `8px`) — Corner radius.
|
|
@@ -259,11 +259,15 @@ import 'luxen-ui/avatar';
|
|
|
259
259
|
|
|
260
260
|
### Attributes & Properties
|
|
261
261
|
|
|
262
|
-
- **src**: `string` — Image URL. Falls back to initials (then the default icon) if it fails to load.
|
|
263
|
-
- **name**: `string` — Name used as the accessible label and to derive the initials fallback.
|
|
264
|
-
- **size**: `string` (default: `'md'`) — Avatar size: `xs`, `sm`, `md` (default), `lg`, or `xl`.
|
|
265
262
|
- **badge**: `number` (default: `0`) — Count shown in the corner badge. `0` hides the badge.
|
|
266
263
|
- **interactive**: `boolean` (default: `false`) — Render as a `<button>` with focus ring and hover states.
|
|
264
|
+
- **name**: `string` — Name used as the accessible label and to derive the initials fallback.
|
|
265
|
+
- **size**: `string` (default: `'md'`) — Avatar size: `xs`, `sm`, `md` (default), `lg`, or `xl`.
|
|
266
|
+
- **src**: `string` — Image URL. Falls back to initials (then the default icon) if it fails to load.
|
|
267
|
+
|
|
268
|
+
### CSS parts
|
|
269
|
+
|
|
270
|
+
- `base` — The avatar container that paints `--color`; style it (e.g. `color`) to override the auto-derived text color.
|
|
267
271
|
|
|
268
272
|
### CSS classes
|
|
269
273
|
|
|
@@ -271,11 +275,7 @@ import 'luxen-ui/avatar';
|
|
|
271
275
|
|
|
272
276
|
### CSS custom properties
|
|
273
277
|
|
|
274
|
-
- `--
|
|
278
|
+
- `--appearance` — Set to `circle` for a fully circular avatar (default is a rounded square).
|
|
275
279
|
- `--color` — Background fill color for initials and the default icon.
|
|
280
|
+
- `--size` (default: `40px`) — Box size (any length). Set it inline (e.g. `style="--size: 20px"`) for an arbitrary size beyond the `size` token scale; the font then follows proportionally. The `size` attribute sets it to the matching token.
|
|
276
281
|
- `--text-color` — Initials/icon color over `--color`. Defaults to an auto-derived readable color; set it to enforce a specific brand color (overrides the automatic choice).
|
|
277
|
-
- `--appearance` — Set to `circle` for a fully circular avatar (default is a rounded square).
|
|
278
|
-
|
|
279
|
-
### CSS parts
|
|
280
|
-
|
|
281
|
-
- `base` — The avatar container that paints `--color`; style it (e.g. `color`) to override the auto-derived text color.
|
|
@@ -14,7 +14,7 @@ Badges are used to draw attention and display statuses or counts. Commonly used
|
|
|
14
14
|
|
|
15
15
|
> **Badge or tag?**
|
|
16
16
|
>
|
|
17
|
-
> A badge is a value the user **reads**. When the chip is something the user **operates** — a filter to toggle, a token to remove — use [`<l-tag>`](/elements/tag).
|
|
17
|
+
> A badge is a value the user **reads**. When the chip is something the user **operates** — a filter to toggle, a token to remove — use [`<l-tag>`](https://luxen-ui.com/elements/tag).
|
|
18
18
|
|
|
19
19
|
## Options
|
|
20
20
|
|
|
@@ -360,14 +360,14 @@ import 'luxen-ui/badge';
|
|
|
360
360
|
|
|
361
361
|
### Attributes & Properties
|
|
362
362
|
|
|
363
|
-
- **
|
|
363
|
+
- **appearance**: `BadgeAppearance | undefined` — Visual appearance: `filled`, `filled-outlined`, `accent`. Default is outlined.
|
|
364
364
|
- **pill**: `boolean` (default: `false`) — Display as pill shape
|
|
365
365
|
- **size**: `BadgeSize | undefined` — Badge size: `sm`, `lg`. Default is md.
|
|
366
|
-
- **
|
|
366
|
+
- **variant**: `BadgeVariant | undefined` — Style variant: `info`, `success`, `warning`, `danger`, or `neutral` (default)
|
|
367
367
|
|
|
368
368
|
### CSS custom properties
|
|
369
369
|
|
|
370
|
-
- `--text-color` — Label color. The border is a tint of it, so this alone repaints an outlined badge. Defaults to the `variant` step.
|
|
371
370
|
- `--background-color` — Badge fill. Defaults to the `appearance` step — transparent when outlined.
|
|
372
371
|
- `--border-color` — Badge border. Defaults to a 30% tint of `--text-color`; setting it replaces that derivation and holds through `appearance="filled"`, whose default line is transparent.
|
|
373
372
|
- `--border-radius` (default: `--l-radius-md`) — Corner radius. The corner stays a squircle; `pill` is what trades it for a true arc.
|
|
373
|
+
- `--text-color` — Label color. The border is a tint of it, so this alone repaints an outlined badge. Defaults to the `variant` step.
|
|
@@ -117,7 +117,7 @@ The divider is a decorative oblique `/`. Recolor it with `--separator-color`, or
|
|
|
117
117
|
|
|
118
118
|
### Long trails
|
|
119
119
|
|
|
120
|
-
The trail never wraps — when it overflows it scrolls horizontally (with touch momentum on mobile). To shorten a deep path instead, keep the first and last crumbs visible and fold the middle ones into an [`l-dropdown`](/elements/dropdown). Label the trigger so its purpose is announced.
|
|
120
|
+
The trail never wraps — when it overflows it scrolls horizontally (with touch momentum on mobile). To shorten a deep path instead, keep the first and last crumbs visible and fold the middle ones into an [`l-dropdown`](https://luxen-ui.com/elements/dropdown). Label the trigger so its purpose is announced.
|
|
121
121
|
|
|
122
122
|
```html
|
|
123
123
|
<!--
|
|
@@ -230,10 +230,10 @@ Add `data-unstyled-links` to opt out of Luxen's link theming and apply your own
|
|
|
230
230
|
@import 'luxen-ui/css/breadcrumb';
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
-
### Attributes
|
|
233
|
+
### Attributes & Properties
|
|
234
234
|
|
|
235
|
-
- **aria-label** — Names the navigation landmark (use `"Breadcrumb"`).
|
|
236
235
|
- **aria-current** — Set to `page` on the current crumb's `<a>`.
|
|
236
|
+
- **aria-label** — Names the navigation landmark (use `"Breadcrumb"`).
|
|
237
237
|
- **data-unstyled-links** — Opt out of Luxen's link theming (color, underline, hover) so you can apply your own link class. Layout, separators, scroll, and current-page behavior stay.
|
|
238
238
|
|
|
239
239
|
### CSS classes
|
|
@@ -243,5 +243,5 @@ Add `data-unstyled-links` to opt out of Luxen's link theming and apply your own
|
|
|
243
243
|
### CSS custom properties
|
|
244
244
|
|
|
245
245
|
- `--gap` (default: `0.5rem`) — Space between crumbs and around the separator.
|
|
246
|
-
- `--separator-color` (default: `var(--l-color-text-tertiary)`) — Separator glyph color.
|
|
247
246
|
- `--separator` (default: `'/'`) — Divider glyph; any character (e.g. `'›'`) or a `url()` image.
|
|
247
|
+
- `--separator-color` (default: `var(--l-color-text-tertiary)`) — Separator glyph color.
|
|
@@ -271,13 +271,13 @@ Wrap related buttons in [`<l-button-group>`](./button-group) to join them into a
|
|
|
271
271
|
|
|
272
272
|
### Attributes & Properties
|
|
273
273
|
|
|
274
|
-
- **disabled** — Disables the button.
|
|
275
274
|
- **command** — Invoker command (`show-modal`, `close`, `show-popover`, etc.).
|
|
276
275
|
- **commandfor** — ID of the target element for `command`.
|
|
277
|
-
- **data-variant**: `primary | destructive` — Visual variant. Default is the secondary style.
|
|
278
|
-
- **data-size**: `sm | lg | xl` — Control size. Default is md.
|
|
279
276
|
- **data-icon-only** — Icon-only mode (square button, width equals height). Auto-detected for a single icon child.
|
|
280
277
|
- **data-press-effect** — Press effect (scale + translate on active).
|
|
278
|
+
- **data-size**: `sm | lg | xl` — Control size. Default is md.
|
|
279
|
+
- **data-variant**: `primary | destructive` — Visual variant. Default is the secondary style.
|
|
280
|
+
- **disabled** — Disables the button.
|
|
281
281
|
|
|
282
282
|
### CSS classes
|
|
283
283
|
|
|
@@ -285,13 +285,13 @@ Wrap related buttons in [`<l-button-group>`](./button-group) to join them into a
|
|
|
285
285
|
|
|
286
286
|
### CSS custom properties
|
|
287
287
|
|
|
288
|
-
- `--height` (default: `36px`) — Button height (md size).
|
|
289
|
-
- `--padding-inline` (default: `0.625rem`) — Horizontal padding.
|
|
290
288
|
- `--background-color` — Background color.
|
|
291
|
-
- `--background-color-hover` — Background color on hover.
|
|
292
289
|
- `--background-color-active` — Background color on press.
|
|
293
|
-
- `--
|
|
294
|
-
- `--text-color-hover` — Text color on hover.
|
|
290
|
+
- `--background-color-hover` — Background color on hover.
|
|
295
291
|
- `--border-color` — Border color.
|
|
296
292
|
- `--border-color-hover` — Border color on hover.
|
|
297
293
|
- `--font-size` (default: `0.875rem`) — Label font size. Stays 14px across all sizes; override to opt into a larger label.
|
|
294
|
+
- `--height` (default: `36px`) — Button height (md size).
|
|
295
|
+
- `--padding-inline` (default: `0.625rem`) — Horizontal padding.
|
|
296
|
+
- `--text-color` — Text color.
|
|
297
|
+
- `--text-color-hover` — Text color on hover.
|
|
@@ -576,77 +576,77 @@ import 'luxen-ui/carousel-item';
|
|
|
576
576
|
|
|
577
577
|
### Attributes & Properties
|
|
578
578
|
|
|
579
|
-
- **
|
|
579
|
+
- **align**: `AlignmentOptionType` (default: `'start'`) — Align the slides relative to the carousel viewport.
|
|
580
580
|
- **autoplay**: `number` (default: `0`) — Choose a delay between transitions in milliseconds (default: 4000).
|
|
581
581
|
- **autoplay-options**: `any` — Configure autoplay options.
|
|
582
582
|
- **axis**: `AxisOptionType` (default: `'x'`) — Choose scroll axis between x and y.
|
|
583
|
-
- **align**: `AlignmentOptionType` (default: `'start'`) — Align the slides relative to the carousel viewport.
|
|
584
583
|
- **breakpoints**: `any` (default: `{}`) — Breakpoint overrides for options.
|
|
585
|
-
- **loop**: `boolean` (default: `false`) — Enables infinite looping.
|
|
586
|
-
- **drag-free**: `boolean` (default: `false`) — Enables momentum scrolling (drag free).
|
|
587
|
-
- **duration**: `number` (default: `20`) — Set scroll duration when triggered by API methods.
|
|
588
|
-
- **skip-snaps**: `boolean` (default: `false`) — Allow skipping scroll snaps on vigorous drag.
|
|
589
|
-
- **slides-to-scroll**: `SlidesToScrollOptionType` (default: `1`) — Group slides together for navigation.
|
|
590
|
-
- **start-index**: `number` (default: `0`) — Set the initial scroll snap index.
|
|
591
584
|
- **contain-scroll**: `ScrollContainOptionType` (default: `'trimSnaps'`) — Clear leading and trailing empty space.
|
|
592
|
-
- **single**: `boolean` (default: `false`)
|
|
593
|
-
- **with-dots**: `boolean` (default: `false`)
|
|
594
|
-
- **with-scrollbar**: `boolean` (default: `false`)
|
|
595
|
-
- **with-fullscreen**: `boolean` (default: `false`)
|
|
596
585
|
- **dot-appearance**: `'circle' | 'bar'` (default: `'bar'`)
|
|
586
|
+
- **drag-free**: `boolean` (default: `false`) — Enables momentum scrolling (drag free).
|
|
587
|
+
- **duration**: `number` (default: `20`) — Set scroll duration when triggered by API methods.
|
|
588
|
+
- **embla**: `EmblaCarouselType`
|
|
589
|
+
- **loop**: `boolean` (default: `false`) — Enables infinite looping.
|
|
597
590
|
- **max-visible-dots**: `number` (default: `0`) — Maximum number of dots rendered at once. When the snap count exceeds this,
|
|
598
591
|
a sliding window keeps the active dot in view and shrinks the edge dot(s)
|
|
599
592
|
on the side where dots are hidden. `0` (default) renders all dots.
|
|
600
|
-
- **scroll-buttons-position**: `'inside' | 'outside'` (default: `'inside'`)
|
|
601
593
|
- **next**
|
|
602
594
|
- **previous**
|
|
595
|
+
- **scroll-buttons-position**: `'inside' | 'outside'` (default: `'inside'`)
|
|
596
|
+
- **single**: `boolean` (default: `false`)
|
|
597
|
+
- **skip-snaps**: `boolean` (default: `false`) — Allow skipping scroll snaps on vigorous drag.
|
|
598
|
+
- **slides-to-scroll**: `SlidesToScrollOptionType` (default: `1`) — Group slides together for navigation.
|
|
599
|
+
- **start-index**: `number` (default: `0`) — Set the initial scroll snap index.
|
|
600
|
+
- **with-dots**: `boolean` (default: `false`)
|
|
601
|
+
- **with-fullscreen**: `boolean` (default: `false`)
|
|
602
|
+
- **with-scrollbar**: `boolean` (default: `false`)
|
|
603
603
|
|
|
604
604
|
### Methods
|
|
605
605
|
|
|
606
|
-
- **options()** → `EmblaOptionsType`
|
|
607
606
|
- **goToSlide(index: number, jump: boolean)**
|
|
608
|
-
- **slideNodes()**
|
|
609
|
-
- **slidesInView()**
|
|
610
607
|
- **isActive()**
|
|
608
|
+
- **options()** → `EmblaOptionsType`
|
|
611
609
|
- **renderFullscreenButton()**
|
|
612
610
|
- **renderNextPreviousButtons()**
|
|
611
|
+
- **slideNodes()**
|
|
612
|
+
- **slidesInView()**
|
|
613
613
|
|
|
614
614
|
### Events
|
|
615
615
|
|
|
616
|
+
- **fullscreen** — Fired when the fullscreen button is activated.
|
|
616
617
|
- **select** — Fired when the active slide changes. Bubbles. Properties: `index: number`.
|
|
617
618
|
- **slides-in-view** — Fired when the set of slides in view changes. Properties: `indexes: number[]`.
|
|
618
|
-
- **fullscreen** — Fired when the fullscreen button is activated.
|
|
619
619
|
|
|
620
|
-
### CSS
|
|
620
|
+
### CSS parts
|
|
621
621
|
|
|
622
|
-
- `viewport` — The carousel viewport container.
|
|
623
|
-
- `container` — The slides container slot.
|
|
624
|
-
- `scroll-buttons` — The scroll buttons wrapper.
|
|
625
622
|
- `button` — Any navigation button.
|
|
626
|
-
- `button-previous` — The previous slide navigation button.
|
|
627
|
-
- `button-next` — The next slide navigation button.
|
|
628
623
|
- `button-dot` — Any dot navigation button.
|
|
629
|
-
- `dots` — The dots navigation wrapper.
|
|
630
624
|
- `button-fullscreen` — The fullscreen button.
|
|
631
625
|
- `button-icon` — Any button icon SVG.
|
|
626
|
+
- `button-next` — The next slide navigation button.
|
|
627
|
+
- `button-previous` — The previous slide navigation button.
|
|
628
|
+
- `container` — The slides container slot.
|
|
629
|
+
- `dots` — The dots navigation wrapper.
|
|
630
|
+
- `scroll-buttons` — The scroll buttons wrapper.
|
|
631
|
+
- `viewport` — The carousel viewport container.
|
|
632
632
|
|
|
633
633
|
### CSS custom properties
|
|
634
634
|
|
|
635
|
-
- `--slide-height` — Height of slides in vertical axis mode.
|
|
636
|
-
- `--slide-size` — Width of each slide (e.g. `100%`, `calc(100% / 3)`).
|
|
637
|
-
- `--slide-gap` — Gap between slides.
|
|
638
|
-
- `--button-size` — Size of navigation buttons.
|
|
639
|
-
- `--button-arrow-size` — Size of arrow icons inside buttons.
|
|
640
635
|
- `--button-arrow-color` — Color of arrow icons.
|
|
641
|
-
- `--button-
|
|
636
|
+
- `--button-arrow-size` — Size of arrow icons inside buttons.
|
|
637
|
+
- `--button-bg` — Background color of buttons.
|
|
642
638
|
- `--button-border-color` — Border color of buttons.
|
|
643
639
|
- `--button-border-radius` — Border radius of buttons.
|
|
644
|
-
- `--button-bg` — Background color of buttons.
|
|
645
640
|
- `--button-color` — Text/icon color of buttons.
|
|
641
|
+
- `--button-offset` — Offset of inside-positioned buttons from edges.
|
|
642
|
+
- `--button-size` — Size of navigation buttons.
|
|
646
643
|
- `--dot-color` — Color of inactive dots.
|
|
647
644
|
- `--dot-color-active` — Color of active dot.
|
|
648
|
-
- `--dot-margin` — Margin around dots container.
|
|
649
645
|
- `--dot-edge-scale` (default: `0.5`) — Scale factor applied to edge dots that signal more dots exist beyond the visible window ().
|
|
646
|
+
- `--dot-margin` — Margin around dots container.
|
|
647
|
+
- `--slide-gap` — Gap between slides.
|
|
648
|
+
- `--slide-height` — Height of slides in vertical axis mode.
|
|
649
|
+
- `--slide-size` — Width of each slide (e.g. `100%`, `calc(100% / 3)`).
|
|
650
650
|
|
|
651
651
|
### `carousel-item` CSS custom properties
|
|
652
652
|
|
|
@@ -16,7 +16,7 @@ Checkboxes let users select one or more options, or toggle a single setting on o
|
|
|
16
16
|
</l-form-field>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
[`l-form-field`](/elements/form-field) auto-styles a bare `<input type="checkbox">` and wires the accessibility (label, hint, error, `aria-*`). Standalone, apply `.l-checkbox` to the input yourself.
|
|
19
|
+
[`l-form-field`](https://luxen-ui.com/elements/form-field) auto-styles a bare `<input type="checkbox">` and wires the accessibility (label, hint, error, `aria-*`). Standalone, apply `.l-checkbox` to the input yourself.
|
|
20
20
|
|
|
21
21
|
For a single setting that takes effect **immediately** (no Save button), use a switch instead.
|
|
22
22
|
|
|
@@ -176,11 +176,11 @@ Override `--size` for the box and `--accent` for the checked fill.
|
|
|
176
176
|
|
|
177
177
|
### Attributes & Properties
|
|
178
178
|
|
|
179
|
+
- **aria-invalid** — Set to `true` to force the invalid style (otherwise applied via `:user-invalid`). `l-form-field` manages this automatically.
|
|
179
180
|
- **checked** — Whether the checkbox is checked.
|
|
180
181
|
- **disabled** — Disables the checkbox.
|
|
181
|
-
- **required** — Marks the checkbox as required for form submission.
|
|
182
182
|
- **indeterminate** — Indeterminate state (DOM property `el.indeterminate = true`; renders a dash). Typically the parent of a group.
|
|
183
|
-
- **
|
|
183
|
+
- **required** — Marks the checkbox as required for form submission.
|
|
184
184
|
|
|
185
185
|
### CSS classes
|
|
186
186
|
|
|
@@ -188,6 +188,6 @@ Override `--size` for the box and `--accent` for the checked fill.
|
|
|
188
188
|
|
|
189
189
|
### CSS custom properties
|
|
190
190
|
|
|
191
|
-
- `--size` (default: `1.25em`) — Box size.
|
|
192
191
|
- `--accent` (default: `var(--l-form-control-activated-color)`) — Checked/indeterminate fill color.
|
|
193
192
|
- `--checkmark` — Checkmark icon as a `url()`. Override to swap the SVG (color is baked into the image).
|
|
193
|
+
- `--size` (default: `1.25em`) — Box size.
|
|
@@ -96,9 +96,9 @@ Pick a visual style via `data-appearance`. Each appearance has its own CSS impor
|
|
|
96
96
|
|
|
97
97
|
### Attributes & Properties
|
|
98
98
|
|
|
99
|
-
- **data-appearance**: `ring | square | circle` — Visual appearance (matches the imported appearance CSS).
|
|
100
99
|
- **command** — Invoker command (typically `close`).
|
|
101
100
|
- **commandfor** — ID of the target element to close.
|
|
101
|
+
- **data-appearance**: `ring | square | circle` — Visual appearance (matches the imported appearance CSS).
|
|
102
102
|
|
|
103
103
|
### CSS classes
|
|
104
104
|
|
|
@@ -106,8 +106,8 @@ Pick a visual style via `data-appearance`. Each appearance has its own CSS impor
|
|
|
106
106
|
|
|
107
107
|
### CSS custom properties
|
|
108
108
|
|
|
109
|
-
- `--size` (default: `36px`) — Button size.
|
|
110
109
|
- `--icon-color` — Icon color.
|
|
111
110
|
- `--icon-size` (default: `24px`) — Icon size.
|
|
112
111
|
- `--ring-color` — Hover ring color (`ring` appearance only).
|
|
113
112
|
- `--ring-tickness` — Hover ring thickness (`ring` appearance only).
|
|
113
|
+
- `--size` (default: `36px`) — Button size.
|
|
@@ -41,7 +41,7 @@ Its home is an icon-only button in a header — the button owns the role, the na
|
|
|
41
41
|
</header>
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
It is **presentational only** — it shows a scheme, it never chooses or stores one. With no `scheme` it follows [`colorScheme.current`](/overview/color-scheme), so it stays in step with every other control on the page without wiring; set `scheme` to pin it.
|
|
44
|
+
It is **presentational only** — it shows a scheme, it never chooses or stores one. With no `scheme` it follows [`colorScheme.current`](https://luxen-ui.com/overview/color-scheme), so it stays in step with every other control on the page without wiring; set `scheme` to pin it.
|
|
45
45
|
|
|
46
46
|
The example above uses inline handlers to stay readable. In an application, the click and the pressed state are what you wire — the glyph needs nothing:
|
|
47
47
|
|
|
@@ -68,7 +68,7 @@ To advertise the destination instead — a sun meaning "switch to light" — pas
|
|
|
68
68
|
|
|
69
69
|
### Scheme
|
|
70
70
|
|
|
71
|
-
Leave `scheme` unset and the icon follows the page's [color scheme](/overview/color-scheme) — a stored override, else the OS preference — updating itself when it changes anywhere, including in another tab.
|
|
71
|
+
Leave `scheme` unset and the icon follows the page's [color scheme](https://luxen-ui.com/overview/color-scheme) — a stored override, else the OS preference — updating itself when it changes anywhere, including in another tab.
|
|
72
72
|
|
|
73
73
|
Set `scheme` and the store is out of the picture: the glyph shows what you tell it and nothing else moves it. That is the hook for an app that already owns its light/dark state — a framework store, a class on `<html>` written by the server, a user setting fetched from an API — and also what pins a glyph in a legend or a preview.
|
|
74
74
|
|
|
@@ -150,7 +150,7 @@ Both icons below look identical; the difference exists only in the accessibility
|
|
|
150
150
|
|
|
151
151
|
### In a menu row
|
|
152
152
|
|
|
153
|
-
Put it in a `type="checkbox"` [dropdown item](/elements/dropdown#theme-row) and the row is the control: whole row clickable, `menuitemcheckbox` role, menu stays open. The icon stays decorative.
|
|
153
|
+
Put it in a `type="checkbox"` [dropdown item](https://luxen-ui.com/elements/dropdown#theme-row) and the row is the control: whole row clickable, `menuitemcheckbox` role, menu stays open. The icon stays decorative.
|
|
154
154
|
|
|
155
155
|
Add `check-placement="end"` so the check moves to the trailing edge and leaves the leading column free — the glyph then lines up with every other row's icon.
|
|
156
156
|
|
|
@@ -235,7 +235,7 @@ document.querySelector('l-dropdown').addEventListener('select', (event) => {
|
|
|
235
235
|
colorScheme.subscribe((scheme) => (item.checked = scheme === 'dark'));
|
|
236
236
|
```
|
|
237
237
|
|
|
238
|
-
Do not put a [switch](/elements/switch) in a menu row instead: a `role="menu"` may only own `menuitem`, `menuitemcheckbox` and `menuitemradio` children, and a nested control gives the row two competing click targets.
|
|
238
|
+
Do not put a [switch](https://luxen-ui.com/elements/switch) in a menu row instead: a `role="menu"` may only own `menuitem`, `menuitemcheckbox` and `menuitemradio` children, and a nested control gives the row two competing click targets.
|
|
239
239
|
|
|
240
240
|
## Accessibility
|
|
241
241
|
|
|
@@ -259,21 +259,21 @@ Do not put a [switch](/elements/switch) in a menu row instead: a `role="menu"` m
|
|
|
259
259
|
import 'luxen-ui/color-scheme-icon';
|
|
260
260
|
```
|
|
261
261
|
|
|
262
|
-
### Properties
|
|
262
|
+
### Attributes & Properties
|
|
263
263
|
|
|
264
|
+
- **label**: `string | undefined` — Accessible label. When set, the glyph becomes meaningful (`role="img"`);
|
|
265
|
+
when absent it is decorative and hidden from assistive tech — the right
|
|
266
|
+
default inside a row or button that already carries the name.
|
|
264
267
|
- **scheme**: `ColorScheme | undefined` — Which glyph to show. Leave it unset and the icon follows the page's scheme
|
|
265
268
|
(`colorScheme.current` — a stored override, else the OS preference), so it
|
|
266
269
|
stays in step with every other control without wiring. Set it to pin the
|
|
267
270
|
glyph, for a legend or a preview that must not move.
|
|
268
|
-
- **label**: `string | undefined` — Accessible label. When set, the glyph becomes meaningful (`role="img"`);
|
|
269
|
-
when absent it is decorative and hidden from assistive tech — the right
|
|
270
|
-
default inside a row or button that already carries the name.
|
|
271
|
-
|
|
272
|
-
### CSS custom properties
|
|
273
|
-
|
|
274
|
-
- `--size` (default: `1em`) — Width and height of the glyph.
|
|
275
|
-
- `--color` (default: `currentColor`) — Glyph color.
|
|
276
271
|
|
|
277
272
|
### CSS parts
|
|
278
273
|
|
|
279
274
|
- `base` — The root `<svg>`, for overriding the morph's timing or tilt.
|
|
275
|
+
|
|
276
|
+
### CSS custom properties
|
|
277
|
+
|
|
278
|
+
- `--color` (default: `currentColor`) — Glyph color.
|
|
279
|
+
- `--size` (default: `1em`) — Width and height of the glyph.
|
|
@@ -22,7 +22,7 @@ A text input paired with a filterable list of options — type to narrow the lis
|
|
|
22
22
|
</l-combobox>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Options are authored as a native `<datalist>` of `<option>` — the same authoring surface as [`<select>`](/elements/select).
|
|
25
|
+
Options are authored as a native `<datalist>` of `<option>` — the same authoring surface as [`<select>`](https://luxen-ui.com/elements/select).
|
|
26
26
|
|
|
27
27
|
## Options
|
|
28
28
|
|
|
@@ -114,7 +114,7 @@ Add `allow-custom` to accept a typed value that matches no option.
|
|
|
114
114
|
|
|
115
115
|
### Rich options
|
|
116
116
|
|
|
117
|
-
Put markup inside each `<option>` — the same `.l-select-item-media` / `.l-select-item-text` / `.l-select-item-title` / `.l-select-item-description` classes as [`<select>`](/elements/select). Set a `label` (or `.l-select-item-title`) so filtering and the input display use the title.
|
|
117
|
+
Put markup inside each `<option>` — the same `.l-select-item-media` / `.l-select-item-text` / `.l-select-item-title` / `.l-select-item-description` classes as [`<select>`](https://luxen-ui.com/elements/select). Set a `label` (or `.l-select-item-title`) so filtering and the input display use the title.
|
|
118
118
|
|
|
119
119
|
As you type, the match is highlighted inside `.l-select-item-title` and `.l-select-item-description`, with the same accent/case-insensitive matching as plain options. Only the text is wrapped in `<mark>`; the option's markup is kept as authored.
|
|
120
120
|
|
|
@@ -162,7 +162,7 @@ As you type, the match is highlighted inside `.l-select-item-title` and `.l-sele
|
|
|
162
162
|
|
|
163
163
|
#### Suffix
|
|
164
164
|
|
|
165
|
-
Add a `.l-select-item-suffix` after `.l-select-item-text` to pin a badge, a count or a status icon to the end of the row, before the checkmark. It sits on the title's line, keeps its natural width while the title truncates, and is never matched by the filter or written into the input. Rich options are copied into the popover's shadow root: an [`<l-badge>`](/elements/badge) is styled there, but your page's own selectors don't reach that copy. To theme it, set the badge's CSS custom properties on the `<l-combobox>`: they inherit into the popover. Screen readers announce the suffix with its option, so write it as words ("12 members", not "12").
|
|
165
|
+
Add a `.l-select-item-suffix` after `.l-select-item-text` to pin a badge, a count or a status icon to the end of the row, before the checkmark. It sits on the title's line, keeps its natural width while the title truncates, and is never matched by the filter or written into the input. Rich options are copied into the popover's shadow root: an [`<l-badge>`](https://luxen-ui.com/elements/badge) is styled there, but your page's own selectors don't reach that copy. To theme it, set the badge's CSS custom properties on the `<l-combobox>`: they inherit into the popover. Screen readers announce the suffix with its option, so write it as words ("12 members", not "12").
|
|
166
166
|
|
|
167
167
|
```html
|
|
168
168
|
<div class="w-80">
|
|
@@ -367,47 +367,47 @@ import 'luxen-ui/combobox';
|
|
|
367
367
|
|
|
368
368
|
### Attributes & Properties
|
|
369
369
|
|
|
370
|
-
- **value**: `string` — Selected value (the chosen option's `value`).
|
|
371
|
-
- **placeholder**: `string` — Placeholder text in the input.
|
|
372
|
-
- **label**: `string` — Accessible label for the input.
|
|
373
|
-
- **size**: `ComboboxSize` (default: `'md'`) — Control size.
|
|
374
|
-
- **with-clear**: `boolean` (default: `false`) — Show a button to clear the value.
|
|
375
370
|
- **allow-custom**: `boolean` (default: `false`) — Accept a typed value that matches no option.
|
|
371
|
+
- **filter**: `ComboboxFilter` (default: `defaultFilter`) — Override the option filter. `(item, query) => boolean`.
|
|
376
372
|
- **highlight**: `boolean` (default: `true`) — Wrap the matching substring of each option in `<mark>` — the label of a
|
|
377
373
|
plain option, the title and description of a rich one.
|
|
374
|
+
- **label**: `string` — Accessible label for the input.
|
|
375
|
+
- **placeholder**: `string` — Placeholder text in the input.
|
|
378
376
|
- **placement**: `Placement` (default: `'bottom-start'`) — Panel placement relative to the control.
|
|
379
|
-
- **
|
|
377
|
+
- **size**: `ComboboxSize` (default: `'md'`) — Control size.
|
|
378
|
+
- **value**: `string` — Selected value (the chosen option's `value`).
|
|
379
|
+
- **with-clear**: `boolean` (default: `false`) — Show a button to clear the value.
|
|
380
380
|
|
|
381
381
|
### Events
|
|
382
382
|
|
|
383
|
-
- **change** — Fired when an option is selected. Bubbles. Not cancelable. Properties: `value: string`.
|
|
384
|
-
- **input** — Fired as the user types. Bubbles. Not cancelable. Properties: `value: string` (the query).
|
|
385
383
|
- **show** (cancelable) — Fired before the list opens. Cancelable.
|
|
386
384
|
- **hide** (cancelable) — Fired before the list closes. Cancelable.
|
|
385
|
+
- **change** — Fired when an option is selected. Bubbles. Not cancelable. Properties: `value: string`.
|
|
386
|
+
- **input** — Fired as the user types. Bubbles. Not cancelable. Properties: `value: string` (the query).
|
|
387
387
|
|
|
388
388
|
### CSS parts
|
|
389
389
|
|
|
390
390
|
- `base` — The host wrapper.
|
|
391
391
|
- `control` — The input control row (input + clear + chevron).
|
|
392
|
+
- `empty` — The "no results" message.
|
|
392
393
|
- `input` — The text input.
|
|
393
|
-
- `panel` — The floating popover panel.
|
|
394
394
|
- `listbox` — The options container.
|
|
395
395
|
- `option` — Each option row.
|
|
396
|
-
- `
|
|
396
|
+
- `panel` — The floating popover panel.
|
|
397
397
|
|
|
398
398
|
### CSS classes
|
|
399
399
|
|
|
400
|
+
- `.l-select-item-description` — Rich option: secondary line, shown in the listbox only.
|
|
400
401
|
- `.l-select-item-media` — Rich option: leading image or icon.
|
|
402
|
+
- `.l-select-item-suffix` — Rich option: trailing badge, count or status icon on the title's line. Kept out of the input and the filter.
|
|
401
403
|
- `.l-select-item-text` — Rich option: column holding the title and the description.
|
|
402
404
|
- `.l-select-item-title` — Rich option: title, truncated with an ellipsis. Used as the label when the option has no `label`.
|
|
403
|
-
- `.l-select-item-description` — Rich option: secondary line, shown in the listbox only.
|
|
404
|
-
- `.l-select-item-suffix` — Rich option: trailing badge, count or status icon on the title's line. Kept out of the input and the filter.
|
|
405
405
|
|
|
406
406
|
### CSS custom properties
|
|
407
407
|
|
|
408
|
-
- `--
|
|
409
|
-
- `--
|
|
408
|
+
- `--background` — Panel background.
|
|
409
|
+
- `--border-radius` — Control + panel radius.
|
|
410
410
|
- `--chevron-icon` — Chevron glyph as a `url()`. Masked, so its color comes from the control, not the image.
|
|
411
411
|
- `--clear-icon` — Clear button glyph as a `url()`.
|
|
412
|
-
- `--
|
|
413
|
-
- `--
|
|
412
|
+
- `--height` (default: `var(--l-form-control-height)`) — Control height. The clear button and the chevron each take a square of this height (borders excluded), so their hit area and spacing follow it.
|
|
413
|
+
- `--l-form-control-icon-size` (default: `1em`) — Glyph size of the clear button and the chevron (global form-control token; set it here or on any ancestor). Changes the glyph only — the hit area follows `--height`.
|