@editora/ui-core 0.1.25 → 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 +124 -0
- 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/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-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 +6 -6
- package/dist/gantt.esm.js +6 -6
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const fe=require("./ElementBase-DxbvhLJs.js"),ie=3200,ne=0,oe=0,se=3,re=4,de=.18,me=3,D="#8b5cf6",q="#f59e0b",ge="rgba(148, 163, 184, 0.34)",Q=2,xe=new Set(["none","sm","md","lg","full"]),ue=new Set(["brand","neutral","info","success","warning","danger"]),ye=new Set(["calm","smooth","snappy","surge","pulse","heartbeat"]),Y=new Set(["auto","straight","soft","arc"]),X=new Set(["forward","reverse"]),ve=new Set(["none","glow","pulse","ring","shake"]),K=["node-id","column","row","size","from","to","curve","direction","reverse","duration","delay","tone","color-start","color-end","beam-factor","trail-width","beam-width","id"],c={xxs:{nodeSize:36,hubSize:50,columnGap:72,rowGap:28,padding:12,minHeight:160,radius:16},xs:{nodeSize:46,hubSize:62,columnGap:88,rowGap:36,padding:16,minHeight:190,radius:18},sm:{nodeSize:56,hubSize:74,columnGap:108,rowGap:48,padding:20,minHeight:220,radius:22},md:{nodeSize:84,hubSize:116,columnGap:156,rowGap:72,padding:32,minHeight:320,radius:28},lg:{nodeSize:98,hubSize:132,columnGap:188,rowGap:88,padding:40,minHeight:400,radius:34}},_={calm:{durationScale:1.18,glowOpacity:.26,glowBlur:9,beamFactor:.15,pattern:"progress"},smooth:{durationScale:1,glowOpacity:.34,glowBlur:11,beamFactor:de,pattern:"progress"},snappy:{durationScale:.82,glowOpacity:.38,glowBlur:10,beamFactor:.2,pattern:"progress"},surge:{durationScale:.68,glowOpacity:.44,glowBlur:13,beamFactor:.24,pattern:"progress"},pulse:{durationScale:.92,glowOpacity:.42,glowBlur:14,beamFactor:.22,pattern:"pulse"},heartbeat:{durationScale:.86,glowOpacity:.48,glowBlur:15,beamFactor:.18,pattern:"heartbeat"}},E={brand:{start:D,end:q},neutral:{start:"#64748b",end:"#cbd5e1"},info:{start:"#38bdf8",end:"#6366f1"},success:{start:"#22c55e",end:"#14b8a6"},warning:{start:"#f59e0b",end:"#f97316"},danger:{start:"#ef4444",end:"#f97316"}},_e=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-animated-beam-required-width: 0px;
|
|
4
4
|
--ui-animated-beam-duration: ${ie}ms;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
--ui-animated-beam-beam-factor: ${de};
|
|
18
18
|
--ui-animated-beam-accent: ${D};
|
|
19
19
|
--ui-animated-beam-accent-end: ${q};
|
|
20
|
-
--ui-animated-beam-path-color: ${
|
|
20
|
+
--ui-animated-beam-path-color: ${ge};
|
|
21
21
|
--ui-animated-beam-bg: transparent;
|
|
22
22
|
--ui-animated-beam-color: var(--ui-color-text, #0f172a);
|
|
23
23
|
--ui-animated-beam-border-color:
|
|
@@ -25,24 +25,16 @@
|
|
|
25
25
|
--ui-animated-beam-border: 1px solid transparent;
|
|
26
26
|
--ui-animated-beam-shadow: none;
|
|
27
27
|
--ui-animated-beam-backdrop: none;
|
|
28
|
-
--ui-animated-beam-node-bg:
|
|
29
|
-
linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
|
|
28
|
+
--ui-animated-beam-node-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
|
|
30
29
|
--ui-animated-beam-node-color: inherit;
|
|
31
|
-
--ui-animated-beam-node-border:
|
|
32
|
-
|
|
33
|
-
--ui-animated-beam-node-shadow:
|
|
34
|
-
0 1px 2px rgba(15, 23, 42, 0.06),
|
|
35
|
-
0 14px 28px rgba(15, 23, 42, 0.1);
|
|
30
|
+
--ui-animated-beam-node-border: 1px solid var(--ui-color-line, rgba(15, 23, 42, 0.14));
|
|
31
|
+
--ui-animated-beam-node-shadow: none;
|
|
36
32
|
--ui-animated-beam-node-backdrop: none;
|
|
37
|
-
--ui-animated-beam-hub-bg:
|
|
38
|
-
|
|
39
|
-
--ui-animated-beam-hub-
|
|
40
|
-
|
|
41
|
-
--ui-animated-beam-
|
|
42
|
-
0 1px 2px rgba(15, 23, 42, 0.08),
|
|
43
|
-
0 18px 34px rgba(15, 23, 42, 0.12);
|
|
44
|
-
--ui-animated-beam-glow-opacity: ${v.smooth.glowOpacity};
|
|
45
|
-
--ui-animated-beam-glow-blur: ${v.smooth.glowBlur}px;
|
|
33
|
+
--ui-animated-beam-hub-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
|
|
34
|
+
--ui-animated-beam-hub-border: 1px solid color-mix(in srgb, var(--ui-animated-beam-accent) 40%, var(--ui-color-line, rgba(15, 23, 42, 0.14)));
|
|
35
|
+
--ui-animated-beam-hub-shadow: none;
|
|
36
|
+
--ui-animated-beam-glow-opacity: ${_.smooth.glowOpacity};
|
|
37
|
+
--ui-animated-beam-glow-blur: ${_.smooth.glowBlur}px;
|
|
46
38
|
--ui-animated-beam-core-opacity: 0.96;
|
|
47
39
|
--ui-animated-beam-trail-opacity: 0.72;
|
|
48
40
|
--ui-animated-beam-focus-ring: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
|
|
@@ -256,40 +248,40 @@
|
|
|
256
248
|
}
|
|
257
249
|
|
|
258
250
|
:host([animation="calm"]) {
|
|
259
|
-
--ui-animated-beam-glow-opacity: ${
|
|
260
|
-
--ui-animated-beam-glow-blur: ${
|
|
261
|
-
--ui-animated-beam-beam-factor: ${
|
|
251
|
+
--ui-animated-beam-glow-opacity: ${_.calm.glowOpacity};
|
|
252
|
+
--ui-animated-beam-glow-blur: ${_.calm.glowBlur}px;
|
|
253
|
+
--ui-animated-beam-beam-factor: ${_.calm.beamFactor};
|
|
262
254
|
}
|
|
263
255
|
|
|
264
256
|
:host(:not([animation])),
|
|
265
257
|
:host([animation="smooth"]) {
|
|
266
|
-
--ui-animated-beam-glow-opacity: ${
|
|
267
|
-
--ui-animated-beam-glow-blur: ${
|
|
268
|
-
--ui-animated-beam-beam-factor: ${
|
|
258
|
+
--ui-animated-beam-glow-opacity: ${_.smooth.glowOpacity};
|
|
259
|
+
--ui-animated-beam-glow-blur: ${_.smooth.glowBlur}px;
|
|
260
|
+
--ui-animated-beam-beam-factor: ${_.smooth.beamFactor};
|
|
269
261
|
}
|
|
270
262
|
|
|
271
263
|
:host([animation="snappy"]) {
|
|
272
|
-
--ui-animated-beam-glow-opacity: ${
|
|
273
|
-
--ui-animated-beam-glow-blur: ${
|
|
274
|
-
--ui-animated-beam-beam-factor: ${
|
|
264
|
+
--ui-animated-beam-glow-opacity: ${_.snappy.glowOpacity};
|
|
265
|
+
--ui-animated-beam-glow-blur: ${_.snappy.glowBlur}px;
|
|
266
|
+
--ui-animated-beam-beam-factor: ${_.snappy.beamFactor};
|
|
275
267
|
}
|
|
276
268
|
|
|
277
269
|
:host([animation="surge"]) {
|
|
278
|
-
--ui-animated-beam-glow-opacity: ${
|
|
279
|
-
--ui-animated-beam-glow-blur: ${
|
|
280
|
-
--ui-animated-beam-beam-factor: ${
|
|
270
|
+
--ui-animated-beam-glow-opacity: ${_.surge.glowOpacity};
|
|
271
|
+
--ui-animated-beam-glow-blur: ${_.surge.glowBlur}px;
|
|
272
|
+
--ui-animated-beam-beam-factor: ${_.surge.beamFactor};
|
|
281
273
|
}
|
|
282
274
|
|
|
283
275
|
:host([animation="pulse"]) {
|
|
284
|
-
--ui-animated-beam-glow-opacity: ${
|
|
285
|
-
--ui-animated-beam-glow-blur: ${
|
|
286
|
-
--ui-animated-beam-beam-factor: ${
|
|
276
|
+
--ui-animated-beam-glow-opacity: ${_.pulse.glowOpacity};
|
|
277
|
+
--ui-animated-beam-glow-blur: ${_.pulse.glowBlur}px;
|
|
278
|
+
--ui-animated-beam-beam-factor: ${_.pulse.beamFactor};
|
|
287
279
|
}
|
|
288
280
|
|
|
289
281
|
:host([animation="heartbeat"]) {
|
|
290
|
-
--ui-animated-beam-glow-opacity: ${
|
|
291
|
-
--ui-animated-beam-glow-blur: ${
|
|
292
|
-
--ui-animated-beam-beam-factor: ${
|
|
282
|
+
--ui-animated-beam-glow-opacity: ${_.heartbeat.glowOpacity};
|
|
283
|
+
--ui-animated-beam-glow-blur: ${_.heartbeat.glowBlur}px;
|
|
284
|
+
--ui-animated-beam-beam-factor: ${_.heartbeat.beamFactor};
|
|
293
285
|
}
|
|
294
286
|
|
|
295
287
|
.root {
|
|
@@ -470,7 +462,7 @@
|
|
|
470
462
|
outline: none;
|
|
471
463
|
border-color: color-mix(in srgb, var(--ui-animated-beam-focus-ring) 26%, transparent);
|
|
472
464
|
box-shadow:
|
|
473
|
-
0 0 0
|
|
465
|
+
0 0 0 2px var(--ui-ring-color, var(--ui-animated-beam-focus-ring)),
|
|
474
466
|
var(--ui-animated-beam-node-shadow);
|
|
475
467
|
}
|
|
476
468
|
|
|
@@ -507,8 +499,8 @@
|
|
|
507
499
|
--ui-animated-beam-path-color: CanvasText;
|
|
508
500
|
}
|
|
509
501
|
}
|
|
510
|
-
`;class ce extends
|
|
511
|
-
<style>${
|
|
502
|
+
`;class ce extends fe.ElementBase{constructor(){super(...arguments),this._nodeSlot=null,this._hubSlot=null,this._connectionSlot=null,this._surfaceEl=null,this._canvasEl=null,this._svgEl=null,this._defsEl=null,this._pathsEl=null,this._animationStyleEl=null,this._nodes=[],this._connections=[],this._nodeEffectAnimations=new Map,this._lastLayoutMetrics=null,this._resizeObserver=null,this._mutationObserver=null,this._mediaQuery=null,this._observedResizeElements=new Set,this._uid=`ui-animated-beam-${Math.random().toString(36).slice(2,10)}`,this._boundSlotChange=this._handleSlotChange.bind(this),this._boundReducedMotionChange=this._handleReducedMotionChange.bind(this),this._boundResize=this._handleResize.bind(this),this._refreshScheduled=!1}static get observedAttributes(){return["animation","variant","tone","size","radius","elevation","columns","rows","padding","column-gap","row-gap","min-height","node-size","hub-size","duration","delay","stagger","trail-width","beam-width","beam-factor","path","glow","node-effect","auto-fit","paused","repeat","direction","reverse","color-start","color-end","trail-color","curve"]}connectedCallback(){super.connectedCallback(),this._bindReducedMotionWatcher(),this._ensureResizeObserver(),this._ensureMutationObserver()}disconnectedCallback(){this._clearNodeEffectAnimations(),this._disconnectResizeObserver(),this._disconnectMutationObserver(),this._mediaQuery?.removeEventListener?.("change",this._boundReducedMotionChange),this._mediaQuery?.removeListener?.(this._boundReducedMotionChange),this._mediaQuery=null,super.disconnectedCallback()}attributeChangedCallback(e,t,r){if(!(t===r||!this.isConnected)){if(e==="paused"){this._syncState();return}this._syncRuntimeStyles(),this._refreshScene()}}play(){this.hasAttribute("paused")&&this.removeAttribute("paused"),this._syncState()}pause(){this.hasAttribute("paused")||this.setAttribute("paused",""),this._syncState()}refresh(){this._clearNodeEffectAnimations(),this._syncRuntimeStyles(),this._syncNodes(),this._syncConnections(),this._layoutNodes(),this._renderConnections(),this._syncObservedResizeElements(),this._syncState()}render(){this.setContent(`
|
|
503
|
+
<style>${_e}</style>
|
|
512
504
|
<style data-ui-animated-beam-animations></style>
|
|
513
505
|
<div class="root" part="root">
|
|
514
506
|
<div class="surface" part="surface">
|
|
@@ -525,7 +517,7 @@
|
|
|
525
517
|
</div>
|
|
526
518
|
</div>
|
|
527
519
|
</div>
|
|
528
|
-
`),this._surfaceEl=this.root.querySelector(".surface"),this._canvasEl=this.root.querySelector(".canvas"),this._svgEl=this.root.querySelector(".svg"),this._defsEl=this.root.querySelector("defs"),this._pathsEl=this.root.querySelector(".paths"),this._animationStyleEl=this.root.querySelector("style[data-ui-animated-beam-animations]"),this._nodeSlot=this.root.querySelector("slot:not([name])"),this._hubSlot=this.root.querySelector('slot[name="hub"]'),this._connectionSlot=this.root.querySelector('slot[name="connections"]'),this._nodeSlot?.addEventListener("slotchange",this._boundSlotChange),this._hubSlot?.addEventListener("slotchange",this._boundSlotChange),this._connectionSlot?.addEventListener("slotchange",this._boundSlotChange),this._syncRuntimeStyles(),this.refresh()}shouldRenderOnAttributeChange(){return!1}_handleSlotChange(){this._refreshScene()}_handleReducedMotionChange(){this._syncState()}_handleResize(){this._refreshScene()}_refreshScene(){this._refreshScheduled||(this._refreshScheduled=!0,queueMicrotask(()=>{this._refreshScheduled=!1,this.isConnected&&this.refresh()}))}_bindReducedMotionWatcher(){typeof window>"u"||typeof window.matchMedia!="function"||this._mediaQuery||(this._mediaQuery=window.matchMedia("(prefers-reduced-motion: reduce)"),this._mediaQuery.addEventListener?.("change",this._boundReducedMotionChange),this._mediaQuery.addListener?.(this._boundReducedMotionChange))}_prefersReducedMotion(){return!!this._mediaQuery?.matches}_ensureResizeObserver(){this._resizeObserver||typeof ResizeObserver>"u"||(this._resizeObserver=new ResizeObserver(this._boundResize),this._syncObservedResizeElements())}_disconnectResizeObserver(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null,this._observedResizeElements.clear())}_syncObservedResizeElements(){if(!this._resizeObserver)return;const e=new Set;this._canvasEl&&e.add(this._canvasEl),e.add(this);for(const t of this._nodes)e.add(t.el);for(const t of this._observedResizeElements)e.has(t)||this._resizeObserver.unobserve(t);for(const t of e)this._observedResizeElements.has(t)||this._resizeObserver.observe(t);this._observedResizeElements=e}_ensureMutationObserver(){this._mutationObserver||typeof MutationObserver>"u"||(this._mutationObserver=new MutationObserver(e=>{for(const t of e){if(t.type==="childList"){this._refreshScene();return}if(t.type==="attributes"&&t.target instanceof HTMLElement&&K.includes(t.attributeName||"")){this._refreshScene();return}}}),this._mutationObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:K}))}_disconnectMutationObserver(){this._mutationObserver?.disconnect(),this._mutationObserver=null}_syncRuntimeStyles(){const e=this._sizePreset(),t=this._motionPreset();this.style.setProperty("--ui-animated-beam-required-width",`${this._autoFit()?0:this._requiredWidthPx(e)}px`),this.style.setProperty("--ui-animated-beam-duration",`${this._durationMs()*t.durationScale}ms`),this.style.setProperty("--ui-animated-beam-delay",`${this._delayMs()}ms`),this.style.setProperty("--ui-animated-beam-stagger",`${this._staggerMs()}ms`),this.style.setProperty("--ui-animated-beam-columns",String(this._columns())),this.style.setProperty("--ui-animated-beam-padding",`${this._paddingPx(e)}px`),this.style.setProperty("--ui-animated-beam-column-gap",`${this._columnGapPx(e)}px`),this.style.setProperty("--ui-animated-beam-row-gap",`${this._rowGapPx(e)}px`),this.style.setProperty("--ui-animated-beam-node-size",`${this._nodeSizePx(e)}px`),this.style.setProperty("--ui-animated-beam-hub-size",`${this._hubSizePx(e)}px`),this.style.setProperty("--ui-animated-beam-min-height",`${this._minHeightPx(e)}px`),this.style.setProperty("--ui-animated-beam-trail-width",`${this._trailWidthPx()}px`),this.style.setProperty("--ui-animated-beam-beam-width",`${this._beamWidthPx()}px`),this.style.setProperty("--ui-animated-beam-beam-factor",String(this._beamFactor(t))),this.style.setProperty("--ui-animated-beam-glow-opacity",String(t.glowOpacity)),this.style.setProperty("--ui-animated-beam-glow-blur",`${t.glowBlur}px`);const r=this.getAttribute("radius");if(r&&!xe.has(r.trim())){const i=he(r);i?this.style.setProperty("--ui-animated-beam-radius",i):this.style.removeProperty("--ui-animated-beam-radius")}else this.style.removeProperty("--ui-animated-beam-radius");const o=this.getAttribute("color-start"),n=this.getAttribute("color-end");o?this.style.setProperty("--ui-animated-beam-accent",o):this.style.removeProperty("--ui-animated-beam-accent"),n?this.style.setProperty("--ui-animated-beam-accent-end",n):this.style.removeProperty("--ui-animated-beam-accent-end");const s=this.getAttribute("trail-color");s?this.style.setProperty("--ui-animated-beam-path-color",s):this.style.removeProperty("--ui-animated-beam-path-color")}_nodesFromSlot(){return this._nodeSlot?this._nodeSlot.assignedElements({flatten:!0}).filter(e=>e instanceof HTMLElement):[]}_hubsFromSlot(){return this._hubSlot?this._hubSlot.assignedElements({flatten:!0}).filter(e=>e instanceof HTMLElement):[]}_connectionsFromSlot(){return this._connectionSlot?this._connectionSlot.assignedElements({flatten:!0}).filter(e=>e instanceof HTMLElement):[]}_syncNodes(){const e=this._sizePreset(),t=this._columns(),r=this._declaredRows(),o=this._nodesFromSlot(),n=this._hubsFromSlot(),s=new Set([...o,...n]);for(const p of this._nodes)s.has(p.el)||Pe(p.el);const i=[];o.forEach((p,l)=>{i.push(this._buildNodeRecord(p,"node",l,t,r,e))}),n.forEach((p,l)=>{i.push(this._buildNodeRecord(p,"hub",l,t,r,e))}),this._nodes=i,this.setAttribute("data-node-count",String(o.length)),this.setAttribute("data-hub-count",String(n.length))}_buildNodeRecord(e,t,r,o,n,s){const i=t==="hub"?"data-ui-animated-beam-hub":"data-ui-animated-beam-node";e.hasAttribute(i)||e.setAttribute(i,""),e.hasAttribute("data-ui-animated-beam-managed")||e.setAttribute("data-ui-animated-beam-managed",""),e.hasAttribute("data-ui-animated-beam-node-id-owned")||e.removeAttribute("data-ui-animated-beam-node-id-owned"),t==="hub"&&e.getAttribute("slot")!=="hub"&&e.setAttribute("slot","hub");const p=this._nodeIdForElement(e,t,r),l=n?Math.max(1,Math.ceil(n/2)):t==="hub"?2:r+1,d=O(L(e.getAttribute("row"),l),1,Math.max(n||l,l)),u=t==="hub"?Math.ceil(o/2):O(r+1,1,o),h=O(L(e.getAttribute("column"),u),1,o),f=t==="hub"?s.hubSize:s.nodeSize,g=P(e.getAttribute("size"),f);return{el:e,nodeId:p,kind:t,column:h,row:d,sizePx:g,centerX:0,centerY:0,radiusPx:g/2}}_nodeIdForElement(e,t,r){const o=e.getAttribute("node-id")||e.id;if(o)return o;const n=`${t}-${r+1}`;return e.setAttribute("node-id",n),e.setAttribute("data-ui-animated-beam-node-id-owned",""),n}_syncConnections(){const e=this._motionPreset(),t=this._connectionsFromSlot(),r=new Set(t);for(const i of this._connections)r.has(i.el)||ke(i.el);const o=this._tone(),n=[],s=new Map;t.forEach((i,p)=>{i.getAttribute("slot")!=="connections"&&i.setAttribute("slot","connections"),i.hasAttribute("data-ui-animated-beam-connection")||i.setAttribute("data-ui-animated-beam-connection",""),i.hasAttribute("data-ui-animated-beam-managed")||i.setAttribute("data-ui-animated-beam-managed","");const l=i.getAttribute("from"),d=i.getAttribute("to");if(!l||!d)return;const u=Ce(i.getAttribute("tone")),h=F(i.getAttribute("duration"),this._durationMs()),f=i.getAttribute("delay"),g=s.get(l)||0;s.set(l,g+1),n.push({el:i,from:l,to:d,index:p,curve:this._curveForConnection(i),reverse:this._directionForConnection(i)==="reverse",tone:u,durationMs:h*e.durationScale,hasExplicitDelay:f!=null&&f.trim()!=="",localDelayMs:F(f,0),delayMs:0,siblingIndex:g,beamFactor:_(ae(i.getAttribute("beam-factor"),this._beamFactor(e)),.06,.48),trailWidthPx:P(i.getAttribute("trail-width"),this._trailWidthPx()),beamWidthPx:P(i.getAttribute("beam-width"),this._beamWidthPx()),colorStart:i.getAttribute("color-start")||E[u||o].start,colorEnd:i.getAttribute("color-end")||E[u||o].end})}),this._connections=n,this.setAttribute("data-connection-count",String(this._connections.length))}_curveForConnection(e){const t=e.getAttribute("curve");if(t&&Y.has(t))return t;const r=this.getAttribute("curve");return r&&Y.has(r)?r:"auto"}_directionForConnection(e){const t=e.getAttribute("direction");if(t&&X.has(t))return t;if(e.hasAttribute("reverse"))return"reverse";const r=this.getAttribute("direction");return r&&X.has(r)?r:this.hasAttribute("reverse")?"reverse":"forward"}_layoutNodes(){if(!this._canvasEl||!this._svgEl)return;const e=this._layoutMetrics();this._lastLayoutMetrics=e;const t=this._resolvedRowCount(),r=e.columns>1?(e.width-e.padding*2-e.columnGap*(e.columns-1))/e.columns:e.width-e.padding*2,o=t>1?(e.height-e.padding*2-e.rowGap*(t-1))/t:e.height-e.padding*2;for(const n of this._nodes){const s=n.sizePx*e.scale,i=e.padding+r*(n.column-.5)+e.columnGap*(n.column-1),p=e.padding+o*(n.row-.5)+e.rowGap*(n.row-1);n.centerX=i,n.centerY=p,n.radiusPx=s/2,n.el.style.left=`${i}px`,n.el.style.top=`${p}px`,n.el.style.inlineSize=`${s}px`,n.el.style.blockSize=`${s}px`,n.el.style.zIndex=n.kind==="hub"?"2":"1",n.el.style.setProperty("--ui-animated-beam-render-size",`${s}px`)}this._svgEl.setAttribute("viewBox",`0 0 ${e.width} ${e.height}`),this._canvasEl.style.minHeight=`${e.height}px`,this.setAttribute("data-row-count",String(t)),this.setAttribute("data-column-count",String(e.columns))}_renderConnections(){if(!this._defsEl||!this._pathsEl||!this._animationStyleEl)return;const e=this._lastLayoutMetrics||this._layoutMetrics(),t=_(e.scale,.72,1),r=this._nodeEffect(),o=this._motionPreset(),n=new Map(this._nodes.map(y=>[y.nodeId,y])),s=[],i=[],p=[];this._connections.forEach(y=>{const m=n.get(y.from),w=n.get(y.to);if(!m||!w)return;const x=we(m,w,y.curve);s.push({connection:y,geometry:x,travelDistance:x.length})});const l=Se(s,this._delayMs(),this._staggerMs()),d=Math.max(1,...s.map(y=>(l.get(y.connection)??this._delayMs())+y.connection.durationMs)),u=r==="none"?0:J(d),h=this._repeat()?"infinite":"1",f=[],g=new Map;s.forEach(y=>{const w=(l.get(y.connection)??this._delayMs())+y.connection.durationMs,x=be(y.connection);g.set(x,Math.max(g.get(x)??0,w))});const $=Math.max(d,...Array.from(g.values(),y=>y+u));s.forEach(y=>{const{connection:m,geometry:w,travelDistance:x}=y,z=m.reverse?$e(w):w,k=`${this._uid}-gradient-${m.index}`,A=Math.max(1,m.trailWidthPx*t),M=Math.max(1.5,m.beamWidthPx*t),C=A.toFixed(2),T=M.toFixed(2),R=Math.max(M*2,M+4*t),H=R.toFixed(2),N=z.start,G=z.end,I=0,U=_(x*m.beamFactor,M*6,x*.72);m.delayMs=l.get(m)??this._delayMs();const V=`${this._uid}-glow-${m.index}`,j=`${this._uid}-core-${m.index}`;f.push(Z(V,$,m.delayMs,m.durationMs,"var(--ui-animated-beam-glow-opacity)",o.pattern,x,R,R*1.18,U)),f.push(Z(j,$,m.delayMs,m.durationMs,"var(--ui-animated-beam-core-opacity)",o.pattern,x,M,M*1.22,U)),i.push(`
|
|
520
|
+
`),this._surfaceEl=this.root.querySelector(".surface"),this._canvasEl=this.root.querySelector(".canvas"),this._svgEl=this.root.querySelector(".svg"),this._defsEl=this.root.querySelector("defs"),this._pathsEl=this.root.querySelector(".paths"),this._animationStyleEl=this.root.querySelector("style[data-ui-animated-beam-animations]"),this._nodeSlot=this.root.querySelector("slot:not([name])"),this._hubSlot=this.root.querySelector('slot[name="hub"]'),this._connectionSlot=this.root.querySelector('slot[name="connections"]'),this._nodeSlot?.addEventListener("slotchange",this._boundSlotChange),this._hubSlot?.addEventListener("slotchange",this._boundSlotChange),this._connectionSlot?.addEventListener("slotchange",this._boundSlotChange),this._syncRuntimeStyles(),this.refresh()}shouldRenderOnAttributeChange(){return!1}_handleSlotChange(){this._refreshScene()}_handleReducedMotionChange(){this._syncState()}_handleResize(){this._refreshScene()}_refreshScene(){this._refreshScheduled||(this._refreshScheduled=!0,queueMicrotask(()=>{this._refreshScheduled=!1,this.isConnected&&this.refresh()}))}_bindReducedMotionWatcher(){typeof window>"u"||typeof window.matchMedia!="function"||this._mediaQuery||(this._mediaQuery=window.matchMedia("(prefers-reduced-motion: reduce)"),this._mediaQuery.addEventListener?.("change",this._boundReducedMotionChange),this._mediaQuery.addListener?.(this._boundReducedMotionChange))}_prefersReducedMotion(){return!!this._mediaQuery?.matches}_ensureResizeObserver(){this._resizeObserver||typeof ResizeObserver>"u"||(this._resizeObserver=new ResizeObserver(this._boundResize),this._syncObservedResizeElements())}_disconnectResizeObserver(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null,this._observedResizeElements.clear())}_syncObservedResizeElements(){if(!this._resizeObserver)return;const e=new Set;this._canvasEl&&e.add(this._canvasEl),e.add(this);for(const t of this._nodes)e.add(t.el);for(const t of this._observedResizeElements)e.has(t)||this._resizeObserver.unobserve(t);for(const t of e)this._observedResizeElements.has(t)||this._resizeObserver.observe(t);this._observedResizeElements=e}_ensureMutationObserver(){this._mutationObserver||typeof MutationObserver>"u"||(this._mutationObserver=new MutationObserver(e=>{for(const t of e){if(t.type==="childList"){this._refreshScene();return}if(t.type==="attributes"&&t.target instanceof HTMLElement&&K.includes(t.attributeName||"")){this._refreshScene();return}}}),this._mutationObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:K}))}_disconnectMutationObserver(){this._mutationObserver?.disconnect(),this._mutationObserver=null}_syncRuntimeStyles(){const e=this._sizePreset(),t=this._motionPreset();this.style.setProperty("--ui-animated-beam-required-width",`${this._autoFit()?0:this._requiredWidthPx(e)}px`),this.style.setProperty("--ui-animated-beam-duration",`${this._durationMs()*t.durationScale}ms`),this.style.setProperty("--ui-animated-beam-delay",`${this._delayMs()}ms`),this.style.setProperty("--ui-animated-beam-stagger",`${this._staggerMs()}ms`),this.style.setProperty("--ui-animated-beam-columns",String(this._columns())),this.style.setProperty("--ui-animated-beam-padding",`${this._paddingPx(e)}px`),this.style.setProperty("--ui-animated-beam-column-gap",`${this._columnGapPx(e)}px`),this.style.setProperty("--ui-animated-beam-row-gap",`${this._rowGapPx(e)}px`),this.style.setProperty("--ui-animated-beam-node-size",`${this._nodeSizePx(e)}px`),this.style.setProperty("--ui-animated-beam-hub-size",`${this._hubSizePx(e)}px`),this.style.setProperty("--ui-animated-beam-min-height",`${this._minHeightPx(e)}px`),this.style.setProperty("--ui-animated-beam-trail-width",`${this._trailWidthPx()}px`),this.style.setProperty("--ui-animated-beam-beam-width",`${this._beamWidthPx()}px`),this.style.setProperty("--ui-animated-beam-beam-factor",String(this._beamFactor(t))),this.style.setProperty("--ui-animated-beam-glow-opacity",String(t.glowOpacity)),this.style.setProperty("--ui-animated-beam-glow-blur",`${t.glowBlur}px`);const r=this.getAttribute("radius");if(r&&!xe.has(r.trim())){const i=he(r);i?this.style.setProperty("--ui-animated-beam-radius",i):this.style.removeProperty("--ui-animated-beam-radius")}else this.style.removeProperty("--ui-animated-beam-radius");const o=this.getAttribute("color-start"),n=this.getAttribute("color-end");o?this.style.setProperty("--ui-animated-beam-accent",o):this.style.removeProperty("--ui-animated-beam-accent"),n?this.style.setProperty("--ui-animated-beam-accent-end",n):this.style.removeProperty("--ui-animated-beam-accent-end");const s=this.getAttribute("trail-color");s?this.style.setProperty("--ui-animated-beam-path-color",s):this.style.removeProperty("--ui-animated-beam-path-color")}_nodesFromSlot(){return this._nodeSlot?this._nodeSlot.assignedElements({flatten:!0}).filter(e=>e instanceof HTMLElement):[]}_hubsFromSlot(){return this._hubSlot?this._hubSlot.assignedElements({flatten:!0}).filter(e=>e instanceof HTMLElement):[]}_connectionsFromSlot(){return this._connectionSlot?this._connectionSlot.assignedElements({flatten:!0}).filter(e=>e instanceof HTMLElement):[]}_syncNodes(){const e=this._sizePreset(),t=this._columns(),r=this._declaredRows(),o=this._nodesFromSlot(),n=this._hubsFromSlot(),s=new Set([...o,...n]);for(const p of this._nodes)s.has(p.el)||Pe(p.el);const i=[];o.forEach((p,l)=>{i.push(this._buildNodeRecord(p,"node",l,t,r,e))}),n.forEach((p,l)=>{i.push(this._buildNodeRecord(p,"hub",l,t,r,e))}),this._nodes=i,this.setAttribute("data-node-count",String(o.length)),this.setAttribute("data-hub-count",String(n.length))}_buildNodeRecord(e,t,r,o,n,s){const i=t==="hub"?"data-ui-animated-beam-hub":"data-ui-animated-beam-node";e.hasAttribute(i)||e.setAttribute(i,""),e.hasAttribute("data-ui-animated-beam-managed")||e.setAttribute("data-ui-animated-beam-managed",""),e.hasAttribute("data-ui-animated-beam-node-id-owned")||e.removeAttribute("data-ui-animated-beam-node-id-owned"),t==="hub"&&e.getAttribute("slot")!=="hub"&&e.setAttribute("slot","hub");const p=this._nodeIdForElement(e,t,r),l=n?Math.max(1,Math.ceil(n/2)):t==="hub"?2:r+1,d=O(L(e.getAttribute("row"),l),1,Math.max(n||l,l)),u=t==="hub"?Math.ceil(o/2):O(r+1,1,o),h=O(L(e.getAttribute("column"),u),1,o),g=t==="hub"?s.hubSize:s.nodeSize,f=P(e.getAttribute("size"),g);return{el:e,nodeId:p,kind:t,column:h,row:d,sizePx:f,centerX:0,centerY:0,radiusPx:f/2}}_nodeIdForElement(e,t,r){const o=e.getAttribute("node-id")||e.id;if(o)return o;const n=`${t}-${r+1}`;return e.setAttribute("node-id",n),e.setAttribute("data-ui-animated-beam-node-id-owned",""),n}_syncConnections(){const e=this._motionPreset(),t=this._connectionsFromSlot(),r=new Set(t);for(const i of this._connections)r.has(i.el)||ke(i.el);const o=this._tone(),n=[],s=new Map;t.forEach((i,p)=>{i.getAttribute("slot")!=="connections"&&i.setAttribute("slot","connections"),i.hasAttribute("data-ui-animated-beam-connection")||i.setAttribute("data-ui-animated-beam-connection",""),i.hasAttribute("data-ui-animated-beam-managed")||i.setAttribute("data-ui-animated-beam-managed","");const l=i.getAttribute("from"),d=i.getAttribute("to");if(!l||!d)return;const u=Ce(i.getAttribute("tone")),h=F(i.getAttribute("duration"),this._durationMs()),g=i.getAttribute("delay"),f=s.get(l)||0;s.set(l,f+1),n.push({el:i,from:l,to:d,index:p,curve:this._curveForConnection(i),reverse:this._directionForConnection(i)==="reverse",tone:u,durationMs:h*e.durationScale,hasExplicitDelay:g!=null&&g.trim()!=="",localDelayMs:F(g,0),delayMs:0,siblingIndex:f,beamFactor:v(ae(i.getAttribute("beam-factor"),this._beamFactor(e)),.06,.48),trailWidthPx:P(i.getAttribute("trail-width"),this._trailWidthPx()),beamWidthPx:P(i.getAttribute("beam-width"),this._beamWidthPx()),colorStart:i.getAttribute("color-start")||E[u||o].start,colorEnd:i.getAttribute("color-end")||E[u||o].end})}),this._connections=n,this.setAttribute("data-connection-count",String(this._connections.length))}_curveForConnection(e){const t=e.getAttribute("curve");if(t&&Y.has(t))return t;const r=this.getAttribute("curve");return r&&Y.has(r)?r:"auto"}_directionForConnection(e){const t=e.getAttribute("direction");if(t&&X.has(t))return t;if(e.hasAttribute("reverse"))return"reverse";const r=this.getAttribute("direction");return r&&X.has(r)?r:this.hasAttribute("reverse")?"reverse":"forward"}_layoutNodes(){if(!this._canvasEl||!this._svgEl)return;const e=this._layoutMetrics();this._lastLayoutMetrics=e;const t=this._resolvedRowCount(),r=e.columns>1?(e.width-e.padding*2-e.columnGap*(e.columns-1))/e.columns:e.width-e.padding*2,o=t>1?(e.height-e.padding*2-e.rowGap*(t-1))/t:e.height-e.padding*2;for(const n of this._nodes){const s=n.sizePx*e.scale,i=e.padding+r*(n.column-.5)+e.columnGap*(n.column-1),p=e.padding+o*(n.row-.5)+e.rowGap*(n.row-1);n.centerX=i,n.centerY=p,n.radiusPx=s/2,n.el.style.left=`${i}px`,n.el.style.top=`${p}px`,n.el.style.inlineSize=`${s}px`,n.el.style.blockSize=`${s}px`,n.el.style.zIndex=n.kind==="hub"?"2":"1",n.el.style.setProperty("--ui-animated-beam-render-size",`${s}px`)}this._svgEl.setAttribute("viewBox",`0 0 ${e.width} ${e.height}`),this._canvasEl.style.minHeight=`${e.height}px`,this.setAttribute("data-row-count",String(t)),this.setAttribute("data-column-count",String(e.columns))}_renderConnections(){if(!this._defsEl||!this._pathsEl||!this._animationStyleEl)return;const e=this._lastLayoutMetrics||this._layoutMetrics(),t=v(e.scale,.72,1),r=this._nodeEffect(),o=this._motionPreset(),n=new Map(this._nodes.map(y=>[y.nodeId,y])),s=[],i=[],p=[];this._connections.forEach(y=>{const m=n.get(y.from),w=n.get(y.to);if(!m||!w)return;const x=we(m,w,y.curve);s.push({connection:y,geometry:x,travelDistance:x.length})});const l=Se(s,this._delayMs(),this._staggerMs()),d=Math.max(1,...s.map(y=>(l.get(y.connection)??this._delayMs())+y.connection.durationMs)),u=r==="none"?0:J(d),h=this._repeat()?"infinite":"1",g=[],f=new Map;s.forEach(y=>{const w=(l.get(y.connection)??this._delayMs())+y.connection.durationMs,x=be(y.connection);f.set(x,Math.max(f.get(x)??0,w))});const $=Math.max(d,...Array.from(f.values(),y=>y+u));s.forEach(y=>{const{connection:m,geometry:w,travelDistance:x}=y,z=m.reverse?$e(w):w,k=`${this._uid}-gradient-${m.index}`,A=Math.max(1,m.trailWidthPx*t),M=Math.max(1.5,m.beamWidthPx*t),C=A.toFixed(2),T=M.toFixed(2),R=Math.max(M*2,M+4*t),H=R.toFixed(2),N=z.start,G=z.end,I=0,U=v(x*m.beamFactor,M*6,x*.72);m.delayMs=l.get(m)??this._delayMs();const V=`${this._uid}-glow-${m.index}`,j=`${this._uid}-core-${m.index}`;g.push(Z(V,$,m.delayMs,m.durationMs,"var(--ui-animated-beam-glow-opacity)",o.pattern,x,R,R*1.18,U)),g.push(Z(j,$,m.delayMs,m.durationMs,"var(--ui-animated-beam-core-opacity)",o.pattern,x,M,M*1.22,U)),i.push(`
|
|
529
521
|
<linearGradient id="${k}" gradientUnits="userSpaceOnUse" x1="${N.x}" y1="${N.y}" x2="${G.x}" y2="${G.y}">
|
|
530
522
|
<stop offset="0%" stop-color="${B(m.colorStart||D)}"></stop>
|
|
531
523
|
<stop offset="100%" stop-color="${B(m.colorEnd||q)}"></stop>
|
|
@@ -568,10 +560,10 @@
|
|
|
568
560
|
style="animation-name:${j};"
|
|
569
561
|
></path>
|
|
570
562
|
</g>
|
|
571
|
-
`)}),this._applyNodeEffectStyles(r,
|
|
572
|
-
`),this.setAttribute("data-path-visible",this._pathVisible()?"true":"false")}_applyNodeEffectStyles(e,t,r,o,n){const s=J(r);this._nodes.forEach((i,p)=>{const l=t.get(i.nodeId);if(e==="none"||l==null){this._nodeEffectAnimations.get(i.el)?.cancel(),this._nodeEffectAnimations.delete(i.el),le(i.el);return}const d=`${this._uid}-node-effect-${p}`;n.push(Ae(d,r,l,s,e)),i.el.style.setProperty("--ui-animated-beam-node-effect-name",d),i.el.style.setProperty("--ui-animated-beam-node-effect-cycle",`${r}ms`),i.el.style.setProperty("--ui-animated-beam-node-effect-iterations",o),this._startNodeEffectAnimation(i.el,e,r,l,s,o)})}_syncState(){const e=this.hasAttribute("paused")||this._prefersReducedMotion();this.setAttribute("data-state",e?"paused":"running"),this.setAttribute("data-reduced-motion",this._prefersReducedMotion()?"true":"false"),this.setAttribute("data-path-visible",this._pathVisible()?"true":"false"),this._syncNodeEffectAnimationState(e)}_startNodeEffectAnimation(e,t,r,o,n,s){if(typeof e.animate!="function"||this._prefersReducedMotion()||t==="none")return;this._nodeEffectAnimations.get(e)?.cancel();const i=Math.max(r,1),p=
|
|
563
|
+
`)}),this._applyNodeEffectStyles(r,f,$,h,g),this._defsEl.innerHTML=i.join(""),this._pathsEl.innerHTML=p.join(""),this._animationStyleEl.textContent=g.join(`
|
|
564
|
+
`),this.setAttribute("data-path-visible",this._pathVisible()?"true":"false")}_applyNodeEffectStyles(e,t,r,o,n){const s=J(r);this._nodes.forEach((i,p)=>{const l=t.get(i.nodeId);if(e==="none"||l==null){this._nodeEffectAnimations.get(i.el)?.cancel(),this._nodeEffectAnimations.delete(i.el),le(i.el);return}const d=`${this._uid}-node-effect-${p}`;n.push(Ae(d,r,l,s,e)),i.el.style.setProperty("--ui-animated-beam-node-effect-name",d),i.el.style.setProperty("--ui-animated-beam-node-effect-cycle",`${r}ms`),i.el.style.setProperty("--ui-animated-beam-node-effect-iterations",o),this._startNodeEffectAnimation(i.el,e,r,l,s,o)})}_syncState(){const e=this.hasAttribute("paused")||this._prefersReducedMotion();this.setAttribute("data-state",e?"paused":"running"),this.setAttribute("data-reduced-motion",this._prefersReducedMotion()?"true":"false"),this.setAttribute("data-path-visible",this._pathVisible()?"true":"false"),this._syncNodeEffectAnimationState(e)}_startNodeEffectAnimation(e,t,r,o,n,s){if(typeof e.animate!="function"||this._prefersReducedMotion()||t==="none")return;this._nodeEffectAnimations.get(e)?.cancel();const i=Math.max(r,1),p=v(o/i,0,1),l=v((o+n*.35)/i,p,1),d=v((o+n*.72)/i,l,1),u=v((o+n)/i,d,1),h=e.animate(Me(t,p,l,d,u),{duration:r,iterations:s==="infinite"?1/0:1,fill:"both",easing:"linear",delay:0});(this.hasAttribute("paused")||this._prefersReducedMotion())&&h.pause(),this._nodeEffectAnimations.set(e,h)}_syncNodeEffectAnimationState(e){this._nodeEffectAnimations.forEach(t=>{e?t.pause():t.play()})}_clearNodeEffectAnimations(){this._nodeEffectAnimations.forEach(e=>e.cancel()),this._nodeEffectAnimations.clear()}_layoutMetrics(){const e=this._sizePreset(),t=this._columns(),r=this._resolvedRowCount(),o=this._paddingPx(e),n=this._columnGapPx(e),s=this._rowGapPx(e),i=this._nodeSizePx(e),p=this._hubSizePx(e),l=this._minHeightPx(e),d=Math.max(i,Math.round(p*.86)),u=o*2+t*d+Math.max(0,t-1)*n,h=this._canvasEl?.getBoundingClientRect(),g=h?.width||this.clientWidth||0,f=this._autoFit()&&g>0&&u>0?v(g/u,.2,1):1,$=o*f,y=n*f,m=s*f,w=i*f,x=p*f,z=l*f,k=Math.max(z,$*2+r*Math.max(w,Math.round(x*.86))+Math.max(0,r-1)*m),A=this._autoFit()&&g>0?g:Math.max(g,u),M=Math.max(h?.height||this.clientHeight||0,k);return{width:A,height:M,scale:f,padding:$,columns:t,rows:r,columnGap:y,rowGap:m,nodeSize:w,hubSize:x}}_resolvedRowCount(){const e=this._declaredRows(),t=this._nodes.reduce((r,o)=>Math.max(r,o.row),1);return Math.max(1,e||t)}_declaredRows(){const e=L(this.getAttribute("rows"),NaN);return Number.isFinite(e)?O(e,1,12):null}_columns(){return O(L(this.getAttribute("columns"),me),1,6)}_paddingPx(e){return P(this.getAttribute("padding"),e.padding)}_columnGapPx(e){return P(this.getAttribute("column-gap"),e.columnGap)}_rowGapPx(e){return P(this.getAttribute("row-gap"),e.rowGap)}_nodeSizePx(e){return P(this.getAttribute("node-size"),e.nodeSize)}_hubSizePx(e){return P(this.getAttribute("hub-size"),e.hubSize)}_minHeightPx(e){return P(this.getAttribute("min-height"),e.minHeight)}_requiredWidthPx(e){const t=this._columns(),r=this._paddingPx(e),o=this._columnGapPx(e),n=this._nodeSizePx(e),s=this._hubSizePx(e),i=Math.max(n,Math.round(s*.86));return r*2+t*i+Math.max(0,t-1)*o}_autoFit(){const e=this.getAttribute("auto-fit");return e==null?!1:W(e,!0)}_trailWidthPx(){return P(this.getAttribute("trail-width"),se)}_beamWidthPx(){return P(this.getAttribute("beam-width"),re)}_durationMs(){return F(this.getAttribute("duration"),ie)}_delayMs(){return F(this.getAttribute("delay"),ne)}_staggerMs(){return F(this.getAttribute("stagger"),oe)}_beamFactor(e){return v(ae(this.getAttribute("beam-factor"),e.beamFactor),.06,.48)}_sizePreset(){const e=this.getAttribute("size");return e==="xxs"||e==="0"?c.xxs:e==="xs"?c.xs:e==="sm"||e==="1"?c.sm:e==="lg"||e==="3"?c.lg:c.md}_motionPreset(){const e=this.getAttribute("animation");return e&&ye.has(e)?_[e]:_.smooth}_tone(){const e=this.getAttribute("tone");return e&&ue.has(e)?e:"brand"}_pathVisible(){const e=this.getAttribute("path");return e==null?!0:W(e,!0)}_repeat(){const e=this.getAttribute("repeat");return e==null?!0:W(e,!0)}_nodeEffect(){const e=this.getAttribute("node-effect");return e&&ve.has(e)?e:"none"}}function we(a,e,t){const r={x:a.centerX,y:a.centerY},o={x:e.centerX,y:e.centerY},n=Math.atan2(o.y-r.y,o.x-r.x),s=te(r,n,Math.max(0,a.radiusPx-Q)),i=te(o,n+Math.PI,Math.max(0,e.radiusPx-Q)),p=i.x-s.x,l=i.y-s.y,d=Math.abs(p),u=Math.abs(l);if(t==="straight"||t==="auto"&&u<Math.max(8,Math.min(a.radiusPx,e.radiusPx)*.28))return{kind:"line",start:s,end:i,d:`M ${b(s.x)} ${b(s.y)} L ${b(i.x)} ${b(i.y)}`,length:pe(s,i)};const h=t==="arc"?.56:t==="soft"?.34:u>d*.45?.48:.4;if(d>=u){const y=Math.max(d*h,44),m={x:s.x+Math.sign(p||1)*y,y:s.y},w={x:i.x-Math.sign(p||1)*y,y:i.y};return{kind:"cubic",start:s,end:i,c1:m,c2:w,d:`M ${b(s.x)} ${b(s.y)} C ${b(m.x)} ${b(m.y)} ${b(w.x)} ${b(w.y)} ${b(i.x)} ${b(i.y)}`,length:ee(s,m,w,i)}}const g=Math.max(u*h,44),f={x:s.x,y:s.y+Math.sign(l||1)*g},$={x:i.x,y:i.y-Math.sign(l||1)*g};return{kind:"cubic",start:s,end:i,c1:f,c2:$,d:`M ${b(s.x)} ${b(s.y)} C ${b(f.x)} ${b(f.y)} ${b($.x)} ${b($.y)} ${b(i.x)} ${b(i.y)}`,length:ee(s,f,$,i)}}function $e(a){if(a.kind==="line")return{kind:"line",start:a.end,end:a.start,d:`M ${b(a.end.x)} ${b(a.end.y)} L ${b(a.start.x)} ${b(a.start.y)}`,length:a.length};const e=a.c2,t=a.c1;return{kind:"cubic",start:a.end,end:a.start,c1:e,c2:t,d:`M ${b(a.end.x)} ${b(a.end.y)} C ${b(e.x)} ${b(e.y)} ${b(t.x)} ${b(t.y)} ${b(a.start.x)} ${b(a.start.y)}`,length:a.length}}function Se(a,e,t){const r=new Map,o=new Map,n=new Map,s=new Set,i=new Set;for(const d of a){const u=be(d.connection),h=r.get(u);h?h.push(d):r.set(u,[d])}const p=d=>{const u=o.get(d);if(u!=null)return u;if(s.has(d))return e;s.add(d);const h=r.get(d);let g=e;return h?.length&&(g=h.reduce((f,$)=>{const y=l($.connection);return Math.max(f,y+$.connection.durationMs)},e)),s.delete(d),o.set(d,g),g},l=d=>{const u=n.get(d);if(u!=null)return u;if(i.has(d))return e;i.add(d);const h=p(ze(d)),g=d.hasExplicitDelay?0:d.siblingIndex*t,f=h+g+d.localDelayMs;return i.delete(d),n.set(d,f),f};for(const d of a)n.set(d.connection,l(d.connection));return n}function Z(a,e,t,r,o,n,s,i,p,l){const d=Math.max(e,1),u=v(t/d*100,0,100),h=v((t+r)/d*100,u,100),g=v(u+Math.max(r/d*100*.02,.01),u,h),f=S(u),$=S(g),y=S(h),m=b(i),w=b(p),x=b(s),z=b(l);if(n==="pulse"){const k=v(u+(h-u)*.42,g,h),A=v(u+(h-u)*.82,k,h),M=S(k),C=S(A);return`
|
|
573
565
|
@keyframes ${a} {
|
|
574
|
-
0%, ${
|
|
566
|
+
0%, ${f}% {
|
|
575
567
|
opacity: 0;
|
|
576
568
|
stroke-dasharray: ${z} ${x};
|
|
577
569
|
stroke-dashoffset: 0;
|
|
@@ -603,9 +595,9 @@
|
|
|
603
595
|
stroke-width: ${m};
|
|
604
596
|
}
|
|
605
597
|
}
|
|
606
|
-
`}if(n==="heartbeat"){const k=
|
|
598
|
+
`}if(n==="heartbeat"){const k=v(l*.72,i*4.5,s*.42),A=b(k),M=v(u+(h-u)*.24,g,h),C=v(u+(h-u)*.34,M,h),T=v(u+(h-u)*.48,C,h),R=v(u+(h-u)*.82,T,h),H=S(M),N=S(C),G=S(T),I=S(R);return`
|
|
607
599
|
@keyframes ${a} {
|
|
608
|
-
0%, ${
|
|
600
|
+
0%, ${f}% {
|
|
609
601
|
opacity: 0;
|
|
610
602
|
stroke-dasharray: ${A} ${x};
|
|
611
603
|
stroke-dashoffset: 0;
|
|
@@ -651,7 +643,7 @@
|
|
|
651
643
|
}
|
|
652
644
|
`}return`
|
|
653
645
|
@keyframes ${a} {
|
|
654
|
-
0%, ${
|
|
646
|
+
0%, ${f}% {
|
|
655
647
|
opacity: 0;
|
|
656
648
|
stroke-dasharray: 0 ${x};
|
|
657
649
|
stroke-width: ${m};
|
|
@@ -667,7 +659,7 @@
|
|
|
667
659
|
stroke-width: ${m};
|
|
668
660
|
}
|
|
669
661
|
}
|
|
670
|
-
`}function ze(a){return a.reverse?a.to:a.from}function be(a){return a.reverse?a.from:a.to}function J(a){return
|
|
662
|
+
`}function ze(a){return a.reverse?a.to:a.from}function be(a){return a.reverse?a.from:a.to}function J(a){return v(a*.16,360,900)}function Ae(a,e,t,r,o){const n=Math.max(e,1),s=v(t/n*100,0,100),i=v((t+r*.35)/n*100,s,100),p=v((t+r*.72)/n*100,i,100),l=v((t+r)/n*100,p,100),d=S(s),u=S(i),h=S(p),g=S(l);if(o==="shake"){const m=v(s+(i-s)*.3,s,i),w=v(s+(i-s)*.65,m,i),x=S(m),z=S(w);return`
|
|
671
663
|
@keyframes ${a} {
|
|
672
664
|
0%, ${d}%, 100% {
|
|
673
665
|
transform: translate(-50%, -50%) scale(1);
|
|
@@ -692,7 +684,7 @@
|
|
|
692
684
|
0 0 24px var(--ui-animated-beam-node-effect-glow);
|
|
693
685
|
}
|
|
694
686
|
${h}%,
|
|
695
|
-
${
|
|
687
|
+
${g}% {
|
|
696
688
|
transform: translate(-50%, -50%) scale(1);
|
|
697
689
|
box-shadow: var(--ui-animated-beam-node-base-shadow);
|
|
698
690
|
border-color: color-mix(in srgb, var(--ui-animated-beam-accent) 12%, rgba(15, 23, 42, 0.1));
|
|
@@ -711,10 +703,10 @@
|
|
|
711
703
|
border-color: ${o==="ring"?"color-mix(in srgb, var(--ui-animated-beam-accent-end) 34%, transparent)":"color-mix(in srgb, var(--ui-animated-beam-accent) 28%, transparent)"};
|
|
712
704
|
}
|
|
713
705
|
${h}%,
|
|
714
|
-
${
|
|
706
|
+
${g}% {
|
|
715
707
|
transform: translate(-50%, -50%) scale(1);
|
|
716
708
|
box-shadow: var(--ui-animated-beam-node-base-shadow);
|
|
717
709
|
border-color: color-mix(in srgb, var(--ui-animated-beam-accent) 12%, rgba(15, 23, 42, 0.1));
|
|
718
710
|
}
|
|
719
711
|
}
|
|
720
|
-
`}function Me(a,e=0,t=.1,r=.16,o=.2){const n={offset:0,transform:"translate(-50%, -50%) scale(1)",boxShadow:"var(--ui-animated-beam-node-base-shadow)",borderColor:"color-mix(in srgb, var(--ui-animated-beam-accent) 12%, rgba(15, 23, 42, 0.1))"};if(a==="shake"){const l=e+(t-e)*.3,d=e+(t-e)*.65;return[{...n,offset:0},{...n,offset:e},{offset:l,transform:"translate(calc(-50% - 2px), calc(-50% + 1px)) scale(1.02) rotate(-2deg)",boxShadow:"var(--ui-animated-beam-node-base-shadow), 0 0 0 5px var(--ui-animated-beam-node-effect-ring)",borderColor:"color-mix(in srgb, var(--ui-animated-beam-accent-end) 30%, transparent)"},{offset:d,transform:"translate(calc(-50% + 2px), calc(-50% - 1px)) scale(1.03) rotate(2deg)",boxShadow:"var(--ui-animated-beam-node-base-shadow), 0 0 0 5px var(--ui-animated-beam-node-effect-ring)",borderColor:"color-mix(in srgb, var(--ui-animated-beam-accent-end) 30%, transparent)"},{offset:t,transform:"translate(-50%, -50%) scale(1.03)",boxShadow:"var(--ui-animated-beam-node-base-shadow), 0 0 0 6px var(--ui-animated-beam-node-effect-ring), 0 0 24px var(--ui-animated-beam-node-effect-glow)",borderColor:"color-mix(in srgb, var(--ui-animated-beam-accent-end) 30%, transparent)"},{...n,offset:r},{...n,offset:o},{...n,offset:1}]}const s=a==="pulse"?"translate(-50%, -50%) scale(1.08)":a==="ring"?"translate(-50%, -50%) scale(1.04)":"translate(-50%, -50%) scale(1.03)",i=a==="ring"?"var(--ui-animated-beam-node-base-shadow), 0 0 0 7px var(--ui-animated-beam-node-effect-ring)":a==="pulse"?"var(--ui-animated-beam-node-base-shadow), 0 0 0 6px var(--ui-animated-beam-node-effect-ring), 0 0 20px var(--ui-animated-beam-node-effect-glow)":"var(--ui-animated-beam-node-base-shadow), 0 0 0 5px var(--ui-animated-beam-node-effect-ring), 0 0 28px var(--ui-animated-beam-node-effect-glow)",p=a==="ring"?"color-mix(in srgb, var(--ui-animated-beam-accent-end) 34%, transparent)":"color-mix(in srgb, var(--ui-animated-beam-accent) 28%, transparent)";return[{...n,offset:0},{...n,offset:e},{offset:t,transform:s,boxShadow:i,borderColor:p},{...n,offset:r},{...n,offset:o},{...n,offset:1}]}function ee(a,e,t,r){let o=0,n=a;const s=18;for(let i=1;i<=s;i+=1){const p=i/s,l=Ee(a,e,t,r,p);o+=pe(n,l),n=l}return o}function Ee(a,e,t,r,o){const n=1-o,s=n*n*n*a.x+3*n*n*o*e.x+3*n*o*o*t.x+o*o*o*r.x,i=n*n*n*a.y+3*n*n*o*e.y+3*n*o*o*t.y+o*o*o*r.y;return{x:s,y:i}}function te(a,e,t){return{x:a.x+Math.cos(e)*t,y:a.y+Math.sin(e)*t}}function Pe(a){a.removeAttribute("data-ui-animated-beam-managed"),a.removeAttribute("data-ui-animated-beam-node"),a.removeAttribute("data-ui-animated-beam-hub"),a.hasAttribute("data-ui-animated-beam-node-id-owned")&&(a.removeAttribute("node-id"),a.removeAttribute("data-ui-animated-beam-node-id-owned")),a.style.removeProperty("left"),a.style.removeProperty("top"),a.style.removeProperty("inline-size"),a.style.removeProperty("block-size"),a.style.removeProperty("z-index"),a.style.removeProperty("--ui-animated-beam-render-size"),le(a)}function ke(a){a.removeAttribute("data-ui-animated-beam-managed"),a.removeAttribute("data-ui-animated-beam-connection")}function le(a){a.style.removeProperty("--ui-animated-beam-node-effect-name"),a.style.removeProperty("--ui-animated-beam-node-effect-cycle"),a.style.removeProperty("--ui-animated-beam-node-effect-iterations")}function Ce(a){return a&&ue.has(a)?a:null}function he(a){return a?/^-?\d+(\.\d+)?$/.test(a.trim())?`${a.trim()}px`:a:null}function P(a,e){const t=he(a);if(!t)return e;const r=t.match(/-?\d+(\.\d+)?/);return r?Number.parseFloat(r[0]):e}function F(a,e){if(!a)return e;const t=a.trim();return t?/^-?\d+(\.\d+)?$/.test(t)?Number.parseFloat(t):t.endsWith("ms")?Number.parseFloat(t.slice(0,-2))||e:t.endsWith("s")?(Number.parseFloat(t.slice(0,-1))||e/1e3)*1e3:e:e}function W(a,e){if(a==null)return e;const t=a.trim().toLowerCase();return t?t==="false"||t==="0"||t==="off"||t==="no"?!1:t==="true"||t==="1"||t==="on"||t==="yes"?!0:e:!0}function L(a,e){if(a==null)return e;const t=Number.parseInt(a,10);return Number.isFinite(t)?t:e}function ae(a,e){if(a==null)return e;const t=Number.parseFloat(a);return Number.isFinite(t)?t:e}function O(a,e,t){return Math.min(t,Math.max(e,Math.round(a)))}function
|
|
712
|
+
`}function Me(a,e=0,t=.1,r=.16,o=.2){const n={offset:0,transform:"translate(-50%, -50%) scale(1)",boxShadow:"var(--ui-animated-beam-node-base-shadow)",borderColor:"color-mix(in srgb, var(--ui-animated-beam-accent) 12%, rgba(15, 23, 42, 0.1))"};if(a==="shake"){const l=e+(t-e)*.3,d=e+(t-e)*.65;return[{...n,offset:0},{...n,offset:e},{offset:l,transform:"translate(calc(-50% - 2px), calc(-50% + 1px)) scale(1.02) rotate(-2deg)",boxShadow:"var(--ui-animated-beam-node-base-shadow), 0 0 0 5px var(--ui-animated-beam-node-effect-ring)",borderColor:"color-mix(in srgb, var(--ui-animated-beam-accent-end) 30%, transparent)"},{offset:d,transform:"translate(calc(-50% + 2px), calc(-50% - 1px)) scale(1.03) rotate(2deg)",boxShadow:"var(--ui-animated-beam-node-base-shadow), 0 0 0 5px var(--ui-animated-beam-node-effect-ring)",borderColor:"color-mix(in srgb, var(--ui-animated-beam-accent-end) 30%, transparent)"},{offset:t,transform:"translate(-50%, -50%) scale(1.03)",boxShadow:"var(--ui-animated-beam-node-base-shadow), 0 0 0 6px var(--ui-animated-beam-node-effect-ring), 0 0 24px var(--ui-animated-beam-node-effect-glow)",borderColor:"color-mix(in srgb, var(--ui-animated-beam-accent-end) 30%, transparent)"},{...n,offset:r},{...n,offset:o},{...n,offset:1}]}const s=a==="pulse"?"translate(-50%, -50%) scale(1.08)":a==="ring"?"translate(-50%, -50%) scale(1.04)":"translate(-50%, -50%) scale(1.03)",i=a==="ring"?"var(--ui-animated-beam-node-base-shadow), 0 0 0 7px var(--ui-animated-beam-node-effect-ring)":a==="pulse"?"var(--ui-animated-beam-node-base-shadow), 0 0 0 6px var(--ui-animated-beam-node-effect-ring), 0 0 20px var(--ui-animated-beam-node-effect-glow)":"var(--ui-animated-beam-node-base-shadow), 0 0 0 5px var(--ui-animated-beam-node-effect-ring), 0 0 28px var(--ui-animated-beam-node-effect-glow)",p=a==="ring"?"color-mix(in srgb, var(--ui-animated-beam-accent-end) 34%, transparent)":"color-mix(in srgb, var(--ui-animated-beam-accent) 28%, transparent)";return[{...n,offset:0},{...n,offset:e},{offset:t,transform:s,boxShadow:i,borderColor:p},{...n,offset:r},{...n,offset:o},{...n,offset:1}]}function ee(a,e,t,r){let o=0,n=a;const s=18;for(let i=1;i<=s;i+=1){const p=i/s,l=Ee(a,e,t,r,p);o+=pe(n,l),n=l}return o}function Ee(a,e,t,r,o){const n=1-o,s=n*n*n*a.x+3*n*n*o*e.x+3*n*o*o*t.x+o*o*o*r.x,i=n*n*n*a.y+3*n*n*o*e.y+3*n*o*o*t.y+o*o*o*r.y;return{x:s,y:i}}function te(a,e,t){return{x:a.x+Math.cos(e)*t,y:a.y+Math.sin(e)*t}}function Pe(a){a.removeAttribute("data-ui-animated-beam-managed"),a.removeAttribute("data-ui-animated-beam-node"),a.removeAttribute("data-ui-animated-beam-hub"),a.hasAttribute("data-ui-animated-beam-node-id-owned")&&(a.removeAttribute("node-id"),a.removeAttribute("data-ui-animated-beam-node-id-owned")),a.style.removeProperty("left"),a.style.removeProperty("top"),a.style.removeProperty("inline-size"),a.style.removeProperty("block-size"),a.style.removeProperty("z-index"),a.style.removeProperty("--ui-animated-beam-render-size"),le(a)}function ke(a){a.removeAttribute("data-ui-animated-beam-managed"),a.removeAttribute("data-ui-animated-beam-connection")}function le(a){a.style.removeProperty("--ui-animated-beam-node-effect-name"),a.style.removeProperty("--ui-animated-beam-node-effect-cycle"),a.style.removeProperty("--ui-animated-beam-node-effect-iterations")}function Ce(a){return a&&ue.has(a)?a:null}function he(a){return a?/^-?\d+(\.\d+)?$/.test(a.trim())?`${a.trim()}px`:a:null}function P(a,e){const t=he(a);if(!t)return e;const r=t.match(/-?\d+(\.\d+)?/);return r?Number.parseFloat(r[0]):e}function F(a,e){if(!a)return e;const t=a.trim();return t?/^-?\d+(\.\d+)?$/.test(t)?Number.parseFloat(t):t.endsWith("ms")?Number.parseFloat(t.slice(0,-2))||e:t.endsWith("s")?(Number.parseFloat(t.slice(0,-1))||e/1e3)*1e3:e:e}function W(a,e){if(a==null)return e;const t=a.trim().toLowerCase();return t?t==="false"||t==="0"||t==="off"||t==="no"?!1:t==="true"||t==="1"||t==="on"||t==="yes"?!0:e:!0}function L(a,e){if(a==null)return e;const t=Number.parseInt(a,10);return Number.isFinite(t)?t:e}function ae(a,e){if(a==null)return e;const t=Number.parseFloat(a);return Number.isFinite(t)?t:e}function O(a,e,t){return Math.min(t,Math.max(e,Math.round(a)))}function v(a,e,t){return Math.min(t,Math.max(e,a))}function pe(a,e){return Math.hypot(e.x-a.x,e.y-a.y)}function b(a){return a.toFixed(2)}function S(a){return a.toFixed(4).replace(/\.?0+$/,"")}function B(a){return a.split("&").join("&").split('"').join(""").split("<").join("<").split(">").join(">")}typeof customElements<"u"&&!customElements.get("ui-animated-beam")&&customElements.define("ui-animated-beam",ce);exports.UIAnimatedBeam=ce;
|
|
@@ -64,7 +64,7 @@ const ie = 3200, ne = 0, oe = 0, se = 3, re = 4, de = 0.18, me = 3, D = "#8b5cf6
|
|
|
64
64
|
minHeight: 400,
|
|
65
65
|
radius: 34
|
|
66
66
|
}
|
|
67
|
-
},
|
|
67
|
+
}, _ = {
|
|
68
68
|
calm: {
|
|
69
69
|
durationScale: 1.18,
|
|
70
70
|
glowOpacity: 0.26,
|
|
@@ -114,7 +114,7 @@ const ie = 3200, ne = 0, oe = 0, se = 3, re = 4, de = 0.18, me = 3, D = "#8b5cf6
|
|
|
114
114
|
success: { start: "#22c55e", end: "#14b8a6" },
|
|
115
115
|
warning: { start: "#f59e0b", end: "#f97316" },
|
|
116
116
|
danger: { start: "#ef4444", end: "#f97316" }
|
|
117
|
-
},
|
|
117
|
+
}, ve = `
|
|
118
118
|
:host {
|
|
119
119
|
--ui-animated-beam-required-width: 0px;
|
|
120
120
|
--ui-animated-beam-duration: ${ie}ms;
|
|
@@ -141,24 +141,16 @@ const ie = 3200, ne = 0, oe = 0, se = 3, re = 4, de = 0.18, me = 3, D = "#8b5cf6
|
|
|
141
141
|
--ui-animated-beam-border: 1px solid transparent;
|
|
142
142
|
--ui-animated-beam-shadow: none;
|
|
143
143
|
--ui-animated-beam-backdrop: none;
|
|
144
|
-
--ui-animated-beam-node-bg:
|
|
145
|
-
linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
|
|
144
|
+
--ui-animated-beam-node-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
|
|
146
145
|
--ui-animated-beam-node-color: inherit;
|
|
147
|
-
--ui-animated-beam-node-border:
|
|
148
|
-
|
|
149
|
-
--ui-animated-beam-node-shadow:
|
|
150
|
-
0 1px 2px rgba(15, 23, 42, 0.06),
|
|
151
|
-
0 14px 28px rgba(15, 23, 42, 0.1);
|
|
146
|
+
--ui-animated-beam-node-border: 1px solid var(--ui-color-line, rgba(15, 23, 42, 0.14));
|
|
147
|
+
--ui-animated-beam-node-shadow: none;
|
|
152
148
|
--ui-animated-beam-node-backdrop: none;
|
|
153
|
-
--ui-animated-beam-hub-bg:
|
|
154
|
-
|
|
155
|
-
--ui-animated-beam-hub-
|
|
156
|
-
|
|
157
|
-
--ui-animated-beam-
|
|
158
|
-
0 1px 2px rgba(15, 23, 42, 0.08),
|
|
159
|
-
0 18px 34px rgba(15, 23, 42, 0.12);
|
|
160
|
-
--ui-animated-beam-glow-opacity: ${v.smooth.glowOpacity};
|
|
161
|
-
--ui-animated-beam-glow-blur: ${v.smooth.glowBlur}px;
|
|
149
|
+
--ui-animated-beam-hub-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
|
|
150
|
+
--ui-animated-beam-hub-border: 1px solid color-mix(in srgb, var(--ui-animated-beam-accent) 40%, var(--ui-color-line, rgba(15, 23, 42, 0.14)));
|
|
151
|
+
--ui-animated-beam-hub-shadow: none;
|
|
152
|
+
--ui-animated-beam-glow-opacity: ${_.smooth.glowOpacity};
|
|
153
|
+
--ui-animated-beam-glow-blur: ${_.smooth.glowBlur}px;
|
|
162
154
|
--ui-animated-beam-core-opacity: 0.96;
|
|
163
155
|
--ui-animated-beam-trail-opacity: 0.72;
|
|
164
156
|
--ui-animated-beam-focus-ring: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
|
|
@@ -372,40 +364,40 @@ const ie = 3200, ne = 0, oe = 0, se = 3, re = 4, de = 0.18, me = 3, D = "#8b5cf6
|
|
|
372
364
|
}
|
|
373
365
|
|
|
374
366
|
:host([animation="calm"]) {
|
|
375
|
-
--ui-animated-beam-glow-opacity: ${
|
|
376
|
-
--ui-animated-beam-glow-blur: ${
|
|
377
|
-
--ui-animated-beam-beam-factor: ${
|
|
367
|
+
--ui-animated-beam-glow-opacity: ${_.calm.glowOpacity};
|
|
368
|
+
--ui-animated-beam-glow-blur: ${_.calm.glowBlur}px;
|
|
369
|
+
--ui-animated-beam-beam-factor: ${_.calm.beamFactor};
|
|
378
370
|
}
|
|
379
371
|
|
|
380
372
|
:host(:not([animation])),
|
|
381
373
|
:host([animation="smooth"]) {
|
|
382
|
-
--ui-animated-beam-glow-opacity: ${
|
|
383
|
-
--ui-animated-beam-glow-blur: ${
|
|
384
|
-
--ui-animated-beam-beam-factor: ${
|
|
374
|
+
--ui-animated-beam-glow-opacity: ${_.smooth.glowOpacity};
|
|
375
|
+
--ui-animated-beam-glow-blur: ${_.smooth.glowBlur}px;
|
|
376
|
+
--ui-animated-beam-beam-factor: ${_.smooth.beamFactor};
|
|
385
377
|
}
|
|
386
378
|
|
|
387
379
|
:host([animation="snappy"]) {
|
|
388
|
-
--ui-animated-beam-glow-opacity: ${
|
|
389
|
-
--ui-animated-beam-glow-blur: ${
|
|
390
|
-
--ui-animated-beam-beam-factor: ${
|
|
380
|
+
--ui-animated-beam-glow-opacity: ${_.snappy.glowOpacity};
|
|
381
|
+
--ui-animated-beam-glow-blur: ${_.snappy.glowBlur}px;
|
|
382
|
+
--ui-animated-beam-beam-factor: ${_.snappy.beamFactor};
|
|
391
383
|
}
|
|
392
384
|
|
|
393
385
|
:host([animation="surge"]) {
|
|
394
|
-
--ui-animated-beam-glow-opacity: ${
|
|
395
|
-
--ui-animated-beam-glow-blur: ${
|
|
396
|
-
--ui-animated-beam-beam-factor: ${
|
|
386
|
+
--ui-animated-beam-glow-opacity: ${_.surge.glowOpacity};
|
|
387
|
+
--ui-animated-beam-glow-blur: ${_.surge.glowBlur}px;
|
|
388
|
+
--ui-animated-beam-beam-factor: ${_.surge.beamFactor};
|
|
397
389
|
}
|
|
398
390
|
|
|
399
391
|
:host([animation="pulse"]) {
|
|
400
|
-
--ui-animated-beam-glow-opacity: ${
|
|
401
|
-
--ui-animated-beam-glow-blur: ${
|
|
402
|
-
--ui-animated-beam-beam-factor: ${
|
|
392
|
+
--ui-animated-beam-glow-opacity: ${_.pulse.glowOpacity};
|
|
393
|
+
--ui-animated-beam-glow-blur: ${_.pulse.glowBlur}px;
|
|
394
|
+
--ui-animated-beam-beam-factor: ${_.pulse.beamFactor};
|
|
403
395
|
}
|
|
404
396
|
|
|
405
397
|
:host([animation="heartbeat"]) {
|
|
406
|
-
--ui-animated-beam-glow-opacity: ${
|
|
407
|
-
--ui-animated-beam-glow-blur: ${
|
|
408
|
-
--ui-animated-beam-beam-factor: ${
|
|
398
|
+
--ui-animated-beam-glow-opacity: ${_.heartbeat.glowOpacity};
|
|
399
|
+
--ui-animated-beam-glow-blur: ${_.heartbeat.glowBlur}px;
|
|
400
|
+
--ui-animated-beam-beam-factor: ${_.heartbeat.beamFactor};
|
|
409
401
|
}
|
|
410
402
|
|
|
411
403
|
.root {
|
|
@@ -586,7 +578,7 @@ const ie = 3200, ne = 0, oe = 0, se = 3, re = 4, de = 0.18, me = 3, D = "#8b5cf6
|
|
|
586
578
|
outline: none;
|
|
587
579
|
border-color: color-mix(in srgb, var(--ui-animated-beam-focus-ring) 26%, transparent);
|
|
588
580
|
box-shadow:
|
|
589
|
-
0 0 0
|
|
581
|
+
0 0 0 2px var(--ui-ring-color, var(--ui-animated-beam-focus-ring)),
|
|
590
582
|
var(--ui-animated-beam-node-shadow);
|
|
591
583
|
}
|
|
592
584
|
|
|
@@ -624,7 +616,7 @@ const ie = 3200, ne = 0, oe = 0, se = 3, re = 4, de = 0.18, me = 3, D = "#8b5cf6
|
|
|
624
616
|
}
|
|
625
617
|
}
|
|
626
618
|
`;
|
|
627
|
-
class
|
|
619
|
+
class _e extends pe {
|
|
628
620
|
constructor() {
|
|
629
621
|
super(...arguments), this._nodeSlot = null, this._hubSlot = null, this._connectionSlot = null, this._surfaceEl = null, this._canvasEl = null, this._svgEl = null, this._defsEl = null, this._pathsEl = null, this._animationStyleEl = null, this._nodes = [], this._connections = [], this._nodeEffectAnimations = /* @__PURE__ */ new Map(), this._lastLayoutMetrics = null, this._resizeObserver = null, this._mutationObserver = null, this._mediaQuery = null, this._observedResizeElements = /* @__PURE__ */ new Set(), this._uid = `ui-animated-beam-${Math.random().toString(36).slice(2, 10)}`, this._boundSlotChange = this._handleSlotChange.bind(this), this._boundReducedMotionChange = this._handleReducedMotionChange.bind(this), this._boundResize = this._handleResize.bind(this), this._refreshScheduled = !1;
|
|
630
622
|
}
|
|
@@ -690,7 +682,7 @@ class ve extends pe {
|
|
|
690
682
|
}
|
|
691
683
|
render() {
|
|
692
684
|
this.setContent(`
|
|
693
|
-
<style>${
|
|
685
|
+
<style>${ve}</style>
|
|
694
686
|
<style data-ui-animated-beam-animations></style>
|
|
695
687
|
<div class="root" part="root">
|
|
696
688
|
<div class="surface" part="surface">
|
|
@@ -850,7 +842,7 @@ class ve extends pe {
|
|
|
850
842
|
localDelayMs: F(g, 0),
|
|
851
843
|
delayMs: 0,
|
|
852
844
|
siblingIndex: f,
|
|
853
|
-
beamFactor:
|
|
845
|
+
beamFactor: v(ae(i.getAttribute("beam-factor"), this._beamFactor(e)), 0.06, 0.48),
|
|
854
846
|
trailWidthPx: P(i.getAttribute("trail-width"), this._trailWidthPx()),
|
|
855
847
|
beamWidthPx: P(i.getAttribute("beam-width"), this._beamWidthPx()),
|
|
856
848
|
colorStart: i.getAttribute("color-start") || E[u || o].start,
|
|
@@ -885,7 +877,7 @@ class ve extends pe {
|
|
|
885
877
|
}
|
|
886
878
|
_renderConnections() {
|
|
887
879
|
if (!this._defsEl || !this._pathsEl || !this._animationStyleEl) return;
|
|
888
|
-
const e = this._lastLayoutMetrics || this._layoutMetrics(), t =
|
|
880
|
+
const e = this._lastLayoutMetrics || this._layoutMetrics(), t = v(e.scale, 0.72, 1), r = this._nodeEffect(), o = this._motionPreset(), n = new Map(this._nodes.map((y) => [y.nodeId, y])), s = [], i = [], p = [];
|
|
889
881
|
this._connections.forEach((y) => {
|
|
890
882
|
const m = n.get(y.from), w = n.get(y.to);
|
|
891
883
|
if (!m || !w) return;
|
|
@@ -909,7 +901,7 @@ class ve extends pe {
|
|
|
909
901
|
...Array.from(f.values(), (y) => y + u)
|
|
910
902
|
);
|
|
911
903
|
s.forEach((y) => {
|
|
912
|
-
const { connection: m, geometry: w, travelDistance: x } = y, z = m.reverse ? $e(w) : w, k = `${this._uid}-gradient-${m.index}`, A = Math.max(1, m.trailWidthPx * t), M = Math.max(1.5, m.beamWidthPx * t), C = A.toFixed(2), T = M.toFixed(2), R = Math.max(M * 2, M + 4 * t), H = R.toFixed(2), N = z.start, G = z.end, I = 0, U =
|
|
904
|
+
const { connection: m, geometry: w, travelDistance: x } = y, z = m.reverse ? $e(w) : w, k = `${this._uid}-gradient-${m.index}`, A = Math.max(1, m.trailWidthPx * t), M = Math.max(1.5, m.beamWidthPx * t), C = A.toFixed(2), T = M.toFixed(2), R = Math.max(M * 2, M + 4 * t), H = R.toFixed(2), N = z.start, G = z.end, I = 0, U = v(x * m.beamFactor, M * 6, x * 0.72);
|
|
913
905
|
m.delayMs = l.get(m) ?? this._delayMs();
|
|
914
906
|
const V = `${this._uid}-glow-${m.index}`, Q = `${this._uid}-core-${m.index}`;
|
|
915
907
|
g.push(
|
|
@@ -1004,7 +996,7 @@ class ve extends pe {
|
|
|
1004
996
|
_startNodeEffectAnimation(e, t, r, o, n, s) {
|
|
1005
997
|
if (typeof e.animate != "function" || this._prefersReducedMotion() || t === "none") return;
|
|
1006
998
|
this._nodeEffectAnimations.get(e)?.cancel();
|
|
1007
|
-
const i = Math.max(r, 1), p =
|
|
999
|
+
const i = Math.max(r, 1), p = v(o / i, 0, 1), l = v((o + n * 0.35) / i, p, 1), d = v((o + n * 0.72) / i, l, 1), u = v((o + n) / i, d, 1), h = e.animate(Me(t, p, l, d, u), {
|
|
1008
1000
|
duration: r,
|
|
1009
1001
|
iterations: s === "infinite" ? 1 / 0 : 1,
|
|
1010
1002
|
fill: "both",
|
|
@@ -1022,7 +1014,7 @@ class ve extends pe {
|
|
|
1022
1014
|
this._nodeEffectAnimations.forEach((e) => e.cancel()), this._nodeEffectAnimations.clear();
|
|
1023
1015
|
}
|
|
1024
1016
|
_layoutMetrics() {
|
|
1025
|
-
const e = this._sizePreset(), t = this._columns(), r = this._resolvedRowCount(), o = this._paddingPx(e), n = this._columnGapPx(e), s = this._rowGapPx(e), i = this._nodeSizePx(e), p = this._hubSizePx(e), l = this._minHeightPx(e), d = Math.max(i, Math.round(p * 0.86)), u = o * 2 + t * d + Math.max(0, t - 1) * n, h = this._canvasEl?.getBoundingClientRect(), g = h?.width || this.clientWidth || 0, f = this._autoFit() && g > 0 && u > 0 ?
|
|
1017
|
+
const e = this._sizePreset(), t = this._columns(), r = this._resolvedRowCount(), o = this._paddingPx(e), n = this._columnGapPx(e), s = this._rowGapPx(e), i = this._nodeSizePx(e), p = this._hubSizePx(e), l = this._minHeightPx(e), d = Math.max(i, Math.round(p * 0.86)), u = o * 2 + t * d + Math.max(0, t - 1) * n, h = this._canvasEl?.getBoundingClientRect(), g = h?.width || this.clientWidth || 0, f = this._autoFit() && g > 0 && u > 0 ? v(g / u, 0.2, 1) : 1, $ = o * f, y = n * f, m = s * f, w = i * f, x = p * f, z = l * f, k = Math.max(
|
|
1026
1018
|
z,
|
|
1027
1019
|
$ * 2 + r * Math.max(w, Math.round(x * 0.86)) + Math.max(0, r - 1) * m
|
|
1028
1020
|
), A = this._autoFit() && g > 0 ? g : Math.max(g, u), M = Math.max(h?.height || this.clientHeight || 0, k);
|
|
@@ -1092,7 +1084,7 @@ class ve extends pe {
|
|
|
1092
1084
|
return F(this.getAttribute("stagger"), oe);
|
|
1093
1085
|
}
|
|
1094
1086
|
_beamFactor(e) {
|
|
1095
|
-
return
|
|
1087
|
+
return v(ae(this.getAttribute("beam-factor"), e.beamFactor), 0.06, 0.48);
|
|
1096
1088
|
}
|
|
1097
1089
|
_sizePreset() {
|
|
1098
1090
|
const e = this.getAttribute("size");
|
|
@@ -1100,7 +1092,7 @@ class ve extends pe {
|
|
|
1100
1092
|
}
|
|
1101
1093
|
_motionPreset() {
|
|
1102
1094
|
const e = this.getAttribute("animation");
|
|
1103
|
-
return e && xe.has(e) ?
|
|
1095
|
+
return e && xe.has(e) ? _[e] : _.smooth;
|
|
1104
1096
|
}
|
|
1105
1097
|
_tone() {
|
|
1106
1098
|
const e = this.getAttribute("tone");
|
|
@@ -1203,9 +1195,9 @@ function Se(a, e, t) {
|
|
|
1203
1195
|
return n;
|
|
1204
1196
|
}
|
|
1205
1197
|
function Z(a, e, t, r, o, n, s, i, p, l) {
|
|
1206
|
-
const d = Math.max(e, 1), u =
|
|
1198
|
+
const d = Math.max(e, 1), u = v(t / d * 100, 0, 100), h = v((t + r) / d * 100, u, 100), g = v(u + Math.max(r / d * 100 * 0.02, 0.01), u, h), f = S(u), $ = S(g), y = S(h), m = b(i), w = b(p), x = b(s), z = b(l);
|
|
1207
1199
|
if (n === "pulse") {
|
|
1208
|
-
const k =
|
|
1200
|
+
const k = v(u + (h - u) * 0.42, g, h), A = v(u + (h - u) * 0.82, k, h), M = S(k), C = S(A);
|
|
1209
1201
|
return `
|
|
1210
1202
|
@keyframes ${a} {
|
|
1211
1203
|
0%, ${f}% {
|
|
@@ -1243,7 +1235,7 @@ function Z(a, e, t, r, o, n, s, i, p, l) {
|
|
|
1243
1235
|
`;
|
|
1244
1236
|
}
|
|
1245
1237
|
if (n === "heartbeat") {
|
|
1246
|
-
const k =
|
|
1238
|
+
const k = v(l * 0.72, i * 4.5, s * 0.42), A = b(k), M = v(u + (h - u) * 0.24, g, h), C = v(u + (h - u) * 0.34, M, h), T = v(u + (h - u) * 0.48, C, h), R = v(u + (h - u) * 0.82, T, h), H = S(M), N = S(C), G = S(T), I = S(R);
|
|
1247
1239
|
return `
|
|
1248
1240
|
@keyframes ${a} {
|
|
1249
1241
|
0%, ${f}% {
|
|
@@ -1319,12 +1311,12 @@ function ce(a) {
|
|
|
1319
1311
|
return a.reverse ? a.from : a.to;
|
|
1320
1312
|
}
|
|
1321
1313
|
function J(a) {
|
|
1322
|
-
return
|
|
1314
|
+
return v(a * 0.16, 360, 900);
|
|
1323
1315
|
}
|
|
1324
1316
|
function Ae(a, e, t, r, o) {
|
|
1325
|
-
const n = Math.max(e, 1), s =
|
|
1317
|
+
const n = Math.max(e, 1), s = v(t / n * 100, 0, 100), i = v((t + r * 0.35) / n * 100, s, 100), p = v((t + r * 0.72) / n * 100, i, 100), l = v((t + r) / n * 100, p, 100), d = S(s), u = S(i), h = S(p), g = S(l);
|
|
1326
1318
|
if (o === "shake") {
|
|
1327
|
-
const m =
|
|
1319
|
+
const m = v(s + (i - s) * 0.3, s, i), w = v(s + (i - s) * 0.65, m, i), x = S(m), z = S(w);
|
|
1328
1320
|
return `
|
|
1329
1321
|
@keyframes ${a} {
|
|
1330
1322
|
0%, ${d}%, 100% {
|
|
@@ -1492,7 +1484,7 @@ function ae(a, e) {
|
|
|
1492
1484
|
function O(a, e, t) {
|
|
1493
1485
|
return Math.min(t, Math.max(e, Math.round(a)));
|
|
1494
1486
|
}
|
|
1495
|
-
function
|
|
1487
|
+
function v(a, e, t) {
|
|
1496
1488
|
return Math.min(t, Math.max(e, a));
|
|
1497
1489
|
}
|
|
1498
1490
|
function he(a, e) {
|
|
@@ -1507,7 +1499,7 @@ function S(a) {
|
|
|
1507
1499
|
function B(a) {
|
|
1508
1500
|
return a.split("&").join("&").split('"').join(""").split("<").join("<").split(">").join(">");
|
|
1509
1501
|
}
|
|
1510
|
-
typeof customElements < "u" && !customElements.get("ui-animated-beam") && customElements.define("ui-animated-beam",
|
|
1502
|
+
typeof customElements < "u" && !customElements.get("ui-animated-beam") && customElements.define("ui-animated-beam", _e);
|
|
1511
1503
|
export {
|
|
1512
|
-
|
|
1504
|
+
_e as UIAnimatedBeam
|
|
1513
1505
|
};
|