@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
|
@@ -21,7 +21,7 @@ const SidebarUserProfile = React__default.forwardRef(({ name, email, avatar, sta
|
|
|
21
21
|
const content = (jsxs("div", { ref: ref, className: cn("flex items-center gap-3 rounded-[var(--radius-base)] cursor-pointer transition-colors duration-150 hover:bg-[var(--color-background-secondary)]", isCollapsedView ? "justify-center p-2" : "px-3 py-2", className), role: "button", tabIndex: 0, onClick: onClick, onKeyDown: (e) => {
|
|
22
22
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
23
23
|
e.preventDefault();
|
|
24
|
-
|
|
24
|
+
e.currentTarget.click();
|
|
25
25
|
}
|
|
26
26
|
}, ...props, children: [avatarElement, !isCollapsedView && (jsxs("div", { className: "flex-1 min-w-0", children: [jsx("div", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: name }), email && (jsx("div", { className: "text-xs text-[var(--color-text-muted)] truncate", children: email }))] }))] }));
|
|
27
27
|
// Tooltip when collapsed
|
|
@@ -22,7 +22,7 @@ const SocialIcon = React__default.forwardRef(({ icon, size = 'md', colorMode = '
|
|
|
22
22
|
const fill = colorMode === 'brand' ? platform.brandColor : 'currentColor';
|
|
23
23
|
return (jsx("svg", { ref: ref, xmlns: "http://www.w3.org/2000/svg", viewBox: platform.viewBox, width: resolvedSize, height: resolvedSize, fill: fill, role: "img", "aria-label": `${platform.label} icon`, "data-icon": icon, "data-color-mode": colorMode, "data-size": size, className: cn(theme.baseStyle, className), ...props, children: platform.shapes.map((shape, i) => {
|
|
24
24
|
var _a;
|
|
25
|
-
return (jsx("path", { d: shape.d, fill: (_a = shape.fill) !== null && _a !== void 0 ? _a : undefined }, i));
|
|
25
|
+
return (jsx("path", { d: shape.d, fill: colorMode === 'brand' ? ((_a = shape.fill) !== null && _a !== void 0 ? _a : undefined) : undefined }, i));
|
|
26
26
|
}) }));
|
|
27
27
|
});
|
|
28
28
|
SocialIcon.displayName = 'SocialIcon';
|
|
@@ -154,7 +154,7 @@ const SortableItem = React__default.forwardRef(({ id, children, className, theme
|
|
|
154
154
|
context.setDraggedItemContent(children);
|
|
155
155
|
const items = Array.from(context.itemRefs.current.entries());
|
|
156
156
|
const currentIndex = items.findIndex(([itemId]) => itemId === id);
|
|
157
|
-
(_a = context.onSortDragStart) === null || _a === void 0 ? void 0 : _a.call(context, { id, index: currentIndex, data: value }
|
|
157
|
+
(_a = context.onSortDragStart) === null || _a === void 0 ? void 0 : _a.call(context, { id, index: currentIndex, data: value });
|
|
158
158
|
}, [disabled, id, children, context, value]);
|
|
159
159
|
const handleDragEnd = useCallback(() => {
|
|
160
160
|
var _a;
|
|
@@ -164,7 +164,7 @@ const SortableItem = React__default.forwardRef(({ id, children, className, theme
|
|
|
164
164
|
context.setDropPosition(null);
|
|
165
165
|
const items = Array.from(context.itemRefs.current.entries());
|
|
166
166
|
const currentIndex = items.findIndex(([itemId]) => itemId === id);
|
|
167
|
-
(_a = context.onSortDragEnd) === null || _a === void 0 ? void 0 : _a.call(context, { id, index: currentIndex, data: value }
|
|
167
|
+
(_a = context.onSortDragEnd) === null || _a === void 0 ? void 0 : _a.call(context, { id, index: currentIndex, data: value });
|
|
168
168
|
}, [id, context, value]);
|
|
169
169
|
const handlePointerDown = useCallback((event) => {
|
|
170
170
|
if (disabled) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const sortableTheme = {
|
|
2
2
|
containerStyle: "relative list-none",
|
|
3
3
|
itemStyle: "relative cursor-move select-none relative focus-within:z-10 list-none",
|
|
4
|
-
dragHandleStyle: "cursor-grab active:cursor-grabbing p-1 text-
|
|
4
|
+
dragHandleStyle: "cursor-grab active:cursor-grabbing p-1 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)] flex items-center justify-center rounded transition-colors duration-200",
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
export { sortableTheme };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export interface SortableData {
|
|
3
3
|
id: string;
|
|
4
4
|
index: number;
|
|
5
5
|
data?: string | number | Record<string, unknown>;
|
|
6
6
|
}
|
|
7
|
+
/** Event type for sort drag callbacks - may be a native event, React event, or absent (keyboard-initiated) */
|
|
8
|
+
export type SortableEvent = React.KeyboardEvent<HTMLDivElement> | Event | undefined;
|
|
7
9
|
export interface SortableTheme {
|
|
8
10
|
containerStyle: string;
|
|
9
11
|
itemStyle: string;
|
|
@@ -28,9 +30,9 @@ export interface SortableProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onD
|
|
|
28
30
|
/** Show drag handles */
|
|
29
31
|
showDragHandle?: boolean;
|
|
30
32
|
/** Called when drag starts */
|
|
31
|
-
onSortDragStart?: (data: SortableData, event
|
|
33
|
+
onSortDragStart?: (data: SortableData, event?: SortableEvent) => void;
|
|
32
34
|
/** Called when drag ends */
|
|
33
|
-
onSortDragEnd?: (data: SortableData, event
|
|
35
|
+
onSortDragEnd?: (data: SortableData, event?: SortableEvent) => void;
|
|
34
36
|
/** Optional array of values for Reorder.Group - auto-extracted from children if not provided */
|
|
35
37
|
values?: (string | number)[];
|
|
36
38
|
}
|
|
@@ -53,8 +55,8 @@ export interface SortableContextValue {
|
|
|
53
55
|
showDragHandle: boolean;
|
|
54
56
|
theme: SortableTheme;
|
|
55
57
|
onReorder: (fromIndex: number, toIndex: number) => void;
|
|
56
|
-
onSortDragStart?: (data: SortableData, event
|
|
57
|
-
onSortDragEnd?: (data: SortableData, event
|
|
58
|
+
onSortDragStart?: (data: SortableData, event?: SortableEvent) => void;
|
|
59
|
+
onSortDragEnd?: (data: SortableData, event?: SortableEvent) => void;
|
|
58
60
|
draggedItem: string | null;
|
|
59
61
|
setDraggedItem: (id: string | null) => void;
|
|
60
62
|
dropPosition: {
|
|
@@ -14,7 +14,7 @@ const TabsBody = React__default.forwardRef(({ value, forceMount = false, childre
|
|
|
14
14
|
const shouldReduceMotion = useReducedMotion();
|
|
15
15
|
// Check if we're in Storybook and should disable animations
|
|
16
16
|
const isInStorybook = typeof window !== 'undefined' && window.__STORYBOOK_DISABLE_ANIMATIONS__;
|
|
17
|
-
const shouldDisableAnimations = !!shouldReduceMotion || isInStorybook;
|
|
17
|
+
const shouldDisableAnimations = !!shouldReduceMotion || !!isInStorybook;
|
|
18
18
|
const isSelected = value === selectedValue;
|
|
19
19
|
const shouldRender = forceMount || isSelected;
|
|
20
20
|
// Compute animation variants without a global cache (HMR-safe)
|
|
@@ -14,7 +14,7 @@ const TabsTrigger = React__default.forwardRef(({ value, disabled = false, childr
|
|
|
14
14
|
const shouldReduceMotion = useReducedMotion();
|
|
15
15
|
// Check if we're in Storybook and should disable animations
|
|
16
16
|
const isInStorybook = typeof window !== 'undefined' && window.__STORYBOOK_DISABLE_ANIMATIONS__;
|
|
17
|
-
const shouldDisableAnimations = !!shouldReduceMotion || isInStorybook;
|
|
17
|
+
const shouldDisableAnimations = !!shouldReduceMotion || !!isInStorybook;
|
|
18
18
|
// Memoize derived state flags for performance
|
|
19
19
|
const derivedState = useMemo(() => ({
|
|
20
20
|
isSelected: value === selectedValue,
|
|
@@ -47,10 +47,10 @@ const Tag = React__default.forwardRef(({ children, size = "md", removable = true
|
|
|
47
47
|
// Avatar takes precedence over startContent
|
|
48
48
|
const renderLeadingContent = () => {
|
|
49
49
|
if (avatar) {
|
|
50
|
-
return (jsx(Avatar, { src: avatar.src, name: avatar.name, fallback: avatar.fallback, initialsCount: avatar.initialsCount,
|
|
50
|
+
return (jsx("span", { className: cn("inline-flex items-center justify-center shrink-0 overflow-hidden rounded-full", theme.avatarSizes[size]), children: jsx(Avatar, { src: avatar.src, name: avatar.name, fallback: avatar.fallback, initialsCount: avatar.initialsCount, size: "xs", className: "!size-full border-0 rounded-full" }) }));
|
|
51
51
|
}
|
|
52
52
|
if (startContent) {
|
|
53
|
-
return (jsx("span", { className: cn("inline-flex items-center", theme.startContentSizes[size]), children: startContent }));
|
|
53
|
+
return (jsx("span", { className: cn("inline-flex items-center justify-center shrink-0", theme.startContentSizes[size]), children: startContent }));
|
|
54
54
|
}
|
|
55
55
|
return null;
|
|
56
56
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ToastProps } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ToastProps } from "./Toast.types";
|
|
3
3
|
export declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -5,14 +5,18 @@ import { cn } from '../../../utils/cn.js';
|
|
|
5
5
|
import { toastTheme } from './Toast.theme.js';
|
|
6
6
|
import { toastAnimations, getToastStackingAnimation } from './Toast.animations.js';
|
|
7
7
|
import { ArrowPathIcon, InformationCircleIcon, XMarkIcon } from '@heroicons/react/24/solid';
|
|
8
|
+
import { Button } from '../Button/Button.js';
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
-
|
|
10
|
+
const isToastAction = (action) => typeof action === "object" &&
|
|
11
|
+
action !== null &&
|
|
12
|
+
"label" in action &&
|
|
13
|
+
"onClick" in action;
|
|
14
|
+
const Toast = React__default.forwardRef(({ toast, className, onDismiss, index = 0, isExpanded = false, totalToasts = 1, onMouseEnter, onMouseLeave, onHeightChange, expandedOffset, darkMode = false, ...props }, ref) => {
|
|
11
15
|
var _a;
|
|
12
16
|
const internalRef = useRef(null);
|
|
13
17
|
const setRefs = useCallback((node) => {
|
|
14
18
|
internalRef.current = node;
|
|
15
|
-
if (typeof ref ===
|
|
19
|
+
if (typeof ref === "function") {
|
|
16
20
|
ref(node);
|
|
17
21
|
}
|
|
18
22
|
else if (ref) {
|
|
@@ -20,11 +24,9 @@ onDismiss, index = 0, isExpanded = false, totalToasts = 1, onMouseEnter, onMouse
|
|
|
20
24
|
}
|
|
21
25
|
}, [ref]);
|
|
22
26
|
const shouldReduceMotion = useReducedMotion();
|
|
23
|
-
const { id, variant =
|
|
24
|
-
const isTextOnly = !subtitle && !action;
|
|
25
|
-
const defaultIcon = state ===
|
|
26
|
-
? (jsx(motion.div, { animate: { rotate: 360 }, transition: { repeat: Infinity, duration: 1, ease: "linear" }, children: jsx(ArrowPathIcon, { className: "w-5 h-5" }) }))
|
|
27
|
-
: jsx(InformationCircleIcon, { className: "w-5 h-5" });
|
|
27
|
+
const { id, variant = "default", state = "default", title, subtitle, icon, action, children, duration = 5000, dismissible = true, } = toast;
|
|
28
|
+
const isTextOnly = !subtitle && !action && !children;
|
|
29
|
+
const defaultIcon = state === "loading" ? (jsx(motion.div, { animate: { rotate: 360 }, transition: { repeat: Infinity, duration: 1, ease: "linear" }, children: jsx(ArrowPathIcon, { className: "w-5 h-5" }) })) : (jsx(InformationCircleIcon, { className: "w-5 h-5" }));
|
|
28
30
|
const resolvedIcon = icon || defaultIcon;
|
|
29
31
|
// Auto-dismiss after duration
|
|
30
32
|
useEffect(() => {
|
|
@@ -46,9 +48,11 @@ onDismiss, index = 0, isExpanded = false, totalToasts = 1, onMouseEnter, onMouse
|
|
|
46
48
|
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss(id);
|
|
47
49
|
};
|
|
48
50
|
const handleActionClick = () => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
if (isToastAction(action)) {
|
|
52
|
+
action.onClick();
|
|
53
|
+
if (dismissible) {
|
|
54
|
+
handleDismiss();
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
57
|
};
|
|
54
58
|
const stackingStyle = getToastStackingAnimation(index, totalToasts, isExpanded, expandedOffset);
|
|
@@ -58,31 +62,36 @@ onDismiss, index = 0, isExpanded = false, totalToasts = 1, onMouseEnter, onMouse
|
|
|
58
62
|
opacity: (_a = stackingStyle.opacity) !== null && _a !== void 0 ? _a : 1,
|
|
59
63
|
y: (_b = stackingStyle.y) !== null && _b !== void 0 ? _b : 0,
|
|
60
64
|
scale: (_c = stackingStyle.scale) !== null && _c !== void 0 ? _c : 1,
|
|
61
|
-
zIndex: (_d = stackingStyle.zIndex) !== null && _d !== void 0 ? _d : 1
|
|
65
|
+
zIndex: (_d = stackingStyle.zIndex) !== null && _d !== void 0 ? _d : 1,
|
|
62
66
|
});
|
|
63
|
-
}, [
|
|
67
|
+
}, [
|
|
68
|
+
stackingStyle.opacity,
|
|
69
|
+
stackingStyle.y,
|
|
70
|
+
stackingStyle.scale,
|
|
71
|
+
stackingStyle.zIndex,
|
|
72
|
+
]);
|
|
64
73
|
const styleValue = useMemo(() => {
|
|
65
74
|
var _a;
|
|
66
75
|
return ({
|
|
67
76
|
zIndex: (_a = stackingStyle.zIndex) !== null && _a !== void 0 ? _a : 1,
|
|
68
|
-
position: (index > 0
|
|
77
|
+
position: (index > 0
|
|
78
|
+
? "absolute"
|
|
79
|
+
: "relative"),
|
|
69
80
|
top: index > 0 ? 0 : undefined,
|
|
70
81
|
left: index > 0 ? 0 : undefined,
|
|
71
|
-
width: index > 0 ?
|
|
82
|
+
width: index > 0 ? "100%" : undefined,
|
|
72
83
|
});
|
|
73
84
|
}, [stackingStyle.zIndex, index]);
|
|
74
85
|
const toastNode = (jsxs(motion.div, { ref: setRefs, layout: true, initial: shouldReduceMotion ? false : toastAnimations.initial, animate: animateValue, exit: shouldReduceMotion
|
|
75
86
|
? { ...toastAnimations.exit, transition: { duration: 0 } }
|
|
76
|
-
: toastAnimations.exit, transition: shouldReduceMotion ? { duration: 0 } : toastAnimations.transition, className: cn(toastTheme.baseStyle, isTextOnly &&
|
|
77
|
-
? jsx("div", { className:
|
|
78
|
-
:
|
|
79
|
-
? jsx("div", { className: toastTheme.subtitleStyle, children: subtitle })
|
|
80
|
-
: subtitle), action && (jsx("div", { className: "mt-2", children: jsx("button", { type: "button", className: toastTheme.actionStyle, onClick: handleActionClick, children: action.label }) }))] }), dismissible && (jsx("button", { type: "button", className: isTextOnly ? toastTheme.closeButtonCenteredStyle : toastTheme.closeButtonStyle, onClick: handleDismiss, "aria-label": "Dismiss notification", children: jsx(XMarkIcon, { className: "w-4 h-4" }) }))] }));
|
|
87
|
+
: toastAnimations.exit, transition: shouldReduceMotion ? { duration: 0 } : toastAnimations.transition, className: cn(toastTheme.baseStyle, isTextOnly && "items-center", ((_a = toastTheme.variants) === null || _a === void 0 ? void 0 : _a[variant]) || "", "pointer-events-auto", index > 0 && !isExpanded && "absolute top-0 left-0", className), style: styleValue, role: "alert", "aria-live": "polite", children: [jsx("div", { className: cn(toastTheme.iconStyle, !isTextOnly && "mt-0.5"), children: resolvedIcon }), jsxs("div", { className: "flex-1 min-w-0", children: [title &&
|
|
88
|
+
(typeof title === "string" ? (jsx("div", { className: cn(toastTheme.titleStyle, !isTextOnly && "font-semibold"), children: title })) : (title)), subtitle &&
|
|
89
|
+
(typeof subtitle === "string" ? (jsx("div", { className: toastTheme.subtitleStyle, children: subtitle })) : (subtitle)), action && (jsx("div", { className: "mt-4", children: isToastAction(action) ? (jsx(Button, { variant: "link", color: "primary", onClick: handleActionClick, children: action.label })) : (action) })), children] }), dismissible && (jsx("button", { type: "button", className: cn(toastTheme.closeButtonStyle, !isTextOnly && "mt-0.5"), onClick: handleDismiss, "aria-label": "Dismiss notification", children: jsx(XMarkIcon, { className: "size-5" }) }))] }));
|
|
81
90
|
if (darkMode) {
|
|
82
91
|
return jsx("div", { className: "dark", children: toastNode });
|
|
83
92
|
}
|
|
84
93
|
return toastNode;
|
|
85
94
|
});
|
|
86
|
-
Toast.displayName =
|
|
95
|
+
Toast.displayName = "Toast";
|
|
87
96
|
|
|
88
97
|
export { Toast };
|
|
@@ -6,15 +6,10 @@ const toastTheme = {
|
|
|
6
6
|
default: "border border-[var(--color-border)] dark:border-white/10",
|
|
7
7
|
glass: "glass-effect",
|
|
8
8
|
},
|
|
9
|
-
iconStyle: "flex-shrink-0
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
subtitleStyle: "text-base mt-0.5 opacity-60",
|
|
14
|
-
actionStyle: "text-sm font-medium px-2 py-1 rounded border bg-white/80 hover:bg-white transition-colors cursor-pointer " +
|
|
15
|
-
"dark:bg-white/10 dark:border-white/20 dark:hover:bg-white/20 dark:text-white",
|
|
16
|
-
closeButtonStyle: "absolute top-2 right-2 flex-shrink-0 w-4 h-4 opacity-70 hover:opacity-100 transition-opacity cursor-pointer",
|
|
17
|
-
closeButtonCenteredStyle: "flex-shrink-0 w-4 h-4 opacity-70 hover:opacity-100 transition-opacity cursor-pointer",
|
|
9
|
+
iconStyle: "flex-shrink-0",
|
|
10
|
+
titleStyle: "text-base text-[var(--color-text-primary)]",
|
|
11
|
+
subtitleStyle: "text-base mt-1 text-[var(--color-text-secondary)]",
|
|
12
|
+
closeButtonStyle: "flex-shrink-0 size-5 opacity-70 hover:opacity-100 transition-opacity cursor-pointer",
|
|
18
13
|
containerStyle: "fixed z-50 pointer-events-none",
|
|
19
14
|
};
|
|
20
15
|
|
|
@@ -16,28 +16,11 @@ export interface ToastTheme {
|
|
|
16
16
|
baseStyle: string;
|
|
17
17
|
variants: Record<ToastVariant, string>;
|
|
18
18
|
iconStyle: string;
|
|
19
|
-
iconCenteredStyle: string;
|
|
20
19
|
titleStyle: string;
|
|
21
|
-
textOnlyStyle: string;
|
|
22
20
|
subtitleStyle: string;
|
|
23
|
-
actionStyle: string;
|
|
24
21
|
closeButtonStyle: string;
|
|
25
|
-
closeButtonCenteredStyle: string;
|
|
26
22
|
containerStyle: string;
|
|
27
23
|
}
|
|
28
|
-
export interface ToastThemeOverrides {
|
|
29
|
-
baseStyle?: string;
|
|
30
|
-
variants?: Partial<Record<ToastVariant, string>>;
|
|
31
|
-
iconStyle?: string;
|
|
32
|
-
iconCenteredStyle?: string;
|
|
33
|
-
titleStyle?: string;
|
|
34
|
-
textOnlyStyle?: string;
|
|
35
|
-
subtitleStyle?: string;
|
|
36
|
-
actionStyle?: string;
|
|
37
|
-
closeButtonStyle?: string;
|
|
38
|
-
closeButtonCenteredStyle?: string;
|
|
39
|
-
containerStyle?: string;
|
|
40
|
-
}
|
|
41
24
|
export interface ToastData {
|
|
42
25
|
id: string;
|
|
43
26
|
variant?: ToastVariant;
|
|
@@ -45,7 +28,8 @@ export interface ToastData {
|
|
|
45
28
|
title?: ReactNode;
|
|
46
29
|
subtitle?: ReactNode;
|
|
47
30
|
icon?: ReactNode;
|
|
48
|
-
action?: ToastAction;
|
|
31
|
+
action?: ToastAction | ReactNode;
|
|
32
|
+
children?: ReactNode;
|
|
49
33
|
duration?: number;
|
|
50
34
|
dismissible?: boolean;
|
|
51
35
|
onDismiss?: () => void;
|
|
@@ -55,8 +39,6 @@ export interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"
|
|
|
55
39
|
toast: ToastData;
|
|
56
40
|
/** Custom class name */
|
|
57
41
|
className?: string;
|
|
58
|
-
/** Theme overrides (deprecated - use className for customization) */
|
|
59
|
-
theme?: ToastThemeOverrides;
|
|
60
42
|
/** Callback when toast is dismissed */
|
|
61
43
|
onDismiss?: (id: string) => void;
|
|
62
44
|
/** Index of toast in the stack */
|
|
@@ -102,7 +84,8 @@ export interface UseToastOptions {
|
|
|
102
84
|
state?: ToastState;
|
|
103
85
|
duration?: number;
|
|
104
86
|
dismissible?: boolean;
|
|
105
|
-
action?: ToastAction;
|
|
87
|
+
action?: ToastAction | ReactNode;
|
|
88
|
+
children?: ReactNode;
|
|
106
89
|
icon?: ReactNode;
|
|
107
90
|
}
|
|
108
91
|
export interface UseToastReturn {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Toast } from './Toast';
|
|
2
2
|
export { ToastProvider, useToastContext } from './ToastProvider';
|
|
3
3
|
export { useToast } from './useToast';
|
|
4
|
-
export type { ToastProps, ToastData, ToastProviderProps, ToastTheme,
|
|
4
|
+
export type { ToastProps, ToastData, ToastProviderProps, ToastTheme, ToastVariant, UseToastReturn, UseToastOptions, } from './Toast.types';
|
|
5
5
|
export { toastTheme } from './Toast.theme';
|
|
@@ -55,7 +55,7 @@ const Tooltip = ({ content, children, placement = "top", delay = 300, disabled =
|
|
|
55
55
|
const { position, cssVariables, contentRef: portalContentRef} = useSelectPortal({
|
|
56
56
|
triggerRef,
|
|
57
57
|
isOpen: isVisible,
|
|
58
|
-
placement: placement,
|
|
58
|
+
placement: placement,
|
|
59
59
|
offset,
|
|
60
60
|
autoWidth: true,
|
|
61
61
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const tooltipTheme = {
|
|
2
2
|
// Base style for the tooltip - using fixed positioning for portal rendering
|
|
3
3
|
baseStyle: "fixed z-[99] rounded-[var(--tooltip-radius)] py-1 px-2 text-sm text-[var(--color-text-primary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 pointer-events-none bg-white/60 backdrop-blur-md outline outline-[var(--color-border)] shadow-lg border-t-[1px] border-white " +
|
|
4
|
-
"dark:bg-neutral-800/80 dark:outline-[var(--color-border)]/80 dark:border-[var(--color-border)]",
|
|
4
|
+
"dark:bg-[var(--color-neutral-800)]/80 dark:outline-[var(--color-border)]/80 dark:border-[var(--color-border)]",
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
export { tooltipTheme };
|
|
@@ -74,6 +74,15 @@ export { messageTheme } from './Message/Message.theme.js';
|
|
|
74
74
|
export { messageListTheme } from './Message/MessageList.theme.js';
|
|
75
75
|
export { TypeWriter } from './Message/TypeWriter.js';
|
|
76
76
|
export { MessageBody } from './Message/MessageBody.js';
|
|
77
|
+
export { MessageStatusIndicator } from './Message/MessageStatusIndicator.js';
|
|
78
|
+
export { MessageSenderName } from './Message/MessageSenderName.js';
|
|
79
|
+
export { MessageFile } from './Message/MessageFile.js';
|
|
80
|
+
export { MessageImage } from './Message/MessageImage.js';
|
|
81
|
+
export { MessageAudio } from './Message/MessageAudio.js';
|
|
82
|
+
export { MessageLink } from './Message/MessageLink.js';
|
|
83
|
+
export { MessageReply } from './Message/MessageReply.js';
|
|
84
|
+
export { MessageReactions } from './Message/MessageReactions.js';
|
|
85
|
+
export { MessageDateDivider } from './Message/MessageDateDivider.js';
|
|
77
86
|
export { Empty } from './Empty/Empty.js';
|
|
78
87
|
export { emptyTheme } from './Empty/Empty.theme.js';
|
|
79
88
|
export { Masonry } from './Masonry/Masonry.js';
|
|
@@ -14,7 +14,7 @@ export interface GanttTask {
|
|
|
14
14
|
completed?: boolean;
|
|
15
15
|
dependencies?: string[];
|
|
16
16
|
milestone?: boolean;
|
|
17
|
-
[key: string]:
|
|
17
|
+
[key: string]: unknown;
|
|
18
18
|
}
|
|
19
19
|
export interface GanttHoliday {
|
|
20
20
|
date: Date | string;
|
|
@@ -30,7 +30,7 @@ export interface GanttGroup {
|
|
|
30
30
|
export interface GanttColumn<T extends GanttTask = GanttTask> {
|
|
31
31
|
id: string;
|
|
32
32
|
header: string;
|
|
33
|
-
accessor: keyof T | ((task: T) =>
|
|
33
|
+
accessor: keyof T | ((task: T) => ReactNode | string | number | boolean | null | undefined);
|
|
34
34
|
cell?: (task: T, group: GanttGroup) => ReactNode;
|
|
35
35
|
width?: number;
|
|
36
36
|
align?: "left" | "center" | "right";
|
|
@@ -38,13 +38,13 @@ export interface FilterOption {
|
|
|
38
38
|
/**
|
|
39
39
|
* Column definition for table data display and behavior
|
|
40
40
|
*/
|
|
41
|
-
export interface Column<T =
|
|
41
|
+
export interface Column<T = unknown> {
|
|
42
42
|
/** Unique identifier for the column */
|
|
43
43
|
id: string;
|
|
44
44
|
/** Header content - can be string or React element */
|
|
45
45
|
header: string | ReactNode;
|
|
46
46
|
/** Property key or function to extract cell data from row object */
|
|
47
|
-
accessor: keyof T | ((row: T) =>
|
|
47
|
+
accessor: keyof T | ((row: T) => ReactNode | string | number | boolean | null | undefined);
|
|
48
48
|
/** Optional custom renderer for cell content */
|
|
49
49
|
cell?: (row: T) => ReactNode;
|
|
50
50
|
/** Enable sorting for this column */
|
|
@@ -134,7 +134,7 @@ export interface TableContextType {
|
|
|
134
134
|
*
|
|
135
135
|
* @template T The type of data objects in each table row
|
|
136
136
|
*/
|
|
137
|
-
export interface TableProps<T =
|
|
137
|
+
export interface TableProps<T = unknown> {
|
|
138
138
|
/** Array of data objects to display - required for data-driven API */
|
|
139
139
|
data?: T[];
|
|
140
140
|
/** Column definitions for data display and behavior - required for data-driven API */
|
|
@@ -287,7 +287,7 @@ export interface InternalTableCellProps<T> {
|
|
|
287
287
|
}
|
|
288
288
|
export type ActionVariant = 'default' | 'danger';
|
|
289
289
|
export type ActionPriority = 'high' | 'normal';
|
|
290
|
-
export interface ActionItem<T =
|
|
290
|
+
export interface ActionItem<T = unknown> {
|
|
291
291
|
/** Unique identifier for the action */
|
|
292
292
|
id: string;
|
|
293
293
|
/** Display label for the action */
|
|
@@ -305,7 +305,7 @@ export interface ActionItem<T = any> {
|
|
|
305
305
|
/** Function to determine if action should be disabled */
|
|
306
306
|
disabled?: (row: T) => boolean;
|
|
307
307
|
}
|
|
308
|
-
export interface TableActionsProps<T =
|
|
308
|
+
export interface TableActionsProps<T = unknown> {
|
|
309
309
|
/** Array of action items to display */
|
|
310
310
|
actions: ActionItem<T>[];
|
|
311
311
|
/** Row data to pass to action handlers */
|
|
@@ -315,7 +315,7 @@ export interface TableActionsProps<T = any> {
|
|
|
315
315
|
/** Additional CSS class name */
|
|
316
316
|
className?: string;
|
|
317
317
|
}
|
|
318
|
-
export interface TableActionsMenuProps<T =
|
|
318
|
+
export interface TableActionsMenuProps<T = unknown> {
|
|
319
319
|
/** Array of action items to display in menu */
|
|
320
320
|
actions: ActionItem<T>[];
|
|
321
321
|
/** Row data to pass to action handlers */
|
|
@@ -351,7 +351,7 @@ export interface TableSelectionHeaderProps {
|
|
|
351
351
|
onClearSelection: () => void;
|
|
352
352
|
className?: string;
|
|
353
353
|
}
|
|
354
|
-
export interface TableColumnManagerProps<T =
|
|
354
|
+
export interface TableColumnManagerProps<T = unknown> {
|
|
355
355
|
columns: Column<T>[];
|
|
356
356
|
visibleColumns: string[];
|
|
357
357
|
columnOrder: string[];
|
|
@@ -359,7 +359,7 @@ export interface TableColumnManagerProps<T = any> {
|
|
|
359
359
|
onResetToDefault: () => void;
|
|
360
360
|
onColumnReorder?: (fromIndex: number, toIndex: number) => void;
|
|
361
361
|
}
|
|
362
|
-
export interface TableFilterProps<T =
|
|
362
|
+
export interface TableFilterProps<T = unknown> {
|
|
363
363
|
columns: Column<T>[];
|
|
364
364
|
filterConfig: FilterConfig[];
|
|
365
365
|
onFilterChange: (filterConfig: FilterConfig[]) => void;
|
|
@@ -125,7 +125,7 @@ CustomCursorProvider.displayName = "CustomCursorProvider";
|
|
|
125
125
|
* </CustomCursor>
|
|
126
126
|
* ```
|
|
127
127
|
*/
|
|
128
|
-
const CustomCursor = React.forwardRef(({ children, size = "md", color = "primary", variant = "default", shape = "arrow", className, style, ...props }, ref) => {
|
|
128
|
+
const CustomCursor = React.forwardRef(({ children, size = "md", color = "primary", variant = "default", shape = "arrow", className, style, onAnimationStart: _onAnimationStart, onAnimationEnd: _onAnimationEnd, onDrag: _onDrag, onDragStart: _onDragStart, onDragEnd: _onDragEnd, ...props }, ref) => {
|
|
129
129
|
const { cursorPos, isActive, containerRef, cursorRef } = useCustomCursor();
|
|
130
130
|
React.useImperativeHandle(ref, () => cursorRef.current);
|
|
131
131
|
const x = useMotionValue(0);
|
|
@@ -200,7 +200,7 @@ const userVariantColors = [
|
|
|
200
200
|
"warning",
|
|
201
201
|
"danger",
|
|
202
202
|
];
|
|
203
|
-
const CustomCursorFollow = React.forwardRef(({ children, sideOffset = 15, align = "bottom-right", transition, variant = "default", avatar, name, color, className, style, ...props }, ref) => {
|
|
203
|
+
const CustomCursorFollow = React.forwardRef(({ children, sideOffset = 15, align = "bottom-right", transition, variant = "default", avatar, name, color, className, style, onAnimationStart: _onAnimationStart2, onAnimationEnd: _onAnimationEnd2, onDrag: _onDrag2, onDragStart: _onDragStart2, onDragEnd: _onDragEnd2, ...props }, ref) => {
|
|
204
204
|
const { cursorPos, isActive, cursorRef } = useCustomCursor();
|
|
205
205
|
const cursorFollowRef = React.useRef(null);
|
|
206
206
|
const shouldReduceMotion = useReducedMotion();
|
|
@@ -5,4 +5,4 @@ import { GlassSurfaceProps } from "./GlassSurface.types";
|
|
|
5
5
|
* Creates a realistic chromatic aberration glass effect using SVG filters.
|
|
6
6
|
* Works as a wrapper for any content.
|
|
7
7
|
*/
|
|
8
|
-
export declare const GlassSurface: React.
|
|
8
|
+
export declare const GlassSurface: React.ForwardRefExoticComponent<GlassSurfaceProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useId, useState, useRef, useMemo, useEffect } from 'react';
|
|
2
|
+
import React__default, { useId, useState, useRef, useMemo, useEffect, useCallback } from 'react';
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -23,7 +23,7 @@ const useDarkMode = () => {
|
|
|
23
23
|
* Creates a realistic chromatic aberration glass effect using SVG filters.
|
|
24
24
|
* Works as a wrapper for any content.
|
|
25
25
|
*/
|
|
26
|
-
const GlassSurface = ({ children, width, height, borderRadius = 20, borderWidth = 0.07, brightness: brightnessProp, opacity: opacityProp, blur: blurProp, displace: displaceProp, backgroundOpacity: backgroundOpacityProp, backgroundColor, saturation: saturationProp, distortionScale: distortionScaleProp, redOffset = 0, greenOffset = 10, blueOffset = 20, xChannel = "R", yChannel = "G", mixBlendMode: mixBlendModeProp, colorScheme = "auto", frosted = false, className = "", style = {}, }) => {
|
|
26
|
+
const GlassSurface = React__default.forwardRef(({ children, width, height, borderRadius = 20, borderWidth = 0.07, brightness: brightnessProp, opacity: opacityProp, blur: blurProp, displace: displaceProp, backgroundOpacity: backgroundOpacityProp, backgroundColor, saturation: saturationProp, distortionScale: distortionScaleProp, redOffset = 0, greenOffset = 10, blueOffset = 20, xChannel = "R", yChannel = "G", mixBlendMode: mixBlendModeProp, colorScheme = "auto", backdropBrightness = 1, frosted = false, className = "", style = {}, }, forwardedRef) => {
|
|
27
27
|
const uniqueId = useId().replace(/:/g, "-");
|
|
28
28
|
const filterId = `glass-filter-${uniqueId}`;
|
|
29
29
|
const redGradId = `red-grad-${uniqueId}`;
|
|
@@ -66,11 +66,11 @@ const GlassSurface = ({ children, width, height, borderRadius = 20, borderWidth
|
|
|
66
66
|
<svg viewBox="0 0 ${actualWidth} ${actualHeight}" xmlns="http://www.w3.org/2000/svg">
|
|
67
67
|
<defs>
|
|
68
68
|
<linearGradient id="${redGradId}" x1="100%" y1="0%" x2="0%" y2="0%">
|
|
69
|
-
<stop offset="0%" stop-color="#
|
|
69
|
+
<stop offset="0%" stop-color="#000"/>
|
|
70
70
|
<stop offset="100%" stop-color="red"/>
|
|
71
71
|
</linearGradient>
|
|
72
72
|
<linearGradient id="${blueGradId}" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
73
|
-
<stop offset="0%" stop-color="#
|
|
73
|
+
<stop offset="0%" stop-color="#000"/>
|
|
74
74
|
<stop offset="100%" stop-color="blue"/>
|
|
75
75
|
</linearGradient>
|
|
76
76
|
</defs>
|
|
@@ -186,8 +186,8 @@ const GlassSurface = ({ children, width, height, borderRadius = 20, borderWidth
|
|
|
186
186
|
return {
|
|
187
187
|
...baseStyles,
|
|
188
188
|
background: getBackgroundWithOpacity(),
|
|
189
|
-
backdropFilter: `url(#${filterId}) ${frostedBlur} saturate(${saturation})`,
|
|
190
|
-
WebkitBackdropFilter: `url(#${filterId}) ${frostedBlur} saturate(${saturation})`,
|
|
189
|
+
backdropFilter: `url(#${filterId}) ${frostedBlur} brightness(${backdropBrightness}) saturate(${saturation})`,
|
|
190
|
+
WebkitBackdropFilter: `url(#${filterId}) ${frostedBlur} brightness(${backdropBrightness}) saturate(${saturation})`,
|
|
191
191
|
...(!resolvedDark && { border: "1px solid rgba(0, 0, 0, 0.06)" }),
|
|
192
192
|
...(hasCustomShadow
|
|
193
193
|
? {}
|
|
@@ -246,11 +246,19 @@ const GlassSurface = ({ children, width, height, borderRadius = 20, borderWidth
|
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
}, [style, width, height, borderRadius, frosted, svgSupported, backgroundColor, resolvedDark, backgroundOpacity, filterId, saturation, hasCustomShadow, supportsBackdrop]);
|
|
249
|
+
}, [style, width, height, borderRadius, frosted, svgSupported, backgroundColor, resolvedDark, backgroundOpacity, filterId, backdropBrightness, saturation, hasCustomShadow, supportsBackdrop]);
|
|
250
250
|
const focusVisibleClasses = resolvedDark
|
|
251
251
|
? "focus-visible:outline-2 focus-visible:outline-[#0A84FF] focus-visible:outline-offset-2"
|
|
252
252
|
: "focus-visible:outline-2 focus-visible:outline-[#007AFF] focus-visible:outline-offset-2";
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
const mergedRef = useCallback((node) => {
|
|
254
|
+
containerRef.current = node;
|
|
255
|
+
if (typeof forwardedRef === "function")
|
|
256
|
+
forwardedRef(node);
|
|
257
|
+
else if (forwardedRef)
|
|
258
|
+
forwardedRef.current = node;
|
|
259
|
+
}, [forwardedRef]);
|
|
260
|
+
return (jsxs("div", { ref: mergedRef, className: cn("relative transition-opacity duration-[260ms] ease-out", focusVisibleClasses, className), style: containerStyles, children: [jsx("svg", { className: "w-full h-full pointer-events-none absolute inset-0 opacity-0 -z-10", xmlns: "http://www.w3.org/2000/svg", children: jsxs("defs", { children: [jsxs("filter", { id: filterId, colorInterpolationFilters: "sRGB", x: "0%", y: "0%", width: "100%", height: "100%", children: [jsx("feImage", { ref: feImageRef, x: "0", y: "0", width: "100%", height: "100%", preserveAspectRatio: "none", result: "map" }), jsx("feDisplacementMap", { ref: redChannelRef, in: "SourceGraphic", in2: "map", result: "dispRed" }), jsx("feColorMatrix", { in: "dispRed", type: "matrix", values: "1 0 0 0 0\n 0 0 0 0 0\n 0 0 0 0 0\n 0 0 0 1 0", result: "red" }), jsx("feDisplacementMap", { ref: greenChannelRef, in: "SourceGraphic", in2: "map", result: "dispGreen" }), jsx("feColorMatrix", { in: "dispGreen", type: "matrix", values: "0 0 0 0 0\n 0 1 0 0 0\n 0 0 0 0 0\n 0 0 0 1 0", result: "green" }), jsx("feDisplacementMap", { ref: blueChannelRef, in: "SourceGraphic", in2: "map", result: "dispBlue" }), jsx("feColorMatrix", { in: "dispBlue", type: "matrix", values: "0 0 0 0 0\n 0 0 0 0 0\n 0 0 1 0 0\n 0 0 0 1 0", result: "blue" }), jsx("feBlend", { in: "red", in2: "green", mode: "screen", result: "rg" }), jsx("feBlend", { in: "rg", in2: "blue", mode: "screen", result: "output" }), jsx("feGaussianBlur", { ref: gaussianBlurRef, in: "output", stdDeviation: "0.7" })] }), jsx("filter", { id: noiseFilterId, x: "0%", y: "0%", width: "100%", height: "100%", children: jsx("feTurbulence", { type: "fractalNoise", baseFrequency: "0.65", numOctaves: "3", stitchTiles: "stitch" }) })] }) }), jsx("div", { className: "relative z-10 h-full rounded-[inherit]", children: children }), jsx("div", { className: "absolute inset-0 pointer-events-none rounded-[inherit] overflow-hidden z-20", children: frosted && (jsx("div", { className: "absolute inset-0 opacity-10 mix-blend-overlay", style: { filter: `url(#${noiseFilterId})` } })) })] }));
|
|
261
|
+
});
|
|
262
|
+
GlassSurface.displayName = "GlassSurface";
|
|
255
263
|
|
|
256
264
|
export { GlassSurface };
|
|
@@ -48,6 +48,12 @@ export interface GlassSurfaceProps {
|
|
|
48
48
|
* @default 'auto'
|
|
49
49
|
*/
|
|
50
50
|
colorScheme?: "auto" | "dark" | "light";
|
|
51
|
+
/**
|
|
52
|
+
* Brightness multiplier for the backdrop-filter chain.
|
|
53
|
+
* Values > 1 brighten, < 1 darken. Only applies when SVG filters are supported.
|
|
54
|
+
* @default 1
|
|
55
|
+
*/
|
|
56
|
+
backdropBrightness?: number;
|
|
51
57
|
/**
|
|
52
58
|
* Enable frosted glass effect with noise texture
|
|
53
59
|
* @default false
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Variants } from 'motion/react';
|
|
2
|
+
import type { CharacterState } from './InteractiveCharacters.types';
|
|
3
|
+
export declare const eyelidVariants: Record<CharacterState, {
|
|
4
|
+
scaleY: number;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const blobBodyVariants: Variants;
|
|
7
|
+
export declare const tallBodyVariants: Variants;
|
|
8
|
+
export declare const smallBodyVariants: Variants;
|
|
9
|
+
export declare const blobMouthPaths: Record<CharacterState, string>;
|
|
10
|
+
export declare const tallMouthPaths: Record<CharacterState, string>;
|
|
11
|
+
export declare const smallMouthPaths: Record<CharacterState, string>;
|
|
12
|
+
export declare const eyebrowVariants: Record<CharacterState, {
|
|
13
|
+
rotate: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const springConfigs: {
|
|
17
|
+
readonly small: {
|
|
18
|
+
readonly stiffness: 300;
|
|
19
|
+
readonly damping: 20;
|
|
20
|
+
};
|
|
21
|
+
readonly blob: {
|
|
22
|
+
readonly stiffness: 150;
|
|
23
|
+
readonly damping: 25;
|
|
24
|
+
};
|
|
25
|
+
readonly tall: {
|
|
26
|
+
readonly stiffness: 80;
|
|
27
|
+
readonly damping: 30;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare const bodyTransition: {
|
|
31
|
+
type: "spring";
|
|
32
|
+
stiffness: number;
|
|
33
|
+
damping: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const clickTransition: {
|
|
36
|
+
type: "spring";
|
|
37
|
+
stiffness: number;
|
|
38
|
+
damping: number;
|
|
39
|
+
};
|