@itcase/ui 1.3.32 → 1.3.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{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/components/Tab.js +61 -63
- 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/components/Tab.js +61 -63
- package/dist/css/components/Accordion/Accordion.css +5 -8
- package/dist/css/components/Accordion/Accordion.tokens.css +2 -1
- package/dist/css/components/Avatar/Avatar.css +4 -0
- package/dist/css/components/Avatar/Avatar.tokens.css +2 -0
- package/dist/css/components/Checkbox/Checkbox.css +4 -0
- package/dist/css/components/Checkbox/Checkbox.tokens.css +1 -1
- package/dist/css/components/Chips/Chips.css +50 -36
- package/dist/css/components/Chips/Chips.tokens.css +35 -7
- package/dist/css/components/Choice/Choice.css +13 -2
- package/dist/css/components/Choice/Choice.tokens.css +4 -3
- package/dist/css/components/DatePicker/DatePicker.css +51 -0
- package/dist/css/components/DatePicker/DatePicker.tokens.css +15 -7
- package/dist/css/components/Divider/Divider.css +19 -6
- package/dist/css/components/Divider/Divider.tokens.css +12 -11
- package/dist/css/components/Dot/Dot.css +10 -0
- package/dist/css/components/Drawer/Drawer.css +4 -0
- package/dist/css/components/Drawer/Drawer.tokens.css +4 -0
- package/dist/css/components/Dropdown/Dropdown.css +37 -0
- package/dist/css/components/Dropdown/Dropdown.tokens.css +6 -0
- package/dist/css/components/Icon/Icon.css +5 -0
- package/dist/css/components/Icon/Icon.tokens.css +1 -0
- package/dist/css/components/Input/Input.css +29 -0
- package/dist/css/components/InputPassword/InputPassword.css +23 -0
- package/dist/css/components/Label/Label.css +19 -0
- package/dist/css/components/Label/Label.tokens.css +3 -3
- package/dist/css/components/Logo/Logo.tokens.css +17 -2
- package/dist/css/components/MenuItem/MenuItem.tokens.css +4 -4
- package/dist/css/components/Modal/Modal.css +3 -0
- package/dist/css/components/Modal/Modal.tokens.css +3 -0
- package/dist/css/components/Pagination/Pagination.css +25 -0
- package/dist/css/components/Search/Search.css +16 -0
- package/dist/css/components/Search/Search.tokens.css +6 -3
- package/dist/css/components/Segmented/Segmented.css +6 -0
- package/dist/css/components/Segmented/Segmented.tokens.css +2 -0
- package/dist/css/components/Select/Select.css +35 -8
- package/dist/css/components/Select/Select.tokens.css +12 -17
- package/dist/css/components/Select/css/__control/select__control_fill.css +4 -2
- package/dist/css/components/Select/css/__menu/select__menu-list-item_size.css +1 -1
- package/dist/css/components/Tab/Tab.css +28 -0
- package/dist/css/components/Textarea/Textarea.css +7 -0
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +1 -0
- package/package.json +2 -2
- 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');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var tslib_es6 = require('../../tslib.es6-CCZ3TN_7.js');
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var clsx = require('clsx');
|
|
@@ -9,7 +10,6 @@ var Badge = require('../../Badge-BX4N91_C.js');
|
|
|
9
10
|
var Divider = require('../../Divider-ImOOytuN.js');
|
|
10
11
|
var Link = require('../../Link-B38Hn4G2.js');
|
|
11
12
|
var Text = require('../../Text-C49zj3jO.js');
|
|
12
|
-
require('../../tslib.es6-CCZ3TN_7.js');
|
|
13
13
|
require('lodash/camelCase');
|
|
14
14
|
require('lodash/castArray');
|
|
15
15
|
require('lodash/upperFirst');
|
|
@@ -25,134 +25,132 @@ require('../../Tooltip-DpBQQoNo.js');
|
|
|
25
25
|
require('../../Title-BWWyRwLY.js');
|
|
26
26
|
|
|
27
27
|
var tabAppearance = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
accent: {
|
|
29
|
+
fill: 'accentPrimary',
|
|
30
|
+
fillHover: 'accentPrimaryHover',
|
|
31
|
+
labelColor: 'accentTextPrimary',
|
|
32
|
+
labelColorActive: 'accentTextPrimary',
|
|
31
33
|
dividerFillDisabled: 'accentDisabled',
|
|
32
|
-
dividerFillHover: 'surfaceTertiary',
|
|
33
|
-
fill: 'surfacePrimary',
|
|
34
34
|
fillDisabled: 'surfaceDisabled',
|
|
35
|
-
fillHover: 'surfaceTertiary',
|
|
36
|
-
labelColor: 'surfaceTextPrimary',
|
|
37
|
-
labelColorActive: 'surfaceTextAccent',
|
|
38
35
|
labelColorDisabled: 'surfaceTextDisabled',
|
|
36
|
+
dividerFill: 'surfaceTertiary',
|
|
37
|
+
dividerFillActive: 'surfacePrimary',
|
|
38
|
+
dividerFillHover: 'surfaceTertiary',
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
primary: {
|
|
41
|
+
fill: 'primaryPrimary',
|
|
42
|
+
fillHover: 'primaryPrimaryHover',
|
|
43
|
+
labelColor: 'primaryTextPrimary',
|
|
44
|
+
labelColorActive: 'primaryTextPrimary',
|
|
45
|
+
dividerFillDisabled: 'accentDisabled',
|
|
46
|
+
fillDisabled: 'surfaceDisabled',
|
|
47
|
+
labelColorDisabled: 'surfaceTextDisabled',
|
|
41
48
|
dividerFill: 'surfaceTertiary',
|
|
42
49
|
dividerFillActive: 'accentPrimary',
|
|
50
|
+
dividerFillHover: 'surfaceTertiary',
|
|
51
|
+
},
|
|
52
|
+
secondary: {
|
|
53
|
+
fill: 'secondaryPrimary',
|
|
54
|
+
fillHover: 'secondaryPrimaryHover',
|
|
55
|
+
labelColor: 'secondaryTextPrimary',
|
|
56
|
+
labelColorActive: 'secondaryTextPrimary',
|
|
43
57
|
dividerFillDisabled: 'accentDisabled',
|
|
58
|
+
fillDisabled: 'surfaceDisabled',
|
|
59
|
+
labelColorDisabled: 'surfaceTextDisabled',
|
|
60
|
+
dividerFill: 'surfaceTertiary',
|
|
61
|
+
dividerFillActive: 'accentPrimary',
|
|
44
62
|
dividerFillHover: 'surfaceTertiary',
|
|
63
|
+
},
|
|
64
|
+
surfacePrimary: {
|
|
45
65
|
fill: 'surfacePrimary',
|
|
46
|
-
fillDisabled: 'surfaceDisabled',
|
|
47
66
|
fillHover: 'surfacePrimaryHover',
|
|
48
67
|
labelColor: 'surfaceTextPrimary',
|
|
49
68
|
labelColorActive: 'surfaceTextAccent',
|
|
69
|
+
dividerFillDisabled: 'accentDisabled',
|
|
70
|
+
fillDisabled: 'surfaceDisabled',
|
|
50
71
|
labelColorDisabled: 'surfaceTextDisabled',
|
|
51
|
-
},
|
|
52
|
-
surfaceSecondary: {
|
|
53
72
|
dividerFill: 'surfaceTertiary',
|
|
54
73
|
dividerFillActive: 'accentPrimary',
|
|
55
|
-
dividerFillDisabled: 'accentDisabled',
|
|
56
74
|
dividerFillHover: 'surfaceTertiary',
|
|
75
|
+
},
|
|
76
|
+
surfaceSecondary: {
|
|
57
77
|
fill: 'surfaceSecondary',
|
|
58
|
-
fillDisabled: 'surfaceDisabled',
|
|
59
78
|
fillHover: 'surfaceSecondaryHover',
|
|
60
79
|
labelColor: 'surfaceTextPrimary',
|
|
61
80
|
labelColorActive: 'surfaceTextAccent',
|
|
81
|
+
dividerFillDisabled: 'accentDisabled',
|
|
82
|
+
fillDisabled: 'surfaceDisabled',
|
|
62
83
|
labelColorDisabled: 'surfaceTextDisabled',
|
|
63
|
-
},
|
|
64
|
-
surfaceTertiary: {
|
|
65
84
|
dividerFill: 'surfaceTertiary',
|
|
66
85
|
dividerFillActive: 'accentPrimary',
|
|
67
|
-
dividerFillDisabled: 'accentDisabled',
|
|
68
86
|
dividerFillHover: 'surfaceTertiary',
|
|
87
|
+
},
|
|
88
|
+
surfaceTertiary: {
|
|
69
89
|
fill: 'surfaceTertiary',
|
|
70
|
-
fillDisabled: 'surfaceDisabled',
|
|
71
90
|
fillHover: 'surfaceTertiaryHover',
|
|
72
91
|
labelColor: 'surfaceTextPrimary',
|
|
73
92
|
labelColorActive: 'surfaceTextAccent',
|
|
93
|
+
dividerFillDisabled: 'accentDisabled',
|
|
94
|
+
fillDisabled: 'surfaceDisabled',
|
|
74
95
|
labelColorDisabled: 'surfaceTextDisabled',
|
|
75
|
-
},
|
|
76
|
-
surfaceQuaternary: {
|
|
77
96
|
dividerFill: 'surfaceTertiary',
|
|
78
97
|
dividerFillActive: 'accentPrimary',
|
|
79
|
-
dividerFillDisabled: 'accentDisabled',
|
|
80
98
|
dividerFillHover: 'surfaceTertiary',
|
|
99
|
+
},
|
|
100
|
+
surfaceQuaternary: {
|
|
81
101
|
fill: 'surfaceQuaternary',
|
|
82
|
-
fillDisabled: 'surfaceDisabled',
|
|
83
102
|
fillHover: 'surfaceTertiaryHover',
|
|
84
103
|
labelColor: 'surfaceTextInverse',
|
|
85
104
|
labelColorActive: 'surfaceTextInverse',
|
|
86
|
-
labelColorDisabled: 'surfaceTextDisabled',
|
|
87
|
-
},
|
|
88
|
-
accent: {
|
|
89
|
-
dividerFill: 'surfaceTertiary',
|
|
90
|
-
dividerFillActive: 'surfacePrimary',
|
|
91
105
|
dividerFillDisabled: 'accentDisabled',
|
|
92
|
-
dividerFillHover: 'surfaceTertiary',
|
|
93
|
-
fill: 'accentPrimary',
|
|
94
106
|
fillDisabled: 'surfaceDisabled',
|
|
95
|
-
fillHover: 'accentPrimaryHover',
|
|
96
|
-
labelColor: 'accentTextPrimary',
|
|
97
|
-
labelColorActive: 'accentTextPrimary',
|
|
98
107
|
labelColorDisabled: 'surfaceTextDisabled',
|
|
99
|
-
},
|
|
100
|
-
primary: {
|
|
101
108
|
dividerFill: 'surfaceTertiary',
|
|
102
109
|
dividerFillActive: 'accentPrimary',
|
|
103
|
-
dividerFillDisabled: 'accentDisabled',
|
|
104
110
|
dividerFillHover: 'surfaceTertiary',
|
|
105
|
-
|
|
111
|
+
},
|
|
112
|
+
any: {
|
|
113
|
+
fill: 'surfacePrimary',
|
|
114
|
+
fillHover: 'surfaceTertiary',
|
|
115
|
+
labelColor: 'surfaceTextPrimary',
|
|
116
|
+
labelColorActive: 'surfaceTextAccent',
|
|
117
|
+
dividerFillDisabled: 'accentDisabled',
|
|
106
118
|
fillDisabled: 'surfaceDisabled',
|
|
107
|
-
fillHover: 'primaryPrimaryHover',
|
|
108
|
-
labelColor: 'primaryTextPrimary',
|
|
109
|
-
labelColorActive: 'primaryTextPrimary',
|
|
110
119
|
labelColorDisabled: 'surfaceTextDisabled',
|
|
111
|
-
},
|
|
112
|
-
secondary: {
|
|
113
120
|
dividerFill: 'surfaceTertiary',
|
|
114
121
|
dividerFillActive: 'accentPrimary',
|
|
115
|
-
dividerFillDisabled: 'accentDisabled',
|
|
116
122
|
dividerFillHover: 'surfaceTertiary',
|
|
117
|
-
fill: 'secondaryPrimary',
|
|
118
|
-
fillDisabled: 'surfaceDisabled',
|
|
119
|
-
fillHover: 'secondaryPrimaryHover',
|
|
120
|
-
labelColor: 'secondaryTextPrimary',
|
|
121
|
-
labelColorActive: 'secondaryTextPrimary',
|
|
122
|
-
labelColorDisabled: 'surfaceTextDisabled',
|
|
123
123
|
},
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
var tabConfig = {
|
|
127
127
|
appearance: tabAppearance,
|
|
128
|
-
setAppearance: function (
|
|
129
|
-
tabConfig.appearance =
|
|
128
|
+
setAppearance: function (appearanceConfig) {
|
|
129
|
+
tabConfig.appearance = appearanceConfig;
|
|
130
130
|
},
|
|
131
131
|
};
|
|
132
132
|
function Tab(props) {
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
var className = props.className, appearance = props.appearance, children = props.children, label = props.label, badgeValue = props.badgeValue, dataTour = props.dataTour, href = props.href, link = props.link, rel = props.rel, reset = props.reset, target = props.target, before = props.before, after = props.after, _a = props.isActive, isActive = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isHover, isHover = _c === void 0 ? false : _c, set = props.set, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
134
|
+
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultAppearance, appearance) {
|
|
135
|
+
var _a;
|
|
136
|
+
return (tslib_es6.__assign(tslib_es6.__assign({}, resultAppearance), (_a = tabConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearance]));
|
|
137
|
+
}, {});
|
|
136
138
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
137
|
-
var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass,
|
|
139
|
+
var justifyContentClass = propsGenerator.justifyContentClass, alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, labelColor = propsGenerator.labelColor, labelColorActive = propsGenerator.labelColorActive, labelTextAlign = propsGenerator.labelTextAlign, labelTextColorHover = propsGenerator.labelTextColorHover, labelTextGradient = propsGenerator.labelTextGradient, labelTextSize = propsGenerator.labelTextSize, labelTextStyle = propsGenerator.labelTextStyle, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, dividerFillDisabled = propsGenerator.dividerFillDisabled, fillDisabledClass = propsGenerator.fillDisabledClass, labelColorDisabled = propsGenerator.labelColorDisabled, badgeAppearance = propsGenerator.badgeAppearance, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, dividerDirection = propsGenerator.dividerDirection, dividerFill = propsGenerator.dividerFill, dividerFillActive = propsGenerator.dividerFillActive, dividerFillActiveHover = propsGenerator.dividerFillActiveHover, dividerFillHover = propsGenerator.dividerFillHover, dividerSize = propsGenerator.dividerSize, linkFill = propsGenerator.linkFill, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, typeClass = propsGenerator.typeClass, widthClass = propsGenerator.widthClass;
|
|
138
140
|
// @ts-expect-error
|
|
139
141
|
var tab = useStyles.useStyles(props).styles;
|
|
140
142
|
return (jsxRuntime.jsx("div", { className: clsx('tab', isActive && 'tab_state_active', isDisabled && 'tab_state_disabled', isHover && 'tab_state_hover', !isDisabled
|
|
141
143
|
? fillClass && "fill_".concat(fillClass)
|
|
142
|
-
: fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), !isDisabled ? fillHoverClass && "fill_hover_".concat(fillHoverClass) : null, className, sizeClass && "tab_size_".concat(sizeClass), fillActiveClass && "fill_active_".concat(fillActiveClass), fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), shapeClass && "tab_shape_".concat(shapeClass), typeClass && "tab_type_".concat(typeClass), widthClass && "width_".concat(widthClass), reset && 'tab-reset', set && "tab_set_".concat(set), justifyContentClass && "tab_justify-content_".concat(justifyContentClass), onClick && 'cursor_type_pointer'), "data-tour": dataTour, style: tab, onClick: onClick, onMouseEnter: onMouseEnter, children: jsxRuntime.jsx(Link.Link, { className: clsx('tab__link', alignDirectionClass && "align_".concat(alignDirectionClass), alignClass && "align_".concat(alignClass)), fill: linkFill, href: link || href, rel: rel, target: target, children: jsxRuntime.jsxs(React.Fragment, { children: [before, children || (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("div", { className: "tab__wrapper", children: [
|
|
143
|
-
? labelColorDisabled || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelColorDisabled)
|
|
144
|
-
: labelColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelColor), textColorActive: isActive && (labelColorActive || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelColorActive)), children: label || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.label) })), (badgeValue || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.badgeValue)) && (jsxRuntime.jsx(Badge.Badge, { appearance: badgeAppearance || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.badgeAppearance), shape: badgeShape, size: badgeSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.badgeSize), textColor: badgeTextColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.badgeTextColor), textSize: badgeTextSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.badgeTextSize), value: badgeValue || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.badgeValue) }))] }), jsxRuntime.jsx(Divider.Divider, { width: "fill", fill: isDisabled
|
|
145
|
-
? dividerFillDisabled || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.dividerFillDisabled)
|
|
146
|
-
: dividerFill || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.dividerFill), fillHover: isHover && (dividerFillHover || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.dividerFillHover)), direction: dividerDirection, fillActive: isActive && (dividerFillActive || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.dividerFillActive)), fillActiveHover: dividerFillActiveHover, size: dividerSize })] })), after] }) }) }));
|
|
144
|
+
: fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), !isDisabled ? fillHoverClass && "fill_hover_".concat(fillHoverClass) : null, className, sizeClass && "tab_size_".concat(sizeClass), fillActiveClass && "fill_active_".concat(fillActiveClass), fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), shapeClass && "tab_shape_".concat(shapeClass), typeClass && "tab_type_".concat(typeClass), widthClass && "width_".concat(widthClass), reset && 'tab-reset', set && "tab_set_".concat(set), justifyContentClass && "tab_justify-content_".concat(justifyContentClass), onClick && 'cursor_type_pointer'), "data-tour": dataTour, style: tab, onClick: onClick, onMouseEnter: onMouseEnter, children: jsxRuntime.jsx(Link.Link, { className: clsx('tab__link', alignDirectionClass && "align_".concat(alignDirectionClass), alignClass && "align_".concat(alignClass)), fill: linkFill, href: link || href, rel: rel, target: target, children: jsxRuntime.jsxs(React.Fragment, { children: [before, children || (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("div", { className: "tab__wrapper", children: [label && (jsxRuntime.jsx(Text.Text, { className: "tab__label", textAlign: labelTextAlign, textColor: isDisabled ? labelColorDisabled : labelColor, textColorActive: isActive && labelColorActive, textColorGradient: labelTextGradient, textColorHover: labelTextColorHover, textStyle: labelTextStyle, textWeight: labelTextWeight, textWrap: labelTextWrap, size: labelTextSize, children: label })), badgeValue && (jsxRuntime.jsx(Badge.Badge, { appearance: badgeAppearance, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, size: badgeSize, value: badgeValue }))] }), jsxRuntime.jsx(Divider.Divider, { width: "fill", direction: dividerDirection, fill: isDisabled ? dividerFillDisabled : dividerFill, fillActive: isActive && dividerFillActive, fillActiveHover: dividerFillActiveHover, fillHover: isHover && dividerFillHover, size: dividerSize })] })), after] }) }) }));
|
|
147
145
|
}
|
|
148
146
|
|
|
149
147
|
function TabGroup(props) {
|
|
150
|
-
var id = props.id,
|
|
148
|
+
var id = props.id, className = props.className, children = props.children, dataTour = props.dataTour, horizontalScroll = props.horizontalScroll, style = props.style, set = props.set;
|
|
151
149
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
152
|
-
var
|
|
150
|
+
var directionClass = propsGenerator.directionClass, alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillClass = propsGenerator.fillClass, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, contentAlignClass = propsGenerator.contentAlignClass, widthClass = propsGenerator.widthClass, wrapClass = propsGenerator.wrapClass;
|
|
153
151
|
// @ts-expect-error
|
|
154
152
|
var _a = useStyles.useStyles(props), groupStyles = _a.styles, groupWrapperStyles = _a.wrapper;
|
|
155
|
-
return (jsxRuntime.jsx("div", { className: clsx(className, 'tab-group', 'group', widthClass && "width_".concat(widthClass), contentAlignClass && "group_content-align_".concat(contentAlignClass), alignDirectionClass && "align_".concat(alignDirectionClass), directionClass && "group_direction_".concat(directionClass), alignClass && "align_".concat(alignClass), fillClass && "fill_".concat(fillClass), set && "group_set_".concat(set), horizontalScroll && 'group_type_horizontal_scroll', wrapClass && "group_wrap_".concat(wrapClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass)), "data-tour": dataTour,
|
|
153
|
+
return (jsxRuntime.jsx("div", { id: id, className: clsx(className, 'tab-group', 'group', widthClass && "width_".concat(widthClass), contentAlignClass && "group_content-align_".concat(contentAlignClass), alignDirectionClass && "align_".concat(alignDirectionClass), directionClass && "group_direction_".concat(directionClass), alignClass && "align_".concat(alignClass), fillClass && "fill_".concat(fillClass), set && "group_set_".concat(set), horizontalScroll && 'group_type_horizontal_scroll', wrapClass && "group_wrap_".concat(wrapClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass)), "data-tour": dataTour, style: Object.assign({}, groupStyles, style), children: horizontalScroll ? (jsxRuntime.jsx("div", { className: "tab-group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
|
|
156
154
|
}
|
|
157
155
|
|
|
158
156
|
exports.Tab = Tab;
|
|
@@ -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
|
}
|