@flikk/ui 1.0.0-beta.14 → 1.0.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +3 -1
- package/dist/components/ai/PromptSuggestions/PromptSuggestion.theme.js +4 -4
- package/dist/components/ai/StreamingResponse/AnimatedText.js +3 -3
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +22 -22
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +1 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +10 -10
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +9 -3
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +1 -1
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +11 -11
- package/dist/components/ai/index.d.ts +0 -7
- package/dist/components/ai/index.js +8 -6
- package/dist/components/charts/DonutChart/DonutChart.js +1 -1
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.js +1 -1
- package/dist/components/charts/shared/ChartLegend/ChartLegend.types.d.ts +13 -1
- package/dist/components/charts/shared/ChartLegend/ChartLegendContent.js +1 -1
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.types.d.ts +13 -2
- package/dist/components/core/Accordion/AccordionItem.js +1 -1
- package/dist/components/core/Accordion/AccordionTrigger.js +1 -1
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -0
- package/dist/components/core/Alert/Alert.animations.js +44 -0
- package/dist/components/core/Alert/Alert.js +16 -3
- package/dist/components/core/Avatar/Avatar.js +12 -7
- package/dist/components/core/Avatar/Avatar.theme.d.ts +4 -6
- package/dist/components/core/Avatar/Avatar.theme.js +22 -12
- package/dist/components/core/Avatar/Avatar.types.d.ts +9 -0
- package/dist/components/core/AvatarGroup/AvatarGroup.animations.js +2 -2
- package/dist/components/core/AvatarGroup/AvatarGroup.js +1 -2
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +1 -1
- package/dist/components/core/Badge/Badge.animations.js +1 -1
- package/dist/components/core/Badge/Badge.js +23 -47
- package/dist/components/core/Badge/Badge.theme.js +48 -62
- package/dist/components/core/Badge/Badge.types.d.ts +5 -29
- package/dist/components/core/Button/Button.js +2 -2
- package/dist/components/core/Button/Button.theme.js +2 -2
- package/dist/components/core/ButtonGroup/ButtonGroup.theme.js +6 -6
- package/dist/components/core/ButtonGroup/ButtonGroupText.js +1 -3
- package/dist/components/core/Calendar/Calendar.js +29 -3
- package/dist/components/core/Calendar/Calendar.theme.js +11 -7
- package/dist/components/core/Calendar/Calendar.types.d.ts +3 -0
- package/dist/components/core/Carousel/CarouselBody.js +0 -1
- package/dist/components/core/CommandPalette/CommandItem.js +1 -1
- package/dist/components/core/CommandPalette/CommandPalette.js +6 -4
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +1 -0
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +6 -0
- package/dist/components/core/ContextMenu/ContextMenu.js +5 -4
- package/dist/components/core/ContextMenu/ContextMenuTrigger.js +5 -6
- package/dist/components/core/Drawer/Drawer.d.ts +1 -1
- package/dist/components/core/Drawer/Drawer.js +25 -2
- package/dist/components/core/Drawer/Drawer.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.types.d.ts +6 -0
- package/dist/components/core/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/core/Dropdown/Dropdown.js +5 -1
- package/dist/components/core/Dropdown/Dropdown.types.d.ts +1 -0
- package/dist/components/core/Dropdown/DropdownItem.js +1 -1
- package/dist/components/core/Dropdown/DropdownMenu.js +4 -4
- package/dist/components/core/Dropdown/DropdownSection.js +1 -1
- package/dist/components/core/Dropdown/DropdownSeparator.js +1 -1
- package/dist/components/core/Dropdown/DropdownTrigger.d.ts +6 -1
- package/dist/components/core/Dropdown/DropdownTrigger.js +10 -8
- package/dist/components/core/Kbd/Kbd.theme.js +3 -3
- package/dist/components/core/Link/Link.js +3 -1
- package/dist/components/core/Message/Message.d.ts +9 -0
- package/dist/components/core/Message/Message.js +44 -3
- package/dist/components/core/Message/Message.theme.js +22 -0
- package/dist/components/core/Message/Message.types.d.ts +115 -0
- package/dist/components/core/Message/MessageAudio.d.ts +8 -0
- package/dist/components/core/Message/MessageAudio.js +11 -0
- package/dist/components/core/Message/MessageContext.d.ts +3 -1
- package/dist/components/core/Message/MessageDateDivider.d.ts +6 -0
- package/dist/components/core/Message/MessageDateDivider.js +10 -0
- package/dist/components/core/Message/MessageFile.d.ts +9 -0
- package/dist/components/core/Message/MessageFile.js +15 -0
- package/dist/components/core/Message/MessageImage.d.ts +11 -0
- package/dist/components/core/Message/MessageImage.js +13 -0
- package/dist/components/core/Message/MessageLink.d.ts +10 -0
- package/dist/components/core/Message/MessageLink.js +15 -0
- package/dist/components/core/Message/MessageReactions.d.ts +8 -0
- package/dist/components/core/Message/MessageReactions.js +12 -0
- package/dist/components/core/Message/MessageReply.d.ts +8 -0
- package/dist/components/core/Message/MessageReply.js +10 -0
- package/dist/components/core/Message/MessageSenderName.d.ts +6 -0
- package/dist/components/core/Message/MessageSenderName.js +10 -0
- package/dist/components/core/Message/MessageStatusIndicator.d.ts +9 -0
- package/dist/components/core/Message/MessageStatusIndicator.js +45 -0
- package/dist/components/core/Message/index.d.ts +19 -1
- package/dist/components/core/Modal/Modal.animations.d.ts +1 -0
- package/dist/components/core/Modal/Modal.animations.js +14 -11
- package/dist/components/core/Pagination/Pagination.theme.js +1 -1
- package/dist/components/core/Popover/Popover.d.ts +1 -1
- package/dist/components/core/Popover/PopoverBody.js +2 -2
- package/dist/components/core/Popover/PopoverTrigger.d.ts +1 -1
- package/dist/components/core/Popover/PopoverTrigger.js +11 -11
- package/dist/components/core/Progress/Progress.d.ts +9 -8
- package/dist/components/core/Progress/Progress.js +16 -16
- package/dist/components/core/Progress/Progress.theme.js +4 -15
- package/dist/components/core/Progress/Progress.types.d.ts +2 -20
- package/dist/components/core/Progress/index.d.ts +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.js +49 -7
- package/dist/components/core/ScrollArea/ScrollArea.types.d.ts +12 -3
- package/dist/components/core/ScrollArea/index.d.ts +1 -1
- package/dist/components/core/Segmented/SegmentedItem.js +1 -1
- package/dist/components/core/Sidebar/Sidebar.js +2 -1
- package/dist/components/core/Sidebar/SidebarMobileTrigger.js +2 -1
- package/dist/components/core/Sidebar/SidebarToggle.js +2 -1
- package/dist/components/core/Sidebar/SidebarUserProfile.js +1 -1
- package/dist/components/core/SocialIcon/SocialIcon.js +1 -1
- package/dist/components/core/Sortable/Sortable.js +2 -2
- package/dist/components/core/Sortable/Sortable.theme.js +1 -1
- package/dist/components/core/Sortable/Sortable.types.d.ts +7 -5
- package/dist/components/core/Tabs/TabsBody.js +1 -1
- package/dist/components/core/Tabs/TabsTrigger.js +1 -1
- package/dist/components/core/Tag/Tag.js +2 -2
- package/dist/components/core/Toast/Toast.d.ts +2 -2
- package/dist/components/core/Toast/Toast.js +30 -21
- package/dist/components/core/Toast/Toast.theme.js +4 -9
- package/dist/components/core/Toast/Toast.types.d.ts +4 -21
- package/dist/components/core/Toast/index.d.ts +1 -1
- package/dist/components/core/Tooltip/Tooltip.js +1 -1
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
- package/dist/components/core/index.js +9 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.d.ts +2 -2
- package/dist/components/data-display/Table/Table.types.d.ts +8 -8
- package/dist/components/effects/CustomCursor/CustomCursor.js +2 -2
- package/dist/components/effects/GlassSurface/GlassSurface.d.ts +1 -1
- package/dist/components/effects/GlassSurface/GlassSurface.js +17 -9
- package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +6 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.animations.d.ts +39 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.animations.js +98 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.d.ts +3 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.js +104 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.types.d.ts +30 -0
- package/dist/components/effects/InteractiveCharacters/characters/BlobCharacter.d.ts +3 -0
- package/dist/components/effects/InteractiveCharacters/characters/BlobCharacter.js +36 -0
- package/dist/components/effects/InteractiveCharacters/characters/SmallCharacter.d.ts +3 -0
- package/dist/components/effects/InteractiveCharacters/characters/SmallCharacter.js +36 -0
- package/dist/components/effects/InteractiveCharacters/characters/TallCharacter.d.ts +3 -0
- package/dist/components/effects/InteractiveCharacters/characters/TallCharacter.js +37 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useBlink.d.ts +14 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useBlink.js +41 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useIdleAnimation.d.ts +25 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useIdleAnimation.js +84 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useMouseTracking.d.ts +18 -0
- package/dist/components/effects/InteractiveCharacters/hooks/useMouseTracking.js +35 -0
- package/dist/components/effects/InteractiveCharacters/index.d.ts +2 -0
- package/dist/components/effects/MorphingText/MorphingText.d.ts +1 -1
- package/dist/components/effects/MorphingText/MorphingText.js +6 -5
- package/dist/components/effects/Neumorphic/InsetCircleButton.d.ts +10 -0
- package/dist/components/effects/Neumorphic/InsetCircleButton.js +10 -0
- package/dist/components/effects/Neumorphic/InsetPill.d.ts +8 -0
- package/dist/components/effects/Neumorphic/InsetPill.js +7 -0
- package/dist/components/effects/Neumorphic/index.d.ts +4 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.d.ts +1 -1
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.js +4 -4
- package/dist/components/effects/Overlay/Overlay.js +6 -4
- package/dist/components/effects/PageTransition/PageTransition.animations.d.ts +8 -0
- package/dist/components/effects/PageTransition/PageTransition.animations.js +53 -0
- package/dist/components/effects/PageTransition/PageTransition.d.ts +3 -0
- package/dist/components/effects/PageTransition/PageTransition.js +71 -0
- package/dist/components/effects/PageTransition/PageTransition.types.d.ts +15 -0
- package/dist/components/effects/PageTransition/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +6 -0
- package/dist/components/effects/index.js +4 -0
- package/dist/components/forms/Checkbox/Checkbox.animations.d.ts +14 -0
- package/dist/components/forms/Checkbox/Checkbox.animations.js +53 -0
- package/dist/components/forms/Checkbox/Checkbox.js +4 -2
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPicker.types.d.ts +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerBody.js +3 -3
- package/dist/components/forms/Combobox/Combobox.js +5 -3
- package/dist/components/forms/DatePicker/DatePickerBody.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePicker.animations.d.ts +1 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.d.ts +37 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.js +110 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.d.ts +5 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +52 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.types.d.ts +154 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.d.ts +6 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.js +208 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerPresets.d.ts +6 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerPresets.js +41 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.d.ts +6 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +32 -0
- package/dist/components/forms/DateRangePicker/dateRangePresets.d.ts +5 -0
- package/dist/components/forms/DateRangePicker/dateRangePresets.js +59 -0
- package/dist/components/forms/DateRangePicker/index.d.ts +4 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.animations.d.ts +36 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.animations.js +22 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.d.ts +3 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.js +111 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.d.ts +19 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +27 -0
- package/dist/components/forms/FileUpload/FileUploadProgress.types.d.ts +33 -0
- package/dist/components/forms/FileUpload/index.d.ts +3 -0
- package/dist/components/forms/Input/Input.js +8 -13
- package/dist/components/forms/Input/Input.types.d.ts +6 -0
- package/dist/components/forms/InputAddress/InputAddress.theme.js +1 -1
- package/dist/components/forms/InputCounter/InputCounter.js +1 -1
- package/dist/components/forms/InputCreditCard/InputCreditCard.theme.js +1 -1
- package/dist/components/forms/InputOTP/InputOTP.theme.js +1 -1
- package/dist/components/forms/Radio/Radio.animations.d.ts +10 -0
- package/dist/components/forms/Radio/Radio.animations.js +33 -0
- package/dist/components/forms/Radio/Radio.js +11 -2
- package/dist/components/forms/Radio/Radio.theme.js +3 -3
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +13 -4
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +2 -2
- package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +11 -0
- package/dist/components/forms/Select/Select.d.ts +1 -1
- package/dist/components/forms/Select/Select.js +7 -7
- package/dist/components/forms/Select/Select.types.d.ts +3 -3
- package/dist/components/forms/SelectableCard/SelectableCard.js +1 -1
- package/dist/components/forms/Slider/Slider.js +10 -3
- package/dist/components/forms/Slider/Slider.theme.js +3 -3
- package/dist/components/forms/Switch/Switch.js +10 -2
- package/dist/components/forms/Switch/Switch.theme.js +3 -3
- package/dist/components/forms/forms.theme.js +1 -1
- package/dist/components/forms/index.d.ts +6 -3
- package/dist/components/forms/index.js +8 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useMediaQuery.d.ts +5 -0
- package/dist/hooks/useMediaQuery.js +21 -0
- package/dist/index.js +21 -2
- package/dist/styles.css +1 -1
- package/dist/utils/dateUtils.js +56 -5
- package/dist/utils/formatUtils.d.ts +10 -0
- package/dist/utils/formatUtils.js +24 -0
- package/dist/utils/index.d.ts +1 -1
- package/package.json +12 -4
- package/src/global.scss +319 -39
- package/src/styles/theme.css +105 -16
- package/src/theme-plugin.css +13 -0
- package/dist/components/ai/ApprovalCard/ApprovalCard.d.ts +0 -3
- package/dist/components/ai/ApprovalCard/ApprovalCard.js +0 -16
- package/dist/components/ai/ApprovalCard/ApprovalCard.theme.d.ts +0 -13
- package/dist/components/ai/ApprovalCard/ApprovalCard.theme.js +0 -15
- package/dist/components/ai/ApprovalCard/ApprovalCard.types.d.ts +0 -43
- package/dist/components/ai/ApprovalCard/index.d.ts +0 -2
- package/dist/components/ai/MessageHistory/MessageHistory.d.ts +0 -18
- package/dist/components/ai/MessageHistory/MessageHistory.js +0 -98
- package/dist/components/ai/MessageHistory/MessageHistory.theme.d.ts +0 -2
- package/dist/components/ai/MessageHistory/MessageHistory.theme.js +0 -8
- package/dist/components/ai/MessageHistory/MessageHistory.types.d.ts +0 -94
- package/dist/components/ai/MessageHistory/index.d.ts +0 -3
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.animations.d.ts +0 -10
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.animations.js +0 -47
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.d.ts +0 -20
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.js +0 -55
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.theme.d.ts +0 -2
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.theme.js +0 -20
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.types.d.ts +0 -67
- package/dist/components/ai/ThinkingIndicator/index.d.ts +0 -3
- package/dist/components/forms/TransferList/TransferList.animations.d.ts +0 -10
- package/dist/components/forms/TransferList/TransferList.animations.js +0 -32
- package/dist/components/forms/TransferList/TransferList.d.ts +0 -28
- package/dist/components/forms/TransferList/TransferList.js +0 -199
- package/dist/components/forms/TransferList/TransferList.theme.d.ts +0 -6
- package/dist/components/forms/TransferList/TransferList.theme.js +0 -60
- package/dist/components/forms/TransferList/TransferList.types.d.ts +0 -101
- package/dist/components/forms/TransferList/index.d.ts +0 -3
- package/dist/icons/Icon.d.ts +0 -24
- package/dist/icons/Icon.js +0 -30
- package/dist/icons/Index.d.ts +0 -16
- package/dist/icons/core/ChevronUpDown.d.ts +0 -1
- package/dist/icons/core/ChevronUpDown.js +0 -7
- package/dist/icons/core/DollarIcon.d.ts +0 -1
- package/dist/icons/core/DollarIcon.js +0 -5
- package/dist/icons/core/LockIcon.d.ts +0 -1
- package/dist/icons/core/LockIcon.js +0 -5
- package/dist/icons/core/MinusIcon.d.ts +0 -1
- package/dist/icons/core/MinusIcon.js +0 -7
- package/dist/icons/core/PlusIcon.d.ts +0 -1
- package/dist/icons/core/PlusIcon.js +0 -7
- package/dist/icons/core/SearchIcon.d.ts +0 -1
- package/dist/icons/core/SearchIcon.js +0 -7
- package/dist/icons/core/TickIcon.d.ts +0 -1
- package/dist/icons/core/TickIcon.js +0 -5
- package/dist/icons/core/User.d.ts +0 -1
- package/dist/utils/useClickOutside.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useId, useState, useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
import React__default, { useId, useState, useRef, useCallback, useEffect } from 'react';
|
|
3
3
|
import { useReducedMotion, AnimatePresence, motion } from 'motion/react';
|
|
4
4
|
import { cn } from '../../../utils/cn.js';
|
|
5
5
|
|
|
@@ -17,7 +17,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
17
17
|
* />
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
const MorphingText = ({ texts, interval = 3000, transitionDuration = 800, loop = true, pauseOnHover = false, currentIndex: controlledIndex, onTextChange, className, ...props }) => {
|
|
20
|
+
const MorphingText = React__default.forwardRef(({ texts, interval = 3000, transitionDuration = 800, loop = true, pauseOnHover = false, currentIndex: controlledIndex, onTextChange, className, ...props }, ref) => {
|
|
21
21
|
const filterId = useId();
|
|
22
22
|
const shouldReduceMotion = useReducedMotion();
|
|
23
23
|
const isControlled = controlledIndex !== undefined;
|
|
@@ -80,12 +80,13 @@ const MorphingText = ({ texts, interval = 3000, transitionDuration = 800, loop =
|
|
|
80
80
|
const currentText = texts[safeIndex];
|
|
81
81
|
// Reduced motion: instant swap with no animation
|
|
82
82
|
if (shouldReduceMotion) {
|
|
83
|
-
return (jsx("div", { className: cn('relative inline-block', className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, "aria-live": "polite", "aria-atomic": "true", ...props, children: jsx("span", { children: currentText }) }));
|
|
83
|
+
return (jsx("div", { ref: ref, className: cn('relative inline-block', className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, "aria-live": "polite", "aria-atomic": "true", ...props, children: jsx("span", { children: currentText }) }));
|
|
84
84
|
}
|
|
85
|
-
return (jsxs("div", { className: cn('relative inline-block', className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, "aria-live": "polite", "aria-atomic": "true", ...props, children: [jsx("svg", { className: "absolute h-0 w-0", "aria-hidden": "true", children: jsx("defs", { children: jsx("filter", { id: `${filterId}-blur`, children: jsx("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "0" }) }) }) }), jsx("span", { className: "invisible block", "aria-hidden": "true", children: currentText }), jsx(AnimatePresence, { mode: "popLayout", initial: false, children: jsx(motion.span, { className: "absolute inset-0 flex items-center", initial: { opacity: 0, filter: 'blur(8px)' }, animate: { opacity: 1, filter: 'blur(0px)' }, exit: { opacity: 0, filter: 'blur(8px)' }, transition: {
|
|
85
|
+
return (jsxs("div", { ref: ref, className: cn('relative inline-block', className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, "aria-live": "polite", "aria-atomic": "true", ...props, children: [jsx("svg", { className: "absolute h-0 w-0", "aria-hidden": "true", children: jsx("defs", { children: jsx("filter", { id: `${filterId}-blur`, children: jsx("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "0" }) }) }) }), jsx("span", { className: "invisible block", "aria-hidden": "true", children: currentText }), jsx(AnimatePresence, { mode: "popLayout", initial: false, children: jsx(motion.span, { className: "absolute inset-0 flex items-center", initial: { opacity: 0, filter: 'blur(8px)' }, animate: { opacity: 1, filter: 'blur(0px)' }, exit: { opacity: 0, filter: 'blur(8px)' }, transition: {
|
|
86
86
|
duration: durationSeconds,
|
|
87
87
|
ease: 'easeInOut',
|
|
88
88
|
}, children: currentText }, safeIndex) })] }));
|
|
89
|
-
};
|
|
89
|
+
});
|
|
90
|
+
MorphingText.displayName = "MorphingText";
|
|
90
91
|
|
|
91
92
|
export { MorphingText };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface InsetCircleButtonProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
size?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
classNameDisc?: string;
|
|
7
|
+
classNameHover?: string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function InsetCircleButton({ children, size, className, classNameDisc, classNameHover, onClick, }: InsetCircleButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { motion } from 'motion/react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
function InsetCircleButton({ children, size = 44, className, classNameDisc, classNameHover, onClick, }) {
|
|
7
|
+
return (jsx("div", { className: cn("neu-circle-groove group shrink-0 cursor-pointer bg-neutral-200/80 dark:bg-neutral-900", className), style: { width: size, height: size }, onClick: onClick, children: jsxs(motion.div, { className: cn("neu-circle-disc bg-linear-to-br from-neutral-100 to-neutral-300 dark:from-neutral-700 dark:to-neutral-900", classNameDisc), whileHover: { scale: 1 }, whileTap: { scale: 0.975 }, transition: { type: "spring", stiffness: 200, damping: 20 }, children: [jsx("div", { className: cn("absolute inset-0 rounded-full bg-linear-to-br from-neutral-300 to-neutral-200 dark:from-neutral-900 dark:to-neutral-700 opacity-0 group-hover:opacity-100 transition-opacity duration-300", classNameHover) }), jsx("div", { className: "relative z-2", children: children })] }) }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { InsetCircleButton };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface InsetPillProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
padding?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function InsetPill({ children, className, padding, onClick, }: InsetPillProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function InsetPill({ children, className, padding = "10px 18px", onClick, }) {
|
|
4
|
+
return (jsx("div", { className: `neu-inset inline-flex items-center gap-2 cursor-pointer rounded-full bg-neutral-200/60 dark:bg-neutral-800/80 ${className !== null && className !== void 0 ? className : ""}`, style: { padding }, onClick: onClick, children: jsx("div", { className: "relative z-2 flex items-center gap-2", children: children }) }));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { InsetPill };
|
|
@@ -25,4 +25,4 @@ import type { NoiseOverlayProps } from "./NoiseOverlay.types";
|
|
|
25
25
|
* </div>
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
export declare const NoiseOverlay: React.
|
|
28
|
+
export declare const NoiseOverlay: React.ForwardRefExoticComponent<NoiseOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useId, useRef, useEffect } from 'react';
|
|
2
|
+
import React__default, { useId, useRef, useEffect } from 'react';
|
|
3
3
|
import { useReducedMotion } from 'motion/react';
|
|
4
4
|
import { cn } from '../../../utils/cn.js';
|
|
5
5
|
|
|
@@ -28,7 +28,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
28
28
|
* </div>
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
const NoiseOverlay = ({ opacity = 0.15, frequency = 0.65, octaves = 4, blendMode = "overlay", animated = false, className, style, ...props }) => {
|
|
31
|
+
const NoiseOverlay = React__default.forwardRef(({ opacity = 0.15, frequency = 0.65, octaves = 4, blendMode = "overlay", animated = false, className, style, ...props }, ref) => {
|
|
32
32
|
const filterId = useId();
|
|
33
33
|
const shouldReduceMotion = useReducedMotion();
|
|
34
34
|
const turbulenceRef = useRef(null);
|
|
@@ -50,12 +50,12 @@ const NoiseOverlay = ({ opacity = 0.15, frequency = 0.65, octaves = 4, blendMode
|
|
|
50
50
|
clearInterval(intervalId);
|
|
51
51
|
};
|
|
52
52
|
}, [isAnimating]);
|
|
53
|
-
return (jsx("div", { className: cn("absolute inset-0 pointer-events-none", className), style: {
|
|
53
|
+
return (jsx("div", { ref: ref, className: cn("absolute inset-0 pointer-events-none", className), style: {
|
|
54
54
|
mixBlendMode: blendMode,
|
|
55
55
|
opacity,
|
|
56
56
|
...style,
|
|
57
57
|
}, "aria-hidden": "true", ...props, children: jsxs("svg", { className: "absolute inset-0 w-full h-full", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "none", children: [jsx("filter", { id: filterId, children: jsx("feTurbulence", { ref: turbulenceRef, type: "fractalNoise", baseFrequency: frequency, numOctaves: octaves, stitchTiles: "stitch", seed: 0 }) }), jsx("rect", { width: "100%", height: "100%", filter: `url(#${filterId})` })] }) }));
|
|
58
|
-
};
|
|
58
|
+
});
|
|
59
59
|
NoiseOverlay.displayName = "NoiseOverlay";
|
|
60
60
|
|
|
61
61
|
export { NoiseOverlay };
|
|
@@ -97,14 +97,16 @@ const Overlay = React__default.forwardRef(({ isOpen, onClose, closeOnOverlayClic
|
|
|
97
97
|
const finalContentAnimations = { ...contentAnimations };
|
|
98
98
|
if (animationDuration) {
|
|
99
99
|
if (animationDuration.enter && finalOverlayAnimations.animate) {
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
const animate = finalOverlayAnimations.animate;
|
|
101
|
+
animate.transition = {
|
|
102
|
+
...animate.transition,
|
|
102
103
|
duration: animationDuration.enter,
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
106
|
if (animationDuration.exit && finalOverlayAnimations.exit) {
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
const exit = finalOverlayAnimations.exit;
|
|
108
|
+
exit.transition = {
|
|
109
|
+
...exit.transition,
|
|
108
110
|
duration: animationDuration.exit,
|
|
109
111
|
};
|
|
110
112
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PageTransitionDirection } from './PageTransition.types';
|
|
2
|
+
import type { Variants } from 'motion/react';
|
|
3
|
+
export declare const buildCurtainVariants: (direction: PageTransitionDirection, duration: number) => Variants;
|
|
4
|
+
export declare const buildLogoParallaxVariants: (direction: PageTransitionDirection, duration: number) => Variants;
|
|
5
|
+
export declare const buildSplitVariants: (axis: "h" | "v", duration: number) => {
|
|
6
|
+
panel1: Variants;
|
|
7
|
+
panel2: Variants;
|
|
8
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const exitMap = {
|
|
2
|
+
up: { y: '-100%', x: 0 },
|
|
3
|
+
down: { y: '100%', x: 0 },
|
|
4
|
+
left: { x: '-100%', y: 0 },
|
|
5
|
+
right: { x: '100%', y: 0 },
|
|
6
|
+
};
|
|
7
|
+
const buildCurtainVariants = (direction, duration) => ({
|
|
8
|
+
covered: { y: 0, x: 0 },
|
|
9
|
+
exit: {
|
|
10
|
+
...exitMap[direction],
|
|
11
|
+
transition: {
|
|
12
|
+
duration,
|
|
13
|
+
ease: [0.76, 0, 0.24, 1],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
// Logo is rendered INSIDE the curtain. These are relative offsets that
|
|
18
|
+
// counteract ~30% of the curtain's motion, making the logo appear to
|
|
19
|
+
// move at ~70% of the curtain's speed (parallax lag effect).
|
|
20
|
+
const logoInnerOffsetMap = {
|
|
21
|
+
up: { y: '30vh', x: 0 },
|
|
22
|
+
down: { y: '-30vh', x: 0 },
|
|
23
|
+
left: { x: '30vw', y: 0 },
|
|
24
|
+
right: { x: '-30vw', y: 0 },
|
|
25
|
+
};
|
|
26
|
+
const buildLogoParallaxVariants = (direction, duration) => ({
|
|
27
|
+
covered: { y: 0, x: 0 },
|
|
28
|
+
exit: {
|
|
29
|
+
...logoInnerOffsetMap[direction],
|
|
30
|
+
transition: {
|
|
31
|
+
duration,
|
|
32
|
+
ease: [0.76, 0, 0.24, 1],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
const buildSplitVariants = (axis, duration) => ({
|
|
37
|
+
panel1: {
|
|
38
|
+
covered: {},
|
|
39
|
+
exit: {
|
|
40
|
+
[axis === 'h' ? 'y' : 'x']: '-100%',
|
|
41
|
+
transition: { duration, ease: [0.76, 0, 0.24, 1] },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
panel2: {
|
|
45
|
+
covered: {},
|
|
46
|
+
exit: {
|
|
47
|
+
[axis === 'h' ? 'y' : 'x']: '100%',
|
|
48
|
+
transition: { duration, ease: [0.76, 0, 0.24, 1] },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export { buildCurtainVariants, buildLogoParallaxVariants, buildSplitVariants };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { motion } from 'motion/react';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
import { buildCurtainVariants, buildLogoParallaxVariants, buildSplitVariants } from './PageTransition.animations.js';
|
|
6
|
+
|
|
7
|
+
const PageTransition = ({ children, logo, type = "slide", direction = "up", duration = 0.8, delay = 0.8, color = "bg-[var(--color-primary)]", className, parallax = true, onStart, onComplete, }) => {
|
|
8
|
+
const [phase, setPhase] = useState("covered");
|
|
9
|
+
const [completedPanels, setCompletedPanels] = useState(0);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
let cancelled = false;
|
|
12
|
+
const loadPromise = new Promise((resolve) => {
|
|
13
|
+
if (document.readyState === "complete") {
|
|
14
|
+
resolve();
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
window.addEventListener("load", () => resolve(), { once: true });
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const delayPromise = new Promise((resolve) => {
|
|
21
|
+
setTimeout(resolve, delay * 1000);
|
|
22
|
+
});
|
|
23
|
+
Promise.all([loadPromise, delayPromise]).then(() => {
|
|
24
|
+
if (!cancelled) {
|
|
25
|
+
setPhase("exit");
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
if (!cancelled)
|
|
28
|
+
onStart === null || onStart === void 0 ? void 0 : onStart();
|
|
29
|
+
}, 250);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return () => {
|
|
33
|
+
cancelled = true;
|
|
34
|
+
};
|
|
35
|
+
}, [delay]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (type === "split" && completedPanels === 2) {
|
|
38
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete();
|
|
39
|
+
}
|
|
40
|
+
}, [completedPanels, type, onComplete]);
|
|
41
|
+
if (type === "split") {
|
|
42
|
+
const axis = direction === "up" || direction === "down" ? "h" : "v";
|
|
43
|
+
const splitVars = buildSplitVariants(axis, duration);
|
|
44
|
+
return (jsxs(Fragment, { children: [children, jsxs("div", { className: "fixed inset-0 z-[9999] pointer-events-none", children: [jsx(motion.div, { className: cn(axis === "h"
|
|
45
|
+
? "absolute inset-x-0 top-0 h-1/2"
|
|
46
|
+
: "absolute inset-y-0 left-0 w-1/2", color, className), variants: splitVars.panel1, initial: "covered", animate: phase, onAnimationComplete: (def) => {
|
|
47
|
+
if (def === "exit")
|
|
48
|
+
setCompletedPanels((n) => n + 1);
|
|
49
|
+
} }), jsx(motion.div, { className: cn(axis === "h"
|
|
50
|
+
? "absolute inset-x-0 bottom-0 h-1/2"
|
|
51
|
+
: "absolute inset-y-0 right-0 w-1/2", color, className), variants: splitVars.panel2, initial: "covered", animate: phase, onAnimationComplete: (def) => {
|
|
52
|
+
if (def === "exit")
|
|
53
|
+
setCompletedPanels((n) => n + 1);
|
|
54
|
+
} }), logo && (jsx("div", { className: "absolute inset-0 flex items-center justify-center z-10 pointer-events-none select-none", children: logo }))] })] }));
|
|
55
|
+
}
|
|
56
|
+
// Default: slide
|
|
57
|
+
const curtainVariants = buildCurtainVariants(direction, duration);
|
|
58
|
+
if (type === "slide" && parallax) {
|
|
59
|
+
const logoVariants = buildLogoParallaxVariants(direction, duration);
|
|
60
|
+
return (jsxs(Fragment, { children: [children, jsx(motion.div, { className: cn("fixed inset-0 z-[9999] flex items-center justify-center", color, className), style: { willChange: "transform" }, variants: curtainVariants, initial: "covered", animate: phase, onAnimationComplete: (def) => {
|
|
61
|
+
if (def === "exit")
|
|
62
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete();
|
|
63
|
+
}, children: logo && (jsx(motion.div, { className: "relative z-10 select-none", variants: logoVariants, initial: "covered", animate: phase, children: logo })) })] }));
|
|
64
|
+
}
|
|
65
|
+
return (jsxs(Fragment, { children: [children, jsx(motion.div, { className: cn("fixed inset-0 z-[9999] flex items-center justify-center", color, className), style: { willChange: "transform" }, variants: curtainVariants, initial: "covered", animate: phase, onAnimationComplete: (def) => {
|
|
66
|
+
if (def === "exit")
|
|
67
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete();
|
|
68
|
+
}, children: logo && jsx("div", { className: "relative z-10 select-none", children: logo }) })] }));
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { PageTransition };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type PageTransitionDirection = 'up' | 'down' | 'left' | 'right';
|
|
2
|
+
export type PageTransitionType = 'slide' | 'split';
|
|
3
|
+
export interface PageTransitionProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
logo?: React.ReactNode;
|
|
6
|
+
type?: PageTransitionType;
|
|
7
|
+
direction?: PageTransitionDirection;
|
|
8
|
+
duration?: number;
|
|
9
|
+
delay?: number;
|
|
10
|
+
color?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
parallax?: boolean;
|
|
13
|
+
onStart?: () => void;
|
|
14
|
+
onComplete?: () => void;
|
|
15
|
+
}
|
|
@@ -30,3 +30,9 @@ export { ScrollReveal } from "./ScrollReveal";
|
|
|
30
30
|
export type { ScrollRevealProps, ScrollRevealPreset } from "./ScrollReveal";
|
|
31
31
|
export { StickyScroll } from "./StickyScroll";
|
|
32
32
|
export type { StickyScrollProps, StickyScrollSection, } from "./StickyScroll";
|
|
33
|
+
export { PageTransition } from "./PageTransition";
|
|
34
|
+
export type { PageTransitionProps, PageTransitionDirection, } from "./PageTransition";
|
|
35
|
+
export { InteractiveCharacters } from "./InteractiveCharacters";
|
|
36
|
+
export type { InteractiveCharactersProps, CharacterState, CharacterSize, } from "./InteractiveCharacters";
|
|
37
|
+
export { InsetCircleButton, InsetPill } from "./Neumorphic";
|
|
38
|
+
export type { InsetCircleButtonProps, InsetPillProps, } from "./Neumorphic";
|
|
@@ -14,3 +14,7 @@ export { Spotlight } from './Spotlight/Spotlight.js';
|
|
|
14
14
|
export { ParallaxSection } from './ParallaxSection/ParallaxSection.js';
|
|
15
15
|
export { ScrollReveal } from './ScrollReveal/ScrollReveal.js';
|
|
16
16
|
export { StickyScroll } from './StickyScroll/StickyScroll.js';
|
|
17
|
+
export { PageTransition } from './PageTransition/PageTransition.js';
|
|
18
|
+
export { InteractiveCharacters } from './InteractiveCharacters/InteractiveCharacters.js';
|
|
19
|
+
export { InsetCircleButton } from './Neumorphic/InsetCircleButton.js';
|
|
20
|
+
export { InsetPill } from './Neumorphic/InsetPill.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Variants } from "motion/react";
|
|
2
|
+
/**
|
|
3
|
+
* Checkmark SVG path draw-on animation
|
|
4
|
+
* Animates pathLength from 0 → 1 for a smooth draw effect
|
|
5
|
+
*/
|
|
6
|
+
export declare const checkmarkVariants: Variants;
|
|
7
|
+
/**
|
|
8
|
+
* Indeterminate dash draw-on animation
|
|
9
|
+
*/
|
|
10
|
+
export declare const indeterminateVariants: Variants;
|
|
11
|
+
/**
|
|
12
|
+
* Reduced motion variants — instant opacity toggle, no path draw
|
|
13
|
+
*/
|
|
14
|
+
export declare const reducedMotionVariants: Variants;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const smoothEase = [0.65, 0, 0.35, 1];
|
|
2
|
+
/**
|
|
3
|
+
* Checkmark SVG path draw-on animation
|
|
4
|
+
* Animates pathLength from 0 → 1 for a smooth draw effect
|
|
5
|
+
*/
|
|
6
|
+
const checkmarkVariants = {
|
|
7
|
+
unchecked: {
|
|
8
|
+
pathLength: 0,
|
|
9
|
+
opacity: 0,
|
|
10
|
+
transition: {
|
|
11
|
+
pathLength: { duration: 0.15, ease: smoothEase },
|
|
12
|
+
opacity: { duration: 0.1, ease: "easeOut" },
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
checked: {
|
|
16
|
+
pathLength: 1,
|
|
17
|
+
opacity: 1,
|
|
18
|
+
transition: {
|
|
19
|
+
pathLength: { duration: 0.2, ease: smoothEase },
|
|
20
|
+
opacity: { duration: 0.05, ease: "easeOut" },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Indeterminate dash draw-on animation
|
|
26
|
+
*/
|
|
27
|
+
const indeterminateVariants = {
|
|
28
|
+
unchecked: {
|
|
29
|
+
pathLength: 0,
|
|
30
|
+
opacity: 0,
|
|
31
|
+
transition: {
|
|
32
|
+
pathLength: { duration: 0.1, ease: smoothEase },
|
|
33
|
+
opacity: { duration: 0.08, ease: "easeOut" },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
checked: {
|
|
37
|
+
pathLength: 1,
|
|
38
|
+
opacity: 1,
|
|
39
|
+
transition: {
|
|
40
|
+
pathLength: { duration: 0.15, ease: smoothEase },
|
|
41
|
+
opacity: { duration: 0.05, ease: "easeOut" },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Reduced motion variants — instant opacity toggle, no path draw
|
|
47
|
+
*/
|
|
48
|
+
const reducedMotionVariants = {
|
|
49
|
+
unchecked: { opacity: 0 },
|
|
50
|
+
checked: { opacity: 1 },
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { checkmarkVariants, indeterminateVariants, reducedMotionVariants };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import React__default, { useId, useState, useRef, useEffect } from 'react';
|
|
3
|
+
import { useReducedMotion, AnimatePresence, motion } from 'motion/react';
|
|
3
4
|
import { checkboxTheme } from './Checkbox.theme.js';
|
|
4
5
|
import { formLabelTheme } from '../FormLabel/FormLabel.theme.js';
|
|
5
|
-
import { MinusIcon, CheckIcon } from '@heroicons/react/24/outline';
|
|
6
6
|
import { cn } from '../../../utils/cn.js';
|
|
7
7
|
import { useCheckboxGroupContext } from './CheckboxContext.js';
|
|
8
8
|
import { CheckboxGroup } from './CheckboxGroup.js';
|
|
9
|
+
import { reducedMotionVariants, indeterminateVariants, checkmarkVariants } from './Checkbox.animations.js';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Checkbox component for selecting one or more options
|
|
@@ -13,6 +14,7 @@ import { CheckboxGroup } from './CheckboxGroup.js';
|
|
|
13
14
|
const CheckboxComponent = React__default.forwardRef(({ id: idProp, name: nameProp, value, checked: controlledChecked, indeterminate = false, onChange, label, description, state: stateProp = "default", size: sizeProp = "md", className, ...restProps }, ref) => {
|
|
14
15
|
var _a, _b, _c, _d;
|
|
15
16
|
const autoId = useId();
|
|
17
|
+
const shouldReduceMotion = useReducedMotion();
|
|
16
18
|
const groupContext = useCheckboxGroupContext();
|
|
17
19
|
// Resolve props from group context or individual props
|
|
18
20
|
const id = idProp !== null && idProp !== void 0 ? idProp : autoId;
|
|
@@ -57,7 +59,7 @@ const CheckboxComponent = React__default.forwardRef(({ id: idProp, name: namePro
|
|
|
57
59
|
ref(node);
|
|
58
60
|
else if (ref)
|
|
59
61
|
ref.current = node;
|
|
60
|
-
}, type: "checkbox", id: id, name: name, value: value, checked: isChecked, onChange: handleChange, disabled: isDisabled, "aria-describedby": description ? `${id}-description` : undefined, "data-state": isDisabled ? "disabled" : "default", className: cn(checkboxTheme.inputStyle, checkboxTheme.sizes[size], indeterminate && "bg-neutral-200") }), indeterminate && (jsx(
|
|
62
|
+
}, type: "checkbox", id: id, name: name, value: value, checked: isChecked, onChange: handleChange, disabled: isDisabled, "aria-describedby": description ? `${id}-description` : undefined, "data-state": isDisabled ? "disabled" : "default", className: cn(checkboxTheme.inputStyle, checkboxTheme.sizes[size], indeterminate && "bg-neutral-200") }), jsxs(AnimatePresence, { mode: "wait", children: [indeterminate && (jsx(motion.svg, { viewBox: "0 0 16 16", fill: "none", className: cn("pointer-events-none col-start-1 row-start-1 self-center justify-self-center text-neutral-600", size === "sm" ? "size-3" : "size-4"), children: jsx(motion.path, { d: "M3.5 8 L12.5 8", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", variants: shouldReduceMotion ? reducedMotionVariants : indeterminateVariants, initial: "unchecked", animate: "checked", exit: "unchecked" }) }, "indeterminate")), isChecked && !indeterminate && (jsx(motion.svg, { viewBox: "0 0 16 16", fill: "none", className: cn("pointer-events-none col-start-1 row-start-1 self-center justify-self-center text-white", size === "sm" ? "size-3" : "size-4"), children: jsx(motion.path, { d: "M3.5 8.5 L6.5 11.5 L12.5 4.5", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round", variants: shouldReduceMotion ? reducedMotionVariants : checkmarkVariants, initial: "unchecked", animate: "checked", exit: "unchecked" }) }, "checkmark"))] })] }), (label || description) && (jsxs("label", { htmlFor: id, className: cn("cursor-pointer", isDisabled && "cursor-not-allowed"), children: [label && (typeof label === 'string' ? (jsx("span", { className: cn(formLabelTheme.baseStyle, formLabelTheme.stateStyles[state], "mb-0"), children: label })) : (label)), description && (typeof description === 'string' ? (jsx("div", { id: `${id}-description`, className: checkboxTheme.descriptionStyle, children: description })) : (description))] }))] }));
|
|
61
63
|
});
|
|
62
64
|
CheckboxComponent.displayName = "Checkbox";
|
|
63
65
|
const Checkbox = Object.assign(CheckboxComponent, {
|
|
@@ -10,7 +10,7 @@ const checkboxTheme = {
|
|
|
10
10
|
// Default state - light
|
|
11
11
|
"border-[var(--color-border)] bg-[var(--color-surface)] " +
|
|
12
12
|
// Default state - dark
|
|
13
|
-
"dark:bg-[var(--color-background-
|
|
13
|
+
"dark:bg-[var(--color-background-tertiary)] " +
|
|
14
14
|
// Checked state - light
|
|
15
15
|
"checked:border-[var(--color-primary)] checked:bg-[var(--color-primary)] " +
|
|
16
16
|
// Checked state - dark
|
|
@@ -27,7 +27,7 @@ const checkboxTheme = {
|
|
|
27
27
|
"disabled:bg-[var(--color-background-disabled)] disabled:checked:outline-0 " +
|
|
28
28
|
"data-[state=disabled]:border-[var(--color-border)] data-[state=disabled]:bg-[var(--color-background-disabled)] data-[state=disabled]:cursor-not-allowed " +
|
|
29
29
|
// Disabled state - dark
|
|
30
|
-
"dark:disabled:bg-[var(--color-neutral-
|
|
30
|
+
"dark:disabled:bg-[var(--color-neutral-800)] dark:disabled:border-[var(--color-neutral-600)] " +
|
|
31
31
|
"dark:data-[state=disabled]:bg-[var(--color-neutral-700)] dark:data-[state=disabled]:border-[var(--color-neutral-600)]",
|
|
32
32
|
// Description text - light and dark
|
|
33
33
|
descriptionStyle: "text-base mt-0.5 " + "text-[var(--color-text-secondary)]/80 " + " ",
|
|
@@ -38,7 +38,7 @@ const checkboxTheme = {
|
|
|
38
38
|
// Group styles
|
|
39
39
|
groupStyle: "flex flex-col gap-1.5",
|
|
40
40
|
groupHorizontalStyle: "flex-row flex-wrap gap-x-6 gap-y-3",
|
|
41
|
-
groupDescriptionStyle: "text-base text-[var(--color-text-secondary)]
|
|
41
|
+
groupDescriptionStyle: "text-base text-[var(--color-text-secondary)] -mt-0.5 mb-1",
|
|
42
42
|
groupErrorStyle: "text-base text-[var(--color-danger)] mt-1.5",
|
|
43
43
|
groupItemsStyle: "flex flex-col gap-3",
|
|
44
44
|
};
|
|
@@ -95,7 +95,7 @@ export interface ColorPickerContextValue {
|
|
|
95
95
|
isOpen: boolean;
|
|
96
96
|
setIsOpen: (open: boolean) => void;
|
|
97
97
|
triggerRef: React.RefObject<HTMLElement>;
|
|
98
|
-
placement:
|
|
98
|
+
placement: import("../../../hooks/useSelectPortal").SelectPlacement;
|
|
99
99
|
offset: number;
|
|
100
100
|
showAlpha: boolean;
|
|
101
101
|
showEyeDropper: boolean;
|
|
@@ -26,7 +26,7 @@ const ColorPickerBody = ({ children, className, portal = true, animation = true,
|
|
|
26
26
|
const { position, cssVariables } = useSelectPortal({
|
|
27
27
|
triggerRef,
|
|
28
28
|
isOpen: isOpen || false,
|
|
29
|
-
placement
|
|
29
|
+
placement,
|
|
30
30
|
offset: offset || 4,
|
|
31
31
|
autoWidth: false,
|
|
32
32
|
});
|
|
@@ -52,8 +52,8 @@ const ColorPickerBody = ({ children, className, portal = true, animation = true,
|
|
|
52
52
|
document.addEventListener('keydown', handleEscape);
|
|
53
53
|
return () => document.removeEventListener('keydown', handleEscape);
|
|
54
54
|
}, [isOpen, setIsOpen, triggerRef]);
|
|
55
|
-
// Extract DOM
|
|
56
|
-
const { onAnimationStart, onAnimationEnd, onDrag, onDragStart, onDragEnd, ...domProps } = rest;
|
|
55
|
+
// Extract DOM event handler props that conflict with Framer Motion
|
|
56
|
+
const { onAnimationStart: _onAnimationStart, onAnimationEnd: _onAnimationEnd, onDrag: _onDrag, onDragStart: _onDragStart, onDragEnd: _onDragEnd, ...domProps } = rest;
|
|
57
57
|
const content = (jsx(AnimatePresence, { children: isOpen && (jsx(motion.div, { ref: contentRef, role: "dialog", "aria-label": "Color picker", className: cn('fixed z-50', theme.contentStyle, className), style: {
|
|
58
58
|
...cssVariables,
|
|
59
59
|
top: `${position.top}px`,
|
|
@@ -95,7 +95,8 @@ const ComboboxOptions = ({ isOpen, onClose, triggerRef, portal, placement, offse
|
|
|
95
95
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
96
96
|
}, [isOpen, onClose, portal, contentRef, optionsRef, triggerRef]);
|
|
97
97
|
// Theme can come from Select's theme (optionsContainerStyle) or Combobox's theme (dropdownStyle)
|
|
98
|
-
const
|
|
98
|
+
const comboboxThemeRef = theme;
|
|
99
|
+
const dropdownStyle = comboboxThemeRef.dropdownStyle ||
|
|
99
100
|
theme.optionsContainerStyle ||
|
|
100
101
|
comboboxTheme.dropdownStyle;
|
|
101
102
|
const optionStyle = theme.optionStyle || comboboxTheme.optionStyle;
|
|
@@ -396,7 +397,8 @@ const ComboboxInner = ({ options, value, onChange, placeholder = "Search...", la
|
|
|
396
397
|
? `${comboboxId}-option-${customFilteredOptions[highlightedIndex].id}`
|
|
397
398
|
: undefined, "aria-autocomplete": "list", "aria-invalid": isInvalid, autoComplete: "off", className: cn(inputClasses, sizeClasses, iconStartPadding, showClearButton && "pr-8", inputClassName), value: searchValue, onChange: handleInputChange, onFocus: handleInputFocus, onKeyDown: handleKeyDown, placeholder: placeholder, disabled: isDisabled, required: required }), hasLeftIcon && (jsx("div", { className: theme.iconStartStyle, children: iconStart })), showClearButton && (jsx("button", { type: "button", className: theme.clearButtonStyle, onClick: handleClear, "aria-label": "Clear selection", tabIndex: -1, children: jsx(XMarkIcon, { className: theme.clearIconStyle }) }))] }) }), jsx(ComboboxOptions, { isOpen: isOpen, onClose: () => setIsOpen(false), triggerRef: wrapperRef, portal: portal, placement: placement, offset: offset, emptyMessage: emptyMessage, className: dropdownClassName })] }), helperText && (jsx("p", { className: cn(helperTextClasses, helperTextStateClasses), children: helperText })), name && (jsx("input", { type: "hidden", name: name, value: value !== undefined ? String(value) : "" }))] }) }));
|
|
398
399
|
};
|
|
399
|
-
const
|
|
400
|
-
|
|
400
|
+
const ComboboxForwarded = React__default.forwardRef(ComboboxInner);
|
|
401
|
+
ComboboxForwarded.displayName = "Combobox";
|
|
402
|
+
const Combobox = ComboboxForwarded;
|
|
401
403
|
|
|
402
404
|
export { Combobox };
|
|
@@ -213,7 +213,7 @@ const DatePickerBody = ({ isOpen, className, onClose, portal = true, placement =
|
|
|
213
213
|
const adjustedLeft = new Date(newDate);
|
|
214
214
|
adjustedLeft.setMonth(adjustedLeft.getMonth() - 1);
|
|
215
215
|
setLeftCalendarDate(adjustedLeft);
|
|
216
|
-
}, onNavigatePrev: null, onNavigateNext: handleNavigateNext, minDate: minDate, maxDate: maxDate, isDateDisabled: isDateDisabled, showToday: showToday, selectTodayByDefault: false, weekdays: weekdays, months: months, yearRange: yearRange, size: "md" }) })] })) }), jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-t border-[var(--color-border)]
|
|
216
|
+
}, onNavigatePrev: null, onNavigateNext: handleNavigateNext, minDate: minDate, maxDate: maxDate, isDateDisabled: isDateDisabled, showToday: showToday, selectTodayByDefault: false, weekdays: weekdays, months: months, yearRange: yearRange, size: "md" }) })] })) }), jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-t border-[var(--color-border)]", children: [jsx("div", { className: "text-sm text-[var(--color-text-muted", children: formatRangeDisplay(tempRange) }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Button, { variant: "outline", color: "neutral", size: "sm", onClick: handleCancel, children: "Cancel" }), jsx(Button, { variant: "filled", size: "sm", onClick: handleApply, disabled: !(tempRange === null || tempRange === void 0 ? void 0 : tempRange.start) || !(tempRange === null || tempRange === void 0 ? void 0 : tempRange.end), children: "Apply" })] })] })] })) : (
|
|
217
217
|
// Single calendar for single mode
|
|
218
218
|
jsx("div", { className: "flex-1 p-4", children: children || (jsx(Calendar, { mode: "single", value: selectedValue, onChange: (value) => {
|
|
219
219
|
handleDateSelect(value);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createDropdownAnimations } from "../DatePicker/DatePicker.animations";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DateRangePickerProps, DateRangePickerState, DateRangePickerSize, DateRangePickerTheme, DateRange } from "./DateRangePicker.types";
|
|
3
|
+
import { DateRangePickerTrigger } from "./DateRangePickerTrigger";
|
|
4
|
+
import { DateRangePickerBody } from "./DateRangePickerBody";
|
|
5
|
+
import { DateRangePickerPresets } from "./DateRangePickerPresets";
|
|
6
|
+
interface DateRangePickerContextType {
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
9
|
+
selectedRange: DateRange | undefined;
|
|
10
|
+
handleRangeSelect: (range: DateRange) => void;
|
|
11
|
+
minDate?: Date;
|
|
12
|
+
maxDate?: Date;
|
|
13
|
+
isDateDisabled?: (date: Date) => boolean;
|
|
14
|
+
showToday?: boolean;
|
|
15
|
+
weekdays?: string[];
|
|
16
|
+
months?: string[];
|
|
17
|
+
yearRange?: {
|
|
18
|
+
start: number;
|
|
19
|
+
end: number;
|
|
20
|
+
};
|
|
21
|
+
size: DateRangePickerSize;
|
|
22
|
+
state: DateRangePickerState;
|
|
23
|
+
theme: DateRangePickerTheme;
|
|
24
|
+
triggerRef: React.RefObject<HTMLButtonElement | null>;
|
|
25
|
+
contentRef: React.RefObject<HTMLDivElement | null>;
|
|
26
|
+
}
|
|
27
|
+
export declare const DateRangePickerContext: React.Context<DateRangePickerContextType | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* DateRangePicker Component — dedicated range picker with presets and dual calendars
|
|
30
|
+
*/
|
|
31
|
+
declare const DateRangePickerComponent: React.ForwardRefExoticComponent<DateRangePickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
declare const DateRangePickerWithCompounds: typeof DateRangePickerComponent & {
|
|
33
|
+
Trigger: typeof DateRangePickerTrigger;
|
|
34
|
+
Body: typeof DateRangePickerBody;
|
|
35
|
+
Presets: typeof DateRangePickerPresets;
|
|
36
|
+
};
|
|
37
|
+
export { DateRangePickerTrigger, DateRangePickerBody, DateRangePickerPresets, DateRangePickerWithCompounds as DateRangePicker, };
|