@editora/ui-core 0.1.24 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +339 -5
- package/dist/accordion.cjs.js +13 -12
- package/dist/accordion.esm.js +13 -12
- package/dist/alert-dialog.cjs.js +76 -45
- package/dist/alert-dialog.esm.js +179 -135
- package/dist/alert.cjs.js +41 -32
- package/dist/alert.esm.js +79 -70
- package/dist/animated-beam.cjs.js +42 -50
- package/dist/animated-beam.esm.js +47 -55
- package/dist/animated-list.cjs.js +11 -27
- package/dist/animated-list.esm.js +12 -28
- package/dist/animated-text.cjs.js +4 -4
- package/dist/animated-text.esm.js +4 -4
- package/dist/app-header.cjs.js +5 -5
- package/dist/app-header.esm.js +6 -6
- package/dist/aspect-ratio.cjs.js +10 -12
- package/dist/aspect-ratio.esm.js +11 -13
- package/dist/avatar.cjs.js +13 -17
- package/dist/avatar.esm.js +13 -17
- package/dist/badge.cjs.js +27 -22
- package/dist/badge.esm.js +32 -27
- package/dist/block-controls.cjs.js +11 -12
- package/dist/block-controls.esm.js +8 -9
- package/dist/box.cjs.js +2 -3
- package/dist/box.esm.js +2 -3
- package/dist/breadcrumb.cjs.js +12 -18
- package/dist/breadcrumb.esm.js +11 -17
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-B3PUKHQm.mjs → calendar-DmxiZrR7.mjs} +126 -117
- package/dist/{calendar-D-mXMgqc.js → calendar-o273O28D.js} +53 -44
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +6 -7
- package/dist/card.esm.js +5 -6
- package/dist/chart.cjs.js +52 -52
- package/dist/chart.esm.js +95 -95
- package/dist/checkbox.cjs.js +19 -15
- package/dist/checkbox.esm.js +19 -15
- package/dist/collapsible.cjs.js +7 -11
- package/dist/collapsible.esm.js +7 -11
- package/dist/color-picker.cjs.js +36 -17
- package/dist/color-picker.esm.js +132 -113
- package/dist/combobox.cjs.js +57 -54
- package/dist/combobox.esm.js +62 -58
- package/dist/command-palette.cjs.js +1 -0
- package/dist/command-palette.esm.js +1 -0
- package/dist/command.cjs.js +32 -14
- package/dist/command.esm.js +46 -28
- package/dist/components/date-time-utils.d.ts.map +1 -1
- package/dist/components/gantt-schedule.d.ts +79 -0
- package/dist/components/gantt-schedule.d.ts.map +1 -0
- package/dist/components/ui-accordion.d.ts.map +1 -1
- package/dist/components/ui-alert-dialog.d.ts +2 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-alert.d.ts.map +1 -1
- package/dist/components/ui-animated-beam.d.ts.map +1 -1
- package/dist/components/ui-animated-list.d.ts.map +1 -1
- package/dist/components/ui-aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui-avatar.d.ts.map +1 -1
- package/dist/components/ui-badge.d.ts.map +1 -1
- package/dist/components/ui-block-controls.d.ts.map +1 -1
- package/dist/components/ui-box.d.ts.map +1 -1
- package/dist/components/ui-breadcrumb.d.ts.map +1 -1
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-collapsible.d.ts.map +1 -1
- package/dist/components/ui-color-picker.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-command-palette.d.ts.map +1 -1
- package/dist/components/ui-command.d.ts.map +1 -1
- package/dist/components/ui-container.d.ts.map +1 -1
- package/dist/components/ui-context-menu.d.ts.map +1 -1
- package/dist/components/ui-data-table.d.ts +7 -0
- package/dist/components/ui-data-table.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dialog.d.ts +2 -0
- package/dist/components/ui-dialog.d.ts.map +1 -1
- package/dist/components/ui-dock.d.ts.map +1 -1
- package/dist/components/ui-drawer.d.ts.map +1 -1
- package/dist/components/ui-dropdown.d.ts.map +1 -1
- package/dist/components/ui-empty-state.d.ts.map +1 -1
- package/dist/components/ui-field.d.ts.map +1 -1
- package/dist/components/ui-fieldset.d.ts.map +1 -1
- package/dist/components/ui-file-upload.d.ts.map +1 -1
- package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
- package/dist/components/ui-form.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts +186 -2
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-icon-cloud.d.ts.map +1 -1
- package/dist/components/ui-inline-edit.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-marquee.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-menubar.d.ts.map +1 -1
- package/dist/components/ui-meter.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-orbiter.d.ts.map +1 -1
- package/dist/components/ui-pagination.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-pin-input.d.ts.map +1 -1
- package/dist/components/ui-popover.d.ts.map +1 -1
- package/dist/components/ui-progress.d.ts.map +1 -1
- package/dist/components/ui-radio-group.d.ts.map +1 -1
- package/dist/components/ui-radio.d.ts.map +1 -1
- package/dist/components/ui-rating.d.ts +1 -0
- package/dist/components/ui-rating.d.ts.map +1 -1
- package/dist/components/ui-scroll-area.d.ts.map +1 -1
- package/dist/components/ui-section.d.ts.map +1 -1
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-selection-popup.d.ts.map +1 -1
- package/dist/components/ui-slider.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-spinning-text.d.ts.map +1 -1
- package/dist/components/ui-split-button.d.ts.map +1 -1
- package/dist/components/ui-splitter.d.ts.map +1 -1
- package/dist/components/ui-stepper.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-tags-input.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-picker.d.ts.map +1 -1
- package/dist/components/ui-toggle-group.d.ts +2 -0
- package/dist/components/ui-toggle-group.d.ts.map +1 -1
- package/dist/components/ui-toggle.d.ts.map +1 -1
- package/dist/components/ui-toolbar.d.ts +2 -0
- package/dist/components/ui-toolbar.d.ts.map +1 -1
- package/dist/components/ui-tooltip.d.ts.map +1 -1
- package/dist/components/ui-transfer-list.d.ts.map +1 -1
- package/dist/components/ui-tree-item.d.ts.map +1 -1
- package/dist/components/ui-tree.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/container.cjs.js +6 -12
- package/dist/container.esm.js +8 -14
- package/dist/context-menu.cjs.js +8 -8
- package/dist/context-menu.esm.js +42 -41
- package/dist/data-table.cjs.js +18 -15
- package/dist/data-table.esm.js +207 -187
- package/dist/date-field.cjs.js +8 -8
- package/dist/date-field.esm.js +7 -7
- package/dist/date-picker.cjs.js +27 -18
- package/dist/date-picker.esm.js +57 -48
- package/dist/date-range-picker.cjs.js +22 -17
- package/dist/date-range-picker.esm.js +31 -26
- package/dist/date-range-time-picker.cjs.js +26 -19
- package/dist/date-range-time-picker.esm.js +23 -16
- package/dist/date-time-picker.cjs.js +23 -16
- package/dist/date-time-picker.esm.js +88 -81
- package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-B4hAkt36.mjs} +75 -68
- package/dist/date-time-utils-DdigV4hs.js +1 -0
- package/dist/dialog.cjs.js +57 -41
- package/dist/dialog.esm.js +84 -51
- package/dist/dock.cjs.js +16 -30
- package/dist/dock.esm.js +26 -40
- package/dist/drawer.cjs.js +8 -12
- package/dist/drawer.esm.js +6 -10
- package/dist/dropdown.cjs.js +8 -6
- package/dist/dropdown.esm.js +33 -30
- package/dist/empty-state.cjs.js +17 -15
- package/dist/empty-state.esm.js +13 -11
- package/dist/field.cjs.js +22 -13
- package/dist/field.esm.js +54 -45
- package/dist/fieldset.cjs.js +18 -11
- package/dist/fieldset.esm.js +20 -13
- package/dist/file-upload.cjs.js +77 -35
- package/dist/file-upload.esm.js +152 -110
- package/dist/floating-toolbar.cjs.js +6 -7
- package/dist/floating-toolbar.esm.js +8 -9
- package/dist/form.cjs.js +20 -23
- package/dist/form.esm.js +20 -23
- package/dist/gantt.cjs.js +525 -110
- package/dist/gantt.esm.js +1882 -377
- package/dist/hover-card.cjs.js +7 -7
- package/dist/hover-card.esm.js +7 -7
- package/dist/icon-cloud.cjs.js +19 -36
- package/dist/icon-cloud.esm.js +41 -58
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +108 -104
- package/dist/inline-edit.cjs.js +47 -19
- package/dist/inline-edit.esm.js +66 -38
- package/dist/input.cjs.js +44 -37
- package/dist/input.esm.js +59 -52
- package/dist/layout.cjs.js +3 -3
- package/dist/layout.esm.js +3 -3
- package/dist/marquee.cjs.js +7 -10
- package/dist/marquee.esm.js +7 -10
- package/dist/menu.cjs.js +8 -24
- package/dist/menu.esm.js +52 -72
- package/dist/menubar.cjs.js +9 -31
- package/dist/menubar.esm.js +127 -153
- package/dist/meter.cjs.js +4 -9
- package/dist/meter.esm.js +6 -11
- package/dist/multi-select.cjs.js +48 -35
- package/dist/multi-select.esm.js +67 -53
- package/dist/navigation-menu.cjs.js +10 -10
- package/dist/navigation-menu.esm.js +33 -33
- package/dist/number-field.cjs.js +27 -16
- package/dist/number-field.esm.js +36 -25
- package/dist/odometer.cjs.js +5 -5
- package/dist/odometer.esm.js +3 -3
- package/dist/orbiter.cjs.js +11 -28
- package/dist/orbiter.esm.js +28 -45
- package/dist/overlay-motion-B56x1GoY.js +49 -0
- package/dist/overlay-motion-BX3dPLay.mjs +120 -0
- package/dist/pagination.cjs.js +28 -25
- package/dist/pagination.esm.js +54 -51
- package/dist/password-field.cjs.js +38 -33
- package/dist/password-field.esm.js +62 -57
- package/dist/pin-input.cjs.js +17 -13
- package/dist/pin-input.esm.js +23 -19
- package/dist/plugin-panel.cjs.js +1 -1
- package/dist/plugin-panel.esm.js +1 -1
- package/dist/popover.cjs.js +16 -28
- package/dist/popover.esm.js +29 -45
- package/dist/portal-DeaM1tYY.mjs +121 -0
- package/dist/portal-XbYR3m_q.js +1 -0
- package/dist/portal.d.ts +3 -1
- package/dist/portal.d.ts.map +1 -1
- package/dist/{positioner-D0VGxtYU.mjs → positioner-BE8Nbho2.mjs} +5 -3
- package/dist/{positioner-D_fqyx_j.js → positioner-DZ1FW6A9.js} +1 -1
- package/dist/positioner.cjs.js +1 -1
- package/dist/positioner.esm.js +1 -1
- package/dist/primitives/overlay-motion.d.ts +47 -0
- package/dist/primitives/overlay-motion.d.ts.map +1 -0
- package/dist/primitives/positioner.d.ts.map +1 -1
- package/dist/progress.cjs.js +11 -16
- package/dist/progress.esm.js +37 -42
- package/dist/quick-actions.cjs.js +13 -13
- package/dist/quick-actions.esm.js +11 -11
- package/dist/radio-group.cjs.js +50 -26
- package/dist/radio-group.esm.js +53 -29
- package/dist/radio.cjs.js +15 -12
- package/dist/radio.esm.js +15 -12
- package/dist/rating.cjs.js +11 -15
- package/dist/rating.esm.js +48 -50
- package/dist/{runtime-CFnK53iC.mjs → runtime-CQM6wZOc.mjs} +498 -514
- package/dist/runtime-DxCl0A5q.js +5 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +36 -32
- package/dist/scroll-area.cjs.js +3 -4
- package/dist/scroll-area.esm.js +3 -4
- package/dist/section.cjs.js +2 -4
- package/dist/section.esm.js +2 -4
- package/dist/select.cjs.js +40 -73
- package/dist/select.esm.js +55 -87
- package/dist/selection-popup.cjs.js +3 -4
- package/dist/selection-popup.esm.js +3 -4
- package/dist/semantic-tokens.d.ts +17 -0
- package/dist/semantic-tokens.d.ts.map +1 -0
- package/dist/sidebar.cjs.js +22 -22
- package/dist/sidebar.esm.js +25 -25
- package/dist/skeleton.cjs.js +2 -2
- package/dist/skeleton.esm.js +2 -2
- package/dist/slider.cjs.js +22 -26
- package/dist/slider.esm.js +25 -29
- package/dist/sortable.cjs.js +4 -5
- package/dist/sortable.esm.js +4 -5
- package/dist/spinning-text.cjs.js +4 -13
- package/dist/spinning-text.esm.js +4 -13
- package/dist/split-button.cjs.js +5 -5
- package/dist/split-button.esm.js +15 -14
- package/dist/splitter.cjs.js +52 -10
- package/dist/splitter.esm.js +55 -13
- package/dist/stepper.cjs.js +31 -65
- package/dist/stepper.esm.js +32 -66
- package/dist/switch.cjs.js +20 -22
- package/dist/switch.esm.js +20 -22
- package/dist/table.cjs.js +5 -5
- package/dist/table.esm.js +20 -20
- package/dist/tabs.cjs.js +91 -21
- package/dist/tabs.esm.js +182 -112
- package/dist/tags-input.cjs.js +41 -15
- package/dist/tags-input.esm.js +73 -47
- package/dist/textarea.cjs.js +32 -33
- package/dist/textarea.esm.js +38 -39
- package/dist/theme.d.ts +25 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +7 -7
- package/dist/time-field.esm.js +6 -6
- package/dist/time-picker.cjs.js +16 -13
- package/dist/time-picker.esm.js +27 -24
- package/dist/timeline.cjs.js +10 -10
- package/dist/timeline.esm.js +7 -7
- package/dist/toggle-group.cjs.js +13 -13
- package/dist/toggle-group.esm.js +66 -61
- package/dist/toggle.cjs.js +52 -34
- package/dist/toggle.esm.js +80 -62
- package/dist/toolbar.cjs.js +14 -14
- package/dist/toolbar.esm.js +41 -33
- package/dist/tooltip.cjs.js +3 -3
- package/dist/tooltip.esm.js +39 -33
- package/dist/transfer-list.cjs.js +28 -29
- package/dist/transfer-list.esm.js +28 -29
- package/dist/{tree-B_oQput6.mjs → tree-33fVNnaf.mjs} +6 -5
- package/dist/{tree-SivHxcAy.js → tree-Dc02MChE.js} +6 -5
- package/dist/tree-item.cjs.js +9 -8
- package/dist/tree-item.esm.js +13 -12
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/{ui-button-Co8Sid6t.mjs → ui-button-C3OmI7Sn.mjs} +152 -154
- package/dist/{ui-button-BPrzJScZ.js → ui-button-CnLwXBnx.js} +107 -109
- package/dist/wizard.cjs.js +39 -36
- package/dist/wizard.esm.js +39 -36
- package/package.json +1 -1
- package/dist/date-time-utils-y3AvNvGe.js +0 -1
- package/dist/portal-DgpQ3Jo1.js +0 -1
- package/dist/portal-bR42gHvG.mjs +0 -118
- package/dist/runtime-DwE-tizc.js +0 -1
package/dist/alert-dialog.esm.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { E as Z } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
|
+
import { c as G, l as J } from "./overlay-motion-BX3dPLay.mjs";
|
|
3
|
+
import { a as S, r as L } from "./scroll-lock-LfqXXqsu.mjs";
|
|
4
|
+
const Q = `
|
|
4
5
|
:host {
|
|
5
6
|
display: block;
|
|
6
7
|
color-scheme: light dark;
|
|
7
|
-
--ui-alert-radius: var(--base-alert-dialog-radius, var(--ui-radius,
|
|
8
|
+
--ui-alert-radius: var(--base-alert-dialog-radius, var(--ui-radius, 6px));
|
|
8
9
|
--ui-alert-bg-base: var(--base-alert-dialog-bg, var(--color-panel-solid, var(--ui-color-surface, #ffffff)));
|
|
9
10
|
--ui-alert-bg: var(--ui-alert-bg-base);
|
|
10
11
|
--ui-alert-text: var(--ui-color-text, var(--ui-text, #202020));
|
|
@@ -25,7 +26,8 @@ const U = `
|
|
|
25
26
|
--ui-alert-btn-bg: color-mix(in srgb, var(--ui-alert-bg-base) 90%, var(--ui-color-background, #ffffff) 10%);
|
|
26
27
|
--ui-alert-btn-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
|
|
27
28
|
--ui-alert-btn-hover: color-mix(in srgb, var(--ui-alert-btn-bg) 76%, var(--ui-color-border, #cbd5e1) 24%);
|
|
28
|
-
|
|
29
|
+
/* Default confirm is the primary fill. A tone sets its own fill and text below, so the text always reads. */
|
|
30
|
+
--ui-alert-confirm-bg: var(--ui-color-primary, #2563eb);
|
|
29
31
|
--ui-alert-confirm-color: var(--ui-color-foreground-on-primary, #ffffff);
|
|
30
32
|
--ui-alert-icon-bg: color-mix(in srgb, var(--ui-alert-accent) 14%, transparent);
|
|
31
33
|
--ui-alert-icon-color: var(--ui-alert-accent);
|
|
@@ -37,8 +39,8 @@ const U = `
|
|
|
37
39
|
--ui-alert-description-size: 13px;
|
|
38
40
|
--ui-alert-description-line-height: 20px;
|
|
39
41
|
--ui-alert-icon-size: 28px;
|
|
40
|
-
--ui-alert-button-height: var(--base-button-height-md,
|
|
41
|
-
--ui-alert-button-radius: var(--ui-radius,
|
|
42
|
+
--ui-alert-button-height: var(--base-button-height-md, var(--ui-control-height-2, 32px));
|
|
43
|
+
--ui-alert-button-radius: var(--ui-radius, 6px);
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
:host([tone='info']) {
|
|
@@ -47,14 +49,20 @@ const U = `
|
|
|
47
49
|
|
|
48
50
|
:host([tone='success']) {
|
|
49
51
|
--ui-alert-accent: var(--ui-color-success, #15803d);
|
|
52
|
+
--ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 76%, #000000);
|
|
53
|
+
--ui-alert-confirm-color: #ffffff;
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
:host([tone='warning']) {
|
|
53
57
|
--ui-alert-accent: var(--ui-color-warning, #b45309);
|
|
58
|
+
--ui-alert-confirm-bg: var(--ui-alert-accent);
|
|
59
|
+
--ui-alert-confirm-color: var(--ui-color-foreground-on-warning, #ffffff);
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
:host([tone='danger']) {
|
|
57
63
|
--ui-alert-accent: var(--ui-color-danger, #dc2626);
|
|
64
|
+
--ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 80%, #000000);
|
|
65
|
+
--ui-alert-confirm-color: #ffffff;
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
:host([size='sm']),
|
|
@@ -68,7 +76,7 @@ const U = `
|
|
|
68
76
|
--ui-alert-description-size: 12px;
|
|
69
77
|
--ui-alert-description-line-height: 18px;
|
|
70
78
|
--ui-alert-icon-size: 24px;
|
|
71
|
-
--ui-alert-button-height: var(--base-button-height-sm,
|
|
79
|
+
--ui-alert-button-height: var(--base-button-height-sm, var(--ui-control-height-1, 24px));
|
|
72
80
|
}
|
|
73
81
|
|
|
74
82
|
:host([size='md']),
|
|
@@ -88,7 +96,7 @@ const U = `
|
|
|
88
96
|
--ui-alert-description-size: 14px;
|
|
89
97
|
--ui-alert-description-line-height: 22px;
|
|
90
98
|
--ui-alert-icon-size: 32px;
|
|
91
|
-
--ui-alert-button-height: var(--base-button-height-lg,
|
|
99
|
+
--ui-alert-button-height: var(--base-button-height-lg, var(--ui-control-height-3, 40px));
|
|
92
100
|
}
|
|
93
101
|
|
|
94
102
|
:host([variant='outline']) {
|
|
@@ -136,8 +144,16 @@ const U = `
|
|
|
136
144
|
place-items: center;
|
|
137
145
|
background: var(--ui-alert-backdrop);
|
|
138
146
|
backdrop-filter: saturate(1.04) blur(3px);
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
/* The backdrop goes to the top layer (popover); undo the popover user-agent box. */
|
|
148
|
+
inline-size: 100%;
|
|
149
|
+
block-size: 100%;
|
|
150
|
+
max-inline-size: none;
|
|
151
|
+
max-block-size: none;
|
|
152
|
+
margin: 0;
|
|
153
|
+
padding: 0;
|
|
154
|
+
border: 0;
|
|
155
|
+
overflow: visible;
|
|
156
|
+
color: inherit;
|
|
141
157
|
}
|
|
142
158
|
|
|
143
159
|
.dialog {
|
|
@@ -154,13 +170,9 @@ const U = `
|
|
|
154
170
|
padding: var(--ui-alert-padding);
|
|
155
171
|
outline: none;
|
|
156
172
|
overflow: clip;
|
|
157
|
-
opacity: 0;
|
|
158
|
-
transform: translateY(12px) scale(0.985);
|
|
159
173
|
transition:
|
|
160
174
|
border-color var(--ui-alert-duration) var(--ui-alert-easing),
|
|
161
|
-
box-shadow var(--ui-alert-duration) var(--ui-alert-easing)
|
|
162
|
-
transform var(--ui-alert-duration) var(--ui-alert-easing),
|
|
163
|
-
opacity var(--ui-alert-duration) var(--ui-alert-easing);
|
|
175
|
+
box-shadow var(--ui-alert-duration) var(--ui-alert-easing);
|
|
164
176
|
}
|
|
165
177
|
|
|
166
178
|
.dialog::before {
|
|
@@ -181,13 +193,33 @@ const U = `
|
|
|
181
193
|
display: none;
|
|
182
194
|
}
|
|
183
195
|
|
|
184
|
-
|
|
185
|
-
|
|
196
|
+
/* Open and close are animations on data-state; the surface is created and removed, which a transition cannot play. */
|
|
197
|
+
.backdrop[data-state='open']:not([data-instant]) {
|
|
198
|
+
animation: ui-alert-backdrop-in 150ms ease-out backwards;
|
|
186
199
|
}
|
|
187
200
|
|
|
188
|
-
.backdrop[data-
|
|
189
|
-
|
|
190
|
-
|
|
201
|
+
.backdrop[data-state='open']:not([data-instant]) .dialog {
|
|
202
|
+
animation: ui-alert-dialog-in 150ms var(--ui-motion-enter-easing, cubic-bezier(0.16, 1, 0.3, 1)) backwards;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.backdrop[data-state='closed'] {
|
|
206
|
+
animation: ui-alert-backdrop-out 100ms ease-in both;
|
|
207
|
+
pointer-events: none;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.backdrop[data-state='closed'] .dialog {
|
|
211
|
+
animation: ui-alert-dialog-out 100ms var(--ui-motion-exit-easing, cubic-bezier(0.4, 0, 1, 1)) both;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@keyframes ui-alert-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
|
|
215
|
+
@keyframes ui-alert-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
|
|
216
|
+
@keyframes ui-alert-dialog-in {
|
|
217
|
+
from { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.96); }
|
|
218
|
+
to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
|
|
219
|
+
}
|
|
220
|
+
@keyframes ui-alert-dialog-out {
|
|
221
|
+
from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
|
|
222
|
+
to { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.96); }
|
|
191
223
|
}
|
|
192
224
|
|
|
193
225
|
.dialog:focus-visible {
|
|
@@ -307,12 +339,12 @@ const U = `
|
|
|
307
339
|
|
|
308
340
|
.input {
|
|
309
341
|
width: 100%;
|
|
310
|
-
border-radius: var(--ui-radius,
|
|
342
|
+
border-radius: var(--ui-radius, 6px);
|
|
311
343
|
border: var(--base-input-border, 1px solid color-mix(in srgb, var(--ui-alert-border-color) 88%, transparent));
|
|
312
344
|
background: var(--base-input-bg, color-mix(in srgb, var(--ui-alert-bg-base) 94%, #ffffff 6%));
|
|
313
345
|
color: inherit;
|
|
314
346
|
box-sizing: border-box;
|
|
315
|
-
min-height: var(--base-input-height-md,
|
|
347
|
+
min-height: var(--base-input-height-md, var(--ui-control-height-2, 32px));
|
|
316
348
|
padding: 9px 12px;
|
|
317
349
|
font: inherit;
|
|
318
350
|
line-height: 1.35;
|
|
@@ -499,62 +531,62 @@ const U = `
|
|
|
499
531
|
border: 1px solid CanvasText;
|
|
500
532
|
}
|
|
501
533
|
}
|
|
502
|
-
`,
|
|
503
|
-
function
|
|
504
|
-
if (
|
|
505
|
-
const
|
|
506
|
-
return
|
|
534
|
+
`, X = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
535
|
+
function f(i, t) {
|
|
536
|
+
if (i == null) return t;
|
|
537
|
+
const e = i.trim().toLowerCase();
|
|
538
|
+
return e !== "false" && e !== "0" && e !== "off";
|
|
507
539
|
}
|
|
508
|
-
function a(
|
|
509
|
-
return String(
|
|
540
|
+
function a(i) {
|
|
541
|
+
return String(i).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
510
542
|
}
|
|
511
|
-
function
|
|
512
|
-
return
|
|
543
|
+
function tt(i) {
|
|
544
|
+
return i === "info" || i === "success" || i === "warning" || i === "danger" ? i : "neutral";
|
|
513
545
|
}
|
|
514
|
-
function
|
|
515
|
-
return
|
|
546
|
+
function et(i) {
|
|
547
|
+
return i === "sm" || i === "1" ? "sm" : i === "lg" || i === "3" ? "lg" : "md";
|
|
516
548
|
}
|
|
517
|
-
function
|
|
518
|
-
return
|
|
549
|
+
function it(i) {
|
|
550
|
+
return i === "soft" || i === "outline" || i === "solid" ? i : "surface";
|
|
519
551
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
552
|
+
function rt(i) {
|
|
553
|
+
return i === "none" || i === "high" ? i : "low";
|
|
522
554
|
}
|
|
523
|
-
function
|
|
524
|
-
return
|
|
555
|
+
function st(i) {
|
|
556
|
+
return i === "none" ? "none" : "line";
|
|
525
557
|
}
|
|
526
|
-
function
|
|
527
|
-
if (
|
|
528
|
-
const
|
|
529
|
-
return
|
|
558
|
+
function at(i, t = "var(--base-alert-dialog-radius, var(--ui-radius, 6px))") {
|
|
559
|
+
if (i == null) return t;
|
|
560
|
+
const e = i.trim().toLowerCase();
|
|
561
|
+
return e ? e === "full" || e === "pill" ? "999px" : /^-?\d+(\.\d+)?$/.test(e) ? `${e}px` : i : t;
|
|
530
562
|
}
|
|
531
|
-
const
|
|
532
|
-
function
|
|
533
|
-
return
|
|
563
|
+
const ot = /* @__PURE__ */ new Set(["tone", "size", "variant", "elevation", "indicator", "radius"]);
|
|
564
|
+
function nt(i) {
|
|
565
|
+
return i === "success" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M5 10.2 8.3 13.4 15 6.8"></path></svg>' : i === "warning" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M10 3.6 17 16.4H3L10 3.6Z"></path><path d="M10 8v3.4"></path><circle cx="10" cy="14.1" r="0.9" fill="currentColor" stroke="none"></circle></svg>' : i === "danger" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="m7.5 7.5 5 5M12.5 7.5l-5 5"></path></svg>' : i === "info" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="M10 13v-3.8"></path><circle cx="10" cy="6.5" r="0.9" fill="currentColor" stroke="none"></circle></svg>' : '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6 10h8"></path><circle cx="10" cy="10" r="7.1"></circle></svg>';
|
|
534
566
|
}
|
|
535
567
|
function u() {
|
|
536
568
|
return typeof window < "u" && typeof document < "u";
|
|
537
569
|
}
|
|
538
|
-
function
|
|
570
|
+
function T() {
|
|
539
571
|
if (!u()) return null;
|
|
540
|
-
const
|
|
541
|
-
return
|
|
572
|
+
const i = document.activeElement;
|
|
573
|
+
return i instanceof HTMLElement ? i : null;
|
|
542
574
|
}
|
|
543
|
-
function
|
|
544
|
-
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(() =>
|
|
575
|
+
function k(i) {
|
|
576
|
+
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => i()) : window.setTimeout(i, 16);
|
|
545
577
|
}
|
|
546
|
-
function p(
|
|
547
|
-
if (
|
|
578
|
+
function p(i) {
|
|
579
|
+
if (i) {
|
|
548
580
|
if (typeof cancelAnimationFrame == "function") {
|
|
549
|
-
cancelAnimationFrame(
|
|
581
|
+
cancelAnimationFrame(i);
|
|
550
582
|
return;
|
|
551
583
|
}
|
|
552
|
-
window.clearTimeout(
|
|
584
|
+
window.clearTimeout(i);
|
|
553
585
|
}
|
|
554
586
|
}
|
|
555
|
-
const c = "data-ui-auto-name", l = class l extends
|
|
587
|
+
const c = "data-ui-auto-name", l = class l extends Z {
|
|
556
588
|
constructor() {
|
|
557
|
-
super(), this._lastActive = null, this._active = !1, this._terminalEmitted = !1, this._closeMeta = null, this._uid = Math.random().toString(36).slice(2, 10), this._dialogId = "", this._config = {}, this._inputValue = "", this._checked = !1, this._runtimeError = "", this._activeHeadless = !1, this._focusInitialFrame = 0, this._restoreFocusFrame = 0, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onFocusIn = this._onFocusIn.bind(this), this._onInput = this._onInput.bind(this), this._dialogId = this._uid;
|
|
589
|
+
super(), this._lastActive = null, this._active = !1, this._terminalEmitted = !1, this._closeMeta = null, this._uid = Math.random().toString(36).slice(2, 10), this._dialogId = "", this._config = {}, this._inputValue = "", this._checked = !1, this._runtimeError = "", this._activeHeadless = !1, this._focusInitialFrame = 0, this._restoreFocusFrame = 0, this._presented = !1, this._finishClose = null, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onFocusIn = this._onFocusIn.bind(this), this._onInput = this._onInput.bind(this), this._dialogId = this._uid;
|
|
558
590
|
}
|
|
559
591
|
static get observedAttributes() {
|
|
560
592
|
return [
|
|
@@ -590,9 +622,9 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
590
622
|
disconnectedCallback() {
|
|
591
623
|
this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), this.root.removeEventListener("input", this._onInput), this._focusInitialFrame && (p(this._focusInitialFrame), this._focusInitialFrame = 0), this._restoreFocusFrame && (p(this._restoreFocusFrame), this._restoreFocusFrame = 0), this._active && !this._terminalEmitted && this.close("dismiss", "unmount"), this._deactivate(), super.disconnectedCallback();
|
|
592
624
|
}
|
|
593
|
-
attributeChangedCallback(t,
|
|
594
|
-
if (
|
|
595
|
-
if (
|
|
625
|
+
attributeChangedCallback(t, e, r) {
|
|
626
|
+
if (e !== r) {
|
|
627
|
+
if (ot.has(t)) {
|
|
596
628
|
this._syncVisualTokens();
|
|
597
629
|
return;
|
|
598
630
|
}
|
|
@@ -620,25 +652,25 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
620
652
|
t ? this.setAttribute("headless", "") : this.removeAttribute("headless");
|
|
621
653
|
}
|
|
622
654
|
get dismissible() {
|
|
623
|
-
return
|
|
655
|
+
return f(this.getAttribute("dismissible"), !0);
|
|
624
656
|
}
|
|
625
657
|
set dismissible(t) {
|
|
626
658
|
this.setAttribute("dismissible", String(t));
|
|
627
659
|
}
|
|
628
660
|
get closeOnEsc() {
|
|
629
|
-
return
|
|
661
|
+
return f(this.getAttribute("close-on-esc"), this.dismissible);
|
|
630
662
|
}
|
|
631
663
|
set closeOnEsc(t) {
|
|
632
664
|
this.setAttribute("close-on-esc", String(t));
|
|
633
665
|
}
|
|
634
666
|
get closeOnBackdrop() {
|
|
635
|
-
return
|
|
667
|
+
return f(this.getAttribute("close-on-backdrop"), this.dismissible);
|
|
636
668
|
}
|
|
637
669
|
set closeOnBackdrop(t) {
|
|
638
670
|
this.setAttribute("close-on-backdrop", String(t));
|
|
639
671
|
}
|
|
640
672
|
get lockWhileLoading() {
|
|
641
|
-
return
|
|
673
|
+
return f(this.getAttribute("lock-while-loading"), !0);
|
|
642
674
|
}
|
|
643
675
|
set lockWhileLoading(t) {
|
|
644
676
|
this.setAttribute("lock-while-loading", String(t));
|
|
@@ -650,7 +682,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
650
682
|
this.setAttribute("role", t);
|
|
651
683
|
}
|
|
652
684
|
get tone() {
|
|
653
|
-
return
|
|
685
|
+
return tt(this.getAttribute("tone"));
|
|
654
686
|
}
|
|
655
687
|
set tone(t) {
|
|
656
688
|
if (t === "neutral") {
|
|
@@ -660,7 +692,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
660
692
|
this.setAttribute("tone", t);
|
|
661
693
|
}
|
|
662
694
|
get size() {
|
|
663
|
-
return
|
|
695
|
+
return et(this.getAttribute("size"));
|
|
664
696
|
}
|
|
665
697
|
set size(t) {
|
|
666
698
|
if (t === "md") {
|
|
@@ -670,7 +702,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
670
702
|
this.setAttribute("size", t);
|
|
671
703
|
}
|
|
672
704
|
get variant() {
|
|
673
|
-
return
|
|
705
|
+
return it(this.getAttribute("variant"));
|
|
674
706
|
}
|
|
675
707
|
set variant(t) {
|
|
676
708
|
if (t === "surface") {
|
|
@@ -680,7 +712,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
680
712
|
this.setAttribute("variant", t);
|
|
681
713
|
}
|
|
682
714
|
get elevation() {
|
|
683
|
-
return
|
|
715
|
+
return rt(this.getAttribute("elevation"));
|
|
684
716
|
}
|
|
685
717
|
set elevation(t) {
|
|
686
718
|
if (t === "low") {
|
|
@@ -690,7 +722,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
690
722
|
this.setAttribute("elevation", t);
|
|
691
723
|
}
|
|
692
724
|
get indicator() {
|
|
693
|
-
return
|
|
725
|
+
return st(this.getAttribute("indicator"));
|
|
694
726
|
}
|
|
695
727
|
set indicator(t) {
|
|
696
728
|
if (t === "line") {
|
|
@@ -747,16 +779,16 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
747
779
|
}
|
|
748
780
|
setInputValue(t) {
|
|
749
781
|
this._inputValue = t;
|
|
750
|
-
const
|
|
751
|
-
|
|
782
|
+
const e = this.root.querySelector(".input");
|
|
783
|
+
e && (e.value = t);
|
|
752
784
|
}
|
|
753
785
|
getChecked() {
|
|
754
786
|
return this.root.querySelector(".checkbox-input")?.checked ?? this._checked;
|
|
755
787
|
}
|
|
756
788
|
setChecked(t) {
|
|
757
789
|
this._checked = t;
|
|
758
|
-
const
|
|
759
|
-
|
|
790
|
+
const e = this.root.querySelector(".checkbox-input");
|
|
791
|
+
e && (e.checked = t);
|
|
760
792
|
}
|
|
761
793
|
setError(t) {
|
|
762
794
|
this._runtimeError = t, this.state = t ? "error" : "idle", this.requestRender();
|
|
@@ -764,14 +796,14 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
764
796
|
clearError() {
|
|
765
797
|
this._runtimeError = "", this.state === "error" && (this.state = "idle"), this.requestRender();
|
|
766
798
|
}
|
|
767
|
-
close(t = "dismiss",
|
|
768
|
-
this._terminalEmitted || (this._closeMeta = { action: t, source:
|
|
799
|
+
close(t = "dismiss", e, r) {
|
|
800
|
+
this._terminalEmitted || (this._closeMeta = { action: t, source: e, reason: r }, this.hasAttribute("open") && this.removeAttribute("open"), this._syncOpenState());
|
|
769
801
|
}
|
|
770
802
|
_syncFromAttributes() {
|
|
771
803
|
this.hasAttribute("role") || this.setAttribute("role", "alertdialog");
|
|
772
804
|
}
|
|
773
805
|
_syncVisualTokens() {
|
|
774
|
-
this.style.setProperty("--ui-alert-radius",
|
|
806
|
+
this.style.setProperty("--ui-alert-radius", at(this.getAttribute("radius")));
|
|
775
807
|
}
|
|
776
808
|
_syncOpenState() {
|
|
777
809
|
const t = this.hasAttribute("open");
|
|
@@ -782,9 +814,9 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
782
814
|
!t && this._active && this._deactivate();
|
|
783
815
|
}
|
|
784
816
|
_activate() {
|
|
785
|
-
this._active = !0, this._activeHeadless = this.headless, this._terminalEmitted = !1, this._closeMeta = null, l._openStack.includes(this) || l._openStack.push(this), this._lastActive = this.headless ? null :
|
|
817
|
+
this._active = !0, this._activeHeadless = this.headless, this._terminalEmitted = !1, this._closeMeta = null, l._openStack.includes(this) || l._openStack.push(this), this._lastActive = this.headless ? null : T(), this.headless || S(), u() && !this.headless && document.addEventListener("focusin", this._onFocusIn, !0);
|
|
786
818
|
const t = this.dialogId || this._uid;
|
|
787
|
-
this._dispatchWithLegacy("ui-open", "open", { id: t }), this.headless || (this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame =
|
|
819
|
+
this._dispatchWithLegacy("ui-open", "open", { id: t }), this.headless || (this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = k(() => {
|
|
788
820
|
this._focusInitialFrame = 0, this._focusInitial();
|
|
789
821
|
})), this.requestRender();
|
|
790
822
|
}
|
|
@@ -792,7 +824,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
792
824
|
if (!this._active) return;
|
|
793
825
|
this._active = !1;
|
|
794
826
|
const t = l._openStack.lastIndexOf(this);
|
|
795
|
-
if (t >= 0 && l._openStack.splice(t, 1), u() && !this._activeHeadless && document.removeEventListener("focusin", this._onFocusIn, !0), this._activeHeadless ||
|
|
827
|
+
if (t >= 0 && l._openStack.splice(t, 1), u() && !this._activeHeadless && document.removeEventListener("focusin", this._onFocusIn, !0), this._activeHeadless || L(), !this._terminalEmitted) {
|
|
796
828
|
const r = this._closeMeta || { action: "dismiss", source: "abort" }, s = this.dialogId || this._uid;
|
|
797
829
|
r.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id: s }) : r.action === "dismiss" && this._dispatchWithLegacy("ui-dismiss", "dismiss", {
|
|
798
830
|
id: s,
|
|
@@ -805,11 +837,11 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
805
837
|
reason: r.reason
|
|
806
838
|
}), this._terminalEmitted = !0, this._closeMeta = null;
|
|
807
839
|
}
|
|
808
|
-
const
|
|
809
|
-
this._lastActive = null,
|
|
840
|
+
const e = this._lastActive;
|
|
841
|
+
this._lastActive = null, e && !this._activeHeadless && (this._restoreFocusFrame && p(this._restoreFocusFrame), this._restoreFocusFrame = k(() => {
|
|
810
842
|
this._restoreFocusFrame = 0;
|
|
811
843
|
try {
|
|
812
|
-
|
|
844
|
+
e.focus();
|
|
813
845
|
} catch {
|
|
814
846
|
}
|
|
815
847
|
})), this._activeHeadless = !1, this.requestRender();
|
|
@@ -817,15 +849,15 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
817
849
|
_syncActiveEnvironment() {
|
|
818
850
|
if (this._active && this.headless !== this._activeHeadless) {
|
|
819
851
|
if (this.headless) {
|
|
820
|
-
u() && document.removeEventListener("focusin", this._onFocusIn, !0),
|
|
852
|
+
u() && document.removeEventListener("focusin", this._onFocusIn, !0), L(), this._lastActive = null, this._activeHeadless = !0;
|
|
821
853
|
return;
|
|
822
854
|
}
|
|
823
|
-
this._lastActive =
|
|
855
|
+
this._lastActive = T(), S(), u() && document.addEventListener("focusin", this._onFocusIn, !0), this._activeHeadless = !1, this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = k(() => {
|
|
824
856
|
this._focusInitialFrame = 0, this._focusInitial();
|
|
825
857
|
});
|
|
826
858
|
}
|
|
827
859
|
}
|
|
828
|
-
_dispatchWithLegacy(t,
|
|
860
|
+
_dispatchWithLegacy(t, e, r, s = !1) {
|
|
829
861
|
const o = new CustomEvent(t, {
|
|
830
862
|
detail: r,
|
|
831
863
|
bubbles: !0,
|
|
@@ -833,7 +865,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
833
865
|
cancelable: s
|
|
834
866
|
});
|
|
835
867
|
this.dispatchEvent(o);
|
|
836
|
-
const n = new CustomEvent(
|
|
868
|
+
const n = new CustomEvent(e, {
|
|
837
869
|
detail: r,
|
|
838
870
|
bubbles: !0,
|
|
839
871
|
composed: !0,
|
|
@@ -850,9 +882,9 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
850
882
|
return this.root.querySelector(".dialog");
|
|
851
883
|
}
|
|
852
884
|
_collectFocusable(t) {
|
|
853
|
-
return Array.from(t.querySelectorAll(
|
|
854
|
-
if (
|
|
855
|
-
const s = u() ? window.getComputedStyle(
|
|
885
|
+
return Array.from(t.querySelectorAll(X)).filter((e) => {
|
|
886
|
+
if (e.disabled || e.getAttribute("aria-hidden") === "true") return !1;
|
|
887
|
+
const s = u() ? window.getComputedStyle(e) : null;
|
|
856
888
|
return !(s && (s.display === "none" || s.visibility === "hidden"));
|
|
857
889
|
});
|
|
858
890
|
}
|
|
@@ -860,9 +892,9 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
860
892
|
if (!this.open) return;
|
|
861
893
|
const t = this._queryPanel();
|
|
862
894
|
if (!t) return;
|
|
863
|
-
const
|
|
864
|
-
if (
|
|
865
|
-
const n = t.querySelector(
|
|
895
|
+
const e = this.initialFocus;
|
|
896
|
+
if (e) {
|
|
897
|
+
const n = t.querySelector(e);
|
|
866
898
|
if (n && typeof n.focus == "function") {
|
|
867
899
|
n.focus();
|
|
868
900
|
return;
|
|
@@ -877,30 +909,30 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
877
909
|
}
|
|
878
910
|
_handleTab(t) {
|
|
879
911
|
if (t.key !== "Tab") return;
|
|
880
|
-
const
|
|
881
|
-
if (!
|
|
882
|
-
const r = this._collectFocusable(
|
|
912
|
+
const e = this._queryPanel();
|
|
913
|
+
if (!e) return;
|
|
914
|
+
const r = this._collectFocusable(e);
|
|
883
915
|
if (!r.length) {
|
|
884
|
-
t.preventDefault(),
|
|
916
|
+
t.preventDefault(), e.focus();
|
|
885
917
|
return;
|
|
886
918
|
}
|
|
887
919
|
const s = this.root.activeElement || document.activeElement, o = r[0], n = r[r.length - 1];
|
|
888
920
|
if (t.shiftKey) {
|
|
889
|
-
(s === o || !s || !
|
|
921
|
+
(s === o || !s || !e.contains(s)) && (t.preventDefault(), n.focus());
|
|
890
922
|
return;
|
|
891
923
|
}
|
|
892
924
|
s === n && (t.preventDefault(), o.focus());
|
|
893
925
|
}
|
|
894
926
|
_onFocusIn(t) {
|
|
895
927
|
if (!this.open || !this._isTopMost()) return;
|
|
896
|
-
const
|
|
897
|
-
if (!
|
|
928
|
+
const e = this._queryPanel();
|
|
929
|
+
if (!e) return;
|
|
898
930
|
const r = t.target;
|
|
899
|
-
(typeof t.composedPath == "function" ? t.composedPath() : []).includes(
|
|
931
|
+
(typeof t.composedPath == "function" ? t.composedPath() : []).includes(e) || r && e.contains(r) || this._focusInitial();
|
|
900
932
|
}
|
|
901
933
|
_onInput(t) {
|
|
902
|
-
const
|
|
903
|
-
|
|
934
|
+
const e = t.target;
|
|
935
|
+
e && (e.classList.contains("input") && (this._inputValue = e.value), e.classList.contains("checkbox-input") && (this._checked = e.checked), this._dispatchWithLegacy("ui-change", "change", {
|
|
904
936
|
id: this.dialogId || this._uid,
|
|
905
937
|
inputValue: this._inputValue,
|
|
906
938
|
checked: this._checked
|
|
@@ -909,8 +941,8 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
909
941
|
_isInteractionLocked() {
|
|
910
942
|
return this.state === "loading" && this.lockWhileLoading;
|
|
911
943
|
}
|
|
912
|
-
_requestDismiss(t,
|
|
913
|
-
this._isInteractionLocked() || this.close("dismiss", t,
|
|
944
|
+
_requestDismiss(t, e) {
|
|
945
|
+
this._isInteractionLocked() || this.close("dismiss", t, e);
|
|
914
946
|
}
|
|
915
947
|
_handleConfirm() {
|
|
916
948
|
const t = {
|
|
@@ -925,21 +957,21 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
925
957
|
}
|
|
926
958
|
_onClick(t) {
|
|
927
959
|
if (!this.open || !this._isTopMost()) return;
|
|
928
|
-
const
|
|
929
|
-
if (
|
|
930
|
-
if (
|
|
960
|
+
const e = t.target;
|
|
961
|
+
if (e) {
|
|
962
|
+
if (e.classList.contains("backdrop") && this.closeOnBackdrop) {
|
|
931
963
|
this._requestDismiss("backdrop");
|
|
932
964
|
return;
|
|
933
965
|
}
|
|
934
|
-
if (
|
|
966
|
+
if (e.closest(".close")) {
|
|
935
967
|
this._requestDismiss("close-icon");
|
|
936
968
|
return;
|
|
937
969
|
}
|
|
938
|
-
if (
|
|
970
|
+
if (e.closest(".btn-confirm")) {
|
|
939
971
|
this._handleConfirm();
|
|
940
972
|
return;
|
|
941
973
|
}
|
|
942
|
-
|
|
974
|
+
e.closest(".btn-cancel") && this._handleCancel();
|
|
943
975
|
}
|
|
944
976
|
}
|
|
945
977
|
_onKeyDown(t) {
|
|
@@ -955,7 +987,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
955
987
|
// The host carries role="alertdialog" (that attribute is also how the role is configured), so it
|
|
956
988
|
// is exposed as a dialog of its own. Closed, it was an empty, unnamed alert dialog sitting in the
|
|
957
989
|
// page; open, it needs the same name as the dialog inside its shadow root.
|
|
958
|
-
_syncHostSemantics(t,
|
|
990
|
+
_syncHostSemantics(t, e = "", r = !1) {
|
|
959
991
|
if (!t) {
|
|
960
992
|
this.getAttribute("aria-hidden") !== "true" && this.setAttribute("aria-hidden", "true"), this.hasAttribute(c) && (this.removeAttribute("aria-label"), this.removeAttribute(c));
|
|
961
993
|
return;
|
|
@@ -964,25 +996,35 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
964
996
|
this.hasAttribute(c) && this.removeAttribute(c);
|
|
965
997
|
return;
|
|
966
998
|
}
|
|
967
|
-
this.getAttribute("aria-label") !==
|
|
999
|
+
this.getAttribute("aria-label") !== e && this.setAttribute("aria-label", e), this.hasAttribute(c) || this.setAttribute(c, "");
|
|
968
1000
|
}
|
|
969
1001
|
render() {
|
|
970
1002
|
if (!this.open) {
|
|
971
|
-
this._syncHostSemantics(!1)
|
|
1003
|
+
this._syncHostSemantics(!1);
|
|
1004
|
+
const _ = this.root.querySelector(".backdrop");
|
|
1005
|
+
if (this._presented && _) {
|
|
1006
|
+
this._presented = !1, _.removeAttribute("data-instant"), this._finishClose = G(_, () => {
|
|
1007
|
+
this._finishClose = null, this.setContent("");
|
|
1008
|
+
});
|
|
1009
|
+
return;
|
|
1010
|
+
}
|
|
1011
|
+
if (this._finishClose) return;
|
|
1012
|
+
this.setContent("");
|
|
972
1013
|
return;
|
|
973
1014
|
}
|
|
974
|
-
|
|
1015
|
+
this._finishClose?.(), this._finishClose = null;
|
|
1016
|
+
const t = this._config.title ?? this.getAttribute("title") ?? "", e = this._config.description ?? this.getAttribute("description") ?? "", r = this._config.confirmText ?? this.getAttribute("confirm-text") ?? "Confirm", s = this._config.cancelText ?? this.getAttribute("cancel-text") ?? "Cancel", o = this._config.loadingText ?? this.getAttribute("loading-text") ?? "Working...", n = !!this._config.input?.enabled, $ = this._config.input?.label || "Value", B = this._config.input?.placeholder || "", q = !!this._config.input?.required, O = !!this._config.checkbox?.enabled, D = this._config.checkbox?.label || "Remember this choice", M = this.state, b = this._runtimeError || this._config.errorMessage || this.getAttribute("error-message") || "", w = `ui-alert-title-${this._uid}`, A = `ui-alert-description-${this._uid}`, z = `ui-alert-error-${this._uid}`, H = !!this.querySelector('[slot="title"]'), V = !!this.querySelector('[slot="description"]'), R = !!this.querySelector('[slot="icon"]'), W = !!this.querySelector('[slot="footer"]'), P = !!this.querySelector('[slot="content"]'), g = H || !!t, m = V || !!e, j = R || g || m, K = this._config.showCancel ?? this.dismissible, Y = this._config.showClose ?? this.dismissible, N = this.tone, v = this.hasAttribute(c) ? "" : this.getAttribute("aria-label") || "", F = this.getAttribute("aria-labelledby") || "", C = this.getAttribute("aria-describedby") || "", x = F || (g ? w : ""), E = v || (x ? "" : t || e || "Dialog"), U = (this.querySelector('[slot="title"]')?.textContent || "").replace(/\s+/g, " ").trim();
|
|
975
1017
|
this._syncHostSemantics(
|
|
976
1018
|
!0,
|
|
977
|
-
v ||
|
|
1019
|
+
v || U || t || e || "Dialog",
|
|
978
1020
|
!!v || !!F
|
|
979
1021
|
);
|
|
980
1022
|
const d = [];
|
|
981
|
-
|
|
1023
|
+
C ? d.push(C) : (m && d.push(A), b && d.push(z));
|
|
982
1024
|
const h = M === "loading";
|
|
983
1025
|
this.setContent(`
|
|
984
|
-
<style>${
|
|
985
|
-
<div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}">
|
|
1026
|
+
<style>${Q}</style>
|
|
1027
|
+
<div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}" data-state="open" ${this._presented ? "data-instant" : ""}>
|
|
986
1028
|
<section
|
|
987
1029
|
class="dialog"
|
|
988
1030
|
part="dialog"
|
|
@@ -993,66 +1035,68 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
993
1035
|
${d.length ? `aria-describedby="${a(d.join(" "))}"` : ""}
|
|
994
1036
|
tabindex="-1"
|
|
995
1037
|
>
|
|
996
|
-
${
|
|
1038
|
+
${Y ? `<button class="close" part="close" aria-label="Close dialog">
|
|
997
1039
|
<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round">
|
|
998
1040
|
<path d="m6 6 8 8M14 6l-8 8"></path>
|
|
999
1041
|
</svg>
|
|
1000
1042
|
</button>` : ""}
|
|
1001
1043
|
|
|
1002
|
-
${
|
|
1044
|
+
${j ? `<header class="header">
|
|
1003
1045
|
<div class="header-main">
|
|
1004
1046
|
<span class="icon-wrap" part="icon-wrap" aria-hidden="true">
|
|
1005
1047
|
<span class="icon" part="icon">
|
|
1006
|
-
<slot name="icon">${
|
|
1048
|
+
<slot name="icon">${nt(N)}</slot>
|
|
1007
1049
|
</span>
|
|
1008
1050
|
</span>
|
|
1009
1051
|
<div class="heading">
|
|
1010
|
-
${g ? `<h2 id="${
|
|
1011
|
-
${m ? `<p id="${
|
|
1052
|
+
${g ? `<h2 id="${w}" class="title" part="title"><slot name="title">${a(t)}</slot></h2>` : ""}
|
|
1053
|
+
${m ? `<p id="${A}" class="description" part="description"><slot name="description">${a(e)}</slot></p>` : ""}
|
|
1012
1054
|
</div>
|
|
1013
1055
|
</div>
|
|
1014
1056
|
</header>` : ""}
|
|
1015
1057
|
|
|
1016
1058
|
<div class="content" part="content">
|
|
1017
|
-
${
|
|
1059
|
+
${P ? '<slot name="content"></slot>' : "<slot></slot>"}
|
|
1018
1060
|
|
|
1019
1061
|
${n ? `<label class="input-wrap">
|
|
1020
|
-
<span class="label">${a(
|
|
1062
|
+
<span class="label">${a($)}</span>
|
|
1021
1063
|
<input
|
|
1022
1064
|
class="input"
|
|
1023
1065
|
part="input"
|
|
1024
1066
|
type="text"
|
|
1025
1067
|
value="${a(this.getInputValue())}"
|
|
1026
|
-
placeholder="${a(
|
|
1027
|
-
${
|
|
1068
|
+
placeholder="${a(B)}"
|
|
1069
|
+
${q ? "required" : ""}
|
|
1028
1070
|
${h ? "disabled" : ""}
|
|
1029
1071
|
/>
|
|
1030
1072
|
</label>` : ""}
|
|
1031
1073
|
|
|
1032
|
-
${
|
|
1074
|
+
${O ? `<label class="checkbox" part="checkbox">
|
|
1033
1075
|
<span class="checkbox-line">
|
|
1034
1076
|
<input class="checkbox-input" type="checkbox" ${this.getChecked() ? "checked" : ""} ${h ? "disabled" : ""} />
|
|
1035
|
-
<span>${a(
|
|
1077
|
+
<span>${a(D)}</span>
|
|
1036
1078
|
</span>
|
|
1037
1079
|
</label>` : ""}
|
|
1038
1080
|
</div>
|
|
1039
1081
|
|
|
1040
|
-
<div class="error" id="${
|
|
1082
|
+
<div class="error" id="${z}" part="error" aria-live="polite" data-empty="${String(!b)}">${a(b)}</div>
|
|
1041
1083
|
|
|
1042
1084
|
<footer class="footer" part="footer">
|
|
1043
1085
|
${h ? `<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${a(o)}</span></span>` : '<span aria-hidden="true"></span>'}
|
|
1044
1086
|
|
|
1045
|
-
${
|
|
1087
|
+
${W ? '<slot name="footer"></slot>' : `${K ? `<button class="btn btn-cancel" part="cancel" type="button" ${h ? "disabled" : ""}>${a(s)}</button>` : ""}
|
|
1046
1088
|
<button class="btn btn-confirm" part="confirm" type="button" ${h ? "disabled" : ""}>${a(r)}</button>`}
|
|
1047
1089
|
</footer>
|
|
1048
1090
|
</section>
|
|
1049
1091
|
</div>
|
|
1050
1092
|
`);
|
|
1093
|
+
const I = this.root.querySelector(".backdrop");
|
|
1094
|
+
I && !this.headless && J(I, { resetBox: !1 }), this._presented = !0;
|
|
1051
1095
|
}
|
|
1052
1096
|
};
|
|
1053
1097
|
l._openStack = [];
|
|
1054
|
-
let
|
|
1055
|
-
typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog",
|
|
1098
|
+
let y = l;
|
|
1099
|
+
typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog", y);
|
|
1056
1100
|
export {
|
|
1057
|
-
|
|
1101
|
+
y as UIAlertDialog
|
|
1058
1102
|
};
|