@editora/ui-core 0.1.25 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +132 -0
- package/dist/accordion.cjs.js +13 -12
- package/dist/accordion.esm.js +13 -12
- package/dist/alert-dialog.cjs.js +92 -53
- package/dist/alert-dialog.esm.js +211 -159
- package/dist/alert.cjs.js +42 -33
- package/dist/alert.esm.js +80 -71
- package/dist/animated-beam.cjs.js +42 -50
- package/dist/animated-beam.esm.js +47 -55
- package/dist/animated-list.cjs.js +11 -27
- package/dist/animated-list.esm.js +12 -28
- package/dist/animated-text.cjs.js +9 -9
- package/dist/animated-text.esm.js +9 -9
- package/dist/app-header.cjs.js +17 -12
- package/dist/app-header.esm.js +18 -13
- package/dist/aspect-ratio.cjs.js +10 -12
- package/dist/aspect-ratio.esm.js +11 -13
- package/dist/avatar.cjs.js +16 -20
- package/dist/avatar.esm.js +16 -20
- package/dist/badge.cjs.js +27 -22
- package/dist/badge.esm.js +32 -27
- package/dist/block-controls.cjs.js +11 -12
- package/dist/block-controls.esm.js +8 -9
- package/dist/box.cjs.js +2 -3
- package/dist/box.esm.js +2 -3
- package/dist/breadcrumb.cjs.js +12 -18
- package/dist/breadcrumb.esm.js +11 -17
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-D-mXMgqc.js → calendar-CzpWDxLc.js} +56 -46
- package/dist/{calendar-B3PUKHQm.mjs → calendar-DkSDFg33.mjs} +127 -117
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +6 -7
- package/dist/card.esm.js +5 -6
- package/dist/chart.cjs.js +58 -52
- package/dist/chart.esm.js +101 -95
- package/dist/checkbox.cjs.js +19 -15
- package/dist/checkbox.esm.js +19 -15
- package/dist/collapsible.cjs.js +9 -13
- package/dist/collapsible.esm.js +9 -13
- package/dist/color-picker.cjs.js +38 -19
- package/dist/color-picker.esm.js +134 -115
- package/dist/combobox.cjs.js +60 -57
- package/dist/combobox.esm.js +96 -92
- package/dist/command-palette.cjs.js +1 -0
- package/dist/command-palette.esm.js +1 -0
- package/dist/command.cjs.js +32 -14
- package/dist/command.esm.js +46 -28
- package/dist/components/date-time-utils.d.ts.map +1 -1
- package/dist/components/ui-accordion.d.ts.map +1 -1
- package/dist/components/ui-alert-dialog.d.ts +2 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-alert.d.ts.map +1 -1
- package/dist/components/ui-animated-beam.d.ts.map +1 -1
- package/dist/components/ui-animated-list.d.ts.map +1 -1
- package/dist/components/ui-app-header.d.ts.map +1 -1
- package/dist/components/ui-aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui-avatar.d.ts.map +1 -1
- package/dist/components/ui-badge.d.ts.map +1 -1
- package/dist/components/ui-block-controls.d.ts.map +1 -1
- package/dist/components/ui-box.d.ts.map +1 -1
- package/dist/components/ui-breadcrumb.d.ts.map +1 -1
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-chart.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-collapsible.d.ts.map +1 -1
- package/dist/components/ui-color-picker.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-command-palette.d.ts.map +1 -1
- package/dist/components/ui-command.d.ts.map +1 -1
- package/dist/components/ui-container.d.ts.map +1 -1
- package/dist/components/ui-context-menu.d.ts.map +1 -1
- package/dist/components/ui-data-table.d.ts +7 -0
- package/dist/components/ui-data-table.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dialog.d.ts +2 -0
- package/dist/components/ui-dialog.d.ts.map +1 -1
- package/dist/components/ui-dock.d.ts.map +1 -1
- package/dist/components/ui-drawer.d.ts.map +1 -1
- package/dist/components/ui-dropdown.d.ts.map +1 -1
- package/dist/components/ui-empty-state.d.ts.map +1 -1
- package/dist/components/ui-field.d.ts.map +1 -1
- package/dist/components/ui-fieldset.d.ts.map +1 -1
- package/dist/components/ui-file-upload.d.ts.map +1 -1
- package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
- package/dist/components/ui-form.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-hover-card.d.ts.map +1 -1
- package/dist/components/ui-icon-cloud.d.ts.map +1 -1
- package/dist/components/ui-inline-edit.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-marquee.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-menubar.d.ts.map +1 -1
- package/dist/components/ui-meter.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-orbiter.d.ts.map +1 -1
- package/dist/components/ui-pagination.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-pin-input.d.ts.map +1 -1
- package/dist/components/ui-popover.d.ts.map +1 -1
- package/dist/components/ui-progress.d.ts.map +1 -1
- package/dist/components/ui-radio-group.d.ts.map +1 -1
- package/dist/components/ui-radio.d.ts.map +1 -1
- package/dist/components/ui-rating.d.ts +1 -0
- package/dist/components/ui-rating.d.ts.map +1 -1
- package/dist/components/ui-scroll-area.d.ts.map +1 -1
- package/dist/components/ui-section.d.ts.map +1 -1
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-selection-popup.d.ts.map +1 -1
- package/dist/components/ui-sidebar.d.ts.map +1 -1
- package/dist/components/ui-slider.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-spinning-text.d.ts.map +1 -1
- package/dist/components/ui-split-button.d.ts.map +1 -1
- package/dist/components/ui-splitter.d.ts.map +1 -1
- package/dist/components/ui-stepper.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-tags-input.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-picker.d.ts.map +1 -1
- package/dist/components/ui-toggle-group.d.ts +2 -0
- package/dist/components/ui-toggle-group.d.ts.map +1 -1
- package/dist/components/ui-toggle.d.ts.map +1 -1
- package/dist/components/ui-toolbar.d.ts +2 -0
- package/dist/components/ui-toolbar.d.ts.map +1 -1
- package/dist/components/ui-tooltip.d.ts.map +1 -1
- package/dist/components/ui-transfer-list.d.ts.map +1 -1
- package/dist/components/ui-tree-item.d.ts.map +1 -1
- package/dist/components/ui-tree.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/container.cjs.js +6 -12
- package/dist/container.esm.js +8 -14
- package/dist/context-menu.cjs.js +8 -8
- package/dist/context-menu.esm.js +42 -41
- package/dist/data-table.cjs.js +21 -18
- package/dist/data-table.esm.js +210 -190
- package/dist/date-field.cjs.js +9 -9
- package/dist/date-field.esm.js +19 -19
- package/dist/date-picker.cjs.js +29 -20
- package/dist/date-picker.esm.js +59 -50
- package/dist/date-range-picker.cjs.js +24 -19
- package/dist/date-range-picker.esm.js +86 -81
- package/dist/date-range-time-picker.cjs.js +27 -20
- package/dist/date-range-time-picker.esm.js +24 -17
- package/dist/date-time-picker.cjs.js +24 -17
- package/dist/date-time-picker.esm.js +89 -82
- package/dist/date-time-utils-C-4eHTyy.js +1 -0
- package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-zAx4ghvC.mjs} +75 -68
- package/dist/description.cjs.js +4 -4
- package/dist/description.esm.js +4 -4
- package/dist/dialog.cjs.js +59 -43
- package/dist/dialog.esm.js +86 -53
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dock.cjs.js +16 -30
- package/dist/dock.esm.js +26 -40
- package/dist/drawer.cjs.js +8 -12
- package/dist/drawer.esm.js +6 -10
- package/dist/dropdown.cjs.js +8 -6
- package/dist/dropdown.esm.js +33 -30
- package/dist/empty-state.cjs.js +17 -15
- package/dist/empty-state.esm.js +13 -11
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +7 -7
- package/dist/field.cjs.js +23 -14
- package/dist/field.esm.js +30 -21
- package/dist/fieldset.cjs.js +16 -9
- package/dist/fieldset.esm.js +19 -12
- package/dist/file-upload.cjs.js +79 -37
- package/dist/file-upload.esm.js +154 -112
- package/dist/flex.cjs.js +2 -2
- package/dist/flex.esm.js +8 -8
- package/dist/floating-toolbar.cjs.js +6 -7
- package/dist/floating-toolbar.esm.js +8 -9
- package/dist/form.cjs.js +24 -27
- package/dist/form.esm.js +24 -27
- package/dist/gantt.cjs.js +13 -11
- package/dist/gantt.esm.js +13 -11
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +8 -8
- package/dist/hover-card.esm.js +18 -15
- package/dist/icon-cloud.cjs.js +19 -36
- package/dist/icon-cloud.esm.js +41 -58
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +108 -104
- package/dist/inline-edit.cjs.js +50 -22
- package/dist/inline-edit.esm.js +77 -49
- package/dist/input.cjs.js +45 -38
- package/dist/input.esm.js +60 -53
- package/dist/label.cjs.js +6 -6
- package/dist/label.esm.js +6 -6
- package/dist/layout.cjs.js +3 -3
- package/dist/layout.esm.js +3 -3
- package/dist/marquee.cjs.js +7 -10
- package/dist/marquee.esm.js +7 -10
- package/dist/masonry-grid.cjs.js +2 -2
- package/dist/masonry-grid.esm.js +11 -11
- package/dist/{menu-item-styles-IGSFLAHu.mjs → menu-item-styles-CdqxPUuw.mjs} +15 -15
- package/dist/{menu-item-styles-B4onAr4C.js → menu-item-styles-DUdyjQ7i.js} +10 -10
- package/dist/menu.cjs.js +8 -24
- package/dist/menu.esm.js +52 -72
- package/dist/menubar.cjs.js +9 -31
- package/dist/menubar.esm.js +127 -153
- package/dist/meter.cjs.js +4 -9
- package/dist/meter.esm.js +6 -11
- package/dist/multi-select.cjs.js +53 -40
- package/dist/multi-select.esm.js +87 -73
- package/dist/navigation-menu.cjs.js +10 -10
- package/dist/navigation-menu.esm.js +33 -33
- package/dist/number-field.cjs.js +28 -17
- package/dist/number-field.esm.js +37 -26
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +10 -10
- package/dist/odometer.cjs.js +9 -9
- package/dist/odometer.esm.js +17 -17
- package/dist/orbiter.cjs.js +11 -28
- package/dist/orbiter.esm.js +28 -45
- package/dist/overlay-motion-B56x1GoY.js +49 -0
- package/dist/overlay-motion-BX3dPLay.mjs +120 -0
- package/dist/pagination.cjs.js +28 -25
- package/dist/pagination.esm.js +54 -51
- package/dist/password-field.cjs.js +39 -34
- package/dist/password-field.esm.js +63 -58
- package/dist/pin-input.cjs.js +18 -14
- package/dist/pin-input.esm.js +24 -20
- package/dist/placement-grid.cjs.js +1 -1
- package/dist/placement-grid.esm.js +1 -1
- package/dist/plugin-panel.cjs.js +1 -1
- package/dist/plugin-panel.esm.js +1 -1
- package/dist/popover.cjs.js +16 -28
- package/dist/popover.esm.js +29 -45
- package/dist/portal-DeaM1tYY.mjs +121 -0
- package/dist/portal-XbYR3m_q.js +1 -0
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.d.ts +3 -1
- package/dist/portal.d.ts.map +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/{positioner-D0VGxtYU.mjs → positioner-BE8Nbho2.mjs} +5 -3
- package/dist/{positioner-D_fqyx_j.js → positioner-DZ1FW6A9.js} +1 -1
- package/dist/positioner.cjs.js +1 -1
- package/dist/positioner.esm.js +1 -1
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/primitives/overlay-motion.d.ts +47 -0
- package/dist/primitives/overlay-motion.d.ts.map +1 -0
- package/dist/primitives/positioner.d.ts.map +1 -1
- package/dist/progress.cjs.js +11 -16
- package/dist/progress.esm.js +37 -42
- package/dist/quick-actions.cjs.js +14 -14
- package/dist/quick-actions.esm.js +12 -12
- package/dist/radio-group.cjs.js +50 -26
- package/dist/radio-group.esm.js +53 -29
- package/dist/radio.cjs.js +16 -13
- package/dist/radio.esm.js +16 -13
- package/dist/rating.cjs.js +11 -15
- package/dist/rating.esm.js +48 -50
- package/dist/{runtime-CFnK53iC.mjs → runtime-BRT7E4A8.mjs} +563 -531
- package/dist/runtime-CXw4SGV9.js +5 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +36 -32
- package/dist/scroll-area.cjs.js +3 -4
- package/dist/scroll-area.esm.js +3 -4
- package/dist/section.cjs.js +2 -4
- package/dist/section.esm.js +2 -4
- package/dist/select.cjs.js +42 -75
- package/dist/select.esm.js +57 -89
- package/dist/selection-popup.cjs.js +3 -4
- package/dist/selection-popup.esm.js +3 -4
- package/dist/semantic-tokens.d.ts +17 -0
- package/dist/semantic-tokens.d.ts.map +1 -0
- package/dist/separator.cjs.js +6 -6
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +29 -28
- package/dist/sidebar.esm.js +32 -31
- package/dist/skeleton.cjs.js +2 -2
- package/dist/skeleton.esm.js +2 -2
- package/dist/slider.cjs.js +22 -26
- package/dist/slider.esm.js +25 -29
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/sortable.cjs.js +10 -11
- package/dist/sortable.esm.js +10 -11
- package/dist/spinning-text.cjs.js +4 -13
- package/dist/spinning-text.esm.js +4 -13
- package/dist/split-button.cjs.js +7 -7
- package/dist/split-button.esm.js +17 -16
- package/dist/splitter.cjs.js +52 -10
- package/dist/splitter.esm.js +55 -13
- package/dist/stepper.cjs.js +31 -65
- package/dist/stepper.esm.js +32 -66
- package/dist/switch.cjs.js +20 -22
- package/dist/switch.esm.js +20 -22
- package/dist/table.cjs.js +5 -5
- package/dist/table.esm.js +20 -20
- package/dist/tabs.cjs.js +101 -26
- package/dist/tabs.esm.js +187 -112
- package/dist/tags-input.cjs.js +43 -17
- package/dist/tags-input.esm.js +75 -49
- package/dist/textarea.cjs.js +34 -35
- package/dist/textarea.esm.js +50 -51
- package/dist/theme.d.ts +25 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +8 -8
- package/dist/time-field.esm.js +29 -29
- package/dist/time-picker.cjs.js +17 -14
- package/dist/time-picker.esm.js +28 -25
- package/dist/timeline.cjs.js +10 -10
- package/dist/timeline.esm.js +7 -7
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +2 -2
- package/dist/toggle-group.cjs.js +13 -13
- package/dist/toggle-group.esm.js +66 -61
- package/dist/toggle.cjs.js +52 -34
- package/dist/toggle.esm.js +80 -62
- package/dist/toolbar.cjs.js +14 -14
- package/dist/toolbar.esm.js +41 -33
- package/dist/tooltip.cjs.js +3 -3
- package/dist/tooltip.esm.js +39 -33
- package/dist/transfer-list.cjs.js +37 -38
- package/dist/transfer-list.esm.js +32 -33
- package/dist/{tree-B_oQput6.mjs → tree-33fVNnaf.mjs} +6 -5
- package/dist/{tree-SivHxcAy.js → tree-Dc02MChE.js} +6 -5
- package/dist/tree-item.cjs.js +9 -8
- package/dist/tree-item.esm.js +13 -12
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/{ui-button-Co8Sid6t.mjs → ui-button-C3OmI7Sn.mjs} +152 -154
- package/dist/{ui-button-BPrzJScZ.js → ui-button-CnLwXBnx.js} +107 -109
- package/dist/wizard.cjs.js +51 -39
- package/dist/wizard.esm.js +51 -39
- package/package.json +1 -1
- package/dist/date-time-utils-y3AvNvGe.js +0 -1
- package/dist/portal-DgpQ3Jo1.js +0 -1
- package/dist/portal-bR42gHvG.mjs +0 -118
- package/dist/runtime-DwE-tizc.js +0 -1
package/dist/tree-item.cjs.js
CHANGED
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
|
|
14
14
|
.row {
|
|
15
15
|
min-inline-size: 0;
|
|
16
|
-
min-block-size:
|
|
16
|
+
min-block-size: var(--ui-control-height-2, 32px);
|
|
17
17
|
display: grid;
|
|
18
18
|
grid-template-columns: auto auto minmax(0, 1fr) auto;
|
|
19
19
|
align-items: center;
|
|
20
20
|
gap: 8px;
|
|
21
|
-
padding:
|
|
22
|
-
border-radius:
|
|
21
|
+
padding: 4px 8px 4px calc(8px + (var(--ui-tree-level) - 1) * var(--ui-tree-indent));
|
|
22
|
+
border-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
23
23
|
cursor: default;
|
|
24
24
|
outline: none;
|
|
25
25
|
user-select: none;
|
|
@@ -28,17 +28,18 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.row:hover {
|
|
31
|
-
background: color-mix(in srgb, var(--ui-color-primary, #2563eb) 8%, transparent);
|
|
31
|
+
background: var(--ui-color-fill, color-mix(in srgb, var(--ui-color-primary, #2563eb) 8%, transparent));
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.row:focus-visible {
|
|
35
|
-
|
|
35
|
+
outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-color-focus-ring, #2563eb));
|
|
36
|
+
outline-offset: -2px;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
:host([selected]) .row {
|
|
39
|
-
background: color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent);
|
|
40
|
-
color: color-
|
|
41
|
-
font-weight:
|
|
40
|
+
background: var(--ui-color-accent-fill, color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent));
|
|
41
|
+
color: var(--ui-color-text-strong, var(--ui-color-text, #0f172a));
|
|
42
|
+
font-weight: 500;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
:host([disabled]) .row {
|
package/dist/tree-item.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
const
|
|
1
|
+
import { E as i } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
|
+
const r = `
|
|
3
3
|
:host {
|
|
4
4
|
--ui-tree-indent: 16px;
|
|
5
5
|
--ui-tree-level: 1;
|
|
@@ -14,13 +14,13 @@ const i = `
|
|
|
14
14
|
|
|
15
15
|
.row {
|
|
16
16
|
min-inline-size: 0;
|
|
17
|
-
min-block-size:
|
|
17
|
+
min-block-size: var(--ui-control-height-2, 32px);
|
|
18
18
|
display: grid;
|
|
19
19
|
grid-template-columns: auto auto minmax(0, 1fr) auto;
|
|
20
20
|
align-items: center;
|
|
21
21
|
gap: 8px;
|
|
22
|
-
padding:
|
|
23
|
-
border-radius:
|
|
22
|
+
padding: 4px 8px 4px calc(8px + (var(--ui-tree-level) - 1) * var(--ui-tree-indent));
|
|
23
|
+
border-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
24
24
|
cursor: default;
|
|
25
25
|
outline: none;
|
|
26
26
|
user-select: none;
|
|
@@ -29,17 +29,18 @@ const i = `
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.row:hover {
|
|
32
|
-
background: color-mix(in srgb, var(--ui-color-primary, #2563eb) 8%, transparent);
|
|
32
|
+
background: var(--ui-color-fill, color-mix(in srgb, var(--ui-color-primary, #2563eb) 8%, transparent));
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.row:focus-visible {
|
|
36
|
-
|
|
36
|
+
outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-color-focus-ring, #2563eb));
|
|
37
|
+
outline-offset: -2px;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
:host([selected]) .row {
|
|
40
|
-
background: color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent);
|
|
41
|
-
color: color-
|
|
42
|
-
font-weight:
|
|
41
|
+
background: var(--ui-color-accent-fill, color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent));
|
|
42
|
+
color: var(--ui-color-text-strong, var(--ui-color-text, #0f172a));
|
|
43
|
+
font-weight: 500;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
:host([disabled]) .row {
|
|
@@ -91,7 +92,7 @@ const i = `
|
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
`;
|
|
94
|
-
class t extends
|
|
95
|
+
class t extends i {
|
|
95
96
|
constructor() {
|
|
96
97
|
super(...arguments), this._row = null, this._children = null, this._twist = null;
|
|
97
98
|
}
|
|
@@ -123,7 +124,7 @@ class t extends r {
|
|
|
123
124
|
}
|
|
124
125
|
render() {
|
|
125
126
|
this.setContent(`
|
|
126
|
-
<style>${
|
|
127
|
+
<style>${r}</style>
|
|
127
128
|
<div class="row" part="row" role="treeitem" tabindex="-1">
|
|
128
129
|
<span class="twist" part="twist" data-action="toggle">▸</span>
|
|
129
130
|
<span class="prefix" part="prefix"><slot name="prefix"></slot></span>
|
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-Dc02MChE.js");exports.UITree=e.UITree;
|
package/dist/tree.esm.js
CHANGED
|
@@ -2,18 +2,18 @@ import { E as D } from "./ElementBase-BeZT54Hj.mjs";
|
|
|
2
2
|
import "./ui-icon-DLhB08Fo.mjs";
|
|
3
3
|
const P = `
|
|
4
4
|
:host {
|
|
5
|
-
--ui-btn-radius: var(--ui-control-radius, var(--ui-radius,
|
|
6
|
-
--ui-btn-min-height: var(--ui-control-min-height, var(--base-button-height-md,
|
|
7
|
-
--ui-btn-padding-inline: var(--ui-control-padding-inline,
|
|
5
|
+
--ui-btn-radius: var(--ui-control-radius, var(--ui-control-radius-2, var(--ui-radius, 6px)));
|
|
6
|
+
--ui-btn-min-height: var(--ui-control-min-height, var(--base-button-height-md, var(--ui-control-height-2, 32px)));
|
|
7
|
+
--ui-btn-padding-inline: var(--ui-control-padding-inline, var(--ui-control-padding-inline-2, 12px));
|
|
8
8
|
--ui-btn-gap: var(--ui-control-gap, var(--ui-default-gap, 8px));
|
|
9
|
-
--ui-btn-font-size: var(--ui-control-font-size, var(--ui-
|
|
10
|
-
--ui-btn-font-weight:
|
|
9
|
+
--ui-btn-font-size: var(--ui-control-font-size, var(--ui-control-font-size-2, 14px));
|
|
10
|
+
--ui-btn-font-weight: 500;
|
|
11
11
|
--ui-btn-letter-spacing: var(--ui-default-letter-spacing, var(--letter-spacing-2, 0em));
|
|
12
12
|
--ui-btn-duration: var(--ui-motion-base, 160ms);
|
|
13
13
|
--ui-btn-easing: var(--ui-motion-easing, cubic-bezier(0.2, 0.8, 0.2, 1));
|
|
14
14
|
|
|
15
15
|
--ui-btn-accent: var(--ui-color-primary, #2563eb);
|
|
16
|
-
--ui-btn-accent-
|
|
16
|
+
--ui-btn-accent-text: color-mix(in srgb, var(--ui-btn-accent) 45%, var(--ui-color-text-strong, var(--ui-btn-text)));
|
|
17
17
|
--ui-btn-accent-soft: color-mix(in srgb, var(--ui-btn-accent) 10%, var(--ui-color-surface, #ffffff));
|
|
18
18
|
|
|
19
19
|
--ui-btn-surface: var(--ui-color-surface, #ffffff);
|
|
@@ -73,54 +73,53 @@ const P = `
|
|
|
73
73
|
--ui-btn-accent: color-mix(in srgb, var(--ui-color-primary, #2563eb) 78%, #0ea5e9 22%);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
/* Recipes restyle the coloured variants (primary, danger, success, warning); secondary and ghost stay neutral. */
|
|
77
|
+
:host([recipe="classic"]) .btn--solid:not([disabled]) {
|
|
77
78
|
background-image: linear-gradient(180deg, color-mix(in srgb, white 18%, transparent), color-mix(in srgb, black 10%, transparent));
|
|
78
79
|
box-shadow:
|
|
79
80
|
inset 0 1px 0 color-mix(in srgb, white 52%, transparent),
|
|
80
81
|
inset 0 -1px 0 color-mix(in srgb, black 22%, transparent),
|
|
81
|
-
0 1px 2px rgba(15, 23, 42, 0.
|
|
82
|
-
0 8px 18px color-mix(in srgb, var(--ui-btn-accent) 22%, transparent);
|
|
82
|
+
0 1px 2px rgba(15, 23, 42, 0.12);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
:host([recipe="
|
|
86
|
-
background
|
|
85
|
+
:host([recipe="soft"]) .btn--solid {
|
|
86
|
+
background: color-mix(in srgb, var(--ui-btn-accent) 16%, var(--ui-btn-surface));
|
|
87
|
+
color: var(--ui-btn-accent-text);
|
|
88
|
+
border-color: transparent;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
:host([recipe="soft"]) {
|
|
90
|
-
|
|
91
|
-
--ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 14%, var(--ui-color-surface, #ffffff));
|
|
91
|
+
:host([recipe="soft"]) .btn--solid:hover:not([disabled]) {
|
|
92
|
+
background: color-mix(in srgb, var(--ui-btn-accent) 24%, var(--ui-btn-surface));
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
:host([recipe="
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
:host([recipe="surface"]) .btn--solid {
|
|
96
|
+
background: color-mix(in srgb, var(--ui-btn-accent) 7%, var(--ui-btn-surface));
|
|
97
|
+
color: var(--ui-btn-accent-text);
|
|
98
|
+
border-color: color-mix(in srgb, var(--ui-btn-accent) 40%, transparent);
|
|
97
99
|
}
|
|
98
100
|
|
|
99
|
-
:host([recipe="surface"]) {
|
|
100
|
-
|
|
101
|
-
--ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 5%, var(--color-panel-solid, var(--ui-color-surface)));
|
|
101
|
+
:host([recipe="surface"]) .btn--solid:hover:not([disabled]) {
|
|
102
|
+
background: color-mix(in srgb, var(--ui-btn-accent) 13%, var(--ui-btn-surface));
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
:host([recipe="
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
:host([recipe="outline"]) .btn--solid {
|
|
106
|
+
background: transparent;
|
|
107
|
+
color: var(--ui-btn-accent-text);
|
|
108
|
+
border-color: color-mix(in srgb, var(--ui-btn-accent) 55%, transparent);
|
|
107
109
|
}
|
|
108
110
|
|
|
109
|
-
:host([recipe="outline"]) {
|
|
110
|
-
--ui-btn-
|
|
111
|
-
--ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 6%, transparent);
|
|
111
|
+
:host([recipe="outline"]) .btn--solid:hover:not([disabled]) {
|
|
112
|
+
background: color-mix(in srgb, var(--ui-btn-accent) 10%, transparent);
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
:host([recipe="
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
border-color:
|
|
118
|
-
box-shadow: none;
|
|
115
|
+
:host([recipe="ghost"]) .btn--solid {
|
|
116
|
+
background: transparent;
|
|
117
|
+
color: var(--ui-btn-accent-text);
|
|
118
|
+
border-color: transparent;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
:host([recipe="ghost"]) {
|
|
122
|
-
--ui-btn-
|
|
123
|
-
--ui-btn-surface-alt: transparent;
|
|
121
|
+
:host([recipe="ghost"]) .btn--solid:hover:not([disabled]) {
|
|
122
|
+
background: color-mix(in srgb, var(--ui-btn-accent) 14%, transparent);
|
|
124
123
|
}
|
|
125
124
|
|
|
126
125
|
:host([shape="none"]) {
|
|
@@ -143,31 +142,35 @@ const P = `
|
|
|
143
142
|
--ui-btn-radius: 999px;
|
|
144
143
|
}
|
|
145
144
|
|
|
146
|
-
|
|
147
|
-
--ui-btn-min-height:
|
|
148
|
-
--ui-btn-padding-inline:
|
|
149
|
-
--ui-btn-font-size:
|
|
145
|
+
:host([scale="1"]) {
|
|
146
|
+
--ui-btn-min-height: var(--base-button-height-sm, var(--ui-control-height-1, 24px));
|
|
147
|
+
--ui-btn-padding-inline: var(--ui-control-padding-inline-1, 8px);
|
|
148
|
+
--ui-btn-font-size: var(--ui-control-font-size-1, 12px);
|
|
149
|
+
--ui-btn-radius: var(--ui-control-radius-1, var(--ui-radius, 6px));
|
|
150
150
|
--ui-btn-gap: 6px;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
:host([scale="2"]) {
|
|
154
|
-
--ui-btn-min-height:
|
|
155
|
-
--ui-btn-padding-inline:
|
|
156
|
-
--ui-btn-font-size: 14px;
|
|
154
|
+
--ui-btn-min-height: var(--base-button-height-md, var(--ui-control-height-2, 32px));
|
|
155
|
+
--ui-btn-padding-inline: var(--ui-control-padding-inline-2, 12px);
|
|
156
|
+
--ui-btn-font-size: var(--ui-control-font-size-2, 14px);
|
|
157
|
+
--ui-btn-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
157
158
|
--ui-btn-gap: 8px;
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
:host([scale="3"]) {
|
|
161
|
-
--ui-btn-min-height:
|
|
162
|
-
--ui-btn-padding-inline:
|
|
163
|
-
--ui-btn-font-size: 16px;
|
|
162
|
+
--ui-btn-min-height: var(--base-button-height-lg, var(--ui-control-height-3, 40px));
|
|
163
|
+
--ui-btn-padding-inline: var(--ui-control-padding-inline-3, 16px);
|
|
164
|
+
--ui-btn-font-size: var(--ui-control-font-size-3, 16px);
|
|
165
|
+
--ui-btn-radius: var(--ui-control-radius-3, var(--ui-radius, 6px));
|
|
164
166
|
--ui-btn-gap: 8px;
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
:host([scale="4"]) {
|
|
168
|
-
--ui-btn-min-height:
|
|
169
|
-
--ui-btn-padding-inline:
|
|
170
|
-
--ui-btn-font-size: 18px;
|
|
170
|
+
--ui-btn-min-height: var(--ui-control-height-4, 48px);
|
|
171
|
+
--ui-btn-padding-inline: var(--ui-control-padding-inline-4, 20px);
|
|
172
|
+
--ui-btn-font-size: var(--ui-control-font-size-4, 18px);
|
|
173
|
+
--ui-btn-radius: var(--ui-control-radius-4, var(--ui-radius, 6px));
|
|
171
174
|
--ui-btn-gap: 10px;
|
|
172
175
|
}
|
|
173
176
|
|
|
@@ -210,8 +213,8 @@ const P = `
|
|
|
210
213
|
}
|
|
211
214
|
|
|
212
215
|
.btn:focus-visible {
|
|
213
|
-
outline: 2px solid color
|
|
214
|
-
outline-offset: 2px;
|
|
216
|
+
outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-btn-ring));
|
|
217
|
+
outline-offset: var(--ui-ring-offset, 2px);
|
|
215
218
|
}
|
|
216
219
|
|
|
217
220
|
.btn::after {
|
|
@@ -229,84 +232,79 @@ const P = `
|
|
|
229
232
|
opacity: 0.08;
|
|
230
233
|
}
|
|
231
234
|
|
|
235
|
+
/* Solid: a flat fill, no shadow. Hover goes slightly darker in light themes and lighter in dark ones. */
|
|
236
|
+
.btn--solid {
|
|
237
|
+
background: var(--ui-btn-fill, var(--ui-btn-accent));
|
|
238
|
+
color: var(--ui-btn-on-accent, #ffffff);
|
|
239
|
+
border-color: transparent;
|
|
240
|
+
box-shadow: none;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.btn--solid:hover:not([disabled]) {
|
|
244
|
+
background: color-mix(in srgb, var(--ui-btn-fill, var(--ui-btn-accent)) 88%, var(--ui-color-text-strong, #0f172a));
|
|
245
|
+
}
|
|
246
|
+
|
|
232
247
|
.btn--primary {
|
|
233
|
-
background: var(--ui-btn-accent);
|
|
234
248
|
/* The theme's text colour for a primary fill: the default theme's amber needs dark text. */
|
|
235
|
-
|
|
236
|
-
border-color: color-mix(in srgb, var(--ui-btn-accent) 74%, #0f172a 26%);
|
|
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);
|
|
249
|
+
--ui-btn-on-accent: var(--ui-color-foreground-on-primary, #ffffff);
|
|
238
250
|
}
|
|
239
251
|
|
|
240
|
-
.
|
|
241
|
-
|
|
252
|
+
/* Status fills are a shade deeper than the status colour so white text reads at 4.5:1 or better. */
|
|
253
|
+
.btn--danger {
|
|
254
|
+
--ui-btn-accent: var(--ui-color-danger, #dc2626);
|
|
255
|
+
--ui-btn-fill: color-mix(in srgb, var(--ui-btn-accent) 80%, #000000);
|
|
256
|
+
--ui-btn-on-accent: #ffffff;
|
|
242
257
|
}
|
|
243
258
|
|
|
259
|
+
.btn--success {
|
|
260
|
+
--ui-btn-accent: var(--ui-color-success, #15803d);
|
|
261
|
+
--ui-btn-fill: color-mix(in srgb, var(--ui-btn-accent) 76%, #000000);
|
|
262
|
+
--ui-btn-on-accent: #ffffff;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* The warning colour is often amber, which needs dark text. */
|
|
266
|
+
.btn--warning {
|
|
267
|
+
--ui-btn-accent: var(--ui-color-warning, #b45309);
|
|
268
|
+
--ui-btn-on-accent: var(--ui-color-foreground-on-warning, #ffffff);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/* Secondary: a neutral surface with a hairline border. */
|
|
244
272
|
.btn--secondary {
|
|
245
273
|
background: var(--ui-btn-surface);
|
|
246
|
-
color:
|
|
247
|
-
border-color: color-mix(in srgb, var(--ui-btn-
|
|
248
|
-
box-shadow:
|
|
274
|
+
color: var(--ui-color-text-strong, var(--ui-btn-text));
|
|
275
|
+
border-color: var(--ui-color-line, color-mix(in srgb, var(--ui-btn-muted) 40%, transparent));
|
|
276
|
+
box-shadow: none;
|
|
249
277
|
}
|
|
250
278
|
|
|
251
279
|
.btn--secondary:hover:not([disabled]) {
|
|
252
|
-
background:
|
|
280
|
+
background: var(--ui-color-fill, var(--ui-btn-surface-alt));
|
|
281
|
+
border-color: var(--ui-color-line-strong, var(--ui-color-line, var(--ui-btn-muted)));
|
|
253
282
|
}
|
|
254
283
|
|
|
255
284
|
.btn--ghost {
|
|
256
285
|
background: transparent;
|
|
257
|
-
color:
|
|
286
|
+
color: var(--ui-btn-accent-text);
|
|
258
287
|
border-color: transparent;
|
|
259
288
|
box-shadow: none;
|
|
260
289
|
}
|
|
261
290
|
|
|
262
291
|
.btn--ghost:hover:not([disabled]) {
|
|
263
|
-
background: var(--ui-btn-accent
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.btn--danger {
|
|
267
|
-
background: var(--ui-color-danger, #dc2626);
|
|
268
|
-
color: #ffffff;
|
|
269
|
-
border-color: color-mix(in srgb, var(--ui-color-danger, #dc2626) 72%, #0f172a 28%);
|
|
270
|
-
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-danger, #dc2626) 22%, transparent);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.btn--danger:hover:not([disabled]) {
|
|
274
|
-
background: color-mix(in srgb, var(--ui-color-danger, #dc2626) 86%, #0f172a 14%);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.btn--success {
|
|
278
|
-
background: var(--ui-color-success, #15803d);
|
|
279
|
-
color: #ffffff;
|
|
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);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.btn--success:hover:not([disabled]) {
|
|
285
|
-
background: color-mix(in srgb, var(--ui-color-success, #15803d) 86%, #0f172a 14%);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
.btn--warning {
|
|
289
|
-
background: var(--ui-color-warning, #b45309);
|
|
290
|
-
color: #ffffff;
|
|
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);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.btn--warning:hover:not([disabled]) {
|
|
296
|
-
background: color-mix(in srgb, var(--ui-color-warning, #b45309) 86%, #0f172a 14%);
|
|
292
|
+
background: color-mix(in srgb, var(--ui-btn-accent) 12%, transparent);
|
|
297
293
|
}
|
|
298
294
|
|
|
299
295
|
:host([size="sm"]) {
|
|
300
|
-
--ui-btn-font-size: var(--ui-
|
|
301
|
-
--ui-btn-min-height: var(--base-button-height-sm,
|
|
302
|
-
--ui-btn-padding-inline:
|
|
296
|
+
--ui-btn-font-size: var(--ui-control-font-size-1, 12px);
|
|
297
|
+
--ui-btn-min-height: var(--base-button-height-sm, var(--ui-control-height-1, 24px));
|
|
298
|
+
--ui-btn-padding-inline: var(--ui-control-padding-inline-1, 8px);
|
|
299
|
+
--ui-btn-radius: var(--ui-control-radius-1, var(--ui-radius, 6px));
|
|
303
300
|
--ui-btn-gap: 6px;
|
|
304
301
|
}
|
|
305
302
|
|
|
306
303
|
:host([size="lg"]) {
|
|
307
|
-
--ui-btn-font-size: var(--ui-
|
|
308
|
-
--ui-btn-min-height: var(--base-button-height-lg,
|
|
309
|
-
--ui-btn-padding-inline:
|
|
304
|
+
--ui-btn-font-size: var(--ui-control-font-size-3, 16px);
|
|
305
|
+
--ui-btn-min-height: var(--base-button-height-lg, var(--ui-control-height-3, 40px));
|
|
306
|
+
--ui-btn-padding-inline: var(--ui-control-padding-inline-3, 16px);
|
|
307
|
+
--ui-btn-radius: var(--ui-control-radius-3, var(--ui-radius, 6px));
|
|
310
308
|
--ui-btn-gap: 10px;
|
|
311
309
|
}
|
|
312
310
|
|
|
@@ -317,11 +315,11 @@ const P = `
|
|
|
317
315
|
}
|
|
318
316
|
|
|
319
317
|
:host([state="error"]) .btn:not([disabled]) {
|
|
320
|
-
box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-danger, #dc2626)
|
|
318
|
+
box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-danger, #dc2626) 50%, transparent);
|
|
321
319
|
}
|
|
322
320
|
|
|
323
321
|
:host([state="success"]) .btn:not([disabled]) {
|
|
324
|
-
box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-success, #15803d)
|
|
322
|
+
box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-success, #15803d) 45%, transparent);
|
|
325
323
|
}
|
|
326
324
|
|
|
327
325
|
:host([data-animation]) .btn:not([disabled]):hover {
|
|
@@ -505,7 +503,7 @@ const P = `
|
|
|
505
503
|
}
|
|
506
504
|
}
|
|
507
505
|
`;
|
|
508
|
-
function
|
|
506
|
+
function C(t) {
|
|
509
507
|
return t !== null && t.toLowerCase() !== "false" && t !== "0";
|
|
510
508
|
}
|
|
511
509
|
function U(t) {
|
|
@@ -514,7 +512,7 @@ function U(t) {
|
|
|
514
512
|
function I(t) {
|
|
515
513
|
return t === "sm" || t === "lg" ? t : "md";
|
|
516
514
|
}
|
|
517
|
-
function
|
|
515
|
+
function $(t) {
|
|
518
516
|
return t === "scale" || t === "pulse" || t === "none" ? t : null;
|
|
519
517
|
}
|
|
520
518
|
function N(t) {
|
|
@@ -523,7 +521,7 @@ function N(t) {
|
|
|
523
521
|
function W(t) {
|
|
524
522
|
return t === "loading" || t === "error" || t === "success" ? t : "idle";
|
|
525
523
|
}
|
|
526
|
-
function
|
|
524
|
+
function T(t) {
|
|
527
525
|
return t === "submit" || t === "reset" ? t : "button";
|
|
528
526
|
}
|
|
529
527
|
function G(t) {
|
|
@@ -537,36 +535,36 @@ function K(t) {
|
|
|
537
535
|
}
|
|
538
536
|
function Q(t) {
|
|
539
537
|
if (!t) return null;
|
|
540
|
-
const
|
|
541
|
-
return
|
|
538
|
+
const i = t.trim();
|
|
539
|
+
return i ? i === "full" ? "999px" : /^-?\d+(\.\d+)?$/.test(i) ? `${i}px` : i : null;
|
|
542
540
|
}
|
|
543
|
-
function r(t,
|
|
544
|
-
const e = t.getAttribute(
|
|
541
|
+
function r(t, i) {
|
|
542
|
+
const e = t.getAttribute(i);
|
|
545
543
|
if (e != null) return e;
|
|
546
|
-
const
|
|
547
|
-
return typeof
|
|
544
|
+
const n = t[i];
|
|
545
|
+
return typeof n == "string" && n.length > 0 ? n : null;
|
|
548
546
|
}
|
|
549
|
-
function
|
|
550
|
-
const e = t.getAttribute(
|
|
551
|
-
if (e != null) return
|
|
552
|
-
const
|
|
553
|
-
return typeof
|
|
547
|
+
function u(t, i) {
|
|
548
|
+
const e = t.getAttribute(i);
|
|
549
|
+
if (e != null) return C(e);
|
|
550
|
+
const n = t[i];
|
|
551
|
+
return typeof n == "boolean" ? n : typeof n == "string" ? C(n) : !1;
|
|
554
552
|
}
|
|
555
|
-
function
|
|
553
|
+
function l(t) {
|
|
556
554
|
return t.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
557
555
|
}
|
|
558
|
-
function E(t,
|
|
559
|
-
return !!t.querySelector(`[slot="${
|
|
556
|
+
function E(t, i) {
|
|
557
|
+
return !!t.querySelector(`[slot="${i}"]`);
|
|
560
558
|
}
|
|
561
|
-
function V(t,
|
|
562
|
-
if (
|
|
559
|
+
function V(t, i) {
|
|
560
|
+
if (i === "button") return;
|
|
563
561
|
const e = t.closest("form");
|
|
564
562
|
if (!e) {
|
|
565
563
|
const o = t.closest("ui-form");
|
|
566
|
-
|
|
564
|
+
i === "reset" ? o?.reset?.() : o?.requestSubmit?.();
|
|
567
565
|
return;
|
|
568
566
|
}
|
|
569
|
-
if (
|
|
567
|
+
if (i === "reset") {
|
|
570
568
|
e.reset();
|
|
571
569
|
return;
|
|
572
570
|
}
|
|
@@ -574,10 +572,10 @@ function V(t, n) {
|
|
|
574
572
|
e.requestSubmit();
|
|
575
573
|
return;
|
|
576
574
|
}
|
|
577
|
-
const
|
|
578
|
-
e.dispatchEvent(
|
|
575
|
+
const n = new Event("submit", { bubbles: !0, cancelable: !0 });
|
|
576
|
+
e.dispatchEvent(n);
|
|
579
577
|
}
|
|
580
|
-
const
|
|
578
|
+
const L = ["aria-expanded", "aria-haspopup", "aria-pressed"];
|
|
581
579
|
class X extends D {
|
|
582
580
|
constructor() {
|
|
583
581
|
super(), this._slots = [], this._contentObserver = null, this._onRootClick = this._onRootClick.bind(this), this._onSlotChange = this._onSlotChange.bind(this), this._onContentMutations = this._onContentMutations.bind(this);
|
|
@@ -613,13 +611,13 @@ class X extends D {
|
|
|
613
611
|
disconnectedCallback() {
|
|
614
612
|
this.root.removeEventListener("click", this._onRootClick), this._contentObserver?.disconnect(), this._contentObserver = null, this._detachSlotListeners(), super.disconnectedCallback();
|
|
615
613
|
}
|
|
616
|
-
attributeChangedCallback(
|
|
617
|
-
if (e !==
|
|
618
|
-
if (
|
|
619
|
-
const o =
|
|
614
|
+
attributeChangedCallback(i, e, n) {
|
|
615
|
+
if (e !== n) {
|
|
616
|
+
if (i === "animation") {
|
|
617
|
+
const o = $(n);
|
|
620
618
|
o ? this.setAttribute("data-animation", o) : this.removeAttribute("data-animation");
|
|
621
619
|
}
|
|
622
|
-
if (
|
|
620
|
+
if (L.includes(i)) {
|
|
623
621
|
this._syncForwardedState();
|
|
624
622
|
return;
|
|
625
623
|
}
|
|
@@ -627,26 +625,26 @@ class X extends D {
|
|
|
627
625
|
}
|
|
628
626
|
}
|
|
629
627
|
_syncForwardedState() {
|
|
630
|
-
const
|
|
631
|
-
if (
|
|
632
|
-
for (const e of
|
|
633
|
-
const
|
|
634
|
-
|
|
628
|
+
const i = this.root.querySelector('button[data-ui-button="true"]');
|
|
629
|
+
if (i)
|
|
630
|
+
for (const e of L) {
|
|
631
|
+
const n = this.getAttribute(e);
|
|
632
|
+
n == null || n === "" ? i.removeAttribute(e) : i.getAttribute(e) !== n && i.setAttribute(e, n);
|
|
635
633
|
}
|
|
636
634
|
}
|
|
637
|
-
_onRootClick(
|
|
638
|
-
const
|
|
639
|
-
if (!
|
|
640
|
-
const o =
|
|
635
|
+
_onRootClick(i) {
|
|
636
|
+
const n = i.target?.closest('button[data-ui-button="true"]');
|
|
637
|
+
if (!n || n.disabled) return;
|
|
638
|
+
const o = T(n.getAttribute("data-request-type"));
|
|
641
639
|
queueMicrotask(() => {
|
|
642
|
-
|
|
640
|
+
i.defaultPrevented || V(this, o);
|
|
643
641
|
});
|
|
644
642
|
}
|
|
645
643
|
_attachSlotListeners() {
|
|
646
|
-
this._detachSlotListeners(), this._slots = Array.from(this.root.querySelectorAll("slot")), this._slots.forEach((
|
|
644
|
+
this._detachSlotListeners(), this._slots = Array.from(this.root.querySelectorAll("slot")), this._slots.forEach((i) => i.addEventListener("slotchange", this._onSlotChange));
|
|
647
645
|
}
|
|
648
646
|
_detachSlotListeners() {
|
|
649
|
-
this._slots.forEach((
|
|
647
|
+
this._slots.forEach((i) => i.removeEventListener("slotchange", this._onSlotChange)), this._slots = [];
|
|
650
648
|
}
|
|
651
649
|
_onSlotChange() {
|
|
652
650
|
this.requestRender();
|
|
@@ -655,27 +653,27 @@ class X extends D {
|
|
|
655
653
|
this.requestRender();
|
|
656
654
|
}
|
|
657
655
|
render() {
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
const
|
|
656
|
+
const i = u(this, "disabled"), e = u(this, "loading"), n = r(this, "state"), o = W(n), a = e || o === "loading", b = r(this, "icon"), c = U(r(this, "variant")), d = r(this, "size"), h = I(d), f = $(r(this, "animation")), s = r(this, "theme"), p = s === "dark" || s === "brand" ? s : null, g = r(this, "tone"), m = N(g), R = u(this, "block"), q = u(this, "headless"), M = T(r(this, "type")), v = G(r(this, "recipe")), x = r(this, "shape"), y = J(x), B = r(this, "radius"), k = Q(B), w = K(r(this, "scale")), A = r(this, "aria-label"), F = r(this, "loading-label") || "Loading";
|
|
657
|
+
f ? this.setAttribute("data-animation", f) : this.removeAttribute("data-animation"), R ? this.setAttribute("block", "") : this.removeAttribute("block"), q ? this.setAttribute("headless", "") : this.removeAttribute("headless"), g != null && (m ? this.setAttribute("tone", m) : this.removeAttribute("tone")), d != null && (h === "md" ? this.removeAttribute("size") : this.setAttribute("size", h)), s != null && (p ? this.setAttribute("theme", p) : this.removeAttribute("theme")), n != null && (o === "idle" ? this.removeAttribute("state") : this.setAttribute("state", o)), v ? this.setAttribute("recipe", v) : this.removeAttribute("recipe"), x != null && (y ? this.setAttribute("shape", y) : this.removeAttribute("shape")), k ? this.style.setProperty("--ui-btn-radius", k) : this.style.removeProperty("--ui-btn-radius"), w ? this.setAttribute("scale", w) : this.removeAttribute("scale");
|
|
658
|
+
const z = i || a;
|
|
659
|
+
z ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled"), a ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
|
|
660
|
+
const H = E(this, "prefix"), O = E(this, "suffix"), S = !a && b ? `<ui-icon class="icon" name="${l(b)}" aria-hidden="true"></ui-icon>` : "", _ = a ? '<span class="spinner" aria-hidden="true" part="spinner"></span>' : "", j = _ || S || H ? `<span class="slot slot--prefix" part="prefix">${_}${S}${a ? "" : '<slot name="prefix"></slot>'}</span>` : "", Y = O ? '<span class="slot slot--suffix" part="suffix"><slot name="suffix"></slot></span>' : "";
|
|
663
661
|
this.setContent(`
|
|
664
662
|
<style>${P}</style>
|
|
665
663
|
<button
|
|
666
|
-
class="btn btn--${
|
|
664
|
+
class="btn btn--${c}${c === "secondary" || c === "ghost" ? "" : " btn--solid"}"
|
|
667
665
|
part="button"
|
|
668
666
|
type="button"
|
|
669
667
|
data-ui-button="true"
|
|
670
668
|
data-request-type="${M}"
|
|
671
|
-
aria-busy="${
|
|
672
|
-
${
|
|
673
|
-
${
|
|
669
|
+
aria-busy="${a ? "true" : "false"}"
|
|
670
|
+
${A ? `aria-label="${l(A)}"` : ""}
|
|
671
|
+
${z ? "disabled" : ""}
|
|
674
672
|
>
|
|
675
|
-
${
|
|
673
|
+
${j}
|
|
676
674
|
<span class="slot slot--label" part="label"><slot></slot></span>
|
|
677
675
|
${Y}
|
|
678
|
-
${
|
|
676
|
+
${a ? `<span class="sr-only">${l(F)}</span>` : ""}
|
|
679
677
|
</button>
|
|
680
678
|
`), this._syncForwardedState(), this._attachSlotListeners();
|
|
681
679
|
}
|