@flikk/ui 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ai/ApprovalCard/ApprovalCard.js +2 -2
- package/dist/components/ai/ApprovalCard/ApprovalCard.types.d.ts +2 -2
- package/dist/components/ai/PromptInput/PromptInput.js +173 -13
- package/dist/components/ai/PromptInput/PromptInput.theme.js +1 -0
- package/dist/components/ai/PromptInput/PromptInput.types.d.ts +20 -0
- package/dist/components/core/Accordion/Accordion.theme.js +2 -2
- package/dist/components/core/Alert/Alert.js +2 -2
- package/dist/components/core/Alert/Alert.types.d.ts +2 -2
- package/dist/components/core/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/AlertDialog/AlertDialog.types.d.ts +2 -2
- package/dist/components/core/Badge/Badge.js +11 -9
- package/dist/components/core/Badge/Badge.theme.js +13 -14
- package/dist/components/core/Badge/Badge.types.d.ts +6 -1
- package/dist/components/core/Button/Button.theme.js +8 -9
- package/dist/components/core/Calendar/Calendar.theme.js +1 -1
- package/dist/components/core/Card/Card.d.ts +2 -2
- package/dist/components/core/Card/Card.js +6 -7
- package/dist/components/core/Card/Card.theme.js +4 -4
- package/dist/components/core/Card/Card.types.d.ts +5 -20
- package/dist/components/core/Card/CardSubtitle.d.ts +3 -0
- package/dist/components/core/Card/CardSubtitle.js +11 -0
- package/dist/components/core/Card/index.d.ts +2 -2
- package/dist/components/core/CommandPalette/CommandItem.d.ts +1 -1
- package/dist/components/core/CommandPalette/CommandItem.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -2
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +1 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +2 -2
- package/dist/components/core/Drawer/Drawer.d.ts +13 -1
- package/dist/components/core/Drawer/Drawer.js +23 -10
- package/dist/components/core/Drawer/Drawer.theme.js +1 -1
- package/dist/components/core/Drawer/Drawer.types.d.ts +21 -4
- package/dist/components/core/Drawer/DrawerHeader.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerHeader.js +14 -0
- package/dist/components/core/Drawer/DrawerSubtitle.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerSubtitle.js +11 -0
- package/dist/components/core/Drawer/DrawerTitle.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerTitle.js +11 -0
- package/dist/components/core/Drawer/index.d.ts +1 -1
- package/dist/components/core/Dropdown/Dropdown.types.d.ts +4 -4
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Empty/Empty.js +2 -2
- package/dist/components/core/Empty/Empty.theme.d.ts +1 -1
- package/dist/components/core/Empty/Empty.theme.js +3 -3
- package/dist/components/core/Empty/Empty.types.d.ts +2 -2
- package/dist/components/core/MenuItem/MenuItem.js +2 -2
- package/dist/components/core/MenuItem/MenuItem.theme.d.ts +1 -2
- package/dist/components/core/MenuItem/MenuItem.theme.js +7 -9
- package/dist/components/core/MenuItem/MenuItem.types.d.ts +1 -1
- package/dist/components/core/Message/Message.d.ts +3 -2
- package/dist/components/core/Message/Message.js +30 -24
- package/dist/components/core/Message/Message.theme.d.ts +1 -1
- package/dist/components/core/Message/Message.theme.js +22 -24
- package/dist/components/core/Message/Message.types.d.ts +0 -7
- package/dist/components/core/Message/MessageList.animations.d.ts +6 -0
- package/dist/components/core/Message/MessageList.animations.js +32 -0
- package/dist/components/core/Message/MessageList.d.ts +5 -0
- package/dist/components/core/Message/MessageList.js +78 -0
- package/dist/components/core/Message/MessageList.theme.d.ts +2 -0
- package/dist/components/core/Message/MessageList.theme.js +6 -0
- package/dist/components/core/Message/MessageList.types.d.ts +32 -0
- package/dist/components/core/Message/index.d.ts +2 -0
- package/dist/components/core/Modal/Modal.d.ts +2 -2
- package/dist/components/core/Modal/Modal.js +5 -5
- package/dist/components/core/Modal/Modal.theme.js +5 -5
- package/dist/components/core/Modal/Modal.types.d.ts +4 -4
- package/dist/components/core/Modal/ModalSubtitle.d.ts +5 -0
- package/dist/components/core/Modal/ModalSubtitle.js +11 -0
- package/dist/components/core/ModalStack/ModalStack.animations.js +3 -3
- package/dist/components/core/ModalStack/ModalStackModal.js +3 -3
- package/dist/components/core/PageHeading/PageHeading.d.ts +8 -0
- package/dist/components/core/PageHeading/PageHeading.js +28 -0
- package/dist/components/core/PageHeading/PageHeading.theme.d.ts +2 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +11 -0
- package/dist/components/core/PageHeading/PageHeading.types.d.ts +55 -0
- package/dist/components/core/PageHeading/PageHeadingActions.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingActions.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingBackButton.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +12 -0
- package/dist/components/core/PageHeading/PageHeadingIcon.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingIcon.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingSubtitle.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingSubtitle.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingTitle.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingTitle.js +11 -0
- package/dist/components/core/PageHeading/index.d.ts +2 -0
- package/dist/components/core/Popover/Popover.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +3 -3
- package/dist/components/core/Sidebar/Sidebar.js +1 -0
- package/dist/components/core/SocialIcon/SocialIcon.d.ts +3 -0
- package/dist/components/core/SocialIcon/SocialIcon.js +30 -0
- package/dist/components/core/SocialIcon/SocialIcon.theme.d.ts +2 -0
- package/dist/components/core/SocialIcon/SocialIcon.theme.js +12 -0
- package/dist/components/core/SocialIcon/SocialIcon.types.d.ts +18 -0
- package/dist/components/core/SocialIcon/index.d.ts +2 -0
- package/dist/components/core/SocialIcon/platforms.d.ts +17 -0
- package/dist/components/core/SocialIcon/platforms.js +234 -0
- package/dist/components/core/Toast/Toast.js +4 -4
- package/dist/components/core/Toast/Toast.theme.js +1 -1
- package/dist/components/core/Toast/Toast.types.d.ts +9 -9
- package/dist/components/core/Toast/useToast.js +6 -6
- package/dist/components/core/index.d.ts +2 -7
- package/dist/components/core/index.js +9 -19
- package/dist/components/{core → data-display}/DescriptionList/DescriptionList.theme.js +1 -1
- package/dist/components/{core → data-display}/Feed/Feed.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.animations.d.ts +4 -0
- package/dist/components/data-display/GanttChart/GanttChart.animations.js +21 -0
- package/dist/components/data-display/GanttChart/GanttChart.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttChart.js +170 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +23 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.d.ts +162 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.js +9 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.d.ts +80 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.js +274 -0
- package/dist/components/data-display/GanttChart/GanttChartPanel.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +82 -0
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.js +35 -0
- package/dist/components/data-display/GanttChart/GanttGroupBar.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttGroupBar.js +26 -0
- package/dist/components/data-display/GanttChart/GanttMilestone.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttMilestone.js +44 -0
- package/dist/components/data-display/GanttChart/GanttProgressCircle.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttProgressCircle.js +11 -0
- package/dist/components/data-display/GanttChart/GanttSplitter.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttSplitter.js +39 -0
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.d.ts +7 -0
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +23 -0
- package/dist/components/data-display/GanttChart/GanttTableHeader.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttTableHeader.js +13 -0
- package/dist/components/data-display/GanttChart/GanttTablePanel.d.ts +6 -0
- package/dist/components/data-display/GanttChart/GanttTablePanel.js +20 -0
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.js +30 -0
- package/dist/components/data-display/GanttChart/GanttTaskBar.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +206 -0
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +17 -0
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.d.ts +7 -0
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.js +33 -0
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +43 -0
- package/dist/components/data-display/GanttChart/GanttToolbar.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttToolbar.js +28 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDates.d.ts +12 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDates.js +25 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.d.ts +25 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.js +144 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttLayout.d.ts +2 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttLayout.js +33 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.d.ts +6 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.js +32 -0
- package/dist/components/data-display/GanttChart/index.d.ts +3 -0
- package/dist/components/{core → data-display}/KPI/KPI.js +10 -8
- package/dist/components/{core → data-display}/KPI/KPI.theme.js +2 -1
- package/dist/components/{core → data-display}/KPI/KPI.types.d.ts +5 -5
- package/dist/components/{core → data-display}/KPI/index.d.ts +1 -0
- package/dist/components/{core → data-display}/Metric/Metric.js +4 -7
- package/dist/components/{core → data-display}/Metric/Metric.theme.js +9 -9
- package/dist/components/{core → data-display}/Metric/Metric.types.d.ts +6 -6
- package/dist/components/{core → data-display}/Table/Table.theme.js +2 -2
- package/dist/components/{core → data-display}/Table/TableActions.js +8 -8
- package/dist/components/{core → data-display}/Table/TableColumnManager.js +4 -4
- package/dist/components/{core → data-display}/Table/TableFilter.js +3 -3
- package/dist/components/data-display/Table/TablePagination.js +25 -0
- package/dist/components/{core → data-display}/Table/TableRow.js +1 -1
- package/dist/components/{core → data-display}/Table/TableSelectionHeader.js +1 -1
- package/dist/components/data-display/index.d.ts +7 -0
- package/dist/components/data-display/index.js +20 -0
- package/dist/components/effects/Aurora/Aurora.d.ts +24 -0
- package/dist/components/effects/Aurora/Aurora.js +119 -0
- package/dist/components/effects/Aurora/Aurora.types.d.ts +15 -0
- package/dist/components/effects/Aurora/index.d.ts +2 -0
- package/dist/components/effects/DotPattern/DotPattern.d.ts +18 -0
- package/dist/components/effects/DotPattern/DotPattern.js +65 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +47 -0
- package/dist/components/effects/DotPattern/index.d.ts +2 -0
- package/dist/components/effects/GridPattern/GridPattern.d.ts +18 -0
- package/dist/components/effects/GridPattern/GridPattern.js +64 -0
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +47 -0
- package/dist/components/effects/GridPattern/index.d.ts +2 -0
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +30 -0
- package/dist/components/effects/MagneticElement/MagneticElement.js +110 -0
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +44 -0
- package/dist/components/effects/MagneticElement/index.d.ts +2 -0
- package/dist/components/effects/MorphingText/MorphingText.d.ts +17 -0
- package/dist/components/effects/MorphingText/MorphingText.js +91 -0
- package/dist/components/effects/MorphingText/MorphingText.types.d.ts +18 -0
- package/dist/components/effects/MorphingText/index.d.ts +2 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.d.ts +28 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.js +61 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.types.d.ts +35 -0
- package/dist/components/effects/NoiseOverlay/index.d.ts +2 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.d.ts +26 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.js +71 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.types.d.ts +11 -0
- package/dist/components/effects/ParallaxSection/index.d.ts +2 -0
- package/dist/components/effects/Particles/Particles.d.ts +22 -0
- package/dist/components/effects/Particles/Particles.js +33 -0
- package/dist/components/effects/Particles/Particles.scene.d.ts +3 -0
- package/dist/components/effects/Particles/Particles.scene.js +284 -0
- package/dist/components/effects/Particles/Particles.types.d.ts +65 -0
- package/dist/components/effects/Particles/index.d.ts +2 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.d.ts +3 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.js +75 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.d.ts +7 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.js +12 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.types.d.ts +47 -0
- package/dist/components/effects/ProgressiveBlur/index.d.ts +2 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.d.ts +29 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.js +121 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.types.d.ts +25 -0
- package/dist/components/effects/ScrollReveal/index.d.ts +2 -0
- package/dist/components/effects/Spotlight/Spotlight.d.ts +36 -0
- package/dist/components/effects/Spotlight/Spotlight.js +112 -0
- package/dist/components/effects/Spotlight/Spotlight.types.d.ts +29 -0
- package/dist/components/effects/Spotlight/index.d.ts +2 -0
- package/dist/components/effects/StickyScroll/StickyScroll.d.ts +30 -0
- package/dist/components/effects/StickyScroll/StickyScroll.js +128 -0
- package/dist/components/effects/StickyScroll/StickyScroll.types.d.ts +19 -0
- package/dist/components/effects/StickyScroll/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +24 -0
- package/dist/components/effects/index.js +12 -0
- package/dist/components/forms/Checkbox/Checkbox.js +3 -3
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -5
- package/dist/components/forms/ColorPicker/ColorPicker.theme.js +2 -2
- package/dist/components/forms/CronInput/CronInput.d.ts +3 -0
- package/dist/components/forms/CronInput/CronInput.js +107 -0
- package/dist/components/forms/CronInput/CronInput.theme.d.ts +6 -0
- package/dist/components/forms/CronInput/CronInput.theme.js +84 -0
- package/dist/components/forms/CronInput/CronInput.types.d.ts +98 -0
- package/dist/components/forms/CronInput/CronInput.utils.d.ts +67 -0
- package/dist/components/forms/CronInput/CronInput.utils.js +505 -0
- package/dist/components/forms/CronInput/index.d.ts +4 -0
- package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
- package/dist/components/forms/FileUpload/FileUpload.js +78 -0
- package/dist/components/forms/InputOTP/InputOTP.theme.js +1 -1
- package/dist/components/forms/Mention/Mention.d.ts +3 -0
- package/dist/components/forms/Mention/Mention.js +410 -0
- package/dist/components/forms/Mention/Mention.theme.d.ts +6 -0
- package/dist/components/forms/Mention/Mention.theme.js +56 -0
- package/dist/components/forms/Mention/Mention.types.d.ts +111 -0
- package/dist/components/forms/Mention/index.d.ts +3 -0
- package/dist/components/forms/Radio/Radio.js +8 -12
- package/dist/components/forms/Radio/Radio.theme.js +28 -5
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +2 -0
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +9 -0
- package/dist/components/forms/SelectableCard/SelectableCard.d.ts +5 -0
- package/dist/components/forms/SelectableCard/SelectableCard.js +58 -0
- package/dist/components/forms/SelectableCard/SelectableCard.theme.d.ts +2 -0
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +38 -0
- package/dist/components/forms/SelectableCard/SelectableCard.types.d.ts +34 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.d.ts +3 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.js +12 -0
- package/dist/components/forms/SelectableCard/SelectableCardGroup.d.ts +3 -0
- package/dist/components/forms/SelectableCard/SelectableCardGroup.js +37 -0
- package/dist/components/forms/SelectableCard/index.d.ts +3 -0
- package/dist/components/forms/TimePicker/TimePickerContent.js +78 -1
- package/dist/components/forms/TransferList/TransferList.animations.d.ts +10 -0
- package/dist/components/forms/TransferList/TransferList.animations.js +32 -0
- package/dist/components/forms/TransferList/TransferList.d.ts +28 -0
- package/dist/components/forms/TransferList/TransferList.js +199 -0
- package/dist/components/forms/TransferList/TransferList.theme.d.ts +6 -0
- package/dist/components/forms/TransferList/TransferList.theme.js +60 -0
- package/dist/components/forms/TransferList/TransferList.types.d.ts +101 -0
- package/dist/components/forms/TransferList/index.d.ts +3 -0
- package/dist/components/forms/index.d.ts +13 -0
- package/dist/components/forms/index.js +87 -0
- package/dist/components/layout/FormLayout/FormLayout.d.ts +8 -0
- package/dist/components/layout/FormLayout/FormLayout.js +22 -0
- package/dist/components/layout/FormLayout/FormLayout.theme.d.ts +2 -0
- package/dist/components/layout/FormLayout/FormLayout.theme.js +16 -0
- package/dist/components/layout/FormLayout/FormLayout.types.d.ts +61 -0
- package/dist/components/layout/FormLayout/FormLayoutBody.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutBody.js +91 -0
- package/dist/components/layout/FormLayout/FormLayoutFooter.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutFooter.js +12 -0
- package/dist/components/layout/FormLayout/FormLayoutHeader.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutHeader.js +12 -0
- package/dist/components/layout/FormLayout/FormLayoutSection.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutSection.js +12 -0
- package/dist/components/layout/FormLayout/index.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayout.d.ts +7 -0
- package/dist/components/layout/PageLayout/PageLayout.js +33 -0
- package/dist/components/layout/PageLayout/PageLayout.theme.d.ts +2 -0
- package/dist/components/layout/PageLayout/PageLayout.theme.js +10 -0
- package/dist/components/layout/PageLayout/PageLayout.types.d.ts +39 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.js +12 -0
- package/dist/components/layout/PageLayout/PageLayoutHeader.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutHeader.js +12 -0
- package/dist/components/layout/PageLayout/PageLayoutSidebar.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutSidebar.js +12 -0
- package/dist/components/layout/PageLayout/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +208 -167
- package/dist/styles.css +1 -1
- package/dist/utils/dateUtils.d.ts +30 -0
- package/dist/utils/dateUtils.js +58 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +9 -2
- package/dist/components/core/Card/CardDescription.d.ts +0 -3
- package/dist/components/core/Card/CardDescription.js +0 -11
- package/dist/components/core/Modal/ModalDescription.d.ts +0 -5
- package/dist/components/core/Modal/ModalDescription.js +0 -11
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.d.ts +0 -34
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.js +0 -218
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.theme.d.ts +0 -9
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.types.d.ts +0 -48
- package/dist/components/core/ProgressiveBlur/index.d.ts +0 -2
- package/dist/components/core/Table/TablePagination.js +0 -25
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.js +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.theme.js +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/KPI/KPI.d.ts +0 -0
- /package/dist/components/{core → data-display}/KPI/KPI.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/Metric.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/Metric.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.animations.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.animations.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.filterUtils.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.filterUtils.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.utils.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.utils.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableActions.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableActionsMenu.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableActionsMenu.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableBody.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableBody.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableCell.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableCell.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableColumnManager.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableDeclarative.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableDeclarative.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableFilter.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableHeader.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableHeader.js +0 -0
- /package/dist/components/{core → data-display}/Table/TablePagination.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableRow.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableSelectionHeader.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.js +0 -0
- /package/dist/components/{core → data-display}/Table/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/index.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.animations.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.animations.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.theme.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineContent.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineContent.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineItem.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineItem.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineMarker.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineMarker.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/index.d.ts +0 -0
|
@@ -3,7 +3,7 @@ import React__default from 'react';
|
|
|
3
3
|
import { emptyTheme } from './Empty.theme.js';
|
|
4
4
|
import { cn } from '../../../utils/cn.js';
|
|
5
5
|
|
|
6
|
-
const Empty = React__default.forwardRef(({ title,
|
|
6
|
+
const Empty = React__default.forwardRef(({ title, subtitle, image, imageAlt, icon, action, className, children, ...props }, ref) => {
|
|
7
7
|
// Fixed image and icon dimensions
|
|
8
8
|
const imageDimensions = "size-32";
|
|
9
9
|
const iconDimensions = "size-16";
|
|
@@ -11,7 +11,7 @@ const Empty = React__default.forwardRef(({ title, description, image, imageAlt,
|
|
|
11
11
|
if (children) {
|
|
12
12
|
return (jsx("div", { ref: ref, className: cn(emptyTheme.baseStyle, className), role: "region", "aria-label": "Empty state", ...props, children: children }));
|
|
13
13
|
}
|
|
14
|
-
return (jsxs("div", { ref: ref, className: cn(emptyTheme.baseStyle, className), role: "region", "aria-label": "Empty state", ...props, children: [image ? (jsx("div", { className: "flex-shrink-0 mb-6", children: jsx("img", { src: image, alt: imageAlt || "Empty state illustration", className: cn("mx-auto object-cover", imageDimensions), loading: "lazy" }) })) : icon ? (jsx("div", { className: cn("flex-shrink-0 mx-auto text-[var(--color-text-muted)] mb-6", iconDimensions), "aria-hidden": "true", children: icon })) : null, jsxs("div", { className: "flex flex-col items-center justify-center gap-1", children: [title && jsx("div", { className: emptyTheme.titleStyle, children: title }),
|
|
14
|
+
return (jsxs("div", { ref: ref, className: cn(emptyTheme.baseStyle, className), role: "region", "aria-label": "Empty state", ...props, children: [image ? (jsx("div", { className: "flex-shrink-0 mb-6", children: jsx("img", { src: image, alt: imageAlt || "Empty state illustration", className: cn("mx-auto object-cover", imageDimensions), loading: "lazy" }) })) : icon ? (jsx("div", { className: cn("flex-shrink-0 mx-auto text-[var(--color-text-muted)] mb-6", iconDimensions), "aria-hidden": "true", children: icon })) : null, jsxs("div", { className: "flex flex-col items-center justify-center gap-1", children: [title && jsx("div", { className: emptyTheme.titleStyle, children: title }), subtitle && (jsx("div", { className: emptyTheme.subtitleStyle, children: subtitle }))] }), action && (jsx("div", { className: "flex flex-col sm:flex-row gap-2 justify-center items-center mt-3", children: action }))] }));
|
|
15
15
|
});
|
|
16
16
|
// Set display name for dev tools and Storybook
|
|
17
17
|
Empty.displayName = "Empty";
|
|
@@ -5,9 +5,9 @@ const emptyTheme = {
|
|
|
5
5
|
// Base container styles - customizable spacing, colors, and layout
|
|
6
6
|
baseStyle: "flex flex-col items-center justify-center text-center w-full max-w-md mx-auto space-y-3 py-12 px-6 ",
|
|
7
7
|
// Title text styles - customizable typography and colors
|
|
8
|
-
titleStyle: "text-base font-
|
|
9
|
-
// Description text styles - customizable typography and colors
|
|
10
|
-
|
|
8
|
+
titleStyle: "text-base font-semibold text-[var(--color-text-primary)]",
|
|
9
|
+
// Description text styles - customizable typography and colors
|
|
10
|
+
subtitleStyle: "text-sm text-[var(--color-text-muted)]",
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export { emptyTheme };
|
|
@@ -5,8 +5,8 @@ import React from "react";
|
|
|
5
5
|
export interface EmptyProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
6
6
|
/** Primary title/heading text */
|
|
7
7
|
title?: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/** Subtitle text explaining the empty state */
|
|
9
|
+
subtitle?: React.ReactNode;
|
|
10
10
|
/**
|
|
11
11
|
* Optional image source for illustration
|
|
12
12
|
* Note: If both image and icon are provided, image takes precedence
|
|
@@ -9,7 +9,7 @@ import { menuItemTheme } from './MenuItem.theme.js';
|
|
|
9
9
|
* Handles visual layout, base styling, keyboard activation, and focus tracking.
|
|
10
10
|
* Context-specific behavior (selection, checked state) is handled by consumers.
|
|
11
11
|
*/
|
|
12
|
-
const MenuItem = React__default.forwardRef(({ children, className, startContent, endContent,
|
|
12
|
+
const MenuItem = React__default.forwardRef(({ children, className, startContent, endContent, subtitle, shortcut, disabled = false, isDanger = false, onActivate, theme: themeOverrides, role = "menuitem", ...props }, ref) => {
|
|
13
13
|
const [isFocused, setIsFocused] = useState(false);
|
|
14
14
|
const theme = {
|
|
15
15
|
...menuItemTheme,
|
|
@@ -26,7 +26,7 @@ const MenuItem = React__default.forwardRef(({ children, className, startContent,
|
|
|
26
26
|
handleClick();
|
|
27
27
|
}
|
|
28
28
|
}, [handleClick]);
|
|
29
|
-
return (jsxs("div", { ref: ref, role: role, tabIndex: disabled ? undefined : -1, "aria-disabled": disabled, "data-focused": isFocused, "data-disabled": disabled, className: cn(theme.baseStyle, theme.focusStyle, isDanger && theme.dangerStyle, className), onClick: handleClick, onKeyDown: handleKeyDown, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ...props, children: [startContent && (jsx("div", { className: "flex items-center justify-center flex-shrink-0", children: startContent })), jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center justify-between gap-2", children: [jsx("span", { className: "truncate", children: children }), shortcut && (jsx("
|
|
29
|
+
return (jsxs("div", { ref: ref, role: role, tabIndex: disabled ? undefined : -1, "aria-disabled": disabled, "data-focused": isFocused, "data-disabled": disabled, className: cn(theme.baseStyle, theme.focusStyle, isDanger && theme.dangerStyle, className), onClick: handleClick, onKeyDown: handleKeyDown, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ...props, children: [startContent && (jsx("div", { className: "flex items-center justify-center flex-shrink-0", children: startContent })), jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center justify-between gap-2", children: [jsx("span", { className: "truncate", children: children }), shortcut && (jsx("span", { className: "ml-auto flex-shrink-0", children: shortcut }))] }), subtitle && jsx("div", { className: theme.subtitleStyle, children: subtitle })] }), endContent && (jsx("div", { className: "flex items-center justify-center ml-2", children: endContent }))] }));
|
|
30
30
|
});
|
|
31
31
|
MenuItem.displayName = "MenuItem";
|
|
32
32
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
const menuItemTheme = {
|
|
2
2
|
// Base item styling with hover, focus, and disabled states
|
|
3
|
-
baseStyle: "relative flex items-center gap-2 px-2 py-1.5 text-sm font-[500] text-[var(--color-text-primary)] cursor-pointer outline-none select-none rounded-[var(--radius-base)] transition-colors duration-300 " +
|
|
4
|
-
"hover:bg-[var(--color-background-
|
|
5
|
-
"data-[focused=true]:bg-[var(--color-background-
|
|
3
|
+
baseStyle: "relative flex items-center gap-2 px-2.5 py-1.5 text-sm font-[500] text-[var(--color-text-primary)] cursor-pointer outline-none select-none rounded-[var(--radius-base)] transition-colors duration-300 " +
|
|
4
|
+
"hover:bg-[var(--color-background-secondary)] focus:bg-[var(--color-background-secondary)] " +
|
|
5
|
+
"data-[focused=true]:bg-[var(--color-background-secondary)] " +
|
|
6
6
|
"data-[selected=true]:bg-[var(--color-primary)]/5 data-[selected=true]:text-[var(--color-primary)] " +
|
|
7
7
|
"mb-px last-of-type:mb-0 " +
|
|
8
8
|
"data-[disabled=true]:opacity-60 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:pointer-events-none " +
|
|
9
9
|
// Dark mode
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"dark:data-[focused=true]:bg-[var(--color-
|
|
10
|
+
" " +
|
|
11
|
+
" " +
|
|
12
|
+
"dark:data-[focused=true]:bg-[var(--color-background-secondary)] " +
|
|
13
13
|
"dark:hover:bg-[var(--color-neutral-700)] " +
|
|
14
14
|
"dark:data-[selected=true]:bg-[var(--color-neutral-600)]/50 dark:data-[selected=true]:text-[var(--color-text-primary)]",
|
|
15
15
|
// Danger item styling (e.g., Delete actions)
|
|
@@ -18,10 +18,8 @@ const menuItemTheme = {
|
|
|
18
18
|
// Focus visible styling for keyboard navigation
|
|
19
19
|
focusStyle: "focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 " +
|
|
20
20
|
"dark:focus-visible:ring-[var(--color-primary-400)] dark:focus-visible:ring-offset-[var(--color-neutral-900)]",
|
|
21
|
-
// Keyboard shortcut display
|
|
22
|
-
shortcutStyle: "text-xs text-[var(--color-text-muted)] font-sans border border-[var(--color-border)] rounded px-1.5 py-0.5",
|
|
23
21
|
// Description text below the label
|
|
24
|
-
|
|
22
|
+
subtitleStyle: "text-xs text-[var(--color-text-muted)] mt-0.5 truncate",
|
|
25
23
|
};
|
|
26
24
|
|
|
27
25
|
export { menuItemTheme };
|
|
@@ -10,7 +10,7 @@ export interface MenuItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
10
10
|
/** Icon or element at the end (right side) */
|
|
11
11
|
endContent?: ReactNode;
|
|
12
12
|
/** Secondary text below the label */
|
|
13
|
-
|
|
13
|
+
subtitle?: string;
|
|
14
14
|
/** Keyboard shortcut display */
|
|
15
15
|
shortcut?: ReactNode;
|
|
16
16
|
/** Whether the item is disabled */
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { MessageProps } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MessageProps } from "./Message.types";
|
|
3
3
|
export declare const Message: React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<HTMLDivElement>> & {
|
|
4
4
|
Avatar: React.ForwardRefExoticComponent<import("./MessageAvatar").MessageAvatarComponentProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
Content: React.ForwardRefExoticComponent<import("./MessageContent").MessageContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
Actions: React.ForwardRefExoticComponent<import("./MessageActions").MessageActionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
Timestamp: React.ForwardRefExoticComponent<import("./MessageTimestamp").MessageTimestampProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
List: React.ForwardRefExoticComponent<import("./MessageList.types").MessageListProps & React.RefAttributes<import("..").ScrollAreaRef>>;
|
|
8
9
|
};
|
|
@@ -4,6 +4,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
4
4
|
import { formatTimestamp } from '../../../utils/dateUtils.js';
|
|
5
5
|
import { messageTheme } from './Message.theme.js';
|
|
6
6
|
import { Avatar } from '../Avatar/Avatar.js';
|
|
7
|
+
import { Button } from '../Button/Button.js';
|
|
7
8
|
import { motion } from 'motion/react';
|
|
8
9
|
import { DocumentDuplicateIcon, ArrowPathIcon } from '@heroicons/react/24/outline';
|
|
9
10
|
import { MessageContext } from './MessageContext.js';
|
|
@@ -11,37 +12,42 @@ import { MessageAvatar } from './MessageAvatar.js';
|
|
|
11
12
|
import { MessageContent } from './MessageContent.js';
|
|
12
13
|
import { MessageActions } from './MessageActions.js';
|
|
13
14
|
import { MessageTimestamp } from './MessageTimestamp.js';
|
|
15
|
+
import { MessageList } from './MessageList.js';
|
|
14
16
|
import { TypeWriter } from './TypeWriter.js';
|
|
15
17
|
|
|
16
18
|
const MessageFooter = ({ isStreaming, streamingIndicator, showTimestamp, timestamp, actions, timestampStyle, streamingIndicatorStyle, actionsContainerStyle, variant, }) => {
|
|
17
19
|
if (isStreaming) {
|
|
18
|
-
return (jsx("div", { className: cn(
|
|
20
|
+
return (jsx("div", { className: cn("flex flex-row items-center gap-3 mt-1", variant === "receiver" ? "ml-2" : "mr-3"), children: jsx("div", { className: cn(timestampStyle, streamingIndicatorStyle), children: streamingIndicator || (jsxs(Fragment, { children: [jsx("span", { children: "Typing" }), jsx(motion.span, { animate: { opacity: [0.4, 1, 0.4] }, transition: {
|
|
19
21
|
duration: 1.5,
|
|
20
22
|
repeat: Infinity,
|
|
21
|
-
ease:
|
|
23
|
+
ease: "easeInOut",
|
|
22
24
|
}, children: "\u2022\u2022\u2022" })] })) }) }));
|
|
23
25
|
}
|
|
24
26
|
// For system variant, only show timestamp (no actions)
|
|
25
|
-
if (variant ===
|
|
26
|
-
return showTimestamp && timestamp ? (jsx("div", { className: timestampStyle, children: jsx("time", { dateTime: typeof timestamp ===
|
|
27
|
+
if (variant === "system") {
|
|
28
|
+
return showTimestamp && timestamp ? (jsx("div", { className: timestampStyle, children: jsx("time", { dateTime: typeof timestamp === "string" ? timestamp : timestamp.toISOString(), className: "select-none", children: formatTimestamp(timestamp) }) })) : null;
|
|
27
29
|
}
|
|
28
30
|
// For sender/receiver variants, show timestamp and actions in a row
|
|
29
|
-
return (jsxs("div", { className: cn(`flex flex-row items-center gap-3 mt-
|
|
31
|
+
return (jsxs("div", { className: cn(`flex flex-row items-center gap-3 mt-3`, variant === "receiver" ? "-ml-0" : "mr-3"), children: [showTimestamp && timestamp && (jsx("div", { className: timestampStyle, children: jsx("time", { dateTime: typeof timestamp === "string"
|
|
30
32
|
? timestamp
|
|
31
33
|
: timestamp.toISOString(), className: "select-none", children: formatTimestamp(timestamp) }) })), actions && jsx("div", { className: cn(actionsContainerStyle), children: actions })] }));
|
|
32
34
|
};
|
|
33
|
-
const MessageRoot = React__default.forwardRef(({ role, variant: variantProp, content,
|
|
34
|
-
timestamp, avatar, showTimestamp = true, isStreaming = false, streamingIndicator, typingSpeed = 100, actions, onCopy, onRegenerate, showActions, className, theme: customTheme = {}, children, ...props }, ref) => {
|
|
35
|
+
const MessageRoot = React__default.forwardRef(({ role, variant: variantProp, content, timestamp, avatar, showTimestamp = false, isStreaming = false, streamingIndicator, typingSpeed = 100, actions, onCopy, onRegenerate, showActions, className, theme: customTheme = {}, children, ...props }, ref) => {
|
|
35
36
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
36
37
|
// Determine the variant: role takes precedence over variant prop
|
|
37
38
|
let variant;
|
|
38
39
|
if (role) {
|
|
39
40
|
// Map role to variant
|
|
40
|
-
variant =
|
|
41
|
+
variant =
|
|
42
|
+
role === "user"
|
|
43
|
+
? "sender"
|
|
44
|
+
: role === "assistant"
|
|
45
|
+
? "receiver"
|
|
46
|
+
: "system";
|
|
41
47
|
}
|
|
42
48
|
else {
|
|
43
49
|
// Use variant prop or default
|
|
44
|
-
variant = variantProp ||
|
|
50
|
+
variant = variantProp || "receiver";
|
|
45
51
|
}
|
|
46
52
|
// Detect if using compound API (has children)
|
|
47
53
|
const isCompoundAPI = !!children;
|
|
@@ -52,11 +58,10 @@ timestamp, avatar, showTimestamp = true, isStreaming = false, streamingIndicator
|
|
|
52
58
|
isStreaming,
|
|
53
59
|
typingSpeed,
|
|
54
60
|
}), [role, variant, isStreaming, typingSpeed]);
|
|
55
|
-
|
|
56
|
-
const messageContent = content !== null && content !== void 0 ? content : message;
|
|
61
|
+
const messageContent = content;
|
|
57
62
|
// Determine if we should show default actions
|
|
58
63
|
const shouldShowDefaultActions = showActions !== false &&
|
|
59
|
-
(variant ===
|
|
64
|
+
(variant === "receiver" || role === "assistant") &&
|
|
60
65
|
(onCopy || onRegenerate);
|
|
61
66
|
if (isCompoundAPI) {
|
|
62
67
|
// Compound API - Render with context
|
|
@@ -64,8 +69,8 @@ timestamp, avatar, showTimestamp = true, isStreaming = false, streamingIndicator
|
|
|
64
69
|
// Build container style
|
|
65
70
|
const containerStyle = cn(messageTheme.containerBaseStyle, variantTheme.containerModifier, customTheme.containerBaseStyle, (_b = (_a = customTheme.variants) === null || _a === void 0 ? void 0 : _a[variant]) === null || _b === void 0 ? void 0 : _b.containerModifier,
|
|
66
71
|
// Backward compatibility
|
|
67
|
-
variant ===
|
|
68
|
-
return (jsx(MessageContext.Provider, { value: contextValue, children: jsx("div", { ref: ref, className: cn(
|
|
72
|
+
variant === "sender" && customTheme.senderContainerStyle, variant === "receiver" && customTheme.receiverContainerStyle, variant === "system" && customTheme.systemContainerStyle);
|
|
73
|
+
return (jsx(MessageContext.Provider, { value: contextValue, children: jsx("div", { ref: ref, className: cn("w-full max-w-full group", className), "data-variant": variant, "data-role": role, ...props, children: jsx("div", { className: containerStyle, children: children }) }) }));
|
|
69
74
|
}
|
|
70
75
|
// Props API - Render inline
|
|
71
76
|
// Get variant-specific theme
|
|
@@ -73,37 +78,38 @@ timestamp, avatar, showTimestamp = true, isStreaming = false, streamingIndicator
|
|
|
73
78
|
// Build container styles
|
|
74
79
|
const containerStyle = cn(messageTheme.containerBaseStyle, variantTheme.containerModifier, customTheme.containerBaseStyle, (_d = (_c = customTheme.variants) === null || _c === void 0 ? void 0 : _c[variant]) === null || _d === void 0 ? void 0 : _d.containerModifier,
|
|
75
80
|
// Backward compatibility
|
|
76
|
-
variant ===
|
|
81
|
+
variant === "sender" && customTheme.senderContainerStyle, variant === "receiver" && customTheme.receiverContainerStyle, variant === "system" && customTheme.systemContainerStyle);
|
|
77
82
|
// Build bubble styles
|
|
78
83
|
const bubbleStyle = cn(messageTheme.bubbleBaseStyle, variantTheme.bubbleStyle, customTheme.bubbleBaseStyle, (_f = (_e = customTheme.variants) === null || _e === void 0 ? void 0 : _e[variant]) === null || _f === void 0 ? void 0 : _f.bubbleStyle,
|
|
79
84
|
// Backward compatibility
|
|
80
|
-
variant ===
|
|
85
|
+
variant === "sender" && customTheme.senderBubbleStyle, variant === "receiver" && customTheme.receiverBubbleStyle, variant === "system" && customTheme.systemBubbleStyle);
|
|
81
86
|
// Build timestamp styles
|
|
82
87
|
const timestampStyle = cn(messageTheme.timestampStyle, variantTheme.timestampModifier, customTheme.timestampStyle, (_h = (_g = customTheme.variants) === null || _g === void 0 ? void 0 : _g[variant]) === null || _h === void 0 ? void 0 : _h.timestampModifier,
|
|
83
88
|
// Backward compatibility
|
|
84
|
-
variant ===
|
|
89
|
+
variant === "sender" && customTheme.senderTimestampStyle, variant === "receiver" && customTheme.receiverTimestampStyle, variant === "system" && customTheme.systemTimestampStyle);
|
|
85
90
|
// Build default action buttons if needed
|
|
86
|
-
const defaultActionButtons = shouldShowDefaultActions ? (jsxs("div", { className: cn(messageTheme.actionsContainerStyle, customTheme.actionsContainerStyle), children: [onCopy && (jsx(
|
|
91
|
+
const defaultActionButtons = shouldShowDefaultActions ? (jsxs("div", { className: cn(messageTheme.actionsContainerStyle, customTheme.actionsContainerStyle), children: [onCopy && (jsx(Button, { variant: "link", color: "neutral", size: "sm", onClick: onCopy, "aria-label": "Copy message", className: "opacity-40 hover:opacity-100", children: jsx(DocumentDuplicateIcon, { className: "size-4" }) })), onRegenerate && (jsx(Button, { variant: "link", color: "neutral", size: "sm", onClick: onRegenerate, "aria-label": "Regenerate response", className: "opacity-40 hover:opacity-100", children: jsx(ArrowPathIcon, { className: "size-4" }) }))] })) : undefined;
|
|
87
92
|
// Use custom actions if provided, otherwise use default actions
|
|
88
93
|
const finalActions = actions !== null && actions !== void 0 ? actions : defaultActionButtons;
|
|
89
94
|
// Use TypeWriter for streaming receiver/assistant messages with string content (props API)
|
|
90
|
-
const shouldAnimate = (variant ===
|
|
95
|
+
const shouldAnimate = (variant === "receiver" || role === "assistant") &&
|
|
91
96
|
isStreaming &&
|
|
92
|
-
typeof messageContent ===
|
|
97
|
+
typeof messageContent === "string";
|
|
93
98
|
const renderedContent = shouldAnimate ? (jsx(TypeWriter, { text: messageContent, speed: typingSpeed, enabled: true, className: "break-words" })) : (messageContent);
|
|
94
99
|
// System messages render differently (centered, no avatar)
|
|
95
|
-
if (variant ===
|
|
96
|
-
return (jsx("div", { ref: ref, className: cn(
|
|
100
|
+
if (variant === "system") {
|
|
101
|
+
return (jsx("div", { ref: ref, className: cn("w-full max-w-full", className), "data-variant": "system", "data-role": role, ...props, children: jsxs("div", { className: containerStyle, children: [jsx("div", { className: bubbleStyle, children: typeof renderedContent === "string" ? (jsx("p", { className: "text-sm", children: renderedContent })) : (renderedContent) }), jsx(MessageFooter, { isStreaming: isStreaming, streamingIndicator: streamingIndicator, showTimestamp: showTimestamp, timestamp: timestamp, actions: undefined, timestampStyle: timestampStyle, streamingIndicatorStyle: cn(messageTheme.streamingIndicatorStyle, customTheme.streamingIndicatorStyle), actionsContainerStyle: undefined, variant: "system" })] }) }));
|
|
97
102
|
}
|
|
98
|
-
return (jsx("div", { ref: ref, className: cn(
|
|
103
|
+
return (jsx("div", { ref: ref, className: cn("w-full max-w-full group", className), "data-variant": variant, "data-role": role, ...props, children: jsxs("div", { className: containerStyle, children: [avatar && (jsx("div", { className: "flex-shrink-0", children: jsx(Avatar, { src: avatar.src, alt: avatar.alt, fallback: avatar.fallback, size: "xs" }) })), jsxs("div", { className: cn("flex flex-col", variant === "sender" ? "items-end" : "items-start"), children: [jsx("div", { className: bubbleStyle, children: typeof renderedContent === "string" ? (jsx("p", { className: "break-words", children: renderedContent })) : (renderedContent) }), jsx(MessageFooter, { isStreaming: isStreaming, streamingIndicator: streamingIndicator, showTimestamp: showTimestamp, timestamp: timestamp, actions: finalActions, timestampStyle: timestampStyle, streamingIndicatorStyle: cn(messageTheme.streamingIndicatorStyle, customTheme.streamingIndicatorStyle), actionsContainerStyle: cn(messageTheme.actionsContainerStyle, customTheme.actionsContainerStyle), variant: variant })] })] }) }));
|
|
99
104
|
});
|
|
100
|
-
MessageRoot.displayName =
|
|
105
|
+
MessageRoot.displayName = "Message";
|
|
101
106
|
// Attach compound components
|
|
102
107
|
const Message = Object.assign(MessageRoot, {
|
|
103
108
|
Avatar: MessageAvatar,
|
|
104
109
|
Content: MessageContent,
|
|
105
110
|
Actions: MessageActions,
|
|
106
111
|
Timestamp: MessageTimestamp,
|
|
112
|
+
List: MessageList,
|
|
107
113
|
});
|
|
108
114
|
|
|
109
115
|
export { Message };
|
|
@@ -4,43 +4,41 @@
|
|
|
4
4
|
*/
|
|
5
5
|
const messageTheme = {
|
|
6
6
|
// Shared base styles (apply to all variants)
|
|
7
|
-
bubbleBaseStyle:
|
|
8
|
-
containerBaseStyle:
|
|
9
|
-
timestampStyle:
|
|
7
|
+
bubbleBaseStyle: "max-w-[80%] sm:max-w-[85%] rounded-[calc(var(--radius-base)*1.5)] px-3 py-2 w-fit min-w-fit h-fit",
|
|
8
|
+
containerBaseStyle: "flex items-start gap-3 h-fit text-sm",
|
|
9
|
+
timestampStyle: "text-xs text-[var(--color-text-placeholder)] dark:text-[var(--color-neutral-500)]",
|
|
10
10
|
// Variant-specific modifiers (only differences)
|
|
11
11
|
variants: {
|
|
12
12
|
sender: {
|
|
13
|
-
containerModifier:
|
|
14
|
-
bubbleStyle:
|
|
15
|
-
|
|
13
|
+
containerModifier: "flex-row-reverse", // Reverse direction for right alignment
|
|
14
|
+
bubbleStyle: "bg-[var(--color-background-secondary)] text-[var(--color-text-secondary)] " +
|
|
15
|
+
"rounded-tr-xs " +
|
|
16
16
|
// Dark mode - slightly darker gradient for better contrast
|
|
17
|
-
|
|
18
|
-
timestampModifier:
|
|
17
|
+
" ",
|
|
18
|
+
timestampModifier: "text-right pr-1",
|
|
19
19
|
},
|
|
20
20
|
receiver: {
|
|
21
|
-
containerModifier:
|
|
22
|
-
bubbleStyle:
|
|
23
|
-
|
|
21
|
+
containerModifier: "", // Default direction (no modifier needed)
|
|
22
|
+
bubbleStyle: " text-[var(--color-text-secondary)] rounded-tl-xs py-0 px-0 " +
|
|
23
|
+
" " +
|
|
24
24
|
// Dark mode - dark background with lighter text
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
timestampModifier:
|
|
25
|
+
" " +
|
|
26
|
+
"",
|
|
27
|
+
timestampModifier: "text-left pl-1",
|
|
28
28
|
},
|
|
29
29
|
system: {
|
|
30
|
-
containerModifier:
|
|
31
|
-
bubbleStyle:
|
|
32
|
-
|
|
30
|
+
containerModifier: "justify-center", // Center alignment
|
|
31
|
+
bubbleStyle: "bg-[var(--color-background)] text-[var(--color-text-muted)]/80 rounded-[calc(var(--radius-base)*0.75)] px-1 py-0.5 " +
|
|
32
|
+
"text-xs border-none " +
|
|
33
33
|
// Dark mode
|
|
34
|
-
|
|
35
|
-
timestampModifier:
|
|
34
|
+
"",
|
|
35
|
+
timestampModifier: "text-center",
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
// Feature styles (streaming, actions)
|
|
39
|
-
streamingIndicatorStyle:
|
|
40
|
-
|
|
41
|
-
actionsContainerStyle:
|
|
42
|
-
actionButtonStyle: 'text-[var(--color-text-placeholder)] hover:text-[var(--color-text-primary)] ' +
|
|
43
|
-
'transition-colors cursor-pointer dark:text-[var(--color-neutral-500)] dark:hover:text-[var(--color-neutral-300)]',
|
|
39
|
+
streamingIndicatorStyle: "flex items-center gap-1 text-[var(--color-text-placeholder)] text-xs " +
|
|
40
|
+
"dark:text-[var(--color-neutral-500)]",
|
|
41
|
+
actionsContainerStyle: "flex items-start gap-3",
|
|
44
42
|
};
|
|
45
43
|
|
|
46
44
|
export { messageTheme };
|
|
@@ -50,11 +50,6 @@ export interface MessageProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
50
50
|
* Note: Optional when using compound API with Message.Content
|
|
51
51
|
*/
|
|
52
52
|
content?: ReactNode;
|
|
53
|
-
/**
|
|
54
|
-
* Deprecated alias for content (for backward compatibility)
|
|
55
|
-
* @deprecated Use content instead
|
|
56
|
-
*/
|
|
57
|
-
message?: ReactNode;
|
|
58
53
|
/**
|
|
59
54
|
* The timestamp of the message
|
|
60
55
|
*/
|
|
@@ -131,7 +126,6 @@ export interface MessageTheme {
|
|
|
131
126
|
};
|
|
132
127
|
streamingIndicatorStyle: string;
|
|
133
128
|
actionsContainerStyle: string;
|
|
134
|
-
actionButtonStyle: string;
|
|
135
129
|
}
|
|
136
130
|
/**
|
|
137
131
|
* Theme overrides for Message component
|
|
@@ -147,7 +141,6 @@ export interface MessageThemeOverrides {
|
|
|
147
141
|
};
|
|
148
142
|
streamingIndicatorStyle?: string;
|
|
149
143
|
actionsContainerStyle?: string;
|
|
150
|
-
actionButtonStyle?: string;
|
|
151
144
|
/** @deprecated Use variants.sender.containerModifier instead */
|
|
152
145
|
senderContainerStyle?: string;
|
|
153
146
|
/** @deprecated Use variants.sender.bubbleStyle instead */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Variants } from 'motion/react';
|
|
2
|
+
/**
|
|
3
|
+
* Returns animation variants for message list items, or undefined
|
|
4
|
+
* when animations should be disabled (reduced motion or shouldAnimate=false).
|
|
5
|
+
*/
|
|
6
|
+
export declare const getMessageItemVariants: (shouldReduceMotion: boolean | null, shouldAnimate: boolean) => Variants | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns animation variants for message list items, or undefined
|
|
3
|
+
* when animations should be disabled (reduced motion or shouldAnimate=false).
|
|
4
|
+
*/
|
|
5
|
+
const getMessageItemVariants = (shouldReduceMotion, shouldAnimate) => {
|
|
6
|
+
if (shouldReduceMotion || !shouldAnimate)
|
|
7
|
+
return undefined;
|
|
8
|
+
return {
|
|
9
|
+
initial: {
|
|
10
|
+
opacity: 0,
|
|
11
|
+
y: 10,
|
|
12
|
+
},
|
|
13
|
+
animate: {
|
|
14
|
+
opacity: 1,
|
|
15
|
+
y: 0,
|
|
16
|
+
transition: {
|
|
17
|
+
duration: 0.3,
|
|
18
|
+
ease: [0.2, 0.65, 0.3, 0.9],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
exit: {
|
|
22
|
+
opacity: 0,
|
|
23
|
+
scale: 0.97,
|
|
24
|
+
transition: {
|
|
25
|
+
duration: 0.15,
|
|
26
|
+
ease: 'easeIn',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { getMessageItemVariants };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ScrollAreaRef } from '../ScrollArea/ScrollArea.types';
|
|
3
|
+
import type { MessageListProps } from './MessageList.types';
|
|
4
|
+
declare const MessageList: React.ForwardRefExoticComponent<MessageListProps & React.RefAttributes<ScrollAreaRef>>;
|
|
5
|
+
export { MessageList };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
import { useReducedMotion, motion, AnimatePresence } from 'motion/react';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
import { ScrollArea } from '../ScrollArea/ScrollArea.js';
|
|
6
|
+
import '../ScrollArea/smooth/SmoothScrollEngine.js';
|
|
7
|
+
import { messageListTheme } from './MessageList.theme.js';
|
|
8
|
+
import { getMessageItemVariants } from './MessageList.animations.js';
|
|
9
|
+
|
|
10
|
+
const MessageList = React__default.forwardRef(({ children, autoScroll = true, scrollThreshold = 100, shouldAnimate = true, className, theme: customTheme, ...props }, ref) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const shouldReduceMotion = useReducedMotion();
|
|
13
|
+
const itemVariants = getMessageItemVariants(shouldReduceMotion, shouldAnimate);
|
|
14
|
+
const scrollAreaRef = useRef(null);
|
|
15
|
+
const userHasScrolledRef = useRef(false);
|
|
16
|
+
const childCountRef = useRef(0);
|
|
17
|
+
const scrollToBottom = useCallback(() => {
|
|
18
|
+
const el = scrollAreaRef.current;
|
|
19
|
+
if (!el)
|
|
20
|
+
return;
|
|
21
|
+
el.scrollTop = el.scrollHeight;
|
|
22
|
+
}, []);
|
|
23
|
+
const handleScroll = useCallback(() => {
|
|
24
|
+
const el = scrollAreaRef.current;
|
|
25
|
+
if (!el)
|
|
26
|
+
return;
|
|
27
|
+
const { scrollTop, scrollHeight, clientHeight } = el;
|
|
28
|
+
const isAtBottom = scrollHeight - scrollTop - clientHeight < scrollThreshold;
|
|
29
|
+
userHasScrolledRef.current = !isAtBottom;
|
|
30
|
+
}, [scrollThreshold]);
|
|
31
|
+
const childCount = React__default.Children.count(children);
|
|
32
|
+
// Auto-scroll when new children are added
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!autoScroll)
|
|
35
|
+
return;
|
|
36
|
+
if (childCount > childCountRef.current && !userHasScrolledRef.current) {
|
|
37
|
+
// rAF ensures AnimatePresence has mounted the new child before measuring
|
|
38
|
+
requestAnimationFrame(scrollToBottom);
|
|
39
|
+
}
|
|
40
|
+
childCountRef.current = childCount;
|
|
41
|
+
}, [childCount, autoScroll, scrollToBottom]);
|
|
42
|
+
// Scroll to bottom on initial mount
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
scrollToBottom();
|
|
45
|
+
}, [scrollToBottom]);
|
|
46
|
+
// Dev warning for missing keys
|
|
47
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
48
|
+
React__default.Children.forEach(children, (child) => {
|
|
49
|
+
if (React__default.isValidElement(child) && child.key === null) {
|
|
50
|
+
console.warn('[Message.List]: Each child must have a stable key prop for animations to work correctly.');
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const baseStyle = (_a = customTheme === null || customTheme === void 0 ? void 0 : customTheme.baseStyle) !== null && _a !== void 0 ? _a : messageListTheme.baseStyle;
|
|
55
|
+
const innerStyle = (_b = customTheme === null || customTheme === void 0 ? void 0 : customTheme.innerStyle) !== null && _b !== void 0 ? _b : messageListTheme.innerStyle;
|
|
56
|
+
const wrappedChildren = React__default.Children.map(children, (child) => {
|
|
57
|
+
if (!React__default.isValidElement(child))
|
|
58
|
+
return child;
|
|
59
|
+
if (itemVariants) {
|
|
60
|
+
return (jsx(motion.div, { layout: true, variants: itemVariants, initial: "initial", animate: "animate", exit: "exit", children: child }, child.key));
|
|
61
|
+
}
|
|
62
|
+
return jsx("div", { children: child }, child.key);
|
|
63
|
+
});
|
|
64
|
+
// Merge internal ref with forwarded ref
|
|
65
|
+
const setRefs = useCallback((node) => {
|
|
66
|
+
scrollAreaRef.current = node;
|
|
67
|
+
if (typeof ref === 'function') {
|
|
68
|
+
ref(node);
|
|
69
|
+
}
|
|
70
|
+
else if (ref) {
|
|
71
|
+
ref.current = node;
|
|
72
|
+
}
|
|
73
|
+
}, [ref]);
|
|
74
|
+
return (jsx(ScrollArea, { ref: setRefs, type: "hover", orientation: "vertical", className: cn(baseStyle, className), onScroll: handleScroll, role: "log", "aria-live": "polite", ...props, children: jsx("div", { className: innerStyle, children: jsx(AnimatePresence, { mode: "popLayout", initial: false, children: wrappedChildren }) }) }));
|
|
75
|
+
});
|
|
76
|
+
MessageList.displayName = 'Message.List';
|
|
77
|
+
|
|
78
|
+
export { MessageList };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
export interface MessageListTheme {
|
|
3
|
+
baseStyle: string;
|
|
4
|
+
innerStyle: string;
|
|
5
|
+
}
|
|
6
|
+
export interface MessageListThemeOverrides {
|
|
7
|
+
baseStyle?: string;
|
|
8
|
+
innerStyle?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MessageListProps extends HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/** Message children to render. Each child must have a stable `key` for animations. */
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Auto-scroll to bottom when new children are added,
|
|
15
|
+
* unless the user has manually scrolled up.
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
autoScroll?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Pixels from the bottom to consider "at bottom" for auto-scroll detection.
|
|
21
|
+
* @default 100
|
|
22
|
+
*/
|
|
23
|
+
scrollThreshold?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Enable enter/exit animations for messages.
|
|
26
|
+
* Automatically disabled when the OS prefers reduced motion.
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
shouldAnimate?: boolean;
|
|
30
|
+
/** Theme overrides for the list container and inner wrapper. */
|
|
31
|
+
theme?: MessageListThemeOverrides;
|
|
32
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { Message } from './Message';
|
|
2
2
|
export type { MessageProps, MessageRole, MessageVariant, MessageAvatarProps, MessageTheme, MessageThemeOverrides, MessageVariantTheme, } from './Message.types';
|
|
3
3
|
export { messageTheme } from './Message.theme';
|
|
4
|
+
export { messageListTheme } from './MessageList.theme';
|
|
5
|
+
export type { MessageListProps, MessageListTheme, MessageListThemeOverrides, } from './MessageList.types';
|
|
4
6
|
export { TypeWriter } from './TypeWriter';
|
|
5
7
|
export type { TypeWriterProps } from './TypeWriter';
|
|
@@ -14,8 +14,8 @@ export declare const Modal: {
|
|
|
14
14
|
({ children, className, ...props }: import("./Modal.types").ModalTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
displayName: string;
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
({ children, className, ...props }: import("./Modal.types").
|
|
17
|
+
Subtitle: {
|
|
18
|
+
({ children, className, ...props }: import("./Modal.types").ModalSubtitleProps): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
displayName: string;
|
|
20
20
|
};
|
|
21
21
|
Body: {
|