@flikk/ui 1.0.0-beta.1 → 1.0.0-beta.3
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/dist/components/ai/ApprovalCard/ApprovalCard.js +2 -2
- package/dist/components/ai/ApprovalCard/ApprovalCard.types.d.ts +2 -2
- package/dist/components/ai/PromptInput/PromptInput.js +173 -13
- package/dist/components/ai/PromptInput/PromptInput.theme.js +1 -0
- package/dist/components/ai/PromptInput/PromptInput.types.d.ts +20 -0
- package/dist/components/core/Accordion/Accordion.theme.js +2 -2
- package/dist/components/core/Alert/Alert.js +2 -2
- package/dist/components/core/Alert/Alert.types.d.ts +2 -2
- package/dist/components/core/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/AlertDialog/AlertDialog.types.d.ts +2 -2
- package/dist/components/core/Badge/Badge.js +11 -9
- package/dist/components/core/Badge/Badge.theme.js +13 -14
- package/dist/components/core/Badge/Badge.types.d.ts +6 -1
- package/dist/components/core/Button/Button.theme.js +8 -9
- package/dist/components/core/Calendar/Calendar.theme.js +1 -1
- package/dist/components/core/Card/Card.d.ts +2 -2
- package/dist/components/core/Card/Card.js +6 -7
- package/dist/components/core/Card/Card.theme.js +4 -4
- package/dist/components/core/Card/Card.types.d.ts +5 -20
- package/dist/components/core/Card/CardSubtitle.d.ts +3 -0
- package/dist/components/core/Card/CardSubtitle.js +11 -0
- package/dist/components/core/Card/index.d.ts +2 -2
- package/dist/components/core/CommandPalette/CommandItem.d.ts +1 -1
- package/dist/components/core/CommandPalette/CommandItem.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -2
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +1 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +2 -2
- package/dist/components/core/Drawer/Drawer.d.ts +13 -1
- package/dist/components/core/Drawer/Drawer.js +23 -10
- package/dist/components/core/Drawer/Drawer.theme.js +1 -1
- package/dist/components/core/Drawer/Drawer.types.d.ts +21 -4
- package/dist/components/core/Drawer/DrawerHeader.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerHeader.js +14 -0
- package/dist/components/core/Drawer/DrawerSubtitle.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerSubtitle.js +11 -0
- package/dist/components/core/Drawer/DrawerTitle.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerTitle.js +11 -0
- package/dist/components/core/Drawer/index.d.ts +1 -1
- package/dist/components/core/Dropdown/Dropdown.types.d.ts +4 -4
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Empty/Empty.js +2 -2
- package/dist/components/core/Empty/Empty.theme.d.ts +1 -1
- package/dist/components/core/Empty/Empty.theme.js +3 -3
- package/dist/components/core/Empty/Empty.types.d.ts +2 -2
- package/dist/components/core/MenuItem/MenuItem.js +2 -2
- package/dist/components/core/MenuItem/MenuItem.theme.d.ts +1 -2
- package/dist/components/core/MenuItem/MenuItem.theme.js +7 -9
- package/dist/components/core/MenuItem/MenuItem.types.d.ts +1 -1
- package/dist/components/core/Message/Message.d.ts +3 -2
- package/dist/components/core/Message/Message.js +30 -24
- package/dist/components/core/Message/Message.theme.d.ts +1 -1
- package/dist/components/core/Message/Message.theme.js +22 -24
- package/dist/components/core/Message/Message.types.d.ts +0 -7
- package/dist/components/core/Message/MessageList.animations.d.ts +6 -0
- package/dist/components/core/Message/MessageList.animations.js +32 -0
- package/dist/components/core/Message/MessageList.d.ts +5 -0
- package/dist/components/core/Message/MessageList.js +78 -0
- package/dist/components/core/Message/MessageList.theme.d.ts +2 -0
- package/dist/components/core/Message/MessageList.theme.js +6 -0
- package/dist/components/core/Message/MessageList.types.d.ts +32 -0
- package/dist/components/core/Message/index.d.ts +2 -0
- package/dist/components/core/Modal/Modal.d.ts +2 -2
- package/dist/components/core/Modal/Modal.js +5 -5
- package/dist/components/core/Modal/Modal.theme.js +5 -5
- package/dist/components/core/Modal/Modal.types.d.ts +4 -4
- package/dist/components/core/Modal/ModalSubtitle.d.ts +5 -0
- package/dist/components/core/Modal/ModalSubtitle.js +11 -0
- package/dist/components/core/ModalStack/ModalStack.animations.js +3 -3
- package/dist/components/core/ModalStack/ModalStackModal.js +3 -3
- package/dist/components/core/PageHeading/PageHeading.d.ts +8 -0
- package/dist/components/core/PageHeading/PageHeading.js +28 -0
- package/dist/components/core/PageHeading/PageHeading.theme.d.ts +2 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +11 -0
- package/dist/components/core/PageHeading/PageHeading.types.d.ts +55 -0
- package/dist/components/core/PageHeading/PageHeadingActions.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingActions.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingBackButton.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +12 -0
- package/dist/components/core/PageHeading/PageHeadingIcon.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingIcon.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingSubtitle.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingSubtitle.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingTitle.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingTitle.js +11 -0
- package/dist/components/core/PageHeading/index.d.ts +2 -0
- package/dist/components/core/Popover/Popover.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +3 -3
- package/dist/components/core/Sidebar/Sidebar.js +1 -0
- package/dist/components/core/SocialIcon/SocialIcon.d.ts +3 -0
- package/dist/components/core/SocialIcon/SocialIcon.js +30 -0
- package/dist/components/core/SocialIcon/SocialIcon.theme.d.ts +2 -0
- package/dist/components/core/SocialIcon/SocialIcon.theme.js +12 -0
- package/dist/components/core/SocialIcon/SocialIcon.types.d.ts +18 -0
- package/dist/components/core/SocialIcon/index.d.ts +2 -0
- package/dist/components/core/SocialIcon/platforms.d.ts +17 -0
- package/dist/components/core/SocialIcon/platforms.js +234 -0
- package/dist/components/core/Toast/Toast.js +4 -4
- package/dist/components/core/Toast/Toast.theme.js +1 -1
- package/dist/components/core/Toast/Toast.types.d.ts +9 -9
- package/dist/components/core/Toast/useToast.js +6 -6
- package/dist/components/core/index.d.ts +2 -7
- package/dist/components/core/index.js +9 -19
- package/dist/components/{core → data-display}/DescriptionList/DescriptionList.theme.js +1 -1
- package/dist/components/{core → data-display}/Feed/Feed.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.animations.d.ts +4 -0
- package/dist/components/data-display/GanttChart/GanttChart.animations.js +21 -0
- package/dist/components/data-display/GanttChart/GanttChart.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttChart.js +170 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +23 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.d.ts +162 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.js +9 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.d.ts +80 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.js +274 -0
- package/dist/components/data-display/GanttChart/GanttChartPanel.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +82 -0
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.js +35 -0
- package/dist/components/data-display/GanttChart/GanttGroupBar.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttGroupBar.js +26 -0
- package/dist/components/data-display/GanttChart/GanttMilestone.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttMilestone.js +44 -0
- package/dist/components/data-display/GanttChart/GanttProgressCircle.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttProgressCircle.js +11 -0
- package/dist/components/data-display/GanttChart/GanttSplitter.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttSplitter.js +39 -0
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.d.ts +7 -0
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +23 -0
- package/dist/components/data-display/GanttChart/GanttTableHeader.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttTableHeader.js +13 -0
- package/dist/components/data-display/GanttChart/GanttTablePanel.d.ts +6 -0
- package/dist/components/data-display/GanttChart/GanttTablePanel.js +20 -0
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.js +30 -0
- package/dist/components/data-display/GanttChart/GanttTaskBar.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +206 -0
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +17 -0
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.d.ts +7 -0
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.js +33 -0
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +43 -0
- package/dist/components/data-display/GanttChart/GanttToolbar.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttToolbar.js +28 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDates.d.ts +12 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDates.js +25 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.d.ts +25 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.js +144 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttLayout.d.ts +2 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttLayout.js +33 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.d.ts +6 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.js +32 -0
- package/dist/components/data-display/GanttChart/index.d.ts +3 -0
- package/dist/components/{core → data-display}/KPI/KPI.js +10 -8
- package/dist/components/{core → data-display}/KPI/KPI.theme.js +2 -1
- package/dist/components/{core → data-display}/KPI/KPI.types.d.ts +5 -5
- package/dist/components/{core → data-display}/KPI/index.d.ts +1 -0
- package/dist/components/{core → data-display}/Metric/Metric.js +4 -7
- package/dist/components/{core → data-display}/Metric/Metric.theme.js +9 -9
- package/dist/components/{core → data-display}/Metric/Metric.types.d.ts +6 -6
- package/dist/components/{core → data-display}/Table/Table.theme.js +2 -2
- package/dist/components/{core → data-display}/Table/TableActions.js +8 -8
- package/dist/components/{core → data-display}/Table/TableColumnManager.js +4 -4
- package/dist/components/{core → data-display}/Table/TableFilter.js +3 -3
- package/dist/components/data-display/Table/TablePagination.js +25 -0
- package/dist/components/{core → data-display}/Table/TableRow.js +1 -1
- package/dist/components/{core → data-display}/Table/TableSelectionHeader.js +1 -1
- package/dist/components/data-display/index.d.ts +7 -0
- package/dist/components/data-display/index.js +20 -0
- package/dist/components/effects/Aurora/Aurora.d.ts +24 -0
- package/dist/components/effects/Aurora/Aurora.js +119 -0
- package/dist/components/effects/Aurora/Aurora.types.d.ts +15 -0
- package/dist/components/effects/Aurora/index.d.ts +2 -0
- package/dist/components/effects/DotPattern/DotPattern.d.ts +18 -0
- package/dist/components/effects/DotPattern/DotPattern.js +65 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +47 -0
- package/dist/components/effects/DotPattern/index.d.ts +2 -0
- package/dist/components/effects/GridPattern/GridPattern.d.ts +18 -0
- package/dist/components/effects/GridPattern/GridPattern.js +64 -0
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +47 -0
- package/dist/components/effects/GridPattern/index.d.ts +2 -0
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +30 -0
- package/dist/components/effects/MagneticElement/MagneticElement.js +110 -0
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +44 -0
- package/dist/components/effects/MagneticElement/index.d.ts +2 -0
- package/dist/components/effects/MorphingText/MorphingText.d.ts +17 -0
- package/dist/components/effects/MorphingText/MorphingText.js +91 -0
- package/dist/components/effects/MorphingText/MorphingText.types.d.ts +18 -0
- package/dist/components/effects/MorphingText/index.d.ts +2 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.d.ts +28 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.js +61 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.types.d.ts +35 -0
- package/dist/components/effects/NoiseOverlay/index.d.ts +2 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.d.ts +26 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.js +71 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.types.d.ts +11 -0
- package/dist/components/effects/ParallaxSection/index.d.ts +2 -0
- package/dist/components/effects/Particles/Particles.d.ts +22 -0
- package/dist/components/effects/Particles/Particles.js +33 -0
- package/dist/components/effects/Particles/Particles.scene.d.ts +3 -0
- package/dist/components/effects/Particles/Particles.scene.js +284 -0
- package/dist/components/effects/Particles/Particles.types.d.ts +65 -0
- package/dist/components/effects/Particles/index.d.ts +2 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.d.ts +3 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.js +75 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.d.ts +7 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.js +12 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.types.d.ts +47 -0
- package/dist/components/effects/ProgressiveBlur/index.d.ts +2 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.d.ts +29 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.js +121 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.types.d.ts +25 -0
- package/dist/components/effects/ScrollReveal/index.d.ts +2 -0
- package/dist/components/effects/Spotlight/Spotlight.d.ts +36 -0
- package/dist/components/effects/Spotlight/Spotlight.js +112 -0
- package/dist/components/effects/Spotlight/Spotlight.types.d.ts +29 -0
- package/dist/components/effects/Spotlight/index.d.ts +2 -0
- package/dist/components/effects/StickyScroll/StickyScroll.d.ts +30 -0
- package/dist/components/effects/StickyScroll/StickyScroll.js +128 -0
- package/dist/components/effects/StickyScroll/StickyScroll.types.d.ts +19 -0
- package/dist/components/effects/StickyScroll/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +24 -0
- package/dist/components/effects/index.js +12 -0
- package/dist/components/forms/Checkbox/Checkbox.js +3 -3
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -5
- package/dist/components/forms/ColorPicker/ColorPicker.theme.js +2 -2
- package/dist/components/forms/CronInput/CronInput.d.ts +3 -0
- package/dist/components/forms/CronInput/CronInput.js +107 -0
- package/dist/components/forms/CronInput/CronInput.theme.d.ts +6 -0
- package/dist/components/forms/CronInput/CronInput.theme.js +84 -0
- package/dist/components/forms/CronInput/CronInput.types.d.ts +98 -0
- package/dist/components/forms/CronInput/CronInput.utils.d.ts +67 -0
- package/dist/components/forms/CronInput/CronInput.utils.js +505 -0
- package/dist/components/forms/CronInput/index.d.ts +4 -0
- package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
- package/dist/components/forms/FileUpload/FileUpload.js +78 -0
- package/dist/components/forms/InputOTP/InputOTP.theme.js +1 -1
- package/dist/components/forms/Mention/Mention.d.ts +3 -0
- package/dist/components/forms/Mention/Mention.js +410 -0
- package/dist/components/forms/Mention/Mention.theme.d.ts +6 -0
- package/dist/components/forms/Mention/Mention.theme.js +56 -0
- package/dist/components/forms/Mention/Mention.types.d.ts +111 -0
- package/dist/components/forms/Mention/index.d.ts +3 -0
- package/dist/components/forms/Radio/Radio.js +8 -12
- package/dist/components/forms/Radio/Radio.theme.js +28 -5
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +2 -0
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +9 -0
- package/dist/components/forms/SelectableCard/SelectableCard.d.ts +5 -0
- package/dist/components/forms/SelectableCard/SelectableCard.js +58 -0
- package/dist/components/forms/SelectableCard/SelectableCard.theme.d.ts +2 -0
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +38 -0
- package/dist/components/forms/SelectableCard/SelectableCard.types.d.ts +34 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.d.ts +3 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.js +12 -0
- package/dist/components/forms/SelectableCard/SelectableCardGroup.d.ts +3 -0
- package/dist/components/forms/SelectableCard/SelectableCardGroup.js +37 -0
- package/dist/components/forms/SelectableCard/index.d.ts +3 -0
- package/dist/components/forms/TimePicker/TimePickerContent.js +78 -1
- package/dist/components/forms/TransferList/TransferList.animations.d.ts +10 -0
- package/dist/components/forms/TransferList/TransferList.animations.js +32 -0
- package/dist/components/forms/TransferList/TransferList.d.ts +28 -0
- package/dist/components/forms/TransferList/TransferList.js +199 -0
- package/dist/components/forms/TransferList/TransferList.theme.d.ts +6 -0
- package/dist/components/forms/TransferList/TransferList.theme.js +60 -0
- package/dist/components/forms/TransferList/TransferList.types.d.ts +101 -0
- package/dist/components/forms/TransferList/index.d.ts +3 -0
- package/dist/components/forms/index.d.ts +13 -0
- package/dist/components/forms/index.js +87 -0
- package/dist/components/layout/FormLayout/FormLayout.d.ts +8 -0
- package/dist/components/layout/FormLayout/FormLayout.js +22 -0
- package/dist/components/layout/FormLayout/FormLayout.theme.d.ts +2 -0
- package/dist/components/layout/FormLayout/FormLayout.theme.js +16 -0
- package/dist/components/layout/FormLayout/FormLayout.types.d.ts +61 -0
- package/dist/components/layout/FormLayout/FormLayoutBody.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutBody.js +91 -0
- package/dist/components/layout/FormLayout/FormLayoutFooter.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutFooter.js +12 -0
- package/dist/components/layout/FormLayout/FormLayoutHeader.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutHeader.js +12 -0
- package/dist/components/layout/FormLayout/FormLayoutSection.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutSection.js +12 -0
- package/dist/components/layout/FormLayout/index.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayout.d.ts +7 -0
- package/dist/components/layout/PageLayout/PageLayout.js +33 -0
- package/dist/components/layout/PageLayout/PageLayout.theme.d.ts +2 -0
- package/dist/components/layout/PageLayout/PageLayout.theme.js +10 -0
- package/dist/components/layout/PageLayout/PageLayout.types.d.ts +39 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.js +12 -0
- package/dist/components/layout/PageLayout/PageLayoutHeader.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutHeader.js +12 -0
- package/dist/components/layout/PageLayout/PageLayoutSidebar.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutSidebar.js +12 -0
- package/dist/components/layout/PageLayout/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +208 -167
- package/dist/styles.css +1 -1
- package/dist/utils/dateUtils.d.ts +30 -0
- package/dist/utils/dateUtils.js +58 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +9 -2
- package/dist/components/core/Card/CardDescription.d.ts +0 -3
- package/dist/components/core/Card/CardDescription.js +0 -11
- package/dist/components/core/Modal/ModalDescription.d.ts +0 -5
- package/dist/components/core/Modal/ModalDescription.js +0 -11
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.d.ts +0 -34
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.js +0 -218
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.theme.d.ts +0 -9
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.types.d.ts +0 -48
- package/dist/components/core/ProgressiveBlur/index.d.ts +0 -2
- package/dist/components/core/Table/TablePagination.js +0 -25
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.js +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.theme.js +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/KPI/KPI.d.ts +0 -0
- /package/dist/components/{core → data-display}/KPI/KPI.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/Metric.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/Metric.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.animations.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.animations.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.filterUtils.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.filterUtils.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.utils.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.utils.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableActions.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableActionsMenu.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableActionsMenu.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableBody.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableBody.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableCell.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableCell.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableColumnManager.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableDeclarative.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableDeclarative.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableFilter.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableHeader.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableHeader.js +0 -0
- /package/dist/components/{core → data-display}/Table/TablePagination.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableRow.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableSelectionHeader.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.js +0 -0
- /package/dist/components/{core → data-display}/Table/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/index.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.animations.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.animations.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.theme.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineContent.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineContent.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineItem.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineItem.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineMarker.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineMarker.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/index.d.ts +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DotPatternProps } from "./DotPattern.types";
|
|
3
|
+
/**
|
|
4
|
+
* DotPattern renders an SVG-based dot grid background pattern.
|
|
5
|
+
*
|
|
6
|
+
* Use it as an absolute-positioned decorative background inside a container
|
|
7
|
+
* with `position: relative`. The pattern is fully non-interactive
|
|
8
|
+
* (`pointer-events: none`) and sits at `z-index: 0` by default.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <div className="relative overflow-hidden h-96">
|
|
13
|
+
* <DotPattern spacing={24} dotSize={1.5} fade animated />
|
|
14
|
+
* <div className="relative z-10">Your content here</div>
|
|
15
|
+
* </div>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const DotPattern: React.ForwardRefExoticComponent<DotPatternProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { useId, useMemo } from 'react';
|
|
3
|
+
import { useReducedMotion, motion } from 'motion/react';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Build a CSS mask-image value for the given fade direction and size.
|
|
8
|
+
*/
|
|
9
|
+
function buildMaskImage(direction, fadeSize) {
|
|
10
|
+
const stop = Math.max(0, Math.min(100, fadeSize));
|
|
11
|
+
if (direction === "radial") {
|
|
12
|
+
return `radial-gradient(ellipse at center, black ${100 - stop}%, transparent 100%)`;
|
|
13
|
+
}
|
|
14
|
+
const directionMap = {
|
|
15
|
+
top: "to top",
|
|
16
|
+
bottom: "to bottom",
|
|
17
|
+
left: "to left",
|
|
18
|
+
right: "to right",
|
|
19
|
+
};
|
|
20
|
+
return `linear-gradient(${directionMap[direction]}, black ${100 - stop}%, transparent 100%)`;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* DotPattern renders an SVG-based dot grid background pattern.
|
|
24
|
+
*
|
|
25
|
+
* Use it as an absolute-positioned decorative background inside a container
|
|
26
|
+
* with `position: relative`. The pattern is fully non-interactive
|
|
27
|
+
* (`pointer-events: none`) and sits at `z-index: 0` by default.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <div className="relative overflow-hidden h-96">
|
|
32
|
+
* <DotPattern spacing={24} dotSize={1.5} fade animated />
|
|
33
|
+
* <div className="relative z-10">Your content here</div>
|
|
34
|
+
* </div>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
const DotPattern = React__default.forwardRef(({ spacing = 20, dotSize = 1, color = "var(--color-border)", fade = true, fadeDirection = "radial", fadeSize = 50, animated = false, className, style, ...rest }, ref) => {
|
|
38
|
+
const patternId = useId();
|
|
39
|
+
const shouldReduceMotion = useReducedMotion();
|
|
40
|
+
const enableAnimation = animated && !shouldReduceMotion;
|
|
41
|
+
const maskImage = useMemo(() => (fade ? buildMaskImage(fadeDirection, fadeSize) : undefined), [fade, fadeDirection, fadeSize]);
|
|
42
|
+
const containerStyle = {
|
|
43
|
+
...style,
|
|
44
|
+
...(maskImage
|
|
45
|
+
? {
|
|
46
|
+
maskImage,
|
|
47
|
+
WebkitMaskImage: maskImage,
|
|
48
|
+
}
|
|
49
|
+
: {}),
|
|
50
|
+
};
|
|
51
|
+
// Center the dot within each cell
|
|
52
|
+
const cx = spacing / 2;
|
|
53
|
+
const cy = spacing / 2;
|
|
54
|
+
const dotElement = enableAnimation ? (jsx(motion.circle, { cx: cx, cy: cy, r: dotSize, fill: color, animate: {
|
|
55
|
+
opacity: [0.4, 1, 0.4],
|
|
56
|
+
}, transition: {
|
|
57
|
+
duration: 4,
|
|
58
|
+
ease: "easeInOut",
|
|
59
|
+
repeat: Infinity,
|
|
60
|
+
} })) : (jsx("circle", { cx: cx, cy: cy, r: dotSize, fill: color }));
|
|
61
|
+
return (jsx("div", { ref: ref, className: cn("absolute inset-0 pointer-events-none z-0 overflow-hidden", className), style: containerStyle, ...rest, children: jsxs("svg", { "aria-hidden": "true", className: "absolute inset-0 w-full h-full", children: [jsx("defs", { children: jsx("pattern", { id: patternId, x: "0", y: "0", width: spacing, height: spacing, patternUnits: "userSpaceOnUse", children: dotElement }) }), jsx("rect", { width: "100%", height: "100%", fill: `url(#${patternId})` })] }) }));
|
|
62
|
+
});
|
|
63
|
+
DotPattern.displayName = "DotPattern";
|
|
64
|
+
|
|
65
|
+
export { DotPattern };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/** Direction for the fade gradient mask */
|
|
3
|
+
export type DotPatternFadeDirection = "radial" | "top" | "bottom" | "left" | "right";
|
|
4
|
+
export interface DotPatternProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Distance between dots in pixels (center to center).
|
|
7
|
+
* @default 20
|
|
8
|
+
*/
|
|
9
|
+
spacing?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Radius of each dot in pixels.
|
|
12
|
+
* @default 1
|
|
13
|
+
*/
|
|
14
|
+
dotSize?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Fill color of the dots.
|
|
17
|
+
* Accepts any valid CSS color value or CSS variable.
|
|
18
|
+
* @default "var(--color-border)"
|
|
19
|
+
*/
|
|
20
|
+
color?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to apply a gradient mask that fades the pattern at the edges.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
fade?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Direction of the fade gradient.
|
|
28
|
+
* - "radial" fades from center outward
|
|
29
|
+
* - "top" | "bottom" | "left" | "right" fades toward that edge
|
|
30
|
+
* @default "radial"
|
|
31
|
+
*/
|
|
32
|
+
fadeDirection?: DotPatternFadeDirection;
|
|
33
|
+
/**
|
|
34
|
+
* Size of the fade area as a percentage (0-100).
|
|
35
|
+
* Higher values create a larger transparent region.
|
|
36
|
+
* @default 50
|
|
37
|
+
*/
|
|
38
|
+
fadeSize?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to apply a subtle pulse animation to the dots.
|
|
41
|
+
* Respects prefers-reduced-motion automatically.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
animated?: boolean;
|
|
45
|
+
/** Additional className for style overrides (shadcn pattern). */
|
|
46
|
+
className?: string;
|
|
47
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { GridPatternProps } from "./GridPattern.types";
|
|
3
|
+
/**
|
|
4
|
+
* GridPattern renders an SVG-based grid background pattern.
|
|
5
|
+
*
|
|
6
|
+
* Use it as an absolute-positioned decorative background inside a container
|
|
7
|
+
* with `position: relative`. The pattern is fully non-interactive
|
|
8
|
+
* (`pointer-events: none`) and sits at `z-index: 0` by default.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <div className="relative overflow-hidden h-96">
|
|
13
|
+
* <GridPattern size={48} color="var(--color-border)" fade animated />
|
|
14
|
+
* <div className="relative z-10">Your content here</div>
|
|
15
|
+
* </div>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const GridPattern: React.ForwardRefExoticComponent<GridPatternProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { useId, useMemo } from 'react';
|
|
3
|
+
import { useReducedMotion, motion } from 'motion/react';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Build a CSS mask-image value for the given fade direction and size.
|
|
8
|
+
*/
|
|
9
|
+
function buildMaskImage(direction, fadeSize) {
|
|
10
|
+
const stop = Math.max(0, Math.min(100, fadeSize));
|
|
11
|
+
if (direction === "radial") {
|
|
12
|
+
return `radial-gradient(ellipse at center, black ${100 - stop}%, transparent 100%)`;
|
|
13
|
+
}
|
|
14
|
+
const directionMap = {
|
|
15
|
+
top: "to top",
|
|
16
|
+
bottom: "to bottom",
|
|
17
|
+
left: "to left",
|
|
18
|
+
right: "to right",
|
|
19
|
+
};
|
|
20
|
+
return `linear-gradient(${directionMap[direction]}, black ${100 - stop}%, transparent 100%)`;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* GridPattern renders an SVG-based grid background pattern.
|
|
24
|
+
*
|
|
25
|
+
* Use it as an absolute-positioned decorative background inside a container
|
|
26
|
+
* with `position: relative`. The pattern is fully non-interactive
|
|
27
|
+
* (`pointer-events: none`) and sits at `z-index: 0` by default.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <div className="relative overflow-hidden h-96">
|
|
32
|
+
* <GridPattern size={48} color="var(--color-border)" fade animated />
|
|
33
|
+
* <div className="relative z-10">Your content here</div>
|
|
34
|
+
* </div>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
const GridPattern = React__default.forwardRef(({ size = 40, strokeWidth = 1, color = "var(--color-border)", fade = true, fadeDirection = "radial", fadeSize = 50, animated = false, className, style, ...rest }, ref) => {
|
|
38
|
+
const patternId = useId();
|
|
39
|
+
const shouldReduceMotion = useReducedMotion();
|
|
40
|
+
const enableAnimation = animated && !shouldReduceMotion;
|
|
41
|
+
const maskImage = useMemo(() => (fade ? buildMaskImage(fadeDirection, fadeSize) : undefined), [fade, fadeDirection, fadeSize]);
|
|
42
|
+
const containerStyle = {
|
|
43
|
+
...style,
|
|
44
|
+
...(maskImage
|
|
45
|
+
? {
|
|
46
|
+
maskImage,
|
|
47
|
+
WebkitMaskImage: maskImage,
|
|
48
|
+
}
|
|
49
|
+
: {}),
|
|
50
|
+
};
|
|
51
|
+
const svgContent = (jsxs("svg", { "aria-hidden": "true", className: "absolute inset-0 w-full h-full", children: [jsx("defs", { children: jsxs("pattern", { id: patternId, x: "0", y: "0", width: size, height: size, patternUnits: "userSpaceOnUse", children: [jsx("line", { x1: size, y1: "0", x2: size, y2: size, stroke: color, strokeWidth: strokeWidth }), jsx("line", { x1: "0", y1: size, x2: size, y2: size, stroke: color, strokeWidth: strokeWidth })] }) }), jsx("rect", { width: "100%", height: "100%", fill: `url(#${patternId})` })] }));
|
|
52
|
+
const animatedSvgContent = enableAnimation ? (jsxs(motion.svg, { "aria-hidden": "true", className: "absolute inset-0 w-full h-full", animate: {
|
|
53
|
+
x: [0, size],
|
|
54
|
+
y: [0, size],
|
|
55
|
+
}, transition: {
|
|
56
|
+
duration: 20,
|
|
57
|
+
ease: "linear",
|
|
58
|
+
repeat: Infinity,
|
|
59
|
+
}, children: [jsx("defs", { children: jsxs("pattern", { id: patternId, x: "0", y: "0", width: size, height: size, patternUnits: "userSpaceOnUse", children: [jsx("line", { x1: size, y1: "0", x2: size, y2: size, stroke: color, strokeWidth: strokeWidth }), jsx("line", { x1: "0", y1: size, x2: size, y2: size, stroke: color, strokeWidth: strokeWidth })] }) }), jsx("rect", { x: -size, y: -size, width: `calc(100% + ${size * 2}px)`, height: `calc(100% + ${size * 2}px)`, fill: `url(#${patternId})` })] })) : null;
|
|
60
|
+
return (jsx("div", { ref: ref, className: cn("absolute inset-0 pointer-events-none z-0 overflow-hidden", className), style: containerStyle, ...rest, children: enableAnimation ? animatedSvgContent : svgContent }));
|
|
61
|
+
});
|
|
62
|
+
GridPattern.displayName = "GridPattern";
|
|
63
|
+
|
|
64
|
+
export { GridPattern };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/** Direction for the fade gradient mask */
|
|
3
|
+
export type GridPatternFadeDirection = "radial" | "top" | "bottom" | "left" | "right";
|
|
4
|
+
export interface GridPatternProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Grid cell size in pixels.
|
|
7
|
+
* @default 40
|
|
8
|
+
*/
|
|
9
|
+
size?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Stroke width of the grid lines in pixels.
|
|
12
|
+
* @default 1
|
|
13
|
+
*/
|
|
14
|
+
strokeWidth?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Stroke color of the grid lines.
|
|
17
|
+
* Accepts any valid CSS color value or CSS variable.
|
|
18
|
+
* @default "var(--color-border)"
|
|
19
|
+
*/
|
|
20
|
+
color?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to apply a gradient mask that fades the pattern at the edges.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
fade?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Direction of the fade gradient.
|
|
28
|
+
* - "radial" fades from center outward
|
|
29
|
+
* - "top" | "bottom" | "left" | "right" fades toward that edge
|
|
30
|
+
* @default "radial"
|
|
31
|
+
*/
|
|
32
|
+
fadeDirection?: GridPatternFadeDirection;
|
|
33
|
+
/**
|
|
34
|
+
* Size of the fade area as a percentage (0-100).
|
|
35
|
+
* Higher values create a larger transparent region.
|
|
36
|
+
* @default 50
|
|
37
|
+
*/
|
|
38
|
+
fadeSize?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to apply a subtle drift animation to the grid pattern.
|
|
41
|
+
* Respects prefers-reduced-motion automatically.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
animated?: boolean;
|
|
45
|
+
/** Additional className for style overrides (shadcn pattern). */
|
|
46
|
+
className?: string;
|
|
47
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { MagneticElementProps } from "./MagneticElement.types";
|
|
3
|
+
/**
|
|
4
|
+
* MagneticElement
|
|
5
|
+
*
|
|
6
|
+
* A wrapper component that adds a magnetic pull effect to its children.
|
|
7
|
+
* When the cursor moves over the element, it subtly translates toward
|
|
8
|
+
* the cursor position, creating an engaging interactive effect.
|
|
9
|
+
*
|
|
10
|
+
* The component uses spring-based animations for smooth, natural movement
|
|
11
|
+
* and respects the user's reduced motion preferences.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <MagneticElement strength={0.3}>
|
|
16
|
+
* <Button>Hover me</Button>
|
|
17
|
+
* </MagneticElement>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // With parallax inner content
|
|
23
|
+
* <MagneticElement strength={0.4} innerStrength={2}>
|
|
24
|
+
* <div className="p-4">
|
|
25
|
+
* <span>Pull me closer</span>
|
|
26
|
+
* </div>
|
|
27
|
+
* </MagneticElement>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const MagneticElement: React.ForwardRefExoticComponent<MagneticElementProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useRef, useCallback } from 'react';
|
|
3
|
+
import { useReducedMotion, useMotionValue, useSpring, motion } from 'motion/react';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* MagneticElement
|
|
8
|
+
*
|
|
9
|
+
* A wrapper component that adds a magnetic pull effect to its children.
|
|
10
|
+
* When the cursor moves over the element, it subtly translates toward
|
|
11
|
+
* the cursor position, creating an engaging interactive effect.
|
|
12
|
+
*
|
|
13
|
+
* The component uses spring-based animations for smooth, natural movement
|
|
14
|
+
* and respects the user's reduced motion preferences.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <MagneticElement strength={0.3}>
|
|
19
|
+
* <Button>Hover me</Button>
|
|
20
|
+
* </MagneticElement>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // With parallax inner content
|
|
26
|
+
* <MagneticElement strength={0.4} innerStrength={2}>
|
|
27
|
+
* <div className="p-4">
|
|
28
|
+
* <span>Pull me closer</span>
|
|
29
|
+
* </div>
|
|
30
|
+
* </MagneticElement>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
const MagneticElement = forwardRef(({ strength = 0.3, distance = 100, damping = 15, stiffness = 150, innerStrength = 1.5, disabled = false, className, children, onDrag: _onDrag, onDragStart: _onDragStart, onDragEnd: _onDragEnd, onAnimationStart: _onAnimationStart, ...restProps }, ref) => {
|
|
34
|
+
const elementRef = useRef(null);
|
|
35
|
+
const shouldReduceMotion = useReducedMotion();
|
|
36
|
+
const isDisabled = disabled || shouldReduceMotion;
|
|
37
|
+
// Motion values for outer wrapper translation
|
|
38
|
+
const x = useMotionValue(0);
|
|
39
|
+
const y = useMotionValue(0);
|
|
40
|
+
// Spring-animated versions of x and y for smooth movement
|
|
41
|
+
const springConfig = { damping, stiffness, mass: 1 };
|
|
42
|
+
const springX = useSpring(x, springConfig);
|
|
43
|
+
const springY = useSpring(y, springConfig);
|
|
44
|
+
// Motion values for inner content (parallax effect)
|
|
45
|
+
const innerX = useMotionValue(0);
|
|
46
|
+
const innerY = useMotionValue(0);
|
|
47
|
+
const innerSpringX = useSpring(innerX, springConfig);
|
|
48
|
+
const innerSpringY = useSpring(innerY, springConfig);
|
|
49
|
+
const handleMouseMove = useCallback((event) => {
|
|
50
|
+
var _a;
|
|
51
|
+
if (isDisabled)
|
|
52
|
+
return;
|
|
53
|
+
const element = elementRef.current;
|
|
54
|
+
if (!element)
|
|
55
|
+
return;
|
|
56
|
+
const rect = element.getBoundingClientRect();
|
|
57
|
+
const centerX = rect.left + rect.width / 2;
|
|
58
|
+
const centerY = rect.top + rect.height / 2;
|
|
59
|
+
// Calculate distance from cursor to element center
|
|
60
|
+
const deltaX = event.clientX - centerX;
|
|
61
|
+
const deltaY = event.clientY - centerY;
|
|
62
|
+
const distanceFromCenter = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
63
|
+
// Only apply effect within the configured distance
|
|
64
|
+
const maxDistance = Math.max(rect.width, rect.height) / 2 + distance;
|
|
65
|
+
if (distanceFromCenter < maxDistance) {
|
|
66
|
+
// Apply translation proportional to offset and strength
|
|
67
|
+
const translateX = deltaX * strength;
|
|
68
|
+
const translateY = deltaY * strength;
|
|
69
|
+
x.set(translateX);
|
|
70
|
+
y.set(translateY);
|
|
71
|
+
// Inner content moves slightly more for parallax feel
|
|
72
|
+
if (innerStrength !== 1) {
|
|
73
|
+
innerX.set(translateX * (innerStrength - 1));
|
|
74
|
+
innerY.set(translateY * (innerStrength - 1));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Forward to user's onMouseMove if provided
|
|
78
|
+
(_a = restProps.onMouseMove) === null || _a === void 0 ? void 0 : _a.call(restProps, event);
|
|
79
|
+
}, [isDisabled, strength, distance, innerStrength, x, y, innerX, innerY, restProps.onMouseMove]);
|
|
80
|
+
const handleMouseLeave = useCallback((event) => {
|
|
81
|
+
var _a;
|
|
82
|
+
if (isDisabled)
|
|
83
|
+
return;
|
|
84
|
+
// Reset to center position; the spring will animate the return
|
|
85
|
+
x.set(0);
|
|
86
|
+
y.set(0);
|
|
87
|
+
innerX.set(0);
|
|
88
|
+
innerY.set(0);
|
|
89
|
+
// Forward to user's onMouseLeave if provided
|
|
90
|
+
(_a = restProps.onMouseLeave) === null || _a === void 0 ? void 0 : _a.call(restProps, event);
|
|
91
|
+
}, [isDisabled, x, y, innerX, innerY, restProps.onMouseLeave]);
|
|
92
|
+
// When disabled or reduced motion preferred, render without motion
|
|
93
|
+
if (isDisabled) {
|
|
94
|
+
return (jsx("div", { ref: ref, className: cn("inline-block", className), ...restProps, children: children }));
|
|
95
|
+
}
|
|
96
|
+
const hasParallax = innerStrength !== 1;
|
|
97
|
+
return (jsx(motion.div, { ref: (node) => {
|
|
98
|
+
// Assign to both the internal ref and the forwarded ref
|
|
99
|
+
elementRef.current = node;
|
|
100
|
+
if (typeof ref === "function") {
|
|
101
|
+
ref(node);
|
|
102
|
+
}
|
|
103
|
+
else if (ref) {
|
|
104
|
+
ref.current = node;
|
|
105
|
+
}
|
|
106
|
+
}, className: cn("inline-block", className), style: { x: springX, y: springY }, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, ...restProps, children: hasParallax ? (jsx(motion.div, { style: { x: innerSpringX, y: innerSpringY }, children: children })) : (children) }));
|
|
107
|
+
});
|
|
108
|
+
MagneticElement.displayName = "MagneticElement";
|
|
109
|
+
|
|
110
|
+
export { MagneticElement };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface MagneticElementProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Strength of the magnetic pull effect.
|
|
5
|
+
* Value between 0 and 1, where 0 is no effect and 1 is maximum pull.
|
|
6
|
+
* @default 0.3
|
|
7
|
+
*/
|
|
8
|
+
strength?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Distance in pixels at which the magnetic effect activates.
|
|
11
|
+
* Only applies when the cursor is within this radius of the element center.
|
|
12
|
+
* @default 100
|
|
13
|
+
*/
|
|
14
|
+
distance?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Spring damping for the animation.
|
|
17
|
+
* Higher values result in less oscillation and a more dampened feel.
|
|
18
|
+
* @default 15
|
|
19
|
+
*/
|
|
20
|
+
damping?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Spring stiffness for the animation.
|
|
23
|
+
* Higher values result in a snappier spring.
|
|
24
|
+
* @default 150
|
|
25
|
+
*/
|
|
26
|
+
stiffness?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Multiplier for inner content movement relative to the outer wrapper.
|
|
29
|
+
* Creates a subtle parallax-like effect where content moves slightly more.
|
|
30
|
+
* Set to 1 for no parallax. Values above 1 amplify inner movement.
|
|
31
|
+
* @default 1.5
|
|
32
|
+
*/
|
|
33
|
+
innerStrength?: number;
|
|
34
|
+
/**
|
|
35
|
+
* When true, disables the magnetic effect entirely.
|
|
36
|
+
* The component renders as a plain div wrapper.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/** Additional className for the outer wrapper */
|
|
41
|
+
className?: string;
|
|
42
|
+
/** Content to wrap with the magnetic effect */
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MorphingTextProps } from './MorphingText.types';
|
|
3
|
+
/**
|
|
4
|
+
* MorphingText smoothly morphs between different text strings using a blur/fade
|
|
5
|
+
* transition. Two overlapping text layers cross-fade with a Gaussian blur effect
|
|
6
|
+
* to create a seamless morphing appearance.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <MorphingText
|
|
11
|
+
* texts={["Innovative", "Powerful", "Beautiful"]}
|
|
12
|
+
* interval={3000}
|
|
13
|
+
* transitionDuration={800}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const MorphingText: React.FC<MorphingTextProps>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useId, useState, useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
import { useReducedMotion, AnimatePresence, motion } from 'motion/react';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* MorphingText smoothly morphs between different text strings using a blur/fade
|
|
8
|
+
* transition. Two overlapping text layers cross-fade with a Gaussian blur effect
|
|
9
|
+
* to create a seamless morphing appearance.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <MorphingText
|
|
14
|
+
* texts={["Innovative", "Powerful", "Beautiful"]}
|
|
15
|
+
* interval={3000}
|
|
16
|
+
* transitionDuration={800}
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
const MorphingText = ({ texts, interval = 3000, transitionDuration = 800, loop = true, pauseOnHover = false, currentIndex: controlledIndex, onTextChange, className, ...props }) => {
|
|
21
|
+
const filterId = useId();
|
|
22
|
+
const shouldReduceMotion = useReducedMotion();
|
|
23
|
+
const isControlled = controlledIndex !== undefined;
|
|
24
|
+
const [internalIndex, setInternalIndex] = useState(0);
|
|
25
|
+
const activeIndex = isControlled ? controlledIndex : internalIndex;
|
|
26
|
+
const [isPaused, setIsPaused] = useState(false);
|
|
27
|
+
const intervalRef = useRef(null);
|
|
28
|
+
const hasReachedEnd = useRef(false);
|
|
29
|
+
// Clamp activeIndex to valid range
|
|
30
|
+
const safeIndex = texts.length > 0 ? ((activeIndex % texts.length) + texts.length) % texts.length : 0;
|
|
31
|
+
const advanceIndex = useCallback(() => {
|
|
32
|
+
if (isControlled)
|
|
33
|
+
return;
|
|
34
|
+
setInternalIndex((prev) => {
|
|
35
|
+
const nextIndex = prev + 1;
|
|
36
|
+
if (!loop && nextIndex >= texts.length) {
|
|
37
|
+
hasReachedEnd.current = true;
|
|
38
|
+
return prev;
|
|
39
|
+
}
|
|
40
|
+
const resolvedNext = nextIndex % texts.length;
|
|
41
|
+
onTextChange === null || onTextChange === void 0 ? void 0 : onTextChange(resolvedNext, texts[resolvedNext]);
|
|
42
|
+
return resolvedNext;
|
|
43
|
+
});
|
|
44
|
+
}, [isControlled, loop, texts, onTextChange]);
|
|
45
|
+
// Auto-cycling interval
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (isControlled || isPaused || hasReachedEnd.current) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
intervalRef.current = setInterval(advanceIndex, interval);
|
|
51
|
+
return () => {
|
|
52
|
+
if (intervalRef.current) {
|
|
53
|
+
clearInterval(intervalRef.current);
|
|
54
|
+
intervalRef.current = null;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}, [isControlled, isPaused, interval, advanceIndex]);
|
|
58
|
+
// Reset hasReachedEnd when loop changes or texts change
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
hasReachedEnd.current = false;
|
|
61
|
+
}, [loop, texts]);
|
|
62
|
+
// Fire onTextChange for controlled index changes
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (isControlled) {
|
|
65
|
+
onTextChange === null || onTextChange === void 0 ? void 0 : onTextChange(safeIndex, texts[safeIndex]);
|
|
66
|
+
}
|
|
67
|
+
}, [isControlled, safeIndex, texts, onTextChange]);
|
|
68
|
+
const handleMouseEnter = () => {
|
|
69
|
+
if (pauseOnHover)
|
|
70
|
+
setIsPaused(true);
|
|
71
|
+
};
|
|
72
|
+
const handleMouseLeave = () => {
|
|
73
|
+
if (pauseOnHover)
|
|
74
|
+
setIsPaused(false);
|
|
75
|
+
};
|
|
76
|
+
if (texts.length === 0) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const durationSeconds = transitionDuration / 1000;
|
|
80
|
+
const currentText = texts[safeIndex];
|
|
81
|
+
// Reduced motion: instant swap with no animation
|
|
82
|
+
if (shouldReduceMotion) {
|
|
83
|
+
return (jsx("div", { className: cn('relative inline-block', className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, "aria-live": "polite", "aria-atomic": "true", ...props, children: jsx("span", { children: currentText }) }));
|
|
84
|
+
}
|
|
85
|
+
return (jsxs("div", { className: cn('relative inline-block', className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, "aria-live": "polite", "aria-atomic": "true", ...props, children: [jsx("svg", { className: "absolute h-0 w-0", "aria-hidden": "true", children: jsx("defs", { children: jsx("filter", { id: `${filterId}-blur`, children: jsx("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "0" }) }) }) }), jsx("span", { className: "invisible block", "aria-hidden": "true", children: currentText }), jsx(AnimatePresence, { mode: "popLayout", initial: false, children: jsx(motion.span, { className: "absolute inset-0 flex items-center", initial: { opacity: 0, filter: 'blur(8px)' }, animate: { opacity: 1, filter: 'blur(0px)' }, exit: { opacity: 0, filter: 'blur(8px)' }, transition: {
|
|
86
|
+
duration: durationSeconds,
|
|
87
|
+
ease: 'easeInOut',
|
|
88
|
+
}, children: currentText }, safeIndex) })] }));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export { MorphingText };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface MorphingTextProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
/** Array of text strings to morph between */
|
|
3
|
+
texts: string[];
|
|
4
|
+
/** Time between transitions in ms (default 3000) */
|
|
5
|
+
interval?: number;
|
|
6
|
+
/** Transition duration in ms (default 800) */
|
|
7
|
+
transitionDuration?: number;
|
|
8
|
+
/** Loop continuously (default true) */
|
|
9
|
+
loop?: boolean;
|
|
10
|
+
/** Pause cycling on hover (default false) */
|
|
11
|
+
pauseOnHover?: boolean;
|
|
12
|
+
/** Controlled current index (overrides internal state) */
|
|
13
|
+
currentIndex?: number;
|
|
14
|
+
/** Callback when the active text changes */
|
|
15
|
+
onTextChange?: (index: number, text: string) => void;
|
|
16
|
+
/** Additional class names for the container */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { NoiseOverlayProps } from "./NoiseOverlay.types";
|
|
3
|
+
/**
|
|
4
|
+
* NoiseOverlay Component
|
|
5
|
+
*
|
|
6
|
+
* An SVG feTurbulence-based noise/grain texture overlay that adds a
|
|
7
|
+
* matte or film-like quality to surfaces. Renders as an absolute-positioned,
|
|
8
|
+
* non-interactive layer over its parent container.
|
|
9
|
+
*
|
|
10
|
+
* The parent container should have `position: relative` and `overflow: hidden`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <div className="relative overflow-hidden bg-gray-900 rounded-lg p-6">
|
|
15
|
+
* <NoiseOverlay opacity={0.2} blendMode="soft-light" />
|
|
16
|
+
* <span className="relative z-10">Content with grain texture</span>
|
|
17
|
+
* </div>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example Animated grain
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <div className="relative overflow-hidden bg-indigo-600 rounded-lg p-8">
|
|
23
|
+
* <NoiseOverlay animated frequency={0.8} octaves={3} />
|
|
24
|
+
* <h2 className="relative z-10 text-white">Film grain effect</h2>
|
|
25
|
+
* </div>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const NoiseOverlay: React.FC<NoiseOverlayProps>;
|