@editora/ui-core 0.1.24 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +339 -5
- package/dist/accordion.cjs.js +13 -12
- package/dist/accordion.esm.js +13 -12
- package/dist/alert-dialog.cjs.js +76 -45
- package/dist/alert-dialog.esm.js +179 -135
- package/dist/alert.cjs.js +41 -32
- package/dist/alert.esm.js +79 -70
- 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 +4 -4
- package/dist/animated-text.esm.js +4 -4
- package/dist/app-header.cjs.js +5 -5
- package/dist/app-header.esm.js +6 -6
- package/dist/aspect-ratio.cjs.js +10 -12
- package/dist/aspect-ratio.esm.js +11 -13
- package/dist/avatar.cjs.js +13 -17
- package/dist/avatar.esm.js +13 -17
- 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-B3PUKHQm.mjs → calendar-DmxiZrR7.mjs} +126 -117
- package/dist/{calendar-D-mXMgqc.js → calendar-o273O28D.js} +53 -44
- 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 +52 -52
- package/dist/chart.esm.js +95 -95
- package/dist/checkbox.cjs.js +19 -15
- package/dist/checkbox.esm.js +19 -15
- package/dist/collapsible.cjs.js +7 -11
- package/dist/collapsible.esm.js +7 -11
- package/dist/color-picker.cjs.js +36 -17
- package/dist/color-picker.esm.js +132 -113
- package/dist/combobox.cjs.js +57 -54
- package/dist/combobox.esm.js +62 -58
- 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/gantt-schedule.d.ts +79 -0
- package/dist/components/gantt-schedule.d.ts.map +1 -0
- 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-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-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 +186 -2
- package/dist/components/ui-gantt.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-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 +18 -15
- package/dist/data-table.esm.js +207 -187
- package/dist/date-field.cjs.js +8 -8
- package/dist/date-field.esm.js +7 -7
- package/dist/date-picker.cjs.js +27 -18
- package/dist/date-picker.esm.js +57 -48
- package/dist/date-range-picker.cjs.js +22 -17
- package/dist/date-range-picker.esm.js +31 -26
- package/dist/date-range-time-picker.cjs.js +26 -19
- package/dist/date-range-time-picker.esm.js +23 -16
- package/dist/date-time-picker.cjs.js +23 -16
- package/dist/date-time-picker.esm.js +88 -81
- package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-B4hAkt36.mjs} +75 -68
- package/dist/date-time-utils-DdigV4hs.js +1 -0
- package/dist/dialog.cjs.js +57 -41
- package/dist/dialog.esm.js +84 -51
- 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.cjs.js +22 -13
- package/dist/field.esm.js +54 -45
- package/dist/fieldset.cjs.js +18 -11
- package/dist/fieldset.esm.js +20 -13
- package/dist/file-upload.cjs.js +77 -35
- package/dist/file-upload.esm.js +152 -110
- package/dist/floating-toolbar.cjs.js +6 -7
- package/dist/floating-toolbar.esm.js +8 -9
- package/dist/form.cjs.js +20 -23
- package/dist/form.esm.js +20 -23
- package/dist/gantt.cjs.js +525 -110
- package/dist/gantt.esm.js +1882 -377
- package/dist/hover-card.cjs.js +7 -7
- package/dist/hover-card.esm.js +7 -7
- 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 +47 -19
- package/dist/inline-edit.esm.js +66 -38
- package/dist/input.cjs.js +44 -37
- package/dist/input.esm.js +59 -52
- 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/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 +48 -35
- package/dist/multi-select.esm.js +67 -53
- package/dist/navigation-menu.cjs.js +10 -10
- package/dist/navigation-menu.esm.js +33 -33
- package/dist/number-field.cjs.js +27 -16
- package/dist/number-field.esm.js +36 -25
- package/dist/odometer.cjs.js +5 -5
- package/dist/odometer.esm.js +3 -3
- 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 +38 -33
- package/dist/password-field.esm.js +62 -57
- package/dist/pin-input.cjs.js +17 -13
- package/dist/pin-input.esm.js +23 -19
- 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.d.ts +3 -1
- package/dist/portal.d.ts.map +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/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 +13 -13
- package/dist/quick-actions.esm.js +11 -11
- package/dist/radio-group.cjs.js +50 -26
- package/dist/radio-group.esm.js +53 -29
- package/dist/radio.cjs.js +15 -12
- package/dist/radio.esm.js +15 -12
- package/dist/rating.cjs.js +11 -15
- package/dist/rating.esm.js +48 -50
- package/dist/{runtime-CFnK53iC.mjs → runtime-CQM6wZOc.mjs} +498 -514
- package/dist/runtime-DxCl0A5q.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 +40 -73
- package/dist/select.esm.js +55 -87
- 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/sidebar.cjs.js +22 -22
- package/dist/sidebar.esm.js +25 -25
- 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/sortable.cjs.js +4 -5
- package/dist/sortable.esm.js +4 -5
- package/dist/spinning-text.cjs.js +4 -13
- package/dist/spinning-text.esm.js +4 -13
- package/dist/split-button.cjs.js +5 -5
- package/dist/split-button.esm.js +15 -14
- 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 +91 -21
- package/dist/tabs.esm.js +182 -112
- package/dist/tags-input.cjs.js +41 -15
- package/dist/tags-input.esm.js +73 -47
- package/dist/textarea.cjs.js +32 -33
- package/dist/textarea.esm.js +38 -39
- package/dist/theme.d.ts +25 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +7 -7
- package/dist/time-field.esm.js +6 -6
- package/dist/time-picker.cjs.js +16 -13
- package/dist/time-picker.esm.js +27 -24
- package/dist/timeline.cjs.js +10 -10
- package/dist/timeline.esm.js +7 -7
- 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 +28 -29
- package/dist/transfer-list.esm.js +28 -29
- 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 +39 -36
- package/dist/wizard.esm.js +39 -36
- 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/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
|
+
};
|
package/dist/pagination.cjs.js
CHANGED
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
max-width: 100%;
|
|
5
|
-
--ui-pagination-gap:
|
|
6
|
-
--ui-pagination-radius:
|
|
7
|
-
--ui-pagination-bg:
|
|
8
|
-
--ui-pagination-item-bg:
|
|
9
|
-
--ui-pagination-item-bg-hover: color-mix(in srgb, var(--ui-color-primary, #2563eb) 12%, transparent);
|
|
5
|
+
--ui-pagination-gap: 2px;
|
|
6
|
+
--ui-pagination-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
|
|
7
|
+
--ui-pagination-bg: transparent;
|
|
8
|
+
--ui-pagination-item-bg: transparent;
|
|
9
|
+
--ui-pagination-item-bg-hover: var(--ui-color-fill, color-mix(in srgb, var(--ui-color-primary, #2563eb) 12%, transparent));
|
|
10
10
|
--ui-pagination-active-bg: var(--ui-color-primary, #2563eb);
|
|
11
|
-
--ui-pagination-active-color: #ffffff;
|
|
12
|
-
--ui-pagination-border:
|
|
13
|
-
--ui-pagination-color: var(--ui-color-text, #0f172a);
|
|
14
|
-
--ui-pagination-muted: var(--ui-color-muted, #526175);
|
|
15
|
-
--ui-pagination-
|
|
16
|
-
--ui-pagination-
|
|
11
|
+
--ui-pagination-active-color: var(--ui-color-foreground-on-primary, #ffffff);
|
|
12
|
+
--ui-pagination-border: transparent;
|
|
13
|
+
--ui-pagination-color: var(--ui-color-text-strong, var(--ui-color-text, #0f172a));
|
|
14
|
+
--ui-pagination-muted: var(--ui-color-text-secondary, var(--ui-color-muted, #526175));
|
|
15
|
+
--ui-pagination-h: var(--ui-control-height-2, 32px);
|
|
16
|
+
--ui-pagination-padding: 0 8px;
|
|
17
|
+
--ui-pagination-font-size: var(--ui-control-font-size-2, 14px);
|
|
17
18
|
--ui-pagination-shadow: none;
|
|
18
19
|
color-scheme: light dark;
|
|
19
20
|
}
|
|
@@ -24,9 +25,9 @@
|
|
|
24
25
|
flex-wrap: wrap;
|
|
25
26
|
align-items: center;
|
|
26
27
|
gap: var(--ui-pagination-gap);
|
|
27
|
-
padding:
|
|
28
|
-
border:
|
|
29
|
-
border-radius:
|
|
28
|
+
padding: 0;
|
|
29
|
+
border: 0;
|
|
30
|
+
border-radius: var(--ui-pagination-radius);
|
|
30
31
|
background: var(--ui-pagination-bg);
|
|
31
32
|
box-shadow: var(--ui-pagination-shadow);
|
|
32
33
|
}
|
|
@@ -45,22 +46,22 @@
|
|
|
45
46
|
background: var(--ui-pagination-item-bg);
|
|
46
47
|
color: var(--ui-pagination-color);
|
|
47
48
|
font-size: var(--ui-pagination-font-size);
|
|
48
|
-
font-weight:
|
|
49
|
+
font-weight: 500;
|
|
49
50
|
line-height: 1.2;
|
|
50
51
|
box-sizing: border-box;
|
|
51
|
-
min-width:
|
|
52
|
+
min-width: var(--ui-pagination-h);
|
|
53
|
+
min-height: var(--ui-pagination-h);
|
|
52
54
|
cursor: pointer;
|
|
53
55
|
transition: border-color 130ms ease, background-color 130ms ease, color 130ms ease, transform 130ms ease;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
button:hover:not(:disabled) {
|
|
57
59
|
background: var(--ui-pagination-item-bg-hover);
|
|
58
|
-
border-color: color-mix(in srgb, var(--ui-color-primary, #2563eb) 34%, var(--ui-pagination-border));
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
button:focus-visible {
|
|
62
|
-
outline: 2px solid var(--ui-color-focus-ring, #2563eb);
|
|
63
|
-
outline-offset:
|
|
63
|
+
outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-color-focus-ring, #2563eb));
|
|
64
|
+
outline-offset: var(--ui-ring-offset, 2px);
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
button[aria-current="page"] {
|
|
@@ -77,15 +78,17 @@
|
|
|
77
78
|
:host([size="sm"]) {
|
|
78
79
|
--ui-pagination-gap: 4px;
|
|
79
80
|
--ui-pagination-radius: 8px;
|
|
80
|
-
--ui-pagination-
|
|
81
|
-
--ui-pagination-
|
|
81
|
+
--ui-pagination-h: var(--ui-control-height-1, 24px);
|
|
82
|
+
--ui-pagination-padding: 0 6px;
|
|
83
|
+
--ui-pagination-font-size: var(--ui-control-font-size-1, 12px);
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
:host([size="lg"]) {
|
|
85
87
|
--ui-pagination-gap: 8px;
|
|
86
88
|
--ui-pagination-radius: 12px;
|
|
87
|
-
--ui-pagination-
|
|
88
|
-
--ui-pagination-
|
|
89
|
+
--ui-pagination-h: var(--ui-control-height-3, 40px);
|
|
90
|
+
--ui-pagination-padding: 0 12px;
|
|
91
|
+
--ui-pagination-font-size: var(--ui-control-font-size-3, 16px);
|
|
89
92
|
}
|
|
90
93
|
|
|
91
94
|
:host([variant="classic"]) .pagination {
|
|
@@ -193,9 +196,9 @@
|
|
|
193
196
|
--ui-pagination-shadow: none;
|
|
194
197
|
}
|
|
195
198
|
}
|
|
196
|
-
`;class e extends r.ElementBase{constructor(){super(),this._page=1,this._count=1,this._headless=!1,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["page","count","headless","variant","size","aria-label"]}get page(){return this._page}set page(t){this.goToPage(t)}get count(){return this._count}set count(t){const
|
|
199
|
+
`;class e extends r.ElementBase{constructor(){super(),this._page=1,this._count=1,this._headless=!1,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["page","count","headless","variant","size","aria-label"]}get page(){return this._page}set page(t){this.goToPage(t)}get count(){return this._count}set count(t){const i=Math.max(1,Number(t)||1);this.setAttribute("count",String(i)),this._page>i&&this.setAttribute("page",String(i))}attributeChangedCallback(t,i,a){(t==="page"||t==="count"||t==="headless")&&(this._page=Math.max(1,Number(this.getAttribute("page"))||1),this._count=Math.max(1,Number(this.getAttribute("count"))||1),this._headless=this.hasAttribute("headless"),this._page>this._count&&(this._page=this._count)),this.requestRender()}render(){if(this._headless){this.setContent("");return}let t="";t+=`<button type="button" data-page="1" aria-label="First" ${this._page===1?"disabled":""}>«</button>`,t+=`<button type="button" data-page="${this._page-1}" aria-label="Previous" ${this._page===1?"disabled":""}>‹</button>`;const i=this._getPageRange(this._page,this._count);i[0]>1&&(t+='<button type="button" data-page="1">1</button>',i[0]>2&&(t+='<span class="ellipsis" aria-hidden="true">…</span>'));for(let n=i[0];n<=i[1];n++)t+=`<button type="button" data-page="${n}" ${n===this._page?'aria-current="page"':""}>${n}</button>`;i[1]<this._count&&(i[1]<this._count-1&&(t+='<span class="ellipsis" aria-hidden="true">…</span>'),t+=`<button type="button" data-page="${this._count}">${this._count}</button>`),t+=`<button type="button" data-page="${this._page+1}" aria-label="Next" ${this._page===this._count?"disabled":""}>›</button>`,t+=`<button type="button" data-page="${this._count}" aria-label="Last" ${this._page===this._count?"disabled":""}>»</button>`,this.setContent(`
|
|
197
200
|
<style>${s}</style>
|
|
198
201
|
<nav class="pagination" role="navigation" aria-label="${this.getAttribute("aria-label")||"Pagination"}" tabindex="0">
|
|
199
202
|
${t}
|
|
200
203
|
</nav>
|
|
201
|
-
`);const
|
|
204
|
+
`);const a=this.root.querySelector(".pagination");a&&(a.removeEventListener("click",this._onClick),a.addEventListener("click",this._onClick),a.removeEventListener("keydown",this._onKeyDown),a.addEventListener("keydown",this._onKeyDown))}goToPage(t){const i=Math.max(1,Math.min(this._count,Number(t)||1));i!==this._page&&this._applyPageChange(i)}nextPage(){this.goToPage(this._page+1)}prevPage(){this.goToPage(this._page-1)}firstPage(){this.goToPage(1)}lastPage(){this.goToPage(this._count)}focusCurrent(){this.root.querySelector('button[aria-current="page"]')?.focus()}_getPageRange(t,i){return i<=5?[1,i]:t<=3?[1,5]:t>=i-2?[i-4,i]:[t-2,t+2]}_onClick(t){const i=t.target.closest("button[data-page]");if(!i||i.hasAttribute("disabled"))return;const a=Number(i.getAttribute("data-page"));isNaN(a)||a<1||a>this._count||a===this._page||this._applyPageChange(a)}_onKeyDown(t){const i=this.root.querySelector(".pagination");if(!i)return;const a=Array.from(i.querySelectorAll("button:not(:disabled)")),n=this.root.activeElement;let o=a.indexOf(n);t.key==="ArrowRight"||t.key==="ArrowDown"?(o=(o+1)%a.length,a[o].focus(),t.preventDefault()):t.key==="ArrowLeft"||t.key==="ArrowUp"?(o=(o-1+a.length)%a.length,a[o].focus(),t.preventDefault()):t.key==="Home"?(a[0].focus(),t.preventDefault()):t.key==="End"&&(a[a.length-1].focus(),t.preventDefault())}_applyPageChange(t){const i=this._page,a=Math.max(1,Math.min(this._count,Number(t)||1));if(a===i)return;const n=a===1&&i!==1?"first":a===this._count&&i!==this._count?"last":a===i-1?"prev":a===i+1?"next":"change";this.setAttribute("page",String(a));const o={page:a,previousPage:i,count:this._count,reason:n};this.dispatchEvent(new CustomEvent(n,{detail:o,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:o,bubbles:!0,composed:!0}))}}typeof customElements<"u"&&!customElements.get("ui-pagination")&&customElements.define("ui-pagination",e);exports.UIPagination=e;
|