@moda/om 16.2.0 → 17.0.0
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/CHANGELOG.md +26 -0
- package/dist/index.cjs.js +349 -299
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +348 -298
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/Expandable/Expandable.d.ts +1 -0
- package/dist/src/components/Select/Select.d.ts +1 -0
- package/dist/src/components/Select/SelectOption.d.ts +1 -0
- package/dist/src/components/Select/SelectOptions.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/package.json +18 -8
- package/src/components/AspectRatioBox/AspectRatioBox.tsx +4 -4
- package/src/components/AspectRatioBox/index.ts +1 -1
- package/src/components/Badge/Badge.stories.tsx +5 -5
- package/src/components/Badge/Badge.test.tsx +1 -1
- package/src/components/Breadcrumbs/Breadcrumb/Breadcrumb.tsx +6 -6
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +6 -6
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/components/Breakpoint/Breakpoint.stories.tsx +10 -9
- package/src/components/Breakpoint/Breakpoint.test.tsx +2 -2
- package/src/components/Breakpoint/generateMediaQuery.ts +5 -4
- package/src/components/Button/Button.stories.tsx +4 -4
- package/src/components/Checkbox/Checkbox.stories.tsx +5 -5
- package/src/components/Checkbox/Checkbox.test.tsx +3 -3
- package/src/components/Checkbox/Checkbox.tsx +4 -4
- package/src/components/Clickable/Clickable.stories.tsx +3 -3
- package/src/components/ColorSwatch/ColorSwatch.stories.tsx +11 -11
- package/src/components/ColorSwatch/ColorSwatch.test.tsx +1 -1
- package/src/components/ColorSwatch/ColorSwatch.tsx +1 -1
- package/src/components/Constrain/Constrain.stories.tsx +1 -1
- package/src/components/Constrain/ExceedConstrain.stories.tsx +2 -2
- package/src/components/ControlLink/ControlLink.stories.tsx +1 -1
- package/src/components/ControlLink/index.ts +1 -1
- package/src/components/CreditCardNumberInput/CreditCardNumberInput.stories.tsx +1 -1
- package/src/components/CreditCardNumberInput/CreditCardNumberInput.test.tsx +4 -4
- package/src/components/CreditCardNumberInput/CreditCardNumberInput.tsx +1 -0
- package/src/components/DefinitionList/DefinitionList.stories.tsx +3 -3
- package/src/components/DefinitionList/DefinitionList.test.tsx +1 -1
- package/src/components/Divider/Divider.stories.tsx +4 -4
- package/src/components/Divider/Divider.test.tsx +1 -1
- package/src/components/Divider/Divider.tsx +1 -1
- package/src/components/Divider/NoLineDivider.tsx +1 -1
- package/src/components/Divider/TwoLineDivider.tsx +1 -1
- package/src/components/Expandable/Expandable.stories.tsx +8 -8
- package/src/components/Expandable/Expandable.test.tsx +1 -1
- package/src/components/Expandable/Expandable.tsx +12 -5
- package/src/components/Field/Field.stories.tsx +4 -4
- package/src/components/Field/Field.test.tsx +7 -7
- package/src/components/Field/Field.tsx +5 -5
- package/src/components/Field/index.ts +1 -0
- package/src/components/Loading/Loading.test.tsx +1 -1
- package/src/components/Loading/Loading.tsx +2 -1
- package/src/components/Modal/Modal.test.tsx +2 -2
- package/src/components/ModalOverlay/ModalOverlay.test.tsx +2 -2
- package/src/components/ModalOverlay/ModalOverlay.tsx +2 -2
- package/src/components/Overlay/Overlay.stories.tsx +1 -1
- package/src/components/Paginator/Paginator.tsx +3 -3
- package/src/components/PasswordInput/PasswordInput.stories.tsx +1 -1
- package/src/components/PasswordInput/PasswordInput.tsx +6 -6
- package/src/components/Popover/Popover.stories.tsx +1 -1
- package/src/components/Popover/Popover.tsx +10 -7
- package/src/components/PromoBanner/PromoBanner.stories.tsx +9 -9
- package/src/components/PromoBanner/PromoBanner.tsx +1 -1
- package/src/components/RadioButton/RadioButton.stories.tsx +2 -2
- package/src/components/RadioButton/RadioButton.tsx +4 -4
- package/src/components/SearchInput/SearchInput.stories.tsx +2 -2
- package/src/components/SearchInput/SearchInput.test.tsx +1 -1
- package/src/components/SearchInput/SearchInput.tsx +3 -3
- package/src/components/Select/MultiSelect.tsx +7 -7
- package/src/components/Select/Select.stories.tsx +15 -14
- package/src/components/Select/Select.test.tsx +13 -13
- package/src/components/Select/Select.tsx +11 -7
- package/src/components/Select/SelectOption.tsx +5 -2
- package/src/components/Select/SelectOptions.tsx +8 -5
- package/src/components/SelectableButton/SelectableButton.stories.tsx +1 -1
- package/src/components/Shape/ArcWindow.tsx +10 -10
- package/src/components/Shape/Bradley.tsx +4 -4
- package/src/components/Shape/Brancusi.tsx +4 -4
- package/src/components/Shape/Circle.tsx +10 -10
- package/src/components/Shape/Diamond.tsx +10 -10
- package/src/components/Shape/Keyhole.tsx +4 -4
- package/src/components/Shape/Mirror.tsx +4 -4
- package/src/components/Shape/Oval.tsx +4 -4
- package/src/components/Shape/Triangle.tsx +7 -7
- package/src/components/Shape/Window.tsx +4 -4
- package/src/components/Stack/Stack.stories.tsx +3 -3
- package/src/components/Stack/Stack.test.tsx +1 -1
- package/src/components/Tabs/TabList.tsx +1 -1
- package/src/components/Tabs/TabPanel.tsx +1 -1
- package/src/components/Tabs/TabPanels.tsx +1 -1
- package/src/components/Tabs/Tabs.stories.tsx +2 -2
- package/src/components/Tabs/Tabs.test.tsx +2 -2
- package/src/components/Tabs/Tabs.tsx +7 -1
- package/src/components/Tag/Tag.tsx +6 -5
- package/src/components/Text/Text.stories.tsx +5 -5
- package/src/components/Text/Text.test.tsx +1 -1
- package/src/components/TextInput/TextInput.stories.tsx +1 -1
- package/src/components/TextInput/TextInput.test.tsx +1 -1
- package/src/components/Textarea/Textarea.stories.tsx +1 -1
- package/src/components/Textarea/Textarea.test.tsx +3 -3
- package/src/components/Toast/Toast.stories.tsx +1 -1
- package/src/components/Toast/Toast.test.tsx +1 -1
- package/src/components/Toast/Toast.tsx +6 -6
- package/src/components/VerticalDivider/VerticalDivider.stories.tsx +3 -3
- package/src/components/VerticalDivider/VerticalDivider.test.tsx +2 -2
- package/src/hooks/useKeyboardListNavigation.spec.ts +2 -1
- package/src/hooks/useKeyboardListNavigation.ts +2 -0
- package/src/hooks/useUpdateEffect.ts +1 -0
- package/src/index.ts +2 -2
- package/src/mixins/font-smoothing/font-smoothing.stories.tsx +8 -8
- package/src/mixins/overflow-scroll/overflow-scroll.stories.tsx +2 -2
- package/src/mixins/stack/stack.stories.tsx +5 -6
- package/src/mixins/thin-underline/thin-underline.stories.tsx +1 -1
- package/src/mixins/visually-hidden/visually-hidden.stories.tsx +1 -1
- package/src/utilities/States/State.tsx +3 -2
- package/src/utilities/States/States.tsx +4 -3
- package/src/utilities/States/StatesProps.tsx +5 -2
- package/src/utilities/States/isRenderProps.ts +1 -0
- package/src/utilities/States/stringifyProps.tsx +1 -0
package/dist/index.esm.js
CHANGED
|
@@ -973,20 +973,20 @@ var typography_1 = typography;
|
|
|
973
973
|
|
|
974
974
|
var text = function text(name, font) {
|
|
975
975
|
if (font === void 0) {
|
|
976
|
-
font =
|
|
976
|
+
font = 'sans';
|
|
977
977
|
}
|
|
978
978
|
|
|
979
|
-
var treatment = typography_1.typography[
|
|
979
|
+
var treatment = typography_1.typography['text-treatments'][name];
|
|
980
980
|
return __assign$b(__assign$b({}, treatment), {
|
|
981
|
-
|
|
982
|
-
|
|
981
|
+
'font-family': typography_1.typography.fonts[font].join(','),
|
|
982
|
+
'line-height': "".concat(treatment['line-height'])
|
|
983
983
|
});
|
|
984
984
|
};
|
|
985
985
|
|
|
986
986
|
helpers.text = text;
|
|
987
987
|
|
|
988
988
|
var remToUnitlessPx = function remToUnitlessPx(value) {
|
|
989
|
-
return parseFloat(value) * parseInt(typography_1.typography[
|
|
989
|
+
return parseFloat(value) * parseInt(typography_1.typography['root-font-size'], 10);
|
|
990
990
|
};
|
|
991
991
|
|
|
992
992
|
helpers.remToUnitlessPx = remToUnitlessPx;
|
|
@@ -995,18 +995,19 @@ var color = function color(name, alpha) {
|
|
|
995
995
|
var _a;
|
|
996
996
|
|
|
997
997
|
var color = colors_1.colors.all[name];
|
|
998
|
-
return alpha != null ?
|
|
998
|
+
return alpha != null ? // eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
999
|
+
colorString.to.rgb(__spreadArray$1(__spreadArray$1([], ((_a = colorString.get.rgb(color)) === null || _a === void 0 ? void 0 : _a.slice(0, 3)) || [], true), [alpha], false)) : color;
|
|
999
1000
|
};
|
|
1000
1001
|
|
|
1001
1002
|
helpers.color = color;
|
|
1002
1003
|
|
|
1003
|
-
var spacing = function spacing(
|
|
1004
|
-
return [
|
|
1004
|
+
var spacing = function spacing(topY, rightX, bottom, left) {
|
|
1005
|
+
return [topY, rightX, bottom, left].reduce(function (acc, value) {
|
|
1005
1006
|
var _a;
|
|
1006
1007
|
|
|
1007
|
-
if (
|
|
1008
|
-
return [acc, (_a = space_1.space.scale[
|
|
1009
|
-
},
|
|
1008
|
+
if (value === undefined) return acc;
|
|
1009
|
+
return [acc, (_a = space_1.space.scale[value]) !== null && _a !== void 0 ? _a : value].join(' ');
|
|
1010
|
+
}, '');
|
|
1010
1011
|
};
|
|
1011
1012
|
|
|
1012
1013
|
helpers.spacing = spacing;
|
|
@@ -1015,12 +1016,18 @@ helpers.spacing = spacing;
|
|
|
1015
1016
|
|
|
1016
1017
|
var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1017
1018
|
if (k2 === undefined) k2 = k;
|
|
1018
|
-
Object.
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1019
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1020
|
+
|
|
1021
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1022
|
+
desc = {
|
|
1023
|
+
enumerable: true,
|
|
1024
|
+
get: function get() {
|
|
1025
|
+
return m[k];
|
|
1026
|
+
}
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
Object.defineProperty(o, k2, desc);
|
|
1024
1031
|
} : function (o, m, k, k2) {
|
|
1025
1032
|
if (k2 === undefined) k2 = k;
|
|
1026
1033
|
o[k2] = m[k];
|
|
@@ -1247,6 +1254,182 @@ function _nonIterableRest() {
|
|
|
1247
1254
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1248
1255
|
}
|
|
1249
1256
|
|
|
1257
|
+
var isRenderProps = function isRenderProps(children) {
|
|
1258
|
+
return typeof children === 'function';
|
|
1259
|
+
};
|
|
1260
|
+
|
|
1261
|
+
var classnames = {exports: {}};
|
|
1262
|
+
|
|
1263
|
+
(function (module) {
|
|
1264
|
+
/* global define */
|
|
1265
|
+
(function () {
|
|
1266
|
+
|
|
1267
|
+
var hasOwn = {}.hasOwnProperty;
|
|
1268
|
+
|
|
1269
|
+
function classNames() {
|
|
1270
|
+
var classes = [];
|
|
1271
|
+
|
|
1272
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
1273
|
+
var arg = arguments[i];
|
|
1274
|
+
if (!arg) continue;
|
|
1275
|
+
|
|
1276
|
+
var argType = _typeof(arg);
|
|
1277
|
+
|
|
1278
|
+
if (argType === 'string' || argType === 'number') {
|
|
1279
|
+
classes.push(arg);
|
|
1280
|
+
} else if (Array.isArray(arg)) {
|
|
1281
|
+
if (arg.length) {
|
|
1282
|
+
var inner = classNames.apply(null, arg);
|
|
1283
|
+
|
|
1284
|
+
if (inner) {
|
|
1285
|
+
classes.push(inner);
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
} else if (argType === 'object') {
|
|
1289
|
+
if (arg.toString === Object.prototype.toString) {
|
|
1290
|
+
for (var key in arg) {
|
|
1291
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1292
|
+
classes.push(key);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
} else {
|
|
1296
|
+
classes.push(arg.toString());
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
return classes.join(' ');
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
if (module.exports) {
|
|
1305
|
+
classNames["default"] = classNames;
|
|
1306
|
+
module.exports = classNames;
|
|
1307
|
+
} else {
|
|
1308
|
+
window.classNames = classNames;
|
|
1309
|
+
}
|
|
1310
|
+
})();
|
|
1311
|
+
})(classnames);
|
|
1312
|
+
|
|
1313
|
+
var classNames = classnames.exports;
|
|
1314
|
+
|
|
1315
|
+
var _excluded$E = ["className", "children", "space", "direction", "alignItems", "justifyContent", "style"];
|
|
1316
|
+
var Stack = function Stack(_ref) {
|
|
1317
|
+
var className = _ref.className,
|
|
1318
|
+
children = _ref.children,
|
|
1319
|
+
space = _ref.space,
|
|
1320
|
+
_ref$direction = _ref.direction,
|
|
1321
|
+
direction = _ref$direction === void 0 ? 'vertical' : _ref$direction,
|
|
1322
|
+
alignItems = _ref.alignItems,
|
|
1323
|
+
justifyContent = _ref.justifyContent,
|
|
1324
|
+
style = _ref.style,
|
|
1325
|
+
rest = _objectWithoutProperties(_ref, _excluded$E);
|
|
1326
|
+
|
|
1327
|
+
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
1328
|
+
className: classNames("Stack Stack--".concat(direction, "-").concat(space), className),
|
|
1329
|
+
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
1330
|
+
alignItems: alignItems,
|
|
1331
|
+
justifyContent: justifyContent
|
|
1332
|
+
})
|
|
1333
|
+
}, rest), children);
|
|
1334
|
+
};
|
|
1335
|
+
|
|
1336
|
+
var omit = function omit(obj) {
|
|
1337
|
+
for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1338
|
+
keys[_key - 1] = arguments[_key];
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
return Object.entries(obj).filter(function (_ref) {
|
|
1342
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
1343
|
+
key = _ref2[0];
|
|
1344
|
+
|
|
1345
|
+
return !keys.includes(key);
|
|
1346
|
+
}).reduce(function (obj, _ref3) {
|
|
1347
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
1348
|
+
key = _ref4[0],
|
|
1349
|
+
val = _ref4[1];
|
|
1350
|
+
|
|
1351
|
+
return Object.assign(obj, _defineProperty$1({}, key, val));
|
|
1352
|
+
}, {});
|
|
1353
|
+
};
|
|
1354
|
+
|
|
1355
|
+
var truncate = function truncate(string) {
|
|
1356
|
+
var maxLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;
|
|
1357
|
+
if (!string) return null;
|
|
1358
|
+
var ellipsis = string.length > maxLength;
|
|
1359
|
+
return "".concat(string.substring(0, maxLength)).concat(ellipsis ? '...' : '');
|
|
1360
|
+
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1361
|
+
|
|
1362
|
+
|
|
1363
|
+
var stringifyProps = function stringifyProps(props) {
|
|
1364
|
+
var stringifiedProps = Object.entries(props || {}).reduce(function (memo, _ref) {
|
|
1365
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
1366
|
+
key = _ref2[0],
|
|
1367
|
+
value = _ref2[1];
|
|
1368
|
+
|
|
1369
|
+
if (key === 'children') return "".concat(memo, " children={...}");
|
|
1370
|
+
if (typeof value === 'string') return "".concat(memo, " ").concat(key, "=\"").concat(truncate(value), "\"");
|
|
1371
|
+
if (typeof value === 'function') return "".concat(memo, " ").concat(key, "={fn}");
|
|
1372
|
+
if (typeof value === 'boolean') return "".concat(memo, " ").concat(key).concat(value ? '' : '={false}');
|
|
1373
|
+
if (typeof value === 'number') return "".concat(memo, " ").concat(key, "={").concat(value, "}");
|
|
1374
|
+
if (_typeof(value) === 'object') return "".concat(memo, " ").concat(key, "={...}");
|
|
1375
|
+
return "".concat(memo, " ").concat(key, "=").concat(value);
|
|
1376
|
+
}, '');
|
|
1377
|
+
return stringifiedProps.trim();
|
|
1378
|
+
};
|
|
1379
|
+
|
|
1380
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1381
|
+
|
|
1382
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
1383
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1384
|
+
var isEmpty = function isEmpty(obj) {
|
|
1385
|
+
return Object.entries(obj || {}).length === 0;
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
var StatesProps = function StatesProps(_ref) {
|
|
1389
|
+
var props = _ref.props,
|
|
1390
|
+
children = _ref.children;
|
|
1391
|
+
var childrenProps = omit.apply(void 0, [children.props].concat(_toConsumableArray(Object.keys(props || {}))));
|
|
1392
|
+
return /*#__PURE__*/React__default.createElement(Stack, {
|
|
1393
|
+
className: "StatesProps",
|
|
1394
|
+
space: 2,
|
|
1395
|
+
direction: "horizontal"
|
|
1396
|
+
}, /*#__PURE__*/React__default.createElement("span", null, children.type.displayName || children.type.name), !isEmpty(props) && /*#__PURE__*/React__default.createElement("strong", null, stringifyProps(props)), !isRenderProps(children) && !isEmpty(childrenProps) && /*#__PURE__*/React__default.createElement("span", null, stringifyProps(childrenProps)), /*#__PURE__*/React__default.createElement("span", null, " "));
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1399
|
+
var _excluded$D = ["props", "children"];
|
|
1400
|
+
var State = function State(_ref) {
|
|
1401
|
+
var props = _ref.props,
|
|
1402
|
+
children = _ref.children,
|
|
1403
|
+
rest = _objectWithoutProperties(_ref, _excluded$D);
|
|
1404
|
+
|
|
1405
|
+
var Specimen = isRenderProps(children) ? children(props) : /*#__PURE__*/React__default.cloneElement(children, props);
|
|
1406
|
+
var innerChildren = isRenderProps(children) ? children(props) : children;
|
|
1407
|
+
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
1408
|
+
className: "State"
|
|
1409
|
+
}, rest), Specimen, /*#__PURE__*/React__default.createElement("code", {
|
|
1410
|
+
className: "State__props"
|
|
1411
|
+
}, /*#__PURE__*/React__default.createElement(StatesProps, {
|
|
1412
|
+
props: props
|
|
1413
|
+
}, innerChildren)));
|
|
1414
|
+
};
|
|
1415
|
+
|
|
1416
|
+
var _excluded$C = ["states", "children"];
|
|
1417
|
+
var States = function States(_ref) {
|
|
1418
|
+
var _ref$states = _ref.states,
|
|
1419
|
+
states = _ref$states === void 0 ? [{}] : _ref$states,
|
|
1420
|
+
children = _ref.children,
|
|
1421
|
+
rest = _objectWithoutProperties(_ref, _excluded$C);
|
|
1422
|
+
|
|
1423
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
1424
|
+
className: "States"
|
|
1425
|
+
}, states.map(function (props, index) {
|
|
1426
|
+
return /*#__PURE__*/React__default.createElement(State, _extends$1({
|
|
1427
|
+
key: index,
|
|
1428
|
+
props: props
|
|
1429
|
+
}, rest), children);
|
|
1430
|
+
}));
|
|
1431
|
+
};
|
|
1432
|
+
|
|
1250
1433
|
var _assign = function __assign() {
|
|
1251
1434
|
_assign = Object.assign || function __assign(t) {
|
|
1252
1435
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -1601,7 +1784,7 @@ RemoveScroll.classNames = {
|
|
|
1601
1784
|
};
|
|
1602
1785
|
|
|
1603
1786
|
function _extends() {
|
|
1604
|
-
_extends = Object.assign
|
|
1787
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
1605
1788
|
for (var i = 1; i < arguments.length; i++) {
|
|
1606
1789
|
var source = arguments[i];
|
|
1607
1790
|
|
|
@@ -1614,7 +1797,6 @@ function _extends() {
|
|
|
1614
1797
|
|
|
1615
1798
|
return target;
|
|
1616
1799
|
};
|
|
1617
|
-
|
|
1618
1800
|
return _extends.apply(this, arguments);
|
|
1619
1801
|
}
|
|
1620
1802
|
|
|
@@ -3300,11 +3482,10 @@ var FocusOn$1 = /*#__PURE__*/React.forwardRef(function (props, parentRef) {
|
|
|
3300
3482
|
});
|
|
3301
3483
|
|
|
3302
3484
|
function _setPrototypeOf(o, p) {
|
|
3303
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
3485
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
3304
3486
|
o.__proto__ = p;
|
|
3305
3487
|
return o;
|
|
3306
3488
|
};
|
|
3307
|
-
|
|
3308
3489
|
return _setPrototypeOf(o, p);
|
|
3309
3490
|
}
|
|
3310
3491
|
|
|
@@ -4424,24 +4605,42 @@ var stylesheetSingleton = function stylesheetSingleton() {
|
|
|
4424
4605
|
};
|
|
4425
4606
|
};
|
|
4426
4607
|
|
|
4608
|
+
/**
|
|
4609
|
+
* creates a hook to control style singleton
|
|
4610
|
+
* @see {@link styleSingleton} for a safer component version
|
|
4611
|
+
* @example
|
|
4612
|
+
* ```tsx
|
|
4613
|
+
* const useStyle = styleHookSingleton();
|
|
4614
|
+
* ///
|
|
4615
|
+
* useStyle('body { overflow: hidden}');
|
|
4616
|
+
*/
|
|
4617
|
+
|
|
4427
4618
|
var styleHookSingleton = function styleHookSingleton() {
|
|
4428
4619
|
var sheet = stylesheetSingleton();
|
|
4429
|
-
return function (styles) {
|
|
4620
|
+
return function (styles, isDynamic) {
|
|
4430
4621
|
React.useEffect(function () {
|
|
4431
4622
|
sheet.add(styles);
|
|
4432
4623
|
return function () {
|
|
4433
4624
|
sheet.remove();
|
|
4434
4625
|
};
|
|
4435
|
-
}, [styles]);
|
|
4626
|
+
}, [styles && isDynamic]);
|
|
4436
4627
|
};
|
|
4437
4628
|
};
|
|
4438
4629
|
|
|
4630
|
+
/**
|
|
4631
|
+
* create a Component to add styles on demand
|
|
4632
|
+
* - styles are added when first instance is mounted
|
|
4633
|
+
* - styles are removed when the last instance is unmounted
|
|
4634
|
+
* - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
|
|
4635
|
+
*/
|
|
4636
|
+
|
|
4439
4637
|
var styleSingleton = function styleSingleton() {
|
|
4440
4638
|
var useStyle = styleHookSingleton();
|
|
4441
4639
|
|
|
4442
4640
|
var Sheet = function Sheet(_a) {
|
|
4443
|
-
var styles = _a.styles
|
|
4444
|
-
|
|
4641
|
+
var styles = _a.styles,
|
|
4642
|
+
dynamic = _a.dynamic;
|
|
4643
|
+
useStyle(styles, dynamic);
|
|
4445
4644
|
return null;
|
|
4446
4645
|
};
|
|
4447
4646
|
|
|
@@ -4461,6 +4660,13 @@ var parse = function parse(x) {
|
|
|
4461
4660
|
|
|
4462
4661
|
var getOffset = function getOffset(gapMode) {
|
|
4463
4662
|
var cs = window.getComputedStyle(document.body);
|
|
4663
|
+
|
|
4664
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4665
|
+
if (cs.overflowY === 'hidden') {
|
|
4666
|
+
console.error('react-remove-scroll-bar: cannot calculate scrollbar size because it is removed (overflow:hidden on body');
|
|
4667
|
+
}
|
|
4668
|
+
}
|
|
4669
|
+
|
|
4464
4670
|
var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];
|
|
4465
4671
|
var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];
|
|
4466
4672
|
var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];
|
|
@@ -4509,17 +4715,13 @@ var getStyles = function getStyles(_a, allowRelative, gapMode, important) {
|
|
|
4509
4715
|
|
|
4510
4716
|
|
|
4511
4717
|
var RemoveScrollBar = function RemoveScrollBar(props) {
|
|
4512
|
-
var _a = React.useState(getGapWidth(props.gapMode)),
|
|
4513
|
-
gap = _a[0],
|
|
4514
|
-
setGap = _a[1];
|
|
4515
|
-
|
|
4516
|
-
React.useEffect(function () {
|
|
4517
|
-
setGap(getGapWidth(props.gapMode));
|
|
4518
|
-
}, [props.gapMode]);
|
|
4519
4718
|
var noRelative = props.noRelative,
|
|
4520
4719
|
noImportant = props.noImportant,
|
|
4521
|
-
|
|
4522
|
-
gapMode =
|
|
4720
|
+
_a = props.gapMode,
|
|
4721
|
+
gapMode = _a === void 0 ? 'margin' : _a;
|
|
4722
|
+
var gap = React.useMemo(function () {
|
|
4723
|
+
return getGapWidth(gapMode);
|
|
4724
|
+
}, [gapMode]);
|
|
4523
4725
|
return /*#__PURE__*/React.createElement(Style$1, {
|
|
4524
4726
|
styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '')
|
|
4525
4727
|
});
|
|
@@ -5092,60 +5294,6 @@ var FocusOn = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
5092
5294
|
}));
|
|
5093
5295
|
});
|
|
5094
5296
|
|
|
5095
|
-
var classnames = {exports: {}};
|
|
5096
|
-
|
|
5097
|
-
(function (module) {
|
|
5098
|
-
/* global define */
|
|
5099
|
-
(function () {
|
|
5100
|
-
|
|
5101
|
-
var hasOwn = {}.hasOwnProperty;
|
|
5102
|
-
|
|
5103
|
-
function classNames() {
|
|
5104
|
-
var classes = [];
|
|
5105
|
-
|
|
5106
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
5107
|
-
var arg = arguments[i];
|
|
5108
|
-
if (!arg) continue;
|
|
5109
|
-
|
|
5110
|
-
var argType = _typeof(arg);
|
|
5111
|
-
|
|
5112
|
-
if (argType === 'string' || argType === 'number') {
|
|
5113
|
-
classes.push(arg);
|
|
5114
|
-
} else if (Array.isArray(arg)) {
|
|
5115
|
-
if (arg.length) {
|
|
5116
|
-
var inner = classNames.apply(null, arg);
|
|
5117
|
-
|
|
5118
|
-
if (inner) {
|
|
5119
|
-
classes.push(inner);
|
|
5120
|
-
}
|
|
5121
|
-
}
|
|
5122
|
-
} else if (argType === 'object') {
|
|
5123
|
-
if (arg.toString === Object.prototype.toString) {
|
|
5124
|
-
for (var key in arg) {
|
|
5125
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
5126
|
-
classes.push(key);
|
|
5127
|
-
}
|
|
5128
|
-
}
|
|
5129
|
-
} else {
|
|
5130
|
-
classes.push(arg.toString());
|
|
5131
|
-
}
|
|
5132
|
-
}
|
|
5133
|
-
}
|
|
5134
|
-
|
|
5135
|
-
return classes.join(' ');
|
|
5136
|
-
}
|
|
5137
|
-
|
|
5138
|
-
if (module.exports) {
|
|
5139
|
-
classNames["default"] = classNames;
|
|
5140
|
-
module.exports = classNames;
|
|
5141
|
-
} else {
|
|
5142
|
-
window.classNames = classNames;
|
|
5143
|
-
}
|
|
5144
|
-
})();
|
|
5145
|
-
})(classnames);
|
|
5146
|
-
|
|
5147
|
-
var classNames = classnames.exports;
|
|
5148
|
-
|
|
5149
5297
|
var dist$3 = {};
|
|
5150
5298
|
|
|
5151
5299
|
var scale = {};
|
|
@@ -5253,7 +5401,7 @@ var scale = {};
|
|
|
5253
5401
|
__exportStar(scale, exports);
|
|
5254
5402
|
})(dist$3);
|
|
5255
5403
|
|
|
5256
|
-
var _excluded$
|
|
5404
|
+
var _excluded$B = ["aspectWidth", "aspectHeight", "maxWidth", "maxHeight", "outlined", "children", "className"];
|
|
5257
5405
|
var DEFAULT_PRODUCT_ASPECT_WIDTH = 128;
|
|
5258
5406
|
var DEFAULT_PRODUCT_ASPECT_HEIGHT = 205;
|
|
5259
5407
|
var DEFAULT_PRODUCT_ASPECT_RATIO = DEFAULT_PRODUCT_ASPECT_HEIGHT / DEFAULT_PRODUCT_ASPECT_WIDTH;
|
|
@@ -5268,7 +5416,7 @@ var AspectRatioBox = /*#__PURE__*/React__default.forwardRef(function (_ref, forw
|
|
|
5268
5416
|
outlined = _ref$outlined === void 0 ? false : _ref$outlined,
|
|
5269
5417
|
children = _ref.children,
|
|
5270
5418
|
className = _ref.className,
|
|
5271
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5419
|
+
rest = _objectWithoutProperties(_ref, _excluded$B);
|
|
5272
5420
|
|
|
5273
5421
|
var _scale = dist$3.scale({
|
|
5274
5422
|
width: aspectWidth,
|
|
@@ -5298,23 +5446,23 @@ var AspectRatioBox = /*#__PURE__*/React__default.forwardRef(function (_ref, forw
|
|
|
5298
5446
|
});
|
|
5299
5447
|
AspectRatioBox.displayName = 'AspectRatioBox';
|
|
5300
5448
|
|
|
5301
|
-
var _excluded$
|
|
5449
|
+
var _excluded$A = ["className", "theme", "children"];
|
|
5302
5450
|
var Badge = function Badge(_ref) {
|
|
5303
5451
|
var className = _ref.className,
|
|
5304
5452
|
theme = _ref.theme,
|
|
5305
5453
|
children = _ref.children,
|
|
5306
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5454
|
+
rest = _objectWithoutProperties(_ref, _excluded$A);
|
|
5307
5455
|
|
|
5308
5456
|
return /*#__PURE__*/React__default.createElement("span", _extends$1({
|
|
5309
5457
|
className: classNames('Badge', theme && "Badge--".concat(theme), className)
|
|
5310
5458
|
}, rest), children);
|
|
5311
5459
|
};
|
|
5312
5460
|
|
|
5313
|
-
var _excluded$
|
|
5461
|
+
var _excluded$z = ["children", "className"];
|
|
5314
5462
|
var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
5315
5463
|
var children = _ref.children,
|
|
5316
5464
|
className = _ref.className,
|
|
5317
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5465
|
+
rest = _objectWithoutProperties(_ref, _excluded$z);
|
|
5318
5466
|
|
|
5319
5467
|
var position = 0;
|
|
5320
5468
|
return /*#__PURE__*/React__default.createElement("ol", _extends$1({
|
|
@@ -5334,7 +5482,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
5334
5482
|
}));
|
|
5335
5483
|
};
|
|
5336
5484
|
|
|
5337
|
-
var _excluded$
|
|
5485
|
+
var _excluded$y = ["className", "styleless", "disabled"];
|
|
5338
5486
|
|
|
5339
5487
|
var isLink = function isLink(props) {
|
|
5340
5488
|
return 'to' in props;
|
|
@@ -5353,7 +5501,7 @@ var Clickable = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
5353
5501
|
_ref$styleless = _ref.styleless,
|
|
5354
5502
|
styleless = _ref$styleless === void 0 ? false : _ref$styleless,
|
|
5355
5503
|
disabled = _ref.disabled,
|
|
5356
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5504
|
+
rest = _objectWithoutProperties(_ref, _excluded$y);
|
|
5357
5505
|
|
|
5358
5506
|
var props = _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
5359
5507
|
className: classNames({
|
|
@@ -5376,14 +5524,14 @@ var Clickable = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
5376
5524
|
});
|
|
5377
5525
|
Clickable.displayName = 'Clickable';
|
|
5378
5526
|
|
|
5379
|
-
var _excluded$
|
|
5527
|
+
var _excluded$x = ["className", "disabled", "children", "underlined"];
|
|
5380
5528
|
var ControlLink = function ControlLink(_ref) {
|
|
5381
5529
|
var className = _ref.className,
|
|
5382
5530
|
disabled = _ref.disabled,
|
|
5383
5531
|
children = _ref.children,
|
|
5384
5532
|
_ref$underlined = _ref.underlined,
|
|
5385
5533
|
underlined = _ref$underlined === void 0 ? true : _ref$underlined,
|
|
5386
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5534
|
+
rest = _objectWithoutProperties(_ref, _excluded$x);
|
|
5387
5535
|
|
|
5388
5536
|
return /*#__PURE__*/React__default.createElement(Clickable, _extends$1({}, rest, {
|
|
5389
5537
|
className: classNames('ControlLink', {
|
|
@@ -5395,12 +5543,12 @@ var ControlLink = function ControlLink(_ref) {
|
|
|
5395
5543
|
}), children);
|
|
5396
5544
|
};
|
|
5397
5545
|
|
|
5398
|
-
var _excluded$
|
|
5546
|
+
var _excluded$w = ["children", "position", "className"];
|
|
5399
5547
|
var Breadcrumb = function Breadcrumb(_ref) {
|
|
5400
5548
|
var children = _ref.children,
|
|
5401
5549
|
position = _ref.position,
|
|
5402
5550
|
className = _ref.className,
|
|
5403
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5551
|
+
rest = _objectWithoutProperties(_ref, _excluded$w);
|
|
5404
5552
|
|
|
5405
5553
|
return /*#__PURE__*/React__default.createElement("li", {
|
|
5406
5554
|
className: classNames('Breadcrumb', className),
|
|
@@ -5419,7 +5567,8 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
5419
5567
|
}));
|
|
5420
5568
|
};
|
|
5421
5569
|
|
|
5422
|
-
var breakpointKeys = Object.keys(dist$4.breakpoints);
|
|
5570
|
+
var breakpointKeys = Object.keys(dist$4.breakpoints); // eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
5571
|
+
|
|
5423
5572
|
var ONE_PIXEL = 1 / 16;
|
|
5424
5573
|
var getMediaQueryBounds = function getMediaQueryBounds(_ref) {
|
|
5425
5574
|
var mode = _ref.mode,
|
|
@@ -5429,21 +5578,21 @@ var getMediaQueryBounds = function getMediaQueryBounds(_ref) {
|
|
|
5429
5578
|
case 'at':
|
|
5430
5579
|
{
|
|
5431
5580
|
var prevIndex = breakpointKeys.indexOf(breakpoint) - 1;
|
|
5432
|
-
var prevWidth = prevIndex === -1 ? 0 : parseInt(dist$4.breakpoints[breakpointKeys[prevIndex]]) + ONE_PIXEL;
|
|
5581
|
+
var prevWidth = prevIndex === -1 ? 0 : parseInt(dist$4.breakpoints[breakpointKeys[prevIndex]], 10) + ONE_PIXEL;
|
|
5433
5582
|
return {
|
|
5434
5583
|
min: prevWidth,
|
|
5435
|
-
max: parseInt(dist$4.breakpoints[breakpoint])
|
|
5584
|
+
max: parseInt(dist$4.breakpoints[breakpoint], 10)
|
|
5436
5585
|
};
|
|
5437
5586
|
}
|
|
5438
5587
|
|
|
5439
5588
|
case 'gt':
|
|
5440
5589
|
return {
|
|
5441
|
-
min: parseInt(dist$4.breakpoints[breakpoint]) + ONE_PIXEL
|
|
5590
|
+
min: parseInt(dist$4.breakpoints[breakpoint], 10) + ONE_PIXEL
|
|
5442
5591
|
};
|
|
5443
5592
|
|
|
5444
5593
|
case 'lt':
|
|
5445
5594
|
return {
|
|
5446
|
-
max: parseInt(dist$4.breakpoints[breakpoint])
|
|
5595
|
+
max: parseInt(dist$4.breakpoints[breakpoint], 10)
|
|
5447
5596
|
};
|
|
5448
5597
|
}
|
|
5449
5598
|
};
|
|
@@ -5533,10 +5682,10 @@ var useBreakpoint = function useBreakpoint(props) {
|
|
|
5533
5682
|
};
|
|
5534
5683
|
};
|
|
5535
5684
|
|
|
5536
|
-
var _excluded$
|
|
5685
|
+
var _excluded$v = ["children"];
|
|
5537
5686
|
var Breakpoint = function Breakpoint(_ref) {
|
|
5538
5687
|
var children = _ref.children,
|
|
5539
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5688
|
+
rest = _objectWithoutProperties(_ref, _excluded$v);
|
|
5540
5689
|
|
|
5541
5690
|
var _discriminate = discriminate(rest),
|
|
5542
5691
|
mode = _discriminate.mode,
|
|
@@ -5550,7 +5699,7 @@ var Breakpoint = function Breakpoint(_ref) {
|
|
|
5550
5699
|
}, children) : null;
|
|
5551
5700
|
};
|
|
5552
5701
|
|
|
5553
|
-
var _excluded$
|
|
5702
|
+
var _excluded$u = ["secondary", "chip", "hover", "focus", "disabled", "className"];
|
|
5554
5703
|
var Button = function Button(_ref) {
|
|
5555
5704
|
var secondary = _ref.secondary,
|
|
5556
5705
|
chip = _ref.chip,
|
|
@@ -5558,7 +5707,7 @@ var Button = function Button(_ref) {
|
|
|
5558
5707
|
focus = _ref.focus,
|
|
5559
5708
|
disabled = _ref.disabled,
|
|
5560
5709
|
className = _ref.className,
|
|
5561
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5710
|
+
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
5562
5711
|
|
|
5563
5712
|
return /*#__PURE__*/React__default.createElement(Clickable, _extends$1({
|
|
5564
5713
|
className: classNames('Button', {
|
|
@@ -5709,7 +5858,7 @@ var Circle12 = function Circle12(_a) {
|
|
|
5709
5858
|
|
|
5710
5859
|
Circle12.displayName = 'Circle12';
|
|
5711
5860
|
|
|
5712
|
-
var _excluded$
|
|
5861
|
+
var _excluded$t = ["className", "defaultChecked", "checked", "children", "value", "onChange", "disabled", "checkIcon"];
|
|
5713
5862
|
var CHECKED_ITEM_PROPS = {
|
|
5714
5863
|
className: 'Checkbox__check-mark',
|
|
5715
5864
|
height: '85%',
|
|
@@ -5727,7 +5876,7 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
5727
5876
|
disabled = _ref.disabled,
|
|
5728
5877
|
_ref$checkIcon = _ref.checkIcon,
|
|
5729
5878
|
checkIcon = _ref$checkIcon === void 0 ? 'checkmark' : _ref$checkIcon,
|
|
5730
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5879
|
+
rest = _objectWithoutProperties(_ref, _excluded$t);
|
|
5731
5880
|
|
|
5732
5881
|
var _useState = useState((_ref2 = checked !== null && checked !== void 0 ? checked : defaultChecked) !== null && _ref2 !== void 0 ? _ref2 : false),
|
|
5733
5882
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -5815,7 +5964,7 @@ var SKU_COLORS = {
|
|
|
5815
5964
|
yellow: '#ffca44'
|
|
5816
5965
|
};
|
|
5817
5966
|
|
|
5818
|
-
var _excluded$
|
|
5967
|
+
var _excluded$s = ["className", "size", "color", "backgroundUrl", "focus", "hover", "selected", "soldOut", "onSale", "onClick", "onMouseEnter", "disabled"];
|
|
5819
5968
|
var ColorSwatch = function ColorSwatch(_ref) {
|
|
5820
5969
|
var className = _ref.className,
|
|
5821
5970
|
size = _ref.size,
|
|
@@ -5829,7 +5978,7 @@ var ColorSwatch = function ColorSwatch(_ref) {
|
|
|
5829
5978
|
onClick = _ref.onClick,
|
|
5830
5979
|
onMouseEnter = _ref.onMouseEnter,
|
|
5831
5980
|
disabled = _ref.disabled,
|
|
5832
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5981
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
5833
5982
|
|
|
5834
5983
|
var handleClick = useCallback(function (_event) {
|
|
5835
5984
|
onClick && onClick(color);
|
|
@@ -5865,22 +6014,22 @@ var ColorSwatch = function ColorSwatch(_ref) {
|
|
|
5865
6014
|
}));
|
|
5866
6015
|
};
|
|
5867
6016
|
|
|
5868
|
-
var _excluded$
|
|
6017
|
+
var _excluded$r = ["className", "children"];
|
|
5869
6018
|
var Constrain = function Constrain(_ref) {
|
|
5870
6019
|
var className = _ref.className,
|
|
5871
6020
|
children = _ref.children,
|
|
5872
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
6021
|
+
rest = _objectWithoutProperties(_ref, _excluded$r);
|
|
5873
6022
|
|
|
5874
6023
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
5875
6024
|
className: classNames('Constrain', className)
|
|
5876
6025
|
}, rest), children);
|
|
5877
6026
|
};
|
|
5878
6027
|
|
|
5879
|
-
var _excluded$
|
|
6028
|
+
var _excluded$q = ["className", "children"];
|
|
5880
6029
|
var ExceedConstrain = function ExceedConstrain(_ref) {
|
|
5881
6030
|
var className = _ref.className,
|
|
5882
6031
|
children = _ref.children,
|
|
5883
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
6032
|
+
rest = _objectWithoutProperties(_ref, _excluded$q);
|
|
5884
6033
|
|
|
5885
6034
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
5886
6035
|
className: classNames('ExceedConstrain', className)
|
|
@@ -8292,7 +8441,7 @@ var Warning16 = function Warning16(_a) {
|
|
|
8292
8441
|
|
|
8293
8442
|
Warning16.displayName = 'Warning16';
|
|
8294
8443
|
|
|
8295
|
-
var _excluded$
|
|
8444
|
+
var _excluded$p = ["className", "disabled", "error", "focus", "placeholder", "label", "onChange", "onChangeEvent"];
|
|
8296
8445
|
var TextInput = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
8297
8446
|
var className = _ref.className,
|
|
8298
8447
|
disabled = _ref.disabled,
|
|
@@ -8302,7 +8451,7 @@ var TextInput = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
8302
8451
|
label = _ref.label,
|
|
8303
8452
|
_onChange = _ref.onChange,
|
|
8304
8453
|
onChangeEvent = _ref.onChangeEvent,
|
|
8305
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8454
|
+
rest = _objectWithoutProperties(_ref, _excluded$p);
|
|
8306
8455
|
|
|
8307
8456
|
return /*#__PURE__*/React__default.createElement("input", _extends$1({
|
|
8308
8457
|
className: classNames('TextInput', className, {
|
|
@@ -8641,7 +8790,8 @@ var useKeyboardListNavigation = function useKeyboardListNavigation(_ref) {
|
|
|
8641
8790
|
return function () {
|
|
8642
8791
|
el.removeEventListener('keydown', handleKeyDown);
|
|
8643
8792
|
};
|
|
8644
|
-
}, [handleKeyDown, ref, idleTimeout]);
|
|
8793
|
+
}, [handleKeyDown, ref, idleTimeout]); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8794
|
+
|
|
8645
8795
|
useEffect(function () {
|
|
8646
8796
|
return dispatch({
|
|
8647
8797
|
type: 'RESET',
|
|
@@ -8657,6 +8807,7 @@ var useKeyboardListNavigation = function useKeyboardListNavigation(_ref) {
|
|
|
8657
8807
|
});
|
|
8658
8808
|
};
|
|
8659
8809
|
|
|
8810
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
8660
8811
|
var useUpdateEffect = function useUpdateEffect(effect, deps) {
|
|
8661
8812
|
var didMountRef = useRef(false);
|
|
8662
8813
|
useEffect(function () {
|
|
@@ -8668,7 +8819,7 @@ var useUpdateEffect = function useUpdateEffect(effect, deps) {
|
|
|
8668
8819
|
}, deps);
|
|
8669
8820
|
};
|
|
8670
8821
|
|
|
8671
|
-
var _excluded$
|
|
8822
|
+
var _excluded$o = ["className", "treatment", "color", "family", "children", "style"];
|
|
8672
8823
|
var Text = function Text(_ref) {
|
|
8673
8824
|
var className = _ref.className,
|
|
8674
8825
|
_ref$treatment = _ref.treatment,
|
|
@@ -8678,7 +8829,7 @@ var Text = function Text(_ref) {
|
|
|
8678
8829
|
family = _ref.family,
|
|
8679
8830
|
children = _ref.children,
|
|
8680
8831
|
style = _ref.style,
|
|
8681
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8832
|
+
rest = _objectWithoutProperties(_ref, _excluded$o);
|
|
8682
8833
|
|
|
8683
8834
|
return /*#__PURE__*/React__default.createElement("span", _extends$1({
|
|
8684
8835
|
className: classNames("Text Text--".concat(treatment, " ").concat(family ? "Text--".concat(family) : ''), className),
|
|
@@ -8835,7 +8986,7 @@ var Search20 = function Search20(_a) {
|
|
|
8835
8986
|
|
|
8836
8987
|
Search20.displayName = 'Search20';
|
|
8837
8988
|
|
|
8838
|
-
var _excluded$
|
|
8989
|
+
var _excluded$n = ["className", "onChange", "onChangeValue", "onClear", "value"];
|
|
8839
8990
|
var DEFAULT_INPUT_VALUE = '';
|
|
8840
8991
|
var SearchInput = function SearchInput(_ref) {
|
|
8841
8992
|
var className = _ref.className,
|
|
@@ -8844,7 +8995,7 @@ var SearchInput = function SearchInput(_ref) {
|
|
|
8844
8995
|
onClear = _ref.onClear,
|
|
8845
8996
|
_ref$value = _ref.value,
|
|
8846
8997
|
value = _ref$value === void 0 ? DEFAULT_INPUT_VALUE : _ref$value,
|
|
8847
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8998
|
+
rest = _objectWithoutProperties(_ref, _excluded$n);
|
|
8848
8999
|
|
|
8849
9000
|
var ref = useRef(null);
|
|
8850
9001
|
|
|
@@ -9042,7 +9193,8 @@ var SelectOption = function SelectOption(_ref) {
|
|
|
9042
9193
|
selected = _ref.selected,
|
|
9043
9194
|
option = _ref.option,
|
|
9044
9195
|
onClick = _ref.onClick,
|
|
9045
|
-
className = _ref.className
|
|
9196
|
+
className = _ref.className,
|
|
9197
|
+
dataTestId = _ref.dataTestId;
|
|
9046
9198
|
var ref = useRef(null);
|
|
9047
9199
|
var handleClick = useCallback(function (event) {
|
|
9048
9200
|
event.preventDefault();
|
|
@@ -9064,13 +9216,14 @@ var SelectOption = function SelectOption(_ref) {
|
|
|
9064
9216
|
'SelectOption--disabled': option.disabled
|
|
9065
9217
|
}),
|
|
9066
9218
|
onClick: handleClick,
|
|
9219
|
+
"data-test-id": dataTestId ? "".concat(dataTestId, "--").concat(option.label.replace(' ', '-')) : undefined,
|
|
9067
9220
|
"aria-label": option.label,
|
|
9068
9221
|
"aria-selected": selected,
|
|
9069
9222
|
role: "option"
|
|
9070
9223
|
}, option.label);
|
|
9071
9224
|
};
|
|
9072
9225
|
|
|
9073
|
-
var _excluded$
|
|
9226
|
+
var _excluded$m = ["idRef", "searchable", "autoFocus", "options", "selectedOption", "onSelect", "onFocus", "className", "dataTestId"];
|
|
9074
9227
|
var SelectOptions = function SelectOptions(_ref) {
|
|
9075
9228
|
var idRef = _ref.idRef,
|
|
9076
9229
|
searchable = _ref.searchable,
|
|
@@ -9081,7 +9234,8 @@ var SelectOptions = function SelectOptions(_ref) {
|
|
|
9081
9234
|
onSelect = _ref.onSelect,
|
|
9082
9235
|
onFocus = _ref.onFocus,
|
|
9083
9236
|
className = _ref.className,
|
|
9084
|
-
|
|
9237
|
+
dataTestId = _ref.dataTestId,
|
|
9238
|
+
rest = _objectWithoutProperties(_ref, _excluded$m);
|
|
9085
9239
|
|
|
9086
9240
|
var _useState = useState(''),
|
|
9087
9241
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -9138,6 +9292,7 @@ var SelectOptions = function SelectOptions(_ref) {
|
|
|
9138
9292
|
id: "SelectOption--".concat(option.value, "-").concat(idRef),
|
|
9139
9293
|
key: option.value,
|
|
9140
9294
|
option: option,
|
|
9295
|
+
dataTestId: dataTestId,
|
|
9141
9296
|
active: (activeOption === null || activeOption === void 0 ? void 0 : activeOption.value) === option.value,
|
|
9142
9297
|
selected: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value,
|
|
9143
9298
|
onClick: onSelect
|
|
@@ -9259,7 +9414,7 @@ var useSelect = function useSelect(_ref) {
|
|
|
9259
9414
|
};
|
|
9260
9415
|
};
|
|
9261
9416
|
|
|
9262
|
-
var _excluded$
|
|
9417
|
+
var _excluded$l = ["allowAutoFill", "autoSelect", "className", "defaultValue", "disabled", "dropDirection", "error", "idRef", "label", "name", "onChange", "options", "placeholder", "searchable", "shiftIconLeftwards", "value", "dataTestId"];
|
|
9263
9418
|
var Select = function Select(_ref) {
|
|
9264
9419
|
var _ref2;
|
|
9265
9420
|
|
|
@@ -9285,7 +9440,8 @@ var Select = function Select(_ref) {
|
|
|
9285
9440
|
_ref$shiftIconLeftwar = _ref.shiftIconLeftwards,
|
|
9286
9441
|
shiftIconLeftwards = _ref$shiftIconLeftwar === void 0 ? false : _ref$shiftIconLeftwar,
|
|
9287
9442
|
value = _ref.value,
|
|
9288
|
-
|
|
9443
|
+
dataTestId = _ref.dataTestId,
|
|
9444
|
+
rest = _objectWithoutProperties(_ref, _excluded$l);
|
|
9289
9445
|
|
|
9290
9446
|
var _useSelect = useSelect({
|
|
9291
9447
|
value: value,
|
|
@@ -9353,6 +9509,7 @@ var Select = function Select(_ref) {
|
|
|
9353
9509
|
className: "Select__value",
|
|
9354
9510
|
disabled: disabled,
|
|
9355
9511
|
onClick: handleToggle,
|
|
9512
|
+
"data-test-id": dataTestId,
|
|
9356
9513
|
"aria-haspopup": "listbox",
|
|
9357
9514
|
"aria-expanded": state.mode === Mode.Open,
|
|
9358
9515
|
"aria-labelledby": "Select__label--".concat(idRef, " Select__value--").concat(idRef),
|
|
@@ -9372,6 +9529,7 @@ var Select = function Select(_ref) {
|
|
|
9372
9529
|
'Select__options--up': dropDirection === 'up',
|
|
9373
9530
|
'Select__options--down': dropDirection === 'down'
|
|
9374
9531
|
}),
|
|
9532
|
+
dataTestId: dataTestId,
|
|
9375
9533
|
searchable: searchable,
|
|
9376
9534
|
options: options,
|
|
9377
9535
|
onSelect: handleSelect,
|
|
@@ -10951,7 +11109,7 @@ var Exit16 = function Exit16(_a) {
|
|
|
10951
11109
|
|
|
10952
11110
|
Exit16.displayName = 'Exit16';
|
|
10953
11111
|
|
|
10954
|
-
var _excluded$
|
|
11112
|
+
var _excluded$k = ["className", "defaultValue", "disabled", "dropDirection", "error", "idRef", "onChange", "options", "searchable", "shiftIconLeftwards", "value"];
|
|
10955
11113
|
var MultiSelect = function MultiSelect(_ref) {
|
|
10956
11114
|
var className = _ref.className,
|
|
10957
11115
|
defaultValue = _ref.defaultValue,
|
|
@@ -10966,7 +11124,7 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
10966
11124
|
searchable = _ref.searchable,
|
|
10967
11125
|
shiftIconLeftwards = _ref.shiftIconLeftwards,
|
|
10968
11126
|
value = _ref.value,
|
|
10969
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11127
|
+
rest = _objectWithoutProperties(_ref, _excluded$k);
|
|
10970
11128
|
|
|
10971
11129
|
var _useSelect = useSelect({
|
|
10972
11130
|
value: value,
|
|
@@ -11066,14 +11224,14 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
11066
11224
|
}));
|
|
11067
11225
|
};
|
|
11068
11226
|
|
|
11069
|
-
var _excluded$
|
|
11227
|
+
var _excluded$j = ["className", "children", "error", "label", "placeholder"];
|
|
11070
11228
|
var Field = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
11071
11229
|
var className = _ref.className,
|
|
11072
11230
|
children = _ref.children,
|
|
11073
11231
|
error = _ref.error,
|
|
11074
11232
|
label = _ref.label,
|
|
11075
11233
|
placeholder = _ref.placeholder,
|
|
11076
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11234
|
+
rest = _objectWithoutProperties(_ref, _excluded$j);
|
|
11077
11235
|
|
|
11078
11236
|
return /*#__PURE__*/React__default.createElement("label", {
|
|
11079
11237
|
className: classNames('Field', className)
|
|
@@ -11102,17 +11260,17 @@ var Field = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
11102
11260
|
});
|
|
11103
11261
|
Field.displayName = 'Field';
|
|
11104
11262
|
|
|
11105
|
-
var _excluded$
|
|
11263
|
+
var _excluded$i = ["onChange"];
|
|
11106
11264
|
var CreditCardNumberInputField = function CreditCardNumberInputField(_ref) {
|
|
11107
11265
|
var onChange = _ref.onChange,
|
|
11108
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11266
|
+
rest = _objectWithoutProperties(_ref, _excluded$i);
|
|
11109
11267
|
|
|
11110
11268
|
return /*#__PURE__*/React__default.createElement(Field, _extends$1({}, rest, {
|
|
11111
11269
|
onChangeEvent: onChange
|
|
11112
11270
|
}));
|
|
11113
11271
|
};
|
|
11114
11272
|
|
|
11115
|
-
var _excluded$
|
|
11273
|
+
var _excluded$h = ["value", "disabled", "readOnly", "defaultValue", "maskChar", "alwaysShowMask", "onMouseDown", "onFocus", "onBlur", "onChange"];
|
|
11116
11274
|
var DEFAULT_MASK = '9999 9999 9999 9999';
|
|
11117
11275
|
var CreditCardNumberInput = function CreditCardNumberInput(_ref) {
|
|
11118
11276
|
var _ref2;
|
|
@@ -11127,7 +11285,7 @@ var CreditCardNumberInput = function CreditCardNumberInput(_ref) {
|
|
|
11127
11285
|
onFocus = _ref.onFocus,
|
|
11128
11286
|
onBlur = _ref.onBlur,
|
|
11129
11287
|
onChange = _ref.onChange,
|
|
11130
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11288
|
+
rest = _objectWithoutProperties(_ref, _excluded$h);
|
|
11131
11289
|
|
|
11132
11290
|
var _useState = useState((_ref2 = propsValue !== null && propsValue !== void 0 ? propsValue : defaultValue) !== null && _ref2 !== void 0 ? _ref2 : ''),
|
|
11133
11291
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -11153,6 +11311,7 @@ var CreditCardNumberInput = function CreditCardNumberInput(_ref) {
|
|
|
11153
11311
|
setValue(event.target.value);
|
|
11154
11312
|
onChange === null || onChange === void 0 ? void 0 : onChange(event.target.value);
|
|
11155
11313
|
}, [setValue, onChange]); // TODO: get rid of the any, the types of react-input-mask are incorrect here, it should expect a function as a child, but it expects a ReactNode
|
|
11314
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11156
11315
|
|
|
11157
11316
|
var renderInputField = function renderInputField(inputProps) {
|
|
11158
11317
|
return /*#__PURE__*/React__default.createElement(CreditCardNumberInputField, _extends$1({}, rest, inputProps));
|
|
@@ -11172,19 +11331,19 @@ var CreditCardNumberInput = function CreditCardNumberInput(_ref) {
|
|
|
11172
11331
|
}, renderInputField);
|
|
11173
11332
|
};
|
|
11174
11333
|
|
|
11175
|
-
var _excluded$
|
|
11334
|
+
var _excluded$g = ["term", "children", "className"];
|
|
11176
11335
|
var DefinitionList = function DefinitionList(_ref) {
|
|
11177
11336
|
var term = _ref.term,
|
|
11178
11337
|
children = _ref.children,
|
|
11179
11338
|
className = _ref.className,
|
|
11180
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11339
|
+
rest = _objectWithoutProperties(_ref, _excluded$g);
|
|
11181
11340
|
|
|
11182
11341
|
return /*#__PURE__*/React__default.createElement("dl", _extends$1({
|
|
11183
11342
|
className: classNames('DefinitionList', className)
|
|
11184
11343
|
}, rest), /*#__PURE__*/React__default.createElement("dt", null, term), /*#__PURE__*/React__default.createElement("dd", null, children));
|
|
11185
11344
|
};
|
|
11186
11345
|
|
|
11187
|
-
var _excluded$
|
|
11346
|
+
var _excluded$f = ["name", "children", "className", "virtual", "icon", "data-testid", "defaultExpanded", "expanded"];
|
|
11188
11347
|
var Expandable = function Expandable(_ref) {
|
|
11189
11348
|
var name = _ref.name,
|
|
11190
11349
|
children = _ref.children,
|
|
@@ -11194,15 +11353,19 @@ var Expandable = function Expandable(_ref) {
|
|
|
11194
11353
|
_ref$icon = _ref.icon,
|
|
11195
11354
|
icon = _ref$icon === void 0 ? 'plus-minus' : _ref$icon,
|
|
11196
11355
|
dataTestId = _ref['data-testid'],
|
|
11197
|
-
_ref$
|
|
11198
|
-
|
|
11199
|
-
|
|
11356
|
+
_ref$defaultExpanded = _ref.defaultExpanded,
|
|
11357
|
+
defaultExpanded = _ref$defaultExpanded === void 0 ? false : _ref$defaultExpanded,
|
|
11358
|
+
__expanded__ = _ref.expanded,
|
|
11359
|
+
rest = _objectWithoutProperties(_ref, _excluded$f);
|
|
11200
11360
|
|
|
11201
|
-
var _useState = useState(
|
|
11361
|
+
var _useState = useState(defaultExpanded),
|
|
11202
11362
|
_useState2 = _slicedToArray(_useState, 2),
|
|
11203
11363
|
expanded = _useState2[0],
|
|
11204
11364
|
setExpanded = _useState2[1];
|
|
11205
11365
|
|
|
11366
|
+
useEffect(function () {
|
|
11367
|
+
if (__expanded__ != null && __expanded__ !== expanded) setExpanded(__expanded__);
|
|
11368
|
+
}, [expanded, __expanded__]);
|
|
11206
11369
|
var handleClick = useCallback(function () {
|
|
11207
11370
|
return setExpanded(function (expanded) {
|
|
11208
11371
|
return !expanded;
|
|
@@ -11225,7 +11388,7 @@ var Expandable = function Expandable(_ref) {
|
|
|
11225
11388
|
}, expanded || !virtual ? children : null));
|
|
11226
11389
|
};
|
|
11227
11390
|
|
|
11228
|
-
var _excluded$
|
|
11391
|
+
var _excluded$e = ["text", "treatment", "color", "family", "type", "className"];
|
|
11229
11392
|
var Divider = function Divider(_ref) {
|
|
11230
11393
|
var text = _ref.text,
|
|
11231
11394
|
treatment = _ref.treatment,
|
|
@@ -11233,7 +11396,7 @@ var Divider = function Divider(_ref) {
|
|
|
11233
11396
|
family = _ref.family,
|
|
11234
11397
|
type = _ref.type,
|
|
11235
11398
|
className = _ref.className,
|
|
11236
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11399
|
+
rest = _objectWithoutProperties(_ref, _excluded$e);
|
|
11237
11400
|
|
|
11238
11401
|
var defaultTreatment = type === 'two-line' ? 'eyebrow' : 'h5';
|
|
11239
11402
|
var defaultFamily = type === 'two-line' ? undefined : 'serif';
|
|
@@ -11249,21 +11412,21 @@ var Divider = function Divider(_ref) {
|
|
|
11249
11412
|
|
|
11250
11413
|
var TwoLineDivider = function TwoLineDivider(props) {
|
|
11251
11414
|
return /*#__PURE__*/React__default.createElement(Divider, _extends$1({}, props, {
|
|
11252
|
-
type:
|
|
11415
|
+
type: "two-line"
|
|
11253
11416
|
}));
|
|
11254
11417
|
};
|
|
11255
11418
|
|
|
11256
11419
|
var NoLineDivider = function NoLineDivider(props) {
|
|
11257
11420
|
return /*#__PURE__*/React__default.createElement(Divider, _extends$1({}, props, {
|
|
11258
|
-
type:
|
|
11421
|
+
type: "no-line"
|
|
11259
11422
|
}));
|
|
11260
11423
|
};
|
|
11261
11424
|
|
|
11262
|
-
var _excluded$
|
|
11425
|
+
var _excluded$d = ["className", "hidden"];
|
|
11263
11426
|
var Label = function Label(_ref) {
|
|
11264
11427
|
var className = _ref.className,
|
|
11265
11428
|
hidden = _ref.hidden,
|
|
11266
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11429
|
+
rest = _objectWithoutProperties(_ref, _excluded$d);
|
|
11267
11430
|
|
|
11268
11431
|
return /*#__PURE__*/React__default.createElement("label", _extends$1({
|
|
11269
11432
|
className: classNames('Label', className, {
|
|
@@ -11395,11 +11558,11 @@ var ArcWindow = function ArcWindow() {
|
|
|
11395
11558
|
}));
|
|
11396
11559
|
};
|
|
11397
11560
|
|
|
11398
|
-
var _excluded$
|
|
11561
|
+
var _excluded$c = ["className"];
|
|
11399
11562
|
var FRAMES = [Triangle, Diamond, ArcWindow, Circle];
|
|
11400
11563
|
var Loading = function Loading(_ref) {
|
|
11401
11564
|
var className = _ref.className,
|
|
11402
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11565
|
+
rest = _objectWithoutProperties(_ref, _excluded$c);
|
|
11403
11566
|
|
|
11404
11567
|
var _useCursor = dist.useCursor({
|
|
11405
11568
|
max: FRAMES.length
|
|
@@ -11407,8 +11570,9 @@ var Loading = function Loading(_ref) {
|
|
|
11407
11570
|
index = _useCursor.index,
|
|
11408
11571
|
handleNext = _useCursor.handleNext;
|
|
11409
11572
|
|
|
11573
|
+
var ONE_SECOND_INTERVAL = 1000;
|
|
11410
11574
|
useEffect(function () {
|
|
11411
|
-
var interval = setInterval(handleNext,
|
|
11575
|
+
var interval = setInterval(handleNext, ONE_SECOND_INTERVAL);
|
|
11412
11576
|
return function () {
|
|
11413
11577
|
return clearInterval(interval);
|
|
11414
11578
|
};
|
|
@@ -11474,13 +11638,13 @@ var LoadingBalls = function LoadingBalls(_ref) {
|
|
|
11474
11638
|
})));
|
|
11475
11639
|
};
|
|
11476
11640
|
|
|
11477
|
-
var _excluded$
|
|
11641
|
+
var _excluded$b = ["className", "children", "onClose", "shards"];
|
|
11478
11642
|
var Modal = function Modal(_ref) {
|
|
11479
11643
|
var className = _ref.className,
|
|
11480
11644
|
children = _ref.children,
|
|
11481
11645
|
onClose = _ref.onClose,
|
|
11482
11646
|
shards = _ref.shards,
|
|
11483
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11647
|
+
rest = _objectWithoutProperties(_ref, _excluded$b);
|
|
11484
11648
|
|
|
11485
11649
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
11486
11650
|
className: classNames('Modal', className)
|
|
@@ -11491,14 +11655,14 @@ var Modal = function Modal(_ref) {
|
|
|
11491
11655
|
}, children));
|
|
11492
11656
|
};
|
|
11493
11657
|
|
|
11494
|
-
var _excluded$
|
|
11658
|
+
var _excluded$a = ["className", "children", "show"];
|
|
11495
11659
|
var UNMOUNT_DELAY_MS = 500;
|
|
11496
11660
|
var Overlay = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
11497
11661
|
var className = _ref.className,
|
|
11498
11662
|
children = _ref.children,
|
|
11499
11663
|
_ref$show = _ref.show,
|
|
11500
11664
|
show = _ref$show === void 0 ? true : _ref$show,
|
|
11501
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11665
|
+
rest = _objectWithoutProperties(_ref, _excluded$a);
|
|
11502
11666
|
|
|
11503
11667
|
var _useState = useState(show),
|
|
11504
11668
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -11528,7 +11692,7 @@ var Overlay = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
11528
11692
|
});
|
|
11529
11693
|
Overlay.displayName = 'Overlay';
|
|
11530
11694
|
|
|
11531
|
-
var _excluded$
|
|
11695
|
+
var _excluded$9 = ["children", "className", "contentClassName", "onClose", "overlayClassName", "show", "shards"];
|
|
11532
11696
|
var ModalOverlay = function ModalOverlay(_ref) {
|
|
11533
11697
|
var children = _ref.children,
|
|
11534
11698
|
className = _ref.className,
|
|
@@ -11538,7 +11702,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
|
|
|
11538
11702
|
_ref$show = _ref.show,
|
|
11539
11703
|
show = _ref$show === void 0 ? true : _ref$show,
|
|
11540
11704
|
shards = _ref.shards,
|
|
11541
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11705
|
+
rest = _objectWithoutProperties(_ref, _excluded$9);
|
|
11542
11706
|
|
|
11543
11707
|
var element = useMemo(function () {
|
|
11544
11708
|
return typeof document !== 'undefined' ? document.createElement('div') : null;
|
|
@@ -11809,8 +11973,11 @@ var Paginator = function Paginator(_ref) {
|
|
|
11809
11973
|
})));
|
|
11810
11974
|
};
|
|
11811
11975
|
|
|
11812
|
-
var _excluded$
|
|
11976
|
+
var _excluded$8 = ["className", "children", "content", "open", "anchor", "zIndex", "autoPreview", "smoothTransitioning"];
|
|
11813
11977
|
var POPOVER_MOUSEOUT_DELAY_MS = 200;
|
|
11978
|
+
var THREE_QUARTER_SECOND_DELAY = 750;
|
|
11979
|
+
var ONE_SECOND_DELAY = 1000;
|
|
11980
|
+
var FIVE_SECOND_DELAY = 5000;
|
|
11814
11981
|
var Mode;
|
|
11815
11982
|
|
|
11816
11983
|
(function (Mode) {
|
|
@@ -11834,7 +12001,7 @@ var Popover = function Popover(_ref) {
|
|
|
11834
12001
|
autoPreview = _ref$autoPreview === void 0 ? false : _ref$autoPreview,
|
|
11835
12002
|
_ref$smoothTransition = _ref.smoothTransitioning,
|
|
11836
12003
|
smoothTransitioning = _ref$smoothTransition === void 0 ? false : _ref$smoothTransition,
|
|
11837
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
12004
|
+
rest = _objectWithoutProperties(_ref, _excluded$8);
|
|
11838
12005
|
|
|
11839
12006
|
var _useState = useState(function () {
|
|
11840
12007
|
if (open && smoothTransitioning) {
|
|
@@ -11878,7 +12045,7 @@ var Popover = function Popover(_ref) {
|
|
|
11878
12045
|
if (mode !== Mode.Closing) return;
|
|
11879
12046
|
var closingTimeout = setTimeout(function () {
|
|
11880
12047
|
return setMode(Mode.Closed);
|
|
11881
|
-
},
|
|
12048
|
+
}, THREE_QUARTER_SECOND_DELAY);
|
|
11882
12049
|
return function () {
|
|
11883
12050
|
return clearTimeout(closingTimeout);
|
|
11884
12051
|
};
|
|
@@ -11887,7 +12054,7 @@ var Popover = function Popover(_ref) {
|
|
|
11887
12054
|
if (mode !== Mode.AutoOpening) return;
|
|
11888
12055
|
var openingTimeout = setTimeout(function () {
|
|
11889
12056
|
return setMode(Mode.AutoOpen);
|
|
11890
|
-
},
|
|
12057
|
+
}, ONE_SECOND_DELAY);
|
|
11891
12058
|
return function () {
|
|
11892
12059
|
return clearTimeout(openingTimeout);
|
|
11893
12060
|
};
|
|
@@ -11896,14 +12063,14 @@ var Popover = function Popover(_ref) {
|
|
|
11896
12063
|
if (mode !== Mode.Opening) return;
|
|
11897
12064
|
var openingTimeout = setTimeout(function () {
|
|
11898
12065
|
return setMode(Mode.Open);
|
|
11899
|
-
},
|
|
12066
|
+
}, THREE_QUARTER_SECOND_DELAY);
|
|
11900
12067
|
return function () {
|
|
11901
12068
|
return clearTimeout(openingTimeout);
|
|
11902
12069
|
};
|
|
11903
12070
|
}, [mode]);
|
|
11904
12071
|
useEffect(function () {
|
|
11905
12072
|
if (mode !== Mode.AutoOpen) return;
|
|
11906
|
-
var stayingTimeout = setTimeout(handleClose,
|
|
12073
|
+
var stayingTimeout = setTimeout(handleClose, FIVE_SECOND_DELAY);
|
|
11907
12074
|
return function () {
|
|
11908
12075
|
return clearTimeout(stayingTimeout);
|
|
11909
12076
|
};
|
|
@@ -11937,11 +12104,11 @@ var Popover = function Popover(_ref) {
|
|
|
11937
12104
|
}, content)), children));
|
|
11938
12105
|
};
|
|
11939
12106
|
|
|
11940
|
-
var _excluded$
|
|
12107
|
+
var _excluded$7 = ["className", "children"];
|
|
11941
12108
|
var PromoBanner = function PromoBanner(_ref) {
|
|
11942
12109
|
var className = _ref.className,
|
|
11943
12110
|
children = _ref.children,
|
|
11944
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
12111
|
+
rest = _objectWithoutProperties(_ref, _excluded$7);
|
|
11945
12112
|
|
|
11946
12113
|
var length = Children.count(children);
|
|
11947
12114
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
@@ -11960,7 +12127,7 @@ var PromoBanner = function PromoBanner(_ref) {
|
|
|
11960
12127
|
})));
|
|
11961
12128
|
};
|
|
11962
12129
|
|
|
11963
|
-
var _excluded$
|
|
12130
|
+
var _excluded$6 = ["className", "checked", "children", "value", "tabIndex", "disabled"];
|
|
11964
12131
|
var RadioButton = function RadioButton(_ref) {
|
|
11965
12132
|
var className = _ref.className,
|
|
11966
12133
|
checked = _ref.checked,
|
|
@@ -11968,7 +12135,7 @@ var RadioButton = function RadioButton(_ref) {
|
|
|
11968
12135
|
value = _ref.value,
|
|
11969
12136
|
tabIndex = _ref.tabIndex,
|
|
11970
12137
|
disabled = _ref.disabled,
|
|
11971
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
12138
|
+
rest = _objectWithoutProperties(_ref, _excluded$6);
|
|
11972
12139
|
|
|
11973
12140
|
var inputRef = useRef(null);
|
|
11974
12141
|
return /*#__PURE__*/React__default.createElement("label", {
|
|
@@ -12005,14 +12172,14 @@ var RadioButton = function RadioButton(_ref) {
|
|
|
12005
12172
|
}, children));
|
|
12006
12173
|
};
|
|
12007
12174
|
|
|
12008
|
-
var _excluded$
|
|
12175
|
+
var _excluded$5 = ["className", "hover", "selected", "unavailable", "children"];
|
|
12009
12176
|
var SelectableButton = function SelectableButton(_ref) {
|
|
12010
12177
|
var className = _ref.className,
|
|
12011
12178
|
hover = _ref.hover,
|
|
12012
12179
|
selected = _ref.selected,
|
|
12013
12180
|
unavailable = _ref.unavailable,
|
|
12014
12181
|
children = _ref.children,
|
|
12015
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
12182
|
+
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
12016
12183
|
|
|
12017
12184
|
return /*#__PURE__*/React__default.createElement(Clickable, _extends$1({
|
|
12018
12185
|
className: classNames('SelectableButton', {
|
|
@@ -12023,34 +12190,13 @@ var SelectableButton = function SelectableButton(_ref) {
|
|
|
12023
12190
|
}, rest), /*#__PURE__*/React__default.createElement("span", null, children));
|
|
12024
12191
|
};
|
|
12025
12192
|
|
|
12026
|
-
var _excluded$
|
|
12027
|
-
var Stack = function Stack(_ref) {
|
|
12028
|
-
var className = _ref.className,
|
|
12029
|
-
children = _ref.children,
|
|
12030
|
-
space = _ref.space,
|
|
12031
|
-
_ref$direction = _ref.direction,
|
|
12032
|
-
direction = _ref$direction === void 0 ? 'vertical' : _ref$direction,
|
|
12033
|
-
alignItems = _ref.alignItems,
|
|
12034
|
-
justifyContent = _ref.justifyContent,
|
|
12035
|
-
style = _ref.style,
|
|
12036
|
-
rest = _objectWithoutProperties(_ref, _excluded$7);
|
|
12037
|
-
|
|
12038
|
-
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
12039
|
-
className: classNames("Stack Stack--".concat(direction, "-").concat(space), className),
|
|
12040
|
-
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
12041
|
-
alignItems: alignItems,
|
|
12042
|
-
justifyContent: justifyContent
|
|
12043
|
-
})
|
|
12044
|
-
}, rest), children);
|
|
12045
|
-
};
|
|
12046
|
-
|
|
12047
|
-
var _excluded$6 = ["className", "disabled", "onRemove", "children"];
|
|
12193
|
+
var _excluded$4 = ["className", "disabled", "onRemove", "children"];
|
|
12048
12194
|
var Tag = function Tag(_ref) {
|
|
12049
12195
|
var className = _ref.className,
|
|
12050
12196
|
disabled = _ref.disabled,
|
|
12051
12197
|
onRemove = _ref.onRemove,
|
|
12052
12198
|
children = _ref.children,
|
|
12053
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
12199
|
+
rest = _objectWithoutProperties(_ref, _excluded$4);
|
|
12054
12200
|
|
|
12055
12201
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
12056
12202
|
className: classNames('Tag', className, {
|
|
@@ -12063,13 +12209,13 @@ var Tag = function Tag(_ref) {
|
|
|
12063
12209
|
}, /*#__PURE__*/React__default.createElement(Exit16, null)));
|
|
12064
12210
|
};
|
|
12065
12211
|
|
|
12066
|
-
var _excluded$
|
|
12212
|
+
var _excluded$3 = ["tabs", "onTabClicked", "activeTab", "className"];
|
|
12067
12213
|
var Tabs = function Tabs(_ref) {
|
|
12068
12214
|
var tabs = _ref.tabs,
|
|
12069
12215
|
onTabClicked = _ref.onTabClicked,
|
|
12070
12216
|
activeTab = _ref.activeTab,
|
|
12071
12217
|
className = _ref.className,
|
|
12072
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
12218
|
+
rest = _objectWithoutProperties(_ref, _excluded$3);
|
|
12073
12219
|
|
|
12074
12220
|
var _useState = useState(activeTab || tabs[0].name),
|
|
12075
12221
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -12149,7 +12295,7 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
12149
12295
|
}, children);
|
|
12150
12296
|
};
|
|
12151
12297
|
|
|
12152
|
-
var _excluded$
|
|
12298
|
+
var _excluded$2 = ["className", "disabled", "error", "focus", "placeholder", "label", "onChange"];
|
|
12153
12299
|
var Textarea = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
12154
12300
|
var className = _ref.className,
|
|
12155
12301
|
disabled = _ref.disabled,
|
|
@@ -12158,7 +12304,7 @@ var Textarea = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
12158
12304
|
placeholder = _ref.placeholder,
|
|
12159
12305
|
label = _ref.label,
|
|
12160
12306
|
_onChange = _ref.onChange,
|
|
12161
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
12307
|
+
rest = _objectWithoutProperties(_ref, _excluded$2);
|
|
12162
12308
|
|
|
12163
12309
|
return /*#__PURE__*/React__default.createElement("textarea", _extends$1({
|
|
12164
12310
|
className: classNames('Textarea', className, {
|
|
@@ -12177,13 +12323,13 @@ var Textarea = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
12177
12323
|
});
|
|
12178
12324
|
Textarea.displayName = 'Textarea';
|
|
12179
12325
|
|
|
12180
|
-
var _excluded$
|
|
12326
|
+
var _excluded$1 = ["theme", "className", "onRemove", "children"];
|
|
12181
12327
|
var Toast = function Toast(_ref) {
|
|
12182
12328
|
var theme = _ref.theme,
|
|
12183
12329
|
className = _ref.className,
|
|
12184
12330
|
onRemove = _ref.onRemove,
|
|
12185
12331
|
children = _ref.children,
|
|
12186
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
12332
|
+
rest = _objectWithoutProperties(_ref, _excluded$1);
|
|
12187
12333
|
|
|
12188
12334
|
return /*#__PURE__*/React__default.createElement(Stack, _extends$1({
|
|
12189
12335
|
className: classNames('Toast', "Toast--".concat(theme), className),
|
|
@@ -12200,11 +12346,11 @@ var Toast = function Toast(_ref) {
|
|
|
12200
12346
|
}, /*#__PURE__*/React__default.createElement(Exit16, null)));
|
|
12201
12347
|
};
|
|
12202
12348
|
|
|
12203
|
-
var _excluded
|
|
12349
|
+
var _excluded = ["className", "double"];
|
|
12204
12350
|
var VerticalDivider = function VerticalDivider(_ref) {
|
|
12205
12351
|
var className = _ref.className,
|
|
12206
12352
|
_double = _ref["double"],
|
|
12207
|
-
rest = _objectWithoutProperties(_ref, _excluded
|
|
12353
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
12208
12354
|
|
|
12209
12355
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
12210
12356
|
className: classNames('VerticalDivider', {
|
|
@@ -12243,102 +12389,6 @@ var PasswordInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
12243
12389
|
});
|
|
12244
12390
|
PasswordInput.displayName = 'PasswordInput';
|
|
12245
12391
|
|
|
12246
|
-
var isRenderProps = function isRenderProps(children) {
|
|
12247
|
-
return typeof children === 'function';
|
|
12248
|
-
};
|
|
12249
|
-
|
|
12250
|
-
var truncate = function truncate(string) {
|
|
12251
|
-
var maxLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;
|
|
12252
|
-
if (!string) return null;
|
|
12253
|
-
var ellipsis = string.length > maxLength;
|
|
12254
|
-
return "".concat(string.substring(0, maxLength)).concat(ellipsis ? '...' : '');
|
|
12255
|
-
};
|
|
12256
|
-
|
|
12257
|
-
var stringifyProps = function stringifyProps(props) {
|
|
12258
|
-
var stringifiedProps = Object.entries(props || {}).reduce(function (memo, _ref) {
|
|
12259
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
12260
|
-
key = _ref2[0],
|
|
12261
|
-
value = _ref2[1];
|
|
12262
|
-
|
|
12263
|
-
if (key === 'children') return "".concat(memo, " children={...}");
|
|
12264
|
-
if (typeof value === 'string') return "".concat(memo, " ").concat(key, "=\"").concat(truncate(value), "\"");
|
|
12265
|
-
if (typeof value === 'function') return "".concat(memo, " ").concat(key, "={fn}");
|
|
12266
|
-
if (typeof value === 'boolean') return "".concat(memo, " ").concat(key).concat(value ? '' : '={false}');
|
|
12267
|
-
if (typeof value === 'number') return "".concat(memo, " ").concat(key, "={").concat(value, "}");
|
|
12268
|
-
if (_typeof(value) === 'object') return "".concat(memo, " ").concat(key, "={...}");
|
|
12269
|
-
return "".concat(memo, " ").concat(key, "=").concat(value);
|
|
12270
|
-
}, '');
|
|
12271
|
-
return stringifiedProps.trim();
|
|
12272
|
-
};
|
|
12273
|
-
|
|
12274
|
-
var omit = function omit(obj) {
|
|
12275
|
-
for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
12276
|
-
keys[_key - 1] = arguments[_key];
|
|
12277
|
-
}
|
|
12278
|
-
|
|
12279
|
-
return Object.entries(obj).filter(function (_ref) {
|
|
12280
|
-
var _ref2 = _slicedToArray(_ref, 1),
|
|
12281
|
-
key = _ref2[0];
|
|
12282
|
-
|
|
12283
|
-
return !keys.includes(key);
|
|
12284
|
-
}).reduce(function (obj, _ref3) {
|
|
12285
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
12286
|
-
key = _ref4[0],
|
|
12287
|
-
val = _ref4[1];
|
|
12288
|
-
|
|
12289
|
-
return Object.assign(obj, _defineProperty$1({}, key, val));
|
|
12290
|
-
}, {});
|
|
12291
|
-
};
|
|
12292
|
-
|
|
12293
|
-
var isEmpty = function isEmpty(obj) {
|
|
12294
|
-
return Object.entries(obj || {}).length === 0;
|
|
12295
|
-
};
|
|
12296
|
-
|
|
12297
|
-
var StatesProps = function StatesProps(_ref) {
|
|
12298
|
-
var props = _ref.props,
|
|
12299
|
-
children = _ref.children;
|
|
12300
|
-
var childrenProps = omit.apply(void 0, [children.props].concat(_toConsumableArray(Object.keys(props || {}))));
|
|
12301
|
-
return /*#__PURE__*/React__default.createElement(Stack, {
|
|
12302
|
-
className: "StatesProps",
|
|
12303
|
-
space: 2,
|
|
12304
|
-
direction: "horizontal"
|
|
12305
|
-
}, /*#__PURE__*/React__default.createElement("span", null, children.type.displayName || children.type.name), !isEmpty(props) && /*#__PURE__*/React__default.createElement("strong", null, stringifyProps(props)), !isRenderProps(children) && !isEmpty(childrenProps) && /*#__PURE__*/React__default.createElement("span", null, stringifyProps(childrenProps)), /*#__PURE__*/React__default.createElement("span", null, " "));
|
|
12306
|
-
};
|
|
12307
|
-
|
|
12308
|
-
var _excluded$1 = ["props", "children"];
|
|
12309
|
-
var State = function State(_ref) {
|
|
12310
|
-
var props = _ref.props,
|
|
12311
|
-
children = _ref.children,
|
|
12312
|
-
rest = _objectWithoutProperties(_ref, _excluded$1);
|
|
12313
|
-
|
|
12314
|
-
var Specimen = isRenderProps(children) ? children(props) : /*#__PURE__*/React__default.cloneElement(children, props);
|
|
12315
|
-
var innerChildren = isRenderProps(children) ? children(props) : children;
|
|
12316
|
-
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
12317
|
-
className: "State"
|
|
12318
|
-
}, rest), Specimen, /*#__PURE__*/React__default.createElement("code", {
|
|
12319
|
-
className: "State__props"
|
|
12320
|
-
}, /*#__PURE__*/React__default.createElement(StatesProps, {
|
|
12321
|
-
props: props
|
|
12322
|
-
}, innerChildren)));
|
|
12323
|
-
};
|
|
12324
|
-
|
|
12325
|
-
var _excluded = ["states", "children"];
|
|
12326
|
-
var States = function States(_ref) {
|
|
12327
|
-
var _ref$states = _ref.states,
|
|
12328
|
-
states = _ref$states === void 0 ? [{}] : _ref$states,
|
|
12329
|
-
children = _ref.children,
|
|
12330
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
12331
|
-
|
|
12332
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
12333
|
-
className: "States"
|
|
12334
|
-
}, states.map(function (props, i) {
|
|
12335
|
-
return /*#__PURE__*/React__default.createElement(State, _extends$1({
|
|
12336
|
-
key: i,
|
|
12337
|
-
props: props
|
|
12338
|
-
}, rest), children);
|
|
12339
|
-
}));
|
|
12340
|
-
};
|
|
12341
|
-
|
|
12342
12392
|
var tokens = {
|
|
12343
12393
|
colors: dist$4.colors,
|
|
12344
12394
|
typography: dist$4.typography,
|