@editora/ui-core 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ElementBase-DxbvhLJs.js → ElementBase-CbUsP3D6.js} +1 -1
- package/dist/{ElementBase-BeZT54Hj.mjs → ElementBase-D5QsC5Vw.mjs} +10 -1
- package/dist/ElementBase.d.ts +7 -0
- package/dist/ElementBase.d.ts.map +1 -1
- package/dist/accordion.cjs.js +1 -1
- package/dist/accordion.esm.js +1 -1
- package/dist/add-icons-CVeHOsWl.js +1 -0
- package/dist/add-icons-DBUZJ0g7.mjs +14 -0
- package/dist/add-icons.cjs.js +1 -0
- package/dist/add-icons.d.ts +16 -0
- package/dist/add-icons.d.ts.map +1 -0
- package/dist/add-icons.esm.js +4 -0
- package/dist/alert-dialog.cjs.js +24 -24
- package/dist/alert-dialog.esm.js +112 -107
- package/dist/alert.cjs.js +8 -8
- package/dist/alert.esm.js +22 -22
- package/dist/animated-beam.cjs.js +1 -1
- package/dist/animated-beam.esm.js +1 -1
- package/dist/animated-list.cjs.js +1 -1
- package/dist/animated-list.esm.js +1 -1
- package/dist/animated-text.cjs.js +1 -1
- package/dist/animated-text.esm.js +1 -1
- package/dist/app-header.cjs.js +15 -3
- package/dist/app-header.esm.js +31 -4
- package/dist/aspect-ratio.cjs.js +1 -1
- package/dist/aspect-ratio.esm.js +1 -1
- package/dist/avatar.cjs.js +1 -1
- package/dist/avatar.esm.js +1 -1
- package/dist/badge.cjs.js +1 -1
- package/dist/badge.esm.js +1 -1
- package/dist/block-controls.cjs.js +1 -1
- package/dist/block-controls.esm.js +1 -1
- package/dist/box.cjs.js +1 -1
- package/dist/box.esm.js +1 -1
- package/dist/breadcrumb.cjs.js +4 -4
- package/dist/breadcrumb.esm.js +93 -84
- package/dist/button.cjs.js +520 -1
- package/dist/button.esm.js +682 -2
- package/dist/{calendar-CzpWDxLc.js → calendar-BsVqtpjM.js} +6 -6
- package/dist/{calendar-DkSDFg33.mjs → calendar-CFafqZVA.mjs} +6 -6
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +6 -5
- package/dist/card.esm.js +52 -39
- package/dist/chart.cjs.js +2 -2
- package/dist/chart.esm.js +2 -2
- package/dist/checkbox.cjs.js +4 -4
- package/dist/checkbox.esm.js +36 -15
- package/dist/clone-source-BxK2pEVw.mjs +11 -0
- package/dist/clone-source-C7E_ri5f.js +1 -0
- package/dist/collapsible.cjs.js +1 -1
- package/dist/collapsible.esm.js +1 -1
- package/dist/color-picker.cjs.js +2 -2
- package/dist/color-picker.esm.js +3 -3
- package/dist/combobox.cjs.js +4 -4
- package/dist/combobox.esm.js +22 -19
- package/dist/command-palette.cjs.js +1 -1
- package/dist/command-palette.esm.js +1 -1
- package/dist/command.cjs.js +1 -1
- package/dist/command.esm.js +1 -1
- 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-app-header.d.ts +1 -0
- package/dist/components/ui-app-header.d.ts.map +1 -1
- package/dist/components/ui-breadcrumb.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts +7 -0
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts +6 -0
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dialog.d.ts +1 -0
- package/dist/components/ui-dialog.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-hover-card.d.ts.map +1 -1
- package/dist/components/ui-icon.d.ts +1 -0
- package/dist/components/ui-icon.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts +16 -0
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-layout.d.ts +20 -0
- package/dist/components/ui-layout.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts +1 -0
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-menubar.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts +6 -0
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts +6 -0
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-pagination.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts +11 -0
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-popover.d.ts.map +1 -1
- package/dist/components/ui-positioner.d.ts.map +1 -1
- package/dist/components/ui-radio-group.d.ts +6 -0
- package/dist/components/ui-radio-group.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-select.d.ts +7 -0
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-sidebar.d.ts +1 -0
- package/dist/components/ui-sidebar.d.ts.map +1 -1
- package/dist/components/ui-slider.d.ts +6 -0
- package/dist/components/ui-slider.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts +1 -0
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts +6 -0
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts +2 -0
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts +6 -0
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-toast.d.ts.map +1 -1
- package/dist/components/ui-tooltip.d.ts.map +1 -1
- package/dist/container.cjs.js +1 -1
- package/dist/container.esm.js +1 -1
- package/dist/context-menu.cjs.js +2 -2
- package/dist/context-menu.esm.js +2 -2
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +1 -1
- package/dist/data-table.cjs.js +5 -5
- package/dist/data-table.esm.js +7 -7
- package/dist/date-field.cjs.js +1 -1
- package/dist/date-field.esm.js +3 -3
- package/dist/date-picker.cjs.js +2 -2
- package/dist/date-picker.esm.js +17 -17
- package/dist/date-range-picker.cjs.js +2 -2
- package/dist/date-range-picker.esm.js +4 -4
- package/dist/date-range-time-picker.cjs.js +3 -3
- package/dist/date-range-time-picker.esm.js +16 -16
- package/dist/date-time-picker.cjs.js +26 -23
- package/dist/date-time-picker.esm.js +49 -46
- package/dist/{date-time-utils-zAx4ghvC.mjs → date-time-utils-CJUksWj3.mjs} +1 -1
- package/dist/{date-time-utils-C-4eHTyy.js → date-time-utils-D3hQQ5Om.js} +1 -1
- package/dist/description.cjs.js +1 -1
- package/dist/description.esm.js +1 -1
- package/dist/dialog.cjs.js +7 -7
- package/dist/dialog.esm.js +51 -47
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dismissable-layer.cjs.js +1 -1
- package/dist/dismissable-layer.esm.js +1 -1
- package/dist/dock.cjs.js +1 -1
- package/dist/dock.esm.js +1 -1
- package/dist/drawer.cjs.js +5 -5
- package/dist/drawer.esm.js +18 -17
- package/dist/dropdown.cjs.js +7 -7
- package/dist/dropdown.esm.js +39 -38
- package/dist/empty-state.cjs.js +12 -2
- package/dist/empty-state.esm.js +17 -7
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +1 -1
- package/dist/field.cjs.js +2 -2
- package/dist/field.esm.js +2 -2
- package/dist/fieldset.cjs.js +1 -1
- package/dist/fieldset.esm.js +1 -1
- package/dist/file-upload.cjs.js +1 -1
- package/dist/file-upload.esm.js +1 -1
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +1 -1
- package/dist/floating-toolbar.cjs.js +2 -2
- package/dist/floating-toolbar.esm.js +2 -2
- package/dist/focus-scope-Dl0qk5GP.mjs +177 -0
- package/dist/focus-scope-Doz0bnE1.js +1 -0
- package/dist/focus-scope.cjs.js +1 -1
- package/dist/focus-scope.esm.js +2 -2
- package/dist/form-control-B90_3kYN.js +1 -0
- package/dist/form-control-D9wWUMBl.mjs +86 -0
- package/dist/form.cjs.js +2 -2
- package/dist/form.esm.js +2 -2
- package/dist/gantt.cjs.js +2 -2
- package/dist/gantt.esm.js +2 -2
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +5 -5
- package/dist/hover-card.esm.js +19 -18
- package/dist/icon-cloud.cjs.js +1 -1
- package/dist/icon-cloud.esm.js +1 -1
- package/dist/icon.cjs.js +207 -1
- package/dist/icon.esm.js +294 -2
- package/dist/icons-CpCpPXV5.js +1 -0
- package/dist/icons-DWYbbhb0.mjs +115 -0
- package/dist/icons.d.ts +11 -1
- package/dist/icons.d.ts.map +1 -1
- package/dist/implicit-submit-B6M5Uc56.js +1 -0
- package/dist/implicit-submit-Lr0-q2LR.mjs +44 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +309 -299
- package/dist/inline-edit.cjs.js +1 -1
- package/dist/inline-edit.esm.js +1 -1
- package/dist/input.cjs.js +62 -20
- package/dist/input.esm.js +164 -58
- package/dist/label.cjs.js +1 -1
- package/dist/label.esm.js +1 -1
- package/dist/layout.cjs.js +145 -4
- package/dist/layout.esm.js +278 -40
- package/dist/marquee.cjs.js +1 -1
- package/dist/marquee.esm.js +1 -1
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +1 -1
- package/dist/menu.cjs.js +8 -8
- package/dist/menu.esm.js +51 -47
- package/dist/menubar.cjs.js +9 -9
- package/dist/menubar.esm.js +41 -40
- package/dist/meter.cjs.js +1 -1
- package/dist/meter.esm.js +1 -1
- package/dist/multi-select.cjs.js +7 -7
- package/dist/multi-select.esm.js +55 -34
- package/dist/navigate-CXebafwF.mjs +18 -0
- package/dist/navigate-ChJVIIuS.js +1 -0
- package/dist/navigation-menu.cjs.js +1 -1
- package/dist/navigation-menu.esm.js +1 -1
- package/dist/number-attribute-BAF07JrU.mjs +8 -0
- package/dist/number-attribute-C4Rrl7d3.js +1 -0
- package/dist/number-field.cjs.js +8 -8
- package/dist/number-field.esm.js +90 -69
- package/dist/number-ticker.cjs.js +1 -1
- package/dist/number-ticker.esm.js +1 -1
- package/dist/odometer.cjs.js +1 -1
- package/dist/odometer.esm.js +1 -1
- package/dist/orbiter.cjs.js +1 -1
- package/dist/orbiter.esm.js +1 -1
- package/dist/pagination.cjs.js +24 -23
- package/dist/pagination.esm.js +61 -46
- package/dist/{panel-group-BVHJEdfx.js → panel-group-BIzzpQ5i.js} +1 -1
- package/dist/{panel-group-BxO_eNW6.mjs → panel-group-CFLjzRWI.mjs} +1 -1
- package/dist/panel-group.cjs.js +1 -1
- package/dist/panel-group.esm.js +1 -1
- package/dist/panel.cjs.js +1 -1
- package/dist/panel.esm.js +1 -1
- package/dist/password-field.cjs.js +36 -16
- package/dist/password-field.esm.js +113 -44
- package/dist/pin-input.cjs.js +1 -1
- package/dist/pin-input.esm.js +1 -1
- 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 +2 -2
- package/dist/popover.esm.js +28 -26
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/positioner.cjs.js +2 -2
- package/dist/positioner.esm.js +35 -38
- package/dist/preload.cjs.js +221 -0
- package/dist/preload.css +220 -0
- package/dist/preload.d.ts +17 -0
- package/dist/preload.d.ts.map +1 -0
- package/dist/preload.esm.js +224 -0
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/primitives/clone-source.d.ts +3 -0
- package/dist/primitives/clone-source.d.ts.map +1 -0
- package/dist/primitives/focus-scope.d.ts +6 -0
- package/dist/primitives/focus-scope.d.ts.map +1 -1
- package/dist/primitives/form-control.d.ts +68 -0
- package/dist/primitives/form-control.d.ts.map +1 -0
- package/dist/primitives/implicit-submit.d.ts +17 -0
- package/dist/primitives/implicit-submit.d.ts.map +1 -0
- package/dist/primitives/navigate.d.ts +27 -0
- package/dist/primitives/navigate.d.ts.map +1 -0
- package/dist/primitives/number-attribute.d.ts +7 -0
- package/dist/primitives/number-attribute.d.ts.map +1 -0
- package/dist/primitives/slotted-input.d.ts +19 -0
- package/dist/primitives/slotted-input.d.ts.map +1 -0
- package/dist/progress.cjs.js +3 -3
- package/dist/progress.esm.js +3 -3
- package/dist/quick-actions.cjs.js +5 -5
- package/dist/quick-actions.esm.js +3 -3
- package/dist/radio-group.cjs.js +9 -9
- package/dist/radio-group.esm.js +47 -24
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +1 -1
- package/dist/rating.cjs.js +6 -6
- package/dist/rating.esm.js +21 -10
- package/dist/{runtime-CJzoaC8Z.mjs → runtime-CORXjP7e.mjs} +366 -352
- package/dist/runtime-uCly3ECd.js +5 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +1 -1
- package/dist/scroll-area.cjs.js +1 -1
- package/dist/scroll-area.esm.js +1 -1
- package/dist/section.cjs.js +1 -1
- package/dist/section.esm.js +1 -1
- package/dist/select.cjs.js +21 -21
- package/dist/select.esm.js +111 -71
- package/dist/selection-popup.cjs.js +2 -2
- package/dist/selection-popup.esm.js +2 -2
- package/dist/semantic-tokens.d.ts.map +1 -1
- package/dist/separator.cjs.js +1 -1
- package/dist/separator.esm.js +1 -1
- package/dist/sidebar.cjs.js +15 -15
- package/dist/sidebar.esm.js +48 -42
- package/dist/skeleton.cjs.js +1 -1
- package/dist/skeleton.esm.js +1 -1
- package/dist/slider.cjs.js +11 -11
- package/dist/slider.esm.js +40 -23
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/slotted-input-BVq2QQg2.js +1 -0
- package/dist/slotted-input-atWznLfm.mjs +13 -0
- package/dist/sortable.cjs.js +25 -25
- package/dist/sortable.esm.js +29 -21
- package/dist/spinning-text.cjs.js +1 -1
- package/dist/spinning-text.esm.js +1 -1
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +1 -1
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/standalone/add-icons.d.ts +2 -0
- package/dist/standalone/add-icons.d.ts.map +1 -0
- package/dist/standalone/preload.d.ts +2 -0
- package/dist/standalone/preload.d.ts.map +1 -0
- package/dist/stepper.cjs.js +3 -3
- package/dist/stepper.esm.js +3 -3
- package/dist/switch.cjs.js +9 -9
- package/dist/switch.esm.js +56 -35
- package/dist/table.cjs.js +1 -1
- package/dist/table.esm.js +1 -1
- package/dist/tabs.cjs.js +14 -14
- package/dist/tabs.esm.js +129 -115
- package/dist/tags-input.cjs.js +1 -1
- package/dist/tags-input.esm.js +1 -1
- package/dist/textarea.cjs.js +33 -11
- package/dist/textarea.esm.js +74 -35
- package/dist/theme.d.ts +6 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +1 -1
- package/dist/time-field.esm.js +2 -2
- package/dist/time-picker.cjs.js +1 -1
- package/dist/time-picker.esm.js +3 -3
- package/dist/timeline.cjs.js +2 -2
- package/dist/timeline.esm.js +2 -2
- package/dist/toast.cjs.js +4 -4
- package/dist/toast.esm.js +17 -16
- package/dist/toggle-group.cjs.js +1 -1
- package/dist/toggle-group.esm.js +1 -1
- package/dist/toggle.cjs.js +3 -3
- package/dist/toggle.esm.js +9 -9
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +1 -1
- package/dist/tooltip.cjs.js +2 -2
- package/dist/tooltip.esm.js +12 -14
- package/dist/transfer-list.cjs.js +1 -1
- package/dist/transfer-list.esm.js +1 -1
- package/dist/{tree-33fVNnaf.mjs → tree-CD2k2lIC.mjs} +1 -1
- package/dist/{tree-Dc02MChE.js → tree-ChQfhxya.js} +1 -1
- package/dist/tree-item.cjs.js +1 -1
- package/dist/tree-item.esm.js +1 -1
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +4 -4
- package/dist/wizard.esm.js +4 -4
- package/package.json +3 -2
- package/dist/focus-scope-Bwug2gDv.js +0 -1
- package/dist/focus-scope-CmEsG5UZ.mjs +0 -138
- package/dist/runtime-DYSIU3sR.js +0 -5
- package/dist/ui-button-C3OmI7Sn.mjs +0 -684
- package/dist/ui-button-CnLwXBnx.js +0 -520
- package/dist/ui-icon-D3avtxX_.js +0 -207
- package/dist/ui-icon-DLhB08Fo.mjs +0 -361
|
@@ -3,56 +3,56 @@ import "./positioner-BE8Nbho2.mjs";
|
|
|
3
3
|
function A() {
|
|
4
4
|
return typeof window < "u" && typeof document < "u";
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
return
|
|
6
|
+
function V(t) {
|
|
7
|
+
return t ? typeof t == "string" ? t : t instanceof Error && t.message ? t.message : "Something went wrong. Please try again." : "Something went wrong. Please try again.";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function Z(t) {
|
|
10
|
+
return t === "replace" || t === "stack" ? t : "queue";
|
|
11
11
|
}
|
|
12
|
-
function L(
|
|
13
|
-
return `ui-alert-dialog-${
|
|
12
|
+
function L(t) {
|
|
13
|
+
return `ui-alert-dialog-${t}`;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const e =
|
|
17
|
-
if (
|
|
18
|
-
const i =
|
|
15
|
+
function U(t, a) {
|
|
16
|
+
const e = t.kind === "alert" && a.action === "cancel" ? "dismiss" : a.action, n = t.dialog?.getChecked();
|
|
17
|
+
if (t.kind === "prompt") {
|
|
18
|
+
const i = t.dialog?.getInputValue() ?? t.value ?? "";
|
|
19
19
|
return {
|
|
20
|
-
id:
|
|
20
|
+
id: t.id,
|
|
21
21
|
action: e,
|
|
22
22
|
value: i,
|
|
23
|
-
checked:
|
|
23
|
+
checked: n,
|
|
24
24
|
source: a.source,
|
|
25
25
|
reason: a.reason
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
return {
|
|
29
|
-
id:
|
|
29
|
+
id: t.id,
|
|
30
30
|
action: e,
|
|
31
|
-
value:
|
|
32
|
-
checked:
|
|
31
|
+
value: t.value,
|
|
32
|
+
checked: n,
|
|
33
33
|
source: a.source,
|
|
34
34
|
reason: a.reason
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function y(
|
|
38
|
-
return
|
|
39
|
-
id:
|
|
37
|
+
function y(t, a, e) {
|
|
38
|
+
return t.kind === "prompt" ? {
|
|
39
|
+
id: t.id,
|
|
40
40
|
action: "dismiss",
|
|
41
|
-
value:
|
|
42
|
-
checked:
|
|
41
|
+
value: t.dialog?.getInputValue() ?? t.value ?? "",
|
|
42
|
+
checked: t.dialog?.getChecked(),
|
|
43
43
|
source: a,
|
|
44
44
|
reason: e
|
|
45
45
|
} : {
|
|
46
|
-
id:
|
|
46
|
+
id: t.id,
|
|
47
47
|
action: "dismiss",
|
|
48
|
-
value:
|
|
49
|
-
checked:
|
|
48
|
+
value: t.value,
|
|
49
|
+
checked: t.dialog?.getChecked(),
|
|
50
50
|
source: a,
|
|
51
51
|
reason: e
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
54
|
+
function G(t) {
|
|
55
|
+
return t === "esc" || t === "backdrop" || t === "close-icon" || t === "abort" || t === "unmount" || t === "replace" || t === "programmatic" ? t : "abort";
|
|
56
56
|
}
|
|
57
57
|
class Q {
|
|
58
58
|
constructor(a) {
|
|
@@ -77,39 +77,39 @@ class Q {
|
|
|
77
77
|
this._disposed = !0;
|
|
78
78
|
const e = [...this._active, ...this._queue];
|
|
79
79
|
this._queue = [];
|
|
80
|
-
for (const
|
|
81
|
-
this._settle(
|
|
80
|
+
for (const n of e)
|
|
81
|
+
this._settle(n, y(n, 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
84
|
_enqueue(a, e) {
|
|
85
|
-
const
|
|
85
|
+
const n = this._mergeOptions(e);
|
|
86
86
|
if (!A() || this._disposed) {
|
|
87
87
|
const s = {
|
|
88
|
-
id:
|
|
88
|
+
id: n.id || L(++this._seed),
|
|
89
89
|
action: "dismiss",
|
|
90
90
|
source: "unmount"
|
|
91
91
|
};
|
|
92
92
|
return Promise.resolve(s);
|
|
93
93
|
}
|
|
94
|
-
const i =
|
|
94
|
+
const i = n.id || L(++this._seed), r = Z(n.mode);
|
|
95
95
|
return new Promise((s) => {
|
|
96
96
|
const c = {
|
|
97
97
|
id: i,
|
|
98
98
|
kind: a,
|
|
99
99
|
mode: r,
|
|
100
|
-
options:
|
|
100
|
+
options: n,
|
|
101
101
|
settled: !1,
|
|
102
102
|
processing: !1,
|
|
103
103
|
resolve: s,
|
|
104
104
|
cleanup: []
|
|
105
105
|
};
|
|
106
|
-
if (
|
|
106
|
+
if (n.signal?.aborted) {
|
|
107
107
|
this._settle(c, y(c, "abort"), !1);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
110
|
if (r === "replace") {
|
|
111
|
-
const
|
|
112
|
-
|
|
111
|
+
const l = this._active[this._active.length - 1];
|
|
112
|
+
l && this._settle(l, y(l, "replace", "replace"), !1, !1), this._open(c);
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
if (r === "stack") {
|
|
@@ -129,62 +129,62 @@ class Q {
|
|
|
129
129
|
this._settle(a, y(a, "unmount"), !1);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
|
-
const
|
|
133
|
-
a.dialog =
|
|
132
|
+
const n = document.createElement("ui-alert-dialog");
|
|
133
|
+
a.dialog = n, a.checked = !!a.options.checkbox?.defaultChecked;
|
|
134
134
|
const i = this._buildConfig(a);
|
|
135
|
-
|
|
136
|
-
const r = (
|
|
135
|
+
n.dialogId = a.id, n.config = i;
|
|
136
|
+
const r = (l) => {
|
|
137
137
|
if (a.settled) return;
|
|
138
|
-
const f =
|
|
138
|
+
const f = l.detail;
|
|
139
139
|
a.value = f?.inputValue, a.checked = f?.checked;
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
142
|
-
|
|
140
|
+
const u = this._validatePrompt(a);
|
|
141
|
+
if (u) {
|
|
142
|
+
l.preventDefault(), n.setError(u);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
if (!a.options.onConfirm) {
|
|
146
|
-
|
|
146
|
+
n.clearError();
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
l.preventDefault(), a.processing = !0, n.state = "loading", n.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: n,
|
|
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, n.state = "idle", n.clearError(), a.settled || n.close("confirm");
|
|
159
|
+
}).catch((x) => {
|
|
160
|
+
a.processing = !1, n.state = "error", n.setError(V(x));
|
|
161
161
|
});
|
|
162
162
|
}, s = () => {
|
|
163
|
-
a.settled || (a.value =
|
|
164
|
-
}, c = (
|
|
163
|
+
a.settled || (a.value = n.getInputValue(), a.checked = n.getChecked(), n.state === "error" && n.clearError());
|
|
164
|
+
}, c = (l) => {
|
|
165
165
|
if (a.settled) return;
|
|
166
|
-
const f =
|
|
166
|
+
const f = l.detail;
|
|
167
167
|
this._handleClose(a, f);
|
|
168
168
|
};
|
|
169
|
-
if (
|
|
170
|
-
const
|
|
169
|
+
if (n.addEventListener("ui-confirm", r), n.addEventListener("ui-change", s), n.addEventListener("ui-close", c), a.cleanup.push(() => n.removeEventListener("ui-confirm", r)), a.cleanup.push(() => n.removeEventListener("ui-change", s)), a.cleanup.push(() => n.removeEventListener("ui-close", c)), a.options.signal) {
|
|
170
|
+
const l = () => {
|
|
171
171
|
a.settled || this._settle(a, y(a, "abort"), !1);
|
|
172
172
|
};
|
|
173
|
-
a.options.signal.addEventListener("abort",
|
|
173
|
+
a.options.signal.addEventListener("abort", l, { once: !0 }), a.cleanup.push(() => a.options.signal?.removeEventListener("abort", l));
|
|
174
174
|
}
|
|
175
|
-
this._active.push(a), e.appendChild(
|
|
175
|
+
this._active.push(a), e.appendChild(n), n.open = !0, this._updateStackZIndex();
|
|
176
176
|
}
|
|
177
177
|
_validatePrompt(a) {
|
|
178
178
|
if (a.kind !== "prompt") return null;
|
|
179
|
-
const
|
|
180
|
-
return
|
|
179
|
+
const n = a.options.input, i = a.dialog?.getInputValue() ?? a.value ?? "";
|
|
180
|
+
return n?.required && !i.trim() ? "Please enter a value." : n?.validate ? n.validate(i) : null;
|
|
181
181
|
}
|
|
182
|
-
_settle(a, e,
|
|
182
|
+
_settle(a, e, n, i = !0) {
|
|
183
183
|
if (!a.settled) {
|
|
184
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
185
|
const r = a.dialog;
|
|
186
|
-
if (!
|
|
187
|
-
const s =
|
|
186
|
+
if (!n && r.open) {
|
|
187
|
+
const s = G(e.source);
|
|
188
188
|
r.close("dismiss", s, e.reason);
|
|
189
189
|
}
|
|
190
190
|
r.parentElement && r.parentElement.removeChild(r);
|
|
@@ -205,7 +205,7 @@ class Q {
|
|
|
205
205
|
a && this._open(a);
|
|
206
206
|
}
|
|
207
207
|
_buildConfig(a) {
|
|
208
|
-
const e = a.options,
|
|
208
|
+
const e = a.options, n = a.kind === "prompt", i = a.kind === "alert", r = n ? e.input : void 0;
|
|
209
209
|
return {
|
|
210
210
|
id: a.id,
|
|
211
211
|
title: e.title,
|
|
@@ -219,7 +219,7 @@ class Q {
|
|
|
219
219
|
closeOnBackdrop: e.closeOnBackdrop,
|
|
220
220
|
lockWhileLoading: e.lockWhileLoading ?? !0,
|
|
221
221
|
role: e.role || "alertdialog",
|
|
222
|
-
tone: e.tone || (i ? "info" :
|
|
222
|
+
tone: e.tone || (i ? "info" : n ? "neutral" : "warning"),
|
|
223
223
|
size: e.size || "md",
|
|
224
224
|
variant: e.variant || "surface",
|
|
225
225
|
radius: e.radius,
|
|
@@ -233,7 +233,7 @@ class Q {
|
|
|
233
233
|
showCancel: !i,
|
|
234
234
|
showClose: e.dismissible ?? !0,
|
|
235
235
|
input: {
|
|
236
|
-
enabled:
|
|
236
|
+
enabled: n,
|
|
237
237
|
label: r?.label,
|
|
238
238
|
placeholder: r?.placeholder,
|
|
239
239
|
value: r?.defaultValue || "",
|
|
@@ -256,10 +256,10 @@ class Q {
|
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
_handleClose(a, e) {
|
|
259
|
-
const
|
|
259
|
+
const n = U(a, e);
|
|
260
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, n, !0);
|
|
263
263
|
});
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
@@ -271,11 +271,11 @@ class Q {
|
|
|
271
271
|
reason: e.reason
|
|
272
272
|
})
|
|
273
273
|
).finally(() => {
|
|
274
|
-
this._settle(a,
|
|
274
|
+
this._settle(a, n, !0);
|
|
275
275
|
});
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
|
-
this._settle(a,
|
|
278
|
+
this._settle(a, n, !0);
|
|
279
279
|
}
|
|
280
280
|
_mergeOptions(a) {
|
|
281
281
|
const e = this._defaults;
|
|
@@ -302,37 +302,37 @@ class Q {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
let h = null;
|
|
305
|
-
function W(
|
|
306
|
-
return new Q(
|
|
305
|
+
function W(t = {}) {
|
|
306
|
+
return new Q(t.container ?? null);
|
|
307
307
|
}
|
|
308
308
|
function T() {
|
|
309
309
|
return h || (h = W()), h;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
return T().alert(
|
|
311
|
+
function ha(t = {}) {
|
|
312
|
+
return T().alert(t);
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
return T().confirm(
|
|
314
|
+
function ba(t = {}) {
|
|
315
|
+
return T().confirm(t);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
return T().prompt(
|
|
317
|
+
function va(t = {}) {
|
|
318
|
+
return T().prompt(t);
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
h && (h.destroy(
|
|
320
|
+
function ya(t = "programmatic") {
|
|
321
|
+
h && (h.destroy(t), h = null);
|
|
322
322
|
}
|
|
323
323
|
function I() {
|
|
324
324
|
return typeof window < "u" && typeof document < "u";
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
return
|
|
326
|
+
function X(t) {
|
|
327
|
+
return t === "replace" || t === "stack" ? t : "queue";
|
|
328
328
|
}
|
|
329
|
-
function O(
|
|
330
|
-
return `ui-dialog-${
|
|
329
|
+
function O(t) {
|
|
330
|
+
return `ui-dialog-${t}`;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
return
|
|
332
|
+
function K(t) {
|
|
333
|
+
return t ? typeof t == "string" ? t : t instanceof Error && t.message ? t.message : "Something went wrong. Please try again." : "Something went wrong. Please try again.";
|
|
334
334
|
}
|
|
335
|
-
class
|
|
335
|
+
class Y {
|
|
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
|
}
|
|
@@ -349,9 +349,9 @@ class K {
|
|
|
349
349
|
this._disposed = !0;
|
|
350
350
|
const e = [...this._active, ...this._queue];
|
|
351
351
|
this._queue = [];
|
|
352
|
-
for (const
|
|
353
|
-
this._settle(
|
|
354
|
-
id:
|
|
352
|
+
for (const n of e)
|
|
353
|
+
this._settle(n, {
|
|
354
|
+
id: n.id,
|
|
355
355
|
action: "dismiss",
|
|
356
356
|
source: a,
|
|
357
357
|
reason: a
|
|
@@ -365,11 +365,11 @@ class K {
|
|
|
365
365
|
action: "dismiss",
|
|
366
366
|
source: "unmount"
|
|
367
367
|
});
|
|
368
|
-
const e = a.id || O(++this._seed),
|
|
368
|
+
const e = a.id || O(++this._seed), n = X(a.mode);
|
|
369
369
|
return new Promise((i) => {
|
|
370
370
|
const r = {
|
|
371
371
|
id: e,
|
|
372
|
-
mode:
|
|
372
|
+
mode: n,
|
|
373
373
|
options: a,
|
|
374
374
|
settled: !1,
|
|
375
375
|
resolve: i,
|
|
@@ -379,12 +379,12 @@ class K {
|
|
|
379
379
|
this._settle(r, { id: e, action: "dismiss", source: "abort" }, !1);
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
|
-
if (
|
|
382
|
+
if (n === "replace") {
|
|
383
383
|
const s = this._active[this._active.length - 1];
|
|
384
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 (
|
|
387
|
+
if (n === "stack") {
|
|
388
388
|
this._open(r);
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
@@ -405,41 +405,41 @@ class K {
|
|
|
405
405
|
}, !1);
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
const
|
|
409
|
-
a.dialog =
|
|
408
|
+
const n = document.createElement("ui-dialog");
|
|
409
|
+
a.dialog = n;
|
|
410
410
|
const i = this._buildConfig(a.options, a.id);
|
|
411
|
-
|
|
411
|
+
n.dialogId = a.id, n.config = i;
|
|
412
412
|
const r = (c) => {
|
|
413
413
|
if (a.settled) return;
|
|
414
|
-
const
|
|
415
|
-
if (a.resultFormData =
|
|
416
|
-
|
|
414
|
+
const l = c.detail;
|
|
415
|
+
if (a.resultFormData = l?.formData, !a.options.onSubmit) {
|
|
416
|
+
n.clearError();
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
|
-
c.preventDefault(),
|
|
419
|
+
c.preventDefault(), n.state = "loading", n.clearError(), Promise.resolve(
|
|
420
420
|
a.options.onSubmit({
|
|
421
421
|
id: a.id,
|
|
422
|
-
dialog:
|
|
422
|
+
dialog: n,
|
|
423
423
|
signal: a.options.signal,
|
|
424
|
-
formData:
|
|
424
|
+
formData: l?.formData
|
|
425
425
|
})
|
|
426
426
|
).then(() => {
|
|
427
|
-
a.settled || (
|
|
427
|
+
a.settled || (n.state = "idle", n.clearError(), n.close("submit"));
|
|
428
428
|
}).catch((f) => {
|
|
429
|
-
|
|
429
|
+
n.state = "error", n.setError(K(f));
|
|
430
430
|
});
|
|
431
431
|
}, s = (c) => {
|
|
432
432
|
if (a.settled) return;
|
|
433
|
-
const
|
|
433
|
+
const l = c.detail;
|
|
434
434
|
this._settle(a, {
|
|
435
435
|
id: a.id,
|
|
436
|
-
action:
|
|
437
|
-
source:
|
|
438
|
-
reason:
|
|
436
|
+
action: l.action,
|
|
437
|
+
source: l.source,
|
|
438
|
+
reason: l.reason,
|
|
439
439
|
formData: a.resultFormData
|
|
440
440
|
}, !0);
|
|
441
441
|
};
|
|
442
|
-
if (
|
|
442
|
+
if (n.addEventListener("ui-submit", r), n.addEventListener("ui-close", s), a.cleanup.push(() => n.removeEventListener("ui-submit", r)), a.cleanup.push(() => n.removeEventListener("ui-close", s)), a.options.signal) {
|
|
443
443
|
const c = () => {
|
|
444
444
|
a.settled || this._settle(a, {
|
|
445
445
|
id: a.id,
|
|
@@ -449,13 +449,13 @@ class K {
|
|
|
449
449
|
};
|
|
450
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), e.appendChild(
|
|
452
|
+
this._active.push(a), e.appendChild(n), n.openDialog(), this._updateStackZIndex();
|
|
453
453
|
}
|
|
454
|
-
_settle(a, e,
|
|
454
|
+
_settle(a, e, n, i = !0) {
|
|
455
455
|
if (!a.settled) {
|
|
456
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
457
|
const r = a.dialog;
|
|
458
|
-
!
|
|
458
|
+
!n && r.open && r.close("dismiss", e.source || "abort", e.reason), r.parentElement && r.parentElement.removeChild(r);
|
|
459
459
|
}
|
|
460
460
|
a.resolve(e), this._updateStackZIndex(), !this._disposed && i && this._drainQueue();
|
|
461
461
|
}
|
|
@@ -510,35 +510,49 @@ class K {
|
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
let b = null;
|
|
513
|
-
function J(
|
|
514
|
-
return new
|
|
513
|
+
function J(t = {}) {
|
|
514
|
+
return new Y(t.container ?? null);
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function R() {
|
|
517
517
|
return b || (b = J()), b;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
519
|
+
function wa(t = {}) {
|
|
520
|
+
return R().open(t);
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
return
|
|
522
|
+
function ka(t = {}) {
|
|
523
|
+
return R().confirm(t);
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
b && (b.destroy(
|
|
525
|
+
function _a(t = "programmatic") {
|
|
526
|
+
b && (b.destroy(t), b = null);
|
|
527
527
|
}
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
528
|
+
const q = ["1", "2", "3", "4"], aa = {
|
|
529
|
+
compact: { 1: "20px", 2: "28px", 3: "36px", 4: "44px" },
|
|
530
|
+
default: { 1: "24px", 2: "32px", 3: "40px", 4: "48px" },
|
|
531
|
+
comfortable: { 1: "28px", 2: "36px", 3: "44px", 4: "52px" }
|
|
532
|
+
}, ea = {
|
|
533
|
+
compact: { 1: "12px", 2: "13px", 3: "15px", 4: "17px" },
|
|
534
|
+
default: { 1: "12px", 2: "14px", 3: "16px", 4: "18px" },
|
|
535
|
+
comfortable: { 1: "13px", 2: "15px", 3: "16px", 4: "18px" }
|
|
536
|
+
}, ta = {
|
|
537
|
+
compact: { 1: "6px", 2: "10px", 3: "14px", 4: "18px" },
|
|
538
|
+
default: { 1: "8px", 2: "12px", 3: "16px", 4: "20px" },
|
|
539
|
+
comfortable: { 1: "10px", 2: "14px", 3: "18px", 4: "22px" }
|
|
540
|
+
}, P = { compact: "6px", default: "8px", comfortable: "12px" }, na = { 1: 0, 2: 0, 3: 2, 4: 4 };
|
|
541
|
+
function ra(t) {
|
|
542
|
+
const a = t.palette?.gray || {}, e = t.palette?.accent || {}, n = t.radiusScale || {}, i = t.colors, r = {}, s = (l, f) => {
|
|
543
|
+
f && (r[l] = f);
|
|
532
544
|
};
|
|
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",
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
r[`--ui-control-
|
|
545
|
+
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-accent-on-dark", i.primary ? `color-mix(in srgb, ${i.primary} 45%, #ffffff)` : void 0), s("--ui-color-surface-elevated", t.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";
|
|
546
|
+
const c = t.density === "compact" || t.density === "comfortable" ? t.density : "default";
|
|
547
|
+
r["--ui-density"] = c, r["--ui-density-gap"] = P[c], r["--ui-default-gap"] = P[c];
|
|
548
|
+
for (const l of q) {
|
|
549
|
+
r[`--ui-control-height-${l}`] = aa[c][l], r[`--ui-control-font-size-${l}`] = ea[c][l], r[`--ui-control-padding-inline-${l}`] = ta[c][l];
|
|
550
|
+
const f = na[l], u = t.radius || n[2] || "6px";
|
|
551
|
+
r[`--ui-control-radius-${l}`] = f ? `calc(${u} + ${f}px)` : u;
|
|
538
552
|
}
|
|
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",
|
|
553
|
+
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", t.typography?.codeFamily || "monospace"), s("--font-mono", t.typography?.codeFamily || "monospace"), s("--ui-breakpoint-xl", t.breakpoints?.xl || "1280px"), r;
|
|
540
554
|
}
|
|
541
|
-
const
|
|
555
|
+
const $ = {
|
|
542
556
|
1: "#0000000d",
|
|
543
557
|
2: "#0000001a",
|
|
544
558
|
3: "#00000026",
|
|
@@ -551,7 +565,7 @@ const R = {
|
|
|
551
565
|
10: "#000c",
|
|
552
566
|
11: "#000000e6",
|
|
553
567
|
12: "#000000f2"
|
|
554
|
-
},
|
|
568
|
+
}, H = {
|
|
555
569
|
1: "#ffffff0d",
|
|
556
570
|
2: "#ffffff1a",
|
|
557
571
|
3: "#ffffff26",
|
|
@@ -564,7 +578,7 @@ const R = {
|
|
|
564
578
|
10: "#fffc",
|
|
565
579
|
11: "#ffffffe6",
|
|
566
580
|
12: "#fffffff2"
|
|
567
|
-
},
|
|
581
|
+
}, g = {
|
|
568
582
|
amber: {
|
|
569
583
|
light: {
|
|
570
584
|
scale: {
|
|
@@ -915,7 +929,7 @@ const R = {
|
|
|
915
929
|
track: "#7b7b7b"
|
|
916
930
|
}
|
|
917
931
|
}
|
|
918
|
-
},
|
|
932
|
+
}, ia = {
|
|
919
933
|
button: {
|
|
920
934
|
"classic-after-inset": "2px",
|
|
921
935
|
"classic-box-shadow-top": "inset 0 0 0 1px var(--gray-a5), inset 0 1px 1px var(--white-a10)",
|
|
@@ -1164,7 +1178,7 @@ const R = {
|
|
|
1164
1178
|
input: {
|
|
1165
1179
|
bg: "var(--color-panel-solid)"
|
|
1166
1180
|
}
|
|
1167
|
-
},
|
|
1181
|
+
}, oa = {
|
|
1168
1182
|
button: {
|
|
1169
1183
|
"classic-after-inset": "1px",
|
|
1170
1184
|
"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)",
|
|
@@ -1414,38 +1428,38 @@ const R = {
|
|
|
1414
1428
|
bg: "var(--color-panel-solid)"
|
|
1415
1429
|
}
|
|
1416
1430
|
};
|
|
1417
|
-
function w(
|
|
1418
|
-
const a = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(
|
|
1431
|
+
function w(t) {
|
|
1432
|
+
const a = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(t.trim())?.[1];
|
|
1419
1433
|
if (!a) return null;
|
|
1420
|
-
const e = a.length === 3 ? a.replace(/./g, (i) => i + i) : a.slice(0, 6),
|
|
1434
|
+
const e = a.length === 3 ? a.replace(/./g, (i) => i + i) : a.slice(0, 6), n = (i) => {
|
|
1421
1435
|
const r = parseInt(e.slice(i, i + 2), 16) / 255;
|
|
1422
1436
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1423
1437
|
};
|
|
1424
|
-
return 0.2126 *
|
|
1438
|
+
return 0.2126 * n(0) + 0.7152 * n(2) + 0.0722 * n(4);
|
|
1425
1439
|
}
|
|
1426
|
-
function v(
|
|
1427
|
-
const e = w(
|
|
1428
|
-
return e === null ||
|
|
1440
|
+
function v(t, a) {
|
|
1441
|
+
const e = w(t), n = w(a);
|
|
1442
|
+
return e === null || n === null ? null : (Math.max(e, n) + 0.05) / (Math.min(e, n) + 0.05);
|
|
1429
1443
|
}
|
|
1430
|
-
function
|
|
1431
|
-
const e =
|
|
1444
|
+
function sa(t, a) {
|
|
1445
|
+
const e = t?.colors;
|
|
1432
1446
|
if (!e?.primary) return {};
|
|
1433
|
-
const
|
|
1434
|
-
return a ? e.primary === a.colors?.primary ? {} :
|
|
1447
|
+
const n = e.foregroundOnPrimary;
|
|
1448
|
+
return a ? e.primary === a.colors?.primary ? {} : n && n !== a.colors?.foregroundOnPrimary ? {} : { foregroundOnPrimary: k(e.primary, a.colors?.foregroundOnPrimary || "#ffffff") } : n ? {} : { foregroundOnPrimary: k(e.primary, "#ffffff") };
|
|
1435
1449
|
}
|
|
1436
|
-
function k(
|
|
1437
|
-
const e = v(a,
|
|
1450
|
+
function k(t, a) {
|
|
1451
|
+
const e = v(a, t);
|
|
1438
1452
|
if (e === null || e >= 4.5) return a;
|
|
1439
|
-
const
|
|
1440
|
-
return (v("#111111",
|
|
1453
|
+
const n = v("#ffffff", t) ?? 0;
|
|
1454
|
+
return (v("#111111", t) ?? 0) > n ? "#111111" : "#ffffff";
|
|
1441
1455
|
}
|
|
1442
|
-
function
|
|
1456
|
+
function F(t) {
|
|
1443
1457
|
return {
|
|
1444
|
-
primary:
|
|
1445
|
-
primaryHover:
|
|
1446
|
-
foregroundOnPrimary: k(
|
|
1447
|
-
focusRing:
|
|
1448
|
-
warning:
|
|
1458
|
+
primary: t.scale[9],
|
|
1459
|
+
primaryHover: t.scale[10] || t.scale[9],
|
|
1460
|
+
foregroundOnPrimary: k(t.scale[9], t.contrast),
|
|
1461
|
+
focusRing: t.scale[8] || t.scale[9],
|
|
1462
|
+
warning: t.scale[9]
|
|
1449
1463
|
};
|
|
1450
1464
|
}
|
|
1451
1465
|
const _ = {
|
|
@@ -1494,18 +1508,18 @@ const _ = {
|
|
|
1494
1508
|
11: "#0000009b",
|
|
1495
1509
|
12: "#000000df"
|
|
1496
1510
|
},
|
|
1497
|
-
blackAlpha:
|
|
1498
|
-
whiteAlpha:
|
|
1511
|
+
blackAlpha: $,
|
|
1512
|
+
whiteAlpha: H,
|
|
1499
1513
|
accent: {
|
|
1500
|
-
...
|
|
1514
|
+
...g.amber.light.scale
|
|
1501
1515
|
},
|
|
1502
1516
|
accentAlpha: {
|
|
1503
|
-
...
|
|
1517
|
+
...g.amber.light.alphaScale
|
|
1504
1518
|
},
|
|
1505
|
-
accentContrast:
|
|
1506
|
-
accentSurface:
|
|
1507
|
-
accentIndicator:
|
|
1508
|
-
accentTrack:
|
|
1519
|
+
accentContrast: g.amber.light.contrast,
|
|
1520
|
+
accentSurface: g.amber.light.surface,
|
|
1521
|
+
accentIndicator: g.amber.light.indicator,
|
|
1522
|
+
accentTrack: g.amber.light.track
|
|
1509
1523
|
},
|
|
1510
1524
|
surfaces: {
|
|
1511
1525
|
background: "#ffffff",
|
|
@@ -1603,10 +1617,10 @@ const _ = {
|
|
|
1603
1617
|
effects: {
|
|
1604
1618
|
backdropFilterPanel: "blur(64px)"
|
|
1605
1619
|
},
|
|
1606
|
-
components:
|
|
1620
|
+
components: ia,
|
|
1607
1621
|
zIndex: { modal: 1e3, overlay: 900, toast: 1100 },
|
|
1608
1622
|
breakpoints: { sm: "640px", md: "768px", lg: "1024px" }
|
|
1609
|
-
},
|
|
1623
|
+
}, ca = {
|
|
1610
1624
|
..._,
|
|
1611
1625
|
colors: {
|
|
1612
1626
|
primary: "#ffc53d",
|
|
@@ -1654,18 +1668,18 @@ const _ = {
|
|
|
1654
1668
|
11: "#ffffffaf",
|
|
1655
1669
|
12: "#ffffffed"
|
|
1656
1670
|
},
|
|
1657
|
-
blackAlpha:
|
|
1658
|
-
whiteAlpha:
|
|
1671
|
+
blackAlpha: $,
|
|
1672
|
+
whiteAlpha: H,
|
|
1659
1673
|
accent: {
|
|
1660
|
-
...
|
|
1674
|
+
...g.amber.dark.scale
|
|
1661
1675
|
},
|
|
1662
1676
|
accentAlpha: {
|
|
1663
|
-
...
|
|
1677
|
+
...g.amber.dark.alphaScale
|
|
1664
1678
|
},
|
|
1665
|
-
accentContrast:
|
|
1666
|
-
accentSurface:
|
|
1667
|
-
accentIndicator:
|
|
1668
|
-
accentTrack:
|
|
1679
|
+
accentContrast: g.amber.dark.contrast,
|
|
1680
|
+
accentSurface: g.amber.dark.surface,
|
|
1681
|
+
accentIndicator: g.amber.dark.indicator,
|
|
1682
|
+
accentTrack: g.amber.dark.track
|
|
1669
1683
|
},
|
|
1670
1684
|
surfaces: {
|
|
1671
1685
|
background: "#111111",
|
|
@@ -1687,25 +1701,25 @@ const _ = {
|
|
|
1687
1701
|
5: "0 0 0 1px var(--gray-a6),0 12px 60px var(--black-a5),0 12px 32px -16px var(--black-a7)",
|
|
1688
1702
|
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)"
|
|
1689
1703
|
},
|
|
1690
|
-
components:
|
|
1691
|
-
},
|
|
1692
|
-
function
|
|
1693
|
-
if (!(!
|
|
1694
|
-
return { ...
|
|
1704
|
+
components: oa
|
|
1705
|
+
}, Sa = _, j = /* @__PURE__ */ new Set();
|
|
1706
|
+
function d(t, a) {
|
|
1707
|
+
if (!(!t && !a))
|
|
1708
|
+
return { ...t || {}, ...a || {} };
|
|
1695
1709
|
}
|
|
1696
|
-
function
|
|
1697
|
-
const a =
|
|
1698
|
-
if (!a) return
|
|
1699
|
-
if (a.background && !e.background && (
|
|
1710
|
+
function la(t) {
|
|
1711
|
+
const a = t?.colors, e = t?.surfaces || {}, n = {};
|
|
1712
|
+
if (!a) return n;
|
|
1713
|
+
if (a.background && !e.background && (n.background = a.background), a.surface) {
|
|
1700
1714
|
const i = `color-mix(in srgb, ${a.surface} 80%, transparent)`;
|
|
1701
|
-
e.surface || (
|
|
1715
|
+
e.surface || (n.surface = a.surface), e.panelSolid || (n.panelSolid = a.surface), e.panel || (n.panel = i), e.panelTranslucent || (n.panelTranslucent = i);
|
|
1702
1716
|
}
|
|
1703
|
-
return
|
|
1717
|
+
return n;
|
|
1704
1718
|
}
|
|
1705
|
-
function S(
|
|
1706
|
-
const e = a?.mode || "light",
|
|
1719
|
+
function S(t, a) {
|
|
1720
|
+
const e = a?.mode || "light", n = e === "dark" ? ca : _, i = a?.accentPalette, r = i ? g[i][e] : null, s = r ? {
|
|
1707
1721
|
colors: {
|
|
1708
|
-
...
|
|
1722
|
+
...F(r)
|
|
1709
1723
|
},
|
|
1710
1724
|
palette: {
|
|
1711
1725
|
accent: r.scale,
|
|
@@ -1717,147 +1731,147 @@ function S(n, a) {
|
|
|
1717
1731
|
}
|
|
1718
1732
|
} : null;
|
|
1719
1733
|
return {
|
|
1720
|
-
...t,
|
|
1721
1734
|
...n,
|
|
1735
|
+
...t,
|
|
1722
1736
|
colors: {
|
|
1723
|
-
...
|
|
1737
|
+
...n.colors,
|
|
1724
1738
|
...s?.colors || {},
|
|
1725
|
-
...
|
|
1726
|
-
...
|
|
1739
|
+
...t?.colors || {},
|
|
1740
|
+
...sa(t)
|
|
1727
1741
|
},
|
|
1728
1742
|
palette: {
|
|
1729
|
-
...
|
|
1743
|
+
...n.palette || {},
|
|
1730
1744
|
...s?.palette || {},
|
|
1731
|
-
...
|
|
1732
|
-
gray:
|
|
1733
|
-
grayAlpha:
|
|
1734
|
-
blackAlpha:
|
|
1735
|
-
whiteAlpha:
|
|
1736
|
-
accent:
|
|
1737
|
-
accentAlpha:
|
|
1745
|
+
...t?.palette || {},
|
|
1746
|
+
gray: d(n.palette?.gray, t?.palette?.gray),
|
|
1747
|
+
grayAlpha: d(n.palette?.grayAlpha, t?.palette?.grayAlpha),
|
|
1748
|
+
blackAlpha: d(n.palette?.blackAlpha, t?.palette?.blackAlpha),
|
|
1749
|
+
whiteAlpha: d(n.palette?.whiteAlpha, t?.palette?.whiteAlpha),
|
|
1750
|
+
accent: d(r?.scale || n.palette?.accent, t?.palette?.accent),
|
|
1751
|
+
accentAlpha: d(r?.alphaScale || n.palette?.accentAlpha, t?.palette?.accentAlpha)
|
|
1738
1752
|
},
|
|
1739
1753
|
surfaces: {
|
|
1740
|
-
...
|
|
1741
|
-
...
|
|
1742
|
-
...
|
|
1754
|
+
...n.surfaces || {},
|
|
1755
|
+
...la(t),
|
|
1756
|
+
...t?.surfaces || {}
|
|
1743
1757
|
},
|
|
1744
1758
|
shadows: {
|
|
1745
|
-
...
|
|
1746
|
-
...
|
|
1759
|
+
...n.shadows || {},
|
|
1760
|
+
...t?.shadows || {}
|
|
1747
1761
|
},
|
|
1748
1762
|
spacing: {
|
|
1749
|
-
...
|
|
1750
|
-
...
|
|
1763
|
+
...n.spacing || {},
|
|
1764
|
+
...t?.spacing || {}
|
|
1751
1765
|
},
|
|
1752
|
-
spaceScale:
|
|
1753
|
-
radiusScale:
|
|
1766
|
+
spaceScale: d(n.spaceScale, t?.spaceScale),
|
|
1767
|
+
radiusScale: d(n.radiusScale, t?.radiusScale),
|
|
1754
1768
|
typography: {
|
|
1755
|
-
...
|
|
1756
|
-
...
|
|
1769
|
+
...n.typography || {},
|
|
1770
|
+
...t?.typography || {},
|
|
1757
1771
|
size: {
|
|
1758
|
-
...
|
|
1759
|
-
...
|
|
1772
|
+
...n.typography?.size || {},
|
|
1773
|
+
...t?.typography?.size || {}
|
|
1760
1774
|
},
|
|
1761
|
-
fontScale:
|
|
1762
|
-
lineHeight:
|
|
1763
|
-
letterSpacing:
|
|
1775
|
+
fontScale: d(n.typography?.fontScale, t?.typography?.fontScale),
|
|
1776
|
+
lineHeight: d(n.typography?.lineHeight, t?.typography?.lineHeight),
|
|
1777
|
+
letterSpacing: d(n.typography?.letterSpacing, t?.typography?.letterSpacing)
|
|
1764
1778
|
},
|
|
1765
1779
|
motion: {
|
|
1766
|
-
...
|
|
1767
|
-
...
|
|
1780
|
+
...n.motion || {},
|
|
1781
|
+
...t?.motion || {}
|
|
1768
1782
|
},
|
|
1769
1783
|
effects: {
|
|
1770
|
-
...
|
|
1771
|
-
...
|
|
1784
|
+
...n.effects || {},
|
|
1785
|
+
...t?.effects || {}
|
|
1772
1786
|
},
|
|
1773
1787
|
components: {
|
|
1774
|
-
...
|
|
1775
|
-
...
|
|
1776
|
-
button:
|
|
1777
|
-
badge:
|
|
1778
|
-
dropdown:
|
|
1779
|
-
select:
|
|
1780
|
-
sidebar:
|
|
1781
|
-
card:
|
|
1782
|
-
navigationMenu:
|
|
1783
|
-
blockControls:
|
|
1784
|
-
box:
|
|
1785
|
-
breadcrumb:
|
|
1786
|
-
contextMenu:
|
|
1787
|
-
menubar:
|
|
1788
|
-
alert:
|
|
1789
|
-
alertDialog:
|
|
1790
|
-
appHeader:
|
|
1791
|
-
aspectRatio:
|
|
1792
|
-
avatar:
|
|
1793
|
-
menu:
|
|
1794
|
-
multiSelect:
|
|
1795
|
-
panel:
|
|
1796
|
-
input:
|
|
1788
|
+
...n.components || {},
|
|
1789
|
+
...t?.components || {},
|
|
1790
|
+
button: d(n.components?.button, t?.components?.button),
|
|
1791
|
+
badge: d(n.components?.badge, t?.components?.badge),
|
|
1792
|
+
dropdown: d(n.components?.dropdown, t?.components?.dropdown),
|
|
1793
|
+
select: d(n.components?.select, t?.components?.select),
|
|
1794
|
+
sidebar: d(n.components?.sidebar, t?.components?.sidebar),
|
|
1795
|
+
card: d(n.components?.card, t?.components?.card),
|
|
1796
|
+
navigationMenu: d(n.components?.navigationMenu, t?.components?.navigationMenu),
|
|
1797
|
+
blockControls: d(n.components?.blockControls, t?.components?.blockControls),
|
|
1798
|
+
box: d(n.components?.box, t?.components?.box),
|
|
1799
|
+
breadcrumb: d(n.components?.breadcrumb, t?.components?.breadcrumb),
|
|
1800
|
+
contextMenu: d(n.components?.contextMenu, t?.components?.contextMenu),
|
|
1801
|
+
menubar: d(n.components?.menubar, t?.components?.menubar),
|
|
1802
|
+
alert: d(n.components?.alert, t?.components?.alert),
|
|
1803
|
+
alertDialog: d(n.components?.alertDialog, t?.components?.alertDialog),
|
|
1804
|
+
appHeader: d(n.components?.appHeader, t?.components?.appHeader),
|
|
1805
|
+
aspectRatio: d(n.components?.aspectRatio, t?.components?.aspectRatio),
|
|
1806
|
+
avatar: d(n.components?.avatar, t?.components?.avatar),
|
|
1807
|
+
menu: d(n.components?.menu, t?.components?.menu),
|
|
1808
|
+
multiSelect: d(n.components?.multiSelect, t?.components?.multiSelect),
|
|
1809
|
+
panel: d(n.components?.panel, t?.components?.panel),
|
|
1810
|
+
input: d(n.components?.input, t?.components?.input)
|
|
1797
1811
|
},
|
|
1798
1812
|
zIndex: {
|
|
1799
|
-
...
|
|
1800
|
-
...
|
|
1813
|
+
...n.zIndex || {},
|
|
1814
|
+
...t?.zIndex || {}
|
|
1801
1815
|
},
|
|
1802
1816
|
breakpoints: {
|
|
1803
|
-
...
|
|
1804
|
-
...
|
|
1817
|
+
...n.breakpoints || {},
|
|
1818
|
+
...t?.breakpoints || {}
|
|
1805
1819
|
}
|
|
1806
1820
|
};
|
|
1807
1821
|
}
|
|
1808
|
-
function
|
|
1809
|
-
const
|
|
1822
|
+
function Ca(t, a, e = "light") {
|
|
1823
|
+
const n = g[a][e], i = t;
|
|
1810
1824
|
return S(
|
|
1811
1825
|
{
|
|
1812
1826
|
...i,
|
|
1813
1827
|
colors: {
|
|
1814
1828
|
...i.colors || {},
|
|
1815
|
-
...
|
|
1829
|
+
...F(n)
|
|
1816
1830
|
},
|
|
1817
1831
|
palette: {
|
|
1818
1832
|
...i.palette || {},
|
|
1819
|
-
accent:
|
|
1820
|
-
accentAlpha:
|
|
1821
|
-
accentContrast:
|
|
1822
|
-
accentSurface:
|
|
1823
|
-
accentIndicator:
|
|
1824
|
-
accentTrack:
|
|
1833
|
+
accent: n.scale,
|
|
1834
|
+
accentAlpha: n.alphaScale,
|
|
1835
|
+
accentContrast: n.contrast,
|
|
1836
|
+
accentSurface: n.surface,
|
|
1837
|
+
accentIndicator: n.indicator,
|
|
1838
|
+
accentTrack: n.track
|
|
1825
1839
|
}
|
|
1826
1840
|
},
|
|
1827
1841
|
{ mode: e }
|
|
1828
1842
|
);
|
|
1829
1843
|
}
|
|
1830
|
-
function o(
|
|
1831
|
-
|
|
1844
|
+
function o(t, a, e) {
|
|
1845
|
+
t[a] = e;
|
|
1832
1846
|
}
|
|
1833
|
-
function
|
|
1834
|
-
e && Object.entries(e).forEach(([
|
|
1835
|
-
typeof i == "string" && i && (
|
|
1847
|
+
function p(t, a, e) {
|
|
1848
|
+
e && Object.entries(e).forEach(([n, i]) => {
|
|
1849
|
+
typeof i == "string" && i && (t[`${a}${n}`] = i);
|
|
1836
1850
|
});
|
|
1837
1851
|
}
|
|
1838
|
-
function
|
|
1839
|
-
|
|
1852
|
+
function za(t) {
|
|
1853
|
+
t && j.add(t);
|
|
1840
1854
|
}
|
|
1841
|
-
function
|
|
1842
|
-
return
|
|
1855
|
+
function pa(t) {
|
|
1856
|
+
return N(S(t));
|
|
1843
1857
|
}
|
|
1844
|
-
const
|
|
1845
|
-
function E(
|
|
1846
|
-
const a =
|
|
1858
|
+
const da = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
1859
|
+
function E(t) {
|
|
1860
|
+
const a = da.exec(t.trim());
|
|
1847
1861
|
if (!a) return null;
|
|
1848
|
-
const e = a[1].length === 3 ? a[1].replace(/./g, (
|
|
1862
|
+
const e = a[1].length === 3 ? a[1].replace(/./g, (n) => n + n) : a[1];
|
|
1849
1863
|
return [parseInt(e.slice(0, 2), 16), parseInt(e.slice(2, 4), 16), parseInt(e.slice(4, 6), 16)];
|
|
1850
1864
|
}
|
|
1851
|
-
function z(
|
|
1852
|
-
const
|
|
1853
|
-
return !
|
|
1865
|
+
function z(t, a, e) {
|
|
1866
|
+
const n = E(t), i = E(a);
|
|
1867
|
+
return !n || !i ? null : "#" + n.map((s, c) => Math.round(s + (i[c] - s) * e)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
1854
1868
|
}
|
|
1855
|
-
function
|
|
1856
|
-
const a = {}, e =
|
|
1857
|
-
if (!
|
|
1869
|
+
function fa(t) {
|
|
1870
|
+
const a = {}, e = t.colors, n = e.surface || e.background, i = e.text;
|
|
1871
|
+
if (!n || !i) return a;
|
|
1858
1872
|
const r = [
|
|
1859
1873
|
// 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",
|
|
1874
|
+
["accent", t.palette?.accent?.["11"] || e.primary],
|
|
1861
1875
|
["danger", e.danger],
|
|
1862
1876
|
["success", e.success],
|
|
1863
1877
|
["warning", e.warning],
|
|
@@ -1869,138 +1883,138 @@ function da(n) {
|
|
|
1869
1883
|
a[`--ui-color-${s}-text`] = `color-mix(in srgb, ${c} 62%, ${i})`;
|
|
1870
1884
|
continue;
|
|
1871
1885
|
}
|
|
1872
|
-
const
|
|
1886
|
+
const l = z(c, n, 0.86);
|
|
1873
1887
|
let f = c;
|
|
1874
|
-
for (let
|
|
1875
|
-
const
|
|
1876
|
-
if (!
|
|
1877
|
-
f =
|
|
1878
|
-
const
|
|
1879
|
-
if (
|
|
1888
|
+
for (let u = 0; u <= 18; u += 1) {
|
|
1889
|
+
const x = z(c, i, u * 0.05);
|
|
1890
|
+
if (!x) break;
|
|
1891
|
+
f = x;
|
|
1892
|
+
const m = v(x, n) ?? 0, C = l ? v(x, l) ?? 0 : m;
|
|
1893
|
+
if (m >= 5.5 && C >= 5) break;
|
|
1880
1894
|
}
|
|
1881
1895
|
if (a[`--ui-color-${s}-text`] = f, s === "danger" || s === "success") {
|
|
1882
|
-
let
|
|
1883
|
-
for (let
|
|
1884
|
-
const
|
|
1885
|
-
if (!
|
|
1896
|
+
let u = c;
|
|
1897
|
+
for (let x = 0; x <= 12; x += 1) {
|
|
1898
|
+
const m = z(c, "#000000", x * 0.05);
|
|
1899
|
+
if (!m || (u = m, (v("#ffffff", m) ?? 0) >= 4.6)) break;
|
|
1886
1900
|
}
|
|
1887
|
-
a[`--ui-color-${s}-solid`] =
|
|
1901
|
+
a[`--ui-color-${s}-solid`] = u, a[`--ui-color-foreground-on-${s}`] = "#ffffff";
|
|
1888
1902
|
}
|
|
1889
1903
|
}
|
|
1890
1904
|
return a;
|
|
1891
1905
|
}
|
|
1892
|
-
function
|
|
1893
|
-
const a =
|
|
1894
|
-
if (!e || !a) return
|
|
1895
|
-
const
|
|
1906
|
+
function ua(t) {
|
|
1907
|
+
const a = t.colors, e = t.palette;
|
|
1908
|
+
if (!e || !a) return t;
|
|
1909
|
+
const n = (x, m, C) => `color-mix(in srgb, ${x} ${m}%, ${C})`, i = a.surface || a.background, r = a.text;
|
|
1896
1910
|
let s = e.gray, c = e.accent;
|
|
1897
|
-
const
|
|
1898
|
-
i && r &&
|
|
1911
|
+
const l = a.background ? w(a.background) : null, f = s?.["1"] ? w(s[1]) : null;
|
|
1912
|
+
i && r && l !== null && f !== null && l < 0.4 != f < 0.4 && (s = {
|
|
1899
1913
|
...s,
|
|
1900
|
-
2:
|
|
1901
|
-
3:
|
|
1902
|
-
4:
|
|
1903
|
-
5:
|
|
1904
|
-
6:
|
|
1905
|
-
7:
|
|
1906
|
-
8:
|
|
1914
|
+
2: n(r, 4, i),
|
|
1915
|
+
3: n(r, 8, i),
|
|
1916
|
+
4: n(r, 12, i),
|
|
1917
|
+
5: n(r, 16, i),
|
|
1918
|
+
6: n(r, 20, i),
|
|
1919
|
+
7: n(r, 28, i),
|
|
1920
|
+
8: n(r, 40, i),
|
|
1907
1921
|
11: a.muted || r,
|
|
1908
1922
|
12: r
|
|
1909
1923
|
});
|
|
1910
|
-
const
|
|
1911
|
-
return i && r && a.primary &&
|
|
1924
|
+
const u = c?.["9"];
|
|
1925
|
+
return i && r && a.primary && u && u.trim().toLowerCase() !== a.primary.trim().toLowerCase() && (c = {
|
|
1912
1926
|
...c,
|
|
1913
|
-
2:
|
|
1914
|
-
3:
|
|
1915
|
-
4:
|
|
1916
|
-
5:
|
|
1917
|
-
7:
|
|
1927
|
+
2: n(a.primary, 6, i),
|
|
1928
|
+
3: n(a.primary, 14, i),
|
|
1929
|
+
4: n(a.primary, 20, i),
|
|
1930
|
+
5: n(a.primary, 26, i),
|
|
1931
|
+
7: n(a.primary, 42, i),
|
|
1918
1932
|
9: a.primary,
|
|
1919
1933
|
10: a.primaryHover || a.primary,
|
|
1920
|
-
11:
|
|
1921
|
-
}), s === e.gray && c === e.accent ?
|
|
1934
|
+
11: n(a.primary, 60, r)
|
|
1935
|
+
}), s === e.gray && c === e.accent ? t : { ...t, palette: { ...e, gray: s, accent: c } };
|
|
1922
1936
|
}
|
|
1923
|
-
function
|
|
1924
|
-
const a =
|
|
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),
|
|
1937
|
+
function N(t) {
|
|
1938
|
+
const a = ua(t), e = {};
|
|
1939
|
+
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), p(e, "--gray-", a.palette?.gray), p(e, "--gray-a", a.palette?.grayAlpha), p(e, "--black-a", a.palette?.blackAlpha), p(e, "--white-a", a.palette?.whiteAlpha), p(e, "--accent-", a.palette?.accent), p(e, "--accent-a", a.palette?.accentAlpha), p(e, "--space-", a.spaceScale), p(e, "--radius-", a.radiusScale), p(e, "--font-size-", a.typography?.fontScale), p(e, "--line-height-", a.typography?.lineHeight), p(e, "--letter-spacing-", a.typography?.letterSpacing), p(e, "--shadow-", a.shadows), p(e, "--base-button-", a.components?.button), p(e, "--base-badge-", a.components?.badge), p(e, "--base-dropdown-", a.components?.dropdown), p(e, "--base-select-", a.components?.select), p(e, "--base-sidebar-", a.components?.sidebar), p(e, "--base-block-controls-", a.components?.blockControls), p(e, "--base-box-", a.components?.box), p(e, "--base-breadcrumb-", a.components?.breadcrumb), p(e, "--base-card-", a.components?.card), p(e, "--base-multi-select-", a.components?.multiSelect), p(e, "--base-navigation-menu-", a.components?.navigationMenu), p(e, "--base-menubar-", a.components?.menubar), p(e, "--base-context-menu-", a.components?.contextMenu), p(e, "--base-alert-", a.components?.alert), p(e, "--base-alert-dialog-", a.components?.alertDialog), p(e, "--base-app-header-", a.components?.appHeader), p(e, "--base-aspect-ratio-", a.components?.aspectRatio), p(e, "--base-avatar-", a.components?.avatar), p(e, "--base-menu-", a.components?.menu), p(e, "--base-panel-", a.components?.panel), p(e, "--base-input-", a.components?.input), Object.assign(e, ra(a)), Object.assign(e, fa(a)), o(e, "--ui-color-foreground-on-warning", k(a.colors.warning || a.colors.primary, "#ffffff")), e;
|
|
1926
1940
|
}
|
|
1927
|
-
function
|
|
1928
|
-
Object.entries(a).forEach(([e,
|
|
1941
|
+
function D(t, a) {
|
|
1942
|
+
Object.entries(a).forEach(([e, n]) => {
|
|
1929
1943
|
try {
|
|
1930
|
-
|
|
1944
|
+
t.style.setProperty(e, n);
|
|
1931
1945
|
} catch {
|
|
1932
1946
|
}
|
|
1933
1947
|
});
|
|
1934
1948
|
}
|
|
1935
|
-
function
|
|
1936
|
-
const e = Object.entries(
|
|
1949
|
+
function Ea(t, a = ":root") {
|
|
1950
|
+
const e = Object.entries(pa(t)).map(([n, i]) => ` ${n}: ${i};`).join(`
|
|
1937
1951
|
`);
|
|
1938
1952
|
return `${a} {
|
|
1939
1953
|
${e}
|
|
1940
1954
|
}
|
|
1941
1955
|
`;
|
|
1942
1956
|
}
|
|
1943
|
-
function B(
|
|
1944
|
-
return
|
|
1957
|
+
function B(t) {
|
|
1958
|
+
return t === document ? document.documentElement : t instanceof ShadowRoot ? t.host : t;
|
|
1945
1959
|
}
|
|
1946
|
-
function
|
|
1960
|
+
function ga(t, a = typeof document < "u" ? document : null) {
|
|
1947
1961
|
if (!a) return;
|
|
1948
|
-
const e =
|
|
1949
|
-
if (
|
|
1950
|
-
for (const r of
|
|
1962
|
+
const e = N(S(t)), n = a === document || a instanceof ShadowRoot, i = B(a);
|
|
1963
|
+
if (D(i, e), M(i, e["--ui-color-background"]), n)
|
|
1964
|
+
for (const r of j)
|
|
1951
1965
|
try {
|
|
1952
|
-
|
|
1966
|
+
D(r, e), M(r, e["--ui-color-background"]);
|
|
1953
1967
|
} catch {
|
|
1954
1968
|
}
|
|
1955
1969
|
}
|
|
1956
|
-
function
|
|
1970
|
+
function M(t, a) {
|
|
1957
1971
|
const e = a ? w(a) : null;
|
|
1958
1972
|
if (e !== null)
|
|
1959
1973
|
try {
|
|
1960
|
-
|
|
1974
|
+
t.style.setProperty("color-scheme", e < 0.179 ? "dark" : "light");
|
|
1961
1975
|
} catch {
|
|
1962
1976
|
}
|
|
1963
1977
|
}
|
|
1964
|
-
function
|
|
1965
|
-
const a =
|
|
1978
|
+
function Ta(t = {}) {
|
|
1979
|
+
const a = t.root === void 0 ? typeof document < "u" ? document : null : t.root;
|
|
1966
1980
|
if (!a) return () => {
|
|
1967
1981
|
};
|
|
1968
|
-
const e = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null,
|
|
1982
|
+
const e = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null, n = (r) => {
|
|
1969
1983
|
const s = r ? "dark" : "light";
|
|
1970
|
-
|
|
1984
|
+
ga(S(r ? t.dark : t.light, { accentPalette: t.accentPalette, mode: s }), a);
|
|
1971
1985
|
const c = B(a);
|
|
1972
1986
|
c.setAttribute("data-ui-mode", s), c.style.setProperty("color-scheme", s);
|
|
1973
1987
|
};
|
|
1974
|
-
if (
|
|
1988
|
+
if (n(!!e?.matches), !e) return () => {
|
|
1975
1989
|
};
|
|
1976
|
-
const i = (r) =>
|
|
1990
|
+
const i = (r) => n(r.matches);
|
|
1977
1991
|
return typeof e.addEventListener == "function" ? (e.addEventListener("change", i), () => e.removeEventListener("change", i)) : (e.addListener(i), () => e.removeListener(i));
|
|
1978
1992
|
}
|
|
1979
1993
|
export {
|
|
1980
1994
|
Q as A,
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1995
|
+
Y as D,
|
|
1996
|
+
ha as a,
|
|
1997
|
+
Ta as b,
|
|
1998
|
+
ga as c,
|
|
1999
|
+
g as d,
|
|
2000
|
+
ca as e,
|
|
1987
2001
|
_ as f,
|
|
1988
|
-
|
|
1989
|
-
|
|
2002
|
+
ba as g,
|
|
2003
|
+
ka as h,
|
|
1990
2004
|
W as i,
|
|
1991
2005
|
J as j,
|
|
1992
2006
|
S as k,
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2007
|
+
Sa as l,
|
|
2008
|
+
sa as m,
|
|
2009
|
+
ra as n,
|
|
2010
|
+
la as o,
|
|
2011
|
+
ya as p,
|
|
2012
|
+
_a as q,
|
|
2013
|
+
va as r,
|
|
2000
2014
|
k as s,
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2015
|
+
za as t,
|
|
2016
|
+
wa as u,
|
|
2017
|
+
Ea as v,
|
|
2018
|
+
pa as w,
|
|
2019
|
+
Ca as x
|
|
2006
2020
|
};
|