@itcase/ui 1.9.65 → 1.9.66
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/context/Notifications.js +12 -186
- package/dist/context/UIContext.js +12 -70
- package/dist/context/UrlAssetPrefix.js +12 -12
- package/dist/hoc/urlWithAssetPrefix.js +12 -74
- package/dist/hooks/useActiveClasses/useActiveClasses.helpers.js +1 -0
- package/dist/hooks/useActiveClasses/useActiveClasses.interface.js +1 -0
- package/dist/hooks/useActiveClasses/useActiveClasses.js +3 -1
- package/dist/hooks/useAppearanceConfig/useAppearanceConfig.js +12 -25
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.interface.js +1 -1
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +12 -121
- package/dist/hooks/useDeviceTargetClass.js +52 -37
- package/dist/hooks/useDropzoneFieldFiles.js +20540 -2
- package/dist/hooks/useHoldProgress.js +3 -1
- package/dist/hooks/useMediaQueries/useMediaQueries.js +12 -112
- package/dist/hooks/useStyles/styleAttributes.interface.js +1 -1
- package/dist/hooks/useStyles/styleAttributes.js +12 -167
- package/dist/hooks/useStyles/useStyles.js +12 -193
- package/dist/hooks/useViewportFix.js +2 -0
- package/dist/utils/mergeAppearanceKeys.js +12 -15
- package/dist/utils/setViewportProperty.js +12 -5
- package/package.json +1 -1
- package/dist/components/Accordion/Accordion.appearance.js +0 -9
- package/dist/components/Accordion/Accordion.interface.js +0 -1
- package/dist/components/Accordion/Accordion.js +0 -57
- package/dist/components/Accordion/AccordionItem.js +0 -36
- package/dist/components/Accordion/appearance/accordionSize.js +0 -52
- package/dist/components/Accordion/appearance/accordionStyle.js +0 -14
- package/dist/components/Accordion/appearance/accordionSurface.js +0 -36
- package/dist/components/Accordion/index.js +0 -4
- package/dist/components/Avatar/Avatar.appearance.js +0 -11
- package/dist/components/Avatar/Avatar.interface.js +0 -1
- package/dist/components/Avatar/Avatar.js +0 -29
- package/dist/components/Avatar/appearance/avatarDefault.js +0 -23
- package/dist/components/Avatar/appearance/avatarShape.js +0 -25
- package/dist/components/Avatar/appearance/avatarSize.js +0 -63
- package/dist/components/Avatar/appearance/avatarStyle.js +0 -16
- package/dist/components/Avatar/index.js +0 -2
- package/dist/components/AvatarStack/AvatarStack.appearance.js +0 -5
- package/dist/components/AvatarStack/AvatarStack.interface.js +0 -1
- package/dist/components/AvatarStack/AvatarStack.js +0 -25
- package/dist/components/AvatarStack/appearance/avatarStackSize.js +0 -21
- package/dist/components/AvatarStack/index.js +0 -2
- package/dist/components/Badge/Badge.appearance.js +0 -29
- package/dist/components/Badge/Badge.interface.js +0 -1
- package/dist/components/Badge/Badge.js +0 -35
- package/dist/components/Badge/appearance/badgeAccent.js +0 -31
- package/dist/components/Badge/appearance/badgeDanger.js +0 -10
- package/dist/components/Badge/appearance/badgeDisabled.js +0 -9
- package/dist/components/Badge/appearance/badgeError.js +0 -9
- package/dist/components/Badge/appearance/badgeExtra.js +0 -10
- package/dist/components/Badge/appearance/badgeInfo.js +0 -16
- package/dist/components/Badge/appearance/badgeShape.js +0 -25
- package/dist/components/Badge/appearance/badgeSize.js +0 -38
- package/dist/components/Badge/appearance/badgeSpecial.js +0 -10
- package/dist/components/Badge/appearance/badgeStyle.js +0 -14
- package/dist/components/Badge/appearance/badgeSuccess.js +0 -10
- package/dist/components/Badge/appearance/badgeSurface.js +0 -25
- package/dist/components/Badge/appearance/badgeWarning.js +0 -10
- package/dist/components/Badge/index.js +0 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.appearance.js +0 -11
- package/dist/components/Breadcrumbs/Breadcrumbs.interface.js +0 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +0 -23
- package/dist/components/Breadcrumbs/BreadcrumbsItem.js +0 -24
- package/dist/components/Breadcrumbs/appearance/breadcrumbsAccent.js +0 -9
- package/dist/components/Breadcrumbs/appearance/breadcrumbsSize.js +0 -39
- package/dist/components/Breadcrumbs/appearance/breadcrumbsStyle.js +0 -14
- package/dist/components/Breadcrumbs/appearance/breadcrumbsSurface.js +0 -27
- package/dist/components/Breadcrumbs/index.js +0 -4
- package/dist/components/Button/Button.appearance.js +0 -27
- package/dist/components/Button/Button.interface.js +0 -1
- package/dist/components/Button/Button.js +0 -46
- package/dist/components/Button/appearance/buttonAccent.js +0 -36
- package/dist/components/Button/appearance/buttonDanger.js +0 -24
- package/dist/components/Button/appearance/buttonError.js +0 -24
- package/dist/components/Button/appearance/buttonExtra.js +0 -22
- package/dist/components/Button/appearance/buttonInfo.js +0 -36
- package/dist/components/Button/appearance/buttonShape.js +0 -25
- package/dist/components/Button/appearance/buttonSize.js +0 -52
- package/dist/components/Button/appearance/buttonSpecial.js +0 -22
- package/dist/components/Button/appearance/buttonStyle.js +0 -14
- package/dist/components/Button/appearance/buttonSuccess.js +0 -24
- package/dist/components/Button/appearance/buttonSurface.js +0 -52
- package/dist/components/Button/appearance/buttonWarning.js +0 -24
- package/dist/components/Button/index.js +0 -2
- package/dist/components/Cell/Cell.appearance.js +0 -9
- package/dist/components/Cell/Cell.interface.js +0 -1
- package/dist/components/Cell/Cell.js +0 -36
- package/dist/components/Cell/appearance/cellSize.js +0 -59
- package/dist/components/Cell/appearance/cellStyle.js +0 -14
- package/dist/components/Cell/appearance/cellSurface.js +0 -51
- package/dist/components/Cell/index.js +0 -2
- package/dist/components/Checkbox/Checkbox.appearance.js +0 -19
- package/dist/components/Checkbox/Checkbox.interface.js +0 -1
- package/dist/components/Checkbox/Checkbox.js +0 -39
- package/dist/components/Checkbox/appearance/checkboxDefault.js +0 -16
- package/dist/components/Checkbox/appearance/checkboxDisabled.js +0 -16
- package/dist/components/Checkbox/appearance/checkboxError.js +0 -16
- package/dist/components/Checkbox/appearance/checkboxRequire.js +0 -16
- package/dist/components/Checkbox/appearance/checkboxShape.js +0 -10
- package/dist/components/Checkbox/appearance/checkboxSize.js +0 -23
- package/dist/components/Checkbox/appearance/checkboxStyle.js +0 -22
- package/dist/components/Checkbox/appearance/checkboxSuccess.js +0 -16
- package/dist/components/Checkbox/index.js +0 -2
- package/dist/components/Checkmark/Checkmark.appearance.js +0 -15
- package/dist/components/Checkmark/Checkmark.interface.js +0 -1
- package/dist/components/Checkmark/Checkmark.js +0 -33
- package/dist/components/Checkmark/appearance/checkmarkAccent.js +0 -10
- package/dist/components/Checkmark/appearance/checkmarkDisabled.js +0 -10
- package/dist/components/Checkmark/appearance/checkmarkError.js +0 -10
- package/dist/components/Checkmark/appearance/checkmarkSize.js +0 -32
- package/dist/components/Checkmark/appearance/checkmarkStyle.js +0 -14
- package/dist/components/Checkmark/appearance/checkmarkSurface.js +0 -21
- package/dist/components/Checkmark/index.js +0 -2
- package/dist/components/Chips/Chips.appearance.js +0 -29
- package/dist/components/Chips/Chips.interface.js +0 -1
- package/dist/components/Chips/Chips.js +0 -28
- package/dist/components/Chips/ChipsGroup.js +0 -19
- package/dist/components/Chips/appearance/chipsAccent.js +0 -24
- package/dist/components/Chips/appearance/chipsDanger.js +0 -17
- package/dist/components/Chips/appearance/chipsDisabled.js +0 -14
- package/dist/components/Chips/appearance/chipsError.js +0 -17
- package/dist/components/Chips/appearance/chipsExtra.js +0 -17
- package/dist/components/Chips/appearance/chipsInfo.js +0 -17
- package/dist/components/Chips/appearance/chipsShape.js +0 -25
- package/dist/components/Chips/appearance/chipsSize.js +0 -45
- package/dist/components/Chips/appearance/chipsSpecial.js +0 -17
- package/dist/components/Chips/appearance/chipsStyle.js +0 -14
- package/dist/components/Chips/appearance/chipsSuccess.js +0 -17
- package/dist/components/Chips/appearance/chipsSurface.js +0 -45
- package/dist/components/Chips/appearance/chipsWarning.js +0 -17
- package/dist/components/Chips/index.js +0 -3
- package/dist/components/Choice/Choice.appearance.js +0 -19
- package/dist/components/Choice/Choice.interface.js +0 -1
- package/dist/components/Choice/Choice.js +0 -57
- package/dist/components/Choice/appearance/choiceDefault.js +0 -37
- package/dist/components/Choice/appearance/choiceDisabled.js +0 -18
- package/dist/components/Choice/appearance/choiceError.js +0 -17
- package/dist/components/Choice/appearance/choiceRequire.js +0 -18
- package/dist/components/Choice/appearance/choiceShape.js +0 -25
- package/dist/components/Choice/appearance/choiceSize.js +0 -18
- package/dist/components/Choice/appearance/choiceStyle.js +0 -14
- package/dist/components/Choice/appearance/choiceSuccess.js +0 -18
- package/dist/components/Choice/index.js +0 -2
- package/dist/components/Code/Code.appearance.js +0 -19
- package/dist/components/Code/Code.interface.js +0 -1
- package/dist/components/Code/Code.js +0 -37
- package/dist/components/Code/appearance/codeDefault.js +0 -11
- package/dist/components/Code/appearance/codeDisabled.js +0 -12
- package/dist/components/Code/appearance/codeError.js +0 -12
- package/dist/components/Code/appearance/codeRequire.js +0 -12
- package/dist/components/Code/appearance/codeShape.js +0 -25
- package/dist/components/Code/appearance/codeSize.js +0 -13
- package/dist/components/Code/appearance/codeStyle.js +0 -16
- package/dist/components/Code/appearance/codeSuccess.js +0 -12
- package/dist/components/Code/index.js +0 -2
- package/dist/components/CookiesWarning/CookiesWarning.appearance.js +0 -5
- package/dist/components/CookiesWarning/CookiesWarning.interface.js +0 -1
- package/dist/components/CookiesWarning/CookiesWarning.js +0 -42
- package/dist/components/CookiesWarning/appearance/cookiesWarningDefault.js +0 -12
- package/dist/components/CookiesWarning/index.js +0 -3
- package/dist/components/Dadata/Dadata.interface.js +0 -1
- package/dist/components/Dadata/Dadata.js +0 -35
- package/dist/components/Dadata/index.js +0 -1
- package/dist/components/DatePeriod/DatePeriod.appearance.js +0 -9
- package/dist/components/DatePeriod/DatePeriod.interface.js +0 -1
- package/dist/components/DatePeriod/DatePeriod.js +0 -60
- package/dist/components/DatePeriod/appearance/datePeriodShape.js +0 -35
- package/dist/components/DatePeriod/appearance/datePeriodSize.js +0 -24
- package/dist/components/DatePeriod/appearance/datePeriodSurface.js +0 -17
- package/dist/components/DatePeriod/index.js +0 -2
- package/dist/components/DatePicker/DatePicker.appearance.js +0 -9
- package/dist/components/DatePicker/DatePicker.interface.js +0 -1
- package/dist/components/DatePicker/DatePicker.js +0 -110
- package/dist/components/DatePicker/DatePicker.utils.js +0 -12
- package/dist/components/DatePicker/appearance/datePickerSize.js +0 -31
- package/dist/components/DatePicker/appearance/datePickerStyle.js +0 -20
- package/dist/components/DatePicker/appearance/datePickerSurface.js +0 -14
- package/dist/components/DatePicker/index.js +0 -2
- package/dist/components/Divider/Divider.appearance.js +0 -19
- package/dist/components/Divider/Divider.interface.js +0 -1
- package/dist/components/Divider/Divider.js +0 -25
- package/dist/components/Divider/appearance/dividerAccent.js +0 -6
- package/dist/components/Divider/appearance/dividerError.js +0 -6
- package/dist/components/Divider/appearance/dividerExtra.js +0 -6
- package/dist/components/Divider/appearance/dividerSize.js +0 -12
- package/dist/components/Divider/appearance/dividerSpecial.js +0 -6
- package/dist/components/Divider/appearance/dividerSuccess.js +0 -6
- package/dist/components/Divider/appearance/dividerSurface.js +0 -15
- package/dist/components/Divider/appearance/dividerWarning.js +0 -6
- package/dist/components/Divider/index.js +0 -2
- package/dist/components/Dot/Dot.interface.js +0 -1
- package/dist/components/Dot/Dot.js +0 -12
- package/dist/components/Dot/index.js +0 -1
- package/dist/components/Drawer/Drawer.appearance.js +0 -7
- package/dist/components/Drawer/Drawer.constants.js +0 -16
- package/dist/components/Drawer/Drawer.interface.js +0 -1
- package/dist/components/Drawer/Drawer.js +0 -65
- package/dist/components/Drawer/appearance/drawerSize.js +0 -8
- package/dist/components/Drawer/appearance/drawerSurface.js +0 -10
- package/dist/components/Drawer/index.js +0 -2
- package/dist/components/Dropdown/Dropdown.appearance.js +0 -13
- package/dist/components/Dropdown/Dropdown.interface.js +0 -1
- package/dist/components/Dropdown/Dropdown.js +0 -56
- package/dist/components/Dropdown/DropdownItem.appearance.js +0 -13
- package/dist/components/Dropdown/DropdownItem.js +0 -31
- package/dist/components/Dropdown/appearance/dropdownAccent.js +0 -24
- package/dist/components/Dropdown/appearance/dropdownShape.js +0 -25
- package/dist/components/Dropdown/appearance/dropdownSize.js +0 -39
- package/dist/components/Dropdown/appearance/dropdownStyle.js +0 -14
- package/dist/components/Dropdown/appearance/dropdownSurface.js +0 -32
- package/dist/components/Dropdown/index.js +0 -4
- package/dist/components/Dropzone/Dropzone.appearance.js +0 -15
- package/dist/components/Dropzone/Dropzone.interface.js +0 -1
- package/dist/components/Dropzone/Dropzone.js +0 -131
- package/dist/components/Dropzone/appearance/dropzoneDefault.js +0 -17
- package/dist/components/Dropzone/appearance/dropzoneDisabled.js +0 -17
- package/dist/components/Dropzone/appearance/dropzoneError.js +0 -17
- package/dist/components/Dropzone/appearance/dropzoneRequire.js +0 -17
- package/dist/components/Dropzone/appearance/dropzoneShape.js +0 -25
- package/dist/components/Dropzone/appearance/dropzoneSuccess.js +0 -17
- package/dist/components/Dropzone/index.js +0 -1
- package/dist/components/Flex/Flex.interface.js +0 -1
- package/dist/components/Flex/Flex.js +0 -12
- package/dist/components/Flex/FlexItem.js +0 -13
- package/dist/components/Flex/index.js +0 -3
- package/dist/components/Grid/Grid.interface.js +0 -1
- package/dist/components/Grid/Grid.js +0 -12
- package/dist/components/Grid/GridItem.js +0 -12
- package/dist/components/Grid/GridRow.js +0 -12
- package/dist/components/Grid/index.js +0 -4
- package/dist/components/Group/Group.appearance.js +0 -2
- package/dist/components/Group/Group.interface.js +0 -1
- package/dist/components/Group/Group.js +0 -43
- package/dist/components/Group/index.js +0 -2
- package/dist/components/HTMLContent/HTMLContent.interface.js +0 -1
- package/dist/components/HTMLContent/HTMLContent.js +0 -12
- package/dist/components/HTMLContent/index.js +0 -1
- package/dist/components/HeroTitle/HeroTitle.appearance.js +0 -5
- package/dist/components/HeroTitle/HeroTitle.interface.js +0 -1
- package/dist/components/HeroTitle/HeroTitle.js +0 -30
- package/dist/components/HeroTitle/appearance/heroTitleSize.js +0 -21
- package/dist/components/HeroTitle/index.js +0 -2
- package/dist/components/Icon/Icon.appearance.js +0 -29
- package/dist/components/Icon/Icon.interface.js +0 -1
- package/dist/components/Icon/Icon.js +0 -69
- package/dist/components/Icon/appearance/iconAccent.js +0 -16
- package/dist/components/Icon/appearance/iconDanger.js +0 -10
- package/dist/components/Icon/appearance/iconDisabled.js +0 -9
- package/dist/components/Icon/appearance/iconError.js +0 -10
- package/dist/components/Icon/appearance/iconExtra.js +0 -10
- package/dist/components/Icon/appearance/iconInfo.js +0 -15
- package/dist/components/Icon/appearance/iconShape.js +0 -25
- package/dist/components/Icon/appearance/iconSize.js +0 -171
- package/dist/components/Icon/appearance/iconSpecial.js +0 -10
- package/dist/components/Icon/appearance/iconStyle.js +0 -14
- package/dist/components/Icon/appearance/iconSuccess.js +0 -10
- package/dist/components/Icon/appearance/iconSurface.js +0 -28
- package/dist/components/Icon/appearance/iconWarning.js +0 -10
- package/dist/components/Icon/index.js +0 -2
- package/dist/components/Image/Image.interface.js +0 -1
- package/dist/components/Image/Image.js +0 -33
- package/dist/components/Image/index.js +0 -1
- package/dist/components/Input/Input.appearance.js +0 -19
- package/dist/components/Input/Input.interface.js +0 -1
- package/dist/components/Input/Input.js +0 -22
- package/dist/components/Input/appearance/inputDefault.js +0 -21
- package/dist/components/Input/appearance/inputDisabled.js +0 -17
- package/dist/components/Input/appearance/inputError.js +0 -18
- package/dist/components/Input/appearance/inputRequire.js +0 -19
- package/dist/components/Input/appearance/inputShape.js +0 -25
- package/dist/components/Input/appearance/inputSize.js +0 -31
- package/dist/components/Input/appearance/inputStyle.js +0 -16
- package/dist/components/Input/appearance/inputSuccess.js +0 -18
- package/dist/components/Input/index.js +0 -2
- package/dist/components/InputNumber/InputNumber.appearance.js +0 -11
- package/dist/components/InputNumber/InputNumber.interfaces.js +0 -1
- package/dist/components/InputNumber/InputNumber.js +0 -44
- package/dist/components/InputNumber/appearance/InputNumberShape.js +0 -25
- package/dist/components/InputNumber/appearance/inputNumberSize.js +0 -28
- package/dist/components/InputNumber/appearance/inputNumberStyle.js +0 -16
- package/dist/components/InputNumber/appearance/inputNumberSurface.js +0 -16
- package/dist/components/InputNumber/index.js +0 -2
- package/dist/components/InputPassword/InputPassword.appearance.js +0 -19
- package/dist/components/InputPassword/InputPassword.interface.js +0 -1
- package/dist/components/InputPassword/InputPassword.js +0 -31
- package/dist/components/InputPassword/appearance/inputPasswordDefault.js +0 -24
- package/dist/components/InputPassword/appearance/inputPasswordDisabled.js +0 -21
- package/dist/components/InputPassword/appearance/inputPasswordError.js +0 -21
- package/dist/components/InputPassword/appearance/inputPasswordRequire.js +0 -21
- package/dist/components/InputPassword/appearance/inputPasswordShape.js +0 -25
- package/dist/components/InputPassword/appearance/inputPasswordSize.js +0 -38
- package/dist/components/InputPassword/appearance/inputPasswordStyle.js +0 -16
- package/dist/components/InputPassword/appearance/inputPasswordSuccess.js +0 -21
- package/dist/components/InputPassword/index.js +0 -2
- package/dist/components/Label/Label.appearance.js +0 -31
- package/dist/components/Label/Label.interface.js +0 -1
- package/dist/components/Label/Label.js +0 -32
- package/dist/components/Label/appearance/labelAccent.js +0 -21
- package/dist/components/Label/appearance/labelDanger.js +0 -17
- package/dist/components/Label/appearance/labelDisabled.js +0 -10
- package/dist/components/Label/appearance/labelError.js +0 -17
- package/dist/components/Label/appearance/labelExtra.js +0 -17
- package/dist/components/Label/appearance/labelGradient.js +0 -10
- package/dist/components/Label/appearance/labelInfo.js +0 -17
- package/dist/components/Label/appearance/labelShape.js +0 -25
- package/dist/components/Label/appearance/labelSize.js +0 -59
- package/dist/components/Label/appearance/labelSpecial.js +0 -17
- package/dist/components/Label/appearance/labelStyle.js +0 -14
- package/dist/components/Label/appearance/labelSuccess.js +0 -17
- package/dist/components/Label/appearance/labelSurface.js +0 -25
- package/dist/components/Label/appearance/labelWarning.js +0 -17
- package/dist/components/Label/index.js +0 -2
- package/dist/components/Link/Link.appearance.js +0 -29
- package/dist/components/Link/Link.interface.js +0 -1
- package/dist/components/Link/Link.js +0 -50
- package/dist/components/Link/appearance/linkAccent.js +0 -15
- package/dist/components/Link/appearance/linkDanger.js +0 -7
- package/dist/components/Link/appearance/linkDisabled.js +0 -13
- package/dist/components/Link/appearance/linkError.js +0 -9
- package/dist/components/Link/appearance/linkExtra.js +0 -8
- package/dist/components/Link/appearance/linkInfo.js +0 -17
- package/dist/components/Link/appearance/linkRequire.js +0 -12
- package/dist/components/Link/appearance/linkSize.js +0 -59
- package/dist/components/Link/appearance/linkSpecial.js +0 -8
- package/dist/components/Link/appearance/linkStyle.js +0 -16
- package/dist/components/Link/appearance/linkSuccess.js +0 -9
- package/dist/components/Link/appearance/linkSurface.js +0 -23
- package/dist/components/Link/appearance/linkWarning.js +0 -9
- package/dist/components/Link/index.js +0 -2
- package/dist/components/List/List.appearance.js +0 -25
- package/dist/components/List/List.interface.js +0 -1
- package/dist/components/List/List.js +0 -22
- package/dist/components/List/ListItem.js +0 -16
- package/dist/components/List/appearance/listAccent.js +0 -8
- package/dist/components/List/appearance/listDanger.js +0 -7
- package/dist/components/List/appearance/listError.js +0 -7
- package/dist/components/List/appearance/listExtra.js +0 -7
- package/dist/components/List/appearance/listInfo.js +0 -13
- package/dist/components/List/appearance/listSize.js +0 -24
- package/dist/components/List/appearance/listSpecial.js +0 -7
- package/dist/components/List/appearance/listStyle.js +0 -16
- package/dist/components/List/appearance/listSuccess.js +0 -7
- package/dist/components/List/appearance/listSurface.js +0 -19
- package/dist/components/List/appearance/listWarning.js +0 -7
- package/dist/components/List/index.js +0 -3
- package/dist/components/Loader/Loader.appearance.js +0 -25
- package/dist/components/Loader/Loader.interface.js +0 -1
- package/dist/components/Loader/Loader.js +0 -22
- package/dist/components/Loader/appearance/loaderAccent.js +0 -13
- package/dist/components/Loader/appearance/loaderDanger.js +0 -8
- package/dist/components/Loader/appearance/loaderError.js +0 -8
- package/dist/components/Loader/appearance/loaderExtra.js +0 -8
- package/dist/components/Loader/appearance/loaderInfo.js +0 -8
- package/dist/components/Loader/appearance/loaderSize.js +0 -15
- package/dist/components/Loader/appearance/loaderSpecial.js +0 -8
- package/dist/components/Loader/appearance/loaderStyle.js +0 -14
- package/dist/components/Loader/appearance/loaderSuccess.js +0 -8
- package/dist/components/Loader/appearance/loaderSurface.js +0 -18
- package/dist/components/Loader/appearance/loaderWarning.js +0 -8
- package/dist/components/Loader/index.js +0 -2
- package/dist/components/Logo/Logo.interface.js +0 -1
- package/dist/components/Logo/Logo.js +0 -23
- package/dist/components/Logo/index.js +0 -1
- package/dist/components/MenuItem/MenuItem.appearance.js +0 -15
- package/dist/components/MenuItem/MenuItem.interface.js +0 -1
- package/dist/components/MenuItem/MenuItem.js +0 -47
- package/dist/components/MenuItem/appearance/menuItemAccent.js +0 -27
- package/dist/components/MenuItem/appearance/menuItemError.js +0 -19
- package/dist/components/MenuItem/appearance/menuItemShape.js +0 -25
- package/dist/components/MenuItem/appearance/menuItemSize.js +0 -47
- package/dist/components/MenuItem/appearance/menuItemStyle.js +0 -14
- package/dist/components/MenuItem/appearance/menuItemSurface.js +0 -45
- package/dist/components/MenuItem/index.js +0 -2
- package/dist/components/Modal/Modal.appearance.js +0 -11
- package/dist/components/Modal/Modal.interface.js +0 -1
- package/dist/components/Modal/Modal.js +0 -139
- package/dist/components/Modal/ModalLoader.js +0 -6
- package/dist/components/Modal/appearance/modalShape.js +0 -25
- package/dist/components/Modal/appearance/modalSize.js +0 -28
- package/dist/components/Modal/appearance/modalStyle.js +0 -14
- package/dist/components/Modal/appearance/modalSurface.js +0 -8
- package/dist/components/Modal/index.js +0 -4
- package/dist/components/ModalSheetBottom/ModalSheetBottom.appearance.js +0 -5
- package/dist/components/ModalSheetBottom/ModalSheetBottom.interface.js +0 -1
- package/dist/components/ModalSheetBottom/ModalSheetBottom.js +0 -38
- package/dist/components/ModalSheetBottom/appearance/modalSheetBottomSize.js +0 -9
- package/dist/components/ModalSheetBottom/index.js +0 -2
- package/dist/components/Notification/Notification.appearance.js +0 -19
- package/dist/components/Notification/Notification.interface.js +0 -1
- package/dist/components/Notification/Notification.js +0 -26
- package/dist/components/Notification/NotificationWrapper.js +0 -12
- package/dist/components/Notification/appearance/notificationDefault.js +0 -16
- package/dist/components/Notification/appearance/notificationError.js +0 -16
- package/dist/components/Notification/appearance/notificationInfo.js +0 -16
- package/dist/components/Notification/appearance/notificationShape.js +0 -25
- package/dist/components/Notification/appearance/notificationSize.js +0 -17
- package/dist/components/Notification/appearance/notificationStyle.js +0 -14
- package/dist/components/Notification/appearance/notificationSuccess.js +0 -16
- package/dist/components/Notification/appearance/notificationWarning.js +0 -16
- package/dist/components/Notification/index.js +0 -4
- package/dist/components/Overlay/Overlay.appearance.js +0 -5
- package/dist/components/Overlay/Overlay.interface.js +0 -1
- package/dist/components/Overlay/Overlay.js +0 -21
- package/dist/components/Overlay/appearance/overlayDefault.js +0 -11
- package/dist/components/Overlay/index.js +0 -2
- package/dist/components/Pagination/Pagination.appearance.js +0 -13
- package/dist/components/Pagination/Pagination.interface.js +0 -1
- package/dist/components/Pagination/Pagination.js +0 -117
- package/dist/components/Pagination/appearance/paginationAccent.js +0 -38
- package/dist/components/Pagination/appearance/paginationShape.js +0 -34
- package/dist/components/Pagination/appearance/paginationSize.js +0 -63
- package/dist/components/Pagination/appearance/paginationStyle.js +0 -14
- package/dist/components/Pagination/appearance/paginationSurface.js +0 -35
- package/dist/components/Pagination/index.js +0 -2
- package/dist/components/Radio/Radio.appearance.js +0 -19
- package/dist/components/Radio/Radio.interface.js +0 -1
- package/dist/components/Radio/Radio.js +0 -33
- package/dist/components/Radio/appearance/radioDefault.js +0 -17
- package/dist/components/Radio/appearance/radioDisabled.js +0 -14
- package/dist/components/Radio/appearance/radioError.js +0 -14
- package/dist/components/Radio/appearance/radioRequire.js +0 -14
- package/dist/components/Radio/appearance/radioShape.js +0 -25
- package/dist/components/Radio/appearance/radioSize.js +0 -18
- package/dist/components/Radio/appearance/radioStyle.js +0 -24
- package/dist/components/Radio/appearance/radioSuccess.js +0 -14
- package/dist/components/Radio/index.js +0 -2
- package/dist/components/RangeSlider/RangeSlider.interface.js +0 -1
- package/dist/components/RangeSlider/RangeSlider.js +0 -16
- package/dist/components/RangeSlider/index.js +0 -1
- package/dist/components/Response/Response.appearance.js +0 -25
- package/dist/components/Response/Response.constant.js +0 -68
- package/dist/components/Response/Response.interface.js +0 -1
- package/dist/components/Response/Response.js +0 -49
- package/dist/components/Response/appearance/responseConfirm.js +0 -15
- package/dist/components/Response/appearance/responseDanger.js +0 -15
- package/dist/components/Response/appearance/responseEmpty.js +0 -15
- package/dist/components/Response/appearance/responseError.js +0 -15
- package/dist/components/Response/appearance/responseFail.js +0 -15
- package/dist/components/Response/appearance/responseNothingFound.js +0 -15
- package/dist/components/Response/appearance/responseRefresh.js +0 -15
- package/dist/components/Response/appearance/responseStyle.js +0 -14
- package/dist/components/Response/appearance/responseSuccess.js +0 -15
- package/dist/components/Response/appearance/responseUnableLoadData.js +0 -15
- package/dist/components/Response/appearance/responseWarning.js +0 -15
- package/dist/components/Response/img/index.js +0 -25
- package/dist/components/Response/index.js +0 -5
- package/dist/components/SVGContent/SVGContent.interface.js +0 -1
- package/dist/components/SVGContent/SVGContent.js +0 -15
- package/dist/components/SVGContent/index.js +0 -1
- package/dist/components/ScrollOnDrag/ScrollOnDrag.interface.js +0 -1
- package/dist/components/ScrollOnDrag/ScrollOnDrag.js +0 -18
- package/dist/components/ScrollOnDrag/index.js +0 -1
- package/dist/components/ScrollToView/ScrollToView.interface.js +0 -1
- package/dist/components/ScrollToView/ScrollToView.js +0 -15
- package/dist/components/ScrollToView/index.js +0 -1
- package/dist/components/Scrollbar/Scrollbar.interface.js +0 -1
- package/dist/components/Scrollbar/Scrollbar.js +0 -22
- package/dist/components/Scrollbar/index.js +0 -1
- package/dist/components/Search/Search.appearance.js +0 -19
- package/dist/components/Search/Search.interface.js +0 -1
- package/dist/components/Search/SearchInput.js +0 -42
- package/dist/components/Search/SearchResult.js +0 -12
- package/dist/components/Search/appearance/searchDefault.js +0 -23
- package/dist/components/Search/appearance/searchDisabled.js +0 -13
- package/dist/components/Search/appearance/searchError.js +0 -13
- package/dist/components/Search/appearance/searchRequire.js +0 -13
- package/dist/components/Search/appearance/searchShape.js +0 -25
- package/dist/components/Search/appearance/searchSize.js +0 -46
- package/dist/components/Search/appearance/searchStyle.js +0 -17
- package/dist/components/Search/appearance/searchSuccess.js +0 -12
- package/dist/components/Search/index.js +0 -4
- package/dist/components/Segmented/Segmented.appearance.js +0 -21
- package/dist/components/Segmented/Segmented.interface.js +0 -1
- package/dist/components/Segmented/Segmented.js +0 -53
- package/dist/components/Segmented/appearance/segmentedDefault.js +0 -29
- package/dist/components/Segmented/appearance/segmentedDisabled.js +0 -12
- package/dist/components/Segmented/appearance/segmentedError.js +0 -14
- package/dist/components/Segmented/appearance/segmentedRequire.js +0 -15
- package/dist/components/Segmented/appearance/segmentedShape.js +0 -25
- package/dist/components/Segmented/appearance/segmentedSize.js +0 -28
- package/dist/components/Segmented/appearance/segmentedStyle.js +0 -16
- package/dist/components/Segmented/appearance/segmentedSuccess.js +0 -13
- package/dist/components/Segmented/appearance/segmentedWarning.js +0 -14
- package/dist/components/Segmented/index.js +0 -2
- package/dist/components/Select/Select.appearance.js +0 -19
- package/dist/components/Select/Select.interface.js +0 -1
- package/dist/components/Select/SelectClearIndicator.js +0 -9
- package/dist/components/Select/SelectContainer.js +0 -100
- package/dist/components/Select/SelectControl.js +0 -9
- package/dist/components/Select/SelectDropdownIndicator.js +0 -9
- package/dist/components/Select/SelectGroupHeading.js +0 -9
- package/dist/components/Select/SelectIndicatorsContainer.js +0 -13
- package/dist/components/Select/SelectInput.js +0 -8
- package/dist/components/Select/SelectLoadingIndicator.js +0 -7
- package/dist/components/Select/SelectLoadingMessage.js +0 -8
- package/dist/components/Select/SelectMenu.js +0 -9
- package/dist/components/Select/SelectMultiValue.js +0 -18
- package/dist/components/Select/SelectMultiValueContainer.js +0 -9
- package/dist/components/Select/SelectMultiValueLabel.js +0 -8
- package/dist/components/Select/SelectMultiValueRemove.js +0 -8
- package/dist/components/Select/SelectNoOptions.js +0 -12
- package/dist/components/Select/SelectOption.js +0 -26
- package/dist/components/Select/SelectOverflowBadge.js +0 -9
- package/dist/components/Select/SelectPlaceholder.js +0 -8
- package/dist/components/Select/SelectSingleValue.js +0 -11
- package/dist/components/Select/SelectValueContainer.js +0 -7
- package/dist/components/Select/appearance/selectDefault.js +0 -37
- package/dist/components/Select/appearance/selectDisabled.js +0 -28
- package/dist/components/Select/appearance/selectError.js +0 -37
- package/dist/components/Select/appearance/selectRequire.js +0 -37
- package/dist/components/Select/appearance/selectShape.js +0 -27
- package/dist/components/Select/appearance/selectSize.js +0 -116
- package/dist/components/Select/appearance/selectStyle.js +0 -17
- package/dist/components/Select/appearance/selectSuccess.js +0 -37
- package/dist/components/Select/index.js +0 -16
- package/dist/components/Swiper/Swiper.interface.js +0 -1
- package/dist/components/Swiper/Swiper.js +0 -73
- package/dist/components/Swiper/index.js +0 -1
- package/dist/components/Switch/Switch.appearance.js +0 -17
- package/dist/components/Switch/Switch.interface.js +0 -1
- package/dist/components/Switch/Switch.js +0 -31
- package/dist/components/Switch/appearance/switchDefault.js +0 -11
- package/dist/components/Switch/appearance/switchDisabled.js +0 -11
- package/dist/components/Switch/appearance/switchError.js +0 -11
- package/dist/components/Switch/appearance/switchRequire.js +0 -11
- package/dist/components/Switch/appearance/switchSize.js +0 -18
- package/dist/components/Switch/appearance/switchStyle.js +0 -16
- package/dist/components/Switch/appearance/switchSuccess.js +0 -11
- package/dist/components/Switch/index.js +0 -2
- package/dist/components/Tab/Tab.appearance.js +0 -15
- package/dist/components/Tab/Tab.interface.js +0 -1
- package/dist/components/Tab/Tab.js +0 -34
- package/dist/components/Tab/TabGroup.js +0 -14
- package/dist/components/Tab/appearance/tabError.js +0 -13
- package/dist/components/Tab/appearance/tabSize.js +0 -44
- package/dist/components/Tab/appearance/tabStyle.js +0 -16
- package/dist/components/Tab/appearance/tabSuccess.js +0 -13
- package/dist/components/Tab/appearance/tabSurface.js +0 -64
- package/dist/components/Tab/appearance/tabWarning.js +0 -12
- package/dist/components/Tab/index.js +0 -3
- package/dist/components/Text/Text.appearance.js +0 -5
- package/dist/components/Text/Text.interface.js +0 -1
- package/dist/components/Text/Text.js +0 -35
- package/dist/components/Text/appearance/textSize.js +0 -24
- package/dist/components/Text/index.js +0 -2
- package/dist/components/Textarea/Textarea.appearance.js +0 -19
- package/dist/components/Textarea/Textarea.interface.js +0 -1
- package/dist/components/Textarea/Textarea.js +0 -20
- package/dist/components/Textarea/appearance/textareaDefault.js +0 -33
- package/dist/components/Textarea/appearance/textareaDisabled.js +0 -18
- package/dist/components/Textarea/appearance/textareaError.js +0 -18
- package/dist/components/Textarea/appearance/textareaRequire.js +0 -18
- package/dist/components/Textarea/appearance/textareaShape.js +0 -25
- package/dist/components/Textarea/appearance/textareaSize.js +0 -31
- package/dist/components/Textarea/appearance/textareaStyle.js +0 -16
- package/dist/components/Textarea/appearance/textareaSuccess.js +0 -19
- package/dist/components/Textarea/index.js +0 -2
- package/dist/components/Tile/Tile.appearance.js +0 -11
- package/dist/components/Tile/Tile.interface.js +0 -1
- package/dist/components/Tile/Tile.js +0 -26
- package/dist/components/Tile/appearance/tileShape.js +0 -25
- package/dist/components/Tile/appearance/tileSize.js +0 -51
- package/dist/components/Tile/appearance/tileStyle.js +0 -14
- package/dist/components/Tile/appearance/tileSurface.js +0 -35
- package/dist/components/Tile/index.js +0 -2
- package/dist/components/Title/Title.appearance.js +0 -29
- package/dist/components/Title/Title.interface.js +0 -1
- package/dist/components/Title/Title.js +0 -43
- package/dist/components/Title/appearance/titleAccent.js +0 -11
- package/dist/components/Title/appearance/titleDanger.js +0 -7
- package/dist/components/Title/appearance/titleDisabled.js +0 -16
- package/dist/components/Title/appearance/titleError.js +0 -9
- package/dist/components/Title/appearance/titleExtra.js +0 -8
- package/dist/components/Title/appearance/titleInfo.js +0 -11
- package/dist/components/Title/appearance/titleRequire.js +0 -16
- package/dist/components/Title/appearance/titleSize.js +0 -45
- package/dist/components/Title/appearance/titleSpecial.js +0 -7
- package/dist/components/Title/appearance/titleStyle.js +0 -11
- package/dist/components/Title/appearance/titleSuccess.js +0 -7
- package/dist/components/Title/appearance/titleSurface.js +0 -19
- package/dist/components/Title/appearance/titleWarning.js +0 -9
- package/dist/components/Title/index.js +0 -2
- package/dist/components/Tooltip/Tooltip.appearance.js +0 -19
- package/dist/components/Tooltip/Tooltip.interface.js +0 -1
- package/dist/components/Tooltip/Tooltip.js +0 -68
- package/dist/components/Tooltip/appearance/tooltipDefault.js +0 -10
- package/dist/components/Tooltip/appearance/tooltipDisabled.js +0 -9
- package/dist/components/Tooltip/appearance/tooltipError.js +0 -10
- package/dist/components/Tooltip/appearance/tooltipRequire.js +0 -10
- package/dist/components/Tooltip/appearance/tooltipShape.js +0 -25
- package/dist/components/Tooltip/appearance/tooltipSize.js +0 -18
- package/dist/components/Tooltip/appearance/tooltipStyle.js +0 -14
- package/dist/components/Tooltip/appearance/tooltipSuccess.js +0 -10
- package/dist/components/Tooltip/index.js +0 -2
- package/dist/components/Video/Video.interface.js +0 -1
- package/dist/components/Video/Video.js +0 -9
- package/dist/components/Video/index.js +0 -1
- package/dist/components/Warning/Warning.appearance.js +0 -17
- package/dist/components/Warning/Warning.interface.js +0 -1
- package/dist/components/Warning/Warning.js +0 -25
- package/dist/components/Warning/appearance/warningAccent.js +0 -24
- package/dist/components/Warning/appearance/warningError.js +0 -24
- package/dist/components/Warning/appearance/warningInfo.js +0 -24
- package/dist/components/Warning/appearance/warningShape.js +0 -25
- package/dist/components/Warning/appearance/warningSize.js +0 -11
- package/dist/components/Warning/appearance/warningStyle.js +0 -14
- package/dist/components/Warning/appearance/warningWarning.js +0 -24
- package/dist/components/Warning/index.js +0 -2
- package/dist/config/forms/datepicker.js +0 -18
- package/dist/config/forms/index.js +0 -3
- package/dist/config/forms/input.js +0 -17
- package/dist/context/Notifications.interface.js +0 -1
- package/dist/context/index.js +0 -2
- package/dist/hooks/index.helpers.js +0 -6
- package/dist/hooks/useActiveClasses/index.js +0 -2
- package/dist/hooks/useAppearanceConfig/index.js +0 -1
- package/dist/hooks/useDevicePropsGenerator/index.js +0 -1
- package/dist/hooks/useMediaQueries/index.js +0 -1
- package/dist/hooks/useMediaQueries/mediaQueries.json +0 -19
- package/dist/hooks/useStyles/index.js +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/utils.js +0 -1
- package/dist/utils/index.js +0 -3
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { fromEvent } from 'file-selector'; // install with "react-dropzone"
|
|
5
|
-
import { ErrorCode, useDropzone } from 'react-dropzone';
|
|
6
|
-
import { Button } from 'src/components/Button';
|
|
7
|
-
import { Loader } from 'src/components/Loader';
|
|
8
|
-
import { Text } from 'src/components/Text';
|
|
9
|
-
import { useAppearanceConfig } from 'src/hooks/useAppearanceConfig';
|
|
10
|
-
import { useDevicePropsGenerator } from 'src/hooks/useDevicePropsGenerator';
|
|
11
|
-
import { useDropzoneFieldFiles } from 'src/hooks/useDropzoneFieldFiles';
|
|
12
|
-
import { dropzoneAppearance } from './Dropzone.appearance';
|
|
13
|
-
const dropzoneConfig = {
|
|
14
|
-
appearance: dropzoneAppearance,
|
|
15
|
-
setAppearance: (appearanceConfig) => {
|
|
16
|
-
dropzoneConfig.appearance = appearanceConfig;
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
const Dropzone = React.memo(function Dropzone(props) {
|
|
20
|
-
const { appearance, maxFiles = 5, maxSize = 10485760, // 10mb
|
|
21
|
-
dropzoneProps = {}, fieldValuesList: maybeFieldValuesList, fileErrorText, hintDescription, inputName, showFilename = true, thumbColumn, isSkeleton, isPreviews = true, onClickPreview, onAddFiles, onChangeFiles, onDeleteFile,
|
|
22
|
-
// className, unused
|
|
23
|
-
// size, unused
|
|
24
|
-
} = props;
|
|
25
|
-
const appearanceConfig = useAppearanceConfig(appearance, dropzoneConfig);
|
|
26
|
-
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
27
|
-
const { fillClass, fillHoverClass, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, errorMessageTextColor, errorMessageTextSize, errorMessageTextWeight, hintDescriptionTextColor, hintDescriptionTextSize, hintDescriptionTextWeight, hintDescriptionTextWrap, hintTitle, hintTitleTextColor, hintTitleTextSize, hintTitleTextWeight, hintTitleTextWrap, removeThumbAppearance, removeThumbShape, removeThumbText, removeThumbTextWeight, shapeClass, sizeClass, thumbBorderColorClass, thumbBorderColorHoverClass, thumbBorderTypeClass, thumbBorderWidthClass, thumbDirectionClass, thumbNameTextColor, thumbNameTextSize, thumbNameTextWeight, thumbNameTextWrap, } = propsGenerator;
|
|
28
|
-
const fieldValuesList = useMemo(() => {
|
|
29
|
-
return Array.isArray(maybeFieldValuesList) ? maybeFieldValuesList : [];
|
|
30
|
-
}, [maybeFieldValuesList]);
|
|
31
|
-
// Using a hook to manage files
|
|
32
|
-
const { convertValueFilesToDropzoneItems, fileIsLoading, fileRejectedMessage, setFileRejectedMessage, } = useDropzoneFieldFiles(fieldValuesList, isPreviews);
|
|
33
|
-
// Create dropzone options
|
|
34
|
-
const { getInputProps, getRootProps } = useDropzone({
|
|
35
|
-
// accept: { 'image/*': [] },
|
|
36
|
-
// validator: (file) => {},
|
|
37
|
-
maxFiles: maxFiles,
|
|
38
|
-
maxSize: maxSize,
|
|
39
|
-
...dropzoneProps,
|
|
40
|
-
getFilesFromEvent: async (event) => {
|
|
41
|
-
const result = await fromEvent(event);
|
|
42
|
-
const newFiles = result.filter((item) => item instanceof File);
|
|
43
|
-
/** NOTE:
|
|
44
|
-
* By default, "react-dropzone" works by replacing the field's files
|
|
45
|
-
* when adding a new file. For example, if you drag and drop files
|
|
46
|
-
* one at a time, the previous ones will be replaced by
|
|
47
|
-
* the newly added ones. We're overriding this default behavior
|
|
48
|
-
* to allow multiple files to be added one by one(step by step).
|
|
49
|
-
*
|
|
50
|
-
* "react-dropzone" checks maximum number of available files(maxFiles)
|
|
51
|
-
* at the time of addition, not the total number of files in field.
|
|
52
|
-
* Thats why, we're forced to pass the existing + new files
|
|
53
|
-
* as the field value to the react-dropzone,
|
|
54
|
-
* so that the internal checks work as if all the existing files
|
|
55
|
-
* were added at once.
|
|
56
|
-
*
|
|
57
|
-
* That's behavior actual for accepted and rejected files.
|
|
58
|
-
*/
|
|
59
|
-
return [...fieldValuesList, ...newFiles];
|
|
60
|
-
},
|
|
61
|
-
onDropAccepted: async (acceptedFiles) => {
|
|
62
|
-
const newDzFileItemsList = await convertValueFilesToDropzoneItems(acceptedFiles, true);
|
|
63
|
-
setFileRejectedMessage('');
|
|
64
|
-
// Callback just for add new files
|
|
65
|
-
onAddFiles && onAddFiles(newDzFileItemsList, inputName);
|
|
66
|
-
// Callback for save to form data (including empty when files are not valid)
|
|
67
|
-
onChangeFiles && onChangeFiles(newDzFileItemsList);
|
|
68
|
-
},
|
|
69
|
-
onDropRejected: (rejectedFiles) => {
|
|
70
|
-
// Clean error by default
|
|
71
|
-
let fileErrorMessage = '';
|
|
72
|
-
// If dropped files has rejected - show error message
|
|
73
|
-
if (rejectedFiles.length > 0) {
|
|
74
|
-
fileErrorMessage = 'Ошибка при добавлении файла';
|
|
75
|
-
const firstFileErrorItem = rejectedFiles[0].errors[0];
|
|
76
|
-
if (firstFileErrorItem) {
|
|
77
|
-
if (firstFileErrorItem.code === ErrorCode.TooManyFiles) {
|
|
78
|
-
fileErrorMessage = `Максимальное количество файлов: ${maxFiles}`;
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
fileErrorMessage = firstFileErrorItem.message;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
setFileRejectedMessage(fileErrorMessage);
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
// Delete file from dropzone
|
|
89
|
-
const onClickRemoveFile = useCallback((event, indexDeleted) => {
|
|
90
|
-
event.stopPropagation();
|
|
91
|
-
event.preventDefault();
|
|
92
|
-
const dzFileItemDeleted = fieldValuesList[indexDeleted];
|
|
93
|
-
const newFiles = fieldValuesList.filter((dzFileItem) => dzFileItem.id !== dzFileItemDeleted.id);
|
|
94
|
-
onDeleteFile && onDeleteFile(dzFileItemDeleted, inputName);
|
|
95
|
-
onChangeFiles && onChangeFiles(newFiles);
|
|
96
|
-
},
|
|
97
|
-
// If "inputName" will be changes, then it should be a different field
|
|
98
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
99
|
-
[fieldValuesList, onChangeFiles, onDeleteFile]);
|
|
100
|
-
useEffect(() => {
|
|
101
|
-
// Check if we need to convert form state value to field format
|
|
102
|
-
const isNeedToConvert = fieldValuesList.some((fieldValue) => {
|
|
103
|
-
const isMaybeUrl = typeof fieldValue === 'string';
|
|
104
|
-
const isJsFile = fieldValue instanceof File;
|
|
105
|
-
const isImageData = typeof fieldValue === 'object' && !fieldValue.file;
|
|
106
|
-
return isMaybeUrl || isJsFile || isImageData;
|
|
107
|
-
});
|
|
108
|
-
if (isNeedToConvert) {
|
|
109
|
-
const convertFiledValueAndSaveAsFiles = async () => {
|
|
110
|
-
const dzFileItemsList = await convertValueFilesToDropzoneItems(fieldValuesList);
|
|
111
|
-
// Save to form state as right objects
|
|
112
|
-
onChangeFiles && onChangeFiles(dzFileItemsList);
|
|
113
|
-
};
|
|
114
|
-
// First time convert value to dropzoneFileItem and save to form state
|
|
115
|
-
convertFiledValueAndSaveAsFiles();
|
|
116
|
-
}
|
|
117
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
118
|
-
}, [fieldValuesList]);
|
|
119
|
-
return (_jsxs(React.Fragment, { children: [_jsxs("div", { ...getRootProps({ className: `dropzone__dropzone dropzone` }), children: [_jsx("input", { ...getInputProps(), name: inputName }), _jsxs("div", { className: clsx('dropzone dropzone__dropzone-wrapper', thumbColumn && `dropzone__dropzone-wrapper_column_${thumbColumn}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass &&
|
|
120
|
-
`border-color_hover_${borderColorHoverClass}`, borderTypeClass && `border_type_${borderTypeClass}`, shapeClass && `shape_${shapeClass}`, isSkeleton && 'dropzone_skeleton', sizeClass && `dropzone_size_${sizeClass}`), children: [fieldValuesList.map((fileItem, index) => {
|
|
121
|
-
const { id, name, error, file, preview } = fileItem;
|
|
122
|
-
const fileErrorMessage = error || file?.error;
|
|
123
|
-
const fileName = name || file?.name;
|
|
124
|
-
return (_jsxs("aside", { className: clsx('dropzone__thumb', fillClass, thumbDirectionClass, thumbBorderWidthClass, thumbBorderColorClass, thumbBorderColorHoverClass, thumbBorderTypeClass), children: [isPreviews && !error && preview && (_jsx("div", { className: "dropzone__thumb-image", children: _jsx("img", { className: "dropzone__thumb-image-inner", src: preview, onClick: (event) => {
|
|
125
|
-
onClickPreview && onClickPreview(fileItem, event);
|
|
126
|
-
} }) })), (fileErrorText || fileErrorMessage) && (_jsx("div", { children: _jsx(Text, { size: thumbNameTextSize, textColor: thumbNameTextColor, textWeight: thumbNameTextWeight, textWrap: thumbNameTextWrap, children: fileErrorText || fileErrorMessage }) })), showFilename && fileName && (_jsx("div", { className: "dropzone__thumb-name", children: _jsx(Text, { className: "dropzone__thumb-name-inner", size: thumbNameTextSize, textColor: thumbNameTextColor, textWeight: thumbNameTextWeight, textWrap: thumbNameTextWrap, children: fileName }) })), fileIsLoading && (_jsx("div", { className: "dropzone__thumb-loader", children: _jsx(Loader, { width: "fill", height: "fill" }) })), _jsx("div", { className: clsx('dropzone__thumb-remove'), children: _jsx(Button, { appearance: removeThumbAppearance, className: "dropzone__thumb-remove-text", label: removeThumbText || 'Удалить', labelTextWeight: removeThumbTextWeight, shape: removeThumbShape,
|
|
127
|
-
// TODO: Use id of dropzone special object
|
|
128
|
-
onClick: (event) => onClickRemoveFile(event, index) }) })] }, id || index));
|
|
129
|
-
}), fieldValuesList.length === 0 ? (_jsxs("div", { className: "dropzone__hint", children: [_jsx(Text, { className: "dropzone__hint-title", size: hintTitleTextSize, textColor: hintTitleTextColor, textWeight: hintTitleTextWeight, textWrap: hintTitleTextWrap, children: hintTitle || 'Select a file or drag in form' }), hintDescription && (_jsx(Text, { className: "dropzone__hint-text", size: hintDescriptionTextSize, textColor: hintDescriptionTextColor, textWeight: hintDescriptionTextWeight, textWrap: hintDescriptionTextWrap, children: hintDescription }))] })) : (_jsxs("div", { className: "dropzone__hint dropzone__hint_type_add-more", children: [_jsx(Text, { className: "dropzone__hint-title", size: hintTitleTextSize, textColor: hintTitleTextColor, textWeight: hintTitleTextWeight, textWrap: hintTitleTextWrap, children: hintTitle || 'Select a file or drag in form' }), hintDescription && (_jsx(Text, { className: "dropzone__hint-text", size: hintDescriptionTextSize, textColor: hintDescriptionTextColor, textWeight: hintDescriptionTextWeight, textWrap: hintDescriptionTextWrap, children: hintDescription }))] }))] })] }), fileRejectedMessage && (_jsx("div", { className: "form-field__message", children: _jsx(Text, { className: "form-field__message-item form-field__message-item_type_message", size: errorMessageTextSize, textColor: errorMessageTextColor, textWeight: errorMessageTextWeight, children: fileRejectedMessage }) }))] }));
|
|
130
|
-
});
|
|
131
|
-
export { Dropzone };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const dropzoneAppearanceDefault = {
|
|
2
|
-
defaultSecondary: {
|
|
3
|
-
fill: 'surfaceSecondary',
|
|
4
|
-
fillHover: 'surfaceTertiary',
|
|
5
|
-
hintTitle: 'Перетащите изображение или выберите файл с компьютера',
|
|
6
|
-
hintTitleTextColor: 'surfaceTextPrimary',
|
|
7
|
-
hintTitleTextSize: 'm',
|
|
8
|
-
removeThumbText: 'удалить',
|
|
9
|
-
removeThumbTextColor: 'errorTextPrimary',
|
|
10
|
-
thumbBorderColor: 'surfaceBorderTertiary',
|
|
11
|
-
thumbBorderColorHover: 'surfaceBorderQuaternary',
|
|
12
|
-
thumbBorderWidth: '1',
|
|
13
|
-
thumbNameTextColor: 'surfaceTextPrimary',
|
|
14
|
-
thumbNameTextSize: 's',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export { dropzoneAppearanceDefault };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const dropzoneAppearanceDisabled = {
|
|
2
|
-
disabledTertiary: {
|
|
3
|
-
fill: 'disabledTertiary',
|
|
4
|
-
fillHover: 'disabledQuaternary',
|
|
5
|
-
hintTitle: 'Перетащите изображение или выберите файл с компьютера',
|
|
6
|
-
hintTitleTextColor: 'disabledTextSecondary',
|
|
7
|
-
hintTitleTextSize: 'm',
|
|
8
|
-
removeThumbText: 'удалить',
|
|
9
|
-
removeThumbTextColor: 'errorTextPrimary',
|
|
10
|
-
thumbBorderColor: 'surfaceBorderTertiary',
|
|
11
|
-
thumbBorderColorHover: 'surfaceBorderQuaternary',
|
|
12
|
-
thumbBorderWidth: '1',
|
|
13
|
-
thumbNameTextColor: 'surfaceTextPrimary',
|
|
14
|
-
thumbNameTextSize: 's',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export { dropzoneAppearanceDisabled };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const dropzoneAppearanceError = {
|
|
2
|
-
errorTertiary: {
|
|
3
|
-
fill: 'errorTertiary',
|
|
4
|
-
fillHover: 'errorTertiary',
|
|
5
|
-
hintTitle: 'Перетащите изображение или выберите файл с компьютера',
|
|
6
|
-
hintTitleTextColor: 'errorTextQuaternary',
|
|
7
|
-
hintTitleTextSize: 'm',
|
|
8
|
-
removeThumbText: 'удалить',
|
|
9
|
-
removeThumbTextColor: 'errorTextPrimary',
|
|
10
|
-
thumbBorderColor: 'surfaceBorderTertiary',
|
|
11
|
-
thumbBorderColorHover: 'surfaceBorderQuaternary',
|
|
12
|
-
thumbBorderWidth: '1',
|
|
13
|
-
thumbNameTextColor: 'surfaceTextPrimary',
|
|
14
|
-
thumbNameTextSize: 's',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export { dropzoneAppearanceError };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const dropzoneAppearanceRequire = {
|
|
2
|
-
requireTertiary: {
|
|
3
|
-
fill: 'warningTertiary',
|
|
4
|
-
fillHover: 'warningTertiary',
|
|
5
|
-
hintTitle: 'Перетащите изображение или выберите файл с компьютера',
|
|
6
|
-
hintTitleTextColor: 'specialTextSecondary',
|
|
7
|
-
hintTitleTextSize: 'm',
|
|
8
|
-
removeThumbText: 'удалить',
|
|
9
|
-
removeThumbTextColor: 'errorTextPrimary',
|
|
10
|
-
thumbBorderColor: 'surfaceBorderTertiary',
|
|
11
|
-
thumbBorderColorHover: 'surfaceBorderQuaternary',
|
|
12
|
-
thumbBorderWidth: '1',
|
|
13
|
-
thumbNameTextColor: 'surfaceTextPrimary',
|
|
14
|
-
thumbNameTextSize: 's',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export { dropzoneAppearanceRequire };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const dropzoneAppearanceShape = {
|
|
2
|
-
circular: {
|
|
3
|
-
shape: 'circular',
|
|
4
|
-
},
|
|
5
|
-
rounded: {
|
|
6
|
-
shape: 'rounded',
|
|
7
|
-
},
|
|
8
|
-
roundedXL: {
|
|
9
|
-
shape: 'rounded',
|
|
10
|
-
shapeStrength: '2m',
|
|
11
|
-
},
|
|
12
|
-
roundedL: {
|
|
13
|
-
shape: 'rounded',
|
|
14
|
-
shapeStrength: '1_5m',
|
|
15
|
-
},
|
|
16
|
-
roundedM: {
|
|
17
|
-
shape: 'rounded',
|
|
18
|
-
shapeStrength: '1m',
|
|
19
|
-
},
|
|
20
|
-
roundedS: {
|
|
21
|
-
shape: 'rounded',
|
|
22
|
-
shapeStrength: '0_5m',
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
export { dropzoneAppearanceShape };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const dropzoneAppearanceSuccess = {
|
|
2
|
-
successTertiary: {
|
|
3
|
-
fill: 'successTertiary',
|
|
4
|
-
fillHover: 'successTertiary',
|
|
5
|
-
hintTitle: 'Перетащите изображение или выберите файл с компьютера',
|
|
6
|
-
hintTitleTextColor: 'successTextQuaternary',
|
|
7
|
-
hintTitleTextSize: 'm',
|
|
8
|
-
removeThumbText: 'удалить',
|
|
9
|
-
removeThumbTextColor: 'errorTextPrimary',
|
|
10
|
-
thumbBorderColor: 'surfaceBorderTertiary',
|
|
11
|
-
thumbBorderColorHover: 'surfaceBorderQuaternary',
|
|
12
|
-
thumbBorderWidth: '1',
|
|
13
|
-
thumbNameTextColor: 'surfaceTextPrimary',
|
|
14
|
-
thumbNameTextSize: 's',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export { dropzoneAppearanceSuccess };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Dropzone } from './Dropzone';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { useDevicePropsGenerator } from 'src/hooks/useDevicePropsGenerator';
|
|
4
|
-
import { useStyles } from 'src/hooks/useStyles';
|
|
5
|
-
function Flex(props) {
|
|
6
|
-
const { id, className, dataTestId, dataTour, type, dataId, print, style, tag: Tag = 'div', onClick, children, } = props;
|
|
7
|
-
const propsGenerator = useDevicePropsGenerator(props);
|
|
8
|
-
const { directionClass, justifyContentClass, alignContentClass, alignItemsClass, fillClass, borderColorClass, borderTypeClass, flowClass, positionClass, shapeClass, widthClass, wrapClass, } = propsGenerator;
|
|
9
|
-
const { styles: flexStyles, wrapper: flexWrapperStyles } = useStyles(props);
|
|
10
|
-
return (_jsx(Tag, { id: id, className: clsx(className, 'flex', widthClass && `width_${widthClass}`, alignContentClass && `flex_align-content_${alignContentClass}`, alignItemsClass && `flex_align-items_${alignItemsClass}`, directionClass && `flex_direction_${directionClass}`, fillClass && `fill_${fillClass}`, flowClass && `flex_flow_${flowClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, positionClass && `position_${positionClass}`, justifyContentClass && `flex_justify-content_${justifyContentClass}`, shapeClass && `flex_shape_${shapeClass}`, type && `flex_type_${type}`, !print && 'no-print', print && 'print', wrapClass && `flex_wrap_${wrapClass}`), "data-id": dataId, "data-testid": dataTestId, "data-tour": dataTour, style: Object.assign({}, flexStyles, style), onClick: onClick, children: _jsx("div", { className: "flex__wrapper", style: flexWrapperStyles, children: children }) }));
|
|
11
|
-
}
|
|
12
|
-
export { Flex };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { useDevicePropsGenerator } from 'src/hooks/useDevicePropsGenerator';
|
|
4
|
-
import { useStyles } from 'src/hooks/useStyles';
|
|
5
|
-
function FlexItem(props) {
|
|
6
|
-
const { className, htmlFor, print, style, tag: Tag = 'div', children } = props;
|
|
7
|
-
const propsGenerator = useDevicePropsGenerator(props);
|
|
8
|
-
const { dataTestId, dataTour, directionClass, justifyContentClass, alignItemsClass, alignSelfClass, fillClass, fillHoverClass, dataId, growClass, positionClass, shapeClass, widthClass, wrapClass, } = propsGenerator;
|
|
9
|
-
const { styles: flexItemStyles } = useStyles(props);
|
|
10
|
-
return (_jsx(Tag, { className: clsx(className, 'flex__item', positionClass && `position_${positionClass}`, alignItemsClass && `flex__item_align-items_${alignItemsClass}`, alignSelfClass && `flex__item_align-self_${alignSelfClass}`, directionClass && `flex__item_direction_${directionClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, growClass && `flex__item_grow_${growClass}`, justifyContentClass &&
|
|
11
|
-
`flex__item_justify-content_${justifyContentClass}`, shapeClass && `flex__item_shape_${shapeClass}`, !print && 'no-print', print && 'print', widthClass && `width_${widthClass}`, wrapClass && `flex__item_wrap_${wrapClass}`), "data-id": dataId, "data-testid": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: Object.assign({}, flexItemStyles, style), children: children }));
|
|
12
|
-
}
|
|
13
|
-
export { FlexItem };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { useDevicePropsGenerator } from 'src/hooks/useDevicePropsGenerator';
|
|
4
|
-
import { useStyles } from 'src/hooks/useStyles';
|
|
5
|
-
function Grid(props) {
|
|
6
|
-
const { id, className, dataTestId, dataTour, type, horizontalResizing, horizontalScroll, print, tag: Tag = 'div', useGridSystem, verticalResizing, before, after, onClick, onDoubleClick, children, } = props;
|
|
7
|
-
const propsGenerator = useDevicePropsGenerator(props);
|
|
8
|
-
const { justifyContentClass, justifyItemsClass, alignContentClass, alignItemsClass, fillClass, fillHoverClass, borderColorClass, columnGapClass, columnsClass, heightClass, rowGapClass, rowsClass, widthClass, } = propsGenerator;
|
|
9
|
-
const { styles: gridStyles } = useStyles(props);
|
|
10
|
-
return (_jsxs(Tag, { id: id, className: clsx(className, 'grid', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, useGridSystem && `grid_state_system`, horizontalScroll && `grid_scroll_horizontal`, type && `grid_type_${type}`, columnsClass && `grid_columns_${columnsClass}`, rowsClass && `grid_rows_${rowsClass}`, rowGapClass && `grid_row-gap_${rowGapClass}`, columnGapClass && `grid_column-gap_${columnGapClass}`, alignContentClass && `grid_align-content_${alignContentClass}`, alignItemsClass && `grid_align-items_${alignItemsClass}`, borderColorClass && `border-color_${borderColorClass}`, justifyContentClass && `grid_justify-content_${justifyContentClass}`, justifyItemsClass && `grid_justify-items_${justifyItemsClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, horizontalResizing && `grid_horizontal-resizing_${horizontalResizing}`, verticalResizing && `grid_vertical-resizing_${verticalResizing}`, !print && 'no-print', print && 'print'), "data-testid": dataTestId, "data-tour": dataTour, style: gridStyles, onClick: onClick, onDoubleClick: onDoubleClick, children: [before && _jsx("div", { className: "grid__before", children: before }), children, after && _jsx("div", { className: "grid__after", children: after })] }));
|
|
11
|
-
}
|
|
12
|
-
export { Grid };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { useDevicePropsGenerator } from 'src/hooks/useDevicePropsGenerator';
|
|
4
|
-
import { useStyles } from 'src/hooks/useStyles';
|
|
5
|
-
function GridItem(props) {
|
|
6
|
-
const { id, className, dataTestId, dataTour, print, style, onClick, children, } = props;
|
|
7
|
-
const propsGenerator = useDevicePropsGenerator(props);
|
|
8
|
-
const { directionClass, justifySelfClass, alignSelfClass, fillClass, fillHoverClass, columnEndClass, columnGapClass, columnSpanClass, columnStartClass, gapClass, heightClass, orderClass, rowEndClass, rowGapClass, rowSpanClass, rowStartClass, widthClass, } = propsGenerator;
|
|
9
|
-
const { styles: gridItemStyles } = useStyles(props);
|
|
10
|
-
return (_jsx("div", { id: id, className: clsx(className, 'grid__item', orderClass && `order_${orderClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, alignSelfClass && `grid__item_align-self_${alignSelfClass}`, justifySelfClass && `grid__item_justify-self_${justifySelfClass}`, columnStartClass && `grid__item_column-start_${columnStartClass}`, columnEndClass && `grid__item_column-end_${columnEndClass}`, columnSpanClass && `grid__item_column-span_${columnSpanClass}`, rowStartClass && `grid__item_row-start_${rowStartClass}`, rowEndClass && `grid__item_row-end_${rowEndClass}`, rowSpanClass && `grid__item_row-span_${rowSpanClass}`, directionClass && `direction_${directionClass}`, gapClass && `gap_${gapClass}`, widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, rowGapClass && `row-gap_${rowGapClass}`, !print && 'no-print', print && 'print', columnGapClass && `column-gap_${columnGapClass}`), "data-testid": dataTestId, "data-tour": dataTour, style: Object.assign({}, gridItemStyles, style), onClick: onClick, children: children }));
|
|
11
|
-
}
|
|
12
|
-
export { GridItem };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { useDevicePropsGenerator } from 'src/hooks/useDevicePropsGenerator';
|
|
4
|
-
import { useStyles } from 'src/hooks/useStyles';
|
|
5
|
-
function GridRow(props) {
|
|
6
|
-
const { id, className, dataTestId, dataTour, dataId, htmlFor, print, tag: Tag = 'div', onClick, children, } = props;
|
|
7
|
-
const propsGenerator = useDevicePropsGenerator(props);
|
|
8
|
-
const { fillClass, fillHoverClass, borderColorClass, heightClass, widthClass, } = propsGenerator;
|
|
9
|
-
const { styles: gridRowStyles } = useStyles(props);
|
|
10
|
-
return (_jsx(Tag, { id: id, className: clsx(className, 'grid__row', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, !print && 'no-print', print && 'print', borderColorClass && `border-color_${borderColorClass}`), "data-id": dataId, "data-testid": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: gridRowStyles, onClick: onClick, children: children }));
|
|
11
|
-
}
|
|
12
|
-
export { GridRow };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { useAppearanceConfig } from 'src/hooks/useAppearanceConfig';
|
|
5
|
-
import { useDevicePropsGenerator } from 'src/hooks/useDevicePropsGenerator';
|
|
6
|
-
import { useStyles } from 'src/hooks/useStyles';
|
|
7
|
-
import { groupAppearance } from './Group.appearance';
|
|
8
|
-
const groupConfig = {
|
|
9
|
-
appearance: groupAppearance,
|
|
10
|
-
setAppearance: (appearanceConfig) => {
|
|
11
|
-
groupConfig.appearance = appearanceConfig;
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
const Group = React.forwardRef(function Group(props, ref) {
|
|
15
|
-
const { id, appearance, className, dataTestId, dataTour, name, dataId, easing, htmlFor, print, scroll, style, tag: Tag = 'div', isActive, isDisabled, onClick, onMouseDown, onMouseEnter, onMouseLeave, children, } = props;
|
|
16
|
-
const appearanceConfig = useAppearanceConfig(appearance, groupConfig);
|
|
17
|
-
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
18
|
-
const { directionClass, flexGrowClass, justifyContentClass, alignClass, alignDirectionClass, fillActiveClass, fillActiveHoverClass, fillClass, fillDisabledClass, fillHoverClass, borderColorActiveClass, borderColorActiveHoverClass, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, textColorActiveClass, textColorClass, textColorHoverClass, columnsClass, elevationClass, heightClass, hoverFilterClass, iconFillHoverClass, shapeClass, shapeStrengthClass, stackingClass, widthClass, wrapClass, } = propsGenerator;
|
|
19
|
-
const { styles: groupStyles } = useStyles(props);
|
|
20
|
-
return (_jsx(Tag, { id: id, className: clsx(className, 'group', easing && `easing_${easing}`, widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, hoverFilterClass && `hover-filter_${hoverFilterClass}`, columnsClass && `group_columns_${columnsClass}`, alignDirectionClass && `align_${alignDirectionClass}`, directionClass && `group_direction_${directionClass}`, alignClass && `align_${alignClass}`, justifyContentClass && `justify-content_${justifyContentClass}`, textColorClass && `group_text-color_${textColorClass}`, textColorActiveClass &&
|
|
21
|
-
`group_text-color_active_${textColorActiveClass}`, textColorHoverClass && `group_text-color_hover_${textColorHoverClass}`, iconFillHoverClass && `group_icon_fill_hover_${iconFillHoverClass}`, !isDisabled
|
|
22
|
-
? !isActive
|
|
23
|
-
? fillClass && `fill_${fillClass}`
|
|
24
|
-
: fillActiveClass && `fill_active_${fillActiveClass}`
|
|
25
|
-
: fillDisabledClass && `fill_${fillDisabledClass}`, !isDisabled
|
|
26
|
-
? !isActive
|
|
27
|
-
? fillHoverClass && `fill_hover_${fillHoverClass}`
|
|
28
|
-
: fillActiveHoverClass &&
|
|
29
|
-
`fill_active_hover_${fillActiveHoverClass}`
|
|
30
|
-
: fillDisabledClass && `fill_${fillDisabledClass}`, scroll && `group_scroll_${scroll}`, stackingClass && `group_stacking_${stackingClass}`, wrapClass && `group_wrap_${wrapClass}`, flexGrowClass && `flex-grow_${flexGrowClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, !isDisabled
|
|
31
|
-
? !isActive
|
|
32
|
-
? borderColorClass && `border-color_${borderColorClass}`
|
|
33
|
-
: borderColorActiveClass &&
|
|
34
|
-
`border-color_active_${borderColorActiveClass}`
|
|
35
|
-
: fillDisabledClass && `fill_${fillDisabledClass}`, !isDisabled
|
|
36
|
-
? !isActive
|
|
37
|
-
? borderColorHoverClass &&
|
|
38
|
-
`border-color_hover_${borderColorHoverClass}`
|
|
39
|
-
: borderColorActiveHoverClass &&
|
|
40
|
-
`border-color_active_hover_${borderColorActiveHoverClass}`
|
|
41
|
-
: fillDisabledClass && `fill_${fillDisabledClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, elevationClass && `elevation_${elevationClass}`, !print && 'no-print', print && 'print', onClick && 'cursor_type_pointer'), name: name, ref: ref, "data-id": dataId, "data-testid": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: Object.assign({}, groupStyles, style), onClick: onClick, onMouseDown: onMouseDown, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: children }));
|
|
42
|
-
});
|
|
43
|
-
export { Group, groupConfig };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { useDevicePropsGenerator } from 'src/hooks/useDevicePropsGenerator';
|
|
4
|
-
import { useStyles } from 'src/hooks/useStyles';
|
|
5
|
-
function HTMLContent(props) {
|
|
6
|
-
const { className, dataTestId, dataTour, content, style, onClick, children } = props;
|
|
7
|
-
const propsGenerator = useDevicePropsGenerator(props);
|
|
8
|
-
const { directionClass, flexGrowClass, justifyContentClass, alignClass, alignDirectionClass, fillClass, fillHoverClass, borderColorClass, borderTypeClass, borderWidthClass, textColorClass, textWeightClass, columnsClass, elevationClass, heightClass, shapeClass, widthClass, wrapClass, } = propsGenerator;
|
|
9
|
-
const { styles: htmlContentStyles } = useStyles(props);
|
|
10
|
-
return (_jsx("div", { className: clsx(className, 'html-content', alignClass && `align_${alignClass}`, alignDirectionClass && `align_${alignDirectionClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, borderWidthClass && `border-width_${borderWidthClass}`, columnsClass && `html-content_columns_${columnsClass}`, directionClass && `html-content_direction_${directionClass}`, elevationClass && `elevation_${elevationClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, flexGrowClass && `flex-grow_${flexGrowClass}`, heightClass && `height_${heightClass}`, justifyContentClass && `justify-content_${justifyContentClass}`, shapeClass && `html-content_shape_${shapeClass}`, textColorClass && `text-color_${textColorClass}`, textWeightClass && `text-weight_${textWeightClass}`, wrapClass && `html-content_wrap_${wrapClass}`, widthClass && `width_${widthClass}`), dangerouslySetInnerHTML: { __html: content }, "data-testid": dataTestId, "data-tour": dataTour, style: Object.assign({}, htmlContentStyles, style), onClick: onClick, children: children }));
|
|
11
|
-
}
|
|
12
|
-
export { HTMLContent };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { HTMLContent } from './HTMLContent';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { useAppearanceConfig } from 'src/hooks/useAppearanceConfig';
|
|
5
|
-
import { useDevicePropsGenerator } from 'src/hooks/useDevicePropsGenerator';
|
|
6
|
-
import { useStyles } from 'src/hooks/useStyles';
|
|
7
|
-
import { Icon } from 'src/components/Icon';
|
|
8
|
-
import { heroTitleAppearance } from './HeroTitle.appearance';
|
|
9
|
-
const heroTitleConfig = {
|
|
10
|
-
appearance: heroTitleAppearance,
|
|
11
|
-
setAppearance: (appearanceConfig) => {
|
|
12
|
-
heroTitleConfig.appearance = appearanceConfig;
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
function HeroTitle(props) {
|
|
16
|
-
const { appearance, className, dataTestId, dataTour, text, afterWrapper, beforeWrapper, tag = 'span', before, after, isDisabled, isSkeleton, onClick, children, } = props;
|
|
17
|
-
const appearanceConfig = useAppearanceConfig(appearance, heroTitleConfig, isDisabled);
|
|
18
|
-
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
19
|
-
const { directionClass, size, fillClass, textAlignClass, textColorActiveClass, textColorClass, textColorGradientClass, textColorHoverClass, textFontClass, textStyleClass, textTruncateClass, textWeightClass, textWrap, heightClass, iconAfter, iconAfterFill, iconAfterFillIcon, iconAfterFillSize, iconAfterShape, iconAfterSize, iconAfterSrc, iconBadgeAppearance, iconBadgeShape, iconBadgeSize, iconBadgeTextColor, iconBadgeTextSize, iconBadgeValue, iconBefore, iconBeforeFill, iconBeforeFillIcon, iconBeforeFillSize, iconBeforeShape, iconBeforeSize, iconBeforeSrc, svgFillClass, svgFillHoverClass, typeClass, widthClass, wrapperDirectionClass, } = propsGenerator;
|
|
20
|
-
const { styles: heroTitleStyles, wrapper: heroTitleWrapperStyles } = useStyles(props);
|
|
21
|
-
const Tag = useMemo(() => {
|
|
22
|
-
if (tag) {
|
|
23
|
-
return tag;
|
|
24
|
-
}
|
|
25
|
-
return size ? size : 'span';
|
|
26
|
-
}, [size, tag]);
|
|
27
|
-
return (_jsxs(Tag, { className: clsx(className, 'heroTitle', fillClass && `fill_${fillClass}`, svgFillClass && `svg_fill_${svgFillClass}`, svgFillHoverClass && `svg_fill_hover_${svgFillHoverClass}`, widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, size && `hero-title_size_${size}`, directionClass && `hero-title_direction_${directionClass}`, 'text', textColorClass && `text-color_${textColorClass}`, textColorActiveClass && `text-color_active_${textColorActiveClass}`, textColorHoverClass && `text-color_hover_${textColorHoverClass}`, typeClass && `hero-title_type_${typeClass}`, textColorGradientClass && `text-gradient_${textColorGradientClass}`, textFontClass && `text-font_${textFontClass}`, textStyleClass && `text-style_${textStyleClass}`, textWeightClass && `text-weight_${textWeightClass}`, textWrap && `word-wrap_${textWrap}`, isSkeleton && 'hero-title_skeleton'), "data-testid": dataTestId, "data-tour": dataTour, style: heroTitleStyles, onClick: onClick, children: [before, _jsxs("span", { className: clsx(textAlignClass && `text-align_${textAlignClass}`, wrapperDirectionClass &&
|
|
28
|
-
`hero-title-direction_${wrapperDirectionClass}`, 'hero-title__wrapper', textTruncateClass && `text-truncate_${textTruncateClass}`), style: heroTitleWrapperStyles, children: [(iconBefore || iconBeforeSrc) && (_jsx(Icon, { className: clsx('title__icon_before', iconBadgeValue && 'title__icon_before-badge'), fill: iconBeforeFill, fillSize: iconBeforeFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'title__icon_before_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), beforeWrapper, children || text, afterWrapper, (iconAfter || iconAfterSrc) && (_jsx(Icon, { className: clsx('title__icon_after', iconBadgeValue && 'title__icon_after-badge'), fill: iconAfterFill, fillSize: iconAfterFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'title__icon_after_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter }))] }), after] }));
|
|
29
|
-
}
|
|
30
|
-
export { HeroTitle, heroTitleConfig };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const heroTitleAppearanceSize = {
|
|
2
|
-
sizeH1: {
|
|
3
|
-
size: 'h1',
|
|
4
|
-
},
|
|
5
|
-
sizeH2: {
|
|
6
|
-
size: 'h2',
|
|
7
|
-
},
|
|
8
|
-
sizeH3: {
|
|
9
|
-
size: 'h3',
|
|
10
|
-
},
|
|
11
|
-
sizeH4: {
|
|
12
|
-
size: 'h4',
|
|
13
|
-
},
|
|
14
|
-
sizeH5: {
|
|
15
|
-
size: 'h5',
|
|
16
|
-
},
|
|
17
|
-
sizeH6: {
|
|
18
|
-
size: 'h6',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
export { heroTitleAppearanceSize };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { iconAppearanceAccent } from './appearance/iconAccent';
|
|
2
|
-
import { iconAppearanceDanger } from './appearance/iconDanger';
|
|
3
|
-
import { iconAppearanceDisabled } from './appearance/iconDisabled';
|
|
4
|
-
import { iconAppearanceError } from './appearance/iconError';
|
|
5
|
-
import { iconAppearanceExtra } from './appearance/iconExtra';
|
|
6
|
-
import { iconAppearanceInfo } from './appearance/iconInfo';
|
|
7
|
-
import { iconAppearanceShape } from './appearance/iconShape';
|
|
8
|
-
import { iconAppearanceSize } from './appearance/iconSize';
|
|
9
|
-
import { iconAppearanceSpecial } from './appearance/iconSpecial';
|
|
10
|
-
import { iconAppearanceStyle } from './appearance/iconStyle';
|
|
11
|
-
import { iconAppearanceSuccess } from './appearance/iconSuccess';
|
|
12
|
-
import { iconAppearanceSurface } from './appearance/iconSurface';
|
|
13
|
-
import { iconAppearanceWarning } from './appearance/iconWarning';
|
|
14
|
-
const iconAppearance = {
|
|
15
|
-
...iconAppearanceDisabled,
|
|
16
|
-
...iconAppearanceSize,
|
|
17
|
-
...iconAppearanceStyle,
|
|
18
|
-
...iconAppearanceAccent,
|
|
19
|
-
...iconAppearanceShape,
|
|
20
|
-
...iconAppearanceDanger,
|
|
21
|
-
...iconAppearanceError,
|
|
22
|
-
...iconAppearanceInfo,
|
|
23
|
-
...iconAppearanceSpecial,
|
|
24
|
-
...iconAppearanceExtra,
|
|
25
|
-
...iconAppearanceSuccess,
|
|
26
|
-
...iconAppearanceSurface,
|
|
27
|
-
...iconAppearanceWarning,
|
|
28
|
-
};
|
|
29
|
-
export { iconAppearance };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import SVG from 'react-inlinesvg';
|
|
5
|
-
import { Badge } from 'src/components/Badge';
|
|
6
|
-
import { LinkWrapper } from 'src/components/Link';
|
|
7
|
-
import { Tooltip } from 'src/components/Tooltip';
|
|
8
|
-
import { urlWithAssetPrefix } from 'src/hoc/urlWithAssetPrefix';
|
|
9
|
-
import { useAppearanceConfig } from 'src/hooks/useAppearanceConfig';
|
|
10
|
-
import { useDevicePropsGenerator } from 'src/hooks/useDevicePropsGenerator';
|
|
11
|
-
import { useStyles } from 'src/hooks/useStyles';
|
|
12
|
-
import { mergeAppearanceKeys } from 'src/utils';
|
|
13
|
-
import { iconAppearance } from './Icon.appearance';
|
|
14
|
-
const iconConfig = {
|
|
15
|
-
appearance: iconAppearance,
|
|
16
|
-
setAppearance: (appearanceConfig) => {
|
|
17
|
-
iconConfig.appearance = appearanceConfig;
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
const Icon = urlWithAssetPrefix(React.forwardRef(function Icon(props, ref) {
|
|
21
|
-
const { id, appearance, className, dataTestId, dataTour, width, height, badgeClass, href, imageSrc, link, linkRel, linkTarget, notification, saveFillStroke, showTooltip, SvgImage, before, after, isActive, isDisabled, isSkeleton, onClick, onMouseEnter, onMouseLeave, } = props;
|
|
22
|
-
const ImageComponent = useMemo(() => {
|
|
23
|
-
if (SvgImage) {
|
|
24
|
-
const SvgComponent = SvgImage;
|
|
25
|
-
const sizes = {};
|
|
26
|
-
if (width) {
|
|
27
|
-
sizes.width = width;
|
|
28
|
-
}
|
|
29
|
-
if (height) {
|
|
30
|
-
sizes.height = height;
|
|
31
|
-
}
|
|
32
|
-
return _jsx(SvgComponent, { ...sizes });
|
|
33
|
-
}
|
|
34
|
-
if (imageSrc) {
|
|
35
|
-
if (imageSrc.endsWith('.svg')) {
|
|
36
|
-
if (saveFillStroke) {
|
|
37
|
-
return _jsx(SVG, { src: imageSrc });
|
|
38
|
-
}
|
|
39
|
-
return _jsx(SVG, { src: imageSrc, preProcessor: removeFillStroke });
|
|
40
|
-
}
|
|
41
|
-
return _jsx("img", { src: imageSrc });
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
44
|
-
}, [SvgImage, imageSrc, width, height, saveFillStroke]);
|
|
45
|
-
const appearanceConfig = useAppearanceConfig(appearance, iconConfig, isDisabled);
|
|
46
|
-
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
47
|
-
const { alignmentClass, fillActiveClass, fillActiveHoverClass, fillClass, fillDisabledClass, fillHoverClass, fillSizeClass, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, badgeAppearance, badgeAppearanceSize, badgeShape, badgeSize, badgeTextColor, badgeTextSize, badgeValue, centeringClass, iconFillActiveClass, iconFillActiveHoverClass, iconFillClass, iconFillDisabledClass, iconFillHoverClass, iconSizeClass, shapeClass, shapeStrengthClass, tooltipAppearance, tooltipText, tooltipTextSize, tooltipTitle, tooltipTitleSize, } = propsGenerator;
|
|
48
|
-
const { styles: iconStyles } = useStyles(props);
|
|
49
|
-
return (_jsxs("div", { id: id, className: clsx(className, 'icon', !isActive
|
|
50
|
-
? fillClass && `fill_${fillClass}`
|
|
51
|
-
: fillActiveClass && `fill_active_${fillActiveClass}`, !isActive
|
|
52
|
-
? fillHoverClass && `fill_hover_${fillHoverClass}`
|
|
53
|
-
: fillActiveHoverClass &&
|
|
54
|
-
`fill_active_hover_${fillActiveHoverClass}`, fillSizeClass && `icon_fill_size_${fillSizeClass}`, fillDisabledClass && `fill_disabled_${fillDisabledClass}`, !isActive
|
|
55
|
-
? iconFillClass && `icon_fill_${iconFillClass}`
|
|
56
|
-
: iconFillActiveClass && `icon_fill_active_${iconFillActiveClass}`, !isActive
|
|
57
|
-
? iconFillHoverClass && `icon_fill_hover_${iconFillHoverClass}`
|
|
58
|
-
: iconFillActiveHoverClass &&
|
|
59
|
-
`icon_fill_active_hover_${iconFillActiveHoverClass}`, isDisabled &&
|
|
60
|
-
iconFillDisabledClass &&
|
|
61
|
-
`icon_fill_disabled_${iconFillDisabledClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass &&
|
|
62
|
-
`border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, badgeValue && 'icon_with-badge', centeringClass && `centering_${centeringClass}`, onClick && 'cursor_type_pointer', isSkeleton && `icon_skeleton`), ref: ref, "data-testid": dataTestId, "data-tour": dataTour, style: iconStyles, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: [before, _jsxs(LinkWrapper, { className: clsx((link || href || onClick) && 'cursor_type_pointer', link || href ? 'icon__link' : 'icon__item', iconSizeClass && `icon_size_${iconSizeClass}`), href: link || href, LinkComponent: "div", rel: linkRel, target: linkTarget, children: [ImageComponent, (badgeValue || notification) && (_jsx(Badge, { appearance: mergeAppearanceKeys(badgeAppearance, badgeAppearanceSize), className: clsx(badgeClass, 'icon__badge'), size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), showTooltip && (_jsx(Tooltip, { appearance: tooltipAppearance, className: clsx(className, 'icon__tooltip', alignmentClass && `alignment_${alignmentClass}`), title: tooltipTitle, titleSize: tooltipTitleSize, text: tooltipText, textSize: tooltipTextSize }))] }), after] }));
|
|
63
|
-
}));
|
|
64
|
-
const removeFillStroke = (code) => {
|
|
65
|
-
return code
|
|
66
|
-
.replace(/fill=".*?"/g, 'fill=""')
|
|
67
|
-
.replace(/stroke=".*?"/g, 'stroke=""');
|
|
68
|
-
};
|
|
69
|
-
export { Icon, iconConfig };
|