@pingux/astro 2.207.0 → 2.208.0-alpha.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/lib/cjs/components/Badge/Badge.styles.d.ts +152 -0
- package/lib/cjs/components/Badge/Badge.styles.js +9 -1
- package/lib/cjs/components/Checkbox/CheckboxBase.js +4 -2
- package/lib/cjs/components/CheckboxField/CheckboxField.js +18 -1
- package/lib/cjs/components/CheckboxField/CheckboxField.test.js +82 -0
- package/lib/cjs/components/LinkSelectField/LinkSelectField.js +0 -6
- package/lib/cjs/components/Pagination/Pagination.js +4 -2
- package/lib/cjs/components/Pagination/Pagination.styles.js +1 -1
- package/lib/cjs/components/TableBase/TableBase.js +4 -1
- package/lib/cjs/components/TableBase/TableBase.stories.js +8 -8
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/badges.d.ts +42 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/badges.js +38 -1
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/cards.d.ts +3 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/cards.js +4 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/text.d.ts +3 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/text.js +3 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +26 -3
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +27 -5
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +220 -18
- package/lib/cjs/styles/themes/next-gen/next-gen.js +1 -1
- package/lib/cjs/styles/themes/next-gen/variants/badges.d.ts +202 -0
- package/lib/cjs/styles/themes/next-gen/variants/badges.js +42 -1
- package/lib/cjs/styles/themes/next-gen/variants/cards.d.ts +1 -1
- package/lib/cjs/styles/themes/next-gen/variants/cards.js +3 -1
- package/lib/cjs/styles/themes/next-gen/variants/tableBase.d.ts +11 -17
- package/lib/cjs/styles/themes/next-gen/variants/tableBase.js +13 -17
- package/lib/cjs/styles/themes/next-gen/variants/text.d.ts +6 -0
- package/lib/cjs/styles/themes/next-gen/variants/text.js +6 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +11 -17
- package/lib/components/Badge/Badge.styles.js +9 -1
- package/lib/components/Checkbox/CheckboxBase.js +4 -2
- package/lib/components/CheckboxField/CheckboxField.js +19 -2
- package/lib/components/CheckboxField/CheckboxField.test.js +83 -1
- package/lib/components/LinkSelectField/LinkSelectField.js +0 -6
- package/lib/components/Pagination/Pagination.js +4 -2
- package/lib/components/Pagination/Pagination.styles.js +1 -1
- package/lib/components/TableBase/TableBase.js +4 -1
- package/lib/components/TableBase/TableBase.stories.js +8 -8
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/badges.js +38 -1
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/cards.js +4 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/text.js +3 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +27 -5
- package/lib/styles/themes/next-gen/next-gen.js +1 -1
- package/lib/styles/themes/next-gen/variants/badges.js +42 -1
- package/lib/styles/themes/next-gen/variants/cards.js +3 -1
- package/lib/styles/themes/next-gen/variants/tableBase.js +13 -17
- package/lib/styles/themes/next-gen/variants/text.js +6 -0
- package/package.json +1 -1
|
@@ -963,5 +963,157 @@ declare const _default: {
|
|
|
963
963
|
};
|
|
964
964
|
};
|
|
965
965
|
};
|
|
966
|
+
tableBaseBadge: {
|
|
967
|
+
active: {
|
|
968
|
+
borderColor: string;
|
|
969
|
+
backgroundColor: string;
|
|
970
|
+
border: string;
|
|
971
|
+
'& span': {
|
|
972
|
+
color: string;
|
|
973
|
+
};
|
|
974
|
+
cursor: string;
|
|
975
|
+
p: string;
|
|
976
|
+
alignItems: string;
|
|
977
|
+
justifyContent: string;
|
|
978
|
+
minWidth: string;
|
|
979
|
+
alignSelf: string;
|
|
980
|
+
display: string;
|
|
981
|
+
borderRadius: string;
|
|
982
|
+
fontWeight: number;
|
|
983
|
+
'& button': {
|
|
984
|
+
backgroundColor: string;
|
|
985
|
+
marginLeft: string;
|
|
986
|
+
marginTop: string;
|
|
987
|
+
padding: string;
|
|
988
|
+
'&.is-hovered': {
|
|
989
|
+
backgroundColor: string;
|
|
990
|
+
};
|
|
991
|
+
'& .mdi-icon': {
|
|
992
|
+
marginLeft: string;
|
|
993
|
+
padding: string;
|
|
994
|
+
};
|
|
995
|
+
};
|
|
996
|
+
};
|
|
997
|
+
warning: {
|
|
998
|
+
borderColor: string;
|
|
999
|
+
backgroundColor: string;
|
|
1000
|
+
border: string;
|
|
1001
|
+
'& span': {
|
|
1002
|
+
color: string;
|
|
1003
|
+
};
|
|
1004
|
+
cursor: string;
|
|
1005
|
+
p: string;
|
|
1006
|
+
alignItems: string;
|
|
1007
|
+
justifyContent: string;
|
|
1008
|
+
minWidth: string;
|
|
1009
|
+
alignSelf: string;
|
|
1010
|
+
display: string;
|
|
1011
|
+
borderRadius: string;
|
|
1012
|
+
fontWeight: number;
|
|
1013
|
+
'& button': {
|
|
1014
|
+
backgroundColor: string;
|
|
1015
|
+
marginLeft: string;
|
|
1016
|
+
marginTop: string;
|
|
1017
|
+
padding: string;
|
|
1018
|
+
'&.is-hovered': {
|
|
1019
|
+
backgroundColor: string;
|
|
1020
|
+
};
|
|
1021
|
+
'& .mdi-icon': {
|
|
1022
|
+
marginLeft: string;
|
|
1023
|
+
padding: string;
|
|
1024
|
+
};
|
|
1025
|
+
};
|
|
1026
|
+
};
|
|
1027
|
+
critical: {
|
|
1028
|
+
borderColor: string;
|
|
1029
|
+
backgroundColor: string;
|
|
1030
|
+
border: string;
|
|
1031
|
+
'& span': {
|
|
1032
|
+
color: string;
|
|
1033
|
+
};
|
|
1034
|
+
cursor: string;
|
|
1035
|
+
p: string;
|
|
1036
|
+
alignItems: string;
|
|
1037
|
+
justifyContent: string;
|
|
1038
|
+
minWidth: string;
|
|
1039
|
+
alignSelf: string;
|
|
1040
|
+
display: string;
|
|
1041
|
+
borderRadius: string;
|
|
1042
|
+
fontWeight: number;
|
|
1043
|
+
'& button': {
|
|
1044
|
+
backgroundColor: string;
|
|
1045
|
+
marginLeft: string;
|
|
1046
|
+
marginTop: string;
|
|
1047
|
+
padding: string;
|
|
1048
|
+
'&.is-hovered': {
|
|
1049
|
+
backgroundColor: string;
|
|
1050
|
+
};
|
|
1051
|
+
'& .mdi-icon': {
|
|
1052
|
+
marginLeft: string;
|
|
1053
|
+
padding: string;
|
|
1054
|
+
};
|
|
1055
|
+
};
|
|
1056
|
+
};
|
|
1057
|
+
healthy: {
|
|
1058
|
+
borderColor: string;
|
|
1059
|
+
backgroundColor: string;
|
|
1060
|
+
border: string;
|
|
1061
|
+
'& span': {
|
|
1062
|
+
color: string;
|
|
1063
|
+
};
|
|
1064
|
+
cursor: string;
|
|
1065
|
+
p: string;
|
|
1066
|
+
alignItems: string;
|
|
1067
|
+
justifyContent: string;
|
|
1068
|
+
minWidth: string;
|
|
1069
|
+
alignSelf: string;
|
|
1070
|
+
display: string;
|
|
1071
|
+
borderRadius: string;
|
|
1072
|
+
fontWeight: number;
|
|
1073
|
+
'& button': {
|
|
1074
|
+
backgroundColor: string;
|
|
1075
|
+
marginLeft: string;
|
|
1076
|
+
marginTop: string;
|
|
1077
|
+
padding: string;
|
|
1078
|
+
'&.is-hovered': {
|
|
1079
|
+
backgroundColor: string;
|
|
1080
|
+
};
|
|
1081
|
+
'& .mdi-icon': {
|
|
1082
|
+
marginLeft: string;
|
|
1083
|
+
padding: string;
|
|
1084
|
+
};
|
|
1085
|
+
};
|
|
1086
|
+
};
|
|
1087
|
+
secondary: {
|
|
1088
|
+
borderColor: string;
|
|
1089
|
+
backgroundColor: string;
|
|
1090
|
+
border: string;
|
|
1091
|
+
'& span': {
|
|
1092
|
+
color: string;
|
|
1093
|
+
};
|
|
1094
|
+
cursor: string;
|
|
1095
|
+
p: string;
|
|
1096
|
+
alignItems: string;
|
|
1097
|
+
justifyContent: string;
|
|
1098
|
+
minWidth: string;
|
|
1099
|
+
alignSelf: string;
|
|
1100
|
+
display: string;
|
|
1101
|
+
borderRadius: string;
|
|
1102
|
+
fontWeight: number;
|
|
1103
|
+
'& button': {
|
|
1104
|
+
backgroundColor: string;
|
|
1105
|
+
marginLeft: string;
|
|
1106
|
+
marginTop: string;
|
|
1107
|
+
padding: string;
|
|
1108
|
+
'&.is-hovered': {
|
|
1109
|
+
backgroundColor: string;
|
|
1110
|
+
};
|
|
1111
|
+
'& .mdi-icon': {
|
|
1112
|
+
marginLeft: string;
|
|
1113
|
+
padding: string;
|
|
1114
|
+
};
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
};
|
|
966
1118
|
};
|
|
967
1119
|
export default _default;
|
|
@@ -265,6 +265,13 @@ var dataTable = {
|
|
|
265
265
|
borderColor: 'success.dark'
|
|
266
266
|
})
|
|
267
267
|
};
|
|
268
|
+
var tableBaseBadge = {
|
|
269
|
+
active: _objectSpread({}, infoCalloutBadge),
|
|
270
|
+
warning: _objectSpread({}, warningStatusBadge),
|
|
271
|
+
critical: _objectSpread({}, criticalStatusBadge),
|
|
272
|
+
healthy: _objectSpread({}, healthyStatusBadge),
|
|
273
|
+
secondary: _objectSpread({}, secondaryStatusBadge)
|
|
274
|
+
};
|
|
268
275
|
var _default = exports["default"] = {
|
|
269
276
|
activeStatusBadge: activeStatusBadge,
|
|
270
277
|
badgeDeleteButton: badgeDeleteButton,
|
|
@@ -291,5 +298,6 @@ var _default = exports["default"] = {
|
|
|
291
298
|
secondaryStatusBadge: secondaryStatusBadge,
|
|
292
299
|
removableBadge: removableBadge,
|
|
293
300
|
invertedRemovableBadge: invertedRemovableBadge,
|
|
294
|
-
dataTable: dataTable
|
|
301
|
+
dataTable: dataTable,
|
|
302
|
+
tableBaseBadge: tableBaseBadge
|
|
295
303
|
};
|
|
@@ -31,13 +31,14 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var
|
|
|
31
31
|
}, props));
|
|
32
32
|
});
|
|
33
33
|
var IndeterminateCheckboxIcon = function IndeterminateCheckboxIcon(props) {
|
|
34
|
+
console.log('🚀 ~ IndeterminateCheckboxIcon ~ props:', props);
|
|
34
35
|
return (0, _react2.jsx)("svg", (0, _extends2["default"])({
|
|
35
36
|
viewBox: "0 0 24 24",
|
|
36
37
|
fill: "none",
|
|
37
38
|
xmlns: "http://www.w3.org/2000/svg",
|
|
38
39
|
"aria-labelledby": "checkbox-icon-title",
|
|
39
40
|
"data-testid": "checkbox-icon-indeterminate"
|
|
40
|
-
}, (0, _lodash.omit)(props, 'id', 'aria-checked', 'data-testid')), (0, _react2.jsx)("title", {
|
|
41
|
+
}, (0, _lodash.omit)(props, 'id', 'aria-checked', 'data-testid', 'onFocus')), (0, _react2.jsx)("title", {
|
|
41
42
|
id: "checkbox-icon-title"
|
|
42
43
|
}, "Indeterminate Checkbox Icon"), (0, _react2.jsx)("rect", {
|
|
43
44
|
x: "3.5",
|
|
@@ -75,7 +76,8 @@ var IndeterminateCheckbox = /*#__PURE__*/(0, _react.forwardRef)(function (props,
|
|
|
75
76
|
variant: "variants.box.indeterminateCheckboxIcon",
|
|
76
77
|
mr: 2
|
|
77
78
|
}, props, {
|
|
78
|
-
opacity: 1
|
|
79
|
+
opacity: 1,
|
|
80
|
+
tabIndex: -1
|
|
79
81
|
})));
|
|
80
82
|
});
|
|
81
83
|
var CheckboxBase = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
@@ -16,6 +16,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
exports["default"] = void 0;
|
|
18
18
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
19
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
19
20
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
20
21
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
22
|
var _reactAria = require("react-aria");
|
|
@@ -27,6 +28,7 @@ var _hooks = require("../../hooks");
|
|
|
27
28
|
var _pendoID = require("../../utils/devUtils/constants/pendoID");
|
|
28
29
|
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
|
29
30
|
var _react2 = require("@emotion/react");
|
|
31
|
+
var _excluded = ["onKeyDown", "onKeyUp"];
|
|
30
32
|
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
31
33
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
32
34
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -56,16 +58,31 @@ var CheckboxField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
56
58
|
ref: checkboxRef
|
|
57
59
|
})),
|
|
58
60
|
containerPressProps = _usePress.pressProps;
|
|
61
|
+
// usePress onKeyDown registers a global keyup listener and when isIndeterminate changes during
|
|
62
|
+
// a press, usePress creates a new state machine instance but old global keyup
|
|
63
|
+
// listener never fires cleanly and the state machine gets out of sync, causing
|
|
64
|
+
// subsequent Space presses to be ignored. The checkbox input already handles Space natively.
|
|
65
|
+
var _kd = containerPressProps.onKeyDown,
|
|
66
|
+
_ku = containerPressProps.onKeyUp,
|
|
67
|
+
safeContainerPressProps = (0, _objectWithoutProperties2["default"])(containerPressProps, _excluded);
|
|
68
|
+
var prevIsIndeterminate = (0, _react.useRef)(isIndeterminate);
|
|
59
69
|
(0, _react.useEffect)(function () {
|
|
60
70
|
if (checkboxRef.current && isIndeterminate) {
|
|
61
71
|
checkboxRef.current.indeterminate = true;
|
|
62
72
|
} else if (checkboxRef.current && !isIndeterminate) {
|
|
63
73
|
checkboxRef.current.indeterminate = false;
|
|
74
|
+
|
|
75
|
+
// Restore focus to the new input when the transition from indeterminate to default
|
|
76
|
+
// occurs and focus has landed on <body> (meaning it was on the old input before the swap).
|
|
77
|
+
if (prevIsIndeterminate.current && document.activeElement === document.body) {
|
|
78
|
+
checkboxRef.current.focus();
|
|
79
|
+
}
|
|
64
80
|
}
|
|
81
|
+
prevIsIndeterminate.current = isIndeterminate;
|
|
65
82
|
}, [isIndeterminate]);
|
|
66
83
|
var _useCheckbox = (0, _reactAria.useCheckbox)(checkboxProps, state, checkboxRef),
|
|
67
84
|
inputProps = _useCheckbox.inputProps;
|
|
68
|
-
var _useField = (0, _hooks.useField)(_objectSpread(_objectSpread(_objectSpread({},
|
|
85
|
+
var _useField = (0, _hooks.useField)(_objectSpread(_objectSpread(_objectSpread({}, safeContainerPressProps), props), {}, {
|
|
69
86
|
statusClasses: {
|
|
70
87
|
isIndeterminate: isIndeterminate
|
|
71
88
|
},
|
|
@@ -12,6 +12,7 @@ var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise");
|
|
|
12
12
|
var _Symbol$iterator = require("@babel/runtime-corejs3/core-js-stable/symbol/iterator");
|
|
13
13
|
var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
|
|
14
14
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
15
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
15
16
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
16
17
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
17
18
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -335,4 +336,85 @@ test('indeterminate checkbox, clicking svg', /*#__PURE__*/(0, _asyncToGenerator2
|
|
|
335
336
|
return _context8.stop();
|
|
336
337
|
}
|
|
337
338
|
}, _callee8);
|
|
339
|
+
})));
|
|
340
|
+
test('controlled indeterminate checkbox retains focus and toggles correctly across keyboard Space presses', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
341
|
+
var onChange, IndeterminateParent, input, input2;
|
|
342
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
343
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
344
|
+
case 0:
|
|
345
|
+
onChange = jest.fn();
|
|
346
|
+
IndeterminateParent = function IndeterminateParent() {
|
|
347
|
+
var _React$useState = _react["default"].useState(true),
|
|
348
|
+
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
349
|
+
isIndeterminate = _React$useState2[0],
|
|
350
|
+
setIsIndeterminate = _React$useState2[1];
|
|
351
|
+
var _React$useState3 = _react["default"].useState(false),
|
|
352
|
+
_React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
|
|
353
|
+
isSelected = _React$useState4[0],
|
|
354
|
+
setIsSelected = _React$useState4[1];
|
|
355
|
+
var handleChange = function handleChange(selected) {
|
|
356
|
+
onChange(selected);
|
|
357
|
+
setIsIndeterminate(false);
|
|
358
|
+
setIsSelected(selected);
|
|
359
|
+
};
|
|
360
|
+
return (0, _react2.jsx)(_["default"], {
|
|
361
|
+
label: testLabel,
|
|
362
|
+
isIndeterminate: isIndeterminate,
|
|
363
|
+
isSelected: isSelected,
|
|
364
|
+
onChange: handleChange
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
(0, _testWrapper.render)((0, _react2.jsx)(IndeterminateParent, null));
|
|
368
|
+
|
|
369
|
+
// Initial: indeterminate
|
|
370
|
+
expect(_testWrapper.screen.getByRole('checkbox')).toHaveAttribute('aria-checked', 'mixed');
|
|
371
|
+
|
|
372
|
+
// First Space: focus the input, then simulate Space press
|
|
373
|
+
input = _testWrapper.screen.getByRole('checkbox');
|
|
374
|
+
(0, _testWrapper.act)(function () {
|
|
375
|
+
input.focus();
|
|
376
|
+
});
|
|
377
|
+
expect(input).toHaveFocus();
|
|
378
|
+
|
|
379
|
+
// Simulate keyboard Space: keydown triggers native change on checkbox, then keyup
|
|
380
|
+
_testWrapper.fireEvent.keyDown(input, {
|
|
381
|
+
key: ' ',
|
|
382
|
+
code: 'Space',
|
|
383
|
+
charCode: 32
|
|
384
|
+
});
|
|
385
|
+
_testWrapper.fireEvent.click(input); // keyboard Space on checkbox fires a click event in browsers
|
|
386
|
+
_testWrapper.fireEvent.keyUp(input, {
|
|
387
|
+
key: ' ',
|
|
388
|
+
code: 'Space',
|
|
389
|
+
charCode: 32
|
|
390
|
+
});
|
|
391
|
+
expect(onChange).toHaveBeenNthCalledWith(1, true);
|
|
392
|
+
// Re-query after re-render: isIndeterminate=false now
|
|
393
|
+
expect(_testWrapper.screen.getByRole('checkbox')).not.toHaveAttribute('aria-checked', 'mixed');
|
|
394
|
+
expect(_testWrapper.screen.getByRole('checkbox')).toBeChecked();
|
|
395
|
+
|
|
396
|
+
// After the indeterminate->checked transition, the input should still have focus
|
|
397
|
+
// (the old IndeterminateCheckbox input was unmounted, so focus may be lost)
|
|
398
|
+
expect(_testWrapper.screen.getByRole('checkbox')).toHaveFocus();
|
|
399
|
+
|
|
400
|
+
// Second Space: checked -> unchecked
|
|
401
|
+
input2 = _testWrapper.screen.getByRole('checkbox');
|
|
402
|
+
_testWrapper.fireEvent.keyDown(input2, {
|
|
403
|
+
key: ' ',
|
|
404
|
+
code: 'Space',
|
|
405
|
+
charCode: 32
|
|
406
|
+
});
|
|
407
|
+
_testWrapper.fireEvent.click(input2);
|
|
408
|
+
_testWrapper.fireEvent.keyUp(input2, {
|
|
409
|
+
key: ' ',
|
|
410
|
+
code: 'Space',
|
|
411
|
+
charCode: 32
|
|
412
|
+
});
|
|
413
|
+
expect(onChange).toHaveBeenNthCalledWith(2, false);
|
|
414
|
+
expect(_testWrapper.screen.getByRole('checkbox')).not.toBeChecked();
|
|
415
|
+
case 20:
|
|
416
|
+
case "end":
|
|
417
|
+
return _context9.stop();
|
|
418
|
+
}
|
|
419
|
+
}, _callee9);
|
|
338
420
|
})));
|
|
@@ -93,16 +93,10 @@ var LinkSelectField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
93
93
|
variant: "forms.select.arrow"
|
|
94
94
|
}, (0, _react2.jsx)(_.Icon, (0, _extends2["default"])({
|
|
95
95
|
icon: MenuDown,
|
|
96
|
-
title: {
|
|
97
|
-
name: 'Menu Down Icon'
|
|
98
|
-
},
|
|
99
96
|
sx: _objectSpread(_objectSpread({}, state.isOpen ? {
|
|
100
97
|
transform: 'rotate(180deg)'
|
|
101
98
|
} : null), iconPropsSx)
|
|
102
99
|
}, restIconProps, {
|
|
103
|
-
title: {
|
|
104
|
-
name: ''
|
|
105
|
-
},
|
|
106
100
|
color: isOnyx ? 'font.link' : 'active',
|
|
107
101
|
size: linkSelectFieldIcon,
|
|
108
102
|
"aria-hidden": "true"
|
|
@@ -73,12 +73,14 @@ var Pagination = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
73
73
|
icon: _ChevronLeftIcon["default"],
|
|
74
74
|
title: {
|
|
75
75
|
name: 'Previous'
|
|
76
|
-
}
|
|
76
|
+
},
|
|
77
|
+
size: "md"
|
|
77
78
|
}, previousButtonIconProps))), (0, _react2.jsx)(_index.IconButton, nextButtonProps, (0, _react2.jsx)(_index.Icon, (0, _extends2["default"])({
|
|
78
79
|
icon: _ChevronRightIcon["default"],
|
|
79
80
|
title: {
|
|
80
81
|
name: 'Next'
|
|
81
|
-
}
|
|
82
|
+
},
|
|
83
|
+
size: "md"
|
|
82
84
|
}, nextButtonIconProps))))));
|
|
83
85
|
});
|
|
84
86
|
var _default = exports["default"] = Pagination;
|
|
@@ -338,7 +338,10 @@ function TableColumnHeader(props) {
|
|
|
338
338
|
isRow: true,
|
|
339
339
|
gap: "sm",
|
|
340
340
|
alignItems: "center"
|
|
341
|
-
}, (0, _react2.jsx)(_.Text,
|
|
341
|
+
}, (0, _react2.jsx)(_.Text, {
|
|
342
|
+
as: "h4",
|
|
343
|
+
variant: "headText"
|
|
344
|
+
}, column.rendered), allowsSorting && sortIcon), allowsResizing && (0, _react2.jsx)(Resizer, {
|
|
342
345
|
column: column,
|
|
343
346
|
layoutState: layoutState,
|
|
344
347
|
onResizeStart: onResizeStart,
|
|
@@ -89,11 +89,11 @@ var objects = [{
|
|
|
89
89
|
total_grant: '75,000'
|
|
90
90
|
}];
|
|
91
91
|
var statusVariant = {
|
|
92
|
-
Pending: '
|
|
93
|
-
Failed: '
|
|
94
|
-
Rejected: '
|
|
95
|
-
Active: '
|
|
96
|
-
Inactive: '
|
|
92
|
+
Pending: 'tableBaseBadge.secondary',
|
|
93
|
+
Failed: 'tableBaseBadge.critical',
|
|
94
|
+
Rejected: 'tableBaseBadge.critical',
|
|
95
|
+
Active: 'tableBaseBadge.healthy',
|
|
96
|
+
Inactive: 'tableBaseBadge.secondary'
|
|
97
97
|
};
|
|
98
98
|
var Default = exports.Default = function Default() {
|
|
99
99
|
return (0, _react2.jsx)(_.Card, {
|
|
@@ -256,11 +256,11 @@ var DynamicWithSorting = exports.DynamicWithSorting = function DynamicWithSortin
|
|
|
256
256
|
}, {
|
|
257
257
|
name: 'Population',
|
|
258
258
|
key: 'population',
|
|
259
|
-
isSortable:
|
|
259
|
+
isSortable: false
|
|
260
260
|
}, {
|
|
261
261
|
name: 'Continent',
|
|
262
262
|
key: 'continent',
|
|
263
|
-
isSortable:
|
|
263
|
+
isSortable: false
|
|
264
264
|
}];
|
|
265
265
|
var rows = [{
|
|
266
266
|
id: 1,
|
|
@@ -367,7 +367,7 @@ var DynamicWithSorting = exports.DynamicWithSorting = function DynamicWithSortin
|
|
|
367
367
|
}, function (column) {
|
|
368
368
|
return (0, _react2.jsx)(_.Column, {
|
|
369
369
|
minWidth: 155,
|
|
370
|
-
allowsSorting:
|
|
370
|
+
allowsSorting: column.isSortable
|
|
371
371
|
}, column.name);
|
|
372
372
|
}), (0, _react2.jsx)(_.TBody, {
|
|
373
373
|
items: list.items,
|
|
@@ -151,5 +151,47 @@ declare const badges: {
|
|
|
151
151
|
color: string;
|
|
152
152
|
};
|
|
153
153
|
};
|
|
154
|
+
tableBaseBadge: {
|
|
155
|
+
active: {
|
|
156
|
+
backgroundColor: string;
|
|
157
|
+
'& > span': {
|
|
158
|
+
color: any;
|
|
159
|
+
fontSize: string;
|
|
160
|
+
lineHeight: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
warning: {
|
|
164
|
+
backgroundColor: string;
|
|
165
|
+
'& > span': {
|
|
166
|
+
color: any;
|
|
167
|
+
fontSize: string;
|
|
168
|
+
lineHeight: string;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
critical: {
|
|
172
|
+
backgroundColor: string;
|
|
173
|
+
'& > span': {
|
|
174
|
+
color: any;
|
|
175
|
+
fontSize: string;
|
|
176
|
+
lineHeight: string;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
healthy: {
|
|
180
|
+
backgroundColor: string;
|
|
181
|
+
'& > span': {
|
|
182
|
+
color: any;
|
|
183
|
+
fontSize: string;
|
|
184
|
+
lineHeight: string;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
secondary: {
|
|
188
|
+
backgroundColor: string;
|
|
189
|
+
'& > span': {
|
|
190
|
+
color: any;
|
|
191
|
+
fontSize: string;
|
|
192
|
+
lineHeight: string;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
};
|
|
154
196
|
};
|
|
155
197
|
export default badges;
|
|
@@ -110,6 +110,42 @@ var itemBadgeWithSlot = _objectSpread(_objectSpread({}, selectedItemBadge), {},
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
+
var tableBaseBadgeSpanStyle = {
|
|
114
|
+
fontSize: '11.25px',
|
|
115
|
+
lineHeight: '1'
|
|
116
|
+
};
|
|
117
|
+
var tableBaseBadge = {
|
|
118
|
+
active: {
|
|
119
|
+
backgroundColor: "".concat(_onyxTokens.astroTokensDark.color.blue[500], " !important"),
|
|
120
|
+
'& > span': _objectSpread(_objectSpread({}, tableBaseBadgeSpanStyle), {}, {
|
|
121
|
+
color: _onyxTokens.astroTokensDark.color.black
|
|
122
|
+
})
|
|
123
|
+
},
|
|
124
|
+
warning: {
|
|
125
|
+
backgroundColor: "".concat(_onyxTokens.astroTokensDark.color.yellow[500], " !important"),
|
|
126
|
+
'& > span': _objectSpread(_objectSpread({}, tableBaseBadgeSpanStyle), {}, {
|
|
127
|
+
color: _onyxTokens.astroTokensDark.color.black
|
|
128
|
+
})
|
|
129
|
+
},
|
|
130
|
+
critical: {
|
|
131
|
+
backgroundColor: "".concat(_onyxTokens.astroTokensDark.color.red[500], " !important"),
|
|
132
|
+
'& > span': _objectSpread(_objectSpread({}, tableBaseBadgeSpanStyle), {}, {
|
|
133
|
+
color: _onyxTokens.astroTokensDark.color.black
|
|
134
|
+
})
|
|
135
|
+
},
|
|
136
|
+
healthy: {
|
|
137
|
+
backgroundColor: "".concat(_onyxTokens.astroTokensDark.color.green[500], " !important"),
|
|
138
|
+
'& > span': _objectSpread(_objectSpread({}, tableBaseBadgeSpanStyle), {}, {
|
|
139
|
+
color: _onyxTokens.astroTokensDark.color.black
|
|
140
|
+
})
|
|
141
|
+
},
|
|
142
|
+
secondary: {
|
|
143
|
+
backgroundColor: "".concat(_onyxTokens.astroTokensDark.color.gray[500], " !important"),
|
|
144
|
+
'& > span': _objectSpread(_objectSpread({}, tableBaseBadgeSpanStyle), {}, {
|
|
145
|
+
color: _onyxTokens.astroTokensDark.color.black
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
};
|
|
113
149
|
var badges = {
|
|
114
150
|
baseBadge: baseBadge,
|
|
115
151
|
primary: primary,
|
|
@@ -154,6 +190,7 @@ var badges = {
|
|
|
154
190
|
'& span': {
|
|
155
191
|
color: 'font.base'
|
|
156
192
|
}
|
|
157
|
-
}
|
|
193
|
+
},
|
|
194
|
+
tableBaseBadge: tableBaseBadge
|
|
158
195
|
};
|
|
159
196
|
var _default = exports["default"] = badges;
|
|
@@ -5,6 +5,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
|
+
var _onyxTokens = require("@pingux/onyx-tokens");
|
|
8
9
|
var cards = {
|
|
9
10
|
dark: {
|
|
10
11
|
border: '1px solid',
|
|
@@ -31,6 +32,9 @@ var cards = {
|
|
|
31
32
|
},
|
|
32
33
|
activeCard: {
|
|
33
34
|
borderColor: 'border.attachment'
|
|
35
|
+
},
|
|
36
|
+
tableWrapper: {
|
|
37
|
+
borderColor: _onyxTokens.astroTokensDark.color.common.border
|
|
34
38
|
}
|
|
35
39
|
};
|
|
36
40
|
var _default = exports["default"] = cards;
|
|
@@ -56,6 +56,9 @@ var text = exports.text = {
|
|
|
56
56
|
pageHeaderTitle: {
|
|
57
57
|
color: _onyxTokens.astroTokensDark.color.gray[100]
|
|
58
58
|
},
|
|
59
|
+
headText: {
|
|
60
|
+
color: _onyxTokens.astroTokensDark.color.font.base
|
|
61
|
+
},
|
|
59
62
|
linkSelectFieldLabel: {
|
|
60
63
|
color: _onyxTokens.astroTokensDark.color.font.link
|
|
61
64
|
},
|
|
@@ -664,18 +664,41 @@ declare const _default: {
|
|
|
664
664
|
};
|
|
665
665
|
};
|
|
666
666
|
caption: {
|
|
667
|
-
color:
|
|
667
|
+
color: any;
|
|
668
|
+
borderBottomColor: any;
|
|
668
669
|
};
|
|
669
670
|
thead: {
|
|
671
|
+
borderBottomColor: any;
|
|
670
672
|
'&.is-sticky': {
|
|
671
673
|
boxShadow: string;
|
|
672
674
|
};
|
|
673
675
|
};
|
|
676
|
+
tbody: {
|
|
677
|
+
borderTopColor: any;
|
|
678
|
+
};
|
|
679
|
+
row: {
|
|
680
|
+
borderBottomColor: any;
|
|
681
|
+
'&.is-hovered': {
|
|
682
|
+
bg: any;
|
|
683
|
+
'& > td:last-of-type': {
|
|
684
|
+
bg: any;
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
'&:nth-of-type(odd)': {
|
|
688
|
+
bg: any;
|
|
689
|
+
'&.is-hovered': {
|
|
690
|
+
bg: any;
|
|
691
|
+
};
|
|
692
|
+
'& > td:last-of-type': {
|
|
693
|
+
bg: any;
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
};
|
|
674
697
|
head: {
|
|
675
|
-
color:
|
|
698
|
+
color: any;
|
|
676
699
|
};
|
|
677
700
|
data: {
|
|
678
|
-
color:
|
|
701
|
+
color: any;
|
|
679
702
|
};
|
|
680
703
|
resizer: {
|
|
681
704
|
backgroundColor: any;
|