@pingux/astro 1.39.2 → 1.40.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/Chip/Badge.js +17 -6
- package/lib/cjs/components/Chip/Badge.test.js +2 -2
- package/lib/cjs/styles/variants/navBar.js +26 -1
- package/lib/components/Chip/Badge.js +16 -6
- package/lib/components/Chip/Badge.test.js +2 -2
- package/lib/styles/variants/navBar.js +26 -1
- package/package.json +1 -1
- package/NOTICE.html +0 -4707
@@ -28,6 +28,8 @@ _Object$defineProperty(exports, "__esModule", {
|
|
28
28
|
|
29
29
|
exports["default"] = void 0;
|
30
30
|
|
31
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
32
|
+
|
31
33
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
32
34
|
|
33
35
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
@@ -48,7 +50,7 @@ var colors = _interopRequireWildcard(require("../../styles/colors"));
|
|
48
50
|
|
49
51
|
var _react2 = require("@emotion/react");
|
50
52
|
|
51
|
-
var _excluded = ["align", "bg", "children", "isUppercase", "label", "sx", "slots", "textColor", "textProps"];
|
53
|
+
var _excluded = ["align", "bg", "children", "isUppercase", "label", "sx", "slots", "textColor", "textProps", "variant"];
|
52
54
|
|
53
55
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
54
56
|
|
@@ -73,6 +75,7 @@ var Badge = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
73
75
|
slots = props.slots,
|
74
76
|
textColor = props.textColor,
|
75
77
|
textProps = props.textProps,
|
78
|
+
variant = props.variant,
|
76
79
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
77
80
|
|
78
81
|
var badgeSx = _objectSpread(_objectSpread(_objectSpread({}, isUppercase && {
|
@@ -88,16 +91,21 @@ var Badge = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
88
91
|
ref: ref,
|
89
92
|
textColor: textColor,
|
90
93
|
sx: badgeSx
|
91
|
-
}, others);
|
94
|
+
}, others); // The following is to correct a visual regression released in 1.39.0 https://jira.pingidentity.com/browse/UIP-5907.
|
95
|
+
// TODO : Remove in Astro V2 with theme remapping roll out.
|
96
|
+
|
92
97
|
|
98
|
+
var oldVariantPaths = ['boxes.countChip', 'boxes.countNeutral', 'boxes.itemChipWithSlot', 'collapsiblePanel.collapsiblePanelBadge', 'boxes.environmentChip', 'boxes.readOnlyChip', 'boxes.selectedItemChip'];
|
99
|
+
var fixedVariant = (0, _includes["default"])(oldVariantPaths).call(oldVariantPaths, props.variant) ? "variants.".concat(props.variant) : props.variant;
|
93
100
|
return (0, _react2.jsx)(_BadgeContext.BadgeContext.Provider, {
|
94
101
|
value: {
|
95
102
|
bg: bg
|
96
103
|
}
|
97
104
|
}, (0, _react2.jsx)(_themeUi.Badge, (0, _extends2["default"])({
|
98
|
-
isRow: true
|
99
|
-
|
100
|
-
|
105
|
+
isRow: true
|
106
|
+
}, badgeProps, {
|
107
|
+
variant: props.variant ? fixedVariant : 'variants.boxes.chip'
|
108
|
+
}), (slots === null || slots === void 0 ? void 0 : slots.leftIcon) && (0, _react2.jsx)(_.Box, {
|
101
109
|
mr: "xs"
|
102
110
|
}, slots.leftIcon), (0, _react2.jsx)(_.Text, (0, _extends2["default"])({
|
103
111
|
variant: "label",
|
@@ -135,7 +143,10 @@ Badge.propTypes = {
|
|
135
143
|
align: _propTypes["default"].oneOf(['top', 'right', 'bottom', 'left']),
|
136
144
|
|
137
145
|
/** JSX styling that is passed into the component. */
|
138
|
-
sx: _propTypes["default"].shape({})
|
146
|
+
sx: _propTypes["default"].shape({}),
|
147
|
+
|
148
|
+
/** The variant of the badge */
|
149
|
+
variant: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object])
|
139
150
|
};
|
140
151
|
Badge.defaultProps = {
|
141
152
|
textColor: 'white',
|
@@ -36,9 +36,9 @@ var getComponent = function getComponent() {
|
|
36
36
|
test('renders Chip component', function () {
|
37
37
|
getComponent();
|
38
38
|
|
39
|
-
var
|
39
|
+
var chip = _react2.screen.getByTestId(testId);
|
40
40
|
|
41
|
-
expect(
|
41
|
+
expect(chip).toBeInTheDocument();
|
42
42
|
});
|
43
43
|
test('renders children within Chip component', function () {
|
44
44
|
var children = (0, _react3.jsx)(_Button["default"], null);
|
@@ -59,7 +59,32 @@ var sectionContainer = {
|
|
59
59
|
pt: 'sm',
|
60
60
|
height: '100%',
|
61
61
|
maxHeight: '100%',
|
62
|
-
overflowY: 'auto'
|
62
|
+
overflowY: 'auto',
|
63
|
+
// these rules are for webkit browsers: chrome, safari, edge
|
64
|
+
'&::-webkit-scrollbar-thumb': {
|
65
|
+
backgroundColor: 'rgba(255, 255, 255, 0.2)',
|
66
|
+
borderRadius: '4px'
|
67
|
+
},
|
68
|
+
'&::-webkit-scrollbar': {
|
69
|
+
width: 10
|
70
|
+
},
|
71
|
+
'&::-webkit-scrollbar-track': {
|
72
|
+
backgroundColor: 'accent.10'
|
73
|
+
},
|
74
|
+
// this is a newer standard that only ff supports for now
|
75
|
+
scrollbarColor: 'rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1)',
|
76
|
+
// can't use theme values here, unfortunately
|
77
|
+
// different colors while hovering over the nav bar
|
78
|
+
'&:hover': {
|
79
|
+
'&::-webkit-scrollbar-thumb': {
|
80
|
+
backgroundColor: 'rgba(255, 255, 255, 0.7)',
|
81
|
+
borderRadius: '4px'
|
82
|
+
},
|
83
|
+
'&::-webkit-scrollbar-track': {
|
84
|
+
backgroundColor: 'accent.5'
|
85
|
+
},
|
86
|
+
scrollbarColor: 'rgba(255, 255, 255, 0.5) rgba(0, 0, 0, 0.2)'
|
87
|
+
}
|
63
88
|
};
|
64
89
|
|
65
90
|
var sectionBody = _objectSpread(_objectSpread({}, _accordion["default"].accordionGridBody), {}, {
|
@@ -9,7 +9,8 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
9
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
11
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
12
|
-
var _excluded = ["align", "bg", "children", "isUppercase", "label", "sx", "slots", "textColor", "textProps"];
|
12
|
+
var _excluded = ["align", "bg", "children", "isUppercase", "label", "sx", "slots", "textColor", "textProps", "variant"];
|
13
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
13
14
|
|
14
15
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
15
16
|
|
@@ -38,6 +39,7 @@ var Badge = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
38
39
|
slots = props.slots,
|
39
40
|
textColor = props.textColor,
|
40
41
|
textProps = props.textProps,
|
42
|
+
variant = props.variant,
|
41
43
|
others = _objectWithoutProperties(props, _excluded);
|
42
44
|
|
43
45
|
var badgeSx = _objectSpread(_objectSpread(_objectSpread({}, isUppercase && {
|
@@ -53,16 +55,21 @@ var Badge = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
53
55
|
ref: ref,
|
54
56
|
textColor: textColor,
|
55
57
|
sx: badgeSx
|
56
|
-
}, others);
|
58
|
+
}, others); // The following is to correct a visual regression released in 1.39.0 https://jira.pingidentity.com/browse/UIP-5907.
|
59
|
+
// TODO : Remove in Astro V2 with theme remapping roll out.
|
57
60
|
|
61
|
+
|
62
|
+
var oldVariantPaths = ['boxes.countChip', 'boxes.countNeutral', 'boxes.itemChipWithSlot', 'collapsiblePanel.collapsiblePanelBadge', 'boxes.environmentChip', 'boxes.readOnlyChip', 'boxes.selectedItemChip'];
|
63
|
+
var fixedVariant = _includesInstanceProperty(oldVariantPaths).call(oldVariantPaths, props.variant) ? "variants.".concat(props.variant) : props.variant;
|
58
64
|
return ___EmotionJSX(BadgeContext.Provider, {
|
59
65
|
value: {
|
60
66
|
bg: bg
|
61
67
|
}
|
62
68
|
}, ___EmotionJSX(ThemeUIBadge, _extends({
|
63
|
-
isRow: true
|
64
|
-
|
65
|
-
|
69
|
+
isRow: true
|
70
|
+
}, badgeProps, {
|
71
|
+
variant: props.variant ? fixedVariant : 'variants.boxes.chip'
|
72
|
+
}), (slots === null || slots === void 0 ? void 0 : slots.leftIcon) && ___EmotionJSX(Box, {
|
66
73
|
mr: "xs"
|
67
74
|
}, slots.leftIcon), ___EmotionJSX(Text, _extends({
|
68
75
|
variant: "label",
|
@@ -99,7 +106,10 @@ Badge.propTypes = {
|
|
99
106
|
align: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
100
107
|
|
101
108
|
/** JSX styling that is passed into the component. */
|
102
|
-
sx: PropTypes.shape({})
|
109
|
+
sx: PropTypes.shape({}),
|
110
|
+
|
111
|
+
/** The variant of the badge */
|
112
|
+
variant: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
|
103
113
|
};
|
104
114
|
Badge.defaultProps = {
|
105
115
|
textColor: 'white',
|
@@ -22,8 +22,8 @@ var getComponent = function getComponent() {
|
|
22
22
|
axeTest(getComponent);
|
23
23
|
test('renders Chip component', function () {
|
24
24
|
getComponent();
|
25
|
-
var
|
26
|
-
expect(
|
25
|
+
var chip = screen.getByTestId(testId);
|
26
|
+
expect(chip).toBeInTheDocument();
|
27
27
|
});
|
28
28
|
test('renders children within Chip component', function () {
|
29
29
|
var children = ___EmotionJSX(Button, null);
|
@@ -40,7 +40,32 @@ var sectionContainer = {
|
|
40
40
|
pt: 'sm',
|
41
41
|
height: '100%',
|
42
42
|
maxHeight: '100%',
|
43
|
-
overflowY: 'auto'
|
43
|
+
overflowY: 'auto',
|
44
|
+
// these rules are for webkit browsers: chrome, safari, edge
|
45
|
+
'&::-webkit-scrollbar-thumb': {
|
46
|
+
backgroundColor: 'rgba(255, 255, 255, 0.2)',
|
47
|
+
borderRadius: '4px'
|
48
|
+
},
|
49
|
+
'&::-webkit-scrollbar': {
|
50
|
+
width: 10
|
51
|
+
},
|
52
|
+
'&::-webkit-scrollbar-track': {
|
53
|
+
backgroundColor: 'accent.10'
|
54
|
+
},
|
55
|
+
// this is a newer standard that only ff supports for now
|
56
|
+
scrollbarColor: 'rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1)',
|
57
|
+
// can't use theme values here, unfortunately
|
58
|
+
// different colors while hovering over the nav bar
|
59
|
+
'&:hover': {
|
60
|
+
'&::-webkit-scrollbar-thumb': {
|
61
|
+
backgroundColor: 'rgba(255, 255, 255, 0.7)',
|
62
|
+
borderRadius: '4px'
|
63
|
+
},
|
64
|
+
'&::-webkit-scrollbar-track': {
|
65
|
+
backgroundColor: 'accent.5'
|
66
|
+
},
|
67
|
+
scrollbarColor: 'rgba(255, 255, 255, 0.5) rgba(0, 0, 0, 0.2)'
|
68
|
+
}
|
44
69
|
};
|
45
70
|
|
46
71
|
var sectionBody = _objectSpread(_objectSpread({}, accordion.accordionGridBody), {}, {
|