@flikk/ui 1.0.0-beta.14 → 1.0.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +3 -1
- package/dist/components/ai/PromptSuggestions/PromptSuggestion.theme.js +4 -4
- package/dist/components/ai/StreamingResponse/AnimatedText.js +3 -3
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +22 -22
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +1 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +10 -10
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +9 -3
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +1 -1
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +11 -11
- package/dist/components/ai/index.d.ts +0 -7
- package/dist/components/ai/index.js +8 -6
- package/dist/components/charts/DonutChart/DonutChart.js +1 -1
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.js +1 -1
- package/dist/components/charts/shared/ChartLegend/ChartLegend.types.d.ts +13 -1
- package/dist/components/charts/shared/ChartLegend/ChartLegendContent.js +1 -1
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.types.d.ts +13 -2
- package/dist/components/core/Accordion/AccordionItem.js +1 -1
- package/dist/components/core/Accordion/AccordionTrigger.js +1 -1
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -0
- package/dist/components/core/Alert/Alert.animations.js +44 -0
- package/dist/components/core/Alert/Alert.js +16 -3
- package/dist/components/core/Avatar/Avatar.js +12 -7
- package/dist/components/core/Avatar/Avatar.theme.d.ts +4 -6
- package/dist/components/core/Avatar/Avatar.theme.js +22 -12
- package/dist/components/core/Avatar/Avatar.types.d.ts +9 -0
- package/dist/components/core/AvatarGroup/AvatarGroup.animations.js +2 -2
- package/dist/components/core/AvatarGroup/AvatarGroup.js +1 -2
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +1 -1
- package/dist/components/core/Badge/Badge.animations.js +1 -1
- package/dist/components/core/Badge/Badge.js +23 -47
- package/dist/components/core/Badge/Badge.theme.js +48 -62
- package/dist/components/core/Badge/Badge.types.d.ts +5 -29
- package/dist/components/core/Button/Button.js +2 -2
- package/dist/components/core/Button/Button.theme.js +2 -2
- package/dist/components/core/ButtonGroup/ButtonGroup.theme.js +6 -6
- package/dist/components/core/ButtonGroup/ButtonGroupText.js +1 -3
- package/dist/components/core/Calendar/Calendar.js +29 -3
- package/dist/components/core/Calendar/Calendar.theme.js +11 -7
- package/dist/components/core/Calendar/Calendar.types.d.ts +3 -0
- package/dist/components/core/Carousel/CarouselBody.js +0 -1
- package/dist/components/core/CommandPalette/CommandItem.js +1 -1
- package/dist/components/core/CommandPalette/CommandPalette.js +6 -4
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +1 -0
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +6 -0
- package/dist/components/core/ContextMenu/ContextMenu.js +5 -4
- package/dist/components/core/ContextMenu/ContextMenuTrigger.js +5 -6
- package/dist/components/core/Drawer/Drawer.d.ts +1 -1
- package/dist/components/core/Drawer/Drawer.js +25 -2
- package/dist/components/core/Drawer/Drawer.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.types.d.ts +6 -0
- package/dist/components/core/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/core/Dropdown/Dropdown.js +5 -1
- package/dist/components/core/Dropdown/Dropdown.types.d.ts +1 -0
- package/dist/components/core/Dropdown/DropdownItem.js +1 -1
- package/dist/components/core/Dropdown/DropdownMenu.js +4 -4
- package/dist/components/core/Dropdown/DropdownSection.js +1 -1
- package/dist/components/core/Dropdown/DropdownSeparator.js +1 -1
- package/dist/components/core/Dropdown/DropdownTrigger.d.ts +6 -1
- package/dist/components/core/Dropdown/DropdownTrigger.js +10 -8
- package/dist/components/core/Kbd/Kbd.theme.js +3 -3
- package/dist/components/core/Link/Link.js +3 -1
- package/dist/components/core/Message/Message.d.ts +9 -0
- package/dist/components/core/Message/Message.js +44 -3
- package/dist/components/core/Message/Message.theme.js +22 -0
- package/dist/components/core/Message/Message.types.d.ts +115 -0
- package/dist/components/core/Message/MessageAudio.d.ts +8 -0
- package/dist/components/core/Message/MessageAudio.js +11 -0
- package/dist/components/core/Message/MessageContext.d.ts +3 -1
- package/dist/components/core/Message/MessageDateDivider.d.ts +6 -0
- package/dist/components/core/Message/MessageDateDivider.js +10 -0
- package/dist/components/core/Message/MessageFile.d.ts +9 -0
- package/dist/components/core/Message/MessageFile.js +15 -0
- package/dist/components/core/Message/MessageImage.d.ts +11 -0
- package/dist/components/core/Message/MessageImage.js +13 -0
- package/dist/components/core/Message/MessageLink.d.ts +10 -0
- package/dist/components/core/Message/MessageLink.js +15 -0
- package/dist/components/core/Message/MessageReactions.d.ts +8 -0
- package/dist/components/core/Message/MessageReactions.js +12 -0
- package/dist/components/core/Message/MessageReply.d.ts +8 -0
- package/dist/components/core/Message/MessageReply.js +10 -0
- package/dist/components/core/Message/MessageSenderName.d.ts +6 -0
- package/dist/components/core/Message/MessageSenderName.js +10 -0
- package/dist/components/core/Message/MessageStatusIndicator.d.ts +9 -0
- package/dist/components/core/Message/MessageStatusIndicator.js +45 -0
- package/dist/components/core/Message/index.d.ts +19 -1
- package/dist/components/core/Modal/Modal.animations.d.ts +1 -0
- package/dist/components/core/Modal/Modal.animations.js +14 -11
- package/dist/components/core/Pagination/Pagination.theme.js +1 -1
- package/dist/components/core/Popover/Popover.d.ts +1 -1
- package/dist/components/core/Popover/PopoverBody.js +2 -2
- package/dist/components/core/Popover/PopoverTrigger.d.ts +1 -1
- package/dist/components/core/Popover/PopoverTrigger.js +11 -11
- package/dist/components/core/Progress/Progress.d.ts +9 -8
- package/dist/components/core/Progress/Progress.js +16 -16
- package/dist/components/core/Progress/Progress.theme.js +4 -15
- package/dist/components/core/Progress/Progress.types.d.ts +2 -20
- package/dist/components/core/Progress/index.d.ts +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.js +49 -7
- package/dist/components/core/ScrollArea/ScrollArea.types.d.ts +12 -3
- package/dist/components/core/ScrollArea/index.d.ts +1 -1
- package/dist/components/core/Segmented/SegmentedItem.js +1 -1
- package/dist/components/core/Sidebar/Sidebar.js +2 -1
- package/dist/components/core/Sidebar/SidebarMobileTrigger.js +2 -1
- package/dist/components/core/Sidebar/SidebarToggle.js +2 -1
- package/dist/components/core/Sidebar/SidebarUserProfile.js +1 -1
- package/dist/components/core/SocialIcon/SocialIcon.js +1 -1
- package/dist/components/core/Sortable/Sortable.js +2 -2
- package/dist/components/core/Sortable/Sortable.theme.js +1 -1
- package/dist/components/core/Sortable/Sortable.types.d.ts +7 -5
- package/dist/components/core/Tabs/TabsBody.js +1 -1
- package/dist/components/core/Tabs/TabsTrigger.js +1 -1
- package/dist/components/core/Tag/Tag.js +2 -2
- package/dist/components/core/Toast/Toast.d.ts +2 -2
- package/dist/components/core/Toast/Toast.js +30 -21
- package/dist/components/core/Toast/Toast.theme.js +4 -9
- package/dist/components/core/Toast/Toast.types.d.ts +4 -21
- package/dist/components/core/Toast/index.d.ts +1 -1
- package/dist/components/core/Tooltip/Tooltip.js +1 -1
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
- package/dist/components/core/index.js +9 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.d.ts +2 -2
- package/dist/components/data-display/Table/Table.types.d.ts +8 -8
- package/dist/components/effects/CustomCursor/CustomCursor.js +2 -2
- package/dist/components/effects/GlassSurface/GlassSurface.d.ts +1 -1
- package/dist/components/effects/GlassSurface/GlassSurface.js +17 -9
- package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +6 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.animations.d.ts +39 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.animations.js +98 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.d.ts +3 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.js +104 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.types.d.ts +30 -0
- package/dist/components/effects/InteractiveCharacters/characters/BlobCharacter.d.ts +3 -0
- package/dist/components/effects/InteractiveCharacters/characters/BlobCharacter.js +36 -0
- package/dist/components/effects/InteractiveCharacters/characters/SmallCharacter.d.ts +3 -0
- package/dist/components/effects/InteractiveCharacters/characters/SmallCharacter.js +36 -0
- package/dist/components/effects/InteractiveCharacters/characters/TallCharacter.d.ts +3 -0
- package/dist/components/effects/InteractiveCharacters/characters/TallCharacter.js +37 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useBlink.d.ts +14 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useBlink.js +41 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useIdleAnimation.d.ts +25 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useIdleAnimation.js +84 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useMouseTracking.d.ts +18 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useMouseTracking.js +35 -0
- package/dist/components/effects/InteractiveCharacters/index.d.ts +2 -0
- package/dist/components/effects/MorphingText/MorphingText.d.ts +1 -1
- package/dist/components/effects/MorphingText/MorphingText.js +6 -5
- package/dist/components/effects/Neumorphic/InsetCircleButton.d.ts +10 -0
- package/dist/components/effects/Neumorphic/InsetCircleButton.js +10 -0
- package/dist/components/effects/Neumorphic/InsetPill.d.ts +8 -0
- package/dist/components/effects/Neumorphic/InsetPill.js +7 -0
- package/dist/components/effects/Neumorphic/index.d.ts +4 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.d.ts +1 -1
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.js +4 -4
- package/dist/components/effects/Overlay/Overlay.js +6 -4
- package/dist/components/effects/PageTransition/PageTransition.animations.d.ts +8 -0
- package/dist/components/effects/PageTransition/PageTransition.animations.js +53 -0
- package/dist/components/effects/PageTransition/PageTransition.d.ts +3 -0
- package/dist/components/effects/PageTransition/PageTransition.js +71 -0
- package/dist/components/effects/PageTransition/PageTransition.types.d.ts +15 -0
- package/dist/components/effects/PageTransition/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +6 -0
- package/dist/components/effects/index.js +4 -0
- package/dist/components/forms/Checkbox/Checkbox.animations.d.ts +14 -0
- package/dist/components/forms/Checkbox/Checkbox.animations.js +53 -0
- package/dist/components/forms/Checkbox/Checkbox.js +4 -2
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPicker.types.d.ts +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerBody.js +3 -3
- package/dist/components/forms/Combobox/Combobox.js +5 -3
- package/dist/components/forms/DatePicker/DatePickerBody.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePicker.animations.d.ts +1 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.d.ts +37 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.js +110 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.d.ts +5 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +52 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.types.d.ts +154 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.d.ts +6 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.js +208 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerPresets.d.ts +6 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerPresets.js +41 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.d.ts +6 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +32 -0
- package/dist/components/forms/DateRangePicker/dateRangePresets.d.ts +5 -0
- package/dist/components/forms/DateRangePicker/dateRangePresets.js +59 -0
- package/dist/components/forms/DateRangePicker/index.d.ts +4 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.animations.d.ts +36 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.animations.js +22 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.d.ts +3 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.js +111 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.d.ts +19 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +27 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.types.d.ts +33 -0
- package/dist/components/forms/FileUpload/index.d.ts +3 -0
- package/dist/components/forms/Input/Input.js +8 -13
- package/dist/components/forms/Input/Input.types.d.ts +6 -0
- package/dist/components/forms/InputAddress/InputAddress.theme.js +1 -1
- package/dist/components/forms/InputCounter/InputCounter.js +1 -1
- package/dist/components/forms/InputCreditCard/InputCreditCard.theme.js +1 -1
- package/dist/components/forms/InputOTP/InputOTP.theme.js +1 -1
- package/dist/components/forms/Radio/Radio.animations.d.ts +10 -0
- package/dist/components/forms/Radio/Radio.animations.js +33 -0
- package/dist/components/forms/Radio/Radio.js +11 -2
- package/dist/components/forms/Radio/Radio.theme.js +3 -3
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +13 -4
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +2 -2
- package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +11 -0
- package/dist/components/forms/Select/Select.d.ts +1 -1
- package/dist/components/forms/Select/Select.js +7 -7
- package/dist/components/forms/Select/Select.types.d.ts +3 -3
- package/dist/components/forms/SelectableCard/SelectableCard.js +1 -1
- package/dist/components/forms/Slider/Slider.js +10 -3
- package/dist/components/forms/Slider/Slider.theme.js +3 -3
- package/dist/components/forms/Switch/Switch.js +10 -2
- package/dist/components/forms/Switch/Switch.theme.js +3 -3
- package/dist/components/forms/forms.theme.js +1 -1
- package/dist/components/forms/index.d.ts +6 -3
- package/dist/components/forms/index.js +8 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useMediaQuery.d.ts +5 -0
- package/dist/hooks/useMediaQuery.js +21 -0
- package/dist/index.js +21 -2
- package/dist/styles.css +1 -1
- package/dist/utils/dateUtils.js +56 -5
- package/dist/utils/formatUtils.d.ts +10 -0
- package/dist/utils/formatUtils.js +24 -0
- package/dist/utils/index.d.ts +1 -1
- package/package.json +12 -4
- package/src/global.scss +319 -39
- package/src/styles/theme.css +105 -16
- package/src/theme-plugin.css +13 -0
- package/dist/components/ai/ApprovalCard/ApprovalCard.d.ts +0 -3
- package/dist/components/ai/ApprovalCard/ApprovalCard.js +0 -16
- package/dist/components/ai/ApprovalCard/ApprovalCard.theme.d.ts +0 -13
- package/dist/components/ai/ApprovalCard/ApprovalCard.theme.js +0 -15
- package/dist/components/ai/ApprovalCard/ApprovalCard.types.d.ts +0 -43
- package/dist/components/ai/ApprovalCard/index.d.ts +0 -2
- package/dist/components/ai/MessageHistory/MessageHistory.d.ts +0 -18
- package/dist/components/ai/MessageHistory/MessageHistory.js +0 -98
- package/dist/components/ai/MessageHistory/MessageHistory.theme.d.ts +0 -2
- package/dist/components/ai/MessageHistory/MessageHistory.theme.js +0 -8
- package/dist/components/ai/MessageHistory/MessageHistory.types.d.ts +0 -94
- package/dist/components/ai/MessageHistory/index.d.ts +0 -3
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.animations.d.ts +0 -10
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.animations.js +0 -47
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.d.ts +0 -20
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.js +0 -55
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.theme.d.ts +0 -2
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.theme.js +0 -20
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.types.d.ts +0 -67
- package/dist/components/ai/ThinkingIndicator/index.d.ts +0 -3
- package/dist/components/forms/TransferList/TransferList.animations.d.ts +0 -10
- package/dist/components/forms/TransferList/TransferList.animations.js +0 -32
- package/dist/components/forms/TransferList/TransferList.d.ts +0 -28
- package/dist/components/forms/TransferList/TransferList.js +0 -199
- package/dist/components/forms/TransferList/TransferList.theme.d.ts +0 -6
- package/dist/components/forms/TransferList/TransferList.theme.js +0 -60
- package/dist/components/forms/TransferList/TransferList.types.d.ts +0 -101
- package/dist/components/forms/TransferList/index.d.ts +0 -3
- package/dist/icons/Icon.d.ts +0 -24
- package/dist/icons/Icon.js +0 -30
- package/dist/icons/Index.d.ts +0 -16
- package/dist/icons/core/ChevronUpDown.d.ts +0 -1
- package/dist/icons/core/ChevronUpDown.js +0 -7
- package/dist/icons/core/DollarIcon.d.ts +0 -1
- package/dist/icons/core/DollarIcon.js +0 -5
- package/dist/icons/core/LockIcon.d.ts +0 -1
- package/dist/icons/core/LockIcon.js +0 -5
- package/dist/icons/core/MinusIcon.d.ts +0 -1
- package/dist/icons/core/MinusIcon.js +0 -7
- package/dist/icons/core/PlusIcon.d.ts +0 -1
- package/dist/icons/core/PlusIcon.js +0 -7
- package/dist/icons/core/SearchIcon.d.ts +0 -1
- package/dist/icons/core/SearchIcon.js +0 -7
- package/dist/icons/core/TickIcon.d.ts +0 -1
- package/dist/icons/core/TickIcon.js +0 -5
- package/dist/icons/core/User.d.ts +0 -1
- package/dist/utils/useClickOutside.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Message } from './Message';
|
|
2
|
-
export type { MessageProps, MessageRole, MessageVariant, MessageAvatarProps, MessageTheme, MessageThemeOverrides, MessageVariantTheme, } from './Message.types';
|
|
2
|
+
export type { MessageProps, MessageRole, MessageVariant, MessageAvatarProps, MessageTheme, MessageThemeOverrides, MessageVariantTheme, MessageStatus, MessageAttachmentType, MessageAttachment, MessageReaction, MessageReplyTo, MessageSenderInfo, } from './Message.types';
|
|
3
3
|
export { messageTheme } from './Message.theme';
|
|
4
4
|
export { messageListTheme } from './MessageList.theme';
|
|
5
5
|
export type { MessageListProps, MessageListTheme, MessageListThemeOverrides, } from './MessageList.types';
|
|
@@ -7,3 +7,21 @@ export { TypeWriter } from './TypeWriter';
|
|
|
7
7
|
export type { TypeWriterProps } from './TypeWriter';
|
|
8
8
|
export { MessageBody } from './MessageBody';
|
|
9
9
|
export type { MessageBodyProps } from './MessageBody';
|
|
10
|
+
export { MessageStatusIndicator } from './MessageStatusIndicator';
|
|
11
|
+
export type { MessageStatusIndicatorProps } from './MessageStatusIndicator';
|
|
12
|
+
export { MessageSenderName } from './MessageSenderName';
|
|
13
|
+
export type { MessageSenderNameProps } from './MessageSenderName';
|
|
14
|
+
export { MessageFile } from './MessageFile';
|
|
15
|
+
export type { MessageFileProps } from './MessageFile';
|
|
16
|
+
export { MessageImage } from './MessageImage';
|
|
17
|
+
export type { MessageImageProps } from './MessageImage';
|
|
18
|
+
export { MessageAudio } from './MessageAudio';
|
|
19
|
+
export type { MessageAudioProps } from './MessageAudio';
|
|
20
|
+
export { MessageLink } from './MessageLink';
|
|
21
|
+
export type { MessageLinkProps } from './MessageLink';
|
|
22
|
+
export { MessageReply } from './MessageReply';
|
|
23
|
+
export type { MessageReplyProps } from './MessageReply';
|
|
24
|
+
export { MessageReactions } from './MessageReactions';
|
|
25
|
+
export type { MessageReactionsProps } from './MessageReactions';
|
|
26
|
+
export { MessageDateDivider } from './MessageDateDivider';
|
|
27
|
+
export type { MessageDateDividerProps } from './MessageDateDivider';
|
|
@@ -22,30 +22,33 @@ const modalOverlayAnimations = {
|
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
24
|
* Modal content animation variants
|
|
25
|
+
* Scale + slight slide (Vercel/Notion style)
|
|
25
26
|
*/
|
|
26
27
|
const modalContentAnimations = {
|
|
27
28
|
initial: {
|
|
28
29
|
opacity: 0,
|
|
29
|
-
|
|
30
|
+
scale: 0.98,
|
|
31
|
+
y: 8,
|
|
30
32
|
},
|
|
31
33
|
animate: {
|
|
32
34
|
opacity: 1,
|
|
35
|
+
scale: 1,
|
|
33
36
|
y: 0,
|
|
34
37
|
transition: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
38
|
+
duration: 0.2,
|
|
39
|
+
ease: [0.4, 0, 0.2, 1],
|
|
40
|
+
delay: 0.05,
|
|
41
|
+
},
|
|
40
42
|
},
|
|
41
43
|
exit: {
|
|
42
44
|
opacity: 0,
|
|
43
|
-
|
|
45
|
+
scale: 0.98,
|
|
46
|
+
y: 4,
|
|
44
47
|
transition: {
|
|
45
|
-
duration: 0.
|
|
46
|
-
ease:
|
|
47
|
-
}
|
|
48
|
-
}
|
|
48
|
+
duration: 0.15,
|
|
49
|
+
ease: [0.4, 0, 1, 1],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
49
52
|
};
|
|
50
53
|
|
|
51
54
|
export { modalContentAnimations, modalOverlayAnimations };
|
|
@@ -15,7 +15,7 @@ const paginationTheme = {
|
|
|
15
15
|
// Base state - dark
|
|
16
16
|
"dark:bg-[var(--color-neutral-800)] dark:text-[var(--color-neutral-400)] dark:border-transparent " +
|
|
17
17
|
// Hover state - light
|
|
18
|
-
"hover:text-[var(--color-text-primary)] hover:bg-
|
|
18
|
+
"hover:text-[var(--color-text-primary)] hover:bg-[var(--color-background-secondary)] hover:border-[var(--color-border)] " +
|
|
19
19
|
// Hover state - dark
|
|
20
20
|
"dark:hover:bg-[var(--color-neutral-700)] dark:hover:text-[var(--color-neutral-200)] dark:hover:border-[var(--color-neutral-600)] " +
|
|
21
21
|
// Active state - light
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { PopoverRootProps as PopoverProps } from "./Popover.types";
|
|
3
3
|
export declare const Popover: (({ children, className, isOpen: controlledIsOpen, defaultIsOpen, onOpenChange, placement, offset, triggerType, closeOnClickOutside, closeOnEsc, preventClose, hasBackdrop, theme: themeOverrides, darkMode, ...props }: PopoverProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
-
Trigger: React.ForwardRefExoticComponent<Omit<import("./Popover.types").PopoverTriggerProps, "ref"> & React.RefAttributes<
|
|
4
|
+
Trigger: React.ForwardRefExoticComponent<Omit<import("./Popover.types").PopoverTriggerProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
5
5
|
Body: React.ForwardRefExoticComponent<import("./Popover.types").PopoverBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
};
|
|
@@ -58,7 +58,7 @@ const PopoverBody = React__default.forwardRef(({ children, className, animation
|
|
|
58
58
|
const { position, cssVariables, contentRef: portalContentRef, } = useSelectPortal({
|
|
59
59
|
triggerRef,
|
|
60
60
|
isOpen: isOpen || false,
|
|
61
|
-
placement
|
|
61
|
+
placement,
|
|
62
62
|
offset: offset || 8,
|
|
63
63
|
autoWidth: true,
|
|
64
64
|
onClose: () => {
|
|
@@ -132,7 +132,7 @@ const PopoverBody = React__default.forwardRef(({ children, className, animation
|
|
|
132
132
|
return (jsx(Overlay, { ref: handleRef, isOpen: isOpen, onClose: () => {
|
|
133
133
|
if (!preventClose)
|
|
134
134
|
onOpenChange(false);
|
|
135
|
-
}, closeOnOverlayClick: closeOnClickOutside && !preventClose, closeOnEsc: closeOnEsc && !preventClose, enableScrollLock: false, enableFocusTrap:
|
|
135
|
+
}, closeOnOverlayClick: closeOnClickOutside && !preventClose, closeOnEsc: closeOnEsc && !preventClose, enableScrollLock: false, enableFocusTrap: true, position: "none", role: "dialog", ariaModal: true, contentClassName: contentClasses, contentStyle: contentPositionStyle, animations: animation && !shouldReduceMotion
|
|
136
136
|
? {
|
|
137
137
|
overlay: overlayBackdropAnimations,
|
|
138
138
|
content: overlayContentAnimations,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { PopoverTriggerProps } from "./Popover.types";
|
|
3
|
-
export declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<PopoverTriggerProps, "ref"> & React.RefAttributes<
|
|
3
|
+
export declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<PopoverTriggerProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
@@ -5,6 +5,7 @@ import { usePopoverContext } from './PopoverContext.js';
|
|
|
5
5
|
const PopoverTrigger = React__default.forwardRef(({ children, className, ...props }, ref) => {
|
|
6
6
|
var _a;
|
|
7
7
|
const context = usePopoverContext();
|
|
8
|
+
const childElement = children;
|
|
8
9
|
// Create trigger events based on triggerType
|
|
9
10
|
const getTriggerEvents = () => {
|
|
10
11
|
if (context.triggerType === "click") {
|
|
@@ -14,7 +15,7 @@ const PopoverTrigger = React__default.forwardRef(({ children, className, ...prop
|
|
|
14
15
|
e.preventDefault();
|
|
15
16
|
context.onOpenChange(!context.isOpen);
|
|
16
17
|
// Call the original onClick if it exists
|
|
17
|
-
(_b = (_a =
|
|
18
|
+
(_b = (_a = childElement.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
18
19
|
},
|
|
19
20
|
};
|
|
20
21
|
}
|
|
@@ -24,7 +25,7 @@ const PopoverTrigger = React__default.forwardRef(({ children, className, ...prop
|
|
|
24
25
|
var _a, _b;
|
|
25
26
|
context.onOpenChange(true);
|
|
26
27
|
// Call the original onMouseEnter if it exists
|
|
27
|
-
(_b = (_a =
|
|
28
|
+
(_b = (_a = childElement.props) === null || _a === void 0 ? void 0 : _a.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
28
29
|
},
|
|
29
30
|
onMouseLeave: (e) => {
|
|
30
31
|
var _a, _b;
|
|
@@ -32,43 +33,42 @@ const PopoverTrigger = React__default.forwardRef(({ children, className, ...prop
|
|
|
32
33
|
context.onOpenChange(false);
|
|
33
34
|
}
|
|
34
35
|
// Call the original onMouseLeave if it exists
|
|
35
|
-
(_b = (_a =
|
|
36
|
+
(_b = (_a = childElement.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
36
37
|
},
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
return {};
|
|
40
41
|
};
|
|
41
42
|
// Merge refs for the trigger element
|
|
42
|
-
function
|
|
43
|
+
function mergeRefs(node) {
|
|
43
44
|
context.triggerRef.current = node;
|
|
44
45
|
if (ref) {
|
|
45
46
|
if (typeof ref === "function")
|
|
46
47
|
ref(node);
|
|
47
|
-
else if (typeof ref === "object")
|
|
48
|
+
else if (typeof ref === "object" && ref)
|
|
48
49
|
ref.current = node;
|
|
49
50
|
}
|
|
50
|
-
const childRef =
|
|
51
|
+
const childRef = childElement.ref;
|
|
51
52
|
if (childRef) {
|
|
52
53
|
if (typeof childRef === "function")
|
|
53
54
|
childRef(node);
|
|
54
|
-
else if (typeof childRef === "object")
|
|
55
|
+
else if (typeof childRef === "object" && childRef)
|
|
55
56
|
childRef.current = node;
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
const triggerEvents = getTriggerEvents();
|
|
59
|
-
const childElement = children;
|
|
60
60
|
return React__default.cloneElement(childElement, {
|
|
61
|
-
ref:
|
|
61
|
+
ref: mergeRefs,
|
|
62
62
|
"aria-expanded": context.isOpen,
|
|
63
63
|
"aria-haspopup": true,
|
|
64
64
|
"aria-controls": context.contentId,
|
|
65
|
-
className: cn((_a = childElement.props) === null || _a === void 0 ? void 0 : _a.className, className
|
|
65
|
+
className: cn("popover-trigger", (_a = childElement.props) === null || _a === void 0 ? void 0 : _a.className, className),
|
|
66
66
|
"data-state": context.isOpen ? "open" : "closed",
|
|
67
67
|
"data-trigger-type": context.triggerType,
|
|
68
68
|
...triggerEvents,
|
|
69
69
|
...props,
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
|
-
PopoverTrigger.displayName = "
|
|
72
|
+
PopoverTrigger.displayName = "Popover.Trigger";
|
|
73
73
|
|
|
74
74
|
export { PopoverTrigger };
|
|
@@ -6,23 +6,24 @@ import { ProgressProps } from "./Progress.types";
|
|
|
6
6
|
* Features:
|
|
7
7
|
* - Determinate mode: Shows specific progress value (0-100)
|
|
8
8
|
* - Indeterminate mode: Animated loading state when value is undefined
|
|
9
|
-
* - Multiple sizes
|
|
9
|
+
* - Multiple sizes with default primary color
|
|
10
|
+
* - className controls the fill bar color (the primary styling target)
|
|
11
|
+
* - wrapperClassName controls the outer container
|
|
10
12
|
* - Flexible label positioning (right, top, bottom, inside)
|
|
11
13
|
* - Respects reduced motion preferences
|
|
12
|
-
* - Full className override support
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
|
-
* //
|
|
16
|
-
* <Progress value={60}
|
|
16
|
+
* // Default (primary color)
|
|
17
|
+
* <Progress value={60} />
|
|
18
|
+
*
|
|
19
|
+
* // Custom fill color via className
|
|
20
|
+
* <Progress value={70} className="bg-[var(--color-success)]" />
|
|
17
21
|
*
|
|
18
22
|
* // With label
|
|
19
23
|
* <Progress value={75} showLabel labelPosition="right" />
|
|
20
24
|
*
|
|
21
25
|
* // Indeterminate (loading)
|
|
22
|
-
* <Progress
|
|
23
|
-
*
|
|
24
|
-
* // Custom label format
|
|
25
|
-
* <Progress value={50} showLabel formatLabel={(pct) => `${pct}% complete`} />
|
|
26
|
+
* <Progress />
|
|
26
27
|
*/
|
|
27
28
|
declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
29
|
export { Progress };
|
|
@@ -16,25 +16,26 @@ const PROGRESS_SPRING_TRANSITION = {
|
|
|
16
16
|
* Features:
|
|
17
17
|
* - Determinate mode: Shows specific progress value (0-100)
|
|
18
18
|
* - Indeterminate mode: Animated loading state when value is undefined
|
|
19
|
-
* - Multiple sizes
|
|
19
|
+
* - Multiple sizes with default primary color
|
|
20
|
+
* - className controls the fill bar color (the primary styling target)
|
|
21
|
+
* - wrapperClassName controls the outer container
|
|
20
22
|
* - Flexible label positioning (right, top, bottom, inside)
|
|
21
23
|
* - Respects reduced motion preferences
|
|
22
|
-
* - Full className override support
|
|
23
24
|
*
|
|
24
25
|
* @example
|
|
25
|
-
* //
|
|
26
|
-
* <Progress value={60}
|
|
26
|
+
* // Default (primary color)
|
|
27
|
+
* <Progress value={60} />
|
|
28
|
+
*
|
|
29
|
+
* // Custom fill color via className
|
|
30
|
+
* <Progress value={70} className="bg-[var(--color-success)]" />
|
|
27
31
|
*
|
|
28
32
|
* // With label
|
|
29
33
|
* <Progress value={75} showLabel labelPosition="right" />
|
|
30
34
|
*
|
|
31
35
|
* // Indeterminate (loading)
|
|
32
|
-
* <Progress
|
|
33
|
-
*
|
|
34
|
-
* // Custom label format
|
|
35
|
-
* <Progress value={50} showLabel formatLabel={(pct) => `${pct}% complete`} />
|
|
36
|
+
* <Progress />
|
|
36
37
|
*/
|
|
37
|
-
const Progress = React__default.forwardRef(({ value, size = "md",
|
|
38
|
+
const Progress = React__default.forwardRef(({ value, size = "md", showLabel = false, labelPosition = "right", formatLabel, animated = true, wrapperClassName, className, theme: customTheme, ...props }, ref) => {
|
|
38
39
|
const shouldReduceMotion = useReducedMotion();
|
|
39
40
|
// Merge custom theme with default theme
|
|
40
41
|
const theme = useMemo(() => {
|
|
@@ -44,7 +45,6 @@ const Progress = React__default.forwardRef(({ value, size = "md", color = "prima
|
|
|
44
45
|
...progressTheme,
|
|
45
46
|
...customTheme,
|
|
46
47
|
sizes: { ...progressTheme.sizes, ...customTheme.sizes },
|
|
47
|
-
colors: { ...progressTheme.colors, ...customTheme.colors },
|
|
48
48
|
};
|
|
49
49
|
}, [customTheme]);
|
|
50
50
|
// Calculate percentage (clamped to 0-100)
|
|
@@ -71,7 +71,7 @@ const Progress = React__default.forwardRef(({ value, size = "md", color = "prima
|
|
|
71
71
|
case "top":
|
|
72
72
|
return "flex flex-col gap-1.5";
|
|
73
73
|
case "bottom":
|
|
74
|
-
return "flex flex-col
|
|
74
|
+
return "flex flex-col gap-1.5";
|
|
75
75
|
case "right":
|
|
76
76
|
return "flex items-center gap-3";
|
|
77
77
|
case "inside":
|
|
@@ -95,14 +95,14 @@ const Progress = React__default.forwardRef(({ value, size = "md", color = "prima
|
|
|
95
95
|
: ""), children: label }));
|
|
96
96
|
};
|
|
97
97
|
// Track element with optional fill
|
|
98
|
-
const renderTrack = () => (jsxs("div", { className: cn(theme.trackStyle, theme.sizes[size], "relative",
|
|
98
|
+
const renderTrack = () => (jsxs("div", { className: cn(theme.trackStyle, theme.sizes[size], "relative", wrapperClassName), children: [isIndeterminate ? (
|
|
99
99
|
// Indeterminate animation
|
|
100
|
-
jsx("div", { className: cn(theme.fillStyle,
|
|
100
|
+
jsx("div", { className: cn(theme.fillStyle, "absolute", theme.indeterminateStyle, className) })) : shouldAnimate ? (
|
|
101
101
|
// Animated determinate progress with spring animation
|
|
102
|
-
jsx(motion.div, { className: cn(theme.fillStyle,
|
|
102
|
+
jsx(motion.div, { className: cn(theme.fillStyle, className), initial: { width: 0 }, animate: { width: `${percentage}%` }, transition: PROGRESS_SPRING_TRANSITION })) : (
|
|
103
103
|
// Static determinate progress
|
|
104
|
-
jsx("div", { className: cn(theme.fillStyle,
|
|
105
|
-
return (jsxs("div", { ref: ref, className: cn(theme.containerStyle, containerLayoutClass
|
|
104
|
+
jsx("div", { className: cn(theme.fillStyle, className), style: { width: `${percentage}%` } })), showLabel && labelPosition === "inside" && size === "lg" && !isIndeterminate && (jsx("span", { className: theme.insideLabelStyle, children: label }))] }));
|
|
105
|
+
return (jsxs("div", { ref: ref, className: cn(theme.containerStyle, containerLayoutClass), role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": isIndeterminate ? undefined : percentage, "aria-label": isIndeterminate ? "Loading" : `${percentage}% complete`, ...props, children: [labelPosition === "top" && renderLabel(), labelPosition === "right" ? (jsxs(Fragment, { children: [jsx("div", { className: "flex-1", children: renderTrack() }), renderLabel()] })) : (renderTrack()), labelPosition === "bottom" && renderLabel()] }));
|
|
106
106
|
});
|
|
107
107
|
Progress.displayName = "Progress";
|
|
108
108
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { semanticBgColors } from '../../../utils/colorUtils.js';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Default theme configuration for Progress component
|
|
5
3
|
*/
|
|
@@ -8,10 +6,10 @@ const progressTheme = {
|
|
|
8
6
|
containerStyle: "w-full",
|
|
9
7
|
// Track (background) styles
|
|
10
8
|
trackStyle: "relative w-full rounded-full bg-[var(--color-background-tertiary)] overflow-hidden",
|
|
11
|
-
// Fill (progress bar) styles
|
|
12
|
-
fillStyle: "h-full rounded-full",
|
|
9
|
+
// Fill (progress bar) styles — includes default primary color
|
|
10
|
+
fillStyle: "h-full rounded-full bg-[var(--color-primary)]",
|
|
13
11
|
// Label text styles
|
|
14
|
-
labelStyle: "text-base font-
|
|
12
|
+
labelStyle: "text-base font-semibold text-[var(--color-text-secondary)] tabular-nums min-w-[2.5rem] text-right",
|
|
15
13
|
// Inside label styles (when label is positioned inside the bar)
|
|
16
14
|
insideLabelStyle: "absolute inset-0 flex items-center justify-center text-sm font-medium text-[var(--color-primary-contrast)] tabular-nums",
|
|
17
15
|
// Size variants for track height
|
|
@@ -20,17 +18,8 @@ const progressTheme = {
|
|
|
20
18
|
md: "h-2.5",
|
|
21
19
|
lg: "h-4",
|
|
22
20
|
},
|
|
23
|
-
// Color variants for the fill
|
|
24
|
-
colors: {
|
|
25
|
-
neutral: semanticBgColors.neutral + " dark:bg-[var(--color-neutral-500)]",
|
|
26
|
-
primary: semanticBgColors.primary + " dark:bg-[var(--color-primary-400)]",
|
|
27
|
-
secondary: semanticBgColors.secondary + " dark:bg-[var(--color-secondary-400)]",
|
|
28
|
-
success: semanticBgColors.success + " dark:bg-[var(--color-success-400)]",
|
|
29
|
-
warning: semanticBgColors.warning + " dark:bg-[var(--color-warning-400)]",
|
|
30
|
-
danger: semanticBgColors.danger + " dark:bg-[var(--color-danger-400)]",
|
|
31
|
-
},
|
|
32
21
|
// Indeterminate animation styles
|
|
33
|
-
indeterminateStyle: "animate-[progress-indeterminate_1.
|
|
22
|
+
indeterminateStyle: "animate-[progress-indeterminate_1.8s_linear_infinite]",
|
|
34
23
|
};
|
|
35
24
|
|
|
36
25
|
export { progressTheme };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { SemanticColor } from "../../../utils/colorUtils";
|
|
3
2
|
export type ProgressSize = "sm" | "md" | "lg";
|
|
4
|
-
export type ProgressColor = SemanticColor;
|
|
5
3
|
export type ProgressLabelPosition = "right" | "top" | "bottom" | "inside";
|
|
6
4
|
/**
|
|
7
5
|
* Theme configuration for Progress component
|
|
@@ -19,8 +17,6 @@ export interface ProgressTheme {
|
|
|
19
17
|
insideLabelStyle: string;
|
|
20
18
|
/** Size variants for the track height */
|
|
21
19
|
sizes: Record<ProgressSize, string>;
|
|
22
|
-
/** Color variants for the fill */
|
|
23
|
-
colors: Record<ProgressColor, string>;
|
|
24
20
|
/** Indeterminate animation styles */
|
|
25
21
|
indeterminateStyle: string;
|
|
26
22
|
}
|
|
@@ -34,7 +30,6 @@ export interface ProgressThemeOverrides {
|
|
|
34
30
|
labelStyle?: string;
|
|
35
31
|
insideLabelStyle?: string;
|
|
36
32
|
sizes?: Partial<Record<ProgressSize, string>>;
|
|
37
|
-
colors?: Partial<Record<ProgressColor, string>>;
|
|
38
33
|
indeterminateStyle?: string;
|
|
39
34
|
}
|
|
40
35
|
export interface ProgressProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
@@ -48,11 +43,6 @@ export interface ProgressProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
48
43
|
* @default 'md'
|
|
49
44
|
*/
|
|
50
45
|
size?: ProgressSize;
|
|
51
|
-
/**
|
|
52
|
-
* The semantic color of the progress bar
|
|
53
|
-
* @default 'primary'
|
|
54
|
-
*/
|
|
55
|
-
color?: ProgressColor;
|
|
56
46
|
/**
|
|
57
47
|
* Whether to show the percentage label
|
|
58
48
|
* @default false
|
|
@@ -75,17 +65,9 @@ export interface ProgressProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
75
65
|
*/
|
|
76
66
|
animated?: boolean;
|
|
77
67
|
/**
|
|
78
|
-
* Additional class name for the track
|
|
79
|
-
*/
|
|
80
|
-
trackClassName?: string;
|
|
81
|
-
/**
|
|
82
|
-
* Additional class name for the fill (progress) element
|
|
83
|
-
*/
|
|
84
|
-
fillClassName?: string;
|
|
85
|
-
/**
|
|
86
|
-
* Additional class name for the container
|
|
68
|
+
* Additional class name for the outer container/track wrapper
|
|
87
69
|
*/
|
|
88
|
-
|
|
70
|
+
wrapperClassName?: string;
|
|
89
71
|
/**
|
|
90
72
|
* Component-level theme overrides
|
|
91
73
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Progress } from "./Progress";
|
|
2
|
-
export type { ProgressProps, ProgressSize,
|
|
2
|
+
export type { ProgressProps, ProgressSize, ProgressLabelPosition, ProgressThemeOverrides, } from "./Progress.types";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import React__default, { useRef, useMemo, useImperativeHandle } from 'react';
|
|
2
|
+
import React__default, { useRef, useMemo, useImperativeHandle, useState, useEffect } from 'react';
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
import { scrollAreaTheme } from './ScrollArea.theme.js';
|
|
5
5
|
import { useSmoothScroll } from './smooth/useSmoothScroll.js';
|
|
@@ -25,7 +25,7 @@ import { useSmoothScroll } from './smooth/useSmoothScroll.js';
|
|
|
25
25
|
* </ScrollArea>
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
const ScrollArea = React__default.forwardRef(({ children, type = 'hover', orientation = 'vertical', snap, snapAlign = 'start', smooth = false, smoothConfig, onScrollProgress, onPerformanceUpdate, className, theme, ...props }, ref) => {
|
|
28
|
+
const ScrollArea = React__default.forwardRef(({ children, type = 'hover', size = 'default', orientation = 'vertical', snap, snapAlign = 'start', smooth = false, smoothConfig, onScrollProgress, onPerformanceUpdate, className, theme, ...props }, ref) => {
|
|
29
29
|
// Internal ref for the scrollable element
|
|
30
30
|
const internalRef = useRef(null);
|
|
31
31
|
// Determine scroll orientation for smooth scroll
|
|
@@ -65,6 +65,26 @@ const ScrollArea = React__default.forwardRef(({ children, type = 'hover', orient
|
|
|
65
65
|
}
|
|
66
66
|
return extendedRef;
|
|
67
67
|
}, [smooth, smoothAPI]);
|
|
68
|
+
// Scroll-detection state for type='scroll' (overlay scrollbar)
|
|
69
|
+
const [isScrolling, setIsScrolling] = useState(false);
|
|
70
|
+
const scrollTimerRef = useRef(undefined);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (type !== 'scroll')
|
|
73
|
+
return;
|
|
74
|
+
const el = internalRef.current;
|
|
75
|
+
if (!el)
|
|
76
|
+
return;
|
|
77
|
+
const onScroll = () => {
|
|
78
|
+
setIsScrolling(true);
|
|
79
|
+
clearTimeout(scrollTimerRef.current);
|
|
80
|
+
scrollTimerRef.current = setTimeout(() => setIsScrolling(false), 1000);
|
|
81
|
+
};
|
|
82
|
+
el.addEventListener('scroll', onScroll, { passive: true });
|
|
83
|
+
return () => {
|
|
84
|
+
el.removeEventListener('scroll', onScroll);
|
|
85
|
+
clearTimeout(scrollTimerRef.current);
|
|
86
|
+
};
|
|
87
|
+
}, [type]);
|
|
68
88
|
// Resolve theme with overrides
|
|
69
89
|
const resolvedTheme = useMemo(() => {
|
|
70
90
|
var _a, _b, _c;
|
|
@@ -75,7 +95,19 @@ const ScrollArea = React__default.forwardRef(({ children, type = 'hover', orient
|
|
|
75
95
|
});
|
|
76
96
|
}, [theme]);
|
|
77
97
|
// Determine overflow classes based on orientation
|
|
98
|
+
// For type='scroll', use overflow:overlay so scrollbar overlays content
|
|
78
99
|
const overflowClasses = useMemo(() => {
|
|
100
|
+
if (type === 'scroll') {
|
|
101
|
+
switch (orientation) {
|
|
102
|
+
case 'horizontal':
|
|
103
|
+
return 'overflow-x-[overlay] overflow-y-hidden';
|
|
104
|
+
case 'both':
|
|
105
|
+
return 'overflow-x-[overlay] overflow-y-[overlay]';
|
|
106
|
+
case 'vertical':
|
|
107
|
+
default:
|
|
108
|
+
return 'overflow-y-[overlay] overflow-x-hidden';
|
|
109
|
+
}
|
|
110
|
+
}
|
|
79
111
|
switch (orientation) {
|
|
80
112
|
case 'horizontal':
|
|
81
113
|
return 'overflow-x-auto overflow-y-hidden';
|
|
@@ -85,7 +117,7 @@ const ScrollArea = React__default.forwardRef(({ children, type = 'hover', orient
|
|
|
85
117
|
default:
|
|
86
118
|
return 'overflow-y-auto overflow-x-hidden';
|
|
87
119
|
}
|
|
88
|
-
}, [orientation]);
|
|
120
|
+
}, [orientation, type]);
|
|
89
121
|
// Scroll snap classes
|
|
90
122
|
// When snap is enabled for horizontal/both, the viewport becomes a flex container
|
|
91
123
|
// so that items are direct children of the scrollable element (required for snap-align).
|
|
@@ -107,9 +139,11 @@ const ScrollArea = React__default.forwardRef(({ children, type = 'hover', orient
|
|
|
107
139
|
return `${axisClass} ${strictnessClass} ${alignClass} ${layoutClass}`;
|
|
108
140
|
}, [snap, orientation, snapAlign]);
|
|
109
141
|
// Base scrollbar styling classes (shared across all types)
|
|
142
|
+
const scrollbarDimension = size === 'thin'
|
|
143
|
+
? '[&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar]:h-1'
|
|
144
|
+
: '[&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar]:h-2';
|
|
110
145
|
const scrollbarBase = [
|
|
111
|
-
|
|
112
|
-
'[&::-webkit-scrollbar]:h-2',
|
|
146
|
+
scrollbarDimension,
|
|
113
147
|
'[&::-webkit-scrollbar-track]:bg-transparent',
|
|
114
148
|
'[&::-webkit-scrollbar-thumb]:rounded-full',
|
|
115
149
|
'[&::-webkit-scrollbar-corner]:bg-transparent',
|
|
@@ -124,13 +158,21 @@ const ScrollArea = React__default.forwardRef(({ children, type = 'hover', orient
|
|
|
124
158
|
].join(' ');
|
|
125
159
|
case 'scroll':
|
|
126
160
|
return [
|
|
127
|
-
'[&::-webkit-scrollbar-thumb]:bg-
|
|
161
|
+
'[&::-webkit-scrollbar-thumb]:bg-transparent',
|
|
162
|
+
'[&[data-scrolling]::-webkit-scrollbar-thumb]:bg-black/30',
|
|
163
|
+
'[&::-webkit-scrollbar-thumb]:transition-colors',
|
|
164
|
+
'[&::-webkit-scrollbar-thumb]:duration-300',
|
|
128
165
|
].join(' ');
|
|
129
166
|
case 'hover':
|
|
130
167
|
return [
|
|
131
168
|
'[&::-webkit-scrollbar-thumb]:bg-transparent',
|
|
132
169
|
'[&:hover::-webkit-scrollbar-thumb]:bg-[var(--color-border)]',
|
|
133
170
|
].join(' ');
|
|
171
|
+
case 'none':
|
|
172
|
+
return [
|
|
173
|
+
'[&::-webkit-scrollbar]:!hidden',
|
|
174
|
+
'[scrollbar-width:none]',
|
|
175
|
+
].join(' ');
|
|
134
176
|
case 'auto':
|
|
135
177
|
default:
|
|
136
178
|
return [
|
|
@@ -138,7 +180,7 @@ const ScrollArea = React__default.forwardRef(({ children, type = 'hover', orient
|
|
|
138
180
|
].join(' ');
|
|
139
181
|
}
|
|
140
182
|
}, [type]);
|
|
141
|
-
return (jsx("div", { ref: internalRef, className: cn(resolvedTheme.baseStyle, overflowClasses, snapClasses, scrollbarBase, scrollbarVisibility, className), "data-orientation": orientation, "data-type": type, "data-smooth": smooth, ...props, children: children }));
|
|
183
|
+
return (jsx("div", { ref: internalRef, className: cn(resolvedTheme.baseStyle, overflowClasses, snapClasses, scrollbarBase, scrollbarVisibility, className), "data-orientation": orientation, "data-type": type, "data-smooth": smooth, "data-scrolling": isScrolling || undefined, ...props, children: children }));
|
|
142
184
|
});
|
|
143
185
|
ScrollArea.displayName = 'ScrollArea';
|
|
144
186
|
|
|
@@ -4,10 +4,17 @@ import { SmoothScrollConfig, ScrollProgress, PerformanceMetrics } from './smooth
|
|
|
4
4
|
* Scrollbar visibility behavior
|
|
5
5
|
* - 'auto': Standard browser behavior (show when content overflows)
|
|
6
6
|
* - 'always': Always show scrollbar
|
|
7
|
-
* - 'scroll':
|
|
7
|
+
* - 'scroll': Show scrollbar only while actively scrolling (overlay, no track)
|
|
8
8
|
* - 'hover': Show scrollbar only on hover
|
|
9
|
+
* - 'none': Hide scrollbar completely while keeping scroll functionality
|
|
9
10
|
*/
|
|
10
|
-
export type ScrollAreaType = 'auto' | 'always' | 'scroll' | 'hover';
|
|
11
|
+
export type ScrollAreaType = 'auto' | 'always' | 'scroll' | 'hover' | 'none';
|
|
12
|
+
/**
|
|
13
|
+
* Scrollbar size
|
|
14
|
+
* - 'default': 8px scrollbar (w-2/h-2)
|
|
15
|
+
* - 'thin': 4px scrollbar (w-1/h-1)
|
|
16
|
+
*/
|
|
17
|
+
export type ScrollAreaSize = 'default' | 'thin';
|
|
11
18
|
/**
|
|
12
19
|
* Theme structure for the ScrollArea component
|
|
13
20
|
*/
|
|
@@ -29,7 +36,7 @@ export interface ScrollAreaThemeOverrides {
|
|
|
29
36
|
*/
|
|
30
37
|
export interface ScrollAreaRef extends HTMLDivElement {
|
|
31
38
|
/** Programmatically scroll to position with smooth animation */
|
|
32
|
-
smoothScrollTo?: (position: number, options?:
|
|
39
|
+
smoothScrollTo?: (position: number, options?: import("./smooth/SmoothScrollEngine.types").ScrollToOptions) => void;
|
|
33
40
|
/** Get current scroll velocity */
|
|
34
41
|
getScrollVelocity?: () => number;
|
|
35
42
|
/** Pause smooth scrolling */
|
|
@@ -65,6 +72,8 @@ export interface ScrollAreaProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
65
72
|
children: ReactNode;
|
|
66
73
|
/** Scrollbar visibility behavior @default 'hover' */
|
|
67
74
|
type?: ScrollAreaType;
|
|
75
|
+
/** Scrollbar size @default 'default' */
|
|
76
|
+
size?: ScrollAreaSize;
|
|
68
77
|
/** Scroll direction @default 'vertical' */
|
|
69
78
|
orientation?: 'vertical' | 'horizontal' | 'both';
|
|
70
79
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ScrollArea } from './ScrollArea';
|
|
2
|
-
export type { ScrollAreaProps, ScrollAreaRef, ScrollAreaTheme, ScrollAreaThemeOverrides, ScrollAreaType, } from './ScrollArea.types';
|
|
2
|
+
export type { ScrollAreaProps, ScrollAreaRef, ScrollAreaTheme, ScrollAreaThemeOverrides, ScrollAreaType, ScrollAreaSize, } from './ScrollArea.types';
|
|
3
3
|
export { scrollAreaTheme } from './ScrollArea.theme';
|
|
4
4
|
export { useSmoothScroll } from './smooth/useSmoothScroll';
|
|
5
5
|
export type { SmoothScrollAPI, SmoothScrollConfig, ScrollProgress, ScrollToOptions, SnapPoint, EasingFunction, PerformanceMetrics, } from './smooth';
|
|
@@ -24,6 +24,6 @@ const SegmentedItem = React__default.forwardRef(({ value, disabled = false, chil
|
|
|
24
24
|
), onClick: handleClick, "data-value": value, "data-selected": isSelected, "data-disabled": isDisabled, ...props, children: children }));
|
|
25
25
|
});
|
|
26
26
|
// Set display name for dev tools and Storybook
|
|
27
|
-
SegmentedItem.displayName = "
|
|
27
|
+
SegmentedItem.displayName = "Segmented.Item";
|
|
28
28
|
|
|
29
29
|
export { SegmentedItem };
|
|
@@ -31,12 +31,13 @@ const SidebarDesktop = React__default.forwardRef(({ side = "left", variant = "si
|
|
|
31
31
|
variants: { ...sidebarTheme.variants, ...customTheme.variants },
|
|
32
32
|
sides: { ...sidebarTheme.sides, ...customTheme.sides },
|
|
33
33
|
}), [customTheme]);
|
|
34
|
+
const { onAnimationStart, onAnimationEnd, onDrag, onDragStart, onDragEnd, ...motionSafeProps } = props;
|
|
34
35
|
const sidebarClasses = cn(theme.baseStyle, theme.variants[variant], theme.sides[side], className);
|
|
35
36
|
const animateValue = useMemo(() => ({
|
|
36
37
|
width: collapsed ? collapsedWidth : expandedWidth,
|
|
37
38
|
maxWidth: "100vw",
|
|
38
39
|
}), [collapsed, collapsedWidth, expandedWidth]);
|
|
39
|
-
return (jsx(motion.div, { ref: ref, className: sidebarClasses, "data-side": side, "data-variant": variant, "data-collapsed": collapsed, initial: false, animate: animateValue, transition: SIDEBAR_TRANSITION, ...
|
|
40
|
+
return (jsx(motion.div, { ref: ref, className: sidebarClasses, "data-side": side, "data-variant": variant, "data-collapsed": collapsed, initial: false, animate: animateValue, transition: SIDEBAR_TRANSITION, ...motionSafeProps, children: children }));
|
|
40
41
|
});
|
|
41
42
|
SidebarDesktop.displayName = "SidebarDesktop";
|
|
42
43
|
const SidebarMobile = ({ children, className, theme: customTheme = {} }) => {
|
|
@@ -21,7 +21,8 @@ const SidebarMobileTrigger = React__default.forwardRef(({ icon, className, onCli
|
|
|
21
21
|
setMobileOpen(true);
|
|
22
22
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
const { onAnimationStart, onAnimationEnd, onDrag, onDragStart, onDragEnd, color: _color, ...buttonProps } = props;
|
|
25
|
+
return (jsx(Button, { ref: ref, variant: "soft", size: "sm", className: cn("size-9 p-0", className), onClick: handleClick, "aria-label": "Open navigation menu", ...buttonProps, children: icon || jsx(Bars3Icon, { className: "size-5" }) }));
|
|
25
26
|
});
|
|
26
27
|
SidebarMobileTrigger.displayName = "SidebarMobileTrigger";
|
|
27
28
|
|
|
@@ -19,7 +19,8 @@ const SidebarToggle = React__default.forwardRef(({ expandIcon, collapseIcon, cla
|
|
|
19
19
|
toggleCollapsed();
|
|
20
20
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
const { onAnimationStart, onAnimationEnd, onDrag, onDragStart, onDragEnd, color: _color, ...buttonProps } = props;
|
|
23
|
+
return (jsx(Button, { ref: ref, variant: "soft", size: "sm", className: cn("size-8 p-0", className), onClick: handleClick, "aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar", title: collapsed ? "Expand sidebar" : "Collapse sidebar", ...buttonProps, children: jsx(motion.div, { initial: false, animate: { rotate: collapsed ? 180 : 0 }, transition: { duration: 0.2 }, children: collapsed
|
|
23
24
|
? expandIcon || jsx(ChevronRightIcon, { className: "size-4" })
|
|
24
25
|
: collapseIcon || jsx(ChevronLeftIcon, { className: "size-4" }) }) }));
|
|
25
26
|
});
|