@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,33 @@
|
|
|
1
|
+
@use "../styles/breakpoints.scss" as breakpoints;
|
|
2
|
+
|
|
3
|
+
.overlay {
|
|
4
|
+
opacity: 0;
|
|
5
|
+
visibility: hidden;
|
|
6
|
+
|
|
7
|
+
&.open {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
visibility: visible;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.dialog {
|
|
14
|
+
max-width: 40rem;
|
|
15
|
+
max-height: 100%;
|
|
16
|
+
transform: scale(0.2);
|
|
17
|
+
opacity: 0;
|
|
18
|
+
|
|
19
|
+
&.open {
|
|
20
|
+
transform: scale(1);
|
|
21
|
+
opacity: 1;
|
|
22
|
+
visibility: visible;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@include breakpoints.m {
|
|
26
|
+
position: fixed;
|
|
27
|
+
bottom: var(--static-space-8);
|
|
28
|
+
left: var(--static-space-8);
|
|
29
|
+
right: var(--static-space-8);
|
|
30
|
+
top: var(--static-space-8);
|
|
31
|
+
max-width: calc(100% - var(--static-space-16)) !important;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Row } from ".";
|
|
3
|
+
interface DropdownProps extends Omit<React.ComponentProps<typeof Row>, "onSelect"> {
|
|
4
|
+
selectedOption?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
onEscape?: () => void;
|
|
7
|
+
onSelect?: (event: string) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Dropdown: React.ForwardRefExoticComponent<Omit<DropdownProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { Dropdown };
|
|
12
|
+
export type { DropdownProps };
|
|
13
|
+
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../src/components/Dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAA8B,MAAM,OAAO,CAAC;AACrE,OAAO,EAAU,GAAG,EAAE,MAAM,GAAG,CAAC;AAEhC,UAAU,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,UAAU,CAAC;IAChF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,mGAoCb,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { Column, Row } from ".";
|
|
5
|
+
const Dropdown = forwardRef(({ selectedOption, className, children, onEscape, onSelect, disabled = false, ...flex }, ref) => {
|
|
6
|
+
const handleSelect = (event) => {
|
|
7
|
+
if (disabled)
|
|
8
|
+
return;
|
|
9
|
+
// Only handle clicks on elements that have a data-value attribute
|
|
10
|
+
const target = event.target;
|
|
11
|
+
const value = target.getAttribute("data-value") ||
|
|
12
|
+
target.closest("[data-value]")?.getAttribute("data-value");
|
|
13
|
+
if (onSelect && value) {
|
|
14
|
+
onSelect(value);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return (_jsx(Row, { ref: ref, role: "listbox", onClick: handleSelect, flex: 1, border: "neutral-medium", background: "surface", overflow: "hidden", className: disabled ? "cursor-not-allowed" : undefined, style: { opacity: disabled ? 0.6 : undefined }, "aria-disabled": disabled, ...flex, children: _jsx(Column, { flex: 1, overflowY: "auto", gap: "2", children: children }) }));
|
|
18
|
+
});
|
|
19
|
+
Dropdown.displayName = "Dropdown";
|
|
20
|
+
export { Dropdown };
|
|
21
|
+
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../src/components/Dropdown.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAa,UAAU,EAAkB,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAUhC,MAAM,QAAQ,GAAG,UAAU,CACzB,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IAC9F,MAAM,YAAY,GAAG,CAAC,KAAqC,EAAE,EAAE;QAC7D,IAAI,QAAQ;YAAE,OAAO;QAErB,kEAAkE;QAClE,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;QAC3C,MAAM,KAAK,GACT,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC;YACjC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;QAE7D,IAAI,QAAQ,IAAI,KAAK,EAAE,CAAC;YACtB,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,GAAG,IACF,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,CAAC,EACP,MAAM,EAAC,gBAAgB,EACvB,UAAU,EAAC,SAAS,EACpB,QAAQ,EAAC,QAAQ,EACjB,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,EACtD,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,mBAC/B,QAAQ,KACnB,IAAI,YAER,KAAC,MAAM,IAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAC,MAAM,EAAC,GAAG,EAAC,GAAG,YACtC,QAAQ,GACF,GACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Placement } from "@floating-ui/react-dom";
|
|
3
|
+
import { NavigationLayout } from "../hooks/useArrowNavigation";
|
|
4
|
+
export interface DropdownWrapperProps {
|
|
5
|
+
fillWidth?: boolean;
|
|
6
|
+
minWidth?: number;
|
|
7
|
+
maxWidth?: number;
|
|
8
|
+
minHeight?: number;
|
|
9
|
+
placement?: Placement;
|
|
10
|
+
trigger: ReactNode;
|
|
11
|
+
dropdown: ReactNode;
|
|
12
|
+
selectedOption?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
className?: string;
|
|
15
|
+
onSelect?: (value: string) => void;
|
|
16
|
+
closeAfterClick?: boolean;
|
|
17
|
+
handleArrowNavigation?: boolean;
|
|
18
|
+
isOpen?: boolean;
|
|
19
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
20
|
+
isNested?: boolean;
|
|
21
|
+
navigationLayout?: NavigationLayout;
|
|
22
|
+
columns?: number | string;
|
|
23
|
+
optionsCount?: number;
|
|
24
|
+
dropdownId?: string;
|
|
25
|
+
disableTriggerClick?: boolean;
|
|
26
|
+
}
|
|
27
|
+
declare const DropdownWrapper: React.ForwardRefExoticComponent<DropdownWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export { DropdownWrapper };
|
|
29
|
+
//# sourceMappingURL=DropdownWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownWrapper.d.ts","sourceRoot":"","sources":["../../src/components/DropdownWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAKZ,SAAS,EAMV,MAAM,OAAO,CAAC;AAEf,OAAO,EAOL,SAAS,EACV,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,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,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAKD,QAAA,MAAM,eAAe,6FAiuBpB,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React, { useState, useRef, useEffect, forwardRef, useImperativeHandle, useCallback, } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { useFloating, shift, offset, flip, size, autoUpdate, } from "@floating-ui/react-dom";
|
|
6
|
+
import { Flex, Dropdown, Column, Row, FocusTrap, ArrowNavigation, ScrollLock } from ".";
|
|
7
|
+
import styles from "./DropdownWrapper.module.scss";
|
|
8
|
+
// Global state to track the last opened dropdown
|
|
9
|
+
let dropdownCounter = 0;
|
|
10
|
+
const DropdownWrapper = forwardRef(({ trigger, dropdown, selectedOption, minHeight, onSelect, closeAfterClick = true, isOpen: controlledIsOpen, handleArrowNavigation = true, onOpenChange, minWidth, maxWidth, fillWidth = false, placement = "bottom-start", className, style, isNested = false, navigationLayout: propNavigationLayout, columns = 8, optionsCount: propOptionsCount, dropdownId: propDropdownId, disableTriggerClick = false, }, ref) => {
|
|
11
|
+
const [internalIsOpen, setInternalIsOpen] = useState(false);
|
|
12
|
+
const [mounted, setMounted] = useState(false);
|
|
13
|
+
const [focusedIndex, setFocusedIndex] = useState(-1);
|
|
14
|
+
// Use provided dropdownId or generate a unique ID for this dropdown
|
|
15
|
+
const dropdownId = useRef(propDropdownId || `dropdown-${dropdownCounter++}`);
|
|
16
|
+
const wrapperRef = useRef(null);
|
|
17
|
+
const triggerRef = useRef(null);
|
|
18
|
+
const dropdownRef = useRef(null);
|
|
19
|
+
const isControlled = controlledIsOpen !== undefined;
|
|
20
|
+
const isOpen = isControlled ? controlledIsOpen : internalIsOpen;
|
|
21
|
+
const handleOpenChange = useCallback((newIsOpen) => {
|
|
22
|
+
if (newIsOpen) {
|
|
23
|
+
// Close any other open dropdown before opening this one
|
|
24
|
+
if (window.lastOpenedDropdown && window.lastOpenedDropdown !== dropdownId.current) {
|
|
25
|
+
// Dispatch event to close other dropdowns
|
|
26
|
+
const closeEvent = new CustomEvent('close-other-dropdowns', {
|
|
27
|
+
detail: { exceptId: dropdownId.current }
|
|
28
|
+
});
|
|
29
|
+
document.dispatchEvent(closeEvent);
|
|
30
|
+
// Small delay to let the other dropdown close and restore scroll first
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
if (!isControlled) {
|
|
33
|
+
setInternalIsOpen(true);
|
|
34
|
+
}
|
|
35
|
+
window.lastOpenedDropdown = dropdownId.current;
|
|
36
|
+
onOpenChange?.(true);
|
|
37
|
+
}, 50);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Set this as the last opened dropdown using global variable
|
|
41
|
+
window.lastOpenedDropdown = dropdownId.current;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Clear the last opened dropdown if this one is closing
|
|
45
|
+
if (window.lastOpenedDropdown === dropdownId.current) {
|
|
46
|
+
window.lastOpenedDropdown = null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (!isControlled) {
|
|
50
|
+
setInternalIsOpen(newIsOpen);
|
|
51
|
+
}
|
|
52
|
+
onOpenChange?.(newIsOpen);
|
|
53
|
+
}, [onOpenChange, isControlled, isNested]);
|
|
54
|
+
// State to track if we're in a browser environment for portal rendering
|
|
55
|
+
const [isBrowser, setIsBrowser] = useState(false);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
setIsBrowser(true);
|
|
58
|
+
}, []);
|
|
59
|
+
// Store the reference element's width for fillWidth calculation
|
|
60
|
+
const [referenceWidth, setReferenceWidth] = useState(null);
|
|
61
|
+
// We'll measure the width directly in the floating UI middleware
|
|
62
|
+
const { x, y, strategy, refs, update } = useFloating({
|
|
63
|
+
placement: placement,
|
|
64
|
+
open: isOpen,
|
|
65
|
+
middleware: [
|
|
66
|
+
offset(4),
|
|
67
|
+
minHeight ? undefined : flip(),
|
|
68
|
+
shift(),
|
|
69
|
+
size({
|
|
70
|
+
apply({ availableWidth, availableHeight, elements }) {
|
|
71
|
+
// Get the width directly from the trigger element when needed
|
|
72
|
+
let width = "auto";
|
|
73
|
+
if (fillWidth && triggerRef.current) {
|
|
74
|
+
const triggerWidth = triggerRef.current.getBoundingClientRect().width;
|
|
75
|
+
width = `${Math.max(triggerWidth, 200)}px`;
|
|
76
|
+
}
|
|
77
|
+
Object.assign(elements.floating.style, {
|
|
78
|
+
width: width,
|
|
79
|
+
minWidth: minWidth ? `${minWidth}rem` : fillWidth ? width : undefined,
|
|
80
|
+
maxWidth: maxWidth ? `${maxWidth}rem` : `${availableWidth}px`,
|
|
81
|
+
minHeight: `${Math.min(minHeight || 0)}px`,
|
|
82
|
+
maxHeight: `${availableHeight}px`,
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
}),
|
|
86
|
+
],
|
|
87
|
+
whileElementsMounted: autoUpdate,
|
|
88
|
+
});
|
|
89
|
+
useImperativeHandle(ref, () => wrapperRef.current);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (wrapperRef.current) {
|
|
92
|
+
refs.setReference(wrapperRef.current);
|
|
93
|
+
// Store the reference element's width for fillWidth calculation
|
|
94
|
+
if (fillWidth) {
|
|
95
|
+
setReferenceWidth(wrapperRef.current.getBoundingClientRect().width);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}, [refs, mounted, fillWidth]);
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (!mounted) {
|
|
101
|
+
setMounted(true);
|
|
102
|
+
}
|
|
103
|
+
}, [mounted]);
|
|
104
|
+
// Store the previously focused element to restore focus when dropdown closes
|
|
105
|
+
const previouslyFocusedElement = useRef(null);
|
|
106
|
+
// Force update when dropdown opens
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (isOpen && mounted) {
|
|
109
|
+
// Small delay to ensure DOM is ready
|
|
110
|
+
const timeoutId = setTimeout(() => {
|
|
111
|
+
update();
|
|
112
|
+
}, 0);
|
|
113
|
+
return () => clearTimeout(timeoutId);
|
|
114
|
+
}
|
|
115
|
+
}, [isOpen, mounted, update]);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (isOpen && mounted) {
|
|
118
|
+
// Store the currently focused element before focusing the dropdown
|
|
119
|
+
previouslyFocusedElement.current = document.activeElement;
|
|
120
|
+
requestAnimationFrame(() => {
|
|
121
|
+
if (dropdownRef.current) {
|
|
122
|
+
refs.setFloating(dropdownRef.current);
|
|
123
|
+
update();
|
|
124
|
+
// Reset focus index when opening
|
|
125
|
+
setFocusedIndex(-1);
|
|
126
|
+
const focusableElements = dropdownRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
127
|
+
if (focusableElements.length > 0) {
|
|
128
|
+
focusableElements[0].focus({ preventScroll: true });
|
|
129
|
+
}
|
|
130
|
+
const optionElements = dropdownRef.current
|
|
131
|
+
? Array.from(dropdownRef.current.querySelectorAll('.option, [role="option"], [data-value]'))
|
|
132
|
+
: [];
|
|
133
|
+
if (optionElements.length > 0) {
|
|
134
|
+
setFocusedIndex(0);
|
|
135
|
+
optionElements.forEach((el, i) => {
|
|
136
|
+
if (i === 0) {
|
|
137
|
+
el.classList.add("highlighted");
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
el.classList.remove("highlighted");
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else if (!isOpen && previouslyFocusedElement.current) {
|
|
148
|
+
// Only try to focus if the element is still in the document
|
|
149
|
+
if (document.contains(previouslyFocusedElement.current)) {
|
|
150
|
+
previouslyFocusedElement.current.focus({ preventScroll: true });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}, [isOpen, mounted, refs, update]);
|
|
154
|
+
const handleClickOutside = useCallback((event) => {
|
|
155
|
+
const target = event.target;
|
|
156
|
+
// Check if the click is inside the dropdown or the wrapper
|
|
157
|
+
const isClickInDropdown = dropdownRef.current && dropdownRef.current.contains(target);
|
|
158
|
+
const isClickInWrapper = wrapperRef.current && wrapperRef.current.contains(target);
|
|
159
|
+
// Check if the click is on a dropdown trigger (for nested dropdowns)
|
|
160
|
+
const isClickOnDropdownTrigger = target.closest(".dropdown-trigger") !== null;
|
|
161
|
+
// Check if the click is on the dropdown portal itself
|
|
162
|
+
const isClickOnDropdownPortal = target.closest(".dropdown-portal") !== null;
|
|
163
|
+
// Check if the click is on any dropdown-related element
|
|
164
|
+
const isClickOnDropdownElement = target.closest('[data-role="dropdown-wrapper"]') !== null ||
|
|
165
|
+
target.closest('[data-role="dropdown-portal"]') !== null ||
|
|
166
|
+
target.closest('[data-is-dropdown="true"]') !== null;
|
|
167
|
+
// Only close if the click is outside both the dropdown and the wrapper
|
|
168
|
+
// and not on a nested dropdown trigger or dropdown portal
|
|
169
|
+
if (!isClickInDropdown &&
|
|
170
|
+
!isClickInWrapper &&
|
|
171
|
+
!isClickOnDropdownTrigger &&
|
|
172
|
+
!isClickOnDropdownPortal &&
|
|
173
|
+
!isClickOnDropdownElement) {
|
|
174
|
+
handleOpenChange(false);
|
|
175
|
+
setFocusedIndex(-1);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
// If click is inside dropdown but not on an option, try to close nested dropdowns
|
|
179
|
+
if (isClickInDropdown || isClickOnDropdownPortal) {
|
|
180
|
+
// Try to close all other dropdown portals
|
|
181
|
+
const allPortals = document.querySelectorAll('[data-role="dropdown-portal"]');
|
|
182
|
+
allPortals.forEach((portal, index) => {
|
|
183
|
+
if (portal !== dropdownRef.current) {
|
|
184
|
+
// Try to find the dropdown wrapper that contains this portal
|
|
185
|
+
const wrapper = portal.closest('[data-role="dropdown-wrapper"]');
|
|
186
|
+
if (wrapper) {
|
|
187
|
+
const trigger = wrapper.querySelector(".dropdown-trigger");
|
|
188
|
+
if (trigger) {
|
|
189
|
+
trigger.click();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}, [handleOpenChange]);
|
|
197
|
+
const handleFocusOut = useCallback((event) => {
|
|
198
|
+
// Check if focus moved to the dropdown or stayed in the wrapper
|
|
199
|
+
const isFocusInDropdown = dropdownRef.current && dropdownRef.current.contains(event.relatedTarget);
|
|
200
|
+
const isFocusInWrapper = wrapperRef.current && wrapperRef.current.contains(event.relatedTarget);
|
|
201
|
+
// Only close if focus moved outside both the dropdown and the wrapper
|
|
202
|
+
if (!isFocusInDropdown && !isFocusInWrapper) {
|
|
203
|
+
handleOpenChange(false);
|
|
204
|
+
setFocusedIndex(-1);
|
|
205
|
+
}
|
|
206
|
+
}, [handleOpenChange]);
|
|
207
|
+
useEffect(() => {
|
|
208
|
+
const currentWrapperRef = wrapperRef.current;
|
|
209
|
+
document.addEventListener("click", handleClickOutside);
|
|
210
|
+
currentWrapperRef?.addEventListener("focusout", handleFocusOut);
|
|
211
|
+
// Listen for close-nested-dropdowns events if this is a nested dropdown
|
|
212
|
+
const handleCloseNestedDropdowns = () => {
|
|
213
|
+
if (isNested && isOpen) {
|
|
214
|
+
handleOpenChange(false);
|
|
215
|
+
setFocusedIndex(-1);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
// Listen for close-other-dropdowns event to close this dropdown when another opens
|
|
219
|
+
const handleCloseOtherDropdowns = (e) => {
|
|
220
|
+
const customEvent = e;
|
|
221
|
+
const exceptId = customEvent.detail?.exceptId;
|
|
222
|
+
// Close this dropdown if it's not the one being excepted
|
|
223
|
+
if (isOpen && dropdownId.current !== exceptId) {
|
|
224
|
+
handleOpenChange(false);
|
|
225
|
+
setFocusedIndex(-1);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
document.addEventListener("close-nested-dropdowns", handleCloseNestedDropdowns);
|
|
229
|
+
document.addEventListener("close-other-dropdowns", handleCloseOtherDropdowns);
|
|
230
|
+
return () => {
|
|
231
|
+
document.removeEventListener("click", handleClickOutside);
|
|
232
|
+
currentWrapperRef?.removeEventListener("focusout", handleFocusOut);
|
|
233
|
+
document.removeEventListener("close-nested-dropdowns", handleCloseNestedDropdowns);
|
|
234
|
+
document.removeEventListener("close-other-dropdowns", handleCloseOtherDropdowns);
|
|
235
|
+
};
|
|
236
|
+
}, [handleClickOutside, handleFocusOut, isNested, isOpen, handleOpenChange]);
|
|
237
|
+
// Get options from the dropdown
|
|
238
|
+
const getOptions = useCallback(() => {
|
|
239
|
+
if (!dropdownRef.current)
|
|
240
|
+
return [];
|
|
241
|
+
return Array.from(dropdownRef.current.querySelectorAll('.option, [role="option"], [data-value]'));
|
|
242
|
+
}, []);
|
|
243
|
+
// Track hover on options to sync with keyboard navigation
|
|
244
|
+
useEffect(() => {
|
|
245
|
+
if (!isOpen || !dropdownRef.current)
|
|
246
|
+
return;
|
|
247
|
+
const handleOptionHover = (e) => {
|
|
248
|
+
const target = e.target;
|
|
249
|
+
const option = target.closest('[role="option"], [data-value]');
|
|
250
|
+
if (option && dropdownRef.current?.contains(option)) {
|
|
251
|
+
const options = getOptions();
|
|
252
|
+
const index = options.indexOf(option);
|
|
253
|
+
if (index >= 0 && index !== focusedIndex) {
|
|
254
|
+
setFocusedIndex(index);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
const dropdown = dropdownRef.current;
|
|
259
|
+
dropdown.addEventListener('mouseover', handleOptionHover);
|
|
260
|
+
return () => {
|
|
261
|
+
dropdown.removeEventListener('mouseover', handleOptionHover);
|
|
262
|
+
};
|
|
263
|
+
}, [isOpen, focusedIndex, getOptions]);
|
|
264
|
+
// Determine the appropriate navigation layout
|
|
265
|
+
const determineNavigationLayout = useCallback(() => {
|
|
266
|
+
// Use the prop if provided, otherwise default to column
|
|
267
|
+
if (propNavigationLayout) {
|
|
268
|
+
return propNavigationLayout;
|
|
269
|
+
}
|
|
270
|
+
// Default to column layout for most dropdowns
|
|
271
|
+
return "column";
|
|
272
|
+
}, [propNavigationLayout]);
|
|
273
|
+
const [navigationLayout, setNavigationLayout] = useState(propNavigationLayout || "column");
|
|
274
|
+
const [optionsCount, setOptionsCount] = useState(propOptionsCount || 0);
|
|
275
|
+
// Update options count when dropdown opens or content changes
|
|
276
|
+
useEffect(() => {
|
|
277
|
+
if (isOpen) {
|
|
278
|
+
// If optionsCount is provided as a prop, use it
|
|
279
|
+
if (propOptionsCount !== undefined) {
|
|
280
|
+
setOptionsCount(propOptionsCount);
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
const options = getOptions();
|
|
284
|
+
setOptionsCount(options.length);
|
|
285
|
+
}
|
|
286
|
+
// Try to determine the layout based on the dropdown content or props
|
|
287
|
+
setNavigationLayout(determineNavigationLayout());
|
|
288
|
+
}
|
|
289
|
+
}, [isOpen, getOptions, determineNavigationLayout, propOptionsCount]);
|
|
290
|
+
// Handle option selection
|
|
291
|
+
const handleOptionSelect = useCallback((index) => {
|
|
292
|
+
const options = getOptions();
|
|
293
|
+
if (index >= 0 && index < options.length) {
|
|
294
|
+
options[index].click();
|
|
295
|
+
if (closeAfterClick) {
|
|
296
|
+
handleOpenChange(false);
|
|
297
|
+
setFocusedIndex(-1);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}, [getOptions, closeAfterClick, handleOpenChange]);
|
|
301
|
+
// Handle focus change
|
|
302
|
+
const handleFocusChange = useCallback((index) => {
|
|
303
|
+
setFocusedIndex(index);
|
|
304
|
+
const options = getOptions();
|
|
305
|
+
if (index >= 0 && index < options.length && dropdownRef.current) {
|
|
306
|
+
// Scroll within the dropdown container only, not the page
|
|
307
|
+
const option = options[index];
|
|
308
|
+
const container = dropdownRef.current;
|
|
309
|
+
const optionRect = option.getBoundingClientRect();
|
|
310
|
+
const containerRect = container.getBoundingClientRect();
|
|
311
|
+
// Check if option is outside visible area of container
|
|
312
|
+
if (optionRect.bottom > containerRect.bottom) {
|
|
313
|
+
option.scrollIntoView({ block: "nearest", behavior: "auto" });
|
|
314
|
+
}
|
|
315
|
+
else if (optionRect.top < containerRect.top) {
|
|
316
|
+
option.scrollIntoView({ block: "nearest", behavior: "auto" });
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}, [getOptions]);
|
|
320
|
+
// Handle keyboard navigation
|
|
321
|
+
const handleKeyDown = useCallback((e) => {
|
|
322
|
+
if (!isOpen) {
|
|
323
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
324
|
+
e.preventDefault();
|
|
325
|
+
handleOpenChange(true);
|
|
326
|
+
}
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (e.key === "Escape") {
|
|
330
|
+
e.preventDefault();
|
|
331
|
+
handleOpenChange(false);
|
|
332
|
+
setFocusedIndex(-1);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
// Handle tab key for focus trapping
|
|
336
|
+
if (e.key === "Tab" && dropdownRef.current) {
|
|
337
|
+
// Find all focusable elements in the dropdown
|
|
338
|
+
const focusableElements = Array.from(dropdownRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));
|
|
339
|
+
if (focusableElements.length === 0)
|
|
340
|
+
return;
|
|
341
|
+
// Get the first and last focusable elements
|
|
342
|
+
const firstElement = focusableElements[0];
|
|
343
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
344
|
+
// Handle tab and shift+tab to cycle through focusable elements
|
|
345
|
+
if (e.shiftKey) {
|
|
346
|
+
// Shift+Tab
|
|
347
|
+
if (document.activeElement === firstElement) {
|
|
348
|
+
e.preventDefault();
|
|
349
|
+
lastElement.focus();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
// Tab
|
|
354
|
+
if (document.activeElement === lastElement) {
|
|
355
|
+
e.preventDefault();
|
|
356
|
+
firstElement.focus();
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
// If handleArrowNavigation is false, forward keyboard events to the dropdown content
|
|
362
|
+
if (!handleArrowNavigation && dropdownRef.current) {
|
|
363
|
+
// Let the dropdown content handle arrow keys, enter, space, etc.
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
// Arrow key navigation will be handled by ArrowNavigation component
|
|
367
|
+
// Enter/Space key selection will be handled by ArrowNavigation component
|
|
368
|
+
}, [isOpen, handleOpenChange, handleArrowNavigation]);
|
|
369
|
+
return (_jsxs(_Fragment, { children: [_jsx(ScrollLock, { enabled: isOpen, allowScrollInElement: dropdownRef }), _jsxs(Column, { fillWidth: fillWidth, fitWidth: !fillWidth, transition: "macro-medium", style: {
|
|
370
|
+
...style,
|
|
371
|
+
}, className: className, ref: wrapperRef, onClick: disableTriggerClick
|
|
372
|
+
? undefined
|
|
373
|
+
: (e) => {
|
|
374
|
+
if (!isOpen) {
|
|
375
|
+
handleOpenChange(true);
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
}, onKeyDown: handleKeyDown, tabIndex: -1, role: "button", "aria-haspopup": "listbox", "aria-expanded": isOpen, "data-role": "dropdown-wrapper", children: [_jsx(Row, { ref: triggerRef, fillWidth: fillWidth, fitWidth: !fillWidth, onClick: disableTriggerClick
|
|
379
|
+
? undefined
|
|
380
|
+
: (e) => {
|
|
381
|
+
// If already open, close on trigger click
|
|
382
|
+
if (isOpen) {
|
|
383
|
+
handleOpenChange(false);
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
handleOpenChange(true);
|
|
387
|
+
}, onKeyDown: (e) => {
|
|
388
|
+
handleKeyDown(e);
|
|
389
|
+
}, role: "button", "data-is-dropdown": "true", "aria-haspopup": "true", "aria-expanded": isOpen, className: "dropdown-trigger", children: trigger }), isOpen &&
|
|
390
|
+
dropdown &&
|
|
391
|
+
isBrowser &&
|
|
392
|
+
createPortal(_jsx(FocusTrap, { active: isOpen, onEscape: () => handleOpenChange(false), autoFocus: true, restoreFocus: true, children: handleArrowNavigation ? (_jsx(ArrowNavigation, { layout: navigationLayout, itemCount: optionsCount, columns: typeof columns === "string" ? parseInt(columns, 10) || 8 : columns, onSelect: handleOptionSelect, onFocusChange: handleFocusChange, wrap: true, autoFocus: true, initialFocusedIndex: focusedIndex, itemSelector: '.option, [role="option"], [data-value]', role: navigationLayout === "grid" ? "grid" : "listbox", "aria-label": "Dropdown options", disabled: window.lastOpenedDropdown !== dropdownId.current, children: _jsx(Flex, { zIndex: 9, className: `${styles.fadeIn} dropdown-portal`, minWidth: minWidth, ref: dropdownRef, style: {
|
|
393
|
+
position: strategy,
|
|
394
|
+
top: y ?? 0,
|
|
395
|
+
left: x ?? 0,
|
|
396
|
+
}, "data-role": "dropdown-portal", "data-is-dropdown": "true", "data-dropdown-id": dropdownId.current, "data-is-active": window.lastOpenedDropdown === dropdownId.current, onKeyDown: (e) => {
|
|
397
|
+
// If handleArrowNavigation is false, let all keyboard events pass through
|
|
398
|
+
if (!handleArrowNavigation) {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
// Let FocusTrap handle Tab key
|
|
402
|
+
// Let ArrowNavigation handle arrow keys
|
|
403
|
+
if (e.key !== "Tab" &&
|
|
404
|
+
e.key !== "ArrowUp" &&
|
|
405
|
+
e.key !== "ArrowDown" &&
|
|
406
|
+
e.key !== "ArrowLeft" &&
|
|
407
|
+
e.key !== "ArrowRight") {
|
|
408
|
+
handleKeyDown(e);
|
|
409
|
+
}
|
|
410
|
+
}, onMouseDown: (e) => {
|
|
411
|
+
// Allow interactive elements (inputs, buttons, etc.) to work normally
|
|
412
|
+
const target = e.target;
|
|
413
|
+
const isInteractive = target.closest('input, textarea, select, button, [role="button"], a');
|
|
414
|
+
if (!isInteractive) {
|
|
415
|
+
e.preventDefault();
|
|
416
|
+
}
|
|
417
|
+
}, onPointerDown: (e) => {
|
|
418
|
+
// Allow interactive elements (inputs, buttons, etc.) to work normally
|
|
419
|
+
const target = e.target;
|
|
420
|
+
const isInteractive = target.closest('input, textarea, select, button, [role="button"], a');
|
|
421
|
+
if (!isInteractive) {
|
|
422
|
+
e.preventDefault();
|
|
423
|
+
}
|
|
424
|
+
}, onTouchStart: (e) => {
|
|
425
|
+
// Allow interactive elements (inputs, buttons, etc.) to work normally
|
|
426
|
+
const target = e.target;
|
|
427
|
+
const isInteractive = target.closest('input, textarea, select, button, [role="button"], a');
|
|
428
|
+
if (!isInteractive) {
|
|
429
|
+
e.preventDefault();
|
|
430
|
+
}
|
|
431
|
+
}, children: _jsx(Dropdown, { minWidth: minWidth, radius: "l", padding: "0", selectedOption: selectedOption, onSelect: (value) => {
|
|
432
|
+
onSelect?.(value);
|
|
433
|
+
if (closeAfterClick) {
|
|
434
|
+
handleOpenChange(false);
|
|
435
|
+
setFocusedIndex(-1);
|
|
436
|
+
}
|
|
437
|
+
}, children: React.Children.map(dropdown, (child) => {
|
|
438
|
+
if (React.isValidElement(child)) {
|
|
439
|
+
// Only add onClick handler to elements that have data-value or are interactive
|
|
440
|
+
const childElement = child;
|
|
441
|
+
const hasDataValue = childElement.props["data-value"] ||
|
|
442
|
+
childElement.props.value ||
|
|
443
|
+
childElement.type === "button" ||
|
|
444
|
+
childElement.props.role === "option";
|
|
445
|
+
if (hasDataValue) {
|
|
446
|
+
// Cast the child element to any to avoid TypeScript errors with unknown props
|
|
447
|
+
return React.cloneElement(childElement, {
|
|
448
|
+
onClick: (val) => {
|
|
449
|
+
onSelect?.(val);
|
|
450
|
+
if (closeAfterClick) {
|
|
451
|
+
handleOpenChange(false);
|
|
452
|
+
setFocusedIndex(-1);
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
// Return the child unchanged if it doesn't need an onClick handler
|
|
458
|
+
return child;
|
|
459
|
+
}
|
|
460
|
+
return child;
|
|
461
|
+
}) }) }) })) : (_jsx(Flex, { zIndex: 9, className: `${styles.fadeIn} dropdown-portal`, minWidth: minWidth, ref: dropdownRef, style: {
|
|
462
|
+
position: strategy,
|
|
463
|
+
top: y ?? 0,
|
|
464
|
+
left: x ?? 0,
|
|
465
|
+
}, "data-role": "dropdown-portal", "data-is-dropdown": "true", "data-dropdown-id": dropdownId.current, "data-is-active": window.lastOpenedDropdown === dropdownId.current, onKeyDown: (e) => {
|
|
466
|
+
// If handleArrowNavigation is false, let all keyboard events pass through
|
|
467
|
+
if (!handleArrowNavigation) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
// Let FocusTrap handle Tab key
|
|
471
|
+
if (e.key !== "Tab") {
|
|
472
|
+
handleKeyDown(e);
|
|
473
|
+
}
|
|
474
|
+
}, onMouseDown: (e) => {
|
|
475
|
+
// Allow interactive elements (inputs, buttons, etc.) to work normally
|
|
476
|
+
const target = e.target;
|
|
477
|
+
const isInteractive = target.closest('input, textarea, select, button, [role="button"], a');
|
|
478
|
+
if (!isInteractive) {
|
|
479
|
+
e.preventDefault();
|
|
480
|
+
}
|
|
481
|
+
}, onPointerDown: (e) => {
|
|
482
|
+
// Allow interactive elements (inputs, buttons, etc.) to work normally
|
|
483
|
+
const target = e.target;
|
|
484
|
+
const isInteractive = target.closest('input, textarea, select, button, [role="button"], a');
|
|
485
|
+
if (!isInteractive) {
|
|
486
|
+
e.preventDefault();
|
|
487
|
+
}
|
|
488
|
+
}, onTouchStart: (e) => {
|
|
489
|
+
// Allow interactive elements (inputs, buttons, etc.) to work normally
|
|
490
|
+
const target = e.target;
|
|
491
|
+
const isInteractive = target.closest('input, textarea, select, button, [role="button"], a');
|
|
492
|
+
if (!isInteractive) {
|
|
493
|
+
e.preventDefault();
|
|
494
|
+
}
|
|
495
|
+
}, children: _jsx(Dropdown, { minWidth: minWidth, radius: "l", padding: "0", selectedOption: selectedOption, onSelect: (value) => {
|
|
496
|
+
onSelect?.(value);
|
|
497
|
+
if (closeAfterClick) {
|
|
498
|
+
handleOpenChange(false);
|
|
499
|
+
setFocusedIndex(-1);
|
|
500
|
+
}
|
|
501
|
+
}, children: dropdown }) })) }), document.body)] })] }));
|
|
502
|
+
});
|
|
503
|
+
DropdownWrapper.displayName = "DropdownWrapper";
|
|
504
|
+
export { DropdownWrapper };
|
|
505
|
+
//# sourceMappingURL=DropdownWrapper.js.map
|