luxen-ui 0.2.0 → 0.2.1
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/cdn/custom-elements.json +466 -357
- package/cdn/elements/dialog/dialog.d.ts +3 -0
- package/cdn/elements/dialog/dialog.d.ts.map +1 -1
- package/cdn/elements/dialog/dialog.js +10 -6
- package/cdn/elements/dialog/dialog.js.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.js +1 -1
- package/cdn/elements/dropdown-item/dropdown-item.js.map +1 -1
- package/cdn/elements/popover/popover.js +1 -1
- package/cdn/elements/popover/popover.js.map +1 -1
- package/cdn/styles/elements/button.css +1 -1
- package/cdn/styles/index.css +5 -2
- package/dist/css/elements/button.css +1 -1
- package/dist/css/index.css +5 -2
- package/dist/custom-elements.json +466 -357
- package/dist/elements/dialog/dialog.d.ts +3 -0
- package/dist/elements/dialog/dialog.d.ts.map +1 -1
- package/dist/elements/dialog/dialog.js +16 -4
- package/dist/elements/dropdown/dropdown.css +4 -4
- package/dist/elements/dropdown-item/dropdown-item.css +2 -1
- package/dist/elements/popover/popover.css +3 -4
- package/dist/skills/luxen-ui/references/dialog.md +3 -1
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ import { LuxenElement } from '../../shared/luxen-element';
|
|
|
7
7
|
* Invoker commands). There are no public `show()` / `close()` methods.
|
|
8
8
|
*
|
|
9
9
|
* @slot - Body content.
|
|
10
|
+
* @slot title - Custom heading element. Overrides the default `<h2>` rendered from the `title` property.
|
|
10
11
|
* @slot close - Close button (typically `<button class="l-close">`).
|
|
11
12
|
* @slot footer - Footer actions.
|
|
12
13
|
*
|
|
@@ -37,6 +38,8 @@ export declare class LuxenDialog extends LuxenElement {
|
|
|
37
38
|
open: boolean;
|
|
38
39
|
/** Close when the backdrop is clicked. */
|
|
39
40
|
lightDismiss: boolean;
|
|
41
|
+
/** Hide the header entirely (title and close slot). */
|
|
42
|
+
withoutHeader: boolean;
|
|
40
43
|
dialog: HTMLDialogElement;
|
|
41
44
|
private _mouseDownTarget;
|
|
42
45
|
private _commandListener;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/html/elements/dialog/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAwB1D
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/html/elements/dialog/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAwB1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,MAAM,CAAC,MAAM,4BAAwB;IAErC,2CAA2C;IAE3C,KAAK,SAAM;IAEX,kCAAkC;IAElC,IAAI,UAAS;IAEb,0CAA0C;IAE1C,YAAY,UAAS;IAErB,uDAAuD;IAEvD,aAAa,UAAS;IAGtB,MAAM,EAAG,iBAAiB,CAAC;IAE3B,OAAO,CAAC,gBAAgB,CAA4B;IAEpD,OAAO,CAAC,gBAAgB,CAEtB;IAIF,iBAAiB;IAKjB,oBAAoB;IAKpB,YAAY;IASZ,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC;IA0BrC,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,eAAe,CAAC,CAAY;IAEpC,OAAO,CAAC,aAAa;YAcP,UAAU;IAUxB,OAAO,CAAC,qBAAqB;IAK7B,MAAM;CA0BP"}
|
|
@@ -28,6 +28,7 @@ if (typeof document !== 'undefined' && !(SCROLL_LOCK_SHEET in document)) {
|
|
|
28
28
|
* Invoker commands). There are no public `show()` / `close()` methods.
|
|
29
29
|
*
|
|
30
30
|
* @slot - Body content.
|
|
31
|
+
* @slot title - Custom heading element. Overrides the default `<h2>` rendered from the `title` property.
|
|
31
32
|
* @slot close - Close button (typically `<button class="l-close">`).
|
|
32
33
|
* @slot footer - Footer actions.
|
|
33
34
|
*
|
|
@@ -59,6 +60,8 @@ export class LuxenDialog extends LuxenElement {
|
|
|
59
60
|
this.open = false;
|
|
60
61
|
/** Close when the backdrop is clicked. */
|
|
61
62
|
this.lightDismiss = false;
|
|
63
|
+
/** Hide the header entirely (title and close slot). */
|
|
64
|
+
this.withoutHeader = false;
|
|
62
65
|
this._mouseDownTarget = null;
|
|
63
66
|
this._commandListener = {
|
|
64
67
|
handleEvent: (e) => this._onCommand(e),
|
|
@@ -176,10 +179,16 @@ export class LuxenDialog extends LuxenElement {
|
|
|
176
179
|
part="dialog"
|
|
177
180
|
closedby=${closedby}
|
|
178
181
|
>
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
${this.withoutHeader
|
|
183
|
+
? nothing
|
|
184
|
+
: html `
|
|
185
|
+
<header part="header">
|
|
186
|
+
<slot name="title">
|
|
187
|
+
${this.title ? html `<h2 part="title">${this.title}</h2>` : nothing}
|
|
188
|
+
</slot>
|
|
189
|
+
<slot name="close"></slot>
|
|
190
|
+
</header>
|
|
191
|
+
`}
|
|
183
192
|
<div part="body">
|
|
184
193
|
<slot></slot>
|
|
185
194
|
</div>
|
|
@@ -200,6 +209,9 @@ __decorate([
|
|
|
200
209
|
__decorate([
|
|
201
210
|
property({ type: Boolean, reflect: true, attribute: 'light-dismiss' })
|
|
202
211
|
], LuxenDialog.prototype, "lightDismiss", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
property({ type: Boolean, reflect: true, attribute: 'without-header' })
|
|
214
|
+
], LuxenDialog.prototype, "withoutHeader", void 0);
|
|
203
215
|
__decorate([
|
|
204
216
|
query('dialog')
|
|
205
217
|
], LuxenDialog.prototype, "dialog", void 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
--background: var(--l-color-bg-surface, Canvas);
|
|
3
|
-
--radius:
|
|
4
|
-
--shadow: 0 4px
|
|
3
|
+
--radius: 6px;
|
|
4
|
+
--shadow: 0 4px 6px -1px rgb(0 0 0 / 8%), 0 2px 4px -2px rgb(0 0 0 / 6%);
|
|
5
5
|
--show-duration: 150;
|
|
6
6
|
--hide-duration: 150;
|
|
7
7
|
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
box-sizing: border-box;
|
|
20
20
|
width: max-content;
|
|
21
21
|
min-width: anchor-size(width);
|
|
22
|
-
padding:
|
|
22
|
+
padding: 0.25rem;
|
|
23
23
|
margin: 0;
|
|
24
|
-
border: 1px solid var(--l-color-border, light-dark(#e5e7eb, #374151));
|
|
24
|
+
border: 1px solid var(--l-color-border-overlay, light-dark(#e5e7eb, #374151));
|
|
25
25
|
border-radius: var(--radius);
|
|
26
26
|
background: var(--background);
|
|
27
27
|
color: var(--l-color-text-primary, CanvasText);
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
display: flex;
|
|
12
12
|
align-items: center;
|
|
13
13
|
gap: 8px;
|
|
14
|
-
padding:
|
|
14
|
+
padding: 0.375rem 0.5rem;
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
outline: none;
|
|
17
|
+
border-radius: 4px;
|
|
17
18
|
font-size: 0.875rem;
|
|
18
19
|
line-height: 1.5;
|
|
19
20
|
color: var(--l-color-text-primary, CanvasText);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
--background: var(--l-color-bg-surface, Canvas);
|
|
3
3
|
--color: inherit;
|
|
4
|
-
--border-radius:
|
|
4
|
+
--border-radius: 6px;
|
|
5
5
|
--max-width: 320px;
|
|
6
|
-
--shadow: 0 4px
|
|
6
|
+
--shadow: 0 4px 6px -1px rgb(0 0 0 / 8%), 0 2px 4px -2px rgb(0 0 0 / 6%);
|
|
7
7
|
--arrow-size: 8px;
|
|
8
8
|
--show-duration: 150ms;
|
|
9
9
|
--hide-duration: 150ms;
|
|
10
10
|
|
|
11
|
-
--_border-color: var(--l-color-border, light-dark(#e5e7eb, #374151));
|
|
11
|
+
--_border-color: var(--l-color-border-overlay, light-dark(#e5e7eb, #374151));
|
|
12
12
|
|
|
13
13
|
display: contents;
|
|
14
14
|
}
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
width: max-content;
|
|
22
22
|
max-width: var(--max-width);
|
|
23
|
-
padding: 12px 16px;
|
|
24
23
|
border: 1px solid var(--_border-color);
|
|
25
24
|
border-radius: var(--border-radius);
|
|
26
25
|
background: var(--background);
|
|
@@ -352,7 +352,7 @@ Add `autofocus` to any focusable element inside the dialog to focus it automatic
|
|
|
352
352
|
| Check | Description |
|
|
353
353
|
|-------|-------------|
|
|
354
354
|
| Role | Rendered as a native `<dialog>` in the shadow root — built-in `dialog` role and modal semantics |
|
|
355
|
-
| Accessible name | The `title` property
|
|
355
|
+
| Accessible name | The `title` property renders as an `<h2>` in the header, or provide a custom heading via `slot="title"` |
|
|
356
356
|
| Focus management | Focus is trapped inside the modal; moves to the first focusable element on open |
|
|
357
357
|
| Focus restoration | Focus returns to the trigger element when the dialog closes |
|
|
358
358
|
| Close button | Consumer provides the close button via `slot="close"` with `aria-label="Close"` |
|
|
@@ -385,6 +385,7 @@ import 'luxen-ui/dialog';
|
|
|
385
385
|
{ Attribute: 'title', Description: 'Dialog title rendered in the header as an `<h2>`' },
|
|
386
386
|
{ Attribute: 'open', Description: 'Whether the dialog is open. Reflects to attribute' },
|
|
387
387
|
{ Attribute: 'light-dismiss', Description: 'Close when the backdrop is clicked' },
|
|
388
|
+
{ Attribute: 'without-header', Description: 'Hide the header entirely (title and close slot)' },
|
|
388
389
|
]" />
|
|
389
390
|
|
|
390
391
|
### Commands
|
|
@@ -409,6 +410,7 @@ Open and close the dialog by toggling its `open` property, or via the [Invoker C
|
|
|
409
410
|
|
|
410
411
|
<ApiTable :data="[
|
|
411
412
|
{ Slot: '(default)', Description: 'Body content' },
|
|
413
|
+
{ Slot: 'title', Description: 'Custom heading element. Overrides the default `<h2>` rendered from the `title` property' },
|
|
412
414
|
{ Slot: 'close', Description: 'Close button (typically `<button class="l-close">`)' },
|
|
413
415
|
{ Slot: 'footer', Description: 'Footer actions' },
|
|
414
416
|
]" />
|
package/package.json
CHANGED