@editora/ui-core 0.1.25 → 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/README.md +132 -0
- package/dist/accordion.cjs.js +13 -12
- package/dist/accordion.esm.js +13 -12
- package/dist/alert-dialog.cjs.js +92 -53
- package/dist/alert-dialog.esm.js +211 -159
- package/dist/alert.cjs.js +42 -33
- package/dist/alert.esm.js +80 -71
- 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 +9 -9
- package/dist/animated-text.esm.js +9 -9
- package/dist/app-header.cjs.js +17 -12
- package/dist/app-header.esm.js +18 -13
- package/dist/aspect-ratio.cjs.js +10 -12
- package/dist/aspect-ratio.esm.js +11 -13
- package/dist/avatar.cjs.js +16 -20
- package/dist/avatar.esm.js +16 -20
- 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-D-mXMgqc.js → calendar-CzpWDxLc.js} +56 -46
- package/dist/{calendar-B3PUKHQm.mjs → calendar-DkSDFg33.mjs} +127 -117
- 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 +58 -52
- package/dist/chart.esm.js +101 -95
- package/dist/checkbox.cjs.js +19 -15
- package/dist/checkbox.esm.js +19 -15
- package/dist/collapsible.cjs.js +9 -13
- package/dist/collapsible.esm.js +9 -13
- package/dist/color-picker.cjs.js +38 -19
- package/dist/color-picker.esm.js +134 -115
- package/dist/combobox.cjs.js +60 -57
- package/dist/combobox.esm.js +96 -92
- 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/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-app-header.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-chart.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.map +1 -1
- package/dist/components/ui-hover-card.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-sidebar.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 +21 -18
- package/dist/data-table.esm.js +210 -190
- package/dist/date-field.cjs.js +9 -9
- package/dist/date-field.esm.js +19 -19
- package/dist/date-picker.cjs.js +29 -20
- package/dist/date-picker.esm.js +59 -50
- package/dist/date-range-picker.cjs.js +24 -19
- package/dist/date-range-picker.esm.js +86 -81
- package/dist/date-range-time-picker.cjs.js +27 -20
- package/dist/date-range-time-picker.esm.js +24 -17
- package/dist/date-time-picker.cjs.js +24 -17
- package/dist/date-time-picker.esm.js +89 -82
- package/dist/date-time-utils-C-4eHTyy.js +1 -0
- package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-zAx4ghvC.mjs} +75 -68
- package/dist/description.cjs.js +4 -4
- package/dist/description.esm.js +4 -4
- package/dist/dialog.cjs.js +59 -43
- package/dist/dialog.esm.js +86 -53
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- 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-error.cjs.js +1 -1
- package/dist/field-error.esm.js +7 -7
- package/dist/field.cjs.js +23 -14
- package/dist/field.esm.js +30 -21
- package/dist/fieldset.cjs.js +16 -9
- package/dist/fieldset.esm.js +19 -12
- package/dist/file-upload.cjs.js +79 -37
- package/dist/file-upload.esm.js +154 -112
- package/dist/flex.cjs.js +2 -2
- package/dist/flex.esm.js +8 -8
- package/dist/floating-toolbar.cjs.js +6 -7
- package/dist/floating-toolbar.esm.js +8 -9
- package/dist/form.cjs.js +24 -27
- package/dist/form.esm.js +24 -27
- package/dist/gantt.cjs.js +13 -11
- package/dist/gantt.esm.js +13 -11
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +8 -8
- package/dist/hover-card.esm.js +18 -15
- 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 +50 -22
- package/dist/inline-edit.esm.js +77 -49
- package/dist/input.cjs.js +45 -38
- package/dist/input.esm.js +60 -53
- package/dist/label.cjs.js +6 -6
- package/dist/label.esm.js +6 -6
- 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/masonry-grid.cjs.js +2 -2
- package/dist/masonry-grid.esm.js +11 -11
- package/dist/{menu-item-styles-IGSFLAHu.mjs → menu-item-styles-CdqxPUuw.mjs} +15 -15
- package/dist/{menu-item-styles-B4onAr4C.js → menu-item-styles-DUdyjQ7i.js} +10 -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 +53 -40
- package/dist/multi-select.esm.js +87 -73
- package/dist/navigation-menu.cjs.js +10 -10
- package/dist/navigation-menu.esm.js +33 -33
- package/dist/number-field.cjs.js +28 -17
- package/dist/number-field.esm.js +37 -26
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +10 -10
- package/dist/odometer.cjs.js +9 -9
- package/dist/odometer.esm.js +17 -17
- 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 +39 -34
- package/dist/password-field.esm.js +63 -58
- package/dist/pin-input.cjs.js +18 -14
- package/dist/pin-input.esm.js +24 -20
- package/dist/placement-grid.cjs.js +1 -1
- package/dist/placement-grid.esm.js +1 -1
- 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.cjs.js +1 -1
- package/dist/portal.d.ts +3 -1
- package/dist/portal.d.ts.map +1 -1
- package/dist/portal.esm.js +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/presence.cjs.js +1 -1
- package/dist/presence.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 +14 -14
- package/dist/quick-actions.esm.js +12 -12
- package/dist/radio-group.cjs.js +50 -26
- package/dist/radio-group.esm.js +53 -29
- package/dist/radio.cjs.js +16 -13
- package/dist/radio.esm.js +16 -13
- package/dist/rating.cjs.js +11 -15
- package/dist/rating.esm.js +48 -50
- package/dist/{runtime-CFnK53iC.mjs → runtime-BRT7E4A8.mjs} +563 -531
- package/dist/runtime-CXw4SGV9.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 +42 -75
- package/dist/select.esm.js +57 -89
- 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/separator.cjs.js +6 -6
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +29 -28
- package/dist/sidebar.esm.js +32 -31
- 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/slot.cjs.js +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/sortable.cjs.js +10 -11
- package/dist/sortable.esm.js +10 -11
- package/dist/spinning-text.cjs.js +4 -13
- package/dist/spinning-text.esm.js +4 -13
- package/dist/split-button.cjs.js +7 -7
- package/dist/split-button.esm.js +17 -16
- 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 +101 -26
- package/dist/tabs.esm.js +187 -112
- package/dist/tags-input.cjs.js +43 -17
- package/dist/tags-input.esm.js +75 -49
- package/dist/textarea.cjs.js +34 -35
- package/dist/textarea.esm.js +50 -51
- package/dist/theme.d.ts +25 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +8 -8
- package/dist/time-field.esm.js +29 -29
- package/dist/time-picker.cjs.js +17 -14
- package/dist/time-picker.esm.js +28 -25
- package/dist/timeline.cjs.js +10 -10
- package/dist/timeline.esm.js +7 -7
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +2 -2
- 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 +37 -38
- package/dist/transfer-list.esm.js +32 -33
- 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 +51 -39
- package/dist/wizard.esm.js +51 -39
- 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));
|
|
@@ -20,12 +21,16 @@ const U = `
|
|
|
20
21
|
--ui-alert-z: 1301;
|
|
21
22
|
--ui-alert-backdrop-z: 1300;
|
|
22
23
|
--ui-alert-focus: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
|
|
23
|
-
--ui-alert-danger: var(--ui-color-danger, #dc2626);
|
|
24
|
+
--ui-alert-danger: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
25
|
+
/* A solid dialog: the fill, and the text colour that reads on it. */
|
|
26
|
+
--ui-alert-solid-bg: var(--ui-alert-accent);
|
|
27
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-primary, #ffffff);
|
|
24
28
|
--ui-alert-backdrop: var(--base-alert-dialog-backdrop, var(--color-overlay, rgba(2, 6, 23, 0.52)));
|
|
25
29
|
--ui-alert-btn-bg: color-mix(in srgb, var(--ui-alert-bg-base) 90%, var(--ui-color-background, #ffffff) 10%);
|
|
26
30
|
--ui-alert-btn-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
|
|
27
31
|
--ui-alert-btn-hover: color-mix(in srgb, var(--ui-alert-btn-bg) 76%, var(--ui-color-border, #cbd5e1) 24%);
|
|
28
|
-
|
|
32
|
+
/* Default confirm is the primary fill. A tone sets its own fill and text below, so the text always reads. */
|
|
33
|
+
--ui-alert-confirm-bg: var(--ui-color-primary, #2563eb);
|
|
29
34
|
--ui-alert-confirm-color: var(--ui-color-foreground-on-primary, #ffffff);
|
|
30
35
|
--ui-alert-icon-bg: color-mix(in srgb, var(--ui-alert-accent) 14%, transparent);
|
|
31
36
|
--ui-alert-icon-color: var(--ui-alert-accent);
|
|
@@ -37,8 +42,8 @@ const U = `
|
|
|
37
42
|
--ui-alert-description-size: 13px;
|
|
38
43
|
--ui-alert-description-line-height: 20px;
|
|
39
44
|
--ui-alert-icon-size: 28px;
|
|
40
|
-
--ui-alert-button-height: var(--base-button-height-md,
|
|
41
|
-
--ui-alert-button-radius: var(--ui-radius,
|
|
45
|
+
--ui-alert-button-height: var(--base-button-height-md, var(--ui-control-height-2, 32px));
|
|
46
|
+
--ui-alert-button-radius: var(--ui-radius, 6px);
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
:host([tone='info']) {
|
|
@@ -47,14 +52,25 @@ const U = `
|
|
|
47
52
|
|
|
48
53
|
:host([tone='success']) {
|
|
49
54
|
--ui-alert-accent: var(--ui-color-success, #15803d);
|
|
55
|
+
--ui-alert-solid-bg: var(--ui-color-success-solid, var(--ui-alert-accent));
|
|
56
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-success, #ffffff);
|
|
57
|
+
--ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 76%, #000000);
|
|
58
|
+
--ui-alert-confirm-color: #ffffff;
|
|
50
59
|
}
|
|
51
60
|
|
|
52
61
|
:host([tone='warning']) {
|
|
53
62
|
--ui-alert-accent: var(--ui-color-warning, #b45309);
|
|
63
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-warning, #ffffff);
|
|
64
|
+
--ui-alert-confirm-bg: var(--ui-alert-accent);
|
|
65
|
+
--ui-alert-confirm-color: var(--ui-color-foreground-on-warning, #ffffff);
|
|
54
66
|
}
|
|
55
67
|
|
|
56
68
|
:host([tone='danger']) {
|
|
57
69
|
--ui-alert-accent: var(--ui-color-danger, #dc2626);
|
|
70
|
+
--ui-alert-solid-bg: var(--ui-color-danger-solid, var(--ui-alert-accent));
|
|
71
|
+
--ui-alert-on-accent: var(--ui-color-foreground-on-danger, #ffffff);
|
|
72
|
+
--ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 80%, #000000);
|
|
73
|
+
--ui-alert-confirm-color: #ffffff;
|
|
58
74
|
}
|
|
59
75
|
|
|
60
76
|
:host([size='sm']),
|
|
@@ -68,7 +84,7 @@ const U = `
|
|
|
68
84
|
--ui-alert-description-size: 12px;
|
|
69
85
|
--ui-alert-description-line-height: 18px;
|
|
70
86
|
--ui-alert-icon-size: 24px;
|
|
71
|
-
--ui-alert-button-height: var(--base-button-height-sm,
|
|
87
|
+
--ui-alert-button-height: var(--base-button-height-sm, var(--ui-control-height-1, 24px));
|
|
72
88
|
}
|
|
73
89
|
|
|
74
90
|
:host([size='md']),
|
|
@@ -88,7 +104,7 @@ const U = `
|
|
|
88
104
|
--ui-alert-description-size: 14px;
|
|
89
105
|
--ui-alert-description-line-height: 22px;
|
|
90
106
|
--ui-alert-icon-size: 32px;
|
|
91
|
-
--ui-alert-button-height: var(--base-button-height-lg,
|
|
107
|
+
--ui-alert-button-height: var(--base-button-height-lg, var(--ui-control-height-3, 40px));
|
|
92
108
|
}
|
|
93
109
|
|
|
94
110
|
:host([variant='outline']) {
|
|
@@ -103,17 +119,17 @@ const U = `
|
|
|
103
119
|
}
|
|
104
120
|
|
|
105
121
|
:host([variant='solid']) {
|
|
106
|
-
--ui-alert-bg: var(--ui-alert-
|
|
122
|
+
--ui-alert-bg: var(--ui-alert-solid-bg);
|
|
107
123
|
--ui-alert-border: 1px solid color-mix(in srgb, #000000 16%, transparent);
|
|
108
|
-
--ui-alert-text:
|
|
109
|
-
--ui-alert-muted: color-mix(in srgb,
|
|
124
|
+
--ui-alert-text: var(--ui-alert-on-accent);
|
|
125
|
+
--ui-alert-muted: color-mix(in srgb, var(--ui-alert-on-accent) 98%, transparent);
|
|
110
126
|
--ui-alert-btn-bg: color-mix(in srgb, #000000 14%, transparent);
|
|
111
|
-
--ui-alert-btn-border: color-mix(in srgb,
|
|
127
|
+
--ui-alert-btn-border: color-mix(in srgb, var(--ui-alert-on-accent) 30%, transparent);
|
|
112
128
|
--ui-alert-btn-hover: color-mix(in srgb, #000000 22%, transparent);
|
|
113
129
|
--ui-alert-confirm-bg: color-mix(in srgb, #000000 30%, transparent);
|
|
114
|
-
--ui-alert-confirm-color:
|
|
115
|
-
--ui-alert-icon-bg: color-mix(in srgb,
|
|
116
|
-
--ui-alert-icon-color:
|
|
130
|
+
--ui-alert-confirm-color: var(--ui-alert-on-accent);
|
|
131
|
+
--ui-alert-icon-bg: color-mix(in srgb, var(--ui-alert-on-accent) 18%, transparent);
|
|
132
|
+
--ui-alert-icon-color: var(--ui-alert-on-accent);
|
|
117
133
|
}
|
|
118
134
|
|
|
119
135
|
:host([elevation='none']) {
|
|
@@ -136,8 +152,16 @@ const U = `
|
|
|
136
152
|
place-items: center;
|
|
137
153
|
background: var(--ui-alert-backdrop);
|
|
138
154
|
backdrop-filter: saturate(1.04) blur(3px);
|
|
139
|
-
|
|
140
|
-
|
|
155
|
+
/* The backdrop goes to the top layer (popover); undo the popover user-agent box. */
|
|
156
|
+
inline-size: 100%;
|
|
157
|
+
block-size: 100%;
|
|
158
|
+
max-inline-size: none;
|
|
159
|
+
max-block-size: none;
|
|
160
|
+
margin: 0;
|
|
161
|
+
padding: 0;
|
|
162
|
+
border: 0;
|
|
163
|
+
overflow: visible;
|
|
164
|
+
color: inherit;
|
|
141
165
|
}
|
|
142
166
|
|
|
143
167
|
.dialog {
|
|
@@ -154,13 +178,9 @@ const U = `
|
|
|
154
178
|
padding: var(--ui-alert-padding);
|
|
155
179
|
outline: none;
|
|
156
180
|
overflow: clip;
|
|
157
|
-
opacity: 0;
|
|
158
|
-
transform: translateY(12px) scale(0.985);
|
|
159
181
|
transition:
|
|
160
182
|
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);
|
|
183
|
+
box-shadow var(--ui-alert-duration) var(--ui-alert-easing);
|
|
164
184
|
}
|
|
165
185
|
|
|
166
186
|
.dialog::before {
|
|
@@ -181,13 +201,33 @@ const U = `
|
|
|
181
201
|
display: none;
|
|
182
202
|
}
|
|
183
203
|
|
|
184
|
-
|
|
185
|
-
|
|
204
|
+
/* Open and close are animations on data-state; the surface is created and removed, which a transition cannot play. */
|
|
205
|
+
.backdrop[data-state='open']:not([data-instant]) {
|
|
206
|
+
animation: ui-alert-backdrop-in 150ms ease-out backwards;
|
|
186
207
|
}
|
|
187
208
|
|
|
188
|
-
.backdrop[data-
|
|
189
|
-
|
|
190
|
-
|
|
209
|
+
.backdrop[data-state='open']:not([data-instant]) .dialog {
|
|
210
|
+
animation: ui-alert-dialog-in 150ms var(--ui-motion-enter-easing, cubic-bezier(0.16, 1, 0.3, 1)) backwards;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.backdrop[data-state='closed'] {
|
|
214
|
+
animation: ui-alert-backdrop-out 100ms ease-in both;
|
|
215
|
+
pointer-events: none;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.backdrop[data-state='closed'] .dialog {
|
|
219
|
+
animation: ui-alert-dialog-out 100ms var(--ui-motion-exit-easing, cubic-bezier(0.4, 0, 1, 1)) both;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@keyframes ui-alert-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
|
|
223
|
+
@keyframes ui-alert-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
|
|
224
|
+
@keyframes ui-alert-dialog-in {
|
|
225
|
+
from { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.96); }
|
|
226
|
+
to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
|
|
227
|
+
}
|
|
228
|
+
@keyframes ui-alert-dialog-out {
|
|
229
|
+
from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
|
|
230
|
+
to { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.96); }
|
|
191
231
|
}
|
|
192
232
|
|
|
193
233
|
.dialog:focus-visible {
|
|
@@ -307,12 +347,12 @@ const U = `
|
|
|
307
347
|
|
|
308
348
|
.input {
|
|
309
349
|
width: 100%;
|
|
310
|
-
border-radius: var(--ui-radius,
|
|
350
|
+
border-radius: var(--ui-radius, 6px);
|
|
311
351
|
border: var(--base-input-border, 1px solid color-mix(in srgb, var(--ui-alert-border-color) 88%, transparent));
|
|
312
352
|
background: var(--base-input-bg, color-mix(in srgb, var(--ui-alert-bg-base) 94%, #ffffff 6%));
|
|
313
353
|
color: inherit;
|
|
314
354
|
box-sizing: border-box;
|
|
315
|
-
min-height: var(--base-input-height-md,
|
|
355
|
+
min-height: var(--base-input-height-md, var(--ui-control-height-2, 32px));
|
|
316
356
|
padding: 9px 12px;
|
|
317
357
|
font: inherit;
|
|
318
358
|
line-height: 1.35;
|
|
@@ -499,62 +539,62 @@ const U = `
|
|
|
499
539
|
border: 1px solid CanvasText;
|
|
500
540
|
}
|
|
501
541
|
}
|
|
502
|
-
`,
|
|
503
|
-
function
|
|
504
|
-
if (
|
|
505
|
-
const
|
|
506
|
-
return
|
|
542
|
+
`, X = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
543
|
+
function f(i, t) {
|
|
544
|
+
if (i == null) return t;
|
|
545
|
+
const e = i.trim().toLowerCase();
|
|
546
|
+
return e !== "false" && e !== "0" && e !== "off";
|
|
507
547
|
}
|
|
508
|
-
function
|
|
509
|
-
return String(
|
|
548
|
+
function s(i) {
|
|
549
|
+
return String(i).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
510
550
|
}
|
|
511
|
-
function
|
|
512
|
-
return
|
|
551
|
+
function tt(i) {
|
|
552
|
+
return i === "info" || i === "success" || i === "warning" || i === "danger" ? i : "neutral";
|
|
513
553
|
}
|
|
514
|
-
function
|
|
515
|
-
return
|
|
554
|
+
function et(i) {
|
|
555
|
+
return i === "sm" || i === "1" ? "sm" : i === "lg" || i === "3" ? "lg" : "md";
|
|
516
556
|
}
|
|
517
|
-
function
|
|
518
|
-
return
|
|
557
|
+
function it(i) {
|
|
558
|
+
return i === "soft" || i === "outline" || i === "solid" ? i : "surface";
|
|
519
559
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
560
|
+
function rt(i) {
|
|
561
|
+
return i === "none" || i === "high" ? i : "low";
|
|
522
562
|
}
|
|
523
|
-
function
|
|
524
|
-
return
|
|
563
|
+
function at(i) {
|
|
564
|
+
return i === "none" ? "none" : "line";
|
|
525
565
|
}
|
|
526
|
-
function
|
|
527
|
-
if (
|
|
528
|
-
const
|
|
529
|
-
return
|
|
566
|
+
function st(i, t = "var(--base-alert-dialog-radius, var(--ui-radius, 6px))") {
|
|
567
|
+
if (i == null) return t;
|
|
568
|
+
const e = i.trim().toLowerCase();
|
|
569
|
+
return e ? e === "full" || e === "pill" ? "999px" : /^-?\d+(\.\d+)?$/.test(e) ? `${e}px` : i : t;
|
|
530
570
|
}
|
|
531
|
-
const
|
|
532
|
-
function
|
|
533
|
-
return
|
|
571
|
+
const ot = /* @__PURE__ */ new Set(["tone", "size", "variant", "elevation", "indicator", "radius"]);
|
|
572
|
+
function nt(i) {
|
|
573
|
+
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
574
|
}
|
|
535
575
|
function u() {
|
|
536
576
|
return typeof window < "u" && typeof document < "u";
|
|
537
577
|
}
|
|
538
|
-
function
|
|
578
|
+
function T() {
|
|
539
579
|
if (!u()) return null;
|
|
540
|
-
const
|
|
541
|
-
return
|
|
580
|
+
const i = document.activeElement;
|
|
581
|
+
return i instanceof HTMLElement ? i : null;
|
|
542
582
|
}
|
|
543
|
-
function
|
|
544
|
-
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(() =>
|
|
583
|
+
function k(i) {
|
|
584
|
+
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => i()) : window.setTimeout(i, 16);
|
|
545
585
|
}
|
|
546
|
-
function p(
|
|
547
|
-
if (
|
|
586
|
+
function p(i) {
|
|
587
|
+
if (i) {
|
|
548
588
|
if (typeof cancelAnimationFrame == "function") {
|
|
549
|
-
cancelAnimationFrame(
|
|
589
|
+
cancelAnimationFrame(i);
|
|
550
590
|
return;
|
|
551
591
|
}
|
|
552
|
-
window.clearTimeout(
|
|
592
|
+
window.clearTimeout(i);
|
|
553
593
|
}
|
|
554
594
|
}
|
|
555
|
-
const c = "data-ui-auto-name", l = class l extends
|
|
595
|
+
const c = "data-ui-auto-name", l = class l extends Z {
|
|
556
596
|
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;
|
|
597
|
+
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
598
|
}
|
|
559
599
|
static get observedAttributes() {
|
|
560
600
|
return [
|
|
@@ -590,9 +630,9 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
590
630
|
disconnectedCallback() {
|
|
591
631
|
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
632
|
}
|
|
593
|
-
attributeChangedCallback(t,
|
|
594
|
-
if (
|
|
595
|
-
if (
|
|
633
|
+
attributeChangedCallback(t, e, r) {
|
|
634
|
+
if (e !== r) {
|
|
635
|
+
if (ot.has(t)) {
|
|
596
636
|
this._syncVisualTokens();
|
|
597
637
|
return;
|
|
598
638
|
}
|
|
@@ -620,25 +660,25 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
620
660
|
t ? this.setAttribute("headless", "") : this.removeAttribute("headless");
|
|
621
661
|
}
|
|
622
662
|
get dismissible() {
|
|
623
|
-
return
|
|
663
|
+
return f(this.getAttribute("dismissible"), !0);
|
|
624
664
|
}
|
|
625
665
|
set dismissible(t) {
|
|
626
666
|
this.setAttribute("dismissible", String(t));
|
|
627
667
|
}
|
|
628
668
|
get closeOnEsc() {
|
|
629
|
-
return
|
|
669
|
+
return f(this.getAttribute("close-on-esc"), this.dismissible);
|
|
630
670
|
}
|
|
631
671
|
set closeOnEsc(t) {
|
|
632
672
|
this.setAttribute("close-on-esc", String(t));
|
|
633
673
|
}
|
|
634
674
|
get closeOnBackdrop() {
|
|
635
|
-
return
|
|
675
|
+
return f(this.getAttribute("close-on-backdrop"), this.dismissible);
|
|
636
676
|
}
|
|
637
677
|
set closeOnBackdrop(t) {
|
|
638
678
|
this.setAttribute("close-on-backdrop", String(t));
|
|
639
679
|
}
|
|
640
680
|
get lockWhileLoading() {
|
|
641
|
-
return
|
|
681
|
+
return f(this.getAttribute("lock-while-loading"), !0);
|
|
642
682
|
}
|
|
643
683
|
set lockWhileLoading(t) {
|
|
644
684
|
this.setAttribute("lock-while-loading", String(t));
|
|
@@ -650,7 +690,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
650
690
|
this.setAttribute("role", t);
|
|
651
691
|
}
|
|
652
692
|
get tone() {
|
|
653
|
-
return
|
|
693
|
+
return tt(this.getAttribute("tone"));
|
|
654
694
|
}
|
|
655
695
|
set tone(t) {
|
|
656
696
|
if (t === "neutral") {
|
|
@@ -660,7 +700,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
660
700
|
this.setAttribute("tone", t);
|
|
661
701
|
}
|
|
662
702
|
get size() {
|
|
663
|
-
return
|
|
703
|
+
return et(this.getAttribute("size"));
|
|
664
704
|
}
|
|
665
705
|
set size(t) {
|
|
666
706
|
if (t === "md") {
|
|
@@ -670,7 +710,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
670
710
|
this.setAttribute("size", t);
|
|
671
711
|
}
|
|
672
712
|
get variant() {
|
|
673
|
-
return
|
|
713
|
+
return it(this.getAttribute("variant"));
|
|
674
714
|
}
|
|
675
715
|
set variant(t) {
|
|
676
716
|
if (t === "surface") {
|
|
@@ -680,7 +720,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
680
720
|
this.setAttribute("variant", t);
|
|
681
721
|
}
|
|
682
722
|
get elevation() {
|
|
683
|
-
return
|
|
723
|
+
return rt(this.getAttribute("elevation"));
|
|
684
724
|
}
|
|
685
725
|
set elevation(t) {
|
|
686
726
|
if (t === "low") {
|
|
@@ -690,7 +730,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
690
730
|
this.setAttribute("elevation", t);
|
|
691
731
|
}
|
|
692
732
|
get indicator() {
|
|
693
|
-
return
|
|
733
|
+
return at(this.getAttribute("indicator"));
|
|
694
734
|
}
|
|
695
735
|
set indicator(t) {
|
|
696
736
|
if (t === "line") {
|
|
@@ -747,16 +787,16 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
747
787
|
}
|
|
748
788
|
setInputValue(t) {
|
|
749
789
|
this._inputValue = t;
|
|
750
|
-
const
|
|
751
|
-
|
|
790
|
+
const e = this.root.querySelector(".input");
|
|
791
|
+
e && (e.value = t);
|
|
752
792
|
}
|
|
753
793
|
getChecked() {
|
|
754
794
|
return this.root.querySelector(".checkbox-input")?.checked ?? this._checked;
|
|
755
795
|
}
|
|
756
796
|
setChecked(t) {
|
|
757
797
|
this._checked = t;
|
|
758
|
-
const
|
|
759
|
-
|
|
798
|
+
const e = this.root.querySelector(".checkbox-input");
|
|
799
|
+
e && (e.checked = t);
|
|
760
800
|
}
|
|
761
801
|
setError(t) {
|
|
762
802
|
this._runtimeError = t, this.state = t ? "error" : "idle", this.requestRender();
|
|
@@ -764,14 +804,14 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
764
804
|
clearError() {
|
|
765
805
|
this._runtimeError = "", this.state === "error" && (this.state = "idle"), this.requestRender();
|
|
766
806
|
}
|
|
767
|
-
close(t = "dismiss",
|
|
768
|
-
this._terminalEmitted || (this._closeMeta = { action: t, source:
|
|
807
|
+
close(t = "dismiss", e, r) {
|
|
808
|
+
this._terminalEmitted || (this._closeMeta = { action: t, source: e, reason: r }, this.hasAttribute("open") && this.removeAttribute("open"), this._syncOpenState());
|
|
769
809
|
}
|
|
770
810
|
_syncFromAttributes() {
|
|
771
811
|
this.hasAttribute("role") || this.setAttribute("role", "alertdialog");
|
|
772
812
|
}
|
|
773
813
|
_syncVisualTokens() {
|
|
774
|
-
this.style.setProperty("--ui-alert-radius",
|
|
814
|
+
this.style.setProperty("--ui-alert-radius", st(this.getAttribute("radius")));
|
|
775
815
|
}
|
|
776
816
|
_syncOpenState() {
|
|
777
817
|
const t = this.hasAttribute("open");
|
|
@@ -782,9 +822,9 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
782
822
|
!t && this._active && this._deactivate();
|
|
783
823
|
}
|
|
784
824
|
_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 :
|
|
825
|
+
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
826
|
const t = this.dialogId || this._uid;
|
|
787
|
-
this._dispatchWithLegacy("ui-open", "open", { id: t }), this.headless || (this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame =
|
|
827
|
+
this._dispatchWithLegacy("ui-open", "open", { id: t }), this.headless || (this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = k(() => {
|
|
788
828
|
this._focusInitialFrame = 0, this._focusInitial();
|
|
789
829
|
})), this.requestRender();
|
|
790
830
|
}
|
|
@@ -792,24 +832,24 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
792
832
|
if (!this._active) return;
|
|
793
833
|
this._active = !1;
|
|
794
834
|
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 ||
|
|
796
|
-
const r = this._closeMeta || { action: "dismiss", source: "abort" },
|
|
797
|
-
r.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id:
|
|
798
|
-
id:
|
|
835
|
+
if (t >= 0 && l._openStack.splice(t, 1), u() && !this._activeHeadless && document.removeEventListener("focusin", this._onFocusIn, !0), this._activeHeadless || L(), !this._terminalEmitted) {
|
|
836
|
+
const r = this._closeMeta || { action: "dismiss", source: "abort" }, a = this.dialogId || this._uid;
|
|
837
|
+
r.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id: a }) : r.action === "dismiss" && this._dispatchWithLegacy("ui-dismiss", "dismiss", {
|
|
838
|
+
id: a,
|
|
799
839
|
source: r.source || "abort",
|
|
800
840
|
reason: r.reason
|
|
801
841
|
}), this._dispatchWithLegacy("ui-close", "close", {
|
|
802
|
-
id:
|
|
842
|
+
id: a,
|
|
803
843
|
action: r.action,
|
|
804
844
|
source: r.source,
|
|
805
845
|
reason: r.reason
|
|
806
846
|
}), this._terminalEmitted = !0, this._closeMeta = null;
|
|
807
847
|
}
|
|
808
|
-
const
|
|
809
|
-
this._lastActive = null,
|
|
848
|
+
const e = this._lastActive;
|
|
849
|
+
this._lastActive = null, e && !this._activeHeadless && (this._restoreFocusFrame && p(this._restoreFocusFrame), this._restoreFocusFrame = k(() => {
|
|
810
850
|
this._restoreFocusFrame = 0;
|
|
811
851
|
try {
|
|
812
|
-
|
|
852
|
+
e.focus();
|
|
813
853
|
} catch {
|
|
814
854
|
}
|
|
815
855
|
})), this._activeHeadless = !1, this.requestRender();
|
|
@@ -817,27 +857,27 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
817
857
|
_syncActiveEnvironment() {
|
|
818
858
|
if (this._active && this.headless !== this._activeHeadless) {
|
|
819
859
|
if (this.headless) {
|
|
820
|
-
u() && document.removeEventListener("focusin", this._onFocusIn, !0),
|
|
860
|
+
u() && document.removeEventListener("focusin", this._onFocusIn, !0), L(), this._lastActive = null, this._activeHeadless = !0;
|
|
821
861
|
return;
|
|
822
862
|
}
|
|
823
|
-
this._lastActive =
|
|
863
|
+
this._lastActive = T(), S(), u() && document.addEventListener("focusin", this._onFocusIn, !0), this._activeHeadless = !1, this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = k(() => {
|
|
824
864
|
this._focusInitialFrame = 0, this._focusInitial();
|
|
825
865
|
});
|
|
826
866
|
}
|
|
827
867
|
}
|
|
828
|
-
_dispatchWithLegacy(t,
|
|
868
|
+
_dispatchWithLegacy(t, e, r, a = !1) {
|
|
829
869
|
const o = new CustomEvent(t, {
|
|
830
870
|
detail: r,
|
|
831
871
|
bubbles: !0,
|
|
832
872
|
composed: !0,
|
|
833
|
-
cancelable:
|
|
873
|
+
cancelable: a
|
|
834
874
|
});
|
|
835
875
|
this.dispatchEvent(o);
|
|
836
|
-
const n = new CustomEvent(
|
|
876
|
+
const n = new CustomEvent(e, {
|
|
837
877
|
detail: r,
|
|
838
878
|
bubbles: !0,
|
|
839
879
|
composed: !0,
|
|
840
|
-
cancelable:
|
|
880
|
+
cancelable: a
|
|
841
881
|
});
|
|
842
882
|
return this.dispatchEvent(n), o;
|
|
843
883
|
}
|
|
@@ -850,19 +890,19 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
850
890
|
return this.root.querySelector(".dialog");
|
|
851
891
|
}
|
|
852
892
|
_collectFocusable(t) {
|
|
853
|
-
return Array.from(t.querySelectorAll(
|
|
854
|
-
if (
|
|
855
|
-
const
|
|
856
|
-
return !(
|
|
893
|
+
return Array.from(t.querySelectorAll(X)).filter((e) => {
|
|
894
|
+
if (e.disabled || e.getAttribute("aria-hidden") === "true") return !1;
|
|
895
|
+
const a = u() ? window.getComputedStyle(e) : null;
|
|
896
|
+
return !(a && (a.display === "none" || a.visibility === "hidden"));
|
|
857
897
|
});
|
|
858
898
|
}
|
|
859
899
|
_focusInitial() {
|
|
860
900
|
if (!this.open) return;
|
|
861
901
|
const t = this._queryPanel();
|
|
862
902
|
if (!t) return;
|
|
863
|
-
const
|
|
864
|
-
if (
|
|
865
|
-
const n = t.querySelector(
|
|
903
|
+
const e = this.initialFocus;
|
|
904
|
+
if (e) {
|
|
905
|
+
const n = t.querySelector(e);
|
|
866
906
|
if (n && typeof n.focus == "function") {
|
|
867
907
|
n.focus();
|
|
868
908
|
return;
|
|
@@ -877,30 +917,30 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
877
917
|
}
|
|
878
918
|
_handleTab(t) {
|
|
879
919
|
if (t.key !== "Tab") return;
|
|
880
|
-
const
|
|
881
|
-
if (!
|
|
882
|
-
const r = this._collectFocusable(
|
|
920
|
+
const e = this._queryPanel();
|
|
921
|
+
if (!e) return;
|
|
922
|
+
const r = this._collectFocusable(e);
|
|
883
923
|
if (!r.length) {
|
|
884
|
-
t.preventDefault(),
|
|
924
|
+
t.preventDefault(), e.focus();
|
|
885
925
|
return;
|
|
886
926
|
}
|
|
887
|
-
const
|
|
927
|
+
const a = this.root.activeElement || document.activeElement, o = r[0], n = r[r.length - 1];
|
|
888
928
|
if (t.shiftKey) {
|
|
889
|
-
(
|
|
929
|
+
(a === o || !a || !e.contains(a)) && (t.preventDefault(), n.focus());
|
|
890
930
|
return;
|
|
891
931
|
}
|
|
892
|
-
|
|
932
|
+
a === n && (t.preventDefault(), o.focus());
|
|
893
933
|
}
|
|
894
934
|
_onFocusIn(t) {
|
|
895
935
|
if (!this.open || !this._isTopMost()) return;
|
|
896
|
-
const
|
|
897
|
-
if (!
|
|
936
|
+
const e = this._queryPanel();
|
|
937
|
+
if (!e) return;
|
|
898
938
|
const r = t.target;
|
|
899
|
-
(typeof t.composedPath == "function" ? t.composedPath() : []).includes(
|
|
939
|
+
(typeof t.composedPath == "function" ? t.composedPath() : []).includes(e) || r && e.contains(r) || this._focusInitial();
|
|
900
940
|
}
|
|
901
941
|
_onInput(t) {
|
|
902
|
-
const
|
|
903
|
-
|
|
942
|
+
const e = t.target;
|
|
943
|
+
e && (e.classList.contains("input") && (this._inputValue = e.value), e.classList.contains("checkbox-input") && (this._checked = e.checked), this._dispatchWithLegacy("ui-change", "change", {
|
|
904
944
|
id: this.dialogId || this._uid,
|
|
905
945
|
inputValue: this._inputValue,
|
|
906
946
|
checked: this._checked
|
|
@@ -909,8 +949,8 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
909
949
|
_isInteractionLocked() {
|
|
910
950
|
return this.state === "loading" && this.lockWhileLoading;
|
|
911
951
|
}
|
|
912
|
-
_requestDismiss(t,
|
|
913
|
-
this._isInteractionLocked() || this.close("dismiss", t,
|
|
952
|
+
_requestDismiss(t, e) {
|
|
953
|
+
this._isInteractionLocked() || this.close("dismiss", t, e);
|
|
914
954
|
}
|
|
915
955
|
_handleConfirm() {
|
|
916
956
|
const t = {
|
|
@@ -925,21 +965,21 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
925
965
|
}
|
|
926
966
|
_onClick(t) {
|
|
927
967
|
if (!this.open || !this._isTopMost()) return;
|
|
928
|
-
const
|
|
929
|
-
if (
|
|
930
|
-
if (
|
|
968
|
+
const e = t.target;
|
|
969
|
+
if (e) {
|
|
970
|
+
if (e.classList.contains("backdrop") && this.closeOnBackdrop) {
|
|
931
971
|
this._requestDismiss("backdrop");
|
|
932
972
|
return;
|
|
933
973
|
}
|
|
934
|
-
if (
|
|
974
|
+
if (e.closest(".close")) {
|
|
935
975
|
this._requestDismiss("close-icon");
|
|
936
976
|
return;
|
|
937
977
|
}
|
|
938
|
-
if (
|
|
978
|
+
if (e.closest(".btn-confirm")) {
|
|
939
979
|
this._handleConfirm();
|
|
940
980
|
return;
|
|
941
981
|
}
|
|
942
|
-
|
|
982
|
+
e.closest(".btn-cancel") && this._handleCancel();
|
|
943
983
|
}
|
|
944
984
|
}
|
|
945
985
|
_onKeyDown(t) {
|
|
@@ -955,7 +995,7 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
955
995
|
// The host carries role="alertdialog" (that attribute is also how the role is configured), so it
|
|
956
996
|
// is exposed as a dialog of its own. Closed, it was an empty, unnamed alert dialog sitting in the
|
|
957
997
|
// page; open, it needs the same name as the dialog inside its shadow root.
|
|
958
|
-
_syncHostSemantics(t,
|
|
998
|
+
_syncHostSemantics(t, e = "", r = !1) {
|
|
959
999
|
if (!t) {
|
|
960
1000
|
this.getAttribute("aria-hidden") !== "true" && this.setAttribute("aria-hidden", "true"), this.hasAttribute(c) && (this.removeAttribute("aria-label"), this.removeAttribute(c));
|
|
961
1001
|
return;
|
|
@@ -964,95 +1004,107 @@ const c = "data-ui-auto-name", l = class l extends N {
|
|
|
964
1004
|
this.hasAttribute(c) && this.removeAttribute(c);
|
|
965
1005
|
return;
|
|
966
1006
|
}
|
|
967
|
-
this.getAttribute("aria-label") !==
|
|
1007
|
+
this.getAttribute("aria-label") !== e && this.setAttribute("aria-label", e), this.hasAttribute(c) || this.setAttribute(c, "");
|
|
968
1008
|
}
|
|
969
1009
|
render() {
|
|
970
1010
|
if (!this.open) {
|
|
971
|
-
this._syncHostSemantics(!1)
|
|
1011
|
+
this._syncHostSemantics(!1);
|
|
1012
|
+
const _ = this.root.querySelector(".backdrop");
|
|
1013
|
+
if (this._presented && _) {
|
|
1014
|
+
this._presented = !1, _.removeAttribute("data-instant"), this._finishClose = G(_, () => {
|
|
1015
|
+
this._finishClose = null, this.setContent("");
|
|
1016
|
+
});
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
if (this._finishClose) return;
|
|
1020
|
+
this.setContent("");
|
|
972
1021
|
return;
|
|
973
1022
|
}
|
|
974
|
-
|
|
1023
|
+
this._finishClose?.(), this._finishClose = null;
|
|
1024
|
+
const t = this._config.title ?? this.getAttribute("title") ?? "", e = this._config.description ?? this.getAttribute("description") ?? "", r = this._config.confirmText ?? this.getAttribute("confirm-text") ?? "Confirm", a = 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
1025
|
this._syncHostSemantics(
|
|
976
1026
|
!0,
|
|
977
|
-
v ||
|
|
1027
|
+
v || U || t || e || "Dialog",
|
|
978
1028
|
!!v || !!F
|
|
979
1029
|
);
|
|
980
1030
|
const d = [];
|
|
981
|
-
|
|
1031
|
+
C ? d.push(C) : (m && d.push(A), b && d.push(z));
|
|
982
1032
|
const h = M === "loading";
|
|
983
1033
|
this.setContent(`
|
|
984
|
-
<style>${
|
|
985
|
-
<div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}">
|
|
1034
|
+
<style>${Q}</style>
|
|
1035
|
+
<div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}" data-state="open" ${this._presented ? "data-instant" : ""}>
|
|
986
1036
|
<section
|
|
987
1037
|
class="dialog"
|
|
988
1038
|
part="dialog"
|
|
989
|
-
role="${
|
|
1039
|
+
role="${s(this.roleType)}"
|
|
990
1040
|
aria-modal="true"
|
|
991
|
-
${E ? `aria-label="${
|
|
992
|
-
${x ? `aria-labelledby="${
|
|
993
|
-
${d.length ? `aria-describedby="${
|
|
1041
|
+
${E ? `aria-label="${s(E)}"` : ""}
|
|
1042
|
+
${x ? `aria-labelledby="${s(x)}"` : ""}
|
|
1043
|
+
${d.length ? `aria-describedby="${s(d.join(" "))}"` : ""}
|
|
994
1044
|
tabindex="-1"
|
|
995
1045
|
>
|
|
996
|
-
${
|
|
1046
|
+
${Y ? `<button class="close" part="close" aria-label="Close dialog">
|
|
997
1047
|
<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round">
|
|
998
1048
|
<path d="m6 6 8 8M14 6l-8 8"></path>
|
|
999
1049
|
</svg>
|
|
1000
1050
|
</button>` : ""}
|
|
1001
1051
|
|
|
1002
|
-
${
|
|
1052
|
+
${j ? `<header class="header">
|
|
1003
1053
|
<div class="header-main">
|
|
1004
1054
|
<span class="icon-wrap" part="icon-wrap" aria-hidden="true">
|
|
1005
1055
|
<span class="icon" part="icon">
|
|
1006
|
-
<slot name="icon">${
|
|
1056
|
+
<slot name="icon">${nt(N)}</slot>
|
|
1007
1057
|
</span>
|
|
1008
1058
|
</span>
|
|
1009
1059
|
<div class="heading">
|
|
1010
|
-
${g ? `<h2 id="${
|
|
1011
|
-
${m ? `<p id="${
|
|
1060
|
+
${g ? `<h2 id="${w}" class="title" part="title"><slot name="title">${s(t)}</slot></h2>` : ""}
|
|
1061
|
+
${m ? `<p id="${A}" class="description" part="description"><slot name="description">${s(e)}</slot></p>` : ""}
|
|
1012
1062
|
</div>
|
|
1013
1063
|
</div>
|
|
1014
1064
|
</header>` : ""}
|
|
1015
1065
|
|
|
1016
1066
|
<div class="content" part="content">
|
|
1017
|
-
${
|
|
1067
|
+
${P ? '<slot name="content"></slot>' : "<slot></slot>"}
|
|
1018
1068
|
|
|
1019
1069
|
${n ? `<label class="input-wrap">
|
|
1020
|
-
<span class="label">${
|
|
1070
|
+
<span class="label">${s($)}</span>
|
|
1021
1071
|
<input
|
|
1022
1072
|
class="input"
|
|
1023
1073
|
part="input"
|
|
1024
1074
|
type="text"
|
|
1025
|
-
value="${
|
|
1026
|
-
placeholder="${
|
|
1027
|
-
${
|
|
1075
|
+
value="${s(this.getInputValue())}"
|
|
1076
|
+
placeholder="${s(B)}"
|
|
1077
|
+
${q ? "required" : ""}
|
|
1028
1078
|
${h ? "disabled" : ""}
|
|
1029
1079
|
/>
|
|
1030
1080
|
</label>` : ""}
|
|
1031
1081
|
|
|
1032
|
-
${
|
|
1082
|
+
${O ? `<label class="checkbox" part="checkbox">
|
|
1033
1083
|
<span class="checkbox-line">
|
|
1034
1084
|
<input class="checkbox-input" type="checkbox" ${this.getChecked() ? "checked" : ""} ${h ? "disabled" : ""} />
|
|
1035
|
-
<span>${
|
|
1085
|
+
<span>${s(D)}</span>
|
|
1036
1086
|
</span>
|
|
1037
1087
|
</label>` : ""}
|
|
1038
1088
|
</div>
|
|
1039
1089
|
|
|
1040
|
-
<div class="error" id="${
|
|
1090
|
+
<div class="error" id="${z}" part="error" aria-live="polite" data-empty="${String(!b)}">${s(b)}</div>
|
|
1041
1091
|
|
|
1042
1092
|
<footer class="footer" part="footer">
|
|
1043
|
-
${h ? `<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${
|
|
1093
|
+
${h ? `<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${s(o)}</span></span>` : '<span aria-hidden="true"></span>'}
|
|
1044
1094
|
|
|
1045
|
-
${
|
|
1046
|
-
<button class="btn btn-confirm" part="confirm" type="button" ${h ? "disabled" : ""}>${
|
|
1095
|
+
${W ? '<slot name="footer"></slot>' : `${K ? `<button class="btn btn-cancel" part="cancel" type="button" ${h ? "disabled" : ""}>${s(a)}</button>` : ""}
|
|
1096
|
+
<button class="btn btn-confirm" part="confirm" type="button" ${h ? "disabled" : ""}>${s(r)}</button>`}
|
|
1047
1097
|
</footer>
|
|
1048
1098
|
</section>
|
|
1049
1099
|
</div>
|
|
1050
1100
|
`);
|
|
1101
|
+
const I = this.root.querySelector(".backdrop");
|
|
1102
|
+
I && !this.headless && J(I, { resetBox: !1 }), this._presented = !0;
|
|
1051
1103
|
}
|
|
1052
1104
|
};
|
|
1053
1105
|
l._openStack = [];
|
|
1054
|
-
let
|
|
1055
|
-
typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog",
|
|
1106
|
+
let y = l;
|
|
1107
|
+
typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog", y);
|
|
1056
1108
|
export {
|
|
1057
|
-
|
|
1109
|
+
y as UIAlertDialog
|
|
1058
1110
|
};
|