@flikk/ui 1.0.0-beta.2 → 1.0.0-beta.4
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 +51 -10
- package/dist/components/ai/PromptInput/PromptInput.theme.js +1 -0
- package/dist/components/ai/PromptInput/PromptInput.types.d.ts +20 -0
- package/dist/components/charts/DonutChart/DonutChart.types.d.ts +1 -2
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.types.d.ts +1 -2
- 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.d.ts +1 -1
- 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 +8 -4
- package/dist/components/core/Button/Button.d.ts +1 -1
- package/dist/components/core/Button/Button.theme.js +8 -9
- package/dist/components/core/Button/Button.types.d.ts +1 -2
- 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/Link/Link.d.ts +1 -1
- package/dist/components/core/Link/Link.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/3d/index.d.ts +6 -0
- package/dist/components/effects/3d/index.js +3 -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/CustomCursor/CustomCursor.d.ts +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.types.d.ts +3 -3
- 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 +22 -4
- package/dist/components/effects/index.js +11 -2
- 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/InputCounter/InputCounter.d.ts +1 -1
- package/dist/components/forms/InputCounter/InputCounter.types.d.ts +3 -2
- 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 +33 -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/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 +9 -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 +13 -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 +53 -21
- 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 +26 -22
- 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
|
@@ -4,13 +4,36 @@
|
|
|
4
4
|
const radioTheme = {
|
|
5
5
|
baseStyle: "relative flex items-start gap-3",
|
|
6
6
|
inputContainerStyle: "relative flex-shrink-0 flex items-center justify-center",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
// Input styles with light and dark mode variants
|
|
8
|
+
inputStyle: "col-start-1 row-start-1 appearance-none rounded-full border-2 transition-all duration-400 " +
|
|
9
|
+
// Default state - light
|
|
10
|
+
"border-[var(--color-border)] bg-[var(--color-surface)] " +
|
|
11
|
+
// Default state - dark
|
|
12
|
+
"dark:bg-[var(--color-background-secondary)] " +
|
|
13
|
+
// Checked state - light
|
|
14
|
+
"checked:border-[var(--color-primary)] " +
|
|
15
|
+
// Checked state - dark
|
|
16
|
+
" " +
|
|
17
|
+
// Checked outline - light
|
|
18
|
+
"checked:outline-2 checked:outline-[var(--color-primary-100)] checked:outline-offset-1 " +
|
|
19
|
+
// Checked outline - dark
|
|
20
|
+
"dark:checked:outline-[var(--color-primary-900)] " +
|
|
21
|
+
// Focus visible - light
|
|
22
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-primary-600)] " +
|
|
23
|
+
// Focus visible - dark
|
|
24
|
+
"dark:focus-visible:outline-[var(--color-primary-500)] " +
|
|
25
|
+
// Disabled state - light
|
|
26
|
+
"disabled:bg-[var(--color-background-disabled)] disabled:checked:outline-0 " +
|
|
27
|
+
"data-[state=disabled]:border-[var(--color-border)] data-[state=disabled]:bg-[var(--color-background-disabled)] data-[state=disabled]:cursor-not-allowed " +
|
|
28
|
+
// Disabled state - dark
|
|
29
|
+
"dark:disabled:bg-[var(--color-neutral-700)] dark:disabled:border-[var(--color-neutral-600)] " +
|
|
30
|
+
"dark:data-[state=disabled]:bg-[var(--color-neutral-700)] dark:data-[state=disabled]:border-[var(--color-neutral-600)]",
|
|
31
|
+
dotStyle: "absolute inset-0 m-auto pointer-events-none rounded-full bg-[var(--color-primary)] opacity-0 transition-all duration-400 peer-checked:opacity-100 peer-data-[state=disabled]:saturate-0 peer-data-[state=disabled]:peer-checked:opacity-80",
|
|
32
|
+
descriptionStyle: "text-sm text-[var(--color-text-secondary)]/80 mt-0.5",
|
|
10
33
|
sizes: {
|
|
11
34
|
sm: "size-5 mt-0.25",
|
|
12
|
-
md: "size-6"
|
|
13
|
-
}
|
|
35
|
+
md: "size-6",
|
|
36
|
+
},
|
|
14
37
|
};
|
|
15
38
|
|
|
16
39
|
export { radioTheme };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SelectableCardProps } from "./SelectableCard.types";
|
|
3
|
+
export declare const SelectableCard: React.ForwardRefExoticComponent<SelectableCardProps & React.RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
Group: React.ForwardRefExoticComponent<import("./SelectableCard.types").SelectableCardGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { useId } from 'react';
|
|
3
|
+
import { useReducedMotion, motion } from 'motion/react';
|
|
4
|
+
import { CheckIcon } from '@heroicons/react/24/outline';
|
|
5
|
+
import { cn } from '../../../utils/cn.js';
|
|
6
|
+
import { useSelectableCardContext } from './SelectableCardContext.js';
|
|
7
|
+
import { SelectableCardGroup } from './SelectableCardGroup.js';
|
|
8
|
+
import { cardVariants } from './SelectableCard.animations.js';
|
|
9
|
+
|
|
10
|
+
// ─── Radio Indicator ─────────────────────────────────────────────────────────
|
|
11
|
+
const RadioIndicator = ({ checked }) => (jsxs("div", { className: "relative flex-shrink-0 flex items-center justify-center size-5", children: [jsx("div", { className: cn("size-5 rounded-full border-2 transition-colors duration-200", checked
|
|
12
|
+
? "border-[var(--color-primary)]"
|
|
13
|
+
: "border-[var(--color-border)]") }), jsx("div", { className: cn("absolute inset-0 m-auto rounded-full bg-[var(--color-primary)] transition-all duration-200", checked ? "size-2.5 opacity-100" : "size-0 opacity-0") })] }));
|
|
14
|
+
// ─── Checkbox Indicator ──────────────────────────────────────────────────────
|
|
15
|
+
const CheckboxIndicator = ({ checked }) => (jsx("div", { className: cn("flex-shrink-0 flex items-center justify-center size-5 rounded-[4px] border-2 transition-colors duration-200", checked
|
|
16
|
+
? "border-[var(--color-primary)] bg-[var(--color-primary)]"
|
|
17
|
+
: "border-[var(--color-border)] bg-[var(--color-background)]"), children: checked && jsx(CheckIcon, { className: "size-3.5 stroke-white", strokeWidth: 3 }) }));
|
|
18
|
+
// ─── SelectableCard ──────────────────────────────────────────────────────────
|
|
19
|
+
const SelectableCardRoot = React__default.forwardRef(({ value, disabled: cardDisabled, className, children, ...props }, ref) => {
|
|
20
|
+
const content = children;
|
|
21
|
+
const ctx = useSelectableCardContext();
|
|
22
|
+
const inputId = useId();
|
|
23
|
+
const shouldReduceMotion = useReducedMotion();
|
|
24
|
+
const isDisabled = cardDisabled || ctx.disabled;
|
|
25
|
+
const isSelected = ctx.type === "single"
|
|
26
|
+
? ctx.value === value
|
|
27
|
+
: Array.isArray(ctx.value) && ctx.value.includes(value);
|
|
28
|
+
const handleClick = () => {
|
|
29
|
+
if (isDisabled)
|
|
30
|
+
return;
|
|
31
|
+
ctx.onChange(value);
|
|
32
|
+
};
|
|
33
|
+
const handleKeyDown = (e) => {
|
|
34
|
+
if (isDisabled)
|
|
35
|
+
return;
|
|
36
|
+
if (e.key === " " || e.key === "Enter") {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
ctx.onChange(value);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const inputType = ctx.type === "single" ? "radio" : "checkbox";
|
|
42
|
+
const animated = !shouldReduceMotion && !isDisabled;
|
|
43
|
+
const motionProps = animated
|
|
44
|
+
? {
|
|
45
|
+
variants: cardVariants,
|
|
46
|
+
initial: "idle",
|
|
47
|
+
whileTap: "tap",
|
|
48
|
+
}
|
|
49
|
+
: {};
|
|
50
|
+
return (jsxs(motion.div, { ref: ref, role: ctx.type === "single" ? "radio" : "checkbox", "aria-checked": isSelected, "aria-disabled": isDisabled || undefined, tabIndex: isDisabled ? -1 : 0, "data-selected": isSelected, "data-disabled": isDisabled || undefined, className: cn(ctx.theme.card, isSelected && ctx.theme.selectedCard, isDisabled && ctx.theme.disabledCard, className), onClick: handleClick, onKeyDown: handleKeyDown, ...motionProps, ...props, children: [jsx("input", { type: inputType, id: inputId, name: ctx.name, value: value, checked: isSelected, disabled: isDisabled, onChange: () => { }, className: "sr-only", tabIndex: -1, "aria-hidden": true }), jsx("div", { className: ctx.theme.contentWrapper, children: content }), ctx.indicator !== "none" && (jsx("div", { className: ctx.theme.indicator, children: ctx.indicator === "radio" ? (jsx(RadioIndicator, { checked: isSelected })) : (jsx(CheckboxIndicator, { checked: isSelected })) }))] }));
|
|
51
|
+
});
|
|
52
|
+
SelectableCardRoot.displayName = "SelectableCard";
|
|
53
|
+
// ─── Compound Export ─────────────────────────────────────────────────────────
|
|
54
|
+
const SelectableCard = Object.assign(SelectableCardRoot, {
|
|
55
|
+
Group: SelectableCardGroup,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export { SelectableCard };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const selectableCardTheme = {
|
|
2
|
+
group: "flex flex-col gap-3",
|
|
3
|
+
card:
|
|
4
|
+
// Base layout
|
|
5
|
+
"relative flex items-center justify-between gap-4 rounded-[var(--radius-base)] p-4 cursor-pointer transition-[border-color,background-color,box-shadow,outline] duration-200 " +
|
|
6
|
+
// Default state - light
|
|
7
|
+
"border border-[var(--color-border)] bg-[var(--color-surface)] " +
|
|
8
|
+
// Default state - dark
|
|
9
|
+
"dark:bg-[var(--color-background)] " +
|
|
10
|
+
// Hover state - light
|
|
11
|
+
"hover:border-[var(--color-border-secondary)] " +
|
|
12
|
+
// Hover state - dark
|
|
13
|
+
" " +
|
|
14
|
+
// Focus visible - light
|
|
15
|
+
"focus-visible:outline focus-visible:outline-offset-1 focus-visible:outline-[var(--color-primary)] " +
|
|
16
|
+
// Focus visible - dark
|
|
17
|
+
"dark:focus-visible:outline-[var(--color-primary)]/50",
|
|
18
|
+
selectedCard:
|
|
19
|
+
// Selected border & ring - light
|
|
20
|
+
"border-[var(--color-primary)] ring-2 ring-[var(--color-primary)]/10 " +
|
|
21
|
+
// Selected border & ring - dark
|
|
22
|
+
"dark:border-[var(--color-primary)] dark:ring-[var(--color-primary)]/20 " +
|
|
23
|
+
// Selected background gradient - light
|
|
24
|
+
"bg-[var(--color-primary-50)] " +
|
|
25
|
+
// Selected background gradient - dark
|
|
26
|
+
"dark:bg-[var(--color-background-secondary)] " +
|
|
27
|
+
// Selected hover - light
|
|
28
|
+
"hover:border-[var(--color-primary)] " +
|
|
29
|
+
// Selected hover - dark
|
|
30
|
+
"dark:hover:border-[var(--color-primary)] ",
|
|
31
|
+
disabledCard:
|
|
32
|
+
// Disabled state
|
|
33
|
+
"opacity-50 cursor-not-allowed pointer-events-none",
|
|
34
|
+
contentWrapper: "flex-1 min-w-0",
|
|
35
|
+
indicator: "flex-shrink-0",
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { selectableCardTheme };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type SelectableCardType = "single" | "multiple";
|
|
3
|
+
export type SelectableCardIndicator = "radio" | "checkbox" | "none";
|
|
4
|
+
export interface SelectableCardTheme {
|
|
5
|
+
group?: string;
|
|
6
|
+
card?: string;
|
|
7
|
+
selectedCard?: string;
|
|
8
|
+
disabledCard?: string;
|
|
9
|
+
contentWrapper?: string;
|
|
10
|
+
indicator?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SelectableCardContextValue {
|
|
13
|
+
type: SelectableCardType;
|
|
14
|
+
indicator: SelectableCardIndicator;
|
|
15
|
+
value: string | string[];
|
|
16
|
+
onChange: (cardValue: string) => void;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
name: string;
|
|
19
|
+
theme: SelectableCardTheme;
|
|
20
|
+
}
|
|
21
|
+
export interface SelectableCardGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
22
|
+
type?: SelectableCardType;
|
|
23
|
+
value: string | string[];
|
|
24
|
+
onChange: (value: string | string[]) => void;
|
|
25
|
+
indicator?: SelectableCardIndicator;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
name?: string;
|
|
28
|
+
theme?: Partial<SelectableCardTheme>;
|
|
29
|
+
}
|
|
30
|
+
export interface SelectableCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "value"> {
|
|
31
|
+
value: string;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
const SelectableCardContext = createContext(undefined);
|
|
4
|
+
function useSelectableCardContext() {
|
|
5
|
+
const context = useContext(SelectableCardContext);
|
|
6
|
+
if (!context) {
|
|
7
|
+
throw new Error("SelectableCard must be used within a SelectableCard.Group");
|
|
8
|
+
}
|
|
9
|
+
return context;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { SelectableCardContext, useSelectableCardContext };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { useId, useMemo } from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { selectableCardTheme } from './SelectableCard.theme.js';
|
|
5
|
+
import { SelectableCardContext } from './SelectableCardContext.js';
|
|
6
|
+
|
|
7
|
+
const SelectableCardGroup = React__default.forwardRef(({ type = "single", value, onChange, indicator, disabled = false, name, className, theme: customTheme, children, ...props }, ref) => {
|
|
8
|
+
const autoId = useId();
|
|
9
|
+
const groupName = name !== null && name !== void 0 ? name : `selectable-card-${autoId}`;
|
|
10
|
+
const resolvedIndicator = indicator !== null && indicator !== void 0 ? indicator : (type === "single" ? "radio" : "checkbox");
|
|
11
|
+
const theme = useMemo(() => ({ ...selectableCardTheme, ...customTheme }), [customTheme]);
|
|
12
|
+
const handleChange = (cardValue) => {
|
|
13
|
+
if (type === "single") {
|
|
14
|
+
onChange(cardValue);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
const current = Array.isArray(value) ? value : [];
|
|
18
|
+
const next = current.includes(cardValue)
|
|
19
|
+
? current.filter((v) => v !== cardValue)
|
|
20
|
+
: [...current, cardValue];
|
|
21
|
+
onChange(next);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const contextValue = useMemo(() => ({
|
|
25
|
+
type,
|
|
26
|
+
indicator: resolvedIndicator,
|
|
27
|
+
value,
|
|
28
|
+
onChange: handleChange,
|
|
29
|
+
disabled,
|
|
30
|
+
name: groupName,
|
|
31
|
+
theme,
|
|
32
|
+
}), [type, resolvedIndicator, value, disabled, groupName, theme]);
|
|
33
|
+
return (jsx(SelectableCardContext.Provider, { value: contextValue, children: jsx("div", { ref: ref, role: type === "single" ? "radiogroup" : "group", className: cn(theme.group, className), ...props, children: children }) }));
|
|
34
|
+
});
|
|
35
|
+
SelectableCardGroup.displayName = "SelectableCard.Group";
|
|
36
|
+
|
|
37
|
+
export { SelectableCardGroup };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { SelectableCard } from "./SelectableCard";
|
|
2
|
+
export type { SelectableCardProps, SelectableCardGroupProps, SelectableCardType, SelectableCardIndicator, SelectableCardTheme, } from "./SelectableCard.types";
|
|
3
|
+
export { selectableCardTheme } from "./SelectableCard.theme";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Variants } from "motion/react";
|
|
2
|
+
/**
|
|
3
|
+
* Get animation variants for items entering/exiting lists.
|
|
4
|
+
* Items slide and fade in from the transfer direction.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getItemVariants: (shouldReduceMotion: boolean | null) => Variants | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Get staggered list animation variants for initial render
|
|
9
|
+
*/
|
|
10
|
+
export declare const getListVariants: (shouldReduceMotion: boolean | null) => Variants | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get animation variants for items entering/exiting lists.
|
|
3
|
+
* Items slide and fade in from the transfer direction.
|
|
4
|
+
*/
|
|
5
|
+
const getItemVariants = (shouldReduceMotion) => (shouldReduceMotion !== null && shouldReduceMotion !== void 0 ? shouldReduceMotion : false)
|
|
6
|
+
? undefined
|
|
7
|
+
: {
|
|
8
|
+
initial: {
|
|
9
|
+
opacity: 0,
|
|
10
|
+
x: 0,
|
|
11
|
+
height: 0,
|
|
12
|
+
},
|
|
13
|
+
animate: {
|
|
14
|
+
opacity: 1,
|
|
15
|
+
x: 0,
|
|
16
|
+
height: "auto",
|
|
17
|
+
transition: {
|
|
18
|
+
duration: 0.2,
|
|
19
|
+
ease: "easeOut",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
exit: {
|
|
23
|
+
opacity: 0,
|
|
24
|
+
height: 0,
|
|
25
|
+
transition: {
|
|
26
|
+
duration: 0.15,
|
|
27
|
+
ease: "easeIn",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { getItemVariants };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TransferListProps } from "./TransferList.types";
|
|
3
|
+
/**
|
|
4
|
+
* TransferList is a dual-list picker for moving items between a source
|
|
5
|
+
* (available) list and a target (selected) list. Commonly used in
|
|
6
|
+
* admin/permissions interfaces for assigning roles, features, or users.
|
|
7
|
+
*
|
|
8
|
+
* Supports controlled (value + onChange) and uncontrolled (defaultValue)
|
|
9
|
+
* patterns, optional search filtering, multi-select with checkboxes,
|
|
10
|
+
* custom item renderers, disabled items, and animated transitions.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <TransferList
|
|
15
|
+
* items={[
|
|
16
|
+
* { id: '1', label: 'Read' },
|
|
17
|
+
* { id: '2', label: 'Write' },
|
|
18
|
+
* { id: '3', label: 'Delete' },
|
|
19
|
+
* ]}
|
|
20
|
+
* value={selectedPermissions}
|
|
21
|
+
* onChange={setSelectedPermissions}
|
|
22
|
+
* sourceTitle="Available Permissions"
|
|
23
|
+
* targetTitle="Assigned Permissions"
|
|
24
|
+
* searchable
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const TransferList: React.ForwardRefExoticComponent<TransferListProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { useState, useMemo, useCallback } from 'react';
|
|
3
|
+
import { useReducedMotion, AnimatePresence, motion } from 'motion/react';
|
|
4
|
+
import { ChevronDoubleRightIcon, ChevronRightIcon, ChevronLeftIcon, ChevronDoubleLeftIcon, MagnifyingGlassIcon } from '@heroicons/react/24/outline';
|
|
5
|
+
import { cn } from '../../../utils/cn.js';
|
|
6
|
+
import { transferListTheme } from './TransferList.theme.js';
|
|
7
|
+
import { getItemVariants } from './TransferList.animations.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* TransferList is a dual-list picker for moving items between a source
|
|
11
|
+
* (available) list and a target (selected) list. Commonly used in
|
|
12
|
+
* admin/permissions interfaces for assigning roles, features, or users.
|
|
13
|
+
*
|
|
14
|
+
* Supports controlled (value + onChange) and uncontrolled (defaultValue)
|
|
15
|
+
* patterns, optional search filtering, multi-select with checkboxes,
|
|
16
|
+
* custom item renderers, disabled items, and animated transitions.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <TransferList
|
|
21
|
+
* items={[
|
|
22
|
+
* { id: '1', label: 'Read' },
|
|
23
|
+
* { id: '2', label: 'Write' },
|
|
24
|
+
* { id: '3', label: 'Delete' },
|
|
25
|
+
* ]}
|
|
26
|
+
* value={selectedPermissions}
|
|
27
|
+
* onChange={setSelectedPermissions}
|
|
28
|
+
* sourceTitle="Available Permissions"
|
|
29
|
+
* targetTitle="Assigned Permissions"
|
|
30
|
+
* searchable
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
const TransferList = React__default.forwardRef(({ items, value: controlledValue, defaultValue = [], onChange, sourceTitle = "Available", targetTitle = "Selected", searchable = false, size = "md", renderItem, className, ...restProps }, ref) => {
|
|
35
|
+
const shouldReduceMotion = useReducedMotion();
|
|
36
|
+
const itemVariants = getItemVariants(shouldReduceMotion);
|
|
37
|
+
// Controlled vs uncontrolled state for target IDs
|
|
38
|
+
const isControlled = controlledValue !== undefined;
|
|
39
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
40
|
+
const targetIds = isControlled ? controlledValue : internalValue;
|
|
41
|
+
// Selection state for checkboxes in each list
|
|
42
|
+
const [sourceSelected, setSourceSelected] = useState(new Set());
|
|
43
|
+
const [targetSelected, setTargetSelected] = useState(new Set());
|
|
44
|
+
// Search/filter state
|
|
45
|
+
const [sourceSearch, setSourceSearch] = useState("");
|
|
46
|
+
const [targetSearch, setTargetSearch] = useState("");
|
|
47
|
+
const theme = transferListTheme;
|
|
48
|
+
const sizeStyles = theme.sizes[size];
|
|
49
|
+
// Build a lookup map for items by ID
|
|
50
|
+
const itemMap = useMemo(() => {
|
|
51
|
+
const map = new Map();
|
|
52
|
+
for (const item of items) {
|
|
53
|
+
map.set(item.id, item);
|
|
54
|
+
}
|
|
55
|
+
return map;
|
|
56
|
+
}, [items]);
|
|
57
|
+
// Derive target IDs set for fast lookup
|
|
58
|
+
const targetIdSet = useMemo(() => new Set(targetIds), [targetIds]);
|
|
59
|
+
// Split items into source and target lists
|
|
60
|
+
const sourceItems = useMemo(() => items.filter((item) => !targetIdSet.has(item.id)), [items, targetIdSet]);
|
|
61
|
+
const targetItems = useMemo(() => targetIds
|
|
62
|
+
.map((id) => itemMap.get(id))
|
|
63
|
+
.filter((item) => item !== undefined), [targetIds, itemMap]);
|
|
64
|
+
// Filter items by search query
|
|
65
|
+
const filteredSourceItems = useMemo(() => {
|
|
66
|
+
if (!sourceSearch.trim())
|
|
67
|
+
return sourceItems;
|
|
68
|
+
const query = sourceSearch.toLowerCase();
|
|
69
|
+
return sourceItems.filter((item) => item.label.toLowerCase().includes(query));
|
|
70
|
+
}, [sourceItems, sourceSearch]);
|
|
71
|
+
const filteredTargetItems = useMemo(() => {
|
|
72
|
+
if (!targetSearch.trim())
|
|
73
|
+
return targetItems;
|
|
74
|
+
const query = targetSearch.toLowerCase();
|
|
75
|
+
return targetItems.filter((item) => item.label.toLowerCase().includes(query));
|
|
76
|
+
}, [targetItems, targetSearch]);
|
|
77
|
+
// Update the target list value
|
|
78
|
+
const updateValue = useCallback((newTargetIds) => {
|
|
79
|
+
if (!isControlled) {
|
|
80
|
+
setInternalValue(newTargetIds);
|
|
81
|
+
}
|
|
82
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newTargetIds);
|
|
83
|
+
}, [isControlled, onChange]);
|
|
84
|
+
// Transfer selected source items to target
|
|
85
|
+
const handleMoveToTarget = useCallback(() => {
|
|
86
|
+
const idsToMove = Array.from(sourceSelected).filter((id) => {
|
|
87
|
+
const item = itemMap.get(id);
|
|
88
|
+
return item && !item.disabled;
|
|
89
|
+
});
|
|
90
|
+
if (idsToMove.length === 0)
|
|
91
|
+
return;
|
|
92
|
+
const newTargetIds = [...targetIds, ...idsToMove];
|
|
93
|
+
updateValue(newTargetIds);
|
|
94
|
+
setSourceSelected(new Set());
|
|
95
|
+
}, [sourceSelected, targetIds, updateValue, itemMap]);
|
|
96
|
+
// Transfer selected target items back to source
|
|
97
|
+
const handleMoveToSource = useCallback(() => {
|
|
98
|
+
const idsToMove = new Set(Array.from(targetSelected).filter((id) => {
|
|
99
|
+
const item = itemMap.get(id);
|
|
100
|
+
return item && !item.disabled;
|
|
101
|
+
}));
|
|
102
|
+
if (idsToMove.size === 0)
|
|
103
|
+
return;
|
|
104
|
+
const newTargetIds = targetIds.filter((id) => !idsToMove.has(id));
|
|
105
|
+
updateValue(newTargetIds);
|
|
106
|
+
setTargetSelected(new Set());
|
|
107
|
+
}, [targetSelected, targetIds, updateValue, itemMap]);
|
|
108
|
+
// Move all non-disabled source items to target
|
|
109
|
+
const handleMoveAllToTarget = useCallback(() => {
|
|
110
|
+
const nonDisabledSourceIds = sourceItems
|
|
111
|
+
.filter((item) => !item.disabled)
|
|
112
|
+
.map((item) => item.id);
|
|
113
|
+
if (nonDisabledSourceIds.length === 0)
|
|
114
|
+
return;
|
|
115
|
+
const newTargetIds = [...targetIds, ...nonDisabledSourceIds];
|
|
116
|
+
updateValue(newTargetIds);
|
|
117
|
+
setSourceSelected(new Set());
|
|
118
|
+
}, [sourceItems, targetIds, updateValue]);
|
|
119
|
+
// Move all non-disabled target items back to source
|
|
120
|
+
const handleMoveAllToSource = useCallback(() => {
|
|
121
|
+
const disabledTargetIds = targetItems
|
|
122
|
+
.filter((item) => item.disabled)
|
|
123
|
+
.map((item) => item.id);
|
|
124
|
+
updateValue(disabledTargetIds);
|
|
125
|
+
setTargetSelected(new Set());
|
|
126
|
+
}, [targetItems, updateValue]);
|
|
127
|
+
// Toggle an individual item's selection
|
|
128
|
+
const toggleSelection = useCallback((id, selected, setSelected) => {
|
|
129
|
+
const item = itemMap.get(id);
|
|
130
|
+
if (item === null || item === void 0 ? void 0 : item.disabled)
|
|
131
|
+
return;
|
|
132
|
+
const next = new Set(selected);
|
|
133
|
+
if (next.has(id)) {
|
|
134
|
+
next.delete(id);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
next.add(id);
|
|
138
|
+
}
|
|
139
|
+
setSelected(next);
|
|
140
|
+
}, [itemMap]);
|
|
141
|
+
// Toggle select-all for a given list
|
|
142
|
+
const toggleSelectAll = useCallback((listItems, selected, setSelected) => {
|
|
143
|
+
const selectableItems = listItems.filter((item) => !item.disabled);
|
|
144
|
+
const allSelected = selectableItems.every((item) => selected.has(item.id));
|
|
145
|
+
if (allSelected) {
|
|
146
|
+
setSelected(new Set());
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
setSelected(new Set(selectableItems.map((item) => item.id)));
|
|
150
|
+
}
|
|
151
|
+
}, []);
|
|
152
|
+
// Compute select-all checkbox states
|
|
153
|
+
const sourceSelectableItems = filteredSourceItems.filter((i) => !i.disabled);
|
|
154
|
+
const targetSelectableItems = filteredTargetItems.filter((i) => !i.disabled);
|
|
155
|
+
const sourceAllSelected = sourceSelectableItems.length > 0 &&
|
|
156
|
+
sourceSelectableItems.every((item) => sourceSelected.has(item.id));
|
|
157
|
+
const sourceIndeterminate = !sourceAllSelected &&
|
|
158
|
+
sourceSelectableItems.some((item) => sourceSelected.has(item.id));
|
|
159
|
+
const targetAllSelected = targetSelectableItems.length > 0 &&
|
|
160
|
+
targetSelectableItems.every((item) => targetSelected.has(item.id));
|
|
161
|
+
const targetIndeterminate = !targetAllSelected &&
|
|
162
|
+
targetSelectableItems.some((item) => targetSelected.has(item.id));
|
|
163
|
+
// Icon size classes per size variant
|
|
164
|
+
const iconSize = size === "sm" ? "w-3.5 h-3.5" : size === "lg" ? "w-5 h-5" : "w-4 h-4";
|
|
165
|
+
const searchIconSize = size === "sm" ? "w-3.5 h-3.5" : size === "lg" ? "w-5 h-5" : "w-4 h-4";
|
|
166
|
+
const searchIconPosition = size === "sm" ? "left-2" : size === "lg" ? "left-3" : "left-2.5";
|
|
167
|
+
// Checkbox size
|
|
168
|
+
const checkboxSize = size === "sm" ? "w-3.5 h-3.5" : size === "lg" ? "w-5 h-5" : "w-4 h-4";
|
|
169
|
+
// Render a single list panel
|
|
170
|
+
const renderPanel = (title, listItems, filteredItems, selected, setSelected, search, setSearch, allSelected, indeterminate, panelAriaLabel) => {
|
|
171
|
+
const selectableCount = filteredItems.filter((i) => !i.disabled).length;
|
|
172
|
+
const selectedCount = Array.from(selected).filter((id) => filteredItems.some((item) => item.id === id)).length;
|
|
173
|
+
return (jsxs("div", { className: cn(theme.panelStyle, sizeStyles.panel), role: "listbox", "aria-label": panelAriaLabel, "aria-multiselectable": "true", children: [jsxs("div", { className: theme.headerStyle, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("input", { type: "checkbox", checked: allSelected, ref: (el) => {
|
|
174
|
+
if (el)
|
|
175
|
+
el.indeterminate = indeterminate;
|
|
176
|
+
}, onChange: () => toggleSelectAll(filteredItems, selected, setSelected), disabled: selectableCount === 0, className: cn(checkboxSize, "rounded-[calc(var(--radius-base)*0.5)] border-2 border-[var(--color-border)] accent-[var(--color-primary)] cursor-pointer disabled:cursor-not-allowed disabled:opacity-50"), "aria-label": `Select all ${title}` }), jsx("span", { className: cn(theme.titleStyle, size === "sm" ? "text-xs" : "text-sm"), children: title })] }), jsxs("span", { className: cn(theme.countStyle, size === "sm" ? "text-xs" : "text-xs"), children: [selectedCount > 0 ? `${selectedCount}/` : "", listItems.length] })] }), searchable && (jsxs("div", { className: theme.searchWrapperStyle, children: [jsx(MagnifyingGlassIcon, { className: cn(searchIconSize, "absolute text-[var(--color-text-placeholder)] pointer-events-none", searchIconPosition) }), jsx("input", { type: "text", value: search, onChange: (e) => setSearch(e.target.value), placeholder: "Search...", className: cn(theme.searchInputStyle, sizeStyles.searchInput), "aria-label": `Search ${title}` })] })), jsxs("div", { className: theme.listStyle, children: [jsx(AnimatePresence, { mode: "popLayout", initial: false, children: filteredItems.map((item) => {
|
|
177
|
+
const isSelected = selected.has(item.id);
|
|
178
|
+
const isDisabled = item.disabled === true;
|
|
179
|
+
const itemContent = (jsxs(Fragment, { children: [jsx("input", { type: "checkbox", checked: isSelected, onChange: () => toggleSelection(item.id, selected, setSelected), disabled: isDisabled, className: cn(checkboxSize, "rounded-[calc(var(--radius-base)*0.5)] border-2 border-[var(--color-border)] accent-[var(--color-primary)] cursor-pointer flex-shrink-0", isDisabled && "cursor-not-allowed"), tabIndex: -1, "aria-hidden": "true" }), jsx("span", { className: "truncate flex-1", children: renderItem ? renderItem(item) : item.label })] }));
|
|
180
|
+
const itemProps = {
|
|
181
|
+
key: item.id,
|
|
182
|
+
role: "option",
|
|
183
|
+
"aria-selected": isSelected,
|
|
184
|
+
"aria-disabled": isDisabled,
|
|
185
|
+
"data-selected": isSelected ? "true" : "false",
|
|
186
|
+
onClick: () => toggleSelection(item.id, selected, setSelected),
|
|
187
|
+
className: cn(theme.itemStyle, sizeStyles.item, isDisabled && theme.itemDisabledStyle),
|
|
188
|
+
};
|
|
189
|
+
if (itemVariants) {
|
|
190
|
+
return (jsx(motion.div, { ...itemProps, layout: true, variants: itemVariants, initial: "initial", animate: "animate", exit: "exit", children: itemContent }));
|
|
191
|
+
}
|
|
192
|
+
return jsx("div", { ...itemProps, children: itemContent });
|
|
193
|
+
}) }), filteredItems.length === 0 && (jsx("div", { className: cn("flex items-center justify-center text-[var(--color-text-muted)]", size === "sm" ? "py-4 text-xs" : size === "lg" ? "py-8 text-sm" : "py-6 text-xs"), children: search.trim() ? "No matches found" : "No items" }))] })] }));
|
|
194
|
+
};
|
|
195
|
+
return (jsxs("div", { ref: ref, className: cn(theme.baseStyle, className), ...restProps, children: [renderPanel(sourceTitle, sourceItems, filteredSourceItems, sourceSelected, setSourceSelected, sourceSearch, setSourceSearch, sourceAllSelected, sourceIndeterminate, sourceTitle), jsxs("div", { className: theme.actionsStyle, children: [jsx("button", { type: "button", onClick: handleMoveAllToTarget, disabled: sourceItems.filter((i) => !i.disabled).length === 0, className: cn(theme.buttonStyle, sizeStyles.button), "aria-label": "Move all to target", children: jsx(ChevronDoubleRightIcon, { className: iconSize }) }), jsx("button", { type: "button", onClick: handleMoveToTarget, disabled: sourceSelected.size === 0, className: cn(theme.buttonStyle, sizeStyles.button), "aria-label": "Move selected to target", children: jsx(ChevronRightIcon, { className: iconSize }) }), jsx("button", { type: "button", onClick: handleMoveToSource, disabled: targetSelected.size === 0, className: cn(theme.buttonStyle, sizeStyles.button), "aria-label": "Move selected to source", children: jsx(ChevronLeftIcon, { className: iconSize }) }), jsx("button", { type: "button", onClick: handleMoveAllToSource, disabled: targetItems.filter((i) => !i.disabled).length === 0, className: cn(theme.buttonStyle, sizeStyles.button), "aria-label": "Move all to source", children: jsx(ChevronDoubleLeftIcon, { className: iconSize }) })] }), renderPanel(targetTitle, targetItems, filteredTargetItems, targetSelected, setTargetSelected, targetSearch, setTargetSearch, targetAllSelected, targetIndeterminate, targetTitle)] }));
|
|
196
|
+
});
|
|
197
|
+
TransferList.displayName = "TransferList";
|
|
198
|
+
|
|
199
|
+
export { TransferList };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default theme configuration for the TransferList component.
|
|
3
|
+
* Uses CSS variables from global.scss for consistent theming.
|
|
4
|
+
*/
|
|
5
|
+
const transferListTheme = {
|
|
6
|
+
// Root container - horizontal layout with centered actions
|
|
7
|
+
baseStyle: "flex items-stretch gap-0",
|
|
8
|
+
// Individual list panel
|
|
9
|
+
panelStyle: "flex flex-col border border-[var(--color-border)] rounded-[var(--form-radius)] bg-[var(--color-surface)] overflow-hidden",
|
|
10
|
+
// Panel header with title and count
|
|
11
|
+
headerStyle: "flex items-center justify-between px-3 py-2 border-b border-[var(--color-border)] bg-[var(--color-background-secondary)]",
|
|
12
|
+
// Title text
|
|
13
|
+
titleStyle: "font-medium text-[var(--color-text-primary)]",
|
|
14
|
+
// Item count badge
|
|
15
|
+
countStyle: "text-[var(--color-text-muted)] tabular-nums",
|
|
16
|
+
// Search input wrapper
|
|
17
|
+
searchWrapperStyle: "relative flex items-center border-b border-[var(--color-border)]",
|
|
18
|
+
// Search input
|
|
19
|
+
searchInputStyle: "w-full bg-transparent text-[var(--color-text-primary)] placeholder:text-[var(--color-text-placeholder)] focus:outline-none",
|
|
20
|
+
// Scrollable list container
|
|
21
|
+
listStyle: "flex-1 overflow-y-auto",
|
|
22
|
+
// Individual item row
|
|
23
|
+
itemStyle: "flex items-center gap-2 cursor-pointer transition-colors duration-150 " +
|
|
24
|
+
"hover:bg-[var(--color-background-secondary)] " +
|
|
25
|
+
"data-[selected=true]:bg-[var(--color-primary-50)]",
|
|
26
|
+
// Disabled item overlay
|
|
27
|
+
itemDisabledStyle: "opacity-50 cursor-not-allowed hover:bg-transparent",
|
|
28
|
+
// Actions column with transfer buttons
|
|
29
|
+
actionsStyle: "flex flex-col items-center justify-center gap-1 px-2",
|
|
30
|
+
// Transfer button
|
|
31
|
+
buttonStyle: "inline-flex items-center justify-center rounded-[var(--form-radius)] border border-[var(--color-border)] " +
|
|
32
|
+
"bg-[var(--color-surface)] text-[var(--color-text-secondary)] " +
|
|
33
|
+
"transition-all duration-150 " +
|
|
34
|
+
"hover:bg-[var(--color-background-secondary)] hover:text-[var(--color-text-primary)] hover:border-[var(--color-border-secondary)] " +
|
|
35
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-1 " +
|
|
36
|
+
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-[var(--color-surface)] disabled:hover:text-[var(--color-text-secondary)] disabled:hover:border-[var(--color-border)]",
|
|
37
|
+
// Size variants
|
|
38
|
+
sizes: {
|
|
39
|
+
sm: {
|
|
40
|
+
panel: "w-56 h-64",
|
|
41
|
+
item: "px-2 py-1 text-xs gap-1.5",
|
|
42
|
+
button: "p-1",
|
|
43
|
+
searchInput: "px-2 py-1.5 text-xs pl-7",
|
|
44
|
+
},
|
|
45
|
+
md: {
|
|
46
|
+
panel: "w-72 h-80",
|
|
47
|
+
item: "px-3 py-1.5 text-sm gap-2",
|
|
48
|
+
button: "p-1.5",
|
|
49
|
+
searchInput: "px-3 py-2 text-sm pl-8",
|
|
50
|
+
},
|
|
51
|
+
lg: {
|
|
52
|
+
panel: "w-80 h-96",
|
|
53
|
+
item: "px-3 py-2 text-base gap-2.5",
|
|
54
|
+
button: "p-2",
|
|
55
|
+
searchInput: "px-3 py-2.5 text-base pl-9",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { transferListTheme };
|