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,24 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as f } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as h } from "react";
|
|
4
|
+
import { BASE_ANIMATION as p, COMPONENT_NAME as N } from "./constants.js";
|
|
5
|
+
import { SkeletonStyled as l } from "./SkeletonStyled.js";
|
|
6
|
+
import { SkeletonVariant as c } from "../../../types/skeleton.js";
|
|
7
|
+
import { useTheme as S } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
const M = h((t, o) => {
|
|
9
|
+
const {
|
|
10
|
+
variant: e = c.Rounded,
|
|
11
|
+
children: r,
|
|
12
|
+
animationName: i,
|
|
13
|
+
animationProps: n = p,
|
|
14
|
+
width: m,
|
|
15
|
+
height: a,
|
|
16
|
+
...s
|
|
17
|
+
} = t, {
|
|
18
|
+
theme: d
|
|
19
|
+
} = S();
|
|
20
|
+
return /* @__PURE__ */ f(l, { ref: o, theme: d, $width: m, $height: a, $variant: e, $animationName: i, $animationProps: n, "data-testid": N, ...s, children: r });
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
M as Skeleton
|
|
24
|
+
};
|
|
@@ -1 +1,28 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as S } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as $ } from "react";
|
|
4
|
+
import { convertJsonToCssKeyframeCss as k, getBoxStyles as x } from "../../../tokens/utils.js";
|
|
5
|
+
import { SkeletonVariant as K } from "../../../types/skeleton.js";
|
|
6
|
+
import { get as t } from "../../../utils/helpers.js";
|
|
7
|
+
const P = $((a, r) => {
|
|
8
|
+
const {
|
|
9
|
+
theme: {
|
|
10
|
+
skeleton: o,
|
|
11
|
+
animations: m
|
|
12
|
+
} = {},
|
|
13
|
+
$variant: i = K.Rounded,
|
|
14
|
+
styles: l = {},
|
|
15
|
+
$animationName: e = "blinkKeyframes",
|
|
16
|
+
$animationProps: f,
|
|
17
|
+
...c
|
|
18
|
+
} = a, n = t(m, e ?? "", null), s = n ? k(n) : e, p = {
|
|
19
|
+
animation: `${s} ${f}`
|
|
20
|
+
}, {
|
|
21
|
+
boxStyles: y,
|
|
22
|
+
restProps: d
|
|
23
|
+
} = x(c), u = [t(o, "default", {}), t(o, i, {}), y, s ? p : {}, l];
|
|
24
|
+
return /* @__PURE__ */ S("span", { css: u, ...d, ref: r });
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
P as SkeletonStyled
|
|
28
|
+
};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { BASE_ANIMATION_MS as A, BASE_ANIMATION_DELAY_MS as N } from "../../../constants/timers.js";
|
|
2
|
+
const t = "Skeleton", M = `${A}ms ease-in-out ${N}ms infinite`;
|
|
3
|
+
export {
|
|
4
|
+
M as BASE_ANIMATION,
|
|
5
|
+
t as COMPONENT_NAME
|
|
6
|
+
};
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as v } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as _, useState as A, useEffect as L } from "react";
|
|
4
|
+
import { SLIDER_MIN_VALUE_DEFAULT as N, SLIDER_MAX_VALUE_DEFAULT as S, COMPONENT_NAME as n } from "./constants.js";
|
|
5
|
+
import { StyledSlider as R } from "./SliderStyled.js";
|
|
6
|
+
import { setInRange as V } from "../../../utils/setInRange.js";
|
|
7
|
+
import { useTheme as g } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
const h = _((s, u) => {
|
|
9
|
+
const {
|
|
10
|
+
min: e = N,
|
|
11
|
+
max: a = S,
|
|
12
|
+
value: r,
|
|
13
|
+
onChange: t,
|
|
14
|
+
disabled: i,
|
|
15
|
+
...d
|
|
16
|
+
} = s, {
|
|
17
|
+
theme: f
|
|
18
|
+
} = g(), [o, l] = A(r || e);
|
|
19
|
+
L(() => {
|
|
20
|
+
r !== void 0 && l(r);
|
|
21
|
+
}, [r]);
|
|
22
|
+
const c = (E) => {
|
|
23
|
+
const m = V({
|
|
24
|
+
min: e,
|
|
25
|
+
max: a,
|
|
26
|
+
value: Number(E.target.value)
|
|
27
|
+
});
|
|
28
|
+
l(m), t == null || t(m);
|
|
29
|
+
}, p = a > e ? (o - e) / (a - e) : e;
|
|
30
|
+
return /* @__PURE__ */ v(R, { "data-testid": n, type: "range", role: "slider", min: e, max: a, value: o, disabled: i, theme: f, fillRatio: p, onChange: c, "aria-valuenow": o, "aria-valuemin": e, "aria-valuemax": a, "aria-disabled": i, ref: u, ...d });
|
|
31
|
+
});
|
|
32
|
+
h.displayName = n;
|
|
33
|
+
export {
|
|
34
|
+
h as Slider
|
|
35
|
+
};
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as f } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as d } from "react";
|
|
4
|
+
import { get as m } from "../../../utils/helpers.js";
|
|
5
|
+
const u = d((t, e) => {
|
|
6
|
+
const {
|
|
7
|
+
theme: {
|
|
8
|
+
slider: r
|
|
9
|
+
} = {},
|
|
10
|
+
fillRatio: o,
|
|
11
|
+
styles: s = {},
|
|
12
|
+
...i
|
|
13
|
+
} = t, l = [m(r, "default", {}), {
|
|
14
|
+
"--gd-slider-fill-ratio": o
|
|
15
|
+
}, s];
|
|
16
|
+
return /* @__PURE__ */ f("input", { css: l, ...i, ref: e });
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
u as StyledSlider
|
|
20
|
+
};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const E = 0, _ = 100, A = "Slider";
|
|
2
|
+
export {
|
|
3
|
+
A as COMPONENT_NAME,
|
|
4
|
+
_ as SLIDER_MAX_VALUE_DEFAULT,
|
|
5
|
+
E as SLIDER_MIN_VALUE_DEFAULT
|
|
6
|
+
};
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as o, jsx as t } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as T, useState as b, useCallback as A, useEffect as I } from "react";
|
|
4
|
+
import { DEFAULT_VARIANT as N, ANIMATION_DURATION as v, COMPONENT_NAME as O } from "./constants.js";
|
|
5
|
+
import { SnackbarStyled as $, CloseButtonWrapperStyled as g, CloseButtonIconStyled as x, SnackbarBodyStyled as B, SnackbarIconStyled as E, SnackbarContentStyled as D, SnackbarTitleStyled as M, SnackbarDescriptionStyled as R, SnackbarActionsContainerStyled as _ } from "./SnackbarStyled.js";
|
|
6
|
+
import { useTheme as j } from "../../../hooks/useTheme/useTheme.js";
|
|
7
|
+
import { convertToInlineBoxStyles as P } from "../../../tokens/utils.js";
|
|
8
|
+
const q = T((d, m) => {
|
|
9
|
+
const {
|
|
10
|
+
title: S,
|
|
11
|
+
message: a,
|
|
12
|
+
variant: l = N,
|
|
13
|
+
isAnimated: u = !0,
|
|
14
|
+
duration: i,
|
|
15
|
+
onClose: r,
|
|
16
|
+
action: s,
|
|
17
|
+
colored: f = !1,
|
|
18
|
+
dismissOnClick: C = !0,
|
|
19
|
+
icon: k,
|
|
20
|
+
...p
|
|
21
|
+
} = d, {
|
|
22
|
+
theme: e
|
|
23
|
+
} = j(), [c, h] = b(!1), n = A(() => {
|
|
24
|
+
h(!0), setTimeout(() => r == null ? void 0 : r(), v);
|
|
25
|
+
}, []);
|
|
26
|
+
return I(() => {
|
|
27
|
+
if (!i) return;
|
|
28
|
+
const y = setTimeout(() => {
|
|
29
|
+
n();
|
|
30
|
+
}, i);
|
|
31
|
+
return () => clearTimeout(y);
|
|
32
|
+
}, [i]), /* @__PURE__ */ o($, { ref: m, $variant: l, $colored: f, $isClosing: c, $isAnimated: u, onClick: C ? n : void 0, theme: e, role: "alert", "aria-live": "polite", "aria-hidden": c, "data-testid": O, ...P(p), children: [
|
|
33
|
+
r && /* @__PURE__ */ t(g, { theme: e, onClick: n, "aria-label": "Close notification", children: /* @__PURE__ */ t(x, { theme: e }) }),
|
|
34
|
+
/* @__PURE__ */ o(B, { theme: e, children: [
|
|
35
|
+
k || /* @__PURE__ */ t(E, { theme: e, $variant: l }),
|
|
36
|
+
/* @__PURE__ */ o(D, { theme: e, children: [
|
|
37
|
+
/* @__PURE__ */ t(M, { children: S }),
|
|
38
|
+
a && /* @__PURE__ */ t(R, { children: a }),
|
|
39
|
+
s && /* @__PURE__ */ t(_, { theme: e, children: s })
|
|
40
|
+
] })
|
|
41
|
+
] })
|
|
42
|
+
] });
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
q as Snackbar
|
|
46
|
+
};
|
|
@@ -1 +1,48 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { useState as a, useEffect as l, useMemo as S } from "react";
|
|
4
|
+
import { v4 as A } from "uuid";
|
|
5
|
+
import { SnackbarContainerStyled as h } from "./SnackbarStyled.js";
|
|
6
|
+
import { Snackbar as E } from "./Snackbar.js";
|
|
7
|
+
import { DEFAULT_DURATION as N, DEFAULT_POSITION as p, DEFAULT_VARIANT as T, COMPONENT_SNACKBAR_MANAGER_NAME as b } from "./constants.js";
|
|
8
|
+
import { get as O } from "../../../utils/helpers.js";
|
|
9
|
+
import { useTheme as _ } from "../../../hooks/useTheme/useTheme.js";
|
|
10
|
+
import { Portal as C } from "../Portal/Portal.js";
|
|
11
|
+
let i = [];
|
|
12
|
+
const s = [], d = () => {
|
|
13
|
+
s.forEach((e) => e(i));
|
|
14
|
+
}, M = (e) => {
|
|
15
|
+
const c = {
|
|
16
|
+
id: O(e, "id", A()),
|
|
17
|
+
variant: T,
|
|
18
|
+
position: p,
|
|
19
|
+
duration: N,
|
|
20
|
+
...e
|
|
21
|
+
};
|
|
22
|
+
i = [...i, c].slice(-50), d();
|
|
23
|
+
}, g = (e) => {
|
|
24
|
+
i = i.filter((n) => n.id !== e), d();
|
|
25
|
+
}, v = (e) => M(e), y = () => {
|
|
26
|
+
const {
|
|
27
|
+
theme: e
|
|
28
|
+
} = _(), [n, c] = a(i);
|
|
29
|
+
l(() => {
|
|
30
|
+
const o = (r) => c(r);
|
|
31
|
+
return s.push(o), () => {
|
|
32
|
+
const r = s.indexOf(o);
|
|
33
|
+
r > -1 && s.splice(r, 1);
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
const f = S(() => n.reduce((o, r) => {
|
|
37
|
+
const t = r.position || p;
|
|
38
|
+
return o[t] = o[t] || [], o[t].push(r), o;
|
|
39
|
+
}, {}), [n]);
|
|
40
|
+
return n.length ? /* @__PURE__ */ m(C, { withWrapper: !1, "data-testid": b, children: Object.entries(f).map(([o, r]) => /* @__PURE__ */ m(h, { theme: e, $position: o, children: r.map((t) => /* @__PURE__ */ m(E, { ...t, onClose: () => {
|
|
41
|
+
var u;
|
|
42
|
+
(u = t.onClose) == null || u.call(t), g(t.id);
|
|
43
|
+
} }, t.id)) }, o)) }) : null;
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
y as SnackbarManager,
|
|
47
|
+
v as showSnackbar
|
|
48
|
+
};
|
|
@@ -1,5 +1,109 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as O } from "react";
|
|
4
|
+
import { convertJsonToCssKeyframeCss as S, getBoxStyles as j } from "../../../tokens/utils.js";
|
|
5
|
+
import { Typography as p } from "../Typography/Typography.js";
|
|
6
|
+
import { get as r } from "../../../utils/helpers.js";
|
|
7
|
+
import { Icon as b } from "../Icon/Icon.js";
|
|
8
|
+
import { TypographyStyleVariant as k, TypographyVariant as f, TextAlign as g } from "../../../types/typography.js";
|
|
9
|
+
const G = O((n, o) => {
|
|
10
|
+
var l, m, y, u;
|
|
11
|
+
const {
|
|
12
|
+
theme: {
|
|
13
|
+
animations: t,
|
|
14
|
+
snackbar: s
|
|
15
|
+
} = {},
|
|
16
|
+
$variant: a,
|
|
17
|
+
$colored: $,
|
|
18
|
+
$isClosing: v,
|
|
19
|
+
$isAnimated: h,
|
|
20
|
+
styles: C,
|
|
21
|
+
...B
|
|
22
|
+
} = n, A = S(t == null ? void 0 : t.slideIn), T = S(t == null ? void 0 : t.slideOut), {
|
|
23
|
+
boxStyles: x,
|
|
24
|
+
restProps: I
|
|
25
|
+
} = j(B), c = (m = (l = s == null ? void 0 : s.snackbar) == null ? void 0 : l.animation) == null ? void 0 : m.duration, i = (u = (y = s == null ? void 0 : s.snackbar) == null ? void 0 : y.animation) == null ? void 0 : u.timing, P = `
|
|
26
|
+
${T} ${c} ${i} forwards
|
|
27
|
+
`, V = `
|
|
28
|
+
${A} ${c} ${i}
|
|
29
|
+
`, d = r(s, "snackbar.background.default"), w = r(s, "snackbar.default", {}), N = {
|
|
30
|
+
background: $ ? r(s, `snackbar.background.variants.${a}`, d) : d
|
|
31
|
+
};
|
|
32
|
+
return /* @__PURE__ */ e("div", { css: [h ? {
|
|
33
|
+
animation: {
|
|
34
|
+
animation: v ? P : V
|
|
35
|
+
}
|
|
36
|
+
} : {}, w, N, x, C], ...I, ref: o });
|
|
37
|
+
}), H = (n) => {
|
|
38
|
+
const {
|
|
39
|
+
theme: {
|
|
40
|
+
snackbar: o
|
|
41
|
+
} = {},
|
|
42
|
+
...t
|
|
43
|
+
} = n;
|
|
44
|
+
return /* @__PURE__ */ e("div", { css: r(o, "closeButton", {}), ...t });
|
|
45
|
+
}, L = (n) => {
|
|
46
|
+
const {
|
|
47
|
+
theme: {
|
|
48
|
+
snackbar: o
|
|
49
|
+
} = {}
|
|
50
|
+
} = n, t = r(o, "icons.close", {
|
|
51
|
+
name: "cross"
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ e(b, { ...t });
|
|
54
|
+
}, M = (n) => {
|
|
55
|
+
const {
|
|
56
|
+
$variant: o,
|
|
57
|
+
theme: {
|
|
58
|
+
snackbar: t
|
|
59
|
+
} = {}
|
|
60
|
+
} = n, s = r(t, ["icons", o], {
|
|
61
|
+
name: ""
|
|
62
|
+
});
|
|
63
|
+
return /* @__PURE__ */ e(b, { ...s });
|
|
64
|
+
}, Q = (n) => {
|
|
65
|
+
const {
|
|
66
|
+
theme: {
|
|
67
|
+
snackbar: o
|
|
68
|
+
} = {},
|
|
69
|
+
...t
|
|
70
|
+
} = n;
|
|
71
|
+
return /* @__PURE__ */ e("div", { css: r(o, "snackbarBody", {}), ...t });
|
|
72
|
+
}, U = (n) => {
|
|
73
|
+
const {
|
|
74
|
+
theme: {
|
|
75
|
+
snackbar: o
|
|
76
|
+
} = {},
|
|
77
|
+
...t
|
|
78
|
+
} = n;
|
|
79
|
+
return /* @__PURE__ */ e("div", { css: r(o, "snackbarContent", {}), ...t });
|
|
80
|
+
}, X = (n) => /* @__PURE__ */ e(p, { align: g.Start, variant: f.Body2, styleVariant: k.Semibold, ...n }), Y = (n) => /* @__PURE__ */ e(p, { align: g.Start, variant: f.Body2, styleVariant: k.Normal, ...n }), Z = (n) => {
|
|
81
|
+
const {
|
|
82
|
+
theme: {
|
|
83
|
+
snackbar: o
|
|
84
|
+
} = {},
|
|
85
|
+
...t
|
|
86
|
+
} = n;
|
|
87
|
+
return /* @__PURE__ */ e("div", { css: r(o, "actionsContainer", {}), ...t });
|
|
88
|
+
}, _ = (n) => {
|
|
89
|
+
const {
|
|
90
|
+
theme: {
|
|
91
|
+
snackbar: o
|
|
92
|
+
} = {},
|
|
93
|
+
$position: t,
|
|
94
|
+
...s
|
|
95
|
+
} = n, a = [r(o, "container.default", {}), r(o, ["positions", t], {})];
|
|
96
|
+
return /* @__PURE__ */ e("div", { css: a, ...s });
|
|
97
|
+
};
|
|
98
|
+
export {
|
|
99
|
+
L as CloseButtonIconStyled,
|
|
100
|
+
H as CloseButtonWrapperStyled,
|
|
101
|
+
Z as SnackbarActionsContainerStyled,
|
|
102
|
+
Q as SnackbarBodyStyled,
|
|
103
|
+
_ as SnackbarContainerStyled,
|
|
104
|
+
U as SnackbarContentStyled,
|
|
105
|
+
Y as SnackbarDescriptionStyled,
|
|
106
|
+
M as SnackbarIconStyled,
|
|
107
|
+
G as SnackbarStyled,
|
|
108
|
+
X as SnackbarTitleStyled
|
|
109
|
+
};
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { SnackbarPosition as A, SnackbarVariant as n } from "../../../types/snackbar.js";
|
|
2
|
+
const N = "Snackbar", t = "Snackbar-manager", a = n.Info, c = A.BottomRight, T = 3e3, r = 300;
|
|
3
|
+
export {
|
|
4
|
+
r as ANIMATION_DURATION,
|
|
5
|
+
N as COMPONENT_NAME,
|
|
6
|
+
t as COMPONENT_SNACKBAR_MANAGER_NAME,
|
|
7
|
+
T as DEFAULT_DURATION,
|
|
8
|
+
c as DEFAULT_POSITION,
|
|
9
|
+
a as DEFAULT_VARIANT
|
|
10
|
+
};
|
|
@@ -1 +1,36 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as f, jsx as c } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as u, useState as $, useCallback as n, useEffect as x } from "react";
|
|
4
|
+
import { COMPONENT_NAME as d } from "./constants.js";
|
|
5
|
+
import { SwitchWrapperStyled as y, SwitchLabelStyled as N, SwitchStyled as g, SwitchSliderStyled as C, HiddenCheckboxStyled as E } from "./SwitchStyled.js";
|
|
6
|
+
import { LabelPosition as j } from "../../../types/label.js";
|
|
7
|
+
import { useTheme as I } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
const A = u((p, S) => {
|
|
9
|
+
const {
|
|
10
|
+
onValueChange: a,
|
|
11
|
+
checked: s = !1,
|
|
12
|
+
disabled: r = !1,
|
|
13
|
+
label: b = j.Right,
|
|
14
|
+
children: w,
|
|
15
|
+
...i
|
|
16
|
+
} = p, {
|
|
17
|
+
theme: t
|
|
18
|
+
} = I(), [l, o] = $(s), h = n((e) => {
|
|
19
|
+
o(e), a == null || a(e);
|
|
20
|
+
}, [a]), k = n((e) => {
|
|
21
|
+
var m;
|
|
22
|
+
r || h((m = e == null ? void 0 : e.target) == null ? void 0 : m.checked);
|
|
23
|
+
}, [r, h]);
|
|
24
|
+
return x(() => {
|
|
25
|
+
o(s);
|
|
26
|
+
}, [s]), /* @__PURE__ */ f(y, { theme: t, ref: S, $disabled: r, "data-testid": `${d}-wrapper`, ...i, children: [
|
|
27
|
+
/* @__PURE__ */ c(N, { className: "gd-switch-label", theme: t, $label: b, "data-testid": `${d}-label`, children: w }),
|
|
28
|
+
/* @__PURE__ */ f(g, { "data-testid": d, theme: t, children: [
|
|
29
|
+
/* @__PURE__ */ c(C, { className: "gd-switch-slider", theme: t, $checked: l, "data-testid": `${d}-slider` }),
|
|
30
|
+
/* @__PURE__ */ c(E, { theme: t, checked: l, disabled: r, onChange: k, "data-testid": `${d}-checkbox`, ...i })
|
|
31
|
+
] })
|
|
32
|
+
] });
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
A as Switch
|
|
36
|
+
};
|
|
@@ -1 +1,56 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import { get as r } from "../../../utils/helpers.js";
|
|
5
|
+
const a = (s) => {
|
|
6
|
+
const {
|
|
7
|
+
theme: {
|
|
8
|
+
switchToken: e
|
|
9
|
+
} = {},
|
|
10
|
+
...t
|
|
11
|
+
} = s, c = r(e, "checkbox", {});
|
|
12
|
+
return /* @__PURE__ */ o("input", { type: "checkbox", css: c, ...t });
|
|
13
|
+
}, m = n((s, e) => {
|
|
14
|
+
const {
|
|
15
|
+
theme: {
|
|
16
|
+
switchToken: t
|
|
17
|
+
} = {},
|
|
18
|
+
styles: c = {},
|
|
19
|
+
$disabled: l,
|
|
20
|
+
...d
|
|
21
|
+
} = s;
|
|
22
|
+
return /* @__PURE__ */ o("div", { css: [r(t, "wrapper.default", {}), l ? r(t, "wrapper.disabled", {}) : {}, c], ...d, ref: e });
|
|
23
|
+
}), u = (s) => {
|
|
24
|
+
const {
|
|
25
|
+
theme: {
|
|
26
|
+
switchToken: e
|
|
27
|
+
} = {},
|
|
28
|
+
$label: t,
|
|
29
|
+
...c
|
|
30
|
+
} = s;
|
|
31
|
+
return /* @__PURE__ */ o("div", { css: [r(e, "label.default", {}), r(e, ["label", t], {})], ...c });
|
|
32
|
+
}, w = (s) => {
|
|
33
|
+
const {
|
|
34
|
+
theme: {
|
|
35
|
+
switchToken: e
|
|
36
|
+
} = {},
|
|
37
|
+
$checked: t,
|
|
38
|
+
...c
|
|
39
|
+
} = s;
|
|
40
|
+
return /* @__PURE__ */ o("div", { css: [r(e, "slider.default", {}), t ? r(e, "slider.checked", {}) : {}], ...c });
|
|
41
|
+
}, S = (s) => {
|
|
42
|
+
const {
|
|
43
|
+
theme: {
|
|
44
|
+
switchToken: e
|
|
45
|
+
} = {},
|
|
46
|
+
...t
|
|
47
|
+
} = s;
|
|
48
|
+
return /* @__PURE__ */ o("label", { css: [r(e, "default", {})], ...t });
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
a as HiddenCheckboxStyled,
|
|
52
|
+
u as SwitchLabelStyled,
|
|
53
|
+
w as SwitchSliderStyled,
|
|
54
|
+
S as SwitchStyled,
|
|
55
|
+
m as SwitchWrapperStyled
|
|
56
|
+
};
|
|
@@ -1 +1,41 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as z } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as A, useRef as C, useImperativeHandle as N } from "react";
|
|
4
|
+
import { COMPONENT_NAME as i } from "./constants.js";
|
|
5
|
+
import { TextareaStyled as O } from "./TextareaStyled.js";
|
|
6
|
+
import { TextareaVariant as $, TextareaColorVariant as j, TextareaResize as v } from "./Textarea.types.js";
|
|
7
|
+
import { useAutoFocus as I } from "../../../hooks/useAutoFocus/useAutoFocus.js";
|
|
8
|
+
import { useResizeObserver as V } from "./hooks/useResizeObserver.js";
|
|
9
|
+
import { useDynamicHeightAdjustment as D } from "./hooks/useDynamicHeightAdjustment.js";
|
|
10
|
+
import { useTheme as E } from "../../../hooks/useTheme/useTheme.js";
|
|
11
|
+
const F = A((o, n) => {
|
|
12
|
+
const {
|
|
13
|
+
errorText: s,
|
|
14
|
+
onChange: t,
|
|
15
|
+
onCustomResize: m,
|
|
16
|
+
defaultValue: l = "",
|
|
17
|
+
variant: u = $.Outlined,
|
|
18
|
+
color: d = j.Primary,
|
|
19
|
+
resize: f = v.None,
|
|
20
|
+
ariaDescribedBy: c,
|
|
21
|
+
maxLength: h,
|
|
22
|
+
minHeight: p,
|
|
23
|
+
maxHeight: x,
|
|
24
|
+
dynamicHeightAdjustment: g = !1,
|
|
25
|
+
disabled: y = !1,
|
|
26
|
+
readOnly: H = !1,
|
|
27
|
+
autoFocus: r = !1,
|
|
28
|
+
...T
|
|
29
|
+
} = o, {
|
|
30
|
+
theme: b
|
|
31
|
+
} = E(), e = C(null);
|
|
32
|
+
N(n, () => e.current), I(e, r), V(e, m);
|
|
33
|
+
const R = D(e, g);
|
|
34
|
+
return /* @__PURE__ */ z(O, { theme: b, ref: e, "aria-invalid": s ? "true" : "false", "aria-describedby": c, "aria-multiline": "true", role: "textbox", $variant: u, $color: d, $resize: f, maxLength: h, disabled: y, readOnly: H, autoFocus: r, onChange: (a) => {
|
|
35
|
+
R(a), t && t(a);
|
|
36
|
+
}, $minHeight: p, $maxHeight: x, defaultValue: l, "data-testid": i, ...T });
|
|
37
|
+
});
|
|
38
|
+
F.displayName = i;
|
|
39
|
+
export {
|
|
40
|
+
F as Textarea
|
|
41
|
+
};
|
|
@@ -27,8 +27,6 @@ export interface TextareaProps extends CommonCssComponentProps<HTMLTextAreaEleme
|
|
|
27
27
|
color?: EnumOrPrimitive<TextareaColorVariant>;
|
|
28
28
|
resize?: EnumOrPrimitive<TextareaResize>;
|
|
29
29
|
name?: string;
|
|
30
|
-
label?: string;
|
|
31
|
-
helperText?: string;
|
|
32
30
|
placeholder?: string;
|
|
33
31
|
ariaDescribedBy?: string;
|
|
34
32
|
value?: string;
|
|
@@ -37,7 +35,6 @@ export interface TextareaProps extends CommonCssComponentProps<HTMLTextAreaEleme
|
|
|
37
35
|
readOnly?: boolean;
|
|
38
36
|
errorText?: string;
|
|
39
37
|
maxLength?: number;
|
|
40
|
-
maxLengthCountShow?: boolean;
|
|
41
38
|
dynamicHeightAdjustment?: boolean;
|
|
42
39
|
onCustomResize?: (newSize: {
|
|
43
40
|
height: number;
|
|
@@ -45,6 +42,7 @@ export interface TextareaProps extends CommonCssComponentProps<HTMLTextAreaEleme
|
|
|
45
42
|
}) => void;
|
|
46
43
|
minHeight?: string;
|
|
47
44
|
maxHeight?: string;
|
|
45
|
+
rows?: string | number;
|
|
48
46
|
}
|
|
49
47
|
export interface TextareaStyledProps extends CommonCssComponentStyledProps<HTMLTextAreaElement> {
|
|
50
48
|
$minHeight?: string;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
var c = /* @__PURE__ */ ((n) => (n.None = "none", n.Both = "both", n.Horizontal = "horizontal", n.Vertical = "vertical", n))(c || {}), r = /* @__PURE__ */ ((n) => (n.Outlined = "outlined", n.Contained = "contained", n.Text = "text", n))(r || {}), o = /* @__PURE__ */ ((n) => (n.Primary = "primary", n.Secondary = "secondary", n.Success = "success", n.Warning = "warning", n.Error = "error", n))(o || {});
|
|
2
|
+
export {
|
|
3
|
+
o as TextareaColorVariant,
|
|
4
|
+
c as TextareaResize,
|
|
5
|
+
r as TextareaVariant
|
|
6
|
+
};
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as c } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
import { TextareaVariant as d, TextareaColorVariant as g, TextareaResize as h } from "./Textarea.types.js";
|
|
5
|
+
import { get as a } from "../../../utils/helpers.js";
|
|
6
|
+
const T = p((i, o) => {
|
|
7
|
+
const {
|
|
8
|
+
theme: {
|
|
9
|
+
textarea: e
|
|
10
|
+
} = {},
|
|
11
|
+
$variant: m = d.Outlined,
|
|
12
|
+
$color: s = g.Primary,
|
|
13
|
+
styles: n = {},
|
|
14
|
+
$resize: x = h.None,
|
|
15
|
+
$minHeight: t,
|
|
16
|
+
$maxHeight: r,
|
|
17
|
+
...f
|
|
18
|
+
} = i, l = [a(e, "default", {}), a(e, [m, s], {}), t ? {
|
|
19
|
+
minHeight: t
|
|
20
|
+
} : {}, r ? {
|
|
21
|
+
maxHeight: r
|
|
22
|
+
} : {}, {
|
|
23
|
+
resize: x
|
|
24
|
+
}, n];
|
|
25
|
+
return /* @__PURE__ */ c("textarea", { css: l, ...f, ref: o });
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
T as TextareaStyled
|
|
29
|
+
};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { useCallback as l } from "react";
|
|
2
|
+
const s = (r, u) => l((t) => {
|
|
3
|
+
var c;
|
|
4
|
+
!u || !r.current || (r.current.style.height = "auto", r.current.style.height = `${r.current.scrollHeight || ((c = t == null ? void 0 : t.target) == null ? void 0 : c.scrollHeight)}px`);
|
|
5
|
+
}, [u, r]);
|
|
6
|
+
export {
|
|
7
|
+
s as useDynamicHeightAdjustment
|
|
8
|
+
};
|