@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
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CronFields, CronPreset } from "./CronInput.types";
|
|
2
|
+
export declare const MONTH_NAMES: readonly ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
3
|
+
export declare const MONTH_SHORT_NAMES: readonly ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
4
|
+
export declare const DAY_NAMES: readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
5
|
+
export declare const DAY_SHORT_NAMES: readonly ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
6
|
+
/**
|
|
7
|
+
* Preset cron schedules for common use cases
|
|
8
|
+
*/
|
|
9
|
+
export declare const CRON_PRESETS: CronPreset[];
|
|
10
|
+
export interface FieldOption {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Generate minute options: every minute (*), specific minutes, and intervals
|
|
16
|
+
*/
|
|
17
|
+
export declare function getMinuteOptions(): FieldOption[];
|
|
18
|
+
/**
|
|
19
|
+
* Generate hour options: every hour (*), specific hours, and intervals
|
|
20
|
+
*/
|
|
21
|
+
export declare function getHourOptions(): FieldOption[];
|
|
22
|
+
/**
|
|
23
|
+
* Generate day-of-month options: every day (*), specific days
|
|
24
|
+
*/
|
|
25
|
+
export declare function getDayOfMonthOptions(): FieldOption[];
|
|
26
|
+
/**
|
|
27
|
+
* Generate month options: every month (*), specific months
|
|
28
|
+
*/
|
|
29
|
+
export declare function getMonthOptions(): FieldOption[];
|
|
30
|
+
/**
|
|
31
|
+
* Generate day-of-week options: every day (*), specific days, ranges
|
|
32
|
+
*/
|
|
33
|
+
export declare function getDayOfWeekOptions(): FieldOption[];
|
|
34
|
+
/**
|
|
35
|
+
* Parse a cron expression string into individual fields
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseCron(expr: string): CronFields;
|
|
38
|
+
/**
|
|
39
|
+
* Convert CronFields back to a cron expression string
|
|
40
|
+
*/
|
|
41
|
+
export declare function fieldsToCron(fields: CronFields): string;
|
|
42
|
+
/**
|
|
43
|
+
* Validate a complete cron expression
|
|
44
|
+
*/
|
|
45
|
+
export declare function validateCron(expr: string): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Convert a cron expression to a human-readable description
|
|
48
|
+
*/
|
|
49
|
+
export declare function cronToDescription(expr: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Calculate the next N run times for a cron expression.
|
|
52
|
+
* Uses a brute-force minute-by-minute scan (simple approach for common cases).
|
|
53
|
+
*
|
|
54
|
+
* @param expr - Cron expression string
|
|
55
|
+
* @param count - Number of next runs to find (default: 3)
|
|
56
|
+
* @param from - Starting date (default: now)
|
|
57
|
+
* @returns Array of Date objects for the next runs
|
|
58
|
+
*/
|
|
59
|
+
export declare function getNextRuns(expr: string, count?: number, from?: Date): Date[];
|
|
60
|
+
/**
|
|
61
|
+
* Format a Date as a human-readable next run string
|
|
62
|
+
*/
|
|
63
|
+
export declare function formatNextRun(date: Date): string;
|
|
64
|
+
/**
|
|
65
|
+
* Check if a field value represents a specific number (not a pattern)
|
|
66
|
+
*/
|
|
67
|
+
export declare function isSpecificValue(value: string): boolean;
|
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Constants
|
|
3
|
+
// ============================================================================
|
|
4
|
+
const MONTH_NAMES = [
|
|
5
|
+
"January",
|
|
6
|
+
"February",
|
|
7
|
+
"March",
|
|
8
|
+
"April",
|
|
9
|
+
"May",
|
|
10
|
+
"June",
|
|
11
|
+
"July",
|
|
12
|
+
"August",
|
|
13
|
+
"September",
|
|
14
|
+
"October",
|
|
15
|
+
"November",
|
|
16
|
+
"December",
|
|
17
|
+
];
|
|
18
|
+
const DAY_NAMES = [
|
|
19
|
+
"Sunday",
|
|
20
|
+
"Monday",
|
|
21
|
+
"Tuesday",
|
|
22
|
+
"Wednesday",
|
|
23
|
+
"Thursday",
|
|
24
|
+
"Friday",
|
|
25
|
+
"Saturday",
|
|
26
|
+
];
|
|
27
|
+
const DAY_SHORT_NAMES = [
|
|
28
|
+
"Sun",
|
|
29
|
+
"Mon",
|
|
30
|
+
"Tue",
|
|
31
|
+
"Wed",
|
|
32
|
+
"Thu",
|
|
33
|
+
"Fri",
|
|
34
|
+
"Sat",
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Preset cron schedules for common use cases
|
|
38
|
+
*/
|
|
39
|
+
const CRON_PRESETS = [
|
|
40
|
+
{
|
|
41
|
+
label: "Every minute",
|
|
42
|
+
value: "* * * * *",
|
|
43
|
+
description: "Runs every minute",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: "Every hour",
|
|
47
|
+
value: "0 * * * *",
|
|
48
|
+
description: "At the start of every hour",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: "Every day at midnight",
|
|
52
|
+
value: "0 0 * * *",
|
|
53
|
+
description: "Once a day at 00:00",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: "Every Monday",
|
|
57
|
+
value: "0 9 * * 1",
|
|
58
|
+
description: "At 09:00 on Monday",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: "Every weekday",
|
|
62
|
+
value: "0 9 * * 1-5",
|
|
63
|
+
description: "At 09:00, Monday through Friday",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: "Monthly",
|
|
67
|
+
value: "0 0 1 * *",
|
|
68
|
+
description: "At midnight on the 1st of every month",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: "Yearly",
|
|
72
|
+
value: "0 0 1 1 *",
|
|
73
|
+
description: "At midnight on January 1st",
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
/**
|
|
77
|
+
* Generate minute options: every minute (*), specific minutes, and intervals
|
|
78
|
+
*/
|
|
79
|
+
function getMinuteOptions() {
|
|
80
|
+
const options = [
|
|
81
|
+
{ value: "*", label: "Every minute" },
|
|
82
|
+
{ value: "*/5", label: "Every 5 minutes" },
|
|
83
|
+
{ value: "*/10", label: "Every 10 minutes" },
|
|
84
|
+
{ value: "*/15", label: "Every 15 minutes" },
|
|
85
|
+
{ value: "*/30", label: "Every 30 minutes" },
|
|
86
|
+
];
|
|
87
|
+
for (let i = 0; i < 60; i++) {
|
|
88
|
+
options.push({
|
|
89
|
+
value: String(i),
|
|
90
|
+
label: String(i).padStart(2, "0"),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return options;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Generate hour options: every hour (*), specific hours, and intervals
|
|
97
|
+
*/
|
|
98
|
+
function getHourOptions() {
|
|
99
|
+
const options = [
|
|
100
|
+
{ value: "*", label: "Every hour" },
|
|
101
|
+
{ value: "*/2", label: "Every 2 hours" },
|
|
102
|
+
{ value: "*/4", label: "Every 4 hours" },
|
|
103
|
+
{ value: "*/6", label: "Every 6 hours" },
|
|
104
|
+
{ value: "*/12", label: "Every 12 hours" },
|
|
105
|
+
];
|
|
106
|
+
for (let i = 0; i < 24; i++) {
|
|
107
|
+
const hour12 = i === 0 ? 12 : i > 12 ? i - 12 : i;
|
|
108
|
+
const ampm = i < 12 ? "AM" : "PM";
|
|
109
|
+
options.push({
|
|
110
|
+
value: String(i),
|
|
111
|
+
label: `${String(i).padStart(2, "0")}:00 (${hour12}${ampm})`,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return options;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Generate day-of-month options: every day (*), specific days
|
|
118
|
+
*/
|
|
119
|
+
function getDayOfMonthOptions() {
|
|
120
|
+
const options = [
|
|
121
|
+
{ value: "*", label: "Every day" },
|
|
122
|
+
];
|
|
123
|
+
for (let i = 1; i <= 31; i++) {
|
|
124
|
+
const suffix = getOrdinalSuffix(i);
|
|
125
|
+
options.push({
|
|
126
|
+
value: String(i),
|
|
127
|
+
label: `${i}${suffix}`,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return options;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Generate month options: every month (*), specific months
|
|
134
|
+
*/
|
|
135
|
+
function getMonthOptions() {
|
|
136
|
+
const options = [
|
|
137
|
+
{ value: "*", label: "Every month" },
|
|
138
|
+
];
|
|
139
|
+
for (let i = 1; i <= 12; i++) {
|
|
140
|
+
options.push({
|
|
141
|
+
value: String(i),
|
|
142
|
+
label: MONTH_NAMES[i - 1],
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return options;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Generate day-of-week options: every day (*), specific days, ranges
|
|
149
|
+
*/
|
|
150
|
+
function getDayOfWeekOptions() {
|
|
151
|
+
const options = [
|
|
152
|
+
{ value: "*", label: "Every day" },
|
|
153
|
+
{ value: "1-5", label: "Weekdays (Mon-Fri)" },
|
|
154
|
+
{ value: "0,6", label: "Weekends (Sat-Sun)" },
|
|
155
|
+
];
|
|
156
|
+
for (let i = 0; i <= 6; i++) {
|
|
157
|
+
options.push({
|
|
158
|
+
value: String(i),
|
|
159
|
+
label: DAY_NAMES[i],
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
return options;
|
|
163
|
+
}
|
|
164
|
+
// ============================================================================
|
|
165
|
+
// Parsing
|
|
166
|
+
// ============================================================================
|
|
167
|
+
/**
|
|
168
|
+
* Parse a cron expression string into individual fields
|
|
169
|
+
*/
|
|
170
|
+
function parseCron(expr) {
|
|
171
|
+
const trimmed = expr.trim();
|
|
172
|
+
const parts = trimmed.split(/\s+/);
|
|
173
|
+
if (parts.length !== 5) {
|
|
174
|
+
return {
|
|
175
|
+
minute: "*",
|
|
176
|
+
hour: "*",
|
|
177
|
+
dayOfMonth: "*",
|
|
178
|
+
month: "*",
|
|
179
|
+
dayOfWeek: "*",
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
minute: parts[0],
|
|
184
|
+
hour: parts[1],
|
|
185
|
+
dayOfMonth: parts[2],
|
|
186
|
+
month: parts[3],
|
|
187
|
+
dayOfWeek: parts[4],
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Convert CronFields back to a cron expression string
|
|
192
|
+
*/
|
|
193
|
+
function fieldsToCron(fields) {
|
|
194
|
+
return `${fields.minute} ${fields.hour} ${fields.dayOfMonth} ${fields.month} ${fields.dayOfWeek}`;
|
|
195
|
+
}
|
|
196
|
+
// ============================================================================
|
|
197
|
+
// Validation
|
|
198
|
+
// ============================================================================
|
|
199
|
+
/**
|
|
200
|
+
* Validate whether a single cron field value is valid
|
|
201
|
+
*/
|
|
202
|
+
function isValidCronField(value, min, max) {
|
|
203
|
+
if (value === "*")
|
|
204
|
+
return true;
|
|
205
|
+
// Step values: */5, 1-30/5
|
|
206
|
+
if (value.includes("/")) {
|
|
207
|
+
const [range, stepStr] = value.split("/");
|
|
208
|
+
const step = parseInt(stepStr, 10);
|
|
209
|
+
if (isNaN(step) || step < 1)
|
|
210
|
+
return false;
|
|
211
|
+
if (range === "*")
|
|
212
|
+
return step <= max;
|
|
213
|
+
return isValidCronField(range, min, max);
|
|
214
|
+
}
|
|
215
|
+
// Ranges: 1-5
|
|
216
|
+
if (value.includes("-")) {
|
|
217
|
+
const [startStr, endStr] = value.split("-");
|
|
218
|
+
const start = parseInt(startStr, 10);
|
|
219
|
+
const end = parseInt(endStr, 10);
|
|
220
|
+
return (!isNaN(start) &&
|
|
221
|
+
!isNaN(end) &&
|
|
222
|
+
start >= min &&
|
|
223
|
+
end <= max &&
|
|
224
|
+
start <= end);
|
|
225
|
+
}
|
|
226
|
+
// Lists: 1,3,5
|
|
227
|
+
if (value.includes(",")) {
|
|
228
|
+
return value.split(",").every((v) => isValidCronField(v.trim(), min, max));
|
|
229
|
+
}
|
|
230
|
+
// Single number
|
|
231
|
+
const num = parseInt(value, 10);
|
|
232
|
+
return !isNaN(num) && num >= min && num <= max;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Validate a complete cron expression
|
|
236
|
+
*/
|
|
237
|
+
function validateCron(expr) {
|
|
238
|
+
const trimmed = expr.trim();
|
|
239
|
+
const parts = trimmed.split(/\s+/);
|
|
240
|
+
if (parts.length !== 5)
|
|
241
|
+
return false;
|
|
242
|
+
const [minute, hour, dayOfMonth, month, dayOfWeek] = parts;
|
|
243
|
+
return (isValidCronField(minute, 0, 59) &&
|
|
244
|
+
isValidCronField(hour, 0, 23) &&
|
|
245
|
+
isValidCronField(dayOfMonth, 1, 31) &&
|
|
246
|
+
isValidCronField(month, 1, 12) &&
|
|
247
|
+
isValidCronField(dayOfWeek, 0, 6));
|
|
248
|
+
}
|
|
249
|
+
// ============================================================================
|
|
250
|
+
// Human-readable description
|
|
251
|
+
// ============================================================================
|
|
252
|
+
/**
|
|
253
|
+
* Get ordinal suffix for a number (1st, 2nd, 3rd, etc.)
|
|
254
|
+
*/
|
|
255
|
+
function getOrdinalSuffix(n) {
|
|
256
|
+
const s = ["th", "st", "nd", "rd"];
|
|
257
|
+
const v = n % 100;
|
|
258
|
+
return s[(v - 20) % 10] || s[v] || s[0];
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Describe a minute field
|
|
262
|
+
*/
|
|
263
|
+
function describeMinute(minute) {
|
|
264
|
+
if (minute === "*")
|
|
265
|
+
return "";
|
|
266
|
+
if (minute.startsWith("*/"))
|
|
267
|
+
return `every ${minute.slice(2)} minutes`;
|
|
268
|
+
return `at minute ${minute}`;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Describe an hour field
|
|
272
|
+
*/
|
|
273
|
+
function describeHour(hour) {
|
|
274
|
+
if (hour === "*")
|
|
275
|
+
return "";
|
|
276
|
+
if (hour.startsWith("*/"))
|
|
277
|
+
return `every ${hour.slice(2)} hours`;
|
|
278
|
+
const h = parseInt(hour, 10);
|
|
279
|
+
if (isNaN(h))
|
|
280
|
+
return "";
|
|
281
|
+
const hour12 = h === 0 ? 12 : h > 12 ? h - 12 : h;
|
|
282
|
+
const ampm = h < 12 ? "AM" : "PM";
|
|
283
|
+
return `${hour12}:00 ${ampm}`;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Describe the time portion (minute + hour)
|
|
287
|
+
*/
|
|
288
|
+
function describeTime(minute, hour) {
|
|
289
|
+
if (minute === "*" && hour === "*")
|
|
290
|
+
return "every minute";
|
|
291
|
+
if (minute === "*" && hour !== "*") {
|
|
292
|
+
if (hour.startsWith("*/"))
|
|
293
|
+
return `every ${hour.slice(2)} hours`;
|
|
294
|
+
return `every minute during ${describeHour(hour)}`;
|
|
295
|
+
}
|
|
296
|
+
if (minute !== "*" && hour === "*") {
|
|
297
|
+
if (minute.startsWith("*/"))
|
|
298
|
+
return `${describeMinute(minute)}`;
|
|
299
|
+
return `at minute ${minute} of every hour`;
|
|
300
|
+
}
|
|
301
|
+
// Both specific
|
|
302
|
+
const h = parseInt(hour, 10);
|
|
303
|
+
const m = parseInt(minute, 10);
|
|
304
|
+
if (!isNaN(h) && !isNaN(m)) {
|
|
305
|
+
const hour12 = h === 0 ? 12 : h > 12 ? h - 12 : h;
|
|
306
|
+
const ampm = h < 12 ? "AM" : "PM";
|
|
307
|
+
return `at ${String(hour12).padStart(2, "0")}:${String(m).padStart(2, "0")} ${ampm}`;
|
|
308
|
+
}
|
|
309
|
+
// Fallback for intervals
|
|
310
|
+
const parts = [];
|
|
311
|
+
if (minute.startsWith("*/"))
|
|
312
|
+
parts.push(describeMinute(minute));
|
|
313
|
+
if (hour.startsWith("*/"))
|
|
314
|
+
parts.push(describeHour(hour));
|
|
315
|
+
if (parts.length > 0)
|
|
316
|
+
return parts.join(", ");
|
|
317
|
+
return `at ${hour}:${minute}`;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Convert a cron expression to a human-readable description
|
|
321
|
+
*/
|
|
322
|
+
function cronToDescription(expr) {
|
|
323
|
+
if (!validateCron(expr))
|
|
324
|
+
return "Invalid cron expression";
|
|
325
|
+
const { minute, hour, dayOfMonth, month, dayOfWeek } = parseCron(expr);
|
|
326
|
+
const timePart = describeTime(minute, hour);
|
|
327
|
+
const parts = [];
|
|
328
|
+
// Time
|
|
329
|
+
if (timePart) {
|
|
330
|
+
// Capitalize first letter
|
|
331
|
+
parts.push(timePart.charAt(0).toUpperCase() + timePart.slice(1));
|
|
332
|
+
}
|
|
333
|
+
// Day of week
|
|
334
|
+
if (dayOfWeek !== "*") {
|
|
335
|
+
if (dayOfWeek === "1-5") {
|
|
336
|
+
parts.push("on weekdays");
|
|
337
|
+
}
|
|
338
|
+
else if (dayOfWeek === "0,6") {
|
|
339
|
+
parts.push("on weekends");
|
|
340
|
+
}
|
|
341
|
+
else if (dayOfWeek.includes(",")) {
|
|
342
|
+
const days = dayOfWeek
|
|
343
|
+
.split(",")
|
|
344
|
+
.map((d) => DAY_NAMES[parseInt(d, 10)] || d);
|
|
345
|
+
parts.push(`on ${days.join(" and ")}`);
|
|
346
|
+
}
|
|
347
|
+
else if (dayOfWeek.includes("-")) {
|
|
348
|
+
const [start, end] = dayOfWeek.split("-").map((d) => parseInt(d, 10));
|
|
349
|
+
parts.push(`on ${DAY_SHORT_NAMES[start]} through ${DAY_SHORT_NAMES[end]}`);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
const dayIdx = parseInt(dayOfWeek, 10);
|
|
353
|
+
if (!isNaN(dayIdx) && dayIdx >= 0 && dayIdx <= 6) {
|
|
354
|
+
parts.push(`on ${DAY_NAMES[dayIdx]}`);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// Day of month
|
|
359
|
+
if (dayOfMonth !== "*") {
|
|
360
|
+
const day = parseInt(dayOfMonth, 10);
|
|
361
|
+
if (!isNaN(day)) {
|
|
362
|
+
parts.push(`on the ${day}${getOrdinalSuffix(day)}`);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
// Month
|
|
366
|
+
if (month !== "*") {
|
|
367
|
+
const monthIdx = parseInt(month, 10);
|
|
368
|
+
if (!isNaN(monthIdx) && monthIdx >= 1 && monthIdx <= 12) {
|
|
369
|
+
parts.push(`in ${MONTH_NAMES[monthIdx - 1]}`);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (parts.length === 0)
|
|
373
|
+
return "Every minute";
|
|
374
|
+
return parts.join(" ");
|
|
375
|
+
}
|
|
376
|
+
// ============================================================================
|
|
377
|
+
// Next run calculation
|
|
378
|
+
// ============================================================================
|
|
379
|
+
/**
|
|
380
|
+
* Expand a cron field value into an array of matching numbers.
|
|
381
|
+
* Handles *, specific values, ranges, lists, and step values.
|
|
382
|
+
*/
|
|
383
|
+
function expandField(value, min, max) {
|
|
384
|
+
if (value === "*") {
|
|
385
|
+
return Array.from({ length: max - min + 1 }, (_, i) => min + i);
|
|
386
|
+
}
|
|
387
|
+
// Step values: */5 or 1-30/5
|
|
388
|
+
if (value.includes("/")) {
|
|
389
|
+
const [range, stepStr] = value.split("/");
|
|
390
|
+
const step = parseInt(stepStr, 10);
|
|
391
|
+
const result = [];
|
|
392
|
+
let rangeMin = min;
|
|
393
|
+
let rangeMax = max;
|
|
394
|
+
if (range !== "*") {
|
|
395
|
+
if (range.includes("-")) {
|
|
396
|
+
const [rMin, rMax] = range.split("-").map(Number);
|
|
397
|
+
rangeMin = rMin;
|
|
398
|
+
rangeMax = rMax;
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
rangeMin = parseInt(range, 10);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
for (let i = rangeMin; i <= rangeMax; i += step) {
|
|
405
|
+
result.push(i);
|
|
406
|
+
}
|
|
407
|
+
return result;
|
|
408
|
+
}
|
|
409
|
+
// Lists: 1,3,5
|
|
410
|
+
if (value.includes(",")) {
|
|
411
|
+
return value.split(",").map((v) => parseInt(v.trim(), 10));
|
|
412
|
+
}
|
|
413
|
+
// Ranges: 1-5
|
|
414
|
+
if (value.includes("-")) {
|
|
415
|
+
const [start, end] = value.split("-").map(Number);
|
|
416
|
+
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
417
|
+
}
|
|
418
|
+
// Single number
|
|
419
|
+
return [parseInt(value, 10)];
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Check if a given Date matches a cron expression
|
|
423
|
+
*/
|
|
424
|
+
function matchesCron(date, fields) {
|
|
425
|
+
const minutes = expandField(fields.minute, 0, 59);
|
|
426
|
+
const hours = expandField(fields.hour, 0, 23);
|
|
427
|
+
const daysOfMonth = expandField(fields.dayOfMonth, 1, 31);
|
|
428
|
+
const months = expandField(fields.month, 1, 12);
|
|
429
|
+
const daysOfWeek = expandField(fields.dayOfWeek, 0, 6);
|
|
430
|
+
return (minutes.includes(date.getMinutes()) &&
|
|
431
|
+
hours.includes(date.getHours()) &&
|
|
432
|
+
daysOfMonth.includes(date.getDate()) &&
|
|
433
|
+
months.includes(date.getMonth() + 1) &&
|
|
434
|
+
daysOfWeek.includes(date.getDay()));
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Calculate the next N run times for a cron expression.
|
|
438
|
+
* Uses a brute-force minute-by-minute scan (simple approach for common cases).
|
|
439
|
+
*
|
|
440
|
+
* @param expr - Cron expression string
|
|
441
|
+
* @param count - Number of next runs to find (default: 3)
|
|
442
|
+
* @param from - Starting date (default: now)
|
|
443
|
+
* @returns Array of Date objects for the next runs
|
|
444
|
+
*/
|
|
445
|
+
function getNextRuns(expr, count = 3, from) {
|
|
446
|
+
if (!validateCron(expr))
|
|
447
|
+
return [];
|
|
448
|
+
const fields = parseCron(expr);
|
|
449
|
+
const results = [];
|
|
450
|
+
// Start from the next minute
|
|
451
|
+
const start = from ? new Date(from) : new Date();
|
|
452
|
+
start.setSeconds(0, 0);
|
|
453
|
+
start.setMinutes(start.getMinutes() + 1);
|
|
454
|
+
const current = new Date(start);
|
|
455
|
+
// Scan up to 2 years ahead, max 525960 iterations (minutes in a year * 2)
|
|
456
|
+
// to avoid infinite loops
|
|
457
|
+
const maxIterations = 525960 * 2;
|
|
458
|
+
let iterations = 0;
|
|
459
|
+
while (results.length < count && iterations < maxIterations) {
|
|
460
|
+
if (matchesCron(current, fields)) {
|
|
461
|
+
results.push(new Date(current));
|
|
462
|
+
}
|
|
463
|
+
current.setMinutes(current.getMinutes() + 1);
|
|
464
|
+
iterations++;
|
|
465
|
+
}
|
|
466
|
+
return results;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Format a Date as a human-readable next run string
|
|
470
|
+
*/
|
|
471
|
+
function formatNextRun(date) {
|
|
472
|
+
const now = new Date();
|
|
473
|
+
const diffMs = date.getTime() - now.getTime();
|
|
474
|
+
const diffMinutes = Math.round(diffMs / 60000);
|
|
475
|
+
const diffHours = Math.round(diffMs / 3600000);
|
|
476
|
+
const diffDays = Math.round(diffMs / 86400000);
|
|
477
|
+
const timeStr = date.toLocaleTimeString(undefined, {
|
|
478
|
+
hour: "2-digit",
|
|
479
|
+
minute: "2-digit",
|
|
480
|
+
});
|
|
481
|
+
const dateStr = date.toLocaleDateString(undefined, {
|
|
482
|
+
weekday: "short",
|
|
483
|
+
month: "short",
|
|
484
|
+
day: "numeric",
|
|
485
|
+
});
|
|
486
|
+
let relative;
|
|
487
|
+
if (diffMinutes < 1) {
|
|
488
|
+
relative = "in less than a minute";
|
|
489
|
+
}
|
|
490
|
+
else if (diffMinutes < 60) {
|
|
491
|
+
relative = `in ${diffMinutes} minute${diffMinutes !== 1 ? "s" : ""}`;
|
|
492
|
+
}
|
|
493
|
+
else if (diffHours < 24) {
|
|
494
|
+
relative = `in ${diffHours} hour${diffHours !== 1 ? "s" : ""}`;
|
|
495
|
+
}
|
|
496
|
+
else if (diffDays < 7) {
|
|
497
|
+
relative = `in ${diffDays} day${diffDays !== 1 ? "s" : ""}`;
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
relative = `on ${dateStr}`;
|
|
501
|
+
}
|
|
502
|
+
return `${dateStr} at ${timeStr} (${relative})`;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export { CRON_PRESETS, DAY_NAMES, DAY_SHORT_NAMES, MONTH_NAMES, cronToDescription, fieldsToCron, formatNextRun, getDayOfMonthOptions, getDayOfWeekOptions, getHourOptions, getMinuteOptions, getMonthOptions, getNextRuns, parseCron, validateCron };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CronInput } from "./CronInput";
|
|
2
|
+
export type { CronInputProps, CronInputSize, CronInputMode, CronInputTheme, CronInputThemeOverrides, CronFields, CronPreset, } from "./CronInput.types";
|
|
3
|
+
export { cronInputTheme } from "./CronInput.theme";
|
|
4
|
+
export { parseCron, fieldsToCron, validateCron, cronToDescription, getNextRuns, formatNextRun, CRON_PRESETS, } from "./CronInput.utils";
|
|
@@ -29,10 +29,10 @@ const datePickerTheme = {
|
|
|
29
29
|
// Dropdown content - with dark mode support
|
|
30
30
|
contentStyle: "min-w-fit max-w-none bg-white border border-[var(--color-border)] rounded-[var(--popover-radius)] shadow-real-xl p-0 overflow-hidden z-[1000] fixed " +
|
|
31
31
|
"dark:bg-[var(--color-neutral-900)] dark:border-[var(--color-neutral-700)]",
|
|
32
|
-
contentWithPresetsStyle: "flex w-fit max-w-none bg-white border border-[var(--color-border)] rounded-[var(--popover-radius)] shadow-lg p-0 overflow-hidden z-[1000] fixed " +
|
|
32
|
+
contentWithPresetsStyle: "flex flex-col sm:flex-row w-fit max-w-[calc(100vw-2rem)] sm:max-w-none bg-white border border-[var(--color-border)] rounded-[var(--popover-radius)] shadow-lg p-0 overflow-hidden z-[1000] fixed " +
|
|
33
33
|
"dark:bg-[var(--color-neutral-900)] dark:border-[var(--color-neutral-700)]",
|
|
34
34
|
// Presets sidebar - with dark mode support
|
|
35
|
-
presetsContainerStyle: "flex flex-col gap-1 p-3 border-r border-[var(--color-border)] bg-[var(--color-neutral-50)] min-w-[180px] " +
|
|
35
|
+
presetsContainerStyle: "flex flex-col gap-1 p-3 border-b sm:border-b-0 sm:border-r border-[var(--color-border)] bg-[var(--color-neutral-50)] sm:min-w-[180px] " +
|
|
36
36
|
"dark:bg-[var(--color-neutral-800)] dark:border-[var(--color-neutral-700)]",
|
|
37
37
|
// Preset button - with dark mode support
|
|
38
38
|
presetButtonStyle: "w-full text-left px-3 py-2 text-sm rounded-[calc(var(--radius-base)*0.75)] transition-colors cursor-pointer " +
|
|
@@ -26,4 +26,4 @@ import { InputCounterProps } from "./InputCounter.types";
|
|
|
26
26
|
* );
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
export declare const InputCounter: React.ForwardRefExoticComponent<
|
|
29
|
+
export declare const InputCounter: React.ForwardRefExoticComponent<InputCounterProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Transition } from 'motion/react';
|
|
2
3
|
import { ButtonProps } from '../../core/Button/Button.types';
|
|
3
4
|
/**
|
|
4
5
|
* InputCounter component props
|
|
@@ -13,7 +14,7 @@ import { ButtonProps } from '../../core/Button/Button.types';
|
|
|
13
14
|
* @property {object} theme - Theme overrides for styling
|
|
14
15
|
* @property {object} transition - Custom Framer Motion transition
|
|
15
16
|
*/
|
|
16
|
-
export interface InputCounterProps extends Omit<
|
|
17
|
+
export interface InputCounterProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
17
18
|
/** Current counter value (controlled) */
|
|
18
19
|
value: number;
|
|
19
20
|
/** Callback when value changes */
|
|
@@ -12,7 +12,7 @@ const inputOTPTheme = {
|
|
|
12
12
|
// Individual input field styles with design tokens
|
|
13
13
|
inputStyle: 'text-center text-lg text-[var(--color-text-primary)] h-full',
|
|
14
14
|
// Input group wrapper for grouped inputs (overrides default Input styling)
|
|
15
|
-
inputGroupStyle: 'w-12 min-w-12 h-12 min-h-12',
|
|
15
|
+
inputGroupStyle: 'w-10 min-w-10 h-10 min-h-10 sm:w-12 sm:min-w-12 sm:h-12 sm:min-h-12',
|
|
16
16
|
// Separator between input groups
|
|
17
17
|
separatorStyle: 'text-[var(--color-text-muted)] font-medium select-none',
|
|
18
18
|
// Helper text with state handling (reuses form base)
|