@itcase/ui 1.3.32 → 1.3.36
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/{Button-DZ3z7f-A.js → Button-BtAUGGPc.js} +5 -5
- package/dist/{Button-D1m2MxZA.js → Button-HKkjJ38v.js} +5 -5
- package/dist/Group-Chtnas-J.js +40 -0
- package/dist/Group-DiMnEfge.js +36 -0
- package/dist/cjs/components/Accordion.js +12 -16
- package/dist/cjs/components/Button.js +1 -1
- package/dist/cjs/components/Cell.js +8 -4
- package/dist/cjs/components/CookiesWarning.js +2 -2
- package/dist/cjs/components/DatePicker.js +1 -1
- package/dist/cjs/components/Group.js +1 -1
- package/dist/cjs/components/Panel.js +1 -1
- package/dist/cjs/components/Response.js +2 -2
- package/dist/cjs/components/Select.js +1 -1
- package/dist/cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +1 -0
- package/dist/components/Accordion.js +12 -16
- package/dist/components/Button.js +1 -1
- package/dist/components/Cell.js +8 -4
- package/dist/components/CookiesWarning.js +2 -2
- package/dist/components/DatePicker.js +1 -1
- package/dist/components/Group.js +1 -1
- package/dist/components/Panel.js +1 -1
- package/dist/components/Response.js +2 -2
- package/dist/components/Select.js +1 -1
- package/dist/css/components/Accordion/Accordion.css +5 -8
- package/dist/css/components/Accordion/Accordion.tokens.css +2 -1
- package/dist/css/components/Chips/Chips.css +50 -36
- package/dist/css/components/Chips/Chips.tokens.css +35 -7
- package/dist/css/components/Select/Select.css +25 -0
- package/dist/css/components/Select/Select.tokens.css +8 -13
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +1 -0
- package/dist/stories/Overview.mdx +5 -5
- package/dist/stories/Playground.mdx +4 -4
- package/package.json +1 -1
- package/dist/Group-BKJmVwPZ.js +0 -34
- package/dist/Group-Bkz3RO18.js +0 -38
- package/dist/css/styles/column-gap/column-gap.css +0 -7
- package/dist/css/styles/row-gap/row-gap.css +0 -7
|
@@ -245,16 +245,16 @@ var buttonAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__a
|
|
|
245
245
|
var buttonConfig = {
|
|
246
246
|
appearance: buttonAppearance,
|
|
247
247
|
setAppearance: function (appearanceConfig) {
|
|
248
|
-
|
|
248
|
+
this.appearance = appearanceConfig;
|
|
249
249
|
},
|
|
250
250
|
};
|
|
251
251
|
var Button = React.forwardRef(function Button(props, ref) {
|
|
252
|
-
var className = props.className, appearance = props.appearance, children = props.children, label = props.label, Badge = props.Badge, dataTestId = props.dataTestId, dataTour = props.dataTour, href = props.href, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, icon = props.icon, iconAfter = props.iconAfter, iconAfterSrc = props.iconAfterSrc, iconBefore = props.iconBefore, iconBeforeSrc = props.iconBeforeSrc, iconSrc = props.iconSrc, link = props.link, _b = props.loadertype, loadertype = _b === void 0 ? 'simple' : _b,
|
|
253
|
-
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (
|
|
252
|
+
var className = props.className, appearance = props.appearance, children = props.children, label = props.label, Badge = props.Badge, dataTestId = props.dataTestId, dataTour = props.dataTour, href = props.href, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, icon = props.icon, iconAfter = props.iconAfter, iconAfterSrc = props.iconAfterSrc, iconBefore = props.iconBefore, iconBeforeSrc = props.iconBeforeSrc, iconSrc = props.iconSrc, link = props.link, _b = props.loadertype, loadertype = _b === void 0 ? 'simple' : _b, loading = props.loading, rel = props.rel, target = props.target, before = props.before, after = props.after, isDisabled = props.isDisabled, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, onClick = props.onClick, onMouseDown = props.onMouseDown;
|
|
253
|
+
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultAppearance, appearance) {
|
|
254
254
|
var _a;
|
|
255
|
-
return (__assign(__assign({},
|
|
255
|
+
return (__assign(__assign({}, resultAppearance), (_a = buttonConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearance]));
|
|
256
256
|
}, {});
|
|
257
|
-
if (loading) {
|
|
257
|
+
if (loading !== undefined) {
|
|
258
258
|
console.warn('DEPRECATED: prop Loading is deprecated, use isLoading');
|
|
259
259
|
}
|
|
260
260
|
var _isLoading = isLoading !== null && isLoading !== void 0 ? isLoading : loading;
|
|
@@ -247,16 +247,16 @@ var buttonAppearance = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(
|
|
|
247
247
|
var buttonConfig = {
|
|
248
248
|
appearance: buttonAppearance,
|
|
249
249
|
setAppearance: function (appearanceConfig) {
|
|
250
|
-
|
|
250
|
+
this.appearance = appearanceConfig;
|
|
251
251
|
},
|
|
252
252
|
};
|
|
253
253
|
var Button = React.forwardRef(function Button(props, ref) {
|
|
254
|
-
var className = props.className, appearance = props.appearance, children = props.children, label = props.label, Badge = props.Badge, dataTestId = props.dataTestId, dataTour = props.dataTour, href = props.href, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, icon = props.icon, iconAfter = props.iconAfter, iconAfterSrc = props.iconAfterSrc, iconBefore = props.iconBefore, iconBeforeSrc = props.iconBeforeSrc, iconSrc = props.iconSrc, link = props.link, _b = props.loadertype, loadertype = _b === void 0 ? 'simple' : _b,
|
|
255
|
-
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (
|
|
254
|
+
var className = props.className, appearance = props.appearance, children = props.children, label = props.label, Badge = props.Badge, dataTestId = props.dataTestId, dataTour = props.dataTour, href = props.href, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, icon = props.icon, iconAfter = props.iconAfter, iconAfterSrc = props.iconAfterSrc, iconBefore = props.iconBefore, iconBeforeSrc = props.iconBeforeSrc, iconSrc = props.iconSrc, link = props.link, _b = props.loadertype, loadertype = _b === void 0 ? 'simple' : _b, loading = props.loading, rel = props.rel, target = props.target, before = props.before, after = props.after, isDisabled = props.isDisabled, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, onClick = props.onClick, onMouseDown = props.onMouseDown;
|
|
255
|
+
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultAppearance, appearance) {
|
|
256
256
|
var _a;
|
|
257
|
-
return (tslib_es6.__assign(tslib_es6.__assign({},
|
|
257
|
+
return (tslib_es6.__assign(tslib_es6.__assign({}, resultAppearance), (_a = buttonConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearance]));
|
|
258
258
|
}, {});
|
|
259
|
-
if (loading) {
|
|
259
|
+
if (loading !== undefined) {
|
|
260
260
|
console.warn('DEPRECATED: prop Loading is deprecated, use isLoading');
|
|
261
261
|
}
|
|
262
262
|
var _isLoading = isLoading !== null && isLoading !== void 0 ? isLoading : loading;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
7
|
+
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
8
|
+
|
|
9
|
+
var groupAppearance = {
|
|
10
|
+
dev: {
|
|
11
|
+
borderWidth: 1,
|
|
12
|
+
borderColor: 'surfaceBorderPrimary',
|
|
13
|
+
direction: 'horizontal',
|
|
14
|
+
fill: 'surfacePrimary',
|
|
15
|
+
fillHover: 'surfacePrimaryHover',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var groupConfig = {
|
|
20
|
+
appearance: groupAppearance,
|
|
21
|
+
setAppearance: function (newComponent) {
|
|
22
|
+
groupConfig.appearance = newComponent;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
var Group = React.forwardRef(function Group(props, ref) {
|
|
26
|
+
var id = props.id, className = props.className, name = props.name, appearance = props.appearance, children = props.children, dataTestId = props.dataTestId, dataTour = props.dataTour, horizontalScroll = props.horizontalScroll, htmlFor = props.htmlFor, style = props.style, _a = props.tag, Tag = _a === void 0 ? 'div' : _a, onClick = props.onClick;
|
|
27
|
+
// @ts-expect-error
|
|
28
|
+
var appearanceConfig = groupConfig.appearance && groupConfig.appearance[appearance];
|
|
29
|
+
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
30
|
+
var directionClass = propsGenerator.directionClass, flexGrowClass = propsGenerator.flexGrowClass, justifyContentClass = propsGenerator.justifyContentClass, alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, textColorActiveClass = propsGenerator.textColorActiveClass, textColorClass = propsGenerator.textColorClass, textColorHoverClass = propsGenerator.textColorHoverClass, columnsClass = propsGenerator.columnsClass, contentAlignClass = propsGenerator.contentAlignClass, elevationClass = propsGenerator.elevationClass, heightClass = propsGenerator.heightClass, iconFillHoverClass = propsGenerator.iconFillHoverClass, shapeClass = propsGenerator.shapeClass, stackingClass = propsGenerator.stackingClass, widthClass = propsGenerator.widthClass, wrapClass = propsGenerator.wrapClass;
|
|
31
|
+
// @ts-expect-error
|
|
32
|
+
var _b = useStyles.useStyles(props), groupStyles = _b.styles, groupWrapperStyles = _b.wrapper;
|
|
33
|
+
return (jsxRuntime.jsx(Tag, { id: id, className: clsx(className, 'group', widthClass && "width_".concat(widthClass), heightClass && "height_".concat(heightClass), columnsClass && "group_columns_".concat(columnsClass), contentAlignClass && "group_content-align_".concat(contentAlignClass), alignDirectionClass && "align_".concat(alignDirectionClass), directionClass && "group_direction_".concat(directionClass), alignClass && "align_".concat(alignClass), textColorClass && "group_text-color_".concat(textColorClass), textColorActiveClass &&
|
|
34
|
+
"group_text-color_active_".concat(textColorActiveClass), textColorHoverClass &&
|
|
35
|
+
"group_text-color_hover_".concat(textColorHoverClass), iconFillHoverClass && "group_icon_fill_hover_".concat(iconFillHoverClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), horizontalScroll && 'group_type_horizontal_scroll', stackingClass && "group_stacking_".concat(stackingClass), wrapClass && "group_wrap_".concat(wrapClass), flexGrowClass && "flex-grow_".concat(flexGrowClass), shapeClass && "group_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass), elevationClass && "elevation_".concat(elevationClass), justifyContentClass && "justify-content_".concat(justifyContentClass), onClick && 'cursor_type_pointer'), name: name, "data-testid": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, ref: ref, style: Object.assign({}, groupStyles, style), onClick: onClick, children: horizontalScroll ? (jsxRuntime.jsx("div", { className: "group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
exports.Group = Group;
|
|
39
|
+
exports.groupAppearance = groupAppearance;
|
|
40
|
+
exports.groupConfig = groupConfig;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
|
+
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
6
|
+
|
|
7
|
+
var groupAppearance = {
|
|
8
|
+
dev: {
|
|
9
|
+
borderWidth: 1,
|
|
10
|
+
borderColor: 'surfaceBorderPrimary',
|
|
11
|
+
direction: 'horizontal',
|
|
12
|
+
fill: 'surfacePrimary',
|
|
13
|
+
fillHover: 'surfacePrimaryHover',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var groupConfig = {
|
|
18
|
+
appearance: groupAppearance,
|
|
19
|
+
setAppearance: function (newComponent) {
|
|
20
|
+
groupConfig.appearance = newComponent;
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
var Group = React.forwardRef(function Group(props, ref) {
|
|
24
|
+
var id = props.id, className = props.className, name = props.name, appearance = props.appearance, children = props.children, dataTestId = props.dataTestId, dataTour = props.dataTour, horizontalScroll = props.horizontalScroll, htmlFor = props.htmlFor, style = props.style, _a = props.tag, Tag = _a === void 0 ? 'div' : _a, onClick = props.onClick;
|
|
25
|
+
// @ts-expect-error
|
|
26
|
+
var appearanceConfig = groupConfig.appearance && groupConfig.appearance[appearance];
|
|
27
|
+
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
28
|
+
var directionClass = propsGenerator.directionClass, flexGrowClass = propsGenerator.flexGrowClass, justifyContentClass = propsGenerator.justifyContentClass, alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, textColorActiveClass = propsGenerator.textColorActiveClass, textColorClass = propsGenerator.textColorClass, textColorHoverClass = propsGenerator.textColorHoverClass, columnsClass = propsGenerator.columnsClass, contentAlignClass = propsGenerator.contentAlignClass, elevationClass = propsGenerator.elevationClass, heightClass = propsGenerator.heightClass, iconFillHoverClass = propsGenerator.iconFillHoverClass, shapeClass = propsGenerator.shapeClass, stackingClass = propsGenerator.stackingClass, widthClass = propsGenerator.widthClass, wrapClass = propsGenerator.wrapClass;
|
|
29
|
+
// @ts-expect-error
|
|
30
|
+
var _b = useStyles(props), groupStyles = _b.styles, groupWrapperStyles = _b.wrapper;
|
|
31
|
+
return (jsx(Tag, { id: id, className: clsx(className, 'group', widthClass && "width_".concat(widthClass), heightClass && "height_".concat(heightClass), columnsClass && "group_columns_".concat(columnsClass), contentAlignClass && "group_content-align_".concat(contentAlignClass), alignDirectionClass && "align_".concat(alignDirectionClass), directionClass && "group_direction_".concat(directionClass), alignClass && "align_".concat(alignClass), textColorClass && "group_text-color_".concat(textColorClass), textColorActiveClass &&
|
|
32
|
+
"group_text-color_active_".concat(textColorActiveClass), textColorHoverClass &&
|
|
33
|
+
"group_text-color_hover_".concat(textColorHoverClass), iconFillHoverClass && "group_icon_fill_hover_".concat(iconFillHoverClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), horizontalScroll && 'group_type_horizontal_scroll', stackingClass && "group_stacking_".concat(stackingClass), wrapClass && "group_wrap_".concat(wrapClass), flexGrowClass && "flex-grow_".concat(flexGrowClass), shapeClass && "group_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass), elevationClass && "elevation_".concat(elevationClass), justifyContentClass && "justify-content_".concat(justifyContentClass), onClick && 'cursor_type_pointer'), name: name, "data-testid": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, ref: ref, style: Object.assign({}, groupStyles, style), onClick: onClick, children: horizontalScroll ? (jsx("div", { className: "group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { Group as G, groupAppearance as a, groupConfig as g };
|
|
@@ -38,25 +38,27 @@ var accordionItemConfig = {
|
|
|
38
38
|
},
|
|
39
39
|
};
|
|
40
40
|
function AccordionItem(props) {
|
|
41
|
-
var id = props.id, children = props.children,
|
|
41
|
+
var id = props.id, className = props.className, appearance = props.appearance, children = props.children, title = props.title, titleTextColor = props.titleTextColor, titleTextSize = props.titleTextSize, titleTextWeight = props.titleTextWeight, afterContent = props.afterContent, beforeContent = props.beforeContent, content = props.content, contentTextColor = props.contentTextColor, contentTextSize = props.contentTextSize, contentTextWeight = props.contentTextWeight, dividerDirection = props.dividerDirection, dividerFill = props.dividerFill, dividerSize = props.dividerSize, icon = props.icon, _a = props.iconFill, iconFill = _a === void 0 ? 'surfaceItemAccent' : _a, showDivider = props.showDivider, size = props.size, isExpanded = props.isExpanded, onClick = props.onClick;
|
|
42
42
|
var onClickTitle = React.useCallback(function () {
|
|
43
43
|
// "!isExpanded" - is next state of expanded
|
|
44
44
|
var thisItemData = {
|
|
45
45
|
id: id,
|
|
46
|
-
isExpanded: !isExpanded,
|
|
47
|
-
content: content,
|
|
48
46
|
title: title,
|
|
47
|
+
content: content,
|
|
48
|
+
isExpanded: !isExpanded,
|
|
49
49
|
};
|
|
50
50
|
onClick && onClick(thisItemData);
|
|
51
51
|
}, [id, title, content, isExpanded, onClick]);
|
|
52
52
|
// @ts-expect-error
|
|
53
|
-
var appearanceConfig = accordionItemConfig.appearance &&
|
|
53
|
+
var appearanceConfig = accordionItemConfig.appearance &&
|
|
54
|
+
accordionItemConfig.appearance[appearance];
|
|
54
55
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
55
|
-
var
|
|
56
|
+
var fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, titleBorderColorClass = propsGenerator.titleBorderColorClass, titleFillClass = propsGenerator.titleFillClass, titleFillHoverClass = propsGenerator.titleFillHoverClass, contentBorderColorClass = propsGenerator.contentBorderColorClass, contentFillClass = propsGenerator.contentFillClass, contentFillHoverClass = propsGenerator.contentFillHoverClass, shapeClass = propsGenerator.shapeClass;
|
|
56
57
|
// @ts-expect-error
|
|
57
58
|
var styles = useStyles.useStyles(props).styles;
|
|
58
|
-
return (jsxRuntime.jsxs("div", { className: clsx('accordion-item', className, borderColorClass && "border-color_".concat(borderColorClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), shapeClass && "accordion-item_shape_".concat(shapeClass), size && "accordion-item_size_".concat(size), isExpanded && 'accordion-item_state_open'), style: styles, children: [jsxRuntime.jsx(Text.Text, { className: clsx('accordion-item__title', titleBorderColorClass && "border-color_".concat(titleBorderColorClass), titleFillClass && "fill_".concat(titleFillClass), titleFillHoverClass && "fill_hover_".concat(titleFillHoverClass), 'cursor_type_pointer'),
|
|
59
|
-
(
|
|
59
|
+
return (jsxRuntime.jsxs("div", { className: clsx('accordion-item', className, borderColorClass && "border-color_".concat(borderColorClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), shapeClass && "accordion-item_shape_".concat(shapeClass), size && "accordion-item_size_".concat(size), isExpanded && 'accordion-item_state_open'), style: styles, children: [jsxRuntime.jsx(Text.Text, { className: clsx('accordion-item__title', titleBorderColorClass && "border-color_".concat(titleBorderColorClass), titleFillClass && "fill_".concat(titleFillClass), titleFillHoverClass && "fill_hover_".concat(titleFillHoverClass), 'cursor_type_pointer'), textColor: titleTextColor, textWeight: titleTextWeight, size: titleTextSize, onClick: onClickTitle, children: title }), jsxRuntime.jsx("div", { className: clsx('accordion-item__icon', 'cursor_type_pointer'), onClick: onClickTitle, children: icon || (jsxRuntime.jsx(Icon.Icon, { iconFill: iconFill, size: "16", SvgImage: _default.icon16.ChevronDown })) }), beforeContent && beforeContent, showDivider && (jsxRuntime.jsx(Divider.Divider, { width: "fill", direction: dividerDirection, fill: dividerFill || 'surfaceTertiary', size: dividerSize })), isExpanded && (jsxRuntime.jsx("div", { className: clsx('accordion-item__content', contentBorderColorClass &&
|
|
60
|
+
"border-color_".concat(contentBorderColorClass), contentFillClass && "fill_".concat(contentFillClass), contentFillHoverClass && "fill_hover_".concat(contentFillHoverClass)), children: children ||
|
|
61
|
+
(content && (jsxRuntime.jsx(Text.Text, { textColor: contentTextColor, textWeight: contentTextWeight, size: contentTextSize, children: content }))) })), afterContent && afterContent] }));
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
var accordionConfig = {
|
|
@@ -66,7 +68,7 @@ var accordionConfig = {
|
|
|
66
68
|
},
|
|
67
69
|
};
|
|
68
70
|
function Accordion(props) {
|
|
69
|
-
var
|
|
71
|
+
var className = props.className, appearance = props.appearance, _a = props.initial, initial = _a === void 0 ? [] : _a, children = props.children, items = props.items, isMultiple = props.isMultiple, onClickItem = props.onClickItem;
|
|
70
72
|
var _b = React.useState(function () { return castArray(initial); }), expandedItems = _b[0], setExpandedItems = _b[1];
|
|
71
73
|
var onClickAccordionItem = React.useCallback(function (targetItem) {
|
|
72
74
|
setExpandedItems(function (prevState) {
|
|
@@ -94,7 +96,7 @@ function Accordion(props) {
|
|
|
94
96
|
}, [isMultiple, onClickItem]);
|
|
95
97
|
var accordionItemsList = React.useMemo(function () {
|
|
96
98
|
if (items) {
|
|
97
|
-
return items.map(function (item, i) { return (jsxRuntime.jsx(AccordionItem, {
|
|
99
|
+
return items.map(function (item, i) { return (jsxRuntime.jsx(AccordionItem, { id: item.id, title: item.title, content: item.content, isExpanded: expandedItems.includes(item.id), onClick: onClickAccordionItem }, "accordionItem_".concat(item.id || i + 1))); });
|
|
98
100
|
}
|
|
99
101
|
if (children) {
|
|
100
102
|
// @ts-ignore
|
|
@@ -112,15 +114,9 @@ function Accordion(props) {
|
|
|
112
114
|
}
|
|
113
115
|
return [];
|
|
114
116
|
}, [children, items, expandedItems, onClickAccordionItem]);
|
|
115
|
-
// @ts-expect-error
|
|
116
117
|
var appearanceConfig = accordionConfig.appearance && accordionConfig.appearance[appearance];
|
|
117
118
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
118
|
-
var
|
|
119
|
-
/*
|
|
120
|
-
* paddingHorizontalWrapper="16px"
|
|
121
|
-
* paddingHorizontal - styles (horizontal will be parsed to left/right)
|
|
122
|
-
* wrapper - target
|
|
123
|
-
*/
|
|
119
|
+
var directionClass = propsGenerator.directionClass, fillClass = propsGenerator.fillClass, borderColorClass = propsGenerator.borderColorClass, shapeClass = propsGenerator.shapeClass, widthClass = propsGenerator.widthClass;
|
|
124
120
|
// @ts-expect-error
|
|
125
121
|
var _c = useStyles.useStyles(props), accordionStyles = _c.styles, accordionWrapperStyles = _c.wrapper;
|
|
126
122
|
return (jsxRuntime.jsx("div", { className: clsx(className, 'accordion', borderColorClass && "border-color_".concat(borderColorClass), directionClass && "accordion_direction_".concat(directionClass), fillClass && "fill_".concat(fillClass), shapeClass && "accordion_shape_".concat(shapeClass), widthClass && "width_".concat(widthClass)), style: accordionStyles, children: jsxRuntime.jsx("div", { className: "accordion__wrapper", style: accordionWrapperStyles, children: accordionItemsList }) }));
|
|
@@ -34,15 +34,15 @@ var cellConfig = {
|
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
36
|
function Cell(props) {
|
|
37
|
-
var
|
|
37
|
+
var className = props.className, appearance = props.appearance, title = props.title, titleIcon = props.titleIcon, titleIconFill = props.titleIconFill, titleIconFillHover = props.titleIconFillHover, titleIconFillSize = props.titleIconFillSize, titleIconItemFill = props.titleIconItemFill, titleIconShape = props.titleIconShape, titleIconSrc = props.titleIconSrc, titleLabel = props.titleLabel, titleLabelAppearance = props.titleLabelAppearance, titleLabelShape = props.titleLabelShape, titleLabelSize = props.titleLabelSize,
|
|
38
38
|
// titleLabelTextSize,
|
|
39
39
|
titleTag = props.titleTag, titleTextColor = props.titleTextColor,
|
|
40
40
|
// titleTextSize,
|
|
41
|
-
titleTextTruncate = props.titleTextTruncate, titleTextWeight = props.titleTextWeight, titleTextWrap = props.titleTextWrap, value = props.value, valueIcon = props.valueIcon, valueIconFill = props.valueIconFill, valueIconFillHover = props.valueIconFillHover, valueIconFillSize = props.valueIconFillSize, valueIconItemFill = props.valueIconItemFill, valueIconShape = props.valueIconShape, valueIconSrc = props.valueIconSrc, valueLabel = props.valueLabel, valueLabelAppearance = props.valueLabelAppearance, valueLabelShape = props.valueLabelShape, valueLabelSize = props.valueLabelSize,
|
|
41
|
+
titleTextTruncate = props.titleTextTruncate, titleTextWeight = props.titleTextWeight, titleTextWrap = props.titleTextWrap, mode = props.mode, reverse = props.reverse, showTitleLabel = props.showTitleLabel, showValueLabel = props.showValueLabel, size = props.size, value = props.value, valueIcon = props.valueIcon, valueIconFill = props.valueIconFill, valueIconFillHover = props.valueIconFillHover, valueIconFillSize = props.valueIconFillSize, valueIconItemFill = props.valueIconItemFill, valueIconShape = props.valueIconShape, valueIconSrc = props.valueIconSrc, valueLabel = props.valueLabel, valueLabelAppearance = props.valueLabelAppearance, valueLabelShape = props.valueLabelShape, valueLabelSize = props.valueLabelSize,
|
|
42
42
|
// valueLabelTextSize,
|
|
43
43
|
valueTag = props.valueTag, valueTextAlign = props.valueTextAlign, valueTextColor = props.valueTextColor,
|
|
44
44
|
// valueTextSize,
|
|
45
|
-
valueTextTruncate = props.valueTextTruncate, valueTextWeight = props.valueTextWeight, valueTextWrap = props.valueTextWrap, zeroGap = props.zeroGap, zeroPadding = props.zeroPadding, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
45
|
+
valueTextTruncate = props.valueTextTruncate, valueTextWeight = props.valueTextWeight, valueTextWrap = props.valueTextWrap, zeroGap = props.zeroGap, zeroPadding = props.zeroPadding, before = props.before, after = props.after, isActive = props.isActive, _a = props.isDisabled, isDisabled = _a === void 0 ? false : _a, isEqual = props.isEqual, set = props.set, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
46
46
|
// @ts-expect-error
|
|
47
47
|
var appearanceConfig = cellConfig.appearance && cellConfig.appearance[appearance];
|
|
48
48
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
@@ -56,7 +56,11 @@ function Cell(props) {
|
|
|
56
56
|
/* eslint-enable perfectionist/sort-objects */
|
|
57
57
|
// @ts-expect-error
|
|
58
58
|
var _b = useStyles.useStyles(props), dataStyles = _b.data, cellStyles = _b.styles;
|
|
59
|
-
return (jsxRuntime.jsxs("div", { className: clsx(className, 'cell', mode && "cell_mode_".concat(mode), size && "cell_size_".concat(size), set && "cell_set_".concat(set), bgFillClass && "fill_".concat(bgFillClass), bgFillHoverClass && "fill_hover_".concat(bgFillHoverClass), isActive && bgFillActiveClass && "fill_active_".concat(bgFillActiveClass), isDisabled &&
|
|
59
|
+
return (jsxRuntime.jsxs("div", { className: clsx(className, 'cell', mode && "cell_mode_".concat(mode), size && "cell_size_".concat(size), set && "cell_set_".concat(set), bgFillClass && "fill_".concat(bgFillClass), bgFillHoverClass && "fill_hover_".concat(bgFillHoverClass), isActive && bgFillActiveClass && "fill_active_".concat(bgFillActiveClass), isDisabled &&
|
|
60
|
+
bgFillDisabledClass &&
|
|
61
|
+
"fill_disabled_".concat(bgFillDisabledClass), bgShapeClass && "cell_shape_".concat(bgShapeClass), widthClass && !(cellStyles === null || cellStyles === void 0 ? void 0 : cellStyles.width) && "width_".concat(widthClass), zeroPadding && 'cell_reset-padding', zeroGap && 'cell_reset-gap', reverse && 'cell_reverse'), style: cellStyles, onClick: onClick, onMouseEnter: onMouseEnter, children: [before && jsxRuntime.jsx("div", { className: "cell__before", children: before }), jsxRuntime.jsxs("div", { className: clsx('cell__wrapper', directionClass && "cell__wrapper_direction_".concat(directionClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), isActive && fillActiveClass && "fill_active_".concat(fillActiveClass), isDisabled &&
|
|
62
|
+
fillDisabledClass &&
|
|
63
|
+
"fill_disabled_".concat(fillDisabledClass), shapeClass && "cell__wrapper_shape_".concat(shapeClass), isEqual && 'cell__wrapper-equal'), children: [title && (jsxRuntime.jsxs("div", { className: "cell__data", style: dataStyles, children: [jsxRuntime.jsx(Text.Text, { className: "cell__title", textColor: titleTextColor, textTruncate: titleTextTruncate, textWeight: titleTextWeight, textWrap: titleTextWrap, size: titleTextSize, tag: titleTag, children: title }), (titleIcon || titleIconSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "cell__icon", fill: titleIconFill, fillSize: titleIconFillSize, iconFill: titleIconItemFill, iconFillHover: titleIconFillHover, imageSrc: titleIconSrc, shape: titleIconShape, SvgImage: titleIcon })), showTitleLabel && (jsxRuntime.jsx(Label.Label, { appearance: titleLabelAppearance, label: titleLabel, labelTextSize: titleLabelTextSize, shape: titleLabelShape, size: titleLabelSize }))] })), value && (jsxRuntime.jsxs("div", { className: "cell__data", style: dataStyles, children: [jsxRuntime.jsx(Text.Text, { className: "cell__value", textAlign: valueTextAlign, textColor: valueTextColor, textTruncate: valueTextTruncate, textWeight: valueTextWeight, textWrap: valueTextWrap, size: valueTextSize, tag: valueTag, children: value }), (valueIcon || valueIconSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "cell__icon", fill: valueIconFill, fillSize: valueIconFillSize, iconFill: valueIconItemFill, iconFillHover: valueIconFillHover, imageSrc: valueIconSrc, shape: valueIconShape, SvgImage: valueIcon })), showValueLabel && (jsxRuntime.jsx(Label.Label, { appearance: valueLabelAppearance, label: valueLabel, labelTextSize: valueLabelTextSize, shape: valueLabelShape, size: valueLabelSize }))] }))] }), after && jsxRuntime.jsx("div", { className: "cell__after", children: after })] }));
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
exports.Cell = Cell;
|
|
@@ -5,8 +5,8 @@ var React = require('react');
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var Cookies = require('js-cookie');
|
|
7
7
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
8
|
-
var Button = require('../../Button-
|
|
9
|
-
var Group = require('../../Group-
|
|
8
|
+
var Button = require('../../Button-HKkjJ38v.js');
|
|
9
|
+
var Group = require('../../Group-Chtnas-J.js');
|
|
10
10
|
var Text = require('../../Text-C49zj3jO.js');
|
|
11
11
|
require('../../tslib.es6-CCZ3TN_7.js');
|
|
12
12
|
require('lodash/camelCase');
|
|
@@ -8,7 +8,7 @@ var locale = require('date-fns/locale');
|
|
|
8
8
|
var DatePicker = require('react-datepicker');
|
|
9
9
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
10
10
|
var useStyles = require('../hooks/useStyles/useStyles.js');
|
|
11
|
-
var Button = require('../../Button-
|
|
11
|
+
var Button = require('../../Button-HKkjJ38v.js');
|
|
12
12
|
var Icon = require('../../Icon-GVGrUu_Z.js');
|
|
13
13
|
var Input = require('../../Input-Dwvk-poq.js');
|
|
14
14
|
var Label = require('../../Label-XTFwl1aq.js');
|
|
@@ -5,7 +5,7 @@ var React = require('react');
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
7
7
|
var useStyles = require('../hooks/useStyles/useStyles.js');
|
|
8
|
-
var Group = require('../../Group-
|
|
8
|
+
var Group = require('../../Group-Chtnas-J.js');
|
|
9
9
|
var Text = require('../../Text-C49zj3jO.js');
|
|
10
10
|
require('../../tslib.es6-CCZ3TN_7.js');
|
|
11
11
|
require('lodash/camelCase');
|
|
@@ -7,8 +7,8 @@ var clsx = require('clsx');
|
|
|
7
7
|
var SVG = require('react-inlinesvg');
|
|
8
8
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
9
9
|
var useStyles = require('../hooks/useStyles/useStyles.js');
|
|
10
|
-
var Button = require('../../Button-
|
|
11
|
-
var Group = require('../../Group-
|
|
10
|
+
var Button = require('../../Button-HKkjJ38v.js');
|
|
11
|
+
var Group = require('../../Group-Chtnas-J.js');
|
|
12
12
|
var Text = require('../../Text-C49zj3jO.js');
|
|
13
13
|
require('lodash/camelCase');
|
|
14
14
|
require('lodash/castArray');
|
|
@@ -10,7 +10,7 @@ var CreatableSelect = require('react-select/creatable');
|
|
|
10
10
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
11
11
|
var Text = require('../../Text-C49zj3jO.js');
|
|
12
12
|
var Badge = require('../../Badge-BX4N91_C.js');
|
|
13
|
-
var Group = require('../../Group-
|
|
13
|
+
var Group = require('../../Group-Chtnas-J.js');
|
|
14
14
|
var Divider = require('../../Divider-ImOOytuN.js');
|
|
15
15
|
require('react-inlinesvg');
|
|
16
16
|
require('../hooks/useStyles/useStyles.js');
|
|
@@ -113,6 +113,7 @@ function useDevicePropsGenerator(componentProps, appearanceConfig) {
|
|
|
113
113
|
},
|
|
114
114
|
};
|
|
115
115
|
return new Proxy(propsGenerator, generatorProxyHandler);
|
|
116
|
+
// TODO: componentProps(react) and appearanceConfig(not memoized) is always new. maybe better check Object.values?
|
|
116
117
|
}, [componentProps, appearanceConfig, deviceCurrentMainType]);
|
|
117
118
|
return devicePropsGenerator;
|
|
118
119
|
}
|
|
@@ -36,25 +36,27 @@ var accordionItemConfig = {
|
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
function AccordionItem(props) {
|
|
39
|
-
var id = props.id, children = props.children,
|
|
39
|
+
var id = props.id, className = props.className, appearance = props.appearance, children = props.children, title = props.title, titleTextColor = props.titleTextColor, titleTextSize = props.titleTextSize, titleTextWeight = props.titleTextWeight, afterContent = props.afterContent, beforeContent = props.beforeContent, content = props.content, contentTextColor = props.contentTextColor, contentTextSize = props.contentTextSize, contentTextWeight = props.contentTextWeight, dividerDirection = props.dividerDirection, dividerFill = props.dividerFill, dividerSize = props.dividerSize, icon = props.icon, _a = props.iconFill, iconFill = _a === void 0 ? 'surfaceItemAccent' : _a, showDivider = props.showDivider, size = props.size, isExpanded = props.isExpanded, onClick = props.onClick;
|
|
40
40
|
var onClickTitle = useCallback(function () {
|
|
41
41
|
// "!isExpanded" - is next state of expanded
|
|
42
42
|
var thisItemData = {
|
|
43
43
|
id: id,
|
|
44
|
-
isExpanded: !isExpanded,
|
|
45
|
-
content: content,
|
|
46
44
|
title: title,
|
|
45
|
+
content: content,
|
|
46
|
+
isExpanded: !isExpanded,
|
|
47
47
|
};
|
|
48
48
|
onClick && onClick(thisItemData);
|
|
49
49
|
}, [id, title, content, isExpanded, onClick]);
|
|
50
50
|
// @ts-expect-error
|
|
51
|
-
var appearanceConfig = accordionItemConfig.appearance &&
|
|
51
|
+
var appearanceConfig = accordionItemConfig.appearance &&
|
|
52
|
+
accordionItemConfig.appearance[appearance];
|
|
52
53
|
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
53
|
-
var
|
|
54
|
+
var fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, titleBorderColorClass = propsGenerator.titleBorderColorClass, titleFillClass = propsGenerator.titleFillClass, titleFillHoverClass = propsGenerator.titleFillHoverClass, contentBorderColorClass = propsGenerator.contentBorderColorClass, contentFillClass = propsGenerator.contentFillClass, contentFillHoverClass = propsGenerator.contentFillHoverClass, shapeClass = propsGenerator.shapeClass;
|
|
54
55
|
// @ts-expect-error
|
|
55
56
|
var styles = useStyles(props).styles;
|
|
56
|
-
return (jsxs("div", { className: clsx('accordion-item', className, borderColorClass && "border-color_".concat(borderColorClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), shapeClass && "accordion-item_shape_".concat(shapeClass), size && "accordion-item_size_".concat(size), isExpanded && 'accordion-item_state_open'), style: styles, children: [jsx(Text, { className: clsx('accordion-item__title', titleBorderColorClass && "border-color_".concat(titleBorderColorClass), titleFillClass && "fill_".concat(titleFillClass), titleFillHoverClass && "fill_hover_".concat(titleFillHoverClass), 'cursor_type_pointer'),
|
|
57
|
-
(
|
|
57
|
+
return (jsxs("div", { className: clsx('accordion-item', className, borderColorClass && "border-color_".concat(borderColorClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), shapeClass && "accordion-item_shape_".concat(shapeClass), size && "accordion-item_size_".concat(size), isExpanded && 'accordion-item_state_open'), style: styles, children: [jsx(Text, { className: clsx('accordion-item__title', titleBorderColorClass && "border-color_".concat(titleBorderColorClass), titleFillClass && "fill_".concat(titleFillClass), titleFillHoverClass && "fill_hover_".concat(titleFillHoverClass), 'cursor_type_pointer'), textColor: titleTextColor, textWeight: titleTextWeight, size: titleTextSize, onClick: onClickTitle, children: title }), jsx("div", { className: clsx('accordion-item__icon', 'cursor_type_pointer'), onClick: onClickTitle, children: icon || (jsx(Icon, { iconFill: iconFill, size: "16", SvgImage: icon16.ChevronDown })) }), beforeContent && beforeContent, showDivider && (jsx(Divider, { width: "fill", direction: dividerDirection, fill: dividerFill || 'surfaceTertiary', size: dividerSize })), isExpanded && (jsx("div", { className: clsx('accordion-item__content', contentBorderColorClass &&
|
|
58
|
+
"border-color_".concat(contentBorderColorClass), contentFillClass && "fill_".concat(contentFillClass), contentFillHoverClass && "fill_hover_".concat(contentFillHoverClass)), children: children ||
|
|
59
|
+
(content && (jsx(Text, { textColor: contentTextColor, textWeight: contentTextWeight, size: contentTextSize, children: content }))) })), afterContent && afterContent] }));
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
var accordionConfig = {
|
|
@@ -64,7 +66,7 @@ var accordionConfig = {
|
|
|
64
66
|
},
|
|
65
67
|
};
|
|
66
68
|
function Accordion(props) {
|
|
67
|
-
var
|
|
69
|
+
var className = props.className, appearance = props.appearance, _a = props.initial, initial = _a === void 0 ? [] : _a, children = props.children, items = props.items, isMultiple = props.isMultiple, onClickItem = props.onClickItem;
|
|
68
70
|
var _b = useState(function () { return castArray(initial); }), expandedItems = _b[0], setExpandedItems = _b[1];
|
|
69
71
|
var onClickAccordionItem = useCallback(function (targetItem) {
|
|
70
72
|
setExpandedItems(function (prevState) {
|
|
@@ -92,7 +94,7 @@ function Accordion(props) {
|
|
|
92
94
|
}, [isMultiple, onClickItem]);
|
|
93
95
|
var accordionItemsList = useMemo(function () {
|
|
94
96
|
if (items) {
|
|
95
|
-
return items.map(function (item, i) { return (jsx(AccordionItem, {
|
|
97
|
+
return items.map(function (item, i) { return (jsx(AccordionItem, { id: item.id, title: item.title, content: item.content, isExpanded: expandedItems.includes(item.id), onClick: onClickAccordionItem }, "accordionItem_".concat(item.id || i + 1))); });
|
|
96
98
|
}
|
|
97
99
|
if (children) {
|
|
98
100
|
// @ts-ignore
|
|
@@ -110,15 +112,9 @@ function Accordion(props) {
|
|
|
110
112
|
}
|
|
111
113
|
return [];
|
|
112
114
|
}, [children, items, expandedItems, onClickAccordionItem]);
|
|
113
|
-
// @ts-expect-error
|
|
114
115
|
var appearanceConfig = accordionConfig.appearance && accordionConfig.appearance[appearance];
|
|
115
116
|
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
116
|
-
var
|
|
117
|
-
/*
|
|
118
|
-
* paddingHorizontalWrapper="16px"
|
|
119
|
-
* paddingHorizontal - styles (horizontal will be parsed to left/right)
|
|
120
|
-
* wrapper - target
|
|
121
|
-
*/
|
|
117
|
+
var directionClass = propsGenerator.directionClass, fillClass = propsGenerator.fillClass, borderColorClass = propsGenerator.borderColorClass, shapeClass = propsGenerator.shapeClass, widthClass = propsGenerator.widthClass;
|
|
122
118
|
// @ts-expect-error
|
|
123
119
|
var _c = useStyles(props), accordionStyles = _c.styles, accordionWrapperStyles = _c.wrapper;
|
|
124
120
|
return (jsx("div", { className: clsx(className, 'accordion', borderColorClass && "border-color_".concat(borderColorClass), directionClass && "accordion_direction_".concat(directionClass), fillClass && "fill_".concat(fillClass), shapeClass && "accordion_shape_".concat(shapeClass), widthClass && "width_".concat(widthClass)), style: accordionStyles, children: jsx("div", { className: "accordion__wrapper", style: accordionWrapperStyles, children: accordionItemsList }) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as Button, a as buttonAppearance, b as buttonConfig } from '../Button-
|
|
1
|
+
export { B as Button, a as buttonAppearance, b as buttonConfig } from '../Button-BtAUGGPc.js';
|
|
2
2
|
import '../tslib.es6-5FtW-kfi.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
package/dist/components/Cell.js
CHANGED
|
@@ -32,15 +32,15 @@ var cellConfig = {
|
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
function Cell(props) {
|
|
35
|
-
var
|
|
35
|
+
var className = props.className, appearance = props.appearance, title = props.title, titleIcon = props.titleIcon, titleIconFill = props.titleIconFill, titleIconFillHover = props.titleIconFillHover, titleIconFillSize = props.titleIconFillSize, titleIconItemFill = props.titleIconItemFill, titleIconShape = props.titleIconShape, titleIconSrc = props.titleIconSrc, titleLabel = props.titleLabel, titleLabelAppearance = props.titleLabelAppearance, titleLabelShape = props.titleLabelShape, titleLabelSize = props.titleLabelSize,
|
|
36
36
|
// titleLabelTextSize,
|
|
37
37
|
titleTag = props.titleTag, titleTextColor = props.titleTextColor,
|
|
38
38
|
// titleTextSize,
|
|
39
|
-
titleTextTruncate = props.titleTextTruncate, titleTextWeight = props.titleTextWeight, titleTextWrap = props.titleTextWrap, value = props.value, valueIcon = props.valueIcon, valueIconFill = props.valueIconFill, valueIconFillHover = props.valueIconFillHover, valueIconFillSize = props.valueIconFillSize, valueIconItemFill = props.valueIconItemFill, valueIconShape = props.valueIconShape, valueIconSrc = props.valueIconSrc, valueLabel = props.valueLabel, valueLabelAppearance = props.valueLabelAppearance, valueLabelShape = props.valueLabelShape, valueLabelSize = props.valueLabelSize,
|
|
39
|
+
titleTextTruncate = props.titleTextTruncate, titleTextWeight = props.titleTextWeight, titleTextWrap = props.titleTextWrap, mode = props.mode, reverse = props.reverse, showTitleLabel = props.showTitleLabel, showValueLabel = props.showValueLabel, size = props.size, value = props.value, valueIcon = props.valueIcon, valueIconFill = props.valueIconFill, valueIconFillHover = props.valueIconFillHover, valueIconFillSize = props.valueIconFillSize, valueIconItemFill = props.valueIconItemFill, valueIconShape = props.valueIconShape, valueIconSrc = props.valueIconSrc, valueLabel = props.valueLabel, valueLabelAppearance = props.valueLabelAppearance, valueLabelShape = props.valueLabelShape, valueLabelSize = props.valueLabelSize,
|
|
40
40
|
// valueLabelTextSize,
|
|
41
41
|
valueTag = props.valueTag, valueTextAlign = props.valueTextAlign, valueTextColor = props.valueTextColor,
|
|
42
42
|
// valueTextSize,
|
|
43
|
-
valueTextTruncate = props.valueTextTruncate, valueTextWeight = props.valueTextWeight, valueTextWrap = props.valueTextWrap, zeroGap = props.zeroGap, zeroPadding = props.zeroPadding, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
43
|
+
valueTextTruncate = props.valueTextTruncate, valueTextWeight = props.valueTextWeight, valueTextWrap = props.valueTextWrap, zeroGap = props.zeroGap, zeroPadding = props.zeroPadding, before = props.before, after = props.after, isActive = props.isActive, _a = props.isDisabled, isDisabled = _a === void 0 ? false : _a, isEqual = props.isEqual, set = props.set, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
44
44
|
// @ts-expect-error
|
|
45
45
|
var appearanceConfig = cellConfig.appearance && cellConfig.appearance[appearance];
|
|
46
46
|
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
@@ -54,7 +54,11 @@ function Cell(props) {
|
|
|
54
54
|
/* eslint-enable perfectionist/sort-objects */
|
|
55
55
|
// @ts-expect-error
|
|
56
56
|
var _b = useStyles(props), dataStyles = _b.data, cellStyles = _b.styles;
|
|
57
|
-
return (jsxs("div", { className: clsx(className, 'cell', mode && "cell_mode_".concat(mode), size && "cell_size_".concat(size), set && "cell_set_".concat(set), bgFillClass && "fill_".concat(bgFillClass), bgFillHoverClass && "fill_hover_".concat(bgFillHoverClass), isActive && bgFillActiveClass && "fill_active_".concat(bgFillActiveClass), isDisabled &&
|
|
57
|
+
return (jsxs("div", { className: clsx(className, 'cell', mode && "cell_mode_".concat(mode), size && "cell_size_".concat(size), set && "cell_set_".concat(set), bgFillClass && "fill_".concat(bgFillClass), bgFillHoverClass && "fill_hover_".concat(bgFillHoverClass), isActive && bgFillActiveClass && "fill_active_".concat(bgFillActiveClass), isDisabled &&
|
|
58
|
+
bgFillDisabledClass &&
|
|
59
|
+
"fill_disabled_".concat(bgFillDisabledClass), bgShapeClass && "cell_shape_".concat(bgShapeClass), widthClass && !(cellStyles === null || cellStyles === void 0 ? void 0 : cellStyles.width) && "width_".concat(widthClass), zeroPadding && 'cell_reset-padding', zeroGap && 'cell_reset-gap', reverse && 'cell_reverse'), style: cellStyles, onClick: onClick, onMouseEnter: onMouseEnter, children: [before && jsx("div", { className: "cell__before", children: before }), jsxs("div", { className: clsx('cell__wrapper', directionClass && "cell__wrapper_direction_".concat(directionClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), isActive && fillActiveClass && "fill_active_".concat(fillActiveClass), isDisabled &&
|
|
60
|
+
fillDisabledClass &&
|
|
61
|
+
"fill_disabled_".concat(fillDisabledClass), shapeClass && "cell__wrapper_shape_".concat(shapeClass), isEqual && 'cell__wrapper-equal'), children: [title && (jsxs("div", { className: "cell__data", style: dataStyles, children: [jsx(Text, { className: "cell__title", textColor: titleTextColor, textTruncate: titleTextTruncate, textWeight: titleTextWeight, textWrap: titleTextWrap, size: titleTextSize, tag: titleTag, children: title }), (titleIcon || titleIconSrc) && (jsx(Icon, { className: "cell__icon", fill: titleIconFill, fillSize: titleIconFillSize, iconFill: titleIconItemFill, iconFillHover: titleIconFillHover, imageSrc: titleIconSrc, shape: titleIconShape, SvgImage: titleIcon })), showTitleLabel && (jsx(Label, { appearance: titleLabelAppearance, label: titleLabel, labelTextSize: titleLabelTextSize, shape: titleLabelShape, size: titleLabelSize }))] })), value && (jsxs("div", { className: "cell__data", style: dataStyles, children: [jsx(Text, { className: "cell__value", textAlign: valueTextAlign, textColor: valueTextColor, textTruncate: valueTextTruncate, textWeight: valueTextWeight, textWrap: valueTextWrap, size: valueTextSize, tag: valueTag, children: value }), (valueIcon || valueIconSrc) && (jsx(Icon, { className: "cell__icon", fill: valueIconFill, fillSize: valueIconFillSize, iconFill: valueIconItemFill, iconFillHover: valueIconFillHover, imageSrc: valueIconSrc, shape: valueIconShape, SvgImage: valueIcon })), showValueLabel && (jsx(Label, { appearance: valueLabelAppearance, label: valueLabel, labelTextSize: valueLabelTextSize, shape: valueLabelShape, size: valueLabelSize }))] }))] }), after && jsx("div", { className: "cell__after", children: after })] }));
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
export { Cell, cellAppearance, cellConfig };
|
|
@@ -3,8 +3,8 @@ import { useRef, useMemo, useCallback, useEffect } from 'react';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import Cookies from 'js-cookie';
|
|
5
5
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
|
-
import { B as Button } from '../Button-
|
|
7
|
-
import { G as Group } from '../Group-
|
|
6
|
+
import { B as Button } from '../Button-BtAUGGPc.js';
|
|
7
|
+
import { G as Group } from '../Group-DiMnEfge.js';
|
|
8
8
|
import { T as Text } from '../Text-C6NSmetx.js';
|
|
9
9
|
import '../tslib.es6-5FtW-kfi.js';
|
|
10
10
|
import 'lodash/camelCase';
|
|
@@ -6,7 +6,7 @@ import { ru } from 'date-fns/locale';
|
|
|
6
6
|
import DatePicker from 'react-datepicker';
|
|
7
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
8
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
9
|
-
import { B as Button } from '../Button-
|
|
9
|
+
import { B as Button } from '../Button-BtAUGGPc.js';
|
|
10
10
|
import { I as Icon } from '../Icon-htF_V35Y.js';
|
|
11
11
|
import { I as Input } from '../Input-COFdaiTe.js';
|
|
12
12
|
import { L as Label } from '../Label-Dpeq55TV.js';
|
package/dist/components/Group.js
CHANGED
package/dist/components/Panel.js
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
6
|
-
import { G as Group } from '../Group-
|
|
6
|
+
import { G as Group } from '../Group-DiMnEfge.js';
|
|
7
7
|
import { T as Text } from '../Text-C6NSmetx.js';
|
|
8
8
|
import '../tslib.es6-5FtW-kfi.js';
|
|
9
9
|
import 'lodash/camelCase';
|
|
@@ -5,8 +5,8 @@ import clsx from 'clsx';
|
|
|
5
5
|
import SVG from 'react-inlinesvg';
|
|
6
6
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
7
7
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
8
|
-
import { B as Button } from '../Button-
|
|
9
|
-
import { G as Group } from '../Group-
|
|
8
|
+
import { B as Button } from '../Button-BtAUGGPc.js';
|
|
9
|
+
import { G as Group } from '../Group-DiMnEfge.js';
|
|
10
10
|
import { T as Text } from '../Text-C6NSmetx.js';
|
|
11
11
|
import 'lodash/camelCase';
|
|
12
12
|
import 'lodash/castArray';
|
|
@@ -8,7 +8,7 @@ import CreatableSelect from 'react-select/creatable';
|
|
|
8
8
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
9
9
|
import { T as Text } from '../Text-C6NSmetx.js';
|
|
10
10
|
import { B as Badge } from '../Badge-CGHosmYx.js';
|
|
11
|
-
import { G as Group } from '../Group-
|
|
11
|
+
import { G as Group } from '../Group-DiMnEfge.js';
|
|
12
12
|
import { D as Divider } from '../Divider-BQcBkzt1.js';
|
|
13
13
|
import 'react-inlinesvg';
|
|
14
14
|
import '../hooks/useStyles/useStyles.js';
|
|
@@ -46,16 +46,12 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
.accordion-item {
|
|
49
|
-
min-width: 170px;
|
|
50
49
|
display: flex;
|
|
51
50
|
flex-flow: row wrap;
|
|
52
51
|
align-items: center;
|
|
53
52
|
gap: 14px;
|
|
54
53
|
&__title {
|
|
55
54
|
flex: 1;
|
|
56
|
-
&.text {
|
|
57
|
-
padding: var(--accordion-item-padding, 0);
|
|
58
|
-
}
|
|
59
55
|
}
|
|
60
56
|
&__icon {
|
|
61
57
|
align-self: flex-start;
|
|
@@ -75,9 +71,9 @@
|
|
|
75
71
|
}
|
|
76
72
|
.accordion-item {
|
|
77
73
|
&_size {
|
|
78
|
-
@each $size in
|
|
74
|
+
@each $size in xxl, xl, l, m, s, xs, xxs {
|
|
79
75
|
&_$(size) {
|
|
80
|
-
padding: var(--accordion-item
|
|
76
|
+
padding: var(--accordion-item-$(size)-padding);
|
|
81
77
|
}
|
|
82
78
|
}
|
|
83
79
|
}
|
|
@@ -90,6 +86,7 @@
|
|
|
90
86
|
}
|
|
91
87
|
}
|
|
92
88
|
:root {
|
|
93
|
-
--accordion-item-
|
|
94
|
-
--accordion-item-
|
|
89
|
+
--accordion-item-shape-rounded: 12px;
|
|
90
|
+
--accordion-item-xs-padding: 10px 8px;
|
|
91
|
+
--accordion-item-l-padding: 14px 12px;
|
|
95
92
|
}
|
|
@@ -1,44 +1,20 @@
|
|
|
1
1
|
.chips {
|
|
2
2
|
display: inline-flex;
|
|
3
|
-
&__label {
|
|
4
|
-
white-space: var(--chips-label-white-space, nowrap);
|
|
5
|
-
}
|
|
6
3
|
&__inner {
|
|
7
4
|
display: flex;
|
|
8
5
|
align-items: center;
|
|
9
|
-
gap: 4px;
|
|
10
6
|
}
|
|
11
7
|
}
|
|
12
8
|
|
|
13
9
|
.chips {
|
|
14
|
-
|
|
15
|
-
&
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
&_s {
|
|
24
|
-
padding: var(--chips-size-s-padding, 2px 6px);
|
|
25
|
-
@mixin text-s;
|
|
26
|
-
}
|
|
27
|
-
&_m {
|
|
28
|
-
padding: var(--chips-size-m-padding, 2px 6px);
|
|
29
|
-
@mixin text-m;
|
|
30
|
-
}
|
|
31
|
-
&_l {
|
|
32
|
-
padding: var(--chips-size-l-padding, 2px 6px);
|
|
33
|
-
@mixin text-l;
|
|
34
|
-
}
|
|
35
|
-
&_xl {
|
|
36
|
-
padding: var(--chips-size-xl-padding, 2px 6px);
|
|
37
|
-
@mixin text-l;
|
|
38
|
-
}
|
|
39
|
-
&_xxl {
|
|
40
|
-
padding: var(--chips-size-xxl-padding, 6px 12px);
|
|
41
|
-
@mixin text-xxl;
|
|
10
|
+
@each $size in xxl, xl, l, m, s, xs, xxs {
|
|
11
|
+
&_size_$(size) {
|
|
12
|
+
^&__inner {
|
|
13
|
+
min-width: var(--chips-$(size)-min-width);
|
|
14
|
+
min-height: var(--chips-$(size)-min-height);
|
|
15
|
+
padding: var(--chips-$(size)-padding);
|
|
16
|
+
gap: var(--chips-$(size)-gap);
|
|
17
|
+
}
|
|
42
18
|
}
|
|
43
19
|
}
|
|
44
20
|
}
|
|
@@ -47,14 +23,52 @@
|
|
|
47
23
|
&_shape {
|
|
48
24
|
&_rounded {
|
|
49
25
|
border-radius: var(--chips-shape-rounded-default, 6px);
|
|
50
|
-
@each $size in
|
|
51
|
-
|
|
52
|
-
border-radius: var(--chips
|
|
26
|
+
@each $size in xxl, xl, l, m, s, xs, xxs {
|
|
27
|
+
&^^&_size_$(size) {
|
|
28
|
+
border-radius: var(--chips-$(size)-shape-rounded, 6px);
|
|
53
29
|
}
|
|
54
30
|
}
|
|
55
31
|
}
|
|
56
32
|
&_circular {
|
|
57
|
-
border-radius:
|
|
33
|
+
border-radius: 20px;
|
|
58
34
|
}
|
|
59
35
|
}
|
|
60
36
|
}
|
|
37
|
+
|
|
38
|
+
:root {
|
|
39
|
+
/* Size XXL */
|
|
40
|
+
--chips-xxl-gap: 0.5m;
|
|
41
|
+
--chips-xxl-padding: 2m 2m;
|
|
42
|
+
--chips-xxl-min-width: 48px;
|
|
43
|
+
--chips-xxl-min-height: 48px;
|
|
44
|
+
/* Size XL */
|
|
45
|
+
--chips-xl-gap: 0.5m;
|
|
46
|
+
--chips-xl-padding: 1m 1m;
|
|
47
|
+
--chips-xl-min-width: 40px;
|
|
48
|
+
--chips-xl-min-height: 40px;
|
|
49
|
+
/* Size L */
|
|
50
|
+
--chips-l-gap: 0.5m;
|
|
51
|
+
--chips-l-padding: 0.5m 0.5m;
|
|
52
|
+
--chips-l-min-width: 32px;
|
|
53
|
+
--chips-l-min-height: 32px;
|
|
54
|
+
/* Size M */
|
|
55
|
+
--chips-m-gap: 0.5m;
|
|
56
|
+
--chips-m-padding: 0.75m 1.25m;
|
|
57
|
+
--chips-m-min-width: 28px;
|
|
58
|
+
--chips-m-min-height: 28px;
|
|
59
|
+
/* Size S */
|
|
60
|
+
--chips-s-gap: 0.5m;
|
|
61
|
+
--chips-s-padding: 0.25m 0.5m;
|
|
62
|
+
--chips-s-min-width: 24px;
|
|
63
|
+
--chips-s-min-height: 24px;
|
|
64
|
+
/* Size XS */
|
|
65
|
+
--chips-xs-gap: 0.5m;
|
|
66
|
+
--chips-xs-padding: 0.5m 0.5m;
|
|
67
|
+
--chips-xs-min-width: 20px;
|
|
68
|
+
--chips-xs-min-height: 20px;
|
|
69
|
+
/* Size XXS */
|
|
70
|
+
--chips-xxs-gap: 0.5m;
|
|
71
|
+
--chips-xxs-padding: 0.25m 0.25m;
|
|
72
|
+
--chips-xxs-min-width: 16px;
|
|
73
|
+
--chips-xxs-min-height: 16px;
|
|
74
|
+
}
|
|
@@ -1,9 +1,37 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
|
|
3
|
-
--chips-
|
|
4
|
-
--chips-
|
|
5
|
-
--chips-
|
|
6
|
-
--chips-
|
|
7
|
-
|
|
8
|
-
--chips-
|
|
2
|
+
/* Size XXL */
|
|
3
|
+
--chips-xxl-gap: 0.5m;
|
|
4
|
+
--chips-xxl-padding: 2m 2m;
|
|
5
|
+
--chips-xxl-min-width: 48px;
|
|
6
|
+
--chips-xxl-min-height: 48px;
|
|
7
|
+
/* Size XL */
|
|
8
|
+
--chips-xl-gap: 0.5m;
|
|
9
|
+
--chips-xl-padding: 1m 1m;
|
|
10
|
+
--chips-xl-min-width: 40px;
|
|
11
|
+
--chips-xl-min-height: 40px;
|
|
12
|
+
/* Size L */
|
|
13
|
+
--chips-l-gap: 0.5m;
|
|
14
|
+
--chips-l-padding: 0.5m 0.5m;
|
|
15
|
+
--chips-l-min-width: 32px;
|
|
16
|
+
--chips-l-min-height: 32px;
|
|
17
|
+
/* Size M */
|
|
18
|
+
--chips-m-gap: 0.5m;
|
|
19
|
+
--chips-m-padding: 0.75m 1.25m;
|
|
20
|
+
--chips-m-min-width: 28px;
|
|
21
|
+
--chips-m-min-height: 28px;
|
|
22
|
+
/* Size S */
|
|
23
|
+
--chips-s-gap: 0.5m;
|
|
24
|
+
--chips-s-padding: 0.25m 0.5m;
|
|
25
|
+
--chips-s-min-width: 24px;
|
|
26
|
+
--chips-s-min-height: 24px;
|
|
27
|
+
/* Size XS */
|
|
28
|
+
--chips-xs-gap: 0.5m;
|
|
29
|
+
--chips-xs-padding: 0.5m 0.5m;
|
|
30
|
+
--chips-xs-min-width: 20px;
|
|
31
|
+
--chips-xs-min-height: 20px;
|
|
32
|
+
/* Size XXS */
|
|
33
|
+
--chips-xxs-gap: 0.5m;
|
|
34
|
+
--chips-xxs-padding: 0.25m 0.25m;
|
|
35
|
+
--chips-xxs-min-width: 16px;
|
|
36
|
+
--chips-xxs-min-height: 16px;
|
|
9
37
|
}
|
|
@@ -371,3 +371,28 @@
|
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
+
|
|
375
|
+
:root {
|
|
376
|
+
--select-size-xxl-padding: 15px 25px;
|
|
377
|
+
--select-size-xl-padding: 9px 20px;
|
|
378
|
+
--select-size-xs-padding: 0px 8px;
|
|
379
|
+
--select-size-m-padding: 5px 12px;
|
|
380
|
+
--select-size-s-padding: 0 4px;
|
|
381
|
+
--select-size-l-padding: 7px 15px;
|
|
382
|
+
|
|
383
|
+
--select-menu-border-radius: 12px;
|
|
384
|
+
--select-menu-margin: 0;
|
|
385
|
+
|
|
386
|
+
--select-multi-value-padding: 2px 6px;
|
|
387
|
+
|
|
388
|
+
--select-control-shape-rounded: 8px;
|
|
389
|
+
|
|
390
|
+
--select-success-border: var(--color-surface-border-tertiary);
|
|
391
|
+
|
|
392
|
+
--select-menu-list-item-size-xxl-padding: 18px 25px;
|
|
393
|
+
--select-menu-list-item-size-xl-padding: 14px 20px;
|
|
394
|
+
--select-menu-list-item-size-l-padding: 10px 12px;
|
|
395
|
+
--select-menu-list-item-size-m-padding: 8px 12px;
|
|
396
|
+
--select-menu-list-item-size-s-padding: 6px 10px;
|
|
397
|
+
--select-menu-list-item-size-xs-padding: 2px 8px;
|
|
398
|
+
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
:root {
|
|
2
|
+
--select-size-xxl-padding: 15px 25px;
|
|
3
|
+
--select-size-xl-padding: 9px 20px;
|
|
2
4
|
--select-size-xs-padding: 0px 8px;
|
|
3
|
-
--select-size-s-padding: 3px 10px;
|
|
4
5
|
--select-size-m-padding: 5px 12px;
|
|
6
|
+
--select-size-s-padding: 0 4px;
|
|
5
7
|
--select-size-l-padding: 7px 15px;
|
|
6
|
-
--select-size-xl-padding: 11px 20px;
|
|
7
|
-
--select-size-xxl-padding: 15px 25px;
|
|
8
|
-
|
|
9
|
-
--select-size-tiny-padding: 0px 8px;
|
|
10
|
-
--select-size-compact-padding: 3px 10px;
|
|
11
|
-
--select-size-normal-padding: 5px 12px;
|
|
12
|
-
--select-size-large-padding: 7px 15px;
|
|
13
8
|
|
|
14
9
|
--select-menu-border-radius: 12px;
|
|
15
10
|
--select-menu-margin: 0;
|
|
@@ -20,10 +15,10 @@
|
|
|
20
15
|
|
|
21
16
|
--select-success-border: var(--color-surface-border-tertiary);
|
|
22
17
|
|
|
23
|
-
--select-menu-list-item-size-xs-padding: 2px 8px;
|
|
24
|
-
--select-menu-list-item-size-s-padding: 6px 10px;
|
|
25
|
-
--select-menu-list-item-size-m-padding: 8px 12px;
|
|
26
|
-
--select-menu-list-item-size-l-padding: 10px 12px;
|
|
27
|
-
--select-menu-list-item-size-xl-padding: 14px 20px;
|
|
28
18
|
--select-menu-list-item-size-xxl-padding: 18px 25px;
|
|
19
|
+
--select-menu-list-item-size-xl-padding: 14px 20px;
|
|
20
|
+
--select-menu-list-item-size-l-padding: 10px 12px;
|
|
21
|
+
--select-menu-list-item-size-m-padding: 8px 12px;
|
|
22
|
+
--select-menu-list-item-size-s-padding: 6px 10px;
|
|
23
|
+
--select-menu-list-item-size-xs-padding: 2px 8px;
|
|
29
24
|
}
|
|
@@ -111,6 +111,7 @@ function useDevicePropsGenerator(componentProps, appearanceConfig) {
|
|
|
111
111
|
},
|
|
112
112
|
};
|
|
113
113
|
return new Proxy(propsGenerator, generatorProxyHandler);
|
|
114
|
+
// TODO: componentProps(react) and appearanceConfig(not memoized) is always new. maybe better check Object.values?
|
|
114
115
|
}, [componentProps, appearanceConfig, deviceCurrentMainType]);
|
|
115
116
|
return devicePropsGenerator;
|
|
116
117
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/blocks'
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as TitleStories from '../stories/Title.stories.tsx'
|
|
4
4
|
|
|
5
|
-
<Meta title="Atoms /
|
|
5
|
+
<Meta title="Atoms / Title / Overview" />
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Title
|
|
8
8
|
|
|
9
|
-
`
|
|
9
|
+
`Title` отображает заголовки.
|
|
10
10
|
|
|
11
|
-
<Story of={
|
|
11
|
+
<Story of={TitleStories.SizeH3} />
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta } from '@storybook/blocks'
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as TitleStories from '../stories/Title.stories.tsx'
|
|
4
4
|
|
|
5
|
-
<Meta title="Atoms /
|
|
5
|
+
<Meta title="Atoms / Title / Playground" />
|
|
6
6
|
|
|
7
7
|
# Playground
|
|
8
8
|
|
|
9
|
-
<Canvas sourceState="shown" of={
|
|
10
|
-
<Controls of={
|
|
9
|
+
<Canvas sourceState="shown" of={TitleStories.SizeH4} />
|
|
10
|
+
<Controls of={TitleStories.SizeH4} />
|
package/package.json
CHANGED
package/dist/Group-BKJmVwPZ.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
|
-
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
6
|
-
|
|
7
|
-
var groupAppearance = {
|
|
8
|
-
dev: {
|
|
9
|
-
borderWidth: 1,
|
|
10
|
-
borderColor: 'surfaceBorderPrimary',
|
|
11
|
-
direction: 'horizontal',
|
|
12
|
-
fill: 'surfacePrimary',
|
|
13
|
-
fillHover: 'surfacePrimaryHover',
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var groupConfig = {
|
|
18
|
-
appearance: groupAppearance,
|
|
19
|
-
setAppearance: function (newComponent) {
|
|
20
|
-
groupConfig.appearance = newComponent;
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
var Group = React.forwardRef(function Group(props, ref) {
|
|
24
|
-
var id = props.id, children = props.children, appearance = props.appearance, className = props.className, dataTestId = props.dataTestId, dataTour = props.dataTour, horizontalScroll = props.horizontalScroll, htmlFor = props.htmlFor, name = props.name, set = props.set, style = props.style, _a = props.tag, Tag = _a === void 0 ? 'div' : _a, onClick = props.onClick;
|
|
25
|
-
// @ts-expect-error
|
|
26
|
-
var appearanceConfig = groupConfig.appearance && groupConfig.appearance[appearance];
|
|
27
|
-
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
28
|
-
var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, columnsClass = propsGenerator.columnsClass, contentAlignClass = propsGenerator.contentAlignClass, directionClass = propsGenerator.directionClass, elevationClass = propsGenerator.elevationClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, flexGrowClass = propsGenerator.flexGrowClass, heightClass = propsGenerator.heightClass, iconFillHoverClass = propsGenerator.iconFillHoverClass, justifyContentClass = propsGenerator.justifyContentClass, shapeClass = propsGenerator.shapeClass, stackingClass = propsGenerator.stackingClass, textColorActiveClass = propsGenerator.textColorActiveClass, textColorClass = propsGenerator.textColorClass, textColorHoverClass = propsGenerator.textColorHoverClass, widthClass = propsGenerator.widthClass, wrapClass = propsGenerator.wrapClass;
|
|
29
|
-
// @ts-expect-error
|
|
30
|
-
var _b = useStyles(props), groupStyles = _b.styles, groupWrapperStyles = _b.wrapper;
|
|
31
|
-
return (jsx(Tag, { className: clsx(className, 'group', widthClass && "width_".concat(widthClass), heightClass && "height_".concat(heightClass), columnsClass && "group_columns_".concat(columnsClass), contentAlignClass && "group_content-align_".concat(contentAlignClass), alignDirectionClass && "align_".concat(alignDirectionClass), directionClass && "group_direction_".concat(directionClass), alignClass && "align_".concat(alignClass), textColorClass && "group_text-color_".concat(textColorClass), textColorActiveClass && "group_text-color_active_".concat(textColorActiveClass), textColorHoverClass && "group_text-color_hover_".concat(textColorHoverClass), iconFillHoverClass && "group_icon_fill_hover_".concat(iconFillHoverClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), set && "group_set_".concat(set), horizontalScroll && 'group_type_horizontal_scroll', stackingClass && "group_stacking_".concat(stackingClass), wrapClass && "group_wrap_".concat(wrapClass), flexGrowClass && "flex-grow_".concat(flexGrowClass), shapeClass && "group_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass), elevationClass && "elevation_".concat(elevationClass), justifyContentClass && "justify-content_".concat(justifyContentClass), onClick && 'cursor_type_pointer'), ref: ref, name: name, "data-testid": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, id: id, style: Object.assign({}, groupStyles, style), onClick: onClick, children: horizontalScroll ? (jsx("div", { className: "group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export { Group as G, groupAppearance as a, groupConfig as g };
|
package/dist/Group-Bkz3RO18.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var clsx = require('clsx');
|
|
6
|
-
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
7
|
-
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
8
|
-
|
|
9
|
-
var groupAppearance = {
|
|
10
|
-
dev: {
|
|
11
|
-
borderWidth: 1,
|
|
12
|
-
borderColor: 'surfaceBorderPrimary',
|
|
13
|
-
direction: 'horizontal',
|
|
14
|
-
fill: 'surfacePrimary',
|
|
15
|
-
fillHover: 'surfacePrimaryHover',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
var groupConfig = {
|
|
20
|
-
appearance: groupAppearance,
|
|
21
|
-
setAppearance: function (newComponent) {
|
|
22
|
-
groupConfig.appearance = newComponent;
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
var Group = React.forwardRef(function Group(props, ref) {
|
|
26
|
-
var id = props.id, children = props.children, appearance = props.appearance, className = props.className, dataTestId = props.dataTestId, dataTour = props.dataTour, horizontalScroll = props.horizontalScroll, htmlFor = props.htmlFor, name = props.name, set = props.set, style = props.style, _a = props.tag, Tag = _a === void 0 ? 'div' : _a, onClick = props.onClick;
|
|
27
|
-
// @ts-expect-error
|
|
28
|
-
var appearanceConfig = groupConfig.appearance && groupConfig.appearance[appearance];
|
|
29
|
-
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
30
|
-
var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, columnsClass = propsGenerator.columnsClass, contentAlignClass = propsGenerator.contentAlignClass, directionClass = propsGenerator.directionClass, elevationClass = propsGenerator.elevationClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, flexGrowClass = propsGenerator.flexGrowClass, heightClass = propsGenerator.heightClass, iconFillHoverClass = propsGenerator.iconFillHoverClass, justifyContentClass = propsGenerator.justifyContentClass, shapeClass = propsGenerator.shapeClass, stackingClass = propsGenerator.stackingClass, textColorActiveClass = propsGenerator.textColorActiveClass, textColorClass = propsGenerator.textColorClass, textColorHoverClass = propsGenerator.textColorHoverClass, widthClass = propsGenerator.widthClass, wrapClass = propsGenerator.wrapClass;
|
|
31
|
-
// @ts-expect-error
|
|
32
|
-
var _b = useStyles.useStyles(props), groupStyles = _b.styles, groupWrapperStyles = _b.wrapper;
|
|
33
|
-
return (jsxRuntime.jsx(Tag, { className: clsx(className, 'group', widthClass && "width_".concat(widthClass), heightClass && "height_".concat(heightClass), columnsClass && "group_columns_".concat(columnsClass), contentAlignClass && "group_content-align_".concat(contentAlignClass), alignDirectionClass && "align_".concat(alignDirectionClass), directionClass && "group_direction_".concat(directionClass), alignClass && "align_".concat(alignClass), textColorClass && "group_text-color_".concat(textColorClass), textColorActiveClass && "group_text-color_active_".concat(textColorActiveClass), textColorHoverClass && "group_text-color_hover_".concat(textColorHoverClass), iconFillHoverClass && "group_icon_fill_hover_".concat(iconFillHoverClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), set && "group_set_".concat(set), horizontalScroll && 'group_type_horizontal_scroll', stackingClass && "group_stacking_".concat(stackingClass), wrapClass && "group_wrap_".concat(wrapClass), flexGrowClass && "flex-grow_".concat(flexGrowClass), shapeClass && "group_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass), elevationClass && "elevation_".concat(elevationClass), justifyContentClass && "justify-content_".concat(justifyContentClass), onClick && 'cursor_type_pointer'), ref: ref, name: name, "data-testid": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, id: id, style: Object.assign({}, groupStyles, style), onClick: onClick, children: horizontalScroll ? (jsxRuntime.jsx("div", { className: "group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
exports.Group = Group;
|
|
37
|
-
exports.groupAppearance = groupAppearance;
|
|
38
|
-
exports.groupConfig = groupConfig;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
.column-gap {
|
|
2
|
-
@each $val in 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200 {
|
|
3
|
-
&_$(val) {
|
|
4
|
-
column-gap: $(val)px;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
.row-gap {
|
|
2
|
-
@each $val in 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200 {
|
|
3
|
-
&_$(val) {
|
|
4
|
-
row-gap: $(val)px;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
}
|