@itcase/ui 1.1.5 → 1.1.7
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/dist/Accordion-JS45IVx7.js +204 -0
- package/dist/Breadcrumbs-KOoMbWmP.js +619 -0
- package/dist/ContextMenuItem-CF5L8xev.js +204 -0
- package/dist/DropdownItem-C0gYXEq6.js +644 -0
- package/dist/FlexItem-DHynUt6v.js +118 -0
- package/dist/GridRow-Buc4dsHd.js +1691 -0
- package/dist/Group-DhYXDvAJ.js +119 -0
- package/dist/ListItem-DYbK4_8c.js +479 -0
- package/dist/ModalLoader-DJVKhIZR.js +374 -0
- package/dist/NotificationList-KbxjrO3o.js +245 -0
- package/dist/SearchResult-DNPmzvp8.js +530 -0
- package/dist/SelectField-uEsQcoxF.js +571 -0
- package/dist/SiteMenuButton-DE_hCJUV.js +181 -0
- package/dist/TabGroup-CCR5jORT.js +1071 -0
- package/dist/Text-DffpwlYq.js +81 -0
- package/dist/cjs/Accordion-BDTE-Lkj.js +213 -0
- package/dist/cjs/Breadcrumbs-BV5q8aPJ.js +629 -0
- package/dist/cjs/ContextMenuItem-C8eg828K.js +213 -0
- package/dist/cjs/DropdownItem-DT8iQfVh.js +653 -0
- package/dist/cjs/FlexItem-CYXxJtYX.js +125 -0
- package/dist/cjs/GridRow-6wilpUeo.js +1701 -0
- package/dist/cjs/Group-DbzIk8kt.js +126 -0
- package/dist/cjs/ListItem-CTDoiG0C.js +488 -0
- package/dist/cjs/ModalLoader-4mmV5G4E.js +384 -0
- package/dist/cjs/NotificationList-B6QbYA9H.js +255 -0
- package/dist/cjs/SearchResult-CdsV7oDb.js +540 -0
- package/dist/cjs/SelectField-DVCsVz6q.js +583 -0
- package/dist/cjs/SiteMenuButton-CVdX1ouh.js +190 -0
- package/dist/cjs/TabGroup-B1LUF9Hg.js +1081 -0
- package/dist/cjs/Text-CfBPhwqK.js +88 -0
- package/dist/cjs/components/Accordion/Accordion.d.ts +8 -0
- package/dist/cjs/components/Accordion/Accordion.interface.d.ts +68 -0
- package/dist/cjs/components/Accordion/AccordionItem.d.ts +8 -0
- package/dist/cjs/components/Accordion/index.d.ts +3 -0
- package/dist/cjs/components/Accordion.js +45 -0
- package/dist/cjs/components/Avatar.js +270 -0
- package/dist/cjs/components/Badge.js +206 -0
- package/dist/cjs/components/Breadcrumbs.js +48 -0
- package/dist/cjs/components/Button.js +563 -0
- package/dist/cjs/components/Caption.js +197 -0
- package/dist/cjs/components/Card.js +279 -0
- package/dist/cjs/components/Cell.js +426 -0
- package/dist/cjs/components/Checkbox.js +166 -0
- package/dist/cjs/components/Chips.js +393 -0
- package/dist/cjs/components/Choice.js +351 -0
- package/dist/cjs/components/Code.js +437 -0
- package/dist/cjs/components/ContextMenu.js +48 -0
- package/dist/cjs/components/CookiesWarning.js +186 -0
- package/dist/cjs/components/DadataHintField.js +1193 -0
- package/dist/cjs/components/DatePicker.js +14102 -0
- package/dist/{components/Background.js → cjs/components/Divider.js} +75 -83
- package/dist/cjs/components/Dot.js +226 -0
- package/dist/cjs/components/Drawer.js +274 -0
- package/dist/cjs/components/Dropdown.js +36 -0
- package/dist/cjs/components/Flex/Flex.d.ts +8 -0
- package/dist/cjs/components/Flex/Flex.interface.d.ts +116 -0
- package/dist/cjs/components/Flex/FlexItem.d.ts +8 -0
- package/dist/cjs/components/Flex/index.d.ts +3 -0
- package/dist/cjs/components/Flex.js +22 -0
- package/dist/cjs/components/FormField.js +59 -0
- package/dist/cjs/components/Grid.js +30 -0
- package/dist/cjs/components/Group/Group.d.ts +9 -0
- package/dist/cjs/components/Group/Group.interface.d.ts +49 -0
- package/dist/cjs/components/Group/index.d.ts +1 -0
- package/dist/cjs/components/Group.js +22 -0
- package/dist/cjs/components/Icon.js +641 -0
- package/dist/cjs/components/Image.js +480 -0
- package/dist/cjs/components/Input.js +233 -0
- package/dist/cjs/components/InputMask.js +233 -0
- package/dist/cjs/components/InputPassword.js +260 -0
- package/dist/cjs/components/Label.js +643 -0
- package/dist/cjs/components/LanguageSelector.js +130 -0
- package/dist/cjs/components/Link.js +505 -0
- package/dist/cjs/components/List.js +31 -0
- package/dist/cjs/components/Loader.js +156 -0
- package/dist/cjs/components/Logo.js +182 -0
- package/dist/cjs/components/Menu.js +192 -0
- package/dist/cjs/components/MenuItem.js +680 -0
- package/dist/cjs/components/Modal.js +28 -0
- package/dist/cjs/components/Notification.js +37 -0
- package/dist/cjs/components/Overlay.js +197 -0
- package/dist/cjs/components/Page.js +422 -0
- package/dist/cjs/components/Pagination.js +372 -0
- package/dist/cjs/components/Radio.js +267 -0
- package/dist/cjs/components/RangeSlider.js +296 -0
- package/dist/cjs/components/Response.js +248 -0
- package/dist/cjs/components/ScrollOnDrag.js +214 -0
- package/dist/cjs/components/Scrollbar.js +71 -0
- package/dist/cjs/components/Search.js +48 -0
- package/dist/cjs/components/Segmented.js +235 -0
- package/dist/cjs/components/Select.js +8538 -0
- package/dist/cjs/components/SiteMenu.js +45 -0
- package/dist/cjs/components/Swiper.js +5655 -0
- package/dist/cjs/components/Switch.js +105 -0
- package/dist/cjs/components/Tab.js +42 -0
- package/dist/cjs/components/Text/Text.d.ts +9 -0
- package/dist/cjs/components/Text/Text.interface.d.ts +51 -0
- package/dist/cjs/components/Text/index.d.ts +1 -0
- package/dist/cjs/components/Text.js +22 -0
- package/dist/cjs/components/Textarea.js +212 -0
- package/dist/cjs/components/Tile.js +571 -0
- package/dist/cjs/components/Title.js +400 -0
- package/dist/cjs/components/Tooltip.js +451 -0
- package/dist/cjs/components/Video.js +175 -0
- package/dist/cjs/components/Wrapper.js +438 -0
- package/dist/cjs/components/index.d.ts +58 -0
- package/dist/cjs/components.js +241 -0
- package/dist/cjs/constants/componentProps/align.js +7 -0
- package/dist/cjs/constants/componentProps/alignDirection.js +7 -0
- package/dist/cjs/constants/componentProps/alignment.js +7 -0
- package/dist/cjs/constants/componentProps/borderColor.js +7 -0
- package/dist/cjs/constants/componentProps/borderColorHover.js +7 -0
- package/dist/cjs/constants/componentProps/borderType.js +7 -0
- package/dist/cjs/constants/componentProps/borderWidth.js +9 -0
- package/dist/cjs/constants/componentProps/captionPosition.js +7 -0
- package/dist/cjs/constants/componentProps/direction.js +7 -0
- package/dist/cjs/constants/componentProps/emojiSize.js +9 -0
- package/dist/cjs/constants/componentProps/fill.js +7 -0
- package/dist/cjs/constants/componentProps/fillGradient.js +7 -0
- package/dist/cjs/constants/componentProps/fillHover.js +7 -0
- package/dist/cjs/constants/componentProps/fillType.js +7 -0
- package/dist/cjs/constants/componentProps/flexAlign.js +7 -0
- package/dist/cjs/constants/componentProps/flexJustifyContent.js +7 -0
- package/dist/cjs/constants/componentProps/flexWrap.js +7 -0
- package/dist/cjs/constants/componentProps/gridAlign.js +7 -0
- package/dist/cjs/constants/componentProps/gridAlignSelf.js +7 -0
- package/dist/cjs/constants/componentProps/gridJustifyItems.js +7 -0
- package/dist/cjs/constants/componentProps/gridJustifySelf.js +7 -0
- package/dist/cjs/constants/componentProps/height.js +7 -0
- package/dist/cjs/constants/componentProps/horizontalContentAlign.js +7 -0
- package/dist/cjs/constants/componentProps/horizontalResizeMode.js +7 -0
- package/dist/cjs/constants/componentProps/iconFillSize.js +9 -0
- package/dist/cjs/constants/componentProps/iconSize.js +9 -0
- package/dist/cjs/constants/componentProps/itemColor.js +7 -0
- package/dist/cjs/constants/componentProps/position.js +7 -0
- package/dist/cjs/constants/componentProps/resizeMode.js +7 -0
- package/dist/cjs/constants/componentProps/shape.js +7 -0
- package/dist/cjs/constants/componentProps/size.js +7 -0
- package/dist/cjs/constants/componentProps/sizeInterface.js +7 -0
- package/dist/cjs/constants/componentProps/sizePX.js +9 -0
- package/dist/cjs/constants/componentProps/stacking.js +7 -0
- package/dist/cjs/constants/componentProps/state.js +7 -0
- package/dist/cjs/constants/componentProps/strokeColor.js +7 -0
- package/dist/cjs/constants/componentProps/textAlign.js +7 -0
- package/dist/cjs/constants/componentProps/textColor.js +7 -0
- package/dist/cjs/constants/componentProps/textColorActive.js +7 -0
- package/dist/cjs/constants/componentProps/textColorHover.js +7 -0
- package/dist/cjs/constants/componentProps/textGradient.js +7 -0
- package/dist/cjs/constants/componentProps/textSize.js +7 -0
- package/dist/cjs/constants/componentProps/textStyle.js +7 -0
- package/dist/cjs/constants/componentProps/textTag.js +7 -0
- package/dist/cjs/constants/componentProps/textWeight.js +9 -0
- package/dist/cjs/constants/componentProps/textWrap.js +7 -0
- package/dist/cjs/constants/componentProps/titleSize.js +7 -0
- package/dist/cjs/constants/componentProps/type.js +7 -0
- package/dist/cjs/constants/componentProps/underline.js +7 -0
- package/dist/cjs/constants/componentProps/verticalContentAlign.js +7 -0
- package/dist/cjs/constants/componentProps/verticalResizeMode.js +7 -0
- package/dist/cjs/constants/componentProps/width.js +7 -0
- package/dist/cjs/constants/componentProps/wrap.js +7 -0
- package/dist/cjs/constants-ts/componentProps/align.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/alignDirection.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/alignment.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/borderColor.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/borderColorHover.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/borderType.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/borderWidth.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/captionPosition.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/direction.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/elevation.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/emojiSize.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/fill.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/fillGradient.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/fillHover.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/fillType.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/flexAlign.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/flexGrow.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/flexJustifyContent.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/flexWrap.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/gridAlign.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/gridAlignSelf.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/gridJustifyItems.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/gridJustifySelf.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/height.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/horizontalContentAlign.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/horizontalResizeMode.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/iconFillSize.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/iconSize.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/itemColor.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/justifyContent.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/position.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/resizeMode.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/shape.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/size.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/sizeInterface.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/sizePX.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/stacking.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/state.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/strokeColor.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/textAlign.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/textColor.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/textColorActive.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/textColorHover.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/textGradient.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/textSize.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/textStyle.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/textTag.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/textWeight.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/textWrap.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/titleSize.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/type.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/underline.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/verticalContentAlign.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/verticalResizeMode.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/width.d.ts +1 -0
- package/dist/cjs/constants-ts/componentProps/wrap.d.ts +1 -0
- package/dist/cjs/constants-ts/index.d.ts +56 -0
- package/dist/cjs/constants.js +111 -0
- package/dist/cjs/context/Notifications.js +122 -0
- package/dist/cjs/context/UIContext.js +56 -0
- package/dist/cjs/context/index.d.ts +2 -0
- package/dist/cjs/hooks/index.d.ts +3 -0
- package/dist/cjs/hooks/styleAttributes.interface.d.ts +145 -0
- package/dist/cjs/hooks/styleAttributes.js +39 -0
- package/dist/cjs/hooks/useDeviceTargetClass.js +61 -0
- package/dist/cjs/hooks/useMediaQueries.js +139 -0
- package/dist/cjs/hooks/useStyles.js +135 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/jsx-runtime-BCmQOGxJ.js +1363 -0
- package/dist/components/Accordion/Accordion.d.ts +8 -0
- package/dist/components/Accordion/Accordion.interface.d.ts +68 -0
- package/dist/components/Accordion/AccordionItem.d.ts +8 -0
- package/dist/components/Accordion/index.d.ts +3 -0
- package/dist/components/Accordion.js +38 -697
- package/dist/components/Avatar.js +75 -70
- package/dist/components/Badge.js +41 -56
- package/dist/components/Breadcrumbs.js +41 -656
- package/dist/components/Button.js +115 -107
- package/dist/components/Caption.js +37 -45
- package/dist/components/Card.js +47 -60
- package/dist/components/Cell.js +87 -96
- package/dist/components/Checkbox.js +41 -56
- package/dist/components/Chips.js +64 -78
- package/dist/components/Choice.js +81 -91
- package/dist/components/Code.js +40 -48
- package/dist/components/ContextMenu.js +41 -246
- package/dist/components/CookiesWarning.js +61 -73
- package/dist/components/DadataHintField.js +59 -65
- package/dist/components/DatePicker.js +5255 -425
- package/dist/components/Divider.js +47 -55
- package/dist/components/Dot.js +37 -45
- package/dist/components/Drawer.js +26 -34
- package/dist/components/Dropdown.js +29 -657
- package/dist/components/Flex/Flex.d.ts +8 -0
- package/dist/components/Flex/Flex.interface.d.ts +116 -0
- package/dist/components/Flex/FlexItem.d.ts +8 -0
- package/dist/components/Flex/index.d.ts +3 -0
- package/dist/components/Flex.js +15 -1185
- package/dist/components/FormField.js +49 -617
- package/dist/components/Grid.js +22 -1705
- package/dist/components/Group/Group.d.ts +9 -0
- package/dist/components/Group/Group.interface.d.ts +49 -0
- package/dist/components/Group/index.d.ts +1 -0
- package/dist/components/Group.js +15 -315
- package/dist/components/Icon.js +113 -124
- package/dist/components/Image.js +78 -94
- package/dist/components/Input.js +40 -49
- package/dist/components/InputMask.js +39 -48
- package/dist/components/InputPassword.js +66 -76
- package/dist/components/Label.js +104 -114
- package/dist/components/LanguageSelector.js +53 -62
- package/dist/components/Link.js +74 -84
- package/dist/components/List.js +24 -498
- package/dist/components/Loader.js +41 -56
- package/dist/components/Logo.js +47 -55
- package/dist/components/Menu.js +51 -58
- package/dist/components/MenuItem.js +103 -111
- package/dist/components/Modal.js +21 -402
- package/dist/components/Notification.js +29 -281
- package/dist/components/Overlay.js +37 -45
- package/dist/components/Page.js +66 -74
- package/dist/components/Pagination.js +223 -54
- package/dist/components/Radio.js +55 -70
- package/dist/components/RangeSlider.js +53 -62
- package/dist/components/Response.js +109 -122
- package/dist/components/ScrollOnDrag.js +80 -164
- package/dist/components/Scrollbar.js +15 -18
- package/dist/components/Search.js +40 -571
- package/dist/components/Segmented.js +54 -69
- package/dist/components/Select.js +281 -324
- package/dist/components/SiteMenu.js +38 -221
- package/dist/components/Swiper.js +183 -186
- package/dist/components/Switch.js +17 -25
- package/dist/components/Tab.js +34 -1089
- package/dist/components/Text/Text.d.ts +9 -0
- package/dist/components/Text/Text.interface.d.ts +51 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/Text.js +15 -362
- package/dist/components/Textarea.js +37 -46
- package/dist/components/Tile.js +103 -112
- package/dist/components/Title.js +66 -75
- package/dist/components/Tooltip.js +83 -93
- package/dist/components/Video.js +32 -40
- package/dist/components/Wrapper.js +67 -75
- package/dist/components/index.d.ts +58 -0
- package/dist/components.js +124 -0
- package/dist/constants/componentProps/align.js +1 -3
- package/dist/constants/componentProps/alignDirection.js +1 -3
- package/dist/constants/componentProps/alignment.js +1 -3
- package/dist/constants/componentProps/borderColor.js +1 -3
- package/dist/constants/componentProps/borderColorHover.js +1 -3
- package/dist/constants/componentProps/borderType.js +1 -3
- package/dist/constants/componentProps/borderWidth.js +1 -3
- package/dist/constants/componentProps/captionPosition.js +1 -3
- package/dist/constants/componentProps/direction.js +1 -3
- package/dist/constants/componentProps/emojiSize.js +1 -3
- package/dist/constants/componentProps/fill.js +1 -3
- package/dist/constants/componentProps/fillGradient.js +1 -3
- package/dist/constants/componentProps/fillHover.js +1 -3
- package/dist/constants/componentProps/fillType.js +1 -3
- package/dist/constants/componentProps/flexAlign.js +1 -3
- package/dist/constants/componentProps/flexJustifyContent.js +1 -3
- package/dist/constants/componentProps/flexWrap.js +1 -3
- package/dist/constants/componentProps/gridAlign.js +1 -3
- package/dist/constants/componentProps/gridAlignSelf.js +1 -3
- package/dist/constants/componentProps/gridJustifyItems.js +1 -3
- package/dist/constants/componentProps/gridJustifySelf.js +1 -3
- package/dist/constants/componentProps/height.js +1 -3
- package/dist/constants/componentProps/horizontalContentAlign.js +1 -3
- package/dist/constants/componentProps/horizontalResizeMode.js +1 -3
- package/dist/constants/componentProps/iconFillSize.js +1 -3
- package/dist/constants/componentProps/iconSize.js +1 -3
- package/dist/constants/componentProps/itemColor.js +1 -3
- package/dist/constants/componentProps/position.js +1 -3
- package/dist/constants/componentProps/resizeMode.js +1 -3
- package/dist/constants/componentProps/shape.js +1 -3
- package/dist/constants/componentProps/size.js +1 -3
- package/dist/constants/componentProps/sizeInterface.js +1 -3
- package/dist/constants/componentProps/sizePX.js +1 -3
- package/dist/constants/componentProps/stacking.js +1 -3
- package/dist/constants/componentProps/state.js +1 -3
- package/dist/constants/componentProps/strokeColor.js +1 -3
- package/dist/constants/componentProps/textAlign.js +1 -3
- package/dist/constants/componentProps/textColor.js +1 -3
- package/dist/constants/componentProps/textColorActive.js +1 -3
- package/dist/constants/componentProps/textColorHover.js +1 -3
- package/dist/constants/componentProps/textGradient.js +1 -3
- package/dist/constants/componentProps/textSize.js +1 -3
- package/dist/constants/componentProps/textStyle.js +1 -3
- package/dist/constants/componentProps/textTag.js +1 -3
- package/dist/constants/componentProps/textWeight.js +1 -3
- package/dist/constants/componentProps/textWrap.js +1 -3
- package/dist/constants/componentProps/titleSize.js +1 -3
- package/dist/constants/componentProps/type.js +1 -3
- package/dist/constants/componentProps/underline.js +1 -3
- package/dist/constants/componentProps/verticalContentAlign.js +1 -3
- package/dist/constants/componentProps/verticalResizeMode.js +1 -3
- package/dist/constants/componentProps/width.js +1 -3
- package/dist/constants/componentProps/wrap.js +1 -3
- package/dist/constants-ts/componentProps/align.d.ts +1 -0
- package/dist/constants-ts/componentProps/alignDirection.d.ts +1 -0
- package/dist/constants-ts/componentProps/alignment.d.ts +1 -0
- package/dist/constants-ts/componentProps/borderColor.d.ts +1 -0
- package/dist/constants-ts/componentProps/borderColorHover.d.ts +1 -0
- package/dist/constants-ts/componentProps/borderType.d.ts +1 -0
- package/dist/constants-ts/componentProps/borderWidth.d.ts +1 -0
- package/dist/constants-ts/componentProps/captionPosition.d.ts +1 -0
- package/dist/constants-ts/componentProps/direction.d.ts +1 -0
- package/dist/constants-ts/componentProps/elevation.d.ts +1 -0
- package/dist/constants-ts/componentProps/emojiSize.d.ts +1 -0
- package/dist/constants-ts/componentProps/fill.d.ts +1 -0
- package/dist/constants-ts/componentProps/fillGradient.d.ts +1 -0
- package/dist/constants-ts/componentProps/fillHover.d.ts +1 -0
- package/dist/constants-ts/componentProps/fillType.d.ts +1 -0
- package/dist/constants-ts/componentProps/flexAlign.d.ts +1 -0
- package/dist/constants-ts/componentProps/flexGrow.d.ts +1 -0
- package/dist/constants-ts/componentProps/flexJustifyContent.d.ts +1 -0
- package/dist/constants-ts/componentProps/flexWrap.d.ts +1 -0
- package/dist/constants-ts/componentProps/gridAlign.d.ts +1 -0
- package/dist/constants-ts/componentProps/gridAlignSelf.d.ts +1 -0
- package/dist/constants-ts/componentProps/gridJustifyItems.d.ts +1 -0
- package/dist/constants-ts/componentProps/gridJustifySelf.d.ts +1 -0
- package/dist/constants-ts/componentProps/height.d.ts +1 -0
- package/dist/constants-ts/componentProps/horizontalContentAlign.d.ts +1 -0
- package/dist/constants-ts/componentProps/horizontalResizeMode.d.ts +1 -0
- package/dist/constants-ts/componentProps/iconFillSize.d.ts +1 -0
- package/dist/constants-ts/componentProps/iconSize.d.ts +1 -0
- package/dist/constants-ts/componentProps/itemColor.d.ts +1 -0
- package/dist/constants-ts/componentProps/justifyContent.d.ts +1 -0
- package/dist/constants-ts/componentProps/position.d.ts +1 -0
- package/dist/constants-ts/componentProps/resizeMode.d.ts +1 -0
- package/dist/constants-ts/componentProps/shape.d.ts +1 -0
- package/dist/constants-ts/componentProps/size.d.ts +1 -0
- package/dist/constants-ts/componentProps/sizeInterface.d.ts +1 -0
- package/dist/constants-ts/componentProps/sizePX.d.ts +1 -0
- package/dist/constants-ts/componentProps/stacking.d.ts +1 -0
- package/dist/constants-ts/componentProps/state.d.ts +1 -0
- package/dist/constants-ts/componentProps/strokeColor.d.ts +1 -0
- package/dist/constants-ts/componentProps/textAlign.d.ts +1 -0
- package/dist/constants-ts/componentProps/textColor.d.ts +1 -0
- package/dist/constants-ts/componentProps/textColorActive.d.ts +1 -0
- package/dist/constants-ts/componentProps/textColorHover.d.ts +1 -0
- package/dist/constants-ts/componentProps/textGradient.d.ts +1 -0
- package/dist/constants-ts/componentProps/textSize.d.ts +1 -0
- package/dist/constants-ts/componentProps/textStyle.d.ts +1 -0
- package/dist/constants-ts/componentProps/textTag.d.ts +1 -0
- package/dist/constants-ts/componentProps/textWeight.d.ts +1 -0
- package/dist/constants-ts/componentProps/textWrap.d.ts +1 -0
- package/dist/constants-ts/componentProps/titleSize.d.ts +1 -0
- package/dist/constants-ts/componentProps/type.d.ts +1 -0
- package/dist/constants-ts/componentProps/underline.d.ts +1 -0
- package/dist/constants-ts/componentProps/verticalContentAlign.d.ts +1 -0
- package/dist/constants-ts/componentProps/verticalResizeMode.d.ts +1 -0
- package/dist/constants-ts/componentProps/width.d.ts +1 -0
- package/dist/constants-ts/componentProps/wrap.d.ts +1 -0
- package/dist/constants-ts/index.d.ts +56 -0
- package/dist/constants.js +53 -111
- package/dist/context/Notifications.js +16 -25
- package/dist/context/UIContext.js +20 -29
- package/dist/context/index.d.ts +2 -0
- package/dist/css/components/Avatar/Avatar.css +10 -0
- package/dist/css/components/Button/Button.css +1 -1
- package/dist/css/components/DatePicker/DatePicker.css +11 -10
- package/dist/css/components/Dropdown/Dropdown.css +41 -15
- package/dist/css/components/Grid/Grid.css +9 -17
- package/dist/css/components/MenuItem/MenuItem.css +5 -5
- package/dist/css/components/Modal/Modal.css +1 -0
- package/dist/css/components/Pagination/Pagination.css +55 -32
- package/dist/css/components/Pagination/css/__item/pagination__item.css +27 -25
- package/dist/css/components/ScrollOnDrag/ScrollOnDrag.css +30 -5
- package/dist/css/components/Scrollbar/Scrollbar.css +56 -0
- package/dist/css/components/Select/Select.css +9 -1
- package/dist/css/components/Select/css/__single-value/select__single-value.css +1 -1
- package/dist/css/components/Swiper/Swiper.css +2 -2
- package/dist/css/styles/text-color/text-color_active.css +4 -2
- package/dist/floating-ui.dom-BQ7wiYTi.js +1374 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/styleAttributes.interface.d.ts +145 -0
- package/dist/hooks/styleAttributes.js +5 -7
- package/dist/hooks/useDeviceTargetClass.js +13 -20
- package/dist/hooks/useMediaQueries.js +16 -10
- package/dist/hooks/useStyles.js +22 -30
- package/dist/index.d.ts +4 -0
- package/dist/jsx-runtime-ClDdVO4Q.js +1357 -0
- package/package.json +91 -40
- package/dist/_commonjsHelpers-CFO10eej.js +0 -7
- package/dist/css/components/Background/Background.css +0 -11
- /package/dist/{floating-ui.dom-C34fOuI9.js → cjs/floating-ui.dom-C34fOuI9.js} +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export interface TypeStyleAttributes {
|
|
2
|
+
/**
|
|
3
|
+
* Layout
|
|
4
|
+
*/
|
|
5
|
+
alignContent?: string;
|
|
6
|
+
alignItems?: string;
|
|
7
|
+
alignSelf?: string;
|
|
8
|
+
aspectRatio?: string;
|
|
9
|
+
border?: string;
|
|
10
|
+
borderBottomWidth?: string;
|
|
11
|
+
borderEndWidth?: string;
|
|
12
|
+
borderLeftWidth?: string;
|
|
13
|
+
borderRightWidth?: string;
|
|
14
|
+
borderStartWidth?: string;
|
|
15
|
+
borderTopWidth?: string;
|
|
16
|
+
borderWidth?: string;
|
|
17
|
+
bottom?: string;
|
|
18
|
+
display?: string;
|
|
19
|
+
end?: string;
|
|
20
|
+
flex?: string;
|
|
21
|
+
flexBasis?: string;
|
|
22
|
+
flexDirection?: string;
|
|
23
|
+
flexShrink?: string;
|
|
24
|
+
flexWrap?: string;
|
|
25
|
+
gap?: string;
|
|
26
|
+
rowGap?: string;
|
|
27
|
+
columnGap?: string;
|
|
28
|
+
columnWidth?: string;
|
|
29
|
+
height?: string;
|
|
30
|
+
left?: string;
|
|
31
|
+
margin?: string;
|
|
32
|
+
marginBottom?: string;
|
|
33
|
+
marginEnd?: string;
|
|
34
|
+
marginHorizontal?: string;
|
|
35
|
+
marginLeft?: string;
|
|
36
|
+
marginRight?: string;
|
|
37
|
+
marginStart?: string;
|
|
38
|
+
marginTop?: string;
|
|
39
|
+
marginVertical?: string;
|
|
40
|
+
maxHeight?: string;
|
|
41
|
+
maxWidth?: string;
|
|
42
|
+
minHeight?: string;
|
|
43
|
+
minWidth?: string;
|
|
44
|
+
overflow?: string;
|
|
45
|
+
padding?: string;
|
|
46
|
+
paddingBottom?: string;
|
|
47
|
+
paddingEnd?: string;
|
|
48
|
+
paddingHorizontal?: string;
|
|
49
|
+
paddingLeft?: string;
|
|
50
|
+
paddingRight?: string;
|
|
51
|
+
paddingStart?: string;
|
|
52
|
+
paddingTop?: string;
|
|
53
|
+
paddingVertical?: string;
|
|
54
|
+
position?: string;
|
|
55
|
+
right?: string;
|
|
56
|
+
start?: string;
|
|
57
|
+
top?: string;
|
|
58
|
+
width?: string;
|
|
59
|
+
zIndex?: string;
|
|
60
|
+
order?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Shadow
|
|
63
|
+
*/
|
|
64
|
+
shadowColor?: string;
|
|
65
|
+
shadowOffset?: string;
|
|
66
|
+
shadowOpacity?: string;
|
|
67
|
+
shadowRadius?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Transform
|
|
70
|
+
*/
|
|
71
|
+
transform?: string;
|
|
72
|
+
/**
|
|
73
|
+
* View
|
|
74
|
+
*/
|
|
75
|
+
background?: string;
|
|
76
|
+
backgroundColor?: string;
|
|
77
|
+
borderBottomColor?: string;
|
|
78
|
+
borderBottomEndRadius?: string;
|
|
79
|
+
borderBottomLeftRadius?: string;
|
|
80
|
+
borderBottomRightRadius?: string;
|
|
81
|
+
borderBottomStartRadius?: string;
|
|
82
|
+
borderColor?: string;
|
|
83
|
+
borderCurve?: string;
|
|
84
|
+
borderEndColor?: string;
|
|
85
|
+
borderLeftColor?: string;
|
|
86
|
+
borderRadius?: string;
|
|
87
|
+
borderRightColor?: string;
|
|
88
|
+
borderStartColor?: string;
|
|
89
|
+
borderStyle?: string;
|
|
90
|
+
borderTopColor?: string;
|
|
91
|
+
borderTopEndRadius?: string;
|
|
92
|
+
borderTopLeftRadius?: string;
|
|
93
|
+
borderTopRightRadius?: string;
|
|
94
|
+
borderTopStartRadius?: string;
|
|
95
|
+
opacity?: string;
|
|
96
|
+
cursor?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Text
|
|
99
|
+
*/
|
|
100
|
+
color?: string;
|
|
101
|
+
fontFamily?: string;
|
|
102
|
+
fontSize?: string;
|
|
103
|
+
fontStyle?: string;
|
|
104
|
+
fontVariant?: string;
|
|
105
|
+
fontWeight?: string;
|
|
106
|
+
letterSpacing?: string;
|
|
107
|
+
lineHeight?: string;
|
|
108
|
+
textAlign?: string;
|
|
109
|
+
textDecorationColor?: string;
|
|
110
|
+
textDecorationLine?: string;
|
|
111
|
+
textDecorationStyle?: string;
|
|
112
|
+
textShadowColor?: string;
|
|
113
|
+
textShadowOffset?: string;
|
|
114
|
+
textShadowRadius?: string;
|
|
115
|
+
textTransform?: string;
|
|
116
|
+
verticalAlign?: string;
|
|
117
|
+
writingMode?: string;
|
|
118
|
+
whiteSpace?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Image
|
|
121
|
+
*/
|
|
122
|
+
overlayColor?: string;
|
|
123
|
+
resizeMode?: string;
|
|
124
|
+
tintColor?: string;
|
|
125
|
+
objectFit?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Grid
|
|
128
|
+
*/
|
|
129
|
+
gridTemplateColumns?: string;
|
|
130
|
+
gridArea?: string;
|
|
131
|
+
gridAutoColumns?: string;
|
|
132
|
+
gridAutoFlow?: string;
|
|
133
|
+
gridAutoRows?: string;
|
|
134
|
+
gridTemplate?: string;
|
|
135
|
+
gridTemplateAreas?: string;
|
|
136
|
+
gridTemplateRows?: string;
|
|
137
|
+
gridColumn?: string;
|
|
138
|
+
gridColumnGap?: string;
|
|
139
|
+
gridRow?: string;
|
|
140
|
+
gridRowGap?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Filter
|
|
143
|
+
*/
|
|
144
|
+
backdropFilter?: string;
|
|
145
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
var styleAttributes = [
|
|
4
2
|
/**
|
|
5
3
|
* Layout
|
|
6
4
|
*/
|
|
7
|
-
'alignContent', 'alignItems', 'alignSelf', 'aspectRatio', 'border', 'borderBottomWidth', 'borderEndWidth', 'borderLeftWidth', 'borderRightWidth', 'borderStartWidth', 'borderTopWidth', 'borderWidth', 'bottom', 'display', '
|
|
5
|
+
'alignContent', 'alignItems', 'alignSelf', 'aspectRatio', 'border', 'borderBottomWidth', 'borderEndWidth', 'borderLeftWidth', 'borderRightWidth', 'borderStartWidth', 'borderTopWidth', 'borderWidth', 'bottom', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'gap', 'rowGap', 'columnGap', 'columnWidth', 'height', 'justifyContent', 'left', 'margin', 'marginBottom', 'marginEnd', 'marginHorizontal', 'marginLeft', 'marginRight', 'marginStart', 'marginTop', 'marginVertical', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'overflow', 'padding', 'paddingBottom', 'paddingEnd', 'paddingHorizontal', 'paddingLeft', 'paddingRight', 'paddingStart', 'paddingTop', 'paddingVertical', 'position', 'right', 'top', 'width', 'zIndex', 'order',
|
|
8
6
|
/**
|
|
9
7
|
* Shadow
|
|
10
8
|
*/
|
|
@@ -28,10 +26,10 @@ var styleAttributes = [
|
|
|
28
26
|
/**
|
|
29
27
|
* Grid
|
|
30
28
|
*/
|
|
31
|
-
'gridTemplateColumns', 'gridArea', 'gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplate', 'gridTemplateAreas', 'gridTemplateRows', 'gridColumnGap', 'gridRowGap',
|
|
29
|
+
'gridTemplateColumns', 'gridArea', 'gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplate', 'gridTemplateAreas', 'gridTemplateRows', 'gridColumn', 'gridColumnGap', 'gridRow', 'gridRowGap',
|
|
32
30
|
/**
|
|
33
|
-
* Filter
|
|
34
|
-
*/
|
|
31
|
+
* Filter
|
|
32
|
+
*/
|
|
35
33
|
'backdropFilter'];
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
export { styleAttributes as default };
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
require('./useMediaQueries.js');
|
|
9
|
-
require('react-responsive');
|
|
10
|
-
|
|
11
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
|
|
13
|
-
var castArray__default = /*#__PURE__*/_interopDefault(castArray);
|
|
14
|
-
var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import castArray from 'lodash/castArray';
|
|
3
|
+
import camelCase from 'lodash/camelCase';
|
|
4
|
+
import { useUserDeviceContext } from '../context/UIContext.js';
|
|
5
|
+
import 'prop-types';
|
|
6
|
+
import './useMediaQueries.js';
|
|
7
|
+
import 'react-responsive';
|
|
15
8
|
|
|
16
9
|
function useDeviceTargetClass(componentProps, hookProps) {
|
|
17
10
|
/** Generate a class depending on the user's device.
|
|
@@ -36,19 +29,19 @@ function useDeviceTargetClass(componentProps, hookProps) {
|
|
|
36
29
|
isMobile,
|
|
37
30
|
isTablet,
|
|
38
31
|
isDesktop
|
|
39
|
-
} =
|
|
40
|
-
const targetClassValue =
|
|
32
|
+
} = useUserDeviceContext();
|
|
33
|
+
const targetClassValue = useMemo(() => {
|
|
41
34
|
// prettier-ignore
|
|
42
35
|
const deviceBasePart = isMobile && 'Mobile' || isTablet && 'Tablet' || isDesktop && 'Desktop' || '';
|
|
43
36
|
const valueForDevice = componentProps[`${propsKey}${deviceBasePart}`];
|
|
44
37
|
const valueDefault = componentProps[propsKey];
|
|
45
38
|
return valueForDevice || valueDefault;
|
|
46
39
|
}, [isMobile, isTablet, isDesktop, componentProps[propsKey], componentProps[`${propsKey}Mobile`], componentProps[`${propsKey}Tablet`], componentProps[`${propsKey}Desktop`]]);
|
|
47
|
-
const targetClass =
|
|
40
|
+
const targetClass = useMemo(() => {
|
|
48
41
|
if (targetClassValue) {
|
|
49
|
-
let cleanClassValue =
|
|
42
|
+
let cleanClassValue = camelCase(String(targetClassValue));
|
|
50
43
|
if (replace) {
|
|
51
|
-
const replaceList =
|
|
44
|
+
const replaceList = castArray(replace);
|
|
52
45
|
cleanClassValue = cleanClassValue.replace(replaceList[0], replaceList[1] || '');
|
|
53
46
|
}
|
|
54
47
|
return `${prefix}${cleanClassValue}`.toLowerCase();
|
|
@@ -58,4 +51,4 @@ function useDeviceTargetClass(componentProps, hookProps) {
|
|
|
58
51
|
return targetClass;
|
|
59
52
|
}
|
|
60
53
|
|
|
61
|
-
|
|
54
|
+
export { useDeviceTargetClass };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var reactResponsive = require('react-responsive');
|
|
1
|
+
import { useMediaQuery } from 'react-responsive';
|
|
4
2
|
|
|
5
3
|
var tablet = "48em";
|
|
6
4
|
var mediaQueries = {
|
|
@@ -27,7 +25,8 @@ const isSSR = typeof window === 'undefined';
|
|
|
27
25
|
function useMediaQueries(userDevice = {}) {
|
|
28
26
|
// const isWarning = useMediaQuery({ maxWidth: mediaQueries['mobile-tiny'] })
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
// prettier-ignore
|
|
29
|
+
const isMobile = useMediaQuery({
|
|
31
30
|
minWidth: mediaQueries['mobile-tiny'],
|
|
32
31
|
maxWidth: mediaQueries['tablet']
|
|
33
32
|
}) || isSSR && Boolean(userDevice.isMobile);
|
|
@@ -56,14 +55,18 @@ function useMediaQueries(userDevice = {}) {
|
|
|
56
55
|
// minWidth: mediaQueries['mobile-extra-large'],
|
|
57
56
|
// maxWidth: mediaQueries['mobile-super-extra-large'],
|
|
58
57
|
// })
|
|
59
|
-
|
|
58
|
+
|
|
59
|
+
useMediaQuery({
|
|
60
60
|
minWidth: mediaQueries['mobile-super-extra-large'],
|
|
61
61
|
maxWidth: mediaQueries['tablet']
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
|
|
64
|
+
// prettier-ignore
|
|
65
|
+
const isTablet = useMediaQuery({
|
|
64
66
|
minWidth: mediaQueries['tablet'],
|
|
65
67
|
maxWidth: mediaQueries['desktop-small']
|
|
66
68
|
}) || isSSR && Boolean(userDevice.isTablet);
|
|
69
|
+
|
|
67
70
|
// const isTabletSmall = useMediaQuery({
|
|
68
71
|
// minWidth: mediaQueries['tablet-small'],
|
|
69
72
|
// maxWidth: mediaQueries['tablet'],
|
|
@@ -73,10 +76,12 @@ function useMediaQueries(userDevice = {}) {
|
|
|
73
76
|
// maxWidth: mediaQueries['tablet-large'],
|
|
74
77
|
// })
|
|
75
78
|
|
|
76
|
-
|
|
79
|
+
// prettier-ignore
|
|
80
|
+
const isDesktop = useMediaQuery({
|
|
77
81
|
minWidth: mediaQueries['desktop-small'],
|
|
78
82
|
maxWidth: mediaQueries['desktop-super-huge']
|
|
79
83
|
}) || isSSR && Boolean(userDevice.isDesktop);
|
|
84
|
+
|
|
80
85
|
// const isDesktopSmall = useMediaQuery({
|
|
81
86
|
// minWidth: mediaQueries['desktop-small'],
|
|
82
87
|
// maxWidth: mediaQueries['desktop-medium'],
|
|
@@ -101,7 +106,8 @@ function useMediaQueries(userDevice = {}) {
|
|
|
101
106
|
// minWidth: mediaQueries['desktop-super-extra-large'],
|
|
102
107
|
// maxWidth: mediaQueries['desktop-huge'],
|
|
103
108
|
// })
|
|
104
|
-
|
|
109
|
+
|
|
110
|
+
const isDesktopMega = useMediaQuery({
|
|
105
111
|
minWidth: mediaQueries['desktop-huge']
|
|
106
112
|
});
|
|
107
113
|
return {
|
|
@@ -124,8 +130,8 @@ function useMediaQueries(userDevice = {}) {
|
|
|
124
130
|
// isDesktopStandart,
|
|
125
131
|
// isDesktopLarge,
|
|
126
132
|
// isDesktopHuge,
|
|
127
|
-
isDesktopMega
|
|
133
|
+
isDesktopMega: isDesktopMega
|
|
128
134
|
};
|
|
129
135
|
}
|
|
130
136
|
|
|
131
|
-
|
|
137
|
+
export { useMediaQueries };
|
package/dist/hooks/useStyles.js
CHANGED
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
require('./useMediaQueries.js');
|
|
11
|
-
require('react-responsive');
|
|
12
|
-
|
|
13
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
|
|
15
|
-
var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
|
|
16
|
-
var maxBy__default = /*#__PURE__*/_interopDefault(maxBy);
|
|
17
|
-
var upperFirst__default = /*#__PURE__*/_interopDefault(upperFirst);
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import camelCase from 'lodash/camelCase';
|
|
3
|
+
import maxBy from 'lodash/maxBy';
|
|
4
|
+
import upperFirst from 'lodash/upperFirst';
|
|
5
|
+
import styleAttributes from './styleAttributes.js';
|
|
6
|
+
import { useUserDeviceContext } from '../context/UIContext.js';
|
|
7
|
+
import 'prop-types';
|
|
8
|
+
import './useMediaQueries.js';
|
|
9
|
+
import 'react-responsive';
|
|
18
10
|
|
|
19
11
|
let DEVICE_TYPES = [];
|
|
20
12
|
const removeDeviceType = originalKey => {
|
|
21
13
|
// Remove "mobile"/"tablet"/"desktop"
|
|
22
14
|
const withOutDeviceType = DEVICE_TYPES.reduce((cleanKey, deviceType) => {
|
|
23
|
-
if (cleanKey.endsWith(
|
|
24
|
-
return cleanKey.replace(
|
|
15
|
+
if (cleanKey.endsWith(upperFirst(deviceType))) {
|
|
16
|
+
return cleanKey.replace(upperFirst(deviceType), '');
|
|
25
17
|
}
|
|
26
18
|
return cleanKey;
|
|
27
19
|
}, originalKey);
|
|
28
20
|
return withOutDeviceType;
|
|
29
21
|
};
|
|
30
22
|
function useStyles(props) {
|
|
31
|
-
const allDevicesTypes =
|
|
23
|
+
const allDevicesTypes = useUserDeviceContext();
|
|
32
24
|
const {
|
|
33
25
|
isMobile,
|
|
34
26
|
isTablet,
|
|
@@ -37,50 +29,50 @@ function useStyles(props) {
|
|
|
37
29
|
} = allDevicesTypes;
|
|
38
30
|
|
|
39
31
|
// prettier-ignore
|
|
40
|
-
const deviceBasePart =
|
|
32
|
+
const deviceBasePart = useMemo(() => isMobile && 'Mobile' || isTablet && 'Tablet' || isDesktop && 'Desktop' || '', [isMobile, isTablet, isDesktop]);
|
|
41
33
|
/*
|
|
42
34
|
* rule of prop key:
|
|
43
35
|
*
|
|
44
|
-
* first is style second is div
|
|
36
|
+
* first is style second is div target third is device
|
|
45
37
|
* paddingHorizontal GridInnerWrapper MobileNormal
|
|
46
38
|
*
|
|
47
39
|
* paddingHorizontalGridInnerWrapperMobileNormal: "10px"
|
|
48
40
|
*/
|
|
49
41
|
|
|
50
|
-
const currentDevice =
|
|
51
|
-
const deviceTypes = Object.keys(allDevicesTypes).map(key =>
|
|
42
|
+
const currentDevice = useMemo(() => {
|
|
43
|
+
const deviceTypes = Object.keys(allDevicesTypes).map(key => camelCase(key.replace('is', '')));
|
|
52
44
|
|
|
53
45
|
// if "fullNamedDeviceTypes.isMobileLarge": true - that our device
|
|
54
46
|
let currentDevice = Object.keys(fullNamedDeviceTypes).find(key => fullNamedDeviceTypes[key]);
|
|
55
47
|
if (!currentDevice) {
|
|
56
48
|
currentDevice = deviceBasePart;
|
|
57
49
|
}
|
|
58
|
-
currentDevice =
|
|
50
|
+
currentDevice = upperFirst(camelCase(currentDevice.replace('is', '')));
|
|
59
51
|
DEVICE_TYPES = deviceTypes;
|
|
60
52
|
|
|
61
53
|
// Set non-existent "currentDevice" value, to collect default styles later
|
|
62
54
|
return currentDevice || '__DEVICE_IS_NOT_FOUND__';
|
|
63
55
|
}, [allDevicesTypes, deviceBasePart]);
|
|
64
|
-
const collectedStyles =
|
|
56
|
+
const collectedStyles = useMemo(() => {
|
|
65
57
|
const resultStyles = {};
|
|
66
58
|
|
|
67
59
|
// For every component props
|
|
68
60
|
Object.entries(props).forEach(([propKey, propValue]) => {
|
|
69
61
|
// Collect list of possible styles for propKey. e.g:
|
|
70
62
|
// "borderLeftWidthWrapperInnerMobileNormal" to ["border", "borderLeftWidth"]
|
|
71
|
-
const possibleStyleAttributes = styleAttributes.
|
|
63
|
+
const possibleStyleAttributes = styleAttributes.filter(styleAttribute => {
|
|
72
64
|
return propKey.startsWith(styleAttribute);
|
|
73
65
|
});
|
|
74
66
|
|
|
75
67
|
// Get longest style key (e.g. "borderLeftWidth")
|
|
76
|
-
const currentStyleAttribute =
|
|
68
|
+
const currentStyleAttribute = maxBy(possibleStyleAttributes, 'length');
|
|
77
69
|
if (currentStyleAttribute) {
|
|
78
70
|
const isStyleForCurrentDevice = propKey.toLowerCase().endsWith(currentDevice.toLowerCase());
|
|
79
71
|
let value = null;
|
|
80
72
|
|
|
81
73
|
// e.g. "GridWrapperInner"
|
|
82
74
|
const targetElementKey = removeDeviceType(propKey.replace(currentStyleAttribute, ''));
|
|
83
|
-
const targetElementResultKey =
|
|
75
|
+
const targetElementResultKey = camelCase(targetElementKey) || 'styles';
|
|
84
76
|
if (!resultStyles[targetElementResultKey]) {
|
|
85
77
|
resultStyles[targetElementResultKey] = {};
|
|
86
78
|
}
|
|
@@ -132,4 +124,4 @@ function useStyles(props) {
|
|
|
132
124
|
return collectedStyles;
|
|
133
125
|
}
|
|
134
126
|
|
|
135
|
-
|
|
127
|
+
export { useStyles };
|
package/dist/index.d.ts
ADDED