@itcase/ui 1.0.1
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/README.md +2 -0
- package/dist/SelectContainer-e2544642.js +7717 -0
- package/dist/components/Accordion.js +249 -0
- package/dist/components/Avatar.js +94 -0
- package/dist/components/Background.js +90 -0
- package/dist/components/Breadcrumbs.js +239 -0
- package/dist/components/Button.js +215 -0
- package/dist/components/Caption.js +65 -0
- package/dist/components/Card.js +112 -0
- package/dist/components/Cell.js +180 -0
- package/dist/components/Checkbox.js +68 -0
- package/dist/components/Chips.js +135 -0
- package/dist/components/ContextMenu.js +149 -0
- package/dist/components/CookiesWarning.js +133 -0
- package/dist/components/Counter.js +99 -0
- package/dist/components/Divider.js +73 -0
- package/dist/components/Dropdown.js +139 -0
- package/dist/components/Emoji.js +124 -0
- package/dist/components/Fader.js +66 -0
- package/dist/components/Flex.js +264 -0
- package/dist/components/FormField.js +289 -0
- package/dist/components/Grid.js +329 -0
- package/dist/components/Group.js +132 -0
- package/dist/components/Icon.js +184 -0
- package/dist/components/Image.js +143 -0
- package/dist/components/Input.js +94 -0
- package/dist/components/Label.js +125 -0
- package/dist/components/LanguageSelector.js +86 -0
- package/dist/components/Link.js +172 -0
- package/dist/components/List.js +143 -0
- package/dist/components/Loader.js +66 -0
- package/dist/components/Logo.js +55 -0
- package/dist/components/Menu.js +86 -0
- package/dist/components/MenuItem.js +209 -0
- package/dist/components/Modal.js +69 -0
- package/dist/components/Notification.js +131 -0
- package/dist/components/Pagination.js +93 -0
- package/dist/components/Popup.js +254 -0
- package/dist/components/Profile.js +99 -0
- package/dist/components/RadioButton.js +71 -0
- package/dist/components/RangeSlider.js +2086 -0
- package/dist/components/Scrollbar.js +3872 -0
- package/dist/components/Search.js +260 -0
- package/dist/components/Segmented.js +77 -0
- package/dist/components/Select.js +49 -0
- package/dist/components/SiteMenu.js +137 -0
- package/dist/components/Swiper.js +927 -0
- package/dist/components/Switch.js +29 -0
- package/dist/components/Text.js +121 -0
- package/dist/components/Textarea.js +90 -0
- package/dist/components/Tile.js +252 -0
- package/dist/components/Title.js +146 -0
- package/dist/components/Tooltip.js +115 -0
- package/dist/components/Video.js +74 -0
- package/dist/components/Wrapper.js +119 -0
- package/dist/constants/componentProps/align.js +5 -0
- package/dist/constants/componentProps/alignDirection.js +5 -0
- package/dist/constants/componentProps/borderColor.js +5 -0
- package/dist/constants/componentProps/borderType.js +5 -0
- package/dist/constants/componentProps/captionPosition.js +5 -0
- package/dist/constants/componentProps/direction.js +5 -0
- package/dist/constants/componentProps/emojiSize.js +5 -0
- package/dist/constants/componentProps/fill.js +5 -0
- package/dist/constants/componentProps/fillGradient.js +5 -0
- package/dist/constants/componentProps/fillType.js +5 -0
- package/dist/constants/componentProps/flexAlign.js +5 -0
- package/dist/constants/componentProps/flexJustifyContent.js +5 -0
- package/dist/constants/componentProps/flexWrap.js +5 -0
- package/dist/constants/componentProps/gridAlign.js +5 -0
- package/dist/constants/componentProps/gridAlignSelf.js +5 -0
- package/dist/constants/componentProps/gridJustifyItems.js +5 -0
- package/dist/constants/componentProps/gridJustifySelf.js +5 -0
- package/dist/constants/componentProps/horizontalContentAlign.js +5 -0
- package/dist/constants/componentProps/horizontalResizeMode.js +5 -0
- package/dist/constants/componentProps/iconSize.js +5 -0
- package/dist/constants/componentProps/position.js +5 -0
- package/dist/constants/componentProps/resizeMode.js +5 -0
- package/dist/constants/componentProps/shape.js +5 -0
- package/dist/constants/componentProps/size.js +5 -0
- package/dist/constants/componentProps/stacking.js +5 -0
- package/dist/constants/componentProps/strokeColor.js +5 -0
- package/dist/constants/componentProps/textAlign.js +5 -0
- package/dist/constants/componentProps/textColor.js +5 -0
- package/dist/constants/componentProps/textColorActive.js +5 -0
- package/dist/constants/componentProps/textColorHover.js +5 -0
- package/dist/constants/componentProps/textGradient.js +5 -0
- package/dist/constants/componentProps/textStyle.js +5 -0
- package/dist/constants/componentProps/textTag.js +5 -0
- package/dist/constants/componentProps/textWeight.js +5 -0
- package/dist/constants/componentProps/titleSize.js +5 -0
- package/dist/constants/componentProps/type.js +5 -0
- package/dist/constants/componentProps/underline.js +5 -0
- package/dist/constants/componentProps/verticalContentAlign.js +5 -0
- package/dist/constants/componentProps/verticalResizeMode.js +5 -0
- package/dist/constants/componentProps/width.js +5 -0
- package/dist/constants/componentProps/wrap.js +5 -0
- package/dist/constants.js +87 -0
- package/dist/context/Notifications.js +121 -0
- package/dist/context/UIContext.js +59 -0
- package/dist/css/components/Accordion/Accordion.css +65 -0
- package/dist/css/components/Avatar/Avatar.css +28 -0
- package/dist/css/components/Background/Background.css +11 -0
- package/dist/css/components/Button/Button.css +362 -0
- package/dist/css/components/Caption/Caption.css +22 -0
- package/dist/css/components/Card/Card.css +19 -0
- package/dist/css/components/Cell/Cell.css +89 -0
- package/dist/css/components/Cell/css/__wrapper/cell__wrapper.css +7 -0
- package/dist/css/components/Cell/css/__wrapper/cell__wrapper_shape.css +15 -0
- package/dist/css/components/Checkbox/Checkbox.css +97 -0
- package/dist/css/components/Chips/Chips.css +47 -0
- package/dist/css/components/ContextMenu/ContextMenu.css +43 -0
- package/dist/css/components/ContextMenu/css/__item/context-menu__item.css +10 -0
- package/dist/css/components/CookiesWarning/CookiesWarning.css +37 -0
- package/dist/css/components/Counter/Counter.css +55 -0
- package/dist/css/components/Divider/Divider.css +78 -0
- package/dist/css/components/Dropdown/Dropdown.css +58 -0
- package/dist/css/components/Emoji/Emoji.css +104 -0
- package/dist/css/components/Emoji/css/__icon/emoji__icon-shape.css +12 -0
- package/dist/css/components/Emoji/css/__icon/emoji__icon.css +5 -0
- package/dist/css/components/Fader/Fader.css +55 -0
- package/dist/css/components/Flex/Flex.css +179 -0
- package/dist/css/components/Flex/css/__item/flex__item.css +5 -0
- package/dist/css/components/Flex/css/__item/flex__item_align.css +15 -0
- package/dist/css/components/Flex/css/__item/flex__item_direction.css +17 -0
- package/dist/css/components/Flex/css/__item/flex__item_grow.css +9 -0
- package/dist/css/components/Flex/css/__item/flex__item_justify-content.css +9 -0
- package/dist/css/components/Flex/css/__item/flex__item_shape.css +12 -0
- package/dist/css/components/Flex/css/__item/flex__item_wrap.css +9 -0
- package/dist/css/components/Grid/Grid.css +208 -0
- package/dist/css/components/Grid/css/__item/grid__item.css +4 -0
- package/dist/css/components/Grid/css/__item/grid__item_align-self.css +9 -0
- package/dist/css/components/Grid/css/__item/grid__item_column.css +17 -0
- package/dist/css/components/Grid/css/__item/grid__item_justify-self.css +9 -0
- package/dist/css/components/Grid/css/__item/grid__item_row.css +17 -0
- package/dist/css/components/Group/Group.css +106 -0
- package/dist/css/components/Icon/Icon.css +149 -0
- package/dist/css/components/Image/Image.css +106 -0
- package/dist/css/components/Input/Input.css +41 -0
- package/dist/css/components/Label/Label.css +33 -0
- package/dist/css/components/Link/Link.css +10 -0
- package/dist/css/components/List/List.css +112 -0
- package/dist/css/components/Loader/Loader.css +42 -0
- package/dist/css/components/Logo/Logo.css +17 -0
- package/dist/css/components/Menu/Menu.css +56 -0
- package/dist/css/components/MenuItem/MenuItem.css +56 -0
- package/dist/css/components/Notification/Notification.css +18 -0
- package/dist/css/components/Pagination/Pagination.css +80 -0
- package/dist/css/components/Pagination/css/__item/pagination__item.css +31 -0
- package/dist/css/components/Pagination/css/__item/pagination__item_state_active.css +16 -0
- package/dist/css/components/Pagination/css/__item/pagination__item_state_disabled.css +19 -0
- package/dist/css/components/Popup/Popup.css +49 -0
- package/dist/css/components/Profile/Profile.css +19 -0
- package/dist/css/components/RadioButton/RadioButton.css +98 -0
- package/dist/css/components/RangeSlider/RangeSlider.css +396 -0
- package/dist/css/components/Scrollbar/Scrollbar.css +2 -0
- package/dist/css/components/Search/Search.css +113 -0
- package/dist/css/components/Search/css/search-input/search-input.css +81 -0
- package/dist/css/components/Search/css/search-input/search-input_shape.css +8 -0
- package/dist/css/components/Search/css/search-result/search-result.css +6 -0
- package/dist/css/components/Search/css/search-result/search-result_shape.css +8 -0
- package/dist/css/components/Select/Select.css +236 -0
- package/dist/css/components/Select/css/__control/select__control.css +11 -0
- package/dist/css/components/Select/css/__control/select__control_fill.css +15 -0
- package/dist/css/components/Select/css/__control/select__control_shape.css +12 -0
- package/dist/css/components/Select/css/__indicators/select__indicators.css +18 -0
- package/dist/css/components/Select/css/__input-container/select__input-container.css +24 -0
- package/dist/css/components/Select/css/__menu/select__menu-notice.css +7 -0
- package/dist/css/components/Select/css/__menu/select__menu.css +36 -0
- package/dist/css/components/Select/css/__option/select__option.css +56 -0
- package/dist/css/components/Select/css/__single-value/select__single-value.css +5 -0
- package/dist/css/components/Select/css/__value-container/select__value-container.css +12 -0
- package/dist/css/components/SiteMenu/SiteMenu.css +37 -0
- package/dist/css/components/Swiper/Swiper.css +839 -0
- package/dist/css/components/Switch/Switch.css +53 -0
- package/dist/css/components/Text/Text.css +33 -0
- package/dist/css/components/Textarea/Textarea.css +40 -0
- package/dist/css/components/Tile/Tile.css +23 -0
- package/dist/css/components/Title/Title.css +71 -0
- package/dist/css/components/Tooltip/Tooltip.css +4 -0
- package/dist/css/components/Video/Video.css +37 -0
- package/dist/css/components/Wrapper/Wrapper.css +36 -0
- package/dist/css/styles/align/align_horizontal-reverse.css +50 -0
- package/dist/css/styles/align/align_horizontal.css +67 -0
- package/dist/css/styles/align/align_vertical-reverse.css +49 -0
- package/dist/css/styles/align/align_vertical.css +64 -0
- package/dist/css/styles/border/border.css +13 -0
- package/dist/css/styles/border-color/border-color.css +28 -0
- package/dist/css/styles/caret-color/caret-color.css +13 -0
- package/dist/css/styles/constraints/constraints.css +59 -0
- package/dist/css/styles/cursor/cursor.css +9 -0
- package/dist/css/styles/direction/direction.css +10 -0
- package/dist/css/styles/elevation/elevation.css +7 -0
- package/dist/css/styles/elevation/elevation_hover.css +11 -0
- package/dist/css/styles/fill/fill.css +28 -0
- package/dist/css/styles/fill/fill_active.css +22 -0
- package/dist/css/styles/fill/fill_active_hover.css +24 -0
- package/dist/css/styles/fill/fill_disabled.css +22 -0
- package/dist/css/styles/fill/fill_hover.css +34 -0
- package/dist/css/styles/fill-gradient/fill-gradient.css +15 -0
- package/dist/css/styles/height/height.css +9 -0
- package/dist/css/styles/hover/hover-fill-color.css +13 -0
- package/dist/css/styles/hover/hover-item-color.css +15 -0
- package/dist/css/styles/hover/hover-text-color.css +15 -0
- package/dist/css/styles/mediaqueries.css +66 -0
- package/dist/css/styles/mixin_elevation.css +33 -0
- package/dist/css/styles/mixin_fill-gradient.css +23 -0
- package/dist/css/styles/mixin_global.css +54 -0
- package/dist/css/styles/opacity/opacity.css +7 -0
- package/dist/css/styles/placeholder-text-color/placeholder-text-color.css +15 -0
- package/dist/css/styles/position/position.css +14 -0
- package/dist/css/styles/resize-horizontal/resize-horizontal.css +12 -0
- package/dist/css/styles/resize-vertical/resize-vertical.css +10 -0
- package/dist/css/styles/shape/shape.css +8 -0
- package/dist/css/styles/text-align/text-align.css +7 -0
- package/dist/css/styles/text-color/text-color.css +13 -0
- package/dist/css/styles/text-color/text-color_active.css +15 -0
- package/dist/css/styles/text-color/text-color_hover.css +17 -0
- package/dist/css/styles/text-color-hover/text-color-hover.css +15 -0
- package/dist/css/styles/text-decoration/text-decoration.css +9 -0
- package/dist/css/styles/text-gradient/text-gradient.css +24 -0
- package/dist/css/styles/text-style/text-style.css +9 -0
- package/dist/css/styles/text-truncate/text-truncate.css +7 -0
- package/dist/css/styles/text-weight/text-weight.css +40 -0
- package/dist/css/styles/width/width.css +9 -0
- package/dist/css/styles/word-wrap/word-wrap.css +8 -0
- package/dist/hooks/styleAttributes.js +33 -0
- package/dist/hooks/useDeviceTargetClass.js +60 -0
- package/dist/hooks/useMediaQueries.js +134 -0
- package/dist/hooks/useStyles.js +16 -0
- package/dist/index-f1505c84.js +86 -0
- package/dist/objectWithoutProperties-ea190611.js +188 -0
- package/dist/useStyles-77c3b520.js +153 -0
- package/package.json +123 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var styleAttributes = [
|
|
4
|
+
/**
|
|
5
|
+
* Layout
|
|
6
|
+
*/
|
|
7
|
+
'alignContent', 'alignItems', 'alignSelf', 'aspectRatio', 'border', 'borderBottomWidth', 'borderEndWidth', 'borderLeftWidth', 'borderRightWidth', 'borderStartWidth', 'borderTopWidth', 'borderWidth', 'bottom', 'display', 'end', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'gap', 'rowGap', 'columnGap', 'columnWidth', 'height', 'justifyContent', 'left', 'margin', 'marginBottom', 'marginEnd', 'marginHorizontal', 'marginLeft', 'marginRight', 'marginStart', 'marginTop', 'marginVertical', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'overflow', 'padding', 'paddingBottom', 'paddingEnd', 'paddingHorizontal', 'paddingLeft', 'paddingRight', 'paddingStart', 'paddingTop', 'paddingVertical', 'position', 'right', 'start', 'top', 'width', 'zIndex', 'order',
|
|
8
|
+
/**
|
|
9
|
+
* Shadow
|
|
10
|
+
*/
|
|
11
|
+
'elevation', 'shadowColor', 'shadowOffset', 'shadowOpacity', 'shadowRadius',
|
|
12
|
+
/**
|
|
13
|
+
* Transform
|
|
14
|
+
*/
|
|
15
|
+
'transform',
|
|
16
|
+
/**
|
|
17
|
+
* View
|
|
18
|
+
*/
|
|
19
|
+
'background', 'backgroundColor', 'borderBottomColor', 'borderBottomEndRadius', 'borderBottomLeftRadius', 'borderBottomRightRadius', 'borderBottomStartRadius', 'borderColor', 'borderCurve', 'borderEndColor', 'borderLeftColor', 'borderRadius', 'borderRightColor', 'borderStartColor', 'borderStyle', 'borderTopColor', 'borderTopEndRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderTopStartRadius', 'opacity', 'cursor',
|
|
20
|
+
/**
|
|
21
|
+
* Text
|
|
22
|
+
*/
|
|
23
|
+
'color', 'fontFamily', 'fontSize', 'fontStyle', 'fontVariant', 'fontWeight', 'letterSpacing', 'lineHeight', 'textAlign', 'textDecorationColor', 'textDecorationLine', 'textDecorationStyle', 'textShadowColor', 'textShadowOffset', 'textShadowRadius', 'textTransform', 'verticalAlign', 'writingMode', 'whiteSpace',
|
|
24
|
+
/**
|
|
25
|
+
* Image
|
|
26
|
+
*/
|
|
27
|
+
'overlayColor', 'resizeMode', 'tintColor', 'objectFit',
|
|
28
|
+
/**
|
|
29
|
+
* Grid
|
|
30
|
+
*/
|
|
31
|
+
'gridTemplateColumns', 'gridArea', 'gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplate', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'];
|
|
32
|
+
|
|
33
|
+
exports.default = styleAttributes;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var castArray = require('lodash/castArray');
|
|
5
|
+
var camelCase = require('lodash/camelCase');
|
|
6
|
+
var UIContext = require('../context/UIContext.js');
|
|
7
|
+
require('prop-types');
|
|
8
|
+
require('./useMediaQueries.js');
|
|
9
|
+
require('react-responsive');
|
|
10
|
+
|
|
11
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var castArray__default = /*#__PURE__*/_interopDefault(castArray);
|
|
14
|
+
var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
|
|
15
|
+
|
|
16
|
+
function useDeviceTargetClass(componentProps, hookProps) {
|
|
17
|
+
/** Generate a class depending on the user's device.
|
|
18
|
+
*
|
|
19
|
+
* Usage:
|
|
20
|
+
* const sizeClass = useDeviceTargetClass(props, {
|
|
21
|
+
* prefix: 'some-item_size_',
|
|
22
|
+
* propsKey: 'size',
|
|
23
|
+
* })
|
|
24
|
+
* Return: "some-item_size_m" (or "s", or "l", or something else)
|
|
25
|
+
*
|
|
26
|
+
* "componentProps" - "props" from component
|
|
27
|
+
* "hookProps" - special props for generating class
|
|
28
|
+
**/
|
|
29
|
+
|
|
30
|
+
var _hookProps$prefix = hookProps.prefix,
|
|
31
|
+
prefix = _hookProps$prefix === void 0 ? '' : _hookProps$prefix,
|
|
32
|
+
propsKey = hookProps.propsKey,
|
|
33
|
+
_hookProps$replace = hookProps.replace,
|
|
34
|
+
replace = _hookProps$replace === void 0 ? [/([A-Z])/g, '-$1'] : _hookProps$replace;
|
|
35
|
+
var _useUserDeviceContext = UIContext.useUserDeviceContext(),
|
|
36
|
+
isMobile = _useUserDeviceContext.isMobile,
|
|
37
|
+
isTablet = _useUserDeviceContext.isTablet,
|
|
38
|
+
isDesktop = _useUserDeviceContext.isDesktop;
|
|
39
|
+
var targetClassValue = React.useMemo(function () {
|
|
40
|
+
// prettier-ignore
|
|
41
|
+
var deviceBasePart = isMobile && 'Mobile' || isTablet && 'Tablet' || isDesktop && 'Desktop' || '';
|
|
42
|
+
var valueForDevice = componentProps["" + propsKey + deviceBasePart];
|
|
43
|
+
var valueDefault = componentProps[propsKey];
|
|
44
|
+
return valueForDevice || valueDefault;
|
|
45
|
+
}, [isMobile, isTablet, isDesktop, componentProps[propsKey], componentProps[propsKey + "Mobile"], componentProps[propsKey + "Tablet"], componentProps[propsKey + "Desktop"]]);
|
|
46
|
+
var targetClass = React.useMemo(function () {
|
|
47
|
+
if (targetClassValue) {
|
|
48
|
+
var cleanClassValue = camelCase__default.default(String(targetClassValue));
|
|
49
|
+
if (replace) {
|
|
50
|
+
var replaceList = castArray__default.default(replace);
|
|
51
|
+
cleanClassValue = cleanClassValue.replace(replaceList[0], replaceList[1] || '');
|
|
52
|
+
}
|
|
53
|
+
return ("" + prefix + cleanClassValue).toLowerCase();
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}, [targetClassValue, prefix, replace]);
|
|
57
|
+
return targetClass;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
exports.useDeviceTargetClass = useDeviceTargetClass;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactResponsive = require('react-responsive');
|
|
4
|
+
|
|
5
|
+
var tablet = "48em";
|
|
6
|
+
var mediaQueries = {
|
|
7
|
+
"mobile-tiny": "15em",
|
|
8
|
+
"mobile-small": "20em",
|
|
9
|
+
"mobile-medium": "23.435em",
|
|
10
|
+
"mobile-normal": "24.375em",
|
|
11
|
+
"mobile-large": "26.75em",
|
|
12
|
+
"mobile-extra-large": "30em",
|
|
13
|
+
"mobile-super-extra-large": "40em",
|
|
14
|
+
tablet: tablet,
|
|
15
|
+
"tablet-small": "40em",
|
|
16
|
+
"tablet-large": "60em",
|
|
17
|
+
"desktop-small": "60em",
|
|
18
|
+
"desktop-medium": "64em",
|
|
19
|
+
"desktop-normal": "72.5em",
|
|
20
|
+
"desktop-large": "80em",
|
|
21
|
+
"desktop-extra-large": "90em",
|
|
22
|
+
"desktop-super-extra-large": "120em",
|
|
23
|
+
"desktop-huge": "160em"
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var isSSR = typeof window === 'undefined';
|
|
27
|
+
function useMediaQueries(userDevice) {
|
|
28
|
+
if (userDevice === void 0) {
|
|
29
|
+
userDevice = {};
|
|
30
|
+
}
|
|
31
|
+
// const isWarning = useMediaQuery({ maxWidth: mediaQueries['mobile-tiny'] })
|
|
32
|
+
|
|
33
|
+
var isMobile = reactResponsive.useMediaQuery({
|
|
34
|
+
minWidth: mediaQueries['mobile-tiny'],
|
|
35
|
+
maxWidth: mediaQueries['tablet']
|
|
36
|
+
}) || isSSR && Boolean(userDevice.isMobile);
|
|
37
|
+
|
|
38
|
+
// const isMobileTiny = useMediaQuery({
|
|
39
|
+
// minWidth: mediaQueries['mobile-tiny'],
|
|
40
|
+
// maxWidth: mediaQueries['mobile-small'],
|
|
41
|
+
// })
|
|
42
|
+
// const isMobileSmall = useMediaQuery({
|
|
43
|
+
// minWidth: mediaQueries['mobile-small'],
|
|
44
|
+
// maxWidth: mediaQueries['mobile-medium'],
|
|
45
|
+
// })
|
|
46
|
+
// const isMobileMedium = useMediaQuery({
|
|
47
|
+
// minWidth: mediaQueries['mobile-medium'],
|
|
48
|
+
// maxWidth: mediaQueries['mobile-normal'],
|
|
49
|
+
// })
|
|
50
|
+
// const isMobileNormal = useMediaQuery({
|
|
51
|
+
// minWidth: mediaQueries['mobile-normal'],
|
|
52
|
+
// maxWidth: mediaQueries['mobile-large'],
|
|
53
|
+
// })
|
|
54
|
+
// const isMobileStandart = useMediaQuery({
|
|
55
|
+
// minWidth: mediaQueries['mobile-large'],
|
|
56
|
+
// maxWidth: mediaQueries['mobile-extra-large'],
|
|
57
|
+
// })
|
|
58
|
+
// const isMobileLarge = useMediaQuery({
|
|
59
|
+
// minWidth: mediaQueries['mobile-extra-large'],
|
|
60
|
+
// maxWidth: mediaQueries['mobile-super-extra-large'],
|
|
61
|
+
// })
|
|
62
|
+
reactResponsive.useMediaQuery({
|
|
63
|
+
minWidth: mediaQueries['mobile-super-extra-large'],
|
|
64
|
+
maxWidth: mediaQueries['tablet']
|
|
65
|
+
});
|
|
66
|
+
var isTablet = reactResponsive.useMediaQuery({
|
|
67
|
+
minWidth: mediaQueries['tablet'],
|
|
68
|
+
maxWidth: mediaQueries['desktop-small']
|
|
69
|
+
}) || isSSR && Boolean(userDevice.isTablet);
|
|
70
|
+
// const isTabletSmall = useMediaQuery({
|
|
71
|
+
// minWidth: mediaQueries['tablet-small'],
|
|
72
|
+
// maxWidth: mediaQueries['tablet'],
|
|
73
|
+
// })
|
|
74
|
+
// const isTabletLarge = useMediaQuery({
|
|
75
|
+
// minWidth: mediaQueries['tablet'],
|
|
76
|
+
// maxWidth: mediaQueries['tablet-large'],
|
|
77
|
+
// })
|
|
78
|
+
|
|
79
|
+
var isDesktop = reactResponsive.useMediaQuery({
|
|
80
|
+
minWidth: mediaQueries['desktop-small'],
|
|
81
|
+
maxWidth: mediaQueries['desktop-super-huge']
|
|
82
|
+
}) || isSSR && Boolean(userDevice.isDesktop);
|
|
83
|
+
// const isDesktopSmall = useMediaQuery({
|
|
84
|
+
// minWidth: mediaQueries['desktop-small'],
|
|
85
|
+
// maxWidth: mediaQueries['desktop-medium'],
|
|
86
|
+
// })
|
|
87
|
+
// const isDesktopMedium = useMediaQuery({
|
|
88
|
+
// minWidth: mediaQueries['desktop-medium'],
|
|
89
|
+
// maxWidth: mediaQueries['desktop-normal'],
|
|
90
|
+
// })
|
|
91
|
+
// const isDesktopNormal = useMediaQuery({
|
|
92
|
+
// minWidth: mediaQueries['desktop-normal'],
|
|
93
|
+
// maxWidth: mediaQueries['desktop-large'],
|
|
94
|
+
// })
|
|
95
|
+
// const isDesktopStandart = useMediaQuery({
|
|
96
|
+
// minWidth: mediaQueries['desktop-large'],
|
|
97
|
+
// maxWidth: mediaQueries['desktop-extra-large'],
|
|
98
|
+
// })
|
|
99
|
+
// const isDesktopLarge = useMediaQuery({
|
|
100
|
+
// minWidth: mediaQueries['desktop-extra-large'],
|
|
101
|
+
// maxWidth: mediaQueries['desktop-super-extra-large'],
|
|
102
|
+
// })
|
|
103
|
+
// const isDesktopHuge = useMediaQuery({
|
|
104
|
+
// minWidth: mediaQueries['desktop-super-extra-large'],
|
|
105
|
+
// maxWidth: mediaQueries['desktop-huge'],
|
|
106
|
+
// })
|
|
107
|
+
var isDesktopMega = reactResponsive.useMediaQuery({
|
|
108
|
+
minWidth: mediaQueries['desktop-huge']
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
// isWarning,
|
|
112
|
+
isMobile: isMobile,
|
|
113
|
+
// isMobileTiny,
|
|
114
|
+
// isMobileSmall,
|
|
115
|
+
// isMobileMedium,
|
|
116
|
+
// isMobileNormal,
|
|
117
|
+
// isMobileStandart,
|
|
118
|
+
// isMobileLarge,
|
|
119
|
+
isMobileHuge: isMobile,
|
|
120
|
+
isTablet: isTablet,
|
|
121
|
+
// isTabletSmall,
|
|
122
|
+
// isTabletLarge,
|
|
123
|
+
isDesktop: isDesktop,
|
|
124
|
+
// isDesktopSmall,
|
|
125
|
+
// isDesktopMedium,
|
|
126
|
+
// isDesktopNormal,
|
|
127
|
+
// isDesktopStandart,
|
|
128
|
+
// isDesktopLarge,
|
|
129
|
+
// isDesktopHuge,
|
|
130
|
+
isDesktopMega: isDesktopMega
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
exports.useMediaQueries = useMediaQueries;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var useStyles = require('../useStyles-77c3b520.js');
|
|
4
|
+
require('react');
|
|
5
|
+
require('lodash/camelCase');
|
|
6
|
+
require('lodash/maxBy');
|
|
7
|
+
require('lodash/upperFirst');
|
|
8
|
+
require('./styleAttributes.js');
|
|
9
|
+
require('../context/UIContext.js');
|
|
10
|
+
require('prop-types');
|
|
11
|
+
require('./useMediaQueries.js');
|
|
12
|
+
require('react-responsive');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.useStyles = useStyles.useStyles;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
|
|
7
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
8
|
+
|
|
9
|
+
var ChevronDown16 = function ChevronDown16(props) {
|
|
10
|
+
return /*#__PURE__*/React__default.default.createElement("svg", props, /*#__PURE__*/React__default.default.createElement("path", {
|
|
11
|
+
fillRule: "evenodd",
|
|
12
|
+
clipRule: "evenodd",
|
|
13
|
+
d: "M2.50398 4.75303C2.81229 4.41566 3.31216 4.41566 3.62047 4.75303L8.1611 9.72163C8.22276 9.7891 8.32274 9.7891 8.3844 9.72163L12.925 4.75303C13.2333 4.41566 13.7332 4.41566 14.0415 4.75303C14.3498 5.09039 14.3498 5.63737 14.0415 5.97474L9.50088 10.9433C8.8226 11.6856 7.7229 11.6856 7.04462 10.9433L2.50398 5.97474C2.19567 5.63737 2.19567 5.09039 2.50398 4.75303Z"
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
ChevronDown16.defaultProps = {
|
|
17
|
+
width: "17",
|
|
18
|
+
height: "16",
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
+
fill: "none",
|
|
21
|
+
stroke: "none"
|
|
22
|
+
};
|
|
23
|
+
var Facebook24 = function Facebook24(props) {
|
|
24
|
+
return /*#__PURE__*/React__default.default.createElement("svg", props, /*#__PURE__*/React__default.default.createElement("path", {
|
|
25
|
+
d: "M24 12.0301C24 5.38947 18.624 0 12 0C5.376 0 0 5.38947 0 12.0301C0 17.8526 4.128 22.7008 9.6 23.8195V15.6391H7.2V12.0301H9.6V9.02256C9.6 6.70075 11.484 4.81203 13.8 4.81203H16.8V8.42105H14.4C13.74 8.42105 13.2 8.96241 13.2 9.62406V12.0301H16.8V15.6391H13.2V24C19.26 23.3985 24 18.2737 24 12.0301Z"
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
Facebook24.defaultProps = {
|
|
29
|
+
width: "24",
|
|
30
|
+
height: "24",
|
|
31
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "none"
|
|
34
|
+
};
|
|
35
|
+
var Instagram24 = function Instagram24(props) {
|
|
36
|
+
return /*#__PURE__*/React__default.default.createElement("svg", props, /*#__PURE__*/React__default.default.createElement("path", {
|
|
37
|
+
d: "M6.96 0H17.04C20.88 0 24 3.12 24 6.96V17.04C24 18.8859 23.2667 20.6562 21.9615 21.9615C20.6562 23.2667 18.8859 24 17.04 24H6.96C3.12 24 0 20.88 0 17.04V6.96C0 5.11409 0.733284 3.34379 2.03854 2.03854C3.34379 0.733284 5.11409 0 6.96 0ZM6.72 2.4C5.57427 2.4 4.47546 2.85514 3.6653 3.6653C2.85514 4.47546 2.4 5.57427 2.4 6.72V17.28C2.4 19.668 4.332 21.6 6.72 21.6H17.28C18.4257 21.6 19.5245 21.1449 20.3347 20.3347C21.1449 19.5245 21.6 18.4257 21.6 17.28V6.72C21.6 4.332 19.668 2.4 17.28 2.4H6.72ZM18.3 4.2C18.6978 4.2 19.0794 4.35804 19.3607 4.63934C19.642 4.92064 19.8 5.30218 19.8 5.7C19.8 6.09783 19.642 6.47936 19.3607 6.76066C19.0794 7.04197 18.6978 7.2 18.3 7.2C17.9022 7.2 17.5206 7.04197 17.2393 6.76066C16.958 6.47936 16.8 6.09783 16.8 5.7C16.8 5.30218 16.958 4.92064 17.2393 4.63934C17.5206 4.35804 17.9022 4.2 18.3 4.2ZM12 6C13.5913 6 15.1174 6.63214 16.2426 7.75736C17.3679 8.88258 18 10.4087 18 12C18 13.5913 17.3679 15.1174 16.2426 16.2426C15.1174 17.3679 13.5913 18 12 18C10.4087 18 8.88258 17.3679 7.75736 16.2426C6.63214 15.1174 6 13.5913 6 12C6 10.4087 6.63214 8.88258 7.75736 7.75736C8.88258 6.63214 10.4087 6 12 6ZM12 8.4C11.0452 8.4 10.1295 8.77928 9.45442 9.45442C8.77928 10.1295 8.4 11.0452 8.4 12C8.4 12.9548 8.77928 13.8705 9.45442 14.5456C10.1295 15.2207 11.0452 15.6 12 15.6C12.9548 15.6 13.8705 15.2207 14.5456 14.5456C15.2207 13.8705 15.6 12.9548 15.6 12C15.6 11.0452 15.2207 10.1295 14.5456 9.45442C13.8705 8.77928 12.9548 8.4 12 8.4Z"
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
Instagram24.defaultProps = {
|
|
41
|
+
width: "24",
|
|
42
|
+
height: "24",
|
|
43
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
44
|
+
fill: "none",
|
|
45
|
+
stroke: "none"
|
|
46
|
+
};
|
|
47
|
+
var DoubleArrowRight24 = function DoubleArrowRight24(props) {
|
|
48
|
+
return /*#__PURE__*/React__default.default.createElement("svg", props, /*#__PURE__*/React__default.default.createElement("path", {
|
|
49
|
+
d: "M17 12C17 12.2305 16.9233 12.4271 16.764 12.6034L12.1622 17.7763C12.0383 17.9254 11.8732 18 11.6844 18C11.3009 18 11 17.661 11 17.2136C11 16.9966 11.0767 16.8 11.2065 16.6508L15.354 12L11.2065 7.34915C11.0767 7.19322 11 6.99661 11 6.77966C11 6.33898 11.3009 6 11.6844 6C11.8732 6 12.0383 6.07458 12.1622 6.22373L16.764 11.3966C16.9233 11.5729 16.9941 11.7695 17 12Z"
|
|
50
|
+
}), /*#__PURE__*/React__default.default.createElement("path", {
|
|
51
|
+
d: "M13 12C13 12.2305 12.9233 12.4271 12.764 12.6034L8.16224 17.7763C8.03835 17.9254 7.87316 18 7.68437 18C7.30089 18 7 17.661 7 17.2136C7 16.9966 7.0767 16.8 7.20649 16.6508L11.354 12L7.20649 7.34915C7.0767 7.19322 7 6.99661 7 6.77966C7 6.33898 7.30089 6 7.68437 6C7.87316 6 8.03835 6.07458 8.16224 6.22373L12.764 11.3966C12.9233 11.5729 12.9941 11.7695 13 12Z"
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
DoubleArrowRight24.defaultProps = {
|
|
55
|
+
width: "24",
|
|
56
|
+
height: "24",
|
|
57
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
58
|
+
fill: "none",
|
|
59
|
+
stroke: "none"
|
|
60
|
+
};
|
|
61
|
+
var DoubleArrowLeft24 = function DoubleArrowLeft24(props) {
|
|
62
|
+
return /*#__PURE__*/React__default.default.createElement("svg", props, /*#__PURE__*/React__default.default.createElement("path", {
|
|
63
|
+
d: "M7 12C7 12.2305 7.0767 12.4271 7.23599 12.6034L11.8378 17.7763C11.9617 17.9254 12.1268 18 12.3156 18C12.6991 18 13 17.661 13 17.2136C13 16.9966 12.9233 16.8 12.7935 16.6508L8.64602 12L12.7935 7.34915C12.9233 7.19322 13 6.99661 13 6.77966C13 6.33898 12.6991 6 12.3156 6C12.1268 6 11.9617 6.07458 11.8378 6.22373L7.23599 11.3966C7.0767 11.5729 7.0059 11.7695 7 12Z"
|
|
64
|
+
}), /*#__PURE__*/React__default.default.createElement("path", {
|
|
65
|
+
d: "M11 12C11 12.2305 11.0767 12.4271 11.236 12.6034L15.8378 17.7763C15.9617 17.9254 16.1268 18 16.3156 18C16.6991 18 17 17.661 17 17.2136C17 16.9966 16.9233 16.8 16.7935 16.6508L12.646 12L16.7935 7.34915C16.9233 7.19322 17 6.99661 17 6.77966C17 6.33898 16.6991 6 16.3156 6C16.1268 6 15.9617 6.07458 15.8378 6.22373L11.236 11.3966C11.0767 11.5729 11.0059 11.7695 11 12Z"
|
|
66
|
+
}));
|
|
67
|
+
};
|
|
68
|
+
DoubleArrowLeft24.defaultProps = {
|
|
69
|
+
width: "24",
|
|
70
|
+
height: "24",
|
|
71
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72
|
+
fill: "none",
|
|
73
|
+
stroke: "none"
|
|
74
|
+
};
|
|
75
|
+
var icon16 = {
|
|
76
|
+
chevron_down: ChevronDown16
|
|
77
|
+
};
|
|
78
|
+
var icon24 = {
|
|
79
|
+
facebook: Facebook24,
|
|
80
|
+
instagram: Instagram24,
|
|
81
|
+
doubleArrowRight: DoubleArrowRight24,
|
|
82
|
+
doubleArrowLeft: DoubleArrowLeft24
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
exports.icon16 = icon16;
|
|
86
|
+
exports.icon24 = icon24;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _extends() {
|
|
4
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
5
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
6
|
+
var source = arguments[i];
|
|
7
|
+
for (var key in source) {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9
|
+
target[key] = source[key];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return target;
|
|
14
|
+
};
|
|
15
|
+
return _extends.apply(this, arguments);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function _typeof(obj) {
|
|
19
|
+
"@babel/helpers - typeof";
|
|
20
|
+
|
|
21
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
22
|
+
return typeof obj;
|
|
23
|
+
} : function (obj) {
|
|
24
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
25
|
+
}, _typeof(obj);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _toPrimitive(input, hint) {
|
|
29
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
30
|
+
var prim = input[Symbol.toPrimitive];
|
|
31
|
+
if (prim !== undefined) {
|
|
32
|
+
var res = prim.call(input, hint || "default");
|
|
33
|
+
if (_typeof(res) !== "object") return res;
|
|
34
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
35
|
+
}
|
|
36
|
+
return (hint === "string" ? String : Number)(input);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function _toPropertyKey(arg) {
|
|
40
|
+
var key = _toPrimitive(arg, "string");
|
|
41
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function _defineProperty(obj, key, value) {
|
|
45
|
+
key = _toPropertyKey(key);
|
|
46
|
+
if (key in obj) {
|
|
47
|
+
Object.defineProperty(obj, key, {
|
|
48
|
+
value: value,
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
obj[key] = value;
|
|
55
|
+
}
|
|
56
|
+
return obj;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function ownKeys(object, enumerableOnly) {
|
|
60
|
+
var keys = Object.keys(object);
|
|
61
|
+
if (Object.getOwnPropertySymbols) {
|
|
62
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
63
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
64
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
65
|
+
})), keys.push.apply(keys, symbols);
|
|
66
|
+
}
|
|
67
|
+
return keys;
|
|
68
|
+
}
|
|
69
|
+
function _objectSpread2(target) {
|
|
70
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
71
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
72
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
73
|
+
_defineProperty(target, key, source[key]);
|
|
74
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
75
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function _arrayLikeToArray(arr, len) {
|
|
82
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
83
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
84
|
+
return arr2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function _arrayWithoutHoles(arr) {
|
|
88
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function _iterableToArray(iter) {
|
|
92
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
96
|
+
if (!o) return;
|
|
97
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
98
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
99
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
100
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
101
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function _nonIterableSpread() {
|
|
105
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function _toConsumableArray(arr) {
|
|
109
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function _arrayWithHoles(arr) {
|
|
113
|
+
if (Array.isArray(arr)) return arr;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function _iterableToArrayLimit(arr, i) {
|
|
117
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
118
|
+
if (null != _i) {
|
|
119
|
+
var _s,
|
|
120
|
+
_e,
|
|
121
|
+
_x,
|
|
122
|
+
_r,
|
|
123
|
+
_arr = [],
|
|
124
|
+
_n = !0,
|
|
125
|
+
_d = !1;
|
|
126
|
+
try {
|
|
127
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
128
|
+
if (Object(_i) !== _i) return;
|
|
129
|
+
_n = !1;
|
|
130
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
131
|
+
} catch (err) {
|
|
132
|
+
_d = !0, _e = err;
|
|
133
|
+
} finally {
|
|
134
|
+
try {
|
|
135
|
+
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
136
|
+
} finally {
|
|
137
|
+
if (_d) throw _e;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return _arr;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function _nonIterableRest() {
|
|
145
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function _slicedToArray(arr, i) {
|
|
149
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
153
|
+
if (source == null) return {};
|
|
154
|
+
var target = {};
|
|
155
|
+
var sourceKeys = Object.keys(source);
|
|
156
|
+
var key, i;
|
|
157
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
158
|
+
key = sourceKeys[i];
|
|
159
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
160
|
+
target[key] = source[key];
|
|
161
|
+
}
|
|
162
|
+
return target;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function _objectWithoutProperties(source, excluded) {
|
|
166
|
+
if (source == null) return {};
|
|
167
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
168
|
+
var key, i;
|
|
169
|
+
if (Object.getOwnPropertySymbols) {
|
|
170
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
171
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
172
|
+
key = sourceSymbolKeys[i];
|
|
173
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
174
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
175
|
+
target[key] = source[key];
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return target;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
exports._defineProperty = _defineProperty;
|
|
182
|
+
exports._extends = _extends;
|
|
183
|
+
exports._objectSpread2 = _objectSpread2;
|
|
184
|
+
exports._objectWithoutProperties = _objectWithoutProperties;
|
|
185
|
+
exports._slicedToArray = _slicedToArray;
|
|
186
|
+
exports._toConsumableArray = _toConsumableArray;
|
|
187
|
+
exports._toPropertyKey = _toPropertyKey;
|
|
188
|
+
exports._typeof = _typeof;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var camelCase = require('lodash/camelCase');
|
|
5
|
+
var maxBy = require('lodash/maxBy');
|
|
6
|
+
var upperFirst = require('lodash/upperFirst');
|
|
7
|
+
var styleAttributes = require('./hooks/styleAttributes.js');
|
|
8
|
+
var UIContext = require('./context/UIContext.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
|
|
13
|
+
var maxBy__default = /*#__PURE__*/_interopDefault(maxBy);
|
|
14
|
+
var upperFirst__default = /*#__PURE__*/_interopDefault(upperFirst);
|
|
15
|
+
|
|
16
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
17
|
+
if (source == null) return {};
|
|
18
|
+
var target = {};
|
|
19
|
+
var sourceKeys = Object.keys(source);
|
|
20
|
+
var key, i;
|
|
21
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
22
|
+
key = sourceKeys[i];
|
|
23
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
24
|
+
target[key] = source[key];
|
|
25
|
+
}
|
|
26
|
+
return target;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var _excluded = ["isMobile", "isTablet", "isDesktop"];
|
|
30
|
+
var DEVICE_TYPES = [];
|
|
31
|
+
var removeDeviceType = function removeDeviceType(originalKey) {
|
|
32
|
+
// Remove "mobile"/"tablet"/"desktop"
|
|
33
|
+
var withOutDeviceType = DEVICE_TYPES.reduce(function (cleanKey, deviceType) {
|
|
34
|
+
if (cleanKey.endsWith(upperFirst__default.default(deviceType))) {
|
|
35
|
+
return cleanKey.replace(upperFirst__default.default(deviceType), '');
|
|
36
|
+
}
|
|
37
|
+
return cleanKey;
|
|
38
|
+
}, originalKey);
|
|
39
|
+
return withOutDeviceType;
|
|
40
|
+
};
|
|
41
|
+
function useStyles(props) {
|
|
42
|
+
var allDevicesTypes = UIContext.useUserDeviceContext();
|
|
43
|
+
var isMobile = allDevicesTypes.isMobile,
|
|
44
|
+
isTablet = allDevicesTypes.isTablet,
|
|
45
|
+
isDesktop = allDevicesTypes.isDesktop,
|
|
46
|
+
fullNamedDeviceTypes = _objectWithoutPropertiesLoose(allDevicesTypes, _excluded);
|
|
47
|
+
|
|
48
|
+
// prettier-ignore
|
|
49
|
+
var deviceBasePart = React.useMemo(function () {
|
|
50
|
+
return isMobile && 'Mobile' || isTablet && 'Tablet' || isDesktop && 'Desktop' || '';
|
|
51
|
+
}, [isMobile, isTablet, isDesktop]);
|
|
52
|
+
/*
|
|
53
|
+
* rule of prop key:
|
|
54
|
+
*
|
|
55
|
+
* first is style second is div targer thrid is device
|
|
56
|
+
* paddingHorizontal GridInnerWrapper MobileNormal
|
|
57
|
+
*
|
|
58
|
+
* paddingHorizontalGridInnerWrapperMobileNormal: "10px"
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
var currentDevice = React.useMemo(function () {
|
|
62
|
+
var deviceTypes = Object.keys(allDevicesTypes).map(function (key) {
|
|
63
|
+
return camelCase__default.default(key.replace('is', ''));
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// if "fullNamedDeviceTypes.isMobileLarge": true - that our device
|
|
67
|
+
var currentDevice = Object.keys(fullNamedDeviceTypes).find(function (key) {
|
|
68
|
+
return fullNamedDeviceTypes[key];
|
|
69
|
+
});
|
|
70
|
+
if (!currentDevice) {
|
|
71
|
+
currentDevice = deviceBasePart;
|
|
72
|
+
}
|
|
73
|
+
currentDevice = upperFirst__default.default(camelCase__default.default(currentDevice.replace('is', '')));
|
|
74
|
+
DEVICE_TYPES = deviceTypes;
|
|
75
|
+
|
|
76
|
+
// Set non-existent "currentDevice" value, to collect default styles later
|
|
77
|
+
return currentDevice || '__DEVICE_IS_NOT_FOUND__';
|
|
78
|
+
}, [allDevicesTypes, deviceBasePart]);
|
|
79
|
+
var collectedStyles = React.useMemo(function () {
|
|
80
|
+
var resultStyles = {};
|
|
81
|
+
|
|
82
|
+
// For every component props
|
|
83
|
+
Object.entries(props).forEach(function (_ref) {
|
|
84
|
+
var propKey = _ref[0],
|
|
85
|
+
propValue = _ref[1];
|
|
86
|
+
// Collect list of possible styles for propKey. e.g:
|
|
87
|
+
// "borderLeftWidthWrapperInnerMobileNormal" to ["border", "borderLeftWidth"]
|
|
88
|
+
var possibleStyleAttributes = styleAttributes.default.filter(function (styleAttribute) {
|
|
89
|
+
return propKey.startsWith(styleAttribute);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Get longest style key (e.g. "borderLeftWidth")
|
|
93
|
+
var currentStyleAttribute = maxBy__default.default(possibleStyleAttributes, 'length');
|
|
94
|
+
if (currentStyleAttribute) {
|
|
95
|
+
var isStyleForCurrentDevice = propKey.toLowerCase().endsWith(currentDevice.toLowerCase());
|
|
96
|
+
var value = null;
|
|
97
|
+
|
|
98
|
+
// e.g. "GridWrapperInner"
|
|
99
|
+
var targetElementKey = removeDeviceType(propKey.replace(currentStyleAttribute, ''));
|
|
100
|
+
var targetElementResultKey = camelCase__default.default(targetElementKey) || 'styles';
|
|
101
|
+
if (!resultStyles[targetElementResultKey]) {
|
|
102
|
+
resultStyles[targetElementResultKey] = {};
|
|
103
|
+
}
|
|
104
|
+
if (isStyleForCurrentDevice) {
|
|
105
|
+
value = propValue;
|
|
106
|
+
} else {
|
|
107
|
+
var propKeyWithOutDeviceType = "" + currentStyleAttribute + targetElementKey;
|
|
108
|
+
var propKeyWithBaseDeviceType = "" + propKeyWithOutDeviceType + deviceBasePart;
|
|
109
|
+
var defaultValue = props[propKeyWithBaseDeviceType] || props[propKeyWithOutDeviceType];
|
|
110
|
+
var currentValue = resultStyles[targetElementResultKey][currentStyleAttribute];
|
|
111
|
+
if (propKeyWithOutDeviceType.includes('Horizontal')) {
|
|
112
|
+
var keyLeft = currentStyleAttribute.replace('Horizontal', 'Left');
|
|
113
|
+
currentValue = resultStyles[targetElementResultKey][keyLeft];
|
|
114
|
+
} else if (propKeyWithOutDeviceType.includes('Vertical')) {
|
|
115
|
+
var keyTop = currentStyleAttribute.replace('Vertical', 'Top');
|
|
116
|
+
currentValue = resultStyles[targetElementResultKey][keyTop];
|
|
117
|
+
}
|
|
118
|
+
if (!currentValue) {
|
|
119
|
+
value = defaultValue;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (value) {
|
|
123
|
+
// TODO: handle 16px/9px propValues for Horizontal(Left/Right) and Vertical(Top/Bottom)
|
|
124
|
+
var HAS_UNIT = /\D/;
|
|
125
|
+
// prettier-ignore
|
|
126
|
+
var ignorePX = currentStyleAttribute.includes('zIndex') || currentStyleAttribute.includes('order');
|
|
127
|
+
if (!HAS_UNIT.test(value) && !ignorePX) {
|
|
128
|
+
value = value + "px";
|
|
129
|
+
}
|
|
130
|
+
if (currentStyleAttribute.includes('Horizontal')) {
|
|
131
|
+
var _keyLeft = currentStyleAttribute.replace('Horizontal', 'Left');
|
|
132
|
+
var keyRight = currentStyleAttribute.replace('Horizontal', 'Right');
|
|
133
|
+
resultStyles[targetElementResultKey][_keyLeft] = value;
|
|
134
|
+
resultStyles[targetElementResultKey][keyRight] = value;
|
|
135
|
+
} else if (currentStyleAttribute.includes('Vertical')) {
|
|
136
|
+
var _keyTop = currentStyleAttribute.replace('Vertical', 'Top');
|
|
137
|
+
var keyBottom = currentStyleAttribute.replace('Vertical', 'Bottom');
|
|
138
|
+
resultStyles[targetElementResultKey][_keyTop] = value;
|
|
139
|
+
resultStyles[targetElementResultKey][keyBottom] = value;
|
|
140
|
+
} else {
|
|
141
|
+
resultStyles[targetElementResultKey][currentStyleAttribute] = value;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
return resultStyles;
|
|
147
|
+
}, [currentDevice]); // props
|
|
148
|
+
|
|
149
|
+
return collectedStyles;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
exports._objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
|
|
153
|
+
exports.useStyles = useStyles;
|