@itcase/ui 1.2.19 → 1.2.21
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/cjs/components/Accordion.js +3 -2
- package/dist/cjs/components/Choice.js +1 -1
- package/dist/cjs/components/InputPassword.js +6 -6
- package/dist/cjs/components/Radio.js +85 -8
- package/dist/cjs/components/Switch.js +12 -8
- package/dist/cjs/components/Tile.js +3 -3
- package/dist/cjs/constants/componentProps/textColor.js +1 -1
- package/dist/cjs/constants/componentProps/textColorHover.js +1 -1
- package/dist/components/Accordion.js +3 -2
- package/dist/components/Choice.js +1 -1
- package/dist/components/InputPassword.js +6 -6
- package/dist/components/Radio.js +86 -5
- package/dist/components/Switch.js +12 -4
- package/dist/components/Tile.js +3 -3
- package/dist/constants/componentProps/textColor.js +1 -1
- package/dist/constants/componentProps/textColorHover.js +1 -1
- package/dist/css/components/Accordion/Accordion.css +1 -0
- package/dist/css/components/DatePicker/DatePicker.css +12 -12
- package/dist/css/components/Icon/Icon.css +4 -2
- package/dist/css/mixins/mixin_elevation.css +0 -2
- package/dist/css/mixins/mixin_typography.css +104 -84
- package/dist/css/mixins/mixin_utils.css +1 -1
- package/dist/css/styles/border-color/border-color.css +4 -2
- package/dist/css/styles/text-gradient/text-gradient.css +9 -4
- package/dist/css/tokens/colors.css +105 -0
- package/dist/css/tokens/elevation.css +10 -0
- package/dist/css/tokens/settings.css +31 -0
- package/dist/css/tokens/typography.css +127 -0
- package/dist/stories/Accordion.mdx +11 -0
- package/dist/stories/Accordion.stories.js +49 -32
- package/dist/stories/AccordionItem.mdx +15 -0
- package/dist/stories/AccordionItem.stories.js +69 -69
- package/dist/stories/AlignContent.mdx +85 -0
- package/dist/stories/AlignItems.mdx +74 -0
- package/dist/stories/AlignItems.stories.js +88 -0
- package/dist/stories/AlignSelf.mdx +85 -0
- package/dist/stories/AlignSelf.stories.js +101 -0
- package/dist/stories/Appearance.mdx +24 -9
- package/dist/stories/Appearance.stories.js +77 -23
- package/dist/stories/Avatar.mdx +23 -0
- package/dist/stories/Avatar.stories.js +69 -64
- package/dist/stories/Badge.mdx +20 -0
- package/dist/stories/Badge.stories.js +43 -44
- package/dist/stories/Button.mdx +48 -0
- package/dist/stories/Button.stories.js +26 -186
- package/dist/stories/Cell.mdx +23 -0
- package/dist/stories/Cell.stories.js +119 -119
- package/dist/stories/Checkbox.mdx +24 -0
- package/dist/stories/Checkbox.stories.js +42 -34
- package/dist/stories/Chips.mdx +31 -0
- package/dist/stories/Chips.stories.js +22 -67
- package/dist/stories/Choice.mdx +11 -0
- package/dist/stories/Choice.stories.js +59 -61
- package/dist/stories/Code.mdx +11 -0
- package/dist/stories/Code.stories.js +37 -40
- package/dist/stories/Columns.mdx +51 -0
- package/dist/stories/Columns.stories.js +80 -0
- package/dist/stories/DatePicker.mdx +31 -0
- package/dist/stories/DatePicker.stories.js +58 -59
- package/dist/stories/Dev.mdx +9 -0
- package/dist/stories/DevMode.mdx +8 -0
- package/dist/stories/Direction.mdx +84 -0
- package/dist/stories/Direction.stories.js +93 -0
- package/dist/stories/Divider.mdx +35 -0
- package/dist/stories/Divider.stories.js +28 -29
- package/dist/stories/Dot.mdx +19 -0
- package/dist/stories/Dot.stories.js +38 -39
- package/dist/stories/Drawer.mdx +11 -0
- package/dist/stories/Drawer.stories.js +75 -0
- package/dist/stories/Dropdown.mdx +12 -0
- package/dist/stories/Dropdown.stories.js +30 -29
- package/dist/stories/DropdownItem.mdx +19 -0
- package/dist/stories/DropdownItem.stories.js +76 -78
- package/dist/stories/Flex.stories.js +47 -0
- package/dist/stories/FlexAlignContent.stories.js +102 -0
- package/dist/stories/FlexAlignItems.stories.js +91 -0
- package/dist/stories/FlexAlignSelf.stories.js +97 -0
- package/dist/stories/FlexDirection.stories.js +112 -0
- package/dist/stories/FlexGrow.stories.js +69 -0
- package/dist/stories/FlexJustifyContent.stories.js +98 -0
- package/dist/stories/FlexOrder.stories.js +76 -0
- package/dist/stories/FlexWrap.stories.js +89 -0
- package/dist/stories/Grid.stories.js +202 -0
- package/dist/stories/Group.mdx +9 -0
- package/dist/stories/{Tab.group.stories.js → Group.stories.js} +60 -56
- package/dist/stories/Grow.mdx +40 -0
- package/dist/stories/Icon.mdx +15 -0
- package/dist/stories/Icon.stories.js +84 -82
- package/dist/stories/Image.mdx +15 -0
- package/dist/stories/Image.stories.js +134 -0
- package/dist/stories/Input.mdx +31 -0
- package/dist/stories/Input.stories.js +26 -26
- package/dist/stories/InputPassword.mdx +15 -0
- package/dist/stories/InputPassword.stories.js +32 -34
- package/dist/stories/JustifyContent.mdx +89 -0
- package/dist/stories/JustifyContent.stories.js +96 -0
- package/dist/stories/Label.mdx +31 -0
- package/dist/stories/Label.stories.js +63 -53
- package/dist/stories/Loader.mdx +31 -0
- package/dist/stories/Loader.stories.js +26 -28
- package/dist/stories/Logo.mdx +19 -0
- package/dist/stories/Logo.stories.js +28 -28
- package/dist/stories/MenuItem.mdx +15 -0
- package/dist/stories/MenuItem.stories.js +156 -91
- package/dist/stories/Message.mdx +12 -0
- package/dist/stories/Message.stories.js +34 -0
- package/dist/stories/ModalConfirm.stories.js +48 -47
- package/dist/stories/ModalDefault.stories.js +21 -20
- package/dist/stories/Notification.mdx +23 -0
- package/dist/stories/Notification.stories.js +24 -47
- package/dist/stories/Order.mdx +52 -0
- package/dist/stories/Overview.mdx +1 -2
- package/dist/stories/Pagination.mdx +11 -0
- package/dist/stories/Pagination.stories.js +24 -27
- package/dist/stories/Playground.mdx +1 -2
- package/dist/stories/Radio.mdx +29 -0
- package/dist/stories/Radio.stories.js +32 -33
- package/dist/stories/Response.mdx +18 -0
- package/dist/stories/Response.stories.js +66 -0
- package/dist/stories/SearchInput.mdx +19 -0
- package/dist/stories/{Search-input.stories.js → SearchInput.stories.js} +79 -62
- package/dist/stories/Segmented.mdx +11 -0
- package/dist/stories/Segmented.stories.js +49 -50
- package/dist/stories/Select.stories.js +155 -155
- package/dist/stories/Size.mdx +35 -0
- package/dist/stories/Size.stories.js +101 -0
- package/dist/stories/Skeleton.mdx +9 -0
- package/dist/stories/State.mdx +19 -0
- package/dist/stories/State.stories.js +70 -0
- package/dist/stories/Switch.mdx +23 -0
- package/dist/stories/Switch.stories.js +23 -23
- package/dist/stories/Text.mdx +35 -0
- package/dist/stories/Text.stories.js +172 -0
- package/dist/stories/Textarea.mdx +15 -0
- package/dist/stories/Textarea.stories.js +27 -27
- package/dist/stories/Tile.mdx +19 -0
- package/dist/stories/Tile.stories.js +111 -96
- package/dist/stories/Title.mdx +31 -0
- package/dist/stories/Title.stories.js +168 -0
- package/dist/stories/Tooltip.mdx +19 -0
- package/dist/stories/Tooltip.stories.js +164 -0
- package/dist/stories/WithTooltip.mdx +9 -0
- package/dist/stories/Wrap.mdx +52 -0
- package/dist/stories/Wrap.stories.js +74 -0
- package/dist/types/components/Accordion/Accordion.interface.d.ts +4 -0
- package/dist/types/components/Choice/Choice.interface.d.ts +0 -2
- package/dist/types/components/InputPassword/InputPassword.interface.d.ts +10 -8
- package/dist/types/components/Tile/Tile.d.ts +1 -1
- package/dist/types/components/Tile/Tile.interface.d.ts +3 -1
- package/dist/types/config/forms/datepicker.d.ts +18 -0
- package/dist/types/config/forms/index.d.ts +4 -0
- package/dist/types/config/forms/input.d.ts +14 -0
- package/dist/types/config/forms/select.d.ts +50 -0
- package/package.json +36 -42
- package/dist/Radio-BQo97TZL.js +0 -89
- package/dist/Radio-oMf0vN7T.js +0 -86
- package/dist/Switch-B5yVEqxz.js +0 -14
- package/dist/Switch-DEXsrPCo.js +0 -12
- package/dist/cjs/components/FormField.js +0 -122
- package/dist/components/FormField.js +0 -116
- package/dist/css/mixins/mixin.css +0 -78
- package/dist/stories/FormFieldCheckbox.stories.js +0 -77
- package/dist/stories/FormFieldChoice.stories.js +0 -75
- package/dist/stories/FormFieldDatepicker.stories.js +0 -51
- package/dist/stories/FormFieldFileInput.stories.js +0 -58
- package/dist/stories/FormFieldInput.stories.js +0 -66
- package/dist/stories/FormFieldInputPassword.stories.js +0 -66
- package/dist/stories/FormFieldMultiBadgeSelect.stories.js +0 -132
- package/dist/stories/FormFieldMultiSelect.stories.js +0 -127
- package/dist/stories/FormFieldSelect.stories.js +0 -99
- package/dist/stories/FormFieldSelectGroup.stories.js +0 -84
- package/dist/stories/NotFound.stories.js +0 -93
- package/dist/stories/Tab.appearance.stories.js +0 -260
- package/dist/stories/Tab.size.stories.js +0 -259
- package/dist/stories/Tab.state.stories.js +0 -227
- package/dist/types/components/FormField/ChoiceField.d.ts +0 -8
- package/dist/types/components/FormField/FormField.d.ts +0 -9
- package/dist/types/components/FormField/FormFiled.interface.d.ts +0 -77
- package/dist/types/components/FormField/PasswordField.d.ts +0 -9
- package/dist/types/components/FormField/SelectField.d.ts +0 -9
- package/dist/types/components/FormField/SwitchField.d.ts +0 -8
- package/dist/types/components/FormField/index.d.ts +0 -6
|
@@ -7,6 +7,7 @@ var clsx = require('clsx');
|
|
|
7
7
|
var castArray = require('lodash/castArray');
|
|
8
8
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
9
9
|
var useStyles = require('../hooks/useStyles.js');
|
|
10
|
+
var Divider = require('../../Divider-BjB5MD6u.js');
|
|
10
11
|
var Icon = require('../../Icon-D-zjcPll.js');
|
|
11
12
|
var Text = require('../../Text-_YhyTsQ1.js');
|
|
12
13
|
require('lodash/camelCase');
|
|
@@ -52,7 +53,7 @@ const icon16 = {
|
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
function AccordionItem(props) {
|
|
55
|
-
var id = props.id, children = props.children, isExpanded = props.isExpanded, afterContent = props.afterContent, beforeContent = props.beforeContent, className = props.className, content = props.content, contentTextColor = props.contentTextColor, contentTextSize = props.contentTextSize, contentTextWeight = props.contentTextWeight, icon = props.icon, _a = props.iconFill, iconFill = _a === void 0 ? 'surfaceItemAccent' : _a, size = props.size, title = props.title, titleTextColor = props.titleTextColor, titleTextSize = props.titleTextSize, titleTextWeight = props.titleTextWeight, onClick = props.onClick;
|
|
56
|
+
var id = props.id, children = props.children, isExpanded = props.isExpanded, afterContent = props.afterContent, beforeContent = props.beforeContent, className = props.className, 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, title = props.title, titleTextColor = props.titleTextColor, titleTextSize = props.titleTextSize, titleTextWeight = props.titleTextWeight, onClick = props.onClick;
|
|
56
57
|
var onClickTitle = React.useCallback(function () {
|
|
57
58
|
// "!isExpanded" - is next state of expanded
|
|
58
59
|
var thisItemData = {
|
|
@@ -101,7 +102,7 @@ function AccordionItem(props) {
|
|
|
101
102
|
});
|
|
102
103
|
// @ts-expect-error
|
|
103
104
|
var styles = useStyles.useStyles(props).styles;
|
|
104
|
-
return (jsxRuntime.jsxs("div", { className: clsx('accordion-item', className, borderColorClass, fillClass, fillHoverClass, 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, titleFillClass, titleFillHoverClass, 'cursor_type_pointer'), size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, 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: icon16.ChevronDown }) }), beforeContent && beforeContent, isExpanded && (jsxRuntime.jsx("div", { className: clsx('accordion-item__content', contentBorderColorClass, contentFillClass, fillHoverClass), children: children ||
|
|
105
|
+
return (jsxRuntime.jsxs("div", { className: clsx('accordion-item', className, borderColorClass, fillClass, fillHoverClass, 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, titleFillClass, titleFillHoverClass, 'cursor_type_pointer'), size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, 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: icon16.ChevronDown }) }), beforeContent && beforeContent, showDivider && (jsxRuntime.jsx(Divider.Divider, { width: "fill", fill: dividerFill || 'surfaceTertiary', direction: dividerDirection, size: dividerSize })), isExpanded && (jsxRuntime.jsx("div", { className: clsx('accordion-item__content', contentBorderColorClass, contentFillClass, fillHoverClass), children: children ||
|
|
105
106
|
(content && (jsxRuntime.jsx(Text.Text, { size: contentTextSize, textColor: contentTextColor, textWeight: contentTextWeight, children: content }))) })), afterContent && afterContent] }));
|
|
106
107
|
}
|
|
107
108
|
|
|
@@ -30,7 +30,7 @@ var choiceConfig = {
|
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
var Choice = React.forwardRef(function Choice(props, ref) {
|
|
33
|
-
|
|
33
|
+
var _a = props.isCheckbox, isCheckbox = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.active, active = _d === void 0 ? { value: undefined } : _d, activeIcon = props.activeIcon, activeIconItemFill = props.activeIconItemFill, after = props.after, appearance = props.appearance, before = props.before, className = props.className, icon = props.icon, iconFillDisabled = props.iconFillDisabled, iconItemFill = props.iconItemFill, iconSize = props.iconSize, labelTextActiveColor = props.labelTextActiveColor, labelTextActiveColorDisabled = props.labelTextActiveColorDisabled, labelTextColor = props.labelTextColor, labelTextColorDisabled = props.labelTextColorDisabled, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, name = props.name, _e = props.options, options = _e === void 0 ? [] : _e, set = props.set, setActiveSegment = props.setActiveSegment, _f = props.size, size = _f === void 0 ? 'normal' : _f, type = props.type;
|
|
34
34
|
var controlRef = React.useRef(null);
|
|
35
35
|
var optionsRefs = React.useMemo(function () { return new Map(options.map(function (item) { return [item.value, React.createRef()]; })); }, [options]);
|
|
36
36
|
var onChange = React.useCallback(function (event, item) {
|
|
@@ -23,17 +23,17 @@ require('../../Text-_YhyTsQ1.js');
|
|
|
23
23
|
require('../../Title-zwP6c2U2.js');
|
|
24
24
|
|
|
25
25
|
var inputPasswordConfig = {
|
|
26
|
-
state: undefined,
|
|
27
|
-
setState: function (newComponent) {
|
|
28
|
-
inputPasswordConfig.state = newComponent;
|
|
29
|
-
},
|
|
30
26
|
appearance: undefined,
|
|
31
27
|
setAppearance: function (newComponent) {
|
|
32
28
|
inputPasswordConfig.appearance = newComponent;
|
|
33
29
|
},
|
|
30
|
+
setState: function (newComponent) {
|
|
31
|
+
inputPasswordConfig.state = newComponent;
|
|
32
|
+
},
|
|
33
|
+
state: undefined,
|
|
34
34
|
};
|
|
35
35
|
function InputPassword(props) {
|
|
36
|
-
var appearance = props.appearance,
|
|
36
|
+
var id = props.id, isRevealable = props.isRevealable, appearance = props.appearance, className = props.className, disabled = props.disabled, iconFill = props.iconFill, iconFillHover = props.iconFillHover, iconRevealableHide = props.iconRevealableHide, iconRevealableShow = props.iconRevealableShow, iconShape = props.iconShape, iconSize = props.iconSize, imageRevealableHide = props.imageRevealableHide, imageRevealableShow = props.imageRevealableShow, placeholder = props.placeholder, state = props.state, value = props.value, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, onKeyDown = props.onKeyDown;
|
|
37
37
|
var fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
38
38
|
prefix: 'fill_',
|
|
39
39
|
propsKey: 'fill',
|
|
@@ -116,7 +116,7 @@ function InputPassword(props) {
|
|
|
116
116
|
((stateConfig === null || stateConfig === void 0 ? void 0 : stateConfig.textColor) &&
|
|
117
117
|
"text-color_".concat(stateConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase()) ||
|
|
118
118
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textColor) &&
|
|
119
|
-
"text-color_".concat(appearanceConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase())),
|
|
119
|
+
"text-color_".concat(appearanceConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase())), disabled: disabled, id: String(id), placeholder: placeholder, type: inputType, value: value, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown }), isRevealable && (jsxRuntime.jsx(Icon.Icon, { className: "input-password__icon", iconFill: iconFill, iconFillHover: iconFillHover, imageSrc: isRevealed ? imageRevealableHide : imageRevealableShow, shape: iconShape, size: iconSize, SvgImage: isRevealed ? iconRevealableHide : iconRevealableShow, onClick: revealeHandler }))] }));
|
|
120
120
|
}
|
|
121
121
|
InputPassword.defaultProps = {
|
|
122
122
|
size: 'm',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('
|
|
5
|
-
require('
|
|
6
|
-
require('
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var clsx = require('clsx');
|
|
5
|
+
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
6
|
+
var Text = require('../../Text-_YhyTsQ1.js');
|
|
7
7
|
require('react');
|
|
8
8
|
require('lodash/castArray');
|
|
9
9
|
require('lodash/camelCase');
|
|
@@ -11,13 +11,90 @@ require('../context/UIContext.js');
|
|
|
11
11
|
require('prop-types');
|
|
12
12
|
require('../hooks/useMediaQueries.js');
|
|
13
13
|
require('react-responsive');
|
|
14
|
-
require('../../Text-_YhyTsQ1.js');
|
|
15
14
|
require('../hooks/useStyles.js');
|
|
16
15
|
require('lodash/maxBy');
|
|
17
16
|
require('lodash/upperFirst');
|
|
18
17
|
require('../hooks/styleAttributes.js');
|
|
19
18
|
|
|
19
|
+
var radioConfig = {
|
|
20
|
+
state: undefined,
|
|
21
|
+
setState: function (newComponent) {
|
|
22
|
+
radioConfig.state = newComponent;
|
|
23
|
+
},
|
|
24
|
+
appearance: undefined,
|
|
25
|
+
setAppearance: function (newComponent) {
|
|
26
|
+
radioConfig.appearance = newComponent;
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
function Radio(props) {
|
|
30
|
+
var appearance = props.appearance, checked = props.checked, className = props.className, desc = props.desc, descTextColor = props.descTextColor, descTextSize = props.descTextSize, descTextWeight = props.descTextWeight, disabled = props.disabled, id = props.id, label = props.label, labelTextColor = props.labelTextColor, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, _a = props.tag, Tag = _a === void 0 ? 'label' : _a, onChange = props.onChange;
|
|
31
|
+
var fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
32
|
+
prefix: 'fill_',
|
|
33
|
+
propsKey: 'fill',
|
|
34
|
+
});
|
|
35
|
+
var shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
36
|
+
prefix: 'radio_shape_',
|
|
37
|
+
propsKey: 'shape',
|
|
38
|
+
});
|
|
39
|
+
var stateShapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
40
|
+
prefix: 'radio__state_shape_',
|
|
41
|
+
propsKey: 'stateShape',
|
|
42
|
+
});
|
|
43
|
+
var stateFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
44
|
+
prefix: 'fill_',
|
|
45
|
+
propsKey: checked ? 'stateFillChecked' : 'stateFill',
|
|
46
|
+
});
|
|
47
|
+
var stateFillDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
48
|
+
prefix: 'fill_',
|
|
49
|
+
propsKey: checked ? 'stateFillDisabledChecked' : 'stateFillDisabled',
|
|
50
|
+
});
|
|
51
|
+
var stateCheckmarkFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
52
|
+
prefix: 'radio_checkmark_fill_',
|
|
53
|
+
propsKey: disabled ? 'stateCheckmarkFillDisabled' : 'stateCheckmarkFill',
|
|
54
|
+
});
|
|
55
|
+
var stateBorderWidthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
56
|
+
prefix: 'border-width_',
|
|
57
|
+
propsKey: 'stateBorderWidth',
|
|
58
|
+
});
|
|
59
|
+
var stateBorderColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
60
|
+
prefix: 'border-color_',
|
|
61
|
+
propsKey: checked ? 'stateBorderColorChecked' : 'stateBorderColor',
|
|
62
|
+
});
|
|
63
|
+
var stateBorderColorHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
64
|
+
prefix: 'border-color_hover_',
|
|
65
|
+
propsKey: checked ? 'stateBorderColorHoverChecked' : 'stateBorderColorHover',
|
|
66
|
+
});
|
|
67
|
+
var stateBorderColorDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
68
|
+
prefix: 'border-color_',
|
|
69
|
+
propsKey: checked ? 'stateBorderColorDisabledChecked' : 'stateBorderColorDisabled',
|
|
70
|
+
});
|
|
71
|
+
var appearanceConfig = appearance && radioConfig.appearance && radioConfig.appearance[appearance];
|
|
72
|
+
return (jsxRuntime.jsxs(Tag, { className: clsx(className, 'radio', fillClass, shapeClass), htmlFor: id, children: [jsxRuntime.jsxs("div", { className: clsx('radio__item', stateCheckmarkFillClass ||
|
|
73
|
+
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.stateCheckmarkFill) &&
|
|
74
|
+
"radio_checkmark_fill_".concat(appearanceConfig.stateCheckmarkFill)
|
|
75
|
+
.replace(/([A-Z])/g, '-$1')
|
|
76
|
+
.toLowerCase())), children: [jsxRuntime.jsx("input", { checked: checked, className: "radio__input", disabled: disabled,
|
|
77
|
+
// @ts-expect-error
|
|
78
|
+
id: id, type: "radio", onChange: onChange }), jsxRuntime.jsx("div", { className: clsx('radio__state', disabled ? stateFillDisabledClass : stateFillClass, disabled
|
|
79
|
+
? stateBorderColorDisabledClass
|
|
80
|
+
: stateBorderColorClass ||
|
|
81
|
+
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.stateBorderColor) &&
|
|
82
|
+
"border-color_".concat(appearanceConfig.stateBorderColor)
|
|
83
|
+
.replace(/([A-Z])/g, '-$1')
|
|
84
|
+
.toLowerCase()), stateBorderColorHoverClass, stateShapeClass ||
|
|
85
|
+
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.stateShape) &&
|
|
86
|
+
"radio__state_shape_".concat(appearanceConfig.stateShape)
|
|
87
|
+
.replace(/([A-Z])/g, '-$1')
|
|
88
|
+
.toLowerCase()), stateBorderWidthClass ||
|
|
89
|
+
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.stateBorderWidth) &&
|
|
90
|
+
"border-width_".concat(appearanceConfig.stateBorderWidth)
|
|
91
|
+
.replace(/([A-Z])/g, '-$1')
|
|
92
|
+
.toLowerCase())), children: "\u00A0" }), jsxRuntime.jsx("div", { className: "radio__state-checkmark", children: "\u00A0" })] }), label && (jsxRuntime.jsx(Text.Text, { className: "radio__label", size: labelTextSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelTextSize), textColor: labelTextColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelTextColor), textWeight: labelTextWeight, children: label })), desc && (jsxRuntime.jsx(Text.Text, { className: "radio__desc", size: descTextSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.descTextSize), textColor: descTextColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.descTextColor), textWeight: descTextWeight, children: desc }))] }));
|
|
93
|
+
}
|
|
94
|
+
Radio.defaultProps = {
|
|
95
|
+
shape: 'circular',
|
|
96
|
+
tag: 'label',
|
|
97
|
+
};
|
|
20
98
|
|
|
21
|
-
|
|
22
|
-
exports.
|
|
23
|
-
exports.radioConfig = Radio.radioConfig;
|
|
99
|
+
exports.Radio = Radio;
|
|
100
|
+
exports.radioConfig = radioConfig;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('react
|
|
5
|
-
require('
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
|
|
7
|
+
var Switch = React.forwardRef(function Switch(props, ref) {
|
|
8
|
+
var className = props.className, set = props.set, size = props.size, id = props.id, checked = props.checked, disabled = props.disabled, onChange = props.onChange;
|
|
9
|
+
return (jsxRuntime.jsxs("div", { className: clsx('switch', className, size && "switch_size_".concat(size), set && "switch_set_".concat(set)), children: [jsxRuntime.jsx("input", { checked: checked, className: "switch__checkbox", disabled: disabled, id: id,
|
|
10
|
+
// @ts-expect-error
|
|
11
|
+
ref: ref, type: "checkbox", onChange: onChange }), jsxRuntime.jsx("div", { className: "switch__bg", children: "\u00A0" }), jsxRuntime.jsx("div", { className: "switch__toggle", children: "\u00A0" })] }));
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
exports.Switch = Switch;
|
|
@@ -19,7 +19,7 @@ require('lodash/upperFirst');
|
|
|
19
19
|
require('../hooks/styleAttributes.js');
|
|
20
20
|
|
|
21
21
|
function Tile(props) {
|
|
22
|
-
var children = props.children, after = props.after, badge = props.badge, badgeSize = props.badgeSize, badgeTextColor = props.badgeTextColor, badgeTextSize = props.badgeTextSize, before = props.before, className = props.className,
|
|
22
|
+
var children = props.children, direction = props.direction, after = props.after, badge = props.badge, badgeAppearance = props.badgeAppearance, badgeSize = props.badgeSize, badgeTextColor = props.badgeTextColor, badgeTextSize = props.badgeTextSize, before = props.before, className = props.className, reverse = props.reverse, size = props.size, text = props.text, textColor = props.textColor, textSize = props.textSize, textWrap = props.textWrap, title = props.title, titleTextAlign = props.titleTextAlign, titleTextColor = props.titleTextColor, titleTextSize = props.titleTextSize, titleTextWeight = props.titleTextWeight, titleTextWrap = props.titleTextWrap, type = props.type, onClick = props.onClick;
|
|
23
23
|
var fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
24
24
|
prefix: 'fill_',
|
|
25
25
|
propsKey: 'fill',
|
|
@@ -54,11 +54,11 @@ function Tile(props) {
|
|
|
54
54
|
});
|
|
55
55
|
// @ts-expect-error
|
|
56
56
|
var tileStyles = useStyles.useStyles(props).styles;
|
|
57
|
-
return (jsxRuntime.jsx("div", { className: clsx('tile', className, fillClass, shapeClass, alignClass, alignDirectionClass, direction && "direction_".concat(direction), borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass, reverse && 'tile_reverse', size && "tile_size_".concat(size), type && "tile_type_".concat(type), badge && "tile_state_badge"), style: tileStyles, onClick: onClick, children: jsxRuntime.jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, title && (jsxRuntime.jsx(Title.Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), text && (jsxRuntime.jsx(Text.Text, { className: "tile__text", size: textSize, textColor: textColor, textWrap: textWrap, children: text })), badge && (jsxRuntime.jsx(Badge.Badge, { className: "tile__badge", size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, value: badge })), children, after] }) }));
|
|
57
|
+
return (jsxRuntime.jsx("div", { className: clsx('tile', className, fillClass, shapeClass, alignClass, alignDirectionClass, direction && "direction_".concat(direction), borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass, reverse && 'tile_reverse', size && "tile_size_".concat(size), type && "tile_type_".concat(type), badge && "tile_state_badge"), style: tileStyles, onClick: onClick, children: jsxRuntime.jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, title && (jsxRuntime.jsx(Title.Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), text && (jsxRuntime.jsx(Text.Text, { className: "tile__text", size: textSize, textColor: textColor, textWrap: textWrap, children: text })), badge && (jsxRuntime.jsx(Badge.Badge, { className: "tile__badge", appearance: badgeAppearance, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, value: badge })), children, after] }) }));
|
|
58
58
|
}
|
|
59
59
|
Tile.defaultProps = {
|
|
60
|
-
textTag: 'span',
|
|
61
60
|
alignDirection: 'vertical',
|
|
61
|
+
textTag: 'span',
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
exports.Tile = Tile;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const textColorProps = [null, false, 'accentTextPrimary', 'accentTextSecondary', 'accentTextTertiary', 'primaryTextPrimary', 'primaryTextSecondary', 'primaryTextTertiary', 'secondaryTextPrimary', 'secondaryTextSecondary', 'secondaryTextTertiary', 'tertiaryTextPrimary', 'tertiaryTextSecondary', 'surfaceTextPrimary', 'surfaceTextAccent', 'surfaceTextSecondary', 'surfaceTextTertiary', 'surfaceTextQuaternary', 'surfaceTextAccent', 'surfaceTextHover', 'surfaceTextFocus', 'surfaceTextActive', 'surfaceTextDisabled', 'errorTextPrimary', 'errorTextSecondary', 'successTextPrimary', 'successTextSecondary', '
|
|
5
|
+
const textColorProps = [null, false, 'accentTextPrimary', 'accentTextSecondary', 'accentTextTertiary', 'primaryTextPrimary', 'primaryTextSecondary', 'primaryTextTertiary', 'secondaryTextPrimary', 'secondaryTextSecondary', 'secondaryTextTertiary', 'tertiaryTextPrimary', 'tertiaryTextSecondary', 'surfaceTextPrimary', 'surfaceTextAccent', 'surfaceTextSecondary', 'surfaceTextTertiary', 'surfaceTextQuaternary', 'surfaceTextAccent', 'surfaceTextHover', 'surfaceTextFocus', 'surfaceTextActive', 'surfaceTextDisabled', 'errorTextPrimary', 'errorTextSecondary', 'successTextPrimary', 'successTextSecondary', 'surfaceTextInverse'];
|
|
6
6
|
|
|
7
7
|
exports.default = textColorProps;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const textColorHoverProps = [null, false, 'accentTextPrimary', 'accentTextSecondary', 'accentTextTertiary', 'primaryTextPrimary', 'primaryTextSecondary', 'primaryTextTertiary', 'secondaryTextPrimary', 'secondaryTextSecondary', 'secondaryTextTertiary', 'tertiaryTextPrimary', 'tertiaryTextSecondary', 'surfaceTextPrimary', 'surfaceTextAccent', 'surfaceTextSecondary', 'surfaceTextTertiary', 'surfaceTextQuaternary', 'surfaceTextAccent', 'surfaceTextHover', 'surfaceTextFocus', 'surfaceTextActive', 'surfaceTextDisabled', 'errorTextPrimary', 'errorTextSecondary', 'successTextPrimary', 'successTextSecondary', '
|
|
5
|
+
const textColorHoverProps = [null, false, 'accentTextPrimary', 'accentTextSecondary', 'accentTextTertiary', 'primaryTextPrimary', 'primaryTextSecondary', 'primaryTextTertiary', 'secondaryTextPrimary', 'secondaryTextSecondary', 'secondaryTextTertiary', 'tertiaryTextPrimary', 'tertiaryTextSecondary', 'surfaceTextPrimary', 'surfaceTextAccent', 'surfaceTextSecondary', 'surfaceTextTertiary', 'surfaceTextQuaternary', 'surfaceTextAccent', 'surfaceTextHover', 'surfaceTextFocus', 'surfaceTextActive', 'surfaceTextDisabled', 'errorTextPrimary', 'errorTextSecondary', 'successTextPrimary', 'successTextSecondary', 'surfaceTextInverse'];
|
|
6
6
|
|
|
7
7
|
exports.default = textColorHoverProps;
|
|
@@ -5,6 +5,7 @@ import clsx from 'clsx';
|
|
|
5
5
|
import castArray from 'lodash/castArray';
|
|
6
6
|
import { useDeviceTargetClass } from '../hooks/useDeviceTargetClass.js';
|
|
7
7
|
import { useStyles } from '../hooks/useStyles.js';
|
|
8
|
+
import { D as Divider } from '../Divider-U5UdY-ef.js';
|
|
8
9
|
import { I as Icon } from '../Icon-DD_Vyrw0.js';
|
|
9
10
|
import { T as Text } from '../Text-CG3xPG27.js';
|
|
10
11
|
import 'lodash/camelCase';
|
|
@@ -50,7 +51,7 @@ const icon16 = {
|
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
function AccordionItem(props) {
|
|
53
|
-
var id = props.id, children = props.children, isExpanded = props.isExpanded, afterContent = props.afterContent, beforeContent = props.beforeContent, className = props.className, content = props.content, contentTextColor = props.contentTextColor, contentTextSize = props.contentTextSize, contentTextWeight = props.contentTextWeight, icon = props.icon, _a = props.iconFill, iconFill = _a === void 0 ? 'surfaceItemAccent' : _a, size = props.size, title = props.title, titleTextColor = props.titleTextColor, titleTextSize = props.titleTextSize, titleTextWeight = props.titleTextWeight, onClick = props.onClick;
|
|
54
|
+
var id = props.id, children = props.children, isExpanded = props.isExpanded, afterContent = props.afterContent, beforeContent = props.beforeContent, className = props.className, 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, title = props.title, titleTextColor = props.titleTextColor, titleTextSize = props.titleTextSize, titleTextWeight = props.titleTextWeight, onClick = props.onClick;
|
|
54
55
|
var onClickTitle = useCallback(function () {
|
|
55
56
|
// "!isExpanded" - is next state of expanded
|
|
56
57
|
var thisItemData = {
|
|
@@ -99,7 +100,7 @@ function AccordionItem(props) {
|
|
|
99
100
|
});
|
|
100
101
|
// @ts-expect-error
|
|
101
102
|
var styles = useStyles(props).styles;
|
|
102
|
-
return (jsxs("div", { className: clsx('accordion-item', className, borderColorClass, fillClass, fillHoverClass, shapeClass, size && "accordion-item_size_".concat(size), isExpanded && 'accordion-item_state_open'), style: styles, children: [jsx(Text, { className: clsx('accordion-item__title', titleBorderColorClass, titleFillClass, titleFillHoverClass, 'cursor_type_pointer'), size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, 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, isExpanded && (jsx("div", { className: clsx('accordion-item__content', contentBorderColorClass, contentFillClass, fillHoverClass), children: children ||
|
|
103
|
+
return (jsxs("div", { className: clsx('accordion-item', className, borderColorClass, fillClass, fillHoverClass, shapeClass, size && "accordion-item_size_".concat(size), isExpanded && 'accordion-item_state_open'), style: styles, children: [jsx(Text, { className: clsx('accordion-item__title', titleBorderColorClass, titleFillClass, titleFillHoverClass, 'cursor_type_pointer'), size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, 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", fill: dividerFill || 'surfaceTertiary', direction: dividerDirection, size: dividerSize })), isExpanded && (jsx("div", { className: clsx('accordion-item__content', contentBorderColorClass, contentFillClass, fillHoverClass), children: children ||
|
|
103
104
|
(content && (jsx(Text, { size: contentTextSize, textColor: contentTextColor, textWeight: contentTextWeight, children: content }))) })), afterContent && afterContent] }));
|
|
104
105
|
}
|
|
105
106
|
|
|
@@ -28,7 +28,7 @@ var choiceConfig = {
|
|
|
28
28
|
},
|
|
29
29
|
};
|
|
30
30
|
var Choice = React.forwardRef(function Choice(props, ref) {
|
|
31
|
-
|
|
31
|
+
var _a = props.isCheckbox, isCheckbox = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.active, active = _d === void 0 ? { value: undefined } : _d, activeIcon = props.activeIcon, activeIconItemFill = props.activeIconItemFill, after = props.after, appearance = props.appearance, before = props.before, className = props.className, icon = props.icon, iconFillDisabled = props.iconFillDisabled, iconItemFill = props.iconItemFill, iconSize = props.iconSize, labelTextActiveColor = props.labelTextActiveColor, labelTextActiveColorDisabled = props.labelTextActiveColorDisabled, labelTextColor = props.labelTextColor, labelTextColorDisabled = props.labelTextColorDisabled, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, name = props.name, _e = props.options, options = _e === void 0 ? [] : _e, set = props.set, setActiveSegment = props.setActiveSegment, _f = props.size, size = _f === void 0 ? 'normal' : _f, type = props.type;
|
|
32
32
|
var controlRef = useRef(null);
|
|
33
33
|
var optionsRefs = useMemo(function () { return new Map(options.map(function (item) { return [item.value, createRef()]; })); }, [options]);
|
|
34
34
|
var onChange = useCallback(function (event, item) {
|
|
@@ -21,17 +21,17 @@ import '../Text-CG3xPG27.js';
|
|
|
21
21
|
import '../Title-BfSFPJtJ.js';
|
|
22
22
|
|
|
23
23
|
var inputPasswordConfig = {
|
|
24
|
-
state: undefined,
|
|
25
|
-
setState: function (newComponent) {
|
|
26
|
-
inputPasswordConfig.state = newComponent;
|
|
27
|
-
},
|
|
28
24
|
appearance: undefined,
|
|
29
25
|
setAppearance: function (newComponent) {
|
|
30
26
|
inputPasswordConfig.appearance = newComponent;
|
|
31
27
|
},
|
|
28
|
+
setState: function (newComponent) {
|
|
29
|
+
inputPasswordConfig.state = newComponent;
|
|
30
|
+
},
|
|
31
|
+
state: undefined,
|
|
32
32
|
};
|
|
33
33
|
function InputPassword(props) {
|
|
34
|
-
var appearance = props.appearance,
|
|
34
|
+
var id = props.id, isRevealable = props.isRevealable, appearance = props.appearance, className = props.className, disabled = props.disabled, iconFill = props.iconFill, iconFillHover = props.iconFillHover, iconRevealableHide = props.iconRevealableHide, iconRevealableShow = props.iconRevealableShow, iconShape = props.iconShape, iconSize = props.iconSize, imageRevealableHide = props.imageRevealableHide, imageRevealableShow = props.imageRevealableShow, placeholder = props.placeholder, state = props.state, value = props.value, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, onKeyDown = props.onKeyDown;
|
|
35
35
|
var fillClass = useDeviceTargetClass(props, {
|
|
36
36
|
prefix: 'fill_',
|
|
37
37
|
propsKey: 'fill',
|
|
@@ -114,7 +114,7 @@ function InputPassword(props) {
|
|
|
114
114
|
((stateConfig === null || stateConfig === void 0 ? void 0 : stateConfig.textColor) &&
|
|
115
115
|
"text-color_".concat(stateConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase()) ||
|
|
116
116
|
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textColor) &&
|
|
117
|
-
"text-color_".concat(appearanceConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase())),
|
|
117
|
+
"text-color_".concat(appearanceConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase())), disabled: disabled, id: String(id), placeholder: placeholder, type: inputType, value: value, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown }), isRevealable && (jsx(Icon, { className: "input-password__icon", iconFill: iconFill, iconFillHover: iconFillHover, imageSrc: isRevealed ? imageRevealableHide : imageRevealableShow, shape: iconShape, size: iconSize, SvgImage: isRevealed ? iconRevealableHide : iconRevealableShow, onClick: revealeHandler }))] }));
|
|
118
118
|
}
|
|
119
119
|
InputPassword.defaultProps = {
|
|
120
120
|
size: 'm',
|
package/dist/components/Radio.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
3
|
-
import '
|
|
4
|
-
import '../
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { useDeviceTargetClass } from '../hooks/useDeviceTargetClass.js';
|
|
4
|
+
import { T as Text } from '../Text-CG3xPG27.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'lodash/castArray';
|
|
7
7
|
import 'lodash/camelCase';
|
|
@@ -9,8 +9,89 @@ import '../context/UIContext.js';
|
|
|
9
9
|
import 'prop-types';
|
|
10
10
|
import '../hooks/useMediaQueries.js';
|
|
11
11
|
import 'react-responsive';
|
|
12
|
-
import '../Text-CG3xPG27.js';
|
|
13
12
|
import '../hooks/useStyles.js';
|
|
14
13
|
import 'lodash/maxBy';
|
|
15
14
|
import 'lodash/upperFirst';
|
|
16
15
|
import '../hooks/styleAttributes.js';
|
|
16
|
+
|
|
17
|
+
var radioConfig = {
|
|
18
|
+
state: undefined,
|
|
19
|
+
setState: function (newComponent) {
|
|
20
|
+
radioConfig.state = newComponent;
|
|
21
|
+
},
|
|
22
|
+
appearance: undefined,
|
|
23
|
+
setAppearance: function (newComponent) {
|
|
24
|
+
radioConfig.appearance = newComponent;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
function Radio(props) {
|
|
28
|
+
var appearance = props.appearance, checked = props.checked, className = props.className, desc = props.desc, descTextColor = props.descTextColor, descTextSize = props.descTextSize, descTextWeight = props.descTextWeight, disabled = props.disabled, id = props.id, label = props.label, labelTextColor = props.labelTextColor, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, _a = props.tag, Tag = _a === void 0 ? 'label' : _a, onChange = props.onChange;
|
|
29
|
+
var fillClass = useDeviceTargetClass(props, {
|
|
30
|
+
prefix: 'fill_',
|
|
31
|
+
propsKey: 'fill',
|
|
32
|
+
});
|
|
33
|
+
var shapeClass = useDeviceTargetClass(props, {
|
|
34
|
+
prefix: 'radio_shape_',
|
|
35
|
+
propsKey: 'shape',
|
|
36
|
+
});
|
|
37
|
+
var stateShapeClass = useDeviceTargetClass(props, {
|
|
38
|
+
prefix: 'radio__state_shape_',
|
|
39
|
+
propsKey: 'stateShape',
|
|
40
|
+
});
|
|
41
|
+
var stateFillClass = useDeviceTargetClass(props, {
|
|
42
|
+
prefix: 'fill_',
|
|
43
|
+
propsKey: checked ? 'stateFillChecked' : 'stateFill',
|
|
44
|
+
});
|
|
45
|
+
var stateFillDisabledClass = useDeviceTargetClass(props, {
|
|
46
|
+
prefix: 'fill_',
|
|
47
|
+
propsKey: checked ? 'stateFillDisabledChecked' : 'stateFillDisabled',
|
|
48
|
+
});
|
|
49
|
+
var stateCheckmarkFillClass = useDeviceTargetClass(props, {
|
|
50
|
+
prefix: 'radio_checkmark_fill_',
|
|
51
|
+
propsKey: disabled ? 'stateCheckmarkFillDisabled' : 'stateCheckmarkFill',
|
|
52
|
+
});
|
|
53
|
+
var stateBorderWidthClass = useDeviceTargetClass(props, {
|
|
54
|
+
prefix: 'border-width_',
|
|
55
|
+
propsKey: 'stateBorderWidth',
|
|
56
|
+
});
|
|
57
|
+
var stateBorderColorClass = useDeviceTargetClass(props, {
|
|
58
|
+
prefix: 'border-color_',
|
|
59
|
+
propsKey: checked ? 'stateBorderColorChecked' : 'stateBorderColor',
|
|
60
|
+
});
|
|
61
|
+
var stateBorderColorHoverClass = useDeviceTargetClass(props, {
|
|
62
|
+
prefix: 'border-color_hover_',
|
|
63
|
+
propsKey: checked ? 'stateBorderColorHoverChecked' : 'stateBorderColorHover',
|
|
64
|
+
});
|
|
65
|
+
var stateBorderColorDisabledClass = useDeviceTargetClass(props, {
|
|
66
|
+
prefix: 'border-color_',
|
|
67
|
+
propsKey: checked ? 'stateBorderColorDisabledChecked' : 'stateBorderColorDisabled',
|
|
68
|
+
});
|
|
69
|
+
var appearanceConfig = appearance && radioConfig.appearance && radioConfig.appearance[appearance];
|
|
70
|
+
return (jsxs(Tag, { className: clsx(className, 'radio', fillClass, shapeClass), htmlFor: id, children: [jsxs("div", { className: clsx('radio__item', stateCheckmarkFillClass ||
|
|
71
|
+
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.stateCheckmarkFill) &&
|
|
72
|
+
"radio_checkmark_fill_".concat(appearanceConfig.stateCheckmarkFill)
|
|
73
|
+
.replace(/([A-Z])/g, '-$1')
|
|
74
|
+
.toLowerCase())), children: [jsx("input", { checked: checked, className: "radio__input", disabled: disabled,
|
|
75
|
+
// @ts-expect-error
|
|
76
|
+
id: id, type: "radio", onChange: onChange }), jsx("div", { className: clsx('radio__state', disabled ? stateFillDisabledClass : stateFillClass, disabled
|
|
77
|
+
? stateBorderColorDisabledClass
|
|
78
|
+
: stateBorderColorClass ||
|
|
79
|
+
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.stateBorderColor) &&
|
|
80
|
+
"border-color_".concat(appearanceConfig.stateBorderColor)
|
|
81
|
+
.replace(/([A-Z])/g, '-$1')
|
|
82
|
+
.toLowerCase()), stateBorderColorHoverClass, stateShapeClass ||
|
|
83
|
+
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.stateShape) &&
|
|
84
|
+
"radio__state_shape_".concat(appearanceConfig.stateShape)
|
|
85
|
+
.replace(/([A-Z])/g, '-$1')
|
|
86
|
+
.toLowerCase()), stateBorderWidthClass ||
|
|
87
|
+
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.stateBorderWidth) &&
|
|
88
|
+
"border-width_".concat(appearanceConfig.stateBorderWidth)
|
|
89
|
+
.replace(/([A-Z])/g, '-$1')
|
|
90
|
+
.toLowerCase())), children: "\u00A0" }), jsx("div", { className: "radio__state-checkmark", children: "\u00A0" })] }), label && (jsx(Text, { className: "radio__label", size: labelTextSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelTextSize), textColor: labelTextColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.labelTextColor), textWeight: labelTextWeight, children: label })), desc && (jsx(Text, { className: "radio__desc", size: descTextSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.descTextSize), textColor: descTextColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.descTextColor), textWeight: descTextWeight, children: desc }))] }));
|
|
91
|
+
}
|
|
92
|
+
Radio.defaultProps = {
|
|
93
|
+
shape: 'circular',
|
|
94
|
+
tag: 'label',
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export { Radio, radioConfig };
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import 'react
|
|
3
|
-
import '
|
|
4
|
-
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
var Switch = React.forwardRef(function Switch(props, ref) {
|
|
6
|
+
var className = props.className, set = props.set, size = props.size, id = props.id, checked = props.checked, disabled = props.disabled, onChange = props.onChange;
|
|
7
|
+
return (jsxs("div", { className: clsx('switch', className, size && "switch_size_".concat(size), set && "switch_set_".concat(set)), children: [jsx("input", { checked: checked, className: "switch__checkbox", disabled: disabled, id: id,
|
|
8
|
+
// @ts-expect-error
|
|
9
|
+
ref: ref, type: "checkbox", onChange: onChange }), jsx("div", { className: "switch__bg", children: "\u00A0" }), jsx("div", { className: "switch__toggle", children: "\u00A0" })] }));
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { Switch };
|
package/dist/components/Tile.js
CHANGED
|
@@ -17,7 +17,7 @@ import 'lodash/upperFirst';
|
|
|
17
17
|
import '../hooks/styleAttributes.js';
|
|
18
18
|
|
|
19
19
|
function Tile(props) {
|
|
20
|
-
var children = props.children, after = props.after, badge = props.badge, badgeSize = props.badgeSize, badgeTextColor = props.badgeTextColor, badgeTextSize = props.badgeTextSize, before = props.before, className = props.className,
|
|
20
|
+
var children = props.children, direction = props.direction, after = props.after, badge = props.badge, badgeAppearance = props.badgeAppearance, badgeSize = props.badgeSize, badgeTextColor = props.badgeTextColor, badgeTextSize = props.badgeTextSize, before = props.before, className = props.className, reverse = props.reverse, size = props.size, text = props.text, textColor = props.textColor, textSize = props.textSize, textWrap = props.textWrap, title = props.title, titleTextAlign = props.titleTextAlign, titleTextColor = props.titleTextColor, titleTextSize = props.titleTextSize, titleTextWeight = props.titleTextWeight, titleTextWrap = props.titleTextWrap, type = props.type, onClick = props.onClick;
|
|
21
21
|
var fillClass = useDeviceTargetClass(props, {
|
|
22
22
|
prefix: 'fill_',
|
|
23
23
|
propsKey: 'fill',
|
|
@@ -52,11 +52,11 @@ function Tile(props) {
|
|
|
52
52
|
});
|
|
53
53
|
// @ts-expect-error
|
|
54
54
|
var tileStyles = useStyles(props).styles;
|
|
55
|
-
return (jsx("div", { className: clsx('tile', className, fillClass, shapeClass, alignClass, alignDirectionClass, direction && "direction_".concat(direction), borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass, reverse && 'tile_reverse', size && "tile_size_".concat(size), type && "tile_type_".concat(type), badge && "tile_state_badge"), style: tileStyles, onClick: onClick, children: jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, title && (jsx(Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), text && (jsx(Text, { className: "tile__text", size: textSize, textColor: textColor, textWrap: textWrap, children: text })), badge && (jsx(Badge, { className: "tile__badge", size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, value: badge })), children, after] }) }));
|
|
55
|
+
return (jsx("div", { className: clsx('tile', className, fillClass, shapeClass, alignClass, alignDirectionClass, direction && "direction_".concat(direction), borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass, reverse && 'tile_reverse', size && "tile_size_".concat(size), type && "tile_type_".concat(type), badge && "tile_state_badge"), style: tileStyles, onClick: onClick, children: jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, title && (jsx(Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), text && (jsx(Text, { className: "tile__text", size: textSize, textColor: textColor, textWrap: textWrap, children: text })), badge && (jsx(Badge, { className: "tile__badge", appearance: badgeAppearance, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, value: badge })), children, after] }) }));
|
|
56
56
|
}
|
|
57
57
|
Tile.defaultProps = {
|
|
58
|
-
textTag: 'span',
|
|
59
58
|
alignDirection: 'vertical',
|
|
59
|
+
textTag: 'span',
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export { Tile };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const textColorProps = [null, false, 'accentTextPrimary', 'accentTextSecondary', 'accentTextTertiary', 'primaryTextPrimary', 'primaryTextSecondary', 'primaryTextTertiary', 'secondaryTextPrimary', 'secondaryTextSecondary', 'secondaryTextTertiary', 'tertiaryTextPrimary', 'tertiaryTextSecondary', 'surfaceTextPrimary', 'surfaceTextAccent', 'surfaceTextSecondary', 'surfaceTextTertiary', 'surfaceTextQuaternary', 'surfaceTextAccent', 'surfaceTextHover', 'surfaceTextFocus', 'surfaceTextActive', 'surfaceTextDisabled', 'errorTextPrimary', 'errorTextSecondary', 'successTextPrimary', 'successTextSecondary', '
|
|
1
|
+
const textColorProps = [null, false, 'accentTextPrimary', 'accentTextSecondary', 'accentTextTertiary', 'primaryTextPrimary', 'primaryTextSecondary', 'primaryTextTertiary', 'secondaryTextPrimary', 'secondaryTextSecondary', 'secondaryTextTertiary', 'tertiaryTextPrimary', 'tertiaryTextSecondary', 'surfaceTextPrimary', 'surfaceTextAccent', 'surfaceTextSecondary', 'surfaceTextTertiary', 'surfaceTextQuaternary', 'surfaceTextAccent', 'surfaceTextHover', 'surfaceTextFocus', 'surfaceTextActive', 'surfaceTextDisabled', 'errorTextPrimary', 'errorTextSecondary', 'successTextPrimary', 'successTextSecondary', 'surfaceTextInverse'];
|
|
2
2
|
|
|
3
3
|
export { textColorProps as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const textColorHoverProps = [null, false, 'accentTextPrimary', 'accentTextSecondary', 'accentTextTertiary', 'primaryTextPrimary', 'primaryTextSecondary', 'primaryTextTertiary', 'secondaryTextPrimary', 'secondaryTextSecondary', 'secondaryTextTertiary', 'tertiaryTextPrimary', 'tertiaryTextSecondary', 'surfaceTextPrimary', 'surfaceTextAccent', 'surfaceTextSecondary', 'surfaceTextTertiary', 'surfaceTextQuaternary', 'surfaceTextAccent', 'surfaceTextHover', 'surfaceTextFocus', 'surfaceTextActive', 'surfaceTextDisabled', 'errorTextPrimary', 'errorTextSecondary', 'successTextPrimary', 'successTextSecondary', '
|
|
1
|
+
const textColorHoverProps = [null, false, 'accentTextPrimary', 'accentTextSecondary', 'accentTextTertiary', 'primaryTextPrimary', 'primaryTextSecondary', 'primaryTextTertiary', 'secondaryTextPrimary', 'secondaryTextSecondary', 'secondaryTextTertiary', 'tertiaryTextPrimary', 'tertiaryTextSecondary', 'surfaceTextPrimary', 'surfaceTextAccent', 'surfaceTextSecondary', 'surfaceTextTertiary', 'surfaceTextQuaternary', 'surfaceTextAccent', 'surfaceTextHover', 'surfaceTextFocus', 'surfaceTextActive', 'surfaceTextDisabled', 'errorTextPrimary', 'errorTextSecondary', 'successTextPrimary', 'successTextSecondary', 'surfaceTextInverse'];
|
|
2
2
|
|
|
3
3
|
export { textColorHoverProps as default };
|
|
@@ -136,7 +136,7 @@ h2.react-datepicker__current-month {
|
|
|
136
136
|
top: -4px;
|
|
137
137
|
}
|
|
138
138
|
.react-datepicker__navigation:hover *::before {
|
|
139
|
-
border-color:
|
|
139
|
+
border-color: rgb(165.75, 165.75, 165.75);
|
|
140
140
|
}
|
|
141
141
|
.react-datepicker__navigation-icon {
|
|
142
142
|
position: relative;
|
|
@@ -298,15 +298,15 @@ h2.react-datepicker__current-month {
|
|
|
298
298
|
color: #fff;
|
|
299
299
|
}
|
|
300
300
|
.react-datepicker__week-number--selected:hover {
|
|
301
|
-
background-color:
|
|
301
|
+
background-color: rgb(28.75, 93.2196969697, 143.75);
|
|
302
302
|
}
|
|
303
303
|
.react-datepicker__week-number--keyboard-selected {
|
|
304
304
|
border-radius: 0.3rem;
|
|
305
|
-
background-color:
|
|
305
|
+
background-color: rgb(41.5, 134.5606060606, 207.5);
|
|
306
306
|
color: #fff;
|
|
307
307
|
}
|
|
308
308
|
.react-datepicker__week-number--keyboard-selected:hover {
|
|
309
|
-
background-color:
|
|
309
|
+
background-color: rgb(28.75, 93.2196969697, 143.75);
|
|
310
310
|
}
|
|
311
311
|
.react-datepicker__day-names {
|
|
312
312
|
white-space: nowrap;
|
|
@@ -356,7 +356,7 @@ h2.react-datepicker__current-month {
|
|
|
356
356
|
.react-datepicker__month-text--highlighted:not([aria-disabled=true]):hover,
|
|
357
357
|
.react-datepicker__quarter-text--highlighted:not([aria-disabled=true]):hover,
|
|
358
358
|
.react-datepicker__year-text--highlighted:not([aria-disabled=true]):hover {
|
|
359
|
-
background-color:
|
|
359
|
+
background-color: rgb(49.8551020408, 189.6448979592, 62.5632653061);
|
|
360
360
|
}
|
|
361
361
|
.react-datepicker__day--highlighted-custom-1,
|
|
362
362
|
.react-datepicker__month-text--highlighted-custom-1,
|
|
@@ -400,7 +400,7 @@ h2.react-datepicker__current-month {
|
|
|
400
400
|
.react-datepicker__month-text--holidays:not([aria-disabled=true]):hover,
|
|
401
401
|
.react-datepicker__quarter-text--holidays:not([aria-disabled=true]):hover,
|
|
402
402
|
.react-datepicker__year-text--holidays:not([aria-disabled=true]):hover {
|
|
403
|
-
background-color:
|
|
403
|
+
background-color: rgb(207, 82.9642857143, 0);
|
|
404
404
|
}
|
|
405
405
|
.react-datepicker__day--holidays:hover .overlay,
|
|
406
406
|
.react-datepicker__month-text--holidays:hover .overlay,
|
|
@@ -433,21 +433,21 @@ h2.react-datepicker__current-month {
|
|
|
433
433
|
.react-datepicker__year-text--selected:not([aria-disabled=true]):hover,
|
|
434
434
|
.react-datepicker__year-text--in-selecting-range:not([aria-disabled=true]):hover,
|
|
435
435
|
.react-datepicker__year-text--in-range:not([aria-disabled=true]):hover {
|
|
436
|
-
background-color:
|
|
436
|
+
background-color: rgb(28.75, 93.2196969697, 143.75);
|
|
437
437
|
}
|
|
438
438
|
.react-datepicker__day--keyboard-selected,
|
|
439
439
|
.react-datepicker__month-text--keyboard-selected,
|
|
440
440
|
.react-datepicker__quarter-text--keyboard-selected,
|
|
441
441
|
.react-datepicker__year-text--keyboard-selected {
|
|
442
442
|
border-radius: 0.3rem;
|
|
443
|
-
background-color:
|
|
443
|
+
background-color: rgb(186.25, 217.0833333333, 241.25);
|
|
444
444
|
color: rgb(0, 0, 0);
|
|
445
445
|
}
|
|
446
446
|
.react-datepicker__day--keyboard-selected:not([aria-disabled=true]):hover,
|
|
447
447
|
.react-datepicker__month-text--keyboard-selected:not([aria-disabled=true]):hover,
|
|
448
448
|
.react-datepicker__quarter-text--keyboard-selected:not([aria-disabled=true]):hover,
|
|
449
449
|
.react-datepicker__year-text--keyboard-selected:not([aria-disabled=true]):hover {
|
|
450
|
-
background-color:
|
|
450
|
+
background-color: rgb(28.75, 93.2196969697, 143.75);
|
|
451
451
|
}
|
|
452
452
|
.react-datepicker__day--in-selecting-range:not(.react-datepicker__day--in-range,
|
|
453
453
|
.react-datepicker__month-text--in-range,
|
|
@@ -556,7 +556,7 @@ h2.react-datepicker__current-month {
|
|
|
556
556
|
.react-datepicker__month-read-view:hover .react-datepicker__month-read-view--down-arrow,
|
|
557
557
|
.react-datepicker__month-year-read-view:hover .react-datepicker__year-read-view--down-arrow,
|
|
558
558
|
.react-datepicker__month-year-read-view:hover .react-datepicker__month-read-view--down-arrow {
|
|
559
|
-
border-top-color:
|
|
559
|
+
border-top-color: rgb(178.5, 178.5, 178.5);
|
|
560
560
|
}
|
|
561
561
|
.react-datepicker__year-read-view--down-arrow,
|
|
562
562
|
.react-datepicker__month-read-view--down-arrow,
|
|
@@ -622,12 +622,12 @@ h2.react-datepicker__current-month {
|
|
|
622
622
|
.react-datepicker__year-option:hover .react-datepicker__navigation--years-upcoming,
|
|
623
623
|
.react-datepicker__month-option:hover .react-datepicker__navigation--years-upcoming,
|
|
624
624
|
.react-datepicker__month-year-option:hover .react-datepicker__navigation--years-upcoming {
|
|
625
|
-
border-bottom-color:
|
|
625
|
+
border-bottom-color: rgb(178.5, 178.5, 178.5);
|
|
626
626
|
}
|
|
627
627
|
.react-datepicker__year-option:hover .react-datepicker__navigation--years-previous,
|
|
628
628
|
.react-datepicker__month-option:hover .react-datepicker__navigation--years-previous,
|
|
629
629
|
.react-datepicker__month-year-option:hover .react-datepicker__navigation--years-previous {
|
|
630
|
-
border-top-color:
|
|
630
|
+
border-top-color: rgb(178.5, 178.5, 178.5);
|
|
631
631
|
}
|
|
632
632
|
.react-datepicker__year-option--selected,
|
|
633
633
|
.react-datepicker__month-option--selected,
|