@editora/ui-core 0.1.21 → 0.1.23
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 +292 -221
- package/dist/{ElementBase-YlTLMsGk.mjs → ElementBase-BeZT54Hj.mjs} +3 -2
- package/dist/ElementBase-DxbvhLJs.js +1 -0
- package/dist/ElementBase.d.ts +2 -1
- package/dist/ElementBase.d.ts.map +1 -1
- package/dist/__tests__/setup.d.ts +0 -2
- package/dist/__tests__/setup.d.ts.map +1 -1
- package/dist/accordion.cjs.js +4 -4
- package/dist/accordion.esm.js +4 -4
- package/dist/alert-dialog.cjs.js +32 -32
- package/dist/alert-dialog.esm.js +95 -75
- package/dist/alert.cjs.js +7 -7
- package/dist/alert.esm.js +7 -7
- package/dist/anchor.cjs.js +3 -3
- package/dist/anchor.esm.js +6 -5
- package/dist/animated-beam.cjs.js +1 -1
- package/dist/animated-beam.esm.js +1 -1
- package/dist/animated-list.cjs.js +5 -5
- package/dist/animated-list.esm.js +5 -5
- package/dist/animated-text.cjs.js +5 -5
- package/dist/animated-text.esm.js +5 -5
- package/dist/app-header.cjs.js +4 -4
- package/dist/app-header.esm.js +4 -4
- package/dist/aspect-ratio.cjs.js +4 -4
- package/dist/aspect-ratio.esm.js +4 -4
- package/dist/avatar.cjs.js +14 -14
- package/dist/avatar.esm.js +31 -29
- package/dist/badge.cjs.js +5 -5
- package/dist/badge.esm.js +5 -5
- package/dist/block-controls.cjs.js +5 -5
- package/dist/block-controls.esm.js +5 -5
- package/dist/box.cjs.js +3 -3
- package/dist/box.esm.js +3 -3
- package/dist/breadcrumb.cjs.js +6 -6
- package/dist/breadcrumb.esm.js +6 -6
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-DLY4acgn.mjs → calendar-B3PUKHQm.mjs} +227 -183
- package/dist/{calendar-Dkof-FTK.js → calendar-D-mXMgqc.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 +5 -5
- package/dist/chart.esm.js +7 -7
- package/dist/checkbox.cjs.js +3 -3
- package/dist/checkbox.esm.js +3 -3
- package/dist/collapsible.cjs.js +8 -8
- package/dist/collapsible.esm.js +8 -8
- package/dist/collection.cjs.js +1 -1
- package/dist/collection.esm.js +9 -8
- package/dist/color-picker.cjs.js +30 -10
- package/dist/color-picker.esm.js +84 -62
- package/dist/combobox.cjs.js +29 -27
- package/dist/combobox.esm.js +51 -45
- package/dist/command-palette.cjs.js +1 -1
- package/dist/command-palette.esm.js +1 -1
- package/dist/command.cjs.js +2 -2
- package/dist/command.esm.js +3 -3
- 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-anchor.d.ts +2 -1
- package/dist/components/ui-anchor.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-collection.d.ts +2 -1
- package/dist/components/ui-collection.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-form.d.ts +1 -0
- package/dist/components/ui-form.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-roving-focus-group.d.ts +2 -1
- package/dist/components/ui-roving-focus-group.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/container.cjs.js +1 -1
- package/dist/container.esm.js +1 -1
- package/dist/context-menu.cjs.js +3 -3
- package/dist/context-menu.esm.js +5 -5
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +1 -1
- package/dist/control-name-BmoI1m3a.js +1 -0
- package/dist/control-name-Bpj7F34X.mjs +48 -0
- package/dist/data-table.cjs.js +6 -3
- package/dist/data-table.esm.js +146 -143
- 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 +49 -45
- 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 +89 -85
- package/dist/date-time-picker.cjs.js +23 -23
- package/dist/date-time-picker.esm.js +103 -99
- package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-BTlxnz5j.mjs} +1 -1
- package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-y3AvNvGe.js} +1 -1
- package/dist/description.cjs.js +4 -4
- package/dist/description.esm.js +4 -4
- package/dist/dialog.cjs.js +3 -3
- package/dist/dialog.esm.js +3 -3
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dismissable-layer.cjs.js +1 -1
- package/dist/dismissable-layer.esm.js +1 -1
- package/dist/dock.cjs.js +12 -12
- package/dist/dock.esm.js +73 -75
- package/dist/domElement-DazSZBjV.js +1 -0
- package/dist/domElement-ZlSGVP0l.mjs +5 -0
- package/dist/domElement.d.ts +2 -0
- package/dist/domElement.d.ts.map +1 -0
- 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 +50 -49
- package/dist/empty-state.cjs.js +4 -4
- package/dist/empty-state.esm.js +4 -4
- package/dist/field-error.cjs.js +2 -2
- package/dist/field-error.esm.js +2 -2
- package/dist/field.cjs.js +12 -12
- package/dist/field.esm.js +84 -75
- package/dist/fieldset.cjs.js +5 -5
- package/dist/fieldset.esm.js +5 -5
- package/dist/file-upload.cjs.js +4 -4
- package/dist/file-upload.esm.js +6 -4
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +1 -1
- package/dist/floating-toolbar.cjs.js +8 -8
- package/dist/floating-toolbar.esm.js +10 -10
- package/dist/focus-scope.cjs.js +1 -1
- package/dist/focus-scope.esm.js +1 -1
- package/dist/form.cjs.js +13 -13
- package/dist/form.esm.js +23 -13
- package/dist/gantt.cjs.js +43 -32
- package/dist/gantt.esm.js +100 -89
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +1 -1
- package/dist/hover-card.esm.js +1 -1
- package/dist/icon-cloud.cjs.js +4 -4
- package/dist/icon-cloud.esm.js +4 -4
- 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 +2 -2
- package/dist/inline-edit.esm.js +2 -2
- package/dist/input.cjs.js +14 -14
- package/dist/input.esm.js +40 -33
- package/dist/label.cjs.js +4 -4
- package/dist/label.esm.js +4 -4
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.esm.js +1 -1
- 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 +4 -4
- package/dist/marquee.esm.js +4 -4
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +1 -1
- 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 +30 -29
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +3 -3
- package/dist/meter.cjs.js +2 -2
- package/dist/meter.esm.js +2 -2
- package/dist/multi-select.cjs.js +17 -17
- package/dist/multi-select.esm.js +52 -44
- package/dist/navigation-menu.cjs.js +2 -2
- package/dist/navigation-menu.esm.js +2 -2
- package/dist/number-field.cjs.js +11 -13
- package/dist/number-field.esm.js +30 -28
- package/dist/number-ticker.cjs.js +5 -5
- package/dist/number-ticker.esm.js +5 -5
- package/dist/odometer.cjs.js +3 -3
- package/dist/odometer.esm.js +3 -3
- package/dist/orbiter.cjs.js +4 -4
- package/dist/orbiter.esm.js +4 -4
- package/dist/pagination.cjs.js +2 -2
- package/dist/pagination.esm.js +2 -2
- package/dist/{panel-group-CaD0_KQf.js → panel-group-BVHJEdfx.js} +1 -1
- package/dist/{panel-group-8sVNnGxg.mjs → panel-group-BxO_eNW6.mjs} +1 -1
- package/dist/panel-group.cjs.js +1 -1
- package/dist/panel-group.esm.js +1 -1
- package/dist/panel.cjs.js +1 -1
- package/dist/panel.esm.js +1 -1
- package/dist/password-field.cjs.js +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 +2 -2
- package/dist/plugin-panel.esm.js +2 -2
- package/dist/popover.cjs.js +6 -6
- package/dist/popover.esm.js +5 -5
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.esm.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/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 +4 -4
- package/dist/quick-actions.esm.js +4 -4
- package/dist/radio-group.cjs.js +2 -2
- package/dist/radio-group.esm.js +2 -2
- package/dist/radio.cjs.js +3 -3
- package/dist/radio.esm.js +3 -3
- package/dist/rating.cjs.js +18 -17
- package/dist/rating.esm.js +91 -92
- package/dist/roving-focus-group.cjs.js +1 -1
- package/dist/roving-focus-group.esm.js +11 -10
- 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/scroll-area.cjs.js +1 -1
- package/dist/scroll-area.esm.js +1 -1
- package/dist/section.cjs.js +1 -1
- package/dist/section.esm.js +1 -1
- package/dist/select.cjs.js +20 -19
- package/dist/select.esm.js +37 -33
- package/dist/selection-popup.cjs.js +3 -3
- package/dist/selection-popup.esm.js +3 -3
- package/dist/separator.cjs.js +8 -8
- package/dist/separator.esm.js +8 -8
- package/dist/sidebar.cjs.js +9 -9
- package/dist/sidebar.esm.js +16 -16
- package/dist/skeleton.cjs.js +8 -8
- package/dist/skeleton.esm.js +8 -8
- package/dist/slider.cjs.js +4 -4
- package/dist/slider.esm.js +4 -4
- package/dist/slot.cjs.js +4 -4
- package/dist/slot.esm.js +4 -4
- package/dist/sortable.cjs.js +43 -44
- package/dist/sortable.esm.js +100 -101
- package/dist/spinning-text.cjs.js +4 -4
- package/dist/spinning-text.esm.js +4 -4
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +2 -2
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/stepper.cjs.js +2 -2
- package/dist/stepper.esm.js +2 -2
- package/dist/switch.cjs.js +11 -13
- package/dist/switch.esm.js +11 -13
- package/dist/table.cjs.js +10 -7
- package/dist/table.esm.js +47 -44
- package/dist/tabs.cjs.js +21 -22
- package/dist/tabs.esm.js +71 -67
- 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 +6 -6
- package/dist/timeline.cjs.js +3 -3
- package/dist/timeline.esm.js +5 -5
- package/dist/toast.cjs.js +7 -7
- package/dist/toast.esm.js +14 -14
- package/dist/toggle-group.cjs.js +6 -7
- package/dist/toggle-group.esm.js +64 -61
- package/dist/toggle.cjs.js +18 -18
- package/dist/toggle.esm.js +32 -31
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +1 -1
- package/dist/tooltip.cjs.js +5 -5
- package/dist/tooltip.esm.js +5 -5
- package/dist/transfer-list.cjs.js +4 -4
- package/dist/transfer-list.esm.js +4 -4
- package/dist/{tree-B3kE8ESs.mjs → tree-B_oQput6.mjs} +35 -34
- package/dist/tree-SivHxcAy.js +39 -0
- package/dist/tree-item.cjs.js +1 -1
- package/dist/tree-item.esm.js +1 -1
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/trigger-BjnxLCeQ.mjs +9 -0
- package/dist/trigger-DkPsKxsP.js +1 -0
- package/dist/{ui-button-rXQOS9QJ.js → ui-button-BPrzJScZ.js} +29 -28
- package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-Co8Sid6t.mjs} +70 -49
- package/dist/{ui-icon-BzVNC_lr.js → ui-icon-D3avtxX_.js} +5 -5
- package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-DLhB08Fo.mjs} +3 -3
- package/dist/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +12 -13
- package/dist/wizard.esm.js +18 -16
- package/package.json +2 -2
- package/dist/ElementBase-EV6mVBUV.js +0 -1
- package/dist/runtime-CTaOSmBj.js +0 -1
- package/dist/tree-Dx_kv_ih.js +0 -39
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const P=require("./ElementBase-DxbvhLJs.js");require("./ui-icon-D3avtxX_.js");const I=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-btn-radius: var(--ui-control-radius, var(--ui-radius, 4px));
|
|
4
4
|
--ui-btn-min-height: var(--ui-control-min-height, var(--base-button-height-md, 40px));
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
--ui-btn-surface: var(--ui-color-surface, #ffffff);
|
|
18
18
|
--ui-btn-surface-alt: var(--ui-color-surface-alt, #f8fafc);
|
|
19
19
|
--ui-btn-text: var(--ui-color-text, #0f172a);
|
|
20
|
-
--ui-btn-muted: var(--ui-color-muted, #
|
|
20
|
+
--ui-btn-muted: var(--ui-color-muted, #526175);
|
|
21
21
|
--ui-btn-ring: var(--ui-color-focus-ring, #2563eb);
|
|
22
22
|
|
|
23
23
|
display: inline-flex;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:host([tone="neutral"]) {
|
|
36
|
-
--ui-btn-accent: color-mix(in srgb, var(--ui-color-muted, #
|
|
36
|
+
--ui-btn-accent: color-mix(in srgb, var(--ui-color-muted, #526175) 74%, var(--ui-color-text, #0f172a) 26%);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
:host([tone="info"]) {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
:host([tone="success"]) {
|
|
44
|
-
--ui-btn-accent: var(--ui-color-success, #
|
|
44
|
+
--ui-btn-accent: var(--ui-color-success, #15803d);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
:host([tone="warning"]) {
|
|
48
|
-
--ui-btn-accent: var(--ui-color-warning, #
|
|
48
|
+
--ui-btn-accent: var(--ui-color-warning, #b45309);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
:host([tone="danger"]) {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
:host([state="success"]) {
|
|
60
|
-
--ui-btn-accent: var(--ui-color-success, #
|
|
60
|
+
--ui-btn-accent: var(--ui-color-success, #15803d);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
:host([theme="dark"]) {
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
:host([recipe="soft"]) {
|
|
88
|
-
--ui-btn-surface: color-mix(in srgb, var(--ui-btn-accent) 10%,
|
|
89
|
-
--ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 14%,
|
|
88
|
+
--ui-btn-surface: color-mix(in srgb, var(--ui-btn-accent) 10%, var(--ui-color-surface, #ffffff));
|
|
89
|
+
--ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 14%, var(--ui-color-surface, #ffffff));
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
:host([recipe="soft"]) .btn--secondary {
|
|
@@ -229,7 +229,8 @@
|
|
|
229
229
|
|
|
230
230
|
.btn--primary {
|
|
231
231
|
background: var(--ui-btn-accent);
|
|
232
|
-
|
|
232
|
+
/* The theme's text colour for a primary fill: the default theme's amber needs dark text. */
|
|
233
|
+
color: var(--ui-color-foreground-on-primary, #ffffff);
|
|
233
234
|
border-color: color-mix(in srgb, var(--ui-btn-accent) 74%, #0f172a 26%);
|
|
234
235
|
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-btn-accent) 22%, transparent);
|
|
235
236
|
}
|
|
@@ -240,7 +241,7 @@
|
|
|
240
241
|
|
|
241
242
|
.btn--secondary {
|
|
242
243
|
background: var(--ui-btn-surface);
|
|
243
|
-
color: color-mix(in srgb, var(--ui-btn-accent)
|
|
244
|
+
color: color-mix(in srgb, var(--ui-btn-accent) 50%, var(--ui-btn-text) 50%);
|
|
244
245
|
border-color: color-mix(in srgb, var(--ui-btn-accent) 22%, var(--ui-btn-muted));
|
|
245
246
|
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.06);
|
|
246
247
|
}
|
|
@@ -251,7 +252,7 @@
|
|
|
251
252
|
|
|
252
253
|
.btn--ghost {
|
|
253
254
|
background: transparent;
|
|
254
|
-
color: color-mix(in srgb, var(--ui-btn-accent)
|
|
255
|
+
color: color-mix(in srgb, var(--ui-btn-accent) 50%, var(--ui-btn-text) 50%);
|
|
255
256
|
border-color: transparent;
|
|
256
257
|
box-shadow: none;
|
|
257
258
|
}
|
|
@@ -272,25 +273,25 @@
|
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
.btn--success {
|
|
275
|
-
background: var(--ui-color-success, #
|
|
276
|
+
background: var(--ui-color-success, #15803d);
|
|
276
277
|
color: #ffffff;
|
|
277
|
-
border-color: color-mix(in srgb, var(--ui-color-success, #
|
|
278
|
-
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-success, #
|
|
278
|
+
border-color: color-mix(in srgb, var(--ui-color-success, #15803d) 70%, #0f172a 30%);
|
|
279
|
+
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);
|
|
279
280
|
}
|
|
280
281
|
|
|
281
282
|
.btn--success:hover:not([disabled]) {
|
|
282
|
-
background: color-mix(in srgb, var(--ui-color-success, #
|
|
283
|
+
background: color-mix(in srgb, var(--ui-color-success, #15803d) 86%, #0f172a 14%);
|
|
283
284
|
}
|
|
284
285
|
|
|
285
286
|
.btn--warning {
|
|
286
|
-
background: var(--ui-color-warning, #
|
|
287
|
+
background: var(--ui-color-warning, #b45309);
|
|
287
288
|
color: #ffffff;
|
|
288
|
-
border-color: color-mix(in srgb, var(--ui-color-warning, #
|
|
289
|
-
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-warning, #
|
|
289
|
+
border-color: color-mix(in srgb, var(--ui-color-warning, #b45309) 70%, #0f172a 30%);
|
|
290
|
+
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);
|
|
290
291
|
}
|
|
291
292
|
|
|
292
293
|
.btn--warning:hover:not([disabled]) {
|
|
293
|
-
background: color-mix(in srgb, var(--ui-color-warning, #
|
|
294
|
+
background: color-mix(in srgb, var(--ui-color-warning, #b45309) 86%, #0f172a 14%);
|
|
294
295
|
}
|
|
295
296
|
|
|
296
297
|
:host([size="sm"]) {
|
|
@@ -318,7 +319,7 @@
|
|
|
318
319
|
}
|
|
319
320
|
|
|
320
321
|
:host([state="success"]) .btn:not([disabled]) {
|
|
321
|
-
box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-success, #
|
|
322
|
+
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);
|
|
322
323
|
}
|
|
323
324
|
|
|
324
325
|
:host([data-animation]) .btn:not([disabled]):hover {
|
|
@@ -501,21 +502,21 @@
|
|
|
501
502
|
color: HighlightText;
|
|
502
503
|
}
|
|
503
504
|
}
|
|
504
|
-
`;function
|
|
505
|
-
<style>${
|
|
505
|
+
`;function S(t){return t!==null&&t.toLowerCase()!=="false"&&t!=="0"}function U(t){return t==="secondary"||t==="ghost"||t==="danger"||t==="success"||t==="warning"?t:"primary"}function N(t){return t==="sm"||t==="lg"?t:"md"}function C(t){return t==="scale"||t==="pulse"||t==="none"?t:null}function W(t){return t==="neutral"||t==="info"||t==="success"||t==="warning"||t==="danger"?t:null}function G(t){return t==="loading"||t==="error"||t==="success"?t:"idle"}function $(t){return t==="submit"||t==="reset"?t:"button"}function J(t){return t==="classic"||t==="solid"||t==="soft"||t==="surface"||t==="outline"||t==="ghost"?t:null}function K(t){return t==="none"||t==="sm"||t==="md"||t==="lg"||t==="full"?t:null}function Q(t){return t==="1"||t==="2"||t==="3"||t==="4"?t:null}function V(t){if(!t)return null;const n=t.trim();return n?n==="full"?"999px":/^-?\d+(\.\d+)?$/.test(n)?`${n}px`:n:null}function r(t,n){const e=t.getAttribute(n);if(e!=null)return e;const i=t[n];return typeof i=="string"&&i.length>0?i:null}function c(t,n){const e=t.getAttribute(n);if(e!=null)return S(e);const i=t[n];return typeof i=="boolean"?i:typeof i=="string"?S(i):!1}function u(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function E(t,n){return!!t.querySelector(`[slot="${n}"]`)}function X(t,n){if(n==="button")return;const e=t.closest("form");if(!e){const o=t.closest("ui-form");n==="reset"?o?.reset?.():o?.requestSubmit?.();return}if(n==="reset"){e.reset();return}if(typeof e.requestSubmit=="function"){e.requestSubmit();return}const i=new Event("submit",{bubbles:!0,cancelable:!0});e.dispatchEvent(i)}const T=["aria-expanded","aria-haspopup","aria-pressed"];class q extends P.ElementBase{constructor(){super(),this._slots=[],this._contentObserver=null,this._onRootClick=this._onRootClick.bind(this),this._onSlotChange=this._onSlotChange.bind(this),this._onContentMutations=this._onContentMutations.bind(this)}static get observedAttributes(){return["disabled","variant","size","headless","loading","icon","block","animation","theme","tone","state","type","recipe","shape","radius","scale","loading-label","aria-label","aria-expanded","aria-haspopup","aria-pressed"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick),this._contentObserver=new MutationObserver(this._onContentMutations),this._contentObserver.observe(this,{childList:!0,subtree:!1,characterData:!0})}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick),this._contentObserver?.disconnect(),this._contentObserver=null,this._detachSlotListeners(),super.disconnectedCallback()}attributeChangedCallback(n,e,i){if(e!==i){if(n==="animation"){const o=C(i);o?this.setAttribute("data-animation",o):this.removeAttribute("data-animation")}if(T.includes(n)){this._syncForwardedState();return}this.isConnected&&this.requestRender()}}_syncForwardedState(){const n=this.root.querySelector('button[data-ui-button="true"]');if(n)for(const e of T){const i=this.getAttribute(e);i==null||i===""?n.removeAttribute(e):n.getAttribute(e)!==i&&n.setAttribute(e,i)}}_onRootClick(n){const i=n.target?.closest('button[data-ui-button="true"]');if(!i||i.disabled)return;const o=$(i.getAttribute("data-request-type"));queueMicrotask(()=>{n.defaultPrevented||X(this,o)})}_attachSlotListeners(){this._detachSlotListeners(),this._slots=Array.from(this.root.querySelectorAll("slot")),this._slots.forEach(n=>n.addEventListener("slotchange",this._onSlotChange))}_detachSlotListeners(){this._slots.forEach(n=>n.removeEventListener("slotchange",this._onSlotChange)),this._slots=[]}_onSlotChange(){this.requestRender()}_onContentMutations(){this.requestRender()}render(){const n=c(this,"disabled"),e=c(this,"loading"),i=r(this,"state"),o=G(i),s=e||o==="loading",l=r(this,"icon"),L=U(r(this,"variant")),b=r(this,"size"),d=N(b),h=C(r(this,"animation")),a=r(this,"theme"),f=a==="dark"||a==="brand"?a:null,p=r(this,"tone"),g=W(p),R=c(this,"block"),M=c(this,"headless"),B=$(r(this,"type")),m=J(r(this,"recipe")),x=r(this,"shape"),v=K(x),F=r(this,"radius"),y=V(F),w=Q(r(this,"scale")),k=r(this,"aria-label"),O=r(this,"loading-label")||"Loading";h?this.setAttribute("data-animation",h):this.removeAttribute("data-animation"),R?this.setAttribute("block",""):this.removeAttribute("block"),M?this.setAttribute("headless",""):this.removeAttribute("headless"),p!=null&&(g?this.setAttribute("tone",g):this.removeAttribute("tone")),b!=null&&(d==="md"?this.removeAttribute("size"):this.setAttribute("size",d)),a!=null&&(f?this.setAttribute("theme",f):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");const A=n||s;A?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled"),s?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy");const j=E(this,"prefix"),H=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>':"",Y=_||z||j?`<span class="slot slot--prefix" part="prefix">${_}${z}${s?"":'<slot name="prefix"></slot>'}</span>`:"",D=H?'<span class="slot slot--suffix" part="suffix"><slot name="suffix"></slot></span>':"";this.setContent(`
|
|
506
|
+
<style>${I}</style>
|
|
506
507
|
<button
|
|
507
|
-
class="btn btn--${
|
|
508
|
+
class="btn btn--${L}"
|
|
508
509
|
part="button"
|
|
509
510
|
type="button"
|
|
510
511
|
data-ui-button="true"
|
|
511
|
-
data-request-type="${
|
|
512
|
+
data-request-type="${B}"
|
|
512
513
|
aria-busy="${s?"true":"false"}"
|
|
513
514
|
${k?`aria-label="${u(k)}"`:""}
|
|
514
|
-
${
|
|
515
|
+
${A?"disabled":""}
|
|
515
516
|
>
|
|
516
517
|
${Y}
|
|
517
518
|
<span class="slot slot--label" part="label"><slot></slot></span>
|
|
518
|
-
${
|
|
519
|
-
${s?`<span class="sr-only">${u(
|
|
519
|
+
${D}
|
|
520
|
+
${s?`<span class="sr-only">${u(O)}</span>`:""}
|
|
520
521
|
</button>
|
|
521
|
-
`),this._attachSlotListeners()}}typeof customElements<"u"&&!customElements.get("ui-button")&&customElements.define("ui-button",
|
|
522
|
+
`),this._syncForwardedState(),this._attachSlotListeners()}}typeof customElements<"u"&&!customElements.get("ui-button")&&customElements.define("ui-button",q);exports.UIButton=q;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import "./ui-icon-
|
|
3
|
-
const
|
|
1
|
+
import { E as D } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
|
+
import "./ui-icon-DLhB08Fo.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,20 +548,24 @@ 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) {
|
|
561
562
|
if (n === "button") return;
|
|
562
563
|
const e = t.closest("form");
|
|
563
|
-
if (!e)
|
|
564
|
+
if (!e) {
|
|
565
|
+
const o = t.closest("ui-form");
|
|
566
|
+
n === "reset" ? o?.reset?.() : o?.requestSubmit?.();
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
564
569
|
if (n === "reset") {
|
|
565
570
|
e.reset();
|
|
566
571
|
return;
|
|
@@ -572,7 +577,8 @@ function V(t, n) {
|
|
|
572
577
|
const i = new Event("submit", { bubbles: !0, cancelable: !0 });
|
|
573
578
|
e.dispatchEvent(i);
|
|
574
579
|
}
|
|
575
|
-
|
|
580
|
+
const T = ["aria-expanded", "aria-haspopup", "aria-pressed"];
|
|
581
|
+
class X extends D {
|
|
576
582
|
constructor() {
|
|
577
583
|
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
584
|
}
|
|
@@ -595,7 +601,10 @@ class W extends P {
|
|
|
595
601
|
"radius",
|
|
596
602
|
"scale",
|
|
597
603
|
"loading-label",
|
|
598
|
-
"aria-label"
|
|
604
|
+
"aria-label",
|
|
605
|
+
"aria-expanded",
|
|
606
|
+
"aria-haspopup",
|
|
607
|
+
"aria-pressed"
|
|
599
608
|
];
|
|
600
609
|
}
|
|
601
610
|
connectedCallback() {
|
|
@@ -607,12 +616,24 @@ class W extends P {
|
|
|
607
616
|
attributeChangedCallback(n, e, i) {
|
|
608
617
|
if (e !== i) {
|
|
609
618
|
if (n === "animation") {
|
|
610
|
-
const o =
|
|
619
|
+
const o = C(i);
|
|
611
620
|
o ? this.setAttribute("data-animation", o) : this.removeAttribute("data-animation");
|
|
612
621
|
}
|
|
622
|
+
if (T.includes(n)) {
|
|
623
|
+
this._syncForwardedState();
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
613
626
|
this.isConnected && this.requestRender();
|
|
614
627
|
}
|
|
615
628
|
}
|
|
629
|
+
_syncForwardedState() {
|
|
630
|
+
const n = this.root.querySelector('button[data-ui-button="true"]');
|
|
631
|
+
if (n)
|
|
632
|
+
for (const e of T) {
|
|
633
|
+
const i = this.getAttribute(e);
|
|
634
|
+
i == null || i === "" ? n.removeAttribute(e) : n.getAttribute(e) !== i && n.setAttribute(e, i);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
616
637
|
_onRootClick(n) {
|
|
617
638
|
const i = n.target?.closest('button[data-ui-button="true"]');
|
|
618
639
|
if (!i || i.disabled) return;
|
|
@@ -634,32 +655,32 @@ class W extends P {
|
|
|
634
655
|
this.requestRender();
|
|
635
656
|
}
|
|
636
657
|
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
|
|
658
|
+
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"), f = a === "dark" || a === "brand" ? a : null, p = r(this, "tone"), g = N(p), 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"), F = r(this, "loading-label") || "Loading";
|
|
659
|
+
h ? this.setAttribute("data-animation", h) : this.removeAttribute("data-animation"), R ? this.setAttribute("block", "") : this.removeAttribute("block"), q ? this.setAttribute("headless", "") : this.removeAttribute("headless"), p != null && (g ? this.setAttribute("tone", g) : this.removeAttribute("tone")), b != null && (d === "md" ? this.removeAttribute("size") : this.setAttribute("size", d)), a != null && (f ? this.setAttribute("theme", f) : 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");
|
|
660
|
+
const A = n || s;
|
|
661
|
+
A ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled"), s ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
|
|
662
|
+
const O = E(this, "prefix"), j = 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 || O ? `<span class="slot slot--prefix" part="prefix">${_}${z}${s ? "" : '<slot name="prefix"></slot>'}</span>` : "", Y = j ? '<span class="slot slot--suffix" part="suffix"><slot name="suffix"></slot></span>' : "";
|
|
642
663
|
this.setContent(`
|
|
643
|
-
<style>${
|
|
664
|
+
<style>${P}</style>
|
|
644
665
|
<button
|
|
645
|
-
class="btn btn--${
|
|
666
|
+
class="btn btn--${L}"
|
|
646
667
|
part="button"
|
|
647
668
|
type="button"
|
|
648
669
|
data-ui-button="true"
|
|
649
|
-
data-request-type="${
|
|
670
|
+
data-request-type="${M}"
|
|
650
671
|
aria-busy="${s ? "true" : "false"}"
|
|
651
672
|
${k ? `aria-label="${u(k)}"` : ""}
|
|
652
|
-
${
|
|
673
|
+
${A ? "disabled" : ""}
|
|
653
674
|
>
|
|
654
|
-
${
|
|
675
|
+
${H}
|
|
655
676
|
<span class="slot slot--label" part="label"><slot></slot></span>
|
|
656
677
|
${Y}
|
|
657
|
-
${s ? `<span class="sr-only">${u(
|
|
678
|
+
${s ? `<span class="sr-only">${u(F)}</span>` : ""}
|
|
658
679
|
</button>
|
|
659
|
-
`), this._attachSlotListeners();
|
|
680
|
+
`), this._syncForwardedState(), this._attachSlotListeners();
|
|
660
681
|
}
|
|
661
682
|
}
|
|
662
|
-
typeof customElements < "u" && !customElements.get("ui-button") && customElements.define("ui-button",
|
|
683
|
+
typeof customElements < "u" && !customElements.get("ui-button") && customElements.define("ui-button", X);
|
|
663
684
|
export {
|
|
664
|
-
|
|
685
|
+
X as U
|
|
665
686
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const k=require("./ElementBase-
|
|
1
|
+
"use strict";const k=require("./ElementBase-DxbvhLJs.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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as x } from "./ElementBase-
|
|
1
|
+
import { E as x } from "./ElementBase-BeZT54Hj.mjs";
|
|
2
2
|
import { hasIcon as h, renderIconSvg as k } from "@editora/icons";
|
|
3
3
|
const a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
4
4
|
function c(i) {
|
|
@@ -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";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-DxbvhLJs.js"),a=`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
color-scheme: light dark;
|