@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
package/dist/alert-dialog.esm.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import {
|
|
1
|
+
import { E as G } from "./ElementBase-D5QsC5Vw.mjs";
|
|
2
|
+
import { g as J, d as Q, c as U } from "./focus-scope-Dl0qk5GP.mjs";
|
|
3
|
+
import { c as X, l as tt } from "./overlay-motion-BX3dPLay.mjs";
|
|
3
4
|
import { a as S, r as L } from "./scroll-lock-LfqXXqsu.mjs";
|
|
4
|
-
const
|
|
5
|
+
const it = `
|
|
5
6
|
:host {
|
|
6
7
|
display: block;
|
|
7
8
|
color-scheme: light dark;
|
|
@@ -539,60 +540,60 @@ const Q = `
|
|
|
539
540
|
border: 1px solid CanvasText;
|
|
540
541
|
}
|
|
541
542
|
}
|
|
542
|
-
|
|
543
|
-
function f(
|
|
544
|
-
if (
|
|
545
|
-
const
|
|
546
|
-
return
|
|
543
|
+
`;
|
|
544
|
+
function f(e, t) {
|
|
545
|
+
if (e == null) return t;
|
|
546
|
+
const i = e.trim().toLowerCase();
|
|
547
|
+
return i !== "false" && i !== "0" && i !== "off";
|
|
547
548
|
}
|
|
548
|
-
function s(
|
|
549
|
-
return String(
|
|
549
|
+
function s(e) {
|
|
550
|
+
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
550
551
|
}
|
|
551
|
-
function
|
|
552
|
-
return
|
|
552
|
+
function et(e) {
|
|
553
|
+
return e === "info" || e === "success" || e === "warning" || e === "danger" ? e : "neutral";
|
|
553
554
|
}
|
|
554
|
-
function
|
|
555
|
-
return
|
|
555
|
+
function rt(e) {
|
|
556
|
+
return e === "sm" || e === "1" ? "sm" : e === "lg" || e === "3" ? "lg" : "md";
|
|
556
557
|
}
|
|
557
|
-
function
|
|
558
|
-
return
|
|
558
|
+
function at(e) {
|
|
559
|
+
return e === "soft" || e === "outline" || e === "solid" ? e : "surface";
|
|
559
560
|
}
|
|
560
|
-
function
|
|
561
|
-
return
|
|
561
|
+
function st(e) {
|
|
562
|
+
return e === "none" || e === "high" ? e : "low";
|
|
562
563
|
}
|
|
563
|
-
function
|
|
564
|
-
return
|
|
564
|
+
function ot(e) {
|
|
565
|
+
return e === "none" ? "none" : "line";
|
|
565
566
|
}
|
|
566
|
-
function
|
|
567
|
-
if (
|
|
568
|
-
const
|
|
569
|
-
return
|
|
567
|
+
function nt(e, t = "var(--base-alert-dialog-radius, var(--ui-radius, 6px))") {
|
|
568
|
+
if (e == null) return t;
|
|
569
|
+
const i = e.trim().toLowerCase();
|
|
570
|
+
return i ? i === "full" || i === "pill" ? "999px" : /^-?\d+(\.\d+)?$/.test(i) ? `${i}px` : e : t;
|
|
570
571
|
}
|
|
571
|
-
const
|
|
572
|
-
function
|
|
573
|
-
return
|
|
572
|
+
const lt = /* @__PURE__ */ new Set(["tone", "size", "variant", "elevation", "indicator", "radius"]);
|
|
573
|
+
function ct(e) {
|
|
574
|
+
return e === "success" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M5 10.2 8.3 13.4 15 6.8"></path></svg>' : e === "warning" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M10 3.6 17 16.4H3L10 3.6Z"></path><path d="M10 8v3.4"></path><circle cx="10" cy="14.1" r="0.9" fill="currentColor" stroke="none"></circle></svg>' : e === "danger" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="m7.5 7.5 5 5M12.5 7.5l-5 5"></path></svg>' : e === "info" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="M10 13v-3.8"></path><circle cx="10" cy="6.5" r="0.9" fill="currentColor" stroke="none"></circle></svg>' : '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6 10h8"></path><circle cx="10" cy="10" r="7.1"></circle></svg>';
|
|
574
575
|
}
|
|
575
576
|
function u() {
|
|
576
577
|
return typeof window < "u" && typeof document < "u";
|
|
577
578
|
}
|
|
578
579
|
function T() {
|
|
579
580
|
if (!u()) return null;
|
|
580
|
-
const
|
|
581
|
-
return
|
|
581
|
+
const e = document.activeElement;
|
|
582
|
+
return e instanceof HTMLElement ? e : null;
|
|
582
583
|
}
|
|
583
|
-
function k(
|
|
584
|
-
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(() =>
|
|
584
|
+
function k(e) {
|
|
585
|
+
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => e()) : window.setTimeout(e, 16);
|
|
585
586
|
}
|
|
586
|
-
function p(
|
|
587
|
-
if (
|
|
587
|
+
function p(e) {
|
|
588
|
+
if (e) {
|
|
588
589
|
if (typeof cancelAnimationFrame == "function") {
|
|
589
|
-
cancelAnimationFrame(
|
|
590
|
+
cancelAnimationFrame(e);
|
|
590
591
|
return;
|
|
591
592
|
}
|
|
592
|
-
window.clearTimeout(
|
|
593
|
+
window.clearTimeout(e);
|
|
593
594
|
}
|
|
594
595
|
}
|
|
595
|
-
const
|
|
596
|
+
const l = "data-ui-auto-name", c = class c extends G {
|
|
596
597
|
constructor() {
|
|
597
598
|
super(), this._lastActive = null, this._active = !1, this._terminalEmitted = !1, this._closeMeta = null, this._uid = Math.random().toString(36).slice(2, 10), this._dialogId = "", this._config = {}, this._inputValue = "", this._checked = !1, this._runtimeError = "", this._activeHeadless = !1, this._focusInitialFrame = 0, this._restoreFocusFrame = 0, this._presented = !1, this._finishClose = null, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onFocusIn = this._onFocusIn.bind(this), this._onInput = this._onInput.bind(this), this._dialogId = this._uid;
|
|
598
599
|
}
|
|
@@ -605,6 +606,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
605
606
|
"close-on-backdrop",
|
|
606
607
|
"lock-while-loading",
|
|
607
608
|
"role",
|
|
609
|
+
"dialog-role",
|
|
608
610
|
"tone",
|
|
609
611
|
"size",
|
|
610
612
|
"variant",
|
|
@@ -630,9 +632,9 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
630
632
|
disconnectedCallback() {
|
|
631
633
|
this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), this.root.removeEventListener("input", this._onInput), this._focusInitialFrame && (p(this._focusInitialFrame), this._focusInitialFrame = 0), this._restoreFocusFrame && (p(this._restoreFocusFrame), this._restoreFocusFrame = 0), this._active && !this._terminalEmitted && this.close("dismiss", "unmount"), this._deactivate(), super.disconnectedCallback();
|
|
632
634
|
}
|
|
633
|
-
attributeChangedCallback(t,
|
|
634
|
-
if (
|
|
635
|
-
if (
|
|
635
|
+
attributeChangedCallback(t, i, r) {
|
|
636
|
+
if (i !== r) {
|
|
637
|
+
if (lt.has(t)) {
|
|
636
638
|
this._syncVisualTokens();
|
|
637
639
|
return;
|
|
638
640
|
}
|
|
@@ -684,13 +686,13 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
684
686
|
this.setAttribute("lock-while-loading", String(t));
|
|
685
687
|
}
|
|
686
688
|
get roleType() {
|
|
687
|
-
return this.getAttribute("role") === "dialog" ? "dialog" : "alertdialog";
|
|
689
|
+
return (this.getAttribute("dialog-role") || this.getAttribute("role")) === "dialog" ? "dialog" : "alertdialog";
|
|
688
690
|
}
|
|
689
691
|
set roleType(t) {
|
|
690
|
-
this.setAttribute("role", t);
|
|
692
|
+
this.setAttribute("dialog-role", t);
|
|
691
693
|
}
|
|
692
694
|
get tone() {
|
|
693
|
-
return
|
|
695
|
+
return et(this.getAttribute("tone"));
|
|
694
696
|
}
|
|
695
697
|
set tone(t) {
|
|
696
698
|
if (t === "neutral") {
|
|
@@ -700,7 +702,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
700
702
|
this.setAttribute("tone", t);
|
|
701
703
|
}
|
|
702
704
|
get size() {
|
|
703
|
-
return
|
|
705
|
+
return rt(this.getAttribute("size"));
|
|
704
706
|
}
|
|
705
707
|
set size(t) {
|
|
706
708
|
if (t === "md") {
|
|
@@ -710,7 +712,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
710
712
|
this.setAttribute("size", t);
|
|
711
713
|
}
|
|
712
714
|
get variant() {
|
|
713
|
-
return
|
|
715
|
+
return at(this.getAttribute("variant"));
|
|
714
716
|
}
|
|
715
717
|
set variant(t) {
|
|
716
718
|
if (t === "surface") {
|
|
@@ -720,7 +722,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
720
722
|
this.setAttribute("variant", t);
|
|
721
723
|
}
|
|
722
724
|
get elevation() {
|
|
723
|
-
return
|
|
725
|
+
return st(this.getAttribute("elevation"));
|
|
724
726
|
}
|
|
725
727
|
set elevation(t) {
|
|
726
728
|
if (t === "low") {
|
|
@@ -730,7 +732,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
730
732
|
this.setAttribute("elevation", t);
|
|
731
733
|
}
|
|
732
734
|
get indicator() {
|
|
733
|
-
return
|
|
735
|
+
return ot(this.getAttribute("indicator"));
|
|
734
736
|
}
|
|
735
737
|
set indicator(t) {
|
|
736
738
|
if (t === "line") {
|
|
@@ -787,16 +789,16 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
787
789
|
}
|
|
788
790
|
setInputValue(t) {
|
|
789
791
|
this._inputValue = t;
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
+
const i = this.root.querySelector(".input");
|
|
793
|
+
i && (i.value = t);
|
|
792
794
|
}
|
|
793
795
|
getChecked() {
|
|
794
796
|
return this.root.querySelector(".checkbox-input")?.checked ?? this._checked;
|
|
795
797
|
}
|
|
796
798
|
setChecked(t) {
|
|
797
799
|
this._checked = t;
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
+
const i = this.root.querySelector(".checkbox-input");
|
|
801
|
+
i && (i.checked = t);
|
|
800
802
|
}
|
|
801
803
|
setError(t) {
|
|
802
804
|
this._runtimeError = t, this.state = t ? "error" : "idle", this.requestRender();
|
|
@@ -804,14 +806,13 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
804
806
|
clearError() {
|
|
805
807
|
this._runtimeError = "", this.state === "error" && (this.state = "idle"), this.requestRender();
|
|
806
808
|
}
|
|
807
|
-
close(t = "dismiss",
|
|
808
|
-
this._terminalEmitted || (this._closeMeta = { action: t, source:
|
|
809
|
+
close(t = "dismiss", i, r) {
|
|
810
|
+
this._terminalEmitted || (this._closeMeta = { action: t, source: i, reason: r }, this.hasAttribute("open") && this.removeAttribute("open"), this._syncOpenState());
|
|
809
811
|
}
|
|
810
812
|
_syncFromAttributes() {
|
|
811
|
-
this.hasAttribute("role") || this.setAttribute("role", "alertdialog");
|
|
812
813
|
}
|
|
813
814
|
_syncVisualTokens() {
|
|
814
|
-
this.style.setProperty("--ui-alert-radius",
|
|
815
|
+
this.style.setProperty("--ui-alert-radius", nt(this.getAttribute("radius")));
|
|
815
816
|
}
|
|
816
817
|
_syncOpenState() {
|
|
817
818
|
const t = this.hasAttribute("open");
|
|
@@ -822,7 +823,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
822
823
|
!t && this._active && this._deactivate();
|
|
823
824
|
}
|
|
824
825
|
_activate() {
|
|
825
|
-
this._active = !0, this._activeHeadless = this.headless, this._terminalEmitted = !1, this._closeMeta = null,
|
|
826
|
+
this._active = !0, this._activeHeadless = this.headless, this._terminalEmitted = !1, this._closeMeta = null, c._openStack.includes(this) || c._openStack.push(this), this._lastActive = this.headless ? null : T(), this.headless || S(), u() && !this.headless && document.addEventListener("focusin", this._onFocusIn, !0);
|
|
826
827
|
const t = this.dialogId || this._uid;
|
|
827
828
|
this._dispatchWithLegacy("ui-open", "open", { id: t }), this.headless || (this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = k(() => {
|
|
828
829
|
this._focusInitialFrame = 0, this._focusInitial();
|
|
@@ -831,8 +832,8 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
831
832
|
_deactivate() {
|
|
832
833
|
if (!this._active) return;
|
|
833
834
|
this._active = !1;
|
|
834
|
-
const t =
|
|
835
|
-
if (t >= 0 &&
|
|
835
|
+
const t = c._openStack.lastIndexOf(this);
|
|
836
|
+
if (t >= 0 && c._openStack.splice(t, 1), u() && !this._activeHeadless && document.removeEventListener("focusin", this._onFocusIn, !0), this._activeHeadless || L(), !this._terminalEmitted) {
|
|
836
837
|
const r = this._closeMeta || { action: "dismiss", source: "abort" }, a = this.dialogId || this._uid;
|
|
837
838
|
r.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id: a }) : r.action === "dismiss" && this._dispatchWithLegacy("ui-dismiss", "dismiss", {
|
|
838
839
|
id: a,
|
|
@@ -845,11 +846,11 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
845
846
|
reason: r.reason
|
|
846
847
|
}), this._terminalEmitted = !0, this._closeMeta = null;
|
|
847
848
|
}
|
|
848
|
-
const
|
|
849
|
-
this._lastActive = null,
|
|
849
|
+
const i = this._lastActive;
|
|
850
|
+
this._lastActive = null, i && !this._activeHeadless && (this._restoreFocusFrame && p(this._restoreFocusFrame), this._restoreFocusFrame = k(() => {
|
|
850
851
|
this._restoreFocusFrame = 0;
|
|
851
852
|
try {
|
|
852
|
-
|
|
853
|
+
i.focus();
|
|
853
854
|
} catch {
|
|
854
855
|
}
|
|
855
856
|
})), this._activeHeadless = !1, this.requestRender();
|
|
@@ -865,7 +866,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
865
866
|
});
|
|
866
867
|
}
|
|
867
868
|
}
|
|
868
|
-
_dispatchWithLegacy(t,
|
|
869
|
+
_dispatchWithLegacy(t, i, r, a = !1) {
|
|
869
870
|
const o = new CustomEvent(t, {
|
|
870
871
|
detail: r,
|
|
871
872
|
bubbles: !0,
|
|
@@ -873,7 +874,7 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
873
874
|
cancelable: a
|
|
874
875
|
});
|
|
875
876
|
this.dispatchEvent(o);
|
|
876
|
-
const n = new CustomEvent(
|
|
877
|
+
const n = new CustomEvent(i, {
|
|
877
878
|
detail: r,
|
|
878
879
|
bubbles: !0,
|
|
879
880
|
composed: !0,
|
|
@@ -883,16 +884,16 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
883
884
|
}
|
|
884
885
|
_isTopMost() {
|
|
885
886
|
if (!this._active) return !1;
|
|
886
|
-
const t =
|
|
887
|
+
const t = c._openStack;
|
|
887
888
|
return t.length > 0 && t[t.length - 1] === this;
|
|
888
889
|
}
|
|
889
890
|
_queryPanel() {
|
|
890
891
|
return this.root.querySelector(".dialog");
|
|
891
892
|
}
|
|
892
893
|
_collectFocusable(t) {
|
|
893
|
-
return
|
|
894
|
-
if (
|
|
895
|
-
const a = u() ? window.getComputedStyle(
|
|
894
|
+
return J(t).filter((i) => {
|
|
895
|
+
if (i.disabled || i.getAttribute("aria-hidden") === "true") return !1;
|
|
896
|
+
const a = u() ? window.getComputedStyle(i) : null;
|
|
896
897
|
return !(a && (a.display === "none" || a.visibility === "hidden"));
|
|
897
898
|
});
|
|
898
899
|
}
|
|
@@ -900,9 +901,9 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
900
901
|
if (!this.open) return;
|
|
901
902
|
const t = this._queryPanel();
|
|
902
903
|
if (!t) return;
|
|
903
|
-
const
|
|
904
|
-
if (
|
|
905
|
-
const n = t.querySelector(
|
|
904
|
+
const i = this.initialFocus;
|
|
905
|
+
if (i) {
|
|
906
|
+
const n = t.querySelector(i);
|
|
906
907
|
if (n && typeof n.focus == "function") {
|
|
907
908
|
n.focus();
|
|
908
909
|
return;
|
|
@@ -917,30 +918,30 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
917
918
|
}
|
|
918
919
|
_handleTab(t) {
|
|
919
920
|
if (t.key !== "Tab") return;
|
|
920
|
-
const
|
|
921
|
-
if (!
|
|
922
|
-
const r = this._collectFocusable(
|
|
921
|
+
const i = this._queryPanel();
|
|
922
|
+
if (!i) return;
|
|
923
|
+
const r = this._collectFocusable(i);
|
|
923
924
|
if (!r.length) {
|
|
924
|
-
t.preventDefault(),
|
|
925
|
+
t.preventDefault(), i.focus();
|
|
925
926
|
return;
|
|
926
927
|
}
|
|
927
|
-
const a =
|
|
928
|
+
const a = Q(), o = r[0], n = r[r.length - 1];
|
|
928
929
|
if (t.shiftKey) {
|
|
929
|
-
(a === o || !a || !
|
|
930
|
+
(a === o || !a || !U(i, a)) && (t.preventDefault(), n.focus());
|
|
930
931
|
return;
|
|
931
932
|
}
|
|
932
933
|
a === n && (t.preventDefault(), o.focus());
|
|
933
934
|
}
|
|
934
935
|
_onFocusIn(t) {
|
|
935
936
|
if (!this.open || !this._isTopMost()) return;
|
|
936
|
-
const
|
|
937
|
-
if (!
|
|
937
|
+
const i = this._queryPanel();
|
|
938
|
+
if (!i) return;
|
|
938
939
|
const r = t.target;
|
|
939
|
-
(typeof t.composedPath == "function" ? t.composedPath() : []).includes(
|
|
940
|
+
(typeof t.composedPath == "function" ? t.composedPath() : []).includes(i) || r && i.contains(r) || this._focusInitial();
|
|
940
941
|
}
|
|
941
942
|
_onInput(t) {
|
|
942
|
-
const
|
|
943
|
-
|
|
943
|
+
const i = t.target;
|
|
944
|
+
i && (i.classList.contains("input") && (this._inputValue = i.value), i.classList.contains("checkbox-input") && (this._checked = i.checked), this._dispatchWithLegacy("ui-change", "change", {
|
|
944
945
|
id: this.dialogId || this._uid,
|
|
945
946
|
inputValue: this._inputValue,
|
|
946
947
|
checked: this._checked
|
|
@@ -949,8 +950,8 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
949
950
|
_isInteractionLocked() {
|
|
950
951
|
return this.state === "loading" && this.lockWhileLoading;
|
|
951
952
|
}
|
|
952
|
-
_requestDismiss(t,
|
|
953
|
-
this._isInteractionLocked() || this.close("dismiss", t,
|
|
953
|
+
_requestDismiss(t, i) {
|
|
954
|
+
this._isInteractionLocked() || this.close("dismiss", t, i);
|
|
954
955
|
}
|
|
955
956
|
_handleConfirm() {
|
|
956
957
|
const t = {
|
|
@@ -965,21 +966,21 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
965
966
|
}
|
|
966
967
|
_onClick(t) {
|
|
967
968
|
if (!this.open || !this._isTopMost()) return;
|
|
968
|
-
const
|
|
969
|
-
if (
|
|
970
|
-
if (
|
|
969
|
+
const i = t.target;
|
|
970
|
+
if (i) {
|
|
971
|
+
if (i.classList.contains("backdrop") && this.closeOnBackdrop) {
|
|
971
972
|
this._requestDismiss("backdrop");
|
|
972
973
|
return;
|
|
973
974
|
}
|
|
974
|
-
if (
|
|
975
|
+
if (i.closest(".close")) {
|
|
975
976
|
this._requestDismiss("close-icon");
|
|
976
977
|
return;
|
|
977
978
|
}
|
|
978
|
-
if (
|
|
979
|
+
if (i.closest(".btn-confirm")) {
|
|
979
980
|
this._handleConfirm();
|
|
980
981
|
return;
|
|
981
982
|
}
|
|
982
|
-
|
|
983
|
+
i.closest(".btn-cancel") && this._handleCancel();
|
|
983
984
|
}
|
|
984
985
|
}
|
|
985
986
|
_onKeyDown(t) {
|
|
@@ -995,23 +996,27 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
995
996
|
// The host carries role="alertdialog" (that attribute is also how the role is configured), so it
|
|
996
997
|
// is exposed as a dialog of its own. Closed, it was an empty, unnamed alert dialog sitting in the
|
|
997
998
|
// page; open, it needs the same name as the dialog inside its shadow root.
|
|
998
|
-
_syncHostSemantics(t,
|
|
999
|
+
_syncHostSemantics(t, i = "", r = !1) {
|
|
1000
|
+
if (!this.hasAttribute("role")) {
|
|
1001
|
+
this.hasAttribute(l) && (this.removeAttribute("aria-label"), this.removeAttribute(l)), t ? this.hasAttribute("aria-hidden") && this.removeAttribute("aria-hidden") : this.getAttribute("aria-hidden") !== "true" && this.setAttribute("aria-hidden", "true");
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
999
1004
|
if (!t) {
|
|
1000
|
-
this.getAttribute("aria-hidden") !== "true" && this.setAttribute("aria-hidden", "true"), this.hasAttribute(
|
|
1005
|
+
this.getAttribute("aria-hidden") !== "true" && this.setAttribute("aria-hidden", "true"), this.hasAttribute(l) && (this.removeAttribute("aria-label"), this.removeAttribute(l));
|
|
1001
1006
|
return;
|
|
1002
1007
|
}
|
|
1003
1008
|
if (this.hasAttribute("aria-hidden") && this.removeAttribute("aria-hidden"), r) {
|
|
1004
|
-
this.hasAttribute(
|
|
1009
|
+
this.hasAttribute(l) && this.removeAttribute(l);
|
|
1005
1010
|
return;
|
|
1006
1011
|
}
|
|
1007
|
-
this.getAttribute("aria-label") !==
|
|
1012
|
+
this.getAttribute("aria-label") !== i && this.setAttribute("aria-label", i), this.hasAttribute(l) || this.setAttribute(l, "");
|
|
1008
1013
|
}
|
|
1009
1014
|
render() {
|
|
1010
1015
|
if (!this.open) {
|
|
1011
1016
|
this._syncHostSemantics(!1);
|
|
1012
1017
|
const _ = this.root.querySelector(".backdrop");
|
|
1013
1018
|
if (this._presented && _) {
|
|
1014
|
-
this._presented = !1, _.removeAttribute("data-instant"), this._finishClose =
|
|
1019
|
+
this._presented = !1, _.removeAttribute("data-instant"), this._finishClose = X(_, () => {
|
|
1015
1020
|
this._finishClose = null, this.setContent("");
|
|
1016
1021
|
});
|
|
1017
1022
|
return;
|
|
@@ -1021,24 +1026,24 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
1021
1026
|
return;
|
|
1022
1027
|
}
|
|
1023
1028
|
this._finishClose?.(), this._finishClose = null;
|
|
1024
|
-
const t = this._config.title ?? this.getAttribute("title") ?? "",
|
|
1029
|
+
const t = this._config.title ?? this.getAttribute("title") ?? "", i = this._config.description ?? this.getAttribute("description") ?? "", r = this._config.confirmText ?? this.getAttribute("confirm-text") ?? "Confirm", a = this._config.cancelText ?? this.getAttribute("cancel-text") ?? "Cancel", o = this._config.loadingText ?? this.getAttribute("loading-text") ?? "Working...", n = !!this._config.input?.enabled, $ = this._config.input?.label || "Value", B = this._config.input?.placeholder || "", q = !!this._config.input?.required, D = !!this._config.checkbox?.enabled, M = this._config.checkbox?.label || "Remember this choice", O = this.state, b = this._runtimeError || this._config.errorMessage || this.getAttribute("error-message") || "", w = `ui-alert-title-${this._uid}`, A = `ui-alert-description-${this._uid}`, z = `ui-alert-error-${this._uid}`, H = !!this.querySelector('[slot="title"]'), V = !!this.querySelector('[slot="description"]'), W = !!this.querySelector('[slot="icon"]'), R = !!this.querySelector('[slot="footer"]'), P = !!this.querySelector('[slot="content"]'), g = H || !!t, m = V || !!i, j = W || g || m, K = this._config.showCancel ?? this.dismissible, Y = this._config.showClose ?? this.dismissible, N = this.tone, v = this.hasAttribute(l) ? "" : this.getAttribute("aria-label") || "", F = this.getAttribute("aria-labelledby") || "", C = this.getAttribute("aria-describedby") || "", x = F || (g ? w : ""), I = v || (x ? "" : t || i || "Dialog"), Z = (this.querySelector('[slot="title"]')?.textContent || "").replace(/\s+/g, " ").trim();
|
|
1025
1030
|
this._syncHostSemantics(
|
|
1026
1031
|
!0,
|
|
1027
|
-
v ||
|
|
1032
|
+
v || Z || t || i || "Dialog",
|
|
1028
1033
|
!!v || !!F
|
|
1029
1034
|
);
|
|
1030
1035
|
const d = [];
|
|
1031
1036
|
C ? d.push(C) : (m && d.push(A), b && d.push(z));
|
|
1032
|
-
const h =
|
|
1037
|
+
const h = O === "loading";
|
|
1033
1038
|
this.setContent(`
|
|
1034
|
-
<style>${
|
|
1039
|
+
<style>${it}</style>
|
|
1035
1040
|
<div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}" data-state="open" ${this._presented ? "data-instant" : ""}>
|
|
1036
1041
|
<section
|
|
1037
1042
|
class="dialog"
|
|
1038
1043
|
part="dialog"
|
|
1039
1044
|
role="${s(this.roleType)}"
|
|
1040
1045
|
aria-modal="true"
|
|
1041
|
-
${
|
|
1046
|
+
${I ? `aria-label="${s(I)}"` : ""}
|
|
1042
1047
|
${x ? `aria-labelledby="${s(x)}"` : ""}
|
|
1043
1048
|
${d.length ? `aria-describedby="${s(d.join(" "))}"` : ""}
|
|
1044
1049
|
tabindex="-1"
|
|
@@ -1053,12 +1058,12 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
1053
1058
|
<div class="header-main">
|
|
1054
1059
|
<span class="icon-wrap" part="icon-wrap" aria-hidden="true">
|
|
1055
1060
|
<span class="icon" part="icon">
|
|
1056
|
-
<slot name="icon">${
|
|
1061
|
+
<slot name="icon">${ct(N)}</slot>
|
|
1057
1062
|
</span>
|
|
1058
1063
|
</span>
|
|
1059
1064
|
<div class="heading">
|
|
1060
1065
|
${g ? `<h2 id="${w}" class="title" part="title"><slot name="title">${s(t)}</slot></h2>` : ""}
|
|
1061
|
-
${m ? `<p id="${A}" class="description" part="description"><slot name="description">${s(
|
|
1066
|
+
${m ? `<p id="${A}" class="description" part="description"><slot name="description">${s(i)}</slot></p>` : ""}
|
|
1062
1067
|
</div>
|
|
1063
1068
|
</div>
|
|
1064
1069
|
</header>` : ""}
|
|
@@ -1079,10 +1084,10 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
1079
1084
|
/>
|
|
1080
1085
|
</label>` : ""}
|
|
1081
1086
|
|
|
1082
|
-
${
|
|
1087
|
+
${D ? `<label class="checkbox" part="checkbox">
|
|
1083
1088
|
<span class="checkbox-line">
|
|
1084
1089
|
<input class="checkbox-input" type="checkbox" ${this.getChecked() ? "checked" : ""} ${h ? "disabled" : ""} />
|
|
1085
|
-
<span>${s(
|
|
1090
|
+
<span>${s(M)}</span>
|
|
1086
1091
|
</span>
|
|
1087
1092
|
</label>` : ""}
|
|
1088
1093
|
</div>
|
|
@@ -1092,18 +1097,18 @@ const c = "data-ui-auto-name", l = class l extends Z {
|
|
|
1092
1097
|
<footer class="footer" part="footer">
|
|
1093
1098
|
${h ? `<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${s(o)}</span></span>` : '<span aria-hidden="true"></span>'}
|
|
1094
1099
|
|
|
1095
|
-
${
|
|
1100
|
+
${R ? '<slot name="footer"></slot>' : `${K ? `<button class="btn btn-cancel" part="cancel" type="button" ${h ? "disabled" : ""}>${s(a)}</button>` : ""}
|
|
1096
1101
|
<button class="btn btn-confirm" part="confirm" type="button" ${h ? "disabled" : ""}>${s(r)}</button>`}
|
|
1097
1102
|
</footer>
|
|
1098
1103
|
</section>
|
|
1099
1104
|
</div>
|
|
1100
1105
|
`);
|
|
1101
|
-
const
|
|
1102
|
-
|
|
1106
|
+
const E = this.root.querySelector(".backdrop");
|
|
1107
|
+
E && !this.headless && tt(E, { resetBox: !1 }), this._presented = !0;
|
|
1103
1108
|
}
|
|
1104
1109
|
};
|
|
1105
|
-
|
|
1106
|
-
let y =
|
|
1110
|
+
c._openStack = [];
|
|
1111
|
+
let y = c;
|
|
1107
1112
|
typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog", y);
|
|
1108
1113
|
export {
|
|
1109
1114
|
y as UIAlertDialog
|
package/dist/alert.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const z=require("./ElementBase-CbUsP3D6.js"),k=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
--ui-alert-radius: var(--base-alert-radius, var(--ui-radius, 6px));
|
|
@@ -334,23 +334,23 @@
|
|
|
334
334
|
border-color: Highlight;
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
`;function n(r){return String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function
|
|
338
|
-
<style>${
|
|
339
|
-
<section class="alert tone-${a} variant-${u} layout-${c} size-${d} elevation-${h} indicator-${p}" part="base"
|
|
337
|
+
`;function n(r){return String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function _(r){return r==="neutral"||r==="success"||r==="warning"||r==="danger"?r:"info"}function C(r){return r==="surface"||r==="outline"||r==="solid"||r==="soft"?r:"surface"}function S(r){return r==="sm"||r==="lg"?r:r==="1"?"sm":r==="3"?"lg":"md"}function A(r){return r==="banner"?"banner":"inline"}function $(r){return r==="none"||r==="low"||r==="high"?r:"low"}function B(r){return r==="none"?"none":"line"}function E(r,i="var(--base-alert-radius, var(--ui-radius, 6px))"){if(!r||!r.trim())return i;const t=r.trim().toLowerCase();return t==="full"||t==="pill"?"999px":t==="square"||t==="none"?"0px":/^-?\d+(\.\d+)?$/.test(t)?`${t}px`:r.trim()}function o(r,i){return Array.from(r.children).some(t=>{if(!(t instanceof HTMLElement))return!1;const e=t.getAttribute("slot")||"";return i?e===i:e===""})}function L(r){return r==="success"?'<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M5 10.2 8.3 13.4 15 6.8"></path></svg>':r==="warning"?'<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M10 3.6 17 16.4H3L10 3.6Z"></path><path d="M10 8v3.4"></path><circle cx="10" cy="14.1" r="0.9" fill="currentColor" stroke="none"></circle></svg>':r==="danger"?'<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="m7.5 7.5 5 5M12.5 7.5l-5 5"></path></svg>':'<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="M10 13v-3.8"></path><circle cx="10" cy="6.5" r="0.9" fill="currentColor" stroke="none"></circle></svg>'}class l extends z.ElementBase{constructor(){super(),this._dismissBtn=null,this._actionsSlot=null,this._onDismiss=this._onDismiss.bind(this),this._onSlotChange=this._onSlotChange.bind(this)}static get observedAttributes(){return["title","description","dismissible","tone","variant","layout","headless","hidden","size","radius","elevation","indicator","live"]}disconnectedCallback(){this._dismissBtn&&(this._dismissBtn.removeEventListener("click",this._onDismiss),this._dismissBtn=null),this._actionsSlot&&(this._actionsSlot.removeEventListener("slotchange",this._onSlotChange),this._actionsSlot=null),super.disconnectedCallback()}get open(){return!this.hasAttribute("hidden")}set open(i){i?this.removeAttribute("hidden"):this.setAttribute("hidden","")}connectedCallback(){super.connectedCallback(),this._syncHostStyles()}attributeChangedCallback(i,t,e){if(t!==e){if(i==="radius"){this._syncHostStyles();return}super.attributeChangedCallback(i,t,e)}}_onDismiss(i){i.preventDefault();const t=new CustomEvent("close",{bubbles:!0,cancelable:!0});this.dispatchEvent(t),t.defaultPrevented||(this.open=!1)}_onSlotChange(){const i=this.root.querySelector(".actions");if(!i||!this._actionsSlot)return;const t=this._actionsSlot.assignedNodes({flatten:!0}).length>0;i.setAttribute("data-empty",t?"false":"true")}_syncHostStyles(){const i=this.getAttribute("radius");if(i&&i.trim()){this.style.setProperty("--ui-alert-radius",E(i));return}this.style.removeProperty("--ui-alert-radius")}render(){const i=this.getAttribute("title")||"",t=this.getAttribute("description")||"",e=this.hasAttribute("dismissible"),a=_(this.getAttribute("tone")),u=C(this.getAttribute("variant")),c=A(this.getAttribute("layout")),d=S(this.getAttribute("size")),h=$(this.getAttribute("elevation")),p=B(this.getAttribute("indicator")),g=this.getAttribute("live")!=="false",s=a==="danger"||a==="warning"?"alert":"status",b=g?`role="${s}" aria-live="${s==="alert"?"assertive":"polite"}" aria-atomic="true"`:"",f=o(this,"title"),v=o(this),m=o(this,"actions"),x=i||f?`<div class="title" part="title"><slot name="title">${n(i)}</slot></div>`:"",w=t||v?`<div class="description" part="description"><slot>${n(t)}</slot></div>`:"",y=a==="danger"?"Dismiss critical alert":"Dismiss alert";this.setContent(`
|
|
338
|
+
<style>${k}</style>
|
|
339
|
+
<section class="alert tone-${a} variant-${u} layout-${c} size-${d} elevation-${h} indicator-${p}" part="base" ${b}>
|
|
340
340
|
<div class="row">
|
|
341
341
|
<span class="icon-wrap" part="icon-wrap" aria-hidden="true">
|
|
342
342
|
<span class="icon" part="icon">
|
|
343
|
-
<slot name="icon">${
|
|
343
|
+
<slot name="icon">${L(a)}</slot>
|
|
344
344
|
</span>
|
|
345
345
|
</span>
|
|
346
346
|
<div class="content">
|
|
347
|
-
${m}
|
|
348
347
|
${x}
|
|
349
|
-
|
|
348
|
+
${w}
|
|
349
|
+
<div class="actions" part="actions" data-empty="${m?"false":"true"}">
|
|
350
350
|
<slot name="actions"></slot>
|
|
351
351
|
</div>
|
|
352
352
|
</div>
|
|
353
|
-
${e?`<button class="dismiss" part="dismiss" type="button" aria-label="${
|
|
353
|
+
${e?`<button class="dismiss" part="dismiss" type="button" aria-label="${y}">
|
|
354
354
|
<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round">
|
|
355
355
|
<path d="m6 6 8 8M14 6l-8 8"></path>
|
|
356
356
|
</svg>
|