@editora/ui-core 0.1.21 → 0.1.22
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/accordion.cjs.js +3 -3
- package/dist/accordion.esm.js +3 -3
- package/dist/alert-dialog.cjs.js +32 -32
- package/dist/alert-dialog.esm.js +95 -75
- package/dist/alert.cjs.js +6 -6
- package/dist/alert.esm.js +6 -6
- package/dist/animated-list.cjs.js +4 -4
- package/dist/animated-list.esm.js +4 -4
- package/dist/animated-text.cjs.js +4 -4
- package/dist/animated-text.esm.js +4 -4
- package/dist/app-header.cjs.js +3 -3
- package/dist/app-header.esm.js +3 -3
- package/dist/aspect-ratio.cjs.js +3 -3
- package/dist/aspect-ratio.esm.js +3 -3
- package/dist/avatar.cjs.js +14 -14
- package/dist/avatar.esm.js +31 -29
- package/dist/badge.cjs.js +4 -4
- package/dist/badge.esm.js +4 -4
- package/dist/block-controls.cjs.js +4 -4
- package/dist/block-controls.esm.js +4 -4
- package/dist/box.cjs.js +2 -2
- package/dist/box.esm.js +2 -2
- package/dist/breadcrumb.cjs.js +5 -5
- package/dist/breadcrumb.esm.js +5 -5
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-DLY4acgn.mjs → calendar-DbxYRdlv.mjs} +227 -183
- package/dist/{calendar-Dkof-FTK.js → calendar-Qa-cFOp3.js} +74 -35
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +8 -8
- package/dist/card.esm.js +63 -20
- package/dist/chart.cjs.js +4 -4
- package/dist/chart.esm.js +6 -6
- package/dist/checkbox.cjs.js +2 -2
- package/dist/checkbox.esm.js +2 -2
- package/dist/collapsible.cjs.js +7 -7
- package/dist/collapsible.esm.js +7 -7
- package/dist/color-picker.cjs.js +30 -10
- package/dist/color-picker.esm.js +82 -60
- package/dist/combobox.cjs.js +29 -27
- package/dist/combobox.esm.js +51 -45
- package/dist/command.cjs.js +2 -2
- package/dist/command.esm.js +2 -2
- package/dist/components/ui-alert-dialog.d.ts +1 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-avatar.d.ts +1 -0
- package/dist/components/ui-avatar.d.ts.map +1 -1
- package/dist/components/ui-button.d.ts +1 -0
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts +3 -0
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-color-picker.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-data-table.d.ts.map +1 -1
- package/dist/components/ui-date-field.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dock.d.ts +1 -0
- package/dist/components/ui-dock.d.ts.map +1 -1
- package/dist/components/ui-drawer.d.ts.map +1 -1
- package/dist/components/ui-dropdown.d.ts.map +1 -1
- package/dist/components/ui-field.d.ts.map +1 -1
- package/dist/components/ui-file-upload.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-pin-input.d.ts +1 -0
- package/dist/components/ui-pin-input.d.ts.map +1 -1
- package/dist/components/ui-placement-grid.d.ts.map +1 -1
- package/dist/components/ui-progress.d.ts.map +1 -1
- package/dist/components/ui-radio.d.ts.map +1 -1
- package/dist/components/ui-rating.d.ts +1 -0
- package/dist/components/ui-rating.d.ts.map +1 -1
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-table.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts +1 -0
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-tags-input.d.ts +1 -0
- package/dist/components/ui-tags-input.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-field.d.ts.map +1 -1
- package/dist/components/ui-toggle-group.d.ts.map +1 -1
- package/dist/components/ui-toggle.d.ts.map +1 -1
- package/dist/components/ui-tree.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/context-menu.cjs.js +3 -3
- package/dist/context-menu.esm.js +4 -4
- package/dist/control-name-BmoI1m3a.js +1 -0
- package/dist/control-name-Bpj7F34X.mjs +48 -0
- package/dist/data-table.cjs.js +5 -2
- package/dist/data-table.esm.js +145 -142
- package/dist/date-field.cjs.js +5 -5
- package/dist/date-field.esm.js +34 -31
- package/dist/date-picker.cjs.js +16 -16
- package/dist/date-picker.esm.js +48 -44
- package/dist/date-range-picker.cjs.js +5 -5
- package/dist/date-range-picker.esm.js +120 -118
- package/dist/date-range-time-picker.cjs.js +22 -22
- package/dist/date-range-time-picker.esm.js +88 -84
- package/dist/date-time-picker.cjs.js +23 -23
- package/dist/date-time-picker.esm.js +102 -98
- package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-BzfTpeU-.js} +1 -1
- package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-Cps2aSu2.mjs} +1 -1
- package/dist/description.cjs.js +3 -3
- package/dist/description.esm.js +3 -3
- package/dist/dialog.cjs.js +2 -2
- package/dist/dialog.esm.js +2 -2
- package/dist/dock.cjs.js +12 -12
- package/dist/dock.esm.js +72 -74
- package/dist/drawer.cjs.js +19 -19
- package/dist/drawer.esm.js +58 -58
- package/dist/dropdown.cjs.js +13 -13
- package/dist/dropdown.esm.js +49 -48
- package/dist/empty-state.cjs.js +3 -3
- package/dist/empty-state.esm.js +3 -3
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +1 -1
- package/dist/field.cjs.js +12 -12
- package/dist/field.esm.js +84 -75
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +4 -4
- package/dist/file-upload.cjs.js +3 -3
- package/dist/file-upload.esm.js +5 -3
- package/dist/floating-toolbar.cjs.js +8 -8
- package/dist/floating-toolbar.esm.js +9 -9
- package/dist/form.cjs.js +11 -11
- package/dist/form.esm.js +11 -11
- package/dist/gantt.cjs.js +43 -32
- package/dist/gantt.esm.js +99 -88
- package/dist/icon-cloud.cjs.js +3 -3
- package/dist/icon-cloud.esm.js +3 -3
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +121 -118
- package/dist/inline-edit.cjs.js +1 -1
- package/dist/inline-edit.esm.js +1 -1
- package/dist/input.cjs.js +14 -14
- package/dist/input.esm.js +39 -32
- package/dist/label.cjs.js +3 -3
- package/dist/label.esm.js +3 -3
- package/dist/{listbox-B6QgECax.js → listbox-CTpRpuF7.js} +1 -1
- package/dist/{listbox-DJamVeFj.mjs → listbox-hMVOhKHC.mjs} +1 -1
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +1 -1
- package/dist/marquee.cjs.js +3 -3
- package/dist/marquee.esm.js +3 -3
- package/dist/{menu-item-styles-CbNUEwP2.js → menu-item-styles-B4onAr4C.js} +3 -3
- package/dist/{menu-item-styles-CZiPwPwl.mjs → menu-item-styles-IGSFLAHu.mjs} +3 -3
- package/dist/menu.cjs.js +7 -7
- package/dist/menu.esm.js +29 -28
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +2 -2
- package/dist/meter.cjs.js +1 -1
- package/dist/meter.esm.js +1 -1
- package/dist/multi-select.cjs.js +17 -17
- package/dist/multi-select.esm.js +51 -43
- package/dist/navigation-menu.cjs.js +1 -1
- package/dist/navigation-menu.esm.js +1 -1
- package/dist/number-field.cjs.js +11 -13
- package/dist/number-field.esm.js +29 -27
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +4 -4
- package/dist/odometer.cjs.js +2 -2
- package/dist/odometer.esm.js +2 -2
- package/dist/orbiter.cjs.js +3 -3
- package/dist/orbiter.esm.js +3 -3
- package/dist/pagination.cjs.js +1 -1
- package/dist/pagination.esm.js +1 -1
- package/dist/password-field.cjs.js +23 -23
- package/dist/password-field.esm.js +48 -47
- package/dist/pin-input.cjs.js +8 -6
- package/dist/pin-input.esm.js +21 -15
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +58 -58
- package/dist/plugin-panel.cjs.js +1 -1
- package/dist/plugin-panel.esm.js +1 -1
- package/dist/popover.cjs.js +5 -5
- package/dist/popover.esm.js +4 -4
- package/dist/primitives/control-name.d.ts +30 -0
- package/dist/primitives/control-name.d.ts.map +1 -0
- package/dist/primitives/trigger.d.ts +2 -0
- package/dist/primitives/trigger.d.ts.map +1 -0
- package/dist/progress.cjs.js +4 -4
- package/dist/progress.esm.js +20 -18
- package/dist/quick-actions.cjs.js +3 -3
- package/dist/quick-actions.esm.js +3 -3
- package/dist/radio-group.cjs.js +1 -1
- package/dist/radio-group.esm.js +1 -1
- package/dist/radio.cjs.js +2 -2
- package/dist/radio.esm.js +2 -2
- package/dist/rating.cjs.js +17 -16
- package/dist/rating.esm.js +91 -92
- package/dist/{runtime-D1gFh1fS.mjs → runtime-CFnK53iC.mjs} +133 -94
- package/dist/runtime-DwE-tizc.js +1 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +29 -26
- package/dist/select.cjs.js +20 -19
- package/dist/select.esm.js +36 -32
- package/dist/selection-popup.cjs.js +2 -2
- package/dist/selection-popup.esm.js +2 -2
- package/dist/separator.cjs.js +7 -7
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +7 -7
- package/dist/sidebar.esm.js +7 -7
- package/dist/skeleton.cjs.js +7 -7
- package/dist/skeleton.esm.js +7 -7
- package/dist/slider.cjs.js +3 -3
- package/dist/slider.esm.js +3 -3
- package/dist/slot.cjs.js +3 -3
- package/dist/slot.esm.js +3 -3
- package/dist/sortable.cjs.js +41 -42
- package/dist/sortable.esm.js +98 -99
- package/dist/spinning-text.cjs.js +3 -3
- package/dist/spinning-text.esm.js +3 -3
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +1 -1
- package/dist/stepper.cjs.js +1 -1
- package/dist/stepper.esm.js +1 -1
- package/dist/switch.cjs.js +10 -12
- package/dist/switch.esm.js +10 -12
- package/dist/table.cjs.js +9 -6
- package/dist/table.esm.js +46 -43
- package/dist/tabs.cjs.js +20 -21
- package/dist/tabs.esm.js +70 -66
- package/dist/tags-input.cjs.js +9 -9
- package/dist/tags-input.esm.js +32 -25
- package/dist/textarea.cjs.js +10 -10
- package/dist/textarea.esm.js +30 -21
- package/dist/theme.d.ts +18 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +5 -5
- package/dist/time-field.esm.js +21 -18
- package/dist/time-picker.cjs.js +4 -4
- package/dist/time-picker.esm.js +5 -5
- package/dist/timeline.cjs.js +2 -2
- package/dist/timeline.esm.js +4 -4
- package/dist/toast.cjs.js +6 -6
- package/dist/toast.esm.js +13 -13
- package/dist/toggle-group.cjs.js +5 -6
- package/dist/toggle-group.esm.js +63 -60
- package/dist/toggle.cjs.js +18 -18
- package/dist/toggle.esm.js +32 -31
- package/dist/tooltip.cjs.js +4 -4
- package/dist/tooltip.esm.js +4 -4
- package/dist/transfer-list.cjs.js +3 -3
- package/dist/transfer-list.esm.js +3 -3
- package/dist/tree-7qbVnpGp.js +39 -0
- package/dist/{tree-B3kE8ESs.mjs → tree-Deoft-kO.mjs} +34 -33
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/trigger-BjnxLCeQ.mjs +9 -0
- package/dist/trigger-DkPsKxsP.js +1 -0
- package/dist/{ui-button-rXQOS9QJ.js → ui-button-BInsgSbr.js} +27 -26
- package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-rfiuUnUD.mjs} +65 -48
- package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-BSi_GtqO.mjs} +2 -2
- package/dist/{ui-icon-BzVNC_lr.js → ui-icon-Bvt9oIIR.js} +5 -5
- package/dist/wizard.cjs.js +12 -13
- package/dist/wizard.esm.js +17 -15
- package/package.json +1 -1
- package/dist/runtime-CTaOSmBj.js +0 -1
- package/dist/tree-Dx_kv_ih.js +0 -39
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import "./ui-icon-
|
|
3
|
-
const
|
|
1
|
+
import { E as D } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
import "./ui-icon-BSi_GtqO.mjs";
|
|
3
|
+
const P = `
|
|
4
4
|
:host {
|
|
5
5
|
--ui-btn-radius: var(--ui-control-radius, var(--ui-radius, 4px));
|
|
6
6
|
--ui-btn-min-height: var(--ui-control-min-height, var(--base-button-height-md, 40px));
|
|
@@ -19,7 +19,7 @@ const D = `
|
|
|
19
19
|
--ui-btn-surface: var(--ui-color-surface, #ffffff);
|
|
20
20
|
--ui-btn-surface-alt: var(--ui-color-surface-alt, #f8fafc);
|
|
21
21
|
--ui-btn-text: var(--ui-color-text, #0f172a);
|
|
22
|
-
--ui-btn-muted: var(--ui-color-muted, #
|
|
22
|
+
--ui-btn-muted: var(--ui-color-muted, #526175);
|
|
23
23
|
--ui-btn-ring: var(--ui-color-focus-ring, #2563eb);
|
|
24
24
|
|
|
25
25
|
display: inline-flex;
|
|
@@ -35,7 +35,7 @@ const D = `
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
:host([tone="neutral"]) {
|
|
38
|
-
--ui-btn-accent: color-mix(in srgb, var(--ui-color-muted, #
|
|
38
|
+
--ui-btn-accent: color-mix(in srgb, var(--ui-color-muted, #526175) 74%, var(--ui-color-text, #0f172a) 26%);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
:host([tone="info"]) {
|
|
@@ -43,11 +43,11 @@ const D = `
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
:host([tone="success"]) {
|
|
46
|
-
--ui-btn-accent: var(--ui-color-success, #
|
|
46
|
+
--ui-btn-accent: var(--ui-color-success, #15803d);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
:host([tone="warning"]) {
|
|
50
|
-
--ui-btn-accent: var(--ui-color-warning, #
|
|
50
|
+
--ui-btn-accent: var(--ui-color-warning, #b45309);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
:host([tone="danger"]) {
|
|
@@ -59,7 +59,7 @@ const D = `
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
:host([state="success"]) {
|
|
62
|
-
--ui-btn-accent: var(--ui-color-success, #
|
|
62
|
+
--ui-btn-accent: var(--ui-color-success, #15803d);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
:host([theme="dark"]) {
|
|
@@ -87,8 +87,8 @@ const D = `
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
:host([recipe="soft"]) {
|
|
90
|
-
--ui-btn-surface: color-mix(in srgb, var(--ui-btn-accent) 10%,
|
|
91
|
-
--ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 14%,
|
|
90
|
+
--ui-btn-surface: color-mix(in srgb, var(--ui-btn-accent) 10%, var(--ui-color-surface, #ffffff));
|
|
91
|
+
--ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 14%, var(--ui-color-surface, #ffffff));
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
:host([recipe="soft"]) .btn--secondary {
|
|
@@ -231,7 +231,8 @@ const D = `
|
|
|
231
231
|
|
|
232
232
|
.btn--primary {
|
|
233
233
|
background: var(--ui-btn-accent);
|
|
234
|
-
|
|
234
|
+
/* The theme's text colour for a primary fill: the default theme's amber needs dark text. */
|
|
235
|
+
color: var(--ui-color-foreground-on-primary, #ffffff);
|
|
235
236
|
border-color: color-mix(in srgb, var(--ui-btn-accent) 74%, #0f172a 26%);
|
|
236
237
|
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-btn-accent) 22%, transparent);
|
|
237
238
|
}
|
|
@@ -242,7 +243,7 @@ const D = `
|
|
|
242
243
|
|
|
243
244
|
.btn--secondary {
|
|
244
245
|
background: var(--ui-btn-surface);
|
|
245
|
-
color: color-mix(in srgb, var(--ui-btn-accent)
|
|
246
|
+
color: color-mix(in srgb, var(--ui-btn-accent) 50%, var(--ui-btn-text) 50%);
|
|
246
247
|
border-color: color-mix(in srgb, var(--ui-btn-accent) 22%, var(--ui-btn-muted));
|
|
247
248
|
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.06);
|
|
248
249
|
}
|
|
@@ -253,7 +254,7 @@ const D = `
|
|
|
253
254
|
|
|
254
255
|
.btn--ghost {
|
|
255
256
|
background: transparent;
|
|
256
|
-
color: color-mix(in srgb, var(--ui-btn-accent)
|
|
257
|
+
color: color-mix(in srgb, var(--ui-btn-accent) 50%, var(--ui-btn-text) 50%);
|
|
257
258
|
border-color: transparent;
|
|
258
259
|
box-shadow: none;
|
|
259
260
|
}
|
|
@@ -274,25 +275,25 @@ const D = `
|
|
|
274
275
|
}
|
|
275
276
|
|
|
276
277
|
.btn--success {
|
|
277
|
-
background: var(--ui-color-success, #
|
|
278
|
+
background: var(--ui-color-success, #15803d);
|
|
278
279
|
color: #ffffff;
|
|
279
|
-
border-color: color-mix(in srgb, var(--ui-color-success, #
|
|
280
|
-
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-success, #
|
|
280
|
+
border-color: color-mix(in srgb, var(--ui-color-success, #15803d) 70%, #0f172a 30%);
|
|
281
|
+
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-success, #15803d) 20%, transparent);
|
|
281
282
|
}
|
|
282
283
|
|
|
283
284
|
.btn--success:hover:not([disabled]) {
|
|
284
|
-
background: color-mix(in srgb, var(--ui-color-success, #
|
|
285
|
+
background: color-mix(in srgb, var(--ui-color-success, #15803d) 86%, #0f172a 14%);
|
|
285
286
|
}
|
|
286
287
|
|
|
287
288
|
.btn--warning {
|
|
288
|
-
background: var(--ui-color-warning, #
|
|
289
|
+
background: var(--ui-color-warning, #b45309);
|
|
289
290
|
color: #ffffff;
|
|
290
|
-
border-color: color-mix(in srgb, var(--ui-color-warning, #
|
|
291
|
-
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-warning, #
|
|
291
|
+
border-color: color-mix(in srgb, var(--ui-color-warning, #b45309) 70%, #0f172a 30%);
|
|
292
|
+
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-warning, #b45309) 18%, transparent);
|
|
292
293
|
}
|
|
293
294
|
|
|
294
295
|
.btn--warning:hover:not([disabled]) {
|
|
295
|
-
background: color-mix(in srgb, var(--ui-color-warning, #
|
|
296
|
+
background: color-mix(in srgb, var(--ui-color-warning, #b45309) 86%, #0f172a 14%);
|
|
296
297
|
}
|
|
297
298
|
|
|
298
299
|
:host([size="sm"]) {
|
|
@@ -320,7 +321,7 @@ const D = `
|
|
|
320
321
|
}
|
|
321
322
|
|
|
322
323
|
:host([state="success"]) .btn:not([disabled]) {
|
|
323
|
-
box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-success, #
|
|
324
|
+
box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-success, #15803d) 30%, transparent), 0 8px 18px rgba(22, 163, 74, 0.14);
|
|
324
325
|
}
|
|
325
326
|
|
|
326
327
|
:host([data-animation]) .btn:not([disabled]):hover {
|
|
@@ -504,22 +505,22 @@ const D = `
|
|
|
504
505
|
}
|
|
505
506
|
}
|
|
506
507
|
`;
|
|
507
|
-
function
|
|
508
|
+
function S(t) {
|
|
508
509
|
return t !== null && t.toLowerCase() !== "false" && t !== "0";
|
|
509
510
|
}
|
|
510
|
-
function
|
|
511
|
+
function U(t) {
|
|
511
512
|
return t === "secondary" || t === "ghost" || t === "danger" || t === "success" || t === "warning" ? t : "primary";
|
|
512
513
|
}
|
|
513
|
-
function
|
|
514
|
+
function I(t) {
|
|
514
515
|
return t === "sm" || t === "lg" ? t : "md";
|
|
515
516
|
}
|
|
516
|
-
function
|
|
517
|
+
function C(t) {
|
|
517
518
|
return t === "scale" || t === "pulse" || t === "none" ? t : null;
|
|
518
519
|
}
|
|
519
|
-
function
|
|
520
|
+
function N(t) {
|
|
520
521
|
return t === "neutral" || t === "info" || t === "success" || t === "warning" || t === "danger" ? t : null;
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
+
function W(t) {
|
|
523
524
|
return t === "loading" || t === "error" || t === "success" ? t : "idle";
|
|
524
525
|
}
|
|
525
526
|
function $(t) {
|
|
@@ -547,14 +548,14 @@ function r(t, n) {
|
|
|
547
548
|
}
|
|
548
549
|
function c(t, n) {
|
|
549
550
|
const e = t.getAttribute(n);
|
|
550
|
-
if (e != null) return
|
|
551
|
+
if (e != null) return S(e);
|
|
551
552
|
const i = t[n];
|
|
552
|
-
return typeof i == "boolean" ? i : typeof i == "string" ?
|
|
553
|
+
return typeof i == "boolean" ? i : typeof i == "string" ? S(i) : !1;
|
|
553
554
|
}
|
|
554
555
|
function u(t) {
|
|
555
556
|
return t.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
556
557
|
}
|
|
557
|
-
function
|
|
558
|
+
function E(t, n) {
|
|
558
559
|
return !!t.querySelector(`[slot="${n}"]`);
|
|
559
560
|
}
|
|
560
561
|
function V(t, n) {
|
|
@@ -572,7 +573,8 @@ function V(t, n) {
|
|
|
572
573
|
const i = new Event("submit", { bubbles: !0, cancelable: !0 });
|
|
573
574
|
e.dispatchEvent(i);
|
|
574
575
|
}
|
|
575
|
-
|
|
576
|
+
const T = ["aria-expanded", "aria-haspopup", "aria-pressed"];
|
|
577
|
+
class X extends D {
|
|
576
578
|
constructor() {
|
|
577
579
|
super(), this._slots = [], this._contentObserver = null, this._onRootClick = this._onRootClick.bind(this), this._onSlotChange = this._onSlotChange.bind(this), this._onContentMutations = this._onContentMutations.bind(this);
|
|
578
580
|
}
|
|
@@ -595,7 +597,10 @@ class W extends P {
|
|
|
595
597
|
"radius",
|
|
596
598
|
"scale",
|
|
597
599
|
"loading-label",
|
|
598
|
-
"aria-label"
|
|
600
|
+
"aria-label",
|
|
601
|
+
"aria-expanded",
|
|
602
|
+
"aria-haspopup",
|
|
603
|
+
"aria-pressed"
|
|
599
604
|
];
|
|
600
605
|
}
|
|
601
606
|
connectedCallback() {
|
|
@@ -607,12 +612,24 @@ class W extends P {
|
|
|
607
612
|
attributeChangedCallback(n, e, i) {
|
|
608
613
|
if (e !== i) {
|
|
609
614
|
if (n === "animation") {
|
|
610
|
-
const o =
|
|
615
|
+
const o = C(i);
|
|
611
616
|
o ? this.setAttribute("data-animation", o) : this.removeAttribute("data-animation");
|
|
612
617
|
}
|
|
618
|
+
if (T.includes(n)) {
|
|
619
|
+
this._syncForwardedState();
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
613
622
|
this.isConnected && this.requestRender();
|
|
614
623
|
}
|
|
615
624
|
}
|
|
625
|
+
_syncForwardedState() {
|
|
626
|
+
const n = this.root.querySelector('button[data-ui-button="true"]');
|
|
627
|
+
if (n)
|
|
628
|
+
for (const e of T) {
|
|
629
|
+
const i = this.getAttribute(e);
|
|
630
|
+
i == null || i === "" ? n.removeAttribute(e) : n.getAttribute(e) !== i && n.setAttribute(e, i);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
616
633
|
_onRootClick(n) {
|
|
617
634
|
const i = n.target?.closest('button[data-ui-button="true"]');
|
|
618
635
|
if (!i || i.disabled) return;
|
|
@@ -634,32 +651,32 @@ class W extends P {
|
|
|
634
651
|
this.requestRender();
|
|
635
652
|
}
|
|
636
653
|
render() {
|
|
637
|
-
const n = c(this, "disabled"), e = c(this, "loading"), i = r(this, "state"), o =
|
|
638
|
-
h ? this.setAttribute("data-animation", h) : this.removeAttribute("data-animation"),
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
const j =
|
|
654
|
+
const n = c(this, "disabled"), e = c(this, "loading"), i = r(this, "state"), o = W(i), s = e || o === "loading", l = r(this, "icon"), L = U(r(this, "variant")), b = r(this, "size"), d = I(b), h = C(r(this, "animation")), a = r(this, "theme"), p = a === "dark" || a === "brand" ? a : null, f = r(this, "tone"), g = N(f), R = c(this, "block"), q = c(this, "headless"), M = $(r(this, "type")), m = G(r(this, "recipe")), x = r(this, "shape"), v = J(x), B = r(this, "radius"), y = Q(B), w = K(r(this, "scale")), k = r(this, "aria-label"), O = r(this, "loading-label") || "Loading";
|
|
655
|
+
h ? this.setAttribute("data-animation", h) : this.removeAttribute("data-animation"), R ? this.setAttribute("block", "") : this.removeAttribute("block"), q ? this.setAttribute("headless", "") : this.removeAttribute("headless"), f != null && (g ? this.setAttribute("tone", g) : this.removeAttribute("tone")), b != null && (d === "md" ? this.removeAttribute("size") : this.setAttribute("size", d)), a != null && (p ? this.setAttribute("theme", p) : this.removeAttribute("theme")), i != null && (o === "idle" ? this.removeAttribute("state") : this.setAttribute("state", o)), m ? this.setAttribute("recipe", m) : this.removeAttribute("recipe"), x != null && (v ? this.setAttribute("shape", v) : this.removeAttribute("shape")), y ? this.style.setProperty("--ui-btn-radius", y) : this.style.removeProperty("--ui-btn-radius"), w ? this.setAttribute("scale", w) : this.removeAttribute("scale");
|
|
656
|
+
const A = n || s;
|
|
657
|
+
A ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled"), s ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
|
|
658
|
+
const j = E(this, "prefix"), F = E(this, "suffix"), z = !s && l ? `<ui-icon class="icon" name="${u(l)}" aria-hidden="true"></ui-icon>` : "", _ = s ? '<span class="spinner" aria-hidden="true" part="spinner"></span>' : "", H = _ || z || j ? `<span class="slot slot--prefix" part="prefix">${_}${z}${s ? "" : '<slot name="prefix"></slot>'}</span>` : "", Y = F ? '<span class="slot slot--suffix" part="suffix"><slot name="suffix"></slot></span>' : "";
|
|
642
659
|
this.setContent(`
|
|
643
|
-
<style>${
|
|
660
|
+
<style>${P}</style>
|
|
644
661
|
<button
|
|
645
|
-
class="btn btn--${
|
|
662
|
+
class="btn btn--${L}"
|
|
646
663
|
part="button"
|
|
647
664
|
type="button"
|
|
648
665
|
data-ui-button="true"
|
|
649
|
-
data-request-type="${
|
|
666
|
+
data-request-type="${M}"
|
|
650
667
|
aria-busy="${s ? "true" : "false"}"
|
|
651
668
|
${k ? `aria-label="${u(k)}"` : ""}
|
|
652
|
-
${
|
|
669
|
+
${A ? "disabled" : ""}
|
|
653
670
|
>
|
|
654
|
-
${
|
|
671
|
+
${H}
|
|
655
672
|
<span class="slot slot--label" part="label"><slot></slot></span>
|
|
656
673
|
${Y}
|
|
657
|
-
${s ? `<span class="sr-only">${u(
|
|
674
|
+
${s ? `<span class="sr-only">${u(O)}</span>` : ""}
|
|
658
675
|
</button>
|
|
659
|
-
`), this._attachSlotListeners();
|
|
676
|
+
`), this._syncForwardedState(), this._attachSlotListeners();
|
|
660
677
|
}
|
|
661
678
|
}
|
|
662
|
-
typeof customElements < "u" && !customElements.get("ui-button") && customElements.define("ui-button",
|
|
679
|
+
typeof customElements < "u" && !customElements.get("ui-button") && customElements.define("ui-button", X);
|
|
663
680
|
export {
|
|
664
|
-
|
|
681
|
+
X as U
|
|
665
682
|
};
|
|
@@ -189,8 +189,8 @@ const z = `
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
:host([tone="brand"]) { --ui-icon-color: var(--ui-color-primary, var(--ui-primary, #2563eb)); }
|
|
192
|
-
:host([tone="success"]) { --ui-icon-color: var(--ui-color-success, var(--ui-success, #
|
|
193
|
-
:host([tone="warning"]) { --ui-icon-color: var(--ui-color-warning, var(--ui-warning, #
|
|
192
|
+
:host([tone="success"]) { --ui-icon-color: var(--ui-color-success, var(--ui-success, #15803d)); }
|
|
193
|
+
:host([tone="warning"]) { --ui-icon-color: var(--ui-color-warning, var(--ui-warning, #b45309)); }
|
|
194
194
|
:host([tone="danger"]) { --ui-icon-color: var(--ui-color-danger, var(--ui-error, #dc2626)); }
|
|
195
195
|
|
|
196
196
|
:host([shape="square"]) { --ui-icon-radius: 4px; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const k=require("./ElementBase-EV6mVBUV.js"),l=require("@editora/icons"),a=new Map,d=new Map;function c(i){return String(i||"").trim().toLowerCase().replace(/\s+/g,"-").replace(/_/g,"-")}function y(i,e){if(!e)return`${i}::default`;const r=e.variant||"outline",t=e.iconWeight||"",n=e.secondaryColor||"",o=e.strokeWidth==null?"":String(e.strokeWidth),s=e.absoluteStrokeWidth?"1":"0",
|
|
1
|
+
"use strict";const k=require("./ElementBase-EV6mVBUV.js"),l=require("@editora/icons"),a=new Map,d=new Map;function c(i){return String(i||"").trim().toLowerCase().replace(/\s+/g,"-").replace(/_/g,"-")}function y(i,e){if(!e)return`${i}::default`;const r=e.variant||"outline",t=e.iconWeight||"",n=e.secondaryColor||"",o=e.strokeWidth==null?"":String(e.strokeWidth),s=e.absoluteStrokeWidth?"1":"0",g=e.strokeLinecap||"",f=e.strokeLinejoin||"",m=e.rotate==null?"":String(e.rotate),v=e.flip||"",x=e.rtl?"1":"0";return[i,r,t,n,o,s,g,f,m,v,x].join("::")}function z(i,e){const r=c(i);r&&a.set(r,e)}function w(i){const e=c(i);e&&a.delete(e)}function C(){a.clear()}function I(i){const e=c(i);return e?a.has(e)?!0:l.hasIcon(e):!1}function A(i,e){return u(i,{variant:e})}function u(i,e){const r=c(i);if(!r)return"";const t=a.get(r);if(t)return t;if(!l.hasIcon(r))return"";const n=y(r,e),o=d.get(n);if(o)return o;const s=l.renderIconSvg(r,{variant:e?.variant||"outline",iconWeight:e?.iconWeight,secondaryColor:e?.secondaryColor,strokeWidth:e?.strokeWidth,absoluteStrokeWidth:e?.absoluteStrokeWidth,strokeLinecap:e?.strokeLinecap,strokeLinejoin:e?.strokeLinejoin,rotate:e?.rotate,flip:e?.flip,rtl:e?.rtl,color:"currentColor",decorative:!0});return s&&d.set(n,s),s}const W=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-icon-size: 1em;
|
|
4
4
|
--ui-icon-color: currentColor;
|
|
@@ -124,8 +124,8 @@
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
:host([tone="brand"]) { --ui-icon-color: var(--ui-color-primary, var(--ui-primary, #2563eb)); }
|
|
127
|
-
:host([tone="success"]) { --ui-icon-color: var(--ui-color-success, var(--ui-success, #
|
|
128
|
-
:host([tone="warning"]) { --ui-icon-color: var(--ui-color-warning, var(--ui-warning, #
|
|
127
|
+
:host([tone="success"]) { --ui-icon-color: var(--ui-color-success, var(--ui-success, #15803d)); }
|
|
128
|
+
:host([tone="warning"]) { --ui-icon-color: var(--ui-color-warning, var(--ui-warning, #b45309)); }
|
|
129
129
|
:host([tone="danger"]) { --ui-icon-color: var(--ui-color-danger, var(--ui-error, #dc2626)); }
|
|
130
130
|
|
|
131
131
|
:host([shape="square"]) { --ui-icon-radius: 4px; }
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
border-color: Canvas;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
`;function h(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function S(i){if(!i)return null;const e=i.trim();return e?/^\d+(\.\d+)?$/.test(e)?`${e}px`:e:null}function p(i){if(!i)return;const e=Number(i);return Number.isFinite(e)?e:void 0}class
|
|
198
|
+
`;function h(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function S(i){if(!i)return null;const e=i.trim();return e?/^\d+(\.\d+)?$/.test(e)?`${e}px`:e:null}function p(i){if(!i)return;const e=Number(i);return Number.isFinite(e)?e:void 0}class b extends k.ElementBase{constructor(){super(),this._lastName=""}static get observedAttributes(){return["name","size","color","variant","icon-variant","icon-weight","secondary-color","tone","shape","spin","pulse","badge","label","decorative","stroke-width","absolute-stroke-width","stroke-linecap","stroke-linejoin","rotate","flip","rtl","headless"]}_syncDynamicVars(){const e=S(this.getAttribute("size"));e?this.style.setProperty("--ui-icon-size",e):this.style.removeProperty("--ui-icon-size");const r=this.getAttribute("color");r?this.style.setProperty("--ui-icon-color",r):this.style.removeProperty("--ui-icon-color");const t=this.getAttribute("stroke-width");t?this.style.setProperty("--ui-icon-stroke-width",t):this.style.removeProperty("--ui-icon-stroke-width")}render(){if(this._syncDynamicVars(),this.hasAttribute("headless")){this.setContent("<style></style><slot></slot>");return}const e=this.getAttribute("name")||"",r=this.getAttribute("label")||"",t=this.hasAttribute("decorative"),n=e?u(e,{variant:this.getAttribute("icon-variant")||void 0,iconWeight:this.getAttribute("icon-weight")||void 0,secondaryColor:this.getAttribute("secondary-color")||void 0,strokeWidth:p(this.getAttribute("stroke-width")),absoluteStrokeWidth:this.hasAttribute("absolute-stroke-width"),strokeLinecap:this.getAttribute("stroke-linecap")||void 0,strokeLinejoin:this.getAttribute("stroke-linejoin")||void 0,rotate:p(this.getAttribute("rotate")),flip:this.getAttribute("flip")||void 0,rtl:this.hasAttribute("rtl")}):"",o=!!n,s=t?'aria-hidden="true" role="presentation"':`role="img" aria-label="${h(r||e||"icon")}"`;this.setContent(`
|
|
199
199
|
<style>${W}</style>
|
|
200
200
|
<span class="icon" part="icon" ${s}>
|
|
201
201
|
<span class="glyph" part="glyph">
|
|
@@ -204,4 +204,4 @@
|
|
|
204
204
|
</span>
|
|
205
205
|
${this.hasAttribute("badge")?'<span class="badge" part="badge" aria-hidden="true"></span>':""}
|
|
206
206
|
</span>
|
|
207
|
-
`),e!==this._lastName&&(this.dispatchEvent(new CustomEvent("iconchange",{detail:{name:e,found:o},bubbles:!0})),this._lastName=e)}shouldRenderOnAttributeChange(e,r,t){return!0}}typeof customElements<"u"&&!customElements.get("ui-icon")&&customElements.define("ui-icon",
|
|
207
|
+
`),e!==this._lastName&&(this.dispatchEvent(new CustomEvent("iconchange",{detail:{name:e,found:o},bubbles:!0})),this._lastName=e)}shouldRenderOnAttributeChange(e,r,t){return!0}}typeof customElements<"u"&&!customElements.get("ui-icon")&&customElements.define("ui-icon",b);exports.UIIcon=b;exports.clearCustomIcons=C;exports.getIcon=u;exports.getIconVariant=A;exports.hasIcon=I;exports.registerIcon=z;exports.unregisterIcon=w;
|
package/dist/wizard.cjs.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("./ElementBase-EV6mVBUV.js")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("./ElementBase-EV6mVBUV.js"),C=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-wizard-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
4
4
|
--ui-wizard-surface: color-mix(in srgb, var(--ui-color-surface, #ffffff) 99%, transparent);
|
|
5
5
|
--ui-wizard-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
|
|
6
6
|
--ui-wizard-text: var(--ui-color-text, #0f172a);
|
|
7
|
-
--ui-wizard-muted: var(--ui-color-muted, #
|
|
7
|
+
--ui-wizard-muted: var(--ui-color-muted, #526175);
|
|
8
8
|
--ui-wizard-accent: var(--ui-color-primary, #2563eb);
|
|
9
9
|
--ui-wizard-focus: var(--ui-color-focus-ring, #2563eb);
|
|
10
|
-
--ui-wizard-success: var(--ui-color-success, #
|
|
11
|
-
--ui-wizard-warning: var(--ui-color-warning, #
|
|
10
|
+
--ui-wizard-success: var(--ui-color-success, #15803d);
|
|
11
|
+
--ui-wizard-warning: var(--ui-color-warning, #b45309);
|
|
12
12
|
--ui-wizard-danger: var(--ui-color-danger, #dc2626);
|
|
13
13
|
|
|
14
14
|
--ui-wizard-radius: 14px;
|
|
@@ -608,7 +608,7 @@
|
|
|
608
608
|
color: Highlight;
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
`;function c(g){return g.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function v(g){if(g==null)return!1;const t=String(g).toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}let C=0;class w extends k.ElementBase{constructor(){super(),this._observer=null,this._instanceId=++C,this._isSyncingValueAttribute=!1,this._visited=new Set,this._lastDirection="none",this._stepButtons=[],this._progressEl=null,this._progressRow=null,this._statusStepEl=null,this._statusValueEl=null,this._prevBtn=null,this._nextBtn=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["value","linear","show-stepper","stepper-position","hide-controls","variant","headless","keep-mounted","lazy-mount","animate","next-label","prev-label","finish-label","aria-label","orientation","density","shape","show-progress","busy","title","description","empty-label"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this._observer=new MutationObserver(t=>{t.some(i=>{if(i.type==="childList")return i.target===this;if(i.type!=="attributes")return!1;const a=i.target,r=i.attributeName||"";if(r==="slot")return a.getAttribute("slot")==="step"||a.matches('[slot="step"]');const o=a.closest('[slot="step"]');return!o||a!==o?!1:r==="data-value"||r==="data-title"||r==="data-description"||r==="data-optional"||r==="data-disabled"||r==="data-state"||r==="data-invalid"||r==="disabled"||r==="invalid"})&&this.requestRender()}),this._observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot","data-value","data-title","data-description","data-optional","data-disabled","data-state","data-invalid","disabled","invalid"]})}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this._observer&&(this._observer.disconnect(),this._observer=null),super.disconnectedCallback()}attributeChangedCallback(t,e,i){if(e!==i){if(t==="value"){this._isSyncingValueAttribute||this._syncValueUi();return}this.isConnected&&this.requestRender()}}get value(){return this.getAttribute("value")||""}set value(t){const e=String(t||"");e?this.setAttribute("value",e):this.removeAttribute("value")}_isBusy(){return v(this.getAttribute("busy"))||this.hasAttribute("busy")}_isAnimationEnabled(){const t=this.getAttribute("animate");return t==null?!0:v(t)||t===""}_steps(){return Array.from(this.children).filter(e=>e instanceof HTMLElement&&e.getAttribute("slot")==="step").map((e,i)=>{const a=(e.getAttribute("data-state")||"").trim().toLowerCase(),r=a==="complete"||a==="success"||a==="warning"||a==="error"?a:"default";return{index:i,value:e.getAttribute("data-value")||String(i+1),title:e.getAttribute("data-title")||e.getAttribute("title")||`Step ${i+1}`,description:e.getAttribute("data-description")||"",optional:v(e.getAttribute("data-optional")),disabled:e.hasAttribute("disabled")||v(e.getAttribute("data-disabled")),state:r,node:e}})}_tabId(t){return`ui-wizard-${this._instanceId}-tab-${t}`}_panelId(t){return`ui-wizard-${this._instanceId}-panel-${t}`}_activeIndex(t){if(!t.length)return-1;const e=this.getAttribute("value")||"";if(e){const a=t.findIndex(r=>r.value===e);if(a>=0)return a}const i=t.find(a=>!a.disabled)||t[0];return i&&this.getAttribute("value")!==i.value&&this.setAttribute("value",i.value),t.findIndex(a=>a.value===i.value)}_visualStatus(t,e,i){return t.state==="error"?"error":t.state==="warning"?"warning":t.state==="success"?"success":t.state==="complete"||e<i?"complete":e===i?"current":"upcoming"}_markVisited(t,e){const i=t[e];i&&this._visited.add(i.value)}_dispatchBlockedNext(t,e,i,a){const r=e[i],o=e[a];this.dispatchEvent(new CustomEvent("blocked-next",{detail:{reason:t,currentIndex:i,nextIndex:a,currentValue:r?.value||"",nextValue:o?.value||""},bubbles:!0,composed:!0}))}_isStepInvalid(t,e){if(!t||t.node.hasAttribute("invalid")||v(t.node.getAttribute("data-invalid")))return!0;const i=new CustomEvent("validate-step",{detail:{index:e,value:t.value,title:t.title,node:t.node},bubbles:!0,composed:!0,cancelable:!0});return!this.dispatchEvent(i)}validateCurrentStep(){const t=this._steps();if(!t.length)return!1;const e=this._activeIndex(t);return e<0?!1:!this._isStepInvalid(t[e],e)}_syncPanels(t,e){const i=this.hasAttribute("keep-mounted"),a=this._isAnimationEnabled();this._markVisited(t,e),t.forEach((r,o)=>{const s=o===e,n=this._panelId(o),l=this._tabId(o),d=this._visited.has(r.value);r.node.id=n,r.node.setAttribute("role","tabpanel"),r.node.setAttribute("aria-labelledby",l),r.node.setAttribute("tabindex",s?"0":"-1"),r.node.setAttribute("data-active",s?"true":"false"),r.node.setAttribute("aria-hidden",s?"false":"true"),r.node.setAttribute("data-keep-mounted",i?"true":"false"),r.node.setAttribute("data-visible",s?"true":"false"),r.node.setAttribute("data-visited",d?"true":"false"),r.node.setAttribute("data-nav-direction",a?this._lastDirection:"none"),i?r.node.hidden=!1:r.node.hidden=!s})}_attemptChange(t,e,i,a){if(this._isBusy())return this._dispatchBlockedNext("busy",t,e,i),!1;if(i===e)return!0;if(i<0||i>=t.length)return this._dispatchBlockedNext("bounds",t,e,i),!1;const r=t[i];if(!r||r.disabled)return this._dispatchBlockedNext("disabled",t,e,i),!1;if(this.hasAttribute("linear")&&i>e+1)return this._dispatchBlockedNext("linear",t,e,i),!1;const o=t[e],s=i>e;if(s&&o&&this._isStepInvalid(o,e))return this._dispatchBlockedNext("validation",t,e,i),!1;const n=new CustomEvent("before-change",{detail:{currentIndex:e,nextIndex:i,currentValue:o?.value||"",nextValue:r.value,trigger:a},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(n))return!1;this._lastDirection=s?"forward":"backward",this.value=r.value;const l={index:i,value:r.value,title:r.title,trigger:a};return this.dispatchEvent(new CustomEvent("input",{detail:l,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:l,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("step-change",{detail:l,bubbles:!0,composed:!0})),!0}goTo(t){const e=this._steps();if(!e.length)return!1;const i=this._activeIndex(e),a=typeof t=="number"?t:e.findIndex(r=>r.value===String(t));return this._attemptChange(e,i,a,"api")}next(){const t=this._steps();if(!t.length)return!1;const e=this._activeIndex(t);if(e>=t.length-1){if(this._isBusy())return!1;const i={index:e,value:t[e]?.value||"",title:t[e]?.title||""};return this.dispatchEvent(new CustomEvent("complete",{detail:i,bubbles:!0,composed:!0})),!0}return this._attemptChange(t,e,e+1,"next")}prev(){const t=this._steps();if(!t.length)return!1;const e=this._activeIndex(t);return this._attemptChange(t,e,e-1,"prev")}_onClick(t){const e=t.target;if(!e)return;if(e.closest(".btn-prev")){this.prev();return}if(e.closest(".btn-next")){this.next();return}const i=e.closest(".step");if(!i)return;const a=Number(i.getAttribute("data-index"));if(!Number.isInteger(a))return;const r=this._steps(),o=this._activeIndex(r);this._attemptChange(r,o,a,"stepper")}_onKeyDown(t){const e=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",i=e==="horizontal"&&getComputedStyle(this).direction==="rtl",a=e==="vertical"?"ArrowDown":i?"ArrowLeft":"ArrowRight",r=e==="vertical"?"ArrowUp":i?"ArrowRight":"ArrowLeft";if(t.altKey&&t.key===a){t.preventDefault(),this.next();return}if(t.altKey&&t.key===r){t.preventDefault(),this.prev();return}const s=t.target?.closest(".step");if(!s)return;const n=this._stepButtons.filter(d=>!d.disabled);if(!n.length)return;const l=n.indexOf(s);if(!(l<0)){if(t.key===a){t.preventDefault(),n[(l+1)%n.length].focus();return}if(t.key===r){t.preventDefault(),n[(l-1+n.length)%n.length].focus();return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),(t.key==="Home"?n[0]:n[n.length-1]).focus();return}(t.key===" "||t.key==="Enter")&&(t.preventDefault(),s.click())}}_syncValueUi(){if(!this.isConnected)return;if(!this.root.querySelector(".frame")){this.requestRender();return}const t=this._steps();if(!t.length)return;this._isSyncingValueAttribute=!0;let e=-1;try{e=this._activeIndex(t)}finally{this._isSyncingValueAttribute=!1}this._syncPanels(t,e),this._stepButtons.forEach((s,n)=>{const l=n===e,d=this._visualStatus(t[n],n,e);s.setAttribute("data-active",l?"true":"false"),s.setAttribute("data-status",d),s.setAttribute("aria-selected",l?"true":"false"),s.setAttribute("tabindex",l?"0":"-1");const p=s.querySelector(".step-badge");p&&(d==="complete"||d==="success"?p.textContent="✓":d==="warning"?p.textContent="!":d==="error"?p.textContent="×":p.textContent=String(n+1));const h=s.closest(".step-item");h&&(h.setAttribute("data-status",d),h.setAttribute("data-complete",n<e?"true":"false"),h.setAttribute("data-current",l?"true":"false"))});const i=t.length,a=i<=1||e<0?0:Math.round(e/(i-1)*100);this._progressEl&&this._progressEl.style.setProperty("--ui-wizard-progress",`${a}%`),this._statusStepEl&&(this._statusStepEl.textContent=`Step ${Math.max(1,e+1)} of ${i}`),this._statusValueEl&&(this._statusValueEl.textContent=`${a}%`);const r=this._isBusy();if(this._prevBtn&&(this._prevBtn.disabled=e<=0||r),this._nextBtn){const s=e>=i-1,n=this.getAttribute("next-label")||"Next",l=this.getAttribute("finish-label")||"Finish";this._nextBtn.textContent=s?l:n,this._nextBtn.setAttribute("data-loading",r?"true":"false"),this._nextBtn.disabled=r||e<0||t[e]?.disabled===!0}const o=this.root.querySelector(".frame");o&&o.setAttribute("aria-busy",r?"true":"false"),this._progressRow&&(this.getAttribute("show-progress")!=="false"&&i>0?this._progressRow.removeAttribute("hidden"):this._progressRow.setAttribute("hidden",""))}render(){const t=this._steps(),e=this._activeIndex(t);this._markVisited(t,e),this._syncPanels(t,e);const i=this.getAttribute("title")||"",a=this.getAttribute("description")||"",r=this.getAttribute("show-stepper")!=="false"&&t.length>0,o=this.getAttribute("show-progress")!=="false"&&t.length>0,s=this.getAttribute("stepper-position")==="bottom"?"bottom":"top",n=this.hasAttribute("hide-controls")||t.length===0,l=this.getAttribute("prev-label")||"Previous",d=this.getAttribute("next-label")||"Next",p=this.getAttribute("finish-label")||"Finish",h=this.getAttribute("empty-label")||'No wizard steps configured. Add elements with slot="step".',m=r?`
|
|
611
|
+
`;function c(g){return g.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function v(g){if(g==null)return!1;const t=String(g).toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}let $=0;const w="data-ui-wizard-auto-label";class x extends k.ElementBase{constructor(){super(),this._observer=null,this._instanceId=++$,this._isSyncingValueAttribute=!1,this._visited=new Set,this._lastDirection="none",this._stepButtons=[],this._progressEl=null,this._progressRow=null,this._statusStepEl=null,this._statusValueEl=null,this._prevBtn=null,this._nextBtn=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["value","linear","show-stepper","stepper-position","hide-controls","variant","headless","keep-mounted","lazy-mount","animate","next-label","prev-label","finish-label","aria-label","orientation","density","shape","show-progress","busy","title","description","empty-label"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this._observer=new MutationObserver(t=>{t.some(i=>{if(i.type==="childList")return i.target===this;if(i.type!=="attributes")return!1;const a=i.target,r=i.attributeName||"";if(r==="slot")return a.getAttribute("slot")==="step"||a.matches('[slot="step"]');const o=a.closest('[slot="step"]');return!o||a!==o?!1:r==="data-value"||r==="data-title"||r==="data-description"||r==="data-optional"||r==="data-disabled"||r==="data-state"||r==="data-invalid"||r==="disabled"||r==="invalid"})&&this.requestRender()}),this._observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot","data-value","data-title","data-description","data-optional","data-disabled","data-state","data-invalid","disabled","invalid"]})}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this._observer&&(this._observer.disconnect(),this._observer=null),super.disconnectedCallback()}attributeChangedCallback(t,e,i){if(e!==i){if(t==="value"){this._isSyncingValueAttribute||this._syncValueUi();return}this.isConnected&&this.requestRender()}}get value(){return this.getAttribute("value")||""}set value(t){const e=String(t||"");e?this.setAttribute("value",e):this.removeAttribute("value")}_isBusy(){return v(this.getAttribute("busy"))||this.hasAttribute("busy")}_isAnimationEnabled(){const t=this.getAttribute("animate");return t==null?!0:v(t)||t===""}_steps(){return Array.from(this.children).filter(e=>e instanceof HTMLElement&&e.getAttribute("slot")==="step").map((e,i)=>{const a=(e.getAttribute("data-state")||"").trim().toLowerCase(),r=a==="complete"||a==="success"||a==="warning"||a==="error"?a:"default";return{index:i,value:e.getAttribute("data-value")||String(i+1),title:e.getAttribute("data-title")||e.getAttribute("title")||`Step ${i+1}`,description:e.getAttribute("data-description")||"",optional:v(e.getAttribute("data-optional")),disabled:e.hasAttribute("disabled")||v(e.getAttribute("data-disabled")),state:r,node:e}})}_tabId(t){return`ui-wizard-${this._instanceId}-tab-${t}`}_panelId(t){return`ui-wizard-${this._instanceId}-panel-${t}`}_activeIndex(t){if(!t.length)return-1;const e=this.getAttribute("value")||"";if(e){const a=t.findIndex(r=>r.value===e);if(a>=0)return a}const i=t.find(a=>!a.disabled)||t[0];return i&&this.getAttribute("value")!==i.value&&this.setAttribute("value",i.value),t.findIndex(a=>a.value===i.value)}_visualStatus(t,e,i){return t.state==="error"?"error":t.state==="warning"?"warning":t.state==="success"?"success":t.state==="complete"||e<i?"complete":e===i?"current":"upcoming"}_markVisited(t,e){const i=t[e];i&&this._visited.add(i.value)}_dispatchBlockedNext(t,e,i,a){const r=e[i],o=e[a];this.dispatchEvent(new CustomEvent("blocked-next",{detail:{reason:t,currentIndex:i,nextIndex:a,currentValue:r?.value||"",nextValue:o?.value||""},bubbles:!0,composed:!0}))}_isStepInvalid(t,e){if(!t||t.node.hasAttribute("invalid")||v(t.node.getAttribute("data-invalid")))return!0;const i=new CustomEvent("validate-step",{detail:{index:e,value:t.value,title:t.title,node:t.node},bubbles:!0,composed:!0,cancelable:!0});return!this.dispatchEvent(i)}validateCurrentStep(){const t=this._steps();if(!t.length)return!1;const e=this._activeIndex(t);return e<0?!1:!this._isStepInvalid(t[e],e)}_syncPanels(t,e){const i=this.hasAttribute("keep-mounted"),a=this._isAnimationEnabled();this._markVisited(t,e),t.forEach((r,o)=>{const s=o===e,n=this._panelId(o),l=this._tabId(o),d=this._visited.has(r.value);r.node.id=n,r.node.setAttribute("role","tabpanel"),r.node.getAttribute("aria-labelledby")===l&&r.node.removeAttribute("aria-labelledby"),!(r.node.hasAttribute("aria-labelledby")||r.node.hasAttribute("aria-label")&&!r.node.hasAttribute(w))&&r.title&&(r.node.setAttribute("aria-label",r.title),r.node.setAttribute(w,"")),r.node.setAttribute("tabindex",s?"0":"-1"),r.node.setAttribute("data-active",s?"true":"false"),r.node.setAttribute("aria-hidden",s?"false":"true"),r.node.setAttribute("data-keep-mounted",i?"true":"false"),r.node.setAttribute("data-visible",s?"true":"false"),r.node.setAttribute("data-visited",d?"true":"false"),r.node.setAttribute("data-nav-direction",a?this._lastDirection:"none"),i?r.node.hidden=!1:r.node.hidden=!s})}_attemptChange(t,e,i,a){if(this._isBusy())return this._dispatchBlockedNext("busy",t,e,i),!1;if(i===e)return!0;if(i<0||i>=t.length)return this._dispatchBlockedNext("bounds",t,e,i),!1;const r=t[i];if(!r||r.disabled)return this._dispatchBlockedNext("disabled",t,e,i),!1;if(this.hasAttribute("linear")&&i>e+1)return this._dispatchBlockedNext("linear",t,e,i),!1;const o=t[e],s=i>e;if(s&&o&&this._isStepInvalid(o,e))return this._dispatchBlockedNext("validation",t,e,i),!1;const n=new CustomEvent("before-change",{detail:{currentIndex:e,nextIndex:i,currentValue:o?.value||"",nextValue:r.value,trigger:a},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(n))return!1;this._lastDirection=s?"forward":"backward",this.value=r.value;const l={index:i,value:r.value,title:r.title,trigger:a};return this.dispatchEvent(new CustomEvent("input",{detail:l,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:l,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("step-change",{detail:l,bubbles:!0,composed:!0})),!0}goTo(t){const e=this._steps();if(!e.length)return!1;const i=this._activeIndex(e),a=typeof t=="number"?t:e.findIndex(r=>r.value===String(t));return this._attemptChange(e,i,a,"api")}next(){const t=this._steps();if(!t.length)return!1;const e=this._activeIndex(t);if(e>=t.length-1){if(this._isBusy())return!1;const i={index:e,value:t[e]?.value||"",title:t[e]?.title||""};return this.dispatchEvent(new CustomEvent("complete",{detail:i,bubbles:!0,composed:!0})),!0}return this._attemptChange(t,e,e+1,"next")}prev(){const t=this._steps();if(!t.length)return!1;const e=this._activeIndex(t);return this._attemptChange(t,e,e-1,"prev")}_onClick(t){const e=t.target;if(!e)return;if(e.closest(".btn-prev")){this.prev();return}if(e.closest(".btn-next")){this.next();return}const i=e.closest(".step");if(!i)return;const a=Number(i.getAttribute("data-index"));if(!Number.isInteger(a))return;const r=this._steps(),o=this._activeIndex(r);this._attemptChange(r,o,a,"stepper")}_onKeyDown(t){const e=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",i=e==="horizontal"&&getComputedStyle(this).direction==="rtl",a=e==="vertical"?"ArrowDown":i?"ArrowLeft":"ArrowRight",r=e==="vertical"?"ArrowUp":i?"ArrowRight":"ArrowLeft";if(t.altKey&&t.key===a){t.preventDefault(),this.next();return}if(t.altKey&&t.key===r){t.preventDefault(),this.prev();return}const s=t.target?.closest(".step");if(!s)return;const n=this._stepButtons.filter(d=>!d.disabled);if(!n.length)return;const l=n.indexOf(s);if(!(l<0)){if(t.key===a){t.preventDefault(),n[(l+1)%n.length].focus();return}if(t.key===r){t.preventDefault(),n[(l-1+n.length)%n.length].focus();return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),(t.key==="Home"?n[0]:n[n.length-1]).focus();return}(t.key===" "||t.key==="Enter")&&(t.preventDefault(),s.click())}}_syncValueUi(){if(!this.isConnected)return;if(!this.root.querySelector(".frame")){this.requestRender();return}const t=this._steps();if(!t.length)return;this._isSyncingValueAttribute=!0;let e=-1;try{e=this._activeIndex(t)}finally{this._isSyncingValueAttribute=!1}this._syncPanels(t,e),this._stepButtons.forEach((s,n)=>{const l=n===e,d=this._visualStatus(t[n],n,e);s.setAttribute("data-active",l?"true":"false"),s.setAttribute("data-status",d),s.setAttribute("aria-selected",l?"true":"false"),s.setAttribute("tabindex",l?"0":"-1");const p=s.querySelector(".step-badge");p&&(d==="complete"||d==="success"?p.textContent="✓":d==="warning"?p.textContent="!":d==="error"?p.textContent="×":p.textContent=String(n+1));const h=s.closest(".step-item");h&&(h.setAttribute("data-status",d),h.setAttribute("data-complete",n<e?"true":"false"),h.setAttribute("data-current",l?"true":"false"))});const i=t.length,a=i<=1||e<0?0:Math.round(e/(i-1)*100);this._progressEl&&this._progressEl.style.setProperty("--ui-wizard-progress",`${a}%`),this._statusStepEl&&(this._statusStepEl.textContent=`Step ${Math.max(1,e+1)} of ${i}`),this._statusValueEl&&(this._statusValueEl.textContent=`${a}%`);const r=this._isBusy();if(this._prevBtn&&(this._prevBtn.disabled=e<=0||r),this._nextBtn){const s=e>=i-1,n=this.getAttribute("next-label")||"Next",l=this.getAttribute("finish-label")||"Finish";this._nextBtn.textContent=s?l:n,this._nextBtn.setAttribute("data-loading",r?"true":"false"),this._nextBtn.disabled=r||e<0||t[e]?.disabled===!0}const o=this.root.querySelector(".frame");o&&o.setAttribute("aria-busy",r?"true":"false"),this._progressRow&&(this.getAttribute("show-progress")!=="false"&&i>0?this._progressRow.removeAttribute("hidden"):this._progressRow.setAttribute("hidden",""))}render(){const t=this._steps(),e=this._activeIndex(t);this._markVisited(t,e),this._syncPanels(t,e);const i=this.getAttribute("title")||"",a=this.getAttribute("description")||"",r=this.getAttribute("show-stepper")!=="false"&&t.length>0,o=this.getAttribute("show-progress")!=="false"&&t.length>0,s=this.getAttribute("stepper-position")==="bottom"?"bottom":"top",n=this.hasAttribute("hide-controls")||t.length===0,l=this.getAttribute("prev-label")||"Previous",d=this.getAttribute("next-label")||"Next",p=this.getAttribute("finish-label")||"Finish",h=this.getAttribute("empty-label")||'No wizard steps configured. Add elements with slot="step".',m=r?`
|
|
612
612
|
<div
|
|
613
613
|
class="stepper"
|
|
614
614
|
part="stepper"
|
|
@@ -616,15 +616,14 @@
|
|
|
616
616
|
aria-orientation="${this.getAttribute("orientation")==="vertical"?"vertical":"horizontal"}"
|
|
617
617
|
aria-label="${c(this.getAttribute("aria-label")||"Wizard steps")}"
|
|
618
618
|
>
|
|
619
|
-
${t.map((b,u)=>{const f=this._visualStatus(b,u,e),
|
|
619
|
+
${t.map((b,u)=>{const f=this._visualStatus(b,u,e),_=this._tabId(u);this._panelId(u);const A=f==="complete"||f==="success"?"✓":f==="warning"?"!":f==="error"?"×":String(u+1);return`
|
|
620
620
|
<div class="step-item" part="step-item" data-index="${u}" data-last="${u===t.length-1?"true":"false"}" data-status="${f}" data-complete="${u<e?"true":"false"}" data-current="${u===e?"true":"false"}">
|
|
621
621
|
<button
|
|
622
622
|
type="button"
|
|
623
623
|
class="step"
|
|
624
624
|
part="step"
|
|
625
|
-
id="${
|
|
625
|
+
id="${_}"
|
|
626
626
|
role="tab"
|
|
627
|
-
aria-controls="${_}"
|
|
628
627
|
data-index="${u}"
|
|
629
628
|
data-active="${u===e?"true":"false"}"
|
|
630
629
|
data-status="${f}"
|
|
@@ -642,8 +641,8 @@
|
|
|
642
641
|
</div>
|
|
643
642
|
`}).join("")}
|
|
644
643
|
</div>
|
|
645
|
-
`:'<div class="stepper" hidden></div>',
|
|
646
|
-
<style>${
|
|
644
|
+
`:'<div class="stepper" hidden></div>',z=e<=0,y=e>=t.length-1;this.setContent(`
|
|
645
|
+
<style>${C}</style>
|
|
647
646
|
<section class="frame" part="frame" role="group" aria-label="${c(this.getAttribute("aria-label")||"Wizard")}" aria-busy="${this._isBusy()?"true":"false"}">
|
|
648
647
|
<h3 class="title" part="title" ${i?"":"hidden"}>${c(i)}</h3>
|
|
649
648
|
<p class="description" part="description" ${a?"":"hidden"}>${c(a)}</p>
|
|
@@ -668,10 +667,10 @@
|
|
|
668
667
|
<div class="controls" part="controls" ${n?"hidden":""}>
|
|
669
668
|
<div class="group" part="controls-start"><slot name="controls-start"></slot></div>
|
|
670
669
|
<div class="group" part="controls-end">
|
|
671
|
-
<button type="button" class="btn btn-prev" part="button-prev" ${
|
|
672
|
-
<button type="button" class="btn primary btn-next" part="button-next" data-loading="${this._isBusy()?"true":"false"}">${c(
|
|
670
|
+
<button type="button" class="btn btn-prev" part="button-prev" ${z?"disabled":""}>${c(l)}</button>
|
|
671
|
+
<button type="button" class="btn primary btn-next" part="button-next" data-loading="${this._isBusy()?"true":"false"}">${c(y?p:d)}</button>
|
|
673
672
|
<slot name="controls-end"></slot>
|
|
674
673
|
</div>
|
|
675
674
|
</div>
|
|
676
675
|
</section>
|
|
677
|
-
`),this._stepButtons=Array.from(this.root.querySelectorAll(".step")),this._progressEl=this.root.querySelector(".progress"),this._progressRow=this.root.querySelector(".status"),this._statusStepEl=this.root.querySelector(".status-step"),this._statusValueEl=this.root.querySelector(".status-value"),this._prevBtn=this.root.querySelector(".btn-prev"),this._nextBtn=this.root.querySelector(".btn-next"),this._syncValueUi()}}typeof customElements<"u"&&!customElements.get("ui-wizard")&&customElements.define("ui-wizard",
|
|
676
|
+
`),this._stepButtons=Array.from(this.root.querySelectorAll(".step")),this._progressEl=this.root.querySelector(".progress"),this._progressRow=this.root.querySelector(".status"),this._statusStepEl=this.root.querySelector(".status-step"),this._statusValueEl=this.root.querySelector(".status-value"),this._prevBtn=this.root.querySelector(".btn-prev"),this._nextBtn=this.root.querySelector(".btn-next"),this._syncValueUi()}}typeof customElements<"u"&&!customElements.get("ui-wizard")&&customElements.define("ui-wizard",x);exports.UIWizard=x;
|
package/dist/wizard.esm.js
CHANGED
|
@@ -5,11 +5,11 @@ const k = `
|
|
|
5
5
|
--ui-wizard-surface: color-mix(in srgb, var(--ui-color-surface, #ffffff) 99%, transparent);
|
|
6
6
|
--ui-wizard-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
|
|
7
7
|
--ui-wizard-text: var(--ui-color-text, #0f172a);
|
|
8
|
-
--ui-wizard-muted: var(--ui-color-muted, #
|
|
8
|
+
--ui-wizard-muted: var(--ui-color-muted, #526175);
|
|
9
9
|
--ui-wizard-accent: var(--ui-color-primary, #2563eb);
|
|
10
10
|
--ui-wizard-focus: var(--ui-color-focus-ring, #2563eb);
|
|
11
|
-
--ui-wizard-success: var(--ui-color-success, #
|
|
12
|
-
--ui-wizard-warning: var(--ui-color-warning, #
|
|
11
|
+
--ui-wizard-success: var(--ui-color-success, #15803d);
|
|
12
|
+
--ui-wizard-warning: var(--ui-color-warning, #b45309);
|
|
13
13
|
--ui-wizard-danger: var(--ui-color-danger, #dc2626);
|
|
14
14
|
|
|
15
15
|
--ui-wizard-radius: 14px;
|
|
@@ -618,10 +618,11 @@ function v(g) {
|
|
|
618
618
|
const t = String(g).toLowerCase();
|
|
619
619
|
return t !== "false" && t !== "0" && t !== "off";
|
|
620
620
|
}
|
|
621
|
-
let
|
|
622
|
-
|
|
621
|
+
let C = 0;
|
|
622
|
+
const w = "data-ui-wizard-auto-label";
|
|
623
|
+
class $ extends A {
|
|
623
624
|
constructor() {
|
|
624
|
-
super(), this._observer = null, this._instanceId =
|
|
625
|
+
super(), this._observer = null, this._instanceId = ++C, this._isSyncingValueAttribute = !1, this._visited = /* @__PURE__ */ new Set(), this._lastDirection = "none", this._stepButtons = [], this._progressEl = null, this._progressRow = null, this._statusStepEl = null, this._statusValueEl = null, this._prevBtn = null, this._nextBtn = null, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this);
|
|
625
626
|
}
|
|
626
627
|
static get observedAttributes() {
|
|
627
628
|
return [
|
|
@@ -787,7 +788,7 @@ class C extends A {
|
|
|
787
788
|
const i = this.hasAttribute("keep-mounted"), a = this._isAnimationEnabled();
|
|
788
789
|
this._markVisited(t, e), t.forEach((r, o) => {
|
|
789
790
|
const s = o === e, n = this._panelId(o), l = this._tabId(o), d = this._visited.has(r.value);
|
|
790
|
-
r.node.id = n, r.node.setAttribute("role", "tabpanel"), r.node.
|
|
791
|
+
r.node.id = n, r.node.setAttribute("role", "tabpanel"), r.node.getAttribute("aria-labelledby") === l && r.node.removeAttribute("aria-labelledby"), !(r.node.hasAttribute("aria-labelledby") || r.node.hasAttribute("aria-label") && !r.node.hasAttribute(w)) && r.title && (r.node.setAttribute("aria-label", r.title), r.node.setAttribute(w, "")), r.node.setAttribute("tabindex", s ? "0" : "-1"), r.node.setAttribute("data-active", s ? "true" : "false"), r.node.setAttribute("aria-hidden", s ? "false" : "true"), r.node.setAttribute(
|
|
791
792
|
"data-keep-mounted",
|
|
792
793
|
i ? "true" : "false"
|
|
793
794
|
), r.node.setAttribute("data-visible", s ? "true" : "false"), r.node.setAttribute("data-visited", d ? "true" : "false"), r.node.setAttribute(
|
|
@@ -964,16 +965,17 @@ class C extends A {
|
|
|
964
965
|
aria-label="${c(this.getAttribute("aria-label") || "Wizard steps")}"
|
|
965
966
|
>
|
|
966
967
|
${t.map((b, u) => {
|
|
967
|
-
const f = this._visualStatus(b, u, e),
|
|
968
|
+
const f = this._visualStatus(b, u, e), y = this._tabId(u);
|
|
969
|
+
this._panelId(u);
|
|
970
|
+
const _ = f === "complete" || f === "success" ? "✓" : f === "warning" ? "!" : f === "error" ? "×" : String(u + 1);
|
|
968
971
|
return `
|
|
969
972
|
<div class="step-item" part="step-item" data-index="${u}" data-last="${u === t.length - 1 ? "true" : "false"}" data-status="${f}" data-complete="${u < e ? "true" : "false"}" data-current="${u === e ? "true" : "false"}">
|
|
970
973
|
<button
|
|
971
974
|
type="button"
|
|
972
975
|
class="step"
|
|
973
976
|
part="step"
|
|
974
|
-
id="${
|
|
977
|
+
id="${y}"
|
|
975
978
|
role="tab"
|
|
976
|
-
aria-controls="${y}"
|
|
977
979
|
data-index="${u}"
|
|
978
980
|
data-active="${u === e ? "true" : "false"}"
|
|
979
981
|
data-status="${f}"
|
|
@@ -992,7 +994,7 @@ class C extends A {
|
|
|
992
994
|
`;
|
|
993
995
|
}).join("")}
|
|
994
996
|
</div>
|
|
995
|
-
` : '<div class="stepper" hidden></div>',
|
|
997
|
+
` : '<div class="stepper" hidden></div>', x = e <= 0, z = e >= t.length - 1;
|
|
996
998
|
this.setContent(`
|
|
997
999
|
<style>${k}</style>
|
|
998
1000
|
<section class="frame" part="frame" role="group" aria-label="${c(this.getAttribute("aria-label") || "Wizard")}" aria-busy="${this._isBusy() ? "true" : "false"}">
|
|
@@ -1019,8 +1021,8 @@ class C extends A {
|
|
|
1019
1021
|
<div class="controls" part="controls" ${n ? "hidden" : ""}>
|
|
1020
1022
|
<div class="group" part="controls-start"><slot name="controls-start"></slot></div>
|
|
1021
1023
|
<div class="group" part="controls-end">
|
|
1022
|
-
<button type="button" class="btn btn-prev" part="button-prev" ${
|
|
1023
|
-
<button type="button" class="btn primary btn-next" part="button-next" data-loading="${this._isBusy() ? "true" : "false"}">${c(
|
|
1024
|
+
<button type="button" class="btn btn-prev" part="button-prev" ${x ? "disabled" : ""}>${c(l)}</button>
|
|
1025
|
+
<button type="button" class="btn primary btn-next" part="button-next" data-loading="${this._isBusy() ? "true" : "false"}">${c(z ? p : d)}</button>
|
|
1024
1026
|
<slot name="controls-end"></slot>
|
|
1025
1027
|
</div>
|
|
1026
1028
|
</div>
|
|
@@ -1042,7 +1044,7 @@ class C extends A {
|
|
|
1042
1044
|
), this._syncValueUi();
|
|
1043
1045
|
}
|
|
1044
1046
|
}
|
|
1045
|
-
typeof customElements < "u" && !customElements.get("ui-wizard") && customElements.define("ui-wizard",
|
|
1047
|
+
typeof customElements < "u" && !customElements.get("ui-wizard") && customElements.define("ui-wizard", $);
|
|
1046
1048
|
export {
|
|
1047
|
-
|
|
1049
|
+
$ as UIWizard
|
|
1048
1050
|
};
|
package/package.json
CHANGED