@editora/ui-core 0.2.1 → 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-BRT7E4A8.mjs → runtime-CORXjP7e.mjs} +379 -357
- 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-CXw4SGV9.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/toggle.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as l } from "./ElementBase-
|
|
1
|
+
import { E as l } from "./ElementBase-D5QsC5Vw.mjs";
|
|
2
2
|
const g = `
|
|
3
3
|
:host {
|
|
4
4
|
--ui-toggle-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
@@ -147,9 +147,9 @@ const g = `
|
|
|
147
147
|
--ui-toggle-bg: #0f172a;
|
|
148
148
|
--ui-toggle-color: #e2e8f0;
|
|
149
149
|
--ui-toggle-border: #334155;
|
|
150
|
-
--ui-toggle-active-bg: #93c5fd;
|
|
150
|
+
--ui-toggle-active-bg: var(--ui-color-accent-on-dark, #93c5fd);
|
|
151
151
|
--ui-toggle-active-color: #0f172a;
|
|
152
|
-
--ui-toggle-focus: #93c5fd;
|
|
152
|
+
--ui-toggle-focus: var(--ui-color-accent-on-dark, #93c5fd);
|
|
153
153
|
--ui-toggle-shadow:
|
|
154
154
|
0 10px 24px rgba(2, 6, 23, 0.38),
|
|
155
155
|
0 24px 50px rgba(2, 6, 23, 0.34);
|
|
@@ -242,13 +242,13 @@ const g = `
|
|
|
242
242
|
--ui-toggle-shadow: none;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
`,
|
|
245
|
+
`, a = /* @__PURE__ */ new Set(["icon-on", "icon-off", "aria-label"]);
|
|
246
246
|
function c(o) {
|
|
247
247
|
if (o == null) return !1;
|
|
248
248
|
const t = String(o).toLowerCase();
|
|
249
249
|
return t !== "false" && t !== "0" && t !== "off";
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function n(o) {
|
|
252
252
|
return String(o).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
253
253
|
}
|
|
254
254
|
class u extends l {
|
|
@@ -283,7 +283,7 @@ class u extends l {
|
|
|
283
283
|
}
|
|
284
284
|
attributeChangedCallback(t, e, i) {
|
|
285
285
|
if (e !== i) {
|
|
286
|
-
if (
|
|
286
|
+
if (a.has(t)) {
|
|
287
287
|
super.attributeChangedCallback(t, e, i);
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
@@ -347,14 +347,14 @@ class u extends l {
|
|
|
347
347
|
part="control"
|
|
348
348
|
${t ? "data-disabled" : ""}
|
|
349
349
|
>
|
|
350
|
-
<span class="icon icon-off" part="icon-off" aria-hidden="true">${
|
|
351
|
-
<span class="icon icon-on" part="icon-on" aria-hidden="true">${
|
|
350
|
+
<span class="icon icon-off" part="icon-off" aria-hidden="true">${n(i)}</span>
|
|
351
|
+
<span class="icon icon-on" part="icon-on" aria-hidden="true">${n(e)}</span>
|
|
352
352
|
<span class="label" part="label"><slot></slot></span>
|
|
353
353
|
</span>
|
|
354
354
|
`), this._control = this.root.querySelector(".control"), this._syncAria();
|
|
355
355
|
}
|
|
356
356
|
shouldRenderOnAttributeChange(t, e, i) {
|
|
357
|
-
return
|
|
357
|
+
return a.has(t);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
typeof customElements < "u" && !customElements.get("ui-toggle") && customElements.define("ui-toggle", u);
|
package/dist/toolbar.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./ElementBase-CbUsP3D6.js"),i=require("./roving-focus-group-BdJ_4Njm.js"),c=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-toolbar-gap: 8px;
|
|
4
4
|
--ui-toolbar-padding: 4px;
|
package/dist/toolbar.esm.js
CHANGED
package/dist/tooltip.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const w=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const w=require("./ElementBase-CbUsP3D6.js"),y=require("./number-attribute-C4Rrl7d3.js"),A=require("./portal-XbYR3m_q.js"),d=require("./overlay-motion-B56x1GoY.js"),m=140,T=120,_=`
|
|
2
2
|
.tooltip {
|
|
3
3
|
color-scheme: light dark;
|
|
4
4
|
--ui-tooltip-bg: color-mix(in srgb, var(--ui-color-text, #0f172a) 92%, #0b1220 8%);
|
|
@@ -156,4 +156,4 @@
|
|
|
156
156
|
forced-color-adjust: none;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
`;function f(i){if(i==null)return!1;const t=String(i).toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}
|
|
159
|
+
`;function f(i){if(i==null)return!1;const t=String(i).toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}const l=y.numberAttribute;function b(i){return i==="top"||i==="right"||i==="bottom"||i==="left"?i:"top"}function L(i){const t=(i||"hover focus").trim().toLowerCase();return t?new Set(t.split(/[\s,]+/).filter(Boolean)):new Set(["hover","focus"])}function u(i){return f(i)}class v extends w.ElementBase{constructor(){super(),this._portalEl=null,this._cleanup=null,this._id=`ui-tooltip-${Math.random().toString(36).slice(2,9)}`,this._isOpen=!1,this._syncingOpenAttr=!1,this._openTimer=null,this._closeTimer=null,this._exitTimer=null,this._pointerInsidePortal=!1,this._onMouseEnter=this._onMouseEnter.bind(this),this._onMouseLeave=this._onMouseLeave.bind(this),this._onFocusIn=this._onFocusIn.bind(this),this._onFocusOut=this._onFocusOut.bind(this),this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPortalMouseEnter=this._handlePortalMouseEnter.bind(this),this._onPortalMouseLeave=this._handlePortalMouseLeave.bind(this),this._onDocumentPointerDown=this._handleDocumentPointerDown.bind(this)}static get observedAttributes(){return["text","placement","open","disabled","headless","variant","size","tone","delay","close-delay","trigger","offset","interactive","arrow","aria-label"]}connectedCallback(){super.connectedCallback(),this.addEventListener("mouseenter",this._onMouseEnter),this.addEventListener("mouseleave",this._onMouseLeave),this.addEventListener("focusin",this._onFocusIn),this.addEventListener("focusout",this._onFocusOut),this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKeyDown),this.hasAttribute("open")&&this._scheduleShow(0)}disconnectedCallback(){this.removeEventListener("mouseenter",this._onMouseEnter),this.removeEventListener("mouseleave",this._onMouseLeave),this.removeEventListener("focusin",this._onFocusIn),this.removeEventListener("focusout",this._onFocusOut),this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKeyDown),this._clearTimers(),this.hide(!0),super.disconnectedCallback()}attributeChangedCallback(t,e,o){if(e!==o){if(t==="open"&&!this._syncingOpenAttr){this.hasAttribute("open")?this._scheduleShow(0):this._scheduleHide(0);return}if(t==="disabled"&&this.hasAttribute("disabled")){this.hide();return}if((t==="text"||t==="aria-label")&&this._isOpen&&!(this.getAttribute("text")||this.getAttribute("aria-label")||"").trim()){this.hide();return}if(this._isOpen&&["text","placement","variant","size","tone","headless","offset","arrow","aria-label","interactive"].includes(t)){this._renderPortalContent(),this._reposition();return}}}_clearTimers(){this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=null),this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),this._exitTimer&&(clearTimeout(this._exitTimer),this._exitTimer=null)}_triggerEnabled(t){const e=L(this.getAttribute("trigger"));return e.has("manual")?t==="manual":e.has(t)}_scheduleShow(t){if(this.hasAttribute("disabled"))return;this._clearTimers();const e=typeof t=="number"?t:l(this.getAttribute("delay"),250);this._openTimer=setTimeout(()=>{this.show(),this._openTimer=null},Math.max(0,e))}_scheduleHide(t){this._clearTimers();const e=typeof t=="number"?t:l(this.getAttribute("close-delay"),120);this._closeTimer=setTimeout(()=>{if(u(this.getAttribute("interactive"))&&this._pointerInsidePortal){this._closeTimer=null;return}this.hide(),this._closeTimer=null},Math.max(0,e))}_ensurePortalEl(){if(this._portalEl)return this._portalEl;const t=document.createElement("div");if(t.className="tooltip",t.id=this._id,t.setAttribute("role","tooltip"),!this.hasAttribute("headless")){const o=document.createElement("style");o.setAttribute("data-ui-tooltip-style",""),o.textContent=_,t.appendChild(o)}const e=document.createElement("div");return e.className="tooltip-content",t.appendChild(e),t.addEventListener("mouseenter",this._onPortalMouseEnter),t.addEventListener("mouseleave",this._onPortalMouseLeave),this._portalEl=t,t}_handlePortalMouseEnter(){this._pointerInsidePortal=!0,this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null)}_handlePortalMouseLeave(){this._pointerInsidePortal=!1,u(this.getAttribute("interactive"))&&this._scheduleHide()}_renderPortalContent(){const t=this._ensurePortalEl(),e=this.getAttribute("text")||this.getAttribute("aria-label")||"",o=b(this.getAttribute("placement")),r=this.getAttribute("variant")||"default",g=this.getAttribute("size")||"md",x=this.getAttribute("tone")||"default",h=!this.hasAttribute("arrow")||f(this.getAttribute("arrow")),E=u(this.getAttribute("interactive")),c=this.hasAttribute("headless"),n=t.querySelector("style[data-ui-tooltip-style]");if(!c&&!n){const s=document.createElement("style");s.setAttribute("data-ui-tooltip-style",""),s.textContent=_,t.prepend(s)}else c&&n&&n.remove();t.setAttribute("data-variant",r),t.setAttribute("data-size",g),t.setAttribute("data-tone",x),t.setAttribute("data-placement",o),t.setAttribute("data-interactive",E?"true":"false");const p=t.querySelector(".tooltip-content");p&&(p.textContent=e);const a=t.querySelector(".arrow");if(h&&!a){const s=document.createElement("div");s.className="arrow",t.appendChild(s)}!h&&a&&a.remove()}_reposition(){if(!this._portalEl)return;this._cleanup&&(this._cleanup(),this._cleanup=null);const t=b(this.getAttribute("placement")),e=l(this.getAttribute("offset"),8);this._cleanup=A.showPortalFor(this,this._portalEl,{placement:t,offset:e,shift:!0,flip:!0}),this._portalEl.getAttribute("data-state")==="open"&&d.liftToTopLayer(this._portalEl)}_syncOpenAttr(t){this._syncingOpenAttr=!0;try{t?this.hasAttribute("open")||this.setAttribute("open",""):this.hasAttribute("open")&&this.removeAttribute("open")}finally{this._syncingOpenAttr=!1}}show(){if(this.hasAttribute("disabled")||!(this.getAttribute("text")||this.getAttribute("aria-label")||"").trim())return;this._clearTimers(),this._renderPortalContent(),this._reposition(),this._portalEl&&(this._portalEl.classList.remove("closing"),this._portalEl.classList.add("show"),this._portalEl.setAttribute("data-state","open"),d.liftToTopLayer(this._portalEl),this.setAttribute("aria-describedby",this._id)),this._bindDocumentDismiss();const e=this._isOpen;this._isOpen=!0,this._syncOpenAttr(!0),e||(this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{open:!0},bubbles:!0,composed:!0})))}hide(t=!1){this._clearTimers(),this._unbindDocumentDismiss(),this._cleanup&&(this._cleanup({remove:!1}),this._cleanup=null);const e=this._portalEl;if(e){e.classList.remove("show"),e.classList.add("closing"),e.setAttribute("data-state","closed");const r=typeof getComputedStyle=="function"?parseFloat(getComputedStyle(e).transitionDuration||"0"):0;t||!(r>0)?this._removePortal():this._exitTimer=setTimeout(()=>{this._removePortal(),this._exitTimer=null},T)}this._pointerInsidePortal=!1,this.removeAttribute("aria-describedby");const o=this._isOpen;this._isOpen=!1,this._syncOpenAttr(!1),o&&(this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{open:!1},bubbles:!0,composed:!0})))}_removePortal(){this._portalEl&&(this._portalEl.removeEventListener("mouseenter",this._onPortalMouseEnter),this._portalEl.removeEventListener("mouseleave",this._onPortalMouseLeave),this._portalEl.parentElement&&this._portalEl.parentElement.removeChild(this._portalEl),this._portalEl=null)}_bindDocumentDismiss(){this._triggerEnabled("click")&&document.addEventListener("pointerdown",this._onDocumentPointerDown)}_unbindDocumentDismiss(){document.removeEventListener("pointerdown",this._onDocumentPointerDown)}_handleDocumentPointerDown(t){if(!this._isOpen)return;const e=t.target;e&&(this.contains(e)||this._portalEl?.contains(e)||this.hide())}shouldRenderOnAttributeChange(t,e,o){return!1}_onMouseEnter(){this._triggerEnabled("hover")&&this._scheduleShow()}_onMouseLeave(){this._triggerEnabled("hover")&&this._scheduleHide()}_onFocusIn(){this._triggerEnabled("focus")&&this._scheduleShow(0)}_onFocusOut(t){if(!this._triggerEnabled("focus"))return;const e=t.relatedTarget;e&&this.contains(e)||e&&this._portalEl?.contains(e)||this._scheduleHide(0)}_onClick(){this._triggerEnabled("click")&&(this._isOpen?this.hide():this._scheduleShow(0))}_onKeyDown(t){t.key==="Escape"&&this._isOpen&&(t.preventDefault(),this.hide())}render(){this.setContent("<slot></slot>")}}typeof customElements<"u"&&!customElements.get("ui-tooltip")&&customElements.define("ui-tooltip",v);exports.UITooltip=v;
|
package/dist/tooltip.esm.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { E } from "./ElementBase-
|
|
2
|
-
import {
|
|
1
|
+
import { E } from "./ElementBase-D5QsC5Vw.mjs";
|
|
2
|
+
import { n as w } from "./number-attribute-BAF07JrU.mjs";
|
|
3
|
+
import { s as A } from "./portal-DeaM1tYY.mjs";
|
|
3
4
|
import { l as d } from "./overlay-motion-BX3dPLay.mjs";
|
|
4
5
|
const m = 140, y = 120, _ = `
|
|
5
6
|
.tooltip {
|
|
@@ -165,21 +166,18 @@ function f(i) {
|
|
|
165
166
|
const t = String(i).toLowerCase();
|
|
166
167
|
return t !== "false" && t !== "0" && t !== "off";
|
|
167
168
|
}
|
|
168
|
-
|
|
169
|
-
const e = Number(i);
|
|
170
|
-
return Number.isFinite(e) ? e : t;
|
|
171
|
-
}
|
|
169
|
+
const l = w;
|
|
172
170
|
function b(i) {
|
|
173
171
|
return i === "top" || i === "right" || i === "bottom" || i === "left" ? i : "top";
|
|
174
172
|
}
|
|
175
|
-
function
|
|
173
|
+
function T(i) {
|
|
176
174
|
const t = (i || "hover focus").trim().toLowerCase();
|
|
177
175
|
return t ? new Set(t.split(/[\s,]+/).filter(Boolean)) : /* @__PURE__ */ new Set(["hover", "focus"]);
|
|
178
176
|
}
|
|
179
177
|
function u(i) {
|
|
180
178
|
return f(i);
|
|
181
179
|
}
|
|
182
|
-
class
|
|
180
|
+
class L extends E {
|
|
183
181
|
constructor() {
|
|
184
182
|
super(), this._portalEl = null, this._cleanup = null, this._id = `ui-tooltip-${Math.random().toString(36).slice(2, 9)}`, this._isOpen = !1, this._syncingOpenAttr = !1, this._openTimer = null, this._closeTimer = null, this._exitTimer = null, this._pointerInsidePortal = !1, this._onMouseEnter = this._onMouseEnter.bind(this), this._onMouseLeave = this._onMouseLeave.bind(this), this._onFocusIn = this._onFocusIn.bind(this), this._onFocusOut = this._onFocusOut.bind(this), this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onPortalMouseEnter = this._handlePortalMouseEnter.bind(this), this._onPortalMouseLeave = this._handlePortalMouseLeave.bind(this), this._onDocumentPointerDown = this._handleDocumentPointerDown.bind(this);
|
|
185
183
|
}
|
|
@@ -232,7 +230,7 @@ class T extends E {
|
|
|
232
230
|
this._openTimer && (clearTimeout(this._openTimer), this._openTimer = null), this._closeTimer && (clearTimeout(this._closeTimer), this._closeTimer = null), this._exitTimer && (clearTimeout(this._exitTimer), this._exitTimer = null);
|
|
233
231
|
}
|
|
234
232
|
_triggerEnabled(t) {
|
|
235
|
-
const e =
|
|
233
|
+
const e = T(this.getAttribute("trigger"));
|
|
236
234
|
return e.has("manual") ? t === "manual" : e.has(t);
|
|
237
235
|
}
|
|
238
236
|
_scheduleShow(t) {
|
|
@@ -271,12 +269,12 @@ class T extends E {
|
|
|
271
269
|
this._pointerInsidePortal = !1, u(this.getAttribute("interactive")) && this._scheduleHide();
|
|
272
270
|
}
|
|
273
271
|
_renderPortalContent() {
|
|
274
|
-
const t = this._ensurePortalEl(), e = this.getAttribute("text") || this.getAttribute("aria-label") || "", o = b(this.getAttribute("placement")), r = this.getAttribute("variant") || "default",
|
|
272
|
+
const t = this._ensurePortalEl(), e = this.getAttribute("text") || this.getAttribute("aria-label") || "", o = b(this.getAttribute("placement")), r = this.getAttribute("variant") || "default", g = this.getAttribute("size") || "md", v = this.getAttribute("tone") || "default", h = !this.hasAttribute("arrow") || f(this.getAttribute("arrow")), x = u(this.getAttribute("interactive")), c = this.hasAttribute("headless"), n = t.querySelector("style[data-ui-tooltip-style]");
|
|
275
273
|
if (!c && !n) {
|
|
276
274
|
const s = document.createElement("style");
|
|
277
275
|
s.setAttribute("data-ui-tooltip-style", ""), s.textContent = _, t.prepend(s);
|
|
278
276
|
} else c && n && n.remove();
|
|
279
|
-
t.setAttribute("data-variant", r), t.setAttribute("data-size",
|
|
277
|
+
t.setAttribute("data-variant", r), t.setAttribute("data-size", g), t.setAttribute("data-tone", v), t.setAttribute("data-placement", o), t.setAttribute("data-interactive", x ? "true" : "false");
|
|
280
278
|
const p = t.querySelector(".tooltip-content");
|
|
281
279
|
p && (p.textContent = e);
|
|
282
280
|
const a = t.querySelector(".arrow");
|
|
@@ -290,7 +288,7 @@ class T extends E {
|
|
|
290
288
|
if (!this._portalEl) return;
|
|
291
289
|
this._cleanup && (this._cleanup(), this._cleanup = null);
|
|
292
290
|
const t = b(this.getAttribute("placement")), e = l(this.getAttribute("offset"), 8);
|
|
293
|
-
this._cleanup =
|
|
291
|
+
this._cleanup = A(this, this._portalEl, {
|
|
294
292
|
placement: t,
|
|
295
293
|
offset: e,
|
|
296
294
|
shift: !0,
|
|
@@ -366,7 +364,7 @@ class T extends E {
|
|
|
366
364
|
this.setContent("<slot></slot>");
|
|
367
365
|
}
|
|
368
366
|
}
|
|
369
|
-
typeof customElements < "u" && !customElements.get("ui-tooltip") && customElements.define("ui-tooltip",
|
|
367
|
+
typeof customElements < "u" && !customElements.get("ui-tooltip") && customElements.define("ui-tooltip", L);
|
|
370
368
|
export {
|
|
371
|
-
|
|
369
|
+
L as UITooltip
|
|
372
370
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const q=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const q=require("./ElementBase-CbUsP3D6.js"),U=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-transfer-accent: var(--ui-color-primary, #2563eb);
|
|
4
4
|
--ui-transfer-text: var(--ui-color-text, #0f172a);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const v=require("./ElementBase-
|
|
1
|
+
"use strict";const v=require("./ElementBase-CbUsP3D6.js"),p=require("./collection-qv8A8rq4.js"),f=require("./tree-item.cjs.js");function x(l,t){const e=[],i=t.getExpanded||(()=>!1),r=t.getDisabled||(()=>!1),s=(d,n,o)=>{d.forEach(a=>{const u=t.getChildren(a)||[],c={item:a,id:t.getId(a),label:t.getLabel(a),level:n,parentId:o,disabled:r(a),expanded:i(a),hasChildren:u.length>0};e.push(c),s(u,n+1,c.id)})};return s(l,1,null),e}function g(l,t){const e=[],i=t.getExpanded||(()=>!1),r=t.getDisabled||(()=>!1),s=(d,n,o)=>{d.forEach(a=>{const u=t.getChildren(a)||[],c=i(a),h={item:a,id:t.getId(a),label:t.getLabel(a),level:n,parentId:o,disabled:r(a),expanded:c,hasChildren:u.length>0};e.push(h),h.hasChildren&&c&&s(u,n+1,h.id)})};return s(l,1,null),e}function b(l,t){return l.findIndex(e=>e.id===t)}function _(l,t){const e=l[t];return e?.parentId?l.findIndex(i=>i.id===e.parentId):-1}function y(l,t,e=-1){const i=p.normalizeCollectionText(t);if(!i)return-1;for(let r=1;r<=l.length;r+=1){const s=(e+r+l.length)%l.length,d=l[s];if(!d.disabled&&p.normalizeCollectionText(d.label).startsWith(i))return s}return-1}const T=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-tree-indent: 16px;
|
|
4
4
|
--ui-tree-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
package/dist/tree-item.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-CbUsP3D6.js"),i=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-tree-indent: 16px;
|
|
4
4
|
--ui-tree-level: 1;
|
package/dist/tree-item.esm.js
CHANGED
package/dist/tree.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./tree-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./tree-ChQfhxya.js");exports.UITree=e.UITree;
|
package/dist/tree.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-CbUsP3D6.js"),a=`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
color-scheme: light dark;
|
package/dist/wizard.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("./ElementBase-CbUsP3D6.js"),C=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-wizard-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
|
|
4
4
|
--ui-wizard-surface: color-mix(in srgb, var(--ui-color-surface, #ffffff) 99%, transparent);
|
|
@@ -487,15 +487,15 @@
|
|
|
487
487
|
--ui-wizard-border: #334155;
|
|
488
488
|
--ui-wizard-text: #e2e8f0;
|
|
489
489
|
--ui-wizard-muted: #93a4bd;
|
|
490
|
-
--ui-wizard-accent: #93c5fd;
|
|
491
|
-
--ui-wizard-focus: #93c5fd;
|
|
490
|
+
--ui-wizard-accent: var(--ui-color-accent-on-dark, #93c5fd);
|
|
491
|
+
--ui-wizard-focus: var(--ui-color-accent-on-dark, #93c5fd);
|
|
492
492
|
--ui-wizard-success: #4ade80;
|
|
493
493
|
--ui-wizard-warning: #fbbf24;
|
|
494
494
|
--ui-wizard-danger: #f87171;
|
|
495
495
|
/* The contrast variant is a dark surface of its own: the theme's light fills and lines do not apply. */
|
|
496
496
|
--ui-wizard-fill: #1e293b;
|
|
497
497
|
--ui-wizard-fill-soft: #1e293b;
|
|
498
|
-
--ui-wizard-accent-fill: color-mix(in srgb, #93c5fd
|
|
498
|
+
--ui-wizard-accent-fill: color-mix(in srgb, var(--ui-color-accent-on-dark, #93c5fd) 14%, #0f172a);
|
|
499
499
|
--ui-wizard-line: #334155;
|
|
500
500
|
}
|
|
501
501
|
|
package/dist/wizard.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as A } from "./ElementBase-
|
|
1
|
+
import { E as A } from "./ElementBase-D5QsC5Vw.mjs";
|
|
2
2
|
const k = `
|
|
3
3
|
:host {
|
|
4
4
|
--ui-wizard-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
|
|
@@ -488,15 +488,15 @@ const k = `
|
|
|
488
488
|
--ui-wizard-border: #334155;
|
|
489
489
|
--ui-wizard-text: #e2e8f0;
|
|
490
490
|
--ui-wizard-muted: #93a4bd;
|
|
491
|
-
--ui-wizard-accent: #93c5fd;
|
|
492
|
-
--ui-wizard-focus: #93c5fd;
|
|
491
|
+
--ui-wizard-accent: var(--ui-color-accent-on-dark, #93c5fd);
|
|
492
|
+
--ui-wizard-focus: var(--ui-color-accent-on-dark, #93c5fd);
|
|
493
493
|
--ui-wizard-success: #4ade80;
|
|
494
494
|
--ui-wizard-warning: #fbbf24;
|
|
495
495
|
--ui-wizard-danger: #f87171;
|
|
496
496
|
/* The contrast variant is a dark surface of its own: the theme's light fills and lines do not apply. */
|
|
497
497
|
--ui-wizard-fill: #1e293b;
|
|
498
498
|
--ui-wizard-fill-soft: #1e293b;
|
|
499
|
-
--ui-wizard-accent-fill: color-mix(in srgb, #93c5fd
|
|
499
|
+
--ui-wizard-accent-fill: color-mix(in srgb, var(--ui-color-accent-on-dark, #93c5fd) 14%, #0f172a);
|
|
500
500
|
--ui-wizard-line: #334155;
|
|
501
501
|
}
|
|
502
502
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editora/ui-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Framework-agnostic Web Components and primitives for the Editora UI ecosystem",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"require": "./dist/runtime.cjs.js",
|
|
25
25
|
"default": "./dist/runtime.esm.js"
|
|
26
26
|
},
|
|
27
|
+
"./preload.css": "./dist/preload.css",
|
|
27
28
|
"./*": {
|
|
28
29
|
"types": "./dist/standalone/*.d.ts",
|
|
29
30
|
"import": "./dist/*.esm.js",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"access": "public"
|
|
55
56
|
},
|
|
56
57
|
"dependencies": {
|
|
57
|
-
"@editora/icons": "^0.
|
|
58
|
+
"@editora/icons": "^0.2.0"
|
|
58
59
|
},
|
|
59
60
|
"keywords": [
|
|
60
61
|
"editora",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const f=[],b=["a[href]","area[href]",'input:not([type="hidden"])',"select","textarea","button","iframe","[tabindex]",'[contenteditable="true"]'].join(", ");function h(){const t=f.filter(e=>!e.paused);return t.length?t[t.length-1]:null}function y(t){return!(t.hasAttribute("disabled")||t.getAttribute("aria-hidden")==="true"||t.hasAttribute("hidden")||t.getAttribute("tabindex")==="-1")}function a(t){return Array.from(t.querySelectorAll(b)).filter(y)}function d(t){t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1")}function m(t){return typeof t=="function"?t():t??null}function s(t){if(!t||!t.isConnected)return!1;try{return t.focus(),!0}catch{return!1}}function F(t){return t.querySelector('[aria-selected="true"], [data-selected="true"], [selected], [checked], [aria-current="true"]')||null}function E(t){if(!t.options.inertOthers||typeof document>"u"||!document.body)return;const e=Array.from(document.body.children);t.inerted=e.filter(r=>r!==t.options.node&&!r.contains(t.options.node)).map(r=>{const c=r.hasAttribute("inert");return c||r.setAttribute("inert",""),{element:r,hadInert:c}})}function v(t){t.inerted.forEach(({element:e,hadInert:r})=>{r||e.removeAttribute("inert")}),t.inerted=[]}function A(t){if(!(t.node instanceof HTMLElement))throw new Error("createFocusScope requires a valid HTMLElement node");const e={id:Symbol("focus-scope"),options:{trapped:!0,loop:!0,restoreFocus:!0,autoFocus:"first",inertOthers:!1,...t},paused:!1,previouslyFocused:document.activeElement instanceof HTMLElement?document.activeElement:null,inerted:[],onKeyDown:()=>{},onFocusIn:()=>{}},r=()=>{const n=a(e.options.node)[0]||null;s(n)||(d(e.options.node),s(e.options.node))},c=()=>{const n=a(e.options.node),o=n.length?n[n.length-1]:null;s(o)||(d(e.options.node),s(e.options.node))},u=()=>{const n=m(e.options.initialFocus);if(s(n))return;const o=e.options.autoFocus;if(o!=="none"){if(o==="container"){d(e.options.node),s(e.options.node);return}if(o==="selected"){const i=F(e.options.node);if(s(i))return}r()}};return e.onKeyDown=n=>{if(e.paused||h()?.id!==e.id||!e.options.trapped||n.key!=="Tab")return;const o=a(e.options.node);if(!o.length){n.preventDefault(),u();return}const i=document.activeElement instanceof HTMLElement?document.activeElement:null;if(!i||!e.options.node.contains(i)){n.preventDefault(),u();return}const l=o[0],p=o[o.length-1];if(n.shiftKey){(i===l||i===e.options.node)&&(n.preventDefault(),e.options.loop&&s(p));return}i===p&&(n.preventDefault(),e.options.loop&&s(l))},e.onFocusIn=n=>{if(e.paused||h()?.id!==e.id||!e.options.trapped)return;const o=n.target;(typeof n.composedPath=="function"?n.composedPath():[]).includes(e.options.node)||o instanceof Node&&(e.options.node.contains(o)||u())},f.push(e),E(e),document.addEventListener("keydown",e.onKeyDown,!0),document.addEventListener("focusin",e.onFocusIn,!0),u(),{destroy(){const n=f.findIndex(i=>i.id===e.id);if(n>=0&&f.splice(n,1),document.removeEventListener("keydown",e.onKeyDown,!0),document.removeEventListener("focusin",e.onFocusIn,!0),v(e),!e.options.restoreFocus)return;const o=m(e.options.finalFocus)||e.previouslyFocused;s(o)},focusFirst:r,focusLast:c,focusInitial:u,pause(){e.paused=!0},resume(){e.paused=!1}}}exports.createFocusScope=A;
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
const f = [], b = [
|
|
2
|
-
"a[href]",
|
|
3
|
-
"area[href]",
|
|
4
|
-
'input:not([type="hidden"])',
|
|
5
|
-
"select",
|
|
6
|
-
"textarea",
|
|
7
|
-
"button",
|
|
8
|
-
"iframe",
|
|
9
|
-
"[tabindex]",
|
|
10
|
-
'[contenteditable="true"]'
|
|
11
|
-
].join(", ");
|
|
12
|
-
function h() {
|
|
13
|
-
const t = f.filter((e) => !e.paused);
|
|
14
|
-
return t.length ? t[t.length - 1] : null;
|
|
15
|
-
}
|
|
16
|
-
function y(t) {
|
|
17
|
-
return !(t.hasAttribute("disabled") || t.getAttribute("aria-hidden") === "true" || t.hasAttribute("hidden") || t.getAttribute("tabindex") === "-1");
|
|
18
|
-
}
|
|
19
|
-
function a(t) {
|
|
20
|
-
return Array.from(t.querySelectorAll(b)).filter(y);
|
|
21
|
-
}
|
|
22
|
-
function d(t) {
|
|
23
|
-
t.hasAttribute("tabindex") || t.setAttribute("tabindex", "-1");
|
|
24
|
-
}
|
|
25
|
-
function m(t) {
|
|
26
|
-
return typeof t == "function" ? t() : t ?? null;
|
|
27
|
-
}
|
|
28
|
-
function s(t) {
|
|
29
|
-
if (!t || !t.isConnected) return !1;
|
|
30
|
-
try {
|
|
31
|
-
return t.focus(), !0;
|
|
32
|
-
} catch {
|
|
33
|
-
return !1;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function F(t) {
|
|
37
|
-
return t.querySelector(
|
|
38
|
-
'[aria-selected="true"], [data-selected="true"], [selected], [checked], [aria-current="true"]'
|
|
39
|
-
) || null;
|
|
40
|
-
}
|
|
41
|
-
function E(t) {
|
|
42
|
-
if (!t.options.inertOthers || typeof document > "u" || !document.body) return;
|
|
43
|
-
const e = Array.from(document.body.children);
|
|
44
|
-
t.inerted = e.filter((r) => r !== t.options.node && !r.contains(t.options.node)).map((r) => {
|
|
45
|
-
const c = r.hasAttribute("inert");
|
|
46
|
-
return c || r.setAttribute("inert", ""), { element: r, hadInert: c };
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function v(t) {
|
|
50
|
-
t.inerted.forEach(({ element: e, hadInert: r }) => {
|
|
51
|
-
r || e.removeAttribute("inert");
|
|
52
|
-
}), t.inerted = [];
|
|
53
|
-
}
|
|
54
|
-
function A(t) {
|
|
55
|
-
if (!(t.node instanceof HTMLElement))
|
|
56
|
-
throw new Error("createFocusScope requires a valid HTMLElement node");
|
|
57
|
-
const e = {
|
|
58
|
-
id: /* @__PURE__ */ Symbol("focus-scope"),
|
|
59
|
-
options: {
|
|
60
|
-
trapped: !0,
|
|
61
|
-
loop: !0,
|
|
62
|
-
restoreFocus: !0,
|
|
63
|
-
autoFocus: "first",
|
|
64
|
-
inertOthers: !1,
|
|
65
|
-
...t
|
|
66
|
-
},
|
|
67
|
-
paused: !1,
|
|
68
|
-
previouslyFocused: document.activeElement instanceof HTMLElement ? document.activeElement : null,
|
|
69
|
-
inerted: [],
|
|
70
|
-
onKeyDown: () => {
|
|
71
|
-
},
|
|
72
|
-
onFocusIn: () => {
|
|
73
|
-
}
|
|
74
|
-
}, r = () => {
|
|
75
|
-
const n = a(e.options.node)[0] || null;
|
|
76
|
-
s(n) || (d(e.options.node), s(e.options.node));
|
|
77
|
-
}, c = () => {
|
|
78
|
-
const n = a(e.options.node), o = n.length ? n[n.length - 1] : null;
|
|
79
|
-
s(o) || (d(e.options.node), s(e.options.node));
|
|
80
|
-
}, u = () => {
|
|
81
|
-
const n = m(e.options.initialFocus);
|
|
82
|
-
if (s(n)) return;
|
|
83
|
-
const o = e.options.autoFocus;
|
|
84
|
-
if (o !== "none") {
|
|
85
|
-
if (o === "container") {
|
|
86
|
-
d(e.options.node), s(e.options.node);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (o === "selected") {
|
|
90
|
-
const i = F(e.options.node);
|
|
91
|
-
if (s(i)) return;
|
|
92
|
-
}
|
|
93
|
-
r();
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
return e.onKeyDown = (n) => {
|
|
97
|
-
if (e.paused || h()?.id !== e.id || !e.options.trapped || n.key !== "Tab") return;
|
|
98
|
-
const o = a(e.options.node);
|
|
99
|
-
if (!o.length) {
|
|
100
|
-
n.preventDefault(), u();
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const i = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
104
|
-
if (!i || !e.options.node.contains(i)) {
|
|
105
|
-
n.preventDefault(), u();
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
const l = o[0], p = o[o.length - 1];
|
|
109
|
-
if (n.shiftKey) {
|
|
110
|
-
(i === l || i === e.options.node) && (n.preventDefault(), e.options.loop && s(p));
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
i === p && (n.preventDefault(), e.options.loop && s(l));
|
|
114
|
-
}, e.onFocusIn = (n) => {
|
|
115
|
-
if (e.paused || h()?.id !== e.id || !e.options.trapped) return;
|
|
116
|
-
const o = n.target;
|
|
117
|
-
(typeof n.composedPath == "function" ? n.composedPath() : []).includes(e.options.node) || o instanceof Node && (e.options.node.contains(o) || u());
|
|
118
|
-
}, f.push(e), E(e), document.addEventListener("keydown", e.onKeyDown, !0), document.addEventListener("focusin", e.onFocusIn, !0), u(), {
|
|
119
|
-
destroy() {
|
|
120
|
-
const n = f.findIndex((i) => i.id === e.id);
|
|
121
|
-
if (n >= 0 && f.splice(n, 1), document.removeEventListener("keydown", e.onKeyDown, !0), document.removeEventListener("focusin", e.onFocusIn, !0), v(e), !e.options.restoreFocus) return;
|
|
122
|
-
const o = m(e.options.finalFocus) || e.previouslyFocused;
|
|
123
|
-
s(o);
|
|
124
|
-
},
|
|
125
|
-
focusFirst: r,
|
|
126
|
-
focusLast: c,
|
|
127
|
-
focusInitial: u,
|
|
128
|
-
pause() {
|
|
129
|
-
e.paused = !0;
|
|
130
|
-
},
|
|
131
|
-
resume() {
|
|
132
|
-
e.paused = !1;
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
export {
|
|
137
|
-
A as c
|
|
138
|
-
};
|