@itcase/ui 1.8.152 → 1.8.153
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/{Group_cjs_CLE5_jDA.js → Group_cjs_BxbmyFvN.js} +2 -2
- package/dist/{Group_es_ZTwafPX1.js → Group_es_p5hBFgw4.js} +2 -2
- package/dist/cjs/components/AvatarStack.js +1 -1
- package/dist/cjs/components/Flex.js +6 -6
- package/dist/cjs/components/Grid.js +7 -7
- package/dist/cjs/components/Group.js +1 -1
- package/dist/cjs/components/Modal.js +7 -3
- package/dist/cjs/components/Notification/stories/__mock__.js +4 -0
- package/dist/cjs/components/Notification.js +3 -3
- package/dist/cjs/components/Response.js +1 -1
- package/dist/cjs/components/Select.js +1 -1
- package/dist/cjs/context/Notifications.js +17 -24
- package/dist/components/AvatarStack.js +1 -1
- package/dist/components/Flex.js +6 -6
- package/dist/components/Grid.js +7 -7
- package/dist/components/Group.js +1 -1
- package/dist/components/Modal.js +7 -3
- package/dist/components/Notification/stories/__mock__.js +4 -0
- package/dist/components/Notification.js +3 -3
- package/dist/components/Response.js +1 -1
- package/dist/components/Select.js +1 -1
- package/dist/context/Notifications.js +17 -24
- package/dist/css/styles/bundle.css +19 -0
- package/dist/css/styles/print/print.css +20 -0
- package/dist/types/components/Notification/stories/__mock__/index.d.ts +1 -0
- package/dist/types/components/Warning/Warning.interface.d.ts +4 -4
- package/dist/types/context/Notifications.d.ts +2 -2
- package/dist/types/context/Notifications.interface.d.ts +8 -6
- package/package.json +3 -3
|
@@ -24,7 +24,7 @@ const groupConfig = {
|
|
|
24
24
|
},
|
|
25
25
|
};
|
|
26
26
|
const Group = React.forwardRef(function Group(props, ref) {
|
|
27
|
-
const { id, appearance, className, dataTestId, dataTour, name, easing, htmlFor, scroll, style, tag: Tag = 'div', isActive, isDisabled, onClick, onMouseDown, children, } = props;
|
|
27
|
+
const { id, appearance, className, dataTestId, dataTour, name, easing, htmlFor, print, scroll, style, tag: Tag = 'div', isActive, isDisabled, onClick, onMouseDown, children, } = props;
|
|
28
28
|
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, groupConfig);
|
|
29
29
|
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
30
30
|
const { directionClass, flexGrowClass, justifyContentClass, alignClass, alignDirectionClass, fillActiveClass, fillActiveHoverClass, fillClass, fillDisabledClass, fillHoverClass, borderColorActiveClass, borderColorActiveHoverClass, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, textColorActiveClass, textColorClass, textColorHoverClass, columnsClass, elevationClass, heightClass, iconFillHoverClass, shapeClass, stackingClass, widthClass, wrapClass, } = propsGenerator;
|
|
@@ -51,7 +51,7 @@ const Group = React.forwardRef(function Group(props, ref) {
|
|
|
51
51
|
`border-color_hover_${borderColorHoverClass}`
|
|
52
52
|
: borderColorActiveHoverClass &&
|
|
53
53
|
`border-color_active_hover_${borderColorActiveHoverClass}`
|
|
54
|
-
: fillDisabledClass && `fill_${fillDisabledClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, elevationClass && `elevation_${elevationClass}`, onClick && 'cursor_type_pointer'), name: name, ref: ref, "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: Object.assign({}, groupStyles, style), onClick: onClick, onMouseDown: onMouseDown, children: children }));
|
|
54
|
+
: fillDisabledClass && `fill_${fillDisabledClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, elevationClass && `elevation_${elevationClass}`, print === false && 'no-print', print === true && 'print', onClick && 'cursor_type_pointer'), name: name, ref: ref, "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: Object.assign({}, groupStyles, style), onClick: onClick, onMouseDown: onMouseDown, children: children }));
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
exports.Group = Group;
|
|
@@ -22,7 +22,7 @@ const groupConfig = {
|
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
const Group = React.forwardRef(function Group(props, ref) {
|
|
25
|
-
const { id, appearance, className, dataTestId, dataTour, name, easing, htmlFor, scroll, style, tag: Tag = 'div', isActive, isDisabled, onClick, onMouseDown, children, } = props;
|
|
25
|
+
const { id, appearance, className, dataTestId, dataTour, name, easing, htmlFor, print, scroll, style, tag: Tag = 'div', isActive, isDisabled, onClick, onMouseDown, children, } = props;
|
|
26
26
|
const appearanceConfig = useAppearanceConfig(appearance, groupConfig);
|
|
27
27
|
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
28
28
|
const { directionClass, flexGrowClass, justifyContentClass, alignClass, alignDirectionClass, fillActiveClass, fillActiveHoverClass, fillClass, fillDisabledClass, fillHoverClass, borderColorActiveClass, borderColorActiveHoverClass, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, textColorActiveClass, textColorClass, textColorHoverClass, columnsClass, elevationClass, heightClass, iconFillHoverClass, shapeClass, stackingClass, widthClass, wrapClass, } = propsGenerator;
|
|
@@ -49,7 +49,7 @@ const Group = React.forwardRef(function Group(props, ref) {
|
|
|
49
49
|
`border-color_hover_${borderColorHoverClass}`
|
|
50
50
|
: borderColorActiveHoverClass &&
|
|
51
51
|
`border-color_active_hover_${borderColorActiveHoverClass}`
|
|
52
|
-
: fillDisabledClass && `fill_${fillDisabledClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, elevationClass && `elevation_${elevationClass}`, onClick && 'cursor_type_pointer'), name: name, ref: ref, "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: Object.assign({}, groupStyles, style), onClick: onClick, onMouseDown: onMouseDown, children: children }));
|
|
52
|
+
: fillDisabledClass && `fill_${fillDisabledClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, elevationClass && `elevation_${elevationClass}`, print === false && 'no-print', print === true && 'print', onClick && 'cursor_type_pointer'), name: name, ref: ref, "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: Object.assign({}, groupStyles, style), onClick: onClick, onMouseDown: onMouseDown, children: children }));
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
export { Group as G, groupAppearance as a, groupConfig as g };
|
|
@@ -6,7 +6,7 @@ var useAppearanceConfig = require('../hooks/useAppearanceConfig/useAppearanceCon
|
|
|
6
6
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
7
7
|
var useStyles = require('../hooks/useStyles/useStyles.js');
|
|
8
8
|
var Avatar = require('../../Avatar_cjs_Dv_yLG9O.js');
|
|
9
|
-
var Group = require('../../
|
|
9
|
+
var Group = require('../../Group_cjs_BxbmyFvN.js');
|
|
10
10
|
var Text = require('../../Text_cjs_DaH5tVvz.js');
|
|
11
11
|
require('react');
|
|
12
12
|
require('lodash/camelCase');
|
|
@@ -20,22 +20,22 @@ require('../hooks/useStyles/styleAttributes.js');
|
|
|
20
20
|
require('lodash/maxBy');
|
|
21
21
|
|
|
22
22
|
function Flex(props) {
|
|
23
|
-
const { id, className, type, style, tag: Tag = 'div', onClick, children, } = props;
|
|
23
|
+
const { id, className, type, print, style, tag: Tag = 'div', onClick, children, } = props;
|
|
24
24
|
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
25
|
-
const { directionClass, justifyContentClass, alignContentClass, alignItemsClass, fillClass, borderColorClass, borderTypeClass,
|
|
25
|
+
const { dataTestId, dataTour, directionClass, justifyContentClass, alignContentClass, alignItemsClass, fillClass, borderColorClass, borderTypeClass, flowClass, positionClass, shapeClass, widthClass, wrapClass, } = propsGenerator;
|
|
26
26
|
// @ts-expect-error
|
|
27
27
|
const { styles: flexStyles, wrapper: flexWrapperStyles } = useStyles.useStyles(props);
|
|
28
|
-
return (jsxRuntime.jsx(Tag, { id: id, className: clsx(className, 'flex', widthClass && `width_${widthClass}`, alignContentClass && `flex_align-content_${alignContentClass}`, alignItemsClass && `flex_align-items_${alignItemsClass}`, directionClass && `flex_direction_${directionClass}`, fillClass && `fill_${fillClass}`, flowClass && `flex_flow_${flowClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, positionClass && `position_${positionClass}`, justifyContentClass && `flex_justify-content_${justifyContentClass}`, shapeClass && `flex_shape_${shapeClass}`, type && `flex_type_${type}`, wrapClass && `flex_wrap_${wrapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, style: Object.assign({}, flexStyles, style), onClick: onClick, children: jsxRuntime.jsx("div", { className: "flex__wrapper", style: flexWrapperStyles, children: children }) }));
|
|
28
|
+
return (jsxRuntime.jsx(Tag, { id: id, className: clsx(className, 'flex', widthClass && `width_${widthClass}`, alignContentClass && `flex_align-content_${alignContentClass}`, alignItemsClass && `flex_align-items_${alignItemsClass}`, directionClass && `flex_direction_${directionClass}`, fillClass && `fill_${fillClass}`, flowClass && `flex_flow_${flowClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, positionClass && `position_${positionClass}`, justifyContentClass && `flex_justify-content_${justifyContentClass}`, shapeClass && `flex_shape_${shapeClass}`, type && `flex_type_${type}`, print === false && 'no-print', print === true && 'print', wrapClass && `flex_wrap_${wrapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, style: Object.assign({}, flexStyles, style), onClick: onClick, children: jsxRuntime.jsx("div", { className: "flex__wrapper", style: flexWrapperStyles, children: children }) }));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function FlexItem(props) {
|
|
32
|
-
const { className, htmlFor, style, tag: Tag = 'div', children } = props;
|
|
32
|
+
const { className, htmlFor, print, style, tag: Tag = 'div', children } = props;
|
|
33
33
|
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
34
|
-
const { directionClass, justifyContentClass, alignItemsClass, alignSelfClass, fillClass, fillHoverClass,
|
|
34
|
+
const { dataTestId, dataTour, directionClass, justifyContentClass, alignItemsClass, alignSelfClass, fillClass, fillHoverClass, growClass, positionClass, shapeClass, widthClass, wrapClass, } = propsGenerator;
|
|
35
35
|
// @ts-expect-error
|
|
36
36
|
const { styles: flexItemStyles } = useStyles.useStyles(props);
|
|
37
37
|
return (jsxRuntime.jsx(Tag, { className: clsx(className, 'flex__item', positionClass && `position_${positionClass}`, alignItemsClass && `flex__item_align-items_${alignItemsClass}`, alignSelfClass && `flex__item_align-self_${alignSelfClass}`, directionClass && `flex__item_direction_${directionClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, growClass && `flex__item_grow_${growClass}`, justifyContentClass &&
|
|
38
|
-
`flex__item_justify-content_${justifyContentClass}`, shapeClass && `flex__item_shape_${shapeClass}`, widthClass && `width_${widthClass}`, wrapClass && `flex__item_wrap_${wrapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: Object.assign({}, flexItemStyles, style), children: children }));
|
|
38
|
+
`flex__item_justify-content_${justifyContentClass}`, shapeClass && `flex__item_shape_${shapeClass}`, print === false && 'no-print', print === true && 'print', widthClass && `width_${widthClass}`, wrapClass && `flex__item_wrap_${wrapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: Object.assign({}, flexItemStyles, style), children: children }));
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
exports.Flex = Flex;
|
|
@@ -20,30 +20,30 @@ require('../hooks/useStyles/styleAttributes.js');
|
|
|
20
20
|
require('lodash/maxBy');
|
|
21
21
|
|
|
22
22
|
function Grid(props) {
|
|
23
|
-
const { id, className, dataTour, type, horizontalResizing, horizontalScroll, tag: Tag = 'div', useGridSystem, verticalResizing, before, after, onClick, onDoubleClick, children, } = props;
|
|
23
|
+
const { id, className, dataTour, type, horizontalResizing, horizontalScroll, print, tag: Tag = 'div', useGridSystem, verticalResizing, before, after, onClick, onDoubleClick, children, } = props;
|
|
24
24
|
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
25
25
|
const { justifyContentClass, justifyItemsClass, alignContentClass, alignItemsClass, fillClass, fillHoverClass, borderColorClass, columnGapClass, columnsClass, heightClass, rowGapClass, rowsClass, widthClass, } = propsGenerator;
|
|
26
26
|
// @ts-expect-error
|
|
27
27
|
const { styles: gridStyles } = useStyles.useStyles(props);
|
|
28
|
-
return (jsxRuntime.jsxs(Tag, { id: id, className: clsx(className, 'grid', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, useGridSystem && `grid_state_system`, horizontalScroll && `grid_scroll_horizontal`, type && `grid_type_${type}`, columnsClass && `grid_columns_${columnsClass}`, rowsClass && `grid_rows_${rowsClass}`, rowGapClass && `grid_row-gap_${rowGapClass}`, columnGapClass && `grid_column-gap_${columnGapClass}`, alignContentClass && `grid_align-content_${alignContentClass}`, alignItemsClass && `grid_align-items_${alignItemsClass}`, borderColorClass && `border-color_${borderColorClass}`, justifyContentClass && `grid_justify-content_${justifyContentClass}`, justifyItemsClass && `grid_justify-items_${justifyItemsClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, horizontalResizing && `grid_horizontal-resizing_${horizontalResizing}`, verticalResizing && `grid_vertical-resizing_${verticalResizing}
|
|
28
|
+
return (jsxRuntime.jsxs(Tag, { id: id, className: clsx(className, 'grid', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, useGridSystem && `grid_state_system`, horizontalScroll && `grid_scroll_horizontal`, type && `grid_type_${type}`, columnsClass && `grid_columns_${columnsClass}`, rowsClass && `grid_rows_${rowsClass}`, rowGapClass && `grid_row-gap_${rowGapClass}`, columnGapClass && `grid_column-gap_${columnGapClass}`, alignContentClass && `grid_align-content_${alignContentClass}`, alignItemsClass && `grid_align-items_${alignItemsClass}`, borderColorClass && `border-color_${borderColorClass}`, justifyContentClass && `grid_justify-content_${justifyContentClass}`, justifyItemsClass && `grid_justify-items_${justifyItemsClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, horizontalResizing && `grid_horizontal-resizing_${horizontalResizing}`, verticalResizing && `grid_vertical-resizing_${verticalResizing}`, print === false && 'no-print', print === true && 'print'), dataTour: dataTour, style: gridStyles, onClick: onClick, onDoubleClick: onDoubleClick, children: [before && jsxRuntime.jsx("div", { className: "grid__before", children: before }), children, after && jsxRuntime.jsx("div", { className: "grid__after", children: after })] }));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function GridItem(props) {
|
|
32
|
-
const { id, className, style, onClick, children } = props;
|
|
32
|
+
const { id, className, print, style, onClick, children } = props;
|
|
33
33
|
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
34
|
-
const { directionClass, justifySelfClass, alignSelfClass, fillClass, fillHoverClass, columnEndClass, columnGapClass, columnSpanClass, columnStartClass,
|
|
34
|
+
const { dataTestId, dataTour, directionClass, justifySelfClass, alignSelfClass, fillClass, fillHoverClass, columnEndClass, columnGapClass, columnSpanClass, columnStartClass, gapClass, heightClass, orderClass, rowEndClass, rowGapClass, rowSpanClass, rowStartClass, widthClass, } = propsGenerator;
|
|
35
35
|
// @ts-expect-error
|
|
36
36
|
const { styles: gridItemStyles } = useStyles.useStyles(props);
|
|
37
|
-
return (jsxRuntime.jsx("div", { id: id, className: clsx(className, 'grid__item', orderClass && `order_${orderClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, alignSelfClass && `grid__item_align-self_${alignSelfClass}`, justifySelfClass && `grid__item_justify-self_${justifySelfClass}`, columnStartClass && `grid__item_column-start_${columnStartClass}`, columnEndClass && `grid__item_column-end_${columnEndClass}`, columnSpanClass && `grid__item_column-span_${columnSpanClass}`, rowStartClass && `grid__item_row-start_${rowStartClass}`, rowEndClass && `grid__item_row-end_${rowEndClass}`, rowSpanClass && `grid__item_row-span_${rowSpanClass}`, directionClass && `direction_${directionClass}`, gapClass && `gap_${gapClass}`, widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, rowGapClass && `row-gap_${rowGapClass}`, columnGapClass && `column-gap_${columnGapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, style: Object.assign({}, gridItemStyles, style), onClick: onClick, children: children }));
|
|
37
|
+
return (jsxRuntime.jsx("div", { id: id, className: clsx(className, 'grid__item', orderClass && `order_${orderClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, alignSelfClass && `grid__item_align-self_${alignSelfClass}`, justifySelfClass && `grid__item_justify-self_${justifySelfClass}`, columnStartClass && `grid__item_column-start_${columnStartClass}`, columnEndClass && `grid__item_column-end_${columnEndClass}`, columnSpanClass && `grid__item_column-span_${columnSpanClass}`, rowStartClass && `grid__item_row-start_${rowStartClass}`, rowEndClass && `grid__item_row-end_${rowEndClass}`, rowSpanClass && `grid__item_row-span_${rowSpanClass}`, directionClass && `direction_${directionClass}`, gapClass && `gap_${gapClass}`, widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, rowGapClass && `row-gap_${rowGapClass}`, print === false && 'no-print', print === true && 'print', columnGapClass && `column-gap_${columnGapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, style: Object.assign({}, gridItemStyles, style), onClick: onClick, children: children }));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
function GridRow(props) {
|
|
41
|
-
const { id, className, dataTestId, dataTour, htmlFor, tag: Tag = 'div', onClick, children, } = props;
|
|
41
|
+
const { id, className, dataTestId, dataTour, htmlFor, print, tag: Tag = 'div', onClick, children, } = props;
|
|
42
42
|
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
43
43
|
const { fillClass, fillHoverClass, borderColorClass, heightClass, widthClass, } = propsGenerator;
|
|
44
44
|
// @ts-expect-error
|
|
45
45
|
const { styles: gridRowStyles } = useStyles.useStyles(props);
|
|
46
|
-
return (jsxRuntime.jsx(Tag, { id: id, className: clsx(className, 'grid__row', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, borderColorClass && `border-color_${borderColorClass}`), "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: gridRowStyles, onClick: onClick, children: children }));
|
|
46
|
+
return (jsxRuntime.jsx(Tag, { id: id, className: clsx(className, 'grid__row', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, print === false && 'no-print', print === true && 'print', borderColorClass && `border-color_${borderColorClass}`), "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: gridRowStyles, onClick: onClick, children: children }));
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
exports.Grid = Grid;
|
|
@@ -137,7 +137,7 @@ const getOrCreateModalElement = (modalQuerySelector, className = '') => {
|
|
|
137
137
|
};
|
|
138
138
|
// Modal component that is an abstraction around the portal API.
|
|
139
139
|
const Modal = React.forwardRef(function Modal(props, ref) {
|
|
140
|
-
const { id, appearance, className, dataTestId, dataTour, title, absoluteHeader = false, modalQuerySelector = '#modal-global', scroll = false, stickyHeader = false, closeIcon, isDisabled, isSkeleton, isCloseOnBlur = true, isOpen: initialIsOpen = false, isOverlay = true, isScrollOnOpen = true, isSetFocusOnOpen = true, onClickOverlay, onCloseModal, onOpenModal, children, } = props;
|
|
140
|
+
const { id, appearance, className, dataTestId, dataTour, title, absoluteHeader = false, modalQuerySelector = '#modal-global', print, scroll = false, stickyHeader = false, closeIcon, isDisabled, isSkeleton, isCloseOnBlur = true, isOpen: initialIsOpen = false, isOverlay = true, isScrollOnOpen = true, isSetFocusOnOpen = true, onClickOverlay, onCloseModal, onOpenModal, children, } = props;
|
|
141
141
|
// Query DOM element
|
|
142
142
|
const [modalElement, setModalElement] = React.useState(null);
|
|
143
143
|
const [isOpen, setIsOpen] = React.useState(initialIsOpen);
|
|
@@ -211,7 +211,11 @@ const Modal = React.forwardRef(function Modal(props, ref) {
|
|
|
211
211
|
addModalProps(modalElement);
|
|
212
212
|
}, [isOpen]); // eslint-disable-line
|
|
213
213
|
React.useLayoutEffect(() => {
|
|
214
|
-
|
|
214
|
+
let classNameModal = className;
|
|
215
|
+
if (print === false) {
|
|
216
|
+
classNameModal = clsx(className, 'no-print');
|
|
217
|
+
}
|
|
218
|
+
const element = getOrCreateModalElement(modalQuerySelector, classNameModal);
|
|
215
219
|
setModalElement(element);
|
|
216
220
|
if (element) {
|
|
217
221
|
addModalProps(element);
|
|
@@ -228,7 +232,7 @@ const Modal = React.forwardRef(function Modal(props, ref) {
|
|
|
228
232
|
return (modalElement &&
|
|
229
233
|
ReactDOM.createPortal(
|
|
230
234
|
// Any valid React child: JSX, strings, arrays, etc.
|
|
231
|
-
isOpen ? (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("div", { id: id, className: clsx('modal__content', absoluteHeader && 'modal__content-absolute-header', !title && !closeIcon && 'modal__content-no-header', fillClass && `fill_${fillClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, shapeClass && `shape_${shapeClass}`, sizeClass && `modal_size_${sizeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, elevationClass && `elevation_${elevationClass}`, scroll && `modal-scroll_${scroll}`, stickyHeader && 'modal-scroll_header_sticky', isSkeleton && 'modal_skeleton'), ref: modalContentRef, "data-test-id": dataTestId, "data-tour": dataTour, style: modalStyles, tabIndex: 0, onBlur: isCloseOnBlur ? closeModal : undefined, children: [(title || closeIcon) && (jsxRuntime.jsxs("div", { className: clsx('modal__header', fillClass && `fill_${fillClass}`), children: [title && (jsxRuntime.jsx(Icon.Title, { width: titleTextWidth, size: titleTextSize, textColor: titleTextColor, textColorHover: titleTextColorHover, textTruncate: titleTextTruncate, textWeight: titleTextWeight, textWrap: titleTextWrap,
|
|
235
|
+
isOpen ? (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("div", { id: id, className: clsx('modal__content', absoluteHeader && 'modal__content-absolute-header', !title && !closeIcon && 'modal__content-no-header', fillClass && `fill_${fillClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, shapeClass && `shape_${shapeClass}`, sizeClass && `modal_size_${sizeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, elevationClass && `elevation_${elevationClass}`, scroll && `modal-scroll_${scroll}`, stickyHeader && 'modal-scroll_header_sticky', isSkeleton && 'modal_skeleton'), ref: modalContentRef, "data-test-id": dataTestId, "data-tour": dataTour, style: modalStyles, tabIndex: 0, onBlur: isCloseOnBlur ? closeModal : undefined, children: [(title || closeIcon) && (jsxRuntime.jsxs("div", { className: clsx('modal__header', fillClass && `fill_${fillClass}`), children: [title && (jsxRuntime.jsx(Icon.Title, { width: titleTextWidth, flex: "1", size: titleTextSize, textColor: titleTextColor, textColorHover: titleTextColorHover, textTruncate: titleTextTruncate, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), closeIcon && (jsxRuntime.jsx("div", { className: "modal__close", onClick: closeModal, children: jsxRuntime.jsx(Icon.Icon, { appearance: `${closeIconAppearance} ${closeIconAppearanceSize}`, fillSize: closeIconFillSize, iconSize: closeIconSize, shape: closeIconShape, SvgImage: closeIconImage ?? _default.icons24.Action.Close }) }))] })), jsxRuntime.jsx("div", { className: "modal__content-wrapper", children: children })] }), jsxRuntime.jsx(Overlay.Overlay, { className: "modal__overlay",
|
|
232
236
|
// ref={modalOverlayRef}
|
|
233
237
|
fill: overlayFill, opacity: overlayOpacity, isOverlay: isOverlay, onClick: onClickOverlay })] })) : null,
|
|
234
238
|
// A DOM element
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const notificationsMock = [
|
|
4
4
|
{
|
|
5
5
|
key: 1,
|
|
6
|
+
type: 'float',
|
|
6
7
|
title: 'Text 123',
|
|
7
8
|
desc: 'Text 123',
|
|
8
9
|
status: 'error',
|
|
@@ -10,6 +11,7 @@ const notificationsMock = [
|
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
13
|
key: 2,
|
|
14
|
+
type: 'float',
|
|
13
15
|
title: 'Text 123',
|
|
14
16
|
desc: 'Text 123',
|
|
15
17
|
status: 'warning',
|
|
@@ -17,6 +19,7 @@ const notificationsMock = [
|
|
|
17
19
|
},
|
|
18
20
|
{
|
|
19
21
|
key: 3,
|
|
22
|
+
type: 'float',
|
|
20
23
|
title: 'Text 123',
|
|
21
24
|
desc: 'Text 123',
|
|
22
25
|
status: 'info',
|
|
@@ -24,6 +27,7 @@ const notificationsMock = [
|
|
|
24
27
|
},
|
|
25
28
|
{
|
|
26
29
|
key: 4,
|
|
30
|
+
type: 'float',
|
|
27
31
|
title: 'Text 123',
|
|
28
32
|
desc: 'Text 123',
|
|
29
33
|
status: 'success',
|
|
@@ -180,20 +180,20 @@ const notificationConfig = {
|
|
|
180
180
|
},
|
|
181
181
|
};
|
|
182
182
|
function Notification(props) {
|
|
183
|
-
const { id, appearance, className, dataTestId, dataTour, type
|
|
183
|
+
const { id, appearance, className, dataTestId, dataTour, type = 'float', title, text, before, after, isSkeleton, isLoading, onClickButton, onClickClose, } = props;
|
|
184
184
|
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, notificationConfig);
|
|
185
185
|
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
186
186
|
const { fillClass, fillHoverClass, titleTextColor, titleTextSize, descTextColor, descTextSize, buttonAppearance, buttonLabel, elevationClass, loaderAppearance, loaderAppearanceSize, loaderFill, loaderItemFill, loaderSize, loaderType = 'hug', shapeClass, shapeStrengthClass, sizeClass, widthClass, closeIcon, closeIconAppearance, closeIconAppearanceSize, closeIconSrc, } = propsGenerator;
|
|
187
187
|
// @ts-expect-error
|
|
188
188
|
const { styles: notificationStyles } = useStyles.useStyles(props);
|
|
189
|
-
return (jsxRuntime.jsxs("div", { className: clsx('notification__item',
|
|
189
|
+
return (jsxRuntime.jsxs("div", { className: clsx('notification__item', `notification__item_${type}`, widthClass && `width_${widthClass}`, elevationClass && `elevation_${elevationClass}`, fillClass && `fill_${fillClass}`, sizeClass && `notification__item_size_${sizeClass}`, type && `notification__item_type_${type}`, fillHoverClass && `fill_${fillHoverClass}`, isSkeleton && `notification__item_skeleton`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`), "data-test-id": dataTestId, "data-tour": dataTour, style: notificationStyles, children: [before, jsxRuntime.jsxs("div", { className: clsx(className, 'notification__item-wrapper'), children: [title && (jsxRuntime.jsx(Text.Text, { className: "notification__item-title", size: titleTextSize, textColor: titleTextColor, children: title })), text && (jsxRuntime.jsx(Text.Text, { className: "notification__item-text", size: descTextSize, textColor: descTextColor, children: text })), isLoading && (jsxRuntime.jsx(Loader.Loader, { appearance: `${loaderAppearance} ${loaderAppearanceSize}`, className: clsx(className, 'button__loader'), type: loaderType, size: loaderSize, fill: loaderFill, itemFill: loaderItemFill })), onClickClose && (jsxRuntime.jsx(Icon.Icon, { appearance: `${closeIconAppearance} ${closeIconAppearanceSize}`, className: clsx('notification__item-close', 'cursor_type_pointer'), imageSrc: closeIconSrc, SvgImage: closeIcon, onClick: () => onClickClose && onClickClose(id) })), (onClickButton || buttonLabel) && (jsxRuntime.jsx(Button.Button, { appearance: buttonAppearance, className: "notification__item-button", width: "fill", label: buttonLabel, onClick: onClickButton }))] }), after] }));
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
function NotificationWrapper(props) {
|
|
193
193
|
const notifications = Notifications.useNotifications();
|
|
194
194
|
const { hideNotifications } = Notifications.useNotificationsAPI();
|
|
195
195
|
const { className } = props;
|
|
196
|
-
return (jsxRuntime.jsx("div", { className: clsx('notification', className), children: jsxRuntime.jsx("div", { className: "notification__wrapper", children: notifications.map((notification
|
|
196
|
+
return (jsxRuntime.jsx("div", { className: clsx('notification', className), children: jsxRuntime.jsx("div", { className: "notification__wrapper", children: notifications.map((notification) => (jsxRuntime.jsx(Notification, { id: notification.id, appearance: notification.appearance, type: notification.type, title: notification.title, status: notification.status, text: notification.text, buttonLabel: notification.buttonLabel, after: notification.after, closeIcon: notification.closeIcon, closeIconSrc: notification.closeIconSrc, isLoading: notification.isLoading, onClickButton: notification.onClickButton, onClickClose: hideNotifications }, notification.id))) }) }));
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
exports.Notification = Notification;
|
|
@@ -9,7 +9,7 @@ var useAppearanceConfig = require('../hooks/useAppearanceConfig/useAppearanceCon
|
|
|
9
9
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
10
10
|
var useStyles = require('../hooks/useStyles/useStyles.js');
|
|
11
11
|
var Button = require('../../Button_cjs_CGIzPuXo.js');
|
|
12
|
-
var Group = require('../../
|
|
12
|
+
var Group = require('../../Group_cjs_BxbmyFvN.js');
|
|
13
13
|
var Text = require('../../Text_cjs_DaH5tVvz.js');
|
|
14
14
|
require('@itcase/common');
|
|
15
15
|
require('../context/UrlAssetPrefix.js');
|
|
@@ -6,7 +6,7 @@ var Icon = require('../../Icon_cjs_B5o0K55R.js');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
8
|
var CreatableSelect = require('react-select/creatable');
|
|
9
|
-
var Group = require('../../
|
|
9
|
+
var Group = require('../../Group_cjs_BxbmyFvN.js');
|
|
10
10
|
var Text = require('../../Text_cjs_DaH5tVvz.js');
|
|
11
11
|
var useAppearanceConfig = require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
12
12
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
@@ -117,21 +117,26 @@ function useNotifications() {
|
|
|
117
117
|
function useNotificationsAPI() {
|
|
118
118
|
return React.useContext(NotificationsAPIContext);
|
|
119
119
|
}
|
|
120
|
+
const statusToAppearanceList = {
|
|
121
|
+
error: 'errorPrimary sizeS solid rounded',
|
|
122
|
+
info: 'infoPrimary sizeS solid rounded',
|
|
123
|
+
success: 'successPrimary sizeS solid rounded',
|
|
124
|
+
warning: 'warningPrimary sizeS solid rounded',
|
|
125
|
+
};
|
|
120
126
|
function createNotification(notification, onClose) {
|
|
121
127
|
// Default notification item properties
|
|
122
128
|
let id = uuid.v4().split('-')[0];
|
|
123
129
|
let title = '';
|
|
124
130
|
let text = '';
|
|
125
|
-
let float = null;
|
|
126
|
-
let toast = null;
|
|
127
|
-
let global = null;
|
|
128
131
|
let closeIcon = '';
|
|
129
132
|
let closeIconSrc = '';
|
|
133
|
+
let type = 'float';
|
|
130
134
|
let buttonLabel = '';
|
|
131
135
|
let status = STATUSES.warning;
|
|
132
136
|
let closeByTime = 4500;
|
|
133
|
-
let appearance =
|
|
137
|
+
let appearance = statusToAppearanceList[status];
|
|
134
138
|
let after = null;
|
|
139
|
+
let isLoading = false;
|
|
135
140
|
let closeIconAppearance = '';
|
|
136
141
|
let onClickButton = null;
|
|
137
142
|
if (typeof notification === 'string') {
|
|
@@ -141,48 +146,36 @@ function createNotification(notification, onClose) {
|
|
|
141
146
|
id = notification.id ?? id;
|
|
142
147
|
title = notification.title ?? title;
|
|
143
148
|
text = notification.text ?? text;
|
|
144
|
-
float = notification.float ?? float;
|
|
145
|
-
toast = notification.toast ?? toast;
|
|
146
149
|
closeIconAppearance =
|
|
147
150
|
notification.closeIconAppearance ?? closeIconAppearance;
|
|
148
|
-
|
|
151
|
+
type = notification.type ?? type;
|
|
149
152
|
closeIcon = notification.closeIcon ?? closeIcon;
|
|
150
153
|
closeIconSrc = notification.closeIconSrc ?? closeIconSrc;
|
|
151
154
|
buttonLabel = notification.buttonLabel ?? buttonLabel;
|
|
152
155
|
onClickButton = notification.onClickButton ?? onClickButton;
|
|
153
156
|
status = notification.status ?? status;
|
|
154
157
|
closeByTime = notification.closeByTime ?? closeByTime;
|
|
158
|
+
isLoading = notification.isLoading ?? isLoading;
|
|
155
159
|
after = notification.after ?? after;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
break;
|
|
161
|
-
case 'info':
|
|
162
|
-
appearance = 'infoPrimary sizeM solid';
|
|
163
|
-
break;
|
|
164
|
-
case 'error':
|
|
165
|
-
appearance = 'errorPrimary sizeM solid';
|
|
166
|
-
break;
|
|
167
|
-
case 'warning':
|
|
168
|
-
appearance = 'warningPrimary sizeM solid';
|
|
169
|
-
break;
|
|
160
|
+
appearance =
|
|
161
|
+
notification.appearance ??
|
|
162
|
+
statusToAppearanceList[notification.status] ??
|
|
163
|
+
appearance;
|
|
170
164
|
}
|
|
171
165
|
return {
|
|
172
166
|
id: id,
|
|
173
167
|
appearance: appearance,
|
|
168
|
+
type: type,
|
|
174
169
|
title: title,
|
|
175
170
|
status: status,
|
|
176
171
|
text: text,
|
|
177
172
|
buttonLabel: buttonLabel,
|
|
178
|
-
float: float,
|
|
179
|
-
global: global,
|
|
180
|
-
toast: toast,
|
|
181
173
|
after: after,
|
|
182
174
|
closeByTime: closeByTime,
|
|
183
175
|
closeIcon: closeIcon,
|
|
184
176
|
closeIconAppearance: closeIconAppearance,
|
|
185
177
|
closeIconSrc: closeIconSrc,
|
|
178
|
+
isLoading: isLoading,
|
|
186
179
|
onClickButton: onClickButton,
|
|
187
180
|
onClose: onClose,
|
|
188
181
|
};
|
|
@@ -4,7 +4,7 @@ import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceC
|
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
6
6
|
import { A as Avatar } from '../Avatar_es_Cp4-nxIj.js';
|
|
7
|
-
import { G as Group } from '../
|
|
7
|
+
import { G as Group } from '../Group_es_p5hBFgw4.js';
|
|
8
8
|
import { T as Text } from '../Text_es_RDU9GLCV.js';
|
|
9
9
|
import 'react';
|
|
10
10
|
import 'lodash/camelCase';
|
package/dist/components/Flex.js
CHANGED
|
@@ -18,22 +18,22 @@ import '../hooks/useStyles/styleAttributes.js';
|
|
|
18
18
|
import 'lodash/maxBy';
|
|
19
19
|
|
|
20
20
|
function Flex(props) {
|
|
21
|
-
const { id, className, type, style, tag: Tag = 'div', onClick, children, } = props;
|
|
21
|
+
const { id, className, type, print, style, tag: Tag = 'div', onClick, children, } = props;
|
|
22
22
|
const propsGenerator = useDevicePropsGenerator(props);
|
|
23
|
-
const { directionClass, justifyContentClass, alignContentClass, alignItemsClass, fillClass, borderColorClass, borderTypeClass,
|
|
23
|
+
const { dataTestId, dataTour, directionClass, justifyContentClass, alignContentClass, alignItemsClass, fillClass, borderColorClass, borderTypeClass, flowClass, positionClass, shapeClass, widthClass, wrapClass, } = propsGenerator;
|
|
24
24
|
// @ts-expect-error
|
|
25
25
|
const { styles: flexStyles, wrapper: flexWrapperStyles } = useStyles(props);
|
|
26
|
-
return (jsx(Tag, { id: id, className: clsx(className, 'flex', widthClass && `width_${widthClass}`, alignContentClass && `flex_align-content_${alignContentClass}`, alignItemsClass && `flex_align-items_${alignItemsClass}`, directionClass && `flex_direction_${directionClass}`, fillClass && `fill_${fillClass}`, flowClass && `flex_flow_${flowClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, positionClass && `position_${positionClass}`, justifyContentClass && `flex_justify-content_${justifyContentClass}`, shapeClass && `flex_shape_${shapeClass}`, type && `flex_type_${type}`, wrapClass && `flex_wrap_${wrapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, style: Object.assign({}, flexStyles, style), onClick: onClick, children: jsx("div", { className: "flex__wrapper", style: flexWrapperStyles, children: children }) }));
|
|
26
|
+
return (jsx(Tag, { id: id, className: clsx(className, 'flex', widthClass && `width_${widthClass}`, alignContentClass && `flex_align-content_${alignContentClass}`, alignItemsClass && `flex_align-items_${alignItemsClass}`, directionClass && `flex_direction_${directionClass}`, fillClass && `fill_${fillClass}`, flowClass && `flex_flow_${flowClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, positionClass && `position_${positionClass}`, justifyContentClass && `flex_justify-content_${justifyContentClass}`, shapeClass && `flex_shape_${shapeClass}`, type && `flex_type_${type}`, print === false && 'no-print', print === true && 'print', wrapClass && `flex_wrap_${wrapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, style: Object.assign({}, flexStyles, style), onClick: onClick, children: jsx("div", { className: "flex__wrapper", style: flexWrapperStyles, children: children }) }));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
function FlexItem(props) {
|
|
30
|
-
const { className, htmlFor, style, tag: Tag = 'div', children } = props;
|
|
30
|
+
const { className, htmlFor, print, style, tag: Tag = 'div', children } = props;
|
|
31
31
|
const propsGenerator = useDevicePropsGenerator(props);
|
|
32
|
-
const { directionClass, justifyContentClass, alignItemsClass, alignSelfClass, fillClass, fillHoverClass,
|
|
32
|
+
const { dataTestId, dataTour, directionClass, justifyContentClass, alignItemsClass, alignSelfClass, fillClass, fillHoverClass, growClass, positionClass, shapeClass, widthClass, wrapClass, } = propsGenerator;
|
|
33
33
|
// @ts-expect-error
|
|
34
34
|
const { styles: flexItemStyles } = useStyles(props);
|
|
35
35
|
return (jsx(Tag, { className: clsx(className, 'flex__item', positionClass && `position_${positionClass}`, alignItemsClass && `flex__item_align-items_${alignItemsClass}`, alignSelfClass && `flex__item_align-self_${alignSelfClass}`, directionClass && `flex__item_direction_${directionClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, growClass && `flex__item_grow_${growClass}`, justifyContentClass &&
|
|
36
|
-
`flex__item_justify-content_${justifyContentClass}`, shapeClass && `flex__item_shape_${shapeClass}`, widthClass && `width_${widthClass}`, wrapClass && `flex__item_wrap_${wrapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: Object.assign({}, flexItemStyles, style), children: children }));
|
|
36
|
+
`flex__item_justify-content_${justifyContentClass}`, shapeClass && `flex__item_shape_${shapeClass}`, print === false && 'no-print', print === true && 'print', widthClass && `width_${widthClass}`, wrapClass && `flex__item_wrap_${wrapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: Object.assign({}, flexItemStyles, style), children: children }));
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export { Flex, FlexItem };
|
package/dist/components/Grid.js
CHANGED
|
@@ -18,30 +18,30 @@ import '../hooks/useStyles/styleAttributes.js';
|
|
|
18
18
|
import 'lodash/maxBy';
|
|
19
19
|
|
|
20
20
|
function Grid(props) {
|
|
21
|
-
const { id, className, dataTour, type, horizontalResizing, horizontalScroll, tag: Tag = 'div', useGridSystem, verticalResizing, before, after, onClick, onDoubleClick, children, } = props;
|
|
21
|
+
const { id, className, dataTour, type, horizontalResizing, horizontalScroll, print, tag: Tag = 'div', useGridSystem, verticalResizing, before, after, onClick, onDoubleClick, children, } = props;
|
|
22
22
|
const propsGenerator = useDevicePropsGenerator(props);
|
|
23
23
|
const { justifyContentClass, justifyItemsClass, alignContentClass, alignItemsClass, fillClass, fillHoverClass, borderColorClass, columnGapClass, columnsClass, heightClass, rowGapClass, rowsClass, widthClass, } = propsGenerator;
|
|
24
24
|
// @ts-expect-error
|
|
25
25
|
const { styles: gridStyles } = useStyles(props);
|
|
26
|
-
return (jsxs(Tag, { id: id, className: clsx(className, 'grid', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, useGridSystem && `grid_state_system`, horizontalScroll && `grid_scroll_horizontal`, type && `grid_type_${type}`, columnsClass && `grid_columns_${columnsClass}`, rowsClass && `grid_rows_${rowsClass}`, rowGapClass && `grid_row-gap_${rowGapClass}`, columnGapClass && `grid_column-gap_${columnGapClass}`, alignContentClass && `grid_align-content_${alignContentClass}`, alignItemsClass && `grid_align-items_${alignItemsClass}`, borderColorClass && `border-color_${borderColorClass}`, justifyContentClass && `grid_justify-content_${justifyContentClass}`, justifyItemsClass && `grid_justify-items_${justifyItemsClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, horizontalResizing && `grid_horizontal-resizing_${horizontalResizing}`, verticalResizing && `grid_vertical-resizing_${verticalResizing}
|
|
26
|
+
return (jsxs(Tag, { id: id, className: clsx(className, 'grid', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, useGridSystem && `grid_state_system`, horizontalScroll && `grid_scroll_horizontal`, type && `grid_type_${type}`, columnsClass && `grid_columns_${columnsClass}`, rowsClass && `grid_rows_${rowsClass}`, rowGapClass && `grid_row-gap_${rowGapClass}`, columnGapClass && `grid_column-gap_${columnGapClass}`, alignContentClass && `grid_align-content_${alignContentClass}`, alignItemsClass && `grid_align-items_${alignItemsClass}`, borderColorClass && `border-color_${borderColorClass}`, justifyContentClass && `grid_justify-content_${justifyContentClass}`, justifyItemsClass && `grid_justify-items_${justifyItemsClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, horizontalResizing && `grid_horizontal-resizing_${horizontalResizing}`, verticalResizing && `grid_vertical-resizing_${verticalResizing}`, print === false && 'no-print', print === true && 'print'), dataTour: dataTour, style: gridStyles, onClick: onClick, onDoubleClick: onDoubleClick, children: [before && jsx("div", { className: "grid__before", children: before }), children, after && jsx("div", { className: "grid__after", children: after })] }));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
function GridItem(props) {
|
|
30
|
-
const { id, className, style, onClick, children } = props;
|
|
30
|
+
const { id, className, print, style, onClick, children } = props;
|
|
31
31
|
const propsGenerator = useDevicePropsGenerator(props);
|
|
32
|
-
const { directionClass, justifySelfClass, alignSelfClass, fillClass, fillHoverClass, columnEndClass, columnGapClass, columnSpanClass, columnStartClass,
|
|
32
|
+
const { dataTestId, dataTour, directionClass, justifySelfClass, alignSelfClass, fillClass, fillHoverClass, columnEndClass, columnGapClass, columnSpanClass, columnStartClass, gapClass, heightClass, orderClass, rowEndClass, rowGapClass, rowSpanClass, rowStartClass, widthClass, } = propsGenerator;
|
|
33
33
|
// @ts-expect-error
|
|
34
34
|
const { styles: gridItemStyles } = useStyles(props);
|
|
35
|
-
return (jsx("div", { id: id, className: clsx(className, 'grid__item', orderClass && `order_${orderClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, alignSelfClass && `grid__item_align-self_${alignSelfClass}`, justifySelfClass && `grid__item_justify-self_${justifySelfClass}`, columnStartClass && `grid__item_column-start_${columnStartClass}`, columnEndClass && `grid__item_column-end_${columnEndClass}`, columnSpanClass && `grid__item_column-span_${columnSpanClass}`, rowStartClass && `grid__item_row-start_${rowStartClass}`, rowEndClass && `grid__item_row-end_${rowEndClass}`, rowSpanClass && `grid__item_row-span_${rowSpanClass}`, directionClass && `direction_${directionClass}`, gapClass && `gap_${gapClass}`, widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, rowGapClass && `row-gap_${rowGapClass}`, columnGapClass && `column-gap_${columnGapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, style: Object.assign({}, gridItemStyles, style), onClick: onClick, children: children }));
|
|
35
|
+
return (jsx("div", { id: id, className: clsx(className, 'grid__item', orderClass && `order_${orderClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, alignSelfClass && `grid__item_align-self_${alignSelfClass}`, justifySelfClass && `grid__item_justify-self_${justifySelfClass}`, columnStartClass && `grid__item_column-start_${columnStartClass}`, columnEndClass && `grid__item_column-end_${columnEndClass}`, columnSpanClass && `grid__item_column-span_${columnSpanClass}`, rowStartClass && `grid__item_row-start_${rowStartClass}`, rowEndClass && `grid__item_row-end_${rowEndClass}`, rowSpanClass && `grid__item_row-span_${rowSpanClass}`, directionClass && `direction_${directionClass}`, gapClass && `gap_${gapClass}`, widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, rowGapClass && `row-gap_${rowGapClass}`, print === false && 'no-print', print === true && 'print', columnGapClass && `column-gap_${columnGapClass}`), "data-test-id": dataTestId, "data-tour": dataTour, style: Object.assign({}, gridItemStyles, style), onClick: onClick, children: children }));
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function GridRow(props) {
|
|
39
|
-
const { id, className, dataTestId, dataTour, htmlFor, tag: Tag = 'div', onClick, children, } = props;
|
|
39
|
+
const { id, className, dataTestId, dataTour, htmlFor, print, tag: Tag = 'div', onClick, children, } = props;
|
|
40
40
|
const propsGenerator = useDevicePropsGenerator(props);
|
|
41
41
|
const { fillClass, fillHoverClass, borderColorClass, heightClass, widthClass, } = propsGenerator;
|
|
42
42
|
// @ts-expect-error
|
|
43
43
|
const { styles: gridRowStyles } = useStyles(props);
|
|
44
|
-
return (jsx(Tag, { id: id, className: clsx(className, 'grid__row', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, borderColorClass && `border-color_${borderColorClass}`), "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: gridRowStyles, onClick: onClick, children: children }));
|
|
44
|
+
return (jsx(Tag, { id: id, className: clsx(className, 'grid__row', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, print === false && 'no-print', print === true && 'print', borderColorClass && `border-color_${borderColorClass}`), "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: gridRowStyles, onClick: onClick, children: children }));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export { Grid, GridItem, GridRow };
|
package/dist/components/Group.js
CHANGED
package/dist/components/Modal.js
CHANGED
|
@@ -135,7 +135,7 @@ const getOrCreateModalElement = (modalQuerySelector, className = '') => {
|
|
|
135
135
|
};
|
|
136
136
|
// Modal component that is an abstraction around the portal API.
|
|
137
137
|
const Modal = React.forwardRef(function Modal(props, ref) {
|
|
138
|
-
const { id, appearance, className, dataTestId, dataTour, title, absoluteHeader = false, modalQuerySelector = '#modal-global', scroll = false, stickyHeader = false, closeIcon, isDisabled, isSkeleton, isCloseOnBlur = true, isOpen: initialIsOpen = false, isOverlay = true, isScrollOnOpen = true, isSetFocusOnOpen = true, onClickOverlay, onCloseModal, onOpenModal, children, } = props;
|
|
138
|
+
const { id, appearance, className, dataTestId, dataTour, title, absoluteHeader = false, modalQuerySelector = '#modal-global', print, scroll = false, stickyHeader = false, closeIcon, isDisabled, isSkeleton, isCloseOnBlur = true, isOpen: initialIsOpen = false, isOverlay = true, isScrollOnOpen = true, isSetFocusOnOpen = true, onClickOverlay, onCloseModal, onOpenModal, children, } = props;
|
|
139
139
|
// Query DOM element
|
|
140
140
|
const [modalElement, setModalElement] = useState(null);
|
|
141
141
|
const [isOpen, setIsOpen] = useState(initialIsOpen);
|
|
@@ -209,7 +209,11 @@ const Modal = React.forwardRef(function Modal(props, ref) {
|
|
|
209
209
|
addModalProps(modalElement);
|
|
210
210
|
}, [isOpen]); // eslint-disable-line
|
|
211
211
|
useLayoutEffect(() => {
|
|
212
|
-
|
|
212
|
+
let classNameModal = className;
|
|
213
|
+
if (print === false) {
|
|
214
|
+
classNameModal = clsx(className, 'no-print');
|
|
215
|
+
}
|
|
216
|
+
const element = getOrCreateModalElement(modalQuerySelector, classNameModal);
|
|
213
217
|
setModalElement(element);
|
|
214
218
|
if (element) {
|
|
215
219
|
addModalProps(element);
|
|
@@ -226,7 +230,7 @@ const Modal = React.forwardRef(function Modal(props, ref) {
|
|
|
226
230
|
return (modalElement &&
|
|
227
231
|
ReactDOM.createPortal(
|
|
228
232
|
// Any valid React child: JSX, strings, arrays, etc.
|
|
229
|
-
isOpen ? (jsxs(React.Fragment, { children: [jsxs("div", { id: id, className: clsx('modal__content', absoluteHeader && 'modal__content-absolute-header', !title && !closeIcon && 'modal__content-no-header', fillClass && `fill_${fillClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, shapeClass && `shape_${shapeClass}`, sizeClass && `modal_size_${sizeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, elevationClass && `elevation_${elevationClass}`, scroll && `modal-scroll_${scroll}`, stickyHeader && 'modal-scroll_header_sticky', isSkeleton && 'modal_skeleton'), ref: modalContentRef, "data-test-id": dataTestId, "data-tour": dataTour, style: modalStyles, tabIndex: 0, onBlur: isCloseOnBlur ? closeModal : undefined, children: [(title || closeIcon) && (jsxs("div", { className: clsx('modal__header', fillClass && `fill_${fillClass}`), children: [title && (jsx(Title, { width: titleTextWidth, size: titleTextSize, textColor: titleTextColor, textColorHover: titleTextColorHover, textTruncate: titleTextTruncate, textWeight: titleTextWeight, textWrap: titleTextWrap,
|
|
233
|
+
isOpen ? (jsxs(React.Fragment, { children: [jsxs("div", { id: id, className: clsx('modal__content', absoluteHeader && 'modal__content-absolute-header', !title && !closeIcon && 'modal__content-no-header', fillClass && `fill_${fillClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, shapeClass && `shape_${shapeClass}`, sizeClass && `modal_size_${sizeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, elevationClass && `elevation_${elevationClass}`, scroll && `modal-scroll_${scroll}`, stickyHeader && 'modal-scroll_header_sticky', isSkeleton && 'modal_skeleton'), ref: modalContentRef, "data-test-id": dataTestId, "data-tour": dataTour, style: modalStyles, tabIndex: 0, onBlur: isCloseOnBlur ? closeModal : undefined, children: [(title || closeIcon) && (jsxs("div", { className: clsx('modal__header', fillClass && `fill_${fillClass}`), children: [title && (jsx(Title, { width: titleTextWidth, flex: "1", size: titleTextSize, textColor: titleTextColor, textColorHover: titleTextColorHover, textTruncate: titleTextTruncate, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), closeIcon && (jsx("div", { className: "modal__close", onClick: closeModal, children: jsx(Icon, { appearance: `${closeIconAppearance} ${closeIconAppearanceSize}`, fillSize: closeIconFillSize, iconSize: closeIconSize, shape: closeIconShape, SvgImage: closeIconImage ?? icons24.Action.Close }) }))] })), jsx("div", { className: "modal__content-wrapper", children: children })] }), jsx(Overlay, { className: "modal__overlay",
|
|
230
234
|
// ref={modalOverlayRef}
|
|
231
235
|
fill: overlayFill, opacity: overlayOpacity, isOverlay: isOverlay, onClick: onClickOverlay })] })) : null,
|
|
232
236
|
// A DOM element
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const notificationsMock = [
|
|
2
2
|
{
|
|
3
3
|
key: 1,
|
|
4
|
+
type: 'float',
|
|
4
5
|
title: 'Text 123',
|
|
5
6
|
desc: 'Text 123',
|
|
6
7
|
status: 'error',
|
|
@@ -8,6 +9,7 @@ const notificationsMock = [
|
|
|
8
9
|
},
|
|
9
10
|
{
|
|
10
11
|
key: 2,
|
|
12
|
+
type: 'float',
|
|
11
13
|
title: 'Text 123',
|
|
12
14
|
desc: 'Text 123',
|
|
13
15
|
status: 'warning',
|
|
@@ -15,6 +17,7 @@ const notificationsMock = [
|
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
19
|
key: 3,
|
|
20
|
+
type: 'float',
|
|
18
21
|
title: 'Text 123',
|
|
19
22
|
desc: 'Text 123',
|
|
20
23
|
status: 'info',
|
|
@@ -22,6 +25,7 @@ const notificationsMock = [
|
|
|
22
25
|
},
|
|
23
26
|
{
|
|
24
27
|
key: 4,
|
|
28
|
+
type: 'float',
|
|
25
29
|
title: 'Text 123',
|
|
26
30
|
desc: 'Text 123',
|
|
27
31
|
status: 'success',
|
|
@@ -178,20 +178,20 @@ const notificationConfig = {
|
|
|
178
178
|
},
|
|
179
179
|
};
|
|
180
180
|
function Notification(props) {
|
|
181
|
-
const { id, appearance, className, dataTestId, dataTour, type
|
|
181
|
+
const { id, appearance, className, dataTestId, dataTour, type = 'float', title, text, before, after, isSkeleton, isLoading, onClickButton, onClickClose, } = props;
|
|
182
182
|
const appearanceConfig = useAppearanceConfig(appearance, notificationConfig);
|
|
183
183
|
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
184
184
|
const { fillClass, fillHoverClass, titleTextColor, titleTextSize, descTextColor, descTextSize, buttonAppearance, buttonLabel, elevationClass, loaderAppearance, loaderAppearanceSize, loaderFill, loaderItemFill, loaderSize, loaderType = 'hug', shapeClass, shapeStrengthClass, sizeClass, widthClass, closeIcon, closeIconAppearance, closeIconAppearanceSize, closeIconSrc, } = propsGenerator;
|
|
185
185
|
// @ts-expect-error
|
|
186
186
|
const { styles: notificationStyles } = useStyles(props);
|
|
187
|
-
return (jsxs("div", { className: clsx('notification__item',
|
|
187
|
+
return (jsxs("div", { className: clsx('notification__item', `notification__item_${type}`, widthClass && `width_${widthClass}`, elevationClass && `elevation_${elevationClass}`, fillClass && `fill_${fillClass}`, sizeClass && `notification__item_size_${sizeClass}`, type && `notification__item_type_${type}`, fillHoverClass && `fill_${fillHoverClass}`, isSkeleton && `notification__item_skeleton`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`), "data-test-id": dataTestId, "data-tour": dataTour, style: notificationStyles, children: [before, jsxs("div", { className: clsx(className, 'notification__item-wrapper'), children: [title && (jsx(Text, { className: "notification__item-title", size: titleTextSize, textColor: titleTextColor, children: title })), text && (jsx(Text, { className: "notification__item-text", size: descTextSize, textColor: descTextColor, children: text })), isLoading && (jsx(Loader, { appearance: `${loaderAppearance} ${loaderAppearanceSize}`, className: clsx(className, 'button__loader'), type: loaderType, size: loaderSize, fill: loaderFill, itemFill: loaderItemFill })), onClickClose && (jsx(Icon, { appearance: `${closeIconAppearance} ${closeIconAppearanceSize}`, className: clsx('notification__item-close', 'cursor_type_pointer'), imageSrc: closeIconSrc, SvgImage: closeIcon, onClick: () => onClickClose && onClickClose(id) })), (onClickButton || buttonLabel) && (jsx(Button, { appearance: buttonAppearance, className: "notification__item-button", width: "fill", label: buttonLabel, onClick: onClickButton }))] }), after] }));
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
function NotificationWrapper(props) {
|
|
191
191
|
const notifications = useNotifications();
|
|
192
192
|
const { hideNotifications } = useNotificationsAPI();
|
|
193
193
|
const { className } = props;
|
|
194
|
-
return (jsx("div", { className: clsx('notification', className), children: jsx("div", { className: "notification__wrapper", children: notifications.map((notification
|
|
194
|
+
return (jsx("div", { className: clsx('notification', className), children: jsx("div", { className: "notification__wrapper", children: notifications.map((notification) => (jsx(Notification, { id: notification.id, appearance: notification.appearance, type: notification.type, title: notification.title, status: notification.status, text: notification.text, buttonLabel: notification.buttonLabel, after: notification.after, closeIcon: notification.closeIcon, closeIconSrc: notification.closeIconSrc, isLoading: notification.isLoading, onClickButton: notification.onClickButton, onClickClose: hideNotifications }, notification.id))) }) }));
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
export { Notification, NotificationWrapper, notificationAppearance, notificationConfig };
|
|
@@ -7,7 +7,7 @@ import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceC
|
|
|
7
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
8
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
9
9
|
import { B as Button } from '../Button_es_CtAnUzZA.js';
|
|
10
|
-
import { G as Group } from '../
|
|
10
|
+
import { G as Group } from '../Group_es_p5hBFgw4.js';
|
|
11
11
|
import { T as Text } from '../Text_es_RDU9GLCV.js';
|
|
12
12
|
import '@itcase/common';
|
|
13
13
|
import '../context/UrlAssetPrefix.js';
|
|
@@ -4,7 +4,7 @@ import { I as Icon, B as Badge } from '../Icon_es_BEhzKfrD.js';
|
|
|
4
4
|
import React, { useRef, useEffect, useMemo } from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import CreatableSelect from 'react-select/creatable';
|
|
7
|
-
import { G as Group } from '../
|
|
7
|
+
import { G as Group } from '../Group_es_p5hBFgw4.js';
|
|
8
8
|
import { T as Text } from '../Text_es_RDU9GLCV.js';
|
|
9
9
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
10
10
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
@@ -115,21 +115,26 @@ function useNotifications() {
|
|
|
115
115
|
function useNotificationsAPI() {
|
|
116
116
|
return useContext(NotificationsAPIContext);
|
|
117
117
|
}
|
|
118
|
+
const statusToAppearanceList = {
|
|
119
|
+
error: 'errorPrimary sizeS solid rounded',
|
|
120
|
+
info: 'infoPrimary sizeS solid rounded',
|
|
121
|
+
success: 'successPrimary sizeS solid rounded',
|
|
122
|
+
warning: 'warningPrimary sizeS solid rounded',
|
|
123
|
+
};
|
|
118
124
|
function createNotification(notification, onClose) {
|
|
119
125
|
// Default notification item properties
|
|
120
126
|
let id = v4().split('-')[0];
|
|
121
127
|
let title = '';
|
|
122
128
|
let text = '';
|
|
123
|
-
let float = null;
|
|
124
|
-
let toast = null;
|
|
125
|
-
let global = null;
|
|
126
129
|
let closeIcon = '';
|
|
127
130
|
let closeIconSrc = '';
|
|
131
|
+
let type = 'float';
|
|
128
132
|
let buttonLabel = '';
|
|
129
133
|
let status = STATUSES.warning;
|
|
130
134
|
let closeByTime = 4500;
|
|
131
|
-
let appearance =
|
|
135
|
+
let appearance = statusToAppearanceList[status];
|
|
132
136
|
let after = null;
|
|
137
|
+
let isLoading = false;
|
|
133
138
|
let closeIconAppearance = '';
|
|
134
139
|
let onClickButton = null;
|
|
135
140
|
if (typeof notification === 'string') {
|
|
@@ -139,48 +144,36 @@ function createNotification(notification, onClose) {
|
|
|
139
144
|
id = notification.id ?? id;
|
|
140
145
|
title = notification.title ?? title;
|
|
141
146
|
text = notification.text ?? text;
|
|
142
|
-
float = notification.float ?? float;
|
|
143
|
-
toast = notification.toast ?? toast;
|
|
144
147
|
closeIconAppearance =
|
|
145
148
|
notification.closeIconAppearance ?? closeIconAppearance;
|
|
146
|
-
|
|
149
|
+
type = notification.type ?? type;
|
|
147
150
|
closeIcon = notification.closeIcon ?? closeIcon;
|
|
148
151
|
closeIconSrc = notification.closeIconSrc ?? closeIconSrc;
|
|
149
152
|
buttonLabel = notification.buttonLabel ?? buttonLabel;
|
|
150
153
|
onClickButton = notification.onClickButton ?? onClickButton;
|
|
151
154
|
status = notification.status ?? status;
|
|
152
155
|
closeByTime = notification.closeByTime ?? closeByTime;
|
|
156
|
+
isLoading = notification.isLoading ?? isLoading;
|
|
153
157
|
after = notification.after ?? after;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
break;
|
|
159
|
-
case 'info':
|
|
160
|
-
appearance = 'infoPrimary sizeM solid';
|
|
161
|
-
break;
|
|
162
|
-
case 'error':
|
|
163
|
-
appearance = 'errorPrimary sizeM solid';
|
|
164
|
-
break;
|
|
165
|
-
case 'warning':
|
|
166
|
-
appearance = 'warningPrimary sizeM solid';
|
|
167
|
-
break;
|
|
158
|
+
appearance =
|
|
159
|
+
notification.appearance ??
|
|
160
|
+
statusToAppearanceList[notification.status] ??
|
|
161
|
+
appearance;
|
|
168
162
|
}
|
|
169
163
|
return {
|
|
170
164
|
id: id,
|
|
171
165
|
appearance: appearance,
|
|
166
|
+
type: type,
|
|
172
167
|
title: title,
|
|
173
168
|
status: status,
|
|
174
169
|
text: text,
|
|
175
170
|
buttonLabel: buttonLabel,
|
|
176
|
-
float: float,
|
|
177
|
-
global: global,
|
|
178
|
-
toast: toast,
|
|
179
171
|
after: after,
|
|
180
172
|
closeByTime: closeByTime,
|
|
181
173
|
closeIcon: closeIcon,
|
|
182
174
|
closeIconAppearance: closeIconAppearance,
|
|
183
175
|
closeIconSrc: closeIconSrc,
|
|
176
|
+
isLoading: isLoading,
|
|
184
177
|
onClickButton: onClickButton,
|
|
185
178
|
onClose: onClose,
|
|
186
179
|
};
|
|
@@ -1087,6 +1087,25 @@ textarea.fill {
|
|
|
1087
1087
|
position: static;
|
|
1088
1088
|
}
|
|
1089
1089
|
}
|
|
1090
|
+
@media screen {
|
|
1091
|
+
.print {
|
|
1092
|
+
height: auto !important;
|
|
1093
|
+
overflow: auto !important;
|
|
1094
|
+
display: none !important;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
@media print {
|
|
1098
|
+
.no-print,
|
|
1099
|
+
.no-print * {
|
|
1100
|
+
height: 0 !important;
|
|
1101
|
+
display: none !important;
|
|
1102
|
+
}
|
|
1103
|
+
.print {
|
|
1104
|
+
height: auto !important;
|
|
1105
|
+
overflow: auto !important;
|
|
1106
|
+
display: block !important;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1090
1109
|
.resize-horizontal {
|
|
1091
1110
|
&_hug {
|
|
1092
1111
|
display: inline-flex;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@media screen {
|
|
2
|
+
.print {
|
|
3
|
+
height: auto !important;
|
|
4
|
+
overflow: auto !important;
|
|
5
|
+
display: none !important;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@media print {
|
|
10
|
+
.no-print,
|
|
11
|
+
.no-print * {
|
|
12
|
+
height: 0 !important;
|
|
13
|
+
display: none !important;
|
|
14
|
+
}
|
|
15
|
+
.print {
|
|
16
|
+
height: auto !important;
|
|
17
|
+
overflow: auto !important;
|
|
18
|
+
display: block !important;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { CSSProperties, ElementType } from 'react';
|
|
2
|
-
import { AppearanceKeysDefault, BorderColorProps, FillProps,
|
|
2
|
+
import { AppearanceKeysDefault, BorderColorProps, FillProps, ItemFillProps, ShapeProps, SizePXProps, TextColorProps, TextSizeProps, TextWeightProps } from '@itcase/types';
|
|
3
3
|
interface WarningThemeColor {
|
|
4
4
|
borderColor?: BorderColorProps;
|
|
5
5
|
descriptionTextColor: TextColorProps;
|
|
6
6
|
descriptionTextSize: TextSizeProps;
|
|
7
7
|
fill?: FillProps;
|
|
8
8
|
iconAfter: ElementType;
|
|
9
|
-
iconAfterFillIcon:
|
|
9
|
+
iconAfterFillIcon: ItemFillProps;
|
|
10
10
|
iconAfterSize: SizePXProps;
|
|
11
11
|
iconAfterSrc: string;
|
|
12
12
|
iconBefore: ElementType;
|
|
13
13
|
iconBeforeFill: FillProps;
|
|
14
|
-
iconBeforeFillIcon:
|
|
14
|
+
iconBeforeFillIcon: ItemFillProps;
|
|
15
15
|
iconBeforeSize: SizePXProps;
|
|
16
16
|
iconBeforeSrc: string;
|
|
17
17
|
labelTextColor?: TextColorProps;
|
|
@@ -38,4 +38,4 @@ interface WarningProps {
|
|
|
38
38
|
style?: CSSProperties;
|
|
39
39
|
isSkeleton?: boolean;
|
|
40
40
|
}
|
|
41
|
-
export {
|
|
41
|
+
export { WarningConfig, WarningProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Id, SimpleCallback } from '@itcase/types';
|
|
2
|
-
import type { CreatedNotification, NotificationsProviderProps } from './Notifications.interface';
|
|
2
|
+
import type { CreatedNotification, Notification, NotificationsProviderProps } from './Notifications.interface';
|
|
3
3
|
declare function NotificationsProvider(props: NotificationsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function useNotifications():
|
|
4
|
+
declare function useNotifications(): Notification[];
|
|
5
5
|
declare function useNotificationsAPI(): {
|
|
6
6
|
hideNotifications: (targetId: Id) => void;
|
|
7
7
|
showNotification: (notification: string | CreatedNotification, onClose?: SimpleCallback) => void;
|
|
@@ -4,34 +4,36 @@ interface Notification {
|
|
|
4
4
|
id: Id;
|
|
5
5
|
_closeTimeout?: ReturnType<typeof setTimeout>;
|
|
6
6
|
after: React.ReactNode;
|
|
7
|
+
appearance?: string;
|
|
7
8
|
buttonLabel: string;
|
|
8
9
|
closeByTime: number | false;
|
|
9
10
|
closeIcon?: string;
|
|
11
|
+
closeIconAppearance?: string;
|
|
10
12
|
closeIconSrc?: string;
|
|
11
|
-
float?: boolean;
|
|
12
|
-
global?: boolean;
|
|
13
13
|
status: 'error' | 'info' | 'success' | 'warning';
|
|
14
14
|
text: string;
|
|
15
15
|
textColor: string;
|
|
16
16
|
title: string;
|
|
17
|
-
|
|
17
|
+
type?: 'float' | 'global' | 'toast';
|
|
18
|
+
isLoading: boolean;
|
|
18
19
|
onClickButton?: () => void;
|
|
19
20
|
onClose?: () => void;
|
|
20
21
|
}
|
|
21
22
|
interface CreatedNotification {
|
|
22
23
|
id?: Notification['id'];
|
|
23
24
|
after?: Notification['after'];
|
|
25
|
+
appearance?: Notification['appearance'];
|
|
24
26
|
buttonLabel?: Notification['buttonLabel'];
|
|
25
27
|
closeByTime?: Notification['closeByTime'];
|
|
26
28
|
closeIcon?: Notification['closeIcon'];
|
|
29
|
+
closeIconAppearance?: Notification['closeIconAppearance'];
|
|
27
30
|
closeIconSrc?: Notification['closeIconSrc'];
|
|
28
|
-
float?: Notification['float'];
|
|
29
|
-
global?: Notification['global'];
|
|
30
31
|
status?: Notification['status'];
|
|
31
32
|
text?: Notification['text'];
|
|
32
33
|
textColor?: Notification['textColor'];
|
|
33
34
|
title?: Notification['title'];
|
|
34
|
-
|
|
35
|
+
type?: Notification['type'];
|
|
36
|
+
isLoading?: Notification['isLoading'];
|
|
35
37
|
onClickButton?: Notification['onClickButton'];
|
|
36
38
|
onClose?: Notification['onClose'];
|
|
37
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/ui",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.153",
|
|
4
4
|
"description": "UI components (Modal, Loader, Popup, etc)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Modal",
|
|
@@ -109,11 +109,11 @@
|
|
|
109
109
|
"@itcase/tokens-palette": "^1.1.20",
|
|
110
110
|
"clsx": "^2.1.1",
|
|
111
111
|
"date-fns": "^4.1.0",
|
|
112
|
-
"framer-motion": "^12.23.
|
|
112
|
+
"framer-motion": "^12.23.23",
|
|
113
113
|
"js-cookie": "^3.0.5",
|
|
114
114
|
"lodash": "^4.17.21",
|
|
115
115
|
"luxon": "^3.7.2",
|
|
116
|
-
"motion": "^12.23.
|
|
116
|
+
"motion": "^12.23.23",
|
|
117
117
|
"rc-slider": "^11.1.9",
|
|
118
118
|
"react": "^18.3.1",
|
|
119
119
|
"react-dadata": "^2.27.4",
|