@brightlocal/ui-components 3.1.0 → 3.3.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/AI_USAGE.md +10 -0
- package/README.md +8 -1
- package/component-meta.json +1591 -123
- package/deprecations.json +45 -1
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +73 -102
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +36 -5
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +83 -128
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +4 -4
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +116 -177
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.js +13 -16
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +30 -45
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +32 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +90 -71
- package/dist/banner.cjs +1 -0
- package/dist/banner.d.ts +81 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +130 -0
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +24 -6
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +74 -140
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +136 -176
- package/dist/blocks/progress-state.cjs +1 -1
- package/dist/blocks/progress-state.d.ts +2 -2
- package/dist/blocks/progress-state.js +223 -347
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +28 -6
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +763 -1086
- package/dist/brand-illustration-motif.cjs +1 -1
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/brand-illustration-motif.js +40 -61
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +62 -102
- package/dist/button-group.cjs +1 -1
- package/dist/button-group.js +23 -31
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +4 -2
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +149 -189
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +87 -3
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +116 -173
- package/dist/callout.cjs +1 -1
- package/dist/callout.js +73 -96
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +92 -6
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +240 -234
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +3 -3
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +174 -268
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.js +27 -48
- package/dist/chart-empty.cjs +1 -1
- package/dist/chart-empty.js +18 -27
- package/dist/chart.cjs +7 -7
- package/dist/chart.d.ts +253 -25
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +465 -511
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +37 -69
- package/dist/chip.cjs +1 -1
- package/dist/chip.js +116 -173
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +35 -41
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +14 -4
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +440 -639
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +273 -420
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +5 -5
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +121 -191
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +442 -144
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +708 -835
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +15 -4
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +156 -231
- package/dist/delta.cjs +1 -0
- package/dist/delta.d.ts +79 -0
- package/dist/delta.d.ts.map +1 -0
- package/dist/delta.js +62 -0
- package/dist/description.cjs +1 -1
- package/dist/description.js +11 -20
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +76 -116
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +11 -11
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +76 -134
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +6 -6
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +179 -300
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +9 -9
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +166 -286
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.js +203 -342
- package/dist/grid.cjs +1 -1
- package/dist/grid.d.ts +24 -1
- package/dist/grid.d.ts.map +1 -1
- package/dist/grid.js +16 -29
- package/dist/header.cjs +1 -1
- package/dist/header.js +21 -38
- package/dist/height-transition.cjs +1 -1
- package/dist/height-transition.js +38 -55
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +10 -9
- package/dist/hooks/use-debounce.cjs +1 -1
- package/dist/hooks/use-debounce.js +12 -11
- package/dist/hooks/use-delayed-pending.cjs +1 -1
- package/dist/hooks/use-delayed-pending.js +8 -9
- package/dist/hooks/use-filter-search-params.cjs +1 -0
- package/dist/hooks/use-filter-search-params.d.ts +93 -0
- package/dist/hooks/use-filter-search-params.d.ts.map +1 -0
- package/dist/hooks/use-filter-search-params.js +122 -0
- package/dist/hooks/use-mobile.cjs +1 -1
- package/dist/hooks/use-mobile.js +6 -6
- package/dist/hooks/use-overlay-pointer-lock.cjs +1 -1
- package/dist/hooks/use-overlay-pointer-lock.js +8 -9
- package/dist/hooks/use-prefers-reduced-motion.cjs +1 -1
- package/dist/hooks/use-prefers-reduced-motion.js +5 -8
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +1 -1
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +30 -62
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +636 -582
- package/dist/info-tooltip.cjs +1 -0
- package/dist/info-tooltip.d.ts +39 -0
- package/dist/info-tooltip.d.ts.map +1 -0
- package/dist/info-tooltip.js +27 -0
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +32 -3
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +182 -231
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +33 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +188 -122
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.d.ts +3 -3
- package/dist/input-otp.d.ts.map +1 -1
- package/dist/input-otp.js +102 -146
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +26 -8
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +139 -171
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +51 -73
- package/dist/label.cjs +1 -1
- package/dist/label.js +20 -38
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +5 -2
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +16 -17
- package/dist/lib/compose-event-handlers.cjs +1 -0
- package/dist/lib/compose-event-handlers.d.ts +9 -0
- package/dist/lib/compose-event-handlers.d.ts.map +1 -0
- package/dist/lib/compose-event-handlers.js +8 -0
- package/dist/lib/download-file.cjs +1 -0
- package/dist/lib/download-file.d.ts +14 -0
- package/dist/lib/download-file.d.ts.map +1 -0
- package/dist/lib/download-file.js +40 -0
- package/dist/lib/empty-canvas.cjs +1 -1
- package/dist/lib/empty-canvas.js +28 -56
- package/dist/lib/empty-chip.cjs +1 -1
- package/dist/lib/empty-chip.d.ts +14 -3
- package/dist/lib/empty-chip.d.ts.map +1 -1
- package/dist/lib/empty-chip.js +15 -11
- package/dist/lib/field-aria.cjs +1 -0
- package/dist/lib/field-aria.d.ts +34 -0
- package/dist/lib/field-aria.d.ts.map +1 -0
- package/dist/lib/field-aria.js +52 -0
- package/dist/lib/image-file-info.cjs +1 -0
- package/dist/lib/image-file-info.d.ts +25 -0
- package/dist/lib/image-file-info.d.ts.map +1 -0
- package/dist/lib/image-file-info.js +67 -0
- package/dist/lib/media-viewer-content.cjs +1 -0
- package/dist/lib/media-viewer-content.d.ts +102 -0
- package/dist/lib/media-viewer-content.d.ts.map +1 -0
- package/dist/lib/media-viewer-content.js +650 -0
- package/dist/lib/media-viewer-internal.cjs +1 -0
- package/dist/lib/media-viewer-internal.d.ts +98 -0
- package/dist/lib/media-viewer-internal.d.ts.map +1 -0
- package/dist/lib/media-viewer-internal.js +61 -0
- package/dist/lib/media-viewer-motion.cjs +1 -0
- package/dist/lib/media-viewer-motion.d.ts +40 -0
- package/dist/lib/media-viewer-motion.d.ts.map +1 -0
- package/dist/lib/media-viewer-motion.js +37 -0
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.d.ts +8 -0
- package/dist/lib/motion.d.ts.map +1 -1
- package/dist/lib/motion.js +11 -10
- package/dist/lib/optical-center.cjs +1 -1
- package/dist/lib/optical-center.d.ts +1 -1
- package/dist/lib/optical-center.d.ts.map +1 -1
- package/dist/lib/optical-center.js +12 -5
- package/dist/lib/spring-settle.cjs +1 -1
- package/dist/lib/spring-settle.js +1 -1
- package/dist/lib/table-internal.cjs +1 -0
- package/dist/lib/table-internal.d.ts +62 -0
- package/dist/lib/table-internal.d.ts.map +1 -0
- package/dist/lib/table-internal.js +18 -0
- package/dist/lib/use-controllable.cjs +1 -0
- package/dist/lib/use-controllable.d.ts +12 -0
- package/dist/lib/use-controllable.d.ts.map +1 -0
- package/dist/lib/use-controllable.js +15 -0
- package/dist/lib/use-dev-warning.cjs +1 -1
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +29 -35
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +1 -1
- package/dist/link.js +78 -124
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts +8 -0
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +94 -156
- package/dist/loading.cjs +1 -1
- package/dist/loading.js +124 -151
- package/dist/logo-mark.cjs +1 -0
- package/dist/logo-mark.d.ts +79 -0
- package/dist/logo-mark.d.ts.map +1 -0
- package/dist/logo-mark.js +219 -0
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +1 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +51 -87
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +390 -586
- package/dist/media-empty.cjs +1 -1
- package/dist/media-empty.js +27 -42
- package/dist/media-viewer.cjs +1 -0
- package/dist/media-viewer.d.ts +224 -0
- package/dist/media-viewer.d.ts.map +1 -0
- package/dist/media-viewer.js +295 -0
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +14 -14
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +130 -267
- package/dist/multi-select-filter.cjs +1 -0
- package/dist/multi-select-filter.d.ts +186 -0
- package/dist/multi-select-filter.d.ts.map +1 -0
- package/dist/multi-select-filter.js +374 -0
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +108 -172
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +36 -12
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +208 -281
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +34 -45
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +139 -17
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +116 -148
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +90 -146
- package/dist/rating.cjs +1 -1
- package/dist/rating.d.ts +80 -13
- package/dist/rating.d.ts.map +1 -1
- package/dist/rating.js +70 -65
- package/dist/relative-date.cjs +1 -0
- package/dist/relative-date.d.ts +65 -0
- package/dist/relative-date.d.ts.map +1 -0
- package/dist/relative-date.js +112 -0
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +39 -23
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +42 -44
- package/dist/result-count.cjs +1 -0
- package/dist/result-count.d.ts +110 -0
- package/dist/result-count.d.ts.map +1 -0
- package/dist/result-count.js +49 -0
- package/dist/route-progress.cjs +1 -1
- package/dist/route-progress.js +58 -102
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +9 -1
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +44 -79
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +20 -10
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +132 -236
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +90 -78
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +86 -7
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +275 -235
- package/dist/single-select-filter.cjs +1 -0
- package/dist/single-select-filter.d.ts +113 -0
- package/dist/single-select-filter.d.ts.map +1 -0
- package/dist/single-select-filter.js +224 -0
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.js +24 -38
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +51 -81
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +113 -137
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +22 -31
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +53 -102
- package/dist/status.cjs +1 -0
- package/dist/status.d.ts +51 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +60 -0
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +184 -316
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +17 -32
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +127 -13
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +170 -192
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +123 -146
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.js +307 -363
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +23 -36
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.js +43 -62
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +34 -46
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +38 -36
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +175 -78
- package/dist/typography-heading.cjs +1 -1
- package/dist/typography-heading.js +25 -61
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +1 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +27 -57
- package/dist/typography.cjs +1 -1
- package/dist/typography.d.ts +1 -1
- package/dist/typography.js +132 -340
- package/package.json +45 -46
- package/src/blocks/empty-state.tsx +42 -21
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +111 -32
- package/src/components/accordion.tsx +1 -1
- package/src/components/alert-dialog.tsx +52 -5
- package/src/components/alert.tsx +16 -8
- package/src/components/badge.tsx +152 -3
- package/src/components/banner.tsx +288 -0
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button.tsx +8 -6
- package/src/components/calendar.tsx +155 -9
- package/src/components/card.tsx +266 -26
- package/src/components/carousel.tsx +4 -1
- package/src/components/chart.tsx +664 -42
- package/src/components/checkbox.tsx +2 -2
- package/src/components/collapsible.tsx +4 -1
- package/src/components/combobox.tsx +42 -9
- package/src/components/command.tsx +10 -11
- package/src/components/context-menu.tsx +4 -4
- package/src/components/data-table.tsx +1363 -398
- package/src/components/date-picker.tsx +31 -4
- package/src/components/delta.tsx +217 -0
- package/src/components/drawer.tsx +5 -5
- package/src/components/dropdown-menu.tsx +4 -4
- package/src/components/field.tsx +36 -15
- package/src/components/global-layout.tsx +1 -1
- package/src/components/grid.tsx +32 -1
- package/src/components/info-tooltip.tsx +94 -0
- package/src/components/input-chip.tsx +52 -8
- package/src/components/input-group.tsx +247 -12
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +29 -11
- package/src/components/input.tsx +11 -2
- package/src/components/list.tsx +15 -3
- package/src/components/logo-mark.tsx +345 -0
- package/src/components/map.tsx +18 -20
- package/src/components/media-viewer.tsx +908 -0
- package/src/components/multi-select-filter.tsx +1046 -0
- package/src/components/navigation-menu.tsx +2 -2
- package/src/components/pagination.tsx +86 -26
- package/src/components/progress.tsx +281 -54
- package/src/components/rating.tsx +200 -74
- package/src/components/relative-date.tsx +238 -0
- package/src/components/resizable.tsx +86 -33
- package/src/components/result-count.tsx +253 -0
- package/src/components/scroll-area.tsx +31 -5
- package/src/components/select.tsx +37 -7
- package/src/components/sheet.tsx +252 -6
- package/src/components/single-select-filter.tsx +538 -0
- package/src/components/slider.tsx +2 -2
- package/src/components/sonner.tsx +16 -5
- package/src/components/split-layout.tsx +2 -2
- package/src/components/status.tsx +162 -0
- package/src/components/switch.tsx +1 -1
- package/src/components/table.tsx +305 -73
- package/src/components/tabs.tsx +94 -46
- package/src/components/textarea.tsx +21 -3
- package/src/components/toggle.tsx +2 -2
- package/src/components/tooltip.tsx +431 -68
- package/src/components/typography-text.tsx +1 -2
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/hooks/use-filter-search-params.ts +302 -0
- package/src/index.ts +11 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/compose-event-handlers.ts +14 -0
- package/src/lib/download-file.ts +61 -0
- package/src/lib/empty-chip.tsx +52 -0
- package/src/lib/field-aria.tsx +97 -0
- package/src/lib/image-file-info.ts +102 -0
- package/src/lib/media-viewer-content.tsx +1587 -0
- package/src/lib/media-viewer-internal.tsx +191 -0
- package/src/lib/media-viewer-motion.ts +120 -0
- package/src/lib/motion.ts +9 -0
- package/src/lib/table-internal.ts +74 -0
- package/src/lib/use-controllable.ts +43 -0
- package/src/lib/utils.ts +1 -0
- package/src/lib/empty-chip.ts +0 -24
|
@@ -1,27 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { usePrefersReducedMotion as $t } from "./hooks/use-prefers-reduced-motion.js";
|
|
3
|
+
import { SETTLE_REST_DELTA as wt } from "./lib/spring-settle.js";
|
|
4
|
+
import { SPRING_SETTLE as Xt, SPRING_SMOOTH as Ft } from "./lib/motion.js";
|
|
5
|
+
import * as bt from "react";
|
|
6
|
+
import { useCallback as Dt, useEffect as it, useId as Nt, useMemo as Rt, useRef as A, useState as _t } from "react";
|
|
7
|
+
import { cn as qt } from "@brightlocal/ui-components/lib/utils";
|
|
1
8
|
import { jsx as C, jsxs as W } from "react/jsx-runtime";
|
|
2
|
-
import * as wt from "react";
|
|
3
|
-
import { useId as $t, useMemo as bt, useRef as M, useState as Xt, useCallback as Ft, useEffect as it } from "react";
|
|
4
9
|
import { animate as G } from "framer-motion";
|
|
5
|
-
|
|
6
|
-
import { usePrefersReducedMotion as Nt } from "./hooks/use-prefers-reduced-motion.js";
|
|
7
|
-
import { SPRING_SMOOTH as _t, SPRING_SETTLE as qt } from "./lib/motion.js";
|
|
8
|
-
import { SETTLE_REST_DELTA as Rt } from "./lib/spring-settle.js";
|
|
9
|
-
const xt = "M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C111.929 0 0 111.929 0 250C0 388.071 111.929 500 250 500Z", Lt = "M492.425 259.355C332.265 293.145 293.145 332.265 259.355 492.425C257.225 502.525 242.775 502.525 240.645 492.425C206.855 332.265 167.735 293.145 7.575 259.355C-2.525 257.225 -2.525 242.775 7.575 240.645C167.735 206.855 206.855 167.735 240.645 7.575C242.775 -2.525 257.225 -2.525 259.355 7.575C293.145 167.735 332.265 206.855 492.425 240.645C502.525 242.775 502.525 257.225 492.425 259.355Z", At = "M258.366 5.58795L296.379 97.3854C298.509 102.526 304.729 104.546 309.47 101.636L394.177 49.7215C401.057 45.5112 409.598 51.7117 407.708 59.5523L384.506 156.16C383.206 161.571 387.046 166.861 392.596 167.301L491.645 175.092C499.685 175.722 502.945 185.763 496.815 191.003L421.259 255.528C417.029 259.138 417.029 265.679 421.259 269.299L496.815 333.824C502.945 339.065 499.685 349.106 491.645 349.736L392.596 357.526C387.046 357.966 383.206 363.257 384.506 368.667L407.708 465.275C409.588 473.116 401.047 479.326 394.177 475.106L309.47 423.192C304.729 420.282 298.509 422.302 296.379 427.442L258.366 519.24C255.275 526.69 244.725 526.69 241.634 519.24L203.621 427.442C201.491 422.302 195.271 420.282 190.53 423.192L105.823 475.106C98.9428 479.316 90.4021 473.116 92.2922 465.275L115.494 368.667C116.794 363.257 112.954 357.966 107.403 357.526L8.35543 349.736C0.314784 349.106 -2.94548 339.065 3.18502 333.824L78.7411 269.299C82.9715 265.689 82.9715 259.148 78.7411 255.528L3.18502 191.003C-2.94548 185.763 0.314784 175.722 8.35543 175.092L107.403 167.301C112.954 166.861 116.794 161.571 115.494 156.16L92.2922 59.5523C90.4121 51.7117 98.9528 45.5012 105.823 49.7215L190.53 101.636C195.271 104.546 201.491 102.526 203.621 97.3854L241.634 5.58795C244.725 -1.86265 255.275 -1.86265 258.366 5.58795Z", q = (u) => u < 0 ? 0 : u > 1 ? 1 : u, zt = [
|
|
10
|
+
var xt = "M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C111.929 0 0 111.929 0 250C0 388.071 111.929 500 250 500Z", vt = "M492.425 259.355C332.265 293.145 293.145 332.265 259.355 492.425C257.225 502.525 242.775 502.525 240.645 492.425C206.855 332.265 167.735 293.145 7.575 259.355C-2.525 257.225 -2.525 242.775 7.575 240.645C167.735 206.855 206.855 167.735 240.645 7.575C242.775 -2.525 257.225 -2.525 259.355 7.575C293.145 167.735 332.265 206.855 492.425 240.645C502.525 242.775 502.525 257.225 492.425 259.355Z", Lt = "M258.366 5.58795L296.379 97.3854C298.509 102.526 304.729 104.546 309.47 101.636L394.177 49.7215C401.057 45.5112 409.598 51.7117 407.708 59.5523L384.506 156.16C383.206 161.571 387.046 166.861 392.596 167.301L491.645 175.092C499.685 175.722 502.945 185.763 496.815 191.003L421.259 255.528C417.029 259.138 417.029 265.679 421.259 269.299L496.815 333.824C502.945 339.065 499.685 349.106 491.645 349.736L392.596 357.526C387.046 357.966 383.206 363.257 384.506 368.667L407.708 465.275C409.588 473.116 401.047 479.326 394.177 475.106L309.47 423.192C304.729 420.282 298.509 422.302 296.379 427.442L258.366 519.24C255.275 526.69 244.725 526.69 241.634 519.24L203.621 427.442C201.491 422.302 195.271 420.282 190.53 423.192L105.823 475.106C98.9428 479.316 90.4021 473.116 92.2922 465.275L115.494 368.667C116.794 363.257 112.954 357.966 107.403 357.526L8.35543 349.736C0.314784 349.106 -2.94548 339.065 3.18502 333.824L78.7411 269.299C82.9715 265.689 82.9715 259.148 78.7411 255.528L3.18502 191.003C-2.94548 185.763 0.314784 175.722 8.35543 175.092L107.403 167.301C112.954 166.861 116.794 161.571 115.494 156.16L92.2922 59.5523C90.4121 51.7117 98.9528 45.5012 105.823 49.7215L190.53 101.636C195.271 104.546 201.491 102.526 203.621 97.3854L241.634 5.58795C244.725 -1.86265 255.275 -1.86265 258.366 5.58795Z", q = (u) => u < 0 ? 0 : u > 1 ? 1 : u, zt = [
|
|
10
11
|
xt,
|
|
12
|
+
vt,
|
|
11
13
|
Lt,
|
|
12
|
-
At,
|
|
13
14
|
xt,
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
Lt,
|
|
16
|
+
vt
|
|
16
17
|
];
|
|
17
|
-
function Ht(u, $, w,
|
|
18
|
+
function Ht(u, $, w, S) {
|
|
18
19
|
let b = !1, X = null;
|
|
19
|
-
const c = {
|
|
20
|
+
const c = {
|
|
21
|
+
ballX: 0,
|
|
22
|
+
clipRight: 100,
|
|
23
|
+
rotate: 0,
|
|
24
|
+
pathD: ""
|
|
25
|
+
};
|
|
20
26
|
function O() {
|
|
21
|
-
b = !1, u.style.transform = `translateX(${c.ballX}px)`, X && (X.style.clipPath = `inset(0 ${c.clipRight}% 0 0)`), $.style.transform = `rotate(${c.rotate}deg)`,
|
|
22
|
-
"gradientTransform",
|
|
23
|
-
`rotate(${-c.rotate} 0.5 0.5)`
|
|
24
|
-
), w.setAttribute("d", c.pathD);
|
|
27
|
+
b = !1, u.style.transform = `translateX(${c.ballX}px)`, X && (X.style.clipPath = `inset(0 ${c.clipRight}% 0 0)`), $.style.transform = `rotate(${c.rotate}deg)`, S?.setAttribute("gradientTransform", `rotate(${-c.rotate} 0.5 0.5)`), w.setAttribute("d", c.pathD);
|
|
25
28
|
}
|
|
26
29
|
function z(F, Z, j, s) {
|
|
27
30
|
c.ballX = F, c.clipRight = Z, c.rotate = j, c.pathD = s, b || (b = !0, requestAnimationFrame(O));
|
|
@@ -30,375 +33,316 @@ function Ht(u, $, w, v) {
|
|
|
30
33
|
X = F;
|
|
31
34
|
}, z;
|
|
32
35
|
}
|
|
33
|
-
function
|
|
36
|
+
function At(u, $) {
|
|
34
37
|
return new Promise((w) => {
|
|
35
|
-
const
|
|
38
|
+
const S = performance.now();
|
|
36
39
|
function b() {
|
|
37
|
-
$.cancelled || performance.now() -
|
|
40
|
+
$.cancelled || performance.now() - S >= u ? w() : requestAnimationFrame(b);
|
|
38
41
|
}
|
|
39
42
|
requestAnimationFrame(b);
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
|
-
|
|
43
|
-
({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
S.current[n] = e;
|
|
62
|
-
},
|
|
63
|
-
[]
|
|
64
|
-
);
|
|
65
|
-
it(() => {
|
|
66
|
-
if (S.current.length === 0 || !S.current[0]) return;
|
|
67
|
-
let n = !1;
|
|
68
|
-
function e() {
|
|
69
|
-
if (n) return;
|
|
70
|
-
const m = [];
|
|
71
|
-
let R = 32;
|
|
72
|
-
for (let h = 0; h < k.length; h++) {
|
|
73
|
-
const x = S.current[h];
|
|
74
|
-
if (x && (m[h] = x.scrollWidth, h === 0)) {
|
|
75
|
-
const E = x.firstElementChild ?? x, t = parseFloat(getComputedStyle(E).fontSize) || 16;
|
|
76
|
-
R = Math.round(t * 1.5);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
vt({ widths: m, ballSize: R });
|
|
80
|
-
}
|
|
81
|
-
return document.fonts.ready.then(() => {
|
|
82
|
-
n || requestAnimationFrame(e);
|
|
83
|
-
}), () => {
|
|
84
|
-
n = !0;
|
|
85
|
-
};
|
|
86
|
-
}, [k.length]), it(() => {
|
|
87
|
-
if (H) return;
|
|
88
|
-
const n = rt.current;
|
|
89
|
-
if (!n) return;
|
|
90
|
-
const e = n;
|
|
91
|
-
let m, R = null;
|
|
92
|
-
const h = 0.12 + Math.random() * 0.06, x = 0.08 + Math.random() * 0.04, E = Math.random() * Math.PI * 2, t = Math.random() * Math.PI * 2;
|
|
93
|
-
let D = -1 / 0;
|
|
94
|
-
function U(f) {
|
|
95
|
-
R || (R = f);
|
|
96
|
-
const l = (f - R) / 1e3, o = -Math.PI / 4 + Math.sin(l * h + E) * 0.5 + Math.sin(l * x + t) * 0.25;
|
|
97
|
-
if (Math.abs(o - D) > 0.01) {
|
|
98
|
-
D = o;
|
|
99
|
-
const N = Math.cos(o), i = Math.sin(o);
|
|
100
|
-
e.setAttribute("x1", `${50 + 45 * N}%`), e.setAttribute("y1", `${50 + 45 * i}%`), e.setAttribute("x2", `${50 - 45 * N}%`), e.setAttribute("y2", `${50 - 45 * i}%`);
|
|
45
|
+
var Ut = bt.forwardRef(({ className: u, dataHook: $, holdTime: w = 1300, shimmer: S = !0, gradientFrom: b = "var(--loading-gradient-from)", gradientTo: X = "var(--loading-gradient-to)", loadingLabel: c, trackingEl: O, trackingLabel: z, children: F, ...Z }, j) => {
|
|
46
|
+
const s = zt, J = 0.8, { stiffness: K, damping: Q, mass: V } = Ft, H = $t(), ct = Nt(), ft = Rt(() => `text-reveal-gradient-${ct.replace(/:/g, "")}`, [ct]), Y = A(null), tt = A(null), et = A(null), nt = A(null), rt = A(null), at = A(null), ot = A(null), M = A([]), k = bt.Children.toArray(F), [Mt, St] = _t({
|
|
47
|
+
widths: [],
|
|
48
|
+
ballSize: 0
|
|
49
|
+
}), { widths: p, ballSize: a } = Mt, kt = Dt((n) => (e) => {
|
|
50
|
+
M.current[n] = e;
|
|
51
|
+
}, []);
|
|
52
|
+
it(() => {
|
|
53
|
+
if (M.current.length === 0 || !M.current[0]) return;
|
|
54
|
+
let n = !1;
|
|
55
|
+
function e() {
|
|
56
|
+
if (n) return;
|
|
57
|
+
const m = [];
|
|
58
|
+
let R = 32;
|
|
59
|
+
for (let h = 0; h < k.length; h++) {
|
|
60
|
+
const x = M.current[h];
|
|
61
|
+
if (x && (m[h] = x.scrollWidth, h === 0)) {
|
|
62
|
+
const E = x.firstElementChild ?? x, t = parseFloat(getComputedStyle(E).fontSize) || 16;
|
|
63
|
+
R = Math.round(t * 1.5);
|
|
101
64
|
}
|
|
102
|
-
m = requestAnimationFrame(U);
|
|
103
65
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
n.style.opacity = "1", G(0, 1, {
|
|
108
|
-
duration: 1.2,
|
|
109
|
-
ease: [0.25, 1, 0.5, 1],
|
|
110
|
-
onUpdate: (e) => {
|
|
111
|
-
n.style.transform = `translateX(${-100 + e * 200}%)`;
|
|
112
|
-
},
|
|
113
|
-
onComplete: () => {
|
|
114
|
-
n.style.opacity = "0";
|
|
115
|
-
}
|
|
66
|
+
St({
|
|
67
|
+
widths: m,
|
|
68
|
+
ballSize: R
|
|
116
69
|
});
|
|
117
70
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
71
|
+
return document.fonts.ready.then(() => {
|
|
72
|
+
n || requestAnimationFrame(e);
|
|
73
|
+
}), () => {
|
|
74
|
+
n = !0;
|
|
75
|
+
};
|
|
76
|
+
}, [k.length]), it(() => {
|
|
77
|
+
if (H) return;
|
|
78
|
+
const n = rt.current;
|
|
79
|
+
if (!n) return;
|
|
80
|
+
const e = n;
|
|
81
|
+
let m, R = null;
|
|
82
|
+
const h = 0.12 + Math.random() * 0.06, x = 0.08 + Math.random() * 0.04, E = Math.random() * Math.PI * 2, t = Math.random() * Math.PI * 2;
|
|
83
|
+
let D = -1 / 0;
|
|
84
|
+
function U(f) {
|
|
85
|
+
R || (R = f);
|
|
86
|
+
const l = (f - R) / 1e3, o = -Math.PI / 4 + Math.sin(l * h + E) * 0.5 + Math.sin(l * x + t) * 0.25;
|
|
87
|
+
if (Math.abs(o - D) > 0.01) {
|
|
88
|
+
D = o;
|
|
89
|
+
const N = Math.cos(o), i = Math.sin(o);
|
|
90
|
+
e.setAttribute("x1", `${50 + 45 * N}%`), e.setAttribute("y1", `${50 + 45 * i}%`), e.setAttribute("x2", `${50 - 45 * N}%`), e.setAttribute("y2", `${50 - 45 * i}%`);
|
|
125
91
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
92
|
+
m = requestAnimationFrame(U);
|
|
93
|
+
}
|
|
94
|
+
return m = requestAnimationFrame(U), () => cancelAnimationFrame(m);
|
|
95
|
+
}, [H]);
|
|
96
|
+
function Et(n) {
|
|
97
|
+
n.style.opacity = "1", G(0, 1, {
|
|
98
|
+
duration: 1.2,
|
|
99
|
+
ease: [
|
|
100
|
+
0.25,
|
|
101
|
+
1,
|
|
102
|
+
0.5,
|
|
103
|
+
1
|
|
104
|
+
],
|
|
105
|
+
onUpdate: (e) => {
|
|
106
|
+
n.style.transform = `translateX(${-100 + e * 200}%)`;
|
|
107
|
+
},
|
|
108
|
+
onComplete: () => {
|
|
109
|
+
n.style.opacity = "0";
|
|
133
110
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
it(() => {
|
|
114
|
+
if (!et.current || !nt.current || !Y.current || !tt.current || !at.current || !ot.current || p.length === 0 || a === 0) return;
|
|
115
|
+
const n = et.current, e = nt.current, m = Y.current, R = tt.current, h = at.current, x = ot.current;
|
|
116
|
+
function E(f) {
|
|
117
|
+
const l = `${f}px`;
|
|
118
|
+
h.style.width = l, x.style.width = l;
|
|
119
|
+
}
|
|
120
|
+
if (H) {
|
|
121
|
+
n.setAttribute("d", s[0]), e.style.opacity = "1";
|
|
122
|
+
const f = M.current[0];
|
|
123
|
+
f && (f.style.opacity = "1", f.style.clipPath = "none"), E(p[0] ?? 0);
|
|
124
|
+
const l = a * 0.25, o = (p[0] ?? 0) + l + a / 2;
|
|
125
|
+
m.style.transform = `translateX(${o}px)`;
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const t = { cancelled: !1 }, D = a * 0.25;
|
|
129
|
+
async function U() {
|
|
130
|
+
const { interpolate: f } = await import("flubber");
|
|
131
|
+
if (t.cancelled) return;
|
|
132
|
+
const l = [];
|
|
133
|
+
for (let v = 0; v < s.length; v++) l.push(f(s[v], s[(v + 1) % s.length]));
|
|
134
|
+
const o = Ht(m, e, n, rt.current);
|
|
135
|
+
e.style.opacity = "1";
|
|
136
|
+
let N = 0, i = 0, g = 0;
|
|
137
|
+
for (; !t.cancelled; ) {
|
|
138
|
+
const v = N % k.length, P = p[v] ?? 0;
|
|
139
|
+
E(P);
|
|
140
|
+
const I = -(D + a / 2), _ = P + D + a / 2, ut = _ - I, pt = M.current[v];
|
|
141
|
+
if (!pt) break;
|
|
142
|
+
o.setItem(pt);
|
|
143
|
+
for (let r = 0; r < k.length; r++) {
|
|
144
|
+
const d = M.current[r];
|
|
145
|
+
d && (d.style.opacity = r === v ? "1" : "0", d.style.clipPath = "inset(0 100% 0 0)");
|
|
146
|
+
}
|
|
147
|
+
const mt = l[i], B = 360, ht = g;
|
|
148
|
+
if (await new Promise((r) => {
|
|
149
|
+
if (t.cancelled) {
|
|
150
|
+
r();
|
|
151
|
+
return;
|
|
160
152
|
}
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
damping: Q,
|
|
171
|
-
mass: V,
|
|
172
|
-
onUpdate: (y) => {
|
|
173
|
-
if (t.cancelled) {
|
|
174
|
-
d.stop(), r();
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
const A = q((y - I) / ut), T = P > 0 ? 100 - q(y / P) * 100 : 100;
|
|
178
|
-
o(y, T, ht + A * B, mt(A));
|
|
179
|
-
},
|
|
180
|
-
onComplete: () => {
|
|
181
|
-
g = ht + B, i = (i + 1) % s.length, t.cancelled || o(_, 0, g, mt(1)), r();
|
|
153
|
+
const d = G(I, _, {
|
|
154
|
+
type: "spring",
|
|
155
|
+
stiffness: K * J,
|
|
156
|
+
damping: Q,
|
|
157
|
+
mass: V,
|
|
158
|
+
onUpdate: (y) => {
|
|
159
|
+
if (t.cancelled) {
|
|
160
|
+
d.stop(), r();
|
|
161
|
+
return;
|
|
182
162
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const y = (i + 1) % s.length, A = l[i], T = g, st = g + 360;
|
|
189
|
-
await new Promise((lt) => {
|
|
190
|
-
if (t.cancelled) {
|
|
191
|
-
lt();
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
const It = G(0, 1 + Rt, {
|
|
195
|
-
...qt,
|
|
196
|
-
restDelta: Rt,
|
|
197
|
-
onUpdate: (Tt) => {
|
|
198
|
-
if (t.cancelled) {
|
|
199
|
-
It.stop(), lt();
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
const Ct = q(Tt);
|
|
203
|
-
o(
|
|
204
|
-
d,
|
|
205
|
-
0,
|
|
206
|
-
T + Ct * (st - T),
|
|
207
|
-
A(Ct)
|
|
208
|
-
);
|
|
209
|
-
},
|
|
210
|
-
onComplete: lt
|
|
211
|
-
});
|
|
212
|
-
}), t.cancelled || o(d, 0, st, A(1)), g = st, i = y;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
if (t.cancelled) break;
|
|
216
|
-
const gt = l[i], yt = g;
|
|
217
|
-
if (await new Promise((r) => {
|
|
218
|
-
if (t.cancelled) {
|
|
219
|
-
r();
|
|
220
|
-
return;
|
|
163
|
+
const L = q((y - I) / ut), T = P > 0 ? 100 - q(y / P) * 100 : 100;
|
|
164
|
+
o(y, T, ht + L * B, mt(L));
|
|
165
|
+
},
|
|
166
|
+
onComplete: () => {
|
|
167
|
+
g = ht + B, i = (i + 1) % s.length, t.cancelled || o(_, 0, g, mt(1)), r();
|
|
221
168
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const A = q(1 - (y - I) / ut), T = P > 0 ? 100 - q(y / P) * 100 : 100;
|
|
233
|
-
o(y, T, yt - A * B, gt(A));
|
|
234
|
-
},
|
|
235
|
-
onComplete: () => {
|
|
236
|
-
g = yt - B, i = (i + 1) % s.length, t.cancelled || o(I, 100, g, gt(1)), r();
|
|
169
|
+
});
|
|
170
|
+
}), t.cancelled) break;
|
|
171
|
+
if (S && Et(R), w > 0) {
|
|
172
|
+
const r = performance.now(), d = _;
|
|
173
|
+
for (; !t.cancelled && performance.now() - r < w && (await At(300, t), !(t.cancelled || performance.now() - r >= w)); ) {
|
|
174
|
+
const y = (i + 1) % s.length, L = l[i], T = g, st = g + 360;
|
|
175
|
+
await new Promise((lt) => {
|
|
176
|
+
if (t.cancelled) {
|
|
177
|
+
lt();
|
|
178
|
+
return;
|
|
237
179
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
180
|
+
const It = G(0, 1 + wt, {
|
|
181
|
+
...Xt,
|
|
182
|
+
restDelta: wt,
|
|
183
|
+
onUpdate: (Tt) => {
|
|
184
|
+
if (t.cancelled) {
|
|
185
|
+
It.stop(), lt();
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const Ct = q(Tt);
|
|
189
|
+
o(d, 0, T + Ct * (st - T), L(Ct));
|
|
190
|
+
},
|
|
191
|
+
onComplete: lt
|
|
192
|
+
});
|
|
193
|
+
}), t.cancelled || o(d, 0, st, L(1)), g = st, i = y;
|
|
194
|
+
}
|
|
241
195
|
}
|
|
196
|
+
if (t.cancelled) break;
|
|
197
|
+
const gt = l[i], yt = g;
|
|
198
|
+
if (await new Promise((r) => {
|
|
199
|
+
if (t.cancelled) {
|
|
200
|
+
r();
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const d = G(_, I, {
|
|
204
|
+
type: "spring",
|
|
205
|
+
stiffness: K * J,
|
|
206
|
+
damping: Q,
|
|
207
|
+
mass: V,
|
|
208
|
+
onUpdate: (y) => {
|
|
209
|
+
if (t.cancelled) {
|
|
210
|
+
d.stop(), r();
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const L = q(1 - (y - I) / ut), T = P > 0 ? 100 - q(y / P) * 100 : 100;
|
|
214
|
+
o(y, T, yt - L * B, gt(L));
|
|
215
|
+
},
|
|
216
|
+
onComplete: () => {
|
|
217
|
+
g = yt - B, i = (i + 1) % s.length, t.cancelled || o(I, 100, g, gt(1)), r();
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}), t.cancelled) break;
|
|
221
|
+
await At(300, t), N++;
|
|
242
222
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
223
|
+
}
|
|
224
|
+
return U(), () => {
|
|
225
|
+
t.cancelled = !0;
|
|
226
|
+
};
|
|
227
|
+
}, [
|
|
228
|
+
p,
|
|
229
|
+
a,
|
|
230
|
+
k.length,
|
|
231
|
+
H,
|
|
232
|
+
J,
|
|
233
|
+
w,
|
|
234
|
+
S,
|
|
235
|
+
K,
|
|
236
|
+
Q,
|
|
237
|
+
V,
|
|
238
|
+
s
|
|
239
|
+
]);
|
|
240
|
+
const dt = Rt(() => p.length > 0 ? Math.max(...p) : 0, [p]), Pt = p.length > 0 && a > 0;
|
|
241
|
+
return /* @__PURE__ */ C("div", {
|
|
242
|
+
ref: j,
|
|
243
|
+
className: qt("relative inline-flex items-center", u),
|
|
244
|
+
"data-hook": $,
|
|
245
|
+
"data-slot": "text-reveal",
|
|
246
|
+
"data-tracking-el": O,
|
|
247
|
+
"data-tracking-label": z,
|
|
248
|
+
style: {
|
|
249
|
+
opacity: Pt ? 1 : 0,
|
|
250
|
+
transition: "opacity 0.4s ease-out"
|
|
251
|
+
},
|
|
252
|
+
...Z,
|
|
253
|
+
children: /* @__PURE__ */ W("div", {
|
|
254
|
+
ref: at,
|
|
255
|
+
className: "relative flex items-center",
|
|
256
|
+
style: {
|
|
257
|
+
width: dt || void 0,
|
|
258
|
+
transition: "width 0.3s ease-out"
|
|
259
|
+
},
|
|
260
|
+
children: [/* @__PURE__ */ W("span", {
|
|
261
|
+
ref: ot,
|
|
262
|
+
className: "relative inline-block overflow-hidden",
|
|
272
263
|
style: {
|
|
273
|
-
|
|
274
|
-
transition: "
|
|
264
|
+
width: dt || void 0,
|
|
265
|
+
transition: "width 0.3s ease-out"
|
|
275
266
|
},
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
267
|
+
children: [k.map((n, e) => /* @__PURE__ */ C("span", {
|
|
268
|
+
ref: kt(e),
|
|
269
|
+
style: {
|
|
270
|
+
display: "block",
|
|
271
|
+
whiteSpace: "nowrap",
|
|
272
|
+
opacity: 0,
|
|
273
|
+
clipPath: "inset(0 100% 0 0)",
|
|
274
|
+
willChange: "clip-path",
|
|
275
|
+
...e > 0 ? {
|
|
276
|
+
position: "absolute",
|
|
277
|
+
top: 0,
|
|
278
|
+
left: 0
|
|
279
|
+
} : {}
|
|
280
|
+
},
|
|
281
|
+
children: n
|
|
282
|
+
}, e)), /* @__PURE__ */ C("div", {
|
|
283
|
+
ref: tt,
|
|
284
|
+
className: "pointer-events-none absolute inset-0",
|
|
285
|
+
style: {
|
|
286
|
+
opacity: 0,
|
|
287
|
+
transform: "translateX(-100%)",
|
|
288
|
+
willChange: "transform",
|
|
289
|
+
background: "linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--background) 40%, transparent) 40%, color-mix(in srgb, var(--background) 70%, transparent) 50%, color-mix(in srgb, var(--background) 40%, transparent) 60%, transparent 100%)"
|
|
290
|
+
}
|
|
291
|
+
})]
|
|
292
|
+
}), /* @__PURE__ */ C("div", {
|
|
293
|
+
ref: Y,
|
|
294
|
+
className: "absolute",
|
|
295
|
+
style: {
|
|
296
|
+
left: -a / 2,
|
|
297
|
+
top: "50%",
|
|
298
|
+
marginTop: -a / 2,
|
|
299
|
+
width: a,
|
|
300
|
+
height: a,
|
|
301
|
+
transform: "translateX(0px)",
|
|
302
|
+
willChange: "transform"
|
|
303
|
+
},
|
|
304
|
+
children: /* @__PURE__ */ W("svg", {
|
|
305
|
+
"aria-label": c ?? "Loading",
|
|
306
|
+
"data-slot": "text-reveal-ball",
|
|
307
|
+
fill: "none",
|
|
308
|
+
height: a,
|
|
309
|
+
role: "img",
|
|
310
|
+
style: { overflow: "visible" },
|
|
311
|
+
viewBox: "-30 -30 560 560",
|
|
312
|
+
width: a,
|
|
313
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
314
|
+
children: [/* @__PURE__ */ C("defs", { children: /* @__PURE__ */ W("linearGradient", {
|
|
315
|
+
ref: rt,
|
|
316
|
+
id: ft,
|
|
317
|
+
x1: "81.8%",
|
|
318
|
+
x2: "18.2%",
|
|
319
|
+
y1: "18.2%",
|
|
320
|
+
y2: "81.8%",
|
|
321
|
+
children: [/* @__PURE__ */ C("stop", {
|
|
322
|
+
offset: "-60%",
|
|
323
|
+
stopColor: b
|
|
324
|
+
}), /* @__PURE__ */ C("stop", {
|
|
325
|
+
offset: "120%",
|
|
326
|
+
stopColor: X
|
|
327
|
+
})]
|
|
328
|
+
}) }), /* @__PURE__ */ C("g", {
|
|
329
|
+
ref: nt,
|
|
282
330
|
style: {
|
|
283
|
-
|
|
284
|
-
|
|
331
|
+
opacity: 0,
|
|
332
|
+
transformOrigin: "250px 250px",
|
|
333
|
+
willChange: "transform"
|
|
285
334
|
},
|
|
286
|
-
children:
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
k.map((n, e) => /* @__PURE__ */ C(
|
|
298
|
-
"span",
|
|
299
|
-
{
|
|
300
|
-
ref: kt(e),
|
|
301
|
-
style: {
|
|
302
|
-
display: "block",
|
|
303
|
-
whiteSpace: "nowrap",
|
|
304
|
-
opacity: 0,
|
|
305
|
-
clipPath: "inset(0 100% 0 0)",
|
|
306
|
-
willChange: "clip-path",
|
|
307
|
-
...e > 0 ? { position: "absolute", top: 0, left: 0 } : {}
|
|
308
|
-
},
|
|
309
|
-
children: n
|
|
310
|
-
},
|
|
311
|
-
e
|
|
312
|
-
)),
|
|
313
|
-
/* @__PURE__ */ C(
|
|
314
|
-
"div",
|
|
315
|
-
{
|
|
316
|
-
ref: tt,
|
|
317
|
-
className: "pointer-events-none absolute inset-0",
|
|
318
|
-
style: {
|
|
319
|
-
opacity: 0,
|
|
320
|
-
transform: "translateX(-100%)",
|
|
321
|
-
willChange: "transform",
|
|
322
|
-
background: "linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--background) 40%, transparent) 40%, color-mix(in srgb, var(--background) 70%, transparent) 50%, color-mix(in srgb, var(--background) 40%, transparent) 60%, transparent 100%)"
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
)
|
|
326
|
-
]
|
|
327
|
-
}
|
|
328
|
-
),
|
|
329
|
-
/* @__PURE__ */ C(
|
|
330
|
-
"div",
|
|
331
|
-
{
|
|
332
|
-
ref: Y,
|
|
333
|
-
className: "absolute",
|
|
334
|
-
style: {
|
|
335
|
-
left: -a / 2,
|
|
336
|
-
top: "50%",
|
|
337
|
-
marginTop: -a / 2,
|
|
338
|
-
width: a,
|
|
339
|
-
height: a,
|
|
340
|
-
transform: "translateX(0px)",
|
|
341
|
-
willChange: "transform"
|
|
342
|
-
},
|
|
343
|
-
children: /* @__PURE__ */ W(
|
|
344
|
-
"svg",
|
|
345
|
-
{
|
|
346
|
-
"aria-label": c ?? "Loading",
|
|
347
|
-
"data-slot": "text-reveal-ball",
|
|
348
|
-
fill: "none",
|
|
349
|
-
height: a,
|
|
350
|
-
role: "img",
|
|
351
|
-
style: { overflow: "visible" },
|
|
352
|
-
viewBox: "-30 -30 560 560",
|
|
353
|
-
width: a,
|
|
354
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
355
|
-
children: [
|
|
356
|
-
/* @__PURE__ */ C("defs", { children: /* @__PURE__ */ W(
|
|
357
|
-
"linearGradient",
|
|
358
|
-
{
|
|
359
|
-
ref: rt,
|
|
360
|
-
id: ft,
|
|
361
|
-
x1: "81.8%",
|
|
362
|
-
x2: "18.2%",
|
|
363
|
-
y1: "18.2%",
|
|
364
|
-
y2: "81.8%",
|
|
365
|
-
children: [
|
|
366
|
-
/* @__PURE__ */ C("stop", { offset: "-60%", stopColor: b }),
|
|
367
|
-
/* @__PURE__ */ C("stop", { offset: "120%", stopColor: X })
|
|
368
|
-
]
|
|
369
|
-
}
|
|
370
|
-
) }),
|
|
371
|
-
/* @__PURE__ */ C(
|
|
372
|
-
"g",
|
|
373
|
-
{
|
|
374
|
-
ref: nt,
|
|
375
|
-
style: {
|
|
376
|
-
opacity: 0,
|
|
377
|
-
transformOrigin: "250px 250px",
|
|
378
|
-
willChange: "transform"
|
|
379
|
-
},
|
|
380
|
-
children: /* @__PURE__ */ C(
|
|
381
|
-
"path",
|
|
382
|
-
{
|
|
383
|
-
ref: et,
|
|
384
|
-
d: s[0],
|
|
385
|
-
fill: `url(#${ft})`
|
|
386
|
-
}
|
|
387
|
-
)
|
|
388
|
-
}
|
|
389
|
-
)
|
|
390
|
-
]
|
|
391
|
-
}
|
|
392
|
-
)
|
|
393
|
-
}
|
|
394
|
-
)
|
|
395
|
-
]
|
|
396
|
-
}
|
|
397
|
-
)
|
|
398
|
-
}
|
|
399
|
-
);
|
|
400
|
-
}
|
|
401
|
-
);
|
|
335
|
+
children: /* @__PURE__ */ C("path", {
|
|
336
|
+
ref: et,
|
|
337
|
+
d: s[0],
|
|
338
|
+
fill: `url(#${ft})`
|
|
339
|
+
})
|
|
340
|
+
})]
|
|
341
|
+
})
|
|
342
|
+
})]
|
|
343
|
+
})
|
|
344
|
+
});
|
|
345
|
+
});
|
|
402
346
|
Ut.displayName = "TextRevealMotion";
|
|
403
347
|
export {
|
|
404
348
|
Ut as TextRevealMotion
|