@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,20 +0,0 @@
|
|
|
1
|
-
const thinkingIndicatorTheme = {
|
|
2
|
-
baseStyle: "inline-flex items-center gap-2",
|
|
3
|
-
labelStyle: "text-[var(--color-text-muted)] font-medium",
|
|
4
|
-
dotsContainerStyle: "inline-flex items-center gap-1",
|
|
5
|
-
dotStyle: "rounded-full bg-[var(--color-text-muted)]",
|
|
6
|
-
sizes: {
|
|
7
|
-
sm: {
|
|
8
|
-
container: "py-1",
|
|
9
|
-
dot: "size-1",
|
|
10
|
-
label: "text-sm",
|
|
11
|
-
},
|
|
12
|
-
md: {
|
|
13
|
-
container: "py-1",
|
|
14
|
-
dot: "size-1.5",
|
|
15
|
-
label: "text-base",
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { thinkingIndicatorTheme };
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* ThinkingIndicator component props
|
|
4
|
-
*/
|
|
5
|
-
export interface ThinkingIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
/**
|
|
7
|
-
* Whether the indicator is visible
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
visible?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Custom label text
|
|
13
|
-
* @default "AI is thinking"
|
|
14
|
-
*/
|
|
15
|
-
label?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to show the label text
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
20
|
-
showLabel?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Size variant
|
|
23
|
-
* @default "md"
|
|
24
|
-
*/
|
|
25
|
-
size?: ThinkingIndicatorSize;
|
|
26
|
-
/**
|
|
27
|
-
* Custom icon to display instead of dots
|
|
28
|
-
*/
|
|
29
|
-
icon?: ReactNode;
|
|
30
|
-
/**
|
|
31
|
-
* Additional className for the container
|
|
32
|
-
*/
|
|
33
|
-
className?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Theme overrides
|
|
36
|
-
*/
|
|
37
|
-
theme?: ThinkingIndicatorThemeOverrides;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Size variants
|
|
41
|
-
*/
|
|
42
|
-
export type ThinkingIndicatorSize = "sm" | "md";
|
|
43
|
-
/**
|
|
44
|
-
* Theme configuration
|
|
45
|
-
*/
|
|
46
|
-
export interface ThinkingIndicatorTheme {
|
|
47
|
-
baseStyle: string;
|
|
48
|
-
labelStyle: string;
|
|
49
|
-
dotsContainerStyle: string;
|
|
50
|
-
dotStyle: string;
|
|
51
|
-
sizes: Record<ThinkingIndicatorSize, ThinkingIndicatorSizeConfig>;
|
|
52
|
-
}
|
|
53
|
-
export interface ThinkingIndicatorSizeConfig {
|
|
54
|
-
container: string;
|
|
55
|
-
dot: string;
|
|
56
|
-
label: string;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Theme overrides
|
|
60
|
-
*/
|
|
61
|
-
export interface ThinkingIndicatorThemeOverrides {
|
|
62
|
-
baseStyle?: string;
|
|
63
|
-
labelStyle?: string;
|
|
64
|
-
dotsContainerStyle?: string;
|
|
65
|
-
dotStyle?: string;
|
|
66
|
-
sizes?: Partial<Record<ThinkingIndicatorSize, Partial<ThinkingIndicatorSizeConfig>>>;
|
|
67
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { ThinkingIndicator } from "./ThinkingIndicator";
|
|
2
|
-
export { thinkingIndicatorTheme } from "./ThinkingIndicator.theme";
|
|
3
|
-
export type { ThinkingIndicatorProps, ThinkingIndicatorSize, ThinkingIndicatorTheme, ThinkingIndicatorThemeOverrides, ThinkingIndicatorSizeConfig, } from "./ThinkingIndicator.types";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Variants } from "motion/react";
|
|
2
|
-
/**
|
|
3
|
-
* Get animation variants for items entering/exiting lists.
|
|
4
|
-
* Items slide and fade in from the transfer direction.
|
|
5
|
-
*/
|
|
6
|
-
export declare const getItemVariants: (shouldReduceMotion: boolean | null) => Variants | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Get staggered list animation variants for initial render
|
|
9
|
-
*/
|
|
10
|
-
export declare const getListVariants: (shouldReduceMotion: boolean | null) => Variants | undefined;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get animation variants for items entering/exiting lists.
|
|
3
|
-
* Items slide and fade in from the transfer direction.
|
|
4
|
-
*/
|
|
5
|
-
const getItemVariants = (shouldReduceMotion) => (shouldReduceMotion !== null && shouldReduceMotion !== void 0 ? shouldReduceMotion : false)
|
|
6
|
-
? undefined
|
|
7
|
-
: {
|
|
8
|
-
initial: {
|
|
9
|
-
opacity: 0,
|
|
10
|
-
x: 0,
|
|
11
|
-
height: 0,
|
|
12
|
-
},
|
|
13
|
-
animate: {
|
|
14
|
-
opacity: 1,
|
|
15
|
-
x: 0,
|
|
16
|
-
height: "auto",
|
|
17
|
-
transition: {
|
|
18
|
-
duration: 0.2,
|
|
19
|
-
ease: "easeOut",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
exit: {
|
|
23
|
-
opacity: 0,
|
|
24
|
-
height: 0,
|
|
25
|
-
transition: {
|
|
26
|
-
duration: 0.15,
|
|
27
|
-
ease: "easeIn",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { getItemVariants };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { TransferListProps } from "./TransferList.types";
|
|
3
|
-
/**
|
|
4
|
-
* TransferList is a dual-list picker for moving items between a source
|
|
5
|
-
* (available) list and a target (selected) list. Commonly used in
|
|
6
|
-
* admin/permissions interfaces for assigning roles, features, or users.
|
|
7
|
-
*
|
|
8
|
-
* Supports controlled (value + onChange) and uncontrolled (defaultValue)
|
|
9
|
-
* patterns, optional search filtering, multi-select with checkboxes,
|
|
10
|
-
* custom item renderers, disabled items, and animated transitions.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* <TransferList
|
|
15
|
-
* items={[
|
|
16
|
-
* { id: '1', label: 'Read' },
|
|
17
|
-
* { id: '2', label: 'Write' },
|
|
18
|
-
* { id: '3', label: 'Delete' },
|
|
19
|
-
* ]}
|
|
20
|
-
* value={selectedPermissions}
|
|
21
|
-
* onChange={setSelectedPermissions}
|
|
22
|
-
* sourceTitle="Available Permissions"
|
|
23
|
-
* targetTitle="Assigned Permissions"
|
|
24
|
-
* searchable
|
|
25
|
-
* />
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare const TransferList: React.ForwardRefExoticComponent<TransferListProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import React__default, { useState, useMemo, useCallback } from 'react';
|
|
3
|
-
import { useReducedMotion, AnimatePresence, motion } from 'motion/react';
|
|
4
|
-
import { ChevronDoubleRightIcon, ChevronRightIcon, ChevronLeftIcon, ChevronDoubleLeftIcon, MagnifyingGlassIcon } from '@heroicons/react/24/outline';
|
|
5
|
-
import { cn } from '../../../utils/cn.js';
|
|
6
|
-
import { transferListTheme } from './TransferList.theme.js';
|
|
7
|
-
import { getItemVariants } from './TransferList.animations.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* TransferList is a dual-list picker for moving items between a source
|
|
11
|
-
* (available) list and a target (selected) list. Commonly used in
|
|
12
|
-
* admin/permissions interfaces for assigning roles, features, or users.
|
|
13
|
-
*
|
|
14
|
-
* Supports controlled (value + onChange) and uncontrolled (defaultValue)
|
|
15
|
-
* patterns, optional search filtering, multi-select with checkboxes,
|
|
16
|
-
* custom item renderers, disabled items, and animated transitions.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```tsx
|
|
20
|
-
* <TransferList
|
|
21
|
-
* items={[
|
|
22
|
-
* { id: '1', label: 'Read' },
|
|
23
|
-
* { id: '2', label: 'Write' },
|
|
24
|
-
* { id: '3', label: 'Delete' },
|
|
25
|
-
* ]}
|
|
26
|
-
* value={selectedPermissions}
|
|
27
|
-
* onChange={setSelectedPermissions}
|
|
28
|
-
* sourceTitle="Available Permissions"
|
|
29
|
-
* targetTitle="Assigned Permissions"
|
|
30
|
-
* searchable
|
|
31
|
-
* />
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
const TransferList = React__default.forwardRef(({ items, value: controlledValue, defaultValue = [], onChange, sourceTitle = "Available", targetTitle = "Selected", searchable = false, size = "md", renderItem, className, ...restProps }, ref) => {
|
|
35
|
-
const shouldReduceMotion = useReducedMotion();
|
|
36
|
-
const itemVariants = getItemVariants(shouldReduceMotion);
|
|
37
|
-
// Controlled vs uncontrolled state for target IDs
|
|
38
|
-
const isControlled = controlledValue !== undefined;
|
|
39
|
-
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
40
|
-
const targetIds = isControlled ? controlledValue : internalValue;
|
|
41
|
-
// Selection state for checkboxes in each list
|
|
42
|
-
const [sourceSelected, setSourceSelected] = useState(new Set());
|
|
43
|
-
const [targetSelected, setTargetSelected] = useState(new Set());
|
|
44
|
-
// Search/filter state
|
|
45
|
-
const [sourceSearch, setSourceSearch] = useState("");
|
|
46
|
-
const [targetSearch, setTargetSearch] = useState("");
|
|
47
|
-
const theme = transferListTheme;
|
|
48
|
-
const sizeStyles = theme.sizes[size];
|
|
49
|
-
// Build a lookup map for items by ID
|
|
50
|
-
const itemMap = useMemo(() => {
|
|
51
|
-
const map = new Map();
|
|
52
|
-
for (const item of items) {
|
|
53
|
-
map.set(item.id, item);
|
|
54
|
-
}
|
|
55
|
-
return map;
|
|
56
|
-
}, [items]);
|
|
57
|
-
// Derive target IDs set for fast lookup
|
|
58
|
-
const targetIdSet = useMemo(() => new Set(targetIds), [targetIds]);
|
|
59
|
-
// Split items into source and target lists
|
|
60
|
-
const sourceItems = useMemo(() => items.filter((item) => !targetIdSet.has(item.id)), [items, targetIdSet]);
|
|
61
|
-
const targetItems = useMemo(() => targetIds
|
|
62
|
-
.map((id) => itemMap.get(id))
|
|
63
|
-
.filter((item) => item !== undefined), [targetIds, itemMap]);
|
|
64
|
-
// Filter items by search query
|
|
65
|
-
const filteredSourceItems = useMemo(() => {
|
|
66
|
-
if (!sourceSearch.trim())
|
|
67
|
-
return sourceItems;
|
|
68
|
-
const query = sourceSearch.toLowerCase();
|
|
69
|
-
return sourceItems.filter((item) => item.label.toLowerCase().includes(query));
|
|
70
|
-
}, [sourceItems, sourceSearch]);
|
|
71
|
-
const filteredTargetItems = useMemo(() => {
|
|
72
|
-
if (!targetSearch.trim())
|
|
73
|
-
return targetItems;
|
|
74
|
-
const query = targetSearch.toLowerCase();
|
|
75
|
-
return targetItems.filter((item) => item.label.toLowerCase().includes(query));
|
|
76
|
-
}, [targetItems, targetSearch]);
|
|
77
|
-
// Update the target list value
|
|
78
|
-
const updateValue = useCallback((newTargetIds) => {
|
|
79
|
-
if (!isControlled) {
|
|
80
|
-
setInternalValue(newTargetIds);
|
|
81
|
-
}
|
|
82
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(newTargetIds);
|
|
83
|
-
}, [isControlled, onChange]);
|
|
84
|
-
// Transfer selected source items to target
|
|
85
|
-
const handleMoveToTarget = useCallback(() => {
|
|
86
|
-
const idsToMove = Array.from(sourceSelected).filter((id) => {
|
|
87
|
-
const item = itemMap.get(id);
|
|
88
|
-
return item && !item.disabled;
|
|
89
|
-
});
|
|
90
|
-
if (idsToMove.length === 0)
|
|
91
|
-
return;
|
|
92
|
-
const newTargetIds = [...targetIds, ...idsToMove];
|
|
93
|
-
updateValue(newTargetIds);
|
|
94
|
-
setSourceSelected(new Set());
|
|
95
|
-
}, [sourceSelected, targetIds, updateValue, itemMap]);
|
|
96
|
-
// Transfer selected target items back to source
|
|
97
|
-
const handleMoveToSource = useCallback(() => {
|
|
98
|
-
const idsToMove = new Set(Array.from(targetSelected).filter((id) => {
|
|
99
|
-
const item = itemMap.get(id);
|
|
100
|
-
return item && !item.disabled;
|
|
101
|
-
}));
|
|
102
|
-
if (idsToMove.size === 0)
|
|
103
|
-
return;
|
|
104
|
-
const newTargetIds = targetIds.filter((id) => !idsToMove.has(id));
|
|
105
|
-
updateValue(newTargetIds);
|
|
106
|
-
setTargetSelected(new Set());
|
|
107
|
-
}, [targetSelected, targetIds, updateValue, itemMap]);
|
|
108
|
-
// Move all non-disabled source items to target
|
|
109
|
-
const handleMoveAllToTarget = useCallback(() => {
|
|
110
|
-
const nonDisabledSourceIds = sourceItems
|
|
111
|
-
.filter((item) => !item.disabled)
|
|
112
|
-
.map((item) => item.id);
|
|
113
|
-
if (nonDisabledSourceIds.length === 0)
|
|
114
|
-
return;
|
|
115
|
-
const newTargetIds = [...targetIds, ...nonDisabledSourceIds];
|
|
116
|
-
updateValue(newTargetIds);
|
|
117
|
-
setSourceSelected(new Set());
|
|
118
|
-
}, [sourceItems, targetIds, updateValue]);
|
|
119
|
-
// Move all non-disabled target items back to source
|
|
120
|
-
const handleMoveAllToSource = useCallback(() => {
|
|
121
|
-
const disabledTargetIds = targetItems
|
|
122
|
-
.filter((item) => item.disabled)
|
|
123
|
-
.map((item) => item.id);
|
|
124
|
-
updateValue(disabledTargetIds);
|
|
125
|
-
setTargetSelected(new Set());
|
|
126
|
-
}, [targetItems, updateValue]);
|
|
127
|
-
// Toggle an individual item's selection
|
|
128
|
-
const toggleSelection = useCallback((id, selected, setSelected) => {
|
|
129
|
-
const item = itemMap.get(id);
|
|
130
|
-
if (item === null || item === void 0 ? void 0 : item.disabled)
|
|
131
|
-
return;
|
|
132
|
-
const next = new Set(selected);
|
|
133
|
-
if (next.has(id)) {
|
|
134
|
-
next.delete(id);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
next.add(id);
|
|
138
|
-
}
|
|
139
|
-
setSelected(next);
|
|
140
|
-
}, [itemMap]);
|
|
141
|
-
// Toggle select-all for a given list
|
|
142
|
-
const toggleSelectAll = useCallback((listItems, selected, setSelected) => {
|
|
143
|
-
const selectableItems = listItems.filter((item) => !item.disabled);
|
|
144
|
-
const allSelected = selectableItems.every((item) => selected.has(item.id));
|
|
145
|
-
if (allSelected) {
|
|
146
|
-
setSelected(new Set());
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
setSelected(new Set(selectableItems.map((item) => item.id)));
|
|
150
|
-
}
|
|
151
|
-
}, []);
|
|
152
|
-
// Compute select-all checkbox states
|
|
153
|
-
const sourceSelectableItems = filteredSourceItems.filter((i) => !i.disabled);
|
|
154
|
-
const targetSelectableItems = filteredTargetItems.filter((i) => !i.disabled);
|
|
155
|
-
const sourceAllSelected = sourceSelectableItems.length > 0 &&
|
|
156
|
-
sourceSelectableItems.every((item) => sourceSelected.has(item.id));
|
|
157
|
-
const sourceIndeterminate = !sourceAllSelected &&
|
|
158
|
-
sourceSelectableItems.some((item) => sourceSelected.has(item.id));
|
|
159
|
-
const targetAllSelected = targetSelectableItems.length > 0 &&
|
|
160
|
-
targetSelectableItems.every((item) => targetSelected.has(item.id));
|
|
161
|
-
const targetIndeterminate = !targetAllSelected &&
|
|
162
|
-
targetSelectableItems.some((item) => targetSelected.has(item.id));
|
|
163
|
-
// Icon size classes per size variant
|
|
164
|
-
const iconSize = size === "sm" ? "w-3.5 h-3.5" : size === "lg" ? "w-5 h-5" : "w-4 h-4";
|
|
165
|
-
const searchIconSize = size === "sm" ? "w-3.5 h-3.5" : size === "lg" ? "w-5 h-5" : "w-4 h-4";
|
|
166
|
-
const searchIconPosition = size === "sm" ? "left-2" : size === "lg" ? "left-3" : "left-2.5";
|
|
167
|
-
// Checkbox size
|
|
168
|
-
const checkboxSize = size === "sm" ? "w-3.5 h-3.5" : size === "lg" ? "w-5 h-5" : "w-4 h-4";
|
|
169
|
-
// Render a single list panel
|
|
170
|
-
const renderPanel = (title, listItems, filteredItems, selected, setSelected, search, setSearch, allSelected, indeterminate, panelAriaLabel) => {
|
|
171
|
-
const selectableCount = filteredItems.filter((i) => !i.disabled).length;
|
|
172
|
-
const selectedCount = Array.from(selected).filter((id) => filteredItems.some((item) => item.id === id)).length;
|
|
173
|
-
return (jsxs("div", { className: cn(theme.panelStyle, sizeStyles.panel), role: "listbox", "aria-label": panelAriaLabel, "aria-multiselectable": "true", children: [jsxs("div", { className: theme.headerStyle, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("input", { type: "checkbox", checked: allSelected, ref: (el) => {
|
|
174
|
-
if (el)
|
|
175
|
-
el.indeterminate = indeterminate;
|
|
176
|
-
}, onChange: () => toggleSelectAll(filteredItems, selected, setSelected), disabled: selectableCount === 0, className: cn(checkboxSize, "rounded-[calc(var(--radius-base)*0.5)] border-2 border-[var(--color-border)] accent-[var(--color-primary)] cursor-pointer disabled:cursor-not-allowed disabled:opacity-50"), "aria-label": `Select all ${title}` }), jsx("span", { className: cn(theme.titleStyle, size === "sm" ? "text-sm" : "text-base"), children: title })] }), jsxs("span", { className: cn(theme.countStyle, size === "sm" ? "text-sm" : "text-sm"), children: [selectedCount > 0 ? `${selectedCount}/` : "", listItems.length] })] }), searchable && (jsxs("div", { className: theme.searchWrapperStyle, children: [jsx(MagnifyingGlassIcon, { className: cn(searchIconSize, "absolute text-[var(--color-text-placeholder)] pointer-events-none", searchIconPosition) }), jsx("input", { type: "text", value: search, onChange: (e) => setSearch(e.target.value), placeholder: "Search...", className: cn(theme.searchInputStyle, sizeStyles.searchInput), "aria-label": `Search ${title}` })] })), jsxs("div", { className: theme.listStyle, children: [jsx(AnimatePresence, { mode: "popLayout", initial: false, children: filteredItems.map((item) => {
|
|
177
|
-
const isSelected = selected.has(item.id);
|
|
178
|
-
const isDisabled = item.disabled === true;
|
|
179
|
-
const itemContent = (jsxs(Fragment, { children: [jsx("input", { type: "checkbox", checked: isSelected, onChange: () => toggleSelection(item.id, selected, setSelected), disabled: isDisabled, className: cn(checkboxSize, "rounded-[calc(var(--radius-base)*0.5)] border-2 border-[var(--color-border)] accent-[var(--color-primary)] cursor-pointer flex-shrink-0", isDisabled && "cursor-not-allowed"), tabIndex: -1, "aria-hidden": "true" }), jsx("span", { className: "truncate flex-1", children: renderItem ? renderItem(item) : item.label })] }));
|
|
180
|
-
const itemProps = {
|
|
181
|
-
key: item.id,
|
|
182
|
-
role: "option",
|
|
183
|
-
"aria-selected": isSelected,
|
|
184
|
-
"aria-disabled": isDisabled,
|
|
185
|
-
"data-selected": isSelected ? "true" : "false",
|
|
186
|
-
onClick: () => toggleSelection(item.id, selected, setSelected),
|
|
187
|
-
className: cn(theme.itemStyle, sizeStyles.item, isDisabled && theme.itemDisabledStyle),
|
|
188
|
-
};
|
|
189
|
-
if (itemVariants) {
|
|
190
|
-
return (jsx(motion.div, { ...itemProps, layout: true, variants: itemVariants, initial: "initial", animate: "animate", exit: "exit", children: itemContent }));
|
|
191
|
-
}
|
|
192
|
-
return jsx("div", { ...itemProps, children: itemContent });
|
|
193
|
-
}) }), filteredItems.length === 0 && (jsx("div", { className: cn("flex items-center justify-center text-[var(--color-text-muted)]", size === "sm" ? "py-4 text-sm" : size === "lg" ? "py-8 text-base" : "py-6 text-sm"), children: search.trim() ? "No matches found" : "No items" }))] })] }));
|
|
194
|
-
};
|
|
195
|
-
return (jsxs("div", { ref: ref, className: cn(theme.baseStyle, className), ...restProps, children: [renderPanel(sourceTitle, sourceItems, filteredSourceItems, sourceSelected, setSourceSelected, sourceSearch, setSourceSearch, sourceAllSelected, sourceIndeterminate, sourceTitle), jsxs("div", { className: theme.actionsStyle, children: [jsx("button", { type: "button", onClick: handleMoveAllToTarget, disabled: sourceItems.filter((i) => !i.disabled).length === 0, className: cn(theme.buttonStyle, sizeStyles.button), "aria-label": "Move all to target", children: jsx(ChevronDoubleRightIcon, { className: iconSize }) }), jsx("button", { type: "button", onClick: handleMoveToTarget, disabled: sourceSelected.size === 0, className: cn(theme.buttonStyle, sizeStyles.button), "aria-label": "Move selected to target", children: jsx(ChevronRightIcon, { className: iconSize }) }), jsx("button", { type: "button", onClick: handleMoveToSource, disabled: targetSelected.size === 0, className: cn(theme.buttonStyle, sizeStyles.button), "aria-label": "Move selected to source", children: jsx(ChevronLeftIcon, { className: iconSize }) }), jsx("button", { type: "button", onClick: handleMoveAllToSource, disabled: targetItems.filter((i) => !i.disabled).length === 0, className: cn(theme.buttonStyle, sizeStyles.button), "aria-label": "Move all to source", children: jsx(ChevronDoubleLeftIcon, { className: iconSize }) })] }), renderPanel(targetTitle, targetItems, filteredTargetItems, targetSelected, setTargetSelected, targetSearch, setTargetSearch, targetAllSelected, targetIndeterminate, targetTitle)] }));
|
|
196
|
-
});
|
|
197
|
-
TransferList.displayName = "TransferList";
|
|
198
|
-
|
|
199
|
-
export { TransferList };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default theme configuration for the TransferList component.
|
|
3
|
-
* Uses CSS variables from global.scss for consistent theming.
|
|
4
|
-
*/
|
|
5
|
-
const transferListTheme = {
|
|
6
|
-
// Root container - horizontal layout with centered actions
|
|
7
|
-
baseStyle: "flex items-stretch gap-0",
|
|
8
|
-
// Individual list panel
|
|
9
|
-
panelStyle: "flex flex-col border border-[var(--color-border)] rounded-[var(--form-radius)] bg-[var(--color-surface)] overflow-hidden",
|
|
10
|
-
// Panel header with title and count
|
|
11
|
-
headerStyle: "flex items-center justify-between px-3 py-2 border-b border-[var(--color-border)] bg-[var(--color-background-secondary)]",
|
|
12
|
-
// Title text
|
|
13
|
-
titleStyle: "font-medium text-[var(--color-text-primary)]",
|
|
14
|
-
// Item count badge
|
|
15
|
-
countStyle: "text-[var(--color-text-muted)] tabular-nums",
|
|
16
|
-
// Search input wrapper
|
|
17
|
-
searchWrapperStyle: "relative flex items-center border-b border-[var(--color-border)]",
|
|
18
|
-
// Search input
|
|
19
|
-
searchInputStyle: "w-full bg-transparent text-[var(--color-text-primary)] placeholder:text-[var(--color-text-placeholder)] focus:outline-none",
|
|
20
|
-
// Scrollable list container
|
|
21
|
-
listStyle: "flex-1 overflow-y-auto",
|
|
22
|
-
// Individual item row
|
|
23
|
-
itemStyle: "flex items-center gap-2 cursor-pointer transition-colors duration-150 " +
|
|
24
|
-
"hover:bg-[var(--color-background-secondary)] " +
|
|
25
|
-
"data-[selected=true]:bg-[var(--color-primary-50)]",
|
|
26
|
-
// Disabled item overlay
|
|
27
|
-
itemDisabledStyle: "opacity-50 cursor-not-allowed hover:bg-transparent",
|
|
28
|
-
// Actions column with transfer buttons
|
|
29
|
-
actionsStyle: "flex flex-col items-center justify-center gap-1 px-2",
|
|
30
|
-
// Transfer button
|
|
31
|
-
buttonStyle: "inline-flex items-center justify-center rounded-[var(--form-radius)] border border-[var(--color-border)] " +
|
|
32
|
-
"bg-[var(--color-surface)] text-[var(--color-text-secondary)] " +
|
|
33
|
-
"transition-all duration-150 " +
|
|
34
|
-
"hover:bg-[var(--color-background-secondary)] hover:text-[var(--color-text-primary)] hover:border-[var(--color-border-secondary)] " +
|
|
35
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-1 " +
|
|
36
|
-
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-[var(--color-surface)] disabled:hover:text-[var(--color-text-secondary)] disabled:hover:border-[var(--color-border)]",
|
|
37
|
-
// Size variants
|
|
38
|
-
sizes: {
|
|
39
|
-
sm: {
|
|
40
|
-
panel: "w-56 h-64",
|
|
41
|
-
item: "px-2 py-1 text-sm gap-1.5",
|
|
42
|
-
button: "p-1",
|
|
43
|
-
searchInput: "px-2 py-1.5 text-sm pl-7",
|
|
44
|
-
},
|
|
45
|
-
md: {
|
|
46
|
-
panel: "w-72 h-80",
|
|
47
|
-
item: "px-3 py-1.5 text-base gap-2",
|
|
48
|
-
button: "p-1.5",
|
|
49
|
-
searchInput: "px-3 py-2 text-base pl-8",
|
|
50
|
-
},
|
|
51
|
-
lg: {
|
|
52
|
-
panel: "w-80 h-96",
|
|
53
|
-
item: "px-3 py-2 text-lg gap-2.5",
|
|
54
|
-
button: "p-2",
|
|
55
|
-
searchInput: "px-3 py-2.5 text-lg pl-9",
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export { transferListTheme };
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Size variants for the TransferList component
|
|
4
|
-
*/
|
|
5
|
-
export type TransferListSize = "sm" | "md" | "lg";
|
|
6
|
-
/**
|
|
7
|
-
* Individual item in the TransferList
|
|
8
|
-
*/
|
|
9
|
-
export interface TransferListItem {
|
|
10
|
-
/** Unique identifier for the item */
|
|
11
|
-
id: string;
|
|
12
|
-
/** Display label for the item */
|
|
13
|
-
label: string;
|
|
14
|
-
/** Whether the item is disabled and cannot be transferred */
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
/** Allow custom data to be attached to the item */
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* TransferList component props
|
|
21
|
-
*
|
|
22
|
-
* Supports both controlled (value + onChange) and uncontrolled (defaultValue) patterns.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```tsx
|
|
26
|
-
* // Controlled
|
|
27
|
-
* <TransferList
|
|
28
|
-
* items={items}
|
|
29
|
-
* value={selectedIds}
|
|
30
|
-
* onChange={setSelectedIds}
|
|
31
|
-
* sourceTitle="Available"
|
|
32
|
-
* targetTitle="Selected"
|
|
33
|
-
* />
|
|
34
|
-
*
|
|
35
|
-
* // Uncontrolled
|
|
36
|
-
* <TransferList
|
|
37
|
-
* items={items}
|
|
38
|
-
* defaultValue={['item-1', 'item-2']}
|
|
39
|
-
* sourceTitle="Available"
|
|
40
|
-
* targetTitle="Selected"
|
|
41
|
-
* />
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export interface TransferListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
45
|
-
/** All available items for both lists */
|
|
46
|
-
items: TransferListItem[];
|
|
47
|
-
/** IDs of items currently in the target list (controlled mode) */
|
|
48
|
-
value?: string[];
|
|
49
|
-
/** Default IDs of items in the target list (uncontrolled mode) */
|
|
50
|
-
defaultValue?: string[];
|
|
51
|
-
/** Callback when target list changes */
|
|
52
|
-
onChange?: (targetIds: string[]) => void;
|
|
53
|
-
/** Title displayed above the source list */
|
|
54
|
-
sourceTitle?: string;
|
|
55
|
-
/** Title displayed above the target list */
|
|
56
|
-
targetTitle?: string;
|
|
57
|
-
/** Whether to show search/filter inputs for each list */
|
|
58
|
-
searchable?: boolean;
|
|
59
|
-
/** Size variant affecting padding and text size */
|
|
60
|
-
size?: TransferListSize;
|
|
61
|
-
/** Custom renderer for each item in both lists */
|
|
62
|
-
renderItem?: (item: TransferListItem) => React.ReactNode;
|
|
63
|
-
/** Additional className for the root container */
|
|
64
|
-
className?: string;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Theme configuration for the TransferList component
|
|
68
|
-
*/
|
|
69
|
-
export interface TransferListTheme {
|
|
70
|
-
/** Root container style */
|
|
71
|
-
baseStyle: string;
|
|
72
|
-
/** Individual list panel style */
|
|
73
|
-
panelStyle: string;
|
|
74
|
-
/** Panel header (title + count) style */
|
|
75
|
-
headerStyle: string;
|
|
76
|
-
/** Title text style */
|
|
77
|
-
titleStyle: string;
|
|
78
|
-
/** Item count badge style */
|
|
79
|
-
countStyle: string;
|
|
80
|
-
/** Search input wrapper style */
|
|
81
|
-
searchWrapperStyle: string;
|
|
82
|
-
/** Search input style */
|
|
83
|
-
searchInputStyle: string;
|
|
84
|
-
/** Scrollable list container style */
|
|
85
|
-
listStyle: string;
|
|
86
|
-
/** Individual item row style */
|
|
87
|
-
itemStyle: string;
|
|
88
|
-
/** Disabled item style */
|
|
89
|
-
itemDisabledStyle: string;
|
|
90
|
-
/** Actions column (transfer buttons) style */
|
|
91
|
-
actionsStyle: string;
|
|
92
|
-
/** Transfer button style */
|
|
93
|
-
buttonStyle: string;
|
|
94
|
-
/** Size variants */
|
|
95
|
-
sizes: Record<TransferListSize, {
|
|
96
|
-
panel: string;
|
|
97
|
-
item: string;
|
|
98
|
-
button: string;
|
|
99
|
-
searchInput: string;
|
|
100
|
-
}>;
|
|
101
|
-
}
|
package/dist/icons/Icon.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
4
|
-
color?: string;
|
|
5
|
-
strokeWidth?: number;
|
|
6
|
-
className?: string;
|
|
7
|
-
/**
|
|
8
|
-
* Force dark mode styling for the icon. Use when placing the icon
|
|
9
|
-
* on a dark background while the page is in light mode. This applies the
|
|
10
|
-
* 'dark' class to the container, making the icon use light colors for visibility.
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
darkMode?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface IconComponent extends React.FC<IconProps> {
|
|
16
|
-
displayName?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Icon factory function to create consistent icons
|
|
20
|
-
* @param Svg - The SVG component to render
|
|
21
|
-
* @param displayName - The display name for the component
|
|
22
|
-
* @returns A standardized Icon component
|
|
23
|
-
*/
|
|
24
|
-
export declare function createIcon(Svg: React.FC<IconProps>, displayName: string): IconComponent;
|
package/dist/icons/Icon.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Icon factory function to create consistent icons
|
|
5
|
-
* @param Svg - The SVG component to render
|
|
6
|
-
* @param displayName - The display name for the component
|
|
7
|
-
* @returns A standardized Icon component
|
|
8
|
-
*/
|
|
9
|
-
function createIcon(Svg, displayName) {
|
|
10
|
-
const Icon = ({ size = 'md', color = 'currentColor', strokeWidth = 2, className = '', darkMode = false, ...props }) => {
|
|
11
|
-
// Map size names to pixel values
|
|
12
|
-
const sizeMap = {
|
|
13
|
-
xs: '16px',
|
|
14
|
-
sm: '20px',
|
|
15
|
-
md: '24px',
|
|
16
|
-
lg: '32px',
|
|
17
|
-
xl: '40px',
|
|
18
|
-
};
|
|
19
|
-
const pixelSize = typeof size === 'string' ? sizeMap[size] || '24px' : `${size}px`;
|
|
20
|
-
const svg = (jsx(Svg, { width: pixelSize, height: pixelSize, fill: "none", stroke: color, strokeWidth: strokeWidth, className: className, "aria-hidden": "true", style: { width: pixelSize, height: pixelSize, ...props.style }, ...props }));
|
|
21
|
-
if (darkMode) {
|
|
22
|
-
return (jsx("span", { className: "dark inline-flex", children: svg }));
|
|
23
|
-
}
|
|
24
|
-
return svg;
|
|
25
|
-
};
|
|
26
|
-
Icon.displayName = displayName;
|
|
27
|
-
return Icon;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { createIcon };
|
package/dist/icons/Index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from './Icon';
|
|
2
|
-
export * from './core/PlusIcon';
|
|
3
|
-
export * from './core/MinusIcon';
|
|
4
|
-
export * from './core/SearchIcon';
|
|
5
|
-
export * from './core/LockIcon';
|
|
6
|
-
export * from './core/DollarIcon';
|
|
7
|
-
export * from './core/TickIcon';
|
|
8
|
-
import React from 'react';
|
|
9
|
-
interface IconProps {
|
|
10
|
-
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
11
|
-
className?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const CalendarIcon: React.FC<IconProps>;
|
|
14
|
-
export declare const ClockIcon: React.FC<IconProps>;
|
|
15
|
-
export declare const ChartBarIcon: React.FC<IconProps>;
|
|
16
|
-
export declare const UserIcon: React.FC<IconProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ChevronUpDownIcon: import("../Icon").IconComponent;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { createIcon } from '../Icon.js';
|
|
3
|
-
|
|
4
|
-
const ChevronUpDownSvg = (props) => (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [jsx("path", { d: "m7 15 5 5 5-5" }), jsx("path", { d: "m7 9 5-5 5 5" })] }));
|
|
5
|
-
const ChevronUpDownIcon = createIcon(ChevronUpDownSvg, 'ChevronUpDownIcon');
|
|
6
|
-
|
|
7
|
-
export { ChevronUpDownIcon };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DollarIcon: import("../Icon").IconComponent;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { createIcon } from '../Icon.js';
|
|
3
|
-
|
|
4
|
-
const DollarSvg = (props) => (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [jsx("line", { x1: "12", x2: "12", y1: "2", y2: "22" }), jsx("path", { d: "M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" })] }));
|
|
5
|
-
createIcon(DollarSvg, 'DollarIcon');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const LockIcon: import("../Icon").IconComponent;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { createIcon } from '../Icon.js';
|
|
3
|
-
|
|
4
|
-
const LockSvg = (props) => (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [jsx("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }), jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })] }));
|
|
5
|
-
createIcon(LockSvg, 'LockIcon');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MinusIcon: import("../Icon").IconComponent;
|