@pingux/astro 2.30.0-alpha.2 → 2.30.0-alpha.4
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/hooks/useAriaLabelWarning/index.d.ts +1 -0
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.d.ts +9 -0
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.js +0 -4
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.test.d.ts +1 -0
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.test.js +1 -3
- package/lib/cjs/hooks/useDevelopmentWarning/index.d.ts +1 -0
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.d.ts +11 -0
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.js +0 -3
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.test.d.ts +1 -0
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.test.js +1 -3
- package/lib/cjs/recipes/{CollapsiblePanel.stories.hidden.js → CollapsiblePanel.stories.js} +22 -43
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.js +0 -5
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.test.js +1 -3
- package/lib/hooks/useDevelopmentWarning/useDevelopmentWarning.js +0 -4
- package/lib/hooks/useDevelopmentWarning/useDevelopmentWarning.test.js +1 -3
- package/lib/recipes/{CollapsiblePanel.stories.hidden.js → CollapsiblePanel.stories.js} +23 -44
- package/package.json +2 -2
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './useAriaLabelWarning';
|
@@ -0,0 +1,9 @@
|
|
1
|
+
interface UseAriaLabelWarning {
|
2
|
+
/**
|
3
|
+
* Provides a development-only console warning when a component
|
4
|
+
* that needs an aria-label is mounted without one.
|
5
|
+
*/
|
6
|
+
(component: string, ariaLabel?: string, shouldTrigger?: boolean): void;
|
7
|
+
}
|
8
|
+
declare const useAriaLabelWarning: UseAriaLabelWarning;
|
9
|
+
export default useAriaLabelWarning;
|
@@ -7,10 +7,6 @@ _Object$defineProperty(exports, "__esModule", {
|
|
7
7
|
});
|
8
8
|
exports["default"] = void 0;
|
9
9
|
var _useDevelopmentWarning = _interopRequireDefault(require("../useDevelopmentWarning"));
|
10
|
-
/**
|
11
|
-
* Provides a development-only console warning when a component
|
12
|
-
* that needs an aria-label is mounted without one.
|
13
|
-
*/
|
14
10
|
var useAriaLabelWarning = function useAriaLabelWarning(component, ariaLabel) {
|
15
11
|
var shouldTrigger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
16
12
|
var message = "".concat(component, " has an undefined aria-label. If the surrounding content sufficiently labels this component instance, you may disable this warning by setting the prop to `null`. Otherwise, please provide an appropriate aria-label. See more info here: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label");
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -6,9 +6,7 @@ var _useAriaLabelWarning = _interopRequireDefault(require("./useAriaLabelWarning
|
|
6
6
|
var component = 'TestComponent';
|
7
7
|
beforeEach(function () {
|
8
8
|
process.env.NODE_ENV = 'development';
|
9
|
-
global.console.warn =
|
10
|
-
return jest.mock();
|
11
|
-
}; // eslint-disable-line no-console
|
9
|
+
global.console.warn = jest.fn(); // eslint-disable-line no-console
|
12
10
|
});
|
13
11
|
|
14
12
|
afterEach(function () {
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './useDevelopmentWarning';
|
@@ -0,0 +1,11 @@
|
|
1
|
+
interface UseDevelopmentWarning {
|
2
|
+
/**
|
3
|
+
* Provides a development-only console warning.
|
4
|
+
*/
|
5
|
+
({ message, shouldTrigger }: {
|
6
|
+
message: string;
|
7
|
+
shouldTrigger: boolean;
|
8
|
+
}): void;
|
9
|
+
}
|
10
|
+
declare const useDevelopmentWarning: UseDevelopmentWarning;
|
11
|
+
export default useDevelopmentWarning;
|
@@ -6,9 +6,6 @@ _Object$defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports["default"] = void 0;
|
8
8
|
var _react = require("react");
|
9
|
-
/**
|
10
|
-
* Provides a development-only console warning.
|
11
|
-
*/
|
12
9
|
var useDevelopmentWarning = function useDevelopmentWarning(_ref) {
|
13
10
|
var message = _ref.message,
|
14
11
|
shouldTrigger = _ref.shouldTrigger;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -6,9 +6,7 @@ var _useDevelopmentWarning = _interopRequireDefault(require("./useDevelopmentWar
|
|
6
6
|
var message = 'This is test message';
|
7
7
|
beforeEach(function () {
|
8
8
|
process.env.NODE_ENV = 'development';
|
9
|
-
global.console.warn =
|
10
|
-
return jest.mock();
|
11
|
-
}; // eslint-disable-line no-console
|
9
|
+
global.console.warn = jest.fn(); // eslint-disable-line no-console
|
12
10
|
});
|
13
11
|
|
14
12
|
afterEach(function () {
|
@@ -108,9 +108,6 @@ var data = [{
|
|
108
108
|
var sx = {
|
109
109
|
listViewItem: {
|
110
110
|
bg: 'white',
|
111
|
-
width: '100%',
|
112
|
-
justifyContent: 'space-between',
|
113
|
-
alignItems: 'center',
|
114
111
|
'&.is-hovered': {
|
115
112
|
bg: 'accent.99'
|
116
113
|
}
|
@@ -122,8 +119,7 @@ var sx = {
|
|
122
119
|
minHeight: 22,
|
123
120
|
justifyContent: 'center',
|
124
121
|
alignItems: 'center',
|
125
|
-
p: 'xs'
|
126
|
-
maxWidth: '50%'
|
122
|
+
p: 'xs'
|
127
123
|
},
|
128
124
|
defaultSelectedTitle: {
|
129
125
|
fontSize: 'sm',
|
@@ -237,48 +233,31 @@ var Default = function Default() {
|
|
237
233
|
mr: "sm",
|
238
234
|
onChange: setSearchValue
|
239
235
|
}), (0, _react2.jsx)(_index.ListView, {
|
240
|
-
items: filteredItems
|
241
|
-
style: {
|
242
|
-
width: '100%',
|
243
|
-
outline: 'none'
|
244
|
-
}
|
236
|
+
items: filteredItems
|
245
237
|
}, function (item) {
|
246
238
|
return (0, _react2.jsx)(_index.Item, {
|
247
239
|
key: item.key,
|
248
240
|
textValue: item.name,
|
249
|
-
"data-id": item.key
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
isRow: true
|
268
|
-
}, (0, _react2.jsx)(_index.Text, {
|
269
|
-
variant: "listTitle",
|
270
|
-
mb: "xs",
|
271
|
-
mr: "xs"
|
272
|
-
}, item.name), (0, _react2.jsx)(_index.Badge, {
|
273
|
-
label: item.badgeValue,
|
274
|
-
bg: "accent.99",
|
275
|
-
textColor: "text.secondary",
|
276
|
-
sx: {
|
277
|
-
minWidth: 'max-content'
|
241
|
+
"data-id": item.key
|
242
|
+
}, (0, _react2.jsx)(_index.ListViewItem, {
|
243
|
+
sx: sx.listViewItem,
|
244
|
+
data: {
|
245
|
+
icon: _AccountGroupIcon["default"],
|
246
|
+
text: item.name,
|
247
|
+
subtext: item.subtitle
|
248
|
+
},
|
249
|
+
slots: {
|
250
|
+
rightOfData: (0, _react2.jsx)(_index.Badge, {
|
251
|
+
label: item.badgeValue,
|
252
|
+
bg: "accent.99",
|
253
|
+
textColor: "text.secondary",
|
254
|
+
sx: {
|
255
|
+
minWidth: 'max-content'
|
256
|
+
},
|
257
|
+
ml: "xs"
|
258
|
+
})
|
278
259
|
}
|
279
|
-
}
|
280
|
-
variant: "listSubtitle"
|
281
|
-
}, item.subtitle))), item.isDefaultSelected ? (0, _react2.jsx)(_index.Box, {
|
260
|
+
}, item.isDefaultSelected ? (0, _react2.jsx)(_index.Box, {
|
282
261
|
isRow: true,
|
283
262
|
sx: sx.defaultSelectedBox
|
284
263
|
}, (0, _react2.jsx)(_index.Icon, {
|
@@ -308,7 +287,7 @@ var Default = function Default() {
|
|
308
287
|
onClick: function onClick() {
|
309
288
|
return checkBoxRef.current.focus();
|
310
289
|
}
|
311
|
-
}));
|
290
|
+
})));
|
312
291
|
})), (0, _react2.jsx)(_index.CollapsiblePanel, {
|
313
292
|
items: selectedItems,
|
314
293
|
selectedFilterCount: selectedItems.length.toString(),
|
@@ -1,9 +1,4 @@
|
|
1
1
|
import useDevelopmentWarning from '../useDevelopmentWarning';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Provides a development-only console warning when a component
|
5
|
-
* that needs an aria-label is mounted without one.
|
6
|
-
*/
|
7
2
|
var useAriaLabelWarning = function useAriaLabelWarning(component, ariaLabel) {
|
8
3
|
var shouldTrigger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
9
4
|
var message = "".concat(component, " has an undefined aria-label. If the surrounding content sufficiently labels this component instance, you may disable this warning by setting the prop to `null`. Otherwise, please provide an appropriate aria-label. See more info here: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label");
|
@@ -3,9 +3,7 @@ import useAriaLabelWarning from './useAriaLabelWarning';
|
|
3
3
|
var component = 'TestComponent';
|
4
4
|
beforeEach(function () {
|
5
5
|
process.env.NODE_ENV = 'development';
|
6
|
-
global.console.warn =
|
7
|
-
return jest.mock();
|
8
|
-
}; // eslint-disable-line no-console
|
6
|
+
global.console.warn = jest.fn(); // eslint-disable-line no-console
|
9
7
|
});
|
10
8
|
|
11
9
|
afterEach(function () {
|
@@ -3,9 +3,7 @@ import useDevelopmentWarning from './useDevelopmentWarning';
|
|
3
3
|
var message = 'This is test message';
|
4
4
|
beforeEach(function () {
|
5
5
|
process.env.NODE_ENV = 'development';
|
6
|
-
global.console.warn =
|
7
|
-
return jest.mock();
|
8
|
-
}; // eslint-disable-line no-console
|
6
|
+
global.console.warn = jest.fn(); // eslint-disable-line no-console
|
9
7
|
});
|
10
8
|
|
11
9
|
afterEach(function () {
|
@@ -21,7 +21,7 @@ import ChevronRightIcon from '@pingux/mdi-react/ChevronRightIcon';
|
|
21
21
|
import Clear from '@pingux/mdi-react/CloseIcon';
|
22
22
|
import SearchIcon from '@pingux/mdi-react/SearchIcon';
|
23
23
|
import { useFilter } from '@react-aria/i18n';
|
24
|
-
import { Badge, Box, Breadcrumbs, CheckboxField, CollapsiblePanel, CollapsiblePanelItem, Icon, IconButton, Item, ListView, SearchField, Text } from '../index';
|
24
|
+
import { Badge, Box, Breadcrumbs, CheckboxField, CollapsiblePanel, CollapsiblePanelItem, Icon, IconButton, Item, ListView, ListViewItem, SearchField, Text } from '../index';
|
25
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
26
26
|
export default {
|
27
27
|
title: 'Recipes/CollapsiblePanel with List'
|
@@ -95,9 +95,6 @@ var data = [{
|
|
95
95
|
var sx = {
|
96
96
|
listViewItem: {
|
97
97
|
bg: 'white',
|
98
|
-
width: '100%',
|
99
|
-
justifyContent: 'space-between',
|
100
|
-
alignItems: 'center',
|
101
98
|
'&.is-hovered': {
|
102
99
|
bg: 'accent.99'
|
103
100
|
}
|
@@ -109,8 +106,7 @@ var sx = {
|
|
109
106
|
minHeight: 22,
|
110
107
|
justifyContent: 'center',
|
111
108
|
alignItems: 'center',
|
112
|
-
p: 'xs'
|
113
|
-
maxWidth: '50%'
|
109
|
+
p: 'xs'
|
114
110
|
},
|
115
111
|
defaultSelectedTitle: {
|
116
112
|
fontSize: 'sm',
|
@@ -224,48 +220,31 @@ export var Default = function Default() {
|
|
224
220
|
mr: "sm",
|
225
221
|
onChange: setSearchValue
|
226
222
|
}), ___EmotionJSX(ListView, {
|
227
|
-
items: filteredItems
|
228
|
-
style: {
|
229
|
-
width: '100%',
|
230
|
-
outline: 'none'
|
231
|
-
}
|
223
|
+
items: filteredItems
|
232
224
|
}, function (item) {
|
233
225
|
return ___EmotionJSX(Item, {
|
234
226
|
key: item.key,
|
235
227
|
textValue: item.name,
|
236
|
-
"data-id": item.key
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
isRow: true
|
255
|
-
}, ___EmotionJSX(Text, {
|
256
|
-
variant: "listTitle",
|
257
|
-
mb: "xs",
|
258
|
-
mr: "xs"
|
259
|
-
}, item.name), ___EmotionJSX(Badge, {
|
260
|
-
label: item.badgeValue,
|
261
|
-
bg: "accent.99",
|
262
|
-
textColor: "text.secondary",
|
263
|
-
sx: {
|
264
|
-
minWidth: 'max-content'
|
228
|
+
"data-id": item.key
|
229
|
+
}, ___EmotionJSX(ListViewItem, {
|
230
|
+
sx: sx.listViewItem,
|
231
|
+
data: {
|
232
|
+
icon: AccountGroupIcon,
|
233
|
+
text: item.name,
|
234
|
+
subtext: item.subtitle
|
235
|
+
},
|
236
|
+
slots: {
|
237
|
+
rightOfData: ___EmotionJSX(Badge, {
|
238
|
+
label: item.badgeValue,
|
239
|
+
bg: "accent.99",
|
240
|
+
textColor: "text.secondary",
|
241
|
+
sx: {
|
242
|
+
minWidth: 'max-content'
|
243
|
+
},
|
244
|
+
ml: "xs"
|
245
|
+
})
|
265
246
|
}
|
266
|
-
}
|
267
|
-
variant: "listSubtitle"
|
268
|
-
}, item.subtitle))), item.isDefaultSelected ? ___EmotionJSX(Box, {
|
247
|
+
}, item.isDefaultSelected ? ___EmotionJSX(Box, {
|
269
248
|
isRow: true,
|
270
249
|
sx: sx.defaultSelectedBox
|
271
250
|
}, ___EmotionJSX(Icon, {
|
@@ -295,7 +274,7 @@ export var Default = function Default() {
|
|
295
274
|
onClick: function onClick() {
|
296
275
|
return checkBoxRef.current.focus();
|
297
276
|
}
|
298
|
-
}));
|
277
|
+
})));
|
299
278
|
})), ___EmotionJSX(CollapsiblePanel, {
|
300
279
|
items: selectedItems,
|
301
280
|
selectedFilterCount: selectedItems.length.toString(),
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pingux/astro",
|
3
|
-
"version": "2.30.0-alpha.
|
3
|
+
"version": "2.30.0-alpha.4",
|
4
4
|
"description": "React component library for Ping Identity's design system",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -136,7 +136,7 @@
|
|
136
136
|
"@storybook/theming": "^7.1.0",
|
137
137
|
"@testing-library/jest-dom": "^5.11.4",
|
138
138
|
"@testing-library/react": "^11.0.4",
|
139
|
-
"@testing-library/react-hooks": "^
|
139
|
+
"@testing-library/react-hooks": "^8.0.1",
|
140
140
|
"@testing-library/user-event": "^12.8.3",
|
141
141
|
"@types/jest": "^29.5.3",
|
142
142
|
"@types/mdx": "^2.0.5",
|