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
|
-
|
|
1
|
+
import { useRef as i, useEffect as s } from "react";
|
|
2
|
+
import { get as n } from "../../../../utils/helpers.js";
|
|
3
|
+
const l = (r, e) => {
|
|
4
|
+
const t = i(!1);
|
|
5
|
+
s(() => {
|
|
6
|
+
if (!r.current || !e) return;
|
|
7
|
+
const c = new ResizeObserver(() => {
|
|
8
|
+
if (!t.current) {
|
|
9
|
+
t.current = !0;
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
e && r.current && e({
|
|
13
|
+
width: n(r, "current.scrollWidth", 0),
|
|
14
|
+
height: n(r, "current.scrollHeight", 0)
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
return c.observe(r.current), () => {
|
|
18
|
+
c.disconnect();
|
|
19
|
+
};
|
|
20
|
+
}, [e]);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
l as useResizeObserver
|
|
24
|
+
};
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as C, useCallback as h } from "react";
|
|
4
|
+
import { COMPONENT_NAME as c } from "./constants.js";
|
|
5
|
+
import { ToggleStyled as v } from "./ToggleStyled.js";
|
|
6
|
+
import { useTheme as T } from "../../../hooks/useTheme/useTheme.js";
|
|
7
|
+
import { ButtonVariant as m } from "../../../types/button.js";
|
|
8
|
+
import { Button as I } from "../Button/Button.js";
|
|
9
|
+
const N = (t) => typeof t == "object" ? t : {
|
|
10
|
+
label: t,
|
|
11
|
+
value: t
|
|
12
|
+
}, x = C((t, i) => {
|
|
13
|
+
const {
|
|
14
|
+
items: u = [],
|
|
15
|
+
onValueChange: o,
|
|
16
|
+
value: f,
|
|
17
|
+
renderItemContent: n,
|
|
18
|
+
disabled: a = !1,
|
|
19
|
+
...p
|
|
20
|
+
} = t, {
|
|
21
|
+
theme: d
|
|
22
|
+
} = T(), g = h((e) => {
|
|
23
|
+
o && o(e);
|
|
24
|
+
}, [o]);
|
|
25
|
+
return /* @__PURE__ */ s(v, { ref: i, "data-testid": c, theme: d, disabled: a, ...p, children: u.map((e, l) => {
|
|
26
|
+
const r = N(e), b = {
|
|
27
|
+
variant: r.value === f ? m.Contained : m.Text,
|
|
28
|
+
onClick: () => g(r.value),
|
|
29
|
+
disabled: a
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ s(I, { ...b, children: n ? n(e, l) : r.label }, `toggle-${l}`);
|
|
32
|
+
}) });
|
|
33
|
+
});
|
|
34
|
+
x.displayName = c;
|
|
35
|
+
export {
|
|
36
|
+
x as Toggle
|
|
37
|
+
};
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as c } from "react";
|
|
4
|
+
import { get as t } from "../../../utils/helpers.js";
|
|
5
|
+
const n = c((o, s) => {
|
|
6
|
+
const {
|
|
7
|
+
theme: {
|
|
8
|
+
switchToggle: e
|
|
9
|
+
} = {},
|
|
10
|
+
disabled: r,
|
|
11
|
+
styles: d = {},
|
|
12
|
+
...l
|
|
13
|
+
} = o, i = [t(e, "default", {}), d, r ? t(e, "disabled", {}) : {}];
|
|
14
|
+
return /* @__PURE__ */ m("div", { css: i, ...l, ref: s });
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
n as ToggleStyled
|
|
18
|
+
};
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as x, jsx as r } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as E } from "react";
|
|
4
|
+
import { COMPONENT_NAME as i } from "./constants.js";
|
|
5
|
+
import { useTooltip as R } from "./utils.js";
|
|
6
|
+
import { TooltipWrapperStyled as W, TooltipStyled as $ } from "./TooltipStyled.js";
|
|
7
|
+
import { useTheme as b } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
import { Portal as j } from "../Portal/Portal.js";
|
|
9
|
+
const A = E((s, l) => {
|
|
10
|
+
const {
|
|
11
|
+
children: p,
|
|
12
|
+
content: a,
|
|
13
|
+
position: n,
|
|
14
|
+
delay: m,
|
|
15
|
+
classNames: f = "",
|
|
16
|
+
gap: c,
|
|
17
|
+
styles: d,
|
|
18
|
+
...o
|
|
19
|
+
} = s, {
|
|
20
|
+
theme: h
|
|
21
|
+
} = b(), {
|
|
22
|
+
isVisible: T,
|
|
23
|
+
coords: t,
|
|
24
|
+
containerRef: u,
|
|
25
|
+
tooltipRef: y,
|
|
26
|
+
showTooltip: N,
|
|
27
|
+
hideTooltip: w,
|
|
28
|
+
positionWithFallback: e
|
|
29
|
+
} = R(n, m, c), M = `${f.trim()} tooltip-${e}`;
|
|
30
|
+
return /* @__PURE__ */ x(W, { ref: u, onMouseEnter: N, onMouseLeave: w, ...o, "data-testid": `${i}-wrapper`, styles: d, children: [
|
|
31
|
+
p,
|
|
32
|
+
T && /* @__PURE__ */ r(j, { withWrapper: !1, ref: l, children: /* @__PURE__ */ r($, { "data-testid": i, className: M, ref: y, position: e, theme: h, style: {
|
|
33
|
+
top: t.top,
|
|
34
|
+
left: t.left
|
|
35
|
+
}, ...o, children: a }) })
|
|
36
|
+
] });
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
A as default
|
|
40
|
+
};
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var t = /* @__PURE__ */ ((r) => (r.Top = "top", r.Bottom = "bottom", r.Left = "left", r.Right = "right", r))(t || {});
|
|
2
|
+
export {
|
|
3
|
+
t as TooltipPosition
|
|
4
|
+
};
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as c } from "react";
|
|
4
|
+
import { get as i } from "../../../utils/helpers.js";
|
|
5
|
+
const n = c((t, e) => {
|
|
6
|
+
const {
|
|
7
|
+
theme: o,
|
|
8
|
+
styles: r = {},
|
|
9
|
+
...s
|
|
10
|
+
} = t, p = [i(o, "tooltip.wrapper.default", {}), r];
|
|
11
|
+
return /* @__PURE__ */ l("div", { css: p, ...s, ref: e });
|
|
12
|
+
}), u = c((t, e) => {
|
|
13
|
+
const {
|
|
14
|
+
theme: o,
|
|
15
|
+
styles: r = {},
|
|
16
|
+
...s
|
|
17
|
+
} = t, p = [i(o, "tooltip.default", {}), r];
|
|
18
|
+
return /* @__PURE__ */ l("div", { css: p, ...s, ref: e });
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
u as TooltipStyled,
|
|
22
|
+
n as TooltipWrapperStyled
|
|
23
|
+
};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const o = "Tooltip", t = 10, A = 200;
|
|
2
|
+
export {
|
|
3
|
+
o as COMPONENT_NAME,
|
|
4
|
+
A as DEFAULT_DELAY,
|
|
5
|
+
t as DEFAULT_GAP
|
|
6
|
+
};
|
|
@@ -1 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
import { useState as w, useRef as c, useCallback as F, useEffect as L } from "react";
|
|
2
|
+
import { TooltipPosition as o } from "./Tooltip.types.js";
|
|
3
|
+
import { DEFAULT_DELAY as Y, DEFAULT_GAP as A } from "./constants.js";
|
|
4
|
+
const U = (t = o.Top, r = Y, l = A) => {
|
|
5
|
+
const [e, h] = w(!1), [T, g] = w({
|
|
6
|
+
top: 0,
|
|
7
|
+
left: 0
|
|
8
|
+
}), [a, B] = w(t), i = c(null), n = c(null), s = c(null), b = F(() => {
|
|
9
|
+
s.current = setTimeout(() => {
|
|
10
|
+
i.current && (h(!0), requestAnimationFrame(() => {
|
|
11
|
+
if (n.current && i.current) {
|
|
12
|
+
const d = i.current.getBoundingClientRect(), f = n.current.getBoundingClientRect(), p = m(d, f, t, l), u = C(t, f, p);
|
|
13
|
+
B(u), g(u === t ? p : m(d, f, u, l));
|
|
14
|
+
}
|
|
15
|
+
}));
|
|
16
|
+
}, r);
|
|
17
|
+
}, [r, t, l]), k = () => {
|
|
18
|
+
s.current && clearTimeout(s.current), h(!1);
|
|
19
|
+
};
|
|
20
|
+
return L(() => () => {
|
|
21
|
+
s.current && (clearTimeout(s.current), s.current = null);
|
|
22
|
+
}, []), {
|
|
23
|
+
isVisible: e,
|
|
24
|
+
coords: T,
|
|
25
|
+
containerRef: i,
|
|
26
|
+
tooltipRef: n,
|
|
27
|
+
showTooltip: b,
|
|
28
|
+
hideTooltip: k,
|
|
29
|
+
positionWithFallback: a
|
|
30
|
+
};
|
|
31
|
+
}, m = (t, r, l, e) => {
|
|
32
|
+
switch (l) {
|
|
33
|
+
case o.Top:
|
|
34
|
+
return {
|
|
35
|
+
top: t.top + window.scrollY - r.height - e,
|
|
36
|
+
left: t.left + window.scrollX + t.width / 2
|
|
37
|
+
};
|
|
38
|
+
case o.Bottom:
|
|
39
|
+
return {
|
|
40
|
+
top: t.top + window.scrollY + t.height + e,
|
|
41
|
+
left: t.left + window.scrollX + t.width / 2
|
|
42
|
+
};
|
|
43
|
+
case o.Left:
|
|
44
|
+
return {
|
|
45
|
+
top: t.top + window.scrollY + t.height / 2,
|
|
46
|
+
left: t.left + window.scrollX - r.width - e
|
|
47
|
+
};
|
|
48
|
+
case o.Right:
|
|
49
|
+
return {
|
|
50
|
+
top: t.top + window.scrollY + t.height / 2,
|
|
51
|
+
left: t.right + window.scrollX + e
|
|
52
|
+
};
|
|
53
|
+
default:
|
|
54
|
+
throw Error(`Unexpected position '${l}'`);
|
|
55
|
+
}
|
|
56
|
+
}, C = (t, r, l) => {
|
|
57
|
+
let e = t;
|
|
58
|
+
return t === o.Top && l.top < 0 ? e = o.Bottom : t === o.Bottom && l.top + r.height > window.innerHeight + window.scrollY ? e = o.Top : t === o.Left && l.left < 0 ? e = o.Right : t === o.Right && l.left + r.width > window.innerWidth + window.scrollX && (e = o.Left), e;
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
m as getCoords,
|
|
62
|
+
C as getFallbackPosition,
|
|
63
|
+
U as useTooltip
|
|
64
|
+
};
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as f } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as c } from "react";
|
|
4
|
+
import { COMPONENT_NAME as t } from "./constants.js";
|
|
5
|
+
import { TypographyStyled as h } from "./TypographyStyled.js";
|
|
6
|
+
import { TypographyVariant as d, TextAlign as g } from "../../../types/typography.js";
|
|
7
|
+
import { useTheme as T } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
const $ = c((o, a) => {
|
|
9
|
+
const {
|
|
10
|
+
variant: r = d.Inherit,
|
|
11
|
+
as: e,
|
|
12
|
+
size: i,
|
|
13
|
+
children: m,
|
|
14
|
+
align: n = g.Start,
|
|
15
|
+
color: s,
|
|
16
|
+
styleVariant: p,
|
|
17
|
+
...l
|
|
18
|
+
} = o, {
|
|
19
|
+
theme: y
|
|
20
|
+
} = T();
|
|
21
|
+
return /* @__PURE__ */ f(h, { ref: a, theme: y, $as: e || r, $variant: r, $align: n, $size: i, $color: s, $styleVariant: p, "data-testid": t, ...l, children: m });
|
|
22
|
+
});
|
|
23
|
+
$.displayName = t;
|
|
24
|
+
export {
|
|
25
|
+
$ as Typography
|
|
26
|
+
};
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as T } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as v } from "react";
|
|
4
|
+
import { TextAlign as z, TypographyVariant as V } from "../../../types/typography.js";
|
|
5
|
+
import { SizeVariant as b } from "../../../types/common.js";
|
|
6
|
+
import { get as t } from "../../../utils/helpers.js";
|
|
7
|
+
const M = v((a, p) => {
|
|
8
|
+
const {
|
|
9
|
+
theme: {
|
|
10
|
+
typography: o,
|
|
11
|
+
colors: i
|
|
12
|
+
} = {},
|
|
13
|
+
$as: y = "span",
|
|
14
|
+
$color: r,
|
|
15
|
+
$align: c = z.Start,
|
|
16
|
+
$variant: n = V.Inherit,
|
|
17
|
+
$size: l = b.Md,
|
|
18
|
+
$styleVariant: e,
|
|
19
|
+
styles: m,
|
|
20
|
+
...g
|
|
21
|
+
} = a, S = t(o, "base", {}), f = t(o, n, {}), u = t(o, [n, l], {}), d = r && t(i, r, r), s = typeof e == "string" ? [e] : e, h = s == null ? void 0 : s.reduce(($, x) => ({
|
|
22
|
+
...$,
|
|
23
|
+
...t(o, ["styleVariant", x], {})
|
|
24
|
+
}), {});
|
|
25
|
+
return /* @__PURE__ */ T(y, { css: [S, f, u, h, {
|
|
26
|
+
textAlign: c,
|
|
27
|
+
color: d
|
|
28
|
+
}, m], ...g, ref: p });
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
M as TypographyStyled
|
|
32
|
+
};
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
import { COMPONENT_NAME as n } from "./constants.js";
|
|
5
|
+
import { WrapperStyled as f } from "./WrapperStyled.js";
|
|
6
|
+
import { useTheme as s } from "../../../hooks/useTheme/useTheme.js";
|
|
7
|
+
import { WrapperVariant as d } from "../../../types/wrapper.js";
|
|
8
|
+
const v = p((r, t) => {
|
|
9
|
+
const {
|
|
10
|
+
variant: e = d.Inline,
|
|
11
|
+
children: o,
|
|
12
|
+
...a
|
|
13
|
+
} = r, {
|
|
14
|
+
theme: m
|
|
15
|
+
} = s();
|
|
16
|
+
return /* @__PURE__ */ i(f, { ref: t, $variant: e, theme: m, "data-testid": n, ...a, children: o });
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
v as default
|
|
20
|
+
};
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as c } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as f } from "react";
|
|
4
|
+
import { WrapperVariant as l } from "../../../types/wrapper.js";
|
|
5
|
+
import { get as t } from "../../../utils/helpers.js";
|
|
6
|
+
const v = f((e, o) => {
|
|
7
|
+
const {
|
|
8
|
+
theme: {
|
|
9
|
+
wrapper: r
|
|
10
|
+
} = {},
|
|
11
|
+
$variant: s = l.Inline,
|
|
12
|
+
styles: p = {},
|
|
13
|
+
...a
|
|
14
|
+
} = e, n = t(r, "default", {}), i = t(r, s, {}), m = {
|
|
15
|
+
...n,
|
|
16
|
+
...i,
|
|
17
|
+
...p
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ c("div", { css: m, ...a, ref: o });
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
v as WrapperStyled
|
|
23
|
+
};
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as O } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { useState as x, useCallback as i, useMemo as A } from "react";
|
|
4
|
+
import { isArray as a, without as b } from "../../../utils/helpers.js";
|
|
5
|
+
import { AccordionContext as j } from "./hooks/useAccordion.js";
|
|
6
|
+
const z = ({
|
|
7
|
+
children: p,
|
|
8
|
+
allowMultipleExpand: m = !1,
|
|
9
|
+
value: n,
|
|
10
|
+
defaultValue: u = [],
|
|
11
|
+
onChange: s
|
|
12
|
+
}) => {
|
|
13
|
+
const [I, f] = x(u), o = a(n), e = o ? n : I, r = i((t) => {
|
|
14
|
+
if (o) {
|
|
15
|
+
s == null || s(t);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
f(t);
|
|
19
|
+
}, [s, o]), d = i((t) => {
|
|
20
|
+
if (e.includes(t)) {
|
|
21
|
+
const c = b(e, t);
|
|
22
|
+
r(c);
|
|
23
|
+
} else {
|
|
24
|
+
const c = m ? [...e, t] : [t];
|
|
25
|
+
r(c);
|
|
26
|
+
}
|
|
27
|
+
}, [m, e, r]), l = A(() => ({
|
|
28
|
+
openedItems: e,
|
|
29
|
+
toggleItem: d
|
|
30
|
+
}), [d, e]);
|
|
31
|
+
return /* @__PURE__ */ O(j.Provider, { value: l, children: p });
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
z as Accordion
|
|
35
|
+
};
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { CONTENT_COMPONENT as d } from "../constants.js";
|
|
4
|
+
import { AccordionContentStyled as s } from "../AccordionStyled.js";
|
|
5
|
+
import { useTheme as l } from "../../../../hooks/useTheme/useTheme.js";
|
|
6
|
+
import { Roles as p } from "../../../core/types/roles.types.js";
|
|
7
|
+
const O = ({
|
|
8
|
+
children: e,
|
|
9
|
+
id: o,
|
|
10
|
+
className: r = "",
|
|
11
|
+
isOpen: t = !1,
|
|
12
|
+
styles: n = {}
|
|
13
|
+
}) => {
|
|
14
|
+
const c = `accordion-panel-${o}`, i = `accordion-header-${o}`, {
|
|
15
|
+
theme: a
|
|
16
|
+
} = l();
|
|
17
|
+
return /* @__PURE__ */ m(s, { id: c, role: p.Region, "data-testid": `${d}-${o}`, "aria-labelledby": i, $isOpen: t, styles: n, theme: a, className: r, children: e });
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
O as AccordionContent
|
|
21
|
+
};
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as m, jsx as p } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { HEADER_COMPONENT as f } from "../constants.js";
|
|
4
|
+
import { AccordionHeaderStyled as h, AccordionIconStyled as A } from "../AccordionStyled.js";
|
|
5
|
+
import { useTheme as $ } from "../../../../hooks/useTheme/useTheme.js";
|
|
6
|
+
import { useAccordion as u } from "../hooks/useAccordion.js";
|
|
7
|
+
const g = ({
|
|
8
|
+
children: t,
|
|
9
|
+
id: o,
|
|
10
|
+
styles: n = {},
|
|
11
|
+
className: d = "",
|
|
12
|
+
isOpen: e = !1,
|
|
13
|
+
expandIcon: r
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
theme: c
|
|
17
|
+
} = $(), {
|
|
18
|
+
toggleItem: i
|
|
19
|
+
} = u(), a = `accordion-header-${o}`, s = `accordion-panel-${o}`, l = () => {
|
|
20
|
+
o && i(o);
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ m(h, { theme: c, id: a, "data-testid": `${f}-${o}`, className: d, "aria-expanded": e, "aria-controls": s, onClick: l, styles: n, children: [
|
|
23
|
+
t,
|
|
24
|
+
r && /* @__PURE__ */ p(A, { theme: c, $isOpen: e, children: r })
|
|
25
|
+
] });
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
g as AccordionHeader
|
|
29
|
+
};
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { Children as l, isValidElement as p, cloneElement as a } from "react";
|
|
4
|
+
import { ITEM_COMPONENT as u } from "../constants.js";
|
|
5
|
+
import { AccordionItemStyled as d } from "../AccordionStyled.js";
|
|
6
|
+
import { useAccordion as f } from "../hooks/useAccordion.js";
|
|
7
|
+
import { useTheme as E } from "../../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
const C = ({
|
|
9
|
+
children: r,
|
|
10
|
+
id: e,
|
|
11
|
+
styles: n = {},
|
|
12
|
+
className: m = ""
|
|
13
|
+
}) => {
|
|
14
|
+
const {
|
|
15
|
+
openedItems: c
|
|
16
|
+
} = f(), {
|
|
17
|
+
theme: i
|
|
18
|
+
} = E(), t = e && c.includes(e);
|
|
19
|
+
return /* @__PURE__ */ s(d, { "data-testid": `${u}-${e}`, "data-open": t, "data-value": e, theme: i, className: m, styles: n, children: l.map(r, (o) => p(o) ? a(o, {
|
|
20
|
+
id: e,
|
|
21
|
+
isOpen: t
|
|
22
|
+
}) : null) });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
C as AccordionItem
|
|
26
|
+
};
|
|
@@ -1 +1,39 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { get as t } from "../../../utils/helpers.js";
|
|
4
|
+
const y = (n) => {
|
|
5
|
+
const {
|
|
6
|
+
theme: c,
|
|
7
|
+
$isOpen: s,
|
|
8
|
+
styles: d = {},
|
|
9
|
+
...e
|
|
10
|
+
} = n, o = t(c, "accordion.content", {}), l = s ? "opened" : "closed", m = [t(o, "default", {}), t(o, l, {}), d];
|
|
11
|
+
return /* @__PURE__ */ r("div", { css: m, ...e });
|
|
12
|
+
}, u = (n) => {
|
|
13
|
+
const {
|
|
14
|
+
theme: c,
|
|
15
|
+
styles: s,
|
|
16
|
+
...d
|
|
17
|
+
} = n, e = t(c, "accordion.header", {}), o = [t(e, "default", {}), s];
|
|
18
|
+
return /* @__PURE__ */ r("button", { css: o, ...d });
|
|
19
|
+
}, S = (n) => {
|
|
20
|
+
const {
|
|
21
|
+
theme: c,
|
|
22
|
+
styles: s,
|
|
23
|
+
...d
|
|
24
|
+
} = n, e = t(c, "accordion.item", {}), o = [t(e, "default", {}), s];
|
|
25
|
+
return /* @__PURE__ */ r("div", { css: o, ...d });
|
|
26
|
+
}, a = (n) => {
|
|
27
|
+
const {
|
|
28
|
+
theme: c,
|
|
29
|
+
$isOpen: s,
|
|
30
|
+
...d
|
|
31
|
+
} = n, e = t(c, "accordion.icon", {}), o = s ? "opened" : "closed", l = [t(e, "default", {}), t(e, o, {})];
|
|
32
|
+
return /* @__PURE__ */ r("span", { css: l, ...d });
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
y as AccordionContentStyled,
|
|
36
|
+
u as AccordionHeaderStyled,
|
|
37
|
+
a as AccordionIconStyled,
|
|
38
|
+
S as AccordionItemStyled
|
|
39
|
+
};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const o = "AccordionItem", c = "AccordionContent", n = "AccordionHeader", t = "Accordion Context must be inside Accordion component";
|
|
2
|
+
export {
|
|
3
|
+
c as CONTENT_COMPONENT,
|
|
4
|
+
t as CONTEXT_ERROR_MESSAGE,
|
|
5
|
+
n as HEADER_COMPONENT,
|
|
6
|
+
o as ITEM_COMPONENT
|
|
7
|
+
};
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as t, useContext as r } from "react";
|
|
3
|
+
import { CONTEXT_ERROR_MESSAGE as e } from "../constants.js";
|
|
4
|
+
const n = t(null), s = () => {
|
|
5
|
+
const o = r(n);
|
|
6
|
+
if (!o) throw new Error(e);
|
|
7
|
+
return o;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
n as AccordionContext,
|
|
11
|
+
s as useAccordion
|
|
12
|
+
};
|