@itcase/ui 1.8.152 → 1.8.154

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.
Files changed (31) hide show
  1. package/dist/{Group_cjs_CLE5_jDA.js → Group_cjs_BxbmyFvN.js} +2 -2
  2. package/dist/{Group_es_ZTwafPX1.js → Group_es_p5hBFgw4.js} +2 -2
  3. package/dist/cjs/components/AvatarStack.js +1 -1
  4. package/dist/cjs/components/Flex.js +6 -6
  5. package/dist/cjs/components/Grid.js +7 -7
  6. package/dist/cjs/components/Group.js +1 -1
  7. package/dist/cjs/components/Modal.js +7 -3
  8. package/dist/cjs/components/Notification/stories/__mock__.js +4 -0
  9. package/dist/cjs/components/Notification.js +3 -3
  10. package/dist/cjs/components/Radio.js +3 -3
  11. package/dist/cjs/components/Response.js +1 -1
  12. package/dist/cjs/components/Select.js +1 -1
  13. package/dist/cjs/context/Notifications.js +17 -24
  14. package/dist/components/AvatarStack.js +1 -1
  15. package/dist/components/Flex.js +6 -6
  16. package/dist/components/Grid.js +7 -7
  17. package/dist/components/Group.js +1 -1
  18. package/dist/components/Modal.js +7 -3
  19. package/dist/components/Notification/stories/__mock__.js +4 -0
  20. package/dist/components/Notification.js +3 -3
  21. package/dist/components/Radio.js +3 -3
  22. package/dist/components/Response.js +1 -1
  23. package/dist/components/Select.js +1 -1
  24. package/dist/context/Notifications.js +17 -24
  25. package/dist/css/styles/bundle.css +9730 -0
  26. package/dist/css/styles/print/print.css +20 -0
  27. package/dist/types/components/Notification/stories/__mock__/index.d.ts +1 -0
  28. package/dist/types/components/Warning/Warning.interface.d.ts +4 -4
  29. package/dist/types/context/Notifications.d.ts +2 -2
  30. package/dist/types/context/Notifications.interface.d.ts +8 -6
  31. package/package.json +6 -6
@@ -178,10 +178,10 @@ const radioConfig = {
178
178
  },
179
179
  };
180
180
  function Radio(props) {
181
- const { id, className, appearance, label, desc, isDisabled, checked, tag: Tag = 'label', value, isActive, isSkeleton, onChange, } = props;
181
+ const { id, appearance, className, label, desc, checked, tag: Tag = 'label', value, isActive, isDisabled, isSkeleton, onChange, } = props;
182
182
  const appearanceConfig = useAppearanceConfig(appearance, radioConfig, isDisabled);
183
183
  const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
184
- const { fillCheckmarkClass, fillClass, fillHoverClass, fillRadioActiveClass, fillRadioActiveHoverClass, fillRadioClass, fillRadioHoverClass, labelTextColor, labelTextSize, labelTextWeight, descTextColor, descTextSize, descTextWeight, borderRadioColorClass, borderRadioColorActiveClass, borderRadioColorActiveHoverClass, borderRadioColorHoverClass, shapeClass, shapeStrengthClass, sizeClass, } = propsGenerator;
184
+ const { fillCheckmarkClass, fillClass, fillHoverClass, fillRadioActiveClass, fillRadioActiveHoverClass, fillRadioClass, fillRadioHoverClass, labelTextColor, labelTextSize, labelTextWeight, descTextColor, descTextSize, descTextWeight, borderRadioColorActiveClass, borderRadioColorActiveHoverClass, borderRadioColorClass, borderRadioColorHoverClass, shapeClass, shapeStrengthClass, sizeClass, } = propsGenerator;
185
185
  return (jsxs(Tag, { className: clsx(className, 'radio', fillClass && `fill_${fillClass}`, fillHoverClass && `fill_${fillHoverClass}`, isSkeleton && 'radio_skeleton', sizeClass && `radio_size_${sizeClass}`, !checked || !isActive
186
186
  ? fillRadioClass && `radio_fill_${fillRadioClass}`
187
187
  : fillRadioActiveClass && `radio_fill_active_${fillRadioActiveClass}`, !checked || !isActive
@@ -195,7 +195,7 @@ function Radio(props) {
195
195
  ? borderRadioColorHoverClass &&
196
196
  `radio_border-color_hover_${borderRadioColorHoverClass}`
197
197
  : borderRadioColorActiveHoverClass &&
198
- `radio_border-color_active_hover_${borderRadioColorActiveHoverClass}`), htmlFor: id, children: [jsxs("div", { className: clsx('radio__item'), children: [jsx("input", { id: String(id), className: "radio__input", type: "radio", disabled: isDisabled && 'disabled', checked: checked, value: value, onChange: onChange }), jsx("div", { className: clsx('radio__state', shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`), children: "\u00A0" }), jsx("div", { className: clsx('radio__state-checkmark', checked && fillCheckmarkClass && `fill_${fillCheckmarkClass}`), children: "\u00A0" })] }), label && (jsx(Text, { className: "radio__label", size: labelTextSize, textColor: labelTextColor, textWeight: labelTextWeight, children: label })), desc && (jsx(Text, { className: "radio__desc", size: descTextSize, textColor: descTextColor, textWeight: descTextWeight, children: desc }))] }));
198
+ `radio_border-color_active_hover_${borderRadioColorActiveHoverClass}`), htmlFor: id, children: [jsxs("div", { className: clsx('radio__item'), children: [jsx("input", { id: String(id), className: "radio__input", type: "radio", checked: checked, disabled: isDisabled && 'disabled', value: value, onChange: onChange }), jsx("div", { className: clsx('radio__state', shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`), children: "\u00A0" }), jsx("div", { className: clsx('radio__state-checkmark', checked && fillCheckmarkClass && `fill_${fillCheckmarkClass}`), children: "\u00A0" })] }), label && (jsx(Text, { className: "radio__label", size: labelTextSize, textColor: labelTextColor, textWeight: labelTextWeight, children: label })), desc && (jsx(Text, { className: "radio__desc", size: descTextSize, textColor: descTextColor, textWeight: descTextWeight, children: desc }))] }));
199
199
  }
200
200
 
201
201
  export { Radio, radioAppearance, radioConfig };
@@ -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 '../Group_es_ZTwafPX1.js';
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 '../Group_es_ZTwafPX1.js';
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
- global = notification.global ?? global;
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
- switch (status) {
156
- case 'success':
157
- appearance = 'successPrimary sizeM solid';
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
  };