gd-design-library 0.3.4 → 0.4.0
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/CHANGELOG.md +86 -17
- package/README.md +2 -0
- package/assets/icons/account_circle.js +17 -1
- package/assets/icons/arrow-down.js +15 -1
- package/assets/icons/arrow-forward.js +17 -1
- package/assets/icons/attachment.js +17 -1
- package/assets/icons/check.js +16 -1
- package/assets/icons/chevron-left.js +17 -1
- package/assets/icons/chevron-right.js +17 -1
- package/assets/icons/content-copy.js +17 -1
- package/assets/icons/cross.js +16 -1
- package/assets/icons/delete_outlined.js +17 -1
- package/assets/icons/dot.js +16 -1
- package/assets/icons/edit.js +17 -1
- package/assets/icons/error_outline.js +22 -1
- package/assets/icons/eye.js +17 -1
- package/assets/icons/favorite.js +17 -1
- package/assets/icons/favorite_outlined.js +17 -1
- package/assets/icons/file-copy.js +16 -1
- package/assets/icons/filter.js +17 -1
- package/assets/icons/folder.js +17 -1
- package/assets/icons/folderOpen.js +17 -1
- package/assets/icons/home.js +17 -1
- package/assets/icons/keyboard-arrow-down.js +12 -1
- package/assets/icons/local_shipping.js +17 -1
- package/assets/icons/minus.js +16 -1
- package/assets/icons/mobile_menu_button.js +17 -1
- package/assets/icons/paymentCard.js +17 -1
- package/assets/icons/plus.js +16 -1
- package/assets/icons/portrait.js +17 -1
- package/assets/icons/processing.js +17 -1
- package/assets/icons/ruler.js +17 -1
- package/assets/icons/search.js +17 -1
- package/assets/icons/shopping_bag.js +17 -1
- package/assets/icons/slash.js +17 -1
- package/assets/icons/star.js +16 -1
- package/assets/icons/starOutlined.js +16 -1
- package/assets/icons/thumb-down.js +17 -1
- package/assets/icons/thumb-up.js +17 -1
- package/assets/icons/toast_error.js +20 -1
- package/assets/icons/toast_info.js +16 -1
- package/assets/icons/toast_success.js +20 -1
- package/assets/icons/toast_warning.js +16 -1
- package/assets/icons/upload.js +17 -1
- package/assets/icons/volume-up.js +17 -1
- package/assets/icons/wifiTethering.js +17 -1
- package/assets/svg/checkbox_bg_checked.svg.js +5 -2
- package/assets/svg/checkbox_border.svg.js +5 -2
- package/assets/svg/checkbox_disabled_bg_checked.svg.js +5 -2
- package/assets/svg/radio_bg.svg.js +5 -2
- package/assets/svg/radio_bg_checked.svg.js +5 -2
- package/components/core/Breadcrumbs/Breadcrumbs.js +34 -1
- package/components/core/Breadcrumbs/BreadcrumbsStyled.js +58 -1
- package/components/core/Breadcrumbs/constants.js +4 -1
- package/components/core/Button/Button.js +43 -1
- package/components/core/Button/ButtonStyled.js +53 -1
- package/components/core/Button/constants.js +4 -1
- package/components/core/Dropdown/Dropdown.js +38 -1
- package/components/core/Dropdown/DropdownStyled.js +20 -1
- package/components/core/Dropdown/constants.js +4 -1
- package/components/core/Dropdown/hooks/useDropdown.js +12 -1
- package/components/core/DropdownItem/DropdownItem.js +38 -1
- package/components/core/DropdownItem/DropdownItemStyled.js +17 -1
- package/components/core/DropdownItem/constants.js +4 -1
- package/components/core/Form/Form.js +48 -1
- package/components/core/Form/FormStyled.js +16 -1
- package/components/core/Form/constants.js +4 -1
- package/components/core/Form/utils.js +34 -1
- package/components/core/Icon/Icon.js +33 -1
- package/components/core/Icon/constants.js +92 -1
- package/components/core/Image/Image.js +39 -1
- package/components/core/Image/ImageStyled.js +54 -1
- package/components/core/Image/constants.js +4 -1
- package/components/core/InlineNotification/InlineNotification.js +38 -1
- package/components/core/InlineNotification/InlineNotificationStyled.js +29 -1
- package/components/core/InlineNotification/constants.js +21 -1
- package/components/core/Input/Input.js +72 -1
- package/components/core/Input/InputAdornment/InputAdornment.js +18 -1
- package/components/core/Input/InputAdornment/InputAdornmentStyled.js +15 -1
- package/components/core/Input/InputAdornment/constants.js +4 -1
- package/components/core/Input/InputHelper/InputHelper.js +22 -1
- package/components/core/Input/InputHelper/InputHelperStyled.js +17 -1
- package/components/core/Input/InputHelper/constants.js +4 -1
- package/components/core/Input/InputStyled.js +18 -1
- package/components/core/Input/InputWrapper/InputWrapper.js +22 -1
- package/components/core/Input/InputWrapper/InputWrapperStyled.js +21 -1
- package/components/core/Input/InputWrapper/constants.js +5 -1
- package/components/core/Input/constants.js +18 -1
- package/components/core/Input/useInputHandlers.js +31 -1
- package/components/core/InputFile/InputFile.js +40 -1
- package/components/core/InputFile/InputFileStyled.js +27 -1
- package/components/core/InputFile/constants.js +6 -1
- package/components/core/Label/Label.js +27 -1
- package/components/core/Label/LabelStyled.js +17 -1
- package/components/core/Label/constants.js +4 -1
- package/components/core/Link/Link.js +43 -1
- package/components/core/Link/LinkStyled.js +22 -1
- package/components/core/Link/constants.js +4 -1
- package/components/core/List/List.js +45 -1
- package/components/core/List/ListStyled.js +31 -1
- package/components/core/List/constants.js +4 -1
- package/components/core/Loader/Loader.js +28 -1
- package/components/core/Loader/LoaderStyled.js +41 -1
- package/components/core/Loader/constants.js +6 -1
- package/components/core/Loader/utils.js +37 -1
- package/components/core/Menu/Menu.js +100 -1
- package/components/core/Menu/MenuStyled.js +31 -1
- package/components/core/Menu/constants.js +24 -1
- package/components/core/Modal/Modal.js +47 -1
- package/components/core/Modal/ModalStyled.js +76 -1
- package/components/core/Modal/constants.js +4 -1
- package/components/core/Portal/Portal.d.ts +1 -2
- package/components/core/Portal/Portal.js +19 -1
- package/components/core/Portal/index.d.ts +1 -1
- package/components/core/Scroll/Scroll.js +40 -1
- package/components/core/Scroll/ScrollBar.js +68 -1
- package/components/core/Scroll/ScrollStyled.js +56 -1
- package/components/core/Scroll/constants.js +6 -1
- package/components/core/Scroll/utils.js +41 -1
- package/components/core/Select/Select.js +145 -1
- package/components/core/Select/SelectStyled.js +70 -1
- package/components/core/Select/constants.js +5 -1
- package/components/core/Select/hooks/useSelectContext.js +12 -1
- package/components/core/Separator/Separator.js +36 -1
- package/components/core/Separator/SeparatorStyled.js +61 -1
- package/components/core/Separator/constants.js +4 -1
- package/components/core/Skeleton/Skeleton.js +24 -1
- package/components/core/Skeleton/SkeletonStyled.js +28 -1
- package/components/core/Skeleton/constants.js +6 -1
- package/components/core/Slider/Slider.js +35 -1
- package/components/core/Slider/SliderStyled.js +20 -1
- package/components/core/Slider/constants.js +6 -1
- package/components/core/Snackbar/Snackbar.js +46 -1
- package/components/core/Snackbar/SnackbarManager.js +48 -1
- package/components/core/Snackbar/SnackbarStyled.js +109 -5
- package/components/core/Snackbar/constants.js +10 -1
- package/components/core/Switch/Switch.js +36 -1
- package/components/core/Switch/SwitchStyled.js +56 -1
- package/components/core/Switch/constants.js +4 -1
- package/components/core/Textarea/Textarea.js +41 -1
- package/components/core/Textarea/Textarea.types.d.ts +1 -3
- package/components/core/Textarea/Textarea.types.js +6 -1
- package/components/core/Textarea/TextareaStyled.js +29 -1
- package/components/core/Textarea/constants.js +4 -1
- package/components/core/Textarea/hooks/useDynamicHeightAdjustment.js +8 -1
- package/components/core/Textarea/hooks/useResizeObserver.js +24 -1
- package/components/core/Toggle/Toggle.js +37 -1
- package/components/core/Toggle/ToggleStyled.js +18 -1
- package/components/core/Toggle/constants.js +4 -1
- package/components/core/Tooltip/Tooltip.js +40 -1
- package/components/core/Tooltip/Tooltip.types.js +4 -1
- package/components/core/Tooltip/TooltipStyled.js +23 -1
- package/components/core/Tooltip/constants.js +6 -1
- package/components/core/Tooltip/utils.js +64 -1
- package/components/core/Typography/Typography.js +26 -1
- package/components/core/Typography/TypographyStyled.js +32 -1
- package/components/core/Typography/constants.js +4 -1
- package/components/core/Wrapper/Wrapper.js +20 -1
- package/components/core/Wrapper/WrapperStyled.js +23 -1
- package/components/core/Wrapper/constants.js +4 -1
- package/components/core/index.d.ts +1 -1
- package/components/core/types/roles.types.js +4 -1
- package/components/domainSpecific/Accordion/Accordion.js +35 -1
- package/components/domainSpecific/Accordion/AccordionContent/AccordionContent.js +21 -1
- package/components/domainSpecific/Accordion/AccordionHeader/AccordionHeader.js +29 -1
- package/components/domainSpecific/Accordion/AccordionItem/AccordionItem.js +26 -1
- package/components/domainSpecific/Accordion/AccordionStyled.js +39 -1
- package/components/domainSpecific/Accordion/constants.js +7 -1
- package/components/domainSpecific/Accordion/hooks/useAccordion.js +12 -1
- package/components/domainSpecific/Avatar/Avatar.js +44 -1
- package/components/domainSpecific/Avatar/AvatarStyled.js +63 -1
- package/components/domainSpecific/Avatar/constants.js +6 -1
- package/components/domainSpecific/Card/Card.js +47 -1
- package/components/domainSpecific/Card/CardButton/CardButton.js +25 -1
- package/components/domainSpecific/Card/CardButton/CardButtonStyled.js +18 -1
- package/components/domainSpecific/Card/CardButton/constants.js +4 -1
- package/components/domainSpecific/Card/CardCounter/CardCounter.js +26 -1
- package/components/domainSpecific/Card/CardCounter/CardCounterStyled.js +17 -1
- package/components/domainSpecific/Card/CardCounter/constants.js +4 -1
- package/components/domainSpecific/Card/CardDescription/CardDescription.js +24 -1
- package/components/domainSpecific/Card/CardDescription/CardDescriptionStyled.js +24 -1
- package/components/domainSpecific/Card/CardDescription/constants.js +10 -1
- package/components/domainSpecific/Card/CardImage/CardImage.js +26 -1
- package/components/domainSpecific/Card/CardImage/CardImageStyled.js +18 -1
- package/components/domainSpecific/Card/CardImage/constants.js +4 -1
- package/components/domainSpecific/Card/CardPrice/CardPrice.js +22 -1
- package/components/domainSpecific/Card/CardPrice/CardPriceStyled.js +18 -1
- package/components/domainSpecific/Card/CardPrice/constants.js +4 -1
- package/components/domainSpecific/Card/CardRating/CardRating.js +30 -1
- package/components/domainSpecific/Card/CardRating/CardRatingStyled.js +18 -1
- package/components/domainSpecific/Card/CardRating/constants.js +6 -1
- package/components/domainSpecific/Card/CardTitle/CardTitle.js +25 -1
- package/components/domainSpecific/Card/CardTitle/CardTitleStyled.js +24 -1
- package/components/domainSpecific/Card/CardTitle/constants.js +10 -1
- package/components/domainSpecific/Card/CartStyled.js +26 -1
- package/components/domainSpecific/Card/constants.js +4 -1
- package/components/domainSpecific/Carousel/Carousel.js +137 -1
- package/components/domainSpecific/Carousel/Carousel.types.d.ts +1 -12
- package/components/domainSpecific/Carousel/CarouselStyled.js +143 -1
- package/components/domainSpecific/Carousel/constants.js +4 -1
- package/components/domainSpecific/ChatBubble/ChatBubble.js +26 -1
- package/components/domainSpecific/ChatBubble/ChatBubbleStyled.js +43 -1
- package/components/domainSpecific/ChatBubble/constants.js +4 -1
- package/components/domainSpecific/ContentCarousel/ContentCarousel.js +69 -1
- package/components/domainSpecific/ContentCarousel/ContentCarouselStyled.js +32 -1
- package/components/domainSpecific/ContentCarousel/constants.js +4 -1
- package/components/domainSpecific/Counter/Counter.js +55 -1
- package/components/domainSpecific/Counter/CounterStyled.js +27 -1
- package/components/domainSpecific/Counter/constants.js +8 -1
- package/components/domainSpecific/DragAndDropFiles/DragAndDropFiles.js +48 -1
- package/components/domainSpecific/DragAndDropFiles/DragAndDropFilesStyled.js +16 -1
- package/components/domainSpecific/DragAndDropFiles/constants.js +4 -1
- package/components/domainSpecific/DragAndDropFiles/hooks/useDragAndDrop/useDragAndDrop.js +49 -1
- package/components/domainSpecific/Header/Header.js +88 -1
- package/components/domainSpecific/Header/HeaderStyled.js +136 -1
- package/components/domainSpecific/Header/constants.js +4 -1
- package/components/domainSpecific/Price/Price.js +23 -1
- package/components/domainSpecific/Price/PriceStyled.js +42 -1
- package/components/domainSpecific/Price/constants.js +4 -1
- package/components/domainSpecific/ProgressBar/ProgressBar.js +29 -1
- package/components/domainSpecific/ProgressBar/ProgressBarStyled.js +70 -1
- package/components/domainSpecific/ProgressBar/constants.js +7 -1
- package/components/domainSpecific/RadioGroup/RadioGroup.js +54 -1
- package/components/domainSpecific/RadioGroup/RadioGroup.types.js +4 -1
- package/components/domainSpecific/RadioGroup/RadioGroupItem/RadioGroupItem.js +37 -1
- package/components/domainSpecific/RadioGroup/RadioGroupStyled.js +130 -1
- package/components/domainSpecific/RadioGroup/constants.js +5 -1
- package/components/domainSpecific/Rating/Rating.js +63 -1
- package/components/domainSpecific/Rating/RatingStyled.js +61 -1
- package/components/domainSpecific/Rating/constants.js +9 -1
- package/components/domainSpecific/Search/Search.js +58 -1
- package/components/domainSpecific/Search/SearchStyled.js +16 -1
- package/components/domainSpecific/Search/constants.js +7 -1
- package/components/domainSpecific/SearchModal/SearchInput/SearchInput.js +26 -1
- package/components/domainSpecific/SearchModal/SearchInput/SearchInputStyled.js +25 -1
- package/components/domainSpecific/SearchModal/SearchInput/constants.js +6 -1
- package/components/domainSpecific/SearchModal/SearchItems/SearchItems.js +48 -1
- package/components/domainSpecific/SearchModal/SearchItems/SearchItemsStyled.js +82 -1
- package/components/domainSpecific/SearchModal/SearchItems/constants.js +10 -1
- package/components/domainSpecific/SearchModal/SearchItems/utils.js +7 -1
- package/components/domainSpecific/SearchModal/SearchLoader/SearchLoader.js +20 -1
- package/components/domainSpecific/SearchModal/SearchLoader/SearchLoaderStyled.js +14 -1
- package/components/domainSpecific/SearchModal/SearchLoader/constants.js +4 -1
- package/components/domainSpecific/SearchModal/SearchModal.js +39 -1
- package/components/domainSpecific/SearchModal/SearchModalStyled.js +29 -1
- package/components/domainSpecific/SearchModal/constants.js +8 -1
- package/components/domainSpecific/Stepper/Stepper.js +42 -1
- package/components/domainSpecific/Stepper/StepperStyled.js +58 -1
- package/components/domainSpecific/Stepper/constants.js +4 -1
- package/components/domainSpecific/Stepper/utils.js +37 -1
- package/components/domainSpecific/Tabs/Tabs.js +40 -1
- package/components/domainSpecific/Tabs/TabsStyled.js +79 -1
- package/components/domainSpecific/Tabs/constants.js +6 -1
- package/components/index.types.js +4 -1
- package/components/layout/ChatContainer/ChatContainer.js +51 -1
- package/components/layout/ChatContainer/ChatContainer.types.d.ts +1 -6
- package/components/layout/ChatContainer/ChatContainerStyled.js +71 -1
- package/components/layout/ChatContainer/constants.js +4 -1
- package/components/layout/Column/Column.js +26 -1
- package/components/layout/Column/ColumnStyled.js +36 -1
- package/components/layout/Column/constants.js +4 -1
- package/components/layout/FlexContainer/FlexContainer.js +25 -1
- package/components/layout/FlexContainer/FlexContainerStyled.js +27 -1
- package/components/layout/FlexContainer/constants.js +4 -1
- package/components/layout/FlexContainer/utils.js +18 -1
- package/components/layout/Row/Row.js +26 -1
- package/components/layout/Row/RowStyled.js +36 -1
- package/components/layout/Row/constants.js +4 -1
- package/components/templates/SkeletonSearch/SkeletonSearch.js +30 -1
- package/components/templates/SkeletonSearch/SkeletonSearchStyled.js +97 -1
- package/components/templates/SkeletonSearch/constants.js +5 -1
- package/components/widget/DragAndDrop/DragAndDrop.js +74 -1
- package/components/widget/DragAndDrop/DragAndDropStyled.js +61 -1
- package/components/widget/DragAndDrop/constants.js +4 -1
- package/components/widget/DragAndDrop/utils/validators.js +17 -1
- package/constants/keyboard.js +10 -1
- package/constants/positioning.js +12 -1
- package/constants/timers.js +5 -1
- package/hooks/useAutoFocus/useAutoFocus.js +11 -1
- package/hooks/useCarousel/useCarousel.js +61 -1
- package/hooks/useClickOutside/useClickOutside.js +15 -1
- package/hooks/useKeyControls/useKeyControls.js +19 -1
- package/hooks/useMediaQuery/useMediaQuery.js +14 -1
- package/hooks/useTheme/useTheme.js +48 -1
- package/index.js +350 -1
- package/package.json +17 -2
- package/stories/components/TokenViewer/TokenViewer.d.ts +2 -0
- package/stories/components/TokenViewer/TokenViewer.types.d.ts +12 -0
- package/stories/components/TokenViewer/TokenViewerStyled.d.ts +11 -0
- package/stories/components/TokenViewer/index.d.ts +1 -0
- package/tokens/accordion.js +72 -1
- package/tokens/animations.js +63 -1
- package/tokens/avatar.d.ts +22 -15
- package/tokens/avatar.js +153 -1
- package/tokens/borders.js +17 -1
- package/tokens/breadcrumbs.js +37 -1
- package/tokens/breakpoints.d.ts +8 -0
- package/tokens/breakpoints.js +12 -0
- package/tokens/button.js +146 -1
- package/tokens/card.d.ts +5 -1
- package/tokens/card.js +191 -1
- package/tokens/carousel.js +216 -1
- package/tokens/chat.d.ts +4 -0
- package/tokens/chat.js +122 -1
- package/tokens/chatbubble.d.ts +1 -3
- package/tokens/chatbubble.js +75 -1
- package/tokens/colors.js +157 -1
- package/tokens/column.js +9 -1
- package/tokens/constants.js +4 -1
- package/tokens/counter.js +37 -1
- package/tokens/cursors.js +20 -1
- package/tokens/defaultTheme.d.ts +154 -47
- package/tokens/defaultTheme.js +123 -1
- package/tokens/display.js +19 -1
- package/tokens/draganddrop.js +87 -1
- package/tokens/draganddropfiles.js +6 -1
- package/tokens/flexContainer.js +13 -1
- package/tokens/font.js +52 -1
- package/tokens/form.js +6 -1
- package/tokens/header.js +123 -1
- package/tokens/icon.js +32 -1
- package/tokens/image.js +40 -1
- package/tokens/index.d.ts +71 -47
- package/tokens/index.js +145 -1
- package/tokens/inlineNotification.js +75 -1
- package/tokens/input.js +192 -1
- package/tokens/inputfile.js +12 -1
- package/tokens/label.js +9 -1
- package/tokens/link.js +66 -1
- package/tokens/list.js +87 -1
- package/tokens/loader.js +141 -1
- package/tokens/menu.js +19 -1
- package/tokens/modal.js +108 -1
- package/tokens/price.js +32 -1
- package/tokens/progressbar.js +60 -1
- package/tokens/radiogroup.js +103 -2
- package/tokens/radius.js +14 -1
- package/tokens/rating.js +73 -1
- package/tokens/reset.js +4 -1
- package/tokens/row.js +8 -1
- package/tokens/scroll.js +99 -1
- package/tokens/search.js +45 -1
- package/tokens/searchModal.js +159 -1
- package/tokens/select.js +99 -1
- package/tokens/separator.js +63 -1
- package/tokens/shadow.js +25 -1
- package/tokens/skeleton.js +77 -1
- package/tokens/slider.js +45 -1
- package/tokens/snackbar.d.ts +30 -28
- package/tokens/snackbar.js +169 -1
- package/tokens/spacing.js +13 -1
- package/tokens/stepper.js +147 -1
- package/tokens/switch.js +76 -1
- package/tokens/tabs.js +108 -1
- package/tokens/textarea.js +45 -1
- package/tokens/toggle.js +19 -1
- package/tokens/tooltip.js +69 -1
- package/tokens/types/index.types.js +4 -1
- package/tokens/typography.js +134 -1
- package/tokens/utils.d.ts +6 -0
- package/tokens/utils.js +88 -1
- package/tokens/values.js +73 -1
- package/tokens/wrapper.js +34 -1
- package/types/accesability.js +4 -1
- package/types/button.js +7 -1
- package/types/card.js +5 -1
- package/types/carousel.d.ts +12 -1
- package/types/carousel.js +6 -0
- package/types/chat.js +4 -1
- package/types/common.js +5 -1
- package/types/cursors.js +4 -1
- package/types/index.d.ts +1 -0
- package/types/input.js +6 -1
- package/types/label.js +4 -1
- package/types/layout.js +4 -1
- package/types/link.js +5 -1
- package/types/list.js +4 -1
- package/types/separator.js +5 -1
- package/types/skeleton.js +4 -1
- package/types/snackbar.js +5 -1
- package/types/stepper.js +5 -1
- package/types/typography.js +6 -1
- package/types/wrapper.js +4 -1
- package/utils/animationFrame.js +17 -1
- package/utils/common.js +4 -1
- package/utils/date.js +11 -1
- package/utils/focus.js +54 -1
- package/utils/helpers.js +42 -1
- package/utils/layout.js +32 -1
- package/utils/math.js +11 -1
- package/utils/setInRange.js +11 -1
- package/utils/uniqueKeys.js +4 -1
- package/components/domainSpecific/Carousel/Carousel.types.js +0 -1
- package/components/layout/ChatContainer/ChatContainer.types.js +0 -1
- /package/{gd-design-library.css → assets/styles.css} +0 -0
|
@@ -1 +1,19 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import { createPortal as f } from "react-dom";
|
|
5
|
+
import c from "../Wrapper/Wrapper.js";
|
|
6
|
+
import { WrapperVariant as l } from "../../../types/wrapper.js";
|
|
7
|
+
const W = n((t, o) => {
|
|
8
|
+
const {
|
|
9
|
+
children: r,
|
|
10
|
+
container: e,
|
|
11
|
+
wrapperVariant: a = l.FullPage,
|
|
12
|
+
withWrapper: p = !0,
|
|
13
|
+
...i
|
|
14
|
+
} = t;
|
|
15
|
+
return f(p ? /* @__PURE__ */ m(c, { ref: o, variant: a, ...i, children: r }) : r, e || document.body);
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
W as Portal
|
|
19
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './Portal';
|
|
2
2
|
export * from './Portal.types';
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as f, jsx as o } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as z, useState as u, useRef as x, useImperativeHandle as M } from "react";
|
|
4
|
+
import { ScrollStyled as V, ScrollBarsStyled as W, ScrollContentStyled as j } from "./ScrollStyled.js";
|
|
5
|
+
import { ScrollBar as S } from "./ScrollBar.js";
|
|
6
|
+
import { COMPONENT_NAME as i } from "./constants.js";
|
|
7
|
+
import { useTheme as A } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
import { useAnimationFrame as B } from "../../../utils/animationFrame.js";
|
|
9
|
+
const I = z((b, c) => {
|
|
10
|
+
const [s, p] = u(!1), [a, g] = u(!1), t = x(null), {
|
|
11
|
+
theme: e
|
|
12
|
+
} = A(), {
|
|
13
|
+
vertical: w = "auto",
|
|
14
|
+
horizontal: n = "auto",
|
|
15
|
+
children: H,
|
|
16
|
+
...N
|
|
17
|
+
} = b, d = (r, l) => r === "visible" ? !0 : r === "hidden" ? !1 : l;
|
|
18
|
+
return B(() => {
|
|
19
|
+
if (!t.current)
|
|
20
|
+
return;
|
|
21
|
+
const {
|
|
22
|
+
clientHeight: r,
|
|
23
|
+
scrollHeight: l,
|
|
24
|
+
clientWidth: v,
|
|
25
|
+
scrollWidth: y
|
|
26
|
+
} = t.current, h = d(w, Math.ceil(r / l * 100) < 100), m = d(n, Math.ceil(v / y * 100) < 100);
|
|
27
|
+
h !== s && p(h), m !== a && g(m);
|
|
28
|
+
}, 300), M(c, () => t.current, []), /* @__PURE__ */ f(V, { className: "gd-scroll", ref: t, theme: e, ...N, "data-testid": i, children: [
|
|
29
|
+
/* @__PURE__ */ f(W, { className: "gd-scroll--scrollbars", theme: e, "data-testid": `${i}-scrollbars`, children: [
|
|
30
|
+
s && /* @__PURE__ */ o(S, { direction: "vertical", containerRef: t }),
|
|
31
|
+
a && /* @__PURE__ */ o(S, { direction: "horizontal", containerRef: t })
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ o(j, { ref: c, className: "gd-scroll--content", theme: e, style: n === "hidden" ? {
|
|
34
|
+
maxWidth: "100%"
|
|
35
|
+
} : void 0, "data-testid": `${i}-content`, children: H })
|
|
36
|
+
] });
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
I as Scroll
|
|
40
|
+
};
|
|
@@ -1 +1,68 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as T } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { useRef as z, useEffect as A } from "react";
|
|
4
|
+
import { getThumbPosition as H } from "./utils.js";
|
|
5
|
+
import { SCROLL_BAR_ANIMATION_THROTTLE as x, COMPONENT_NAME as $ } from "./constants.js";
|
|
6
|
+
import { ScrollBarStyled as C, ScrollBarThumbStyled as M } from "./ScrollStyled.js";
|
|
7
|
+
import { useTheme as D } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
import { useAnimationFrame as I } from "../../../utils/animationFrame.js";
|
|
9
|
+
const Y = (v) => {
|
|
10
|
+
const {
|
|
11
|
+
direction: o,
|
|
12
|
+
containerRef: t
|
|
13
|
+
} = v, s = z(null), {
|
|
14
|
+
theme: i
|
|
15
|
+
} = D();
|
|
16
|
+
return I(() => {
|
|
17
|
+
const r = t != null && t.current ? H(t.current, o) : {
|
|
18
|
+
position: 0,
|
|
19
|
+
size: 0
|
|
20
|
+
};
|
|
21
|
+
s.current && (o === "vertical" ? (s.current.style.top = `${r.position}%`, s.current.style.height = `${r.size}%`) : (s.current.style.left = `${r.position}%`, s.current.style.width = `${r.size}%`));
|
|
22
|
+
}, x), A(() => {
|
|
23
|
+
const r = s.current;
|
|
24
|
+
if (!r)
|
|
25
|
+
return;
|
|
26
|
+
let u = 0, m = 0;
|
|
27
|
+
const E = ({
|
|
28
|
+
clientY: e
|
|
29
|
+
}, {
|
|
30
|
+
top: n,
|
|
31
|
+
height: l
|
|
32
|
+
}) => (e - n) / l, _ = ({
|
|
33
|
+
clientX: e
|
|
34
|
+
}, {
|
|
35
|
+
left: n,
|
|
36
|
+
width: l
|
|
37
|
+
}) => (e - n) / l, N = (e, n, l) => {
|
|
38
|
+
const a = r.parentElement, c = t == null ? void 0 : t.current;
|
|
39
|
+
if (!a || !c)
|
|
40
|
+
return [0, 0];
|
|
41
|
+
const {
|
|
42
|
+
offsetHeight: h,
|
|
43
|
+
offsetWidth: g
|
|
44
|
+
} = r, {
|
|
45
|
+
top: O,
|
|
46
|
+
left: S,
|
|
47
|
+
height: b,
|
|
48
|
+
width: L
|
|
49
|
+
} = a.getBoundingClientRect(), w = c.scrollHeight - b, y = c.scrollWidth - L, B = (e.clientY - O - h * n) / (b - h), P = (e.clientX - S - g * l) / (L - g);
|
|
50
|
+
return [w * B, y * P];
|
|
51
|
+
}, d = (e) => {
|
|
52
|
+
const [n, l] = N(e, u, m);
|
|
53
|
+
t != null && t.current && (o === "vertical" ? t.current.scrollTop = n : t.current.scrollLeft = l);
|
|
54
|
+
}, p = () => {
|
|
55
|
+
document.removeEventListener("pointermove", d), document.removeEventListener("pointerup", p);
|
|
56
|
+
}, f = (e) => {
|
|
57
|
+
e.stopPropagation(), e.preventDefault();
|
|
58
|
+
const n = r.getBoundingClientRect();
|
|
59
|
+
u = E(e, n), m = _(e, n), document.addEventListener("pointermove", d), document.addEventListener("pointerup", p);
|
|
60
|
+
};
|
|
61
|
+
return r.addEventListener("pointerdown", f), () => {
|
|
62
|
+
r.removeEventListener("pointerdown", f);
|
|
63
|
+
};
|
|
64
|
+
}, [t, s, o]), /* @__PURE__ */ T(C, { className: `gd-scroll--scrollbar gd-scroll--scrollbar__${o}`, $direction: o, theme: i, "data-testid": `${$}-scrollbar_${o}`, children: /* @__PURE__ */ T(M, { className: `gd-scroll--scrollbar-thumb gd-scroll--scrollbar-thumb__${o}`, ref: s, $direction: o, theme: i, "data-testid": `${$}-scrollbar-thumb_${o}` }) });
|
|
65
|
+
};
|
|
66
|
+
export {
|
|
67
|
+
Y as ScrollBar
|
|
68
|
+
};
|
|
@@ -1 +1,56 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as d } from "react";
|
|
4
|
+
import { get as l } from "../../../utils/helpers.js";
|
|
5
|
+
const i = d((e, r) => {
|
|
6
|
+
const {
|
|
7
|
+
theme: {
|
|
8
|
+
scroll: t
|
|
9
|
+
} = {},
|
|
10
|
+
styles: s = {},
|
|
11
|
+
...o
|
|
12
|
+
} = e, c = [l(t, "container.default", {}), s];
|
|
13
|
+
return /* @__PURE__ */ n("div", { css: c, ...o, ref: r });
|
|
14
|
+
}), p = d((e, r) => {
|
|
15
|
+
const {
|
|
16
|
+
theme: {
|
|
17
|
+
scroll: t
|
|
18
|
+
} = {},
|
|
19
|
+
styles: s = {},
|
|
20
|
+
...o
|
|
21
|
+
} = e, c = [l(t, "content.default", {}), s];
|
|
22
|
+
return /* @__PURE__ */ n("div", { css: c, ...o, ref: r });
|
|
23
|
+
}), a = (e) => {
|
|
24
|
+
const {
|
|
25
|
+
theme: {
|
|
26
|
+
scroll: r
|
|
27
|
+
} = {},
|
|
28
|
+
...t
|
|
29
|
+
} = e, s = l(r, "scrollbars.default", {});
|
|
30
|
+
return /* @__PURE__ */ n("div", { css: s, ...t });
|
|
31
|
+
}, f = (e) => {
|
|
32
|
+
const {
|
|
33
|
+
$direction: r,
|
|
34
|
+
theme: {
|
|
35
|
+
scroll: t
|
|
36
|
+
} = {},
|
|
37
|
+
...s
|
|
38
|
+
} = e, o = [l(t, "scrollbar.default", {}), l(t, `scrollbar.${r}`, {})];
|
|
39
|
+
return /* @__PURE__ */ n("div", { css: o, ...s });
|
|
40
|
+
}, y = d((e, r) => {
|
|
41
|
+
const {
|
|
42
|
+
$direction: t,
|
|
43
|
+
theme: {
|
|
44
|
+
scroll: s
|
|
45
|
+
} = {},
|
|
46
|
+
...o
|
|
47
|
+
} = e, c = [l(s, "thumb.default", {}), l(s, `thumb.${t}`, {})];
|
|
48
|
+
return /* @__PURE__ */ n("div", { css: c, ...o, ref: r });
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
f as ScrollBarStyled,
|
|
52
|
+
y as ScrollBarThumbStyled,
|
|
53
|
+
a as ScrollBarsStyled,
|
|
54
|
+
p as ScrollContentStyled,
|
|
55
|
+
i as ScrollStyled
|
|
56
|
+
};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const N = "Scroll", T = 24, o = 50;
|
|
2
|
+
export {
|
|
3
|
+
N as COMPONENT_NAME,
|
|
4
|
+
T as MIN_WIDTH,
|
|
5
|
+
o as SCROLL_BAR_ANIMATION_THROTTLE
|
|
6
|
+
};
|
|
@@ -1 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
import { MIN_WIDTH as c } from "./constants.js";
|
|
2
|
+
function m(e) {
|
|
3
|
+
const {
|
|
4
|
+
clientHeight: t,
|
|
5
|
+
scrollHeight: i
|
|
6
|
+
} = e;
|
|
7
|
+
return t * t / i > c ? 0 : c / t;
|
|
8
|
+
}
|
|
9
|
+
function H(e) {
|
|
10
|
+
const {
|
|
11
|
+
clientWidth: t,
|
|
12
|
+
scrollWidth: i
|
|
13
|
+
} = e;
|
|
14
|
+
return t * t / i > c ? 0 : c / t;
|
|
15
|
+
}
|
|
16
|
+
function d(e, t) {
|
|
17
|
+
const {
|
|
18
|
+
clientHeight: i,
|
|
19
|
+
scrollHeight: o,
|
|
20
|
+
clientWidth: l,
|
|
21
|
+
scrollWidth: n
|
|
22
|
+
} = e, r = t === "vertical" ? i / o : l / n;
|
|
23
|
+
return Math.ceil(r * 100) / 100;
|
|
24
|
+
}
|
|
25
|
+
const W = (e, t) => {
|
|
26
|
+
const {
|
|
27
|
+
scrollTop: i,
|
|
28
|
+
scrollHeight: o,
|
|
29
|
+
clientHeight: l,
|
|
30
|
+
scrollLeft: n,
|
|
31
|
+
scrollWidth: r,
|
|
32
|
+
clientWidth: h
|
|
33
|
+
} = e, u = t === "vertical" ? i / (o - l) : n / (r - h), s = d(e, t), g = (t === "vertical" ? m(e) : H(e)) || s;
|
|
34
|
+
return {
|
|
35
|
+
position: u * (1 - g) * 100,
|
|
36
|
+
size: s * 100
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
W as getThumbPosition
|
|
41
|
+
};
|
|
@@ -1 +1,145 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n, jsxs as D, Fragment as _ } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as Z, useRef as $, useState as K, useEffect as L, useImperativeHandle as ee, isValidElement as te } from "react";
|
|
4
|
+
import { KEYBOARD_KEYS as u } from "../../../constants/keyboard.js";
|
|
5
|
+
import { DropdownItem as re } from "../DropdownItem/DropdownItem.js";
|
|
6
|
+
import { Dropdown as ne } from "../Dropdown/Dropdown.js";
|
|
7
|
+
import { calculateMaxWidth as oe } from "../../layout/FlexContainer/utils.js";
|
|
8
|
+
import { COMPONENT_NAME as f, DEFAULT_SELECTED_VALUE as ie } from "./constants.js";
|
|
9
|
+
import { SelectWrapperStyled as le, InitiatorWrapperStyled as se, DropdownButtonStyled as ae, SelectAdornmentStyled as A, ArrowIconWrapperStyled as ce, DropdownIconStyled as de } from "./SelectStyled.js";
|
|
10
|
+
import { useClickOutside as ue } from "../../../hooks/useClickOutside/useClickOutside.js";
|
|
11
|
+
import { getClosestFocusable as O } from "../../../utils/focus.js";
|
|
12
|
+
import { toNumber as T } from "../../../utils/helpers.js";
|
|
13
|
+
import { useTheme as me } from "../../../hooks/useTheme/useTheme.js";
|
|
14
|
+
import { SelectContext as fe } from "./hooks/useSelectContext.js";
|
|
15
|
+
const pe = Z((P, V) => {
|
|
16
|
+
const {
|
|
17
|
+
onSelect: p,
|
|
18
|
+
children: y,
|
|
19
|
+
initiator: B,
|
|
20
|
+
onInitiatorClick: R,
|
|
21
|
+
renderOption: k,
|
|
22
|
+
dropdownParams: U,
|
|
23
|
+
renderDropdownHeader: h,
|
|
24
|
+
emptyItemsResult: x,
|
|
25
|
+
autoOpen: M = !0,
|
|
26
|
+
width: j = oe(),
|
|
27
|
+
styles: F,
|
|
28
|
+
activeIndex: E,
|
|
29
|
+
value: S,
|
|
30
|
+
onChange: w,
|
|
31
|
+
itemStringifier: H = (e) => String(e),
|
|
32
|
+
itemIdentifier: Y = (e, t) => e === t,
|
|
33
|
+
disabled: r = !1,
|
|
34
|
+
items: c,
|
|
35
|
+
adornmentStart: I,
|
|
36
|
+
adornmentEnd: g
|
|
37
|
+
} = P, {
|
|
38
|
+
theme: o
|
|
39
|
+
} = me(), i = $(null), N = $(null), [d, l] = K(!1), [v, W] = K(S);
|
|
40
|
+
L(() => {
|
|
41
|
+
W(S);
|
|
42
|
+
}, [S]), ue(i, () => l(!1));
|
|
43
|
+
const b = () => {
|
|
44
|
+
if (i.current && !r) {
|
|
45
|
+
const e = O({
|
|
46
|
+
initial: i.current,
|
|
47
|
+
root: i.current,
|
|
48
|
+
keyboard: !0
|
|
49
|
+
});
|
|
50
|
+
e == null || e.focus();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
L(() => {
|
|
54
|
+
const e = (t) => {
|
|
55
|
+
var s;
|
|
56
|
+
if (!(!d || r)) {
|
|
57
|
+
if (t.key === u.ESCAPE)
|
|
58
|
+
t.preventDefault(), l(!1), b();
|
|
59
|
+
else if (t.key === u.TAB && (t.preventDefault(), l(!1), i.current)) {
|
|
60
|
+
const m = document.createElement("div");
|
|
61
|
+
(s = i.current.parentNode) == null || s.insertBefore(m, i.current.nextSibling);
|
|
62
|
+
const a = O({
|
|
63
|
+
initial: m,
|
|
64
|
+
root: document.body,
|
|
65
|
+
keyboard: !0
|
|
66
|
+
});
|
|
67
|
+
m.remove(), a == null || a.focus();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return document.addEventListener("keydown", e), () => {
|
|
72
|
+
document.removeEventListener("keydown", e);
|
|
73
|
+
};
|
|
74
|
+
}, [d, r]), ee(V, () => ({
|
|
75
|
+
ref: i,
|
|
76
|
+
isOpen: d,
|
|
77
|
+
open: () => {
|
|
78
|
+
r || l(!0);
|
|
79
|
+
},
|
|
80
|
+
close: () => l(!1),
|
|
81
|
+
toggle: () => {
|
|
82
|
+
r || l((e) => !e);
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
const q = () => c != null && c.length ? X() : /* @__PURE__ */ n(_, { children: x }), z = {
|
|
86
|
+
onSelect: (e, t) => {
|
|
87
|
+
r || (e.preventDefault(), W(t), w == null || w(t), p == null || p({
|
|
88
|
+
event: e,
|
|
89
|
+
value: t
|
|
90
|
+
}), l(!1), setTimeout(() => {
|
|
91
|
+
b();
|
|
92
|
+
}));
|
|
93
|
+
},
|
|
94
|
+
value: v,
|
|
95
|
+
itemIdentifier: Y
|
|
96
|
+
}, G = (e) => {
|
|
97
|
+
if (!(r || ![u.ARROW_DOWN, u.ARROW_UP].includes(e.key)))
|
|
98
|
+
switch (e.preventDefault(), e.key) {
|
|
99
|
+
case u.ARROW_DOWN:
|
|
100
|
+
C(e, !1);
|
|
101
|
+
break;
|
|
102
|
+
case u.ARROW_UP:
|
|
103
|
+
C(e, !0);
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
}, C = (e, t) => {
|
|
107
|
+
if (r)
|
|
108
|
+
return;
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
const s = N.current;
|
|
111
|
+
if (!s) {
|
|
112
|
+
l(!0);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const m = t ? s.appendChild(document.createElement("div")) : s, a = O({
|
|
116
|
+
initial: m,
|
|
117
|
+
previous: t,
|
|
118
|
+
root: s
|
|
119
|
+
});
|
|
120
|
+
a == null || a.focus();
|
|
121
|
+
}, J = () => {
|
|
122
|
+
!r && M && l(!d);
|
|
123
|
+
}, Q = (e) => {
|
|
124
|
+
r || (R ? R(e) : J());
|
|
125
|
+
}, X = () => /* @__PURE__ */ D(_, { children: [
|
|
126
|
+
h == null ? void 0 : h(o, U),
|
|
127
|
+
c == null ? void 0 : c.map((e, t) => k ? k({
|
|
128
|
+
item: e,
|
|
129
|
+
index: t,
|
|
130
|
+
isActiveItem: E == t,
|
|
131
|
+
className: T(E) === t ? "active" : ""
|
|
132
|
+
}) : /* @__PURE__ */ n(re, { theme: o, value: e.value, name: e.name, customClass: `${T(E) === t ? "active" : ""}`, children: e.name }, `dropdown-item-${e.value}-${t}`))
|
|
133
|
+
] });
|
|
134
|
+
return /* @__PURE__ */ n(fe.Provider, { value: z, children: /* @__PURE__ */ D(le, { ref: i, theme: o, "data-testid": f, styles: F, $disabled: r, children: [
|
|
135
|
+
/* @__PURE__ */ n(se, { theme: o, onClick: Q, onKeyDown: G, width: j, "data-testid": `${f}-initiator-wrapper`, children: B ?? /* @__PURE__ */ n(ae, { theme: o, disabled: r, iconStart: I && /* @__PURE__ */ n(A, { theme: o, children: I }), iconEnd: /* @__PURE__ */ D(A, { theme: o, children: [
|
|
136
|
+
g && /* @__PURE__ */ n(A, { theme: o, children: g }),
|
|
137
|
+
/* @__PURE__ */ n(ce, { theme: o, $isOpen: d, children: /* @__PURE__ */ n(de, { theme: o }) })
|
|
138
|
+
] }), "data-testid": `${f}-initiator`, children: v ? H(v) : /* @__PURE__ */ n("span", { children: ie }) }) }),
|
|
139
|
+
d && !r && /* @__PURE__ */ n(ne, { "data-testid": `${f}-dropdown`, ref: N, children: Array.isArray(y) || te(y) ? y : q() })
|
|
140
|
+
] }) });
|
|
141
|
+
});
|
|
142
|
+
pe.displayName = f;
|
|
143
|
+
export {
|
|
144
|
+
pe as Select
|
|
145
|
+
};
|
|
@@ -1 +1,70 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import { get as o } from "../../../utils/helpers.js";
|
|
5
|
+
import { Button as d } from "../Button/Button.js";
|
|
6
|
+
import { Icon as l } from "../Icon/Icon.js";
|
|
7
|
+
const I = a((r, t) => {
|
|
8
|
+
const {
|
|
9
|
+
theme: {
|
|
10
|
+
select: e
|
|
11
|
+
} = {},
|
|
12
|
+
styles: n = {},
|
|
13
|
+
$disabled: c,
|
|
14
|
+
...p
|
|
15
|
+
} = r;
|
|
16
|
+
return /* @__PURE__ */ s("div", { css: [o(e, "default", {}), c ? o(e, "disabled", {}) : {}, n], ...p, ref: t });
|
|
17
|
+
}), S = (r) => {
|
|
18
|
+
const {
|
|
19
|
+
theme: {
|
|
20
|
+
select: t
|
|
21
|
+
} = {},
|
|
22
|
+
width: e,
|
|
23
|
+
...n
|
|
24
|
+
} = r;
|
|
25
|
+
return /* @__PURE__ */ s("div", { css: [o(t, "initiatorWrapper", {}), e ? {
|
|
26
|
+
width: e
|
|
27
|
+
} : {}], ...n });
|
|
28
|
+
}, h = (r) => {
|
|
29
|
+
const {
|
|
30
|
+
theme: {
|
|
31
|
+
select: t
|
|
32
|
+
} = {},
|
|
33
|
+
$isOpen: e,
|
|
34
|
+
...n
|
|
35
|
+
} = r;
|
|
36
|
+
return /* @__PURE__ */ s("div", { css: [o(t, "arrowIconWrapper.default", {}), e ? o(t, "arrowIconWrapper.transform.open", {}) : o(t, "arrowIconWrapper.transform.close", {})], ...n });
|
|
37
|
+
}, y = (r) => {
|
|
38
|
+
const {
|
|
39
|
+
theme: {
|
|
40
|
+
select: t
|
|
41
|
+
} = {}
|
|
42
|
+
} = r;
|
|
43
|
+
return /* @__PURE__ */ s(l, { ...o(t, "arrowIcon", {
|
|
44
|
+
name: "arrowDown"
|
|
45
|
+
}) });
|
|
46
|
+
}, W = (r) => {
|
|
47
|
+
const {
|
|
48
|
+
theme: {
|
|
49
|
+
select: t
|
|
50
|
+
} = {},
|
|
51
|
+
...e
|
|
52
|
+
} = r;
|
|
53
|
+
return /* @__PURE__ */ s(d, { css: [o(t, "button.default", {})], ...o(t, "button.attrs", {}), ...e });
|
|
54
|
+
}, P = (r) => {
|
|
55
|
+
const {
|
|
56
|
+
theme: {
|
|
57
|
+
select: t
|
|
58
|
+
} = {},
|
|
59
|
+
...e
|
|
60
|
+
} = r;
|
|
61
|
+
return /* @__PURE__ */ s("div", { css: [o(t, "adornment.default", {})], ...e });
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
h as ArrowIconWrapperStyled,
|
|
65
|
+
W as DropdownButtonStyled,
|
|
66
|
+
y as DropdownIconStyled,
|
|
67
|
+
S as InitiatorWrapperStyled,
|
|
68
|
+
P as SelectAdornmentStyled,
|
|
69
|
+
I as SelectWrapperStyled
|
|
70
|
+
};
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as t, useContext as o } from "react";
|
|
3
|
+
const n = t(void 0), r = () => {
|
|
4
|
+
const e = o(n);
|
|
5
|
+
if (!e)
|
|
6
|
+
throw new Error("useSelectContext must be used within a Select component or children");
|
|
7
|
+
return e;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
n as SelectContext,
|
|
11
|
+
r as useSelectContext
|
|
12
|
+
};
|
|
@@ -1 +1,36 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as $, jsx as t, Fragment as N } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as P } from "react";
|
|
4
|
+
import { COMPONENT_NAME as h } from "./constants.js";
|
|
5
|
+
import { SeparatorWrapperStyled as g, SeparatorLabelStyled as c, SeparatorLineStyled as d } from "./SeparatorStyled.js";
|
|
6
|
+
import { SeparatorLabelPosition as a } from "../../../types/separator.js";
|
|
7
|
+
import { useTheme as u } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
const v = P((b, S) => {
|
|
9
|
+
const {
|
|
10
|
+
styles: f = {},
|
|
11
|
+
label: o,
|
|
12
|
+
labelPosition: l = a.Center,
|
|
13
|
+
size: r,
|
|
14
|
+
variant: m,
|
|
15
|
+
orientation: i,
|
|
16
|
+
length: C,
|
|
17
|
+
color: p,
|
|
18
|
+
labelColor: n,
|
|
19
|
+
...L
|
|
20
|
+
} = b, {
|
|
21
|
+
theme: e
|
|
22
|
+
} = u(), s = !!o, z = s && l === a.Start, y = s && l === a.Center, E = s && l === a.End;
|
|
23
|
+
return /* @__PURE__ */ $(g, { theme: e, styles: f, ref: S, "data-testid": h, $orientation: i, $length: C, ...L, children: [
|
|
24
|
+
z && /* @__PURE__ */ t(c, { theme: e, $size: r, $labelColor: n, children: o }),
|
|
25
|
+
/* @__PURE__ */ t(d, { theme: e, $color: p, $size: r, $variant: m, $orientation: i }),
|
|
26
|
+
y && /* @__PURE__ */ $(N, { children: [
|
|
27
|
+
/* @__PURE__ */ t(c, { theme: e, $size: r, $labelColor: n, children: o }),
|
|
28
|
+
/* @__PURE__ */ t(d, { theme: e, $color: p, $size: r, $variant: m, $orientation: i })
|
|
29
|
+
] }),
|
|
30
|
+
E && /* @__PURE__ */ t(c, { theme: e, $size: r, $labelColor: n, children: o })
|
|
31
|
+
] });
|
|
32
|
+
});
|
|
33
|
+
v.displayName = h;
|
|
34
|
+
export {
|
|
35
|
+
v as Separator
|
|
36
|
+
};
|
|
@@ -1 +1,61 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as y } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as x } from "react";
|
|
4
|
+
import { TypographyStyled as H } from "../Typography/TypographyStyled.js";
|
|
5
|
+
import { SeparatorVariant as L } from "../../../types/separator.js";
|
|
6
|
+
import { Orientation as c, SizeVariant as V } from "../../../types/common.js";
|
|
7
|
+
import { getBoxStyles as k } from "../../../tokens/utils.js";
|
|
8
|
+
import { get as t } from "../../../utils/helpers.js";
|
|
9
|
+
const B = x((i, e) => {
|
|
10
|
+
const {
|
|
11
|
+
theme: {
|
|
12
|
+
separator: r
|
|
13
|
+
} = {},
|
|
14
|
+
styles: o = {},
|
|
15
|
+
$orientation: s = c.Horizontal,
|
|
16
|
+
$length: a,
|
|
17
|
+
...n
|
|
18
|
+
} = i, p = {
|
|
19
|
+
[s === c.Horizontal ? "width" : "height"]: a
|
|
20
|
+
}, {
|
|
21
|
+
boxStyles: d,
|
|
22
|
+
restProps: m
|
|
23
|
+
} = k(n), S = [t(r, "default", {}), t(r, s, {}), a ? p : {}, d, o];
|
|
24
|
+
return /* @__PURE__ */ y("div", { css: S, ...m, ref: e });
|
|
25
|
+
}), O = (i) => {
|
|
26
|
+
var $, f;
|
|
27
|
+
const {
|
|
28
|
+
theme: {
|
|
29
|
+
separator: e,
|
|
30
|
+
colors: r,
|
|
31
|
+
values: o
|
|
32
|
+
} = {},
|
|
33
|
+
styles: s = {},
|
|
34
|
+
$as: a = "div",
|
|
35
|
+
$orientation: n = c.Horizontal,
|
|
36
|
+
$color: l = t(r, "border.default", ""),
|
|
37
|
+
$size: p = V.Sm,
|
|
38
|
+
$variant: d = L.Solid,
|
|
39
|
+
...m
|
|
40
|
+
} = i, S = t(o, `separator.thickness.${p}`, (f = ($ = o == null ? void 0 : o.separator) == null ? void 0 : $.thickness) == null ? void 0 : f.sm), b = t(r, l, l), u = `${S} ${d} ${b}`, h = n === c.Horizontal ? "borderTop" : "borderLeft", z = {
|
|
41
|
+
...t(e, `line.${n}`, {}),
|
|
42
|
+
[h]: u
|
|
43
|
+
}, g = [t(e, "line.default", {}), z, s];
|
|
44
|
+
return /* @__PURE__ */ y(a, { css: g, ...m });
|
|
45
|
+
}, R = (i) => {
|
|
46
|
+
const {
|
|
47
|
+
theme: {
|
|
48
|
+
separator: e,
|
|
49
|
+
colors: r
|
|
50
|
+
} = {},
|
|
51
|
+
$labelColor: o = t(r, "text.caption"),
|
|
52
|
+
$size: s,
|
|
53
|
+
children: a
|
|
54
|
+
} = i, n = t(e, "label.default", {}), l = t(e, `label.attrs.${s}`, {});
|
|
55
|
+
return /* @__PURE__ */ y(H, { css: n, ...l, $color: o, children: a });
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
R as SeparatorLabelStyled,
|
|
59
|
+
O as SeparatorLineStyled,
|
|
60
|
+
B as SeparatorWrapperStyled
|
|
61
|
+
};
|