@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
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import "./portal-
|
|
2
|
-
import "./positioner-
|
|
3
|
-
function
|
|
1
|
+
import "./portal-DeaM1tYY.mjs";
|
|
2
|
+
import "./positioner-BE8Nbho2.mjs";
|
|
3
|
+
function A() {
|
|
4
4
|
return typeof window < "u" && typeof document < "u";
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
return
|
|
6
|
+
function B(n) {
|
|
7
|
+
return n ? typeof n == "string" ? n : n instanceof Error && n.message ? n.message : "Something went wrong. Please try again." : "Something went wrong. Please try again.";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function N(n) {
|
|
10
|
+
return n === "replace" || n === "stack" ? n : "queue";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return `ui-alert-dialog-${
|
|
12
|
+
function L(n) {
|
|
13
|
+
return `ui-alert-dialog-${n}`;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
15
|
+
function V(n, a) {
|
|
16
|
+
const e = n.kind === "alert" && a.action === "cancel" ? "dismiss" : a.action, t = n.dialog?.getChecked();
|
|
17
|
+
if (n.kind === "prompt") {
|
|
18
|
+
const i = n.dialog?.getInputValue() ?? n.value ?? "";
|
|
19
19
|
return {
|
|
20
|
-
id:
|
|
21
|
-
action:
|
|
22
|
-
value:
|
|
23
|
-
checked:
|
|
20
|
+
id: n.id,
|
|
21
|
+
action: e,
|
|
22
|
+
value: i,
|
|
23
|
+
checked: t,
|
|
24
24
|
source: a.source,
|
|
25
25
|
reason: a.reason
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
return {
|
|
29
|
-
id:
|
|
30
|
-
action:
|
|
31
|
-
value:
|
|
32
|
-
checked:
|
|
29
|
+
id: n.id,
|
|
30
|
+
action: e,
|
|
31
|
+
value: n.value,
|
|
32
|
+
checked: t,
|
|
33
33
|
source: a.source,
|
|
34
34
|
reason: a.reason
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
-
id:
|
|
37
|
+
function y(n, a, e) {
|
|
38
|
+
return n.kind === "prompt" ? {
|
|
39
|
+
id: n.id,
|
|
40
40
|
action: "dismiss",
|
|
41
|
-
value:
|
|
42
|
-
checked:
|
|
41
|
+
value: n.dialog?.getInputValue() ?? n.value ?? "",
|
|
42
|
+
checked: n.dialog?.getChecked(),
|
|
43
43
|
source: a,
|
|
44
|
-
reason:
|
|
44
|
+
reason: e
|
|
45
45
|
} : {
|
|
46
|
-
id:
|
|
46
|
+
id: n.id,
|
|
47
47
|
action: "dismiss",
|
|
48
|
-
value:
|
|
49
|
-
checked:
|
|
48
|
+
value: n.value,
|
|
49
|
+
checked: n.dialog?.getChecked(),
|
|
50
50
|
source: a,
|
|
51
|
-
reason:
|
|
51
|
+
reason: e
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
54
|
+
function Z(n) {
|
|
55
|
+
return n === "esc" || n === "backdrop" || n === "close-icon" || n === "abort" || n === "unmount" || n === "replace" || n === "programmatic" ? n : "abort";
|
|
56
56
|
}
|
|
57
|
-
class
|
|
57
|
+
class U {
|
|
58
58
|
constructor(a) {
|
|
59
59
|
this._container = null, this._ownsContainer = !1, this._queue = [], this._active = [], this._disposed = !1, this._seed = 0, this._defaults = {}, this._container = a ?? null;
|
|
60
60
|
}
|
|
@@ -75,127 +75,127 @@ class $ {
|
|
|
75
75
|
}
|
|
76
76
|
destroy(a = "unmount") {
|
|
77
77
|
this._disposed = !0;
|
|
78
|
-
const
|
|
78
|
+
const e = [...this._active, ...this._queue];
|
|
79
79
|
this._queue = [];
|
|
80
|
-
for (const
|
|
81
|
-
this._settle(
|
|
80
|
+
for (const t of e)
|
|
81
|
+
this._settle(t, y(t, a), !1);
|
|
82
82
|
this._active = [], this._ownsContainer && this._container && this._container.parentElement && this._container.parentElement.removeChild(this._container), this._container = null, this._ownsContainer = !1;
|
|
83
83
|
}
|
|
84
|
-
_enqueue(a,
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
const
|
|
88
|
-
id:
|
|
84
|
+
_enqueue(a, e) {
|
|
85
|
+
const t = this._mergeOptions(e);
|
|
86
|
+
if (!A() || this._disposed) {
|
|
87
|
+
const s = {
|
|
88
|
+
id: t.id || L(++this._seed),
|
|
89
89
|
action: "dismiss",
|
|
90
90
|
source: "unmount"
|
|
91
91
|
};
|
|
92
|
-
return Promise.resolve(
|
|
92
|
+
return Promise.resolve(s);
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
return new Promise((
|
|
96
|
-
const
|
|
97
|
-
id:
|
|
94
|
+
const i = t.id || L(++this._seed), r = N(t.mode);
|
|
95
|
+
return new Promise((s) => {
|
|
96
|
+
const c = {
|
|
97
|
+
id: i,
|
|
98
98
|
kind: a,
|
|
99
|
-
mode:
|
|
100
|
-
options:
|
|
99
|
+
mode: r,
|
|
100
|
+
options: t,
|
|
101
101
|
settled: !1,
|
|
102
102
|
processing: !1,
|
|
103
|
-
resolve:
|
|
103
|
+
resolve: s,
|
|
104
104
|
cleanup: []
|
|
105
105
|
};
|
|
106
|
-
if (
|
|
107
|
-
this._settle(
|
|
106
|
+
if (t.signal?.aborted) {
|
|
107
|
+
this._settle(c, y(c, "abort"), !1);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
111
|
-
const
|
|
112
|
-
|
|
110
|
+
if (r === "replace") {
|
|
111
|
+
const d = this._active[this._active.length - 1];
|
|
112
|
+
d && this._settle(d, y(d, "replace", "replace"), !1, !1), this._open(c);
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (
|
|
116
|
-
this._open(
|
|
115
|
+
if (r === "stack") {
|
|
116
|
+
this._open(c);
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
if (this._active.length > 0) {
|
|
120
|
-
this._queue.push(
|
|
120
|
+
this._queue.push(c);
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
this._open(
|
|
123
|
+
this._open(c);
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
_open(a) {
|
|
127
|
-
const
|
|
128
|
-
if (!
|
|
129
|
-
this._settle(a,
|
|
127
|
+
const e = this._ensureContainer();
|
|
128
|
+
if (!e) {
|
|
129
|
+
this._settle(a, y(a, "unmount"), !1);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
|
-
const
|
|
133
|
-
a.dialog =
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
const
|
|
132
|
+
const t = document.createElement("ui-alert-dialog");
|
|
133
|
+
a.dialog = t, a.checked = !!a.options.checkbox?.defaultChecked;
|
|
134
|
+
const i = this._buildConfig(a);
|
|
135
|
+
t.dialogId = a.id, t.config = i;
|
|
136
|
+
const r = (d) => {
|
|
137
137
|
if (a.settled) return;
|
|
138
|
-
const
|
|
139
|
-
a.value =
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
142
|
-
|
|
138
|
+
const f = d.detail;
|
|
139
|
+
a.value = f?.inputValue, a.checked = f?.checked;
|
|
140
|
+
const g = this._validatePrompt(a);
|
|
141
|
+
if (g) {
|
|
142
|
+
d.preventDefault(), t.setError(g);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
if (!a.options.onConfirm) {
|
|
146
|
-
|
|
146
|
+
t.clearError();
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
d.preventDefault(), a.processing = !0, t.state = "loading", t.clearError(), Promise.resolve(
|
|
150
150
|
a.options.onConfirm({
|
|
151
151
|
id: a.id,
|
|
152
152
|
value: a.value,
|
|
153
153
|
checked: a.checked,
|
|
154
|
-
dialog:
|
|
154
|
+
dialog: t,
|
|
155
155
|
signal: a.options.signal
|
|
156
156
|
})
|
|
157
157
|
).then(() => {
|
|
158
|
-
a.processing = !1,
|
|
159
|
-
}).catch((
|
|
160
|
-
a.processing = !1,
|
|
158
|
+
a.processing = !1, t.state = "idle", t.clearError(), a.settled || t.close("confirm");
|
|
159
|
+
}).catch((m) => {
|
|
160
|
+
a.processing = !1, t.state = "error", t.setError(B(m));
|
|
161
161
|
});
|
|
162
|
-
},
|
|
163
|
-
a.settled || (a.value =
|
|
164
|
-
},
|
|
162
|
+
}, s = () => {
|
|
163
|
+
a.settled || (a.value = t.getInputValue(), a.checked = t.getChecked(), t.state === "error" && t.clearError());
|
|
164
|
+
}, c = (d) => {
|
|
165
165
|
if (a.settled) return;
|
|
166
|
-
const
|
|
167
|
-
this._handleClose(a,
|
|
166
|
+
const f = d.detail;
|
|
167
|
+
this._handleClose(a, f);
|
|
168
168
|
};
|
|
169
|
-
if (
|
|
170
|
-
const
|
|
171
|
-
a.settled || this._settle(a,
|
|
169
|
+
if (t.addEventListener("ui-confirm", r), t.addEventListener("ui-change", s), t.addEventListener("ui-close", c), a.cleanup.push(() => t.removeEventListener("ui-confirm", r)), a.cleanup.push(() => t.removeEventListener("ui-change", s)), a.cleanup.push(() => t.removeEventListener("ui-close", c)), a.options.signal) {
|
|
170
|
+
const d = () => {
|
|
171
|
+
a.settled || this._settle(a, y(a, "abort"), !1);
|
|
172
172
|
};
|
|
173
|
-
a.options.signal.addEventListener("abort",
|
|
173
|
+
a.options.signal.addEventListener("abort", d, { once: !0 }), a.cleanup.push(() => a.options.signal?.removeEventListener("abort", d));
|
|
174
174
|
}
|
|
175
|
-
this._active.push(a),
|
|
175
|
+
this._active.push(a), e.appendChild(t), t.open = !0, this._updateStackZIndex();
|
|
176
176
|
}
|
|
177
177
|
_validatePrompt(a) {
|
|
178
178
|
if (a.kind !== "prompt") return null;
|
|
179
|
-
const
|
|
180
|
-
return
|
|
179
|
+
const t = a.options.input, i = a.dialog?.getInputValue() ?? a.value ?? "";
|
|
180
|
+
return t?.required && !i.trim() ? "Please enter a value." : t?.validate ? t.validate(i) : null;
|
|
181
181
|
}
|
|
182
|
-
_settle(a,
|
|
182
|
+
_settle(a, e, t, i = !0) {
|
|
183
183
|
if (!a.settled) {
|
|
184
|
-
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((
|
|
185
|
-
const
|
|
186
|
-
if (!
|
|
187
|
-
const
|
|
188
|
-
|
|
184
|
+
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((r) => r !== a), this._queue = this._queue.filter((r) => r !== a), a.dialog) {
|
|
185
|
+
const r = a.dialog;
|
|
186
|
+
if (!t && r.open) {
|
|
187
|
+
const s = Z(e.source);
|
|
188
|
+
r.close("dismiss", s, e.reason);
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
r.parentElement && r.parentElement.removeChild(r);
|
|
191
191
|
}
|
|
192
|
-
a.resolve(
|
|
192
|
+
a.resolve(e), this._updateStackZIndex(), !this._disposed && i && this._drainQueue();
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
_cleanupRequest(a) {
|
|
196
|
-
for (const
|
|
196
|
+
for (const e of a.cleanup.splice(0))
|
|
197
197
|
try {
|
|
198
|
-
|
|
198
|
+
e();
|
|
199
199
|
} catch {
|
|
200
200
|
}
|
|
201
201
|
}
|
|
@@ -205,44 +205,44 @@ class $ {
|
|
|
205
205
|
a && this._open(a);
|
|
206
206
|
}
|
|
207
207
|
_buildConfig(a) {
|
|
208
|
-
const
|
|
208
|
+
const e = a.options, t = a.kind === "prompt", i = a.kind === "alert", r = t ? e.input : void 0;
|
|
209
209
|
return {
|
|
210
210
|
id: a.id,
|
|
211
|
-
title:
|
|
212
|
-
description:
|
|
213
|
-
confirmText:
|
|
214
|
-
cancelText:
|
|
215
|
-
loadingText:
|
|
216
|
-
errorMessage:
|
|
217
|
-
dismissible:
|
|
218
|
-
closeOnEsc:
|
|
219
|
-
closeOnBackdrop:
|
|
220
|
-
lockWhileLoading:
|
|
221
|
-
role:
|
|
222
|
-
tone:
|
|
223
|
-
size:
|
|
224
|
-
variant:
|
|
225
|
-
radius:
|
|
226
|
-
elevation:
|
|
227
|
-
indicator:
|
|
228
|
-
initialFocus:
|
|
229
|
-
ariaLabel:
|
|
230
|
-
ariaLabelledby:
|
|
231
|
-
ariaDescribedby:
|
|
232
|
-
headless:
|
|
233
|
-
showCancel: !
|
|
234
|
-
showClose:
|
|
211
|
+
title: e.title,
|
|
212
|
+
description: e.description,
|
|
213
|
+
confirmText: e.confirmText || (i ? "OK" : "Confirm"),
|
|
214
|
+
cancelText: e.cancelText || "Cancel",
|
|
215
|
+
loadingText: e.loadingText,
|
|
216
|
+
errorMessage: e.errorMessage,
|
|
217
|
+
dismissible: e.dismissible ?? !0,
|
|
218
|
+
closeOnEsc: e.closeOnEsc,
|
|
219
|
+
closeOnBackdrop: e.closeOnBackdrop,
|
|
220
|
+
lockWhileLoading: e.lockWhileLoading ?? !0,
|
|
221
|
+
role: e.role || "alertdialog",
|
|
222
|
+
tone: e.tone || (i ? "info" : t ? "neutral" : "warning"),
|
|
223
|
+
size: e.size || "md",
|
|
224
|
+
variant: e.variant || "surface",
|
|
225
|
+
radius: e.radius,
|
|
226
|
+
elevation: e.elevation || "low",
|
|
227
|
+
indicator: e.indicator || "line",
|
|
228
|
+
initialFocus: e.initialFocus,
|
|
229
|
+
ariaLabel: e.ariaLabel,
|
|
230
|
+
ariaLabelledby: e.ariaLabelledby,
|
|
231
|
+
ariaDescribedby: e.ariaDescribedby,
|
|
232
|
+
headless: e.headless,
|
|
233
|
+
showCancel: !i,
|
|
234
|
+
showClose: e.dismissible ?? !0,
|
|
235
235
|
input: {
|
|
236
|
-
enabled:
|
|
237
|
-
label:
|
|
238
|
-
placeholder:
|
|
239
|
-
value:
|
|
240
|
-
required:
|
|
236
|
+
enabled: t,
|
|
237
|
+
label: r?.label,
|
|
238
|
+
placeholder: r?.placeholder,
|
|
239
|
+
value: r?.defaultValue || "",
|
|
240
|
+
required: r?.required
|
|
241
241
|
},
|
|
242
242
|
checkbox: {
|
|
243
|
-
enabled: !!
|
|
244
|
-
label:
|
|
245
|
-
checked:
|
|
243
|
+
enabled: !!e.checkbox?.enabled,
|
|
244
|
+
label: e.checkbox?.label,
|
|
245
|
+
checked: e.checkbox?.defaultChecked
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
248
|
}
|
|
@@ -255,84 +255,84 @@ class $ {
|
|
|
255
255
|
signal: a.options.signal
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
_handleClose(a,
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
258
|
+
_handleClose(a, e) {
|
|
259
|
+
const t = V(a, e);
|
|
260
|
+
if (e.action === "cancel" && a.options.onCancel) {
|
|
261
261
|
Promise.resolve(a.options.onCancel(this._buildLifecycleContext(a))).finally(() => {
|
|
262
|
-
this._settle(a,
|
|
262
|
+
this._settle(a, t, !0);
|
|
263
263
|
});
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
266
|
-
if (
|
|
266
|
+
if (e.action === "dismiss" && a.options.onDismiss) {
|
|
267
267
|
Promise.resolve(
|
|
268
268
|
a.options.onDismiss({
|
|
269
269
|
...this._buildLifecycleContext(a),
|
|
270
|
-
source:
|
|
271
|
-
reason:
|
|
270
|
+
source: e.source || "programmatic",
|
|
271
|
+
reason: e.reason
|
|
272
272
|
})
|
|
273
273
|
).finally(() => {
|
|
274
|
-
this._settle(a,
|
|
274
|
+
this._settle(a, t, !0);
|
|
275
275
|
});
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
|
-
this._settle(a,
|
|
278
|
+
this._settle(a, t, !0);
|
|
279
279
|
}
|
|
280
280
|
_mergeOptions(a) {
|
|
281
|
-
const
|
|
281
|
+
const e = this._defaults;
|
|
282
282
|
return {
|
|
283
|
-
...
|
|
283
|
+
...e,
|
|
284
284
|
...a,
|
|
285
285
|
checkbox: {
|
|
286
|
-
...
|
|
286
|
+
...e.checkbox || {},
|
|
287
287
|
...a.checkbox || {}
|
|
288
288
|
}
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
291
|
_ensureContainer() {
|
|
292
|
-
if (!
|
|
292
|
+
if (!A()) return null;
|
|
293
293
|
if (this._container && this._container.isConnected) return this._container;
|
|
294
294
|
let a = document.querySelector('[data-ui-alert-dialog-host="true"]');
|
|
295
295
|
return a ? this._ownsContainer = !1 : (a = document.createElement("div"), a.setAttribute("data-ui-alert-dialog-host", "true"), a.style.position = "relative", a.style.zIndex = "1000", document.body.appendChild(a), this._ownsContainer = !0), this._container = a, a;
|
|
296
296
|
}
|
|
297
297
|
_updateStackZIndex() {
|
|
298
298
|
for (let a = 0; a < this._active.length; a += 1) {
|
|
299
|
-
const
|
|
300
|
-
|
|
299
|
+
const e = this._active[a];
|
|
300
|
+
e.dialog && (e.dialog.style.setProperty("--ui-alert-backdrop-z", String(1e3 + a * 2)), e.dialog.style.setProperty("--ui-alert-z", String(1001 + a * 2)));
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
let
|
|
305
|
-
function
|
|
306
|
-
return new
|
|
304
|
+
let h = null;
|
|
305
|
+
function Q(n = {}) {
|
|
306
|
+
return new U(n.container ?? null);
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
return
|
|
308
|
+
function T() {
|
|
309
|
+
return h || (h = Q()), h;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
return
|
|
311
|
+
function ma(n = {}) {
|
|
312
|
+
return T().alert(n);
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
return
|
|
314
|
+
function xa(n = {}) {
|
|
315
|
+
return T().confirm(n);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
return
|
|
317
|
+
function ha(n = {}) {
|
|
318
|
+
return T().prompt(n);
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
|
|
320
|
+
function ba(n = "programmatic") {
|
|
321
|
+
h && (h.destroy(n), h = null);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function I() {
|
|
324
324
|
return typeof window < "u" && typeof document < "u";
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
return
|
|
326
|
+
function W(n) {
|
|
327
|
+
return n === "replace" || n === "stack" ? n : "queue";
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
return `ui-dialog-${
|
|
329
|
+
function O(n) {
|
|
330
|
+
return `ui-dialog-${n}`;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
return
|
|
332
|
+
function G(n) {
|
|
333
|
+
return n ? typeof n == "string" ? n : n instanceof Error && n.message ? n.message : "Something went wrong. Please try again." : "Something went wrong. Please try again.";
|
|
334
334
|
}
|
|
335
|
-
class
|
|
335
|
+
class X {
|
|
336
336
|
constructor(a) {
|
|
337
337
|
this._container = null, this._ownsContainer = !1, this._queue = [], this._active = [], this._disposed = !1, this._seed = 0, this._container = a ?? null;
|
|
338
338
|
}
|
|
@@ -347,11 +347,11 @@ class Z {
|
|
|
347
347
|
}
|
|
348
348
|
destroy(a = "unmount") {
|
|
349
349
|
this._disposed = !0;
|
|
350
|
-
const
|
|
350
|
+
const e = [...this._active, ...this._queue];
|
|
351
351
|
this._queue = [];
|
|
352
|
-
for (const
|
|
353
|
-
this._settle(
|
|
354
|
-
id:
|
|
352
|
+
for (const t of e)
|
|
353
|
+
this._settle(t, {
|
|
354
|
+
id: t.id,
|
|
355
355
|
action: "dismiss",
|
|
356
356
|
source: a,
|
|
357
357
|
reason: a
|
|
@@ -359,45 +359,45 @@ class Z {
|
|
|
359
359
|
this._active = [], this._ownsContainer && this._container && this._container.parentElement && this._container.parentElement.removeChild(this._container), this._container = null, this._ownsContainer = !1;
|
|
360
360
|
}
|
|
361
361
|
_enqueue(a) {
|
|
362
|
-
if (!
|
|
362
|
+
if (!I() || this._disposed)
|
|
363
363
|
return Promise.resolve({
|
|
364
|
-
id: a.id ||
|
|
364
|
+
id: a.id || O(++this._seed),
|
|
365
365
|
action: "dismiss",
|
|
366
366
|
source: "unmount"
|
|
367
367
|
});
|
|
368
|
-
const
|
|
369
|
-
return new Promise((
|
|
370
|
-
const
|
|
371
|
-
id:
|
|
372
|
-
mode:
|
|
368
|
+
const e = a.id || O(++this._seed), t = W(a.mode);
|
|
369
|
+
return new Promise((i) => {
|
|
370
|
+
const r = {
|
|
371
|
+
id: e,
|
|
372
|
+
mode: t,
|
|
373
373
|
options: a,
|
|
374
374
|
settled: !1,
|
|
375
|
-
resolve:
|
|
375
|
+
resolve: i,
|
|
376
376
|
cleanup: []
|
|
377
377
|
};
|
|
378
378
|
if (a.signal?.aborted) {
|
|
379
|
-
this._settle(
|
|
379
|
+
this._settle(r, { id: e, action: "dismiss", source: "abort" }, !1);
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
|
-
if (
|
|
383
|
-
const
|
|
384
|
-
|
|
382
|
+
if (t === "replace") {
|
|
383
|
+
const s = this._active[this._active.length - 1];
|
|
384
|
+
s && this._settle(s, { id: s.id, action: "dismiss", source: "replace", reason: "replace" }, !1, !1), this._open(r);
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
|
-
if (
|
|
388
|
-
this._open(
|
|
387
|
+
if (t === "stack") {
|
|
388
|
+
this._open(r);
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
if (this._active.length > 0) {
|
|
392
|
-
this._queue.push(
|
|
392
|
+
this._queue.push(r);
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
|
-
this._open(
|
|
395
|
+
this._open(r);
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
398
|
_open(a) {
|
|
399
|
-
const
|
|
400
|
-
if (!
|
|
399
|
+
const e = this._ensureContainer();
|
|
400
|
+
if (!e) {
|
|
401
401
|
this._settle(a, {
|
|
402
402
|
id: a.id,
|
|
403
403
|
action: "dismiss",
|
|
@@ -405,65 +405,65 @@ class Z {
|
|
|
405
405
|
}, !1);
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
const
|
|
409
|
-
a.dialog =
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
const
|
|
408
|
+
const t = document.createElement("ui-dialog");
|
|
409
|
+
a.dialog = t;
|
|
410
|
+
const i = this._buildConfig(a.options, a.id);
|
|
411
|
+
t.dialogId = a.id, t.config = i;
|
|
412
|
+
const r = (c) => {
|
|
413
413
|
if (a.settled) return;
|
|
414
|
-
const
|
|
415
|
-
if (a.resultFormData =
|
|
416
|
-
|
|
414
|
+
const d = c.detail;
|
|
415
|
+
if (a.resultFormData = d?.formData, !a.options.onSubmit) {
|
|
416
|
+
t.clearError();
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
|
-
|
|
419
|
+
c.preventDefault(), t.state = "loading", t.clearError(), Promise.resolve(
|
|
420
420
|
a.options.onSubmit({
|
|
421
421
|
id: a.id,
|
|
422
|
-
dialog:
|
|
422
|
+
dialog: t,
|
|
423
423
|
signal: a.options.signal,
|
|
424
|
-
formData:
|
|
424
|
+
formData: d?.formData
|
|
425
425
|
})
|
|
426
426
|
).then(() => {
|
|
427
|
-
a.settled || (
|
|
428
|
-
}).catch((
|
|
429
|
-
|
|
427
|
+
a.settled || (t.state = "idle", t.clearError(), t.close("submit"));
|
|
428
|
+
}).catch((f) => {
|
|
429
|
+
t.state = "error", t.setError(G(f));
|
|
430
430
|
});
|
|
431
|
-
},
|
|
431
|
+
}, s = (c) => {
|
|
432
432
|
if (a.settled) return;
|
|
433
|
-
const
|
|
433
|
+
const d = c.detail;
|
|
434
434
|
this._settle(a, {
|
|
435
435
|
id: a.id,
|
|
436
|
-
action:
|
|
437
|
-
source:
|
|
438
|
-
reason:
|
|
436
|
+
action: d.action,
|
|
437
|
+
source: d.source,
|
|
438
|
+
reason: d.reason,
|
|
439
439
|
formData: a.resultFormData
|
|
440
440
|
}, !0);
|
|
441
441
|
};
|
|
442
|
-
if (
|
|
443
|
-
const
|
|
442
|
+
if (t.addEventListener("ui-submit", r), t.addEventListener("ui-close", s), a.cleanup.push(() => t.removeEventListener("ui-submit", r)), a.cleanup.push(() => t.removeEventListener("ui-close", s)), a.options.signal) {
|
|
443
|
+
const c = () => {
|
|
444
444
|
a.settled || this._settle(a, {
|
|
445
445
|
id: a.id,
|
|
446
446
|
action: "dismiss",
|
|
447
447
|
source: "abort"
|
|
448
448
|
}, !1);
|
|
449
449
|
};
|
|
450
|
-
a.options.signal.addEventListener("abort",
|
|
450
|
+
a.options.signal.addEventListener("abort", c, { once: !0 }), a.cleanup.push(() => a.options.signal?.removeEventListener("abort", c));
|
|
451
451
|
}
|
|
452
|
-
this._active.push(a),
|
|
452
|
+
this._active.push(a), e.appendChild(t), t.openDialog(), this._updateStackZIndex();
|
|
453
453
|
}
|
|
454
|
-
_settle(a,
|
|
454
|
+
_settle(a, e, t, i = !0) {
|
|
455
455
|
if (!a.settled) {
|
|
456
|
-
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((
|
|
457
|
-
const
|
|
458
|
-
!
|
|
456
|
+
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((r) => r !== a), this._queue = this._queue.filter((r) => r !== a), a.dialog) {
|
|
457
|
+
const r = a.dialog;
|
|
458
|
+
!t && r.open && r.close("dismiss", e.source || "abort", e.reason), r.parentElement && r.parentElement.removeChild(r);
|
|
459
459
|
}
|
|
460
|
-
a.resolve(
|
|
460
|
+
a.resolve(e), this._updateStackZIndex(), !this._disposed && i && this._drainQueue();
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
_cleanupRequest(a) {
|
|
464
|
-
for (const
|
|
464
|
+
for (const e of a.cleanup.splice(0))
|
|
465
465
|
try {
|
|
466
|
-
|
|
466
|
+
e();
|
|
467
467
|
} catch {
|
|
468
468
|
}
|
|
469
469
|
}
|
|
@@ -472,9 +472,9 @@ class Z {
|
|
|
472
472
|
const a = this._queue.shift();
|
|
473
473
|
a && this._open(a);
|
|
474
474
|
}
|
|
475
|
-
_buildConfig(a,
|
|
475
|
+
_buildConfig(a, e) {
|
|
476
476
|
return {
|
|
477
|
-
id:
|
|
477
|
+
id: e,
|
|
478
478
|
title: a.title,
|
|
479
479
|
description: a.description,
|
|
480
480
|
submitText: a.submitText || "Submit",
|
|
@@ -497,35 +497,48 @@ class Z {
|
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
499
|
_ensureContainer() {
|
|
500
|
-
if (!
|
|
500
|
+
if (!I()) return null;
|
|
501
501
|
if (this._container && this._container.isConnected) return this._container;
|
|
502
502
|
let a = document.querySelector('[data-ui-dialog-host="true"]');
|
|
503
503
|
return a ? this._ownsContainer = !1 : (a = document.createElement("div"), a.setAttribute("data-ui-dialog-host", "true"), a.style.position = "relative", a.style.zIndex = "1200", document.body.appendChild(a), this._ownsContainer = !0), this._container = a, a;
|
|
504
504
|
}
|
|
505
505
|
_updateStackZIndex() {
|
|
506
506
|
for (let a = 0; a < this._active.length; a += 1) {
|
|
507
|
-
const
|
|
508
|
-
|
|
507
|
+
const e = this._active[a];
|
|
508
|
+
e.dialog && (e.dialog.style.setProperty("--ui-dialog-backdrop-z", String(1200 + a * 2)), e.dialog.style.setProperty("--ui-dialog-z", String(1201 + a * 2)));
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
let
|
|
513
|
-
function
|
|
514
|
-
return new
|
|
512
|
+
let b = null;
|
|
513
|
+
function K(n = {}) {
|
|
514
|
+
return new X(n.container ?? null);
|
|
515
515
|
}
|
|
516
|
-
function
|
|
517
|
-
return
|
|
516
|
+
function D() {
|
|
517
|
+
return b || (b = K()), b;
|
|
518
|
+
}
|
|
519
|
+
function va(n = {}) {
|
|
520
|
+
return D().open(n);
|
|
518
521
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
522
|
+
function ya(n = {}) {
|
|
523
|
+
return D().confirm(n);
|
|
521
524
|
}
|
|
522
|
-
function
|
|
523
|
-
|
|
525
|
+
function wa(n = "programmatic") {
|
|
526
|
+
b && (b.destroy(n), b = null);
|
|
524
527
|
}
|
|
525
|
-
|
|
526
|
-
|
|
528
|
+
const J = ["1", "2", "3", "4"], Y = { 1: "24px", 2: "32px", 3: "40px", 4: "48px" }, q = { 1: "12px", 2: "14px", 3: "16px", 4: "18px" }, aa = { 1: "8px", 2: "12px", 3: "16px", 4: "20px" }, ea = { 1: 0, 2: 0, 3: 2, 4: 4 };
|
|
529
|
+
function na(n) {
|
|
530
|
+
const a = n.palette?.gray || {}, e = n.palette?.accent || {}, t = n.radiusScale || {}, i = n.colors, r = {}, s = (c, d) => {
|
|
531
|
+
d && (r[c] = d);
|
|
532
|
+
};
|
|
533
|
+
s("--ui-color-surface-subtle", a[2]), s("--ui-color-fill", a[3]), s("--ui-color-fill-hover", a[4]), s("--ui-color-fill-active", a[5]), s("--ui-color-line-subtle", a[6]), s("--ui-color-line", a[7]), s("--ui-color-line-strong", a[8]), s("--ui-color-text-secondary", a[11] || i.muted), s("--ui-color-text-strong", a[12] || i.text), s("--ui-color-accent-subtle", e[2]), s("--ui-color-accent-fill", e[3]), s("--ui-color-accent-fill-hover", e[4]), s("--ui-color-accent-fill-active", e[5]), s("--ui-color-accent-line", e[7]), s("--ui-color-accent-solid", e[9] || i.primary), s("--ui-color-accent-solid-hover", e[10] || i.primaryHover || i.primary), s("--ui-color-accent-text", e[11]), s("--ui-color-surface-elevated", n.surfaces?.panelSolid || i.surfaceAlt || i.surface), s("--ui-color-info", i.info), s("--ui-color-placeholder", i.text ? `color-mix(in srgb, ${i.text} 62%, transparent)` : void 0), s("--ui-ring-color", i.focusRing || i.primary), r["--ui-ring-width"] = "2px", r["--ui-ring-offset"] = "2px";
|
|
534
|
+
for (const c of J) {
|
|
535
|
+
r[`--ui-control-height-${c}`] = Y[c], r[`--ui-control-font-size-${c}`] = q[c], r[`--ui-control-padding-inline-${c}`] = aa[c];
|
|
536
|
+
const d = ea[c], f = n.radius || t[2] || "6px";
|
|
537
|
+
r[`--ui-control-radius-${c}`] = d ? `calc(${f} + ${d}px)` : f;
|
|
538
|
+
}
|
|
539
|
+
return r["--ui-motion-enter-easing"] = "cubic-bezier(0.16, 1, 0.3, 1)", r["--ui-motion-exit-easing"] = "cubic-bezier(0.4, 0, 1, 1)", s("--ui-font-family-mono", n.typography?.codeFamily || "monospace"), s("--font-mono", n.typography?.codeFamily || "monospace"), s("--ui-breakpoint-xl", n.breakpoints?.xl || "1280px"), r;
|
|
527
540
|
}
|
|
528
|
-
const
|
|
541
|
+
const M = {
|
|
529
542
|
1: "#0000000d",
|
|
530
543
|
2: "#0000001a",
|
|
531
544
|
3: "#00000026",
|
|
@@ -538,7 +551,7 @@ const P = {
|
|
|
538
551
|
10: "#000c",
|
|
539
552
|
11: "#000000e6",
|
|
540
553
|
12: "#000000f2"
|
|
541
|
-
},
|
|
554
|
+
}, R = {
|
|
542
555
|
1: "#ffffff0d",
|
|
543
556
|
2: "#ffffff1a",
|
|
544
557
|
3: "#ffffff26",
|
|
@@ -551,7 +564,7 @@ const P = {
|
|
|
551
564
|
10: "#fffc",
|
|
552
565
|
11: "#ffffffe6",
|
|
553
566
|
12: "#fffffff2"
|
|
554
|
-
},
|
|
567
|
+
}, u = {
|
|
555
568
|
amber: {
|
|
556
569
|
light: {
|
|
557
570
|
scale: {
|
|
@@ -902,11 +915,8 @@ const P = {
|
|
|
902
915
|
track: "#7b7b7b"
|
|
903
916
|
}
|
|
904
917
|
}
|
|
905
|
-
},
|
|
918
|
+
}, ta = {
|
|
906
919
|
button: {
|
|
907
|
-
"height-sm": "32px",
|
|
908
|
-
"height-md": "36px",
|
|
909
|
-
"height-lg": "44px",
|
|
910
920
|
"classic-after-inset": "2px",
|
|
911
921
|
"classic-box-shadow-top": "inset 0 0 0 1px var(--gray-a5), inset 0 1px 1px var(--white-a10)",
|
|
912
922
|
"classic-box-shadow-bottom": "inset 0 4px 2px -2px var(--white-a9), inset 0 2px 1px -1px var(--white-a9)",
|
|
@@ -915,14 +925,7 @@ const P = {
|
|
|
915
925
|
"solid-active-filter": "brightness(0.96) saturate(1.02)"
|
|
916
926
|
},
|
|
917
927
|
badge: {
|
|
918
|
-
|
|
919
|
-
shadow: "none",
|
|
920
|
-
"font-size": "12px",
|
|
921
|
-
"font-weight": "600",
|
|
922
|
-
gap: "6px",
|
|
923
|
-
"padding-block": "5px",
|
|
924
|
-
"padding-inline": "10px",
|
|
925
|
-
"border-width": "1px"
|
|
928
|
+
shadow: "none"
|
|
926
929
|
},
|
|
927
930
|
blockControls: {
|
|
928
931
|
bg: "var(--color-panel)",
|
|
@@ -967,12 +970,8 @@ const P = {
|
|
|
967
970
|
},
|
|
968
971
|
select: {
|
|
969
972
|
bg: "var(--color-panel-solid)",
|
|
970
|
-
border: "1px solid color-mix(in srgb, var(--gray-a5) 82%, transparent)",
|
|
971
973
|
radius: "var(--ui-radius)",
|
|
972
974
|
shadow: "none",
|
|
973
|
-
"height-sm": "34px",
|
|
974
|
-
"height-md": "42px",
|
|
975
|
-
"height-lg": "46px",
|
|
976
975
|
"padding-x": "12px",
|
|
977
976
|
gap: "8px",
|
|
978
977
|
"label-color": "var(--ui-color-text)",
|
|
@@ -995,31 +994,18 @@ const P = {
|
|
|
995
994
|
},
|
|
996
995
|
sidebar: {
|
|
997
996
|
bg: "var(--color-panel-solid)",
|
|
998
|
-
border: "1px solid color-mix(in srgb, var(--gray-a5) 82%, transparent)",
|
|
999
|
-
radius: "4px",
|
|
1000
|
-
shadow: "var(--shadow-5)",
|
|
1001
997
|
padding: "12px",
|
|
1002
998
|
gap: "12px",
|
|
1003
999
|
"header-padding": "6px 8px 10px",
|
|
1004
|
-
"item-radius": "4px",
|
|
1005
|
-
"item-height": "45px",
|
|
1006
|
-
"item-padding-x": "6px",
|
|
1007
|
-
"item-padding-y": "3px",
|
|
1008
1000
|
"item-gap": "8px",
|
|
1009
|
-
"item-font-size": "12px",
|
|
1010
|
-
"item-line-height": "22px",
|
|
1011
1001
|
"section-gap": "10px",
|
|
1012
1002
|
"section-label-size": "12px",
|
|
1013
1003
|
"section-label-spacing": "0.06em",
|
|
1014
1004
|
"submenu-indent": "18px",
|
|
1015
|
-
"promo-radius": "4px",
|
|
1016
1005
|
"promo-padding": "18px"
|
|
1017
1006
|
},
|
|
1018
1007
|
card: {
|
|
1019
1008
|
bg: "var(--color-panel-solid)",
|
|
1020
|
-
border: "1px solid color-mix(in srgb, var(--gray-a5) 82%, transparent)",
|
|
1021
|
-
radius: "var(--ui-radius)",
|
|
1022
|
-
shadow: "var(--shadow-2)",
|
|
1023
1009
|
"hover-shadow": "var(--shadow-3)",
|
|
1024
1010
|
"active-shadow": "var(--shadow-2)",
|
|
1025
1011
|
"classic-shadow": "var(--shadow-2)",
|
|
@@ -1028,14 +1014,9 @@ const P = {
|
|
|
1028
1014
|
},
|
|
1029
1015
|
multiSelect: {
|
|
1030
1016
|
bg: "var(--color-panel-solid)",
|
|
1031
|
-
border: "1px solid color-mix(in srgb, var(--gray-a5) 82%, transparent)",
|
|
1032
1017
|
radius: "var(--ui-radius)",
|
|
1033
1018
|
shadow: "none",
|
|
1034
|
-
"height-sm": "38px",
|
|
1035
|
-
"height-md": "44px",
|
|
1036
|
-
"height-lg": "48px",
|
|
1037
1019
|
"padding-x": "10px",
|
|
1038
|
-
"padding-y": "8px",
|
|
1039
1020
|
"panel-bg": "var(--color-panel-solid)",
|
|
1040
1021
|
"panel-border": "1px solid color-mix(in srgb, var(--gray-a5) 84%, transparent)",
|
|
1041
1022
|
"panel-radius": "calc(var(--ui-radius) + 2px)",
|
|
@@ -1043,7 +1024,6 @@ const P = {
|
|
|
1043
1024
|
"chip-radius": "999px",
|
|
1044
1025
|
"chip-gap": "6px",
|
|
1045
1026
|
"chip-padding-x": "10px",
|
|
1046
|
-
"chip-padding-y": "6px",
|
|
1047
1027
|
"option-radius": "10px",
|
|
1048
1028
|
"option-gap": "10px",
|
|
1049
1029
|
"option-padding-x": "10px",
|
|
@@ -1051,12 +1031,8 @@ const P = {
|
|
|
1051
1031
|
},
|
|
1052
1032
|
navigationMenu: {
|
|
1053
1033
|
bg: "var(--color-panel-solid)",
|
|
1054
|
-
border: "1px solid color-mix(in srgb, var(--gray-a5) 80%, transparent)",
|
|
1055
|
-
radius: "var(--radius-4)",
|
|
1056
|
-
shadow: "var(--shadow-2)",
|
|
1057
1034
|
padding: "6px",
|
|
1058
1035
|
gap: "6px",
|
|
1059
|
-
"item-radius": "var(--radius-2)",
|
|
1060
1036
|
"item-padding-x": "12px",
|
|
1061
1037
|
"item-padding-y": "8px",
|
|
1062
1038
|
"item-font-size": "14px",
|
|
@@ -1116,13 +1092,10 @@ const P = {
|
|
|
1116
1092
|
},
|
|
1117
1093
|
alert: {
|
|
1118
1094
|
bg: "var(--color-panel-solid)",
|
|
1119
|
-
border: "1px solid color-mix(in srgb, var(--gray-a5) 82%, transparent)",
|
|
1120
1095
|
radius: "var(--ui-radius)",
|
|
1121
|
-
shadow: "var(--shadow-2)",
|
|
1122
1096
|
"padding-x": "16px",
|
|
1123
1097
|
"padding-y": "14px",
|
|
1124
1098
|
gap: "var(--ui-default-gap)",
|
|
1125
|
-
"icon-size": "26px",
|
|
1126
1099
|
"dismiss-size": "28px"
|
|
1127
1100
|
},
|
|
1128
1101
|
alertDialog: {
|
|
@@ -1140,9 +1113,7 @@ const P = {
|
|
|
1140
1113
|
},
|
|
1141
1114
|
appHeader: {
|
|
1142
1115
|
bg: "var(--color-panel)",
|
|
1143
|
-
border: "1px solid color-mix(in srgb, var(--gray-a5) 78%, transparent)",
|
|
1144
1116
|
radius: "0px",
|
|
1145
|
-
shadow: "none",
|
|
1146
1117
|
padding: "16px",
|
|
1147
1118
|
gap: "12px",
|
|
1148
1119
|
height: "64px",
|
|
@@ -1158,10 +1129,7 @@ const P = {
|
|
|
1158
1129
|
"badge-radius": "999px"
|
|
1159
1130
|
},
|
|
1160
1131
|
avatar: {
|
|
1161
|
-
bg: "var(--color-panel-solid)",
|
|
1162
|
-
border: "1px solid color-mix(in srgb, var(--gray-a5) 82%, transparent)",
|
|
1163
1132
|
radius: "999px",
|
|
1164
|
-
shadow: "0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 24px rgba(15, 23, 42, 0.12)",
|
|
1165
1133
|
"size-sm": "30px",
|
|
1166
1134
|
"size-md": "40px",
|
|
1167
1135
|
"size-lg": "52px",
|
|
@@ -1194,18 +1162,10 @@ const P = {
|
|
|
1194
1162
|
padding: "var(--ui-default-gap)"
|
|
1195
1163
|
},
|
|
1196
1164
|
input: {
|
|
1197
|
-
|
|
1198
|
-
"height-md": "36px",
|
|
1199
|
-
"height-lg": "44px",
|
|
1200
|
-
bg: "var(--color-panel-solid)",
|
|
1201
|
-
border: "1px solid color-mix(in srgb, var(--gray-a5) 84%, transparent)",
|
|
1202
|
-
"focus-ring": "0 0 0 3px color-mix(in srgb, var(--accent-a5) 48%, transparent)"
|
|
1165
|
+
bg: "var(--color-panel-solid)"
|
|
1203
1166
|
}
|
|
1204
|
-
},
|
|
1167
|
+
}, ra = {
|
|
1205
1168
|
button: {
|
|
1206
|
-
"height-sm": "32px",
|
|
1207
|
-
"height-md": "36px",
|
|
1208
|
-
"height-lg": "44px",
|
|
1209
1169
|
"classic-after-inset": "1px",
|
|
1210
1170
|
"classic-box-shadow-top": "inset 0 0 0 1px var(--white-a2), inset 0 4px 2px -2px var(--white-a3), inset 0 1px 1px var(--white-a6), inset 0 -1px 1px var(--black-a6)",
|
|
1211
1171
|
"classic-box-shadow-bottom": "inset 0 0 0 1px var(--black-a4), inset 0 -1px 1px var(--black-a8)",
|
|
@@ -1214,14 +1174,7 @@ const P = {
|
|
|
1214
1174
|
"solid-active-filter": "brightness(0.92) saturate(1.04)"
|
|
1215
1175
|
},
|
|
1216
1176
|
badge: {
|
|
1217
|
-
|
|
1218
|
-
shadow: "none",
|
|
1219
|
-
"font-size": "12px",
|
|
1220
|
-
"font-weight": "600",
|
|
1221
|
-
gap: "6px",
|
|
1222
|
-
"padding-block": "5px",
|
|
1223
|
-
"padding-inline": "10px",
|
|
1224
|
-
"border-width": "1px"
|
|
1177
|
+
shadow: "none"
|
|
1225
1178
|
},
|
|
1226
1179
|
blockControls: {
|
|
1227
1180
|
bg: "var(--color-panel)",
|
|
@@ -1266,12 +1219,8 @@ const P = {
|
|
|
1266
1219
|
},
|
|
1267
1220
|
select: {
|
|
1268
1221
|
bg: "var(--color-panel-solid)",
|
|
1269
|
-
border: "1px solid color-mix(in srgb, var(--gray-a6) 88%, transparent)",
|
|
1270
1222
|
radius: "var(--ui-radius)",
|
|
1271
1223
|
shadow: "none",
|
|
1272
|
-
"height-sm": "34px",
|
|
1273
|
-
"height-md": "42px",
|
|
1274
|
-
"height-lg": "46px",
|
|
1275
1224
|
"padding-x": "12px",
|
|
1276
1225
|
gap: "8px",
|
|
1277
1226
|
"label-color": "var(--ui-color-text)",
|
|
@@ -1294,31 +1243,18 @@ const P = {
|
|
|
1294
1243
|
},
|
|
1295
1244
|
sidebar: {
|
|
1296
1245
|
bg: "var(--color-panel-solid)",
|
|
1297
|
-
border: "1px solid color-mix(in srgb, var(--gray-a6) 88%, transparent)",
|
|
1298
|
-
radius: "4px",
|
|
1299
|
-
shadow: "var(--shadow-5)",
|
|
1300
1246
|
padding: "12px",
|
|
1301
1247
|
gap: "12px",
|
|
1302
1248
|
"header-padding": "6px 8px 10px",
|
|
1303
|
-
"item-radius": "4px",
|
|
1304
|
-
"item-height": "45px",
|
|
1305
|
-
"item-padding-x": "6px",
|
|
1306
|
-
"item-padding-y": "3px",
|
|
1307
1249
|
"item-gap": "8px",
|
|
1308
|
-
"item-font-size": "12px",
|
|
1309
|
-
"item-line-height": "22px",
|
|
1310
1250
|
"section-gap": "10px",
|
|
1311
1251
|
"section-label-size": "12px",
|
|
1312
1252
|
"section-label-spacing": "0.06em",
|
|
1313
1253
|
"submenu-indent": "18px",
|
|
1314
|
-
"promo-radius": "4px",
|
|
1315
1254
|
"promo-padding": "18px"
|
|
1316
1255
|
},
|
|
1317
1256
|
card: {
|
|
1318
1257
|
bg: "var(--color-panel-solid)",
|
|
1319
|
-
border: "1px solid color-mix(in srgb, var(--gray-a6) 88%, transparent)",
|
|
1320
|
-
radius: "var(--ui-radius)",
|
|
1321
|
-
shadow: "var(--shadow-2)",
|
|
1322
1258
|
"hover-shadow": "var(--shadow-3)",
|
|
1323
1259
|
"active-shadow": "var(--shadow-2)",
|
|
1324
1260
|
"classic-shadow": "var(--shadow-2)",
|
|
@@ -1327,14 +1263,9 @@ const P = {
|
|
|
1327
1263
|
},
|
|
1328
1264
|
multiSelect: {
|
|
1329
1265
|
bg: "var(--color-panel-solid)",
|
|
1330
|
-
border: "1px solid color-mix(in srgb, var(--gray-a6) 88%, transparent)",
|
|
1331
1266
|
radius: "var(--ui-radius)",
|
|
1332
1267
|
shadow: "none",
|
|
1333
|
-
"height-sm": "38px",
|
|
1334
|
-
"height-md": "44px",
|
|
1335
|
-
"height-lg": "48px",
|
|
1336
1268
|
"padding-x": "10px",
|
|
1337
|
-
"padding-y": "8px",
|
|
1338
1269
|
"panel-bg": "var(--color-panel-solid)",
|
|
1339
1270
|
"panel-border": "1px solid color-mix(in srgb, var(--gray-a6) 88%, transparent)",
|
|
1340
1271
|
"panel-radius": "calc(var(--ui-radius) + 2px)",
|
|
@@ -1342,7 +1273,6 @@ const P = {
|
|
|
1342
1273
|
"chip-radius": "999px",
|
|
1343
1274
|
"chip-gap": "6px",
|
|
1344
1275
|
"chip-padding-x": "10px",
|
|
1345
|
-
"chip-padding-y": "6px",
|
|
1346
1276
|
"option-radius": "10px",
|
|
1347
1277
|
"option-gap": "10px",
|
|
1348
1278
|
"option-padding-x": "10px",
|
|
@@ -1350,12 +1280,8 @@ const P = {
|
|
|
1350
1280
|
},
|
|
1351
1281
|
navigationMenu: {
|
|
1352
1282
|
bg: "var(--color-panel-solid)",
|
|
1353
|
-
border: "1px solid color-mix(in srgb, var(--gray-a6) 84%, transparent)",
|
|
1354
|
-
radius: "var(--radius-4)",
|
|
1355
|
-
shadow: "var(--shadow-2)",
|
|
1356
1283
|
padding: "6px",
|
|
1357
1284
|
gap: "6px",
|
|
1358
|
-
"item-radius": "var(--radius-2)",
|
|
1359
1285
|
"item-padding-x": "12px",
|
|
1360
1286
|
"item-padding-y": "8px",
|
|
1361
1287
|
"item-font-size": "14px",
|
|
@@ -1415,13 +1341,10 @@ const P = {
|
|
|
1415
1341
|
},
|
|
1416
1342
|
alert: {
|
|
1417
1343
|
bg: "var(--color-panel-solid)",
|
|
1418
|
-
border: "1px solid color-mix(in srgb, var(--gray-a6) 88%, transparent)",
|
|
1419
1344
|
radius: "var(--ui-radius)",
|
|
1420
|
-
shadow: "var(--shadow-2)",
|
|
1421
1345
|
"padding-x": "16px",
|
|
1422
1346
|
"padding-y": "14px",
|
|
1423
1347
|
gap: "var(--ui-default-gap)",
|
|
1424
|
-
"icon-size": "26px",
|
|
1425
1348
|
"dismiss-size": "28px"
|
|
1426
1349
|
},
|
|
1427
1350
|
alertDialog: {
|
|
@@ -1439,9 +1362,7 @@ const P = {
|
|
|
1439
1362
|
},
|
|
1440
1363
|
appHeader: {
|
|
1441
1364
|
bg: "var(--color-panel)",
|
|
1442
|
-
border: "1px solid color-mix(in srgb, var(--gray-a6) 82%, transparent)",
|
|
1443
1365
|
radius: "0px",
|
|
1444
|
-
shadow: "none",
|
|
1445
1366
|
padding: "16px",
|
|
1446
1367
|
gap: "12px",
|
|
1447
1368
|
height: "64px",
|
|
@@ -1457,10 +1378,7 @@ const P = {
|
|
|
1457
1378
|
"badge-radius": "999px"
|
|
1458
1379
|
},
|
|
1459
1380
|
avatar: {
|
|
1460
|
-
bg: "var(--color-panel-solid)",
|
|
1461
|
-
border: "1px solid color-mix(in srgb, var(--gray-a6) 88%, transparent)",
|
|
1462
1381
|
radius: "999px",
|
|
1463
|
-
shadow: "0 1px 2px rgba(2, 6, 23, 0.18), 0 12px 24px rgba(2, 6, 23, 0.28)",
|
|
1464
1382
|
"size-sm": "30px",
|
|
1465
1383
|
"size-md": "40px",
|
|
1466
1384
|
"size-lg": "52px",
|
|
@@ -1493,49 +1411,44 @@ const P = {
|
|
|
1493
1411
|
padding: "var(--ui-default-gap)"
|
|
1494
1412
|
},
|
|
1495
1413
|
input: {
|
|
1496
|
-
|
|
1497
|
-
"height-md": "36px",
|
|
1498
|
-
"height-lg": "44px",
|
|
1499
|
-
bg: "var(--color-panel-solid)",
|
|
1500
|
-
border: "1px solid color-mix(in srgb, var(--gray-a6) 88%, transparent)",
|
|
1501
|
-
"focus-ring": "0 0 0 3px color-mix(in srgb, var(--accent-a6) 42%, transparent)"
|
|
1414
|
+
bg: "var(--color-panel-solid)"
|
|
1502
1415
|
}
|
|
1503
1416
|
};
|
|
1504
|
-
function
|
|
1505
|
-
const a = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(
|
|
1417
|
+
function w(n) {
|
|
1418
|
+
const a = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(n.trim())?.[1];
|
|
1506
1419
|
if (!a) return null;
|
|
1507
|
-
const
|
|
1508
|
-
const
|
|
1509
|
-
return
|
|
1420
|
+
const e = a.length === 3 ? a.replace(/./g, (i) => i + i) : a.slice(0, 6), t = (i) => {
|
|
1421
|
+
const r = parseInt(e.slice(i, i + 2), 16) / 255;
|
|
1422
|
+
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1510
1423
|
};
|
|
1511
|
-
return 0.2126 *
|
|
1424
|
+
return 0.2126 * t(0) + 0.7152 * t(2) + 0.0722 * t(4);
|
|
1512
1425
|
}
|
|
1513
|
-
function
|
|
1514
|
-
const
|
|
1515
|
-
return
|
|
1426
|
+
function v(n, a) {
|
|
1427
|
+
const e = w(n), t = w(a);
|
|
1428
|
+
return e === null || t === null ? null : (Math.max(e, t) + 0.05) / (Math.min(e, t) + 0.05);
|
|
1516
1429
|
}
|
|
1517
|
-
function
|
|
1518
|
-
const
|
|
1519
|
-
if (!
|
|
1520
|
-
const
|
|
1521
|
-
return a ?
|
|
1430
|
+
function ia(n, a) {
|
|
1431
|
+
const e = n?.colors;
|
|
1432
|
+
if (!e?.primary) return {};
|
|
1433
|
+
const t = e.foregroundOnPrimary;
|
|
1434
|
+
return a ? e.primary === a.colors?.primary ? {} : t && t !== a.colors?.foregroundOnPrimary ? {} : { foregroundOnPrimary: k(e.primary, a.colors?.foregroundOnPrimary || "#ffffff") } : t ? {} : { foregroundOnPrimary: k(e.primary, "#ffffff") };
|
|
1522
1435
|
}
|
|
1523
|
-
function
|
|
1524
|
-
const
|
|
1525
|
-
if (
|
|
1526
|
-
const
|
|
1527
|
-
return (
|
|
1436
|
+
function k(n, a) {
|
|
1437
|
+
const e = v(a, n);
|
|
1438
|
+
if (e === null || e >= 4.5) return a;
|
|
1439
|
+
const t = v("#ffffff", n) ?? 0;
|
|
1440
|
+
return (v("#111111", n) ?? 0) > t ? "#111111" : "#ffffff";
|
|
1528
1441
|
}
|
|
1529
|
-
function
|
|
1442
|
+
function $(n) {
|
|
1530
1443
|
return {
|
|
1531
|
-
primary:
|
|
1532
|
-
primaryHover:
|
|
1533
|
-
foregroundOnPrimary:
|
|
1534
|
-
focusRing:
|
|
1535
|
-
warning:
|
|
1444
|
+
primary: n.scale[9],
|
|
1445
|
+
primaryHover: n.scale[10] || n.scale[9],
|
|
1446
|
+
foregroundOnPrimary: k(n.scale[9], n.contrast),
|
|
1447
|
+
focusRing: n.scale[8] || n.scale[9],
|
|
1448
|
+
warning: n.scale[9]
|
|
1536
1449
|
};
|
|
1537
1450
|
}
|
|
1538
|
-
const
|
|
1451
|
+
const _ = {
|
|
1539
1452
|
colors: {
|
|
1540
1453
|
primary: "#ffc53d",
|
|
1541
1454
|
primaryHover: "#ffba18",
|
|
@@ -1549,7 +1462,8 @@ const x = {
|
|
|
1549
1462
|
focusRing: "#e2a336",
|
|
1550
1463
|
success: "#30a46c",
|
|
1551
1464
|
danger: "#e5484d",
|
|
1552
|
-
warning: "#ffc53d"
|
|
1465
|
+
warning: "#ffc53d",
|
|
1466
|
+
info: "#0e7490"
|
|
1553
1467
|
},
|
|
1554
1468
|
palette: {
|
|
1555
1469
|
gray: {
|
|
@@ -1580,18 +1494,18 @@ const x = {
|
|
|
1580
1494
|
11: "#0000009b",
|
|
1581
1495
|
12: "#000000df"
|
|
1582
1496
|
},
|
|
1583
|
-
blackAlpha:
|
|
1584
|
-
whiteAlpha:
|
|
1497
|
+
blackAlpha: M,
|
|
1498
|
+
whiteAlpha: R,
|
|
1585
1499
|
accent: {
|
|
1586
|
-
...
|
|
1500
|
+
...u.amber.light.scale
|
|
1587
1501
|
},
|
|
1588
1502
|
accentAlpha: {
|
|
1589
|
-
...
|
|
1503
|
+
...u.amber.light.alphaScale
|
|
1590
1504
|
},
|
|
1591
|
-
accentContrast:
|
|
1592
|
-
accentSurface:
|
|
1593
|
-
accentIndicator:
|
|
1594
|
-
accentTrack:
|
|
1505
|
+
accentContrast: u.amber.light.contrast,
|
|
1506
|
+
accentSurface: u.amber.light.surface,
|
|
1507
|
+
accentIndicator: u.amber.light.indicator,
|
|
1508
|
+
accentTrack: u.amber.light.track
|
|
1595
1509
|
},
|
|
1596
1510
|
surfaces: {
|
|
1597
1511
|
background: "#ffffff",
|
|
@@ -1602,7 +1516,7 @@ const x = {
|
|
|
1602
1516
|
overlay: "rgba(2, 6, 23, 0.52)",
|
|
1603
1517
|
transparent: "transparent"
|
|
1604
1518
|
},
|
|
1605
|
-
radius: "
|
|
1519
|
+
radius: "6px",
|
|
1606
1520
|
radiusScale: {
|
|
1607
1521
|
1: "3px",
|
|
1608
1522
|
2: "4px",
|
|
@@ -1689,11 +1603,11 @@ const x = {
|
|
|
1689
1603
|
effects: {
|
|
1690
1604
|
backdropFilterPanel: "blur(64px)"
|
|
1691
1605
|
},
|
|
1692
|
-
components:
|
|
1606
|
+
components: ta,
|
|
1693
1607
|
zIndex: { modal: 1e3, overlay: 900, toast: 1100 },
|
|
1694
1608
|
breakpoints: { sm: "640px", md: "768px", lg: "1024px" }
|
|
1695
|
-
},
|
|
1696
|
-
...
|
|
1609
|
+
}, oa = {
|
|
1610
|
+
..._,
|
|
1697
1611
|
colors: {
|
|
1698
1612
|
primary: "#ffc53d",
|
|
1699
1613
|
primaryHover: "#ffd60a",
|
|
@@ -1707,10 +1621,11 @@ const x = {
|
|
|
1707
1621
|
focusRing: "#ffc53d",
|
|
1708
1622
|
success: "#30a46c",
|
|
1709
1623
|
danger: "#e5484d",
|
|
1710
|
-
warning: "#ffc53d"
|
|
1624
|
+
warning: "#ffc53d",
|
|
1625
|
+
info: "#4cc3d6"
|
|
1711
1626
|
},
|
|
1712
1627
|
palette: {
|
|
1713
|
-
...
|
|
1628
|
+
..._.palette,
|
|
1714
1629
|
gray: {
|
|
1715
1630
|
1: "#111",
|
|
1716
1631
|
2: "#191919",
|
|
@@ -1739,18 +1654,18 @@ const x = {
|
|
|
1739
1654
|
11: "#ffffffaf",
|
|
1740
1655
|
12: "#ffffffed"
|
|
1741
1656
|
},
|
|
1742
|
-
blackAlpha:
|
|
1743
|
-
whiteAlpha:
|
|
1657
|
+
blackAlpha: M,
|
|
1658
|
+
whiteAlpha: R,
|
|
1744
1659
|
accent: {
|
|
1745
|
-
...
|
|
1660
|
+
...u.amber.dark.scale
|
|
1746
1661
|
},
|
|
1747
1662
|
accentAlpha: {
|
|
1748
|
-
...
|
|
1663
|
+
...u.amber.dark.alphaScale
|
|
1749
1664
|
},
|
|
1750
|
-
accentContrast:
|
|
1751
|
-
accentSurface:
|
|
1752
|
-
accentIndicator:
|
|
1753
|
-
accentTrack:
|
|
1665
|
+
accentContrast: u.amber.dark.contrast,
|
|
1666
|
+
accentSurface: u.amber.dark.surface,
|
|
1667
|
+
accentIndicator: u.amber.dark.indicator,
|
|
1668
|
+
accentTrack: u.amber.dark.track
|
|
1754
1669
|
},
|
|
1755
1670
|
surfaces: {
|
|
1756
1671
|
background: "#111111",
|
|
@@ -1772,195 +1687,312 @@ const x = {
|
|
|
1772
1687
|
5: "0 0 0 1px var(--gray-a6),0 12px 60px var(--black-a5),0 12px 32px -16px var(--black-a7)",
|
|
1773
1688
|
6: "0 0 0 1px var(--gray-a6),0 12px 60px var(--black-a4),0 16px 64px var(--black-a6),0 16px 36px -20px var(--black-a11)"
|
|
1774
1689
|
},
|
|
1775
|
-
components:
|
|
1776
|
-
},
|
|
1777
|
-
function p(
|
|
1778
|
-
if (!(!
|
|
1779
|
-
return { ...
|
|
1690
|
+
components: ra
|
|
1691
|
+
}, ka = _, H = /* @__PURE__ */ new Set();
|
|
1692
|
+
function p(n, a) {
|
|
1693
|
+
if (!(!n && !a))
|
|
1694
|
+
return { ...n || {}, ...a || {} };
|
|
1780
1695
|
}
|
|
1781
|
-
function
|
|
1782
|
-
const a =
|
|
1783
|
-
if (!a) return
|
|
1784
|
-
if (a.background && !
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1696
|
+
function sa(n) {
|
|
1697
|
+
const a = n?.colors, e = n?.surfaces || {}, t = {};
|
|
1698
|
+
if (!a) return t;
|
|
1699
|
+
if (a.background && !e.background && (t.background = a.background), a.surface) {
|
|
1700
|
+
const i = `color-mix(in srgb, ${a.surface} 80%, transparent)`;
|
|
1701
|
+
e.surface || (t.surface = a.surface), e.panelSolid || (t.panelSolid = a.surface), e.panel || (t.panel = i), e.panelTranslucent || (t.panelTranslucent = i);
|
|
1787
1702
|
}
|
|
1788
|
-
return
|
|
1703
|
+
return t;
|
|
1789
1704
|
}
|
|
1790
|
-
function
|
|
1791
|
-
const
|
|
1705
|
+
function S(n, a) {
|
|
1706
|
+
const e = a?.mode || "light", t = e === "dark" ? oa : _, i = a?.accentPalette, r = i ? u[i][e] : null, s = r ? {
|
|
1792
1707
|
colors: {
|
|
1793
|
-
|
|
1708
|
+
...$(r)
|
|
1794
1709
|
},
|
|
1795
1710
|
palette: {
|
|
1796
|
-
accent:
|
|
1797
|
-
accentAlpha:
|
|
1798
|
-
accentContrast:
|
|
1799
|
-
accentSurface:
|
|
1800
|
-
accentIndicator:
|
|
1801
|
-
accentTrack:
|
|
1711
|
+
accent: r.scale,
|
|
1712
|
+
accentAlpha: r.alphaScale,
|
|
1713
|
+
accentContrast: r.contrast,
|
|
1714
|
+
accentSurface: r.surface,
|
|
1715
|
+
accentIndicator: r.indicator,
|
|
1716
|
+
accentTrack: r.track
|
|
1802
1717
|
}
|
|
1803
1718
|
} : null;
|
|
1804
1719
|
return {
|
|
1805
|
-
...
|
|
1806
|
-
...
|
|
1720
|
+
...t,
|
|
1721
|
+
...n,
|
|
1807
1722
|
colors: {
|
|
1808
|
-
...
|
|
1809
|
-
...
|
|
1810
|
-
...
|
|
1811
|
-
...
|
|
1723
|
+
...t.colors,
|
|
1724
|
+
...s?.colors || {},
|
|
1725
|
+
...n?.colors || {},
|
|
1726
|
+
...ia(n)
|
|
1812
1727
|
},
|
|
1813
1728
|
palette: {
|
|
1814
|
-
...
|
|
1815
|
-
...
|
|
1816
|
-
...
|
|
1817
|
-
gray: p(
|
|
1818
|
-
grayAlpha: p(
|
|
1819
|
-
blackAlpha: p(
|
|
1820
|
-
whiteAlpha: p(
|
|
1821
|
-
accent: p(
|
|
1822
|
-
accentAlpha: p(
|
|
1729
|
+
...t.palette || {},
|
|
1730
|
+
...s?.palette || {},
|
|
1731
|
+
...n?.palette || {},
|
|
1732
|
+
gray: p(t.palette?.gray, n?.palette?.gray),
|
|
1733
|
+
grayAlpha: p(t.palette?.grayAlpha, n?.palette?.grayAlpha),
|
|
1734
|
+
blackAlpha: p(t.palette?.blackAlpha, n?.palette?.blackAlpha),
|
|
1735
|
+
whiteAlpha: p(t.palette?.whiteAlpha, n?.palette?.whiteAlpha),
|
|
1736
|
+
accent: p(r?.scale || t.palette?.accent, n?.palette?.accent),
|
|
1737
|
+
accentAlpha: p(r?.alphaScale || t.palette?.accentAlpha, n?.palette?.accentAlpha)
|
|
1823
1738
|
},
|
|
1824
1739
|
surfaces: {
|
|
1825
|
-
...
|
|
1826
|
-
...
|
|
1827
|
-
...
|
|
1740
|
+
...t.surfaces || {},
|
|
1741
|
+
...sa(n),
|
|
1742
|
+
...n?.surfaces || {}
|
|
1828
1743
|
},
|
|
1829
1744
|
shadows: {
|
|
1830
|
-
...
|
|
1831
|
-
...
|
|
1745
|
+
...t.shadows || {},
|
|
1746
|
+
...n?.shadows || {}
|
|
1832
1747
|
},
|
|
1833
1748
|
spacing: {
|
|
1834
|
-
...
|
|
1835
|
-
...
|
|
1749
|
+
...t.spacing || {},
|
|
1750
|
+
...n?.spacing || {}
|
|
1836
1751
|
},
|
|
1837
|
-
spaceScale: p(
|
|
1838
|
-
radiusScale: p(
|
|
1752
|
+
spaceScale: p(t.spaceScale, n?.spaceScale),
|
|
1753
|
+
radiusScale: p(t.radiusScale, n?.radiusScale),
|
|
1839
1754
|
typography: {
|
|
1840
|
-
...
|
|
1841
|
-
...
|
|
1755
|
+
...t.typography || {},
|
|
1756
|
+
...n?.typography || {},
|
|
1842
1757
|
size: {
|
|
1843
|
-
...
|
|
1844
|
-
...
|
|
1758
|
+
...t.typography?.size || {},
|
|
1759
|
+
...n?.typography?.size || {}
|
|
1845
1760
|
},
|
|
1846
|
-
fontScale: p(
|
|
1847
|
-
lineHeight: p(
|
|
1848
|
-
letterSpacing: p(
|
|
1761
|
+
fontScale: p(t.typography?.fontScale, n?.typography?.fontScale),
|
|
1762
|
+
lineHeight: p(t.typography?.lineHeight, n?.typography?.lineHeight),
|
|
1763
|
+
letterSpacing: p(t.typography?.letterSpacing, n?.typography?.letterSpacing)
|
|
1849
1764
|
},
|
|
1850
1765
|
motion: {
|
|
1851
|
-
...
|
|
1852
|
-
...
|
|
1766
|
+
...t.motion || {},
|
|
1767
|
+
...n?.motion || {}
|
|
1853
1768
|
},
|
|
1854
1769
|
effects: {
|
|
1855
|
-
...
|
|
1856
|
-
...
|
|
1770
|
+
...t.effects || {},
|
|
1771
|
+
...n?.effects || {}
|
|
1857
1772
|
},
|
|
1858
1773
|
components: {
|
|
1859
|
-
...
|
|
1860
|
-
...
|
|
1861
|
-
button: p(
|
|
1862
|
-
badge: p(
|
|
1863
|
-
dropdown: p(
|
|
1864
|
-
select: p(
|
|
1865
|
-
sidebar: p(
|
|
1866
|
-
card: p(
|
|
1867
|
-
navigationMenu: p(
|
|
1868
|
-
blockControls: p(
|
|
1869
|
-
box: p(
|
|
1870
|
-
breadcrumb: p(
|
|
1871
|
-
contextMenu: p(
|
|
1872
|
-
menubar: p(
|
|
1873
|
-
alert: p(
|
|
1874
|
-
alertDialog: p(
|
|
1875
|
-
appHeader: p(
|
|
1876
|
-
aspectRatio: p(
|
|
1877
|
-
avatar: p(
|
|
1878
|
-
menu: p(
|
|
1879
|
-
multiSelect: p(
|
|
1880
|
-
panel: p(
|
|
1881
|
-
input: p(
|
|
1774
|
+
...t.components || {},
|
|
1775
|
+
...n?.components || {},
|
|
1776
|
+
button: p(t.components?.button, n?.components?.button),
|
|
1777
|
+
badge: p(t.components?.badge, n?.components?.badge),
|
|
1778
|
+
dropdown: p(t.components?.dropdown, n?.components?.dropdown),
|
|
1779
|
+
select: p(t.components?.select, n?.components?.select),
|
|
1780
|
+
sidebar: p(t.components?.sidebar, n?.components?.sidebar),
|
|
1781
|
+
card: p(t.components?.card, n?.components?.card),
|
|
1782
|
+
navigationMenu: p(t.components?.navigationMenu, n?.components?.navigationMenu),
|
|
1783
|
+
blockControls: p(t.components?.blockControls, n?.components?.blockControls),
|
|
1784
|
+
box: p(t.components?.box, n?.components?.box),
|
|
1785
|
+
breadcrumb: p(t.components?.breadcrumb, n?.components?.breadcrumb),
|
|
1786
|
+
contextMenu: p(t.components?.contextMenu, n?.components?.contextMenu),
|
|
1787
|
+
menubar: p(t.components?.menubar, n?.components?.menubar),
|
|
1788
|
+
alert: p(t.components?.alert, n?.components?.alert),
|
|
1789
|
+
alertDialog: p(t.components?.alertDialog, n?.components?.alertDialog),
|
|
1790
|
+
appHeader: p(t.components?.appHeader, n?.components?.appHeader),
|
|
1791
|
+
aspectRatio: p(t.components?.aspectRatio, n?.components?.aspectRatio),
|
|
1792
|
+
avatar: p(t.components?.avatar, n?.components?.avatar),
|
|
1793
|
+
menu: p(t.components?.menu, n?.components?.menu),
|
|
1794
|
+
multiSelect: p(t.components?.multiSelect, n?.components?.multiSelect),
|
|
1795
|
+
panel: p(t.components?.panel, n?.components?.panel),
|
|
1796
|
+
input: p(t.components?.input, n?.components?.input)
|
|
1882
1797
|
},
|
|
1883
1798
|
zIndex: {
|
|
1884
|
-
...
|
|
1885
|
-
...
|
|
1799
|
+
...t.zIndex || {},
|
|
1800
|
+
...n?.zIndex || {}
|
|
1886
1801
|
},
|
|
1887
1802
|
breakpoints: {
|
|
1888
|
-
...
|
|
1889
|
-
...
|
|
1803
|
+
...t.breakpoints || {},
|
|
1804
|
+
...n?.breakpoints || {}
|
|
1890
1805
|
}
|
|
1891
1806
|
};
|
|
1892
1807
|
}
|
|
1893
|
-
function
|
|
1894
|
-
const
|
|
1895
|
-
return
|
|
1808
|
+
function _a(n, a, e = "light") {
|
|
1809
|
+
const t = u[a][e], i = n;
|
|
1810
|
+
return S(
|
|
1896
1811
|
{
|
|
1897
|
-
...
|
|
1812
|
+
...i,
|
|
1898
1813
|
colors: {
|
|
1899
|
-
...
|
|
1900
|
-
|
|
1814
|
+
...i.colors || {},
|
|
1815
|
+
...$(t)
|
|
1901
1816
|
},
|
|
1902
1817
|
palette: {
|
|
1903
|
-
...
|
|
1904
|
-
accent:
|
|
1905
|
-
accentAlpha:
|
|
1906
|
-
accentContrast:
|
|
1907
|
-
accentSurface:
|
|
1908
|
-
accentIndicator:
|
|
1909
|
-
accentTrack:
|
|
1818
|
+
...i.palette || {},
|
|
1819
|
+
accent: t.scale,
|
|
1820
|
+
accentAlpha: t.alphaScale,
|
|
1821
|
+
accentContrast: t.contrast,
|
|
1822
|
+
accentSurface: t.surface,
|
|
1823
|
+
accentIndicator: t.indicator,
|
|
1824
|
+
accentTrack: t.track
|
|
1910
1825
|
}
|
|
1911
1826
|
},
|
|
1912
|
-
{ mode:
|
|
1827
|
+
{ mode: e }
|
|
1913
1828
|
);
|
|
1914
1829
|
}
|
|
1915
|
-
function o(
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1830
|
+
function o(n, a, e) {
|
|
1831
|
+
n[a] = e;
|
|
1832
|
+
}
|
|
1833
|
+
function l(n, a, e) {
|
|
1834
|
+
e && Object.entries(e).forEach(([t, i]) => {
|
|
1835
|
+
typeof i == "string" && i && (n[`${a}${t}`] = i);
|
|
1836
|
+
});
|
|
1837
|
+
}
|
|
1838
|
+
function Sa(n) {
|
|
1839
|
+
n && H.add(n);
|
|
1840
|
+
}
|
|
1841
|
+
function ca(n) {
|
|
1842
|
+
return F(S(n));
|
|
1843
|
+
}
|
|
1844
|
+
const la = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
1845
|
+
function E(n) {
|
|
1846
|
+
const a = la.exec(n.trim());
|
|
1847
|
+
if (!a) return null;
|
|
1848
|
+
const e = a[1].length === 3 ? a[1].replace(/./g, (t) => t + t) : a[1];
|
|
1849
|
+
return [parseInt(e.slice(0, 2), 16), parseInt(e.slice(2, 4), 16), parseInt(e.slice(4, 6), 16)];
|
|
1850
|
+
}
|
|
1851
|
+
function z(n, a, e) {
|
|
1852
|
+
const t = E(n), i = E(a);
|
|
1853
|
+
return !t || !i ? null : "#" + t.map((s, c) => Math.round(s + (i[c] - s) * e)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
1854
|
+
}
|
|
1855
|
+
function pa(n) {
|
|
1856
|
+
const a = {}, e = n.colors, t = e.surface || e.background, i = e.text;
|
|
1857
|
+
if (!t || !i) return a;
|
|
1858
|
+
const r = [
|
|
1859
|
+
// the accent's text step (Radix step 11) can sit just under 4.5:1 (amber is 4.49:1 on near-white)
|
|
1860
|
+
["accent", n.palette?.accent?.["11"] || e.primary],
|
|
1861
|
+
["danger", e.danger],
|
|
1862
|
+
["success", e.success],
|
|
1863
|
+
["warning", e.warning],
|
|
1864
|
+
["info", e.info]
|
|
1865
|
+
];
|
|
1866
|
+
for (const [s, c] of r) {
|
|
1867
|
+
if (!c) continue;
|
|
1868
|
+
if (!E(c)) {
|
|
1869
|
+
a[`--ui-color-${s}-text`] = `color-mix(in srgb, ${c} 62%, ${i})`;
|
|
1870
|
+
continue;
|
|
1871
|
+
}
|
|
1872
|
+
const d = z(c, t, 0.86);
|
|
1873
|
+
let f = c;
|
|
1874
|
+
for (let g = 0; g <= 18; g += 1) {
|
|
1875
|
+
const m = z(c, i, g * 0.05);
|
|
1876
|
+
if (!m) break;
|
|
1877
|
+
f = m;
|
|
1878
|
+
const x = v(m, t) ?? 0, C = d ? v(m, d) ?? 0 : x;
|
|
1879
|
+
if (x >= 5.5 && C >= 5) break;
|
|
1880
|
+
}
|
|
1881
|
+
if (a[`--ui-color-${s}-text`] = f, s === "danger" || s === "success") {
|
|
1882
|
+
let g = c;
|
|
1883
|
+
for (let m = 0; m <= 12; m += 1) {
|
|
1884
|
+
const x = z(c, "#000000", m * 0.05);
|
|
1885
|
+
if (!x || (g = x, (v("#ffffff", x) ?? 0) >= 4.6)) break;
|
|
1886
|
+
}
|
|
1887
|
+
a[`--ui-color-${s}-solid`] = g, a[`--ui-color-foreground-on-${s}`] = "#ffffff";
|
|
1888
|
+
}
|
|
1919
1889
|
}
|
|
1890
|
+
return a;
|
|
1920
1891
|
}
|
|
1921
|
-
function
|
|
1922
|
-
|
|
1923
|
-
|
|
1892
|
+
function da(n) {
|
|
1893
|
+
const a = n.colors, e = n.palette;
|
|
1894
|
+
if (!e || !a) return n;
|
|
1895
|
+
const t = (m, x, C) => `color-mix(in srgb, ${m} ${x}%, ${C})`, i = a.surface || a.background, r = a.text;
|
|
1896
|
+
let s = e.gray, c = e.accent;
|
|
1897
|
+
const d = a.background ? w(a.background) : null, f = s?.["1"] ? w(s[1]) : null;
|
|
1898
|
+
i && r && d !== null && f !== null && d < 0.4 != f < 0.4 && (s = {
|
|
1899
|
+
...s,
|
|
1900
|
+
2: t(r, 4, i),
|
|
1901
|
+
3: t(r, 8, i),
|
|
1902
|
+
4: t(r, 12, i),
|
|
1903
|
+
5: t(r, 16, i),
|
|
1904
|
+
6: t(r, 20, i),
|
|
1905
|
+
7: t(r, 28, i),
|
|
1906
|
+
8: t(r, 40, i),
|
|
1907
|
+
11: a.muted || r,
|
|
1908
|
+
12: r
|
|
1924
1909
|
});
|
|
1910
|
+
const g = c?.["9"];
|
|
1911
|
+
return i && r && a.primary && g && g.trim().toLowerCase() !== a.primary.trim().toLowerCase() && (c = {
|
|
1912
|
+
...c,
|
|
1913
|
+
2: t(a.primary, 6, i),
|
|
1914
|
+
3: t(a.primary, 14, i),
|
|
1915
|
+
4: t(a.primary, 20, i),
|
|
1916
|
+
5: t(a.primary, 26, i),
|
|
1917
|
+
7: t(a.primary, 42, i),
|
|
1918
|
+
9: a.primary,
|
|
1919
|
+
10: a.primaryHover || a.primary,
|
|
1920
|
+
11: t(a.primary, 60, r)
|
|
1921
|
+
}), s === e.gray && c === e.accent ? n : { ...n, palette: { ...e, gray: s, accent: c } };
|
|
1925
1922
|
}
|
|
1926
|
-
function
|
|
1927
|
-
|
|
1923
|
+
function F(n) {
|
|
1924
|
+
const a = da(n), e = {};
|
|
1925
|
+
return o(e, "--ui-color-primary", a.colors.primary), o(e, "--ui-color-primary-hover", a.colors.primaryHover || a.colors.primary), o(e, "--ui-color-foreground-on-primary", a.colors.foregroundOnPrimary || "#ffffff"), o(e, "--ui-color-background", a.colors.background || "#ffffff"), o(e, "--ui-color-surface", a.colors.surface || a.colors.background || "#ffffff"), o(e, "--ui-color-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), o(e, "--ui-color-text", a.colors.text || "#202020"), o(e, "--ui-color-muted", a.colors.muted || "#646464"), o(e, "--ui-color-border", a.colors.border || "#0000001f"), o(e, "--ui-color-focus-ring", a.colors.focusRing || a.colors.primary), o(e, "--ui-color-success", a.colors.success || "#30a46c"), o(e, "--ui-color-danger", a.colors.danger || "#e5484d"), o(e, "--ui-color-warning", a.colors.warning || a.colors.primary), o(e, "--ui-primary", a.colors.primary), o(e, "--ui-primary-hover", a.colors.primaryHover || a.colors.primary), o(e, "--ui-foreground", a.colors.foregroundOnPrimary || "#ffffff"), o(e, "--ui-background", a.colors.background || "#ffffff"), o(e, "--ui-surface", a.colors.surface || a.colors.background || "#ffffff"), o(e, "--ui-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), o(e, "--ui-text", a.colors.text || "#202020"), o(e, "--ui-muted", a.colors.muted || "#646464"), o(e, "--ui-border", a.colors.border || "#0000001f"), o(e, "--ui-focus-ring", a.colors.focusRing || a.colors.primary), o(e, "--ui-success", a.colors.success || "#30a46c"), o(e, "--ui-error", a.colors.danger || "#e5484d"), o(e, "--ui-warning", a.colors.warning || a.colors.primary), o(e, "--ui-radius", a.radius || "6px"), o(e, "--ui-space-xs", a.spacing?.xs || "4px"), o(e, "--ui-space-sm", a.spacing?.sm || "8px"), o(e, "--ui-space-md", a.spacing?.md || "12px"), o(e, "--ui-space-lg", a.spacing?.lg || "24px"), o(e, "--ui-space-xl", a.spacing?.xl || "32px"), o(e, "--ui-space-xxl", a.spacing?.xxl || "48px"), o(e, "--ui-default-gap", a.spacing?.sm || a.spaceScale?.["2"] || "8px"), o(e, "--ui-shadow-sm", a.shadows?.sm || a.shadows?.["2"] || "none"), o(e, "--ui-shadow-md", a.shadows?.md || a.shadows?.["3"] || "none"), o(e, "--ui-shadow-lg", a.shadows?.lg || a.shadows?.["4"] || "none"), o(e, "--ui-font-family", a.typography?.family || "system-ui, sans-serif"), o(e, "--ui-font-family-heading", a.typography?.headingFamily || a.typography?.family || "system-ui, sans-serif"), o(e, "--ui-font-family-code", a.typography?.codeFamily || "monospace"), o(e, "--ui-font-size-sm", a.typography?.size?.sm || "12px"), o(e, "--ui-font-size-md", a.typography?.size?.md || "14px"), o(e, "--ui-font-size-lg", a.typography?.size?.lg || "16px"), o(e, "--ui-default-font-size", a.typography?.size?.md || a.typography?.fontScale?.["2"] || "14px"), o(e, "--ui-default-line-height", a.typography?.lineHeight?.["2"] || "20px"), o(e, "--ui-default-letter-spacing", a.typography?.letterSpacing?.["2"] || "0em"), o(e, "--ui-motion-short", a.motion?.durationShort || "120ms"), o(e, "--ui-motion-base", a.motion?.durationBase || "180ms"), o(e, "--ui-motion-long", a.motion?.durationLong || "260ms"), o(e, "--ui-motion-easing", a.motion?.easing || "cubic-bezier(0.2, 0.8, 0.2, 1)"), o(e, "--ui-z-modal", String(a.zIndex?.modal ?? 1e3)), o(e, "--ui-z-overlay", String(a.zIndex?.overlay ?? 900)), o(e, "--ui-z-toast", String(a.zIndex?.toast ?? 1100)), o(e, "--ui-breakpoint-sm", a.breakpoints?.sm || "640px"), o(e, "--ui-breakpoint-md", a.breakpoints?.md || "768px"), o(e, "--ui-breakpoint-lg", a.breakpoints?.lg || "1024px"), o(e, "--color-background", a.surfaces?.background || a.colors.background || "#ffffff"), o(e, "--color-surface", a.surfaces?.surface || a.colors.surface || "#fcfcfc"), o(e, "--color-panel", a.surfaces?.panel || a.surfaces?.panelTranslucent || "#ffffffcc"), o(e, "--color-panel-solid", a.surfaces?.panelSolid || a.colors.surface || "#ffffff"), o(e, "--color-panel-translucent", a.surfaces?.panelTranslucent || "#ffffffcc"), o(e, "--color-overlay", a.surfaces?.overlay || "rgba(2, 6, 23, 0.52)"), o(e, "--color-transparent", a.surfaces?.transparent || "transparent"), o(e, "--backdrop-filter-panel", a.effects?.backdropFilterPanel || "blur(64px)"), a.palette?.accentContrast && o(e, "--accent-contrast", a.palette.accentContrast), a.palette?.accentSurface && o(e, "--accent-surface", a.palette.accentSurface), a.palette?.accentIndicator && o(e, "--accent-indicator", a.palette.accentIndicator), a.palette?.accentTrack && o(e, "--accent-track", a.palette.accentTrack), l(e, "--gray-", a.palette?.gray), l(e, "--gray-a", a.palette?.grayAlpha), l(e, "--black-a", a.palette?.blackAlpha), l(e, "--white-a", a.palette?.whiteAlpha), l(e, "--accent-", a.palette?.accent), l(e, "--accent-a", a.palette?.accentAlpha), l(e, "--space-", a.spaceScale), l(e, "--radius-", a.radiusScale), l(e, "--font-size-", a.typography?.fontScale), l(e, "--line-height-", a.typography?.lineHeight), l(e, "--letter-spacing-", a.typography?.letterSpacing), l(e, "--shadow-", a.shadows), l(e, "--base-button-", a.components?.button), l(e, "--base-badge-", a.components?.badge), l(e, "--base-dropdown-", a.components?.dropdown), l(e, "--base-select-", a.components?.select), l(e, "--base-sidebar-", a.components?.sidebar), l(e, "--base-block-controls-", a.components?.blockControls), l(e, "--base-box-", a.components?.box), l(e, "--base-breadcrumb-", a.components?.breadcrumb), l(e, "--base-card-", a.components?.card), l(e, "--base-multi-select-", a.components?.multiSelect), l(e, "--base-navigation-menu-", a.components?.navigationMenu), l(e, "--base-menubar-", a.components?.menubar), l(e, "--base-context-menu-", a.components?.contextMenu), l(e, "--base-alert-", a.components?.alert), l(e, "--base-alert-dialog-", a.components?.alertDialog), l(e, "--base-app-header-", a.components?.appHeader), l(e, "--base-aspect-ratio-", a.components?.aspectRatio), l(e, "--base-avatar-", a.components?.avatar), l(e, "--base-menu-", a.components?.menu), l(e, "--base-panel-", a.components?.panel), l(e, "--base-input-", a.components?.input), Object.assign(e, na(a)), Object.assign(e, pa(a)), o(e, "--ui-color-foreground-on-warning", k(a.colors.warning || a.colors.primary, "#ffffff")), e;
|
|
1928
1926
|
}
|
|
1929
|
-
function
|
|
1930
|
-
|
|
1927
|
+
function P(n, a) {
|
|
1928
|
+
Object.entries(a).forEach(([e, t]) => {
|
|
1929
|
+
try {
|
|
1930
|
+
n.style.setProperty(e, t);
|
|
1931
|
+
} catch {
|
|
1932
|
+
}
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
function Ca(n, a = ":root") {
|
|
1936
|
+
const e = Object.entries(ca(n)).map(([t, i]) => ` ${t}: ${i};`).join(`
|
|
1937
|
+
`);
|
|
1938
|
+
return `${a} {
|
|
1939
|
+
${e}
|
|
1940
|
+
}
|
|
1941
|
+
`;
|
|
1942
|
+
}
|
|
1943
|
+
function j(n) {
|
|
1944
|
+
return n === document ? document.documentElement : n instanceof ShadowRoot ? n.host : n;
|
|
1931
1945
|
}
|
|
1932
|
-
function
|
|
1946
|
+
function fa(n, a = typeof document < "u" ? document : null) {
|
|
1933
1947
|
if (!a) return;
|
|
1934
|
-
const
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
for (const n of I)
|
|
1948
|
+
const e = F(S(n)), t = a === document || a instanceof ShadowRoot, i = j(a);
|
|
1949
|
+
if (P(i, e), t)
|
|
1950
|
+
for (const r of H)
|
|
1938
1951
|
try {
|
|
1939
|
-
|
|
1952
|
+
P(r, e);
|
|
1940
1953
|
} catch {
|
|
1941
1954
|
}
|
|
1942
1955
|
}
|
|
1956
|
+
function za(n = {}) {
|
|
1957
|
+
const a = n.root === void 0 ? typeof document < "u" ? document : null : n.root;
|
|
1958
|
+
if (!a) return () => {
|
|
1959
|
+
};
|
|
1960
|
+
const e = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null, t = (r) => {
|
|
1961
|
+
const s = r ? "dark" : "light";
|
|
1962
|
+
fa(S(r ? n.dark : n.light, { accentPalette: n.accentPalette, mode: s }), a);
|
|
1963
|
+
const c = j(a);
|
|
1964
|
+
c.setAttribute("data-ui-mode", s), c.style.setProperty("color-scheme", s);
|
|
1965
|
+
};
|
|
1966
|
+
if (t(!!e?.matches), !e) return () => {
|
|
1967
|
+
};
|
|
1968
|
+
const i = (r) => t(r.matches);
|
|
1969
|
+
return typeof e.addEventListener == "function" ? (e.addEventListener("change", i), () => e.removeEventListener("change", i)) : (e.addListener(i), () => e.removeListener(i));
|
|
1970
|
+
}
|
|
1943
1971
|
export {
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1972
|
+
U as A,
|
|
1973
|
+
X as D,
|
|
1974
|
+
ma as a,
|
|
1975
|
+
za as b,
|
|
1976
|
+
fa as c,
|
|
1977
|
+
u as d,
|
|
1978
|
+
oa as e,
|
|
1979
|
+
_ as f,
|
|
1980
|
+
xa as g,
|
|
1981
|
+
ya as h,
|
|
1982
|
+
Q as i,
|
|
1983
|
+
K as j,
|
|
1984
|
+
S as k,
|
|
1985
|
+
ka as l,
|
|
1986
|
+
ia as m,
|
|
1987
|
+
na as n,
|
|
1988
|
+
sa as o,
|
|
1989
|
+
ba as p,
|
|
1990
|
+
wa as q,
|
|
1991
|
+
ha as r,
|
|
1992
|
+
k as s,
|
|
1993
|
+
Sa as t,
|
|
1994
|
+
va as u,
|
|
1995
|
+
Ca as v,
|
|
1996
|
+
ca as w,
|
|
1997
|
+
_a as x
|
|
1966
1998
|
};
|