@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/odometer.esm.js
CHANGED
|
@@ -16,10 +16,10 @@ const D = `
|
|
|
16
16
|
--ui-odometer-container-bg: transparent;
|
|
17
17
|
--ui-odometer-container-border: none;
|
|
18
18
|
--ui-odometer-container-radius: 999px;
|
|
19
|
-
--ui-odometer-digit-bg:
|
|
20
|
-
--ui-odometer-digit-border: 1px solid rgba(148, 163, 184, 0.35);
|
|
19
|
+
--ui-odometer-digit-bg: var(--ui-color-fill, #f0f0f0);
|
|
20
|
+
--ui-odometer-digit-border: 1px solid var(--ui-color-line-subtle, rgba(148, 163, 184, 0.35));
|
|
21
21
|
--ui-odometer-digit-radius: 0.18em;
|
|
22
|
-
--ui-odometer-digit-shadow:
|
|
22
|
+
--ui-odometer-digit-shadow: none;
|
|
23
23
|
--ui-odometer-separator-opacity: 0.7;
|
|
24
24
|
--ui-odometer-affix-opacity: 0.82;
|
|
25
25
|
|
|
@@ -53,19 +53,19 @@ const D = `
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
:host([tone="brand"]) {
|
|
56
|
-
--ui-odometer-color: var(--ui-color-primary, #2563eb);
|
|
56
|
+
--ui-odometer-color: var(--ui-color-accent-text, var(--ui-color-primary, #2563eb));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
:host([tone="success"]) {
|
|
60
|
-
--ui-odometer-color: var(--ui-color-success, #15803d);
|
|
60
|
+
--ui-odometer-color: var(--ui-color-success-text, var(--ui-color-success, #15803d));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
:host([tone="warning"]) {
|
|
64
|
-
--ui-odometer-color: var(--ui-color-warning, #b45309);
|
|
64
|
+
--ui-odometer-color: var(--ui-color-warning-text, var(--ui-color-warning, #b45309));
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
:host([tone="danger"]) {
|
|
68
|
-
--ui-odometer-color: var(--ui-color-danger, #dc2626);
|
|
68
|
+
--ui-odometer-color: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
:host([theme="dark"]) {
|
|
@@ -76,7 +76,7 @@ const D = `
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
:host([theme="brand"]) {
|
|
79
|
-
--ui-odometer-color: var(--ui-color-primary, #2563eb);
|
|
79
|
+
--ui-odometer-color: var(--ui-color-accent-text, var(--ui-color-primary, #2563eb));
|
|
80
80
|
--ui-odometer-digit-bg: linear-gradient(180deg, rgba(219, 234, 254, 0.98), rgba(191, 219, 254, 0.94));
|
|
81
81
|
--ui-odometer-digit-border: 1px solid rgba(37, 99, 235, 0.22);
|
|
82
82
|
}
|
|
@@ -353,7 +353,7 @@ function A(e) {
|
|
|
353
353
|
} : {};
|
|
354
354
|
}
|
|
355
355
|
function S(e, t) {
|
|
356
|
-
const i = k(n(e, "format")), r = n(e, "locale") || void 0, o = n(e, "currency") || void 0, u = C(n(e, "notation")), m = n(e, "decimal-separator"), c = n(e, "group-separator"), s = A(e),
|
|
356
|
+
const i = k(n(e, "format")), r = n(e, "locale") || void 0, o = n(e, "currency") || void 0, u = C(n(e, "notation")), m = n(e, "decimal-separator"), c = n(e, "group-separator"), s = A(e), v = {
|
|
357
357
|
style: i === "currency" && o ? "currency" : i === "percent" ? "percent" : "decimal",
|
|
358
358
|
currency: i === "currency" && o ? o : void 0,
|
|
359
359
|
notation: u,
|
|
@@ -364,14 +364,14 @@ function S(e, t) {
|
|
|
364
364
|
};
|
|
365
365
|
let p;
|
|
366
366
|
try {
|
|
367
|
-
p = new Intl.NumberFormat(r,
|
|
367
|
+
p = new Intl.NumberFormat(r, v).formatToParts(t);
|
|
368
368
|
} catch {
|
|
369
|
-
p = new Intl.NumberFormat(void 0,
|
|
369
|
+
p = new Intl.NumberFormat(void 0, v).formatToParts(t);
|
|
370
370
|
}
|
|
371
371
|
const d = [];
|
|
372
372
|
for (const a of p) {
|
|
373
|
-
const
|
|
374
|
-
for (const f of
|
|
373
|
+
const y = a.type === "decimal" && m != null ? m : a.type === "group" && c != null ? c : a.value;
|
|
374
|
+
for (const f of y) {
|
|
375
375
|
if (/[0-9]/.test(f)) {
|
|
376
376
|
d.push({ kind: "digit", value: f });
|
|
377
377
|
continue;
|
|
@@ -509,22 +509,22 @@ class j extends T {
|
|
|
509
509
|
return typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1;
|
|
510
510
|
}
|
|
511
511
|
render() {
|
|
512
|
-
const t = M(n(this, "variant")), i = n(this, "prefix") || "", r = n(this, "suffix") || "", o = n(this, "label"), u = S(this, this._currentValue), m = o || `${i}${u.text}${r}`, c = this._animationFrame !== null, s = c ? 1 - this._animationProgress : 0,
|
|
512
|
+
const t = M(n(this, "variant")), i = n(this, "prefix") || "", r = n(this, "suffix") || "", o = n(this, "label"), u = S(this, this._currentValue), m = o || `${i}${u.text}${r}`, c = this._animationFrame !== null, s = c ? 1 - this._animationProgress : 0, v = this._motionDirection === "down" ? -1 : this._motionDirection === "up" ? 1 : 0;
|
|
513
513
|
let p = "value-display", d = "";
|
|
514
514
|
t === "digital" ? (p += " digital-display", d = [
|
|
515
515
|
`--ui-odometer-motion-intensity: ${s.toFixed(3)}`,
|
|
516
|
-
`--ui-odometer-digital-shift-y: ${(
|
|
516
|
+
`--ui-odometer-digital-shift-y: ${(v * s * 0.16).toFixed(3)}em`,
|
|
517
517
|
`--ui-odometer-digital-scale-y: ${(1 + s * 0.08).toFixed(3)}`
|
|
518
518
|
].join("; ")) : t === "analog" && (p += " analog-display", d = [
|
|
519
519
|
`--ui-odometer-motion-intensity: ${s.toFixed(3)}`,
|
|
520
|
-
`--ui-odometer-analog-shift-x: ${(
|
|
520
|
+
`--ui-odometer-analog-shift-x: ${(v * s * 0.08).toFixed(3)}em`,
|
|
521
521
|
`--ui-odometer-analog-shift-y: ${(-s * 0.05).toFixed(3)}em`,
|
|
522
522
|
`--ui-odometer-analog-scale: ${(1 + s * 0.03).toFixed(3)}`,
|
|
523
523
|
`--ui-odometer-analog-blur: ${(s * 0.035).toFixed(3)}em`
|
|
524
524
|
].join("; "));
|
|
525
525
|
let a = `<span class="${p}" part="value" aria-hidden="true"${d ? ` style="${d}"` : ""}>${x(u.text)}</span>`;
|
|
526
526
|
if (t === "odometer") {
|
|
527
|
-
const
|
|
527
|
+
const y = N(n(this, "direction")), f = y === "auto" ? this._targetValue >= this._startValue ? "up" : "down" : y, g = P(f);
|
|
528
528
|
a = `
|
|
529
529
|
<span class="digits" part="digits" role="img" aria-label="${x(m)}">
|
|
530
530
|
${u.tokens.map((_) => {
|
package/dist/orbiter.cjs.js
CHANGED
|
@@ -7,40 +7,23 @@
|
|
|
7
7
|
--ui-orbiter-center-size: ${w};
|
|
8
8
|
--ui-orbiter-ring-gap: ${E};
|
|
9
9
|
--ui-orbiter-padding: ${$};
|
|
10
|
-
--ui-orbiter-radius:
|
|
10
|
+
--ui-orbiter-radius: calc(var(--ui-radius, 6px) + 4px);
|
|
11
11
|
--ui-orbiter-stage-size:
|
|
12
12
|
calc((2 * var(--ui-orbiter-farthest-radius, ${A})) + var(--ui-orbiter-item-size));
|
|
13
13
|
--ui-orbiter-accent: var(--ui-color-primary, var(--ui-primary, #2563eb));
|
|
14
|
-
--ui-orbiter-bg:
|
|
15
|
-
radial-gradient(
|
|
16
|
-
circle at 50% 50%,
|
|
17
|
-
color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 92%, transparent) 0%,
|
|
18
|
-
color-mix(in srgb, var(--ui-color-surface, #ffffff) 98%, transparent) 64%,
|
|
19
|
-
color-mix(in srgb, var(--ui-color-surface, #ffffff) 84%, transparent) 100%
|
|
20
|
-
);
|
|
14
|
+
--ui-orbiter-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
|
|
21
15
|
--ui-orbiter-color: var(--ui-color-text, #0f172a);
|
|
22
|
-
--ui-orbiter-border-color:
|
|
23
|
-
color-mix(in srgb, var(--ui-color-border, rgba(15, 23, 42, 0.16)) 86%, transparent);
|
|
16
|
+
--ui-orbiter-border-color: var(--ui-color-line-subtle, color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent));
|
|
24
17
|
--ui-orbiter-border: 1px solid var(--ui-orbiter-border-color);
|
|
25
|
-
--ui-orbiter-shadow:
|
|
26
|
-
0 1px 3px rgba(15, 23, 42, 0.06),
|
|
27
|
-
0 24px 44px rgba(15, 23, 42, 0.12);
|
|
18
|
+
--ui-orbiter-shadow: none;
|
|
28
19
|
--ui-orbiter-backdrop: none;
|
|
29
20
|
--ui-orbiter-path-color:
|
|
30
21
|
color-mix(in srgb, var(--ui-orbiter-accent) 16%, var(--ui-orbiter-border-color));
|
|
31
22
|
--ui-orbiter-path-opacity: 0.95;
|
|
32
|
-
--ui-orbiter-item-bg:
|
|
33
|
-
linear-gradient(
|
|
34
|
-
180deg,
|
|
35
|
-
color-mix(in srgb, #ffffff 96%, transparent),
|
|
36
|
-
color-mix(in srgb, var(--ui-orbiter-accent) 8%, rgba(255, 255, 255, 0.9))
|
|
37
|
-
);
|
|
23
|
+
--ui-orbiter-item-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
|
|
38
24
|
--ui-orbiter-item-color: var(--ui-orbiter-color);
|
|
39
|
-
--ui-orbiter-item-border:
|
|
40
|
-
|
|
41
|
-
--ui-orbiter-item-shadow:
|
|
42
|
-
0 8px 14px rgba(15, 23, 42, 0.08),
|
|
43
|
-
0 1px 2px rgba(15, 23, 42, 0.05);
|
|
25
|
+
--ui-orbiter-item-border: 1px solid var(--ui-color-line-subtle, color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent));
|
|
26
|
+
--ui-orbiter-item-shadow: none;
|
|
44
27
|
--ui-orbiter-item-backdrop: none;
|
|
45
28
|
--ui-orbiter-center-bg:
|
|
46
29
|
radial-gradient(
|
|
@@ -366,7 +349,7 @@
|
|
|
366
349
|
outline: none;
|
|
367
350
|
border-color: color-mix(in srgb, var(--ui-orbiter-focus-ring) 30%, transparent);
|
|
368
351
|
box-shadow:
|
|
369
|
-
0 0 0
|
|
352
|
+
0 0 0 2px var(--ui-ring-color, var(--ui-orbiter-focus-ring)),
|
|
370
353
|
var(--ui-orbiter-item-shadow);
|
|
371
354
|
}
|
|
372
355
|
|
|
@@ -434,7 +417,7 @@
|
|
|
434
417
|
outline: none;
|
|
435
418
|
border-color: color-mix(in srgb, var(--ui-orbiter-focus-ring) 24%, transparent);
|
|
436
419
|
box-shadow:
|
|
437
|
-
0 0 0
|
|
420
|
+
0 0 0 2px var(--ui-ring-color, var(--ui-orbiter-focus-ring)),
|
|
438
421
|
var(--ui-orbiter-shadow);
|
|
439
422
|
}
|
|
440
423
|
|
|
@@ -479,7 +462,7 @@
|
|
|
479
462
|
forced-color-adjust: none;
|
|
480
463
|
}
|
|
481
464
|
}
|
|
482
|
-
`;function h(i,t){if(i==null||i==="")return t;const e=i.trim();if(!e)return t;const s=e.split(/\s+/).filter(Boolean);if(!s.length)return t;const
|
|
465
|
+
`;function h(i,t){if(i==null||i==="")return t;const e=i.trim();if(!e)return t;const s=e.split(/\s+/).filter(Boolean);if(!s.length)return t;const c=s.map(a=>/^-?\d+(\.\d+)?$/.test(a)?`${a}px`:/^-?\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex|vmin|vmax)$/.test(a)?a:null);return c.some(a=>a===null)?t:c.join(" ")}function N(i,t){if(i==null||i==="")return t;const e=i.trim();return e?/^-?\d+(\.\d+)?(ms|s)$/i.test(e)?e:/^-?\d+(\.\d+)?$/i.test(e)?`${e}s`:t:t}function F(i,t){if(i==null||i==="")return t;const e=i.trim();return e?/^-?\d+(\.\d+)?ms$/i.test(e)?Number.parseFloat(e):/^-?\d+(\.\d+)?s$/i.test(e)||/^-?\d+(\.\d+)?$/i.test(e)?Number.parseFloat(e)*1e3:t:t}function g(i,t){if(i==null||i==="")return t;const e=Number.parseFloat(i);return Number.isFinite(e)?e:t}function S(i,t){const e=g(i,t);return Number.isFinite(e)&&e>0?e:t}function q(i,t){if(i==null)return t;const e=i.trim().toLowerCase();return e?e==="false"||e==="0"||e==="off"||e==="no"?!1:e==="true"||e==="1"||e==="on"||e==="yes"?!0:t:!0}function v(i,t){return`translate(-50%, -50%) rotate(${i}deg) translateX(${t}) rotate(${-i}deg)`}function z(i){const t=Math.round(g(i,1));return Math.min(X,Math.max(1,t||1))}class D extends B.ElementBase{constructor(){super(),this._itemSlot=null,this._centerSlot=null,this._pathsEl=null,this._items=[],this._centerNodes=[],this._animations=new Map,this._hovering=!1,this._itemHovering=!1,this._focusWithin=!1,this._itemHoverHandlers=new WeakMap,this._boundSlotChange=this._handleSlotChange.bind(this),this._boundPointerEnter=()=>{this._hovering=!0,this._syncState()},this._boundPointerLeave=()=>{this._hovering=!1,this._syncState()},this._boundFocusIn=()=>{this._focusWithin=!0,this._syncState()},this._boundFocusOut=()=>{this._focusWithin=this.matches(":focus-within"),this._syncState()},this.addEventListener("pointerenter",this._boundPointerEnter),this.addEventListener("pointerleave",this._boundPointerLeave),this.addEventListener("focusin",this._boundFocusIn),this.addEventListener("focusout",this._boundFocusOut)}static get observedAttributes(){return["duration","delay","speed","reverse","radius","orbit-radius","icon-size","item-size","center-size","ring-gap","rings","start-angle","direction","animation","variant","tone","size","surface-radius","elevation","padding","path","show-paths","pause-on-hover","pause-on-item-hover","pause-on-focus","paused"]}play(){this.hasAttribute("paused")&&this.removeAttribute("paused"),this._syncState()}pause(){this.hasAttribute("paused")||this.setAttribute("paused",""),this._syncState()}refresh(){this._syncRuntimeStyles(),this._syncItems(),this._renderPaths(),this._syncAnimations(),this._syncState()}disconnectedCallback(){this._cancelAllAnimations(),this._hovering=!1,this._itemHovering=!1,this._focusWithin=!1,super.disconnectedCallback()}render(){this.setContent(`
|
|
483
466
|
<style>${Q}</style>
|
|
484
467
|
<div class="root" part="root">
|
|
485
468
|
<div class="surface" part="surface">
|
|
@@ -492,4 +475,4 @@
|
|
|
492
475
|
</div>
|
|
493
476
|
</div>
|
|
494
477
|
</div>
|
|
495
|
-
`),this._itemSlot=this.root.querySelector("slot:not([name])"),this._centerSlot=this.root.querySelector('slot[name="center"]'),this._pathsEl=this.root.querySelector(".paths"),this._itemSlot?.addEventListener("slotchange",this._boundSlotChange),this._centerSlot?.addEventListener("slotchange",this._boundSlotChange),this._syncRuntimeStyles(),this._syncItems(),this._renderPaths(),this._syncAnimations(),this._syncState()}shouldRenderOnAttributeChange(){return!1}attributeChangedCallback(t,e,s){if(!(e===s||!this.isConnected)){if(t==="paused"){this._syncState();return}this._syncRuntimeStyles(),t==="orbit-radius"||t==="radius"||t==="icon-size"||t==="item-size"||t==="center-size"||t==="ring-gap"||t==="rings"||t==="start-angle"||t==="direction"||t==="reverse"||t==="size"?(this._syncItems(),this._renderPaths(),this._syncAnimations()):(t==="duration"||t==="delay"||t==="speed"||t==="animation")&&this._syncAnimations(),this._syncState()}}_handleSlotChange(){this._syncItems(),this._renderPaths(),this._syncAnimations(),this._syncState()}_itemsFromSlot(){return this._itemSlot?this._itemSlot.assignedElements({flatten:!0}).filter(t=>t instanceof HTMLElement):[]}_centerFromSlot(){return this._centerSlot?this._centerSlot.assignedElements({flatten:!0}).filter(t=>t instanceof HTMLElement):[]}_syncItems(){const t=this._itemsFromSlot(),e=this._centerFromSlot(),s=new Set(t),b=new Set(e);for(const r of this._items)s.has(r)||(this._unbindItemHover(r),this._cancelAnimation(r),r.removeAttribute("data-ui-orbiter-managed"),r.removeAttribute("data-ui-orbit-runtime"),r.style.removeProperty("--ui-orbit-index"),r.style.removeProperty("--ui-orbit-ring"),r.style.removeProperty("--ui-orbit-radius"),r.style.removeProperty("--ui-orbit-start-angle"),r.style.removeProperty("--ui-orbit-quarter-angle"),r.style.removeProperty("--ui-orbit-half-angle"),r.style.removeProperty("--ui-orbit-three-quarter-angle"),r.style.removeProperty("--ui-orbit-end-angle"),r.style.removeProperty("--ui-orbit-start-angle-inverse"),r.style.removeProperty("--ui-orbit-quarter-angle-inverse"),r.style.removeProperty("--ui-orbit-half-angle-inverse"),r.style.removeProperty("--ui-orbit-three-quarter-angle-inverse"),r.style.removeProperty("--ui-orbit-end-angle-inverse"),r.style.removeProperty("--ui-orbit-duration"),r.style.removeProperty("--ui-orbit-duration-scale"),r.style.removeProperty("animation"),r.style.removeProperty("transform"),r.hasAttribute("data-ui-orbiter-owned")&&(r.removeAttribute("data-ui-orbiter-item"),r.removeAttribute("data-ui-orbiter-owned")));for(const r of this._centerNodes)b.has(r)||(r.removeAttribute("data-ui-orbiter-managed"),r.hasAttribute("data-ui-orbiter-owned")&&(r.removeAttribute("data-ui-orbiter-center"),r.removeAttribute("data-ui-orbiter-owned")));e.forEach(r=>{r.setAttribute("data-ui-orbiter-managed",""),r.hasAttribute("data-ui-orbiter-center")||(r.setAttribute("data-ui-orbiter-center",""),r.setAttribute("data-ui-orbiter-owned","")),r.setAttribute("slot","center")});const a=z(this.getAttribute("rings")),u=h(this._orbitRadiusValue(),this._sizePreset().orbitRadius),o=h(this.getAttribute("ring-gap"),this._sizePreset().ringGap),l=g(this.getAttribute("start-angle"),C),d=Array.from({length:a},()=>[]);t.forEach((r,c)=>{r.setAttribute("data-ui-orbiter-managed",""),r.hasAttribute("data-ui-orbiter-item")||(r.setAttribute("data-ui-orbiter-item",""),r.setAttribute("data-ui-orbiter-owned","")),this._bindItemHover(r),d[c%a].push({item:r,index:c})}),d.forEach((r,c)=>{const f=r.length?360/r.length:360,y=r.length>1&&c%2===1?f/2:0,p=c===0?u:`calc(${u} + ${c} * ${o})`,x=360*this._directionSign(c);r.forEach(({item:n,index:G},U)=>{const m=l+y+U*f,R=m+x,k=m+x*.25,I=m+x*.5,L=m+x*.75,H=1+c*.14;n.style.setProperty("--ui-orbit-index",String(G)),n.style.setProperty("--ui-orbit-ring",String(c)),n.style.setProperty("--ui-orbit-radius",p),n.style.setProperty("--ui-orbit-duration",`calc(var(--ui-orbiter-duration) * ${H})`),n.style.setProperty("--ui-orbit-duration-scale",String(H)),n.style.setProperty("--ui-orbit-start-angle",`${m}deg`),n.style.setProperty("--ui-orbit-quarter-angle",`${k}deg`),n.style.setProperty("--ui-orbit-half-angle",`${I}deg`),n.style.setProperty("--ui-orbit-three-quarter-angle",`${L}deg`),n.style.setProperty("--ui-orbit-end-angle",`${R}deg`),n.style.setProperty("--ui-orbit-start-angle-inverse",`${-m}deg`),n.style.setProperty("--ui-orbit-quarter-angle-inverse",`${-k}deg`),n.style.setProperty("--ui-orbit-half-angle-inverse",`${-I}deg`),n.style.setProperty("--ui-orbit-three-quarter-angle-inverse",`${-L}deg`),n.style.setProperty("--ui-orbit-end-angle-inverse",`${-R}deg`),n.style.setProperty("transform",v(m,p))})}),this._items=t,this._centerNodes=e,this._itemHovering=this._items.some(r=>r.matches(":hover")),this.setAttribute("data-item-count",String(this._items.length)),this.setAttribute("data-center-count",String(this._centerNodes.length)),this.setAttribute("data-ring-count",String(a))}_renderPaths(){if(!this._pathsEl)return;const t=z(this.getAttribute("rings")),e=h(this._orbitRadiusValue(),this._sizePreset().orbitRadius),s=h(this.getAttribute("ring-gap"),this._sizePreset().ringGap),b=Array.from({length:t},(a,u)=>{const o=u===0?e:`calc(${e} + ${u} * ${s})`;return`<div class="path" part="path path-${u+1}" style="inline-size:calc(2 * (${o}));block-size:calc(2 * (${o}));"></div>`}).join("");this._pathsEl.innerHTML=b,this._pathsEl.toggleAttribute("hidden",!this._pathVisible())}_bindItemHover(t){if(this._itemHoverHandlers.has(t))return;const e=()=>{this._itemHovering=!0,this._syncState()},s=b=>{const u=(b.relatedTarget instanceof HTMLElement?b.relatedTarget:null)?.closest("[data-ui-orbiter-item]");this._itemHovering=u instanceof HTMLElement?this._items.includes(u):!1,this._syncState()};t.addEventListener("pointerenter",e),t.addEventListener("pointerleave",s),this._itemHoverHandlers.set(t,{enter:e,leave:s})}_unbindItemHover(t){const e=this._itemHoverHandlers.get(t);e&&(t.removeEventListener("pointerenter",e.enter),t.removeEventListener("pointerleave",e.leave),this._itemHoverHandlers.delete(t))}_sizePreset(){switch(this.getAttribute("size")){case"xs":case"0":return _.xs;case"sm":case"1":return _.sm;case"lg":case"3":return _.lg;case"xl":case"4":return _.xl;default:return _.md}}_motionPreset(){const t=this.getAttribute("animation");return t&&Z.has(t)?M[t]:M.smooth}_direction(){const t=this.getAttribute("direction");return t&&j.has(t)?t:"clockwise"}_directionSign(t){const e=this._direction();let s=e==="counterclockwise"||e==="alternate"&&t%2===1?-1:1;return q(this.getAttribute("reverse"),this.hasAttribute("reverse"))&&(s*=-1),s}_pathVisible(){const t=this.getAttribute("path");return t!=null?q(t,!0):(this.hasAttribute("show-paths"),!0)}_orbitRadiusValue(){return this.getAttribute("radius")??this.getAttribute("orbit-radius")}_iconSizeValue(){return this.getAttribute("icon-size")??this.getAttribute("item-size")}_syncRuntimeStyles(){const t=this._sizePreset(),e=this._motionPreset(),s=N(this.getAttribute("duration"),O),b=N(this.getAttribute("delay"),V),a=h(this._orbitRadiusValue(),t.orbitRadius),u=h(this._iconSizeValue(),t.itemSize),o=h(this.getAttribute("center-size"),t.centerSize),l=h(this.getAttribute("ring-gap"),t.ringGap),d=h(this.getAttribute("padding"),t.padding),r=z(this.getAttribute("rings")),c=S(this.getAttribute("speed"),1),f=r<=1?a:`calc(${a} + ${r-1} * ${l})`,y=`calc((2 * (${f})) + ${u})`;this.style.setProperty("--ui-orbiter-duration",`calc((${s}) * ${e.durationScale} / ${c})`),this.style.setProperty("--ui-orbiter-delay",b),this.style.setProperty("--ui-orbiter-orbit-radius",a),this.style.setProperty("--ui-orbiter-item-size",u),this.style.setProperty("--ui-orbiter-center-size",o),this.style.setProperty("--ui-orbiter-ring-gap",l),this.style.setProperty("--ui-orbiter-padding",d),this.style.setProperty("--ui-orbiter-farthest-radius",f),this.style.setProperty("--ui-orbiter-stage-size",y),this.style.setProperty("--ui-orbiter-path-opacity",String(e.accentOpacity>.18?1:.95));const p=this.getAttribute("surface-radius");!p||W.has(p.trim())?this.style.removeProperty("--ui-orbiter-radius"):this.style.setProperty("--ui-orbiter-radius",h(p,t.panelRadius))}_syncAnimations(){const t=this._items,e=new Set(t);for(const[o,l]of this._animations.entries())e.has(o)||(l.cancel(),this._animations.delete(o));if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){this._cancelAllAnimations(),t.forEach(o=>o.removeAttribute("data-ui-orbit-runtime"));return}if(typeof HTMLElement>"u"||typeof HTMLElement.prototype.animate!="function"){t.forEach(o=>o.removeAttribute("data-ui-orbit-runtime"));return}const s=this._motionPreset(),b=F(this.getAttribute("duration"),18e3),a=F(this.getAttribute("delay"),0),u=S(this.getAttribute("speed"),1);for(const o of t){const l=o.style.getPropertyValue("--ui-orbit-radius")||"var(--ui-orbiter-orbit-radius)",d=g(o.style.getPropertyValue("--ui-orbit-start-angle"),C),r=g(o.style.getPropertyValue("--ui-orbit-quarter-angle"),d+90),c=g(o.style.getPropertyValue("--ui-orbit-half-angle"),d+180),f=g(o.style.getPropertyValue("--ui-orbit-three-quarter-angle"),d+270),y=g(o.style.getPropertyValue("--ui-orbit-end-angle"),d+360),p=S(o.style.getPropertyValue("--ui-orbit-duration-scale"),1),T=b*s.durationScale*p/u;this._animations.get(o)?.cancel(),o.setAttribute("data-ui-orbit-runtime","");const n=o.animate([{transform:v(d,l),offset:0},{transform:v(r,l),offset:.25},{transform:v(c,l),offset:.5},{transform:v(f,l),offset:.75},{transform:v(y,l),offset:1}],{duration:Math.max(1,T),delay:Math.max(0,a),easing:"linear",iterations:Number.POSITIVE_INFINITY,fill:"both"});this._animations.set(o,n)}}_cancelAnimation(t){const e=this._animations.get(t);t.removeAttribute("data-ui-orbit-runtime"),e&&(e.cancel(),this._animations.delete(t))}_cancelAllAnimations(){for(const t of this._animations.values())t.cancel();this._animations.clear(),this._items.forEach(t=>{t.removeAttribute("data-ui-orbit-runtime"),this._unbindItemHover(t)})}_effectivePaused(){return!!(this.hasAttribute("paused")||this.hasAttribute("pause-on-hover")&&this._hovering||this.hasAttribute("pause-on-item-hover")&&this._itemHovering||this.hasAttribute("pause-on-focus")&&this._focusWithin)}_syncState(){const t=this._effectivePaused()?"paused":"running";this.setAttribute("data-state",t),this.setAttribute("data-path-visible",this._pathVisible()?"true":"false"),this.setAttribute("data-item-hovered",this._itemHovering?"true":"false");for(const e of this._animations.values())t==="paused"?e.pause():e.play()}}typeof customElements<"u"&&!customElements.get("ui-orbiter")&&customElements.define("ui-orbiter",D);exports.UIOrbiter=D;
|
|
478
|
+
`),this._itemSlot=this.root.querySelector("slot:not([name])"),this._centerSlot=this.root.querySelector('slot[name="center"]'),this._pathsEl=this.root.querySelector(".paths"),this._itemSlot?.addEventListener("slotchange",this._boundSlotChange),this._centerSlot?.addEventListener("slotchange",this._boundSlotChange),this._syncRuntimeStyles(),this._syncItems(),this._renderPaths(),this._syncAnimations(),this._syncState()}shouldRenderOnAttributeChange(){return!1}attributeChangedCallback(t,e,s){if(!(e===s||!this.isConnected)){if(t==="paused"){this._syncState();return}this._syncRuntimeStyles(),t==="orbit-radius"||t==="radius"||t==="icon-size"||t==="item-size"||t==="center-size"||t==="ring-gap"||t==="rings"||t==="start-angle"||t==="direction"||t==="reverse"||t==="size"?(this._syncItems(),this._renderPaths(),this._syncAnimations()):(t==="duration"||t==="delay"||t==="speed"||t==="animation")&&this._syncAnimations(),this._syncState()}}_handleSlotChange(){this._syncItems(),this._renderPaths(),this._syncAnimations(),this._syncState()}_itemsFromSlot(){return this._itemSlot?this._itemSlot.assignedElements({flatten:!0}).filter(t=>t instanceof HTMLElement):[]}_centerFromSlot(){return this._centerSlot?this._centerSlot.assignedElements({flatten:!0}).filter(t=>t instanceof HTMLElement):[]}_syncItems(){const t=this._itemsFromSlot(),e=this._centerFromSlot(),s=new Set(t),c=new Set(e);for(const r of this._items)s.has(r)||(this._unbindItemHover(r),this._cancelAnimation(r),r.removeAttribute("data-ui-orbiter-managed"),r.removeAttribute("data-ui-orbit-runtime"),r.style.removeProperty("--ui-orbit-index"),r.style.removeProperty("--ui-orbit-ring"),r.style.removeProperty("--ui-orbit-radius"),r.style.removeProperty("--ui-orbit-start-angle"),r.style.removeProperty("--ui-orbit-quarter-angle"),r.style.removeProperty("--ui-orbit-half-angle"),r.style.removeProperty("--ui-orbit-three-quarter-angle"),r.style.removeProperty("--ui-orbit-end-angle"),r.style.removeProperty("--ui-orbit-start-angle-inverse"),r.style.removeProperty("--ui-orbit-quarter-angle-inverse"),r.style.removeProperty("--ui-orbit-half-angle-inverse"),r.style.removeProperty("--ui-orbit-three-quarter-angle-inverse"),r.style.removeProperty("--ui-orbit-end-angle-inverse"),r.style.removeProperty("--ui-orbit-duration"),r.style.removeProperty("--ui-orbit-duration-scale"),r.style.removeProperty("animation"),r.style.removeProperty("transform"),r.hasAttribute("data-ui-orbiter-owned")&&(r.removeAttribute("data-ui-orbiter-item"),r.removeAttribute("data-ui-orbiter-owned")));for(const r of this._centerNodes)c.has(r)||(r.removeAttribute("data-ui-orbiter-managed"),r.hasAttribute("data-ui-orbiter-owned")&&(r.removeAttribute("data-ui-orbiter-center"),r.removeAttribute("data-ui-orbiter-owned")));e.forEach(r=>{r.setAttribute("data-ui-orbiter-managed",""),r.hasAttribute("data-ui-orbiter-center")||(r.setAttribute("data-ui-orbiter-center",""),r.setAttribute("data-ui-orbiter-owned","")),r.setAttribute("slot","center")});const a=z(this.getAttribute("rings")),u=h(this._orbitRadiusValue(),this._sizePreset().orbitRadius),o=h(this.getAttribute("ring-gap"),this._sizePreset().ringGap),l=g(this.getAttribute("start-angle"),C),d=Array.from({length:a},()=>[]);t.forEach((r,b)=>{r.setAttribute("data-ui-orbiter-managed",""),r.hasAttribute("data-ui-orbiter-item")||(r.setAttribute("data-ui-orbiter-item",""),r.setAttribute("data-ui-orbiter-owned","")),this._bindItemHover(r),d[b%a].push({item:r,index:b})}),d.forEach((r,b)=>{const f=r.length?360/r.length:360,y=r.length>1&&b%2===1?f/2:0,p=b===0?u:`calc(${u} + ${b} * ${o})`,x=360*this._directionSign(b);r.forEach(({item:n,index:G},U)=>{const m=l+y+U*f,R=m+x,k=m+x*.25,I=m+x*.5,L=m+x*.75,H=1+b*.14;n.style.setProperty("--ui-orbit-index",String(G)),n.style.setProperty("--ui-orbit-ring",String(b)),n.style.setProperty("--ui-orbit-radius",p),n.style.setProperty("--ui-orbit-duration",`calc(var(--ui-orbiter-duration) * ${H})`),n.style.setProperty("--ui-orbit-duration-scale",String(H)),n.style.setProperty("--ui-orbit-start-angle",`${m}deg`),n.style.setProperty("--ui-orbit-quarter-angle",`${k}deg`),n.style.setProperty("--ui-orbit-half-angle",`${I}deg`),n.style.setProperty("--ui-orbit-three-quarter-angle",`${L}deg`),n.style.setProperty("--ui-orbit-end-angle",`${R}deg`),n.style.setProperty("--ui-orbit-start-angle-inverse",`${-m}deg`),n.style.setProperty("--ui-orbit-quarter-angle-inverse",`${-k}deg`),n.style.setProperty("--ui-orbit-half-angle-inverse",`${-I}deg`),n.style.setProperty("--ui-orbit-three-quarter-angle-inverse",`${-L}deg`),n.style.setProperty("--ui-orbit-end-angle-inverse",`${-R}deg`),n.style.setProperty("transform",v(m,p))})}),this._items=t,this._centerNodes=e,this._itemHovering=this._items.some(r=>r.matches(":hover")),this.setAttribute("data-item-count",String(this._items.length)),this.setAttribute("data-center-count",String(this._centerNodes.length)),this.setAttribute("data-ring-count",String(a))}_renderPaths(){if(!this._pathsEl)return;const t=z(this.getAttribute("rings")),e=h(this._orbitRadiusValue(),this._sizePreset().orbitRadius),s=h(this.getAttribute("ring-gap"),this._sizePreset().ringGap),c=Array.from({length:t},(a,u)=>{const o=u===0?e:`calc(${e} + ${u} * ${s})`;return`<div class="path" part="path path-${u+1}" style="inline-size:calc(2 * (${o}));block-size:calc(2 * (${o}));"></div>`}).join("");this._pathsEl.innerHTML=c,this._pathsEl.toggleAttribute("hidden",!this._pathVisible())}_bindItemHover(t){if(this._itemHoverHandlers.has(t))return;const e=()=>{this._itemHovering=!0,this._syncState()},s=c=>{const u=(c.relatedTarget instanceof HTMLElement?c.relatedTarget:null)?.closest("[data-ui-orbiter-item]");this._itemHovering=u instanceof HTMLElement?this._items.includes(u):!1,this._syncState()};t.addEventListener("pointerenter",e),t.addEventListener("pointerleave",s),this._itemHoverHandlers.set(t,{enter:e,leave:s})}_unbindItemHover(t){const e=this._itemHoverHandlers.get(t);e&&(t.removeEventListener("pointerenter",e.enter),t.removeEventListener("pointerleave",e.leave),this._itemHoverHandlers.delete(t))}_sizePreset(){switch(this.getAttribute("size")){case"xs":case"0":return _.xs;case"sm":case"1":return _.sm;case"lg":case"3":return _.lg;case"xl":case"4":return _.xl;default:return _.md}}_motionPreset(){const t=this.getAttribute("animation");return t&&Z.has(t)?M[t]:M.smooth}_direction(){const t=this.getAttribute("direction");return t&&j.has(t)?t:"clockwise"}_directionSign(t){const e=this._direction();let s=e==="counterclockwise"||e==="alternate"&&t%2===1?-1:1;return q(this.getAttribute("reverse"),this.hasAttribute("reverse"))&&(s*=-1),s}_pathVisible(){const t=this.getAttribute("path");return t!=null?q(t,!0):(this.hasAttribute("show-paths"),!0)}_orbitRadiusValue(){return this.getAttribute("radius")??this.getAttribute("orbit-radius")}_iconSizeValue(){return this.getAttribute("icon-size")??this.getAttribute("item-size")}_syncRuntimeStyles(){const t=this._sizePreset(),e=this._motionPreset(),s=N(this.getAttribute("duration"),O),c=N(this.getAttribute("delay"),V),a=h(this._orbitRadiusValue(),t.orbitRadius),u=h(this._iconSizeValue(),t.itemSize),o=h(this.getAttribute("center-size"),t.centerSize),l=h(this.getAttribute("ring-gap"),t.ringGap),d=h(this.getAttribute("padding"),t.padding),r=z(this.getAttribute("rings")),b=S(this.getAttribute("speed"),1),f=r<=1?a:`calc(${a} + ${r-1} * ${l})`,y=`calc((2 * (${f})) + ${u})`;this.style.setProperty("--ui-orbiter-duration",`calc((${s}) * ${e.durationScale} / ${b})`),this.style.setProperty("--ui-orbiter-delay",c),this.style.setProperty("--ui-orbiter-orbit-radius",a),this.style.setProperty("--ui-orbiter-item-size",u),this.style.setProperty("--ui-orbiter-center-size",o),this.style.setProperty("--ui-orbiter-ring-gap",l),this.style.setProperty("--ui-orbiter-padding",d),this.style.setProperty("--ui-orbiter-farthest-radius",f),this.style.setProperty("--ui-orbiter-stage-size",y),this.style.setProperty("--ui-orbiter-path-opacity",String(e.accentOpacity>.18?1:.95));const p=this.getAttribute("surface-radius");!p||W.has(p.trim())?this.style.removeProperty("--ui-orbiter-radius"):this.style.setProperty("--ui-orbiter-radius",h(p,t.panelRadius))}_syncAnimations(){const t=this._items,e=new Set(t);for(const[o,l]of this._animations.entries())e.has(o)||(l.cancel(),this._animations.delete(o));if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){this._cancelAllAnimations(),t.forEach(o=>o.removeAttribute("data-ui-orbit-runtime"));return}if(typeof HTMLElement>"u"||typeof HTMLElement.prototype.animate!="function"){t.forEach(o=>o.removeAttribute("data-ui-orbit-runtime"));return}const s=this._motionPreset(),c=F(this.getAttribute("duration"),18e3),a=F(this.getAttribute("delay"),0),u=S(this.getAttribute("speed"),1);for(const o of t){const l=o.style.getPropertyValue("--ui-orbit-radius")||"var(--ui-orbiter-orbit-radius)",d=g(o.style.getPropertyValue("--ui-orbit-start-angle"),C),r=g(o.style.getPropertyValue("--ui-orbit-quarter-angle"),d+90),b=g(o.style.getPropertyValue("--ui-orbit-half-angle"),d+180),f=g(o.style.getPropertyValue("--ui-orbit-three-quarter-angle"),d+270),y=g(o.style.getPropertyValue("--ui-orbit-end-angle"),d+360),p=S(o.style.getPropertyValue("--ui-orbit-duration-scale"),1),T=c*s.durationScale*p/u;this._animations.get(o)?.cancel(),o.setAttribute("data-ui-orbit-runtime","");const n=o.animate([{transform:v(d,l),offset:0},{transform:v(r,l),offset:.25},{transform:v(b,l),offset:.5},{transform:v(f,l),offset:.75},{transform:v(y,l),offset:1}],{duration:Math.max(1,T),delay:Math.max(0,a),easing:"linear",iterations:Number.POSITIVE_INFINITY,fill:"both"});this._animations.set(o,n)}}_cancelAnimation(t){const e=this._animations.get(t);t.removeAttribute("data-ui-orbit-runtime"),e&&(e.cancel(),this._animations.delete(t))}_cancelAllAnimations(){for(const t of this._animations.values())t.cancel();this._animations.clear(),this._items.forEach(t=>{t.removeAttribute("data-ui-orbit-runtime"),this._unbindItemHover(t)})}_effectivePaused(){return!!(this.hasAttribute("paused")||this.hasAttribute("pause-on-hover")&&this._hovering||this.hasAttribute("pause-on-item-hover")&&this._itemHovering||this.hasAttribute("pause-on-focus")&&this._focusWithin)}_syncState(){const t=this._effectivePaused()?"paused":"running";this.setAttribute("data-state",t),this.setAttribute("data-path-visible",this._pathVisible()?"true":"false"),this.setAttribute("data-item-hovered",this._itemHovering?"true":"false");for(const e of this._animations.values())t==="paused"?e.pause():e.play()}}typeof customElements<"u"&&!customElements.get("ui-orbiter")&&customElements.define("ui-orbiter",D);exports.UIOrbiter=D;
|
package/dist/orbiter.esm.js
CHANGED
|
@@ -66,40 +66,23 @@ const O = "18s", V = "0s", A = "88px", P = "44px", w = "128px", E = "28px", $ =
|
|
|
66
66
|
--ui-orbiter-center-size: ${w};
|
|
67
67
|
--ui-orbiter-ring-gap: ${E};
|
|
68
68
|
--ui-orbiter-padding: ${$};
|
|
69
|
-
--ui-orbiter-radius:
|
|
69
|
+
--ui-orbiter-radius: calc(var(--ui-radius, 6px) + 4px);
|
|
70
70
|
--ui-orbiter-stage-size:
|
|
71
71
|
calc((2 * var(--ui-orbiter-farthest-radius, ${A})) + var(--ui-orbiter-item-size));
|
|
72
72
|
--ui-orbiter-accent: var(--ui-color-primary, var(--ui-primary, #2563eb));
|
|
73
|
-
--ui-orbiter-bg:
|
|
74
|
-
radial-gradient(
|
|
75
|
-
circle at 50% 50%,
|
|
76
|
-
color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 92%, transparent) 0%,
|
|
77
|
-
color-mix(in srgb, var(--ui-color-surface, #ffffff) 98%, transparent) 64%,
|
|
78
|
-
color-mix(in srgb, var(--ui-color-surface, #ffffff) 84%, transparent) 100%
|
|
79
|
-
);
|
|
73
|
+
--ui-orbiter-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
|
|
80
74
|
--ui-orbiter-color: var(--ui-color-text, #0f172a);
|
|
81
|
-
--ui-orbiter-border-color:
|
|
82
|
-
color-mix(in srgb, var(--ui-color-border, rgba(15, 23, 42, 0.16)) 86%, transparent);
|
|
75
|
+
--ui-orbiter-border-color: var(--ui-color-line-subtle, color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent));
|
|
83
76
|
--ui-orbiter-border: 1px solid var(--ui-orbiter-border-color);
|
|
84
|
-
--ui-orbiter-shadow:
|
|
85
|
-
0 1px 3px rgba(15, 23, 42, 0.06),
|
|
86
|
-
0 24px 44px rgba(15, 23, 42, 0.12);
|
|
77
|
+
--ui-orbiter-shadow: none;
|
|
87
78
|
--ui-orbiter-backdrop: none;
|
|
88
79
|
--ui-orbiter-path-color:
|
|
89
80
|
color-mix(in srgb, var(--ui-orbiter-accent) 16%, var(--ui-orbiter-border-color));
|
|
90
81
|
--ui-orbiter-path-opacity: 0.95;
|
|
91
|
-
--ui-orbiter-item-bg:
|
|
92
|
-
linear-gradient(
|
|
93
|
-
180deg,
|
|
94
|
-
color-mix(in srgb, #ffffff 96%, transparent),
|
|
95
|
-
color-mix(in srgb, var(--ui-orbiter-accent) 8%, rgba(255, 255, 255, 0.9))
|
|
96
|
-
);
|
|
82
|
+
--ui-orbiter-item-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
|
|
97
83
|
--ui-orbiter-item-color: var(--ui-orbiter-color);
|
|
98
|
-
--ui-orbiter-item-border:
|
|
99
|
-
|
|
100
|
-
--ui-orbiter-item-shadow:
|
|
101
|
-
0 8px 14px rgba(15, 23, 42, 0.08),
|
|
102
|
-
0 1px 2px rgba(15, 23, 42, 0.05);
|
|
84
|
+
--ui-orbiter-item-border: 1px solid var(--ui-color-line-subtle, color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent));
|
|
85
|
+
--ui-orbiter-item-shadow: none;
|
|
103
86
|
--ui-orbiter-item-backdrop: none;
|
|
104
87
|
--ui-orbiter-center-bg:
|
|
105
88
|
radial-gradient(
|
|
@@ -425,7 +408,7 @@ const O = "18s", V = "0s", A = "88px", P = "44px", w = "128px", E = "28px", $ =
|
|
|
425
408
|
outline: none;
|
|
426
409
|
border-color: color-mix(in srgb, var(--ui-orbiter-focus-ring) 30%, transparent);
|
|
427
410
|
box-shadow:
|
|
428
|
-
0 0 0
|
|
411
|
+
0 0 0 2px var(--ui-ring-color, var(--ui-orbiter-focus-ring)),
|
|
429
412
|
var(--ui-orbiter-item-shadow);
|
|
430
413
|
}
|
|
431
414
|
|
|
@@ -493,7 +476,7 @@ const O = "18s", V = "0s", A = "88px", P = "44px", w = "128px", E = "28px", $ =
|
|
|
493
476
|
outline: none;
|
|
494
477
|
border-color: color-mix(in srgb, var(--ui-orbiter-focus-ring) 24%, transparent);
|
|
495
478
|
box-shadow:
|
|
496
|
-
0 0 0
|
|
479
|
+
0 0 0 2px var(--ui-ring-color, var(--ui-orbiter-focus-ring)),
|
|
497
480
|
var(--ui-orbiter-shadow);
|
|
498
481
|
}
|
|
499
482
|
|
|
@@ -545,8 +528,8 @@ function h(i, t) {
|
|
|
545
528
|
if (!e) return t;
|
|
546
529
|
const s = e.split(/\s+/).filter(Boolean);
|
|
547
530
|
if (!s.length) return t;
|
|
548
|
-
const
|
|
549
|
-
return
|
|
531
|
+
const c = s.map((a) => /^-?\d+(\.\d+)?$/.test(a) ? `${a}px` : /^-?\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex|vmin|vmax)$/.test(a) ? a : null);
|
|
532
|
+
return c.some((a) => a === null) ? t : c.join(" ");
|
|
550
533
|
}
|
|
551
534
|
function F(i, t) {
|
|
552
535
|
if (i == null || i === "") return t;
|
|
@@ -671,39 +654,39 @@ class Q extends U {
|
|
|
671
654
|
return this._centerSlot ? this._centerSlot.assignedElements({ flatten: !0 }).filter((t) => t instanceof HTMLElement) : [];
|
|
672
655
|
}
|
|
673
656
|
_syncItems() {
|
|
674
|
-
const t = this._itemsFromSlot(), e = this._centerFromSlot(), s = new Set(t),
|
|
657
|
+
const t = this._itemsFromSlot(), e = this._centerFromSlot(), s = new Set(t), c = new Set(e);
|
|
675
658
|
for (const r of this._items)
|
|
676
659
|
s.has(r) || (this._unbindItemHover(r), this._cancelAnimation(r), r.removeAttribute("data-ui-orbiter-managed"), r.removeAttribute("data-ui-orbit-runtime"), r.style.removeProperty("--ui-orbit-index"), r.style.removeProperty("--ui-orbit-ring"), r.style.removeProperty("--ui-orbit-radius"), r.style.removeProperty("--ui-orbit-start-angle"), r.style.removeProperty("--ui-orbit-quarter-angle"), r.style.removeProperty("--ui-orbit-half-angle"), r.style.removeProperty("--ui-orbit-three-quarter-angle"), r.style.removeProperty("--ui-orbit-end-angle"), r.style.removeProperty("--ui-orbit-start-angle-inverse"), r.style.removeProperty("--ui-orbit-quarter-angle-inverse"), r.style.removeProperty("--ui-orbit-half-angle-inverse"), r.style.removeProperty("--ui-orbit-three-quarter-angle-inverse"), r.style.removeProperty("--ui-orbit-end-angle-inverse"), r.style.removeProperty("--ui-orbit-duration"), r.style.removeProperty("--ui-orbit-duration-scale"), r.style.removeProperty("animation"), r.style.removeProperty("transform"), r.hasAttribute("data-ui-orbiter-owned") && (r.removeAttribute("data-ui-orbiter-item"), r.removeAttribute("data-ui-orbiter-owned")));
|
|
677
660
|
for (const r of this._centerNodes)
|
|
678
|
-
|
|
661
|
+
c.has(r) || (r.removeAttribute("data-ui-orbiter-managed"), r.hasAttribute("data-ui-orbiter-owned") && (r.removeAttribute("data-ui-orbiter-center"), r.removeAttribute("data-ui-orbiter-owned")));
|
|
679
662
|
e.forEach((r) => {
|
|
680
663
|
r.setAttribute("data-ui-orbiter-managed", ""), r.hasAttribute("data-ui-orbiter-center") || (r.setAttribute("data-ui-orbiter-center", ""), r.setAttribute("data-ui-orbiter-owned", "")), r.setAttribute("slot", "center");
|
|
681
664
|
});
|
|
682
665
|
const a = z(this.getAttribute("rings")), u = h(this._orbitRadiusValue(), this._sizePreset().orbitRadius), o = h(this.getAttribute("ring-gap"), this._sizePreset().ringGap), l = g(this.getAttribute("start-angle"), C), d = Array.from({ length: a }, () => []);
|
|
683
|
-
t.forEach((r,
|
|
684
|
-
r.setAttribute("data-ui-orbiter-managed", ""), r.hasAttribute("data-ui-orbiter-item") || (r.setAttribute("data-ui-orbiter-item", ""), r.setAttribute("data-ui-orbiter-owned", "")), this._bindItemHover(r), d[
|
|
685
|
-
}), d.forEach((r,
|
|
686
|
-
const f = r.length ? 360 / r.length : 360, y = r.length > 1 &&
|
|
666
|
+
t.forEach((r, b) => {
|
|
667
|
+
r.setAttribute("data-ui-orbiter-managed", ""), r.hasAttribute("data-ui-orbiter-item") || (r.setAttribute("data-ui-orbiter-item", ""), r.setAttribute("data-ui-orbiter-owned", "")), this._bindItemHover(r), d[b % a].push({ item: r, index: b });
|
|
668
|
+
}), d.forEach((r, b) => {
|
|
669
|
+
const f = r.length ? 360 / r.length : 360, y = r.length > 1 && b % 2 === 1 ? f / 2 : 0, p = b === 0 ? u : `calc(${u} + ${b} * ${o})`, x = 360 * this._directionSign(b);
|
|
687
670
|
r.forEach(({ item: n, index: D }, G) => {
|
|
688
|
-
const m = l + y + G * f, R = m + x, k = m + x * 0.25, I = m + x * 0.5, L = m + x * 0.75, H = 1 +
|
|
689
|
-
n.style.setProperty("--ui-orbit-index", String(D)), n.style.setProperty("--ui-orbit-ring", String(
|
|
671
|
+
const m = l + y + G * f, R = m + x, k = m + x * 0.25, I = m + x * 0.5, L = m + x * 0.75, H = 1 + b * 0.14;
|
|
672
|
+
n.style.setProperty("--ui-orbit-index", String(D)), n.style.setProperty("--ui-orbit-ring", String(b)), n.style.setProperty("--ui-orbit-radius", p), n.style.setProperty("--ui-orbit-duration", `calc(var(--ui-orbiter-duration) * ${H})`), n.style.setProperty("--ui-orbit-duration-scale", String(H)), n.style.setProperty("--ui-orbit-start-angle", `${m}deg`), n.style.setProperty("--ui-orbit-quarter-angle", `${k}deg`), n.style.setProperty("--ui-orbit-half-angle", `${I}deg`), n.style.setProperty("--ui-orbit-three-quarter-angle", `${L}deg`), n.style.setProperty("--ui-orbit-end-angle", `${R}deg`), n.style.setProperty("--ui-orbit-start-angle-inverse", `${-m}deg`), n.style.setProperty("--ui-orbit-quarter-angle-inverse", `${-k}deg`), n.style.setProperty("--ui-orbit-half-angle-inverse", `${-I}deg`), n.style.setProperty("--ui-orbit-three-quarter-angle-inverse", `${-L}deg`), n.style.setProperty("--ui-orbit-end-angle-inverse", `${-R}deg`), n.style.setProperty("transform", v(m, p));
|
|
690
673
|
});
|
|
691
674
|
}), this._items = t, this._centerNodes = e, this._itemHovering = this._items.some((r) => r.matches(":hover")), this.setAttribute("data-item-count", String(this._items.length)), this.setAttribute("data-center-count", String(this._centerNodes.length)), this.setAttribute("data-ring-count", String(a));
|
|
692
675
|
}
|
|
693
676
|
_renderPaths() {
|
|
694
677
|
if (!this._pathsEl) return;
|
|
695
|
-
const t = z(this.getAttribute("rings")), e = h(this._orbitRadiusValue(), this._sizePreset().orbitRadius), s = h(this.getAttribute("ring-gap"), this._sizePreset().ringGap),
|
|
678
|
+
const t = z(this.getAttribute("rings")), e = h(this._orbitRadiusValue(), this._sizePreset().orbitRadius), s = h(this.getAttribute("ring-gap"), this._sizePreset().ringGap), c = Array.from({ length: t }, (a, u) => {
|
|
696
679
|
const o = u === 0 ? e : `calc(${e} + ${u} * ${s})`;
|
|
697
680
|
return `<div class="path" part="path path-${u + 1}" style="inline-size:calc(2 * (${o}));block-size:calc(2 * (${o}));"></div>`;
|
|
698
681
|
}).join("");
|
|
699
|
-
this._pathsEl.innerHTML =
|
|
682
|
+
this._pathsEl.innerHTML = c, this._pathsEl.toggleAttribute("hidden", !this._pathVisible());
|
|
700
683
|
}
|
|
701
684
|
_bindItemHover(t) {
|
|
702
685
|
if (this._itemHoverHandlers.has(t)) return;
|
|
703
686
|
const e = () => {
|
|
704
687
|
this._itemHovering = !0, this._syncState();
|
|
705
|
-
}, s = (
|
|
706
|
-
const u = (
|
|
688
|
+
}, s = (c) => {
|
|
689
|
+
const u = (c.relatedTarget instanceof HTMLElement ? c.relatedTarget : null)?.closest("[data-ui-orbiter-item]");
|
|
707
690
|
this._itemHovering = u instanceof HTMLElement ? this._items.includes(u) : !1, this._syncState();
|
|
708
691
|
};
|
|
709
692
|
t.addEventListener("pointerenter", e), t.addEventListener("pointerleave", s), this._itemHoverHandlers.set(t, { enter: e, leave: s });
|
|
@@ -754,8 +737,8 @@ class Q extends U {
|
|
|
754
737
|
return this.getAttribute("icon-size") ?? this.getAttribute("item-size");
|
|
755
738
|
}
|
|
756
739
|
_syncRuntimeStyles() {
|
|
757
|
-
const t = this._sizePreset(), e = this._motionPreset(), s = F(this.getAttribute("duration"), O),
|
|
758
|
-
this.style.setProperty("--ui-orbiter-duration", `calc((${s}) * ${e.durationScale} / ${
|
|
740
|
+
const t = this._sizePreset(), e = this._motionPreset(), s = F(this.getAttribute("duration"), O), c = F(this.getAttribute("delay"), V), a = h(this._orbitRadiusValue(), t.orbitRadius), u = h(this._iconSizeValue(), t.itemSize), o = h(this.getAttribute("center-size"), t.centerSize), l = h(this.getAttribute("ring-gap"), t.ringGap), d = h(this.getAttribute("padding"), t.padding), r = z(this.getAttribute("rings")), b = S(this.getAttribute("speed"), 1), f = r <= 1 ? a : `calc(${a} + ${r - 1} * ${l})`, y = `calc((2 * (${f})) + ${u})`;
|
|
741
|
+
this.style.setProperty("--ui-orbiter-duration", `calc((${s}) * ${e.durationScale} / ${b})`), this.style.setProperty("--ui-orbiter-delay", c), this.style.setProperty("--ui-orbiter-orbit-radius", a), this.style.setProperty("--ui-orbiter-item-size", u), this.style.setProperty("--ui-orbiter-center-size", o), this.style.setProperty("--ui-orbiter-ring-gap", l), this.style.setProperty("--ui-orbiter-padding", d), this.style.setProperty("--ui-orbiter-farthest-radius", f), this.style.setProperty("--ui-orbiter-stage-size", y), this.style.setProperty("--ui-orbiter-path-opacity", String(e.accentOpacity > 0.18 ? 1 : 0.95));
|
|
759
742
|
const p = this.getAttribute("surface-radius");
|
|
760
743
|
!p || B.has(p.trim()) ? this.style.removeProperty("--ui-orbiter-radius") : this.style.setProperty("--ui-orbiter-radius", h(p, t.panelRadius));
|
|
761
744
|
}
|
|
@@ -771,15 +754,15 @@ class Q extends U {
|
|
|
771
754
|
t.forEach((o) => o.removeAttribute("data-ui-orbit-runtime"));
|
|
772
755
|
return;
|
|
773
756
|
}
|
|
774
|
-
const s = this._motionPreset(),
|
|
757
|
+
const s = this._motionPreset(), c = M(this.getAttribute("duration"), 18e3), a = M(this.getAttribute("delay"), 0), u = S(this.getAttribute("speed"), 1);
|
|
775
758
|
for (const o of t) {
|
|
776
|
-
const l = o.style.getPropertyValue("--ui-orbit-radius") || "var(--ui-orbiter-orbit-radius)", d = g(o.style.getPropertyValue("--ui-orbit-start-angle"), C), r = g(o.style.getPropertyValue("--ui-orbit-quarter-angle"), d + 90),
|
|
759
|
+
const l = o.style.getPropertyValue("--ui-orbit-radius") || "var(--ui-orbiter-orbit-radius)", d = g(o.style.getPropertyValue("--ui-orbit-start-angle"), C), r = g(o.style.getPropertyValue("--ui-orbit-quarter-angle"), d + 90), b = g(o.style.getPropertyValue("--ui-orbit-half-angle"), d + 180), f = g(o.style.getPropertyValue("--ui-orbit-three-quarter-angle"), d + 270), y = g(o.style.getPropertyValue("--ui-orbit-end-angle"), d + 360), p = S(o.style.getPropertyValue("--ui-orbit-duration-scale"), 1), T = c * s.durationScale * p / u;
|
|
777
760
|
this._animations.get(o)?.cancel(), o.setAttribute("data-ui-orbit-runtime", "");
|
|
778
761
|
const n = o.animate(
|
|
779
762
|
[
|
|
780
763
|
{ transform: v(d, l), offset: 0 },
|
|
781
764
|
{ transform: v(r, l), offset: 0.25 },
|
|
782
|
-
{ transform: v(
|
|
765
|
+
{ transform: v(b, l), offset: 0.5 },
|
|
783
766
|
{ transform: v(f, l), offset: 0.75 },
|
|
784
767
|
{ transform: v(y, l), offset: 1 }
|
|
785
768
|
],
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";const v=`
|
|
2
|
+
[data-ui-overlay] {
|
|
3
|
+
--ui-overlay-shift: 4px;
|
|
4
|
+
--ui-overlay-from: translate3d(0, 0, 0);
|
|
5
|
+
--ui-overlay-ox: center;
|
|
6
|
+
--ui-overlay-oy: center;
|
|
7
|
+
transform-origin: var(--ui-overlay-ox) var(--ui-overlay-oy);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-ui-overlay][data-side="top"] { --ui-overlay-from: translate3d(0, var(--ui-overlay-shift), 0); --ui-overlay-oy: bottom; }
|
|
11
|
+
[data-ui-overlay][data-side="bottom"] { --ui-overlay-from: translate3d(0, calc(var(--ui-overlay-shift) * -1), 0); --ui-overlay-oy: top; }
|
|
12
|
+
[data-ui-overlay][data-side="left"] { --ui-overlay-from: translate3d(var(--ui-overlay-shift), 0, 0); --ui-overlay-ox: right; }
|
|
13
|
+
[data-ui-overlay][data-side="right"] { --ui-overlay-from: translate3d(calc(var(--ui-overlay-shift) * -1), 0, 0); --ui-overlay-ox: left; }
|
|
14
|
+
[data-ui-overlay][data-align="start"][data-side="top"],
|
|
15
|
+
[data-ui-overlay][data-align="start"][data-side="bottom"] { --ui-overlay-ox: left; }
|
|
16
|
+
[data-ui-overlay][data-align="end"][data-side="top"],
|
|
17
|
+
[data-ui-overlay][data-align="end"][data-side="bottom"] { --ui-overlay-ox: right; }
|
|
18
|
+
[data-ui-overlay][data-align="start"][data-side="left"],
|
|
19
|
+
[data-ui-overlay][data-align="start"][data-side="right"] { --ui-overlay-oy: top; }
|
|
20
|
+
[data-ui-overlay][data-align="end"][data-side="left"],
|
|
21
|
+
[data-ui-overlay][data-align="end"][data-side="right"] { --ui-overlay-oy: bottom; }
|
|
22
|
+
|
|
23
|
+
[data-ui-overlay][data-state="open"] {
|
|
24
|
+
animation: ui-overlay-in var(--ui-overlay-in-duration, 150ms) var(--ui-motion-enter-easing, cubic-bezier(0.16, 1, 0.3, 1)) backwards;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-ui-overlay][data-instant][data-state="open"] {
|
|
28
|
+
animation: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-ui-overlay][data-state="closed"] {
|
|
32
|
+
animation: ui-overlay-out var(--ui-overlay-out-duration, 100ms) var(--ui-motion-exit-easing, cubic-bezier(0.4, 0, 1, 1)) both;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@keyframes ui-overlay-in {
|
|
37
|
+
from { opacity: 0; transform: var(--ui-overlay-from) scale(0.96); }
|
|
38
|
+
to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@keyframes ui-overlay-out {
|
|
42
|
+
from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
|
|
43
|
+
to { opacity: 0; transform: var(--ui-overlay-from) scale(0.96); }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (prefers-reduced-motion: reduce) {
|
|
47
|
+
[data-ui-overlay][data-state] { animation: none !important; }
|
|
48
|
+
}
|
|
49
|
+
`,m=()=>typeof HTMLElement<"u"&&typeof HTMLElement.prototype.showPopover=="function";function l(t,e={}){if(!(!m()||!t.isConnected))try{t.hasAttribute("popover")||t.setAttribute("popover","manual"),e.resetBox!==!1&&(t.style.setProperty("right","auto"),t.style.setProperty("bottom","auto"),t.style.setProperty("margin","0"),t.style.setProperty("border","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","visible"),t.style.setProperty("background","transparent"),t.style.setProperty("color","inherit")),t.matches(":popover-open")||t.showPopover()}catch{}}function f(t,e={}){t.setAttribute("data-ui-overlay",""),e.animate===!1&&t.setAttribute("data-instant",""),t.setAttribute("data-state","open"),e.topLayer!==!1&&l(t)}function c(t){if(typeof getComputedStyle!="function")return null;const e=getComputedStyle(t),r=(e.animationName||"").split(",").map(a=>a.trim());if(!r.length||r.every(a=>!a||a==="none"))return null;const o=a=>{const i=parseFloat(a);return Number.isFinite(i)?/ms\s*$/.test(a)?i:i*1e3:0},s=(e.animationDuration||"0s").split(",").map(o),n=(e.animationDelay||"0s").split(",").map(o);return Math.max(0,...s.map((a,i)=>a+(n[i]??n[0]??0)))}function u(t,e){t.setAttribute("data-ui-overlay",""),t.setAttribute("data-state","closed");const r=c(t);if(r===null||r<=0)return e(),()=>{};let o=!1,s=null;const n=()=>{o||(o=!0,s&&clearTimeout(s),t.removeEventListener("animationend",a),t.removeEventListener("animationcancel",a),e())},a=i=>{i.target===t&&n()};return t.addEventListener("animationend",a),t.addEventListener("animationcancel",a),s=setTimeout(n,r+60),n}function y(t){if(t)try{t.parentElement&&t.parentElement.removeChild(t)}catch{}}function p(t){t&&u(t,()=>y(t))}const d=new WeakMap;function b(t,e,r){if(r&&t.setAttribute("data-side",r),d.get(t)?.(),d.delete(t),t.setAttribute("data-ui-overlay",""),e){const o=t.hidden;t.hidden=!1,(o||t.getAttribute("data-state")!=="open")&&t.setAttribute("data-state","open");return}if(t.hidden){t.setAttribute("data-state","closed");return}d.set(t,u(t,()=>{d.delete(t),t.hidden=!0}))}exports.OVERLAY_MOTION_CSS=v;exports.closeOverlay=u;exports.liftToTopLayer=l;exports.openOverlay=f;exports.removeOverlay=y;exports.retireOverlay=p;exports.setPanelOpen=b;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
const f = `
|
|
2
|
+
[data-ui-overlay] {
|
|
3
|
+
--ui-overlay-shift: 4px;
|
|
4
|
+
--ui-overlay-from: translate3d(0, 0, 0);
|
|
5
|
+
--ui-overlay-ox: center;
|
|
6
|
+
--ui-overlay-oy: center;
|
|
7
|
+
transform-origin: var(--ui-overlay-ox) var(--ui-overlay-oy);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-ui-overlay][data-side="top"] { --ui-overlay-from: translate3d(0, var(--ui-overlay-shift), 0); --ui-overlay-oy: bottom; }
|
|
11
|
+
[data-ui-overlay][data-side="bottom"] { --ui-overlay-from: translate3d(0, calc(var(--ui-overlay-shift) * -1), 0); --ui-overlay-oy: top; }
|
|
12
|
+
[data-ui-overlay][data-side="left"] { --ui-overlay-from: translate3d(var(--ui-overlay-shift), 0, 0); --ui-overlay-ox: right; }
|
|
13
|
+
[data-ui-overlay][data-side="right"] { --ui-overlay-from: translate3d(calc(var(--ui-overlay-shift) * -1), 0, 0); --ui-overlay-ox: left; }
|
|
14
|
+
[data-ui-overlay][data-align="start"][data-side="top"],
|
|
15
|
+
[data-ui-overlay][data-align="start"][data-side="bottom"] { --ui-overlay-ox: left; }
|
|
16
|
+
[data-ui-overlay][data-align="end"][data-side="top"],
|
|
17
|
+
[data-ui-overlay][data-align="end"][data-side="bottom"] { --ui-overlay-ox: right; }
|
|
18
|
+
[data-ui-overlay][data-align="start"][data-side="left"],
|
|
19
|
+
[data-ui-overlay][data-align="start"][data-side="right"] { --ui-overlay-oy: top; }
|
|
20
|
+
[data-ui-overlay][data-align="end"][data-side="left"],
|
|
21
|
+
[data-ui-overlay][data-align="end"][data-side="right"] { --ui-overlay-oy: bottom; }
|
|
22
|
+
|
|
23
|
+
[data-ui-overlay][data-state="open"] {
|
|
24
|
+
animation: ui-overlay-in var(--ui-overlay-in-duration, 150ms) var(--ui-motion-enter-easing, cubic-bezier(0.16, 1, 0.3, 1)) backwards;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-ui-overlay][data-instant][data-state="open"] {
|
|
28
|
+
animation: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-ui-overlay][data-state="closed"] {
|
|
32
|
+
animation: ui-overlay-out var(--ui-overlay-out-duration, 100ms) var(--ui-motion-exit-easing, cubic-bezier(0.4, 0, 1, 1)) both;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@keyframes ui-overlay-in {
|
|
37
|
+
from { opacity: 0; transform: var(--ui-overlay-from) scale(0.96); }
|
|
38
|
+
to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@keyframes ui-overlay-out {
|
|
42
|
+
from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
|
|
43
|
+
to { opacity: 0; transform: var(--ui-overlay-from) scale(0.96); }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (prefers-reduced-motion: reduce) {
|
|
47
|
+
[data-ui-overlay][data-state] { animation: none !important; }
|
|
48
|
+
}
|
|
49
|
+
`, l = () => typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function";
|
|
50
|
+
function y(t, e = {}) {
|
|
51
|
+
if (!(!l() || !t.isConnected))
|
|
52
|
+
try {
|
|
53
|
+
t.hasAttribute("popover") || t.setAttribute("popover", "manual"), e.resetBox !== !1 && (t.style.setProperty("right", "auto"), t.style.setProperty("bottom", "auto"), t.style.setProperty("margin", "0"), t.style.setProperty("border", "0"), t.style.setProperty("padding", "0"), t.style.setProperty("overflow", "visible"), t.style.setProperty("background", "transparent"), t.style.setProperty("color", "inherit")), t.matches(":popover-open") || t.showPopover();
|
|
54
|
+
} catch {
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function c(t, e = {}) {
|
|
58
|
+
t.setAttribute("data-ui-overlay", ""), e.animate === !1 && t.setAttribute("data-instant", ""), t.setAttribute("data-state", "open"), e.topLayer !== !1 && y(t);
|
|
59
|
+
}
|
|
60
|
+
function v(t) {
|
|
61
|
+
if (typeof getComputedStyle != "function") return null;
|
|
62
|
+
const e = getComputedStyle(t), r = (e.animationName || "").split(",").map((a) => a.trim());
|
|
63
|
+
if (!r.length || r.every((a) => !a || a === "none")) return null;
|
|
64
|
+
const o = (a) => {
|
|
65
|
+
const i = parseFloat(a);
|
|
66
|
+
return Number.isFinite(i) ? /ms\s*$/.test(a) ? i : i * 1e3 : 0;
|
|
67
|
+
}, s = (e.animationDuration || "0s").split(",").map(o), n = (e.animationDelay || "0s").split(",").map(o);
|
|
68
|
+
return Math.max(0, ...s.map((a, i) => a + (n[i] ?? n[0] ?? 0)));
|
|
69
|
+
}
|
|
70
|
+
function u(t, e) {
|
|
71
|
+
t.setAttribute("data-ui-overlay", ""), t.setAttribute("data-state", "closed");
|
|
72
|
+
const r = v(t);
|
|
73
|
+
if (r === null || r <= 0)
|
|
74
|
+
return e(), () => {
|
|
75
|
+
};
|
|
76
|
+
let o = !1, s = null;
|
|
77
|
+
const n = () => {
|
|
78
|
+
o || (o = !0, s && clearTimeout(s), t.removeEventListener("animationend", a), t.removeEventListener("animationcancel", a), e());
|
|
79
|
+
}, a = (i) => {
|
|
80
|
+
i.target === t && n();
|
|
81
|
+
};
|
|
82
|
+
return t.addEventListener("animationend", a), t.addEventListener("animationcancel", a), s = setTimeout(n, r + 60), n;
|
|
83
|
+
}
|
|
84
|
+
function m(t) {
|
|
85
|
+
if (t)
|
|
86
|
+
try {
|
|
87
|
+
t.parentElement && t.parentElement.removeChild(t);
|
|
88
|
+
} catch {
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function p(t) {
|
|
92
|
+
t && u(t, () => m(t));
|
|
93
|
+
}
|
|
94
|
+
const d = /* @__PURE__ */ new WeakMap();
|
|
95
|
+
function b(t, e, r) {
|
|
96
|
+
if (r && t.setAttribute("data-side", r), d.get(t)?.(), d.delete(t), t.setAttribute("data-ui-overlay", ""), e) {
|
|
97
|
+
const o = t.hidden;
|
|
98
|
+
t.hidden = !1, (o || t.getAttribute("data-state") !== "open") && t.setAttribute("data-state", "open");
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (t.hidden) {
|
|
102
|
+
t.setAttribute("data-state", "closed");
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
d.set(
|
|
106
|
+
t,
|
|
107
|
+
u(t, () => {
|
|
108
|
+
d.delete(t), t.hidden = !0;
|
|
109
|
+
})
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
f as O,
|
|
114
|
+
m as a,
|
|
115
|
+
u as c,
|
|
116
|
+
y as l,
|
|
117
|
+
c as o,
|
|
118
|
+
p as r,
|
|
119
|
+
b as s
|
|
120
|
+
};
|