@studio-helga/once-ui-core 1.7.8
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 +54 -0
- package/dist/README.md +54 -0
- package/dist/components/Accordion.d.ts +25 -0
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion.js +75 -0
- package/dist/components/Accordion.js.map +1 -0
- package/dist/components/Accordion.module.scss +5 -0
- package/dist/components/AccordionGroup.d.ts +16 -0
- package/dist/components/AccordionGroup.d.ts.map +1 -0
- package/dist/components/AccordionGroup.js +27 -0
- package/dist/components/AccordionGroup.js.map +1 -0
- package/dist/components/Animation.d.ts +34 -0
- package/dist/components/Animation.d.ts.map +1 -0
- package/dist/components/Animation.js +230 -0
- package/dist/components/Animation.js.map +1 -0
- package/dist/components/Arrow.d.ts +11 -0
- package/dist/components/Arrow.d.ts.map +1 -0
- package/dist/components/Arrow.js +33 -0
- package/dist/components/Arrow.js.map +1 -0
- package/dist/components/Arrow.module.scss +39 -0
- package/dist/components/ArrowNavigationContext.d.ts +33 -0
- package/dist/components/ArrowNavigationContext.d.ts.map +1 -0
- package/dist/components/ArrowNavigationContext.js +60 -0
- package/dist/components/ArrowNavigationContext.js.map +1 -0
- package/dist/components/AutoScroll.d.ts +14 -0
- package/dist/components/AutoScroll.d.ts.map +1 -0
- package/dist/components/AutoScroll.js +178 -0
- package/dist/components/AutoScroll.js.map +1 -0
- package/dist/components/AutoScroll.module.scss +9 -0
- package/dist/components/Avatar.d.ts +21 -0
- package/dist/components/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar.js +54 -0
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/Avatar.module.scss +56 -0
- package/dist/components/AvatarGroup.d.ts +14 -0
- package/dist/components/AvatarGroup.d.ts.map +1 -0
- package/dist/components/AvatarGroup.js +20 -0
- package/dist/components/AvatarGroup.js.map +1 -0
- package/dist/components/AvatarGroup.module.scss +11 -0
- package/dist/components/Background.d.ts +49 -0
- package/dist/components/Background.d.ts.map +1 -0
- package/dist/components/Background.js +72 -0
- package/dist/components/Background.js.map +1 -0
- package/dist/components/Background.module.scss +23 -0
- package/dist/components/Badge.d.ts +17 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +21 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Badge.module.scss +67 -0
- package/dist/components/Banner.d.ts +6 -0
- package/dist/components/Banner.d.ts.map +1 -0
- package/dist/components/Banner.js +7 -0
- package/dist/components/Banner.js.map +1 -0
- package/dist/components/BlobFx.d.ts +8 -0
- package/dist/components/BlobFx.d.ts.map +1 -0
- package/dist/components/BlobFx.js +82 -0
- package/dist/components/BlobFx.js.map +1 -0
- package/dist/components/BlockQuote.d.ts +21 -0
- package/dist/components/BlockQuote.d.ts.map +1 -0
- package/dist/components/BlockQuote.js +10 -0
- package/dist/components/BlockQuote.js.map +1 -0
- package/dist/components/Button.d.ts +27 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +25 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Button.module.scss +154 -0
- package/dist/components/Card.d.ts +13 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +13 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/Card.module.scss +7 -0
- package/dist/components/Carousel.d.ts +32 -0
- package/dist/components/Carousel.d.ts.map +1 -0
- package/dist/components/Carousel.js +156 -0
- package/dist/components/Carousel.js.map +1 -0
- package/dist/components/Carousel.module.scss +48 -0
- package/dist/components/CelebrationFx.d.ts +17 -0
- package/dist/components/CelebrationFx.d.ts.map +1 -0
- package/dist/components/CelebrationFx.js +314 -0
- package/dist/components/CelebrationFx.js.map +1 -0
- package/dist/components/Checkbox.d.ts +11 -0
- package/dist/components/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox.js +56 -0
- package/dist/components/Checkbox.js.map +1 -0
- package/dist/components/Chip.d.ts +17 -0
- package/dist/components/Chip.d.ts.map +1 -0
- package/dist/components/Chip.js +43 -0
- package/dist/components/Chip.js.map +1 -0
- package/dist/components/Chip.module.scss +39 -0
- package/dist/components/ClientFlex.d.ts +13 -0
- package/dist/components/ClientFlex.d.ts.map +1 -0
- package/dist/components/ClientFlex.js +110 -0
- package/dist/components/ClientFlex.js.map +1 -0
- package/dist/components/ClientGrid.d.ts +13 -0
- package/dist/components/ClientGrid.d.ts.map +1 -0
- package/dist/components/ClientGrid.js +110 -0
- package/dist/components/ClientGrid.js.map +1 -0
- package/dist/components/ColorInput.d.ts +11 -0
- package/dist/components/ColorInput.d.ts.map +1 -0
- package/dist/components/ColorInput.js +78 -0
- package/dist/components/ColorInput.js.map +1 -0
- package/dist/components/Column.d.ts +7 -0
- package/dist/components/Column.d.ts.map +1 -0
- package/dist/components/Column.js +10 -0
- package/dist/components/Column.js.map +1 -0
- package/dist/components/CompareImage.d.ts +16 -0
- package/dist/components/CompareImage.d.ts.map +1 -0
- package/dist/components/CompareImage.js +58 -0
- package/dist/components/CompareImage.js.map +1 -0
- package/dist/components/CompareImage.module.scss +14 -0
- package/dist/components/ContextMenu.d.ts +22 -0
- package/dist/components/ContextMenu.d.ts.map +1 -0
- package/dist/components/ContextMenu.js +224 -0
- package/dist/components/ContextMenu.js.map +1 -0
- package/dist/components/ContextMenu.module.scss +15 -0
- package/dist/components/CountFx.d.ts +15 -0
- package/dist/components/CountFx.d.ts.map +1 -0
- package/dist/components/CountFx.js +203 -0
- package/dist/components/CountFx.js.map +1 -0
- package/dist/components/CountdownFx.d.ts +11 -0
- package/dist/components/CountdownFx.d.ts.map +1 -0
- package/dist/components/CountdownFx.js +49 -0
- package/dist/components/CountdownFx.js.map +1 -0
- package/dist/components/Cursor.d.ts +8 -0
- package/dist/components/Cursor.d.ts.map +1 -0
- package/dist/components/Cursor.js +79 -0
- package/dist/components/Cursor.js.map +1 -0
- package/dist/components/CursorCard.d.ts +13 -0
- package/dist/components/CursorCard.d.ts.map +1 -0
- package/dist/components/CursorCard.js +63 -0
- package/dist/components/CursorCard.js.map +1 -0
- package/dist/components/CursorCard.module.scss +12 -0
- package/dist/components/DateInput.d.ts +18 -0
- package/dist/components/DateInput.d.ts.map +1 -0
- package/dist/components/DateInput.js +43 -0
- package/dist/components/DateInput.js.map +1 -0
- package/dist/components/DatePicker.d.ts +33 -0
- package/dist/components/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker.js +487 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/DatePicker.module.scss +194 -0
- package/dist/components/DateRangeInput.d.ts +15 -0
- package/dist/components/DateRangeInput.d.ts.map +1 -0
- package/dist/components/DateRangeInput.js +45 -0
- package/dist/components/DateRangeInput.js.map +1 -0
- package/dist/components/DateRangePicker.d.ts +17 -0
- package/dist/components/DateRangePicker.d.ts.map +1 -0
- package/dist/components/DateRangePicker.js +78 -0
- package/dist/components/DateRangePicker.js.map +1 -0
- package/dist/components/Dialog.d.ts +21 -0
- package/dist/components/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog.js +230 -0
- package/dist/components/Dialog.js.map +1 -0
- package/dist/components/Dialog.module.scss +33 -0
- package/dist/components/Dropdown.d.ts +13 -0
- package/dist/components/Dropdown.d.ts.map +1 -0
- package/dist/components/Dropdown.js +21 -0
- package/dist/components/Dropdown.js.map +1 -0
- package/dist/components/DropdownWrapper.d.ts +29 -0
- package/dist/components/DropdownWrapper.d.ts.map +1 -0
- package/dist/components/DropdownWrapper.js +505 -0
- package/dist/components/DropdownWrapper.js.map +1 -0
- package/dist/components/DropdownWrapper.module.scss +15 -0
- package/dist/components/ElementType.d.ts +14 -0
- package/dist/components/ElementType.d.ts.map +1 -0
- package/dist/components/ElementType.js +21 -0
- package/dist/components/ElementType.js.map +1 -0
- package/dist/components/EmojiPicker.d.ts +16 -0
- package/dist/components/EmojiPicker.d.ts.map +1 -0
- package/dist/components/EmojiPicker.js +178 -0
- package/dist/components/EmojiPicker.js.map +1 -0
- package/dist/components/EmojiPicker.module.scss +14 -0
- package/dist/components/EmojiPickerDropdown.d.ts +11 -0
- package/dist/components/EmojiPickerDropdown.d.ts.map +1 -0
- package/dist/components/EmojiPickerDropdown.js +14 -0
- package/dist/components/EmojiPickerDropdown.js.map +1 -0
- package/dist/components/Fade.d.ts +19 -0
- package/dist/components/Fade.d.ts.map +1 -0
- package/dist/components/Fade.js +43 -0
- package/dist/components/Fade.js.map +1 -0
- package/dist/components/Fade.module.scss +6 -0
- package/dist/components/FadingLettersFx.d.ts +15 -0
- package/dist/components/FadingLettersFx.d.ts.map +1 -0
- package/dist/components/FadingLettersFx.js +27 -0
- package/dist/components/FadingLettersFx.js.map +1 -0
- package/dist/components/FadingLettersFx.module.scss +71 -0
- package/dist/components/Feedback.d.ts +16 -0
- package/dist/components/Feedback.d.ts.map +1 -0
- package/dist/components/Feedback.js +16 -0
- package/dist/components/Feedback.js.map +1 -0
- package/dist/components/Flex.d.ts +11 -0
- package/dist/components/Flex.d.ts.map +1 -0
- package/dist/components/Flex.js +31 -0
- package/dist/components/Flex.js.map +1 -0
- package/dist/components/FlipFx.d.ts +17 -0
- package/dist/components/FlipFx.d.ts.map +1 -0
- package/dist/components/FlipFx.js +76 -0
- package/dist/components/FlipFx.js.map +1 -0
- package/dist/components/FocusTrap.d.ts +16 -0
- package/dist/components/FocusTrap.d.ts.map +1 -0
- package/dist/components/FocusTrap.js +87 -0
- package/dist/components/FocusTrap.js.map +1 -0
- package/dist/components/GlitchFx.d.ts +12 -0
- package/dist/components/GlitchFx.d.ts.map +1 -0
- package/dist/components/GlitchFx.js +41 -0
- package/dist/components/GlitchFx.js.map +1 -0
- package/dist/components/GlitchFx.module.scss +92 -0
- package/dist/components/Grid.d.ts +11 -0
- package/dist/components/Grid.d.ts.map +1 -0
- package/dist/components/Grid.js +32 -0
- package/dist/components/Grid.js.map +1 -0
- package/dist/components/Heading.d.ts +9 -0
- package/dist/components/Heading.d.ts.map +1 -0
- package/dist/components/Heading.js +50 -0
- package/dist/components/Heading.js.map +1 -0
- package/dist/components/HoloFx.d.ts +32 -0
- package/dist/components/HoloFx.d.ts.map +1 -0
- package/dist/components/HoloFx.js +90 -0
- package/dist/components/HoloFx.js.map +1 -0
- package/dist/components/HoloFx.module.scss +32 -0
- package/dist/components/Hover.d.ts +14 -0
- package/dist/components/Hover.d.ts.map +1 -0
- package/dist/components/Hover.js +99 -0
- package/dist/components/Hover.js.map +1 -0
- package/dist/components/Hover.module.scss +12 -0
- package/dist/components/HoverCard.d.ts +5 -0
- package/dist/components/HoverCard.d.ts.map +1 -0
- package/dist/components/HoverCard.js +10 -0
- package/dist/components/HoverCard.js.map +1 -0
- package/dist/components/HoverCard.module.scss +12 -0
- package/dist/components/Icon.d.ts +18 -0
- package/dist/components/Icon.d.ts.map +1 -0
- package/dist/components/Icon.js +35 -0
- package/dist/components/Icon.js.map +1 -0
- package/dist/components/Icon.module.scss +19 -0
- package/dist/components/IconButton.d.ts +23 -0
- package/dist/components/IconButton.d.ts.map +1 -0
- package/dist/components/IconButton.js +23 -0
- package/dist/components/IconButton.js.map +1 -0
- package/dist/components/IconButton.module.scss +34 -0
- package/dist/components/InfiniteScroll.d.ts +16 -0
- package/dist/components/InfiniteScroll.d.ts.map +1 -0
- package/dist/components/InfiniteScroll.js +52 -0
- package/dist/components/InfiniteScroll.js.map +1 -0
- package/dist/components/InlineCode.d.ts +10 -0
- package/dist/components/InlineCode.d.ts.map +1 -0
- package/dist/components/InlineCode.js +12 -0
- package/dist/components/InlineCode.js.map +1 -0
- package/dist/components/InlineCode.module.scss +5 -0
- package/dist/components/Input.d.ts +24 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +82 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/Input.module.scss +196 -0
- package/dist/components/InteractiveDetails.d.ts +15 -0
- package/dist/components/InteractiveDetails.d.ts.map +1 -0
- package/dist/components/InteractiveDetails.js +10 -0
- package/dist/components/InteractiveDetails.js.map +1 -0
- package/dist/components/Kbd.d.ts +12 -0
- package/dist/components/Kbd.d.ts.map +1 -0
- package/dist/components/Kbd.js +7 -0
- package/dist/components/Kbd.js.map +1 -0
- package/dist/components/LetterFx.d.ts +13 -0
- package/dist/components/LetterFx.d.ts.map +1 -0
- package/dist/components/LetterFx.js +80 -0
- package/dist/components/LetterFx.js.map +1 -0
- package/dist/components/Line.d.ts +9 -0
- package/dist/components/Line.d.ts.map +1 -0
- package/dist/components/Line.js +10 -0
- package/dist/components/Line.js.map +1 -0
- package/dist/components/List.d.ts +11 -0
- package/dist/components/List.d.ts.map +1 -0
- package/dist/components/List.js +13 -0
- package/dist/components/List.js.map +1 -0
- package/dist/components/List.module.scss +5 -0
- package/dist/components/ListItem.d.ts +10 -0
- package/dist/components/ListItem.d.ts.map +1 -0
- package/dist/components/ListItem.js +13 -0
- package/dist/components/ListItem.js.map +1 -0
- package/dist/components/Logo.d.ts +18 -0
- package/dist/components/Logo.d.ts.map +1 -0
- package/dist/components/Logo.js +99 -0
- package/dist/components/Logo.js.map +1 -0
- package/dist/components/LogoCloud.d.ts +14 -0
- package/dist/components/LogoCloud.d.ts.map +1 -0
- package/dist/components/LogoCloud.js +38 -0
- package/dist/components/LogoCloud.js.map +1 -0
- package/dist/components/LogoCloud.module.scss +42 -0
- package/dist/components/Mask.d.ts +15 -0
- package/dist/components/Mask.d.ts.map +1 -0
- package/dist/components/Mask.js +107 -0
- package/dist/components/Mask.js.map +1 -0
- package/dist/components/Mask.module.scss +8 -0
- package/dist/components/MasonryGrid.d.ts +22 -0
- package/dist/components/MasonryGrid.d.ts.map +1 -0
- package/dist/components/MasonryGrid.js +53 -0
- package/dist/components/MasonryGrid.js.map +1 -0
- package/dist/components/MasonryGrid.module.scss +199 -0
- package/dist/components/MatrixFx.d.ts +27 -0
- package/dist/components/MatrixFx.d.ts.map +1 -0
- package/dist/components/MatrixFx.js +799 -0
- package/dist/components/MatrixFx.js.map +1 -0
- package/dist/components/Media.d.ts +26 -0
- package/dist/components/Media.d.ts.map +1 -0
- package/dist/components/Media.js +112 -0
- package/dist/components/Media.js.map +1 -0
- package/dist/components/Modal.d.ts +11 -0
- package/dist/components/Modal.d.ts.map +1 -0
- package/dist/components/Modal.js +72 -0
- package/dist/components/Modal.js.map +1 -0
- package/dist/components/NavIcon.d.ts +11 -0
- package/dist/components/NavIcon.d.ts.map +1 -0
- package/dist/components/NavIcon.js +11 -0
- package/dist/components/NavIcon.js.map +1 -0
- package/dist/components/NavIcon.module.scss +25 -0
- package/dist/components/NumberInput.d.ts +13 -0
- package/dist/components/NumberInput.d.ts.map +1 -0
- package/dist/components/NumberInput.js +44 -0
- package/dist/components/NumberInput.js.map +1 -0
- package/dist/components/NumberInput.module.scss +18 -0
- package/dist/components/OTPInput.d.ts +13 -0
- package/dist/components/OTPInput.d.ts.map +1 -0
- package/dist/components/OTPInput.js +71 -0
- package/dist/components/OTPInput.js.map +1 -0
- package/dist/components/OTPInput.module.scss +26 -0
- package/dist/components/OgCard.d.ts +34 -0
- package/dist/components/OgCard.d.ts.map +1 -0
- package/dist/components/OgCard.js +102 -0
- package/dist/components/OgCard.js.map +1 -0
- package/dist/components/Option.d.ts +21 -0
- package/dist/components/Option.d.ts.map +1 -0
- package/dist/components/Option.js +93 -0
- package/dist/components/Option.js.map +1 -0
- package/dist/components/Option.module.scss +47 -0
- package/dist/components/Particle.d.ts +21 -0
- package/dist/components/Particle.d.ts.map +1 -0
- package/dist/components/Particle.js +140 -0
- package/dist/components/Particle.js.map +1 -0
- package/dist/components/PasswordInput.d.ts +4 -0
- package/dist/components/PasswordInput.d.ts.map +1 -0
- package/dist/components/PasswordInput.js +12 -0
- package/dist/components/PasswordInput.js.map +1 -0
- package/dist/components/ProgressBar.d.ts +15 -0
- package/dist/components/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar.js +12 -0
- package/dist/components/ProgressBar.js.map +1 -0
- package/dist/components/Pulse.d.ts +13 -0
- package/dist/components/Pulse.d.ts.map +1 -0
- package/dist/components/Pulse.js +11 -0
- package/dist/components/Pulse.js.map +1 -0
- package/dist/components/Pulse.module.scss +22 -0
- package/dist/components/RadioButton.d.ts +15 -0
- package/dist/components/RadioButton.d.ts.map +1 -0
- package/dist/components/RadioButton.js +45 -0
- package/dist/components/RadioButton.js.map +1 -0
- package/dist/components/RevealFx.d.ts +16 -0
- package/dist/components/RevealFx.d.ts.map +1 -0
- package/dist/components/RevealFx.js +83 -0
- package/dist/components/RevealFx.js.map +1 -0
- package/dist/components/RevealFx.module.scss +27 -0
- package/dist/components/Row.d.ts +7 -0
- package/dist/components/Row.d.ts.map +1 -0
- package/dist/components/Row.js +10 -0
- package/dist/components/Row.js.map +1 -0
- package/dist/components/ScrollContainer.d.ts +9 -0
- package/dist/components/ScrollContainer.d.ts.map +1 -0
- package/dist/components/ScrollContainer.js +67 -0
- package/dist/components/ScrollContainer.js.map +1 -0
- package/dist/components/ScrollLock.d.ts +8 -0
- package/dist/components/ScrollLock.d.ts.map +1 -0
- package/dist/components/ScrollLock.js +112 -0
- package/dist/components/ScrollLock.js.map +1 -0
- package/dist/components/ScrollToTop.d.ts +7 -0
- package/dist/components/ScrollToTop.d.ts.map +1 -0
- package/dist/components/ScrollToTop.js +24 -0
- package/dist/components/ScrollToTop.js.map +1 -0
- package/dist/components/ScrollToTop.module.scss +11 -0
- package/dist/components/Scroller.d.ts +14 -0
- package/dist/components/Scroller.d.ts.map +1 -0
- package/dist/components/Scroller.js +100 -0
- package/dist/components/Scroller.js.map +1 -0
- package/dist/components/Scroller.module.scss +20 -0
- package/dist/components/SegmentedControl.d.ts +18 -0
- package/dist/components/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl.js +70 -0
- package/dist/components/SegmentedControl.js.map +1 -0
- package/dist/components/Select.d.ts +19 -0
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/components/Select.js +170 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/ServerFlex.d.ts +12 -0
- package/dist/components/ServerFlex.d.ts.map +1 -0
- package/dist/components/ServerFlex.js +282 -0
- package/dist/components/ServerFlex.js.map +1 -0
- package/dist/components/ServerGrid.d.ts +13 -0
- package/dist/components/ServerGrid.d.ts.map +1 -0
- package/dist/components/ServerGrid.js +207 -0
- package/dist/components/ServerGrid.js.map +1 -0
- package/dist/components/SharedInteractiveStyles.module.scss +91 -0
- package/dist/components/ShineFx.d.ts +13 -0
- package/dist/components/ShineFx.d.ts.map +1 -0
- package/dist/components/ShineFx.js +19 -0
- package/dist/components/ShineFx.js.map +1 -0
- package/dist/components/ShineFx.module.scss +50 -0
- package/dist/components/Skeleton.d.ts +13 -0
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton.js +12 -0
- package/dist/components/Skeleton.js.map +1 -0
- package/dist/components/Skeleton.module.scss +120 -0
- package/dist/components/Slider.d.ts +17 -0
- package/dist/components/Slider.d.ts.map +1 -0
- package/dist/components/Slider.js +29 -0
- package/dist/components/Slider.js.map +1 -0
- package/dist/components/Slider.module.scss +75 -0
- package/dist/components/SmartLink.d.ts +18 -0
- package/dist/components/SmartLink.d.ts.map +1 -0
- package/dist/components/SmartLink.js +36 -0
- package/dist/components/SmartLink.js.map +1 -0
- package/dist/components/Spinner.d.ts +11 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner.js +11 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/Spinner.module.scss +71 -0
- package/dist/components/SplitView.d.ts +16 -0
- package/dist/components/SplitView.d.ts.map +1 -0
- package/dist/components/SplitView.js +80 -0
- package/dist/components/SplitView.js.map +1 -0
- package/dist/components/SplitView.module.scss +18 -0
- package/dist/components/StatusIndicator.d.ts +12 -0
- package/dist/components/StatusIndicator.d.ts.map +1 -0
- package/dist/components/StatusIndicator.js +11 -0
- package/dist/components/StatusIndicator.js.map +1 -0
- package/dist/components/StatusIndicator.module.scss +72 -0
- package/dist/components/StyleOverlay.d.ts +10 -0
- package/dist/components/StyleOverlay.d.ts.map +1 -0
- package/dist/components/StyleOverlay.js +17 -0
- package/dist/components/StyleOverlay.js.map +1 -0
- package/dist/components/StyleOverlay.module.scss +18 -0
- package/dist/components/StylePanel.d.ts +8 -0
- package/dist/components/StylePanel.d.ts.map +1 -0
- package/dist/components/StylePanel.js +193 -0
- package/dist/components/StylePanel.js.map +1 -0
- package/dist/components/StylePanel.module.scss +127 -0
- package/dist/components/Swiper.d.ts +17 -0
- package/dist/components/Swiper.d.ts.map +1 -0
- package/dist/components/Swiper.js +170 -0
- package/dist/components/Swiper.js.map +1 -0
- package/dist/components/Swiper.module.scss +31 -0
- package/dist/components/Switch.d.ts +17 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Switch.js +33 -0
- package/dist/components/Switch.js.map +1 -0
- package/dist/components/Switch.module.scss +102 -0
- package/dist/components/Table.d.ts +16 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Table.js +44 -0
- package/dist/components/Table.js.map +1 -0
- package/dist/components/Table.module.scss +5 -0
- package/dist/components/Tag.d.ts +16 -0
- package/dist/components/Tag.d.ts.map +1 -0
- package/dist/components/Tag.js +14 -0
- package/dist/components/Tag.js.map +1 -0
- package/dist/components/Tag.module.scss +10 -0
- package/dist/components/TagInput.d.ts +9 -0
- package/dist/components/TagInput.d.ts.map +1 -0
- package/dist/components/TagInput.js +36 -0
- package/dist/components/TagInput.js.map +1 -0
- package/dist/components/Text.d.ts +9 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/Text.js +50 -0
- package/dist/components/Text.js.map +1 -0
- package/dist/components/Textarea.d.ts +24 -0
- package/dist/components/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea.js +109 -0
- package/dist/components/Textarea.js.map +1 -0
- package/dist/components/ThemeInit.d.ts +20 -0
- package/dist/components/ThemeInit.d.ts.map +1 -0
- package/dist/components/ThemeInit.js +46 -0
- package/dist/components/ThemeInit.js.map +1 -0
- package/dist/components/ThemeSwitcher.d.ts +4 -0
- package/dist/components/ThemeSwitcher.d.ts.map +1 -0
- package/dist/components/ThemeSwitcher.js +21 -0
- package/dist/components/ThemeSwitcher.js.map +1 -0
- package/dist/components/TiltFx.d.ts +10 -0
- package/dist/components/TiltFx.d.ts.map +1 -0
- package/dist/components/TiltFx.js +67 -0
- package/dist/components/TiltFx.js.map +1 -0
- package/dist/components/TiltFx.module.scss +11 -0
- package/dist/components/Timeline.d.ts +18 -0
- package/dist/components/Timeline.d.ts.map +1 -0
- package/dist/components/Timeline.js +72 -0
- package/dist/components/Timeline.js.map +1 -0
- package/dist/components/Toast.d.ts +12 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +29 -0
- package/dist/components/Toast.js.map +1 -0
- package/dist/components/Toast.module.scss +11 -0
- package/dist/components/Toaster.d.ts +19 -0
- package/dist/components/Toaster.d.ts.map +1 -0
- package/dist/components/Toaster.js +47 -0
- package/dist/components/Toaster.js.map +1 -0
- package/dist/components/Toaster.module.scss +58 -0
- package/dist/components/ToggleButton.d.ts +25 -0
- package/dist/components/ToggleButton.d.ts.map +1 -0
- package/dist/components/ToggleButton.js +20 -0
- package/dist/components/ToggleButton.js.map +1 -0
- package/dist/components/ToggleButton.module.scss +73 -0
- package/dist/components/Tooltip.d.ts +13 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip.js +15 -0
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/Tooltip.module.scss +14 -0
- package/dist/components/TypeFx.d.ts +15 -0
- package/dist/components/TypeFx.d.ts.map +1 -0
- package/dist/components/TypeFx.js +84 -0
- package/dist/components/TypeFx.js.map +1 -0
- package/dist/components/User.d.ts +16 -0
- package/dist/components/User.d.ts.map +1 -0
- package/dist/components/User.js +13 -0
- package/dist/components/User.js.map +1 -0
- package/dist/components/UserMenu.d.ts +13 -0
- package/dist/components/UserMenu.d.ts.map +1 -0
- package/dist/components/UserMenu.js +13 -0
- package/dist/components/UserMenu.js.map +1 -0
- package/dist/components/UserMenu.module.scss +14 -0
- package/dist/components/WeatherFx.d.ts +18 -0
- package/dist/components/WeatherFx.d.ts.map +1 -0
- package/dist/components/WeatherFx.js +864 -0
- package/dist/components/WeatherFx.js.map +1 -0
- package/dist/components/index.d.ts +121 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +121 -0
- package/dist/components/index.js.map +1 -0
- package/dist/contexts/DataThemeProvider.d.ts +26 -0
- package/dist/contexts/DataThemeProvider.d.ts.map +1 -0
- package/dist/contexts/DataThemeProvider.js +103 -0
- package/dist/contexts/DataThemeProvider.js.map +1 -0
- package/dist/contexts/IconProvider.d.ts +12 -0
- package/dist/contexts/IconProvider.d.ts.map +1 -0
- package/dist/contexts/IconProvider.js +20 -0
- package/dist/contexts/IconProvider.js.map +1 -0
- package/dist/contexts/LayoutProvider.d.ts +27 -0
- package/dist/contexts/LayoutProvider.d.ts.map +1 -0
- package/dist/contexts/LayoutProvider.js +96 -0
- package/dist/contexts/LayoutProvider.js.map +1 -0
- package/dist/contexts/ThemeProvider.d.ts +49 -0
- package/dist/contexts/ThemeProvider.d.ts.map +1 -0
- package/dist/contexts/ThemeProvider.js +285 -0
- package/dist/contexts/ThemeProvider.js.map +1 -0
- package/dist/contexts/ToastProvider.d.ts +24 -0
- package/dist/contexts/ToastProvider.d.ts.map +1 -0
- package/dist/contexts/ToastProvider.js +34 -0
- package/dist/contexts/ToastProvider.js.map +1 -0
- package/dist/contexts/index.d.ts +6 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/contexts/index.js +6 -0
- package/dist/contexts/index.js.map +1 -0
- package/dist/css/styles.css +1 -0
- package/dist/css/styles.css.map +1 -0
- package/dist/css/tokens.css +1 -0
- package/dist/css/tokens.css.map +1 -0
- package/dist/data/emoji-data.json +16062 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +8 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useArrowNavigation.d.ts +23 -0
- package/dist/hooks/useArrowNavigation.d.ts.map +1 -0
- package/dist/hooks/useArrowNavigation.js +205 -0
- package/dist/hooks/useArrowNavigation.js.map +1 -0
- package/dist/hooks/useDebounce.d.ts +2 -0
- package/dist/hooks/useDebounce.d.ts.map +1 -0
- package/dist/hooks/useDebounce.js +15 -0
- package/dist/hooks/useDebounce.js.map +1 -0
- package/dist/hooks/useFetchOg.d.ts +17 -0
- package/dist/hooks/useFetchOg.d.ts.map +1 -0
- package/dist/hooks/useFetchOg.js +63 -0
- package/dist/hooks/useFetchOg.js.map +1 -0
- package/dist/hooks/useHeadingLinks.d.ts +6 -0
- package/dist/hooks/useHeadingLinks.d.ts.map +1 -0
- package/dist/hooks/useHeadingLinks.js +17 -0
- package/dist/hooks/useHeadingLinks.js.map +1 -0
- package/dist/hooks/useInViewport.d.ts +3 -0
- package/dist/hooks/useInViewport.d.ts.map +1 -0
- package/dist/hooks/useInViewport.js +19 -0
- package/dist/hooks/useInViewport.js.map +1 -0
- package/dist/hooks/useReducedMotion.d.ts +8 -0
- package/dist/hooks/useReducedMotion.d.ts.map +1 -0
- package/dist/hooks/useReducedMotion.js +44 -0
- package/dist/hooks/useReducedMotion.js.map +1 -0
- package/dist/hooks/useResponsiveClasses.d.ts +9 -0
- package/dist/hooks/useResponsiveClasses.d.ts.map +1 -0
- package/dist/hooks/useResponsiveClasses.js +250 -0
- package/dist/hooks/useResponsiveClasses.js.map +1 -0
- package/dist/hooks/useStreamingData.d.ts +24 -0
- package/dist/hooks/useStreamingData.d.ts.map +1 -0
- package/dist/hooks/useStreamingData.js +89 -0
- package/dist/hooks/useStreamingData.js.map +1 -0
- package/dist/hooks/useStreamingViewport.d.ts +25 -0
- package/dist/hooks/useStreamingViewport.d.ts.map +1 -0
- package/dist/hooks/useStreamingViewport.js +120 -0
- package/dist/hooks/useStreamingViewport.js.map +1 -0
- package/dist/icons.d.ts +5 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +56 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces.d.ts +177 -0
- package/dist/interfaces.d.ts.map +1 -0
- package/dist/interfaces.js +2 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/modules/code/CodeBlock.d.ts +6 -0
- package/dist/modules/code/CodeBlock.d.ts.map +1 -0
- package/dist/modules/code/CodeBlock.impl.d.ts +34 -0
- package/dist/modules/code/CodeBlock.impl.d.ts.map +1 -0
- package/dist/modules/code/CodeBlock.impl.js +497 -0
- package/dist/modules/code/CodeBlock.impl.js.map +1 -0
- package/dist/modules/code/CodeBlock.js +14 -0
- package/dist/modules/code/CodeBlock.js.map +1 -0
- package/dist/modules/code/CodeBlock.module.scss +43 -0
- package/dist/modules/code/CodeDiff.css +175 -0
- package/dist/modules/code/CodeHighlight.css +116 -0
- package/dist/modules/code/LineNumber.css +34 -0
- package/dist/modules/data/BarChart.d.ts +6 -0
- package/dist/modules/data/BarChart.d.ts.map +1 -0
- package/dist/modules/data/BarChart.impl.d.ts +12 -0
- package/dist/modules/data/BarChart.impl.d.ts.map +1 -0
- package/dist/modules/data/BarChart.impl.js +129 -0
- package/dist/modules/data/BarChart.impl.js.map +1 -0
- package/dist/modules/data/BarChart.js +14 -0
- package/dist/modules/data/BarChart.js.map +1 -0
- package/dist/modules/data/ChartHeader.d.ts +14 -0
- package/dist/modules/data/ChartHeader.d.ts.map +1 -0
- package/dist/modules/data/ChartHeader.js +116 -0
- package/dist/modules/data/ChartHeader.js.map +1 -0
- package/dist/modules/data/ChartStatus.d.ts +10 -0
- package/dist/modules/data/ChartStatus.d.ts.map +1 -0
- package/dist/modules/data/ChartStatus.js +10 -0
- package/dist/modules/data/ChartStatus.js.map +1 -0
- package/dist/modules/data/DataTooltip.d.ts +16 -0
- package/dist/modules/data/DataTooltip.d.ts.map +1 -0
- package/dist/modules/data/DataTooltip.js +16 -0
- package/dist/modules/data/DataTooltip.js.map +1 -0
- package/dist/modules/data/Gauge.module.css +27 -0
- package/dist/modules/data/Gradient.d.ts +32 -0
- package/dist/modules/data/Gradient.d.ts.map +1 -0
- package/dist/modules/data/Gradient.js +56 -0
- package/dist/modules/data/Gradient.js.map +1 -0
- package/dist/modules/data/Legend.d.ts +15 -0
- package/dist/modules/data/Legend.d.ts.map +1 -0
- package/dist/modules/data/Legend.js +69 -0
- package/dist/modules/data/Legend.js.map +1 -0
- package/dist/modules/data/LineBarChart.d.ts +6 -0
- package/dist/modules/data/LineBarChart.d.ts.map +1 -0
- package/dist/modules/data/LineBarChart.impl.d.ts +12 -0
- package/dist/modules/data/LineBarChart.impl.d.ts.map +1 -0
- package/dist/modules/data/LineBarChart.impl.js +124 -0
- package/dist/modules/data/LineBarChart.impl.js.map +1 -0
- package/dist/modules/data/LineBarChart.js +14 -0
- package/dist/modules/data/LineBarChart.js.map +1 -0
- package/dist/modules/data/LineChart.d.ts +6 -0
- package/dist/modules/data/LineChart.d.ts.map +1 -0
- package/dist/modules/data/LineChart.impl.d.ts +17 -0
- package/dist/modules/data/LineChart.impl.d.ts.map +1 -0
- package/dist/modules/data/LineChart.impl.js +137 -0
- package/dist/modules/data/LineChart.impl.js.map +1 -0
- package/dist/modules/data/LineChart.js +14 -0
- package/dist/modules/data/LineChart.js.map +1 -0
- package/dist/modules/data/LinearGauge.d.ts +18 -0
- package/dist/modules/data/LinearGauge.d.ts.map +1 -0
- package/dist/modules/data/LinearGauge.js +78 -0
- package/dist/modules/data/LinearGauge.js.map +1 -0
- package/dist/modules/data/PieChart.d.ts +6 -0
- package/dist/modules/data/PieChart.d.ts.map +1 -0
- package/dist/modules/data/PieChart.impl.d.ts +18 -0
- package/dist/modules/data/PieChart.impl.d.ts.map +1 -0
- package/dist/modules/data/PieChart.impl.js +100 -0
- package/dist/modules/data/PieChart.impl.js.map +1 -0
- package/dist/modules/data/PieChart.js +14 -0
- package/dist/modules/data/PieChart.js.map +1 -0
- package/dist/modules/data/RadialGauge.d.ts +25 -0
- package/dist/modules/data/RadialGauge.d.ts.map +1 -0
- package/dist/modules/data/RadialGauge.js +94 -0
- package/dist/modules/data/RadialGauge.js.map +1 -0
- package/dist/modules/data/Swatch.d.ts +9 -0
- package/dist/modules/data/Swatch.d.ts.map +1 -0
- package/dist/modules/data/Swatch.js +44 -0
- package/dist/modules/data/Swatch.js.map +1 -0
- package/dist/modules/data/index.d.ts +14 -0
- package/dist/modules/data/index.d.ts.map +1 -0
- package/dist/modules/data/index.js +14 -0
- package/dist/modules/data/index.js.map +1 -0
- package/dist/modules/data/interfaces.d.ts +53 -0
- package/dist/modules/data/interfaces.d.ts.map +1 -0
- package/dist/modules/data/interfaces.js +2 -0
- package/dist/modules/data/interfaces.js.map +1 -0
- package/dist/modules/data/rechartsLoader.d.ts +2 -0
- package/dist/modules/data/rechartsLoader.d.ts.map +1 -0
- package/dist/modules/data/rechartsLoader.js +15 -0
- package/dist/modules/data/rechartsLoader.js.map +1 -0
- package/dist/modules/data/utils/colorDistribution.d.ts +10 -0
- package/dist/modules/data/utils/colorDistribution.d.ts.map +1 -0
- package/dist/modules/data/utils/colorDistribution.js +46 -0
- package/dist/modules/data/utils/colorDistribution.js.map +1 -0
- package/dist/modules/data/utils/formatDate.d.ts +12 -0
- package/dist/modules/data/utils/formatDate.d.ts.map +1 -0
- package/dist/modules/data/utils/formatDate.js +30 -0
- package/dist/modules/data/utils/formatDate.js.map +1 -0
- package/dist/modules/index.d.ts +6 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +7 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/media/MediaUpload.d.ts +6 -0
- package/dist/modules/media/MediaUpload.d.ts.map +1 -0
- package/dist/modules/media/MediaUpload.impl.d.ts +24 -0
- package/dist/modules/media/MediaUpload.impl.d.ts.map +1 -0
- package/dist/modules/media/MediaUpload.impl.js +106 -0
- package/dist/modules/media/MediaUpload.impl.js.map +1 -0
- package/dist/modules/media/MediaUpload.js +14 -0
- package/dist/modules/media/MediaUpload.js.map +1 -0
- package/dist/modules/media/MediaUpload.module.scss +24 -0
- package/dist/modules/navigation/HeadingLink.d.ts +11 -0
- package/dist/modules/navigation/HeadingLink.d.ts.map +1 -0
- package/dist/modules/navigation/HeadingLink.js +39 -0
- package/dist/modules/navigation/HeadingLink.js.map +1 -0
- package/dist/modules/navigation/HeadingLink.module.scss +15 -0
- package/dist/modules/navigation/HeadingNav.d.ts +8 -0
- package/dist/modules/navigation/HeadingNav.d.ts.map +1 -0
- package/dist/modules/navigation/HeadingNav.js +168 -0
- package/dist/modules/navigation/HeadingNav.js.map +1 -0
- package/dist/modules/navigation/Kbar.d.ts +34 -0
- package/dist/modules/navigation/Kbar.d.ts.map +1 -0
- package/dist/modules/navigation/Kbar.js +192 -0
- package/dist/modules/navigation/Kbar.js.map +1 -0
- package/dist/modules/navigation/Kbar.module.scss +60 -0
- package/dist/modules/navigation/MegaMenu.d.ts +28 -0
- package/dist/modules/navigation/MegaMenu.d.ts.map +1 -0
- package/dist/modules/navigation/MegaMenu.js +182 -0
- package/dist/modules/navigation/MegaMenu.js.map +1 -0
- package/dist/modules/navigation/MegaMenu.module.scss +14 -0
- package/dist/modules/navigation/MobileMegaMenu.d.ts +28 -0
- package/dist/modules/navigation/MobileMegaMenu.d.ts.map +1 -0
- package/dist/modules/navigation/MobileMegaMenu.js +22 -0
- package/dist/modules/navigation/MobileMegaMenu.js.map +1 -0
- package/dist/modules/navigation/index.d.ts +6 -0
- package/dist/modules/navigation/index.d.ts.map +1 -0
- package/dist/modules/navigation/index.js +6 -0
- package/dist/modules/navigation/index.js.map +1 -0
- package/dist/modules/seo/Meta.d.ts +29 -0
- package/dist/modules/seo/Meta.d.ts.map +1 -0
- package/dist/modules/seo/Meta.js +53 -0
- package/dist/modules/seo/Meta.js.map +1 -0
- package/dist/modules/seo/Schema.d.ts +19 -0
- package/dist/modules/seo/Schema.d.ts.map +1 -0
- package/dist/modules/seo/Schema.js +65 -0
- package/dist/modules/seo/Schema.js.map +1 -0
- package/dist/package.json +130 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +2 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/og-utils.d.ts +20 -0
- package/dist/server/og-utils.d.ts.map +1 -0
- package/dist/server/og-utils.js +125 -0
- package/dist/server/og-utils.js.map +1 -0
- package/dist/styles/background.scss +423 -0
- package/dist/styles/border.scss +546 -0
- package/dist/styles/breakpoints.scss +28 -0
- package/dist/styles/color.scss +183 -0
- package/dist/styles/display.scss +391 -0
- package/dist/styles/flex.scss +518 -0
- package/dist/styles/global.scss +36 -0
- package/dist/styles/grid.scss +293 -0
- package/dist/styles/index.scss +14 -0
- package/dist/styles/position.scss +1549 -0
- package/dist/styles/shadow.scss +19 -0
- package/dist/styles/size.scss +53 -0
- package/dist/styles/spacing.scss +1505 -0
- package/dist/styles/typography.scss +215 -0
- package/dist/styles/utilities.scss +23 -0
- package/dist/test/dialogTestUtils.d.ts +2 -0
- package/dist/test/dialogTestUtils.d.ts.map +1 -0
- package/dist/test/dialogTestUtils.js +12 -0
- package/dist/test/dialogTestUtils.js.map +1 -0
- package/dist/test/setup.d.ts +2 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/setup.js +59 -0
- package/dist/test/setup.js.map +1 -0
- package/dist/tokens/border.scss +95 -0
- package/dist/tokens/data.scss +107 -0
- package/dist/tokens/function.scss +742 -0
- package/dist/tokens/index.scss +8 -0
- package/dist/tokens/layout.scss +275 -0
- package/dist/tokens/scheme.scss +352 -0
- package/dist/tokens/shadow.scss +7 -0
- package/dist/tokens/theme.scss +639 -0
- package/dist/tokens/typography.scss +116 -0
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/MissingDependency.d.ts +7 -0
- package/dist/utils/MissingDependency.d.ts.map +1 -0
- package/dist/utils/MissingDependency.js +6 -0
- package/dist/utils/MissingDependency.js.map +1 -0
- package/dist/utils/devLogger.d.ts +13 -0
- package/dist/utils/devLogger.d.ts.map +1 -0
- package/dist/utils/devLogger.js +34 -0
- package/dist/utils/devLogger.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +155 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Column.d.ts","sourceRoot":"","sources":["../../src/components/Column.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAEzB,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC;IACpE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,MAAM,qHAMV,CAAC;AAGH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { Flex } from ".";
|
|
5
|
+
const Column = forwardRef(({ children, ...rest }, ref) => {
|
|
6
|
+
return (_jsx(Flex, { direction: "column", ref: ref, ...rest, children: children }));
|
|
7
|
+
});
|
|
8
|
+
Column.displayName = "Column";
|
|
9
|
+
export { Column };
|
|
10
|
+
//# sourceMappingURL=Column.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Column.js","sourceRoot":"","sources":["../../src/components/Column.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAMzB,MAAM,MAAM,GAAG,UAAU,CAA8B,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IACpF,OAAO,CACL,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,EAAC,GAAG,EAAE,GAAG,KAAM,IAAI,YACxC,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Flex } from ".";
|
|
2
|
+
interface SideContent {
|
|
3
|
+
src: string | React.ReactNode;
|
|
4
|
+
alt?: string;
|
|
5
|
+
}
|
|
6
|
+
interface CompareImageProps extends React.ComponentProps<typeof Flex> {
|
|
7
|
+
leftContent: SideContent;
|
|
8
|
+
rightContent: SideContent;
|
|
9
|
+
aspectRatio?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const CompareImage: {
|
|
12
|
+
({ leftContent, rightContent, aspectRatio, ...rest }: CompareImageProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export { CompareImage };
|
|
16
|
+
//# sourceMappingURL=CompareImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompareImage.d.ts","sourceRoot":"","sources":["../../src/components/CompareImage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAqB,MAAM,GAAG,CAAC;AAG5C,UAAU,WAAW;IACnB,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC;IACnE,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAuBD,QAAA,MAAM,YAAY;0DAAyD,iBAAiB;;CAqF3F,CAAC;AAGF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useRef, useEffect } from "react";
|
|
4
|
+
import { Flex, Media, IconButton } from ".";
|
|
5
|
+
import styles from "./CompareImage.module.scss";
|
|
6
|
+
const renderContent = (content, clipPath, aspectRatio) => {
|
|
7
|
+
if (typeof content.src === "string") {
|
|
8
|
+
return (_jsx(Media, { src: content.src, alt: content.alt || "", fill: true, aspectRatio: aspectRatio || "16/9", position: "absolute", style: { clipPath } }));
|
|
9
|
+
}
|
|
10
|
+
return (_jsx(Flex, { fill: true, position: "absolute", style: { clipPath }, children: content.src }));
|
|
11
|
+
};
|
|
12
|
+
const CompareImage = ({ leftContent, rightContent, aspectRatio, ...rest }) => {
|
|
13
|
+
const [position, setPosition] = useState(50);
|
|
14
|
+
const containerRef = useRef(null);
|
|
15
|
+
const isDragging = useRef(false);
|
|
16
|
+
const handleMouseDown = () => {
|
|
17
|
+
isDragging.current = true;
|
|
18
|
+
};
|
|
19
|
+
const handleMouseUp = () => {
|
|
20
|
+
isDragging.current = false;
|
|
21
|
+
};
|
|
22
|
+
const updatePosition = (clientX) => {
|
|
23
|
+
if (!isDragging.current || !containerRef.current)
|
|
24
|
+
return;
|
|
25
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
26
|
+
const x = clientX - rect.left;
|
|
27
|
+
const containerWidth = rect.width;
|
|
28
|
+
// Calculate percentage (constrained between 0 and 100)
|
|
29
|
+
const newPosition = Math.max(0, Math.min(100, (x / containerWidth) * 100));
|
|
30
|
+
setPosition(newPosition);
|
|
31
|
+
};
|
|
32
|
+
const handleMouseMove = (e) => {
|
|
33
|
+
updatePosition(e.clientX);
|
|
34
|
+
};
|
|
35
|
+
const handleTouchMove = (e) => {
|
|
36
|
+
updatePosition(e.touches[0].clientX);
|
|
37
|
+
};
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
40
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
41
|
+
document.addEventListener("touchmove", handleTouchMove);
|
|
42
|
+
document.addEventListener("touchend", handleMouseUp);
|
|
43
|
+
return () => {
|
|
44
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
45
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
46
|
+
document.removeEventListener("touchmove", handleTouchMove);
|
|
47
|
+
document.removeEventListener("touchend", handleMouseUp);
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
50
|
+
return (_jsxs(Flex, { ref: containerRef, aspectRatio: aspectRatio || "16/9", fillWidth: true, style: { touchAction: "none" }, ...rest, children: [renderContent(leftContent, `inset(0 ${100 - position}% 0 0)`, aspectRatio), renderContent(rightContent, `inset(0 0 0 ${position}%)`, aspectRatio), _jsx(Flex, { position: "absolute", horizontal: "center", width: 3, className: styles.hitArea, top: "0", bottom: "0", style: {
|
|
51
|
+
left: `${position}%`,
|
|
52
|
+
}, onMouseDown: handleMouseDown, onTouchStart: handleMouseDown, children: _jsx(Flex, { width: "1", fillHeight: true, background: "neutral-strong", zIndex: 2 }) }), _jsx(Flex, { radius: "l", background: "surface", fitHeight: true, className: styles.dragIcon, style: {
|
|
53
|
+
left: `${position}%`,
|
|
54
|
+
}, children: _jsx(IconButton, { icon: "chevronsLeftRight", variant: "secondary", onMouseDown: handleMouseDown, onTouchStart: handleMouseDown }) })] }));
|
|
55
|
+
};
|
|
56
|
+
CompareImage.displayName = "CompareImage";
|
|
57
|
+
export { CompareImage };
|
|
58
|
+
//# sourceMappingURL=CompareImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompareImage.js","sourceRoot":"","sources":["../../src/components/CompareImage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,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|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Placement } from "@floating-ui/react-dom";
|
|
3
|
+
export interface ContextMenuProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
dropdown: ReactNode;
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
fillWidth?: boolean;
|
|
8
|
+
minWidth?: number;
|
|
9
|
+
maxWidth?: number;
|
|
10
|
+
minHeight?: number;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
className?: string;
|
|
13
|
+
onSelect?: (value: string) => void;
|
|
14
|
+
closeAfterClick?: boolean;
|
|
15
|
+
isOpen?: boolean;
|
|
16
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
17
|
+
selectedOption?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const ContextMenu: React.ForwardRefExoticComponent<ContextMenuProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export { ContextMenu };
|
|
22
|
+
//# sourceMappingURL=ContextMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/components/ContextMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAGZ,SAAS,EAMV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKnD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,WAAW,yFA4UhB,CAAC;AAIF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useRef, forwardRef, useCallback, useEffect, } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { Flex, Dropdown, ScrollLock } from ".";
|
|
6
|
+
import styles from "./ContextMenu.module.scss";
|
|
7
|
+
const ContextMenu = forwardRef(({ children, dropdown, minHeight, onSelect, closeAfterClick = true, isOpen, onOpenChange, minWidth = 12, maxWidth, fillWidth = false, placement = "bottom-end", disabled = false, className, style, ...rest }, ref) => {
|
|
8
|
+
const [contextPosition, setContextPosition] = useState({ x: 0, y: 0 });
|
|
9
|
+
const [internalIsOpen, setInternalIsOpen] = useState(false);
|
|
10
|
+
const [isBrowser, setIsBrowser] = useState(false);
|
|
11
|
+
const [focusedIndex, setFocusedIndex] = useState(-1);
|
|
12
|
+
const containerRef = useRef(null);
|
|
13
|
+
const dropdownRef = useRef(null);
|
|
14
|
+
const previouslyFocusedElement = useRef(null);
|
|
15
|
+
// Control open state internally if not provided
|
|
16
|
+
const isControlled = isOpen !== undefined;
|
|
17
|
+
const isDropdownOpen = isControlled ? isOpen : internalIsOpen;
|
|
18
|
+
// Handle open state changes
|
|
19
|
+
const handleOpenChange = useCallback((open) => {
|
|
20
|
+
if (!isControlled) {
|
|
21
|
+
setInternalIsOpen(open);
|
|
22
|
+
}
|
|
23
|
+
onOpenChange?.(open);
|
|
24
|
+
}, [isControlled, onOpenChange]);
|
|
25
|
+
// Set browser state for portal rendering
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
setIsBrowser(true);
|
|
28
|
+
}, []);
|
|
29
|
+
const handleContextMenu = useCallback((e) => {
|
|
30
|
+
if (disabled)
|
|
31
|
+
return;
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
// Set the position to the mouse position
|
|
35
|
+
setContextPosition({ x: e.clientX, y: e.clientY });
|
|
36
|
+
// Open the dropdown
|
|
37
|
+
handleOpenChange(true);
|
|
38
|
+
}, [disabled, handleOpenChange]);
|
|
39
|
+
// Handle click events for MacBook support (Control+click)
|
|
40
|
+
const handleClick = useCallback((e) => {
|
|
41
|
+
if (disabled)
|
|
42
|
+
return;
|
|
43
|
+
// Check if it's a control+click (common right-click equivalent on Mac)
|
|
44
|
+
if (e.ctrlKey || e.metaKey) {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
// Set the position to the mouse position
|
|
48
|
+
setContextPosition({ x: e.clientX, y: e.clientY });
|
|
49
|
+
// Open the dropdown
|
|
50
|
+
handleOpenChange(true);
|
|
51
|
+
}
|
|
52
|
+
}, [disabled, handleOpenChange]);
|
|
53
|
+
// Close dropdown when clicking outside
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const handleClickOutside = (e) => {
|
|
56
|
+
if (isDropdownOpen &&
|
|
57
|
+
dropdownRef.current &&
|
|
58
|
+
!dropdownRef.current.contains(e.target)) {
|
|
59
|
+
handleOpenChange(false);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
63
|
+
return () => {
|
|
64
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
65
|
+
};
|
|
66
|
+
}, [isDropdownOpen, handleOpenChange]);
|
|
67
|
+
// Focus management
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (isDropdownOpen) {
|
|
70
|
+
// Store the currently focused element before focusing the dropdown
|
|
71
|
+
previouslyFocusedElement.current = document.activeElement;
|
|
72
|
+
// Reset focus index when opening
|
|
73
|
+
setFocusedIndex(-1);
|
|
74
|
+
// Store current scroll position
|
|
75
|
+
const scrollX = window.scrollX;
|
|
76
|
+
const scrollY = window.scrollY;
|
|
77
|
+
// Focus the dropdown after a small delay to ensure it's rendered
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
if (dropdownRef.current) {
|
|
80
|
+
// Force focus on the dropdown container first
|
|
81
|
+
dropdownRef.current.focus();
|
|
82
|
+
// Find all option elements
|
|
83
|
+
const optionElements = Array.from(dropdownRef.current.querySelectorAll('.option, [role="option"], [data-value]'));
|
|
84
|
+
if (optionElements.length > 0) {
|
|
85
|
+
// Set focus index to first option
|
|
86
|
+
setFocusedIndex(0);
|
|
87
|
+
// Focus and highlight the first option
|
|
88
|
+
optionElements[0].focus({ preventScroll: true });
|
|
89
|
+
optionElements[0].classList.add("highlighted");
|
|
90
|
+
// Remove highlight from other options
|
|
91
|
+
for (let i = 1; i < optionElements.length; i++) {
|
|
92
|
+
optionElements[i].classList.remove("highlighted");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
// If no options, focus any focusable element
|
|
97
|
+
const focusableElements = dropdownRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
98
|
+
if (focusableElements.length > 0) {
|
|
99
|
+
focusableElements[0].focus({ preventScroll: true });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Restore scroll position that might have been changed by focus
|
|
103
|
+
window.scrollTo(scrollX, scrollY);
|
|
104
|
+
}
|
|
105
|
+
}, 50); // Small delay to ensure DOM is ready
|
|
106
|
+
}
|
|
107
|
+
else if (!isDropdownOpen && previouslyFocusedElement.current) {
|
|
108
|
+
// Restore focus when closing
|
|
109
|
+
previouslyFocusedElement.current.focus();
|
|
110
|
+
}
|
|
111
|
+
}, [isDropdownOpen]);
|
|
112
|
+
// Handle keyboard navigation
|
|
113
|
+
const handleKeyDown = useCallback((e) => {
|
|
114
|
+
if (!isDropdownOpen)
|
|
115
|
+
return;
|
|
116
|
+
if (e.key === "Escape") {
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
handleOpenChange(false);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// Handle tab key for focus trapping
|
|
122
|
+
if (e.key === "Tab" && dropdownRef.current) {
|
|
123
|
+
// Find all focusable elements in the dropdown
|
|
124
|
+
const focusableElements = Array.from(dropdownRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));
|
|
125
|
+
if (focusableElements.length === 0)
|
|
126
|
+
return;
|
|
127
|
+
// Get the first and last focusable elements
|
|
128
|
+
const firstElement = focusableElements[0];
|
|
129
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
130
|
+
// Handle tab and shift+tab to cycle through focusable elements
|
|
131
|
+
if (e.shiftKey) {
|
|
132
|
+
// Shift+Tab
|
|
133
|
+
if (document.activeElement === firstElement) {
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
lastElement.focus();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
// Tab
|
|
140
|
+
if (document.activeElement === lastElement) {
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
firstElement.focus();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
// Find all Option components in the dropdown
|
|
150
|
+
const optionElements = dropdownRef.current
|
|
151
|
+
? Array.from(dropdownRef.current.querySelectorAll('.option, [role="option"], [data-value]'))
|
|
152
|
+
: [];
|
|
153
|
+
if (optionElements.length === 0)
|
|
154
|
+
return;
|
|
155
|
+
let newIndex = focusedIndex;
|
|
156
|
+
if (e.key === "ArrowDown") {
|
|
157
|
+
newIndex = focusedIndex < optionElements.length - 1 ? focusedIndex + 1 : 0;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
newIndex = focusedIndex > 0 ? focusedIndex - 1 : optionElements.length - 1;
|
|
161
|
+
}
|
|
162
|
+
setFocusedIndex(newIndex);
|
|
163
|
+
// Highlight the element visually
|
|
164
|
+
optionElements.forEach((el, i) => {
|
|
165
|
+
if (i === newIndex) {
|
|
166
|
+
el.classList.add("highlighted");
|
|
167
|
+
// Scroll into view if needed
|
|
168
|
+
el.scrollIntoView({ block: "nearest" });
|
|
169
|
+
// Focus the element
|
|
170
|
+
el.focus();
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
el.classList.remove("highlighted");
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
else if (e.key === "Enter" || e.key === " ") {
|
|
178
|
+
e.preventDefault();
|
|
179
|
+
// Find all Option components
|
|
180
|
+
const optionElements = dropdownRef.current
|
|
181
|
+
? Array.from(dropdownRef.current.querySelectorAll('.option, [role="option"], [data-value]'))
|
|
182
|
+
: [];
|
|
183
|
+
// Click the focused option
|
|
184
|
+
if (focusedIndex >= 0 && focusedIndex < optionElements.length) {
|
|
185
|
+
optionElements[focusedIndex].click();
|
|
186
|
+
if (closeAfterClick) {
|
|
187
|
+
handleOpenChange(false);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}, [isDropdownOpen, focusedIndex, handleOpenChange, closeAfterClick]);
|
|
192
|
+
return (_jsxs(_Fragment, { children: [_jsx(ScrollLock, { enabled: isDropdownOpen, allowScrollInElement: dropdownRef }), _jsxs(Flex, { ref: containerRef, onContextMenu: handleContextMenu, onClick: handleClick, className: className || "", style: { ...style, opacity: disabled ? 0.6 : undefined }, "aria-disabled": disabled, children: [children, isDropdownOpen &&
|
|
193
|
+
isBrowser &&
|
|
194
|
+
createPortal(_jsx(Flex, { position: "fixed", zIndex: 10, tabIndex: 0, ref: (node) => {
|
|
195
|
+
dropdownRef.current = node;
|
|
196
|
+
if (typeof ref === "function") {
|
|
197
|
+
ref(node);
|
|
198
|
+
}
|
|
199
|
+
else if (ref) {
|
|
200
|
+
ref.current = node;
|
|
201
|
+
}
|
|
202
|
+
}, className: styles.fadeIn, style: {
|
|
203
|
+
top: contextPosition.y,
|
|
204
|
+
left: contextPosition.x,
|
|
205
|
+
}, role: "menu", onKeyDown: handleKeyDown, onClick: (e) => {
|
|
206
|
+
const el = e.target;
|
|
207
|
+
const isSelectable = el.closest(".option") ||
|
|
208
|
+
el.closest("[role='option']") ||
|
|
209
|
+
el.closest("[data-value]");
|
|
210
|
+
if (isSelectable && closeAfterClick) {
|
|
211
|
+
setTimeout(() => {
|
|
212
|
+
handleOpenChange(false);
|
|
213
|
+
}, 50);
|
|
214
|
+
}
|
|
215
|
+
}, children: _jsx(Dropdown, { minWidth: minWidth, maxWidth: maxWidth, minHeight: minHeight, radius: "l", onSelect: (value) => {
|
|
216
|
+
onSelect?.(value);
|
|
217
|
+
if (closeAfterClick) {
|
|
218
|
+
handleOpenChange(false);
|
|
219
|
+
}
|
|
220
|
+
}, ...rest, children: dropdown }) }), document.body)] })] }));
|
|
221
|
+
});
|
|
222
|
+
ContextMenu.displayName = "ContextMenu";
|
|
223
|
+
export { ContextMenu };
|
|
224
|
+
//# sourceMappingURL=ContextMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenu.js","sourceRoot":"","sources":["../../src/components/ContextMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EACZ,QAAQ,EACR,MAAM,EAEN,UAAU,EAGV,WAAW,EACX,SAAS,GACV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,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
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.fadeIn {
|
|
13
|
+
transform-origin: top left;
|
|
14
|
+
animation: fadeIn var(--transition-duration-micro-medium) var(--transition-eased);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text } from ".";
|
|
3
|
+
export interface CountFxProps extends React.ComponentProps<typeof Text> {
|
|
4
|
+
value: number;
|
|
5
|
+
speed?: number;
|
|
6
|
+
easing?: "linear" | "ease-out" | "ease-in-out";
|
|
7
|
+
format?: (value: number) => string;
|
|
8
|
+
separator?: string;
|
|
9
|
+
decimals?: number;
|
|
10
|
+
effect?: "simple" | "wheel" | "smooth";
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare const CountFx: React.FC<CountFxProps>;
|
|
14
|
+
export { CountFx };
|
|
15
|
+
//# sourceMappingURL=CountFx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CountFx.d.ts","sourceRoot":"","sources":["../../src/components/CountFx.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAO,IAAI,EAAE,MAAM,GAAG,CAAC;AAE9B,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC;IAC/C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACvC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAmTnC,CAAC;AAGF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState, useRef } from "react";
|
|
4
|
+
import { Row, Text } from ".";
|
|
5
|
+
const CountFx = ({ value, speed = 1000, easing = "ease-out", format, separator, decimals, effect = "simple", children, ...text }) => {
|
|
6
|
+
const [displayValue, setDisplayValue] = useState(value);
|
|
7
|
+
const [animationProgress, setAnimationProgress] = useState(1);
|
|
8
|
+
const animationRef = useRef(undefined);
|
|
9
|
+
const previousValueRef = useRef(value);
|
|
10
|
+
// Default format function with separator and decimals support
|
|
11
|
+
const defaultFormat = (val) => {
|
|
12
|
+
let formattedValue = decimals !== undefined ? val.toFixed(decimals) : val.toString();
|
|
13
|
+
if (separator) {
|
|
14
|
+
const parts = formattedValue.split('.');
|
|
15
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
16
|
+
formattedValue = parts.join('.');
|
|
17
|
+
}
|
|
18
|
+
return formattedValue;
|
|
19
|
+
};
|
|
20
|
+
const formatValue = format || defaultFormat;
|
|
21
|
+
// Easing functions
|
|
22
|
+
const getEasing = (progress) => {
|
|
23
|
+
switch (easing) {
|
|
24
|
+
case "linear":
|
|
25
|
+
return progress;
|
|
26
|
+
case "ease-out":
|
|
27
|
+
return 1 - Math.pow(1 - progress, 3);
|
|
28
|
+
case "ease-in-out":
|
|
29
|
+
return progress < 0.5 ? 2 * progress * progress : 1 - Math.pow(-2 * progress + 2, 2) / 2;
|
|
30
|
+
default:
|
|
31
|
+
return 1 - Math.pow(1 - progress, 3);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
// Wheel animation: create digit wheels
|
|
35
|
+
const renderWheelDigits = (currentValue, targetValue) => {
|
|
36
|
+
const currentStr = currentValue.toString().padStart(targetValue.toString().length, "0");
|
|
37
|
+
const targetStr = targetValue.toString();
|
|
38
|
+
const maxLength = Math.max(currentStr.length, targetStr.length);
|
|
39
|
+
return Array.from({ length: maxLength }, (_, index) => {
|
|
40
|
+
const currentDigit = parseInt(currentStr[maxLength - 1 - index] || "0");
|
|
41
|
+
const targetDigit = parseInt(targetStr[maxLength - 1 - index] || "0");
|
|
42
|
+
// Calculate progress for this specific digit
|
|
43
|
+
const digitDifference = targetDigit - currentDigit;
|
|
44
|
+
const digitProgress = Math.abs(digitDifference) > 0 ? Math.min(Math.abs(digitDifference) / 10, 1) : 1; // Progress based on how close to target
|
|
45
|
+
// Create wheel effect for this digit
|
|
46
|
+
const wheelDigits = [];
|
|
47
|
+
for (let i = 0; i <= 9; i++) {
|
|
48
|
+
const isActive = i === currentDigit;
|
|
49
|
+
// Calculate transition speed based on progress (slower as it approaches target)
|
|
50
|
+
const transitionDuration = 0.1 + digitProgress * 0.2; // 0.1s to 0.3s
|
|
51
|
+
// Calculate position for wheel effect
|
|
52
|
+
let position = 0;
|
|
53
|
+
if (isActive) {
|
|
54
|
+
position = 0; // Current digit is centered
|
|
55
|
+
}
|
|
56
|
+
else if (i < currentDigit) {
|
|
57
|
+
position = -100; // Digits below current are above
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
position = 100; // Digits above current are below
|
|
61
|
+
}
|
|
62
|
+
wheelDigits.push(_jsx(Row, { center: true, position: "absolute", top: "0", left: "0", right: "0", bottom: "0", style: {
|
|
63
|
+
height: "1em",
|
|
64
|
+
width: "100%",
|
|
65
|
+
transform: `translateY(${position * 2}%)`,
|
|
66
|
+
transition: `all ${transitionDuration}s ease-out`,
|
|
67
|
+
pointerEvents: "none",
|
|
68
|
+
}, children: i }, i));
|
|
69
|
+
}
|
|
70
|
+
return (_jsx(Row, { align: "center", overflow: "hidden", inline: true, style: {
|
|
71
|
+
height: "1em",
|
|
72
|
+
width: "0.8em",
|
|
73
|
+
marginLeft: "-0.125em",
|
|
74
|
+
marginRight: "-0.125em",
|
|
75
|
+
position: "relative",
|
|
76
|
+
isolation: "isolate",
|
|
77
|
+
}, children: wheelDigits }, index));
|
|
78
|
+
}).reverse();
|
|
79
|
+
};
|
|
80
|
+
// Smooth animation: animate each digit independently from start to target
|
|
81
|
+
const renderSmoothDigits = (startValue, targetValue, progress) => {
|
|
82
|
+
const startStr = startValue.toString().padStart(targetValue.toString().length, "0");
|
|
83
|
+
const targetStr = targetValue.toString();
|
|
84
|
+
const maxLength = Math.max(startStr.length, targetStr.length);
|
|
85
|
+
return Array.from({ length: maxLength }, (_, index) => {
|
|
86
|
+
const startDigit = parseInt(startStr[maxLength - 1 - index] || "0");
|
|
87
|
+
const targetDigit = parseInt(targetStr[maxLength - 1 - index] || "0");
|
|
88
|
+
// Calculate the shortest path between digits (handles wrapping around 0-9)
|
|
89
|
+
let digitDifference = targetDigit - startDigit;
|
|
90
|
+
if (Math.abs(digitDifference) > 5) {
|
|
91
|
+
// Take the shorter path around the wheel
|
|
92
|
+
digitDifference = digitDifference > 0 ? digitDifference - 10 : digitDifference + 10;
|
|
93
|
+
}
|
|
94
|
+
// Calculate the current digit position based on progress
|
|
95
|
+
const currentDigitPosition = startDigit + digitDifference * progress;
|
|
96
|
+
// Create wheel effect for this digit
|
|
97
|
+
const wheelDigits = [];
|
|
98
|
+
for (let i = 0; i <= 9; i++) {
|
|
99
|
+
// Calculate the position of each digit in the wheel
|
|
100
|
+
let position = 0;
|
|
101
|
+
// Calculate the relative position of this digit to the current position
|
|
102
|
+
let relativePosition = i - currentDigitPosition;
|
|
103
|
+
// Handle wrapping around the wheel
|
|
104
|
+
if (relativePosition > 5)
|
|
105
|
+
relativePosition -= 10;
|
|
106
|
+
if (relativePosition < -5)
|
|
107
|
+
relativePosition += 10;
|
|
108
|
+
// Convert to percentage position
|
|
109
|
+
position = relativePosition * 200; // 200% for full wheel height
|
|
110
|
+
const opacity = Math.max(0, 1 - Math.abs(relativePosition) * 2);
|
|
111
|
+
wheelDigits.push(_jsx(Row, { center: true, position: "absolute", top: "0", left: "0", right: "0", bottom: "0", pointerEvents: "none", fillWidth: true, style: {
|
|
112
|
+
height: '1em',
|
|
113
|
+
transform: `translateY(${position}%)`,
|
|
114
|
+
transition: 'none',
|
|
115
|
+
opacity: opacity,
|
|
116
|
+
}, children: i }, i));
|
|
117
|
+
}
|
|
118
|
+
return (_jsx(Row, { style: {
|
|
119
|
+
height: '1em',
|
|
120
|
+
marginLeft: '-0.125em',
|
|
121
|
+
marginRight: '-0.125em',
|
|
122
|
+
}, children: _jsx(Row, { align: "center", inline: true, overflow: "hidden", style: {
|
|
123
|
+
opacity: 1,
|
|
124
|
+
height: '2em',
|
|
125
|
+
width: '0.8em',
|
|
126
|
+
isolation: 'isolate',
|
|
127
|
+
}, children: wheelDigits }) }, index));
|
|
128
|
+
}).reverse();
|
|
129
|
+
};
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
if (value === previousValueRef.current)
|
|
132
|
+
return;
|
|
133
|
+
const startValue = previousValueRef.current;
|
|
134
|
+
const endValue = value;
|
|
135
|
+
const difference = endValue - startValue;
|
|
136
|
+
let startTime;
|
|
137
|
+
const animate = (timestamp) => {
|
|
138
|
+
if (!startTime)
|
|
139
|
+
startTime = timestamp;
|
|
140
|
+
const elapsed = timestamp - startTime;
|
|
141
|
+
const progress = Math.min(elapsed / speed, 1);
|
|
142
|
+
const easedProgress = getEasing(progress);
|
|
143
|
+
if (effect === "wheel") {
|
|
144
|
+
// For wheel animation, we animate each digit independently
|
|
145
|
+
const currentValue = decimals !== undefined
|
|
146
|
+
? parseFloat((startValue + difference * easedProgress).toFixed(decimals))
|
|
147
|
+
: Math.floor(startValue + difference * easedProgress);
|
|
148
|
+
setDisplayValue(currentValue);
|
|
149
|
+
}
|
|
150
|
+
else if (effect === "smooth") {
|
|
151
|
+
// For smooth animation, we track progress and animate digits independently
|
|
152
|
+
setAnimationProgress(easedProgress);
|
|
153
|
+
const currentValue = decimals !== undefined
|
|
154
|
+
? parseFloat((startValue + difference * easedProgress).toFixed(decimals))
|
|
155
|
+
: Math.floor(startValue + difference * easedProgress);
|
|
156
|
+
setDisplayValue(currentValue);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
// Simple animation
|
|
160
|
+
const currentValue = startValue + difference * easedProgress;
|
|
161
|
+
const currentStepValue = decimals !== undefined
|
|
162
|
+
? parseFloat(currentValue.toFixed(decimals))
|
|
163
|
+
: Math.floor(currentValue);
|
|
164
|
+
setDisplayValue(currentStepValue);
|
|
165
|
+
}
|
|
166
|
+
if (progress < 1) {
|
|
167
|
+
animationRef.current = requestAnimationFrame(animate);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
setDisplayValue(endValue);
|
|
171
|
+
setAnimationProgress(1);
|
|
172
|
+
previousValueRef.current = endValue;
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
if (animationRef.current) {
|
|
176
|
+
cancelAnimationFrame(animationRef.current);
|
|
177
|
+
}
|
|
178
|
+
animationRef.current = requestAnimationFrame(animate);
|
|
179
|
+
return () => {
|
|
180
|
+
if (animationRef.current) {
|
|
181
|
+
cancelAnimationFrame(animationRef.current);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}, [value, speed, easing, effect]);
|
|
185
|
+
// Cleanup on unmount
|
|
186
|
+
useEffect(() => {
|
|
187
|
+
return () => {
|
|
188
|
+
if (animationRef.current) {
|
|
189
|
+
cancelAnimationFrame(animationRef.current);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
}, []);
|
|
193
|
+
if (effect === "wheel") {
|
|
194
|
+
return (_jsxs(Text, { ...text, style: { display: "flex", alignItems: "center", gap: "0.1em", ...text.style }, children: [renderWheelDigits(displayValue, value), children] }));
|
|
195
|
+
}
|
|
196
|
+
if (effect === "smooth") {
|
|
197
|
+
return (_jsxs(Text, { ...text, style: { display: "flex", alignItems: "center", gap: "0.1em", ...text.style }, children: [renderSmoothDigits(previousValueRef.current, value, animationProgress), children] }));
|
|
198
|
+
}
|
|
199
|
+
return (_jsxs(Text, { ...text, children: [formatValue(displayValue), children] }));
|
|
200
|
+
};
|
|
201
|
+
CountFx.displayName = "CountFx";
|
|
202
|
+
export { CountFx };
|
|
203
|
+
//# sourceMappingURL=CountFx.js.map
|