@sth87/shadcn-design-system 0.0.35 → 0.1.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 +20 -2
- package/dist/AI_CONTEXT.md +212 -214
- package/dist/cjs/components/Accordion/Accordion.cjs +1 -1
- package/dist/cjs/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.cjs +1 -1
- package/dist/cjs/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/cjs/components/Badge/Badge.cjs +1 -1
- package/dist/cjs/components/Badge/Badge.cjs.map +1 -1
- package/dist/cjs/components/Breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/cjs/components/Breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/Button/Button.cjs +1 -1
- package/dist/cjs/components/Button/Button.cjs.map +1 -1
- package/dist/cjs/components/Calendar/Calendar.cjs +1 -1
- package/dist/cjs/components/Calendar/Calendar.cjs.map +1 -1
- package/dist/cjs/components/Carousel/Carousel.cjs +1 -1
- package/dist/cjs/components/Carousel/Carousel.cjs.map +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/cjs/components/Collapsible/Collapsible.cjs +1 -1
- package/dist/cjs/components/Collapsible/Collapsible.cjs.map +1 -1
- package/dist/cjs/components/Command/Command.cjs +1 -1
- package/dist/cjs/components/Command/Command.cjs.map +1 -1
- package/dist/cjs/components/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/cjs/components/ContextMenu/ContextMenu.cjs.map +1 -1
- package/dist/cjs/components/Cropper/Cropper.cjs +1 -1
- package/dist/cjs/components/Cropper/Cropper.cjs.map +1 -1
- package/dist/cjs/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker/DatePicker.cjs.map +1 -1
- package/dist/cjs/components/DatePicker/RangePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker/RangePicker.cjs.map +1 -1
- package/dist/cjs/components/DatePicker/TimePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker/TimePicker.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.cjs +1 -1
- package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
- package/dist/cjs/components/FloatLabel.cjs +1 -1
- package/dist/cjs/components/FloatLabel.cjs.map +1 -1
- package/dist/cjs/components/Glass/Glass.cjs +1 -1
- package/dist/cjs/components/Glass/Glass.cjs.map +1 -1
- package/dist/cjs/components/ImageViewer/ImageViewer.cjs +1 -1
- package/dist/cjs/components/ImageViewer/ImageViewer.cjs.map +1 -1
- package/dist/cjs/components/Input/Input.cjs +1 -1
- package/dist/cjs/components/Input/Input.cjs.map +1 -1
- package/dist/cjs/components/InputOTP/InputOTP.cjs +1 -1
- package/dist/cjs/components/InputOTP/InputOTP.cjs.map +1 -1
- package/dist/cjs/components/Interactive/CursorFollow.cjs +1 -1
- package/dist/cjs/components/Interactive/CursorFollow.cjs.map +1 -1
- package/dist/cjs/components/Marquee/Marquee.cjs +1 -1
- package/dist/cjs/components/Marquee/Marquee.cjs.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.cjs +1 -1
- package/dist/cjs/components/Pagination/Pagination.cjs.map +1 -1
- package/dist/cjs/components/QrCode/QrCode.cjs +1 -1
- package/dist/cjs/components/QrCode/QrCode.cjs.map +1 -1
- package/dist/cjs/components/Radio/Radio.cjs +1 -1
- package/dist/cjs/components/Radio/Radio.cjs.map +1 -1
- package/dist/cjs/components/Rate/Rate.cjs +1 -1
- package/dist/cjs/components/Rate/Rate.cjs.map +1 -1
- package/dist/cjs/components/Resizable/Resizable.cjs +1 -1
- package/dist/cjs/components/Resizable/Resizable.cjs.map +1 -1
- package/dist/cjs/components/ScrollArea/ScrollArea.cjs +1 -1
- package/dist/cjs/components/ScrollArea/ScrollArea.cjs.map +1 -1
- package/dist/cjs/components/Select/Select.cjs +1 -1
- package/dist/cjs/components/Select/Select.cjs.map +1 -1
- package/dist/cjs/components/Sheet/Sheet.cjs +2 -2
- package/dist/cjs/components/Sheet/Sheet.cjs.map +1 -1
- package/dist/cjs/components/Slider/Slider.cjs +1 -1
- package/dist/cjs/components/Slider/Slider.cjs.map +1 -1
- package/dist/cjs/components/Stepper/Stepper.cjs +1 -1
- package/dist/cjs/components/Stepper/Stepper.cjs.map +1 -1
- package/dist/cjs/components/Stepper/StepperWrapper.cjs +1 -1
- package/dist/cjs/components/Stepper/StepperWrapper.cjs.map +1 -1
- package/dist/cjs/components/Switch/Switch.cjs +1 -1
- package/dist/cjs/components/Switch/Switch.cjs.map +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-date-filter.cjs +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-date-filter.cjs.map +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-filter-popover.cjs +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-filter-popover.cjs.map +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-slider-filter.cjs +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-slider-filter.cjs.map +1 -1
- package/dist/cjs/components/Table/data-table-column-header.cjs +1 -1
- package/dist/cjs/components/Table/data-table-column-header.cjs.map +1 -1
- package/dist/cjs/components/Table/data-table-pagination.cjs +1 -1
- package/dist/cjs/components/Table/data-table-pagination.cjs.map +1 -1
- package/dist/cjs/components/Table/data-table.cjs +1 -1
- package/dist/cjs/components/Table/data-table.cjs.map +1 -1
- package/dist/cjs/components/Tabs/Tabs.cjs +1 -1
- package/dist/cjs/components/Tabs/Tabs.cjs.map +1 -1
- package/dist/cjs/components/Tabs/classes.cjs +1 -1
- package/dist/cjs/components/Tabs/classes.cjs.map +1 -1
- package/dist/cjs/components/Textarea/Textarea.cjs +1 -1
- package/dist/cjs/components/Textarea/Textarea.cjs.map +1 -1
- package/dist/cjs/components/TimeGridView.cjs +1 -1
- package/dist/cjs/components/TimeGridView.cjs.map +1 -1
- package/dist/cjs/components/Toast/Toast.cjs +1 -1
- package/dist/cjs/components/Toast/Toast.cjs.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/cjs/components/Tour/Tour.cjs +1 -1
- package/dist/cjs/components/Tour/Tour.cjs.map +1 -1
- package/dist/cjs/components/Tour/TourWrapper.cjs +1 -1
- package/dist/cjs/components/Tour/TourWrapper.cjs.map +1 -1
- package/dist/cjs/components/Upload/Upload.cjs +3 -3
- package/dist/cjs/components/Upload/Upload.cjs.map +1 -1
- package/dist/cjs/components/WheelColumn.cjs +1 -1
- package/dist/cjs/components/WheelColumn.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/BlurText.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/BlurText.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/CircularText.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/CircularText.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/FlipWords.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/FlipWords.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/GradientText.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/GradientText.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/RollingText.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/RollingText.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/RotatingText.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/RotatingText.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/ShimmeringText.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/ShimmeringText.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/TextGenerateEffect.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/TextGenerateEffect.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/TextHoverEffect.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/TextHoverEffect.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/TextPressureEffect.cjs +2 -2
- package/dist/cjs/lib/TextAnimation/TextPressureEffect.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/TypingText.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/TypingText.cjs.map +1 -1
- package/dist/cjs/lib/TextAnimation/WritingText.cjs +1 -1
- package/dist/cjs/lib/TextAnimation/WritingText.cjs.map +1 -1
- package/dist/cjs/node_modules/.pnpm/nuqs@2.8.0_next@15.5.9_@babel_core@7.28.5_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/nuqs/dist/server.cjs.map +1 -0
- package/dist/cjs/packages/ui/src/components/accordion.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/accordion.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/alert-dialog.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/alert-dialog.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/avatar.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/avatar.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/badge.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/badge.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/breadcrumb.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/breadcrumb.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/button-group.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/button-group.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/button.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/button.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/calendar.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/calendar.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/checkbox.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/checkbox.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/combobox.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/combobox.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/command.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/command.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/context-menu.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/context-menu.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/dialog.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/dialog.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/drawer.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/drawer.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/dropdown-menu.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/dropdown-menu.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/input-otp.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/input-otp.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/input.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/input.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/label.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/label.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/pagination.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/pagination.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/popover.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/popover.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/radio-group.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/radio-group.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/resizable.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/resizable.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/scroll-area.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/scroll-area.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/select.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/select.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/separator.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/separator.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/sheet.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/sheet.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/sidebar.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/sidebar.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/skeleton.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/skeleton.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/switch.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/switch.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/table.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/table.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/tabs.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/tabs.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/textarea.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/textarea.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/toggle.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/toggle.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/tooltip.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/tooltip.cjs.map +1 -1
- package/dist/cjs/packages/ui/src/components/tree-view.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/tree-view.cjs.map +1 -1
- package/dist/cjs/styles/index.css +1 -1
- package/dist/cjs/utils/animations.cjs +1 -1
- package/dist/cjs/utils/animations.cjs.map +1 -1
- package/dist/cjs/utils/css.cjs +1 -1
- package/dist/cjs/utils/css.cjs.map +1 -1
- package/dist/cjs/utils/parsers.cjs +1 -1
- package/dist/cjs/utils/parsers.cjs.map +1 -1
- package/dist/esm/components/Accordion/Accordion.js +60 -60
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.js +40 -40
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Badge/Badge.js +1 -1
- package/dist/esm/components/Badge/Badge.js.map +1 -1
- package/dist/esm/components/Breadcrumb/Breadcrumb.js +36 -36
- package/dist/esm/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/components/Button/Button.js +9 -9
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Calendar/Calendar.js +4 -4
- package/dist/esm/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/components/Carousel/Carousel.js +165 -165
- package/dist/esm/components/Carousel/Carousel.js.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +26 -26
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Collapsible/Collapsible.js +43 -43
- package/dist/esm/components/Collapsible/Collapsible.js.map +1 -1
- package/dist/esm/components/Command/Command.js +28 -28
- package/dist/esm/components/Command/Command.js.map +1 -1
- package/dist/esm/components/ContextMenu/ContextMenu.js +11 -11
- package/dist/esm/components/ContextMenu/ContextMenu.js.map +1 -1
- package/dist/esm/components/Cropper/Cropper.js +132 -132
- package/dist/esm/components/Cropper/Cropper.js.map +1 -1
- package/dist/esm/components/DatePicker/DatePicker.js +75 -75
- package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/components/DatePicker/RangePicker.js +136 -136
- package/dist/esm/components/DatePicker/RangePicker.js.map +1 -1
- package/dist/esm/components/DatePicker/TimePicker.js +150 -150
- package/dist/esm/components/DatePicker/TimePicker.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +114 -114
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/DropdownMenu/DropdownMenu.js +13 -13
- package/dist/esm/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/esm/components/FloatLabel.js +44 -44
- package/dist/esm/components/FloatLabel.js.map +1 -1
- package/dist/esm/components/Glass/Glass.js +15 -15
- package/dist/esm/components/Glass/Glass.js.map +1 -1
- package/dist/esm/components/ImageViewer/ImageViewer.js +53 -53
- package/dist/esm/components/ImageViewer/ImageViewer.js.map +1 -1
- package/dist/esm/components/Input/Input.js +104 -104
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/InputOTP/InputOTP.js +16 -16
- package/dist/esm/components/InputOTP/InputOTP.js.map +1 -1
- package/dist/esm/components/Interactive/CursorFollow.js +49 -49
- package/dist/esm/components/Interactive/CursorFollow.js.map +1 -1
- package/dist/esm/components/Marquee/Marquee.js +130 -130
- package/dist/esm/components/Marquee/Marquee.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +68 -68
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/QrCode/QrCode.js +37 -37
- package/dist/esm/components/QrCode/QrCode.js.map +1 -1
- package/dist/esm/components/Radio/Radio.js +16 -16
- package/dist/esm/components/Radio/Radio.js.map +1 -1
- package/dist/esm/components/Rate/Rate.js +62 -62
- package/dist/esm/components/Rate/Rate.js.map +1 -1
- package/dist/esm/components/Resizable/Resizable.js +6 -6
- package/dist/esm/components/Resizable/Resizable.js.map +1 -1
- package/dist/esm/components/ScrollArea/ScrollArea.js +10 -10
- package/dist/esm/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/esm/components/Select/Select.js +64 -64
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Sheet/Sheet.js +21 -21
- package/dist/esm/components/Sheet/Sheet.js.map +1 -1
- package/dist/esm/components/Slider/Slider.js +54 -54
- package/dist/esm/components/Slider/Slider.js.map +1 -1
- package/dist/esm/components/Stepper/Stepper.js +198 -198
- package/dist/esm/components/Stepper/Stepper.js.map +1 -1
- package/dist/esm/components/Stepper/StepperWrapper.js +15 -15
- package/dist/esm/components/Stepper/StepperWrapper.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +38 -38
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Table/TableFilter/data-table-date-filter.js +37 -37
- package/dist/esm/components/Table/TableFilter/data-table-date-filter.js.map +1 -1
- package/dist/esm/components/Table/TableFilter/data-table-filter-popover.js +25 -25
- package/dist/esm/components/Table/TableFilter/data-table-filter-popover.js.map +1 -1
- package/dist/esm/components/Table/TableFilter/data-table-slider-filter.js +64 -64
- package/dist/esm/components/Table/TableFilter/data-table-slider-filter.js.map +1 -1
- package/dist/esm/components/Table/data-table-column-header.js +18 -18
- package/dist/esm/components/Table/data-table-column-header.js.map +1 -1
- package/dist/esm/components/Table/data-table-pagination.js +21 -21
- package/dist/esm/components/Table/data-table-pagination.js.map +1 -1
- package/dist/esm/components/Table/data-table.js +18 -18
- package/dist/esm/components/Table/data-table.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +242 -242
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Tabs/classes.js +51 -51
- package/dist/esm/components/Tabs/classes.js.map +1 -1
- package/dist/esm/components/Textarea/Textarea.js +49 -49
- package/dist/esm/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/components/TimeGridView.js +12 -12
- package/dist/esm/components/TimeGridView.js.map +1 -1
- package/dist/esm/components/Toast/Toast.js +45 -45
- package/dist/esm/components/Toast/Toast.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +19 -19
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tour/Tour.js +11 -11
- package/dist/esm/components/Tour/Tour.js.map +1 -1
- package/dist/esm/components/Tour/TourWrapper.js +15 -15
- package/dist/esm/components/Tour/TourWrapper.js.map +1 -1
- package/dist/esm/components/Upload/Upload.js +405 -405
- package/dist/esm/components/Upload/Upload.js.map +1 -1
- package/dist/esm/components/WheelColumn.js +47 -47
- package/dist/esm/components/WheelColumn.js.map +1 -1
- package/dist/esm/lib/TextAnimation/BlurText.js +18 -18
- package/dist/esm/lib/TextAnimation/BlurText.js.map +1 -1
- package/dist/esm/lib/TextAnimation/CircularText.js +7 -7
- package/dist/esm/lib/TextAnimation/CircularText.js.map +1 -1
- package/dist/esm/lib/TextAnimation/FlipWords.js +21 -21
- package/dist/esm/lib/TextAnimation/FlipWords.js.map +1 -1
- package/dist/esm/lib/TextAnimation/GradientText.js +4 -4
- package/dist/esm/lib/TextAnimation/GradientText.js.map +1 -1
- package/dist/esm/lib/TextAnimation/RollingText.js +24 -24
- package/dist/esm/lib/TextAnimation/RollingText.js.map +1 -1
- package/dist/esm/lib/TextAnimation/RotatingText.js +6 -6
- package/dist/esm/lib/TextAnimation/RotatingText.js.map +1 -1
- package/dist/esm/lib/TextAnimation/ShimmeringText.js +9 -9
- package/dist/esm/lib/TextAnimation/ShimmeringText.js.map +1 -1
- package/dist/esm/lib/TextAnimation/TextGenerateEffect.js +14 -14
- package/dist/esm/lib/TextAnimation/TextGenerateEffect.js.map +1 -1
- package/dist/esm/lib/TextAnimation/TextHoverEffect.js +9 -9
- package/dist/esm/lib/TextAnimation/TextHoverEffect.js.map +1 -1
- package/dist/esm/lib/TextAnimation/TextPressureEffect.js +3 -3
- package/dist/esm/lib/TextAnimation/TextPressureEffect.js.map +1 -1
- package/dist/esm/lib/TextAnimation/TypingText.js +17 -17
- package/dist/esm/lib/TextAnimation/TypingText.js.map +1 -1
- package/dist/esm/lib/TextAnimation/WritingText.js +10 -10
- package/dist/esm/lib/TextAnimation/WritingText.js.map +1 -1
- package/dist/esm/node_modules/.pnpm/nuqs@2.8.0_next@15.5.9_@babel_core@7.28.5_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/nuqs/dist/server.js.map +1 -0
- package/dist/esm/packages/ui/src/components/accordion.js +31 -31
- package/dist/esm/packages/ui/src/components/accordion.js.map +1 -1
- package/dist/esm/packages/ui/src/components/alert-dialog.js +33 -33
- package/dist/esm/packages/ui/src/components/alert-dialog.js.map +1 -1
- package/dist/esm/packages/ui/src/components/avatar.js +20 -20
- package/dist/esm/packages/ui/src/components/avatar.js.map +1 -1
- package/dist/esm/packages/ui/src/components/badge.js +53 -53
- package/dist/esm/packages/ui/src/components/badge.js.map +1 -1
- package/dist/esm/packages/ui/src/components/breadcrumb.js +20 -20
- package/dist/esm/packages/ui/src/components/breadcrumb.js.map +1 -1
- package/dist/esm/packages/ui/src/components/button-group.js +31 -31
- package/dist/esm/packages/ui/src/components/button-group.js.map +1 -1
- package/dist/esm/packages/ui/src/components/button.js +90 -90
- package/dist/esm/packages/ui/src/components/button.js.map +1 -1
- package/dist/esm/packages/ui/src/components/calendar.js +94 -94
- package/dist/esm/packages/ui/src/components/calendar.js.map +1 -1
- package/dist/esm/packages/ui/src/components/checkbox.js +47 -47
- package/dist/esm/packages/ui/src/components/checkbox.js.map +1 -1
- package/dist/esm/packages/ui/src/components/combobox.js +64 -64
- package/dist/esm/packages/ui/src/components/combobox.js.map +1 -1
- package/dist/esm/packages/ui/src/components/command.js +77 -77
- package/dist/esm/packages/ui/src/components/command.js.map +1 -1
- package/dist/esm/packages/ui/src/components/context-menu.js +76 -76
- package/dist/esm/packages/ui/src/components/context-menu.js.map +1 -1
- package/dist/esm/packages/ui/src/components/dialog.js +54 -54
- package/dist/esm/packages/ui/src/components/dialog.js.map +1 -1
- package/dist/esm/packages/ui/src/components/drawer.js +39 -39
- package/dist/esm/packages/ui/src/components/drawer.js.map +1 -1
- package/dist/esm/packages/ui/src/components/dropdown-menu.js +109 -109
- package/dist/esm/packages/ui/src/components/dropdown-menu.js.map +1 -1
- package/dist/esm/packages/ui/src/components/input-otp.js +30 -30
- package/dist/esm/packages/ui/src/components/input-otp.js.map +1 -1
- package/dist/esm/packages/ui/src/components/input.js +19 -19
- package/dist/esm/packages/ui/src/components/input.js.map +1 -1
- package/dist/esm/packages/ui/src/components/label.js +9 -9
- package/dist/esm/packages/ui/src/components/label.js.map +1 -1
- package/dist/esm/packages/ui/src/components/pagination.js +26 -26
- package/dist/esm/packages/ui/src/components/pagination.js.map +1 -1
- package/dist/esm/packages/ui/src/components/popover.js +13 -13
- package/dist/esm/packages/ui/src/components/popover.js.map +1 -1
- package/dist/esm/packages/ui/src/components/radio-group.js +45 -45
- package/dist/esm/packages/ui/src/components/radio-group.js.map +1 -1
- package/dist/esm/packages/ui/src/components/resizable.js +18 -18
- package/dist/esm/packages/ui/src/components/resizable.js.map +1 -1
- package/dist/esm/packages/ui/src/components/scroll-area.js +31 -31
- package/dist/esm/packages/ui/src/components/scroll-area.js.map +1 -1
- package/dist/esm/packages/ui/src/components/select.js +119 -119
- package/dist/esm/packages/ui/src/components/select.js.map +1 -1
- package/dist/esm/packages/ui/src/components/separator.js +86 -86
- package/dist/esm/packages/ui/src/components/separator.js.map +1 -1
- package/dist/esm/packages/ui/src/components/sheet.js +50 -50
- package/dist/esm/packages/ui/src/components/sheet.js.map +1 -1
- package/dist/esm/packages/ui/src/components/sidebar.js +198 -198
- package/dist/esm/packages/ui/src/components/sidebar.js.map +1 -1
- package/dist/esm/packages/ui/src/components/skeleton.js +3 -3
- package/dist/esm/packages/ui/src/components/skeleton.js.map +1 -1
- package/dist/esm/packages/ui/src/components/switch.js +57 -57
- package/dist/esm/packages/ui/src/components/switch.js.map +1 -1
- package/dist/esm/packages/ui/src/components/table.js +17 -17
- package/dist/esm/packages/ui/src/components/table.js.map +1 -1
- package/dist/esm/packages/ui/src/components/tabs.js +33 -33
- package/dist/esm/packages/ui/src/components/tabs.js.map +1 -1
- package/dist/esm/packages/ui/src/components/textarea.js +17 -17
- package/dist/esm/packages/ui/src/components/textarea.js.map +1 -1
- package/dist/esm/packages/ui/src/components/toggle.js +36 -36
- package/dist/esm/packages/ui/src/components/toggle.js.map +1 -1
- package/dist/esm/packages/ui/src/components/tooltip.js +20 -20
- package/dist/esm/packages/ui/src/components/tooltip.js.map +1 -1
- package/dist/esm/packages/ui/src/components/tree-view.js +218 -218
- package/dist/esm/packages/ui/src/components/tree-view.js.map +1 -1
- package/dist/esm/styles/index.css +1 -1
- package/dist/esm/utils/animations.js +55 -55
- package/dist/esm/utils/animations.js.map +1 -1
- package/dist/esm/utils/css.js +7 -7
- package/dist/esm/utils/css.js.map +1 -1
- package/dist/esm/utils/parsers.js +1 -1
- package/dist/types/components/DatePicker/RangePicker.d.ts.map +1 -1
- package/dist/types/lib/TextAnimation/TextPressureEffect.d.ts.map +1 -1
- package/dist/types/lib/TextAnimation/TypingText.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/node_modules/.pnpm/nuqs@2.8.0_next@15.5.9_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/nuqs/dist/server.cjs.map +0 -1
- package/dist/esm/node_modules/.pnpm/nuqs@2.8.0_next@15.5.9_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/nuqs/dist/server.js.map +0 -1
- /package/dist/cjs/node_modules/.pnpm/{nuqs@2.8.0_next@15.5.9_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → nuqs@2.8.0_next@15.5.9_@babel_core@7.28.5_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1}/node_modules/nuqs/dist/server.cjs +0 -0
- /package/dist/esm/node_modules/.pnpm/{nuqs@2.8.0_next@15.5.9_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → nuqs@2.8.0_next@15.5.9_@babel_core@7.28.5_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1}/node_modules/nuqs/dist/server.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularText.cjs","sources":["../../../../src/lib/TextAnimation/CircularText.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect } from \"react\";\nimport {\n motion,\n useAnimation,\n useMotionValue,\n MotionValue,\n type Transition,\n} from \"motion/react\";\n\ninterface CircularTextProps {\n text: string;\n spinDuration?: number;\n onHover?: \"slowDown\" | \"speedUp\" | \"pause\" | \"goBonkers\";\n className?: string;\n}\n\nconst getRotationTransition = (\n duration: number,\n from: number,\n loop: boolean = true\n) => ({\n from,\n to: from + 360,\n ease: \"linear\" as const,\n duration,\n type: \"tween\" as const,\n repeat: loop ? Infinity : 0,\n});\n\nconst getTransition = (duration: number, from: number) => ({\n rotate: getRotationTransition(duration, from),\n scale: {\n type: \"spring\" as const,\n damping: 20,\n stiffness: 300,\n },\n});\n\nconst CircularText: React.FC<CircularTextProps> = ({\n text,\n spinDuration = 20,\n onHover = \"speedUp\",\n className = \"\",\n}) => {\n const letters = Array.from(text);\n const controls = useAnimation();\n const rotation: MotionValue<number> = useMotionValue(0);\n useEffect(() => {\n const start = rotation.get();\n controls.start({\n rotate: start + 360,\n scale: 1,\n transition: getTransition(spinDuration, start),\n });\n }, [spinDuration, text, onHover, controls, rotation]);\n const handleHoverStart = () => {\n const start = rotation.get();\n if (!onHover) return;\n let transitionConfig: ReturnType<typeof getTransition> | Transition;\n let scaleVal = 1;\n switch (onHover) {\n case \"slowDown\":\n transitionConfig = getTransition(spinDuration * 2, start);\n break;\n case \"speedUp\":\n transitionConfig = getTransition(spinDuration / 4, start);\n break;\n case \"pause\":\n transitionConfig = {\n rotate: { type: \"spring\", damping: 20, stiffness: 300 },\n scale: { type: \"spring\", damping: 20, stiffness: 300 },\n };\n break;\n case \"goBonkers\":\n transitionConfig = getTransition(spinDuration / 20, start);\n scaleVal = 0.8;\n break;\n default:\n transitionConfig = getTransition(spinDuration, start);\n }\n controls.start({\n rotate: start + 360,\n scale: scaleVal,\n transition: transitionConfig,\n });\n };\n const handleHoverEnd = () => {\n const start = rotation.get();\n controls.start({\n rotate: start + 360,\n scale: 1,\n transition: getTransition(spinDuration, start),\n });\n };\n return (\n <motion.div\n className={`m-0 mx-auto rounded-full w-[200px] h-[200px] relative font-black text-foreground text-center cursor-pointer origin-center ${className}`}\n style={{ rotate: rotation }}\n initial={{ rotate: 0 }}\n animate={controls}\n onMouseEnter={handleHoverStart}\n onMouseLeave={handleHoverEnd}\n >\n {letters.map((letter, i) => {\n const rotationDeg = (360 / letters.length) * i;\n const factor = Math.PI / letters.length;\n const x = factor * i;\n const y = factor * i;\n const transform = `rotateZ(${rotationDeg}deg) translate3d(${x}px, ${y}px, 0)`;\n return (\n <span\n key={i}\n className=\"absolute inline-block inset-0 text-2xl transition-all duration-500 ease-[cubic-bezier(0,0,0,1)]\"\n style={{ transform, WebkitTransform: transform }}\n >\n {letter}\n </span>\n );\n })}\n </motion.div>\n );\n};\n\nexport default CircularText;\n"],"names":["getRotationTransition","duration","from","loop","getTransition","CircularText","text","spinDuration","onHover","className","letters","controls","useAnimation","rotation","useMotionValue","useEffect","start","handleHoverStart","transitionConfig","scaleVal","handleHoverEnd","jsx","motion","letter","i","rotationDeg","factor","x","transform"],"mappings":"8LAiBMA,EAAwB,CAC5BC,EACAC,EACAC,EAAgB,MACZ,CACJ,KAAAD,EACA,GAAIA,EAAO,IACX,KAAM,SACN,SAAAD,EACA,KAAM,QACN,OAAQE,EAAO,IAAW,CAC5B,GAEMC,EAAgB,CAACH,EAAkBC,KAAkB,CACzD,OAAQF,EAAsBC,EAAUC,CAAI,EAC5C,MAAO,CACL,KAAM,SACN,QAAS,GACT,UAAW,GAAA,CAEf,GAEMG,EAA4C,CAAC,CACjD,KAAAC,EACA,aAAAC,EAAe,GACf,QAAAC,EAAU,UACV,UAAAC,EAAY,EACd,IAAM,CACJ,MAAMC,EAAU,MAAM,KAAKJ,CAAI,EACzBK,EAAWC,EAAAA,aAAA,EACXC,EAAgCC,EAAAA,eAAe,CAAC,EACtDC,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAQH,EAAS,IAAA,EACvBF,EAAS,MAAM,CACb,OAAQK,EAAQ,IAChB,MAAO,EACP,WAAYZ,EAAcG,EAAcS,CAAK,CAAA,CAC9C,CACH,EAAG,CAACT,EAAcD,EAAME,EAASG,EAAUE,CAAQ,CAAC,EACpD,MAAMI,EAAmB,IAAM,CAC7B,MAAMD,EAAQH,EAAS,IAAA,EACvB,GAAI,CAACL,EAAS,OACd,IAAIU,EACAC,EAAW,EACf,OAAQX,EAAA,CACN,IAAK,WACHU,EAAmBd,EAAcG,EAAe,EAAGS,CAAK,EACxD,MACF,IAAK,UACHE,EAAmBd,EAAcG,EAAe,EAAGS,CAAK,EACxD,MACF,IAAK,QACHE,EAAmB,CACjB,OAAQ,CAAE,KAAM,SAAU,QAAS,GAAI,UAAW,GAAA,EAClD,MAAO,CAAE,KAAM,SAAU,QAAS,GAAI,UAAW,GAAA,CAAI,EAEvD,MACF,IAAK,YACHA,EAAmBd,EAAcG,EAAe,GAAIS,CAAK,EACzDG,EAAW,GACX,MACF,QACED,EAAmBd,EAAcG,EAAcS,CAAK,CAAA,CAExDL,EAAS,MAAM,CACb,OAAQK,EAAQ,IAChB,MAAOG,EACP,WAAYD,CAAA,CACb,CACH,EACME,EAAiB,IAAM,CAC3B,MAAMJ,EAAQH,EAAS,IAAA,EACvBF,EAAS,MAAM,CACb,OAAQK,EAAQ,IAChB,MAAO,EACP,WAAYZ,EAAcG,EAAcS,CAAK,CAAA,CAC9C,CACH,EACA,OACEK,EAAAA,IAACC,EAAAA,OAAO,IAAP,CACC,UAAW,
|
|
1
|
+
{"version":3,"file":"CircularText.cjs","sources":["../../../../src/lib/TextAnimation/CircularText.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect } from \"react\";\nimport {\n motion,\n useAnimation,\n useMotionValue,\n MotionValue,\n type Transition,\n} from \"motion/react\";\n\ninterface CircularTextProps {\n text: string;\n spinDuration?: number;\n onHover?: \"slowDown\" | \"speedUp\" | \"pause\" | \"goBonkers\";\n className?: string;\n}\n\nconst getRotationTransition = (\n duration: number,\n from: number,\n loop: boolean = true\n) => ({\n from,\n to: from + 360,\n ease: \"linear\" as const,\n duration,\n type: \"tween\" as const,\n repeat: loop ? Infinity : 0,\n});\n\nconst getTransition = (duration: number, from: number) => ({\n rotate: getRotationTransition(duration, from),\n scale: {\n type: \"spring\" as const,\n damping: 20,\n stiffness: 300,\n },\n});\n\nconst CircularText: React.FC<CircularTextProps> = ({\n text,\n spinDuration = 20,\n onHover = \"speedUp\",\n className = \"\",\n}) => {\n const letters = Array.from(text);\n const controls = useAnimation();\n const rotation: MotionValue<number> = useMotionValue(0);\n useEffect(() => {\n const start = rotation.get();\n controls.start({\n rotate: start + 360,\n scale: 1,\n transition: getTransition(spinDuration, start),\n });\n }, [spinDuration, text, onHover, controls, rotation]);\n const handleHoverStart = () => {\n const start = rotation.get();\n if (!onHover) return;\n let transitionConfig: ReturnType<typeof getTransition> | Transition;\n let scaleVal = 1;\n switch (onHover) {\n case \"slowDown\":\n transitionConfig = getTransition(spinDuration * 2, start);\n break;\n case \"speedUp\":\n transitionConfig = getTransition(spinDuration / 4, start);\n break;\n case \"pause\":\n transitionConfig = {\n rotate: { type: \"spring\", damping: 20, stiffness: 300 },\n scale: { type: \"spring\", damping: 20, stiffness: 300 },\n };\n break;\n case \"goBonkers\":\n transitionConfig = getTransition(spinDuration / 20, start);\n scaleVal = 0.8;\n break;\n default:\n transitionConfig = getTransition(spinDuration, start);\n }\n controls.start({\n rotate: start + 360,\n scale: scaleVal,\n transition: transitionConfig,\n });\n };\n const handleHoverEnd = () => {\n const start = rotation.get();\n controls.start({\n rotate: start + 360,\n scale: 1,\n transition: getTransition(spinDuration, start),\n });\n };\n return (\n <motion.div\n className={`ds:m-0 ds:mx-auto ds:rounded-full ds:w-[200px] ds:h-[200px] ds:relative ds:font-black ds:text-foreground ds:text-center ds:cursor-pointer ds:origin-center ${className}`}\n style={{ rotate: rotation }}\n initial={{ rotate: 0 }}\n animate={controls}\n onMouseEnter={handleHoverStart}\n onMouseLeave={handleHoverEnd}\n >\n {letters.map((letter, i) => {\n const rotationDeg = (360 / letters.length) * i;\n const factor = Math.PI / letters.length;\n const x = factor * i;\n const y = factor * i;\n const transform = `rotateZ(${rotationDeg}deg) translate3d(${x}px, ${y}px, 0)`;\n return (\n <span\n key={i}\n className=\"ds:absolute ds:inline-block ds:inset-0 ds:text-2xl ds:transition-all ds:duration-500 ds:ease-[cubic-bezier(0,0,0,1)]\"\n style={{ transform, WebkitTransform: transform }}\n >\n {letter}\n </span>\n );\n })}\n </motion.div>\n );\n};\n\nexport default CircularText;\n"],"names":["getRotationTransition","duration","from","loop","getTransition","CircularText","text","spinDuration","onHover","className","letters","controls","useAnimation","rotation","useMotionValue","useEffect","start","handleHoverStart","transitionConfig","scaleVal","handleHoverEnd","jsx","motion","letter","i","rotationDeg","factor","x","transform"],"mappings":"8LAiBMA,EAAwB,CAC5BC,EACAC,EACAC,EAAgB,MACZ,CACJ,KAAAD,EACA,GAAIA,EAAO,IACX,KAAM,SACN,SAAAD,EACA,KAAM,QACN,OAAQE,EAAO,IAAW,CAC5B,GAEMC,EAAgB,CAACH,EAAkBC,KAAkB,CACzD,OAAQF,EAAsBC,EAAUC,CAAI,EAC5C,MAAO,CACL,KAAM,SACN,QAAS,GACT,UAAW,GAAA,CAEf,GAEMG,EAA4C,CAAC,CACjD,KAAAC,EACA,aAAAC,EAAe,GACf,QAAAC,EAAU,UACV,UAAAC,EAAY,EACd,IAAM,CACJ,MAAMC,EAAU,MAAM,KAAKJ,CAAI,EACzBK,EAAWC,EAAAA,aAAA,EACXC,EAAgCC,EAAAA,eAAe,CAAC,EACtDC,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAQH,EAAS,IAAA,EACvBF,EAAS,MAAM,CACb,OAAQK,EAAQ,IAChB,MAAO,EACP,WAAYZ,EAAcG,EAAcS,CAAK,CAAA,CAC9C,CACH,EAAG,CAACT,EAAcD,EAAME,EAASG,EAAUE,CAAQ,CAAC,EACpD,MAAMI,EAAmB,IAAM,CAC7B,MAAMD,EAAQH,EAAS,IAAA,EACvB,GAAI,CAACL,EAAS,OACd,IAAIU,EACAC,EAAW,EACf,OAAQX,EAAA,CACN,IAAK,WACHU,EAAmBd,EAAcG,EAAe,EAAGS,CAAK,EACxD,MACF,IAAK,UACHE,EAAmBd,EAAcG,EAAe,EAAGS,CAAK,EACxD,MACF,IAAK,QACHE,EAAmB,CACjB,OAAQ,CAAE,KAAM,SAAU,QAAS,GAAI,UAAW,GAAA,EAClD,MAAO,CAAE,KAAM,SAAU,QAAS,GAAI,UAAW,GAAA,CAAI,EAEvD,MACF,IAAK,YACHA,EAAmBd,EAAcG,EAAe,GAAIS,CAAK,EACzDG,EAAW,GACX,MACF,QACED,EAAmBd,EAAcG,EAAcS,CAAK,CAAA,CAExDL,EAAS,MAAM,CACb,OAAQK,EAAQ,IAChB,MAAOG,EACP,WAAYD,CAAA,CACb,CACH,EACME,EAAiB,IAAM,CAC3B,MAAMJ,EAAQH,EAAS,IAAA,EACvBF,EAAS,MAAM,CACb,OAAQK,EAAQ,IAChB,MAAO,EACP,WAAYZ,EAAcG,EAAcS,CAAK,CAAA,CAC9C,CACH,EACA,OACEK,EAAAA,IAACC,EAAAA,OAAO,IAAP,CACC,UAAW,8JAA8Jb,CAAS,GAClL,MAAO,CAAE,OAAQI,CAAA,EACjB,QAAS,CAAE,OAAQ,CAAA,EACnB,QAASF,EACT,aAAcM,EACd,aAAcG,EAEb,SAAAV,EAAQ,IAAI,CAACa,EAAQC,IAAM,CAC1B,MAAMC,EAAe,IAAMf,EAAQ,OAAUc,EACvCE,EAAS,KAAK,GAAKhB,EAAQ,OAC3BiB,EAAID,EAASF,EACb,EAAIE,EAASF,EACbI,EAAY,WAAWH,CAAW,oBAAoBE,CAAC,OAAO,CAAC,SACrE,OACEN,EAAAA,IAAC,OAAA,CAEC,UAAU,uHACV,MAAO,CAAE,UAAAO,EAAW,gBAAiBA,CAAA,EAEpC,SAAAL,CAAA,EAJIC,CAAA,CAOX,CAAC,CAAA,CAAA,CAGP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),h=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),h=require("react"),u=require("motion/react");require("@radix-ui/react-slot");require("../../packages/ui/src/components/button.cjs");require("../../packages/ui/src/components/button-group.cjs");require("../../packages/ui/src/components/input.cjs");require("../../packages/ui/src/components/textarea.cjs");require("@radix-ui/react-label");const j=require("../../packages/ui/src/lib/utils.cjs");require("../../packages/ui/src/components/select.cjs");require("../../packages/ui/src/components/combobox.cjs");require("@radix-ui/react-tooltip");require("lucide-react");require("react-day-picker");require("../../packages/ui/src/components/popover.cjs");require("@radix-ui/react-separator");require("../../packages/ui/src/components/switch.cjs");require("vaul");require("@radix-ui/react-scroll-area");require("../../packages/ui/src/components/tree-view.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-avatar");require("../../packages/ui/src/components/badge.cjs");require("../../packages/ui/src/components/checkbox.cjs");require("@radix-ui/react-collapsible");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-dropdown-menu");require("../../packages/ui/src/components/input-otp.cjs");require("../../packages/ui/src/components/radio-group.cjs");require("../../packages/ui/src/components/sidebar.cjs");require("@radix-ui/react-slider");require("../../packages/ui/src/components/tabs.cjs");require("../../packages/ui/src/components/toggle.cjs");function O(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const r in i)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}return e.default=i,Object.freeze(e)}const a=O(h);function k({ref:i,words:e,duration:r=3e3,letterDelay:s=.05,wordDelay:o=.3,className:y,...b}){const p=a.useRef(null);a.useImperativeHandle(i,()=>p.current);const[l,g]=a.useState(e[0]),[q,f]=a.useState(!1),m=a.useCallback(()=>{const t=e[e.indexOf(l)+1]||e[0];g(t),f(!0)},[l,e]);return a.useEffect(()=>{if(!q){const t=setTimeout(()=>{m()},r);return()=>clearTimeout(t)}},[q,r,m]),n.jsx("span",{ref:p,"data-slot":"flip-words",...b,children:n.jsx(u.AnimatePresence,{onExitComplete:()=>{f(!1)},children:n.jsx(u.motion.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{type:"spring",stiffness:100,damping:10},exit:{opacity:0,y:-40,x:40,filter:"blur(8px)",scale:2,position:"absolute"},className:j.cn("ds:inline-block ds:relative ds:text-left ds:px-2 ds:will-change-transform ds:will-change-opacity ds:will-change-filter",y),children:l.split(" ").map((t,c)=>n.jsxs(u.motion.span,{initial:{opacity:0,y:10,filter:"blur(8px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{delay:c*o,duration:.3},className:"ds:inline-block ds:whitespace-nowrap",children:[t.split("").map((x,d)=>n.jsx(u.motion.span,{initial:{opacity:0,y:10,filter:"blur(8px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{delay:c*o+d*s,duration:.2},className:"ds:inline-block ds:will-change-transform ds:will-change-opacity ds:will-change-filter",children:x},`${t}-${d}`)),n.jsx("span",{className:"ds:inline-block",children:" "})]},`${t}-${c}`))},l)})})}exports.FlipWords=k;
|
|
2
2
|
//# sourceMappingURL=FlipWords.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlipWords.cjs","sources":["../../../../src/lib/TextAnimation/FlipWords.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { cn } from \"@dsui/ui/index\";\n\ntype FlipWordsProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n words: string[];\n duration?: number;\n letterDelay?: number;\n wordDelay?: number;\n};\n\nfunction FlipWords({\n ref,\n words,\n duration = 3000,\n letterDelay = 0.05,\n wordDelay = 0.3,\n className,\n ...props\n}: FlipWordsProps) {\n const localRef = React.useRef<HTMLSpanElement>(null);\n React.useImperativeHandle(\n ref as any,\n () => localRef.current as HTMLSpanElement\n );\n const [currentWord, setCurrentWord] = React.useState(words[0]);\n const [isAnimating, setIsAnimating] = React.useState<boolean>(false);\n\n const startAnimation = React.useCallback(() => {\n const word = words[words.indexOf(currentWord) + 1] || words[0];\n setCurrentWord(word);\n setIsAnimating(true);\n }, [currentWord, words]);\n\n React.useEffect(() => {\n if (!isAnimating) {\n const timeoutId = setTimeout(() => {\n startAnimation();\n }, duration);\n return () => clearTimeout(timeoutId);\n }\n }, [isAnimating, duration, startAnimation]);\n\n return (\n <span ref={localRef} data-slot=\"flip-words\" {...(props as any)}>\n <AnimatePresence\n onExitComplete={() => {\n setIsAnimating(false);\n }}\n >\n <motion.span\n initial={{\n opacity: 0,\n y: 10,\n }}\n animate={{\n opacity: 1,\n y: 0,\n }}\n transition={{\n type: \"spring\",\n stiffness: 100,\n damping: 10,\n }}\n exit={{\n opacity: 0,\n y: -40,\n x: 40,\n filter: \"blur(8px)\",\n scale: 2,\n position: \"absolute\",\n }}\n className={cn(\n \"inline-block relative text-left px-2 will-change-transform will-change-opacity will-change-filter\",\n className\n )}\n key={currentWord}\n >\n {currentWord.split(\" \").map((word, wordIndex) => (\n <motion.span\n key={`${word}-${wordIndex}`}\n initial={{ opacity: 0, y: 10, filter: \"blur(8px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n transition={{\n delay: wordIndex * wordDelay,\n duration: 0.3,\n }}\n className=\"inline-block whitespace-nowrap\"\n >\n {word.split(\"\").map((letter, letterIndex) => (\n <motion.span\n key={`${word}-${letterIndex}`}\n initial={{ opacity: 0, y: 10, filter: \"blur(8px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n transition={{\n delay: wordIndex * wordDelay + letterIndex * letterDelay,\n duration: 0.2,\n }}\n className=\"inline-block will-change-transform will-change-opacity will-change-filter\"\n >\n {letter}\n </motion.span>\n ))}\n <span className=\"inline-block\"> </span>\n </motion.span>\n ))}\n </motion.span>\n </AnimatePresence>\n </span>\n );\n}\n\nexport { FlipWords, type FlipWordsProps };\n"],"names":["FlipWords","ref","words","duration","letterDelay","wordDelay","className","props","localRef","React","currentWord","setCurrentWord","isAnimating","setIsAnimating","startAnimation","word","timeoutId","jsx","AnimatePresence","motion","cn","wordIndex","jsxs","letter","letterIndex"],"mappings":"01DAYA,SAASA,EAAU,CACjB,IAAAC,EACA,MAAAC,EACA,SAAAC,EAAW,IACX,YAAAC,EAAc,IACd,UAAAC,EAAY,GACZ,UAAAC,EACA,GAAGC,CACL,EAAmB,CACjB,MAAMC,EAAWC,EAAM,OAAwB,IAAI,EACnDA,EAAM,oBACJR,EACA,IAAMO,EAAS,OAAA,EAEjB,KAAM,CAACE,EAAaC,CAAc,EAAIF,EAAM,SAASP,EAAM,CAAC,CAAC,EACvD,CAACU,EAAaC,CAAc,EAAIJ,EAAM,SAAkB,EAAK,EAE7DK,EAAiBL,EAAM,YAAY,IAAM,CAC7C,MAAMM,EAAOb,EAAMA,EAAM,QAAQQ,CAAW,EAAI,CAAC,GAAKR,EAAM,CAAC,EAC7DS,EAAeI,CAAI,EACnBF,EAAe,EAAI,CACrB,EAAG,CAACH,EAAaR,CAAK,CAAC,EAEvBO,OAAAA,EAAM,UAAU,IAAM,CACpB,GAAI,CAACG,EAAa,CAChB,MAAMI,EAAY,WAAW,IAAM,CACjCF,EAAA,CACF,EAAGX,CAAQ,EACX,MAAO,IAAM,aAAaa,CAAS,CACrC,CACF,EAAG,CAACJ,EAAaT,EAAUW,CAAc,CAAC,QAGvC,OAAA,CAAK,IAAKN,EAAU,YAAU,aAAc,GAAID,EAC/C,SAAAU,EAAAA,IAACC,EAAAA,gBAAA,CACC,eAAgB,IAAM,CACpBL,EAAe,EAAK,CACtB,EAEA,SAAAI,EAAAA,IAACE,EAAAA,OAAO,KAAP,CACC,QAAS,CACP,QAAS,EACT,EAAG,EAAA,EAEL,QAAS,CACP,QAAS,EACT,EAAG,CAAA,EAEL,WAAY,CACV,KAAM,SACN,UAAW,IACX,QAAS,EAAA,EAEX,KAAM,CACJ,QAAS,EACT,EAAG,IACH,EAAG,GACH,OAAQ,YACR,MAAO,EACP,SAAU,UAAA,EAEZ,UAAWC,EAAAA,GACT,
|
|
1
|
+
{"version":3,"file":"FlipWords.cjs","sources":["../../../../src/lib/TextAnimation/FlipWords.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { cn } from \"@dsui/ui/index\";\n\ntype FlipWordsProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n words: string[];\n duration?: number;\n letterDelay?: number;\n wordDelay?: number;\n};\n\nfunction FlipWords({\n ref,\n words,\n duration = 3000,\n letterDelay = 0.05,\n wordDelay = 0.3,\n className,\n ...props\n}: FlipWordsProps) {\n const localRef = React.useRef<HTMLSpanElement>(null);\n React.useImperativeHandle(\n ref as any,\n () => localRef.current as HTMLSpanElement\n );\n const [currentWord, setCurrentWord] = React.useState(words[0]);\n const [isAnimating, setIsAnimating] = React.useState<boolean>(false);\n\n const startAnimation = React.useCallback(() => {\n const word = words[words.indexOf(currentWord) + 1] || words[0];\n setCurrentWord(word);\n setIsAnimating(true);\n }, [currentWord, words]);\n\n React.useEffect(() => {\n if (!isAnimating) {\n const timeoutId = setTimeout(() => {\n startAnimation();\n }, duration);\n return () => clearTimeout(timeoutId);\n }\n }, [isAnimating, duration, startAnimation]);\n\n return (\n <span ref={localRef} data-slot=\"flip-words\" {...(props as any)}>\n <AnimatePresence\n onExitComplete={() => {\n setIsAnimating(false);\n }}\n >\n <motion.span\n initial={{\n opacity: 0,\n y: 10,\n }}\n animate={{\n opacity: 1,\n y: 0,\n }}\n transition={{\n type: \"spring\",\n stiffness: 100,\n damping: 10,\n }}\n exit={{\n opacity: 0,\n y: -40,\n x: 40,\n filter: \"blur(8px)\",\n scale: 2,\n position: \"absolute\",\n }}\n className={cn(\n \"ds:inline-block ds:relative ds:text-left ds:px-2 ds:will-change-transform ds:will-change-opacity ds:will-change-filter\",\n className\n )}\n key={currentWord}\n >\n {currentWord.split(\" \").map((word, wordIndex) => (\n <motion.span\n key={`${word}-${wordIndex}`}\n initial={{ opacity: 0, y: 10, filter: \"blur(8px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n transition={{\n delay: wordIndex * wordDelay,\n duration: 0.3,\n }}\n className=\"ds:inline-block ds:whitespace-nowrap\"\n >\n {word.split(\"\").map((letter, letterIndex) => (\n <motion.span\n key={`${word}-${letterIndex}`}\n initial={{ opacity: 0, y: 10, filter: \"blur(8px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n transition={{\n delay: wordIndex * wordDelay + letterIndex * letterDelay,\n duration: 0.2,\n }}\n className=\"ds:inline-block ds:will-change-transform ds:will-change-opacity ds:will-change-filter\"\n >\n {letter}\n </motion.span>\n ))}\n <span className=\"ds:inline-block\"> </span>\n </motion.span>\n ))}\n </motion.span>\n </AnimatePresence>\n </span>\n );\n}\n\nexport { FlipWords, type FlipWordsProps };\n"],"names":["FlipWords","ref","words","duration","letterDelay","wordDelay","className","props","localRef","React","currentWord","setCurrentWord","isAnimating","setIsAnimating","startAnimation","word","timeoutId","jsx","AnimatePresence","motion","cn","wordIndex","jsxs","letter","letterIndex"],"mappings":"01DAYA,SAASA,EAAU,CACjB,IAAAC,EACA,MAAAC,EACA,SAAAC,EAAW,IACX,YAAAC,EAAc,IACd,UAAAC,EAAY,GACZ,UAAAC,EACA,GAAGC,CACL,EAAmB,CACjB,MAAMC,EAAWC,EAAM,OAAwB,IAAI,EACnDA,EAAM,oBACJR,EACA,IAAMO,EAAS,OAAA,EAEjB,KAAM,CAACE,EAAaC,CAAc,EAAIF,EAAM,SAASP,EAAM,CAAC,CAAC,EACvD,CAACU,EAAaC,CAAc,EAAIJ,EAAM,SAAkB,EAAK,EAE7DK,EAAiBL,EAAM,YAAY,IAAM,CAC7C,MAAMM,EAAOb,EAAMA,EAAM,QAAQQ,CAAW,EAAI,CAAC,GAAKR,EAAM,CAAC,EAC7DS,EAAeI,CAAI,EACnBF,EAAe,EAAI,CACrB,EAAG,CAACH,EAAaR,CAAK,CAAC,EAEvBO,OAAAA,EAAM,UAAU,IAAM,CACpB,GAAI,CAACG,EAAa,CAChB,MAAMI,EAAY,WAAW,IAAM,CACjCF,EAAA,CACF,EAAGX,CAAQ,EACX,MAAO,IAAM,aAAaa,CAAS,CACrC,CACF,EA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BIX,CAAA,CA8BP,CAAA,EAEJ,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const u=require("motion/react");require("@radix-ui/react-slot");require("../../packages/ui/src/components/button.cjs");require("../../packages/ui/src/components/button-group.cjs");require("../../packages/ui/src/components/input.cjs");require("../../packages/ui/src/components/textarea.cjs");require("@radix-ui/react-label");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const u=require("motion/react");require("@radix-ui/react-slot");require("../../packages/ui/src/components/button.cjs");require("../../packages/ui/src/components/button-group.cjs");require("../../packages/ui/src/components/input.cjs");require("../../packages/ui/src/components/textarea.cjs");require("@radix-ui/react-label");const d=require("../../packages/ui/src/lib/utils.cjs");require("../../packages/ui/src/components/select.cjs");require("../../packages/ui/src/components/combobox.cjs");require("@radix-ui/react-tooltip");require("lucide-react");require("react-day-picker");require("../../packages/ui/src/components/popover.cjs");require("@radix-ui/react-separator");require("../../packages/ui/src/components/switch.cjs");require("vaul");require("@radix-ui/react-scroll-area");require("../../packages/ui/src/components/tree-view.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-avatar");require("../../packages/ui/src/components/badge.cjs");require("../../packages/ui/src/components/checkbox.cjs");require("@radix-ui/react-collapsible");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-dropdown-menu");require("../../packages/ui/src/components/input-otp.cjs");require("../../packages/ui/src/components/radio-group.cjs");require("../../packages/ui/src/components/sidebar.cjs");require("@radix-ui/react-slider");require("../../packages/ui/src/components/tabs.cjs");require("../../packages/ui/src/components/toggle.cjs");function l({text:r,className:a,gradient:n="linear-gradient(90deg, #3b82f6 0%, #a855f7 20%, #ec4899 50%, #a855f7 80%, #3b82f6 100%)",neon:s=!1,transition:i={duration:3,repeat:1/0,ease:"linear"},...q}){const t={backgroundImage:n,backgroundClip:"text",WebkitBackgroundClip:"text",backgroundSize:"200% 100%",color:"transparent"};return e.jsxs("span",{"data-slot":"gradient-text",className:d.cn("ds:relative ds:inline-block",a),...q,children:[e.jsx(u.motion.span,{className:"ds:m-0 ds:text-transparent",style:t,animate:{backgroundPosition:["0% 0%","200% 0%"]},transition:i,children:r}),s&&e.jsx(u.motion.span,{className:"ds:m-0 ds:absolute ds:top-0 ds:left-0 ds:text-transparent ds:blur-sm ds:mix-blend-plus-lighter",style:t,animate:{backgroundPosition:["0% 0%","200% 0%"]},transition:i,children:r})]})}exports.GradientText=l;
|
|
2
2
|
//# sourceMappingURL=GradientText.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GradientText.cjs","sources":["../../../../src/lib/TextAnimation/GradientText.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { motion, type Transition } from \"motion/react\";\nimport { cn } from \"@dsui/ui/index\";\n\ntype GradientTextProps = React.ComponentProps<\"span\"> & {\n text: string;\n gradient?: string;\n neon?: boolean;\n transition?: Transition;\n};\n\nfunction GradientText({\n text,\n className,\n gradient = \"linear-gradient(90deg, #3b82f6 0%, #a855f7 20%, #ec4899 50%, #a855f7 80%, #3b82f6 100%)\",\n neon = false,\n transition = { duration: 3, repeat: Infinity, ease: \"linear\" },\n ...props\n}: GradientTextProps) {\n const baseStyle: React.CSSProperties = {\n backgroundImage: gradient,\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n backgroundSize: \"200% 100%\",\n color: \"transparent\",\n };\n\n return (\n <span\n data-slot=\"gradient-text\"\n className={cn(\"relative inline-block\", className)}\n {...(props as any)}\n >\n <motion.span\n className=\"m-0 text-transparent\"\n style={baseStyle as any}\n animate={{ backgroundPosition: [\"0% 0%\", \"200% 0%\"] }}\n transition={transition}\n >\n {text}\n </motion.span>\n\n {neon && (\n <motion.span\n className=\"m-0 absolute top-0 left-0 text-transparent blur-sm mix-blend-plus-lighter\"\n style={baseStyle as any}\n animate={{ backgroundPosition: [\"0% 0%\", \"200% 0%\"] }}\n transition={transition}\n >\n {text}\n </motion.span>\n )}\n </span>\n );\n}\n\nexport { GradientText, type GradientTextProps };\n"],"names":["GradientText","text","className","gradient","neon","transition","props","baseStyle","jsxs","cn","jsx","motion"],"mappings":"okDAaA,SAASA,EAAa,CACpB,KAAAC,EACA,UAAAC,EACA,SAAAC,EAAW,0FACX,KAAAC,EAAO,GACP,WAAAC,EAAa,CAAE,SAAU,EAAG,OAAQ,IAAU,KAAM,QAAA,EACpD,GAAGC,CACL,EAAsB,CACpB,MAAMC,EAAiC,CACrC,gBAAiBJ,EACjB,eAAgB,OAChB,qBAAsB,OACtB,eAAgB,YAChB,MAAO,aAAA,EAGT,OACEK,EAAAA,KAAC,OAAA,CACC,YAAU,gBACV,UAAWC,EAAAA,GAAG,
|
|
1
|
+
{"version":3,"file":"GradientText.cjs","sources":["../../../../src/lib/TextAnimation/GradientText.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { motion, type Transition } from \"motion/react\";\nimport { cn } from \"@dsui/ui/index\";\n\ntype GradientTextProps = React.ComponentProps<\"span\"> & {\n text: string;\n gradient?: string;\n neon?: boolean;\n transition?: Transition;\n};\n\nfunction GradientText({\n text,\n className,\n gradient = \"linear-gradient(90deg, #3b82f6 0%, #a855f7 20%, #ec4899 50%, #a855f7 80%, #3b82f6 100%)\",\n neon = false,\n transition = { duration: 3, repeat: Infinity, ease: \"linear\" },\n ...props\n}: GradientTextProps) {\n const baseStyle: React.CSSProperties = {\n backgroundImage: gradient,\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n backgroundSize: \"200% 100%\",\n color: \"transparent\",\n };\n\n return (\n <span\n data-slot=\"gradient-text\"\n className={cn(\"ds:relative ds:inline-block\", className)}\n {...(props as any)}\n >\n <motion.span\n className=\"ds:m-0 ds:text-transparent\"\n style={baseStyle as any}\n animate={{ backgroundPosition: [\"0% 0%\", \"200% 0%\"] }}\n transition={transition}\n >\n {text}\n </motion.span>\n\n {neon && (\n <motion.span\n className=\"ds:m-0 ds:absolute ds:top-0 ds:left-0 ds:text-transparent ds:blur-sm ds:mix-blend-plus-lighter\"\n style={baseStyle as any}\n animate={{ backgroundPosition: [\"0% 0%\", \"200% 0%\"] }}\n transition={transition}\n >\n {text}\n </motion.span>\n )}\n </span>\n );\n}\n\nexport { GradientText, type GradientTextProps };\n"],"names":["GradientText","text","className","gradient","neon","transition","props","baseStyle","jsxs","cn","jsx","motion"],"mappings":"okDAaA,SAASA,EAAa,CACpB,KAAAC,EACA,UAAAC,EACA,SAAAC,EAAW,0FACX,KAAAC,EAAO,GACP,WAAAC,EAAa,CAAE,SAAU,EAAG,OAAQ,IAAU,KAAM,QAAA,EACpD,GAAGC,CACL,EAAsB,CACpB,MAAMC,EAAiC,CACrC,gBAAiBJ,EACjB,eAAgB,OAChB,qBAAsB,OACtB,eAAgB,YAChB,MAAO,aAAA,EAGT,OACEK,EAAAA,KAAC,OAAA,CACC,YAAU,gBACV,UAAWC,EAAAA,GAAG,8BAA+BP,CAAS,EACrD,GAAII,EAEL,SAAA,CAAAI,EAAAA,IAACC,EAAAA,OAAO,KAAP,CACC,UAAU,6BACV,MAAOJ,EACP,QAAS,CAAE,mBAAoB,CAAC,QAAS,SAAS,CAAA,EAClD,WAAAF,EAEC,SAAAJ,CAAA,CAAA,EAGFG,GACCM,EAAAA,IAACC,EAAAA,OAAO,KAAP,CACC,UAAU,iGACV,MAAOJ,EACP,QAAS,CAAE,mBAAoB,CAAC,QAAS,SAAS,CAAA,EAClD,WAAAF,EAEC,SAAAJ,CAAA,CAAA,CACH,CAAA,CAAA,CAIR"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),N=require("react"),r=require("motion/react");function O(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const c=O(N),p={initial:{rotateX:0},animate:{rotateX:90}},f={initial:{rotateX:90},animate:{rotateX:0}},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),N=require("react"),r=require("motion/react");function O(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const c=O(N),p={initial:{rotateX:0},animate:{rotateX:90}},f={initial:{rotateX:90},animate:{rotateX:0}},d=e=>e===" "?" ":e;function R({ref:e,transition:t={duration:.5,delay:.1,ease:"easeOut"},inView:a=!1,inViewMargin:i="0px",inViewOnce:b=!0,text:s,...g}){const u=c.useRef(null);c.useImperativeHandle(e,()=>u.current);const j=r.useInView(u,{once:b,margin:i}),m=!a||j,y=c.useMemo(()=>s.split(""),[s]);return n.jsxs("span",{"data-slot":"rolling-text",...g,ref:e,children:[y.map((l,o)=>n.jsxs("span",{className:"ds:relative ds:inline-block ds:perspective-[9999999px] ds:transform-3d ds:w-auto","aria-hidden":"true",children:[n.jsx(r.motion.span,{className:"ds:absolute ds:inline-block ds:backface-hidden ds:origin-[50%_25%]",initial:p.initial,animate:m?p.animate:void 0,transition:{...t,delay:o*(t?.delay??0)},children:d(l)}),n.jsx(r.motion.span,{className:"ds:absolute ds:inline-block ds:backface-hidden ds:origin-[50%_100%]",initial:f.initial,animate:m?f.animate:void 0,transition:{...t,delay:o*(t?.delay??0)+.3},children:d(l)}),n.jsx("span",{className:"ds:invisible",children:d(l)})]},o)),n.jsx("span",{className:"ds:sr-only",children:s})]})}exports.RollingText=R;
|
|
2
2
|
//# sourceMappingURL=RollingText.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RollingText.cjs","sources":["../../../../src/lib/TextAnimation/RollingText.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n motion,\n useInView,\n type UseInViewOptions,\n type Transition,\n} from \"motion/react\";\n\nconst ENTRY_ANIMATION = {\n initial: { rotateX: 0 },\n animate: { rotateX: 90 },\n};\n\nconst EXIT_ANIMATION = {\n initial: { rotateX: 90 },\n animate: { rotateX: 0 },\n};\n\nconst formatCharacter = (char: string) => (char === \" \" ? \"\\u00A0\" : char);\n\ntype RollingTextProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n transition?: Transition;\n inView?: boolean;\n inViewMargin?: UseInViewOptions[\"margin\"];\n inViewOnce?: boolean;\n text: string;\n};\n\nfunction RollingText({\n ref,\n transition = { duration: 0.5, delay: 0.1, ease: \"easeOut\" },\n inView = false,\n inViewMargin = \"0px\",\n inViewOnce = true,\n text,\n ...props\n}: RollingTextProps) {\n const localRef = React.useRef<HTMLSpanElement>(null);\n React.useImperativeHandle(ref as any, () => localRef.current!);\n\n const inViewResult = useInView(localRef, {\n once: inViewOnce,\n margin: inViewMargin,\n });\n const isInView = !inView || inViewResult;\n\n const characters = React.useMemo(() => text.split(\"\"), [text]);\n\n return (\n <span data-slot=\"rolling-text\" {...(props as any)} ref={ref}>\n {characters.map((char, idx) => (\n <span\n key={idx}\n className=\"relative inline-block perspective-[9999999px] transform-3d w-auto\"\n aria-hidden=\"true\"\n >\n <motion.span\n className=\"absolute inline-block backface-hidden origin-[50%_25%]\"\n initial={ENTRY_ANIMATION.initial}\n animate={isInView ? ENTRY_ANIMATION.animate : undefined}\n transition={{\n ...transition,\n delay: idx * (transition?.delay ?? 0),\n }}\n >\n {formatCharacter(char)}\n </motion.span>\n <motion.span\n className=\"absolute inline-block backface-hidden origin-[50%_100%]\"\n initial={EXIT_ANIMATION.initial}\n animate={isInView ? EXIT_ANIMATION.animate : undefined}\n transition={{\n ...transition,\n delay: idx * (transition?.delay ?? 0) + 0.3,\n }}\n >\n {formatCharacter(char)}\n </motion.span>\n <span className=\"invisible\">{formatCharacter(char)}</span>\n </span>\n ))}\n\n <span className=\"sr-only\">{text}</span>\n </span>\n );\n}\n\nexport { RollingText, type RollingTextProps };\n"],"names":["ENTRY_ANIMATION","EXIT_ANIMATION","formatCharacter","char","RollingText","ref","transition","inView","inViewMargin","inViewOnce","text","props","localRef","React","inViewResult","useInView","isInView","characters","idx","jsxs","jsx","motion"],"mappings":"4bAUMA,EAAkB,CACtB,QAAS,CAAE,QAAS,CAAA,EACpB,QAAS,CAAE,QAAS,EAAA,CACtB,EAEMC,EAAiB,CACrB,QAAS,CAAE,QAAS,EAAA,EACpB,QAAS,CAAE,QAAS,CAAA,CACtB,EAEMC,EAAmBC,GAAkBA,IAAS,IAAM,IAAWA,EAUrE,SAASC,EAAY,CACnB,IAAAC,EACA,WAAAC,EAAa,CAAE,SAAU,GAAK,MAAO,GAAK,KAAM,SAAA,EAChD,OAAAC,EAAS,GACT,aAAAC,EAAe,MACf,WAAAC,EAAa,GACb,KAAAC,EACA,GAAGC,CACL,EAAqB,CACnB,MAAMC,EAAWC,EAAM,OAAwB,IAAI,EACnDA,EAAM,oBAAoBR,EAAY,IAAMO,EAAS,OAAQ,EAE7D,MAAME,EAAeC,EAAAA,UAAUH,EAAU,CACvC,KAAMH,EACN,OAAQD,CAAA,CACT,EACKQ,EAAW,CAACT,GAAUO,EAEtBG,EAAaJ,EAAM,QAAQ,IAAMH,EAAK,MAAM,EAAE,EAAG,CAACA,CAAI,CAAC,EAE7D,cACG,OAAA,CAAK,YAAU,eAAgB,GAAIC,EAAe,IAAAN,EAChD,SAAA,CAAAY,EAAW,IAAI,CAACd,EAAMe,IACrBC,EAAAA,KAAC,OAAA,CAEC,UAAU,
|
|
1
|
+
{"version":3,"file":"RollingText.cjs","sources":["../../../../src/lib/TextAnimation/RollingText.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n motion,\n useInView,\n type UseInViewOptions,\n type Transition,\n} from \"motion/react\";\n\nconst ENTRY_ANIMATION = {\n initial: { rotateX: 0 },\n animate: { rotateX: 90 },\n};\n\nconst EXIT_ANIMATION = {\n initial: { rotateX: 90 },\n animate: { rotateX: 0 },\n};\n\nconst formatCharacter = (char: string) => (char === \" \" ? \"\\u00A0\" : char);\n\ntype RollingTextProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n transition?: Transition;\n inView?: boolean;\n inViewMargin?: UseInViewOptions[\"margin\"];\n inViewOnce?: boolean;\n text: string;\n};\n\nfunction RollingText({\n ref,\n transition = { duration: 0.5, delay: 0.1, ease: \"easeOut\" },\n inView = false,\n inViewMargin = \"0px\",\n inViewOnce = true,\n text,\n ...props\n}: RollingTextProps) {\n const localRef = React.useRef<HTMLSpanElement>(null);\n React.useImperativeHandle(ref as any, () => localRef.current!);\n\n const inViewResult = useInView(localRef, {\n once: inViewOnce,\n margin: inViewMargin,\n });\n const isInView = !inView || inViewResult;\n\n const characters = React.useMemo(() => text.split(\"\"), [text]);\n\n return (\n <span data-slot=\"rolling-text\" {...(props as any)} ref={ref}>\n {characters.map((char, idx) => (\n <span\n key={idx}\n className=\"ds:relative ds:inline-block ds:perspective-[9999999px] ds:transform-3d ds:w-auto\"\n aria-hidden=\"true\"\n >\n <motion.span\n className=\"ds:absolute ds:inline-block ds:backface-hidden ds:origin-[50%_25%]\"\n initial={ENTRY_ANIMATION.initial}\n animate={isInView ? ENTRY_ANIMATION.animate : undefined}\n transition={{\n ...transition,\n delay: idx * (transition?.delay ?? 0),\n }}\n >\n {formatCharacter(char)}\n </motion.span>\n <motion.span\n className=\"ds:absolute ds:inline-block ds:backface-hidden ds:origin-[50%_100%]\"\n initial={EXIT_ANIMATION.initial}\n animate={isInView ? EXIT_ANIMATION.animate : undefined}\n transition={{\n ...transition,\n delay: idx * (transition?.delay ?? 0) + 0.3,\n }}\n >\n {formatCharacter(char)}\n </motion.span>\n <span className=\"ds:invisible\">{formatCharacter(char)}</span>\n </span>\n ))}\n\n <span className=\"ds:sr-only\">{text}</span>\n </span>\n );\n}\n\nexport { RollingText, type RollingTextProps };\n"],"names":["ENTRY_ANIMATION","EXIT_ANIMATION","formatCharacter","char","RollingText","ref","transition","inView","inViewMargin","inViewOnce","text","props","localRef","React","inViewResult","useInView","isInView","characters","idx","jsxs","jsx","motion"],"mappings":"4bAUMA,EAAkB,CACtB,QAAS,CAAE,QAAS,CAAA,EACpB,QAAS,CAAE,QAAS,EAAA,CACtB,EAEMC,EAAiB,CACrB,QAAS,CAAE,QAAS,EAAA,EACpB,QAAS,CAAE,QAAS,CAAA,CACtB,EAEMC,EAAmBC,GAAkBA,IAAS,IAAM,IAAWA,EAUrE,SAASC,EAAY,CACnB,IAAAC,EACA,WAAAC,EAAa,CAAE,SAAU,GAAK,MAAO,GAAK,KAAM,SAAA,EAChD,OAAAC,EAAS,GACT,aAAAC,EAAe,MACf,WAAAC,EAAa,GACb,KAAAC,EACA,GAAGC,CACL,EAAqB,CACnB,MAAMC,EAAWC,EAAM,OAAwB,IAAI,EACnDA,EAAM,oBAAoBR,EAAY,IAAMO,EAAS,OAAQ,EAE7D,MAAME,EAAeC,EAAAA,UAAUH,EAAU,CACvC,KAAMH,EACN,OAAQD,CAAA,CACT,EACKQ,EAAW,CAACT,GAAUO,EAEtBG,EAAaJ,EAAM,QAAQ,IAAMH,EAAK,MAAM,EAAE,EAAG,CAACA,CAAI,CAAC,EAE7D,cACG,OAAA,CAAK,YAAU,eAAgB,GAAIC,EAAe,IAAAN,EAChD,SAAA,CAAAY,EAAW,IAAI,CAACd,EAAMe,IACrBC,EAAAA,KAAC,OAAA,CAEC,UAAU,mFACV,cAAY,OAEZ,SAAA,CAAAC,EAAAA,IAACC,EAAAA,OAAO,KAAP,CACC,UAAU,qEACV,QAASrB,EAAgB,QACzB,QAASgB,EAAWhB,EAAgB,QAAU,OAC9C,WAAY,CACV,GAAGM,EACH,MAAOY,GAAOZ,GAAY,OAAS,EAAA,EAGpC,WAAgBH,CAAI,CAAA,CAAA,EAEvBiB,EAAAA,IAACC,EAAAA,OAAO,KAAP,CACC,UAAU,sEACV,QAASpB,EAAe,QACxB,QAASe,EAAWf,EAAe,QAAU,OAC7C,WAAY,CACV,GAAGK,EACH,MAAOY,GAAOZ,GAAY,OAAS,GAAK,EAAA,EAGzC,WAAgBH,CAAI,CAAA,CAAA,QAEtB,OAAA,CAAK,UAAU,eAAgB,SAAAD,EAAgBC,CAAI,CAAA,CAAE,CAAA,CAAA,EA1BjDe,CAAA,CA4BR,EAEDE,EAAAA,IAAC,OAAA,CAAK,UAAU,aAAc,SAAAV,CAAA,CAAK,CAAA,EACrC,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),y=require("react"),a=require("motion/react");require("@radix-ui/react-slot");require("../../packages/ui/src/components/button.cjs");require("../../packages/ui/src/components/button-group.cjs");require("../../packages/ui/src/components/input.cjs");require("../../packages/ui/src/components/textarea.cjs");require("@radix-ui/react-label");const m=require("../../packages/ui/src/lib/utils.cjs");require("../../packages/ui/src/components/select.cjs");require("../../packages/ui/src/components/combobox.cjs");require("@radix-ui/react-tooltip");require("lucide-react");require("react-day-picker");require("../../packages/ui/src/components/popover.cjs");require("@radix-ui/react-separator");require("../../packages/ui/src/components/switch.cjs");require("vaul");require("@radix-ui/react-scroll-area");require("../../packages/ui/src/components/tree-view.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-avatar");require("../../packages/ui/src/components/badge.cjs");require("../../packages/ui/src/components/checkbox.cjs");require("@radix-ui/react-collapsible");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-dropdown-menu");require("../../packages/ui/src/components/input-otp.cjs");require("../../packages/ui/src/components/radio-group.cjs");require("../../packages/ui/src/components/sidebar.cjs");require("@radix-ui/react-slider");require("../../packages/ui/src/components/tabs.cjs");require("../../packages/ui/src/components/toggle.cjs");function p(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(i,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return i.default=e,Object.freeze(i)}const c=p(y);function g({text:e,y:i=-50,duration:r=2e3,transition:t={duration:.3,ease:"easeOut"},containerClassName:o,...q}){const[s,l]=c.useState(0);c.useEffect(()=>{if(!Array.isArray(e))return;const d=setInterval(()=>{l(f=>(f+1)%e.length)},r);return()=>clearInterval(d)},[e,r]);const n=Array.isArray(e)?e[s]:e;return u.jsx("div",{className:m.cn("overflow-hidden py-1",o),children:u.jsx(a.AnimatePresence,{mode:"wait",children:u.jsx(a.motion.div,{transition:t,initial:{opacity:0,y:-i},animate:{opacity:1,y:0},exit:{opacity:0,y:i},...q,children:n},n)})})}exports.RotatingText=g;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),y=require("react"),a=require("motion/react");require("@radix-ui/react-slot");require("../../packages/ui/src/components/button.cjs");require("../../packages/ui/src/components/button-group.cjs");require("../../packages/ui/src/components/input.cjs");require("../../packages/ui/src/components/textarea.cjs");require("@radix-ui/react-label");const m=require("../../packages/ui/src/lib/utils.cjs");require("../../packages/ui/src/components/select.cjs");require("../../packages/ui/src/components/combobox.cjs");require("@radix-ui/react-tooltip");require("lucide-react");require("react-day-picker");require("../../packages/ui/src/components/popover.cjs");require("@radix-ui/react-separator");require("../../packages/ui/src/components/switch.cjs");require("vaul");require("@radix-ui/react-scroll-area");require("../../packages/ui/src/components/tree-view.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-avatar");require("../../packages/ui/src/components/badge.cjs");require("../../packages/ui/src/components/checkbox.cjs");require("@radix-ui/react-collapsible");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-dropdown-menu");require("../../packages/ui/src/components/input-otp.cjs");require("../../packages/ui/src/components/radio-group.cjs");require("../../packages/ui/src/components/sidebar.cjs");require("@radix-ui/react-slider");require("../../packages/ui/src/components/tabs.cjs");require("../../packages/ui/src/components/toggle.cjs");function p(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(i,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return i.default=e,Object.freeze(i)}const c=p(y);function g({text:e,y:i=-50,duration:r=2e3,transition:t={duration:.3,ease:"easeOut"},containerClassName:o,...q}){const[s,l]=c.useState(0);c.useEffect(()=>{if(!Array.isArray(e))return;const d=setInterval(()=>{l(f=>(f+1)%e.length)},r);return()=>clearInterval(d)},[e,r]);const n=Array.isArray(e)?e[s]:e;return u.jsx("div",{className:m.cn("ds:overflow-hidden ds:py-1",o),children:u.jsx(a.AnimatePresence,{mode:"wait",children:u.jsx(a.motion.div,{transition:t,initial:{opacity:0,y:-i},animate:{opacity:1,y:0},exit:{opacity:0,y:i},...q,children:n},n)})})}exports.RotatingText=g;
|
|
2
2
|
//# sourceMappingURL=RotatingText.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RotatingText.cjs","sources":["../../../../src/lib/TextAnimation/RotatingText.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n AnimatePresence,\n motion,\n type HTMLMotionProps,\n type Transition,\n} from \"motion/react\";\nimport { cn } from \"@dsui/ui/index\";\n\ntype RotatingTextProps = {\n text: string | string[];\n duration?: number;\n transition?: Transition;\n y?: number;\n containerClassName?: string;\n} & HTMLMotionProps<\"div\">;\n\nfunction RotatingText({\n text,\n y = -50,\n duration = 2000,\n transition = { duration: 0.3, ease: \"easeOut\" },\n containerClassName,\n ...props\n}: RotatingTextProps) {\n const [index, setIndex] = React.useState(0);\n\n React.useEffect(() => {\n if (!Array.isArray(text)) return;\n const interval = setInterval(() => {\n setIndex((prevIndex) => (prevIndex + 1) % text.length);\n }, duration);\n return () => clearInterval(interval);\n }, [text, duration]);\n\n const currentText = Array.isArray(text) ? text[index] : text;\n\n return (\n <div className={cn(\"overflow-hidden py-1\", containerClassName)}>\n <AnimatePresence mode=\"wait\">\n <motion.div\n key={currentText}\n transition={transition}\n initial={{ opacity: 0, y: -y }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y }}\n {...(props as any)}\n >\n {currentText}\n </motion.div>\n </AnimatePresence>\n </div>\n );\n}\n\nexport { RotatingText, type RotatingTextProps };\n"],"names":["RotatingText","text","y","duration","transition","containerClassName","props","index","setIndex","React","interval","prevIndex","currentText","jsx","cn","AnimatePresence","motion"],"mappings":"01DAmBA,SAASA,EAAa,CACpB,KAAAC,EACA,EAAAC,EAAI,IACJ,SAAAC,EAAW,IACX,WAAAC,EAAa,CAAE,SAAU,GAAK,KAAM,SAAA,EACpC,mBAAAC,EACA,GAAGC,CACL,EAAsB,CACpB,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAM,SAAS,CAAC,EAE1CA,EAAM,UAAU,IAAM,CACpB,GAAI,CAAC,MAAM,QAAQR,CAAI,EAAG,OAC1B,MAAMS,EAAW,YAAY,IAAM,CACjCF,EAAUG,IAAeA,EAAY,GAAKV,EAAK,MAAM,CACvD,EAAGE,CAAQ,EACX,MAAO,IAAM,cAAcO,CAAQ,CACrC,EAAG,CAACT,EAAME,CAAQ,CAAC,EAEnB,MAAMS,EAAc,MAAM,QAAQX,CAAI,EAAIA,EAAKM,CAAK,EAAIN,EAExD,OACEY,EAAAA,IAAC,MAAA,CAAI,UAAWC,EAAAA,GAAG,
|
|
1
|
+
{"version":3,"file":"RotatingText.cjs","sources":["../../../../src/lib/TextAnimation/RotatingText.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n AnimatePresence,\n motion,\n type HTMLMotionProps,\n type Transition,\n} from \"motion/react\";\nimport { cn } from \"@dsui/ui/index\";\n\ntype RotatingTextProps = {\n text: string | string[];\n duration?: number;\n transition?: Transition;\n y?: number;\n containerClassName?: string;\n} & HTMLMotionProps<\"div\">;\n\nfunction RotatingText({\n text,\n y = -50,\n duration = 2000,\n transition = { duration: 0.3, ease: \"easeOut\" },\n containerClassName,\n ...props\n}: RotatingTextProps) {\n const [index, setIndex] = React.useState(0);\n\n React.useEffect(() => {\n if (!Array.isArray(text)) return;\n const interval = setInterval(() => {\n setIndex((prevIndex) => (prevIndex + 1) % text.length);\n }, duration);\n return () => clearInterval(interval);\n }, [text, duration]);\n\n const currentText = Array.isArray(text) ? text[index] : text;\n\n return (\n <div className={cn(\"ds:overflow-hidden ds:py-1\", containerClassName)}>\n <AnimatePresence mode=\"wait\">\n <motion.div\n key={currentText}\n transition={transition}\n initial={{ opacity: 0, y: -y }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y }}\n {...(props as any)}\n >\n {currentText}\n </motion.div>\n </AnimatePresence>\n </div>\n );\n}\n\nexport { RotatingText, type RotatingTextProps };\n"],"names":["RotatingText","text","y","duration","transition","containerClassName","props","index","setIndex","React","interval","prevIndex","currentText","jsx","cn","AnimatePresence","motion"],"mappings":"01DAmBA,SAASA,EAAa,CACpB,KAAAC,EACA,EAAAC,EAAI,IACJ,SAAAC,EAAW,IACX,WAAAC,EAAa,CAAE,SAAU,GAAK,KAAM,SAAA,EACpC,mBAAAC,EACA,GAAGC,CACL,EAAsB,CACpB,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAM,SAAS,CAAC,EAE1CA,EAAM,UAAU,IAAM,CACpB,GAAI,CAAC,MAAM,QAAQR,CAAI,EAAG,OAC1B,MAAMS,EAAW,YAAY,IAAM,CACjCF,EAAUG,IAAeA,EAAY,GAAKV,EAAK,MAAM,CACvD,EAAGE,CAAQ,EACX,MAAO,IAAM,cAAcO,CAAQ,CACrC,EAAG,CAACT,EAAME,CAAQ,CAAC,EAEnB,MAAMS,EAAc,MAAM,QAAQX,CAAI,EAAIA,EAAKM,CAAK,EAAIN,EAExD,OACEY,EAAAA,IAAC,MAAA,CAAI,UAAWC,EAAAA,GAAG,6BAA8BT,CAAkB,EACjE,SAAAQ,EAAAA,IAACE,EAAAA,gBAAA,CAAgB,KAAK,OACpB,SAAAF,EAAAA,IAACG,EAAAA,OAAO,IAAP,CAEC,WAAAZ,EACA,QAAS,CAAE,QAAS,EAAG,EAAG,CAACF,CAAA,EAC3B,QAAS,CAAE,QAAS,EAAG,EAAG,CAAA,EAC1B,KAAM,CAAE,QAAS,EAAG,EAAAA,CAAA,EACnB,GAAII,EAEJ,SAAAM,CAAA,EAPIA,CAAA,EAST,CAAA,CACF,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const l=require("motion/react");require("@radix-ui/react-slot");require("../../packages/ui/src/components/button.cjs");require("../../packages/ui/src/components/button-group.cjs");require("../../packages/ui/src/components/input.cjs");require("../../packages/ui/src/components/textarea.cjs");require("@radix-ui/react-label");const m=require("../../packages/ui/src/lib/utils.cjs");require("../../packages/ui/src/components/select.cjs");require("../../packages/ui/src/components/combobox.cjs");require("@radix-ui/react-tooltip");require("lucide-react");require("react-day-picker");require("../../packages/ui/src/components/popover.cjs");require("@radix-ui/react-separator");require("../../packages/ui/src/components/switch.cjs");require("vaul");require("@radix-ui/react-scroll-area");require("../../packages/ui/src/components/tree-view.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-avatar");require("../../packages/ui/src/components/badge.cjs");require("../../packages/ui/src/components/checkbox.cjs");require("@radix-ui/react-collapsible");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-dropdown-menu");require("../../packages/ui/src/components/input-otp.cjs");require("../../packages/ui/src/components/radio-group.cjs");require("../../packages/ui/src/components/sidebar.cjs");require("@radix-ui/react-slider");require("../../packages/ui/src/components/tabs.cjs");require("../../packages/ui/src/components/toggle.cjs");function p({text:e,duration:r=1,transition:t,wave:i=!1,className:a,color:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const l=require("motion/react");require("@radix-ui/react-slot");require("../../packages/ui/src/components/button.cjs");require("../../packages/ui/src/components/button-group.cjs");require("../../packages/ui/src/components/input.cjs");require("../../packages/ui/src/components/textarea.cjs");require("@radix-ui/react-label");const m=require("../../packages/ui/src/lib/utils.cjs");require("../../packages/ui/src/components/select.cjs");require("../../packages/ui/src/components/combobox.cjs");require("@radix-ui/react-tooltip");require("lucide-react");require("react-day-picker");require("../../packages/ui/src/components/popover.cjs");require("@radix-ui/react-separator");require("../../packages/ui/src/components/switch.cjs");require("vaul");require("@radix-ui/react-scroll-area");require("../../packages/ui/src/components/tree-view.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-avatar");require("../../packages/ui/src/components/badge.cjs");require("../../packages/ui/src/components/checkbox.cjs");require("@radix-ui/react-collapsible");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-dropdown-menu");require("../../packages/ui/src/components/input-otp.cjs");require("../../packages/ui/src/components/radio-group.cjs");require("../../packages/ui/src/components/sidebar.cjs");require("@radix-ui/react-slider");require("../../packages/ui/src/components/tabs.cjs");require("../../packages/ui/src/components/toggle.cjs");function p({text:e,duration:r=1,transition:t,wave:i=!1,className:a,color:s="var(--color-neutral-500)",shimmeringColor:n="var(--color-neutral-300)",...q}){return o.jsx(l.motion.span,{className:m.cn("ds:relative ds:inline-block ds:[perspective:500px]",a),style:{"--shimmering-color":n,"--color":s,color:"var(--color)"},...q,children:e?.split("")?.map((c,u)=>o.jsx(l.motion.span,{className:"ds:inline-block ds:whitespace-pre ds:[transform-style:preserve-3d]",initial:{...i?{scale:1,rotateY:0}:{},color:"var(--color)"},animate:{...i?{x:[0,5,0],y:[0,-5,0],scale:[1,1.1,1],rotateY:[0,15,0]}:{},color:["var(--color)","var(--shimmering-color)","var(--color)"]},transition:{duration:r,repeat:1/0,repeatType:"loop",repeatDelay:e.length*.05,delay:u*r/e.length,ease:"easeInOut",...t},children:c},u))})}exports.ShimmeringText=p;
|
|
2
2
|
//# sourceMappingURL=ShimmeringText.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShimmeringText.cjs","sources":["../../../../src/lib/TextAnimation/ShimmeringText.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\";\nimport { type HTMLMotionProps, motion, type Transition } from \"motion/react\";\nimport { cn } from \"@dsui/ui/index\";\n\ntype ShimmeringTextProps = {\n text: string;\n duration?: number;\n transition?: Transition;\n wave?: boolean;\n color?: string;\n shimmeringColor?: string;\n} & Omit<HTMLMotionProps<\"span\">, \"children\">;\n\nfunction ShimmeringText({\n text,\n duration = 1,\n transition,\n wave = false,\n className,\n color = \"var(--color-neutral-500)\",\n shimmeringColor = \"var(--color-neutral-300)\",\n ...props\n}: ShimmeringTextProps) {\n return (\n <motion.span\n className={cn(\"relative inline-block [perspective:500px]\", className)}\n style={\n {\n \"--shimmering-color\": shimmeringColor,\n \"--color\": color,\n color: \"var(--color)\",\n } as React.CSSProperties\n }\n {...(props as any)}\n >\n {text?.split(\"\")?.map((char, i) => (\n <motion.span\n key={i}\n className=\"inline-block whitespace-pre [transform-style:preserve-3d]\"\n initial={{\n ...(wave\n ? {\n scale: 1,\n rotateY: 0,\n }\n : {}),\n color: \"var(--color)\",\n }}\n animate={{\n ...(wave\n ? {\n x: [0, 5, 0],\n y: [0, -5, 0],\n scale: [1, 1.1, 1],\n rotateY: [0, 15, 0],\n }\n : {}),\n color: [\"var(--color)\", \"var(--shimmering-color)\", \"var(--color)\"],\n }}\n transition={{\n duration,\n repeat: Infinity,\n repeatType: \"loop\",\n repeatDelay: text.length * 0.05,\n delay: (i * duration) / text.length,\n ease: \"easeInOut\",\n ...transition,\n }}\n >\n {char}\n </motion.span>\n ))}\n </motion.span>\n );\n}\n\nexport { ShimmeringText, type ShimmeringTextProps };\n"],"names":["ShimmeringText","text","duration","transition","wave","className","color","shimmeringColor","props","jsx","motion","cn","char","i"],"mappings":"okDAcA,SAASA,EAAe,CACtB,KAAAC,EACA,SAAAC,EAAW,EACX,WAAAC,EACA,KAAAC,EAAO,GACP,UAAAC,EACA,MAAAC,EAAQ,2BACR,gBAAAC,EAAkB,2BAClB,GAAGC,CACL,EAAwB,CACtB,OACEC,EAAAA,IAACC,EAAAA,OAAO,KAAP,CACC,UAAWC,EAAAA,GAAG,
|
|
1
|
+
{"version":3,"file":"ShimmeringText.cjs","sources":["../../../../src/lib/TextAnimation/ShimmeringText.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\";\nimport { type HTMLMotionProps, motion, type Transition } from \"motion/react\";\nimport { cn } from \"@dsui/ui/index\";\n\ntype ShimmeringTextProps = {\n text: string;\n duration?: number;\n transition?: Transition;\n wave?: boolean;\n color?: string;\n shimmeringColor?: string;\n} & Omit<HTMLMotionProps<\"span\">, \"children\">;\n\nfunction ShimmeringText({\n text,\n duration = 1,\n transition,\n wave = false,\n className,\n color = \"var(--color-neutral-500)\",\n shimmeringColor = \"var(--color-neutral-300)\",\n ...props\n}: ShimmeringTextProps) {\n return (\n <motion.span\n className={cn(\"ds:relative ds:inline-block ds:[perspective:500px]\", className)}\n style={\n {\n \"--shimmering-color\": shimmeringColor,\n \"--color\": color,\n color: \"var(--color)\",\n } as React.CSSProperties\n }\n {...(props as any)}\n >\n {text?.split(\"\")?.map((char, i) => (\n <motion.span\n key={i}\n className=\"ds:inline-block ds:whitespace-pre ds:[transform-style:preserve-3d]\"\n initial={{\n ...(wave\n ? {\n scale: 1,\n rotateY: 0,\n }\n : {}),\n color: \"var(--color)\",\n }}\n animate={{\n ...(wave\n ? {\n x: [0, 5, 0],\n y: [0, -5, 0],\n scale: [1, 1.1, 1],\n rotateY: [0, 15, 0],\n }\n : {}),\n color: [\"var(--color)\", \"var(--shimmering-color)\", \"var(--color)\"],\n }}\n transition={{\n duration,\n repeat: Infinity,\n repeatType: \"loop\",\n repeatDelay: text.length * 0.05,\n delay: (i * duration) / text.length,\n ease: \"easeInOut\",\n ...transition,\n }}\n >\n {char}\n </motion.span>\n ))}\n </motion.span>\n );\n}\n\nexport { ShimmeringText, type ShimmeringTextProps };\n"],"names":["ShimmeringText","text","duration","transition","wave","className","color","shimmeringColor","props","jsx","motion","cn","char","i"],"mappings":"okDAcA,SAASA,EAAe,CACtB,KAAAC,EACA,SAAAC,EAAW,EACX,WAAAC,EACA,KAAAC,EAAO,GACP,UAAAC,EACA,MAAAC,EAAQ,2BACR,gBAAAC,EAAkB,2BAClB,GAAGC,CACL,EAAwB,CACtB,OACEC,EAAAA,IAACC,EAAAA,OAAO,KAAP,CACC,UAAWC,EAAAA,GAAG,qDAAsDN,CAAS,EAC7E,MACE,CACE,qBAAsBE,EACtB,UAAWD,EACX,MAAO,cAAA,EAGV,GAAIE,EAEJ,YAAM,MAAM,EAAE,GAAG,IAAI,CAACI,EAAMC,IAC3BJ,EAAAA,IAACC,EAAAA,OAAO,KAAP,CAEC,UAAU,qEACV,QAAS,CACP,GAAIN,EACA,CACE,MAAO,EACP,QAAS,CAAA,EAEX,CAAA,EACJ,MAAO,cAAA,EAET,QAAS,CACP,GAAIA,EACA,CACE,EAAG,CAAC,EAAG,EAAG,CAAC,EACX,EAAG,CAAC,EAAG,GAAI,CAAC,EACZ,MAAO,CAAC,EAAG,IAAK,CAAC,EACjB,QAAS,CAAC,EAAG,GAAI,CAAC,CAAA,EAEpB,CAAA,EACJ,MAAO,CAAC,eAAgB,0BAA2B,cAAc,CAAA,EAEnE,WAAY,CACV,SAAAF,EACA,OAAQ,IACR,WAAY,OACZ,YAAaD,EAAK,OAAS,IAC3B,MAAQY,EAAIX,EAAYD,EAAK,OAC7B,KAAM,YACN,GAAGE,CAAA,EAGJ,SAAAS,CAAA,EAhCIC,CAAA,CAkCR,CAAA,CAAA,CAGP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),b=require("react"),u=require("motion/react");require("@radix-ui/react-slot");require("../../packages/ui/src/components/button.cjs");require("../../packages/ui/src/components/button-group.cjs");require("../../packages/ui/src/components/input.cjs");require("../../packages/ui/src/components/textarea.cjs");require("@radix-ui/react-label");const g=require("../../packages/ui/src/lib/utils.cjs");require("../../packages/ui/src/components/select.cjs");require("../../packages/ui/src/components/combobox.cjs");require("@radix-ui/react-tooltip");require("lucide-react");require("react-day-picker");require("../../packages/ui/src/components/popover.cjs");require("@radix-ui/react-separator");require("../../packages/ui/src/components/switch.cjs");require("vaul");require("@radix-ui/react-scroll-area");require("../../packages/ui/src/components/tree-view.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-avatar");require("../../packages/ui/src/components/badge.cjs");require("../../packages/ui/src/components/checkbox.cjs");require("@radix-ui/react-collapsible");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-dropdown-menu");require("../../packages/ui/src/components/input-otp.cjs");require("../../packages/ui/src/components/radio-group.cjs");require("../../packages/ui/src/components/sidebar.cjs");require("@radix-ui/react-slider");require("../../packages/ui/src/components/tabs.cjs");require("../../packages/ui/src/components/toggle.cjs");function y(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=y(b);function j({ref:e,words:r,className:t,filter:i=!0,duration:a=.5,staggerDelay:o=.2,...d}){const l=n.useRef(null);n.useImperativeHandle(e,()=>l.current);const[c,q]=u.useAnimate(),p=n.useMemo(()=>r.split(" "),[r]);return n.useEffect(()=>{c.current&&q("span",{opacity:1,filter:i?"blur(0px)":"none"},{duration:a,delay:u.stagger(o)})},[q,a,i,c,o]),s.jsx("div",{ref:l,className:g.cn("ds:font-bold",t),"data-slot":"text-generate-effect",...d,children:s.jsx(u.motion.div,{ref:c,children:p.map((f,m)=>s.jsxs(u.motion.span,{className:"ds:opacity-0 ds:will-change-transform ds:will-change-opacity ds:will-change-filter",style:{filter:i?"blur(10px)":"none"},children:[f," "]},`${f}-${m}`))})})}exports.TextGenerateEffect=j;
|
|
2
2
|
//# sourceMappingURL=TextGenerateEffect.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextGenerateEffect.cjs","sources":["../../../../src/lib/TextAnimation/TextGenerateEffect.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\";\nimport { motion, stagger, useAnimate } from \"motion/react\";\nimport { cn } from \"@dsui/ui/index\";\n\ntype TextGenerateEffectProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n words: string;\n filter?: boolean;\n duration?: number;\n staggerDelay?: number;\n};\n\nfunction TextGenerateEffect({\n ref,\n words,\n className,\n filter = true,\n duration = 0.5,\n staggerDelay = 0.2,\n ...props\n}: TextGenerateEffectProps) {\n const localRef = React.useRef<HTMLDivElement>(null);\n React.useImperativeHandle(\n ref as any,\n () => localRef.current as HTMLDivElement\n );\n\n const [scope, animate] = useAnimate();\n const wordsArray = React.useMemo(() => words.split(\" \"), [words]);\n\n React.useEffect(() => {\n if (scope.current) {\n animate(\n \"span\",\n {\n opacity: 1,\n filter: filter ? \"blur(0px)\" : \"none\",\n },\n {\n duration: duration,\n delay: stagger(staggerDelay),\n }\n );\n }\n }, [animate, duration, filter, scope, staggerDelay]);\n\n return (\n <div\n ref={localRef}\n className={cn(\"font-bold\", className)}\n data-slot=\"text-generate-effect\"\n {...(props as any)}\n >\n <motion.div ref={scope}>\n {wordsArray.map((word, idx) => (\n <motion.span\n key={`${word}-${idx}`}\n className=\"opacity-0 will-change-transform will-change-opacity will-change-filter\"\n style={{\n filter: filter ? \"blur(10px)\" : \"none\",\n }}\n >\n {word}{\" \"}\n </motion.span>\n ))}\n </motion.div>\n </div>\n );\n}\n\nexport { TextGenerateEffect, type TextGenerateEffectProps };\n"],"names":["TextGenerateEffect","ref","words","className","filter","duration","staggerDelay","props","localRef","React","scope","animate","useAnimate","wordsArray","stagger","jsx","cn","motion","word","idx","jsxs"],"mappings":"01DAYA,SAASA,EAAmB,CAC1B,IAAAC,EACA,MAAAC,EACA,UAAAC,EACA,OAAAC,EAAS,GACT,SAAAC,EAAW,GACX,aAAAC,EAAe,GACf,GAAGC,CACL,EAA4B,CAC1B,MAAMC,EAAWC,EAAM,OAAuB,IAAI,EAClDA,EAAM,oBACJR,EACA,IAAMO,EAAS,OAAA,EAGjB,KAAM,CAACE,EAAOC,CAAO,EAAIC,aAAA,EACnBC,EAAaJ,EAAM,QAAQ,IAAMP,EAAM,MAAM,GAAG,EAAG,CAACA,CAAK,CAAC,EAEhEO,OAAAA,EAAM,UAAU,IAAM,CAChBC,EAAM,SACRC,EACE,OACA,CACE,QAAS,EACT,OAAQP,EAAS,YAAc,MAAA,EAEjC,CACE,SAAAC,EACA,MAAOS,EAAAA,QAAQR,CAAY,CAAA,CAC7B,CAGN,EAAG,CAACK,EAASN,EAAUD,EAAQM,EAAOJ,CAAY,CAAC,EAGjDS,EAAAA,IAAC,MAAA,CACC,IAAKP,EACL,UAAWQ,EAAAA,GAAG,
|
|
1
|
+
{"version":3,"file":"TextGenerateEffect.cjs","sources":["../../../../src/lib/TextAnimation/TextGenerateEffect.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\";\nimport { motion, stagger, useAnimate } from \"motion/react\";\nimport { cn } from \"@dsui/ui/index\";\n\ntype TextGenerateEffectProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n words: string;\n filter?: boolean;\n duration?: number;\n staggerDelay?: number;\n};\n\nfunction TextGenerateEffect({\n ref,\n words,\n className,\n filter = true,\n duration = 0.5,\n staggerDelay = 0.2,\n ...props\n}: TextGenerateEffectProps) {\n const localRef = React.useRef<HTMLDivElement>(null);\n React.useImperativeHandle(\n ref as any,\n () => localRef.current as HTMLDivElement\n );\n\n const [scope, animate] = useAnimate();\n const wordsArray = React.useMemo(() => words.split(\" \"), [words]);\n\n React.useEffect(() => {\n if (scope.current) {\n animate(\n \"span\",\n {\n opacity: 1,\n filter: filter ? \"blur(0px)\" : \"none\",\n },\n {\n duration: duration,\n delay: stagger(staggerDelay),\n }\n );\n }\n }, [animate, duration, filter, scope, staggerDelay]);\n\n return (\n <div\n ref={localRef}\n className={cn(\"ds:font-bold\", className)}\n data-slot=\"text-generate-effect\"\n {...(props as any)}\n >\n <motion.div ref={scope}>\n {wordsArray.map((word, idx) => (\n <motion.span\n key={`${word}-${idx}`}\n className=\"ds:opacity-0 ds:will-change-transform ds:will-change-opacity ds:will-change-filter\"\n style={{\n filter: filter ? \"blur(10px)\" : \"none\",\n }}\n >\n {word}{\" \"}\n </motion.span>\n ))}\n </motion.div>\n </div>\n );\n}\n\nexport { TextGenerateEffect, type TextGenerateEffectProps };\n"],"names":["TextGenerateEffect","ref","words","className","filter","duration","staggerDelay","props","localRef","React","scope","animate","useAnimate","wordsArray","stagger","jsx","cn","motion","word","idx","jsxs"],"mappings":"01DAYA,SAASA,EAAmB,CAC1B,IAAAC,EACA,MAAAC,EACA,UAAAC,EACA,OAAAC,EAAS,GACT,SAAAC,EAAW,GACX,aAAAC,EAAe,GACf,GAAGC,CACL,EAA4B,CAC1B,MAAMC,EAAWC,EAAM,OAAuB,IAAI,EAClDA,EAAM,oBACJR,EACA,IAAMO,EAAS,OAAA,EAGjB,KAAM,CAACE,EAAOC,CAAO,EAAIC,aAAA,EACnBC,EAAaJ,EAAM,QAAQ,IAAMP,EAAM,MAAM,GAAG,EAAG,CAACA,CAAK,CAAC,EAEhEO,OAAAA,EAAM,UAAU,IAAM,CAChBC,EAAM,SACRC,EACE,OACA,CACE,QAAS,EACT,OAAQP,EAAS,YAAc,MAAA,EAEjC,CACE,SAAAC,EACA,MAAOS,EAAAA,QAAQR,CAAY,CAAA,CAC7B,CAGN,EAAG,CAACK,EAASN,EAAUD,EAAQM,EAAOJ,CAAY,CAAC,EAGjDS,EAAAA,IAAC,MAAA,CACC,IAAKP,EACL,UAAWQ,EAAAA,GAAG,eAAgBb,CAAS,EACvC,YAAU,uBACT,GAAII,EAEL,SAAAQ,EAAAA,IAACE,EAAAA,OAAO,IAAP,CAAW,IAAKP,EACd,SAAAG,EAAW,IAAI,CAACK,EAAMC,IACrBC,EAAAA,KAACH,EAAAA,OAAO,KAAP,CAEC,UAAU,qFACV,MAAO,CACL,OAAQb,EAAS,aAAe,MAAA,EAGjC,SAAA,CAAAc,EAAM,GAAA,CAAA,EANF,GAAGA,CAAI,IAAIC,CAAG,EAAA,CAQtB,CAAA,CACH,CAAA,CAAA,CAGN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),l=require("motion/react"),m=({text:r,duration:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),l=require("motion/react"),m=({text:r,duration:d})=>{const n=o.useRef(null),[s,c]=o.useState({x:0,y:0}),[a,i]=o.useState(!1),[x,f]=o.useState({cx:"50%",cy:"50%"});return o.useEffect(()=>{if(n.current&&s.x!==null&&s.y!==null){const t=n.current.getBoundingClientRect(),h=(s.x-t.left)/t.width*100,u=(s.y-t.top)/t.height*100;f({cx:`${h}%`,cy:`${u}%`})}},[s]),e.jsxs("svg",{ref:n,width:"100%",height:"100%",viewBox:"0 0 300 100",xmlns:"http://www.w3.org/2000/svg",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onMouseMove:t=>c({x:t.clientX,y:t.clientY}),className:"ds:select-none",children:[e.jsxs("defs",{children:[e.jsx("linearGradient",{id:"textGradient",gradientUnits:"userSpaceOnUse",cx:"50%",cy:"50%",r:"25%",children:a&&e.jsxs(e.Fragment,{children:[e.jsx("stop",{offset:"0%",stopColor:"#eab308"}),e.jsx("stop",{offset:"25%",stopColor:"#ef4444"}),e.jsx("stop",{offset:"50%",stopColor:"#3b82f6"}),e.jsx("stop",{offset:"75%",stopColor:"#06b6d4"}),e.jsx("stop",{offset:"100%",stopColor:"#8b5cf6"})]})}),e.jsxs(l.motion.radialGradient,{id:"revealMask",gradientUnits:"userSpaceOnUse",r:"20%",initial:{cx:"50%",cy:"50%"},animate:x,transition:{duration:d??0,ease:"easeOut"},children:[e.jsx("stop",{offset:"0%",stopColor:"white"}),e.jsx("stop",{offset:"100%",stopColor:"black"})]}),e.jsx("mask",{id:"textMask",children:e.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#revealMask)"})})]}),e.jsx("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",strokeWidth:"0.3",className:`ds:fill-transparent ds:font-[helvetica] ds:text-7xl ds:font-bold ${a?"stroke-transparent":"stroke-gray-400`"}`,children:r}),e.jsx(l.motion.text,{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",strokeWidth:"0.3",className:`ds:fill-transparent ds:font-[helvetica] ds:text-7xl ds:font-bold ${a?"stroke-transparent":"stroke-gray-400"}`,initial:{strokeDashoffset:1e3,strokeDasharray:1e3},animate:{strokeDashoffset:0,strokeDasharray:1e3},transition:{duration:4,ease:"easeInOut"},children:r}),e.jsx("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",stroke:"url(#textGradient)",strokeWidth:"0.3",mask:"url(#textMask)",className:"ds:fill-transparent ds:font-[helvetica] ds:text-7xl ds:font-bold",children:r})]})};exports.TextHoverEffect=m;
|
|
2
2
|
//# sourceMappingURL=TextHoverEffect.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextHoverEffect.cjs","sources":["../../../../src/lib/TextAnimation/TextHoverEffect.tsx"],"sourcesContent":["\"use client\";\nimport React, { useRef, useEffect, useState } from \"react\";\nimport { motion } from \"motion/react\";\n\nexport const TextHoverEffect = ({\n text,\n duration,\n}: {\n text: string;\n duration?: number;\n automatic?: boolean;\n}) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const [cursor, setCursor] = useState({ x: 0, y: 0 });\n const [hovered, setHovered] = useState(false);\n const [maskPosition, setMaskPosition] = useState({ cx: \"50%\", cy: \"50%\" });\n\n useEffect(() => {\n if (svgRef.current && cursor.x !== null && cursor.y !== null) {\n const svgRect = svgRef.current.getBoundingClientRect();\n const cxPercentage = ((cursor.x - svgRect.left) / svgRect.width) * 100;\n const cyPercentage = ((cursor.y - svgRect.top) / svgRect.height) * 100;\n setMaskPosition({\n cx: `${cxPercentage}%`,\n cy: `${cyPercentage}%`,\n });\n }\n }, [cursor]);\n\n return (\n <svg\n ref={svgRef}\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 300 100\"\n xmlns=\"http://www.w3.org/2000/svg\"\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onMouseMove={(e) => setCursor({ x: e.clientX, y: e.clientY })}\n className=\"select-none\"\n >\n <defs>\n <linearGradient\n id=\"textGradient\"\n gradientUnits=\"userSpaceOnUse\"\n cx=\"50%\"\n cy=\"50%\"\n r=\"25%\"\n >\n {hovered && (\n <>\n <stop offset=\"0%\" stopColor=\"#eab308\" />\n <stop offset=\"25%\" stopColor=\"#ef4444\" />\n <stop offset=\"50%\" stopColor=\"#3b82f6\" />\n <stop offset=\"75%\" stopColor=\"#06b6d4\" />\n <stop offset=\"100%\" stopColor=\"#8b5cf6\" />\n </>\n )}\n </linearGradient>\n <motion.radialGradient\n id=\"revealMask\"\n gradientUnits=\"userSpaceOnUse\"\n r=\"20%\"\n initial={{ cx: \"50%\", cy: \"50%\" }}\n animate={maskPosition}\n transition={{ duration: duration ?? 0, ease: \"easeOut\" }}\n >\n <stop offset=\"0%\" stopColor=\"white\" />\n <stop offset=\"100%\" stopColor=\"black\" />\n </motion.radialGradient>\n <mask id=\"textMask\">\n <rect\n x=\"0\"\n y=\"0\"\n width=\"100%\"\n height=\"100%\"\n fill=\"url(#revealMask)\"\n />\n </mask>\n </defs>\n <text\n x=\"50%\"\n y=\"50%\"\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n strokeWidth=\"0.3\"\n className={`fill-transparent font-[helvetica] text-7xl font-bold ${hovered ? \"stroke-transparent\" : \"stroke-gray-400`\"}`}\n >\n {text}\n </text>\n <motion.text\n x=\"50%\"\n y=\"50%\"\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n strokeWidth=\"0.3\"\n className={`fill-transparent font-[helvetica] text-7xl font-bold ${hovered ? \"stroke-transparent\" : \"stroke-gray-400\"}`}\n initial={{ strokeDashoffset: 1000, strokeDasharray: 1000 }}\n animate={{\n strokeDashoffset: 0,\n strokeDasharray: 1000,\n }}\n transition={{\n duration: 4,\n ease: \"easeInOut\",\n }}\n >\n {text}\n </motion.text>\n <text\n x=\"50%\"\n y=\"50%\"\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n stroke=\"url(#textGradient)\"\n strokeWidth=\"0.3\"\n mask=\"url(#textMask)\"\n className=\"fill-transparent font-[helvetica] text-7xl font-bold\"\n >\n {text}\n </text>\n </svg>\n );\n};\n"],"names":["TextHoverEffect","text","duration","svgRef","useRef","cursor","setCursor","useState","hovered","setHovered","maskPosition","setMaskPosition","useEffect","svgRect","cxPercentage","cyPercentage","jsxs","e","jsx","Fragment","motion"],"mappings":"kKAIaA,EAAkB,CAAC,CAC9B,KAAAC,EACA,SAAAC,CACF,IAIM,CACJ,MAAMC,EAASC,EAAAA,OAAsB,IAAI,EACnC,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,CAAE,EAAG,EAAG,EAAG,EAAG,EAC7C,CAACC,EAASC,CAAU,EAAIF,EAAAA,SAAS,EAAK,EACtC,CAACG,EAAcC,CAAe,EAAIJ,EAAAA,SAAS,CAAE,GAAI,MAAO,GAAI,MAAO,EAEzEK,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAIT,EAAO,SAAWE,EAAO,IAAM,MAAQA,EAAO,IAAM,KAAM,CAC5D,MAAMQ,EAAUV,EAAO,QAAQ,sBAAA,EACzBW,GAAiBT,EAAO,EAAIQ,EAAQ,MAAQA,EAAQ,MAAS,IAC7DE,GAAiBV,EAAO,EAAIQ,EAAQ,KAAOA,EAAQ,OAAU,IACnEF,EAAgB,CACd,GAAI,GAAGG,CAAY,IACnB,GAAI,GAAGC,CAAY,GAAA,CACpB,CACH,CACF,EAAG,CAACV,CAAM,CAAC,EAGTW,EAAAA,KAAC,MAAA,CACC,IAAKb,EACL,MAAM,OACN,OAAO,OACP,QAAQ,cACR,MAAM,6BACN,aAAc,IAAMM,EAAW,EAAI,EACnC,aAAc,IAAMA,EAAW,EAAK,EACpC,YAAcQ,GAAMX,EAAU,CAAE,EAAGW,EAAE,QAAS,EAAGA,EAAE,QAAS,EAC5D,UAAU,
|
|
1
|
+
{"version":3,"file":"TextHoverEffect.cjs","sources":["../../../../src/lib/TextAnimation/TextHoverEffect.tsx"],"sourcesContent":["\"use client\";\nimport React, { useRef, useEffect, useState } from \"react\";\nimport { motion } from \"motion/react\";\n\nexport const TextHoverEffect = ({\n text,\n duration,\n}: {\n text: string;\n duration?: number;\n automatic?: boolean;\n}) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const [cursor, setCursor] = useState({ x: 0, y: 0 });\n const [hovered, setHovered] = useState(false);\n const [maskPosition, setMaskPosition] = useState({ cx: \"50%\", cy: \"50%\" });\n\n useEffect(() => {\n if (svgRef.current && cursor.x !== null && cursor.y !== null) {\n const svgRect = svgRef.current.getBoundingClientRect();\n const cxPercentage = ((cursor.x - svgRect.left) / svgRect.width) * 100;\n const cyPercentage = ((cursor.y - svgRect.top) / svgRect.height) * 100;\n setMaskPosition({\n cx: `${cxPercentage}%`,\n cy: `${cyPercentage}%`,\n });\n }\n }, [cursor]);\n\n return (\n <svg\n ref={svgRef}\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 300 100\"\n xmlns=\"http://www.w3.org/2000/svg\"\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onMouseMove={(e) => setCursor({ x: e.clientX, y: e.clientY })}\n className=\"ds:select-none\"\n >\n <defs>\n <linearGradient\n id=\"textGradient\"\n gradientUnits=\"userSpaceOnUse\"\n cx=\"50%\"\n cy=\"50%\"\n r=\"25%\"\n >\n {hovered && (\n <>\n <stop offset=\"0%\" stopColor=\"#eab308\" />\n <stop offset=\"25%\" stopColor=\"#ef4444\" />\n <stop offset=\"50%\" stopColor=\"#3b82f6\" />\n <stop offset=\"75%\" stopColor=\"#06b6d4\" />\n <stop offset=\"100%\" stopColor=\"#8b5cf6\" />\n </>\n )}\n </linearGradient>\n <motion.radialGradient\n id=\"revealMask\"\n gradientUnits=\"userSpaceOnUse\"\n r=\"20%\"\n initial={{ cx: \"50%\", cy: \"50%\" }}\n animate={maskPosition}\n transition={{ duration: duration ?? 0, ease: \"easeOut\" }}\n >\n <stop offset=\"0%\" stopColor=\"white\" />\n <stop offset=\"100%\" stopColor=\"black\" />\n </motion.radialGradient>\n <mask id=\"textMask\">\n <rect\n x=\"0\"\n y=\"0\"\n width=\"100%\"\n height=\"100%\"\n fill=\"url(#revealMask)\"\n />\n </mask>\n </defs>\n <text\n x=\"50%\"\n y=\"50%\"\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n strokeWidth=\"0.3\"\n className={`ds:fill-transparent ds:font-[helvetica] ds:text-7xl ds:font-bold ${hovered ? \"stroke-transparent\" : \"stroke-gray-400`\"}`}\n >\n {text}\n </text>\n <motion.text\n x=\"50%\"\n y=\"50%\"\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n strokeWidth=\"0.3\"\n className={`ds:fill-transparent ds:font-[helvetica] ds:text-7xl ds:font-bold ${hovered ? \"stroke-transparent\" : \"stroke-gray-400\"}`}\n initial={{ strokeDashoffset: 1000, strokeDasharray: 1000 }}\n animate={{\n strokeDashoffset: 0,\n strokeDasharray: 1000,\n }}\n transition={{\n duration: 4,\n ease: \"easeInOut\",\n }}\n >\n {text}\n </motion.text>\n <text\n x=\"50%\"\n y=\"50%\"\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n stroke=\"url(#textGradient)\"\n strokeWidth=\"0.3\"\n mask=\"url(#textMask)\"\n className=\"ds:fill-transparent ds:font-[helvetica] ds:text-7xl ds:font-bold\"\n >\n {text}\n </text>\n </svg>\n );\n};\n"],"names":["TextHoverEffect","text","duration","svgRef","useRef","cursor","setCursor","useState","hovered","setHovered","maskPosition","setMaskPosition","useEffect","svgRect","cxPercentage","cyPercentage","jsxs","e","jsx","Fragment","motion"],"mappings":"kKAIaA,EAAkB,CAAC,CAC9B,KAAAC,EACA,SAAAC,CACF,IAIM,CACJ,MAAMC,EAASC,EAAAA,OAAsB,IAAI,EACnC,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,CAAE,EAAG,EAAG,EAAG,EAAG,EAC7C,CAACC,EAASC,CAAU,EAAIF,EAAAA,SAAS,EAAK,EACtC,CAACG,EAAcC,CAAe,EAAIJ,EAAAA,SAAS,CAAE,GAAI,MAAO,GAAI,MAAO,EAEzEK,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAIT,EAAO,SAAWE,EAAO,IAAM,MAAQA,EAAO,IAAM,KAAM,CAC5D,MAAMQ,EAAUV,EAAO,QAAQ,sBAAA,EACzBW,GAAiBT,EAAO,EAAIQ,EAAQ,MAAQA,EAAQ,MAAS,IAC7DE,GAAiBV,EAAO,EAAIQ,EAAQ,KAAOA,EAAQ,OAAU,IACnEF,EAAgB,CACd,GAAI,GAAGG,CAAY,IACnB,GAAI,GAAGC,CAAY,GAAA,CACpB,CACH,CACF,EAAG,CAACV,CAAM,CAAC,EAGTW,EAAAA,KAAC,MAAA,CACC,IAAKb,EACL,MAAM,OACN,OAAO,OACP,QAAQ,cACR,MAAM,6BACN,aAAc,IAAMM,EAAW,EAAI,EACnC,aAAc,IAAMA,EAAW,EAAK,EACpC,YAAcQ,GAAMX,EAAU,CAAE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C,EAAE,MACF,EAAE,MACF,WAAW,SACX,iBAAiB,SACjB,YAAY,MACZ,UAAW,oEAAoEZ,EAAU,qBAAuB,iBAAiB,GACjI,QAAS,CAAE,iBAAkB,IAAM,gBAAiB,GAAA,EACpD,QAAS,CACP,iBAAkB,EAClB,gBAAiB,GAAA,EAEnB,WAAY,CACV,SAAU,EACV,KAAM,WAAA,EAGP,SAAAP,CAAA,CAAA,EAEHiB,EAAAA,IAAC,OAAA,CACC,EAAE,MACF,EAAE,MACF,WAAW,SACX,iBAAiB,SACjB,OAAO,qBACP,YAAY,MACZ,KAAK,iBACL,UAAU,mEAET,SAAAjB,CAAA,CAAA,CACH,CAAA,CAAA,CAGN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("react/jsx-runtime"),s=require("react"),I=({text:w="Compressa",fontFamily:g="Compressa VF",fontUrl:L="https://res.cloudinary.com/dr6lvwubh/raw/upload/v1529908256/CompressaPRO-GX.woff2",width:v=!0,weight:y=!0,italic:p=!0,alpha:R=!1,flex:z=!0,stroke:F=!1,scale:$=!1,textColor:M="#FFFFFF",strokeColor:q="#FF0000",strokeWidth:B=2,className:A="",minFontSize:E=24})=>{const l=s.useRef(null),u=s.useRef(null),S=s.useRef([]),o=s.useRef({x:0,y:0}),i=s.useRef({x:0,y:0}),[Y,H]=s.useState(E),[N,b]=s.useState(1),[O,C]=s.useState(1),m=w.split(""),P=(t,n)=>{const e=n.x-t.x,r=n.y-t.y;return Math.sqrt(e*e+r*r)};s.useEffect(()=>{const t=e=>{i.current.x=e.clientX,i.current.y=e.clientY},n=e=>{const r=e.touches[0];i.current.x=r.clientX,i.current.y=r.clientY};if(window.addEventListener("mousemove",t),window.addEventListener("touchmove",n,{passive:!1}),l.current){const{left:e,top:r,width:c,height:a}=l.current.getBoundingClientRect();o.current.x=e+c/2,o.current.y=r+a/2,i.current.x=o.current.x,i.current.y=o.current.y}return()=>{window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",n)}},[]);const x=()=>{if(!l.current||!u.current)return;const{width:t,height:n}=l.current.getBoundingClientRect();let e=t/(m.length/2);e=Math.max(e,E),H(e),b(1),C(1),requestAnimationFrame(()=>{if(!u.current)return;const r=u.current.getBoundingClientRect();if($&&r.height>0){const c=n/r.height;b(c),C(c)}})};return s.useEffect(()=>(x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)),[$,w]),s.useEffect(()=>{let t;const n=()=>{if(o.current.x+=(i.current.x-o.current.x)/15,o.current.y+=(i.current.y-o.current.y)/15,u.current){const r=u.current.getBoundingClientRect().width/2;S.current.forEach(c=>{if(!c)return;const a=c.getBoundingClientRect(),T={x:a.x+a.width/2,y:a.y+a.height/2},
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("react/jsx-runtime"),s=require("react"),I=({text:w="Compressa",fontFamily:g="Compressa VF",fontUrl:L="https://res.cloudinary.com/dr6lvwubh/raw/upload/v1529908256/CompressaPRO-GX.woff2",width:v=!0,weight:y=!0,italic:p=!0,alpha:R=!1,flex:z=!0,stroke:F=!1,scale:$=!1,textColor:M="#FFFFFF",strokeColor:q="#FF0000",strokeWidth:B=2,className:A="",minFontSize:E=24})=>{const l=s.useRef(null),u=s.useRef(null),S=s.useRef([]),o=s.useRef({x:0,y:0}),i=s.useRef({x:0,y:0}),[Y,H]=s.useState(E),[N,b]=s.useState(1),[O,C]=s.useState(1),m=w.split(""),P=(t,n)=>{const e=n.x-t.x,r=n.y-t.y;return Math.sqrt(e*e+r*r)};s.useEffect(()=>{const t=e=>{i.current.x=e.clientX,i.current.y=e.clientY},n=e=>{const r=e.touches[0];i.current.x=r.clientX,i.current.y=r.clientY};if(window.addEventListener("mousemove",t),window.addEventListener("touchmove",n,{passive:!1}),l.current){const{left:e,top:r,width:c,height:a}=l.current.getBoundingClientRect();o.current.x=e+c/2,o.current.y=r+a/2,i.current.x=o.current.x,i.current.y=o.current.y}return()=>{window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",n)}},[]);const x=()=>{if(!l.current||!u.current)return;const{width:t,height:n}=l.current.getBoundingClientRect();let e=t/(m.length/2);e=Math.max(e,E),H(e),b(1),C(1),requestAnimationFrame(()=>{if(!u.current)return;const r=u.current.getBoundingClientRect();if($&&r.height>0){const c=n/r.height;b(c),C(c)}})};return s.useEffect(()=>(x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)),[$,w]),s.useEffect(()=>{let t;const n=()=>{if(o.current.x+=(i.current.x-o.current.x)/15,o.current.y+=(i.current.y-o.current.y)/15,u.current){const r=u.current.getBoundingClientRect().width/2;S.current.forEach(c=>{if(!c)return;const a=c.getBoundingClientRect(),T={x:a.x+a.width/2,y:a.y+a.height/2},d=P(o.current,T),f=(D,j,k)=>{const G=k-Math.abs(k*D/r);return Math.max(j,G+j)},X=v?Math.floor(f(d,5,200)):100,V=y?Math.floor(f(d,100,900)):400,W=p?f(d,0,1).toFixed(2):"0",_=R?f(d,0,1).toFixed(2):"1";c.style.opacity=_,c.style.fontVariationSettings=`'wght' ${V}, 'wdth' ${X}, 'ital' ${W}`})}t=requestAnimationFrame(n)};return n(),()=>cancelAnimationFrame(t)},[v,y,p,R,m.length]),h.jsxs("div",{ref:l,className:"ds:relative ds:w-full ds:h-full ds:overflow-hidden ds:bg-transparent",children:[h.jsx("style",{children:`
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: '${g}';
|
|
4
4
|
src: url('${L}');
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
-webkit-text-stroke-width: ${B}px;
|
|
19
19
|
-webkit-text-stroke-color: ${q};
|
|
20
20
|
}
|
|
21
|
-
`}),h.jsx("h1",{ref:u,className:`text-pressure-title ${A} ${z?"flex justify-between":""} ${F?"stroke":""} uppercase text-center`,style:{fontFamily:g,fontSize:Y,lineHeight:O,transform:`scale(1, ${N})`,transformOrigin:"center top",margin:0,fontWeight:100,color:F?void 0:M},children:m.map((t,n)=>h.jsx("span",{ref:e=>{S.current[n]=e},"data-char":t,className:"inline-block",children:t},n))})]})};exports.default=I;
|
|
21
|
+
`}),h.jsx("h1",{ref:u,className:`ds:text-pressure-title ${A} ${z?"flex justify-between":""} ${F?"stroke":""} ds:uppercase ds:text-center`,style:{fontFamily:g,fontSize:Y,lineHeight:O,transform:`scale(1, ${N})`,transformOrigin:"center top",margin:0,fontWeight:100,color:F?void 0:M},children:m.map((t,n)=>h.jsx("span",{ref:e=>{S.current[n]=e},"data-char":t,className:"ds:inline-block",children:t},n))})]})};exports.default=I;
|
|
22
22
|
//# sourceMappingURL=TextPressureEffect.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextPressureEffect.cjs","sources":["../../../../src/lib/TextAnimation/TextPressureEffect.tsx"],"sourcesContent":["// Component ported from https://codepen.io/JuanFuentes/full/rgXKGQ\nimport { useEffect, useRef, useState } from \"react\";\ninterface TextPressureProps {\n text?: string;\n fontFamily?: string;\n fontUrl?: string;\n width?: boolean;\n weight?: boolean;\n italic?: boolean;\n alpha?: boolean;\n flex?: boolean;\n stroke?: boolean;\n scale?: boolean;\n textColor?: string;\n strokeColor?: string;\n strokeWidth?: number;\n className?: string;\n minFontSize?: number;\n}\n\nconst TextPressure: React.FC<TextPressureProps> = ({\n text = \"Compressa\",\n fontFamily = \"Compressa VF\",\n fontUrl = \"https://res.cloudinary.com/dr6lvwubh/raw/upload/v1529908256/CompressaPRO-GX.woff2\",\n width = true,\n weight = true,\n italic = true,\n alpha = false,\n flex = true,\n stroke = false,\n scale = false,\n textColor = \"#FFFFFF\",\n strokeColor = \"#FF0000\",\n strokeWidth = 2,\n className = \"\",\n minFontSize = 24,\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const titleRef = useRef<HTMLHeadingElement | null>(null);\n const spansRef = useRef<(HTMLSpanElement | null)[]>([]);\n const mouseRef = useRef({ x: 0, y: 0 });\n const cursorRef = useRef({ x: 0, y: 0 });\n const [fontSize, setFontSize] = useState(minFontSize);\n const [scaleY, setScaleY] = useState(1);\n const [lineHeight, setLineHeight] = useState(1);\n const chars = text.split(\"\");\n const dist = (a: { x: number; y: number }, b: { x: number; y: number }) => {\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n return Math.sqrt(dx * dx + dy * dy);\n };\n\n useEffect(() => {\n const handleMouseMove = (e: MouseEvent) => {\n cursorRef.current.x = e.clientX;\n cursorRef.current.y = e.clientY;\n };\n const handleTouchMove = (e: TouchEvent) => {\n const t = e.touches[0];\n cursorRef.current.x = t.clientX;\n cursorRef.current.y = t.clientY;\n };\n window.addEventListener(\"mousemove\", handleMouseMove);\n window.addEventListener(\"touchmove\", handleTouchMove, { passive: false });\n if (containerRef.current) {\n const { left, top, width, height } =\n containerRef.current.getBoundingClientRect();\n mouseRef.current.x = left + width / 2;\n mouseRef.current.y = top + height / 2;\n cursorRef.current.x = mouseRef.current.x;\n cursorRef.current.y = mouseRef.current.y;\n }\n return () => {\n window.removeEventListener(\"mousemove\", handleMouseMove);\n window.removeEventListener(\"touchmove\", handleTouchMove);\n };\n }, []);\n\n const setSize = () => {\n if (!containerRef.current || !titleRef.current) return;\n const { width: containerW, height: containerH } =\n containerRef.current.getBoundingClientRect();\n let newFontSize = containerW / (chars.length / 2);\n newFontSize = Math.max(newFontSize, minFontSize);\n setFontSize(newFontSize);\n setScaleY(1);\n setLineHeight(1);\n requestAnimationFrame(() => {\n if (!titleRef.current) return;\n const textRect = titleRef.current.getBoundingClientRect();\n if (scale && textRect.height > 0) {\n const yRatio = containerH / textRect.height;\n setScaleY(yRatio);\n setLineHeight(yRatio);\n }\n });\n };\n\n useEffect(() => {\n setSize();\n window.addEventListener(\"resize\", setSize);\n return () => window.removeEventListener(\"resize\", setSize);\n }, [scale, text]);\n\n useEffect(() => {\n let rafId: number;\n const animate = () => {\n mouseRef.current.x += (cursorRef.current.x - mouseRef.current.x) / 15;\n mouseRef.current.y += (cursorRef.current.y - mouseRef.current.y) / 15;\n if (titleRef.current) {\n const titleRect = titleRef.current.getBoundingClientRect();\n const maxDist = titleRect.width / 2;\n spansRef.current.forEach((span) => {\n if (!span) return;\n const rect = span.getBoundingClientRect();\n const charCenter = {\n x: rect.x + rect.width / 2,\n y: rect.y + rect.height / 2,\n };\n const d = dist(mouseRef.current, charCenter);\n const getAttr = (\n distance: number,\n minVal: number,\n maxVal: number\n ) => {\n const val = maxVal - Math.abs((maxVal * distance) / maxDist);\n return Math.max(minVal, val + minVal);\n };\n const wdth = width ? Math.floor(getAttr(d, 5, 200)) : 100;\n const wght = weight ? Math.floor(getAttr(d, 100, 900)) : 400;\n const italVal = italic ? getAttr(d, 0, 1).toFixed(2) : \"0\";\n const alphaVal = alpha ? getAttr(d, 0, 1).toFixed(2) : \"1\";\n span.style.opacity = alphaVal;\n span.style.fontVariationSettings = `'wght' ${wght}, 'wdth' ${wdth}, 'ital' ${italVal}`;\n });\n }\n rafId = requestAnimationFrame(animate);\n };\n animate();\n return () => cancelAnimationFrame(rafId);\n }, [width, weight, italic, alpha, chars.length]);\n\n return (\n <div\n ref={containerRef}\n className=\"relative w-full h-full overflow-hidden bg-transparent\"\n >\n <style>{`\n @font-face {\n font-family: '${fontFamily}';\n src: url('${fontUrl}');\n font-style: normal;\n }\n .stroke span {\n position: relative;\n color: ${textColor};\n }\n .stroke span::after {\n content: attr(data-char);\n position: absolute;\n left: 0;\n top: 0;\n color: transparent;\n z-index: -1;\n -webkit-text-stroke-width: ${strokeWidth}px;\n -webkit-text-stroke-color: ${strokeColor};\n }\n `}</style>\n <h1\n ref={titleRef}\n className={`text-pressure-title ${className} ${\n flex ? \"flex justify-between\" : \"\"\n } ${stroke ? \"stroke\" : \"\"} uppercase text-center`}\n style={{\n fontFamily,\n fontSize: fontSize,\n lineHeight,\n transform: `scale(1, ${scaleY})`,\n transformOrigin: \"center top\",\n margin: 0,\n fontWeight: 100,\n color: stroke ? undefined : textColor,\n }}\n >\n {chars.map((char, i) => (\n <span\n key={i}\n ref={(el) => {\n spansRef.current[i] = el;\n }}\n data-char={char}\n className=\"inline-block\"\n >\n {char}\n </span>\n ))}\n </h1>\n </div>\n );\n};\n\nexport default TextPressure;\n"],"names":["TextPressure","text","fontFamily","fontUrl","width","weight","italic","alpha","flex","stroke","scale","textColor","strokeColor","strokeWidth","className","minFontSize","containerRef","useRef","titleRef","spansRef","mouseRef","cursorRef","fontSize","setFontSize","useState","scaleY","setScaleY","lineHeight","setLineHeight","chars","dist","a","b","dx","dy","useEffect","handleMouseMove","handleTouchMove","t","left","top","height","setSize","containerW","containerH","newFontSize","textRect","yRatio","rafId","animate","maxDist","span","rect","charCenter","d","getAttr","distance","minVal","maxVal","val","wdth","wght","italVal","alphaVal","jsxs","jsx","char","i","el"],"mappings":"oKAoBMA,EAA4C,CAAC,CACjD,KAAAC,EAAO,YACP,WAAAC,EAAa,eACb,QAAAC,EAAU,oFACV,MAAAC,EAAQ,GACR,OAAAC,EAAS,GACT,OAAAC,EAAS,GACT,MAAAC,EAAQ,GACR,KAAAC,EAAO,GACP,OAAAC,EAAS,GACT,MAAAC,EAAQ,GACR,UAAAC,EAAY,UACZ,YAAAC,EAAc,UACd,YAAAC,EAAc,EACd,UAAAC,EAAY,GACZ,YAAAC,EAAc,EAChB,IAAM,CACJ,MAAMC,EAAeC,EAAAA,OAA8B,IAAI,EACjDC,EAAWD,EAAAA,OAAkC,IAAI,EACjDE,EAAWF,EAAAA,OAAmC,EAAE,EAChDG,EAAWH,EAAAA,OAAO,CAAE,EAAG,EAAG,EAAG,EAAG,EAChCI,EAAYJ,EAAAA,OAAO,CAAE,EAAG,EAAG,EAAG,EAAG,EACjC,CAACK,EAAUC,CAAW,EAAIC,EAAAA,SAAST,CAAW,EAC9C,CAACU,EAAQC,CAAS,EAAIF,EAAAA,SAAS,CAAC,EAChC,CAACG,EAAYC,CAAa,EAAIJ,EAAAA,SAAS,CAAC,EACxCK,EAAQ5B,EAAK,MAAM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["// Component ported from https://codepen.io/JuanFuentes/full/rgXKGQ\nimport { useEffect, useRef, useState } from \"react\";\ninterface TextPressureProps {\n text?: string;\n fontFamily?: string;\n fontUrl?: string;\n width?: boolean;\n weight?: boolean;\n italic?: boolean;\n alpha?: boolean;\n flex?: boolean;\n stroke?: boolean;\n scale?: boolean;\n textColor?: string;\n strokeColor?: string;\n strokeWidth?: number;\n className?: string;\n minFontSize?: number;\n}\n\nconst TextPressure: React.FC<TextPressureProps> = ({\n text = \"Compressa\",\n fontFamily = \"Compressa VF\",\n fontUrl = \"https://res.cloudinary.com/dr6lvwubh/raw/upload/v1529908256/CompressaPRO-GX.woff2\",\n width = true,\n weight = true,\n italic = true,\n alpha = false,\n flex = true,\n stroke = false,\n scale = false,\n textColor = \"#FFFFFF\",\n strokeColor = \"#FF0000\",\n strokeWidth = 2,\n className = \"\",\n minFontSize = 24,\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const titleRef = useRef<HTMLHeadingElement | null>(null);\n const spansRef = useRef<(HTMLSpanElement | null)[]>([]);\n const mouseRef = useRef({ x: 0, y: 0 });\n const cursorRef = useRef({ x: 0, y: 0 });\n const [fontSize, setFontSize] = useState(minFontSize);\n const [scaleY, setScaleY] = useState(1);\n const [lineHeight, setLineHeight] = useState(1);\n const chars = text.split(\"\");\n const dist = (a: { x: number; y: number }, b: { x: number; y: number }) => {\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n return Math.sqrt(dx * dx + dy * dy);\n };\n\n useEffect(() => {\n const handleMouseMove = (e: MouseEvent) => {\n cursorRef.current.x = e.clientX;\n cursorRef.current.y = e.clientY;\n };\n const handleTouchMove = (e: TouchEvent) => {\n const t = e.touches[0];\n cursorRef.current.x = t.clientX;\n cursorRef.current.y = t.clientY;\n };\n window.addEventListener(\"mousemove\", handleMouseMove);\n window.addEventListener(\"touchmove\", handleTouchMove, { passive: false });\n if (containerRef.current) {\n const { left, top, width, height } =\n containerRef.current.getBoundingClientRect();\n mouseRef.current.x = left + width / 2;\n mouseRef.current.y = top + height / 2;\n cursorRef.current.x = mouseRef.current.x;\n cursorRef.current.y = mouseRef.current.y;\n }\n return () => {\n window.removeEventListener(\"mousemove\", handleMouseMove);\n window.removeEventListener(\"touchmove\", handleTouchMove);\n };\n }, []);\n\n const setSize = () => {\n if (!containerRef.current || !titleRef.current) return;\n const { width: containerW, height: containerH } =\n containerRef.current.getBoundingClientRect();\n let newFontSize = containerW / (chars.length / 2);\n newFontSize = Math.max(newFontSize, minFontSize);\n setFontSize(newFontSize);\n setScaleY(1);\n setLineHeight(1);\n requestAnimationFrame(() => {\n if (!titleRef.current) return;\n const textRect = titleRef.current.getBoundingClientRect();\n if (scale && textRect.height > 0) {\n const yRatio = containerH / textRect.height;\n setScaleY(yRatio);\n setLineHeight(yRatio);\n }\n });\n };\n\n useEffect(() => {\n setSize();\n window.addEventListener(\"resize\", setSize);\n return () => window.removeEventListener(\"resize\", setSize);\n }, [scale, text]);\n\n useEffect(() => {\n let rafId: number;\n const animate = () => {\n mouseRef.current.x += (cursorRef.current.x - mouseRef.current.x) / 15;\n mouseRef.current.y += (cursorRef.current.y - mouseRef.current.y) / 15;\n if (titleRef.current) {\n const titleRect = titleRef.current.getBoundingClientRect();\n const maxDist = titleRect.width / 2;\n spansRef.current.forEach((span) => {\n if (!span) return;\n const rect = span.getBoundingClientRect();\n const charCenter = {\n x: rect.x + rect.width / 2,\n y: rect.y + rect.height / 2,\n };\n const d = dist(mouseRef.current, charCenter);\n const getAttr = (\n distance: number,\n minVal: number,\n maxVal: number\n ) => {\n const val = maxVal - Math.abs((maxVal * distance) / maxDist);\n return Math.max(minVal, val + minVal);\n };\n const wdth = width ? Math.floor(getAttr(d, 5, 200)) : 100;\n const wght = weight ? Math.floor(getAttr(d, 100, 900)) : 400;\n const italVal = italic ? getAttr(d, 0, 1).toFixed(2) : \"0\";\n const alphaVal = alpha ? getAttr(d, 0, 1).toFixed(2) : \"1\";\n span.style.opacity = alphaVal;\n span.style.fontVariationSettings = `'wght' ${wght}, 'wdth' ${wdth}, 'ital' ${italVal}`;\n });\n }\n rafId = requestAnimationFrame(animate);\n };\n animate();\n return () => cancelAnimationFrame(rafId);\n }, [width, weight, italic, alpha, chars.length]);\n\n return (\n <div\n ref={containerRef}\n className=\"ds:relative ds:w-full ds:h-full ds:overflow-hidden ds:bg-transparent\"\n >\n <style>{`\n @font-face {\n font-family: '${fontFamily}';\n src: url('${fontUrl}');\n font-style: normal;\n }\n .stroke span {\n position: relative;\n color: ${textColor};\n }\n .stroke span::after {\n content: attr(data-char);\n position: absolute;\n left: 0;\n top: 0;\n color: transparent;\n z-index: -1;\n -webkit-text-stroke-width: ${strokeWidth}px;\n -webkit-text-stroke-color: ${strokeColor};\n }\n `}</style>\n <h1\n ref={titleRef}\n className={`ds:text-pressure-title ${className} ${flex ? \"flex justify-between\" : \"\"} ${stroke ? \"stroke\" : \"\"} ds:uppercase ds:text-center`}\n style={{\n fontFamily,\n fontSize: fontSize,\n lineHeight,\n transform: `scale(1, ${scaleY})`,\n transformOrigin: \"center top\",\n margin: 0,\n fontWeight: 100,\n color: stroke ? undefined : textColor,\n }}\n >\n {chars.map((char, i) => (\n <span\n key={i}\n ref={(el) => {\n spansRef.current[i] = el;\n }}\n data-char={char}\n className=\"ds:inline-block\"\n >\n {char}\n </span>\n ))}\n </h1>\n </div>\n );\n};\n\nexport default TextPressure;\n"],"names":["TextPressure","text","fontFamily","fontUrl","width","weight","italic","alpha","flex","stroke","scale","textColor","strokeColor","strokeWidth","className","minFontSize","containerRef","useRef","titleRef","spansRef","mouseRef","cursorRef","fontSize","setFontSize","useState","scaleY","setScaleY","lineHeight","setLineHeight","chars","dist","a","b","dx","dy","useEffect","handleMouseMove","handleTouchMove","t","left","top","height","setSize","containerW","containerH","newFontSize","textRect","yRatio","rafId","animate","maxDist","span","rect","charCenter","getAttr","distance","minVal","maxVal","val","wdth","wght","italVal","alphaVal","jsxs","jsx","char","i","el"],"mappings":"oKAoBMA,EAA4C,CAA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AKVQ,CAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uCASWE,CAAW;AAAA,uCACXD,CAAW;AAAA;AAAA,QAE1C,EACFoD,EAAAA,IAAC,KAAA,CACC,IAAK9C,EACL,UAAW,0BAA0BJ,CAAS,IAAIN,EAAO,uBAAyB,EAAE,IAAIC,EAAS,SAAW,EAAE,+BAC9G,MAAO,CACL,WAAAP,EACA,SAAAoB,EACA,WAAAK,EACA,UAAW,YAAYF,CAAM,IAC7B,gBAAiB,aACjB,OAAQ,EACR,WAAY,IACZ,MAAOhB,EAAS,OAAYE,CAAA,EAG7B,SAAAkB,EAAM,IAAI,CAACoC,EAAMC,IAChBF,EAAAA,IAAC,OAAA,CAEC,IAAMG,GAAO,CACXhD,EAAS,QAAQ+C,CAAC,EAAIC,CACxB,EACA,YAAWF,EACX,UAAU,kBAET,SAAAA,CAAA,EAPIC,CAAA,CASR,CAAA,CAAA,CACH,CAAA,CAAA,CAGN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("react/jsx-runtime"),e=require("react"),H=require("gsap"),L=({text:o,as:O="div",typingSpeed:l=50,initialDelay:p=0,pauseDuration:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("react/jsx-runtime"),e=require("react"),H=require("gsap"),L=({text:o,as:O="div",typingSpeed:l=50,initialDelay:p=0,pauseDuration:m=2e3,deletingSpeed:b=30,loop:j=!0,className:P="",showCursor:T=!0,hideCursorWhileTyping:z=!1,cursorCharacter:h="|",cursorClassName:E="",cursorBlinkDuration:$=.5,textColors:x=[],variableSpeed:c,onSentenceComplete:y,startOnVisible:I=!1,reverseMode:A=!1,...C})=>{const[f,k]=e.useState(""),[i,q]=e.useState(0),[a,w]=e.useState(!1),[s,F]=e.useState(0),[M,G]=e.useState(!I),d=e.useRef(null),R=e.useRef(null),n=e.useMemo(()=>Array.isArray(o)?o:[o],[o]),v=e.useCallback(()=>{if(!c)return l;const{min:t,max:u}=c;return Math.random()*(u-t)+t},[c,l]),J=()=>x.length===0?"currentColor":x[s%x.length];e.useEffect(()=>{if(!I||!R.current)return;const t=new IntersectionObserver(u=>{u.forEach(g=>{g.isIntersecting&&G(!0)})},{threshold:.1});return t.observe(R.current),()=>t.disconnect()},[I]),e.useEffect(()=>{T&&d.current&&(H.gsap.set(d.current,{opacity:1}),H.gsap.to(d.current,{opacity:0,duration:$,repeat:-1,yoyo:!0,ease:"power2.inOut"}))},[T,$]),e.useEffect(()=>{if(!M)return;let t;const u=n[s],g=A?u.split("").reverse().join(""):u,N=()=>{if(a)if(f===""){if(w(!1),s===n.length-1&&!j)return;y&&y(n[s],s),F(r=>(r+1)%n.length),q(0),t=setTimeout(()=>{},m)}else t=setTimeout(()=>{k(r=>r.slice(0,-1))},b);else i<g.length?t=setTimeout(()=>{k(r=>r+g[i]),q(r=>r+1)},c?v():l):n.length>1&&(t=setTimeout(()=>{w(!0)},m))};return i===0&&!a&&f===""?t=setTimeout(N,p):N(),()=>clearTimeout(t)},[i,f,a,l,b,m,n,s,j,p,M,A,c,y,v]);const K=z&&(i<n[s].length||a);return e.createElement(O,{ref:R,className:`inline-block whitespace-pre-wrap tracking-tight ${P}`,...C},_.jsx("span",{className:"ds:inline",style:{color:J()},children:f}),T&&_.jsx("span",{ref:d,className:`ds:inline-block ds:opacity-100 ${K?"hidden":""} ${h==="|"?`h-5 w-[1px] translate-y-1 bg-foreground ${E}`:`ml-1 ${E}`}`,children:h==="|"?"":h}))};exports.default=L;
|
|
2
2
|
//# sourceMappingURL=TypingText.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypingText.cjs","sources":["../../../../src/lib/TextAnimation/TypingText.tsx"],"sourcesContent":["\"use client\";\nimport {\n type ElementType,\n useEffect,\n useRef,\n useState,\n createElement,\n useMemo,\n useCallback,\n} from \"react\";\nimport { gsap } from \"gsap\";\n\ninterface TypingTextProps {\n className?: string;\n showCursor?: boolean;\n hideCursorWhileTyping?: boolean;\n cursorCharacter?: string | React.ReactNode;\n cursorBlinkDuration?: number;\n cursorClassName?: string;\n text: string | string[];\n as?: ElementType;\n typingSpeed?: number;\n initialDelay?: number;\n pauseDuration?: number;\n deletingSpeed?: number;\n loop?: boolean;\n textColors?: string[];\n variableSpeed?: { min: number; max: number };\n onSentenceComplete?: (sentence: string, index: number) => void;\n startOnVisible?: boolean;\n reverseMode?: boolean;\n}\n\nconst TypingText = ({\n text,\n as: Component = \"div\",\n typingSpeed = 50,\n initialDelay = 0,\n pauseDuration = 2000,\n deletingSpeed = 30,\n loop = true,\n className = \"\",\n showCursor = true,\n hideCursorWhileTyping = false,\n cursorCharacter = \"|\",\n cursorClassName = \"\",\n cursorBlinkDuration = 0.5,\n textColors = [],\n variableSpeed,\n onSentenceComplete,\n startOnVisible = false,\n reverseMode = false,\n ...props\n}: TypingTextProps & React.HTMLAttributes<HTMLElement>) => {\n const [displayedText, setDisplayedText] = useState(\"\");\n const [currentCharIndex, setCurrentCharIndex] = useState(0);\n const [isDeleting, setIsDeleting] = useState(false);\n const [currentTextIndex, setCurrentTextIndex] = useState(0);\n const [isVisible, setIsVisible] = useState(!startOnVisible);\n const cursorRef = useRef<HTMLSpanElement>(null);\n const containerRef = useRef<HTMLElement>(null);\n const textArray = useMemo(\n () => (Array.isArray(text) ? text : [text]),\n [text]\n );\n\n const getRandomSpeed = useCallback(() => {\n if (!variableSpeed) return typingSpeed;\n const { min, max } = variableSpeed;\n return Math.random() * (max - min) + min;\n }, [variableSpeed, typingSpeed]);\n\n const getCurrentTextColor = () => {\n if (textColors.length === 0) return \"currentColor\";\n return textColors[currentTextIndex % textColors.length];\n };\n\n useEffect(() => {\n if (!startOnVisible || !containerRef.current) return;\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n setIsVisible(true);\n }\n });\n },\n { threshold: 0.1 }\n );\n observer.observe(containerRef.current);\n return () => observer.disconnect();\n }, [startOnVisible]);\n\n useEffect(() => {\n if (showCursor && cursorRef.current) {\n gsap.set(cursorRef.current, { opacity: 1 });\n gsap.to(cursorRef.current, {\n opacity: 0,\n duration: cursorBlinkDuration,\n repeat: -1,\n yoyo: true,\n ease: \"power2.inOut\",\n });\n }\n }, [showCursor, cursorBlinkDuration]);\n\n useEffect(() => {\n if (!isVisible) return;\n let timeout: NodeJS.Timeout;\n const currentText = textArray[currentTextIndex];\n const processedText = reverseMode\n ? currentText.split(\"\").reverse().join(\"\")\n : currentText;\n const executeTypingAnimation = () => {\n if (isDeleting) {\n if (displayedText === \"\") {\n setIsDeleting(false);\n if (currentTextIndex === textArray.length - 1 && !loop) {\n return;\n }\n if (onSentenceComplete) {\n onSentenceComplete(textArray[currentTextIndex], currentTextIndex);\n }\n setCurrentTextIndex((prev) => (prev + 1) % textArray.length);\n setCurrentCharIndex(0);\n timeout = setTimeout(() => {}, pauseDuration);\n } else {\n timeout = setTimeout(() => {\n setDisplayedText((prev) => prev.slice(0, -1));\n }, deletingSpeed);\n }\n } else {\n if (currentCharIndex < processedText.length) {\n timeout = setTimeout(\n () => {\n setDisplayedText(\n (prev) => prev + processedText[currentCharIndex]\n );\n setCurrentCharIndex((prev) => prev + 1);\n },\n variableSpeed ? getRandomSpeed() : typingSpeed\n );\n } else if (textArray.length > 1) {\n timeout = setTimeout(() => {\n setIsDeleting(true);\n }, pauseDuration);\n }\n }\n };\n if (currentCharIndex === 0 && !isDeleting && displayedText === \"\") {\n timeout = setTimeout(executeTypingAnimation, initialDelay);\n } else {\n executeTypingAnimation();\n }\n return () => clearTimeout(timeout);\n }, [\n currentCharIndex,\n displayedText,\n isDeleting,\n typingSpeed,\n deletingSpeed,\n pauseDuration,\n textArray,\n currentTextIndex,\n loop,\n initialDelay,\n isVisible,\n reverseMode,\n variableSpeed,\n onSentenceComplete,\n getRandomSpeed,\n ]);\n\n const shouldHideCursor =\n hideCursorWhileTyping &&\n (currentCharIndex < textArray[currentTextIndex].length || isDeleting);\n\n return createElement(\n Component,\n {\n ref: containerRef,\n className: `inline-block whitespace-pre-wrap tracking-tight ${className}`,\n ...props,\n },\n <span className=\"inline\" style={{ color: getCurrentTextColor() }}>\n {displayedText}\n </span>,\n showCursor && (\n <span\n ref={cursorRef}\n className={`inline-block opacity-100 ${shouldHideCursor ? \"hidden\" : \"\"} ${
|
|
1
|
+
{"version":3,"file":"TypingText.cjs","sources":["../../../../src/lib/TextAnimation/TypingText.tsx"],"sourcesContent":["\"use client\";\nimport {\n type ElementType,\n useEffect,\n useRef,\n useState,\n createElement,\n useMemo,\n useCallback,\n} from \"react\";\nimport { gsap } from \"gsap\";\n\ninterface TypingTextProps {\n className?: string;\n showCursor?: boolean;\n hideCursorWhileTyping?: boolean;\n cursorCharacter?: string | React.ReactNode;\n cursorBlinkDuration?: number;\n cursorClassName?: string;\n text: string | string[];\n as?: ElementType;\n typingSpeed?: number;\n initialDelay?: number;\n pauseDuration?: number;\n deletingSpeed?: number;\n loop?: boolean;\n textColors?: string[];\n variableSpeed?: { min: number; max: number };\n onSentenceComplete?: (sentence: string, index: number) => void;\n startOnVisible?: boolean;\n reverseMode?: boolean;\n}\n\nconst TypingText = ({\n text,\n as: Component = \"div\",\n typingSpeed = 50,\n initialDelay = 0,\n pauseDuration = 2000,\n deletingSpeed = 30,\n loop = true,\n className = \"\",\n showCursor = true,\n hideCursorWhileTyping = false,\n cursorCharacter = \"|\",\n cursorClassName = \"\",\n cursorBlinkDuration = 0.5,\n textColors = [],\n variableSpeed,\n onSentenceComplete,\n startOnVisible = false,\n reverseMode = false,\n ...props\n}: TypingTextProps & React.HTMLAttributes<HTMLElement>) => {\n const [displayedText, setDisplayedText] = useState(\"\");\n const [currentCharIndex, setCurrentCharIndex] = useState(0);\n const [isDeleting, setIsDeleting] = useState(false);\n const [currentTextIndex, setCurrentTextIndex] = useState(0);\n const [isVisible, setIsVisible] = useState(!startOnVisible);\n const cursorRef = useRef<HTMLSpanElement>(null);\n const containerRef = useRef<HTMLElement>(null);\n const textArray = useMemo(\n () => (Array.isArray(text) ? text : [text]),\n [text]\n );\n\n const getRandomSpeed = useCallback(() => {\n if (!variableSpeed) return typingSpeed;\n const { min, max } = variableSpeed;\n return Math.random() * (max - min) + min;\n }, [variableSpeed, typingSpeed]);\n\n const getCurrentTextColor = () => {\n if (textColors.length === 0) return \"currentColor\";\n return textColors[currentTextIndex % textColors.length];\n };\n\n useEffect(() => {\n if (!startOnVisible || !containerRef.current) return;\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n setIsVisible(true);\n }\n });\n },\n { threshold: 0.1 }\n );\n observer.observe(containerRef.current);\n return () => observer.disconnect();\n }, [startOnVisible]);\n\n useEffect(() => {\n if (showCursor && cursorRef.current) {\n gsap.set(cursorRef.current, { opacity: 1 });\n gsap.to(cursorRef.current, {\n opacity: 0,\n duration: cursorBlinkDuration,\n repeat: -1,\n yoyo: true,\n ease: \"power2.inOut\",\n });\n }\n }, [showCursor, cursorBlinkDuration]);\n\n useEffect(() => {\n if (!isVisible) return;\n let timeout: NodeJS.Timeout;\n const currentText = textArray[currentTextIndex];\n const processedText = reverseMode\n ? currentText.split(\"\").reverse().join(\"\")\n : currentText;\n const executeTypingAnimation = () => {\n if (isDeleting) {\n if (displayedText === \"\") {\n setIsDeleting(false);\n if (currentTextIndex === textArray.length - 1 && !loop) {\n return;\n }\n if (onSentenceComplete) {\n onSentenceComplete(textArray[currentTextIndex], currentTextIndex);\n }\n setCurrentTextIndex((prev) => (prev + 1) % textArray.length);\n setCurrentCharIndex(0);\n timeout = setTimeout(() => {}, pauseDuration);\n } else {\n timeout = setTimeout(() => {\n setDisplayedText((prev) => prev.slice(0, -1));\n }, deletingSpeed);\n }\n } else {\n if (currentCharIndex < processedText.length) {\n timeout = setTimeout(\n () => {\n setDisplayedText(\n (prev) => prev + processedText[currentCharIndex]\n );\n setCurrentCharIndex((prev) => prev + 1);\n },\n variableSpeed ? getRandomSpeed() : typingSpeed\n );\n } else if (textArray.length > 1) {\n timeout = setTimeout(() => {\n setIsDeleting(true);\n }, pauseDuration);\n }\n }\n };\n if (currentCharIndex === 0 && !isDeleting && displayedText === \"\") {\n timeout = setTimeout(executeTypingAnimation, initialDelay);\n } else {\n executeTypingAnimation();\n }\n return () => clearTimeout(timeout);\n }, [\n currentCharIndex,\n displayedText,\n isDeleting,\n typingSpeed,\n deletingSpeed,\n pauseDuration,\n textArray,\n currentTextIndex,\n loop,\n initialDelay,\n isVisible,\n reverseMode,\n variableSpeed,\n onSentenceComplete,\n getRandomSpeed,\n ]);\n\n const shouldHideCursor =\n hideCursorWhileTyping &&\n (currentCharIndex < textArray[currentTextIndex].length || isDeleting);\n\n return createElement(\n Component,\n {\n ref: containerRef,\n className: `inline-block whitespace-pre-wrap tracking-tight ${className}`,\n ...props,\n },\n <span className=\"ds:inline\" style={{ color: getCurrentTextColor() }}>\n {displayedText}\n </span>,\n showCursor && (\n <span\n ref={cursorRef}\n className={`ds:inline-block ds:opacity-100 ${shouldHideCursor ? \"hidden\" : \"\"} ${cursorCharacter === \"|\"\n ? `h-5 w-[1px] translate-y-1 bg-foreground ${cursorClassName}`\n : `ml-1 ${cursorClassName}`}`}\n >\n {cursorCharacter === \"|\" ? \"\" : cursorCharacter}\n </span>\n )\n );\n};\n\nexport default TypingText;\n"],"names":["TypingText","text","Component","typingSpeed","initialDelay","pauseDuration","deletingSpeed","loop","className","showCursor","hideCursorWhileTyping","cursorCharacter","cursorClassName","cursorBlinkDuration","textColors","variableSpeed","onSentenceComplete","startOnVisible","reverseMode","props","displayedText","setDisplayedText","useState","currentCharIndex","setCurrentCharIndex","isDeleting","setIsDeleting","currentTextIndex","setCurrentTextIndex","isVisible","setIsVisible","cursorRef","useRef","containerRef","textArray","useMemo","getRandomSpeed","useCallback","min","max","getCurrentTextColor","useEffect","observer","entries","entry","gsap","timeout","currentText","processedText","executeTypingAnimation","prev","shouldHideCursor","createElement","jsx"],"mappings":"sLAiCMA,EAAa,CAAC,CAClB,KAAAC,EACA,GAAIC,EAAY,MAChB,YAAAC,EAAc,GACd,aAAAC,EAAe,EACf,cAAAC,EAAgB,IAChB,cAAAC,EAAgB,GAChB,KAAAC,EAAO,GACP,UAAAC,EAAY,GACZ,WAAAC,EAAa,GACb,sBAAAC,EAAwB,GACxB,gBAAAC,EAAkB,IAClB,gBAAAC,EAAkB,GAClB,oBAAAC,EAAsB,GACtB,WAAAC,EAAa,CAAA,EACb,cAAAC,EACA,mBAAAC,EACA,eAAAC,EAAiB,GACjB,YAAAC,EAAc,GACd,GAAGC,CACL,IAA2D,CACzD,KAAM,CAACC,EAAeC,CAAgB,EAAIC,EAAAA,SAAS,EAAE,EAC/C,CAACC,EAAkBC,CAAmB,EAAIF,EAAAA,SAAS,CAAC,EACpD,CAACG,EAAYC,CAAa,EAAIJ,EAAAA,SAAS,EAAK,EAC5C,CAACK,EAAkBC,CAAmB,EAAIN,EAAAA,SAAS,CAAC,EACpD,CAACO,EAAWC,CAAY,EAAIR,EAAAA,SAAS,CAACL,CAAc,EACpDc,EAAYC,EAAAA,OAAwB,IAAI,EACxCC,EAAeD,EAAAA,OAAoB,IAAI,EACvCE,EAAYC,EAAAA,QAChB,IAAO,MAAM,QAAQlC,CAAI,EAAIA,EAAO,CAACA,CAAI,EACzC,CAACA,CAAI,CAAA,EAGDmC,EAAiBC,EAAAA,YAAY,IAAM,CACvC,GAAI,CAACtB,EAAe,OAAOZ,EAC3B,KAAM,CAAE,IAAAmC,EAAK,IAAAC,CAAA,EAAQxB,EACrB,OAAO,KAAK,OAAA,GAAYwB,EAAMD,GAAOA,CACvC,EAAG,CAACvB,EAAeZ,CAAW,CAAC,EAEzBqC,EAAsB,IACtB1B,EAAW,SAAW,EAAU,eAC7BA,EAAWa,EAAmBb,EAAW,MAAM,EAGxD2B,EAAAA,UAAU,IAAM,CACd,GAAI,C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,EAAO,CAAC,CACxC,EACAnC,EAAgBqB,IAAmBjC,CAAA,EAE5B+B,EAAU,OAAS,IAC5BY,EAAU,WAAW,IAAM,CACzBpB,EAAc,EAAI,CACpB,EAAGrB,CAAa,EAGtB,EACA,OAAIkB,IAAqB,GAAK,CAACE,GAAcL,IAAkB,GAC7D0B,EAAU,WAAWG,EAAwB7C,CAAY,EAEzD6C,EAAA,EAEK,IAAM,aAAaH,CAAO,CACnC,EAAG,CACDvB,EACAH,EACAK,EACAtB,EACAG,EACAD,EACA6B,EACAP,EACApB,EACAH,EACAyB,EACAX,EACAH,EACAC,EACAoB,CAAA,CACD,EAED,MAAMe,EACJzC,IACCa,EAAmBW,EAAUP,CAAgB,EAAE,QAAUF,GAE5D,OAAO2B,EAAAA,cACLlD,EACA,CACE,IAAK+B,EACL,UAAW,mDAAmDzB,CAAS,GACvE,GAAGW,CAAA,EAELkC,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAY,MAAO,CAAE,MAAOb,EAAA,CAAoB,EAC7D,SAAApB,CAAA,CACH,EACAX,GACE4C,EAAAA,IAAC,OAAA,CACC,IAAKtB,EACL,UAAW,kCAAkCoB,EAAmB,SAAW,EAAE,IAAIxC,IAAoB,IACvF,2CAA2CC,CAAe,GAC1D,QAAQA,CAAe,EAAE,GAEtC,SAAAD,IAAoB,IAAM,GAAKA,CAAA,CAAA,CAClC,CAGN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),b=require("react"),u=require("motion/react");function j(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const a=j(b);function w({ref:e,inView:n=!1,inViewMargin:t="0px",inViewOnce:i=!0,spacing:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),b=require("react"),u=require("motion/react");function j(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const a=j(b);function w({ref:e,inView:n=!1,inViewMargin:t="0px",inViewOnce:i=!0,spacing:d=5,text:o,transition:s={type:"spring",bounce:0,duration:2,delay:.5},...p}){const r=a.useRef(null);a.useImperativeHandle(e,()=>r.current);const f=u.useInView(r,{once:i,margin:t}),g=!n||f,m=a.useMemo(()=>o.split(" "),[o]);return l.jsx("span",{ref:r,"data-slot":"writing-text",...p,children:m.map((y,c)=>l.jsxs(u.motion.span,{className:"ds:inline-block ds:will-change-transform ds:will-change-opacity",style:{marginRight:d},initial:{opacity:0,y:10},animate:g?{opacity:1,y:0}:void 0,transition:{...s,delay:c*(s?.delay??0)},children:[y," "]},c))})}exports.WritingText=w;
|
|
2
2
|
//# sourceMappingURL=WritingText.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WritingText.cjs","sources":["../../../../src/lib/TextAnimation/WritingText.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n motion,\n useInView,\n type Transition,\n type UseInViewOptions,\n} from \"motion/react\";\n\ntype WritingTextProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n transition?: Transition;\n inView?: boolean;\n inViewMargin?: UseInViewOptions[\"margin\"];\n inViewOnce?: boolean;\n spacing?: number | string;\n text: string;\n};\n\nfunction WritingText({\n ref,\n inView = false,\n inViewMargin = \"0px\",\n inViewOnce = true,\n spacing = 5,\n text,\n transition = { type: \"spring\", bounce: 0, duration: 2, delay: 0.5 },\n ...props\n}: WritingTextProps) {\n const localRef = React.useRef<HTMLSpanElement>(null);\n React.useImperativeHandle(\n ref as any,\n () => localRef.current as HTMLSpanElement\n );\n\n const inViewResult = useInView(localRef, {\n once: inViewOnce,\n margin: inViewMargin,\n });\n const isInView = !inView || inViewResult;\n\n const words = React.useMemo(() => text.split(\" \"), [text]);\n\n return (\n <span ref={localRef} data-slot=\"writing-text\" {...(props as any)}>\n {words.map((word, index) => (\n <motion.span\n key={index}\n className=\"inline-block will-change-transform will-change-opacity\"\n style={{ marginRight: spacing }}\n initial={{ opacity: 0, y: 10 }}\n animate={isInView ? { opacity: 1, y: 0 } : undefined}\n transition={{\n ...transition,\n delay: index * (transition?.delay ?? 0),\n }}\n >\n {word}{\" \"}\n </motion.span>\n ))}\n </span>\n );\n}\n\nexport { WritingText, type WritingTextProps };\n"],"names":["WritingText","ref","inView","inViewMargin","inViewOnce","spacing","text","transition","props","localRef","React","inViewResult","useInView","isInView","words","jsx","word","index","jsxs","motion"],"mappings":"4bAmBA,SAASA,EAAY,CACnB,IAAAC,EACA,OAAAC,EAAS,GACT,aAAAC,EAAe,MACf,WAAAC,EAAa,GACb,QAAAC,EAAU,EACV,KAAAC,EACA,WAAAC,EAAa,CAAE,KAAM,SAAU,OAAQ,EAAG,SAAU,EAAG,MAAO,EAAA,EAC9D,GAAGC,CACL,EAAqB,CACnB,MAAMC,EAAWC,EAAM,OAAwB,IAAI,EACnDA,EAAM,oBACJT,EACA,IAAMQ,EAAS,OAAA,EAGjB,MAAME,EAAeC,EAAAA,UAAUH,EAAU,CACvC,KAAML,EACN,OAAQD,CAAA,CACT,EACKU,EAAW,CAACX,GAAUS,EAEtBG,EAAQJ,EAAM,QAAQ,IAAMJ,EAAK,MAAM,GAAG,EAAG,CAACA,CAAI,CAAC,EAEzD,OACES,EAAAA,IAAC,OAAA,CAAK,IAAKN,EAAU,YAAU,eAAgB,GAAID,EAChD,SAAAM,EAAM,IAAI,CAACE,EAAMC,IAChBC,EAAAA,KAACC,EAAAA,OAAO,KAAP,CAEC,UAAU,
|
|
1
|
+
{"version":3,"file":"WritingText.cjs","sources":["../../../../src/lib/TextAnimation/WritingText.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n motion,\n useInView,\n type Transition,\n type UseInViewOptions,\n} from \"motion/react\";\n\ntype WritingTextProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n transition?: Transition;\n inView?: boolean;\n inViewMargin?: UseInViewOptions[\"margin\"];\n inViewOnce?: boolean;\n spacing?: number | string;\n text: string;\n};\n\nfunction WritingText({\n ref,\n inView = false,\n inViewMargin = \"0px\",\n inViewOnce = true,\n spacing = 5,\n text,\n transition = { type: \"spring\", bounce: 0, duration: 2, delay: 0.5 },\n ...props\n}: WritingTextProps) {\n const localRef = React.useRef<HTMLSpanElement>(null);\n React.useImperativeHandle(\n ref as any,\n () => localRef.current as HTMLSpanElement\n );\n\n const inViewResult = useInView(localRef, {\n once: inViewOnce,\n margin: inViewMargin,\n });\n const isInView = !inView || inViewResult;\n\n const words = React.useMemo(() => text.split(\" \"), [text]);\n\n return (\n <span ref={localRef} data-slot=\"writing-text\" {...(props as any)}>\n {words.map((word, index) => (\n <motion.span\n key={index}\n className=\"ds:inline-block ds:will-change-transform ds:will-change-opacity\"\n style={{ marginRight: spacing }}\n initial={{ opacity: 0, y: 10 }}\n animate={isInView ? { opacity: 1, y: 0 } : undefined}\n transition={{\n ...transition,\n delay: index * (transition?.delay ?? 0),\n }}\n >\n {word}{\" \"}\n </motion.span>\n ))}\n </span>\n );\n}\n\nexport { WritingText, type WritingTextProps };\n"],"names":["WritingText","ref","inView","inViewMargin","inViewOnce","spacing","text","transition","props","localRef","React","inViewResult","useInView","isInView","words","jsx","word","index","jsxs","motion"],"mappings":"4bAmBA,SAASA,EAAY,CACnB,IAAAC,EACA,OAAAC,EAAS,GACT,aAAAC,EAAe,MACf,WAAAC,EAAa,GACb,QAAAC,EAAU,EACV,KAAAC,EACA,WAAAC,EAAa,CAAE,KAAM,SAAU,OAAQ,EAAG,SAAU,EAAG,MAAO,EAAA,EAC9D,GAAGC,CACL,EAAqB,CACnB,MAAMC,EAAWC,EAAM,OAAwB,IAAI,EACnDA,EAAM,oBACJT,EACA,IAAMQ,EAAS,OAAA,EAGjB,MAAME,EAAeC,EAAAA,UAAUH,EAAU,CACvC,KAAML,EACN,OAAQD,CAAA,CACT,EACKU,EAAW,CAACX,GAAUS,EAEtBG,EAAQJ,EAAM,QAAQ,IAAMJ,EAAK,MAAM,GAAG,EAAG,CAACA,CAAI,CAAC,EAEzD,OACES,EAAAA,IAAC,OAAA,CAAK,IAAKN,EAAU,YAAU,eAAgB,GAAID,EAChD,SAAAM,EAAM,IAAI,CAACE,EAAMC,IAChBC,EAAAA,KAACC,EAAAA,OAAO,KAAP,CAEC,UAAU,kEACV,MAAO,CAAE,YAAad,CAAA,EACtB,QAAS,CAAE,QAAS,EAAG,EAAG,EAAA,EAC1B,QAASQ,EAAW,CAAE,QAAS,EAAG,EAAG,GAAM,OAC3C,WAAY,CACV,GAAGN,EACH,MAAOU,GAASV,GAAY,OAAS,EAAA,EAGtC,SAAA,CAAAS,EAAM,GAAA,CAAA,EAVFC,CAAA,CAYR,EACH,CAEJ"}
|