@pingux/astro 2.26.0-alpha.1 → 2.26.0-alpha.3
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.stories.js +32 -2
- package/lib/cjs/components/Badge/Badge.styles.js +59 -1
- package/lib/cjs/components/Badge/Convenience/ConvenienceBadges.stories.js +75 -0
- package/lib/cjs/components/Badge/Convenience/ConvenienceBadges.test.js +66 -0
- package/lib/cjs/components/Badge/Convenience/DefaultBadge.js +22 -0
- package/lib/cjs/components/Badge/Convenience/ErrorCalloutBadge.js +28 -0
- package/lib/cjs/components/Badge/Convenience/InfoCalloutBadge.js +28 -0
- package/lib/cjs/components/Badge/Convenience/SuccessCalloutBadge.js +28 -0
- package/lib/cjs/components/Badge/Convenience/WarningCalloutBadge.js +28 -0
- package/lib/cjs/components/PasswordField/PasswordField.stories.js +4 -2
- package/lib/cjs/index.d.ts +5 -0
- package/lib/cjs/index.js +40 -0
- package/lib/cjs/utils/designUtils/figmaLinks.js +4 -1
- package/lib/components/Badge/Badge.stories.js +29 -0
- package/lib/components/Badge/Badge.styles.js +59 -1
- package/lib/components/Badge/Convenience/ConvenienceBadges.stories.js +64 -0
- package/lib/components/Badge/Convenience/ConvenienceBadges.test.js +63 -0
- package/lib/components/Badge/Convenience/DefaultBadge.js +13 -0
- package/lib/components/Badge/Convenience/ErrorCalloutBadge.js +19 -0
- package/lib/components/Badge/Convenience/InfoCalloutBadge.js +19 -0
- package/lib/components/Badge/Convenience/SuccessCalloutBadge.js +19 -0
- package/lib/components/Badge/Convenience/WarningCalloutBadge.js +19 -0
- package/lib/components/PasswordField/PasswordField.stories.js +4 -2
- package/lib/index.js +5 -0
- package/lib/utils/designUtils/figmaLinks.js +4 -1
- package/package.json +1 -1
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
5
5
|
_Object$defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
exports["default"] = exports.Default = exports.CountBadge = exports.BadgeWithLeftSlotAndIcon = exports.BadgeWithIcon = exports.BadgeWithCustomColors = void 0;
|
8
|
+
exports["default"] = exports.StatusBadgeVariants = exports.Default = exports.CountBadge = exports.BadgeWithLeftSlotAndIcon = exports.BadgeWithIcon = exports.BadgeWithCustomColors = void 0;
|
9
9
|
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectDestructuringEmpty"));
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
@@ -212,4 +212,34 @@ var BadgeWithLeftSlotAndIcon = function BadgeWithLeftSlotAndIcon() {
|
|
212
212
|
}
|
213
213
|
})));
|
214
214
|
};
|
215
|
-
exports.BadgeWithLeftSlotAndIcon = BadgeWithLeftSlotAndIcon;
|
215
|
+
exports.BadgeWithLeftSlotAndIcon = BadgeWithLeftSlotAndIcon;
|
216
|
+
var StatusBadgeVariants = function StatusBadgeVariants(_ref6) {
|
217
|
+
var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref6), _ref6));
|
218
|
+
return (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Badge, (0, _extends2["default"])({
|
219
|
+
variant: "criticalStatusBadge"
|
220
|
+
}, args, {
|
221
|
+
label: "Critical",
|
222
|
+
mb: "lg"
|
223
|
+
})), (0, _react2.jsx)(_index.Badge, (0, _extends2["default"])({
|
224
|
+
variant: "warningStatusBadge"
|
225
|
+
}, args, {
|
226
|
+
label: "Warning",
|
227
|
+
mb: "lg"
|
228
|
+
})), (0, _react2.jsx)(_index.Badge, (0, _extends2["default"])({
|
229
|
+
variant: "healthyStatusBadge"
|
230
|
+
}, args, {
|
231
|
+
label: "Healthy",
|
232
|
+
mb: "lg"
|
233
|
+
})), (0, _react2.jsx)(_index.Badge, (0, _extends2["default"])({
|
234
|
+
variant: "activeStatusBadge"
|
235
|
+
}, args, {
|
236
|
+
label: "Active"
|
237
|
+
})));
|
238
|
+
};
|
239
|
+
exports.StatusBadgeVariants = StatusBadgeVariants;
|
240
|
+
StatusBadgeVariants.parameters = {
|
241
|
+
design: {
|
242
|
+
type: 'figma',
|
243
|
+
url: _figmaLinks.FIGMA_LINKS.badge.statusVariants
|
244
|
+
}
|
245
|
+
};
|
@@ -138,6 +138,55 @@ var countNeutral = _objectSpread(_objectSpread({}, countDefault), {}, {
|
|
138
138
|
textTransform: 'uppercase'
|
139
139
|
}
|
140
140
|
});
|
141
|
+
var convenienceDefault = _objectSpread(_objectSpread({}, baseBadge), {}, {
|
142
|
+
backgroundColor: '#4462ED !important',
|
143
|
+
'& span': {
|
144
|
+
fontWeight: 1
|
145
|
+
}
|
146
|
+
});
|
147
|
+
var calloutBadge = _objectSpread(_objectSpread({}, baseBadge), {}, {
|
148
|
+
height: '21px',
|
149
|
+
backgroundColor: '#FFF !important',
|
150
|
+
border: 'solid 1px',
|
151
|
+
'& span': {
|
152
|
+
color: 'text.primary'
|
153
|
+
}
|
154
|
+
});
|
155
|
+
var errorCalloutBadge = _objectSpread(_objectSpread({}, calloutBadge), {}, {
|
156
|
+
borderColor: 'critical.bright'
|
157
|
+
});
|
158
|
+
var warningCalloutBadge = _objectSpread(_objectSpread({}, calloutBadge), {}, {
|
159
|
+
borderColor: '#E86900'
|
160
|
+
});
|
161
|
+
var successCalloutBadge = _objectSpread(_objectSpread({}, calloutBadge), {}, {
|
162
|
+
borderColor: 'success.bright'
|
163
|
+
});
|
164
|
+
var infoCalloutBadge = _objectSpread(_objectSpread({}, calloutBadge), {}, {
|
165
|
+
borderColor: 'text.secondary'
|
166
|
+
});
|
167
|
+
var statusBadge = _objectSpread(_objectSpread({}, baseBadge), {}, {
|
168
|
+
border: 'solid 1px',
|
169
|
+
height: '21px',
|
170
|
+
'& span': {
|
171
|
+
color: 'text.primary'
|
172
|
+
}
|
173
|
+
});
|
174
|
+
var criticalStatusBadge = _objectSpread(_objectSpread({}, statusBadge), {}, {
|
175
|
+
borderColor: 'critical.bright',
|
176
|
+
backgroundColor: '#FFEBE7 !important'
|
177
|
+
});
|
178
|
+
var warningStatusBadge = _objectSpread(_objectSpread({}, statusBadge), {}, {
|
179
|
+
borderColor: '#E86900',
|
180
|
+
backgroundColor: '#FFF6F2 !important'
|
181
|
+
});
|
182
|
+
var healthyStatusBadge = _objectSpread(_objectSpread({}, statusBadge), {}, {
|
183
|
+
borderColor: 'success.bright',
|
184
|
+
backgroundColor: '#E5FFE9 !important'
|
185
|
+
});
|
186
|
+
var activeStatusBadge = _objectSpread(_objectSpread({}, statusBadge), {}, {
|
187
|
+
borderColor: 'active',
|
188
|
+
backgroundColor: '#F7F8FD !important'
|
189
|
+
});
|
141
190
|
var _default = {
|
142
191
|
baseBadge: baseBadge,
|
143
192
|
environmentBadge: environmentBadge,
|
@@ -148,6 +197,15 @@ var _default = {
|
|
148
197
|
deleteButton: deleteButton,
|
149
198
|
countBadge: countBadge,
|
150
199
|
countNeutral: countNeutral,
|
151
|
-
badgeDeleteButton: badgeDeleteButton
|
200
|
+
badgeDeleteButton: badgeDeleteButton,
|
201
|
+
convenienceDefault: convenienceDefault,
|
202
|
+
errorCalloutBadge: errorCalloutBadge,
|
203
|
+
warningCalloutBadge: warningCalloutBadge,
|
204
|
+
successCalloutBadge: successCalloutBadge,
|
205
|
+
infoCalloutBadge: infoCalloutBadge,
|
206
|
+
criticalStatusBadge: criticalStatusBadge,
|
207
|
+
warningStatusBadge: warningStatusBadge,
|
208
|
+
healthyStatusBadge: healthyStatusBadge,
|
209
|
+
activeStatusBadge: activeStatusBadge
|
152
210
|
};
|
153
211
|
exports["default"] = _default;
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = exports.Default = exports.CalloutBadges = void 0;
|
9
|
+
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectDestructuringEmpty"));
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
12
|
+
var _storybookDocsLayout = _interopRequireDefault(require("../../../../.storybook/storybookDocsLayout"));
|
13
|
+
var _index = require("../../../index");
|
14
|
+
var _figmaLinks = require("../../../utils/designUtils/figmaLinks.js");
|
15
|
+
var _react2 = require("@emotion/react");
|
16
|
+
var _default = {
|
17
|
+
title: 'Components/Badge/Convenience',
|
18
|
+
component: _index.DefaultBadge,
|
19
|
+
argTypes: {
|
20
|
+
label: {
|
21
|
+
control: {
|
22
|
+
type: 'text'
|
23
|
+
}
|
24
|
+
},
|
25
|
+
isUppercase: {
|
26
|
+
control: {
|
27
|
+
type: 'boolean'
|
28
|
+
}
|
29
|
+
}
|
30
|
+
},
|
31
|
+
args: {},
|
32
|
+
parameters: {
|
33
|
+
docs: {
|
34
|
+
source: {
|
35
|
+
type: 'code'
|
36
|
+
},
|
37
|
+
page: function page() {
|
38
|
+
return (0, _react2.jsx)(_storybookDocsLayout["default"], null);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
};
|
43
|
+
exports["default"] = _default;
|
44
|
+
var Default = function Default(_ref) {
|
45
|
+
var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref), _ref));
|
46
|
+
return (0, _react2.jsx)(_index.DefaultBadge, args);
|
47
|
+
};
|
48
|
+
exports.Default = Default;
|
49
|
+
Default.parameters = {
|
50
|
+
design: {
|
51
|
+
type: 'figma',
|
52
|
+
url: _figmaLinks.FIGMA_LINKS.badge.convenienceDefault
|
53
|
+
}
|
54
|
+
};
|
55
|
+
var CalloutBadges = function CalloutBadges(_ref2) {
|
56
|
+
var args = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref2), _ref2));
|
57
|
+
return (0, _react2.jsx)(_index.Box, {
|
58
|
+
gap: "lg"
|
59
|
+
}, (0, _react2.jsx)(_index.ErrorCalloutBadge, (0, _extends2["default"])({
|
60
|
+
label: "You\u2019ve Got Problems"
|
61
|
+
}, args)), (0, _react2.jsx)(_index.WarningCalloutBadge, (0, _extends2["default"])({
|
62
|
+
label: "You\u2019ve Got Issues"
|
63
|
+
}, args)), (0, _react2.jsx)(_index.SuccessCalloutBadge, (0, _extends2["default"])({
|
64
|
+
label: "It Worked!"
|
65
|
+
}, args)), (0, _react2.jsx)(_index.InfoCalloutBadge, (0, _extends2["default"])({
|
66
|
+
label: "Oh by the Way"
|
67
|
+
}, args)));
|
68
|
+
};
|
69
|
+
exports.CalloutBadges = CalloutBadges;
|
70
|
+
CalloutBadges.parameters = {
|
71
|
+
design: {
|
72
|
+
type: 'figma',
|
73
|
+
url: _figmaLinks.FIGMA_LINKS.badge.calloutBadges
|
74
|
+
}
|
75
|
+
};
|
@@ -0,0 +1,66 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
4
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
6
|
+
var _react2 = require("@testing-library/react");
|
7
|
+
var _ = require("../../..");
|
8
|
+
var _testAxe = _interopRequireDefault(require("../../../utils/testUtils/testAxe"));
|
9
|
+
var _react3 = require("@emotion/react");
|
10
|
+
var testId = 'test-separator';
|
11
|
+
var defaultProps = {
|
12
|
+
'data-testid': testId,
|
13
|
+
label: 'Test Label'
|
14
|
+
};
|
15
|
+
var getDefaultBadgeComponent = function getDefaultBadgeComponent() {
|
16
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
17
|
+
return (0, _react2.render)((0, _react3.jsx)(_.DefaultBadge, (0, _extends2["default"])({}, defaultProps, props)));
|
18
|
+
};
|
19
|
+
var getErrorCalloutBadgeComponent = function getErrorCalloutBadgeComponent() {
|
20
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
21
|
+
return (0, _react2.render)((0, _react3.jsx)(_.ErrorCalloutBadge, (0, _extends2["default"])({}, defaultProps, props)));
|
22
|
+
};
|
23
|
+
var getInfoCalloutBadgeComponent = function getInfoCalloutBadgeComponent() {
|
24
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
25
|
+
return (0, _react2.render)((0, _react3.jsx)(_.InfoCalloutBadge, (0, _extends2["default"])({}, defaultProps, props)));
|
26
|
+
};
|
27
|
+
var getSuccessCalloutBadgeComponent = function getSuccessCalloutBadgeComponent() {
|
28
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
29
|
+
return (0, _react2.render)((0, _react3.jsx)(_.SuccessCalloutBadge, (0, _extends2["default"])({}, defaultProps, props)));
|
30
|
+
};
|
31
|
+
var getWarningCalloutBadgeComponent = function getWarningCalloutBadgeComponent() {
|
32
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33
|
+
return (0, _react2.render)((0, _react3.jsx)(_.WarningCalloutBadge, (0, _extends2["default"])({}, defaultProps, props)));
|
34
|
+
};
|
35
|
+
|
36
|
+
// Need to be added to each test file to test accessibility using axe.
|
37
|
+
(0, _testAxe["default"])(getDefaultBadgeComponent);
|
38
|
+
(0, _testAxe["default"])(getErrorCalloutBadgeComponent);
|
39
|
+
(0, _testAxe["default"])(getInfoCalloutBadgeComponent);
|
40
|
+
(0, _testAxe["default"])(getSuccessCalloutBadgeComponent);
|
41
|
+
(0, _testAxe["default"])(getWarningCalloutBadgeComponent);
|
42
|
+
test('renders DefaultBadge component', function () {
|
43
|
+
getDefaultBadgeComponent();
|
44
|
+
var badge = _react2.screen.getByTestId(testId);
|
45
|
+
expect(badge).toBeInTheDocument();
|
46
|
+
});
|
47
|
+
test('renders ErrorCalloutBadge component', function () {
|
48
|
+
getErrorCalloutBadgeComponent();
|
49
|
+
var badge = _react2.screen.getByTestId(testId);
|
50
|
+
expect(badge).toBeInTheDocument();
|
51
|
+
});
|
52
|
+
test('renders InfoCalloutBadge component', function () {
|
53
|
+
getInfoCalloutBadgeComponent();
|
54
|
+
var badge = _react2.screen.getByTestId(testId);
|
55
|
+
expect(badge).toBeInTheDocument();
|
56
|
+
});
|
57
|
+
test('renders SuccessCalloutBadge component', function () {
|
58
|
+
getSuccessCalloutBadgeComponent();
|
59
|
+
var badge = _react2.screen.getByTestId(testId);
|
60
|
+
expect(badge).toBeInTheDocument();
|
61
|
+
});
|
62
|
+
test('renders WarningCalloutBadge component', function () {
|
63
|
+
getWarningCalloutBadgeComponent();
|
64
|
+
var badge = _react2.screen.getByTestId(testId);
|
65
|
+
expect(badge).toBeInTheDocument();
|
66
|
+
});
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = void 0;
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
var _ = require("../../..");
|
12
|
+
var _react2 = require("@emotion/react");
|
13
|
+
var DefaultBadge = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
14
|
+
return (0, _react2.jsx)(_.Badge, (0, _extends2["default"])({
|
15
|
+
ref: ref,
|
16
|
+
label: "default",
|
17
|
+
isUppercase: true,
|
18
|
+
variant: "convenienceDefault"
|
19
|
+
}, props));
|
20
|
+
});
|
21
|
+
var _default = DefaultBadge;
|
22
|
+
exports["default"] = _default;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = void 0;
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
var _AlertCircleIcon = _interopRequireDefault(require("@pingux/mdi-react/AlertCircleIcon"));
|
12
|
+
var _ = require("../../..");
|
13
|
+
var _react2 = require("@emotion/react");
|
14
|
+
var ErrorCalloutBadge = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
15
|
+
return (0, _react2.jsx)(_.Badge, (0, _extends2["default"])({
|
16
|
+
ref: ref,
|
17
|
+
variant: "errorCalloutBadge",
|
18
|
+
slots: {
|
19
|
+
leftIcon: (0, _react2.jsx)(_.Icon, {
|
20
|
+
icon: _AlertCircleIcon["default"],
|
21
|
+
size: 15,
|
22
|
+
color: "critical.bright"
|
23
|
+
})
|
24
|
+
}
|
25
|
+
}, props));
|
26
|
+
});
|
27
|
+
var _default = ErrorCalloutBadge;
|
28
|
+
exports["default"] = _default;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = void 0;
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
var _InformationIcon = _interopRequireDefault(require("@pingux/mdi-react/InformationIcon"));
|
12
|
+
var _ = require("../../..");
|
13
|
+
var _react2 = require("@emotion/react");
|
14
|
+
var InfoCalloutBadge = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
15
|
+
return (0, _react2.jsx)(_.Badge, (0, _extends2["default"])({
|
16
|
+
ref: ref,
|
17
|
+
variant: "infoCalloutBadge",
|
18
|
+
slots: {
|
19
|
+
leftIcon: (0, _react2.jsx)(_.Icon, {
|
20
|
+
icon: _InformationIcon["default"],
|
21
|
+
size: 15,
|
22
|
+
color: "text.secondary"
|
23
|
+
})
|
24
|
+
}
|
25
|
+
}, props));
|
26
|
+
});
|
27
|
+
var _default = InfoCalloutBadge;
|
28
|
+
exports["default"] = _default;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = void 0;
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
var _CheckCircleIcon = _interopRequireDefault(require("@pingux/mdi-react/CheckCircleIcon"));
|
12
|
+
var _ = require("../../..");
|
13
|
+
var _react2 = require("@emotion/react");
|
14
|
+
var SuccessCalloutBadge = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
15
|
+
return (0, _react2.jsx)(_.Badge, (0, _extends2["default"])({
|
16
|
+
ref: ref,
|
17
|
+
variant: "successCalloutBadge",
|
18
|
+
slots: {
|
19
|
+
leftIcon: (0, _react2.jsx)(_.Icon, {
|
20
|
+
icon: _CheckCircleIcon["default"],
|
21
|
+
size: 15,
|
22
|
+
color: "success.bright"
|
23
|
+
})
|
24
|
+
}
|
25
|
+
}, props));
|
26
|
+
});
|
27
|
+
var _default = SuccessCalloutBadge;
|
28
|
+
exports["default"] = _default;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = void 0;
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
var _AlertIcon = _interopRequireDefault(require("@pingux/mdi-react/AlertIcon"));
|
12
|
+
var _ = require("../../..");
|
13
|
+
var _react2 = require("@emotion/react");
|
14
|
+
var WarningCalloutBadge = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
15
|
+
return (0, _react2.jsx)(_.Badge, (0, _extends2["default"])({
|
16
|
+
ref: ref,
|
17
|
+
variant: "warningCalloutBadge",
|
18
|
+
slots: {
|
19
|
+
leftIcon: (0, _react2.jsx)(_.Icon, {
|
20
|
+
icon: _AlertIcon["default"],
|
21
|
+
size: 15,
|
22
|
+
color: "#E86900"
|
23
|
+
})
|
24
|
+
}
|
25
|
+
}, props));
|
26
|
+
});
|
27
|
+
var _default = WarningCalloutBadge;
|
28
|
+
exports["default"] = _default;
|
@@ -304,7 +304,8 @@ var Warning = function Warning() {
|
|
304
304
|
onVisibleChange: onVisibleChange,
|
305
305
|
isVisible: isVisible,
|
306
306
|
label: "Example Label",
|
307
|
-
status: "warning"
|
307
|
+
status: "warning",
|
308
|
+
helperText: "This might match a password you\u2019ve used before."
|
308
309
|
});
|
309
310
|
};
|
310
311
|
exports.Warning = Warning;
|
@@ -320,7 +321,8 @@ var Success = function Success() {
|
|
320
321
|
onVisibleChange: onVisibleChange,
|
321
322
|
isVisible: isVisible,
|
322
323
|
label: "Example Label",
|
323
|
-
status: "success"
|
324
|
+
status: "success",
|
325
|
+
helperText: "This password meets requirements."
|
324
326
|
});
|
325
327
|
};
|
326
328
|
exports.Success = Success;
|
package/lib/cjs/index.d.ts
CHANGED
@@ -15,6 +15,11 @@ export { default as Avatar } from './components/Avatar';
|
|
15
15
|
export * from './components/Avatar';
|
16
16
|
export { default as Badge } from './components/Badge';
|
17
17
|
export * from './components/Badge';
|
18
|
+
export { default as DefaultBadge } from './components/Badge/Convenience/DefaultBadge';
|
19
|
+
export { default as ErrorCalloutBadge } from './components/Badge/Convenience/ErrorCalloutBadge';
|
20
|
+
export { default as InfoCalloutBadge } from './components/Badge/Convenience/InfoCalloutBadge';
|
21
|
+
export { default as SuccessCalloutBadge } from './components/Badge/Convenience/SuccessCalloutBadge';
|
22
|
+
export { default as WarningCalloutBadge } from './components/Badge/Convenience/WarningCalloutBadge';
|
18
23
|
export { default as Box } from './components/Box';
|
19
24
|
export * from './components/Box';
|
20
25
|
export { default as Bracket } from './components/Bracket';
|
package/lib/cjs/index.js
CHANGED
@@ -21,6 +21,11 @@ var _exportNames = {
|
|
21
21
|
AstroProvider: true,
|
22
22
|
Avatar: true,
|
23
23
|
Badge: true,
|
24
|
+
DefaultBadge: true,
|
25
|
+
ErrorCalloutBadge: true,
|
26
|
+
InfoCalloutBadge: true,
|
27
|
+
SuccessCalloutBadge: true,
|
28
|
+
WarningCalloutBadge: true,
|
24
29
|
Box: true,
|
25
30
|
Bracket: true,
|
26
31
|
Breadcrumbs: true,
|
@@ -347,6 +352,12 @@ _Object$defineProperty(exports, "DatePicker", {
|
|
347
352
|
return _DatePicker["default"];
|
348
353
|
}
|
349
354
|
});
|
355
|
+
_Object$defineProperty(exports, "DefaultBadge", {
|
356
|
+
enumerable: true,
|
357
|
+
get: function get() {
|
358
|
+
return _DefaultBadge["default"];
|
359
|
+
}
|
360
|
+
});
|
350
361
|
_Object$defineProperty(exports, "EditButton", {
|
351
362
|
enumerable: true,
|
352
363
|
get: function get() {
|
@@ -359,6 +370,12 @@ _Object$defineProperty(exports, "EnvironmentBreadcrumb", {
|
|
359
370
|
return _EnvironmentBreadcrumb["default"];
|
360
371
|
}
|
361
372
|
});
|
373
|
+
_Object$defineProperty(exports, "ErrorCalloutBadge", {
|
374
|
+
enumerable: true,
|
375
|
+
get: function get() {
|
376
|
+
return _ErrorCalloutBadge["default"];
|
377
|
+
}
|
378
|
+
});
|
362
379
|
_Object$defineProperty(exports, "FieldHelperText", {
|
363
380
|
enumerable: true,
|
364
381
|
get: function get() {
|
@@ -413,6 +430,12 @@ _Object$defineProperty(exports, "ImageUploadField", {
|
|
413
430
|
return _ImageUploadField["default"];
|
414
431
|
}
|
415
432
|
});
|
433
|
+
_Object$defineProperty(exports, "InfoCalloutBadge", {
|
434
|
+
enumerable: true,
|
435
|
+
get: function get() {
|
436
|
+
return _InfoCalloutBadge["default"];
|
437
|
+
}
|
438
|
+
});
|
416
439
|
_Object$defineProperty(exports, "Input", {
|
417
440
|
enumerable: true,
|
418
441
|
get: function get() {
|
@@ -671,6 +694,12 @@ _Object$defineProperty(exports, "Stepper", {
|
|
671
694
|
return _Stepper["default"];
|
672
695
|
}
|
673
696
|
});
|
697
|
+
_Object$defineProperty(exports, "SuccessCalloutBadge", {
|
698
|
+
enumerable: true,
|
699
|
+
get: function get() {
|
700
|
+
return _SuccessCalloutBadge["default"];
|
701
|
+
}
|
702
|
+
});
|
674
703
|
_Object$defineProperty(exports, "Switch", {
|
675
704
|
enumerable: true,
|
676
705
|
get: function get() {
|
@@ -773,6 +802,12 @@ _Object$defineProperty(exports, "TreeView", {
|
|
773
802
|
return _TreeView["default"];
|
774
803
|
}
|
775
804
|
});
|
805
|
+
_Object$defineProperty(exports, "WarningCalloutBadge", {
|
806
|
+
enumerable: true,
|
807
|
+
get: function get() {
|
808
|
+
return _WarningCalloutBadge["default"];
|
809
|
+
}
|
810
|
+
});
|
776
811
|
_Object$defineProperty(exports, "useOverlayPosition", {
|
777
812
|
enumerable: true,
|
778
813
|
get: function get() {
|
@@ -893,6 +928,11 @@ _forEachInstanceProperty(_context8 = _Object$keys(_Badge)).call(_context8, funct
|
|
893
928
|
}
|
894
929
|
});
|
895
930
|
});
|
931
|
+
var _DefaultBadge = _interopRequireDefault(require("./components/Badge/Convenience/DefaultBadge"));
|
932
|
+
var _ErrorCalloutBadge = _interopRequireDefault(require("./components/Badge/Convenience/ErrorCalloutBadge"));
|
933
|
+
var _InfoCalloutBadge = _interopRequireDefault(require("./components/Badge/Convenience/InfoCalloutBadge"));
|
934
|
+
var _SuccessCalloutBadge = _interopRequireDefault(require("./components/Badge/Convenience/SuccessCalloutBadge"));
|
935
|
+
var _WarningCalloutBadge = _interopRequireDefault(require("./components/Badge/Convenience/WarningCalloutBadge"));
|
896
936
|
var _Box = _interopRequireWildcard(require("./components/Box"));
|
897
937
|
_forEachInstanceProperty(_context9 = _Object$keys(_Box)).call(_context9, function (key) {
|
898
938
|
if (key === "default" || key === "__esModule") return;
|
@@ -17,7 +17,10 @@ var FIGMA_LINKS = {
|
|
17
17
|
},
|
18
18
|
badge: {
|
19
19
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=1899-11550&t=VgqEexa1CXAXfPpp-0',
|
20
|
-
countBadge: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=4255%3A12558&t=3b86het2R9G2Zyo2-1'
|
20
|
+
countBadge: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=4255%3A12558&t=3b86het2R9G2Zyo2-1',
|
21
|
+
statusVariants: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=43214%3A600&mode=design&t=1lk7azcFoekl7S8N-1',
|
22
|
+
convenienceDefault: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=43601%3A18124&mode=dev',
|
23
|
+
calloutBadges: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=12854-33198&mode=design&t=cJyYBxLFH8D5XxOw-0'
|
21
24
|
},
|
22
25
|
breadcrumbs: {
|
23
26
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=1162-11924&t=8Wwd3tIBh3GEjCJB-0'
|
@@ -198,4 +198,33 @@ export var BadgeWithLeftSlotAndIcon = function BadgeWithLeftSlotAndIcon() {
|
|
198
198
|
name: 'Clear Icon'
|
199
199
|
}
|
200
200
|
})));
|
201
|
+
};
|
202
|
+
export var StatusBadgeVariants = function StatusBadgeVariants(_ref6) {
|
203
|
+
var args = _extends({}, (_objectDestructuringEmpty(_ref6), _ref6));
|
204
|
+
return ___EmotionJSX(Box, null, ___EmotionJSX(Badge, _extends({
|
205
|
+
variant: "criticalStatusBadge"
|
206
|
+
}, args, {
|
207
|
+
label: "Critical",
|
208
|
+
mb: "lg"
|
209
|
+
})), ___EmotionJSX(Badge, _extends({
|
210
|
+
variant: "warningStatusBadge"
|
211
|
+
}, args, {
|
212
|
+
label: "Warning",
|
213
|
+
mb: "lg"
|
214
|
+
})), ___EmotionJSX(Badge, _extends({
|
215
|
+
variant: "healthyStatusBadge"
|
216
|
+
}, args, {
|
217
|
+
label: "Healthy",
|
218
|
+
mb: "lg"
|
219
|
+
})), ___EmotionJSX(Badge, _extends({
|
220
|
+
variant: "activeStatusBadge"
|
221
|
+
}, args, {
|
222
|
+
label: "Active"
|
223
|
+
})));
|
224
|
+
};
|
225
|
+
StatusBadgeVariants.parameters = {
|
226
|
+
design: {
|
227
|
+
type: 'figma',
|
228
|
+
url: FIGMA_LINKS.badge.statusVariants
|
229
|
+
}
|
201
230
|
};
|
@@ -128,6 +128,55 @@ var countNeutral = _objectSpread(_objectSpread({}, countDefault), {}, {
|
|
128
128
|
textTransform: 'uppercase'
|
129
129
|
}
|
130
130
|
});
|
131
|
+
var convenienceDefault = _objectSpread(_objectSpread({}, baseBadge), {}, {
|
132
|
+
backgroundColor: '#4462ED !important',
|
133
|
+
'& span': {
|
134
|
+
fontWeight: 1
|
135
|
+
}
|
136
|
+
});
|
137
|
+
var calloutBadge = _objectSpread(_objectSpread({}, baseBadge), {}, {
|
138
|
+
height: '21px',
|
139
|
+
backgroundColor: '#FFF !important',
|
140
|
+
border: 'solid 1px',
|
141
|
+
'& span': {
|
142
|
+
color: 'text.primary'
|
143
|
+
}
|
144
|
+
});
|
145
|
+
var errorCalloutBadge = _objectSpread(_objectSpread({}, calloutBadge), {}, {
|
146
|
+
borderColor: 'critical.bright'
|
147
|
+
});
|
148
|
+
var warningCalloutBadge = _objectSpread(_objectSpread({}, calloutBadge), {}, {
|
149
|
+
borderColor: '#E86900'
|
150
|
+
});
|
151
|
+
var successCalloutBadge = _objectSpread(_objectSpread({}, calloutBadge), {}, {
|
152
|
+
borderColor: 'success.bright'
|
153
|
+
});
|
154
|
+
var infoCalloutBadge = _objectSpread(_objectSpread({}, calloutBadge), {}, {
|
155
|
+
borderColor: 'text.secondary'
|
156
|
+
});
|
157
|
+
var statusBadge = _objectSpread(_objectSpread({}, baseBadge), {}, {
|
158
|
+
border: 'solid 1px',
|
159
|
+
height: '21px',
|
160
|
+
'& span': {
|
161
|
+
color: 'text.primary'
|
162
|
+
}
|
163
|
+
});
|
164
|
+
var criticalStatusBadge = _objectSpread(_objectSpread({}, statusBadge), {}, {
|
165
|
+
borderColor: 'critical.bright',
|
166
|
+
backgroundColor: '#FFEBE7 !important'
|
167
|
+
});
|
168
|
+
var warningStatusBadge = _objectSpread(_objectSpread({}, statusBadge), {}, {
|
169
|
+
borderColor: '#E86900',
|
170
|
+
backgroundColor: '#FFF6F2 !important'
|
171
|
+
});
|
172
|
+
var healthyStatusBadge = _objectSpread(_objectSpread({}, statusBadge), {}, {
|
173
|
+
borderColor: 'success.bright',
|
174
|
+
backgroundColor: '#E5FFE9 !important'
|
175
|
+
});
|
176
|
+
var activeStatusBadge = _objectSpread(_objectSpread({}, statusBadge), {}, {
|
177
|
+
borderColor: 'active',
|
178
|
+
backgroundColor: '#F7F8FD !important'
|
179
|
+
});
|
131
180
|
export default {
|
132
181
|
baseBadge: baseBadge,
|
133
182
|
environmentBadge: environmentBadge,
|
@@ -138,5 +187,14 @@ export default {
|
|
138
187
|
deleteButton: deleteButton,
|
139
188
|
countBadge: countBadge,
|
140
189
|
countNeutral: countNeutral,
|
141
|
-
badgeDeleteButton: badgeDeleteButton
|
190
|
+
badgeDeleteButton: badgeDeleteButton,
|
191
|
+
convenienceDefault: convenienceDefault,
|
192
|
+
errorCalloutBadge: errorCalloutBadge,
|
193
|
+
warningCalloutBadge: warningCalloutBadge,
|
194
|
+
successCalloutBadge: successCalloutBadge,
|
195
|
+
infoCalloutBadge: infoCalloutBadge,
|
196
|
+
criticalStatusBadge: criticalStatusBadge,
|
197
|
+
warningStatusBadge: warningStatusBadge,
|
198
|
+
healthyStatusBadge: healthyStatusBadge,
|
199
|
+
activeStatusBadge: activeStatusBadge
|
142
200
|
};
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/esm/objectDestructuringEmpty";
|
2
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
3
|
+
import React from 'react';
|
4
|
+
import DocsLayout from '../../../../.storybook/storybookDocsLayout';
|
5
|
+
import { Box, DefaultBadge, ErrorCalloutBadge, InfoCalloutBadge, SuccessCalloutBadge, WarningCalloutBadge } from '../../../index';
|
6
|
+
import { FIGMA_LINKS } from '../../../utils/designUtils/figmaLinks.js';
|
7
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
|
+
export default {
|
9
|
+
title: 'Components/Badge/Convenience',
|
10
|
+
component: DefaultBadge,
|
11
|
+
argTypes: {
|
12
|
+
label: {
|
13
|
+
control: {
|
14
|
+
type: 'text'
|
15
|
+
}
|
16
|
+
},
|
17
|
+
isUppercase: {
|
18
|
+
control: {
|
19
|
+
type: 'boolean'
|
20
|
+
}
|
21
|
+
}
|
22
|
+
},
|
23
|
+
args: {},
|
24
|
+
parameters: {
|
25
|
+
docs: {
|
26
|
+
source: {
|
27
|
+
type: 'code'
|
28
|
+
},
|
29
|
+
page: function page() {
|
30
|
+
return ___EmotionJSX(DocsLayout, null);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
};
|
35
|
+
export var Default = function Default(_ref) {
|
36
|
+
var args = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
37
|
+
return ___EmotionJSX(DefaultBadge, args);
|
38
|
+
};
|
39
|
+
Default.parameters = {
|
40
|
+
design: {
|
41
|
+
type: 'figma',
|
42
|
+
url: FIGMA_LINKS.badge.convenienceDefault
|
43
|
+
}
|
44
|
+
};
|
45
|
+
export var CalloutBadges = function CalloutBadges(_ref2) {
|
46
|
+
var args = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
47
|
+
return ___EmotionJSX(Box, {
|
48
|
+
gap: "lg"
|
49
|
+
}, ___EmotionJSX(ErrorCalloutBadge, _extends({
|
50
|
+
label: "You\u2019ve Got Problems"
|
51
|
+
}, args)), ___EmotionJSX(WarningCalloutBadge, _extends({
|
52
|
+
label: "You\u2019ve Got Issues"
|
53
|
+
}, args)), ___EmotionJSX(SuccessCalloutBadge, _extends({
|
54
|
+
label: "It Worked!"
|
55
|
+
}, args)), ___EmotionJSX(InfoCalloutBadge, _extends({
|
56
|
+
label: "Oh by the Way"
|
57
|
+
}, args)));
|
58
|
+
};
|
59
|
+
CalloutBadges.parameters = {
|
60
|
+
design: {
|
61
|
+
type: 'figma',
|
62
|
+
url: FIGMA_LINKS.badge.calloutBadges
|
63
|
+
}
|
64
|
+
};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import React from 'react';
|
3
|
+
import { render, screen } from '@testing-library/react';
|
4
|
+
import { DefaultBadge, ErrorCalloutBadge, InfoCalloutBadge, SuccessCalloutBadge, WarningCalloutBadge } from '../../..';
|
5
|
+
import axeTest from '../../../utils/testUtils/testAxe';
|
6
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
|
+
var testId = 'test-separator';
|
8
|
+
var defaultProps = {
|
9
|
+
'data-testid': testId,
|
10
|
+
label: 'Test Label'
|
11
|
+
};
|
12
|
+
var getDefaultBadgeComponent = function getDefaultBadgeComponent() {
|
13
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
14
|
+
return render(___EmotionJSX(DefaultBadge, _extends({}, defaultProps, props)));
|
15
|
+
};
|
16
|
+
var getErrorCalloutBadgeComponent = function getErrorCalloutBadgeComponent() {
|
17
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
18
|
+
return render(___EmotionJSX(ErrorCalloutBadge, _extends({}, defaultProps, props)));
|
19
|
+
};
|
20
|
+
var getInfoCalloutBadgeComponent = function getInfoCalloutBadgeComponent() {
|
21
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
22
|
+
return render(___EmotionJSX(InfoCalloutBadge, _extends({}, defaultProps, props)));
|
23
|
+
};
|
24
|
+
var getSuccessCalloutBadgeComponent = function getSuccessCalloutBadgeComponent() {
|
25
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
26
|
+
return render(___EmotionJSX(SuccessCalloutBadge, _extends({}, defaultProps, props)));
|
27
|
+
};
|
28
|
+
var getWarningCalloutBadgeComponent = function getWarningCalloutBadgeComponent() {
|
29
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
30
|
+
return render(___EmotionJSX(WarningCalloutBadge, _extends({}, defaultProps, props)));
|
31
|
+
};
|
32
|
+
|
33
|
+
// Need to be added to each test file to test accessibility using axe.
|
34
|
+
axeTest(getDefaultBadgeComponent);
|
35
|
+
axeTest(getErrorCalloutBadgeComponent);
|
36
|
+
axeTest(getInfoCalloutBadgeComponent);
|
37
|
+
axeTest(getSuccessCalloutBadgeComponent);
|
38
|
+
axeTest(getWarningCalloutBadgeComponent);
|
39
|
+
test('renders DefaultBadge component', function () {
|
40
|
+
getDefaultBadgeComponent();
|
41
|
+
var badge = screen.getByTestId(testId);
|
42
|
+
expect(badge).toBeInTheDocument();
|
43
|
+
});
|
44
|
+
test('renders ErrorCalloutBadge component', function () {
|
45
|
+
getErrorCalloutBadgeComponent();
|
46
|
+
var badge = screen.getByTestId(testId);
|
47
|
+
expect(badge).toBeInTheDocument();
|
48
|
+
});
|
49
|
+
test('renders InfoCalloutBadge component', function () {
|
50
|
+
getInfoCalloutBadgeComponent();
|
51
|
+
var badge = screen.getByTestId(testId);
|
52
|
+
expect(badge).toBeInTheDocument();
|
53
|
+
});
|
54
|
+
test('renders SuccessCalloutBadge component', function () {
|
55
|
+
getSuccessCalloutBadgeComponent();
|
56
|
+
var badge = screen.getByTestId(testId);
|
57
|
+
expect(badge).toBeInTheDocument();
|
58
|
+
});
|
59
|
+
test('renders WarningCalloutBadge component', function () {
|
60
|
+
getWarningCalloutBadgeComponent();
|
61
|
+
var badge = screen.getByTestId(testId);
|
62
|
+
expect(badge).toBeInTheDocument();
|
63
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import React from 'react';
|
3
|
+
import { Badge } from '../../..';
|
4
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
5
|
+
var DefaultBadge = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
6
|
+
return ___EmotionJSX(Badge, _extends({
|
7
|
+
ref: ref,
|
8
|
+
label: "default",
|
9
|
+
isUppercase: true,
|
10
|
+
variant: "convenienceDefault"
|
11
|
+
}, props));
|
12
|
+
});
|
13
|
+
export default DefaultBadge;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import React from 'react';
|
3
|
+
import AlertCircle from '@pingux/mdi-react/AlertCircleIcon';
|
4
|
+
import { Badge, Icon } from '../../..';
|
5
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
6
|
+
var ErrorCalloutBadge = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
7
|
+
return ___EmotionJSX(Badge, _extends({
|
8
|
+
ref: ref,
|
9
|
+
variant: "errorCalloutBadge",
|
10
|
+
slots: {
|
11
|
+
leftIcon: ___EmotionJSX(Icon, {
|
12
|
+
icon: AlertCircle,
|
13
|
+
size: 15,
|
14
|
+
color: "critical.bright"
|
15
|
+
})
|
16
|
+
}
|
17
|
+
}, props));
|
18
|
+
});
|
19
|
+
export default ErrorCalloutBadge;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import React from 'react';
|
3
|
+
import Information from '@pingux/mdi-react/InformationIcon';
|
4
|
+
import { Badge, Icon } from '../../..';
|
5
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
6
|
+
var InfoCalloutBadge = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
7
|
+
return ___EmotionJSX(Badge, _extends({
|
8
|
+
ref: ref,
|
9
|
+
variant: "infoCalloutBadge",
|
10
|
+
slots: {
|
11
|
+
leftIcon: ___EmotionJSX(Icon, {
|
12
|
+
icon: Information,
|
13
|
+
size: 15,
|
14
|
+
color: "text.secondary"
|
15
|
+
})
|
16
|
+
}
|
17
|
+
}, props));
|
18
|
+
});
|
19
|
+
export default InfoCalloutBadge;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import React from 'react';
|
3
|
+
import CheckCircle from '@pingux/mdi-react/CheckCircleIcon';
|
4
|
+
import { Badge, Icon } from '../../..';
|
5
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
6
|
+
var SuccessCalloutBadge = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
7
|
+
return ___EmotionJSX(Badge, _extends({
|
8
|
+
ref: ref,
|
9
|
+
variant: "successCalloutBadge",
|
10
|
+
slots: {
|
11
|
+
leftIcon: ___EmotionJSX(Icon, {
|
12
|
+
icon: CheckCircle,
|
13
|
+
size: 15,
|
14
|
+
color: "success.bright"
|
15
|
+
})
|
16
|
+
}
|
17
|
+
}, props));
|
18
|
+
});
|
19
|
+
export default SuccessCalloutBadge;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import React from 'react';
|
3
|
+
import Alert from '@pingux/mdi-react/AlertIcon';
|
4
|
+
import { Badge, Icon } from '../../..';
|
5
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
6
|
+
var WarningCalloutBadge = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
7
|
+
return ___EmotionJSX(Badge, _extends({
|
8
|
+
ref: ref,
|
9
|
+
variant: "warningCalloutBadge",
|
10
|
+
slots: {
|
11
|
+
leftIcon: ___EmotionJSX(Icon, {
|
12
|
+
icon: Alert,
|
13
|
+
size: 15,
|
14
|
+
color: "#E86900"
|
15
|
+
})
|
16
|
+
}
|
17
|
+
}, props));
|
18
|
+
});
|
19
|
+
export default WarningCalloutBadge;
|
@@ -283,7 +283,8 @@ export var Warning = function Warning() {
|
|
283
283
|
onVisibleChange: onVisibleChange,
|
284
284
|
isVisible: isVisible,
|
285
285
|
label: "Example Label",
|
286
|
-
status: "warning"
|
286
|
+
status: "warning",
|
287
|
+
helperText: "This might match a password you\u2019ve used before."
|
287
288
|
});
|
288
289
|
};
|
289
290
|
export var Success = function Success() {
|
@@ -298,7 +299,8 @@ export var Success = function Success() {
|
|
298
299
|
onVisibleChange: onVisibleChange,
|
299
300
|
isVisible: isVisible,
|
300
301
|
label: "Example Label",
|
301
|
-
status: "success"
|
302
|
+
status: "success",
|
303
|
+
helperText: "This password meets requirements."
|
302
304
|
});
|
303
305
|
};
|
304
306
|
export var DynamicRequired = function DynamicRequired() {
|
package/lib/index.js
CHANGED
@@ -19,6 +19,11 @@ export { default as Avatar } from './components/Avatar';
|
|
19
19
|
export * from './components/Avatar';
|
20
20
|
export { default as Badge } from './components/Badge';
|
21
21
|
export * from './components/Badge';
|
22
|
+
export { default as DefaultBadge } from './components/Badge/Convenience/DefaultBadge';
|
23
|
+
export { default as ErrorCalloutBadge } from './components/Badge/Convenience/ErrorCalloutBadge';
|
24
|
+
export { default as InfoCalloutBadge } from './components/Badge/Convenience/InfoCalloutBadge';
|
25
|
+
export { default as SuccessCalloutBadge } from './components/Badge/Convenience/SuccessCalloutBadge';
|
26
|
+
export { default as WarningCalloutBadge } from './components/Badge/Convenience/WarningCalloutBadge';
|
22
27
|
export { default as Box } from './components/Box';
|
23
28
|
export * from './components/Box';
|
24
29
|
export { default as Bracket } from './components/Bracket';
|
@@ -10,7 +10,10 @@ export var FIGMA_LINKS = {
|
|
10
10
|
},
|
11
11
|
badge: {
|
12
12
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=1899-11550&t=VgqEexa1CXAXfPpp-0',
|
13
|
-
countBadge: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=4255%3A12558&t=3b86het2R9G2Zyo2-1'
|
13
|
+
countBadge: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=4255%3A12558&t=3b86het2R9G2Zyo2-1',
|
14
|
+
statusVariants: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=43214%3A600&mode=design&t=1lk7azcFoekl7S8N-1',
|
15
|
+
convenienceDefault: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=43601%3A18124&mode=dev',
|
16
|
+
calloutBadges: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=12854-33198&mode=design&t=cJyYBxLFH8D5XxOw-0'
|
14
17
|
},
|
15
18
|
breadcrumbs: {
|
16
19
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=1162-11924&t=8Wwd3tIBh3GEjCJB-0'
|