luxen-ui 0.6.2 → 0.8.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/bin/cli.mjs +54 -10
- package/cdn/chunks/decorate.js +1 -1
- package/cdn/chunks/floating-ui.dom.js +2 -0
- package/cdn/chunks/floating-ui.dom.js.map +1 -0
- package/cdn/chunks/lit-html.js +3 -0
- package/cdn/chunks/lit-html.js.map +1 -0
- package/cdn/chunks/lit.js +1 -2
- package/cdn/chunks/lit.js.map +1 -1
- package/cdn/chunks/module.js +717 -0
- package/cdn/chunks/module.js.map +1 -0
- package/cdn/chunks/native.js +2 -0
- package/cdn/chunks/native.js.map +1 -0
- package/cdn/chunks/static-html.js +2 -0
- package/cdn/chunks/static-html.js.map +1 -0
- package/cdn/custom-elements.json +1412 -12629
- package/cdn/elements/avatar/avatar.d.ts +5 -0
- package/cdn/elements/avatar/avatar.d.ts.map +1 -1
- package/cdn/elements/avatar/avatar.js +5 -5
- package/cdn/elements/avatar/avatar.js.map +1 -1
- package/cdn/elements/button/button.meta.d.ts +33 -0
- package/cdn/elements/button/button.meta.d.ts.map +1 -0
- package/cdn/elements/button/button.meta.js +0 -0
- package/cdn/elements/carousel/carousel.d.ts +6 -0
- package/cdn/elements/carousel/carousel.d.ts.map +1 -1
- package/cdn/elements/carousel/carousel.js +1 -1
- package/cdn/elements/carousel/carousel.js.map +1 -1
- package/cdn/elements/carousel-item/carousel-item.d.ts +2 -0
- package/cdn/elements/carousel-item/carousel-item.d.ts.map +1 -1
- package/cdn/elements/carousel-item/carousel-item.js +1 -1
- package/cdn/elements/carousel-item/carousel-item.js.map +1 -1
- package/cdn/elements/close-button/close-button.meta.d.ts +24 -0
- package/cdn/elements/close-button/close-button.meta.d.ts.map +1 -0
- package/cdn/elements/close-button/close-button.meta.js +0 -0
- package/cdn/elements/dialog/dialog.d.ts +12 -6
- package/cdn/elements/dialog/dialog.d.ts.map +1 -1
- package/cdn/elements/dialog/dialog.js +8 -5
- 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/disclosure/disclosure.meta.d.ts +28 -0
- package/cdn/elements/disclosure/disclosure.meta.d.ts.map +1 -0
- package/cdn/elements/disclosure/disclosure.meta.js +0 -0
- package/cdn/elements/divider/divider.d.ts +1 -1
- package/cdn/elements/divider/divider.js.map +1 -1
- package/cdn/elements/drawer/drawer.d.ts +5 -0
- package/cdn/elements/drawer/drawer.d.ts.map +1 -1
- package/cdn/elements/drawer/drawer.js +1 -1
- package/cdn/elements/drawer/drawer.js.map +1 -1
- package/cdn/elements/dropdown/dropdown.d.ts +2 -0
- package/cdn/elements/dropdown/dropdown.d.ts.map +1 -1
- package/cdn/elements/dropdown/dropdown.js +1 -1
- package/cdn/elements/dropdown/dropdown.js.map +1 -1
- package/cdn/elements/dropdown-item/dropdown-item.d.ts +2 -0
- package/cdn/elements/dropdown-item/dropdown-item.d.ts.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/icon/icon.js +1 -1
- package/cdn/elements/icon/icon.js.map +1 -1
- package/cdn/elements/input-otp/input-otp.d.ts +2 -0
- package/cdn/elements/input-otp/input-otp.d.ts.map +1 -1
- package/cdn/elements/input-otp/input-otp.js.map +1 -1
- package/cdn/elements/input-stepper/input-stepper.d.ts +2 -0
- package/cdn/elements/input-stepper/input-stepper.d.ts.map +1 -1
- package/cdn/elements/input-stepper/input-stepper.js +1 -1
- package/cdn/elements/input-stepper/input-stepper.js.map +1 -1
- package/cdn/elements/kbd/kbd.meta.d.ts +14 -0
- package/cdn/elements/kbd/kbd.meta.d.ts.map +1 -0
- package/cdn/elements/kbd/kbd.meta.js +0 -0
- package/cdn/elements/popover/popover.js +1 -1
- package/cdn/elements/popover/popover.js.map +1 -1
- package/cdn/elements/progress/progress.meta.d.ts +22 -0
- package/cdn/elements/progress/progress.meta.d.ts.map +1 -0
- package/cdn/elements/progress/progress.meta.js +0 -0
- package/cdn/elements/prose-editor/index.d.ts +2 -0
- package/cdn/elements/prose-editor/index.d.ts.map +1 -0
- package/cdn/elements/prose-editor/index.js +2 -0
- package/cdn/elements/prose-editor/index.js.map +1 -0
- package/cdn/elements/prose-editor/prose-editor.d.ts +113 -0
- package/cdn/elements/prose-editor/prose-editor.d.ts.map +1 -0
- package/cdn/elements/prose-editor/prose-editor.js +180 -0
- package/cdn/elements/prose-editor/prose-editor.js.map +1 -0
- package/cdn/elements/rating/rating.d.ts +2 -0
- package/cdn/elements/rating/rating.d.ts.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.meta.d.ts +28 -0
- package/cdn/elements/select/select.meta.d.ts.map +1 -0
- package/cdn/elements/select/select.meta.js +0 -0
- package/cdn/elements/skeleton/skeleton.d.ts +3 -0
- package/cdn/elements/skeleton/skeleton.d.ts.map +1 -1
- package/cdn/elements/skeleton/skeleton.js.map +1 -1
- package/cdn/elements/spinner/spinner.js +1 -1
- package/cdn/elements/spinner/spinner.js.map +1 -1
- package/cdn/elements/sticky-bar/sticky-bar.js +1 -1
- package/cdn/elements/sticky-bar/sticky-bar.js.map +1 -1
- package/cdn/elements/stories-viewer/stories-viewer.d.ts +1 -1
- package/cdn/elements/stories-viewer/stories-viewer.d.ts.map +1 -1
- package/cdn/elements/stories-viewer/stories-viewer.js +26 -26
- package/cdn/elements/stories-viewer/stories-viewer.js.map +1 -1
- package/cdn/elements/story/story.d.ts +10 -1
- package/cdn/elements/story/story.d.ts.map +1 -1
- package/cdn/elements/story/story.js +20 -20
- package/cdn/elements/story/story.js.map +1 -1
- package/cdn/elements/toast/toast.d.ts +5 -0
- package/cdn/elements/toast/toast.d.ts.map +1 -1
- package/cdn/elements/toast/toast.js.map +1 -1
- package/cdn/elements/tooltip/tooltip.js +1 -1
- package/cdn/elements/tooltip/tooltip.js.map +1 -1
- package/cdn/elements/tree/tree.d.ts +2 -0
- package/cdn/elements/tree/tree.d.ts.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.d.ts +2 -0
- package/cdn/elements/tree-item/tree-item.d.ts.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/registry.d.ts +1 -1
- package/cdn/registry.d.ts.map +1 -1
- package/cdn/registry.js.map +1 -1
- package/cdn/shared/controllers/has-slot-controller.d.ts +37 -0
- package/cdn/shared/controllers/has-slot-controller.d.ts.map +1 -0
- package/cdn/shared/controllers/has-slot-controller.js +2 -0
- package/cdn/shared/controllers/has-slot-controller.js.map +1 -0
- package/cdn/shared/controllers/popover.js +1 -1
- package/cdn/shared/controllers/popover.js.map +1 -1
- package/cdn/shared/styles/host.styles.js +1 -1
- package/cdn/standalone.css +132 -1
- package/cdn/standalone.js +25743 -191
- package/cdn/standalone.js.map +1 -1
- package/cdn/static-tag.d.ts +17 -0
- package/cdn/static-tag.d.ts.map +1 -0
- package/cdn/static-tag.js +2 -0
- package/cdn/static-tag.js.map +1 -0
- package/cdn/styles/elements/prose-editor.css +129 -0
- package/cdn/styles/elements/toast.css +1 -1
- package/dist/css/elements/prose-editor.css +129 -0
- package/dist/css/elements/toast.css +1 -1
- package/dist/custom-elements.json +1412 -12629
- package/dist/elements/avatar/avatar.d.ts +5 -0
- package/dist/elements/avatar/avatar.d.ts.map +1 -1
- package/dist/elements/avatar/avatar.js +5 -0
- package/dist/elements/button/button.meta.d.ts +33 -0
- package/dist/elements/button/button.meta.d.ts.map +1 -0
- package/dist/elements/button/button.meta.js +44 -0
- package/dist/elements/carousel/carousel.d.ts +6 -0
- package/dist/elements/carousel/carousel.d.ts.map +1 -1
- package/dist/elements/carousel/carousel.js +6 -0
- package/dist/elements/carousel-item/carousel-item.d.ts +2 -0
- package/dist/elements/carousel-item/carousel-item.d.ts.map +1 -1
- package/dist/elements/carousel-item/carousel-item.js +2 -0
- package/dist/elements/close-button/close-button.meta.d.ts +24 -0
- package/dist/elements/close-button/close-button.meta.d.ts.map +1 -0
- package/dist/elements/close-button/close-button.meta.js +30 -0
- package/dist/elements/dialog/dialog.css +15 -0
- package/dist/elements/dialog/dialog.d.ts +12 -6
- package/dist/elements/dialog/dialog.d.ts.map +1 -1
- package/dist/elements/dialog/dialog.js +21 -7
- package/dist/elements/disclosure/disclosure.meta.d.ts +28 -0
- package/dist/elements/disclosure/disclosure.meta.d.ts.map +1 -0
- package/dist/elements/disclosure/disclosure.meta.js +34 -0
- package/dist/elements/divider/divider.d.ts +1 -1
- package/dist/elements/divider/divider.js +1 -1
- package/dist/elements/drawer/drawer.d.ts +5 -0
- package/dist/elements/drawer/drawer.d.ts.map +1 -1
- package/dist/elements/drawer/drawer.js +5 -0
- package/dist/elements/dropdown/dropdown.d.ts +2 -0
- package/dist/elements/dropdown/dropdown.d.ts.map +1 -1
- package/dist/elements/dropdown/dropdown.js +2 -0
- package/dist/elements/dropdown-item/dropdown-item.d.ts +2 -0
- package/dist/elements/dropdown-item/dropdown-item.d.ts.map +1 -1
- package/dist/elements/dropdown-item/dropdown-item.js +2 -0
- package/dist/elements/input-otp/input-otp.d.ts +2 -0
- package/dist/elements/input-otp/input-otp.d.ts.map +1 -1
- package/dist/elements/input-otp/input-otp.js +2 -0
- package/dist/elements/input-stepper/input-stepper.d.ts +2 -0
- package/dist/elements/input-stepper/input-stepper.d.ts.map +1 -1
- package/dist/elements/input-stepper/input-stepper.js +5 -1
- package/dist/elements/kbd/kbd.meta.d.ts +14 -0
- package/dist/elements/kbd/kbd.meta.d.ts.map +1 -0
- package/dist/elements/kbd/kbd.meta.js +20 -0
- package/dist/elements/progress/progress.meta.d.ts +22 -0
- package/dist/elements/progress/progress.meta.d.ts.map +1 -0
- package/dist/elements/progress/progress.meta.js +28 -0
- package/dist/elements/prose-editor/index.d.ts +2 -0
- package/dist/elements/prose-editor/index.d.ts.map +1 -0
- package/dist/elements/prose-editor/index.js +4 -0
- package/dist/elements/prose-editor/prose-editor.css +133 -0
- package/dist/elements/prose-editor/prose-editor.d.ts +114 -0
- package/dist/elements/prose-editor/prose-editor.d.ts.map +1 -0
- package/dist/elements/prose-editor/prose-editor.js +481 -0
- package/dist/elements/rating/rating.d.ts +2 -0
- package/dist/elements/rating/rating.d.ts.map +1 -1
- package/dist/elements/rating/rating.js +2 -0
- package/dist/elements/select/select.meta.d.ts +28 -0
- package/dist/elements/select/select.meta.d.ts.map +1 -0
- package/dist/elements/select/select.meta.js +34 -0
- package/dist/elements/skeleton/skeleton.d.ts +3 -0
- package/dist/elements/skeleton/skeleton.d.ts.map +1 -1
- package/dist/elements/skeleton/skeleton.js +3 -0
- package/dist/elements/stories-viewer/stories-viewer.d.ts +1 -1
- package/dist/elements/stories-viewer/stories-viewer.d.ts.map +1 -1
- package/dist/elements/stories-viewer/stories-viewer.js +23 -19
- package/dist/elements/story/story.d.ts +10 -1
- package/dist/elements/story/story.d.ts.map +1 -1
- package/dist/elements/story/story.js +29 -17
- package/dist/elements/toast/toast.d.ts +5 -0
- package/dist/elements/toast/toast.d.ts.map +1 -1
- package/dist/elements/toast/toast.js +5 -0
- package/dist/elements/tree/tree.d.ts +2 -0
- package/dist/elements/tree/tree.d.ts.map +1 -1
- package/dist/elements/tree/tree.js +2 -0
- package/dist/elements/tree-item/tree-item.d.ts +2 -0
- package/dist/elements/tree-item/tree-item.d.ts.map +1 -1
- package/dist/elements/tree-item/tree-item.js +2 -0
- package/dist/metadata/avatar.json +83 -0
- package/dist/metadata/badge.json +59 -0
- package/dist/metadata/button.json +138 -0
- package/dist/metadata/carousel-item.json +32 -0
- package/dist/metadata/carousel.json +388 -0
- package/dist/metadata/close-button.json +90 -0
- package/dist/metadata/dialog.json +163 -0
- package/dist/metadata/disclosure.json +88 -0
- package/dist/metadata/divider.json +65 -0
- package/dist/metadata/drawer.json +176 -0
- package/dist/metadata/dropdown-item.json +85 -0
- package/dist/metadata/dropdown.json +157 -0
- package/dist/metadata/icon.json +49 -0
- package/dist/metadata/index.json +4062 -0
- package/dist/metadata/input-otp.json +86 -0
- package/dist/metadata/input-stepper.json +122 -0
- package/dist/metadata/kbd.json +37 -0
- package/dist/metadata/popover.json +157 -0
- package/dist/metadata/progress.json +71 -0
- package/dist/metadata/prose-editor.json +365 -0
- package/dist/metadata/rating.json +126 -0
- package/dist/metadata/select.json +82 -0
- package/dist/metadata/skeleton.json +56 -0
- package/dist/metadata/spinner.json +47 -0
- package/dist/metadata/sticky-bar.json +93 -0
- package/dist/metadata/stories-viewer.json +316 -0
- package/dist/metadata/stories.json +109 -0
- package/dist/metadata/story.json +148 -0
- package/dist/metadata/tabs.json +74 -0
- package/dist/metadata/toast.json +122 -0
- package/dist/metadata/tooltip.json +144 -0
- package/dist/metadata/tree-item.json +199 -0
- package/dist/metadata/tree.json +130 -0
- package/dist/registry.d.ts +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/shared/controllers/has-slot-controller.d.ts +37 -0
- package/dist/shared/controllers/has-slot-controller.d.ts.map +1 -0
- package/dist/shared/controllers/has-slot-controller.js +66 -0
- package/dist/static-tag.d.ts +17 -0
- package/dist/static-tag.d.ts.map +1 -0
- package/dist/static-tag.js +22 -0
- package/dist/templates/elements/avatar.md +21 -24
- package/dist/templates/elements/badge.md +9 -15
- package/dist/templates/elements/button.md +31 -41
- package/dist/templates/elements/close-button.md +24 -36
- package/dist/templates/elements/dialog.md +73 -54
- package/dist/templates/elements/drawer.md +39 -52
- package/dist/templates/elements/progress.md +13 -23
- package/dist/templates/elements/prose-editor.md +211 -0
- package/dist/templates/elements/select.md +20 -31
- package/dist/templates/elements/sticky-bar.md +16 -60
- package/dist/templates/elements/toast.md +33 -53
- package/dist/templates/elements/tree.md +39 -67
- package/elements.json +46 -1
- package/package.json +13 -3
- package/templates/SKILL.md.tpl +5 -1
|
@@ -6,10 +6,7 @@ outline: deep
|
|
|
6
6
|
|
|
7
7
|
Selects are used to pick a single option from a dropdown list. Commonly used in forms for choosing categories, countries, or any predefined set of values.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
tag="select"
|
|
11
|
-
type="native"
|
|
12
|
-
/>
|
|
9
|
+
**`.l-select`** — Native HTML Element
|
|
13
10
|
|
|
14
11
|
## Options
|
|
15
12
|
|
|
@@ -44,26 +41,23 @@ Selects are used to pick a single option from a dropdown list. Commonly used in
|
|
|
44
41
|
|
|
45
42
|
### Criteria
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
| Disabled state | Native `disabled` attribute prevents interaction and announces as disabled |
|
|
52
|
-
| Required state | Native `required` attribute communicates mandatory field to assistive tech |
|
|
44
|
+
- **Role** — Uses native `<select>` — built-in `combobox`/`listbox` semantics
|
|
45
|
+
- **Accessible name** — Must have an associated `<label>` element
|
|
46
|
+
- **Disabled state** — Native `disabled` attribute prevents interaction and announces as disabled
|
|
47
|
+
- **Required state** — Native `required` attribute communicates mandatory field to assistive tech
|
|
53
48
|
|
|
54
49
|
### Rules
|
|
50
|
+
|
|
55
51
|
- Always pair the `<select>` with a visible `<label>` element using `for`/`id`
|
|
56
52
|
- Use native `<option>` elements for choices — the browser handles all ARIA semantics
|
|
57
53
|
|
|
58
54
|
### Keyboard interactions
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
| ArrowUp | Moves to the previous option |
|
|
66
|
-
| Tab | Moves focus to the next focusable element |
|
|
56
|
+
- `Enter` — Opens the option list or confirms selection
|
|
57
|
+
- `Space` — Opens the option list
|
|
58
|
+
- `ArrowDown` — Moves to the next option
|
|
59
|
+
- `ArrowUp` — Moves to the previous option
|
|
60
|
+
- `Tab` — Moves focus to the next focusable element
|
|
67
61
|
|
|
68
62
|
## API reference
|
|
69
63
|
|
|
@@ -75,26 +69,21 @@ Selects are used to pick a single option from a dropdown list. Commonly used in
|
|
|
75
69
|
|
|
76
70
|
### Attributes & Properties
|
|
77
71
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{ Attribute: 'multiple', Description: 'Allows multiple selections' },
|
|
82
|
-
]" />
|
|
72
|
+
- **disabled** — Disables the select.
|
|
73
|
+
- **required** — Marks the field as required.
|
|
74
|
+
- **multiple** — Allows multiple selections.
|
|
83
75
|
|
|
84
76
|
### Events
|
|
85
77
|
|
|
86
|
-
|
|
78
|
+
- **change** — Fires when an option is selected.
|
|
79
|
+
- **input** — Fires when the value changes.
|
|
87
80
|
|
|
88
81
|
### CSS classes
|
|
89
82
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{ Class: '.l-select-item', Description: 'Option styling with checkmark indicator' },
|
|
93
|
-
]" />
|
|
83
|
+
- `.l-select` — Base select element with `appearance: base-select`.
|
|
84
|
+
- `.l-select-item` — Option styling with checkmark indicator.
|
|
94
85
|
|
|
95
86
|
### CSS custom properties
|
|
96
87
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
{ Name: '--border-color', Description: 'Border color (adapts to light/dark)' },
|
|
100
|
-
]" />
|
|
88
|
+
- `--border-radius` (default: `4px`) — Border radius.
|
|
89
|
+
- `--border-color` — Border color (adapts to light/dark).
|
|
@@ -2,48 +2,13 @@
|
|
|
2
2
|
outline: deep
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
<style scoped>
|
|
6
|
-
.phone-deck {
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-wrap: wrap;
|
|
9
|
-
gap: 24px;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
padding: 24px 0;
|
|
12
|
-
}
|
|
13
|
-
.phone {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
align-items: center;
|
|
17
|
-
gap: 8px;
|
|
18
|
-
}
|
|
19
|
-
.phone .label {
|
|
20
|
-
font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
|
|
21
|
-
font-size: 11px;
|
|
22
|
-
font-weight: 500;
|
|
23
|
-
text-transform: uppercase;
|
|
24
|
-
letter-spacing: 0.06em;
|
|
25
|
-
color: var(--vp-c-text-2);
|
|
26
|
-
}
|
|
27
|
-
.phone iframe {
|
|
28
|
-
width: 340px;
|
|
29
|
-
height: 640px;
|
|
30
|
-
border: 10px solid #18181b;
|
|
31
|
-
border-radius: 40px;
|
|
32
|
-
background: var(--vp-c-bg);
|
|
33
|
-
box-shadow: 0 24px 48px -12px rgb(0 0 0 / 0.25);
|
|
34
|
-
}
|
|
35
|
-
</style>
|
|
36
|
-
|
|
37
5
|
# Sticky Bar
|
|
38
6
|
|
|
39
7
|
A bar docked to the viewport edge, painted in the document's **top layer**. Pass `for="<id>"` to track an element; the bar reveals when that element scrolls out of view (e.g. an Add to cart button on a mobile product page). Omit `for` for a permanently visible bar.
|
|
40
8
|
|
|
41
9
|
Common use cases: mobile product Add to cart, sticky save action on long forms, post-form newsletter signup, cookie banners, environment indicators, promo announcements.
|
|
42
10
|
|
|
43
|
-
|
|
44
|
-
tag="l-sticky-bar"
|
|
45
|
-
type="shadow"
|
|
46
|
-
/>
|
|
11
|
+
**`<l-sticky-bar>`** — Custom Element · Shadow DOM
|
|
47
12
|
|
|
48
13
|
## Examples
|
|
49
14
|
|
|
@@ -95,13 +60,12 @@ Both demos start with the bar **revealed** (the Add to cart button sits below th
|
|
|
95
60
|
|
|
96
61
|
The element is a positioning shell — it adds no role of its own. Slotted content keeps its native semantics: a `<button>` stays a button, a `<form>` stays a form, links remain in the focus order.
|
|
97
62
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
| Focus order | Slotted content stays in the natural focus order. Do not focus-trap inside the bar — it is not a dialog |
|
|
102
|
-
| Contrast | The bar inherits text and background from slotted content — apply your own contrast tokens |
|
|
63
|
+
- **Motion** — Respects `prefers-reduced-motion` — the slide animation collapses to instant
|
|
64
|
+
- **Focus order** — Slotted content stays in the natural focus order. Do not focus-trap inside the bar — it is not a dialog
|
|
65
|
+
- **Contrast** — The bar inherits text and background from slotted content — apply your own contrast tokens
|
|
103
66
|
|
|
104
67
|
### Rules
|
|
68
|
+
|
|
105
69
|
- Keep the bar action self-explanatory (e.g. duplicate the in-page button label, do not introduce a new verb)
|
|
106
70
|
- Use `--offset` to clear a sticky header when `placement="top"` to avoid overlap
|
|
107
71
|
- Do not nest live regions or modal-like behavior inside the bar
|
|
@@ -116,33 +80,25 @@ import 'luxen-ui/sticky-bar';
|
|
|
116
80
|
|
|
117
81
|
### Attributes & Properties
|
|
118
82
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
{ Attribute: 'root', Description: 'HTML id of the scrolling ancestor used as the IntersectionObserver root. Omit to use the viewport. Useful for nested scroll containers' },
|
|
123
|
-
]" />
|
|
83
|
+
- **for**: `string` — HTML id of the element to track. When that element leaves the viewport, the bar reveals. Omit for a permanently visible bar.
|
|
84
|
+
- **root**: `string` — HTML id of the scrolling ancestor used as the IntersectionObserver root. Omit to use the viewport. Useful for nested scroll containers (CMS preview panes, modals).
|
|
85
|
+
- **placement**: `'bottom' | 'top'` (default: `'bottom'`) — Edge to dock against.
|
|
124
86
|
|
|
125
87
|
### Events
|
|
126
88
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
{ Event: 'after-hide', Description: 'Fired after the hide animation completes' },
|
|
132
|
-
]" />
|
|
89
|
+
- **show** (cancelable) — Fired before the bar reveals. Cancelable.
|
|
90
|
+
- **after-show** — Fired after the reveal animation completes.
|
|
91
|
+
- **hide** (cancelable) — Fired before the bar hides. Cancelable.
|
|
92
|
+
- **after-hide** — Fired after the hide animation completes.
|
|
133
93
|
|
|
134
94
|
### Slots
|
|
135
95
|
|
|
136
|
-
|
|
137
|
-
{ Slot: '(default)', Description: 'Bar content. Owns its own background, padding, and typography' },
|
|
138
|
-
]" />
|
|
96
|
+
- **(default)** — Bar content. Owns its own background, padding, and typography.
|
|
139
97
|
|
|
140
98
|
### CSS custom properties
|
|
141
99
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
{ Name: '--offset', Description: 'Distance from the active edge. Default `0px`. Use to clear a sticky header when `placement="top"`' },
|
|
146
|
-
]" />
|
|
100
|
+
- `--show-duration` (default: `200ms`) — Reveal animation duration.
|
|
101
|
+
- `--hide-duration` (default: `200ms`) — Dismiss animation duration.
|
|
102
|
+
- `--offset` (default: `0px`) — Distance from the active edge. Use to clear a sticky header when `placement="top"`.
|
|
147
103
|
|
|
148
104
|
> **Top layer.** The bar uses `popover="manual"` internally, so it paints in the document's top layer — `z-index` is not needed and would be ignored. Target `l-sticky-bar:popover-open` to style the revealed state.
|
|
@@ -6,10 +6,7 @@ outline: deep
|
|
|
6
6
|
|
|
7
7
|
Toasts are used to display brief, non-blocking notifications that auto-dismiss. Commonly used to confirm actions, report errors, or surface system messages without interrupting the user's workflow.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
tag="l-toast"
|
|
11
|
-
type="custom"
|
|
12
|
-
/>
|
|
9
|
+
**`<l-toast>`** — Custom Element (no Shadow DOM)
|
|
13
10
|
|
|
14
11
|
## Options
|
|
15
12
|
|
|
@@ -299,16 +296,15 @@ toast({
|
|
|
299
296
|
|
|
300
297
|
### Criteria
|
|
301
298
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
| Timer pausing | Timer pauses on hover and focus, providing keyboard parity |
|
|
309
|
-
| Motion | Respects `prefers-reduced-motion` |
|
|
299
|
+
- **Live region** — Container uses `role="log"` with `aria-live="polite"` for screen reader announcements
|
|
300
|
+
- **Role** — Items use `role="status"` (`role="alert"` for `danger` variant)
|
|
301
|
+
- **Accessible name** — Heading and message linked via `aria-labelledby` / `aria-describedby`
|
|
302
|
+
- **Decorative elements** — Icons, accent bar, and timer bar are hidden with `aria-hidden="true"`
|
|
303
|
+
- **Timer pausing** — Timer pauses on hover and focus, providing keyboard parity
|
|
304
|
+
- **Motion** — Respects `prefers-reduced-motion`
|
|
310
305
|
|
|
311
306
|
### Rules
|
|
307
|
+
|
|
312
308
|
- Keep messages short and readable within the auto-dismiss duration
|
|
313
309
|
- Set `duration` to `5000` or longer for readability
|
|
314
310
|
- Use `variant="danger"` for critical alerts — it promotes the toast to `role="alert"`
|
|
@@ -317,10 +313,8 @@ toast({
|
|
|
317
313
|
|
|
318
314
|
### Keyboard interactions
|
|
319
315
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
| Escape | Dismisses the most recent toast |
|
|
323
|
-
| Tab | Moves focus into the toast (pauses the auto-dismiss timer) |
|
|
316
|
+
- `Escape` — Dismisses the most recent toast
|
|
317
|
+
- `Tab` — Moves focus into the toast (pauses the auto-dismiss timer)
|
|
324
318
|
|
|
325
319
|
## API reference
|
|
326
320
|
|
|
@@ -342,55 +336,41 @@ toast({ text: 'Hello!' });
|
|
|
342
336
|
|
|
343
337
|
### Attributes & Properties
|
|
344
338
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
{ Attribute: 'variant', Description: 'Default variant for toast items: `info`, `success`, `warning`, `danger`' },
|
|
349
|
-
]" />
|
|
339
|
+
- **placement**: `ToastPlacement` (default: `'top-end'`) — Position of the toast stack on the screen.
|
|
340
|
+
- **duration**: `number` (default: `5000`) — Default auto-dismiss delay in milliseconds. 0 disables auto-dismiss.
|
|
341
|
+
- **variant**: `ToastVariant | undefined` — Default variant for toast items: `info`, `success`, `warning`, `danger`.
|
|
350
342
|
|
|
351
343
|
### Methods
|
|
352
344
|
|
|
353
|
-
|
|
354
|
-
{ Method: 'toast()', Arguments: '`options: ToastOptions`', Returns: '`HTMLElement`', Description: 'Creates and shows a toast notification' },
|
|
355
|
-
]" />
|
|
345
|
+
- **toast(options: ToastOptions)** → `HTMLElement` — Create and show a toast notification.
|
|
356
346
|
|
|
357
347
|
### ToastOptions
|
|
358
348
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
{ Property: 'timer', Type: '`boolean`', Default: '`false`', Description: 'Show a countdown progress bar at the bottom' },
|
|
367
|
-
]" />
|
|
349
|
+
- **text**: `string` — The message text to display. Required unless `html` is provided
|
|
350
|
+
- **html**: `string` — HTML content for the message, sanitized via the [Sanitizer API](https://developer.mozilla.org/en-US/docs/Web/API/HTML_Sanitizer_API). Ignored if `text` is provided
|
|
351
|
+
- **heading**: `string` — Heading text displayed above the message
|
|
352
|
+
- **icon**: `string` — Iconify icon name (e.g. `lucide:check`). Replaces the accent bar, colored by variant
|
|
353
|
+
- **variant**: `string` (default: Element's `variant`) — Override variant for this toast
|
|
354
|
+
- **duration**: `number` (default: Element's `duration`) — Override auto-dismiss delay in ms. `0` or `Infinity` to keep open until dismissed
|
|
355
|
+
- **timer**: `boolean` (default: `false`) — Show a countdown progress bar at the bottom
|
|
368
356
|
|
|
369
357
|
### Events
|
|
370
358
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
{ Event: 'l-after-hide', Detail: '`{ toast }`', Description: 'Emitted after the hide animation completes and toast is removed' },
|
|
376
|
-
]" />
|
|
359
|
+
- **show** (cancelable) — Emitted when a toast begins to show. Cancelable.
|
|
360
|
+
- **after-show** — Emitted after the show animation completes.
|
|
361
|
+
- **hide** (cancelable) — Emitted when a toast begins to hide. Cancelable.
|
|
362
|
+
- **after-hide** — Emitted after the hide animation completes and toast is removed.
|
|
377
363
|
|
|
378
364
|
### CSS classes
|
|
379
365
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
{ Class: '.l-toast-heading', Description: 'Heading text' },
|
|
385
|
-
{ Class: '.l-toast-message', Description: 'Message text' },
|
|
386
|
-
{ Class: '.l-toast-timer', Description: 'Countdown progress bar (auto-added for timed toasts)' },
|
|
387
|
-
]" />
|
|
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
|
+
- `.l-toast-content` — The content column wrapping the heading and message.
|
|
369
|
+
- `.l-toast-timer` — The countdown progress bar (for timed toasts).
|
|
388
370
|
|
|
389
371
|
### CSS custom properties
|
|
390
372
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
{ Property: '--hide-duration', Description: 'Hide animation duration. Default `200ms`' },
|
|
396
|
-
]" />
|
|
373
|
+
- `--gap` — Gap between stacked toast items.
|
|
374
|
+
- `--width` — Width of the toast stack.
|
|
375
|
+
- `--show-duration` — Duration of the show animation.
|
|
376
|
+
- `--hide-duration` — Duration of the hide animation.
|
|
@@ -6,10 +6,7 @@ outline: deep
|
|
|
6
6
|
|
|
7
7
|
Tree views present hierarchical data like file explorers, navigation menus, and taxonomies. Each node expands/collapses to reveal nested items and can be selected in several ways.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
tag="l-tree"
|
|
11
|
-
type="shadow"
|
|
12
|
-
/>
|
|
9
|
+
**`<l-tree>`** — Custom Element · Shadow DOM
|
|
13
10
|
|
|
14
11
|
## Options
|
|
15
12
|
|
|
@@ -17,8 +14,6 @@ Tree views present hierarchical data like file explorers, navigation menus, and
|
|
|
17
14
|
|
|
18
15
|
Wrap `<l-tree-item>` nodes inside `<l-tree>`. Nested `<l-tree-item>` children become sub-nodes automatically.
|
|
19
16
|
|
|
20
|
-
<ComponentWrapper vertical :html="treeBasic" />
|
|
21
|
-
|
|
22
17
|
```html
|
|
23
18
|
<l-tree>
|
|
24
19
|
<l-tree-item>
|
|
@@ -47,8 +42,6 @@ Wrap `<l-tree-item>` nodes inside `<l-tree>`. Nested `<l-tree-item>` children be
|
|
|
47
42
|
|
|
48
43
|
Place any element in the `prefix` slot to render a leading icon before the label. Icons inherit the current text color.
|
|
49
44
|
|
|
50
|
-
<ComponentWrapper vertical :html="treeIcons" />
|
|
51
|
-
|
|
52
45
|
```html
|
|
53
46
|
<l-tree>
|
|
54
47
|
<l-tree-item expanded>
|
|
@@ -114,8 +107,6 @@ Place any element in the `prefix` slot to render a leading icon before the label
|
|
|
114
107
|
|
|
115
108
|
Override the `expand-icon` and `collapse-icon` slots to show a different icon per state — e.g. a closed folder when the branch is collapsed and an open folder when expanded. Leaves keep the `prefix` slot for their own icon.
|
|
116
109
|
|
|
117
|
-
<ComponentWrapper vertical :html="treeExpandIcons" />
|
|
118
|
-
|
|
119
110
|
```html
|
|
120
111
|
<l-tree>
|
|
121
112
|
<l-tree-item expanded>
|
|
@@ -177,14 +168,10 @@ Place any interactive element inside a `<l-tree-item>` to expose per-row actions
|
|
|
177
168
|
|
|
178
169
|
This demo is controlled from Vue state: the yellow `…` trigger is rendered only on the selected row via `v-if`, so clicking another row moves the button there without duplicating it in the DOM.
|
|
179
170
|
|
|
180
|
-
<TreeActionsDemo />
|
|
181
|
-
|
|
182
171
|
### Multiple selection
|
|
183
172
|
|
|
184
173
|
Set `selection="multiple"` to render a native checkbox on every item. Toggling a parent cascades the selection to its descendants and sets the indeterminate state when only some children are selected.
|
|
185
174
|
|
|
186
|
-
<ComponentWrapper vertical :html="treeMultiple" />
|
|
187
|
-
|
|
188
175
|
```html
|
|
189
176
|
<l-tree selection="multiple">
|
|
190
177
|
<l-tree-item expanded>
|
|
@@ -205,8 +192,6 @@ Set `selection="multiple"` to render a native checkbox on every item. Toggling a
|
|
|
205
192
|
|
|
206
193
|
Add `independent` to decouple parents and children: a parent can be selected without ticking any of its descendants and vice-versa. Useful when nodes represent independent concepts (categories, tags, permissions) rather than aggregations.
|
|
207
194
|
|
|
208
|
-
<ComponentWrapper vertical :html="treeIndependent" />
|
|
209
|
-
|
|
210
195
|
```html
|
|
211
196
|
<l-tree
|
|
212
197
|
selection="multiple"
|
|
@@ -230,8 +215,6 @@ Add `independent` to decouple parents and children: a parent can be selected wit
|
|
|
230
215
|
|
|
231
216
|
Set `selection="leaf"` when only terminal nodes represent selectable values. Clicking a branch only toggles its expansion.
|
|
232
217
|
|
|
233
|
-
<ComponentWrapper vertical :html="treeLeaf" />
|
|
234
|
-
|
|
235
218
|
```html
|
|
236
219
|
<l-tree selection="leaf">
|
|
237
220
|
<l-tree-item expanded>
|
|
@@ -252,8 +235,6 @@ Set `selection="leaf"` when only terminal nodes represent selectable values. Cli
|
|
|
252
235
|
|
|
253
236
|
Add `disabled` to any item to prevent selection and interaction. The item remains visible and part of the structure.
|
|
254
237
|
|
|
255
|
-
<ComponentWrapper vertical :html="treeDisabled" />
|
|
256
|
-
|
|
257
238
|
```html
|
|
258
239
|
<l-tree selection="multiple">
|
|
259
240
|
<l-tree-item expanded>
|
|
@@ -269,48 +250,41 @@ Add `disabled` to any item to prevent selection and interaction. The item remain
|
|
|
269
250
|
|
|
270
251
|
Add `lazy` to an item whose children will be fetched on first expand. The component emits `lazy-load`; set `loading` to render a spinner in place of the chevron, then append children and remove `lazy`.
|
|
271
252
|
|
|
272
|
-
<TreeLazyDemo />
|
|
273
|
-
|
|
274
253
|
## Examples
|
|
275
254
|
|
|
276
255
|
### Comment thread
|
|
277
256
|
|
|
278
257
|
A discussion tree styled like a Reddit comment thread. Demonstrates stacking `prefix` (avatar), the default slot (multi-line content + action buttons), and swapped `expand-icon` / `collapse-icon` slots (`lucide:circle-plus` / `lucide:circle-minus`). The `::part(base)` and `::part(label)` are overridden to align content to the top and allow wrapping; `--indent-size` and `--indent-guide-width` are tuned for the denser look.
|
|
279
258
|
|
|
280
|
-
<TreeRedditDemo />
|
|
281
|
-
|
|
282
259
|
## Accessibility
|
|
283
260
|
|
|
284
261
|
### Criteria
|
|
285
262
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
| Focus management | Roving tabindex: only one item is in the tab order at a time; arrow keys move focus within the tree |
|
|
294
|
-
| Motion | Chevron rotation and spinner respect `prefers-reduced-motion` |
|
|
263
|
+
- **Role** — Container has `role="tree"`, items have `role="treeitem"`, groups have `role="group"`
|
|
264
|
+
- **Expanded state** — Branches expose `aria-expanded` reflecting open state. Leaf nodes omit the attribute.
|
|
265
|
+
- **Selected state** — Selected items expose `aria-selected="true"`
|
|
266
|
+
- **Multi-selectable** — Container sets `aria-multiselectable="true"` when `selection="multiple"`
|
|
267
|
+
- **Disabled state** — Disabled items expose `aria-disabled="true"` and stay in the DOM for discoverability
|
|
268
|
+
- **Focus management** — Roving tabindex: only one item is in the tab order at a time; arrow keys move focus within the tree
|
|
269
|
+
- **Motion** — Chevron rotation and spinner respect `prefers-reduced-motion`
|
|
295
270
|
|
|
296
271
|
### Rules
|
|
272
|
+
|
|
297
273
|
- Every item needs visible text content for its accessible name
|
|
298
274
|
- Use `selection="leaf"` when branches are never valid values — this prevents keyboard users from accidentally selecting aggregations
|
|
299
275
|
- Prefer `selection="multiple" independent` for forms where parent selection is a distinct choice from the children
|
|
300
276
|
|
|
301
277
|
### Keyboard interactions
|
|
302
278
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
| Space | Activates the item (selects or toggles expansion depending on mode) |
|
|
313
|
-
| * | Expands all sibling branches of the focused item |
|
|
279
|
+
- `ArrowDown` — Moves focus to the next visible item
|
|
280
|
+
- `ArrowUp` — Moves focus to the previous visible item
|
|
281
|
+
- `ArrowRight` — Expands a collapsed branch, or moves to the first child when already expanded
|
|
282
|
+
- `ArrowLeft` — Collapses an expanded branch, or moves to the parent item
|
|
283
|
+
- `Home` — Moves focus to the first visible item
|
|
284
|
+
- `End` — Moves focus to the last visible item
|
|
285
|
+
- `Enter` — Activates the item (selects or toggles expansion depending on mode)
|
|
286
|
+
- `Space` — Activates the item (selects or toggles expansion depending on mode)
|
|
287
|
+
- `*` — Expands all sibling branches of the focused item
|
|
314
288
|
|
|
315
289
|
## API reference
|
|
316
290
|
|
|
@@ -323,37 +297,35 @@ import 'luxen-ui/tree-item';
|
|
|
323
297
|
|
|
324
298
|
### Attributes & Properties
|
|
325
299
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
300
|
+
- **selection**: `TreeSelection` (default: `'single'`) — Selection behaviour:
|
|
301
|
+
- `single` (default): at most one item selected via `aria-selected`.
|
|
302
|
+
- `multiple`: any number of items selected. Checkboxes are rendered.
|
|
303
|
+
- `leaf`: only leaf items can be selected (single). Branches just toggle.
|
|
304
|
+
- `none`: purely navigable, no selection state.
|
|
305
|
+
- **independent**: `boolean` (default: `false`) — When set with `selection="multiple"`, parent and children selection are decoupled:
|
|
306
|
+
toggling a parent does NOT toggle its descendants and vice versa.
|
|
307
|
+
Without it, selection cascades both ways and branches may become indeterminate.
|
|
330
308
|
|
|
331
309
|
### Methods
|
|
332
310
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
{ Method: 'collapseAll()', Description: 'Collapses every item' },
|
|
338
|
-
]" />
|
|
311
|
+
- **getAllItems({ includeDisabled = true }: unknown)** → `TreeItem[]` — Returns all items in document (flat) order, including nested ones.
|
|
312
|
+
- **getSelection()** → `TreeItem[]` — Returns currently selected items.
|
|
313
|
+
- **expandAll()** — Expands every item that has children.
|
|
314
|
+
- **collapseAll()** — Collapses every item.
|
|
339
315
|
|
|
340
316
|
### Events
|
|
341
317
|
|
|
342
|
-
|
|
343
|
-
{ Event: 'selection-change', Description: 'Fired when the selection changes. Detail: `{ selection }`' },
|
|
344
|
-
]" />
|
|
318
|
+
- **selection-change** — Fired when the selected items change. Detail: `{ selection: TreeItem[] }`.
|
|
345
319
|
|
|
346
320
|
### CSS custom properties
|
|
347
321
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
{ Name: '--item-gap', Description: 'Horizontal gap between chevron, prefix, label and suffix on the row; also drives the content slot left indent. Default `0.375rem`' },
|
|
357
|
-
]" />
|
|
322
|
+
- `--indent-size` (default: `1rem`) — Horizontal indent per depth level.
|
|
323
|
+
- `--indent-guide-width` (default: `1px`) — Thickness of the vertical guide line between a parent and its children. Set to `0` to hide guides.
|
|
324
|
+
- `--indent-guide-style` (default: `solid`) — Line style of the guide (`solid`, `dashed`, `dotted`, `double`…).
|
|
325
|
+
- `--indent-guide-color` — Color of the guide line.
|
|
326
|
+
- `--row-height` (default: `1.75rem`) — Minimum row height.
|
|
327
|
+
- `--row-padding-inline` (default: `0.25rem`) — Inner inline padding of the row; also drives the content slot left indent and the indent guide column.
|
|
328
|
+
- `--chevron-size` (default: `1.125rem`) — Size of the expand/collapse chevron box.
|
|
329
|
+
- `--item-gap` (default: `0.375rem`) — Horizontal gap between chevron, prefix, label and suffix on the row; also drives the content slot left indent.
|
|
358
330
|
|
|
359
331
|
See [`<l-tree-item>`](/elements/tree-item) for the per-item API.
|