@itcase/ui 1.9.58 → 1.9.60
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/{Avatar_cjs_BIHJrAbQ.js → Avatar_cjs_rB8eleZS.js} +5 -8
- package/dist/{Avatar_es_CtP68jPM.js → Avatar_es_eDWRG48M.js} +2 -5
- package/dist/{Button_cjs_BCcz3-Fw.js → Button_cjs_cNwSkY7f.js} +7 -13
- package/dist/{Button_es_DAzeb-vJ.js → Button_es_egCg1YEe.js} +2 -8
- package/dist/{ChipsGroup_cjs_C27x9x9O.js → ChipsGroup_cjs_DvFJapnM.js} +7 -11
- package/dist/{ChipsGroup_es_BTe1MYhV.js → ChipsGroup_es_C7tQ_vNa.js} +1 -5
- package/dist/{DatePicker_cjs_Dvw_cGFH.js → DatePicker_cjs_B03pbJ0K.js} +10 -14
- package/dist/{DatePicker_es_t3u6yddn.js → DatePicker_es_DIuTzpna.js} +4 -8
- package/dist/{Group_cjs_BLGSskb3.js → Group_cjs_DtBLfpiv.js} +4 -6
- package/dist/{Group_es_CP-uIchb.js → Group_es_BUkLNi2_.js} +1 -3
- package/dist/{Image_cjs_Hvjp2QDB.js → Image_cjs_BSwaz7r5.js} +4 -6
- package/dist/{Image_es_DpOCNWpn.js → Image_es_DhPg4srf.js} +1 -3
- package/dist/{Input_cjs_BQIi1N63.js → Input_cjs_Cr6u1JXB.js} +3 -4
- package/dist/{Input_es_BYbc2X9M.js → Input_es_Da2Yhzcz.js} +1 -2
- package/dist/{Label_cjs_RI5tFcPt.js → Label_cjs_DMOG-8Eu.js} +5 -9
- package/dist/{Label_es_CNRTIAWo.js → Label_es_DZn7Ulmk.js} +1 -5
- package/dist/{Loader_cjs_CJpdLndn.js → Loader_cjs_Bi6IoQFb.js} +5 -8
- package/dist/{Loader_es_CqlLujBJ.js → Loader_es_BZMRBcgn.js} +1 -4
- package/dist/{Overlay_cjs_BK_0yTLw.js → Overlay_cjs_bR_cRWP3.js} +4 -6
- package/dist/{Overlay_es_DOO535JM.js → Overlay_es_BVxlUWXu.js} +1 -3
- package/dist/{SelectContainer_cjs_DJ_IUDjE.js → SelectContainer_cjs_DSMCeePO.js} +17 -22
- package/dist/{SelectContainer_es_BYBGTq-u.js → SelectContainer_es_D2Yz1Qwi.js} +3 -8
- package/dist/cjs/components/Accordion.js +7 -22
- package/dist/cjs/components/Avatar.js +4 -18
- package/dist/cjs/components/AvatarStack.js +8 -22
- package/dist/cjs/components/Badge.js +5 -19
- package/dist/cjs/components/Breadcrumbs.js +7 -21
- package/dist/cjs/components/Button.js +4 -18
- package/dist/cjs/components/Cell.js +6 -20
- package/dist/cjs/components/Checkbox.js +7 -15
- package/dist/cjs/components/Checkmark.js +5 -19
- package/dist/cjs/components/Chips.js +2 -16
- package/dist/cjs/components/Choice.js +7 -21
- package/dist/cjs/components/Code.js +5 -10
- package/dist/cjs/components/CookiesWarning.js +7 -21
- package/dist/cjs/components/Dadata.js +4 -9
- package/dist/cjs/components/DatePeriod.js +18 -33
- package/dist/cjs/components/DatePicker.js +7 -21
- package/dist/cjs/components/Divider.js +6 -14
- package/dist/cjs/components/Dot.js +4 -10
- package/dist/cjs/components/Drawer.js +6 -21
- package/dist/cjs/components/Dropdown.js +5 -21
- package/dist/cjs/components/Dropzone.js +11 -25
- package/dist/cjs/components/Flex.js +6 -12
- package/dist/cjs/components/Grid.js +8 -14
- package/dist/cjs/components/Group.js +3 -10
- package/dist/cjs/components/HTMLContent.js +4 -10
- package/dist/cjs/components/HeroTitle.js +5 -19
- package/dist/cjs/components/Icon.js +5 -19
- package/dist/cjs/components/Image.js +4 -12
- package/dist/cjs/components/Input.js +4 -9
- package/dist/cjs/components/InputNumber.js +6 -20
- package/dist/cjs/components/InputPassword.js +6 -20
- package/dist/cjs/components/Label.js +2 -16
- package/dist/cjs/components/Link.js +6 -14
- package/dist/cjs/components/List.js +8 -16
- package/dist/cjs/components/Loader.js +3 -11
- package/dist/cjs/components/Logo.js +8 -18
- package/dist/cjs/components/MenuItem.js +5 -19
- package/dist/cjs/components/Modal.js +7 -21
- package/dist/cjs/components/ModalSheetBottom.js +5 -19
- package/dist/cjs/components/Notification.js +11 -25
- package/dist/cjs/components/Overlay.js +3 -10
- package/dist/cjs/components/Pagination.js +8 -24
- package/dist/cjs/components/Radio.js +5 -13
- package/dist/cjs/components/RangeSlider.js +4 -10
- package/dist/cjs/components/Response.js +10 -24
- package/dist/cjs/components/SVGContent.js +5 -14
- package/dist/cjs/components/ScrollOnDrag.js +4 -10
- package/dist/cjs/components/ScrollToView.js +4 -10
- package/dist/cjs/components/Search.js +7 -21
- package/dist/cjs/components/Segmented.js +6 -20
- package/dist/cjs/components/Select.js +5 -20
- package/dist/cjs/components/Swiper.js +6 -20
- package/dist/cjs/components/Switch.js +5 -13
- package/dist/cjs/components/Tab.js +8 -23
- package/dist/cjs/components/Text.js +6 -14
- package/dist/cjs/components/Textarea.js +5 -10
- package/dist/cjs/components/Tile.js +5 -19
- package/dist/cjs/components/Title.js +5 -19
- package/dist/cjs/components/Tooltip.js +5 -19
- package/dist/cjs/components/Video.js +5 -9
- package/dist/cjs/components/Warning.js +5 -19
- package/dist/cjs/context/Notifications.js +16 -188
- package/dist/cjs/context/UIContext.js +14 -71
- package/dist/cjs/context/UrlAssetPrefix.js +15 -13
- package/dist/cjs/hoc/urlWithAssetPrefix.js +14 -73
- package/dist/cjs/hooks/useAppearanceConfig/useAppearanceConfig.js +14 -25
- package/dist/cjs/hooks/useAppearanceConfig.js +12 -2
- package/dist/cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +10 -124
- package/dist/cjs/hooks/useDevicePropsGenerator.js +6 -9
- package/dist/cjs/hooks/useDeviceTargetClass.js +8 -4
- package/dist/cjs/hooks/useMediaQueries/useMediaQueries.js +13 -116
- package/dist/cjs/hooks/useMediaQueries.js +11 -2
- package/dist/cjs/hooks/useStyles/styleAttributes.js +15 -168
- package/dist/cjs/hooks/useStyles/useStyles.js +10 -196
- package/dist/cjs/hooks/useStyles.js +7 -10
- package/dist/cjs/hooks.js +15 -6
- package/dist/cjs/utils/mergeAppearanceKeys.js +15 -15
- package/dist/cjs/utils/setViewportProperty.js +15 -5
- package/dist/cjs/utils.js +14 -4
- package/dist/components/Accordion.js +1 -16
- package/dist/components/Avatar.js +4 -18
- package/dist/components/AvatarStack.js +4 -18
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge.js +2 -16
- package/dist/components/Breadcrumbs.js +1 -15
- package/dist/components/Button.js +4 -18
- package/dist/components/Cell.js +2 -16
- package/dist/components/Checkbox.js +4 -12
- package/dist/components/Checkmark.js +1 -15
- package/dist/components/Chips.js +2 -16
- package/dist/components/Choice.js +2 -16
- package/dist/components/Code.js +3 -8
- package/dist/components/CookiesWarning.js +4 -18
- package/dist/components/Dadata.js +4 -9
- package/dist/components/DatePeriod.js +12 -27
- package/dist/components/DatePicker.js +7 -21
- package/dist/components/Divider.js +3 -11
- package/dist/components/Dot.js +2 -8
- package/dist/components/Drawer.js +3 -18
- package/dist/components/Dropdown.js +1 -17
- package/dist/components/Dropzone.js +7 -21
- package/dist/components/Flex.js +2 -8
- package/dist/components/Grid.js +2 -8
- package/dist/components/Group.js +3 -10
- package/dist/components/HTMLContent.js +2 -8
- package/dist/components/HeroTitle.js +1 -15
- package/dist/components/Icon.js +2 -16
- package/dist/components/Image.js +4 -12
- package/dist/components/Input.js +4 -9
- package/dist/components/InputNumber.js +4 -18
- package/dist/components/InputPassword/index.js +1 -1
- package/dist/components/InputPassword.js +3 -17
- package/dist/components/Label.js +2 -16
- package/dist/components/Link/index.js +1 -1
- package/dist/components/Link.js +2 -10
- package/dist/components/List.js +2 -10
- package/dist/components/Loader.js +3 -11
- package/dist/components/Logo.js +3 -13
- package/dist/components/MenuItem.js +1 -15
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Modal.js +3 -17
- package/dist/components/ModalSheetBottom.js +1 -15
- package/dist/components/Notification/index.js +1 -1
- package/dist/components/Notification.js +5 -19
- package/dist/components/Overlay.js +3 -10
- package/dist/components/Pagination.js +1 -17
- package/dist/components/Radio.js +2 -10
- package/dist/components/RangeSlider.js +2 -8
- package/dist/components/Response.js +5 -19
- package/dist/components/SVGContent.js +2 -11
- package/dist/components/ScrollOnDrag.js +2 -8
- package/dist/components/ScrollToView.js +2 -8
- package/dist/components/Search/index.js +1 -1
- package/dist/components/Search.js +1 -15
- package/dist/components/Segmented.js +2 -16
- package/dist/components/Select.js +5 -20
- package/dist/components/Swiper.js +2 -16
- package/dist/components/Switch.js +2 -10
- package/dist/components/Tab.js +2 -17
- package/dist/components/Text.js +3 -11
- package/dist/components/Textarea.js +3 -8
- package/dist/components/Tile.js +1 -15
- package/dist/components/Title.js +2 -16
- package/dist/components/Tooltip.js +2 -16
- package/dist/components/Video.js +4 -8
- package/dist/components/Warning.js +1 -15
- package/dist/hooks/useAppearanceConfig.js +11 -1
- package/dist/hooks/useDevicePropsGenerator.js +5 -8
- package/dist/hooks/useMediaQueries.js +10 -1
- package/dist/hooks/useStyles.js +6 -9
- package/dist/hooks.js +12 -7
- package/dist/primitives_cjs_CnyJ13MJ.js +2715 -0
- package/dist/primitives_es_BjyEnscF.js +2672 -0
- package/dist/types/components/Accordion/index.d.ts +1 -0
- package/dist/types/components/Avatar/index.d.ts +1 -0
- package/dist/types/components/AvatarStack/index.d.ts +1 -0
- package/dist/types/components/Badge/index.d.ts +2 -1
- package/dist/types/components/Breadcrumbs/index.d.ts +1 -0
- package/dist/types/components/Button/Button.d.ts +45 -45
- package/dist/types/components/Button/index.d.ts +1 -0
- package/dist/types/components/Cell/index.d.ts +1 -0
- package/dist/types/components/Checkbox/index.d.ts +1 -0
- package/dist/types/components/Checkmark/index.d.ts +1 -0
- package/dist/types/components/Choice/index.d.ts +1 -0
- package/dist/types/components/Code/index.d.ts +1 -0
- package/dist/types/components/CookiesWarning/index.d.ts +1 -0
- package/dist/types/components/Dadata/index.d.ts +1 -0
- package/dist/types/components/DatePeriod/index.d.ts +1 -0
- package/dist/types/components/DatePicker/index.d.ts +1 -0
- package/dist/types/components/Divider/index.d.ts +1 -0
- package/dist/types/components/Dot/index.d.ts +1 -0
- package/dist/types/components/Drawer/index.d.ts +1 -0
- package/dist/types/components/Dropdown/index.d.ts +1 -0
- package/dist/types/components/Dropzone/index.d.ts +1 -0
- package/dist/types/components/Flex/index.d.ts +1 -0
- package/dist/types/components/Grid/index.d.ts +1 -0
- package/dist/types/components/Group/Group.d.ts +5 -5
- package/dist/types/components/Group/index.d.ts +1 -0
- package/dist/types/components/HTMLContent/index.d.ts +1 -0
- package/dist/types/components/HeroTitle/index.d.ts +1 -0
- package/dist/types/components/Icon/Icon.d.ts +2 -2
- package/dist/types/components/Icon/index.d.ts +1 -0
- package/dist/types/components/Image/index.d.ts +1 -0
- package/dist/types/components/Input/index.d.ts +1 -0
- package/dist/types/components/InputPassword/index.d.ts +2 -1
- package/dist/types/components/Label/index.d.ts +1 -0
- package/dist/types/components/Link/index.d.ts +2 -1
- package/dist/types/components/List/index.d.ts +1 -0
- package/dist/types/components/Loader/index.d.ts +1 -0
- package/dist/types/components/Logo/index.d.ts +1 -0
- package/dist/types/components/MenuItem/index.d.ts +1 -0
- package/dist/types/components/Modal/Modal.d.ts +16 -16
- package/dist/types/components/Modal/index.d.ts +2 -1
- package/dist/types/components/ModalSheetBottom/ModalSheetBottom.d.ts +7 -7
- package/dist/types/components/ModalSheetBottom/index.d.ts +1 -0
- package/dist/types/components/Notification/index.d.ts +2 -1
- package/dist/types/components/Overlay/index.d.ts +1 -0
- package/dist/types/components/Pagination/index.d.ts +1 -0
- package/dist/types/components/Radio/index.d.ts +1 -0
- package/dist/types/components/RangeSlider/index.d.ts +1 -0
- package/dist/types/components/Response/Response.d.ts +33 -33
- package/dist/types/components/Response/index.d.ts +1 -0
- package/dist/types/components/SVGContent/SVGContent.d.ts +1 -1
- package/dist/types/components/SVGContent/index.d.ts +1 -0
- package/dist/types/components/ScrollOnDrag/index.d.ts +1 -0
- package/dist/types/components/ScrollToView/index.d.ts +1 -0
- package/dist/types/components/Scrollbar/index.d.ts +1 -0
- package/dist/types/components/Search/SearchInput.d.ts +19 -19
- package/dist/types/components/Search/index.d.ts +2 -1
- package/dist/types/components/Segmented/index.d.ts +1 -0
- package/dist/types/components/Select/index.d.ts +1 -0
- package/dist/types/components/Swiper/index.d.ts +1 -0
- package/dist/types/components/Switch/Switch.d.ts +4 -4
- package/dist/types/components/Switch/index.d.ts +1 -0
- package/dist/types/components/Tab/index.d.ts +1 -0
- package/dist/types/components/Text/index.d.ts +1 -0
- package/dist/types/components/Textarea/index.d.ts +1 -0
- package/dist/types/components/Tile/index.d.ts +1 -0
- package/dist/types/components/Title/index.d.ts +1 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +6 -6
- package/dist/types/components/Tooltip/index.d.ts +1 -0
- package/dist/types/components/Video/index.d.ts +1 -0
- package/dist/types/components/Warning/index.d.ts +1 -0
- package/dist/utils.js +12 -2
- package/package.json +1 -1
- package/dist/Divider_cjs_C5Ou2Kqa.js +0 -104
- package/dist/Divider_es_D2snK_vn.js +0 -100
- package/dist/DropdownItem_cjs_k28TIoDU.js +0 -230
- package/dist/DropdownItem_es_DjPgbwtU.js +0 -225
- package/dist/Icon_cjs_DTvdhr8B.js +0 -1099
- package/dist/Icon_es_kewxGRUB.js +0 -1086
- package/dist/Link_cjs_Dn7UhCYe.js +0 -277
- package/dist/Link_es_BDAmhIzd.js +0 -272
- package/dist/Text_cjs_erTy2pUN.js +0 -68
- package/dist/Text_es_DVNvU0m0.js +0 -64
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require('react');
|
|
4
|
+
var primitives = require('../../../primitives_cjs_CnyJ13MJ.js');
|
|
5
|
+
require('react/jsx-runtime');
|
|
6
|
+
require('clsx');
|
|
7
|
+
require('lodash/camelCase');
|
|
8
|
+
require('lodash/castArray');
|
|
9
|
+
require('lodash/upperFirst');
|
|
10
|
+
require('uuid');
|
|
11
|
+
require('@itcase/common');
|
|
12
|
+
require('react-responsive');
|
|
13
|
+
require('lodash/maxBy');
|
|
14
|
+
require('react-inlinesvg');
|
|
4
15
|
|
|
5
|
-
const useAppearanceConfig = (appearance, componentConfig, isDisabled) => {
|
|
6
|
-
const appearanceConfig = React.useMemo(() => {
|
|
7
|
-
if (appearance) {
|
|
8
|
-
const appearanceProps = appearance.split(' ').reduce((resultConfig, appearanceKey) => ({
|
|
9
|
-
...resultConfig,
|
|
10
|
-
...componentConfig.appearance?.[appearanceKey],
|
|
11
|
-
}), {});
|
|
12
|
-
if (isDisabled &&
|
|
13
|
-
(componentConfig?.appearance?.disabled ||
|
|
14
|
-
componentConfig?.appearance?.disabledPrimary)) {
|
|
15
|
-
Object.assign(appearanceProps, componentConfig?.appearance?.disabled ||
|
|
16
|
-
componentConfig?.appearance?.disabledPrimary);
|
|
17
|
-
}
|
|
18
|
-
return appearanceProps;
|
|
19
|
-
}
|
|
20
|
-
if (isDisabled) {
|
|
21
|
-
return (componentConfig?.appearance?.disabled ||
|
|
22
|
-
componentConfig?.appearance?.disabledPrimary);
|
|
23
|
-
}
|
|
24
|
-
return {};
|
|
25
|
-
}, [appearance, componentConfig?.appearance, isDisabled]);
|
|
26
|
-
return appearanceConfig;
|
|
27
|
-
};
|
|
28
16
|
|
|
29
|
-
|
|
17
|
+
|
|
18
|
+
exports.useAppearanceConfig = primitives.useAppearanceConfig;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var primitives = require('../../primitives_cjs_CnyJ13MJ.js');
|
|
4
|
+
require('react/jsx-runtime');
|
|
4
5
|
require('react');
|
|
6
|
+
require('clsx');
|
|
7
|
+
require('lodash/camelCase');
|
|
8
|
+
require('lodash/castArray');
|
|
9
|
+
require('lodash/upperFirst');
|
|
10
|
+
require('uuid');
|
|
11
|
+
require('@itcase/common');
|
|
12
|
+
require('react-responsive');
|
|
13
|
+
require('lodash/maxBy');
|
|
14
|
+
require('react-inlinesvg');
|
|
5
15
|
|
|
6
16
|
|
|
7
17
|
|
|
8
|
-
exports.useAppearanceConfig =
|
|
18
|
+
exports.useAppearanceConfig = primitives.useAppearanceConfig;
|
|
@@ -1,132 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
require('
|
|
8
|
-
var UIContext = require('../../context/UIContext.js');
|
|
9
|
-
var index_helpers = require('../../hooks.js');
|
|
10
|
-
var styleAttributes = require('../useStyles/styleAttributes.js');
|
|
3
|
+
require('react');
|
|
4
|
+
require('lodash/camelCase');
|
|
5
|
+
require('lodash/castArray');
|
|
6
|
+
require('lodash/upperFirst');
|
|
7
|
+
var primitives = require('../../../primitives_cjs_CnyJ13MJ.js');
|
|
11
8
|
require('react/jsx-runtime');
|
|
9
|
+
require('clsx');
|
|
12
10
|
require('uuid');
|
|
13
11
|
require('@itcase/common');
|
|
14
|
-
require('../useMediaQueries/useMediaQueries.js');
|
|
15
12
|
require('react-responsive');
|
|
16
|
-
require('
|
|
13
|
+
require('lodash/maxBy');
|
|
14
|
+
require('react-inlinesvg');
|
|
17
15
|
|
|
18
|
-
function useDevicePropsGenerator(componentProps, appearanceConfig) {
|
|
19
|
-
/** Get or generate(classname) a prop depending on the user's device.
|
|
20
|
-
* Props:
|
|
21
|
-
* - "componentProps" - original "props" from component
|
|
22
|
-
* - "appearanceConfig" - special appearance dictionary with styles presets
|
|
23
|
-
*
|
|
24
|
-
* Usage for create class value:
|
|
25
|
-
* const appearanceConfig = (
|
|
26
|
-
* appearance && componentConfig.appearance && componentConfig.appearance[appearance]
|
|
27
|
-
* )
|
|
28
|
-
* const propsGenerator = useDevicePropsGenerator(props, appearanceConfig)
|
|
29
|
-
* ---------
|
|
30
|
-
* const fillClass = propsGenerator.getClassName('fill')
|
|
31
|
-
* "fillClass" - is "surface-secondary"
|
|
32
|
-
* ---------
|
|
33
|
-
* const fillClass = propsGenerator.getClassName('fill', { prefix: 'fill_' })
|
|
34
|
-
* "fillClass" - is "fill_surface-secondary"
|
|
35
|
-
* ---------
|
|
36
|
-
* const fillClass = propsGenerator.fillClass
|
|
37
|
-
* "fillClass" - is "surface-secondary"
|
|
38
|
-
* ---------
|
|
39
|
-
* const { fillClass } = propsGenerator
|
|
40
|
-
* "fillClass" - is "surface-secondary"
|
|
41
|
-
*
|
|
42
|
-
* Usage for props value for device:
|
|
43
|
-
* const { titleTextSize } = propsGenerator / const titleTextSize = propsGenerator.titleTextSize
|
|
44
|
-
*
|
|
45
|
-
* "titleTextSize" - contain some value from props:
|
|
46
|
-
* - titleTextSize
|
|
47
|
-
* - titleTextSizeMobile
|
|
48
|
-
* - titleTextSizeTablet
|
|
49
|
-
* - titleTextSizeDesktop
|
|
50
|
-
* ---------
|
|
51
|
-
**/
|
|
52
|
-
const { deviceCurrentMainType } = UIContext.useUserDeviceContext();
|
|
53
|
-
const devicePropsGenerator = React.useMemo(() => {
|
|
54
|
-
const propsGenerator = {
|
|
55
|
-
getProp(propKey) {
|
|
56
|
-
const propsForDeviceKey = `${propKey}${upperFirst(deviceCurrentMainType)}`;
|
|
57
|
-
const valueForDevice = componentProps[propsForDeviceKey];
|
|
58
|
-
const valueDefault = componentProps[propKey];
|
|
59
|
-
const appearanceForDevice = appearanceConfig?.[propsForDeviceKey];
|
|
60
|
-
const appearanceDefault = appearanceConfig?.[propKey];
|
|
61
|
-
// prettier-ignore
|
|
62
|
-
const targetPropsValue = (
|
|
63
|
-
// Value for device from props is first priority
|
|
64
|
-
valueForDevice ||
|
|
65
|
-
// Value without device from props is second priority
|
|
66
|
-
valueDefault ||
|
|
67
|
-
// Value for device from appearance config is third priority
|
|
68
|
-
appearanceForDevice ||
|
|
69
|
-
// Value without device from appearance config is last priority
|
|
70
|
-
appearanceDefault);
|
|
71
|
-
return targetPropsValue;
|
|
72
|
-
},
|
|
73
|
-
// eslint-disable-next-line perfectionist/sort-objects
|
|
74
|
-
getClassName(propKey, params) {
|
|
75
|
-
const { prefix = '', replace = [/([A-Z])/g, '-$1'] } = params || {};
|
|
76
|
-
const targetClassValue = this.getProp(String(propKey));
|
|
77
|
-
const styleAttributeKeys = styleAttributes.default.map((attr) => index_helpers.getStyleAttributeKey(attr));
|
|
78
|
-
if (styleAttributeKeys.includes(String(propKey)) &&
|
|
79
|
-
(typeof targetClassValue === 'number' ||
|
|
80
|
-
(typeof targetClassValue === 'string' &&
|
|
81
|
-
!isNaN(parseFloat(targetClassValue))))) {
|
|
82
|
-
return '';
|
|
83
|
-
}
|
|
84
|
-
if (targetClassValue) {
|
|
85
|
-
let cleanClassValue = String(targetClassValue);
|
|
86
|
-
if (!cleanClassValue.includes('.')) {
|
|
87
|
-
cleanClassValue = camelCase(cleanClassValue);
|
|
88
|
-
}
|
|
89
|
-
if (replace) {
|
|
90
|
-
const replaceList = castArray(replace);
|
|
91
|
-
cleanClassValue = cleanClassValue.replace(replaceList[0],
|
|
92
|
-
// @ts-expect-error
|
|
93
|
-
replaceList[1] || '');
|
|
94
|
-
}
|
|
95
|
-
// prettier-ignore
|
|
96
|
-
return `${prefix}${cleanClassValue}`.toLowerCase();
|
|
97
|
-
}
|
|
98
|
-
// If target key not exists in props and appearance config - return empty class
|
|
99
|
-
return '';
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
const generatorProxyHandler = {
|
|
103
|
-
get(target, propKey, receiver, ...args) {
|
|
104
|
-
if (typeof propKey === 'string') {
|
|
105
|
-
// If object does not have the property being retrieved
|
|
106
|
-
if (!Reflect.has(target, propKey)) {
|
|
107
|
-
// And property ended on "Class" keyword
|
|
108
|
-
if (propKey.endsWith('Class')) {
|
|
109
|
-
// prettier-ignore
|
|
110
|
-
const shortProp = propKey.substring(0, propKey.lastIndexOf('Class'));
|
|
111
|
-
// Return prop from props for device as formatted class name
|
|
112
|
-
return target.getClassName(shortProp);
|
|
113
|
-
}
|
|
114
|
-
// Return prop from props for device
|
|
115
|
-
return target.getProp(propKey);
|
|
116
|
-
}
|
|
117
|
-
// Return object property. Original "get".
|
|
118
|
-
// @ts-expect-error
|
|
119
|
-
return Reflect.get(target, propKey, receiver, ...args);
|
|
120
|
-
}
|
|
121
|
-
// In some cases, like in Chrome browser, sometime "prop" is not string.
|
|
122
|
-
// We return this object as is.
|
|
123
|
-
return propKey;
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
return new Proxy(propsGenerator, generatorProxyHandler);
|
|
127
|
-
// TODO: componentProps(react) and appearanceConfig(not memoized) is always new. maybe better check Object.values?
|
|
128
|
-
}, [componentProps, appearanceConfig, deviceCurrentMainType]);
|
|
129
|
-
return devicePropsGenerator;
|
|
130
|
-
}
|
|
131
16
|
|
|
132
|
-
|
|
17
|
+
|
|
18
|
+
exports.useDevicePropsGenerator = primitives.useDevicePropsGenerator;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var primitives = require('../../primitives_cjs_CnyJ13MJ.js');
|
|
4
|
+
require('react/jsx-runtime');
|
|
4
5
|
require('react');
|
|
6
|
+
require('clsx');
|
|
5
7
|
require('lodash/camelCase');
|
|
6
8
|
require('lodash/castArray');
|
|
7
9
|
require('lodash/upperFirst');
|
|
8
|
-
require('../context/Notifications.js');
|
|
9
|
-
require('react/jsx-runtime');
|
|
10
10
|
require('uuid');
|
|
11
11
|
require('@itcase/common');
|
|
12
|
-
require('../context/UIContext.js');
|
|
13
|
-
require('./useMediaQueries/useMediaQueries.js');
|
|
14
12
|
require('react-responsive');
|
|
15
|
-
require('
|
|
16
|
-
require('
|
|
17
|
-
require('./useStyles/styleAttributes.js');
|
|
13
|
+
require('lodash/maxBy');
|
|
14
|
+
require('react-inlinesvg');
|
|
18
15
|
|
|
19
16
|
|
|
20
17
|
|
|
21
|
-
exports.useDevicePropsGenerator =
|
|
18
|
+
exports.useDevicePropsGenerator = primitives.useDevicePropsGenerator;
|
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var camelCase = require('lodash/camelCase');
|
|
5
5
|
var castArray = require('lodash/castArray');
|
|
6
|
-
var
|
|
6
|
+
var primitives = require('../../primitives_cjs_CnyJ13MJ.js');
|
|
7
7
|
require('react/jsx-runtime');
|
|
8
|
-
require('
|
|
8
|
+
require('clsx');
|
|
9
|
+
require('lodash/upperFirst');
|
|
10
|
+
require('uuid');
|
|
11
|
+
require('@itcase/common');
|
|
9
12
|
require('react-responsive');
|
|
10
|
-
require('
|
|
13
|
+
require('lodash/maxBy');
|
|
14
|
+
require('react-inlinesvg');
|
|
11
15
|
|
|
12
16
|
/** TODO:
|
|
13
17
|
* Hook is still used in "itcase-forms".
|
|
@@ -35,7 +39,7 @@ function useDeviceTargetClass(componentProps, hookProps) {
|
|
|
35
39
|
isMobile,
|
|
36
40
|
isTablet,
|
|
37
41
|
isDesktop
|
|
38
|
-
} =
|
|
42
|
+
} = primitives.useUserDeviceContext();
|
|
39
43
|
const targetClassValue = React.useMemo(() => {
|
|
40
44
|
// prettier-ignore
|
|
41
45
|
const deviceCurrentMainType = isMobile && 'Mobile' || isTablet && 'Tablet' || isDesktop && 'Desktop' || '';
|
|
@@ -1,121 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require('react');
|
|
4
|
+
require('react-responsive');
|
|
5
|
+
var primitives = require('../../../primitives_cjs_CnyJ13MJ.js');
|
|
6
|
+
require('react/jsx-runtime');
|
|
7
|
+
require('clsx');
|
|
8
|
+
require('lodash/camelCase');
|
|
9
|
+
require('lodash/castArray');
|
|
10
|
+
require('lodash/upperFirst');
|
|
11
|
+
require('uuid');
|
|
12
|
+
require('@itcase/common');
|
|
13
|
+
require('lodash/maxBy');
|
|
14
|
+
require('react-inlinesvg');
|
|
5
15
|
|
|
6
|
-
var tablet = "48em";
|
|
7
|
-
var mediaQueries = {
|
|
8
|
-
"mobile-tiny": "15em",
|
|
9
|
-
"mobile-super-extra-large": "40em",
|
|
10
|
-
tablet: tablet,
|
|
11
|
-
"desktop-small": "60em",
|
|
12
|
-
"desktop-huge": "160em"
|
|
13
|
-
};
|
|
14
16
|
|
|
15
|
-
const isSSR = typeof window === 'undefined';
|
|
16
|
-
function useMediaQueries(userDevice = {}) {
|
|
17
|
-
// const isWarning = useMediaQuery({ maxWidth: mediaQueries['mobile-tiny'] })
|
|
18
|
-
// prettier-ignore
|
|
19
|
-
const isMobile = reactResponsive.useMediaQuery({
|
|
20
|
-
minWidth: mediaQueries['mobile-tiny'],
|
|
21
|
-
maxWidth: mediaQueries['tablet']
|
|
22
|
-
}) || isSSR && Boolean(userDevice.isMobile);
|
|
23
|
-
// const isMobileTiny = useMediaQuery({
|
|
24
|
-
// minWidth: mediaQueries['mobile-tiny'],
|
|
25
|
-
// maxWidth: mediaQueries['mobile-small'],
|
|
26
|
-
// })
|
|
27
|
-
// const isMobileSmall = useMediaQuery({
|
|
28
|
-
// minWidth: mediaQueries['mobile-small'],
|
|
29
|
-
// maxWidth: mediaQueries['mobile-medium'],
|
|
30
|
-
// })
|
|
31
|
-
// const isMobileMedium = useMediaQuery({
|
|
32
|
-
// minWidth: mediaQueries['mobile-medium'],
|
|
33
|
-
// maxWidth: mediaQueries['mobile-normal'],
|
|
34
|
-
// })
|
|
35
|
-
// const isMobileNormal = useMediaQuery({
|
|
36
|
-
// minWidth: mediaQueries['mobile-normal'],
|
|
37
|
-
// maxWidth: mediaQueries['mobile-large'],
|
|
38
|
-
// })
|
|
39
|
-
// const isMobileStandart = useMediaQuery({
|
|
40
|
-
// minWidth: mediaQueries['mobile-large'],
|
|
41
|
-
// maxWidth: mediaQueries['mobile-extra-large'],
|
|
42
|
-
// })
|
|
43
|
-
// const isMobileLarge = useMediaQuery({
|
|
44
|
-
// minWidth: mediaQueries['mobile-extra-large'],
|
|
45
|
-
// maxWidth: mediaQueries['mobile-super-extra-large'],
|
|
46
|
-
// })
|
|
47
|
-
reactResponsive.useMediaQuery({
|
|
48
|
-
minWidth: mediaQueries['mobile-super-extra-large'],
|
|
49
|
-
maxWidth: mediaQueries['tablet']
|
|
50
|
-
});
|
|
51
|
-
// prettier-ignore
|
|
52
|
-
const isTablet = reactResponsive.useMediaQuery({
|
|
53
|
-
minWidth: mediaQueries['tablet'],
|
|
54
|
-
maxWidth: mediaQueries['desktop-small']
|
|
55
|
-
}) || isSSR && Boolean(userDevice.isTablet);
|
|
56
|
-
// const isTabletSmall = useMediaQuery({
|
|
57
|
-
// minWidth: mediaQueries['tablet-small'],
|
|
58
|
-
// maxWidth: mediaQueries['tablet'],
|
|
59
|
-
// })
|
|
60
|
-
// const isTabletLarge = useMediaQuery({
|
|
61
|
-
// minWidth: mediaQueries['tablet'],
|
|
62
|
-
// maxWidth: mediaQueries['tablet-large'],
|
|
63
|
-
// })
|
|
64
|
-
// prettier-ignore
|
|
65
|
-
const isDesktop = reactResponsive.useMediaQuery({
|
|
66
|
-
minWidth: mediaQueries['desktop-small'],
|
|
67
|
-
maxWidth: mediaQueries['desktop-super-huge']
|
|
68
|
-
}) || isSSR && Boolean(userDevice.isDesktop);
|
|
69
|
-
// const isDesktopSmall = useMediaQuery({
|
|
70
|
-
// minWidth: mediaQueries['desktop-small'],
|
|
71
|
-
// maxWidth: mediaQueries['desktop-medium'],
|
|
72
|
-
// })
|
|
73
|
-
// const isDesktopMedium = useMediaQuery({
|
|
74
|
-
// minWidth: mediaQueries['desktop-medium'],
|
|
75
|
-
// maxWidth: mediaQueries['desktop-normal'],
|
|
76
|
-
// })
|
|
77
|
-
// const isDesktopNormal = useMediaQuery({
|
|
78
|
-
// minWidth: mediaQueries['desktop-normal'],
|
|
79
|
-
// maxWidth: mediaQueries['desktop-large'],
|
|
80
|
-
// })
|
|
81
|
-
// const isDesktopStandart = useMediaQuery({
|
|
82
|
-
// minWidth: mediaQueries['desktop-large'],
|
|
83
|
-
// maxWidth: mediaQueries['desktop-extra-large'],
|
|
84
|
-
// })
|
|
85
|
-
// const isDesktopLarge = useMediaQuery({
|
|
86
|
-
// minWidth: mediaQueries['desktop-extra-large'],
|
|
87
|
-
// maxWidth: mediaQueries['desktop-super-extra-large'],
|
|
88
|
-
// })
|
|
89
|
-
// const isDesktopHuge = useMediaQuery({
|
|
90
|
-
// minWidth: mediaQueries['desktop-super-extra-large'],
|
|
91
|
-
// maxWidth: mediaQueries['desktop-huge'],
|
|
92
|
-
// })
|
|
93
|
-
const isDesktopMega = reactResponsive.useMediaQuery({
|
|
94
|
-
minWidth: mediaQueries['desktop-huge']
|
|
95
|
-
});
|
|
96
|
-
const deviceTypes = React.useMemo(() => ({
|
|
97
|
-
// isWarning,
|
|
98
|
-
isMobile: isMobile,
|
|
99
|
-
// isMobileTiny,
|
|
100
|
-
// isMobileSmall,
|
|
101
|
-
// isMobileMedium,
|
|
102
|
-
// isMobileNormal,
|
|
103
|
-
// isMobileStandart,
|
|
104
|
-
// isMobileLarge,
|
|
105
|
-
isMobileHuge: isMobile,
|
|
106
|
-
isTablet: isTablet,
|
|
107
|
-
// isTabletSmall,
|
|
108
|
-
// isTabletLarge,
|
|
109
|
-
isDesktop: isDesktop,
|
|
110
|
-
// isDesktopSmall,
|
|
111
|
-
// isDesktopMedium,
|
|
112
|
-
// isDesktopNormal,
|
|
113
|
-
// isDesktopStandart,
|
|
114
|
-
// isDesktopLarge,
|
|
115
|
-
// isDesktopHuge,
|
|
116
|
-
isDesktopMega: isDesktopMega
|
|
117
|
-
}), [isMobile, isTablet, isDesktop, isDesktopMega]);
|
|
118
|
-
return deviceTypes;
|
|
119
|
-
}
|
|
120
17
|
|
|
121
|
-
exports.useMediaQueries = useMediaQueries;
|
|
18
|
+
exports.useMediaQueries = primitives.useMediaQueries;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var primitives = require('../../primitives_cjs_CnyJ13MJ.js');
|
|
4
|
+
require('react/jsx-runtime');
|
|
4
5
|
require('react');
|
|
6
|
+
require('clsx');
|
|
7
|
+
require('lodash/camelCase');
|
|
8
|
+
require('lodash/castArray');
|
|
9
|
+
require('lodash/upperFirst');
|
|
10
|
+
require('uuid');
|
|
11
|
+
require('@itcase/common');
|
|
5
12
|
require('react-responsive');
|
|
13
|
+
require('lodash/maxBy');
|
|
14
|
+
require('react-inlinesvg');
|
|
6
15
|
|
|
7
16
|
|
|
8
17
|
|
|
9
|
-
exports.useMediaQueries =
|
|
18
|
+
exports.useMediaQueries = primitives.useMediaQueries;
|
|
@@ -2,172 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'borderTopWidth',
|
|
18
|
-
'borderWidth',
|
|
19
|
-
'bottom',
|
|
20
|
-
'display',
|
|
21
|
-
'flex',
|
|
22
|
-
'flexBasis',
|
|
23
|
-
'flexDirection',
|
|
24
|
-
'flexGrow',
|
|
25
|
-
'flexShrink',
|
|
26
|
-
'flexWrap',
|
|
27
|
-
'gap',
|
|
28
|
-
'rowGap',
|
|
29
|
-
'columnGap',
|
|
30
|
-
'columnWidth',
|
|
31
|
-
'height',
|
|
32
|
-
'justifyContent',
|
|
33
|
-
'left',
|
|
34
|
-
'margin',
|
|
35
|
-
'marginBottom',
|
|
36
|
-
'marginHorizontal',
|
|
37
|
-
'marginLeft',
|
|
38
|
-
'marginRight',
|
|
39
|
-
'marginTop',
|
|
40
|
-
'marginVertical',
|
|
41
|
-
'maxHeight',
|
|
42
|
-
'maxWidth',
|
|
43
|
-
'minHeight',
|
|
44
|
-
'minWidth',
|
|
45
|
-
'overflow',
|
|
46
|
-
'overflowY',
|
|
47
|
-
'overflowX',
|
|
48
|
-
'padding',
|
|
49
|
-
'paddingBottom',
|
|
50
|
-
'paddingEnd',
|
|
51
|
-
'paddingHorizontal',
|
|
52
|
-
'paddingLeft',
|
|
53
|
-
'paddingRight',
|
|
54
|
-
'paddingStart',
|
|
55
|
-
'paddingTop',
|
|
56
|
-
'paddingVertical',
|
|
57
|
-
'position',
|
|
58
|
-
'right',
|
|
59
|
-
'top',
|
|
60
|
-
[
|
|
61
|
-
'width',
|
|
62
|
-
{
|
|
63
|
-
validate: (value) => {
|
|
64
|
-
// Pass only number value for "width" style.
|
|
65
|
-
// If width have custom value, like "fill", we must set class by this value.
|
|
66
|
-
// "\d" - digit; "+" - 1 or more
|
|
67
|
-
return /\d+/.test(value);
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
'zIndex',
|
|
72
|
-
'order',
|
|
73
|
-
/**
|
|
74
|
-
* Shadow
|
|
75
|
-
*/
|
|
76
|
-
'shadowColor',
|
|
77
|
-
'shadowOffset',
|
|
78
|
-
'shadowOpacity',
|
|
79
|
-
'shadowRadius',
|
|
80
|
-
/**
|
|
81
|
-
* Transform
|
|
82
|
-
*/
|
|
83
|
-
'transform',
|
|
84
|
-
/**
|
|
85
|
-
* View
|
|
86
|
-
*/
|
|
87
|
-
'background',
|
|
88
|
-
'backgroundColor',
|
|
89
|
-
'borderBottomColor',
|
|
90
|
-
'borderBottomEndRadius',
|
|
91
|
-
'borderBottomLeftRadius',
|
|
92
|
-
'borderBottomRightRadius',
|
|
93
|
-
'borderBottomStartRadius',
|
|
94
|
-
'borderColor',
|
|
95
|
-
'borderCurve',
|
|
96
|
-
'borderEndColor',
|
|
97
|
-
'borderLeftColor',
|
|
98
|
-
'borderRadius',
|
|
99
|
-
'borderRightColor',
|
|
100
|
-
'borderStartColor',
|
|
101
|
-
'borderStyle',
|
|
102
|
-
'borderTopColor',
|
|
103
|
-
'borderTopEndRadius',
|
|
104
|
-
'borderTopLeftRadius',
|
|
105
|
-
'borderTopRightRadius',
|
|
106
|
-
'borderTopStartRadius',
|
|
107
|
-
'opacity',
|
|
108
|
-
'cursor',
|
|
109
|
-
/**
|
|
110
|
-
* Text
|
|
111
|
-
*/
|
|
112
|
-
'color',
|
|
113
|
-
'fontFamily',
|
|
114
|
-
'fontSize',
|
|
115
|
-
'fontStyle',
|
|
116
|
-
'fontVariant',
|
|
117
|
-
'fontWeight',
|
|
118
|
-
'letterSpacing',
|
|
119
|
-
'lineHeight',
|
|
120
|
-
'textAlign',
|
|
121
|
-
'textDecorationColor',
|
|
122
|
-
'textDecorationLine',
|
|
123
|
-
'textDecorationStyle',
|
|
124
|
-
'textShadowColor',
|
|
125
|
-
'textShadowOffset',
|
|
126
|
-
'textShadowRadius',
|
|
127
|
-
'textTransform',
|
|
128
|
-
'verticalAlign',
|
|
129
|
-
'writingMode',
|
|
130
|
-
'whiteSpace',
|
|
131
|
-
/**
|
|
132
|
-
* Image
|
|
133
|
-
*/
|
|
134
|
-
'overlayColor',
|
|
135
|
-
'resizeMode',
|
|
136
|
-
'tintColor',
|
|
137
|
-
'objectFit',
|
|
138
|
-
'objectPosition',
|
|
139
|
-
/**
|
|
140
|
-
* Grid
|
|
141
|
-
*/
|
|
142
|
-
'gridTemplateColumns',
|
|
143
|
-
'gridArea',
|
|
144
|
-
'gridAutoColumns',
|
|
145
|
-
'gridAutoFlow',
|
|
146
|
-
'gridAutoRows',
|
|
147
|
-
'gridTemplate',
|
|
148
|
-
'gridTemplateAreas',
|
|
149
|
-
'gridTemplateRows',
|
|
150
|
-
'gridColumn',
|
|
151
|
-
'gridColumnStart',
|
|
152
|
-
'gridColumnEnd',
|
|
153
|
-
'gridColumnGap',
|
|
154
|
-
'gridRow',
|
|
155
|
-
'gridRowStart',
|
|
156
|
-
'gridRowEnd',
|
|
157
|
-
'gridRowGap',
|
|
158
|
-
/**
|
|
159
|
-
* Filter
|
|
160
|
-
*/
|
|
161
|
-
'backdropFilter',
|
|
162
|
-
/**
|
|
163
|
-
* transition
|
|
164
|
-
*/
|
|
165
|
-
'transition',
|
|
166
|
-
'transitionBehavior',
|
|
167
|
-
'transitionDelay',
|
|
168
|
-
'transitionDuration',
|
|
169
|
-
'transitionProperty',
|
|
170
|
-
'transitionTimingFunction',
|
|
171
|
-
];
|
|
5
|
+
var primitives = require('../../../primitives_cjs_CnyJ13MJ.js');
|
|
6
|
+
require('react/jsx-runtime');
|
|
7
|
+
require('react');
|
|
8
|
+
require('clsx');
|
|
9
|
+
require('lodash/camelCase');
|
|
10
|
+
require('lodash/castArray');
|
|
11
|
+
require('lodash/upperFirst');
|
|
12
|
+
require('uuid');
|
|
13
|
+
require('@itcase/common');
|
|
14
|
+
require('react-responsive');
|
|
15
|
+
require('lodash/maxBy');
|
|
16
|
+
require('react-inlinesvg');
|
|
172
17
|
|
|
173
|
-
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
exports.default = primitives.styleAttributes;
|