@itcase/ui 1.3.31 → 1.3.33
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/Badge-BX4N91_C.js +250 -0
- package/dist/Badge-CGHosmYx.js +246 -0
- package/dist/Button-BtAUGGPc.js +287 -0
- package/dist/Button-HKkjJ38v.js +291 -0
- package/dist/Divider-BQcBkzt1.js +30 -0
- package/dist/Divider-ImOOytuN.js +34 -0
- package/dist/{DropdownItem-FNOztnTT.js → DropdownItem-BiiEhR49.js} +12 -16
- package/dist/{DropdownItem-Bq-oPnWX.js → DropdownItem-g5jWbyJy.js} +12 -16
- package/dist/Group-Chtnas-J.js +40 -0
- package/dist/Group-DiMnEfge.js +36 -0
- package/dist/{Icon-pUvizy3W.js → Icon-GVGrUu_Z.js} +6 -6
- package/dist/{Icon-BdHr6E6M.js → Icon-htF_V35Y.js} +7 -7
- package/dist/{Image-BbBG_UGI.js → Image-BEGwuGBM.js} +4 -4
- package/dist/{Image-D-QHhsrC.js → Image-DWfyapuD.js} +4 -4
- package/dist/{Input-BrV5_NoV.js → Input-COFdaiTe.js} +3 -3
- package/dist/{Input-ffioh1sj.js → Input-Dwvk-poq.js} +3 -3
- package/dist/Label-Dpeq55TV.js +233 -0
- package/dist/Label-XTFwl1aq.js +237 -0
- package/dist/{Link-CxWmYMyL.js → Link-B38Hn4G2.js} +5 -5
- package/dist/{Link-DN2LhPjD.js → Link-BhJ5BdyS.js} +6 -6
- package/dist/Loader-CBEbIRnd.js +69 -0
- package/dist/Loader-CsPvc-9g.js +65 -0
- package/dist/{MenuItem-CLDNk2l8.js → MenuItem-Cjlnmfwh.js} +6 -6
- package/dist/{MenuItem-amqx61Y0.js → MenuItem-PJkuGghn.js} +6 -6
- package/dist/{Overlay-B9nOIfLe.js → Overlay-BKh07Vb2.js} +4 -4
- package/dist/{Overlay-Yf9EEclM.js → Overlay-DiCjwUv4.js} +4 -4
- package/dist/{Text-Beslj4Ns.js → Text-C49zj3jO.js} +7 -7
- package/dist/{Text-JayJa3hj.js → Text-C6NSmetx.js} +7 -7
- package/dist/{Title-BfKF5WvZ.js → Title-BWWyRwLY.js} +4 -4
- package/dist/{Title-C7Qv9WfS.js → Title-Dck3eHNM.js} +4 -4
- package/dist/{Tooltip-AodzD-7D.js → Tooltip-BYgzNVYI.js} +18 -14
- package/dist/{Tooltip-BDEyAnd-.js → Tooltip-DpBQQoNo.js} +18 -14
- package/dist/cjs/components/Accordion.js +25 -29
- package/dist/cjs/components/Avatar.js +22 -20
- package/dist/cjs/components/Badge.js +12 -7
- package/dist/cjs/components/Breadcrumbs.js +16 -21
- package/dist/cjs/components/Button.js +13 -13
- package/dist/cjs/components/Card.js +9 -9
- package/dist/cjs/components/Cell.js +36 -17
- package/dist/cjs/components/Checkbox.js +13 -13
- package/dist/cjs/components/Checkmark.js +25 -23
- package/dist/cjs/components/Chips.js +22 -17
- package/dist/cjs/components/Choice.js +13 -13
- package/dist/cjs/components/Code.js +9 -19
- package/dist/cjs/components/CookiesWarning.js +15 -15
- package/dist/cjs/components/DadataHintField.js +4 -3
- package/dist/cjs/components/DatePicker.js +43 -19
- package/dist/cjs/components/Divider.js +7 -7
- package/dist/cjs/components/Dot.js +7 -7
- package/dist/cjs/components/Dropdown.js +9 -9
- package/dist/cjs/components/Flex.js +12 -11
- package/dist/cjs/components/Grid.js +12 -12
- package/dist/cjs/components/Group.js +6 -6
- package/dist/cjs/components/HTMLContent.js +7 -7
- package/dist/cjs/components/HeroTitle.js +9 -9
- package/dist/cjs/components/Icon.js +10 -10
- package/dist/cjs/components/Image.js +6 -6
- package/dist/cjs/components/Input.js +4 -3
- package/dist/cjs/components/InputMask.js +16 -15
- package/dist/cjs/components/InputPassword.js +12 -16
- package/dist/cjs/components/Label.js +10 -10
- package/dist/cjs/components/Link.js +6 -6
- package/dist/cjs/components/List.js +13 -12
- package/dist/cjs/components/Loader.js +8 -8
- package/dist/cjs/components/Logo.js +17 -15
- package/dist/cjs/components/Menu.js +11 -15
- package/dist/cjs/components/MenuItem.js +8 -8
- package/dist/cjs/components/Modal.js +11 -16
- package/dist/cjs/components/ModalSheetBottom.js +3 -3
- package/dist/cjs/components/Notification.js +8 -8
- package/dist/cjs/components/Overlay.js +6 -6
- package/dist/cjs/components/Pagination.js +14 -14
- package/dist/cjs/components/Panel.js +9 -9
- package/dist/cjs/components/Radio.js +16 -19
- package/dist/cjs/components/RangeSlider.js +7 -7
- package/dist/cjs/components/Response.js +15 -15
- package/dist/cjs/components/SVGContent.js +7 -7
- package/dist/cjs/components/ScrollOnDrag.js +8 -11
- package/dist/cjs/components/ScrollToView.js +9 -9
- package/dist/cjs/components/Search.js +16 -19
- package/dist/cjs/components/Segmented.js +8 -8
- package/dist/cjs/components/Select.js +34 -34
- package/dist/cjs/components/Swiper.js +11 -14
- package/dist/cjs/components/Switch.js +1 -1
- package/dist/cjs/components/Tab.js +76 -74
- package/dist/cjs/components/Text.js +6 -6
- package/dist/cjs/components/Textarea.js +8 -11
- package/dist/cjs/components/Tile.js +24 -20
- package/dist/cjs/components/Title.js +8 -8
- package/dist/cjs/components/Tooltip.js +9 -9
- package/dist/cjs/components/Video.js +4 -3
- package/dist/cjs/context/UIContext.js +48 -17
- package/dist/cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +121 -0
- package/dist/cjs/hooks/useDevicePropsGenerator.js +17 -0
- package/dist/cjs/hooks/useDeviceTargetClass.js +8 -3
- package/dist/cjs/hooks/useMediaQueries/useMediaQueries.js +129 -0
- package/dist/cjs/hooks/useMediaQueries.js +4 -122
- package/dist/cjs/hooks/{styleAttributes.js → useStyles/styleAttributes.js} +8 -1
- package/dist/cjs/hooks/useStyles/useStyles.js +190 -0
- package/dist/cjs/hooks/useStyles.js +10 -174
- package/dist/components/Accordion.js +26 -30
- package/dist/components/Avatar.js +22 -20
- package/dist/components/Badge.js +13 -8
- package/dist/components/Breadcrumbs.js +17 -22
- package/dist/components/Button.js +13 -13
- package/dist/components/Card.js +10 -10
- package/dist/components/Cell.js +37 -18
- package/dist/components/Checkbox.js +14 -14
- package/dist/components/Checkmark.js +25 -23
- package/dist/components/Chips.js +22 -17
- package/dist/components/Choice.js +14 -14
- package/dist/components/Code.js +10 -20
- package/dist/components/CookiesWarning.js +16 -16
- package/dist/components/DadataHintField.js +5 -4
- package/dist/components/DatePicker.js +44 -20
- package/dist/components/Divider.js +7 -7
- package/dist/components/Dot.js +8 -8
- package/dist/components/Dropdown.js +10 -10
- package/dist/components/Flex.js +13 -12
- package/dist/components/Grid.js +13 -13
- package/dist/components/Group.js +7 -7
- package/dist/components/HTMLContent.js +8 -8
- package/dist/components/HeroTitle.js +9 -9
- package/dist/components/Icon.js +11 -11
- package/dist/components/Image.js +7 -7
- package/dist/components/Input.js +5 -4
- package/dist/components/InputMask.js +17 -16
- package/dist/components/InputPassword.js +13 -17
- package/dist/components/Label.js +10 -10
- package/dist/components/Link.js +7 -7
- package/dist/components/List.js +14 -13
- package/dist/components/Loader.js +8 -8
- package/dist/components/Logo.js +17 -15
- package/dist/components/Menu.js +12 -16
- package/dist/components/MenuItem.js +9 -9
- package/dist/components/Modal.js +12 -17
- package/dist/components/ModalSheetBottom.js +4 -4
- package/dist/components/Notification.js +9 -9
- package/dist/components/Overlay.js +7 -7
- package/dist/components/Pagination.js +15 -15
- package/dist/components/Panel.js +10 -10
- package/dist/components/Radio.js +17 -20
- package/dist/components/RangeSlider.js +8 -8
- package/dist/components/Response.js +16 -16
- package/dist/components/SVGContent.js +8 -8
- package/dist/components/ScrollOnDrag.js +9 -12
- package/dist/components/ScrollToView.js +10 -10
- package/dist/components/Search.js +17 -20
- package/dist/components/Segmented.js +9 -9
- package/dist/components/Select.js +35 -35
- package/dist/components/Swiper.js +12 -15
- package/dist/components/Switch.js +1 -1
- package/dist/components/Tab.js +76 -74
- package/dist/components/Text.js +7 -7
- package/dist/components/Textarea.js +9 -12
- package/dist/components/Tile.js +24 -20
- package/dist/components/Title.js +8 -8
- package/dist/components/Tooltip.js +9 -9
- package/dist/components/Video.js +4 -3
- package/dist/context/Notifications.js +1 -1
- package/dist/context/UIContext.js +50 -18
- package/dist/css/components/Accordion/Accordion.css +5 -8
- package/dist/css/components/Accordion/Accordion.tokens.css +2 -1
- package/dist/css/components/Avatar/Avatar.css +12 -8
- package/dist/css/components/Avatar/Avatar.tokens.css +2 -0
- package/dist/css/components/Badge/Badge.css +48 -26
- package/dist/css/components/Badge/Badge.tokens.css +48 -18
- package/dist/css/components/Button/Button.css +67 -303
- package/dist/css/components/Button/Button.tokens.css +37 -115
- package/dist/css/components/Cell/Cell.css +2 -2
- package/dist/css/components/Checkbox/Checkbox.css +10 -4
- package/dist/css/components/Checkbox/Checkbox.tokens.css +1 -1
- package/dist/css/components/Checkmark/Checkmark.css +11 -10
- package/dist/css/components/Checkmark/Checkmark.tokens.css +20 -14
- package/dist/css/components/Chips/Chips.css +47 -43
- package/dist/css/components/Chips/Chips.tokens.css +35 -7
- package/dist/css/components/Choice/Choice.css +13 -2
- package/dist/css/components/Choice/Choice.tokens.css +4 -3
- package/dist/css/components/DadataHintField/DadataHintField.css +0 -8
- package/dist/css/components/DadataHintField/DadataHintField.tokens.css +7 -2
- package/dist/css/components/DatePicker/DatePicker.css +126 -42
- package/dist/css/components/DatePicker/DatePicker.tokens.css +20 -7
- package/dist/css/components/Divider/Divider.css +17 -16
- package/dist/css/components/Divider/Divider.tokens.css +13 -0
- package/dist/css/components/Dot/Dot.css +10 -0
- package/dist/css/components/Drawer/Drawer.css +4 -0
- package/dist/css/components/Drawer/Drawer.tokens.css +4 -0
- package/dist/css/components/Dropdown/Dropdown.css +37 -0
- package/dist/css/components/Dropdown/Dropdown.tokens.css +6 -0
- package/dist/css/components/Flex/Flex.css +0 -1
- package/dist/css/components/Grid/Grid.css +1 -5
- package/dist/css/components/HeroTitle/HeroTitle.css +2 -2
- package/dist/css/components/Icon/Icon.css +14 -10
- package/dist/css/components/Icon/Icon.tokens.css +3 -1
- package/dist/css/components/Image/Image.css +3 -3
- package/dist/css/components/Input/Input.css +29 -0
- package/dist/css/components/InputPassword/InputPassword.css +23 -0
- package/dist/css/components/Label/Label.css +21 -2
- package/dist/css/components/Label/Label.tokens.css +3 -3
- package/dist/css/components/Loader/Loader.css +12 -5
- package/dist/css/components/Logo/Logo.css +3 -19
- package/dist/css/components/Logo/Logo.tokens.css +17 -2
- package/dist/css/components/Menu/Menu.css +9 -1
- package/dist/css/components/MenuItem/MenuItem.css +0 -10
- package/dist/css/components/MenuItem/MenuItem.tokens.css +12 -4
- package/dist/css/components/Modal/Modal.css +3 -0
- package/dist/css/components/Modal/Modal.tokens.css +3 -0
- package/dist/css/components/Pagination/Pagination.css +25 -0
- package/dist/css/components/Radio/Radio.css +0 -3
- package/dist/css/components/Radio/Radio.tokens.css +2 -1
- package/dist/css/components/ScrollToView/ScrollToView.css +4 -4
- package/dist/css/components/Search/Search.css +16 -0
- package/dist/css/components/Search/Search.tokens.css +6 -3
- package/dist/css/components/Segmented/Segmented.css +6 -0
- package/dist/css/components/Segmented/Segmented.tokens.css +2 -0
- package/dist/css/components/Select/Select.css +35 -8
- package/dist/css/components/Select/Select.tokens.css +12 -17
- package/dist/css/components/Select/css/__control/select__control_fill.css +4 -2
- package/dist/css/components/Select/css/__menu/select__menu-list-item_size.css +1 -1
- package/dist/css/components/Swiper/Swiper.css +2 -3
- package/dist/css/components/Switch/Switch.css +0 -7
- package/dist/css/components/Tab/Tab.css +28 -0
- package/dist/css/components/Text/Text.css +2 -2
- package/dist/css/components/Textarea/Textarea.css +7 -0
- package/dist/css/components/Title/Title.css +2 -2
- package/dist/css/components/Tooltip/Tooltip.css +15 -21
- package/dist/css/components/Tooltip/Tooltip.tokens.css +13 -0
- package/dist/css/styles/fill/fill.css +14 -9
- package/dist/css/styles/fill/fill_active.css +6 -3
- package/dist/css/styles/fill/fill_active_hover.css +8 -6
- package/dist/css/styles/fill/fill_disabled.css +6 -3
- package/dist/css/styles/fill/fill_hover.css +6 -3
- package/dist/css/styles/shape-strength/shape-strength.css +22 -0
- package/dist/css/styles/svg-color/svg_fill.css +27 -17
- package/dist/css/styles/svg-color/svg_fill_hover.css +12 -10
- package/dist/css/styles/svg-color/svg_path_fill.css +13 -9
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +119 -0
- package/dist/hooks/useDevicePropsGenerator.js +11 -0
- package/dist/hooks/useDeviceTargetClass.js +8 -3
- package/dist/hooks/useMediaQueries/useMediaQueries.js +127 -0
- package/dist/hooks/useMediaQueries.js +3 -125
- package/dist/hooks/{styleAttributes.js → useStyles/styleAttributes.js} +8 -1
- package/dist/hooks/useStyles/useStyles.js +188 -0
- package/dist/hooks/useStyles.js +9 -177
- package/dist/stories/AlignContent.mdx +1 -1
- package/dist/stories/AlignItems.mdx +1 -1
- package/dist/stories/AlignSelf.mdx +1 -1
- package/dist/stories/Appearance.mdx +1 -1
- package/dist/stories/Avatar.mdx +1 -1
- package/dist/stories/Checkbox.mdx +1 -1
- package/dist/stories/Checkmark.mdx +7 -3
- package/dist/stories/Chips.mdx +1 -1
- package/dist/stories/Choice.mdx +1 -1
- package/dist/stories/Code.mdx +1 -1
- package/dist/stories/Columns.mdx +1 -1
- package/dist/stories/Components.mdx +197 -0
- package/dist/stories/DatePicker.mdx +1 -1
- package/dist/stories/Dev.mdx +1 -1
- package/dist/stories/DevMode.mdx +1 -1
- package/dist/stories/Direction.mdx +1 -1
- package/dist/stories/Divider.mdx +1 -1
- package/dist/stories/Dot.mdx +1 -1
- package/dist/stories/Drawer.mdx +1 -1
- package/dist/stories/Dropdown.mdx +2 -2
- package/dist/stories/DropdownItem.mdx +1 -1
- package/dist/stories/Group.mdx +1 -1
- package/dist/stories/Grow.mdx +1 -1
- package/dist/stories/HeroTitle.mdx +1 -1
- package/dist/stories/Icon.mdx +1 -1
- package/dist/stories/Image.mdx +1 -1
- package/dist/stories/Input.mdx +1 -1
- package/dist/stories/InputPassword.mdx +1 -1
- package/dist/stories/JustifyContent.mdx +1 -1
- package/dist/stories/Label.mdx +1 -1
- package/dist/stories/Loader.mdx +1 -1
- package/dist/stories/Logo.mdx +1 -1
- package/dist/stories/MenuItem.mdx +1 -1
- package/dist/stories/Message.mdx +1 -1
- package/dist/stories/Notification.mdx +1 -1
- package/dist/stories/Order.mdx +1 -1
- package/dist/stories/Overview.mdx +1 -1
- package/dist/stories/Pagination.mdx +1 -1
- package/dist/stories/Playground.mdx +1 -1
- package/dist/stories/Radio.mdx +1 -1
- package/dist/stories/Response.mdx +1 -1
- package/dist/stories/SearchInput.mdx +1 -1
- package/dist/stories/Segmented.mdx +1 -1
- package/dist/stories/Size.mdx +1 -1
- package/dist/stories/Skeleton.mdx +1 -1
- package/dist/stories/State.mdx +1 -1
- package/dist/stories/Switch.mdx +1 -1
- package/dist/stories/Text.mdx +1 -1
- package/dist/stories/Textarea.mdx +1 -1
- package/dist/stories/Tile.mdx +1 -1
- package/dist/stories/Title.mdx +1 -1
- package/dist/stories/Tooltip.mdx +1 -1
- package/dist/stories/WithTooltip.mdx +1 -1
- package/dist/stories/Wrap.mdx +1 -1
- package/dist/{tslib.es6-Bwu1Cn-t.js → tslib.es6-5FtW-kfi.js} +1 -1
- package/dist/types/appearance/defaultAppearance.d.ts +33 -0
- package/dist/types/appearance/index.d.ts +3 -0
- package/dist/types/appearance/styleAppearance.d.ts +14 -0
- package/dist/types/components/Accordion/Accordion.interface.d.ts +1 -1
- package/dist/types/components/Avatar/Avatar.interface.d.ts +1 -1
- package/dist/types/components/Badge/Badge.d.ts +0 -6
- package/dist/types/components/Badge/Badge.interface.d.ts +1 -1
- package/dist/types/components/Badge/appearance/badgeAccent.d.ts +39 -0
- package/dist/types/components/Badge/appearance/badgeDanger.d.ts +11 -0
- package/dist/types/components/Badge/appearance/badgeDisabled.d.ts +10 -0
- package/dist/types/components/Badge/appearance/badgeError.d.ts +12 -0
- package/dist/types/components/Badge/appearance/badgeInfo.d.ts +18 -0
- package/dist/types/components/Badge/appearance/badgePrimary.d.ts +11 -0
- package/dist/types/components/Badge/appearance/badgeSecondary.d.ts +11 -0
- package/dist/types/components/Badge/appearance/badgeSize.d.ts +32 -0
- package/dist/types/components/Badge/appearance/badgeStyle.d.ts +16 -0
- package/dist/types/components/Badge/appearance/badgeSuccess.d.ts +11 -0
- package/dist/types/components/Badge/appearance/badgeSurface.d.ts +29 -0
- package/dist/types/components/Badge/appearance/badgeWarning.d.ts +11 -0
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +0 -5
- package/dist/types/components/Breadcrumbs/Breadcrumbs.interface.d.ts +1 -1
- package/dist/types/components/Button/Button.interface.d.ts +1 -1
- package/dist/types/components/Button/appearance/buttonAccent.d.ts +50 -0
- package/dist/types/components/Button/appearance/buttonDanger.d.ts +11 -0
- package/dist/types/components/Button/appearance/buttonError.d.ts +11 -0
- package/dist/types/components/Button/appearance/buttonInfo.d.ts +21 -0
- package/dist/types/components/Button/appearance/buttonPrimary.d.ts +8 -0
- package/dist/types/components/Button/appearance/buttonSecondary.d.ts +8 -0
- package/dist/types/components/Button/appearance/buttonSize.d.ts +59 -0
- package/dist/types/components/Button/appearance/buttonStyle.d.ts +16 -0
- package/dist/types/components/Button/appearance/buttonSuccess.d.ts +11 -0
- package/dist/types/components/Button/appearance/buttonSurface.d.ts +25 -0
- package/dist/types/components/Button/appearance/buttonWarning.d.ts +11 -0
- package/dist/types/components/Button/stories/args.d.ts +49 -49
- package/dist/types/components/Card/Card.interface.d.ts +1 -1
- package/dist/types/components/Cell/Cell.interface.d.ts +1 -1
- package/dist/types/components/Checkbox/Checkbox.interface.d.ts +1 -1
- package/dist/types/components/Checkmark/Checkmark.interface.d.ts +1 -1
- package/dist/types/components/Chips/Chips.interface.d.ts +1 -1
- package/dist/types/components/Chips/stories/args.d.ts +2 -2
- package/dist/types/components/Choice/Choice.interface.d.ts +1 -1
- package/dist/types/components/Code/Code.d.ts +0 -15
- package/dist/types/components/Code/Code.interface.d.ts +1 -1
- package/dist/types/components/DadataHintField/DadataHintField.interface.d.ts +1 -1
- package/dist/types/components/Divider/Divider.d.ts +0 -5
- package/dist/types/components/Divider/Divider.interface.d.ts +1 -1
- package/dist/types/components/Dot/Dot.interface.d.ts +1 -1
- package/dist/types/components/Drawer/Drawer.interface.d.ts +1 -1
- package/dist/types/components/Dropdown/Dropdown.interface.d.ts +1 -1
- package/dist/types/components/Dropdown/DropdownItem.d.ts +0 -7
- package/dist/types/components/Flex/Flex.interface.d.ts +1 -1
- package/dist/types/components/Flex/stories/args.d.ts +1 -1
- package/dist/types/components/Grid/Grid.interface.d.ts +1 -1
- package/dist/types/components/Grid/stories/args.d.ts +2 -2
- package/dist/types/components/Group/Group.interface.d.ts +1 -1
- package/dist/types/components/Group/stories/args.d.ts +2 -2
- package/dist/types/components/HTMLContent/HTMLContent.interface.d.ts +1 -1
- package/dist/types/components/HeroTitle/HeroTitle.interface.d.ts +1 -1
- package/dist/types/components/Icon/Icon.interface.d.ts +1 -1
- package/dist/types/components/Image/Image.interface.d.ts +1 -1
- package/dist/types/components/Input/Input.interface.d.ts +1 -1
- package/dist/types/components/InputMask/Input.interface.d.ts +1 -1
- package/dist/types/components/InputPassword/InputPassword.d.ts +0 -6
- package/dist/types/components/InputPassword/InputPassword.interface.d.ts +1 -1
- package/dist/types/components/Label/Label.interface.d.ts +1 -1
- package/dist/types/components/Label/appearance/labelAccent.d.ts +13 -0
- package/dist/types/components/Label/appearance/labelDanger.d.ts +11 -0
- package/dist/types/components/Label/appearance/labelError.d.ts +11 -0
- package/dist/types/components/Label/appearance/labelGradient.d.ts +11 -0
- package/dist/types/components/Label/appearance/labelInfo.d.ts +21 -0
- package/dist/types/components/Label/appearance/labelPrimary.d.ts +8 -0
- package/dist/types/components/Label/appearance/labelSecondary.d.ts +8 -0
- package/dist/types/components/Label/appearance/labelSize.d.ts +59 -0
- package/dist/types/components/Label/appearance/labelStyle.d.ts +16 -0
- package/dist/types/components/Label/appearance/labelSuccess.d.ts +11 -0
- package/dist/types/components/Label/appearance/labelSurface.d.ts +24 -0
- package/dist/types/components/Label/appearance/labelWarning.d.ts +11 -0
- package/dist/types/components/Link/Link.interface.d.ts +1 -1
- package/dist/types/components/List/List.interface.d.ts +1 -1
- package/dist/types/components/Loader/Loader.interface.d.ts +1 -1
- package/dist/types/components/Loader/appearance/loaderAccent.d.ts +7 -0
- package/dist/types/components/Loader/appearance/loaderPrimary.d.ts +7 -0
- package/dist/types/components/Loader/appearance/loaderSecondary.d.ts +7 -0
- package/dist/types/components/Loader/appearance/loaderSurface.d.ts +15 -0
- package/dist/types/components/Logo/Logo.interface.d.ts +1 -1
- package/dist/types/components/Menu/Menu.d.ts +0 -5
- package/dist/types/components/Menu/Menu.interface.d.ts +1 -1
- package/dist/types/components/MenuItem/MenuItem.interface.d.ts +1 -1
- package/dist/types/components/Modal/Modal.interface.d.ts +1 -1
- package/dist/types/components/Notification/Notification.interface.d.ts +1 -1
- package/dist/types/components/Overlay/Overlay.interface.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.interface.d.ts +1 -1
- package/dist/types/components/Panel/Panel.interface.d.ts +1 -1
- package/dist/types/components/Radio/Radio.d.ts +0 -5
- package/dist/types/components/Radio/Radio.interface.d.ts +1 -1
- package/dist/types/components/RangeSlider/RangeSlider.interface.d.ts +1 -1
- package/dist/types/components/Response/Response.interface.d.ts +1 -1
- package/dist/types/components/Response/stories/args.d.ts +4 -4
- package/dist/types/components/SVGContent/SVGContent.interface.d.ts +1 -1
- package/dist/types/components/ScrollOnDrag/ScrollOnDrag.d.ts +0 -5
- package/dist/types/components/ScrollOnDrag/ScrollOnDrag.interface.d.ts +1 -1
- package/dist/types/components/Scrollbar/Scrollbar.interface.d.ts +1 -1
- package/dist/types/components/Search/Search.interface.d.ts +1 -1
- package/dist/types/components/Segmented/Segmented.interface.d.ts +1 -1
- package/dist/types/components/Swiper/Swiper.d.ts +0 -5
- package/dist/types/components/Swiper/Swiper.interface.d.ts +1 -1
- package/dist/types/components/Switch/Switch.interface.d.ts +1 -1
- package/dist/types/components/Tab/Tab.interface.d.ts +1 -1
- package/dist/types/components/Tab/stories/args.d.ts +3 -3
- package/dist/types/components/Text/Text.interface.d.ts +1 -1
- package/dist/types/components/Textarea/Textarea.d.ts +0 -5
- package/dist/types/components/Textarea/Textarea.interface.d.ts +1 -1
- package/dist/types/components/Tile/Tile.d.ts +0 -5
- package/dist/types/components/Tile/Tile.interface.d.ts +1 -1
- package/dist/types/components/Title/Title.interface.d.ts +1 -1
- package/dist/types/components/Tooltip/Tooltip.interface.d.ts +1 -1
- package/dist/types/components/Video/Video.interface.d.ts +1 -1
- package/dist/types/context/UIContext.d.ts +8 -12
- package/dist/types/hooks/useDevicePropsGenerator/index.d.ts +1 -0
- package/dist/types/hooks/useDevicePropsGenerator/useDevicePropsGenerator.d.ts +3 -0
- package/dist/types/hooks/{useDeviceTargetClassGenerator.interface.d.ts → useDevicePropsGenerator/useDevicePropsGenerator.interface.d.ts} +2 -2
- package/dist/types/hooks/useMediaQueries/index.d.ts +1 -0
- package/dist/types/hooks/useStyles/index.d.ts +1 -0
- package/dist/types/hooks/useStyles/styleAttributes.d.ts +4 -0
- package/dist/types/types/componentProps/appearanceKeys.d.ts +1 -1
- package/dist/types/types/componentProps/borderColor.d.ts +1 -1
- package/dist/types/types/componentProps/fill.d.ts +1 -1
- package/package.json +15 -12
- package/dist/Badge-5gtVywXB.js +0 -111
- package/dist/Badge-DhOJoJgc.js +0 -115
- package/dist/Button-BSnodY9v.js +0 -103
- package/dist/Button-Kcw2DdY0.js +0 -99
- package/dist/Divider-DBvDCUqP.js +0 -30
- package/dist/Divider-Goh6mpPK.js +0 -34
- package/dist/Group-BY8OkVsS.js +0 -38
- package/dist/Group-c3ZkPu8e.js +0 -34
- package/dist/Label-CBwPiUuf.js +0 -97
- package/dist/Label-DgyUhGTQ.js +0 -93
- package/dist/Loader-Dn036JwE.js +0 -56
- package/dist/Loader-K_DJmah6.js +0 -52
- package/dist/cjs/hooks/useDeviceTargetClassGenerator.interface.js +0 -3
- package/dist/cjs/hooks/useDeviceTargetClassGenerator.js +0 -98
- package/dist/css/styles/column-gap/column-gap.css +0 -7
- package/dist/css/styles/gap/gap.css +0 -7
- package/dist/css/styles/row-gap/row-gap.css +0 -7
- package/dist/hooks/useDeviceTargetClassGenerator.interface.js +0 -1
- package/dist/hooks/useDeviceTargetClassGenerator.js +0 -96
- package/dist/stories/Badge.mdx +0 -20
- package/dist/stories/Button.mdx +0 -47
- package/dist/types/components/Badge/stories/args.d.ts +0 -69
- package/dist/types/hooks/styleAttributes.d.ts +0 -2
- package/dist/types/hooks/useDeviceTargetClassGenerator.d.ts +0 -3
- /package/dist/cjs/{hooks.js → hooks/useDevicePropsGenerator/useDevicePropsGenerator.interface.js} +0 -0
- /package/dist/cjs/hooks/{styleAttributes.interface.js → useStyles/styleAttributes.interface.js} +0 -0
- /package/dist/{hooks.js → hooks/useDevicePropsGenerator/useDevicePropsGenerator.interface.js} +0 -0
- /package/dist/hooks/{styleAttributes.interface.js → useStyles/styleAttributes.interface.js} +0 -0
- /package/dist/types/hooks/{useMediaQueries.d.ts → useMediaQueries/useMediaQueries.d.ts} +0 -0
- /package/dist/types/hooks/{styleAttributes.interface.d.ts → useStyles/styleAttributes.interface.d.ts} +0 -0
- /package/dist/types/hooks/{useStyles.d.ts → useStyles/useStyles.d.ts} +0 -0
|
@@ -1,182 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
var useStyles = require('./useStyles/useStyles.js');
|
|
4
|
+
require('react');
|
|
5
|
+
require('lodash/camelCase');
|
|
6
|
+
require('lodash/maxBy');
|
|
7
|
+
require('lodash/upperFirst');
|
|
8
|
+
require('../context/UIContext.js');
|
|
9
|
+
require('../../tslib.es6-CCZ3TN_7.js');
|
|
9
10
|
require('react/jsx-runtime');
|
|
10
|
-
require('./useMediaQueries.js');
|
|
11
|
+
require('./useMediaQueries/useMediaQueries.js');
|
|
11
12
|
require('react-responsive');
|
|
12
13
|
require('../utils/setViewportProperty.js');
|
|
14
|
+
require('./useStyles/styleAttributes.js');
|
|
13
15
|
|
|
14
|
-
let DEVICE_TYPES = [];
|
|
15
|
-
const removeDeviceType = originalKey => {
|
|
16
|
-
// Remove "mobile"/"tablet"/"desktop"
|
|
17
|
-
const withOutDeviceType = DEVICE_TYPES.reduce((cleanKey, deviceType) => {
|
|
18
|
-
if (cleanKey.endsWith(upperFirst(deviceType))) {
|
|
19
|
-
return cleanKey.replace(upperFirst(deviceType), '');
|
|
20
|
-
}
|
|
21
|
-
return cleanKey;
|
|
22
|
-
}, originalKey);
|
|
23
|
-
return withOutDeviceType;
|
|
24
|
-
};
|
|
25
16
|
|
|
26
|
-
/*
|
|
27
|
-
* rule of prop key:
|
|
28
|
-
*
|
|
29
|
-
* first is style second is div target third is device
|
|
30
|
-
* paddingHorizontal GridInnerWrapper MobileNormal
|
|
31
|
-
*
|
|
32
|
-
* paddingHorizontalGridInnerWrapperMobileNormal: "10px"
|
|
33
|
-
*/
|
|
34
|
-
function useStyles(props) {
|
|
35
|
-
const allDevicesTypes = UIContext.useUserDeviceContext();
|
|
36
|
-
const {
|
|
37
|
-
isMobile,
|
|
38
|
-
isTablet,
|
|
39
|
-
isDesktop,
|
|
40
|
-
...fullNamedDeviceTypes
|
|
41
|
-
} = allDevicesTypes;
|
|
42
17
|
|
|
43
|
-
|
|
44
|
-
const deviceBasePart = React.useMemo(() => isMobile && 'Mobile' || isTablet && 'Tablet' || isDesktop && 'Desktop' || '', [isMobile, isTablet, isDesktop]);
|
|
45
|
-
const currentDevice = React.useMemo(() => {
|
|
46
|
-
const deviceTypes = Object.keys(allDevicesTypes).map(key => camelCase(key.replace('is', '')));
|
|
47
|
-
|
|
48
|
-
// if "fullNamedDeviceTypes.isMobileLarge": true - that our device
|
|
49
|
-
let currentDevice = Object.keys(fullNamedDeviceTypes).find(key => fullNamedDeviceTypes[key]);
|
|
50
|
-
if (!currentDevice) {
|
|
51
|
-
currentDevice = deviceBasePart;
|
|
52
|
-
}
|
|
53
|
-
currentDevice = upperFirst(camelCase(currentDevice.replace('is', '')));
|
|
54
|
-
DEVICE_TYPES = deviceTypes;
|
|
55
|
-
|
|
56
|
-
// Set non-existent "currentDevice" value, to collect default styles later
|
|
57
|
-
return currentDevice || '__DEVICE_IS_NOT_FOUND__';
|
|
58
|
-
}, [allDevicesTypes, deviceBasePart]);
|
|
59
|
-
const propsStyleAttributes = React.useMemo(() => {
|
|
60
|
-
const styles = Object.entries(props).reduce((result, [propKey, propValue]) => {
|
|
61
|
-
// Collect list of possible styles for propKey. e.g:
|
|
62
|
-
// "borderLeftWidthWrapperInnerMobileNormal" to ["border", "borderLeftWidth"]
|
|
63
|
-
const possibleStyleAttributesList = styleAttributes.default.filter(styleAttribute => {
|
|
64
|
-
return propKey.startsWith(styleAttribute);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
// Get longest style key (e.g. "borderLeftWidth")
|
|
68
|
-
const targetStyleAttribute = maxBy(possibleStyleAttributesList, 'length');
|
|
69
|
-
if (targetStyleAttribute) {
|
|
70
|
-
result[propKey] = propValue;
|
|
71
|
-
}
|
|
72
|
-
return result;
|
|
73
|
-
}, {});
|
|
74
|
-
return styles;
|
|
75
|
-
// "props" object maybe big and frequently changing
|
|
76
|
-
}, [props]);
|
|
77
|
-
const collectedStyles = React.useMemo(() => {
|
|
78
|
-
const resultStylesGroups = {};
|
|
79
|
-
for (const [propKey, propValue] of Object.entries(propsStyleAttributes)) {
|
|
80
|
-
let value = null;
|
|
81
|
-
const possibleStyleAttributesList = styleAttributes.default.filter(styleAttribute => {
|
|
82
|
-
return propKey.startsWith(styleAttribute);
|
|
83
|
-
});
|
|
84
|
-
const styleAttributeKey = maxBy(possibleStyleAttributesList, 'length');
|
|
85
|
-
const isStyleForCurrentDevice = propKey.toLowerCase().endsWith(currentDevice.toLowerCase());
|
|
86
|
-
|
|
87
|
-
// e.g. "GridWrapperInner"
|
|
88
|
-
const targetElementKey = removeDeviceType(propKey.replace(styleAttributeKey, ''));
|
|
89
|
-
const targetElementGroupKey = camelCase(targetElementKey) || 'styles';
|
|
90
|
-
if (!resultStylesGroups[targetElementGroupKey]) {
|
|
91
|
-
resultStylesGroups[targetElementGroupKey] = {};
|
|
92
|
-
}
|
|
93
|
-
if (isStyleForCurrentDevice) {
|
|
94
|
-
value = propValue;
|
|
95
|
-
} else {
|
|
96
|
-
const propKeyWithOutDeviceType = `${styleAttributeKey}${targetElementKey}`;
|
|
97
|
-
const propKeyWithBaseDeviceType = `${propKeyWithOutDeviceType}${deviceBasePart}`;
|
|
98
|
-
const defaultValue = props[propKeyWithBaseDeviceType] || props[propKeyWithOutDeviceType];
|
|
99
|
-
let currentValue = resultStylesGroups[targetElementGroupKey][styleAttributeKey];
|
|
100
|
-
if (propKeyWithOutDeviceType.includes('Horizontal')) {
|
|
101
|
-
const keyLeft = styleAttributeKey.replace('Horizontal', 'Left');
|
|
102
|
-
currentValue = resultStylesGroups[targetElementGroupKey][keyLeft];
|
|
103
|
-
} else if (propKeyWithOutDeviceType.includes('Vertical')) {
|
|
104
|
-
const keyTop = styleAttributeKey.replace('Vertical', 'Top');
|
|
105
|
-
currentValue = resultStylesGroups[targetElementGroupKey][keyTop];
|
|
106
|
-
}
|
|
107
|
-
if (!currentValue) {
|
|
108
|
-
value = defaultValue;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (value) {
|
|
112
|
-
// Check not digit symbols. Chars means some unit ("px", "em", "rem" or custom "m")
|
|
113
|
-
const isValueHasUnit = /\D/.test(value);
|
|
114
|
-
// If value has some unit
|
|
115
|
-
if (isValueHasUnit) {
|
|
116
|
-
// Check value on our custom "m"(module) unit
|
|
117
|
-
/** Pattern for:
|
|
118
|
-
* 1m
|
|
119
|
-
* 1.5m
|
|
120
|
-
* 1m 1m 1.5m
|
|
121
|
-
* 0 0 1m 1m
|
|
122
|
-
*/
|
|
123
|
-
const isValueHasModuleUnit = /\d+\.?\d*m\s?(?![a-zA-Z]+)/.test(value);
|
|
124
|
-
// If value has module unit
|
|
125
|
-
if (isValueHasModuleUnit) {
|
|
126
|
-
/** Order for shorthand properties:
|
|
127
|
-
* top
|
|
128
|
-
* right
|
|
129
|
-
* bottom
|
|
130
|
-
* left
|
|
131
|
-
* or:
|
|
132
|
-
* top
|
|
133
|
-
* right and left
|
|
134
|
-
* bottom
|
|
135
|
-
* or:
|
|
136
|
-
* top and bottom
|
|
137
|
-
* right and left
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
const valuePxPartsList = value.split(' ').map(valuePart => {
|
|
141
|
-
const valueModule = valuePart.replace(/[a-z]/gi, '');
|
|
142
|
-
const valuePx = parseFloat(valueModule) * 8;
|
|
143
|
-
return `${valuePx}px`;
|
|
144
|
-
}, []);
|
|
145
|
-
value = valuePxPartsList.join(' ');
|
|
146
|
-
}
|
|
147
|
-
} else {
|
|
148
|
-
// Some properties doesn't have any units
|
|
149
|
-
const ignorePX = ['zIndex', 'order', 'flexGrow'].includes(styleAttributeKey);
|
|
150
|
-
if (!ignorePX) {
|
|
151
|
-
// Add px to non-unit value
|
|
152
|
-
value = `${value}px`;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (styleAttributeKey.includes('Horizontal')) {
|
|
156
|
-
const keyRight = styleAttributeKey.replace('Horizontal', 'Right');
|
|
157
|
-
const keyLeft = styleAttributeKey.replace('Horizontal', 'Left');
|
|
158
|
-
const valuePartsList = value.split(' ');
|
|
159
|
-
const valueRight = valuePartsList[0];
|
|
160
|
-
const valueLeft = valuePartsList[1] || valuePartsList[0];
|
|
161
|
-
resultStylesGroups[targetElementGroupKey][keyRight] = valueRight;
|
|
162
|
-
resultStylesGroups[targetElementGroupKey][keyLeft] = valueLeft;
|
|
163
|
-
} else if (styleAttributeKey.includes('Vertical')) {
|
|
164
|
-
const keyTop = styleAttributeKey.replace('Vertical', 'Top');
|
|
165
|
-
const keyBottom = styleAttributeKey.replace('Vertical', 'Bottom');
|
|
166
|
-
const valuePartsList = value.split(' ');
|
|
167
|
-
const valueTop = valuePartsList[0];
|
|
168
|
-
const valueBottom = valuePartsList[1] || valuePartsList[0];
|
|
169
|
-
resultStylesGroups[targetElementGroupKey][keyTop] = valueTop;
|
|
170
|
-
resultStylesGroups[targetElementGroupKey][keyBottom] = valueBottom;
|
|
171
|
-
} else {
|
|
172
|
-
resultStylesGroups[targetElementGroupKey][styleAttributeKey] = value;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return resultStylesGroups;
|
|
177
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
178
|
-
}, [deviceBasePart, currentDevice, ...Object.values(propsStyleAttributes)]);
|
|
179
|
-
return collectedStyles;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
exports.useStyles = useStyles;
|
|
18
|
+
exports.useStyles = useStyles.useStyles;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as __spreadArray } from '../tslib.es6-5FtW-kfi.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React, { useCallback, useState, useMemo } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import castArray from 'lodash/castArray';
|
|
6
|
-
import {
|
|
7
|
-
import { useStyles } from '../hooks/useStyles.js';
|
|
6
|
+
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
7
|
+
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
8
8
|
import { icon16 } from '@itcase/icons/default';
|
|
9
|
-
import { D as Divider } from '../Divider-
|
|
10
|
-
import { I as Icon } from '../Icon-
|
|
11
|
-
import { T as Text } from '../Text-
|
|
9
|
+
import { D as Divider } from '../Divider-BQcBkzt1.js';
|
|
10
|
+
import { I as Icon } from '../Icon-htF_V35Y.js';
|
|
11
|
+
import { T as Text } from '../Text-C6NSmetx.js';
|
|
12
12
|
import 'lodash/camelCase';
|
|
13
|
+
import 'lodash/upperFirst';
|
|
13
14
|
import '../context/UIContext.js';
|
|
14
|
-
import '../hooks/useMediaQueries.js';
|
|
15
|
+
import '../hooks/useMediaQueries/useMediaQueries.js';
|
|
15
16
|
import 'react-responsive';
|
|
16
17
|
import '../utils/setViewportProperty.js';
|
|
17
18
|
import 'lodash/maxBy';
|
|
18
|
-
import '
|
|
19
|
-
import '../hooks/styleAttributes.js';
|
|
19
|
+
import '../hooks/useStyles/styleAttributes.js';
|
|
20
20
|
import 'react-inlinesvg';
|
|
21
|
-
import '../Link-
|
|
22
|
-
import '../Tooltip-
|
|
23
|
-
import '../Title-
|
|
21
|
+
import '../Link-BhJ5BdyS.js';
|
|
22
|
+
import '../Tooltip-BYgzNVYI.js';
|
|
23
|
+
import '../Title-Dck3eHNM.js';
|
|
24
24
|
|
|
25
25
|
var accordionAppearance = {
|
|
26
26
|
dev: {},
|
|
@@ -36,25 +36,27 @@ var accordionItemConfig = {
|
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
function AccordionItem(props) {
|
|
39
|
-
var id = props.id, children = props.children,
|
|
39
|
+
var id = props.id, className = props.className, appearance = props.appearance, children = props.children, title = props.title, titleTextColor = props.titleTextColor, titleTextSize = props.titleTextSize, titleTextWeight = props.titleTextWeight, afterContent = props.afterContent, beforeContent = props.beforeContent, content = props.content, contentTextColor = props.contentTextColor, contentTextSize = props.contentTextSize, contentTextWeight = props.contentTextWeight, dividerDirection = props.dividerDirection, dividerFill = props.dividerFill, dividerSize = props.dividerSize, icon = props.icon, _a = props.iconFill, iconFill = _a === void 0 ? 'surfaceItemAccent' : _a, showDivider = props.showDivider, size = props.size, isExpanded = props.isExpanded, onClick = props.onClick;
|
|
40
40
|
var onClickTitle = useCallback(function () {
|
|
41
41
|
// "!isExpanded" - is next state of expanded
|
|
42
42
|
var thisItemData = {
|
|
43
43
|
id: id,
|
|
44
|
-
isExpanded: !isExpanded,
|
|
45
|
-
content: content,
|
|
46
44
|
title: title,
|
|
45
|
+
content: content,
|
|
46
|
+
isExpanded: !isExpanded,
|
|
47
47
|
};
|
|
48
48
|
onClick && onClick(thisItemData);
|
|
49
49
|
}, [id, title, content, isExpanded, onClick]);
|
|
50
50
|
// @ts-expect-error
|
|
51
|
-
var appearanceConfig = accordionItemConfig.appearance &&
|
|
52
|
-
|
|
53
|
-
var
|
|
51
|
+
var appearanceConfig = accordionItemConfig.appearance &&
|
|
52
|
+
accordionItemConfig.appearance[appearance];
|
|
53
|
+
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
54
|
+
var fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, titleBorderColorClass = propsGenerator.titleBorderColorClass, titleFillClass = propsGenerator.titleFillClass, titleFillHoverClass = propsGenerator.titleFillHoverClass, contentBorderColorClass = propsGenerator.contentBorderColorClass, contentFillClass = propsGenerator.contentFillClass, contentFillHoverClass = propsGenerator.contentFillHoverClass, shapeClass = propsGenerator.shapeClass;
|
|
54
55
|
// @ts-expect-error
|
|
55
56
|
var styles = useStyles(props).styles;
|
|
56
|
-
return (jsxs("div", { className: clsx('accordion-item', className, borderColorClass && "border-color_".concat(borderColorClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), shapeClass && "accordion-item_shape_".concat(shapeClass), size && "accordion-item_size_".concat(size), isExpanded && 'accordion-item_state_open'), style: styles, children: [jsx(Text, { className: clsx('accordion-item__title', titleBorderColorClass && "border-color_".concat(titleBorderColorClass), titleFillClass && "fill_".concat(titleFillClass), titleFillHoverClass && "fill_hover_".concat(titleFillHoverClass), 'cursor_type_pointer'),
|
|
57
|
-
(
|
|
57
|
+
return (jsxs("div", { className: clsx('accordion-item', className, borderColorClass && "border-color_".concat(borderColorClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), shapeClass && "accordion-item_shape_".concat(shapeClass), size && "accordion-item_size_".concat(size), isExpanded && 'accordion-item_state_open'), style: styles, children: [jsx(Text, { className: clsx('accordion-item__title', titleBorderColorClass && "border-color_".concat(titleBorderColorClass), titleFillClass && "fill_".concat(titleFillClass), titleFillHoverClass && "fill_hover_".concat(titleFillHoverClass), 'cursor_type_pointer'), textColor: titleTextColor, textWeight: titleTextWeight, size: titleTextSize, onClick: onClickTitle, children: title }), jsx("div", { className: clsx('accordion-item__icon', 'cursor_type_pointer'), onClick: onClickTitle, children: icon || (jsx(Icon, { iconFill: iconFill, size: "16", SvgImage: icon16.ChevronDown })) }), beforeContent && beforeContent, showDivider && (jsx(Divider, { width: "fill", direction: dividerDirection, fill: dividerFill || 'surfaceTertiary', size: dividerSize })), isExpanded && (jsx("div", { className: clsx('accordion-item__content', contentBorderColorClass &&
|
|
58
|
+
"border-color_".concat(contentBorderColorClass), contentFillClass && "fill_".concat(contentFillClass), contentFillHoverClass && "fill_hover_".concat(contentFillHoverClass)), children: children ||
|
|
59
|
+
(content && (jsx(Text, { textColor: contentTextColor, textWeight: contentTextWeight, size: contentTextSize, children: content }))) })), afterContent && afterContent] }));
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
var accordionConfig = {
|
|
@@ -64,7 +66,7 @@ var accordionConfig = {
|
|
|
64
66
|
},
|
|
65
67
|
};
|
|
66
68
|
function Accordion(props) {
|
|
67
|
-
var
|
|
69
|
+
var className = props.className, appearance = props.appearance, _a = props.initial, initial = _a === void 0 ? [] : _a, children = props.children, items = props.items, isMultiple = props.isMultiple, onClickItem = props.onClickItem;
|
|
68
70
|
var _b = useState(function () { return castArray(initial); }), expandedItems = _b[0], setExpandedItems = _b[1];
|
|
69
71
|
var onClickAccordionItem = useCallback(function (targetItem) {
|
|
70
72
|
setExpandedItems(function (prevState) {
|
|
@@ -92,7 +94,7 @@ function Accordion(props) {
|
|
|
92
94
|
}, [isMultiple, onClickItem]);
|
|
93
95
|
var accordionItemsList = useMemo(function () {
|
|
94
96
|
if (items) {
|
|
95
|
-
return items.map(function (item, i) { return (jsx(AccordionItem, {
|
|
97
|
+
return items.map(function (item, i) { return (jsx(AccordionItem, { id: item.id, title: item.title, content: item.content, isExpanded: expandedItems.includes(item.id), onClick: onClickAccordionItem }, "accordionItem_".concat(item.id || i + 1))); });
|
|
96
98
|
}
|
|
97
99
|
if (children) {
|
|
98
100
|
// @ts-ignore
|
|
@@ -110,15 +112,9 @@ function Accordion(props) {
|
|
|
110
112
|
}
|
|
111
113
|
return [];
|
|
112
114
|
}, [children, items, expandedItems, onClickAccordionItem]);
|
|
113
|
-
// @ts-expect-error
|
|
114
115
|
var appearanceConfig = accordionConfig.appearance && accordionConfig.appearance[appearance];
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
/*
|
|
118
|
-
* paddingHorizontalWrapper="16px"
|
|
119
|
-
* paddingHorizontal - styles (horizontal will be parsed to left/right)
|
|
120
|
-
* wrapper - target
|
|
121
|
-
*/
|
|
116
|
+
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
117
|
+
var directionClass = propsGenerator.directionClass, fillClass = propsGenerator.fillClass, borderColorClass = propsGenerator.borderColorClass, shapeClass = propsGenerator.shapeClass, widthClass = propsGenerator.widthClass;
|
|
122
118
|
// @ts-expect-error
|
|
123
119
|
var _c = useStyles(props), accordionStyles = _c.styles, accordionWrapperStyles = _c.wrapper;
|
|
124
120
|
return (jsx("div", { className: clsx(className, 'accordion', borderColorClass && "border-color_".concat(borderColorClass), directionClass && "accordion_direction_".concat(directionClass), fillClass && "fill_".concat(fillClass), shapeClass && "accordion_shape_".concat(shapeClass), widthClass && "width_".concat(widthClass)), style: accordionStyles, children: jsx("div", { className: "accordion__wrapper", style: accordionWrapperStyles, children: accordionItemsList }) }));
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
+
import { _ as __assign } from '../tslib.es6-5FtW-kfi.js';
|
|
1
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import { useMemo } from 'react';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
|
-
import {
|
|
5
|
-
import { I as Icon } from '../Icon-
|
|
6
|
-
import { I as Image } from '../Image-
|
|
7
|
-
import { T as Text } from '../Text-
|
|
8
|
-
import '../tslib.es6-Bwu1Cn-t.js';
|
|
5
|
+
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
|
+
import { I as Icon } from '../Icon-htF_V35Y.js';
|
|
7
|
+
import { I as Image } from '../Image-DWfyapuD.js';
|
|
8
|
+
import { T as Text } from '../Text-C6NSmetx.js';
|
|
9
9
|
import 'lodash/camelCase';
|
|
10
10
|
import 'lodash/castArray';
|
|
11
|
+
import 'lodash/upperFirst';
|
|
11
12
|
import '../context/UIContext.js';
|
|
12
|
-
import '../hooks/useMediaQueries.js';
|
|
13
|
+
import '../hooks/useMediaQueries/useMediaQueries.js';
|
|
13
14
|
import 'react-responsive';
|
|
14
15
|
import '../utils/setViewportProperty.js';
|
|
15
16
|
import 'react-inlinesvg';
|
|
16
|
-
import '../hooks/useStyles.js';
|
|
17
|
+
import '../hooks/useStyles/useStyles.js';
|
|
17
18
|
import 'lodash/maxBy';
|
|
18
|
-
import '
|
|
19
|
-
import '../
|
|
20
|
-
import '../
|
|
21
|
-
import '../
|
|
22
|
-
import '../Title-C7Qv9WfS.js';
|
|
19
|
+
import '../hooks/useStyles/styleAttributes.js';
|
|
20
|
+
import '../Link-BhJ5BdyS.js';
|
|
21
|
+
import '../Tooltip-BYgzNVYI.js';
|
|
22
|
+
import '../Title-Dck3eHNM.js';
|
|
23
23
|
|
|
24
24
|
var avatarAppearance = {
|
|
25
25
|
dev: {},
|
|
@@ -27,22 +27,24 @@ var avatarAppearance = {
|
|
|
27
27
|
|
|
28
28
|
var avatarConfig = {
|
|
29
29
|
appearance: avatarAppearance,
|
|
30
|
-
setAppearance: function (
|
|
31
|
-
avatarConfig.appearance =
|
|
30
|
+
setAppearance: function (appearanceConfig) {
|
|
31
|
+
avatarConfig.appearance = appearanceConfig;
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
function Avatar(props) {
|
|
35
|
-
var
|
|
35
|
+
var className = props.className, type = props.type, appearance = props.appearance, Dot = props.Dot, _a = props.firstName, firstName = _a === void 0 ? '' : _a, icon = props.icon, mode = props.mode, _b = props.secondName, secondName = _b === void 0 ? '' : _b, _c = props.size, size = _c === void 0 ? '96' : _c, src = props.src, before = props.before, after = props.after, onClick = props.onClick;
|
|
36
36
|
var avatarChars = useMemo(function () {
|
|
37
37
|
var firstChar = ((firstName === null || firstName === void 0 ? void 0 : firstName[0]) || '').toUpperCase();
|
|
38
38
|
var secondChar = ((secondName === null || secondName === void 0 ? void 0 : secondName[0]) || '').toUpperCase();
|
|
39
39
|
return "".concat(firstChar).concat(secondChar);
|
|
40
40
|
}, [firstName, secondName]);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultApperance, appearance) {
|
|
42
|
+
var _a;
|
|
43
|
+
return (__assign(__assign({}, resultApperance), (_a = avatarConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearance]));
|
|
44
|
+
}, {});
|
|
45
|
+
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
46
|
+
var fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, _d = propsGenerator.textColor, textColor = _d === void 0 ? 'surfaceTextTertiary' : _d, _e = propsGenerator.textSize, textSize = _e === void 0 ? 'l' : _e, _f = propsGenerator.textWeight, textWeight = _f === void 0 ? '600' : _f, iconFill = propsGenerator.iconFill, iconFillHover = propsGenerator.iconFillHover, iconFillSize = propsGenerator.iconFillSize, iconItemFill = propsGenerator.iconItemFill, iconShape = propsGenerator.iconShape, iconSize = propsGenerator.iconSize, iconSrc = propsGenerator.iconSrc, shapeClass = propsGenerator.shapeClass;
|
|
47
|
+
return (jsx("div", { className: clsx(className, 'avatar', shapeClass && "avatar_shape_".concat(shapeClass), mode && "avatar_mode_".concat(mode), size && "avatar_size_".concat(size), type && "avatar_type_".concat(type), Dot && 'avatar_status', onClick && 'cursor_type_pointer'), onClick: onClick, children: jsxs("div", { className: clsx('avatar__wrapper', fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass)), children: [before, src ? (jsx(Image, { className: "avatar__image", shape: "geometric", src: src })) : (jsx(Text, { className: "avatar__name", textColor: textColor, textWeight: textWeight, size: textSize, children: avatarChars })), (icon || iconSrc) && (jsx(Icon, { className: "avatar__icon", fill: iconFill, fillHover: iconFillHover, fillSize: iconFillSize, iconFill: iconItemFill, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon })), Dot, after] }) }));
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
export { Avatar, avatarAppearance, avatarConfig };
|
package/dist/components/Badge.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
export { B as Badge, b as badgeAppearance, a as badgeConfig } from '../Badge-
|
|
2
|
-
import '../tslib.es6-
|
|
1
|
+
export { B as Badge, b as badgeAppearance, a as badgeConfig } from '../Badge-CGHosmYx.js';
|
|
2
|
+
import '../tslib.es6-5FtW-kfi.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'clsx';
|
|
5
|
-
import '../hooks/
|
|
5
|
+
import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'lodash/camelCase';
|
|
8
8
|
import 'lodash/castArray';
|
|
9
|
+
import 'lodash/upperFirst';
|
|
9
10
|
import '../context/UIContext.js';
|
|
10
|
-
import '../hooks/useMediaQueries.js';
|
|
11
|
+
import '../hooks/useMediaQueries/useMediaQueries.js';
|
|
11
12
|
import 'react-responsive';
|
|
12
13
|
import '../utils/setViewportProperty.js';
|
|
13
|
-
import '../hooks/useStyles.js';
|
|
14
|
+
import '../hooks/useStyles/useStyles.js';
|
|
14
15
|
import 'lodash/maxBy';
|
|
15
|
-
import '
|
|
16
|
-
import '../
|
|
17
|
-
import '
|
|
16
|
+
import '../hooks/useStyles/styleAttributes.js';
|
|
17
|
+
import '../Icon-htF_V35Y.js';
|
|
18
|
+
import 'react-inlinesvg';
|
|
19
|
+
import '../Link-BhJ5BdyS.js';
|
|
20
|
+
import '../Tooltip-BYgzNVYI.js';
|
|
21
|
+
import '../Text-C6NSmetx.js';
|
|
22
|
+
import '../Title-Dck3eHNM.js';
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as __rest, _ as __assign } from '../tslib.es6-5FtW-kfi.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import camelCase from 'lodash/camelCase';
|
|
6
|
-
import {
|
|
7
|
-
import { useStyles } from '../hooks/useStyles.js';
|
|
8
|
-
import { I as Icon } from '../Icon-
|
|
9
|
-
import { L as LinkWrapper } from '../Link-
|
|
10
|
-
import { T as Text } from '../Text-
|
|
6
|
+
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
7
|
+
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
8
|
+
import { I as Icon } from '../Icon-htF_V35Y.js';
|
|
9
|
+
import { L as LinkWrapper } from '../Link-BhJ5BdyS.js';
|
|
10
|
+
import { T as Text } from '../Text-C6NSmetx.js';
|
|
11
11
|
import 'lodash/castArray';
|
|
12
|
+
import 'lodash/upperFirst';
|
|
12
13
|
import '../context/UIContext.js';
|
|
13
|
-
import '../hooks/useMediaQueries.js';
|
|
14
|
+
import '../hooks/useMediaQueries/useMediaQueries.js';
|
|
14
15
|
import 'react-responsive';
|
|
15
16
|
import '../utils/setViewportProperty.js';
|
|
16
17
|
import 'lodash/maxBy';
|
|
17
|
-
import '
|
|
18
|
-
import '../hooks/styleAttributes.js';
|
|
18
|
+
import '../hooks/useStyles/styleAttributes.js';
|
|
19
19
|
import 'react-inlinesvg';
|
|
20
|
-
import '../Tooltip-
|
|
21
|
-
import '../Title-
|
|
20
|
+
import '../Tooltip-BYgzNVYI.js';
|
|
21
|
+
import '../Title-Dck3eHNM.js';
|
|
22
22
|
|
|
23
23
|
function BreadcrumbsItem(props) {
|
|
24
24
|
var children = props.children, cursor = props.cursor, className = props.className, href = props.href, iconAfter = props.iconAfter, iconAfterBgFill = props.iconAfterBgFill, iconAfterFill = props.iconAfterFill, iconAfterSize = props.iconAfterSize, _a = props.set, set = _a === void 0 ? 'default' : _a, text = props.text, textColor = props.textColor, textColorHover = props.textColorHover, textSize = props.textSize, onClick = props.onClick;
|
|
25
|
-
var
|
|
26
|
-
var fillClass =
|
|
25
|
+
var propsGenerator = useDevicePropsGenerator(props);
|
|
26
|
+
var fillClass = propsGenerator.fillClass, positionClass = propsGenerator.positionClass, shapeClass = propsGenerator.shapeClass, underlineClass = propsGenerator.underlineClass;
|
|
27
27
|
// @ts-expect-error
|
|
28
28
|
var itemStyles = useStyles(props).styles;
|
|
29
29
|
return (jsxs(LinkWrapper, { className: clsx(className, 'breadcrumbs__item', set && "breadcrumbs__item_set_".concat(set), fillClass && "fill_".concat(fillClass), positionClass && "position_".concat(positionClass), shapeClass && "breadcrumbs__item_shape_".concat(shapeClass), underlineClass && "text-decoration_".concat(underlineClass), onClick && (cursor || 'cursor_type_pointer')), DefaultComponent: "div", href: href, style: itemStyles, onClick: onClick, children: [jsx(Text, { className: "breadcrumbs__item-text", size: textSize, textColor: textColor, textColorHover: textColorHover, children: text || children }), iconAfter && (jsx(Icon, { className: "breadcrumbs__item-icon", fill: iconAfterFill, bgFill: iconAfterBgFill, size: iconAfterSize, SvgImage: iconAfter }))] }));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function Breadcrumbs(props) {
|
|
33
|
-
var
|
|
33
|
+
var className = props.className, children = props.children, breadcrumbsList = props.breadcrumbsList, iconAfterBgFill = props.iconAfterBgFill, iconAfterFill = props.iconAfterFill, iconAfterSize = props.iconAfterSize, itemTextColor = props.itemTextColor, itemTextColorHover = props.itemTextColorHover, itemUnderline = props.itemUnderline, set = props.set, otherProps = __rest(props, ["className", "children", "breadcrumbsList", "iconAfterBgFill", "iconAfterFill", "iconAfterSize", "itemTextColor", "itemTextColorHover", "itemUnderline", "set"]);
|
|
34
34
|
var breadcrumbsItemsList = useMemo(function () {
|
|
35
35
|
if (breadcrumbsList) {
|
|
36
36
|
var itemProps_1 = Object.entries(otherProps).reduce(function (collectedProps, _a) {
|
|
@@ -42,23 +42,18 @@ function Breadcrumbs(props) {
|
|
|
42
42
|
}
|
|
43
43
|
return collectedProps;
|
|
44
44
|
}, {});
|
|
45
|
-
return breadcrumbsList.map(function (item, i) { return (jsx(BreadcrumbsItem, __assign({ href: item.href,
|
|
46
|
-
// @ts-expect-error
|
|
47
|
-
iconAfter: i + 1 !== breadcrumbsList.length ? itemProps_1.iconAfter : null, iconAfterBgFill: iconAfterBgFill, iconAfterFill: iconAfterFill, iconAfterSize: iconAfterSize, text: item.text, textColor: itemTextColor, textColorHover: itemTextColorHover, underline: itemUnderline, set: i + 1 !== breadcrumbsList.length ? 'default' : 'current' }, itemProps_1), "breadcrumbsItem_".concat(item.id || item.text))); });
|
|
45
|
+
return breadcrumbsList.map(function (item, i) { return (jsx(BreadcrumbsItem, __assign({ text: item.text, textColor: itemTextColor, textColorHover: itemTextColorHover, href: item.href, iconAfter: i + 1 !== breadcrumbsList.length ? itemProps_1.iconAfter : null, iconAfterBgFill: iconAfterBgFill, iconAfterFill: iconAfterFill, iconAfterSize: iconAfterSize, underline: itemUnderline, set: i + 1 !== breadcrumbsList.length ? 'default' : 'current' }, itemProps_1), "breadcrumbsItem_".concat(item.id || item.text))); });
|
|
48
46
|
}
|
|
49
47
|
if (children) {
|
|
50
48
|
return children;
|
|
51
49
|
}
|
|
52
50
|
return [];
|
|
53
51
|
}, [children, breadcrumbsList, otherProps]);
|
|
54
|
-
var
|
|
55
|
-
var
|
|
52
|
+
var propsGenerator = useDevicePropsGenerator(props);
|
|
53
|
+
var _a = propsGenerator.directionClass, directionClass = _a === void 0 ? 'horizontal' : _a, fillClass = propsGenerator.fillClass, positionClass = propsGenerator.positionClass, shapeClass = propsGenerator.shapeClass, widthClass = propsGenerator.widthClass;
|
|
56
54
|
// @ts-expect-error
|
|
57
55
|
var breadcrumbsStyles = useStyles(props).styles;
|
|
58
56
|
return (jsx("div", { className: clsx(className, 'breadcrumbs', widthClass && "width_".concat(widthClass), directionClass && "direction_".concat(directionClass), fillClass && "fill_".concat(fillClass), positionClass && "position_".concat(positionClass), shapeClass && "breadcrumbs_shape_".concat(shapeClass), set && "breadcrumbs_set_".concat(set)), style: breadcrumbsStyles, children: breadcrumbsItemsList }));
|
|
59
57
|
}
|
|
60
|
-
Breadcrumbs.defaultProps = {
|
|
61
|
-
direction: 'horizontal',
|
|
62
|
-
};
|
|
63
58
|
|
|
64
59
|
export { Breadcrumbs, BreadcrumbsItem };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export { B as Button, a as buttonAppearance, b as buttonConfig } from '../Button-
|
|
1
|
+
export { B as Button, a as buttonAppearance, b as buttonConfig } from '../Button-BtAUGGPc.js';
|
|
2
|
+
import '../tslib.es6-5FtW-kfi.js';
|
|
2
3
|
import 'react/jsx-runtime';
|
|
3
4
|
import 'react';
|
|
4
5
|
import 'clsx';
|
|
5
|
-
import '../hooks/
|
|
6
|
-
import '../tslib.es6-Bwu1Cn-t.js';
|
|
6
|
+
import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
7
7
|
import 'lodash/camelCase';
|
|
8
8
|
import 'lodash/castArray';
|
|
9
|
+
import 'lodash/upperFirst';
|
|
9
10
|
import '../context/UIContext.js';
|
|
10
|
-
import '../hooks/useMediaQueries.js';
|
|
11
|
+
import '../hooks/useMediaQueries/useMediaQueries.js';
|
|
11
12
|
import 'react-responsive';
|
|
12
13
|
import '../utils/setViewportProperty.js';
|
|
13
|
-
import '../hooks/useStyles.js';
|
|
14
|
+
import '../hooks/useStyles/useStyles.js';
|
|
14
15
|
import 'lodash/maxBy';
|
|
15
|
-
import '
|
|
16
|
-
import '../
|
|
17
|
-
import '../Icon-BdHr6E6M.js';
|
|
16
|
+
import '../hooks/useStyles/styleAttributes.js';
|
|
17
|
+
import '../Icon-htF_V35Y.js';
|
|
18
18
|
import 'react-inlinesvg';
|
|
19
|
-
import '../Link-
|
|
20
|
-
import '../Tooltip-
|
|
21
|
-
import '../Text-
|
|
22
|
-
import '../Title-
|
|
23
|
-
import '../Loader-
|
|
19
|
+
import '../Link-BhJ5BdyS.js';
|
|
20
|
+
import '../Tooltip-BYgzNVYI.js';
|
|
21
|
+
import '../Text-C6NSmetx.js';
|
|
22
|
+
import '../Title-Dck3eHNM.js';
|
|
23
|
+
import '../Loader-CsPvc-9g.js';
|
package/dist/components/Card.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import {
|
|
4
|
-
import { I as Image } from '../Image-
|
|
5
|
-
import { T as Text } from '../Text-
|
|
6
|
-
import '../tslib.es6-
|
|
3
|
+
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
4
|
+
import { I as Image } from '../Image-DWfyapuD.js';
|
|
5
|
+
import { T as Text } from '../Text-C6NSmetx.js';
|
|
6
|
+
import '../tslib.es6-5FtW-kfi.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
import 'lodash/camelCase';
|
|
9
9
|
import 'lodash/castArray';
|
|
10
|
+
import 'lodash/upperFirst';
|
|
10
11
|
import '../context/UIContext.js';
|
|
11
|
-
import '../hooks/useMediaQueries.js';
|
|
12
|
+
import '../hooks/useMediaQueries/useMediaQueries.js';
|
|
12
13
|
import 'react-responsive';
|
|
13
14
|
import '../utils/setViewportProperty.js';
|
|
14
|
-
import '../hooks/useStyles.js';
|
|
15
|
+
import '../hooks/useStyles/useStyles.js';
|
|
15
16
|
import 'lodash/maxBy';
|
|
16
|
-
import '
|
|
17
|
-
import '../hooks/styleAttributes.js';
|
|
17
|
+
import '../hooks/useStyles/styleAttributes.js';
|
|
18
18
|
|
|
19
19
|
function Card(props) {
|
|
20
20
|
var children = props.children, className = props.className, image = props.image, _a = props.imageShape, imageShape = _a === void 0 ? 'rounded' : _a, size = props.size, src = props.src, text = props.text, _b = props.textColor, textColor = _b === void 0 ? 'surfaceTextPrimary' : _b, _c = props.textSize, textSize = _c === void 0 ? 'p' : _c, textTag = props.textTag, title = props.title, _d = props.titleColor, titleColor = _d === void 0 ? 'surfaceTextPrimary' : _d, _e = props.titleSize, titleSize = _e === void 0 ? 'h5' : _e, _f = props.titleTag, titleTag = _f === void 0 ? 'span' : _f, type = props.type, onClick = props.onClick;
|
|
21
|
-
var
|
|
22
|
-
var shapeClass =
|
|
21
|
+
var propsGenerator = useDevicePropsGenerator(props);
|
|
22
|
+
var shapeClass = propsGenerator.shapeClass, widthClass = propsGenerator.widthClass;
|
|
23
23
|
return (jsx("div", { className: clsx(className, 'card', shapeClass && "card_shape_".concat(shapeClass), size && "card_size_".concat(size), type && "card_type_".concat(type), widthClass && "resize-horizontal_".concat(widthClass)), onClick: onClick, children: jsxs("div", { className: "card__wrapper", children: [image, src && jsx(Image, { className: "card__image", shape: imageShape, src: src }), jsxs("div", { className: "card__data", children: [title && (jsx(Text, { className: "card__data-title", size: titleSize, tag: titleTag, textColor: titleColor, children: title })), text && (jsx(Text, { className: "card__data-desc", size: textSize, tag: textTag, textColor: textColor, children: text }))] }), children] }) }));
|
|
24
24
|
}
|
|
25
25
|
|