@pingux/astro 1.2.0-alpha.1 → 1.2.0-alpha.13
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/Breadcrumbs/Breadcrumbs.stories.js +3 -3
- package/lib/cjs/components/Button/Button.js +14 -2
- package/lib/cjs/components/Button/Button.stories.js +69 -28
- package/lib/cjs/components/Button/Button.test.js +26 -0
- package/lib/cjs/components/CopyText/CopyButton.js +9 -2
- package/lib/cjs/components/HelpHint/HelpHint.js +24 -6
- package/lib/cjs/components/HelpHint/HelpHint.stories.js +57 -0
- package/lib/cjs/components/HelpHint/HelpHint.test.js +80 -0
- package/lib/cjs/components/Messages/Messages.reducer.js +2 -1
- package/lib/cjs/components/Messages/Messages.stories.js +10 -10
- package/lib/cjs/components/Messages/Messages.test.js +15 -1
- package/lib/cjs/components/Messages/index.js +21 -2
- package/lib/cjs/components/Modal/Modal.stories.js +1 -1
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +3 -1
- package/lib/cjs/components/NumberField/NumberField.js +3 -1
- package/lib/cjs/components/NumberField/NumberField.test.js +7 -0
- package/lib/cjs/components/OverlayPanel/OverlayPanel.js +2 -16
- package/lib/cjs/components/OverlayPanel/OverlayPanel.test.js +44 -0
- package/lib/cjs/components/SearchField/SearchField.stories.js +1 -15
- package/lib/cjs/components/TextAreaField/TextAreaField.js +1 -1
- package/lib/cjs/components/TextAreaField/TextAreaField.stories.js +1 -54
- package/lib/cjs/components/TextField/TextField.stories.js +79 -2
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.js +2 -1
- package/lib/cjs/layouts/ListLayout.stories.js +6 -6
- package/lib/cjs/recipes/ArrayField.stories.js +1 -1
- package/lib/cjs/recipes/ConditionalFilter.stories.js +7 -3
- package/lib/cjs/recipes/RadioButtonsWithLinks.stories.js +1 -1
- package/lib/cjs/styles/variants/buttons.js +78 -2
- package/lib/cjs/styles/variants/text.js +14 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +3 -3
- package/lib/components/Button/Button.js +15 -3
- package/lib/components/Button/Button.stories.js +53 -15
- package/lib/components/Button/Button.test.js +20 -0
- package/lib/components/CopyText/CopyButton.js +7 -2
- package/lib/components/HelpHint/HelpHint.js +25 -5
- package/lib/components/HelpHint/HelpHint.stories.js +34 -0
- package/lib/components/HelpHint/HelpHint.test.js +58 -0
- package/lib/components/Messages/Messages.reducer.js +1 -1
- package/lib/components/Messages/Messages.stories.js +1 -1
- package/lib/components/Messages/Messages.test.js +11 -1
- package/lib/components/Messages/index.js +2 -1
- package/lib/components/Modal/Modal.stories.js +1 -1
- package/lib/components/MultivaluesField/MultivaluesField.js +3 -1
- package/lib/components/NumberField/NumberField.js +2 -1
- package/lib/components/NumberField/NumberField.test.js +7 -0
- package/lib/components/OverlayPanel/OverlayPanel.js +3 -16
- package/lib/components/OverlayPanel/OverlayPanel.test.js +38 -0
- package/lib/components/SearchField/SearchField.stories.js +0 -11
- package/lib/components/TextAreaField/TextAreaField.js +1 -1
- package/lib/components/TextAreaField/TextAreaField.stories.js +0 -43
- package/lib/components/TextField/TextField.stories.js +72 -0
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.js +2 -1
- package/lib/layouts/ListLayout.stories.js +6 -6
- package/lib/recipes/ArrayField.stories.js +1 -1
- package/lib/recipes/ConditionalFilter.stories.js +7 -3
- package/lib/recipes/RadioButtonsWithLinks.stories.js +1 -1
- package/lib/styles/variants/buttons.js +78 -2
- package/lib/styles/variants/text.js +14 -0
- package/package.json +2 -2
@@ -169,4 +169,11 @@ test('increment and decrement buttons shouldn\'t be able to be focused via keybo
|
|
169
169
|
_userEvent["default"].tab();
|
170
170
|
|
171
171
|
expect(_testWrapper.screen.getByLabelText('arrow-down')).not.toHaveFocus();
|
172
|
+
});
|
173
|
+
test('number field input receiving name attribute', function () {
|
174
|
+
var testName = 'testName';
|
175
|
+
getComponent({
|
176
|
+
name: testName
|
177
|
+
});
|
178
|
+
expect(_testWrapper.screen.getByLabelText(testLabel)).toHaveAttribute('name', testName);
|
172
179
|
});
|
@@ -18,8 +18,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
|
|
18
18
|
|
19
19
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
20
20
|
|
21
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
22
|
-
|
23
21
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
24
22
|
|
25
23
|
var _react = _interopRequireWildcard(require("react"));
|
@@ -52,14 +50,8 @@ var OverlayPanel = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
52
50
|
onClose = _useOverlayPanelState.onClose;
|
53
51
|
|
54
52
|
var overlayPanelRef = (0, _react.useRef)();
|
55
|
-
|
56
|
-
var _useState = (0, _react.useState)(true),
|
57
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
58
|
-
contain = _useState2[0],
|
59
|
-
setIsContained = _useState2[1];
|
60
53
|
/* istanbul ignore next */
|
61
54
|
|
62
|
-
|
63
55
|
(0, _react.useImperativeHandle)(ref, function () {
|
64
56
|
return overlayPanelRef.current;
|
65
57
|
});
|
@@ -73,18 +65,12 @@ var OverlayPanel = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
73
65
|
e.stopPropagation();
|
74
66
|
|
75
67
|
if (e.key === 'Escape') {
|
76
|
-
|
68
|
+
onClose(state, triggerRef, onCloseProp);
|
77
69
|
}
|
78
70
|
};
|
79
71
|
|
80
|
-
(0, _react.useEffect)(function () {
|
81
|
-
if (!contain && onClose) {
|
82
|
-
onClose(state, triggerRef, onCloseProp);
|
83
|
-
}
|
84
|
-
}, [contain]);
|
85
72
|
return (0, _react2.jsx)(_focus.FocusScope, {
|
86
|
-
autoFocus: true
|
87
|
-
contain: contain
|
73
|
+
autoFocus: true
|
88
74
|
}, (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
89
75
|
variant: "overlayPanel.overlayPanel",
|
90
76
|
ref: overlayPanelRef
|
@@ -79,6 +79,15 @@ test('onClose callback fires when provided', function () {
|
|
79
79
|
|
80
80
|
expect(onClose).toHaveBeenCalled();
|
81
81
|
});
|
82
|
+
test('custom classname can be passed', function () {
|
83
|
+
getComponent({
|
84
|
+
className: 'testing-class'
|
85
|
+
});
|
86
|
+
|
87
|
+
var overlayPanel = _testWrapper.screen.getByTestId(testId);
|
88
|
+
|
89
|
+
expect(overlayPanel).toHaveClass('testing-class');
|
90
|
+
});
|
82
91
|
test('neither callback fires when not provided', function () {
|
83
92
|
var onClose = jest.fn();
|
84
93
|
getComponent({
|
@@ -137,4 +146,39 @@ test('triggerRef.current.focus() fires when provided', function () {
|
|
137
146
|
});
|
138
147
|
|
139
148
|
expect(focusFunction).toHaveBeenCalled();
|
149
|
+
});
|
150
|
+
test('triggerRef.current.focus() does not fire when key other than esc is pressed', function () {
|
151
|
+
var onClose = jest.fn();
|
152
|
+
var focusFunction = jest.fn();
|
153
|
+
var state = {
|
154
|
+
close: onClose
|
155
|
+
};
|
156
|
+
var triggerRef = {
|
157
|
+
current: {
|
158
|
+
focus: focusFunction
|
159
|
+
}
|
160
|
+
};
|
161
|
+
getComponent({
|
162
|
+
state: state,
|
163
|
+
children: (0, _react2.jsx)("div", null, "Test"),
|
164
|
+
triggerRef: triggerRef
|
165
|
+
});
|
166
|
+
|
167
|
+
var overlayPanel = _testWrapper.screen.getByTestId(testId);
|
168
|
+
|
169
|
+
_testWrapper.fireEvent.keyDown(overlayPanel, {
|
170
|
+
key: 'KeyA',
|
171
|
+
code: 'KeyA',
|
172
|
+
keyCode: 65,
|
173
|
+
charCode: 65
|
174
|
+
});
|
175
|
+
|
176
|
+
_testWrapper.fireEvent.keyUp(overlayPanel, {
|
177
|
+
key: 'KeyA',
|
178
|
+
code: 'KeyA',
|
179
|
+
keyCode: 65,
|
180
|
+
charCode: 65
|
181
|
+
});
|
182
|
+
|
183
|
+
expect(focusFunction).not.toHaveBeenCalled();
|
140
184
|
});
|
@@ -10,7 +10,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
10
10
|
value: true
|
11
11
|
});
|
12
12
|
|
13
|
-
exports.ControlledWithDebouncedInput = exports.
|
13
|
+
exports.ControlledWithDebouncedInput = exports.NoClearButton = exports.CustomIcon = exports.Controlled = exports.Default = exports["default"] = void 0;
|
14
14
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
16
16
|
|
@@ -137,20 +137,6 @@ var NoClearButton = function NoClearButton() {
|
|
137
137
|
|
138
138
|
exports.NoClearButton = NoClearButton;
|
139
139
|
|
140
|
-
var MaxLength = function MaxLength(args) {
|
141
|
-
return (0, _react2.jsx)(_index.SearchField, (0, _extends2["default"])({}, args, {
|
142
|
-
icon: _SearchIcon["default"],
|
143
|
-
"aria-label": "Search Groups",
|
144
|
-
onSubmit: function onSubmit(text) {
|
145
|
-
return alert(text);
|
146
|
-
} // eslint-disable-line no-alert
|
147
|
-
,
|
148
|
-
maxLength: 9
|
149
|
-
}));
|
150
|
-
};
|
151
|
-
|
152
|
-
exports.MaxLength = MaxLength;
|
153
|
-
|
154
140
|
var ControlledWithDebouncedInput = function ControlledWithDebouncedInput() {
|
155
141
|
var _useState3 = (0, _react.useState)(''),
|
156
142
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
@@ -10,7 +10,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
10
10
|
value: true
|
11
11
|
});
|
12
12
|
|
13
|
-
exports.MaxLength = exports.WithoutStatusIndicator = exports.
|
13
|
+
exports.MaxLength = exports.WithoutStatusIndicator = exports.Error = exports.Unresizable = exports.Rows = exports.Required = exports.ReadOnly = exports.Disabled = exports.Controlled = exports.FloatLabel = exports.Default = exports["default"] = void 0;
|
14
14
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
16
16
|
|
@@ -20,8 +20,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
20
20
|
|
21
21
|
var _ = _interopRequireDefault(require("."));
|
22
22
|
|
23
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
24
|
-
|
25
23
|
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
26
24
|
|
27
25
|
var _constants = require("../Label/constants");
|
@@ -101,37 +99,6 @@ var FloatLabel = function FloatLabel() {
|
|
101
99
|
|
102
100
|
exports.FloatLabel = FloatLabel;
|
103
101
|
|
104
|
-
var LeftLabel = function LeftLabel() {
|
105
|
-
return (0, _react2.jsx)(_Box["default"], {
|
106
|
-
gap: "xl",
|
107
|
-
width: "fit-content"
|
108
|
-
}, (0, _react2.jsx)(_["default"], {
|
109
|
-
label: "Example label",
|
110
|
-
labelMode: "left"
|
111
|
-
}), (0, _react2.jsx)(_["default"], {
|
112
|
-
label: "Example label that is much longer than the previous one",
|
113
|
-
labelMode: "left",
|
114
|
-
status: "error"
|
115
|
-
}), (0, _react2.jsx)(_["default"], {
|
116
|
-
label: "Example label with set width",
|
117
|
-
labelMode: "left",
|
118
|
-
containerProps: {
|
119
|
-
sx: {
|
120
|
-
gridTemplateColumns: '120px auto'
|
121
|
-
}
|
122
|
-
}
|
123
|
-
}));
|
124
|
-
};
|
125
|
-
|
126
|
-
exports.LeftLabel = LeftLabel;
|
127
|
-
LeftLabel.parameters = {
|
128
|
-
docs: {
|
129
|
-
description: {
|
130
|
-
story: 'Users are able to override the default 40% column width when using left label by providing a new gridTemplatesColumn value, as shown in the example below.'
|
131
|
-
}
|
132
|
-
}
|
133
|
-
};
|
134
|
-
|
135
102
|
var Controlled = function Controlled() {
|
136
103
|
var _useState = (0, _react.useState)(),
|
137
104
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
@@ -206,26 +173,6 @@ var Error = function Error() {
|
|
206
173
|
|
207
174
|
exports.Error = Error;
|
208
175
|
|
209
|
-
var Success = function Success() {
|
210
|
-
return (0, _react2.jsx)(_["default"], {
|
211
|
-
helperText: "Here is some helpful text...",
|
212
|
-
label: "Example Label",
|
213
|
-
status: "success"
|
214
|
-
});
|
215
|
-
};
|
216
|
-
|
217
|
-
exports.Success = Success;
|
218
|
-
|
219
|
-
var Warning = function Warning() {
|
220
|
-
return (0, _react2.jsx)(_["default"], {
|
221
|
-
helperText: "Here is some helpful text...",
|
222
|
-
label: "Example Label",
|
223
|
-
status: "warning"
|
224
|
-
});
|
225
|
-
};
|
226
|
-
|
227
|
-
exports.Warning = Warning;
|
228
|
-
|
229
176
|
var WithoutStatusIndicator = function WithoutStatusIndicator() {
|
230
177
|
return (0, _react2.jsx)(_["default"], {
|
231
178
|
label: "Example Label",
|
@@ -10,7 +10,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
10
10
|
value: true
|
11
11
|
});
|
12
12
|
|
13
|
-
exports.MaxLength = exports.WithoutStatusIndicator = exports.WithHelpHint = exports.Warning = exports.Success = exports.Error = exports.DynamicRequired = exports.Required = exports.ReadOnly = exports.Disabled = exports.Password = exports.Controlled = exports.LeftLabel = exports.FloatLabel = exports.SmallVariant = exports.Default = exports["default"] = void 0;
|
13
|
+
exports.WithSlots = exports.MaxLength = exports.WithoutStatusIndicator = exports.WithHelpHint = exports.Warning = exports.Success = exports.Error = exports.DynamicRequired = exports.Required = exports.ReadOnly = exports.Disabled = exports.Password = exports.Controlled = exports.LeftLabel = exports.FloatLabel = exports.SmallVariant = exports.Default = exports["default"] = void 0;
|
14
14
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
16
16
|
|
@@ -32,6 +32,10 @@ var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/s
|
|
32
32
|
|
33
33
|
var _Box = _interopRequireDefault(require("../Box"));
|
34
34
|
|
35
|
+
var _useCopyToClipboard = _interopRequireDefault(require("../../hooks/useCopyToClipboard"));
|
36
|
+
|
37
|
+
var _CopyButton = _interopRequireDefault(require("../CopyText/CopyButton"));
|
38
|
+
|
35
39
|
var _react2 = require("@emotion/react");
|
36
40
|
|
37
41
|
var _default = {
|
@@ -259,4 +263,77 @@ var MaxLength = function MaxLength() {
|
|
259
263
|
});
|
260
264
|
};
|
261
265
|
|
262
|
-
exports.MaxLength = MaxLength;
|
266
|
+
exports.MaxLength = MaxLength;
|
267
|
+
|
268
|
+
var WithSlots = function WithSlots() {
|
269
|
+
var _useState5 = (0, _react.useState)("[{ 'type': 'work', 'streetAddress': 'San Antonio MI 47096' },{ 'type': 'home', 'streetAddress': 'Santa Rosa MN 98804' }]"),
|
270
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
271
|
+
addressesValue = _useState6[0],
|
272
|
+
setAddressesValue = _useState6[1];
|
273
|
+
|
274
|
+
var _useState7 = (0, _react.useState)("[{ 'status': 'inactive', 'subject': 'example@pingidentity.com' },{ 'status': 'active', 'subject': 'john@pingidentity.com' }]"),
|
275
|
+
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
276
|
+
jsonValue = _useState8[0],
|
277
|
+
setJsonValue = _useState8[1];
|
278
|
+
|
279
|
+
var copyAddressesToClipboard = (0, _useCopyToClipboard["default"])(addressesValue);
|
280
|
+
var copyJsonToClipboard = (0, _useCopyToClipboard["default"])(jsonValue);
|
281
|
+
var buttonSx = {
|
282
|
+
position: 'absolute',
|
283
|
+
right: 0,
|
284
|
+
top: '5px'
|
285
|
+
};
|
286
|
+
var containerSx = {
|
287
|
+
sx: {
|
288
|
+
'& input': {
|
289
|
+
paddingRight: '40px'
|
290
|
+
}
|
291
|
+
}
|
292
|
+
};
|
293
|
+
return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_["default"], {
|
294
|
+
label: "Multiple Addresses",
|
295
|
+
labelMode: "float",
|
296
|
+
onChange: function onChange(e) {
|
297
|
+
return setAddressesValue(e.target.value);
|
298
|
+
},
|
299
|
+
value: addressesValue,
|
300
|
+
containerProps: containerSx,
|
301
|
+
slots: {
|
302
|
+
inContainer: (0, _react2.jsx)(_CopyButton["default"], {
|
303
|
+
onPress: copyAddressesToClipboard,
|
304
|
+
sx: buttonSx,
|
305
|
+
iconProps: {
|
306
|
+
sx: {
|
307
|
+
path: {
|
308
|
+
fill: 'active'
|
309
|
+
}
|
310
|
+
}
|
311
|
+
}
|
312
|
+
})
|
313
|
+
},
|
314
|
+
mb: 30
|
315
|
+
}), (0, _react2.jsx)(_["default"], {
|
316
|
+
label: "Example JSON",
|
317
|
+
labelMode: "float",
|
318
|
+
onChange: function onChange(e) {
|
319
|
+
return setJsonValue(e.target.value);
|
320
|
+
},
|
321
|
+
value: jsonValue,
|
322
|
+
containerProps: containerSx,
|
323
|
+
slots: {
|
324
|
+
inContainer: (0, _react2.jsx)(_CopyButton["default"], {
|
325
|
+
onPress: copyJsonToClipboard,
|
326
|
+
sx: buttonSx,
|
327
|
+
iconProps: {
|
328
|
+
sx: {
|
329
|
+
path: {
|
330
|
+
fill: 'active'
|
331
|
+
}
|
332
|
+
}
|
333
|
+
}
|
334
|
+
})
|
335
|
+
}
|
336
|
+
}));
|
337
|
+
};
|
338
|
+
|
339
|
+
exports.WithSlots = WithSlots;
|
@@ -17,8 +17,9 @@ var _react = require("react");
|
|
17
17
|
* e.g. "\`Component\` requires an aria-label."
|
18
18
|
*/
|
19
19
|
var useAriaLabelWarning = function useAriaLabelWarning(component, ariaLabel) {
|
20
|
+
var condition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
20
21
|
(0, _react.useEffect)(function () {
|
21
|
-
if (process.env.NODE_ENV === 'development' && !ariaLabel) {
|
22
|
+
if (process.env.NODE_ENV === 'development' && condition && !ariaLabel) {
|
22
23
|
// eslint-disable-next-line no-console
|
23
24
|
console.warn("".concat(component, " requires an aria-label"), '\n', '\n', 'NOTE: This is a development-only warning and will not display in production.');
|
24
25
|
}
|
@@ -574,7 +574,7 @@ var Default = function Default() {
|
|
574
574
|
mr: "md",
|
575
575
|
"aria-label": "Save Button"
|
576
576
|
}, "Save"), (0, _react2.jsx)(_index.Button, {
|
577
|
-
variant: "
|
577
|
+
variant: "link",
|
578
578
|
onPress: viewItem,
|
579
579
|
"aria-label": "Cancel Button"
|
580
580
|
}, "Cancel"))), editConfigurationVisible && (0, _react2.jsx)(_index.OverlayPanel, {
|
@@ -704,7 +704,7 @@ var Default = function Default() {
|
|
704
704
|
mr: "md",
|
705
705
|
"aria-label": "Save Button"
|
706
706
|
}, "Save"), (0, _react2.jsx)(_index.Button, {
|
707
|
-
variant: "
|
707
|
+
variant: "link",
|
708
708
|
onPress: viewItem,
|
709
709
|
"aria-label": "Cancel Button"
|
710
710
|
}, "Cancel"))), addItemVisible && (0, _react2.jsx)(_index.OverlayPanel, {
|
@@ -790,7 +790,7 @@ var Default = function Default() {
|
|
790
790
|
isRow: true,
|
791
791
|
sx: buttonBarStyles
|
792
792
|
}, (0, _react2.jsx)(_index.Button, {
|
793
|
-
variant: "
|
793
|
+
variant: "link",
|
794
794
|
onPress: resetListItem,
|
795
795
|
mr: "md",
|
796
796
|
"aria-label": "Cancel Button"
|
@@ -851,7 +851,7 @@ var Default = function Default() {
|
|
851
851
|
isRow: true,
|
852
852
|
sx: buttonBarStyles
|
853
853
|
}, (0, _react2.jsx)(_index.Button, {
|
854
|
-
variant: "
|
854
|
+
variant: "link",
|
855
855
|
onPress: resetListItem,
|
856
856
|
mr: "md"
|
857
857
|
}, "Cancel"), (0, _react2.jsx)(_index.Button, {
|
@@ -873,11 +873,11 @@ var Default = function Default() {
|
|
873
873
|
pt: "lg",
|
874
874
|
mr: "auto"
|
875
875
|
}, (0, _react2.jsx)(_index.Button, {
|
876
|
-
variant: "
|
876
|
+
variant: "critical",
|
877
877
|
mr: "md",
|
878
878
|
onPress: deleteItem
|
879
879
|
}, "Delete"), (0, _react2.jsx)(_index.Button, {
|
880
|
-
variant: "
|
880
|
+
variant: "link",
|
881
881
|
onPress: function onPress() {
|
882
882
|
return setIsDeleting(false);
|
883
883
|
}
|
@@ -118,7 +118,9 @@ var Default = function Default() {
|
|
118
118
|
setEditOverviewVisible = _React$useState4[1];
|
119
119
|
|
120
120
|
return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
|
121
|
-
onPress:
|
121
|
+
onPress: function onPress() {
|
122
|
+
return setStaticOverviewVisible(true);
|
123
|
+
}
|
122
124
|
}, "Open Panel"), staticOverviewVisible && (0, _react2.jsx)(_OverlayPanel["default"], {
|
123
125
|
isOpen: staticOverviewVisible
|
124
126
|
}, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Box, {
|
@@ -133,7 +135,9 @@ var Default = function Default() {
|
|
133
135
|
"aria-label": "edit",
|
134
136
|
variant: "inverted",
|
135
137
|
ml: "xs",
|
136
|
-
onPress:
|
138
|
+
onPress: function onPress() {
|
139
|
+
return setEditOverviewVisible(true);
|
140
|
+
}
|
137
141
|
}, (0, _react2.jsx)(_index.Icon, {
|
138
142
|
icon: _CreateIcon["default"],
|
139
143
|
size: 14
|
@@ -457,7 +461,7 @@ var Default = function Default() {
|
|
457
461
|
onPress: function onPress() {
|
458
462
|
return setEditOverviewVisible(false);
|
459
463
|
},
|
460
|
-
variant: "
|
464
|
+
variant: "link",
|
461
465
|
"aria-label": "cancel"
|
462
466
|
}, "Cancel"))))));
|
463
467
|
};
|
@@ -317,6 +317,11 @@ var helpHint = _objectSpread(_objectSpread({}, iconButton), {}, {
|
|
317
317
|
ml: '5px',
|
318
318
|
maxWidth: '13px',
|
319
319
|
maxHeight: '14px',
|
320
|
+
borderRadius: '5.5px',
|
321
|
+
'svg': {
|
322
|
+
'height': '100%',
|
323
|
+
mb: 0.75
|
324
|
+
},
|
320
325
|
'path': {
|
321
326
|
fill: 'neutral.20'
|
322
327
|
},
|
@@ -376,7 +381,7 @@ var chipDeleteButton = {
|
|
376
381
|
borderRadius: '50%',
|
377
382
|
cursor: 'pointer',
|
378
383
|
height: 14,
|
379
|
-
|
384
|
+
mx: '3px !important',
|
380
385
|
p: 0,
|
381
386
|
width: 14,
|
382
387
|
'&.is-focused, &.is-hovered': {
|
@@ -556,6 +561,75 @@ var tooltipInline = _objectSpread(_objectSpread({}, text), {}, {
|
|
556
561
|
}
|
557
562
|
});
|
558
563
|
|
564
|
+
var defaultVariant = _objectSpread(_objectSpread({}, base), {}, {
|
565
|
+
bg: 'white',
|
566
|
+
border: '1px solid',
|
567
|
+
borderColor: 'active',
|
568
|
+
'&.is-hovered': _objectSpread({}, defaultHover),
|
569
|
+
'&.is-pressed': _objectSpread({}, defaultActive),
|
570
|
+
'&.is-focused': _objectSpread({}, defaultFocus)
|
571
|
+
});
|
572
|
+
|
573
|
+
var filter = _objectSpread(_objectSpread({}, defaultVariant), {}, {
|
574
|
+
px: 'sm',
|
575
|
+
borderColor: 'neutral.80',
|
576
|
+
height: 40,
|
577
|
+
color: 'active',
|
578
|
+
display: 'flex'
|
579
|
+
});
|
580
|
+
|
581
|
+
var colorBlock = {
|
582
|
+
bg: 'neutral.95',
|
583
|
+
border: '1px solid',
|
584
|
+
borderColor: 'neutral.90',
|
585
|
+
borderRadius: 10,
|
586
|
+
outline: 'none',
|
587
|
+
cursor: 'pointer',
|
588
|
+
width: 150,
|
589
|
+
minHeight: 40,
|
590
|
+
p: '5px 15px',
|
591
|
+
display: 'flex',
|
592
|
+
justifyContent: 'space-between',
|
593
|
+
alignItems: 'center',
|
594
|
+
'&.is-hovered': {
|
595
|
+
bg: 'neutral.80'
|
596
|
+
},
|
597
|
+
'&.is-focused': _objectSpread({}, defaultFocus),
|
598
|
+
'&.is-pressed': {
|
599
|
+
bg: 'neutral.60',
|
600
|
+
borderColor: 'neutral.60'
|
601
|
+
},
|
602
|
+
'& span': {
|
603
|
+
color: 'text.primary',
|
604
|
+
textAlign: 'left'
|
605
|
+
},
|
606
|
+
'&>div': {
|
607
|
+
alignItems: 'baseline'
|
608
|
+
},
|
609
|
+
'&>svg': {
|
610
|
+
color: 'text.secondary',
|
611
|
+
fill: 'text.secondary'
|
612
|
+
},
|
613
|
+
'&.is-configured': {
|
614
|
+
bg: 'active',
|
615
|
+
borderColor: 'active',
|
616
|
+
'& span': {
|
617
|
+
color: 'white'
|
618
|
+
},
|
619
|
+
'&>svg': {
|
620
|
+
color: 'white',
|
621
|
+
fill: 'white'
|
622
|
+
}
|
623
|
+
},
|
624
|
+
'&.is-configured.is-hovered': {
|
625
|
+
bg: 'accent.40',
|
626
|
+
borderColor: 'accent.40'
|
627
|
+
},
|
628
|
+
'&.is-configured.is-pressed': {
|
629
|
+
bg: 'accent.20',
|
630
|
+
borderColor: 'accent.20'
|
631
|
+
}
|
632
|
+
};
|
559
633
|
var _default = {
|
560
634
|
accordionHeader: accordionHeader,
|
561
635
|
chipDeleteButton: chipDeleteButton,
|
@@ -576,6 +650,7 @@ var _default = {
|
|
576
650
|
environmentBreadcrumb: environmentBreadcrumb,
|
577
651
|
expandableRow: expandableRow,
|
578
652
|
fileInputField: fileInputField,
|
653
|
+
filter: filter,
|
579
654
|
iconButton: iconButton,
|
580
655
|
imageUpload: imageUpload,
|
581
656
|
inline: inline,
|
@@ -595,6 +670,7 @@ var _default = {
|
|
595
670
|
invertedSquare: invertedSquare,
|
596
671
|
tooltipChip: tooltipChip,
|
597
672
|
tooltipIconButton: tooltipIconButton,
|
598
|
-
tooltipInline: tooltipInline
|
673
|
+
tooltipInline: tooltipInline,
|
674
|
+
colorBlock: colorBlock
|
599
675
|
};
|
600
676
|
exports["default"] = _default;
|
@@ -178,6 +178,20 @@ var text = {
|
|
178
178
|
color: 'accent.30',
|
179
179
|
fontFamily: 'standard'
|
180
180
|
}),
|
181
|
+
buttonTitle: _objectSpread(_objectSpread({}, wordWrap), {}, {
|
182
|
+
fontSize: 'xs',
|
183
|
+
fontWeight: 0,
|
184
|
+
color: 'text.primary',
|
185
|
+
fontFamily: 'standard',
|
186
|
+
lineHeight: '13px'
|
187
|
+
}),
|
188
|
+
buttonSubtitle: _objectSpread(_objectSpread({}, wordWrap), {}, {
|
189
|
+
fontSize: 'sm',
|
190
|
+
fontWeight: 3,
|
191
|
+
color: 'text.primary',
|
192
|
+
fontFamily: 'standard',
|
193
|
+
lineHeight: '16px'
|
194
|
+
}),
|
181
195
|
capsLabel: _objectSpread(_objectSpread({}, wordWrap), {}, {
|
182
196
|
color: 'text.secondary',
|
183
197
|
textTransform: 'uppercase',
|
@@ -41,15 +41,15 @@ export var Default = function Default(args) {
|
|
41
41
|
onAction: onAction
|
42
42
|
}, args), ___EmotionJSX(Item, {
|
43
43
|
key: "home",
|
44
|
-
variant: "
|
44
|
+
variant: "link",
|
45
45
|
"data-id": "home"
|
46
46
|
}, "Home"), ___EmotionJSX(Item, {
|
47
47
|
key: "trendy",
|
48
|
-
variant: "
|
48
|
+
variant: "link",
|
49
49
|
"data-id": "trendy"
|
50
50
|
}, "Trendy"), ___EmotionJSX(Item, {
|
51
51
|
key: "march 2020 assets",
|
52
|
-
variant: "
|
52
|
+
variant: "link",
|
53
53
|
"data-id": "march"
|
54
54
|
}, "March 2020 Assets"));
|
55
55
|
};
|
@@ -21,7 +21,7 @@ import { useButton } from '@react-aria/button';
|
|
21
21
|
import { useHover } from '@react-aria/interactions';
|
22
22
|
import { useFocusRing } from '@react-aria/focus';
|
23
23
|
import { mergeProps } from '@react-aria/utils';
|
24
|
-
import { useStatusClasses, usePropWarning } from '../../hooks';
|
24
|
+
import { useStatusClasses, usePropWarning, useAriaLabelWarning, useDeprecationWarning } from '../../hooks';
|
25
25
|
import Loader from '../Loader';
|
26
26
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
27
27
|
var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
@@ -37,7 +37,8 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
37
37
|
onPressChange = props.onPressChange,
|
38
38
|
onPressUp = props.onPressUp,
|
39
39
|
children = props.children,
|
40
|
-
|
40
|
+
variant = props.variant,
|
41
|
+
others = _objectWithoutProperties(props, ["className", "isDisabled", "isLoading", "onHoverStart", "onHoverChange", "onHoverEnd", "onPress", "onPressStart", "onPressEnd", "onPressChange", "onPressUp", "children", "variant"]);
|
41
42
|
|
42
43
|
var buttonRef = useRef();
|
43
44
|
usePropWarning(props, 'disabled', 'isDisabled');
|
@@ -69,7 +70,17 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
69
70
|
}),
|
70
71
|
classNames = _useStatusClasses.classNames;
|
71
72
|
|
73
|
+
useDeprecationWarning('The "icon" variant for `Button` is deprecated in Astro-UI 1.0.0, use the `IconButton` component instead.', {
|
74
|
+
isActive: props.variant === 'icon'
|
75
|
+
});
|
76
|
+
useDeprecationWarning('The "danger" variant for `Button` will be deprecated in Astro-UI 2.0.0, use the `critical` variant instead.', {
|
77
|
+
isActive: props.variant === 'danger'
|
78
|
+
});
|
79
|
+
useDeprecationWarning('The "text" variant for `Button` will be deprecated in Astro-UI 2.0.0, use the `link` variant instead.', {
|
80
|
+
isActive: props.variant === 'text'
|
81
|
+
});
|
72
82
|
var ariaLabel = props['aria-label'];
|
83
|
+
useAriaLabelWarning('Button', ariaLabel, variant === 'filter');
|
73
84
|
return ___EmotionJSX(ThemeUIButton, _extends({
|
74
85
|
"aria-label": ariaLabel,
|
75
86
|
ref: buttonRef,
|
@@ -80,7 +91,8 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
80
91
|
display: 'flex',
|
81
92
|
justifyContent: 'center',
|
82
93
|
alignItems: 'center'
|
83
|
-
}
|
94
|
+
},
|
95
|
+
variant: variant
|
84
96
|
}, others, mergeProps(hoverProps, focusProps, buttonProps)), isLoading ? ___EmotionJSX("span", {
|
85
97
|
style: {
|
86
98
|
visibility: 'hidden'
|