@doist/reactist 28.7.0 → 28.7.2
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/reactist.cjs.development.js +67 -83
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/avatar/avatar.js +1 -1
- package/es/avatar/avatar.js.map +1 -1
- package/es/badge/badge.js +1 -1
- package/es/badge/badge.js.map +1 -1
- package/es/banner/banner.js +1 -1
- package/es/banner/banner.js.map +1 -1
- package/es/base-field/base-field.js +2 -2
- package/es/base-field/base-field.js.map +1 -1
- package/es/box/box.js +11 -13
- package/es/box/box.js.map +1 -1
- package/es/button/button.js +2 -2
- package/es/button/button.js.map +1 -1
- package/es/checkbox-field/checkbox-field.js +2 -4
- package/es/checkbox-field/checkbox-field.js.map +1 -1
- package/es/components/deprecated-button/deprecated-button.js +1 -1
- package/es/components/deprecated-button/deprecated-button.js.map +1 -1
- package/es/components/keyboard-shortcut/keyboard-shortcut.js +2 -2
- package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/es/components/progress-bar/progress-bar.js +2 -2
- package/es/components/progress-bar/progress-bar.js.map +1 -1
- package/es/components/time/time-utils.js +3 -3
- package/es/components/time/time-utils.js.map +1 -1
- package/es/heading/heading.js +1 -1
- package/es/heading/heading.js.map +1 -1
- package/es/icons/banner-icon.js +1 -1
- package/es/icons/banner-icon.js.map +1 -1
- package/es/loading/loading.js +1 -3
- package/es/loading/loading.js.map +1 -1
- package/es/menu/menu.js +2 -2
- package/es/menu/menu.js.map +1 -1
- package/es/switch-field/switch-field.js +5 -7
- package/es/switch-field/switch-field.js.map +1 -1
- package/es/tabs/tabs.js +16 -20
- package/es/tabs/tabs.js.map +1 -1
- package/es/text/text.js +1 -1
- package/es/text/text.js.map +1 -1
- package/es/toast/toast-animation.js +2 -2
- package/es/toast/toast-animation.js.map +1 -1
- package/es/toast/use-toasts.js +2 -6
- package/es/toast/use-toasts.js.map +1 -1
- package/es/tooltip/tooltip.js +2 -2
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/utils/common-helpers.js +2 -2
- package/es/utils/common-helpers.js.map +1 -1
- package/es/utils/responsive-props.js +4 -4
- package/es/utils/responsive-props.js.map +1 -1
- package/lib/avatar/avatar.js +1 -1
- package/lib/avatar/avatar.js.map +1 -1
- package/lib/badge/badge.js.map +1 -1
- package/lib/banner/banner.js +1 -1
- package/lib/banner/banner.js.map +1 -1
- package/lib/base-field/base-field.js +1 -1
- package/lib/base-field/base-field.js.map +1 -1
- package/lib/box/box.js +1 -1
- package/lib/box/box.js.map +1 -1
- package/lib/button/button.js.map +1 -1
- package/lib/checkbox-field/checkbox-field.js +1 -1
- package/lib/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/components/deprecated-button/deprecated-button.js.map +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/lib/components/progress-bar/progress-bar.js +1 -1
- package/lib/components/progress-bar/progress-bar.js.map +1 -1
- package/lib/components/time/time-utils.js +1 -1
- package/lib/components/time/time-utils.js.map +1 -1
- package/lib/heading/heading.js.map +1 -1
- package/lib/loading/loading.js +1 -1
- package/lib/loading/loading.js.map +1 -1
- package/lib/menu/menu.js +1 -1
- package/lib/menu/menu.js.map +1 -1
- package/lib/switch-field/switch-field.js +1 -1
- package/lib/switch-field/switch-field.js.map +1 -1
- package/lib/tabs/tabs.js +1 -1
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/text/text.js +1 -1
- package/lib/text/text.js.map +1 -1
- package/lib/toast/toast-animation.js +1 -1
- package/lib/toast/toast-animation.js.map +1 -1
- package/lib/toast/use-toasts.js +1 -1
- package/lib/toast/use-toasts.js.map +1 -1
- package/lib/tooltip/tooltip.js +1 -1
- package/lib/tooltip/tooltip.js.map +1 -1
- package/lib/utils/common-helpers.js +1 -1
- package/lib/utils/common-helpers.js.map +1 -1
- package/lib/utils/responsive-props.js +1 -1
- package/lib/utils/responsive-props.js.map +1 -1
- package/package.json +3 -6
- package/styles/avatar.css +2 -2
- package/styles/badge.css +2 -2
- package/styles/banner.css +4 -4
- package/styles/banner.module.css.css +1 -1
- package/styles/base-field.css +3 -3
- package/styles/box.css +2 -2
- package/styles/box.module.css.css +1 -1
- package/styles/button.css +3 -3
- package/styles/checkbox-field.css +2 -2
- package/styles/columns.css +2 -2
- package/styles/divider.css +2 -2
- package/styles/heading.css +2 -2
- package/styles/hidden-visually.css +2 -2
- package/styles/hidden.css +2 -2
- package/styles/index.css +3 -3
- package/styles/loading.css +3 -3
- package/styles/modal.css +4 -4
- package/styles/modal.module.css.css +1 -1
- package/styles/notice.css +2 -2
- package/styles/password-field.css +3 -3
- package/styles/prose.css +2 -2
- package/styles/reactist.css +6 -6
- package/styles/select-field.css +3 -3
- package/styles/spinner.css +1 -1
- package/styles/static-toast.css +3 -3
- package/styles/switch-field.css +3 -3
- package/styles/tabs.css +2 -2
- package/styles/text-area.css +3 -3
- package/styles/text-field.css +3 -3
- package/styles/text-link.css +2 -2
- package/styles/text.css +2 -2
- package/styles/tooltip.css +2 -2
- package/styles/use-toasts.css +3 -3
- package/styles/width.module.css.css +1 -1
|
@@ -170,11 +170,11 @@ function getClassNames(styles, property, value) {
|
|
|
170
170
|
const classList = [];
|
|
171
171
|
|
|
172
172
|
if (typeof value === 'string') {
|
|
173
|
-
classList.push(styles[property
|
|
173
|
+
classList.push(styles[`${property}-${value}`]);
|
|
174
174
|
} else {
|
|
175
|
-
if (value.mobile) classList.push(styles[property
|
|
176
|
-
if (value.tablet) classList.push(styles[
|
|
177
|
-
if (value.desktop) classList.push(styles[
|
|
175
|
+
if (value.mobile) classList.push(styles[`${property}-${value.mobile}`]);
|
|
176
|
+
if (value.tablet) classList.push(styles[`tablet-${property}-${value.tablet}`]);
|
|
177
|
+
if (value.desktop) classList.push(styles[`desktop-${property}-${value.desktop}`]);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
if (!classList.every(Boolean)) {
|
|
@@ -265,16 +265,14 @@ function getBoxClassNames({
|
|
|
265
265
|
overlayScroll,
|
|
266
266
|
className
|
|
267
267
|
}) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
const
|
|
272
|
-
const
|
|
273
|
-
const
|
|
274
|
-
const
|
|
275
|
-
const
|
|
276
|
-
const resolvedMarginBottom = (_ref7 = marginBottom != null ? marginBottom : marginY) != null ? _ref7 : margin;
|
|
277
|
-
const resolvedMarginLeft = (_ref8 = marginLeft != null ? marginLeft : marginX) != null ? _ref8 : margin;
|
|
268
|
+
const resolvedPaddingTop = paddingTop ?? paddingY ?? padding;
|
|
269
|
+
const resolvedPaddingRight = paddingRight ?? paddingX ?? padding;
|
|
270
|
+
const resolvedPaddingBottom = paddingBottom ?? paddingY ?? padding;
|
|
271
|
+
const resolvedPaddingLeft = paddingLeft ?? paddingX ?? padding;
|
|
272
|
+
const resolvedMarginTop = marginTop ?? marginY ?? margin;
|
|
273
|
+
const resolvedMarginRight = marginRight ?? marginX ?? margin;
|
|
274
|
+
const resolvedMarginBottom = marginBottom ?? marginY ?? margin;
|
|
275
|
+
const resolvedMarginLeft = marginLeft ?? marginX ?? margin;
|
|
278
276
|
const omitFlex = !display || typeof display === 'string' && display !== 'flex' && display !== 'inlineFlex';
|
|
279
277
|
return classNames__default["default"](className, modules_54d944f2.box, display ? getClassNames(modules_54d944f2, 'display', display) : null, position !== 'static' ? getClassNames(modules_54d944f2, 'position', position) : null, minWidth != null ? getClassNames(modules_89b7671c, 'minWidth', String(minWidth)) : null, getClassNames(modules_89b7671c, 'maxWidth', maxWidth), getClassNames(modules_54d944f2, 'textAlign', textAlign), // padding
|
|
280
278
|
getClassNames(modules_b537a8ee, 'paddingTop', resolvedPaddingTop), getClassNames(modules_b537a8ee, 'paddingRight', resolvedPaddingRight), getClassNames(modules_b537a8ee, 'paddingBottom', resolvedPaddingBottom), getClassNames(modules_b537a8ee, 'paddingLeft', resolvedPaddingLeft), // margin
|
|
@@ -283,7 +281,7 @@ function getBoxClassNames({
|
|
|
283
281
|
getClassNames(modules_54d944f2, 'overflow', overflow), width != null ? getClassNames(modules_89b7671c, 'width', String(width)) : null, getClassNames(modules_54d944f2, 'height', height), getClassNames(modules_54d944f2, 'bg', background), borderRadius !== 'none' ? getClassNames(modules_54d944f2, 'borderRadius', borderRadius) : null, border !== 'none' ? getClassNames(modules_54d944f2, 'border', border) : null, overlayScroll ? modules_54d944f2.overlayScroll : null);
|
|
284
282
|
}
|
|
285
283
|
|
|
286
|
-
const Box$1 = /*#__PURE__*/polymorphicComponent(function Box(
|
|
284
|
+
const Box$1 = /*#__PURE__*/polymorphicComponent(function Box(_ref, ref) {
|
|
287
285
|
let {
|
|
288
286
|
as: component = 'div',
|
|
289
287
|
position = 'static',
|
|
@@ -322,8 +320,8 @@ const Box$1 = /*#__PURE__*/polymorphicComponent(function Box(_ref9, ref) {
|
|
|
322
320
|
overlayScroll,
|
|
323
321
|
className,
|
|
324
322
|
children
|
|
325
|
-
} =
|
|
326
|
-
props = _objectWithoutProperties(
|
|
323
|
+
} = _ref,
|
|
324
|
+
props = _objectWithoutProperties(_ref, _excluded$w);
|
|
327
325
|
|
|
328
326
|
return /*#__PURE__*/React__namespace.createElement(component, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
329
327
|
className: getBoxClassNames({
|
|
@@ -560,10 +558,10 @@ function uniqueId() {
|
|
|
560
558
|
|
|
561
559
|
function generateElementId(prefix) {
|
|
562
560
|
const num = uniqueId();
|
|
563
|
-
return prefix
|
|
561
|
+
return `${prefix}-${num}`;
|
|
564
562
|
}
|
|
565
563
|
function useId(providedId) {
|
|
566
|
-
const ref = React__namespace.useRef(providedId
|
|
564
|
+
const ref = React__namespace.useRef(providedId ?? null);
|
|
567
565
|
|
|
568
566
|
if (!ref.current) {
|
|
569
567
|
ref.current = generateElementId('element');
|
|
@@ -637,8 +635,8 @@ const Tooltip = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
637
635
|
} = React__namespace.useContext(TooltipContext);
|
|
638
636
|
const tooltip = react.useTooltipStore({
|
|
639
637
|
placement: position,
|
|
640
|
-
showTimeout: showTimeout
|
|
641
|
-
hideTimeout: hideTimeout
|
|
638
|
+
showTimeout: showTimeout ?? globalShowTimeout,
|
|
639
|
+
hideTimeout: hideTimeout ?? globalHideTimeout
|
|
642
640
|
});
|
|
643
641
|
React__namespace.useImperativeHandle(ref, () => tooltip, [tooltip]);
|
|
644
642
|
const isOpen = tooltip.useState('open');
|
|
@@ -718,7 +716,7 @@ const Button$1 = /*#__PURE__*/React__namespace.forwardRef(function Button(_ref,
|
|
|
718
716
|
onClick: isDisabled ? preventDefault : onClick,
|
|
719
717
|
className: classNames__default["default"]([getBoxClassNames({
|
|
720
718
|
width
|
|
721
|
-
}), exceptionallySetClassName, modules_5357ebb8.baseButton, modules_5357ebb8[
|
|
719
|
+
}), exceptionallySetClassName, modules_5357ebb8.baseButton, modules_5357ebb8[`variant-${variant}`], modules_5357ebb8[`tone-${tone}`], modules_5357ebb8[`size-${size}`], shape === 'rounded' ? modules_5357ebb8['shape-rounded'] : null, disabled ? modules_5357ebb8.disabled : null])
|
|
722
720
|
}), /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, startIcon ? /*#__PURE__*/React__namespace.createElement(Box$1, {
|
|
723
721
|
display: "flex",
|
|
724
722
|
className: modules_5357ebb8.startIcon,
|
|
@@ -769,7 +767,7 @@ const IconButton = /*#__PURE__*/React__namespace.forwardRef(function IconButton(
|
|
|
769
767
|
ref: ref,
|
|
770
768
|
"aria-disabled": isDisabled,
|
|
771
769
|
onClick: isDisabled ? preventDefault : onClick,
|
|
772
|
-
className: classNames__default["default"]([exceptionallySetClassName, modules_5357ebb8.baseButton, modules_5357ebb8[
|
|
770
|
+
className: classNames__default["default"]([exceptionallySetClassName, modules_5357ebb8.baseButton, modules_5357ebb8[`variant-${variant}`], modules_5357ebb8[`tone-${tone}`], modules_5357ebb8[`size-${size}`], shape === 'rounded' ? modules_5357ebb8['shape-rounded'] : null, modules_5357ebb8.iconButton, disabled ? modules_5357ebb8.disabled : null])
|
|
773
771
|
}), loading && /*#__PURE__*/React__namespace.createElement(Spinner, null) || icon);
|
|
774
772
|
const tooltipContent = tooltip === undefined ? props['aria-label'] : tooltip;
|
|
775
773
|
return tooltipContent ? /*#__PURE__*/React__namespace.createElement(Tooltip, {
|
|
@@ -808,7 +806,7 @@ function BannerIcon(_ref) {
|
|
|
808
806
|
|
|
809
807
|
const Icon = bannerIconForType[type];
|
|
810
808
|
return Icon ? /*#__PURE__*/React__namespace.createElement(Icon, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
811
|
-
"data-testid":
|
|
809
|
+
"data-testid": `banner-icon-${type}`,
|
|
812
810
|
className: modules_de8ae2e5[type],
|
|
813
811
|
"aria-hidden": true
|
|
814
812
|
})) : null;
|
|
@@ -958,7 +956,7 @@ const Banner = /*#__PURE__*/React__namespace.forwardRef(function Banner(_ref, re
|
|
|
958
956
|
variant: "quaternary",
|
|
959
957
|
onClick: onClose,
|
|
960
958
|
icon: /*#__PURE__*/React__namespace.createElement(CloseIcon, null),
|
|
961
|
-
"aria-label": closeLabel
|
|
959
|
+
"aria-label": closeLabel ?? 'Close banner'
|
|
962
960
|
}) : null;
|
|
963
961
|
return /*#__PURE__*/React__namespace.createElement(Box$1, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
964
962
|
ref: ref,
|
|
@@ -1053,15 +1051,13 @@ const sizeMapping = {
|
|
|
1053
1051
|
};
|
|
1054
1052
|
|
|
1055
1053
|
function Loading(_ref) {
|
|
1056
|
-
var _sizeMapping$size;
|
|
1057
|
-
|
|
1058
1054
|
let {
|
|
1059
1055
|
size = 'small',
|
|
1060
1056
|
exceptionallySetClassName
|
|
1061
1057
|
} = _ref,
|
|
1062
1058
|
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
1063
1059
|
|
|
1064
|
-
const numericSize =
|
|
1060
|
+
const numericSize = sizeMapping[size] ?? sizeMapping.small;
|
|
1065
1061
|
const ariaLabel = props['aria-label'] ? props['aria-label'] : !props['aria-labelledby'] ? 'Loading…' : undefined;
|
|
1066
1062
|
return /*#__PURE__*/React__namespace.createElement(Box$1, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1067
1063
|
"aria-label": ariaLabel,
|
|
@@ -1191,7 +1187,7 @@ const Text = /*#__PURE__*/polymorphicComponent(function Text(_ref, ref) {
|
|
|
1191
1187
|
} = _ref,
|
|
1192
1188
|
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
1193
1189
|
|
|
1194
|
-
const lineClampMultipleLines = typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp
|
|
1190
|
+
const lineClampMultipleLines = typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp ?? 1) > 1;
|
|
1195
1191
|
return /*#__PURE__*/React__namespace.createElement(Box$1, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1196
1192
|
as: as,
|
|
1197
1193
|
className: [exceptionallySetClassName, modules_a9637dd3.text, size !== 'body' ? getClassNames(modules_a9637dd3, 'size', size) : null, weight !== 'regular' ? getClassNames(modules_a9637dd3, 'weight', weight) : null, tone !== 'normal' ? getClassNames(modules_a9637dd3, 'tone', tone) : null, lineClampMultipleLines ? modules_a9637dd3.lineClampMultipleLines : null, lineClamp ? getClassNames(modules_a9637dd3, 'lineClamp', lineClamp.toString()) : null],
|
|
@@ -1394,7 +1390,7 @@ function useToastsAnimation() {
|
|
|
1394
1390
|
transition: ENTRANCE_TRANSITION,
|
|
1395
1391
|
transforms: [{
|
|
1396
1392
|
property: 'transform',
|
|
1397
|
-
from:
|
|
1393
|
+
from: `translateY(${prevTop - top}px)`
|
|
1398
1394
|
}]
|
|
1399
1395
|
});
|
|
1400
1396
|
} else if (typeof prevTop !== 'number') {
|
|
@@ -1404,7 +1400,7 @@ function useToastsAnimation() {
|
|
|
1404
1400
|
transition: ENTRANCE_TRANSITION,
|
|
1405
1401
|
transforms: [{
|
|
1406
1402
|
property: 'transform',
|
|
1407
|
-
from:
|
|
1403
|
+
from: `translateY(${height}px)`
|
|
1408
1404
|
}, {
|
|
1409
1405
|
property: 'opacity',
|
|
1410
1406
|
from: '0'
|
|
@@ -1491,24 +1487,20 @@ const InternalToast = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
1491
1487
|
*/
|
|
1492
1488
|
|
|
1493
1489
|
const actionWithCustomActionHandler = React__default["default"].useMemo(() => {
|
|
1494
|
-
var _action$closeToast;
|
|
1495
|
-
|
|
1496
1490
|
if (!isActionObject(action)) {
|
|
1497
1491
|
return action;
|
|
1498
1492
|
}
|
|
1499
1493
|
|
|
1500
1494
|
return _objectSpread2(_objectSpread2({}, action), {}, {
|
|
1501
|
-
closeToast:
|
|
1495
|
+
closeToast: action.closeToast ?? true,
|
|
1502
1496
|
onClick: function handleActionClick() {
|
|
1503
|
-
var _action$closeToast2;
|
|
1504
|
-
|
|
1505
1497
|
if (!action) {
|
|
1506
1498
|
return;
|
|
1507
1499
|
}
|
|
1508
1500
|
|
|
1509
1501
|
action.onClick();
|
|
1510
1502
|
|
|
1511
|
-
if (
|
|
1503
|
+
if (action.closeToast ?? true) {
|
|
1512
1504
|
removeToast();
|
|
1513
1505
|
}
|
|
1514
1506
|
}
|
|
@@ -1681,7 +1673,7 @@ const Heading = /*#__PURE__*/React__namespace.forwardRef(function Heading(_ref,
|
|
|
1681
1673
|
|
|
1682
1674
|
// In TypeScript v4.1, this would be properly recognized without needing the type assertion
|
|
1683
1675
|
// https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types
|
|
1684
|
-
const headingElementName =
|
|
1676
|
+
const headingElementName = `h${level}`;
|
|
1685
1677
|
const lineClampMultipleLines = typeof lineClamp === 'string' ? parseInt(lineClamp, 10) > 1 : (lineClamp || 0) > 1;
|
|
1686
1678
|
return /*#__PURE__*/React__namespace.createElement(Box$1, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1687
1679
|
className: [exceptionallySetClassName, modules_949d2ff4.heading, weight !== 'regular' ? getClassNames(modules_949d2ff4, 'weight', weight) : null, tone !== 'normal' ? getClassNames(modules_949d2ff4, 'tone', tone) : null, getClassNames(modules_949d2ff4, 'size', size), lineClampMultipleLines ? modules_949d2ff4.lineClampMultipleLines : null, lineClamp ? getClassNames(modules_949d2ff4, 'lineClamp', lineClamp.toString()) : null],
|
|
@@ -1806,8 +1798,6 @@ function useForkRef(...refs) {
|
|
|
1806
1798
|
|
|
1807
1799
|
const _excluded$e = ["label", "icon", "disabled", "indeterminate", "defaultChecked", "onChange"];
|
|
1808
1800
|
const CheckboxField = /*#__PURE__*/React__namespace.forwardRef(function CheckboxField(_ref, ref) {
|
|
1809
|
-
var _ref2, _props$checked, _props$checked2;
|
|
1810
|
-
|
|
1811
1801
|
let {
|
|
1812
1802
|
label,
|
|
1813
1803
|
icon,
|
|
@@ -1832,8 +1822,8 @@ const CheckboxField = /*#__PURE__*/React__namespace.forwardRef(function Checkbox
|
|
|
1832
1822
|
}
|
|
1833
1823
|
|
|
1834
1824
|
const [keyFocused, setKeyFocused] = React__namespace.useState(false);
|
|
1835
|
-
const [checkedState, setChecked] = React__namespace.useState(
|
|
1836
|
-
const isChecked =
|
|
1825
|
+
const [checkedState, setChecked] = React__namespace.useState(props.checked ?? defaultChecked ?? false);
|
|
1826
|
+
const isChecked = props.checked ?? checkedState;
|
|
1837
1827
|
const internalRef = React__namespace.useRef(null);
|
|
1838
1828
|
const combinedRef = useForkRef(internalRef, ref);
|
|
1839
1829
|
React__namespace.useEffect(function setIndeterminate() {
|
|
@@ -1979,7 +1969,7 @@ function validateInputLength({
|
|
|
1979
1969
|
const currentLength = String(value || '').length;
|
|
1980
1970
|
const isNearMaxLength = maxLength - currentLength <= MAX_LENGTH_THRESHOLD;
|
|
1981
1971
|
return {
|
|
1982
|
-
count: currentLength
|
|
1972
|
+
count: `${currentLength}/${maxLength}`,
|
|
1983
1973
|
tone: isNearMaxLength ? 'error' : 'neutral'
|
|
1984
1974
|
};
|
|
1985
1975
|
}
|
|
@@ -2014,7 +2004,7 @@ function BaseField({
|
|
|
2014
2004
|
});
|
|
2015
2005
|
const [characterCount, setCharacterCount] = React__namespace.useState(inputLength.count);
|
|
2016
2006
|
const [characterCountTone, setCharacterCountTone] = React__namespace.useState(inputLength.tone);
|
|
2017
|
-
const ariaDescribedBy = originalAriaDescribedBy
|
|
2007
|
+
const ariaDescribedBy = originalAriaDescribedBy ?? (message ? messageId : null);
|
|
2018
2008
|
const renderCharacterCountBelow = characterCountPosition === 'below' && characterCount !== null;
|
|
2019
2009
|
const renderCharacterCountInline = characterCountPosition === 'inline' && characterCount !== null;
|
|
2020
2010
|
|
|
@@ -2272,8 +2262,6 @@ var modules_8e05f7c9 = {"container":"bae487be","disabled":"_408d32a0","checked":
|
|
|
2272
2262
|
|
|
2273
2263
|
const _excluded$a = ["label", "message", "tone", "disabled", "hidden", "defaultChecked", "id", "aria-describedby", "aria-label", "aria-labelledby", "onChange"];
|
|
2274
2264
|
const SwitchField = /*#__PURE__*/React__namespace.forwardRef(function SwitchField(_ref, ref) {
|
|
2275
|
-
var _ref2, _props$checked, _props$checked2;
|
|
2276
|
-
|
|
2277
2265
|
let {
|
|
2278
2266
|
label,
|
|
2279
2267
|
message,
|
|
@@ -2291,12 +2279,12 @@ const SwitchField = /*#__PURE__*/React__namespace.forwardRef(function SwitchFiel
|
|
|
2291
2279
|
|
|
2292
2280
|
const id = useId(originalId);
|
|
2293
2281
|
const messageId = useId();
|
|
2294
|
-
const ariaDescribedBy = originalAriaDescribedBy
|
|
2295
|
-
const ariaLabel = originalAriaLabel
|
|
2296
|
-
const ariaLabelledBy = originalAriaLabelledby
|
|
2282
|
+
const ariaDescribedBy = originalAriaDescribedBy ?? (message ? messageId : undefined);
|
|
2283
|
+
const ariaLabel = originalAriaLabel ?? undefined;
|
|
2284
|
+
const ariaLabelledBy = originalAriaLabelledby ?? undefined;
|
|
2297
2285
|
const [keyFocused, setKeyFocused] = React__namespace.useState(false);
|
|
2298
|
-
const [checkedState, setChecked] = React__namespace.useState(
|
|
2299
|
-
const isChecked =
|
|
2286
|
+
const [checkedState, setChecked] = React__namespace.useState(props.checked ?? defaultChecked ?? false);
|
|
2287
|
+
const isChecked = props.checked ?? checkedState;
|
|
2300
2288
|
return /*#__PURE__*/React__namespace.createElement(Stack, {
|
|
2301
2289
|
space: "small",
|
|
2302
2290
|
hidden: hidden
|
|
@@ -2507,7 +2495,7 @@ function Avatar(_ref) {
|
|
|
2507
2495
|
const userInitials = getInitials(user.name) || getInitials(user.email);
|
|
2508
2496
|
const avatarSize = size ? size : 'l';
|
|
2509
2497
|
const style = avatarUrl ? {
|
|
2510
|
-
backgroundImage:
|
|
2498
|
+
backgroundImage: `url(${avatarUrl})`,
|
|
2511
2499
|
textIndent: '-9999px' // hide the initials
|
|
2512
2500
|
|
|
2513
2501
|
} : {
|
|
@@ -2537,7 +2525,7 @@ function Badge(_ref) {
|
|
|
2537
2525
|
as: "span" // It enables putting the badge inside a button (https://stackoverflow.com/a/12982334)
|
|
2538
2526
|
,
|
|
2539
2527
|
display: "inline",
|
|
2540
|
-
className: [modules_33c7c985.badge, modules_33c7c985[
|
|
2528
|
+
className: [modules_33c7c985.badge, modules_33c7c985[`badge-${tone}`]]
|
|
2541
2529
|
}), label);
|
|
2542
2530
|
}
|
|
2543
2531
|
|
|
@@ -2855,15 +2843,11 @@ function Tabs({
|
|
|
2855
2843
|
setSelectedId: onSelectedIdChange
|
|
2856
2844
|
});
|
|
2857
2845
|
const actualSelectedId = tabStore.useState('selectedId');
|
|
2858
|
-
const memoizedTabState = React__namespace.useMemo(() => {
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
variant,
|
|
2864
|
-
selectedId: (_ref = selectedId != null ? selectedId : actualSelectedId) != null ? _ref : null
|
|
2865
|
-
};
|
|
2866
|
-
}, [variant, tabStore, selectedId, actualSelectedId]);
|
|
2846
|
+
const memoizedTabState = React__namespace.useMemo(() => ({
|
|
2847
|
+
tabStore,
|
|
2848
|
+
variant,
|
|
2849
|
+
selectedId: selectedId ?? actualSelectedId ?? null
|
|
2850
|
+
}), [variant, tabStore, selectedId, actualSelectedId]);
|
|
2867
2851
|
return /*#__PURE__*/React__namespace.createElement(TabsContext.Provider, {
|
|
2868
2852
|
value: memoizedTabState
|
|
2869
2853
|
}, children);
|
|
@@ -2887,7 +2871,7 @@ const Tab = /*#__PURE__*/React__namespace.forwardRef(function Tab({
|
|
|
2887
2871
|
variant,
|
|
2888
2872
|
tabStore
|
|
2889
2873
|
} = tabContextValue;
|
|
2890
|
-
const className = classNames__default["default"](exceptionallySetClassName, modules_40c67f5b.tab, modules_40c67f5b[
|
|
2874
|
+
const className = classNames__default["default"](exceptionallySetClassName, modules_40c67f5b.tab, modules_40c67f5b[`tab-${variant}`]);
|
|
2891
2875
|
return /*#__PURE__*/React__namespace.createElement(react.Tab, {
|
|
2892
2876
|
id: id,
|
|
2893
2877
|
ref: ref,
|
|
@@ -2902,15 +2886,15 @@ const Tab = /*#__PURE__*/React__namespace.forwardRef(function Tab({
|
|
|
2902
2886
|
* A component used to group `<Tab>` elements together.
|
|
2903
2887
|
*/
|
|
2904
2888
|
|
|
2905
|
-
function TabList(
|
|
2889
|
+
function TabList(_ref) {
|
|
2906
2890
|
let {
|
|
2907
2891
|
children,
|
|
2908
2892
|
space,
|
|
2909
2893
|
width = 'maxContent',
|
|
2910
2894
|
align = 'start',
|
|
2911
2895
|
exceptionallySetClassName
|
|
2912
|
-
} =
|
|
2913
|
-
props = _objectWithoutProperties(
|
|
2896
|
+
} = _ref,
|
|
2897
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
2914
2898
|
|
|
2915
2899
|
const tabListRef = React__namespace.useRef(null);
|
|
2916
2900
|
const tabListPrevWidthRef = React__namespace.useRef(0);
|
|
@@ -2929,8 +2913,8 @@ function TabList(_ref2) {
|
|
|
2929
2913
|
if (selectedTab) {
|
|
2930
2914
|
setSelectedTabElement(selectedTab);
|
|
2931
2915
|
setSelectedTabStyle({
|
|
2932
|
-
left: selectedTab.offsetLeft
|
|
2933
|
-
width: selectedTab.offsetWidth
|
|
2916
|
+
left: `${selectedTab.offsetLeft}px`,
|
|
2917
|
+
width: `${selectedTab.offsetWidth}px`
|
|
2934
2918
|
});
|
|
2935
2919
|
}
|
|
2936
2920
|
}, [selectedId]);
|
|
@@ -3000,9 +2984,9 @@ function TabList(_ref2) {
|
|
|
3000
2984
|
}),
|
|
3001
2985
|
ref: tabListRef
|
|
3002
2986
|
}, props), /*#__PURE__*/React__namespace.createElement(Box$1, {
|
|
3003
|
-
className: [modules_40c67f5b.track, modules_40c67f5b[
|
|
2987
|
+
className: [modules_40c67f5b.track, modules_40c67f5b[`track-${variant}`]]
|
|
3004
2988
|
}), selectedTabElement ? /*#__PURE__*/React__namespace.createElement(Box$1, {
|
|
3005
|
-
className: [modules_40c67f5b.selected, modules_40c67f5b[
|
|
2989
|
+
className: [modules_40c67f5b.selected, modules_40c67f5b[`selected-${variant}`]],
|
|
3006
2990
|
style: selectedTabStyle
|
|
3007
2991
|
}) : null, /*#__PURE__*/React__namespace.createElement(Inline, {
|
|
3008
2992
|
space: space,
|
|
@@ -3016,13 +3000,13 @@ function TabList(_ref2) {
|
|
|
3016
3000
|
*/
|
|
3017
3001
|
|
|
3018
3002
|
|
|
3019
|
-
const TabPanel = /*#__PURE__*/React__namespace.forwardRef(function TabPanel(
|
|
3003
|
+
const TabPanel = /*#__PURE__*/React__namespace.forwardRef(function TabPanel(_ref2, ref) {
|
|
3020
3004
|
let {
|
|
3021
3005
|
children,
|
|
3022
3006
|
id,
|
|
3023
3007
|
renderMode = 'always'
|
|
3024
|
-
} =
|
|
3025
|
-
props = _objectWithoutProperties(
|
|
3008
|
+
} = _ref2,
|
|
3009
|
+
props = _objectWithoutProperties(_ref2, _excluded2$1);
|
|
3026
3010
|
|
|
3027
3011
|
const tabContextValue = React__namespace.useContext(TabsContext);
|
|
3028
3012
|
const [tabRendered, setTabRendered] = React__namespace.useState(false);
|
|
@@ -3196,9 +3180,9 @@ const MenuList = /*#__PURE__*/React__namespace.forwardRef(function MenuList(_ref
|
|
|
3196
3180
|
shift: 4,
|
|
3197
3181
|
ref: ref,
|
|
3198
3182
|
className: classNames__default["default"]('reactist_menulist', exceptionallySetClassName),
|
|
3199
|
-
getAnchorRect: getAnchorRect
|
|
3183
|
+
getAnchorRect: getAnchorRect ?? undefined,
|
|
3200
3184
|
modal: modal,
|
|
3201
|
-
flip: flip
|
|
3185
|
+
flip: flip ?? (isSubMenu ? 'left bottom' : undefined)
|
|
3202
3186
|
}))) : null;
|
|
3203
3187
|
});
|
|
3204
3188
|
/**
|
|
@@ -3354,7 +3338,7 @@ const Button = /*#__PURE__*/React__namespace.forwardRef(function Button(_ref, re
|
|
|
3354
3338
|
} = _ref,
|
|
3355
3339
|
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
3356
3340
|
|
|
3357
|
-
const className = classNames__default["default"]('reactist_button', variant ?
|
|
3341
|
+
const className = classNames__default["default"]('reactist_button', variant ? `reactist_button--${variant}` : null, size !== 'default' ? `reactist_button--${size}` : null, {
|
|
3358
3342
|
'reactist_button--loading': loading
|
|
3359
3343
|
}, props.className);
|
|
3360
3344
|
const button = /*#__PURE__*/React__namespace.createElement("button", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -3729,13 +3713,13 @@ function parseKeys(shortcut, isMac, translateKey) {
|
|
|
3729
3713
|
}
|
|
3730
3714
|
|
|
3731
3715
|
function KeyboardShortcut(_ref) {
|
|
3732
|
-
var _navigator$platform
|
|
3716
|
+
var _navigator$platform;
|
|
3733
3717
|
|
|
3734
3718
|
let {
|
|
3735
3719
|
children,
|
|
3736
3720
|
className,
|
|
3737
3721
|
translateKey = globalTranslateKey,
|
|
3738
|
-
isMac = (
|
|
3722
|
+
isMac = ((_navigator$platform = navigator.platform) == null ? void 0 : _navigator$platform.toUpperCase().includes('MAC')) ?? false
|
|
3739
3723
|
} = _ref,
|
|
3740
3724
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
3741
3725
|
|
|
@@ -3947,12 +3931,12 @@ function ProgressBar({
|
|
|
3947
3931
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
3948
3932
|
className: modules_a0e70af1.inner,
|
|
3949
3933
|
style: {
|
|
3950
|
-
width: width
|
|
3934
|
+
width: `${width}%`
|
|
3951
3935
|
}
|
|
3952
3936
|
}), /*#__PURE__*/React__namespace.createElement(HiddenVisually, null, /*#__PURE__*/React__namespace.createElement("progress", {
|
|
3953
3937
|
value: width,
|
|
3954
3938
|
max: 100,
|
|
3955
|
-
"aria-valuetext": ariaValuetext
|
|
3939
|
+
"aria-valuetext": ariaValuetext ?? undefined
|
|
3956
3940
|
})));
|
|
3957
3941
|
}
|
|
3958
3942
|
|
|
@@ -3988,11 +3972,11 @@ const TimeUtils = {
|
|
|
3988
3972
|
return date.format(shortFormatPastYear);
|
|
3989
3973
|
}
|
|
3990
3974
|
} else if (diffDays === 1) {
|
|
3991
|
-
return
|
|
3975
|
+
return `${diffDays}${daysSuffix}`;
|
|
3992
3976
|
} else if (diffHours > 0 && diffHours <= 23) {
|
|
3993
|
-
return
|
|
3977
|
+
return `${diffHours}${hoursSuffix}`;
|
|
3994
3978
|
} else if (diffMinutes > 0 && diffMinutes <= 59) {
|
|
3995
|
-
return
|
|
3979
|
+
return `${diffMinutes}${minutesSuffix}`;
|
|
3996
3980
|
} else {
|
|
3997
3981
|
return momentsAgo;
|
|
3998
3982
|
}
|