@pingux/astro 1.27.0-alpha.0 → 1.27.0-alpha.1

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.
@@ -207,26 +207,26 @@ var Controlled = function Controlled() {
207
207
  fieldValues = _React$useState2[0],
208
208
  setFieldValues = _React$useState2[1];
209
209
 
210
- function handleOnChange(values) {
210
+ var handleOnChange = function handleOnChange(values) {
211
211
  setFieldValues(values);
212
- }
212
+ };
213
213
 
214
- function handleOnAdd() {
214
+ var handleOnAdd = function handleOnAdd() {
215
215
  setFieldValues(function (oldValues) {
216
216
  var _context;
217
217
 
218
218
  return (0, _concat["default"])(_context = []).call(_context, oldValues, [defaultEmptyField]);
219
219
  });
220
- }
220
+ };
221
221
 
222
- function handleOnDelete(fieldId) {
222
+ var handleOnDelete = function handleOnDelete(fieldId) {
223
223
  setFieldValues(function (oldValues) {
224
224
  return (0, _filter["default"])(oldValues).call(oldValues, function (_ref2) {
225
225
  var id = _ref2.id;
226
226
  return id !== fieldId;
227
227
  });
228
228
  });
229
- }
229
+ };
230
230
 
231
231
  return (0, _react2.jsx)(_index.ArrayField, {
232
232
  value: fieldValues,
@@ -230,7 +230,10 @@ var FileInputField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
230
230
  variant: "boxes.fileInputFieldWrapper"
231
231
  }, (0, _utils.mergeProps)(fieldContainerProps, others), {
232
232
  className: classNames
233
- }, getRootProps()), (0, _react2.jsx)(_index.Input, (0, _extends2["default"])({}, (0, _utils.mergeProps)(visuallyHiddenProps, fieldControlProps, getInputProps()), {
233
+ }, getRootProps(), {
234
+ // to pass accessibility test, this removes focusable dependents
235
+ role: "none"
236
+ }), (0, _react2.jsx)(_index.Input, (0, _extends2["default"])({}, (0, _utils.mergeProps)(visuallyHiddenProps, fieldControlProps, getInputProps()), {
234
237
  "aria-label": "File Input",
235
238
  multiple: isMultiple,
236
239
  onChange: handleOnChange,
@@ -294,8 +297,8 @@ FileInputField.propTypes = {
294
297
  * */
295
298
  fileList: _propTypes["default"].arrayOf(_propTypes["default"].shape({
296
299
  fileObj: _propTypes["default"].shape({}),
297
- id: _propTypes["default"].string.required,
298
- name: _propTypes["default"].string.required,
300
+ id: _propTypes["default"].string.isRequired,
301
+ name: _propTypes["default"].string.isRequired,
299
302
  downloadLink: _propTypes["default"].string,
300
303
  status: _propTypes["default"].oneOf((0, _values["default"])(_statuses["default"]))
301
304
  })),
@@ -303,8 +306,8 @@ FileInputField.propTypes = {
303
306
  /** Default array of objects for uploaded files. */
304
307
  defaultFileList: _propTypes["default"].arrayOf(_propTypes["default"].shape({
305
308
  fileObj: _propTypes["default"].shape({}),
306
- id: _propTypes["default"].string.required,
307
- name: _propTypes["default"].string.required,
309
+ id: _propTypes["default"].string.isRequired,
310
+ name: _propTypes["default"].string.isRequired,
308
311
  downloadLink: _propTypes["default"].string,
309
312
  status: _propTypes["default"].oneOf((0, _values["default"])(_statuses["default"]))
310
313
  })),
@@ -168,7 +168,7 @@ LinkSelectField.propTypes = {
168
168
  * *For performance reasons, use this prop instead of Array.map when iteratively rendering Items*.
169
169
  * For use with [dynamic collections](https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections).
170
170
  */
171
- items: _propTypes["default"].arrayOf(_propTypes["default"].any),
171
+ items: _propTypes["default"].arrayOf(_propTypes["default"].shape({})),
172
172
 
173
173
  /** The label for the select element. */
174
174
  label: _propTypes["default"].node,
@@ -124,7 +124,10 @@ Option.propTypes = {
124
124
  hasVirtualFocus: _propTypes["default"].bool,
125
125
  item: _propTypes["default"].shape({
126
126
  key: _propTypes["default"].string,
127
- props: _propTypes["default"].shape({}),
127
+ props: _propTypes["default"].shape({
128
+ 'data-id': _propTypes["default"].string,
129
+ isSeparator: _propTypes["default"].bool
130
+ }),
128
131
  rendered: _propTypes["default"].node
129
132
  }),
130
133
  state: _propTypes["default"].shape({
@@ -174,7 +174,8 @@ MenuItem.propTypes = {
174
174
  key: _propTypes["default"].string,
175
175
  props: _propTypes["default"].shape({
176
176
  'data-id': _propTypes["default"].string,
177
- isSeparator: _propTypes["default"].bool
177
+ isSeparator: _propTypes["default"].bool,
178
+ isPressed: _propTypes["default"].bool
178
179
  }),
179
180
  rendered: _propTypes["default"].node,
180
181
  isDisabled: _propTypes["default"].bool
@@ -184,7 +184,8 @@ Message.propTypes = {
184
184
  icon: _propTypes["default"].elementType,
185
185
 
186
186
  /* Hides the message with an animated transition */
187
- isHidden: _propTypes["default"].bool
187
+ isHidden: _propTypes["default"].bool,
188
+ 'data-id': _propTypes["default"].string
188
189
  })
189
190
  }),
190
191
 
@@ -104,7 +104,7 @@ SelectField.propTypes = {
104
104
  * *For performance reasons, use this prop instead of Array.map when iteratively rendering Items*.
105
105
  * For use with [dynamic collections](https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections).
106
106
  */
107
- items: _propTypes["default"].arrayOf(_propTypes["default"].any),
107
+ items: _propTypes["default"].arrayOf(_propTypes["default"].shape({})),
108
108
 
109
109
  /** The label for the select element. */
110
110
  label: _propTypes["default"].node,
@@ -46,7 +46,7 @@ var _ = require("../..");
46
46
 
47
47
  var _react2 = require("@emotion/react");
48
48
 
49
- var _excluded = ["icon", "isDisabled", "separator", "tabLabelProps", "tabLineProps", "content", "titleAttr"];
49
+ var _excluded = ["icon", "isDisabled", "separator", "tabLabelProps", "tabLineProps", "content", "titleAttr", "title"];
50
50
 
51
51
  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); }
52
52
 
@@ -74,6 +74,7 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
74
74
  tabLineProps = itemProps.tabLineProps,
75
75
  content = itemProps.content,
76
76
  titleAttr = itemProps.titleAttr,
77
+ title = itemProps.title,
77
78
  otherItemProps = (0, _objectWithoutProperties2["default"])(itemProps, _excluded);
78
79
  var state = (0, _react.useContext)(_Tabs.TabsContext);
79
80
  var isDisabled = tabsDisabled || tabDisabled || state.disabledKeys.has(key);
@@ -149,9 +150,19 @@ CollectionTab.propTypes = {
149
150
  isDisabled: _propTypes["default"].bool,
150
151
  item: _propTypes["default"].shape({
151
152
  key: _propTypes["default"].string,
152
- props: _propTypes["default"].shape({}),
153
- rendered: _propTypes["default"].node,
154
- tabLineProps: _propTypes["default"].shape({})
153
+ props: _propTypes["default"].shape({
154
+ icon: _propTypes["default"].shape({}),
155
+ isDisabled: _propTypes["default"].bool,
156
+ textValue: _propTypes["default"].string,
157
+ tabLineProps: _propTypes["default"].shape({}),
158
+ tabLabelProps: _propTypes["default"].shape({}),
159
+ content: _propTypes["default"].shape({}),
160
+ titleAttr: _propTypes["default"].string,
161
+ title: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].string, _propTypes["default"].object]),
162
+ separator: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].bool]),
163
+ list: _propTypes["default"].arrayOf(_propTypes["default"].shape({}))
164
+ }),
165
+ rendered: _propTypes["default"].node
155
166
  }),
156
167
  mode: _propTypes["default"].oneOf(['default', 'tooltip', 'list']),
157
168
  orientation: _propTypes["default"].oneOf(['horizontal', 'vertical']),
@@ -246,10 +246,10 @@ TabPicker.propTypes = {
246
246
  state: _propTypes["default"].shape({
247
247
  collection: _propTypes["default"].shape({}),
248
248
  selectedKey: _propTypes["default"].string,
249
- setSelectedKey: _propTypes["default"]["function"],
249
+ setSelectedKey: _propTypes["default"].func,
250
250
  selectionManager: _propTypes["default"].shape({
251
251
  focusedKey: _propTypes["default"].string,
252
- setFocusedKey: _propTypes["default"]["function"]
252
+ setFocusedKey: _propTypes["default"].func
253
253
  })
254
254
  })
255
255
  };
@@ -12,7 +12,7 @@ test('default useOverlayPanelState', function () {
12
12
  }),
13
13
  result = _renderHook.result;
14
14
 
15
- expect(result.current).toEqual(expect.objectContaining({
15
+ var obj = {
16
16
  state: {
17
17
  open: expect.any(Function),
18
18
  close: expect.any(Function),
@@ -20,5 +20,6 @@ test('default useOverlayPanelState', function () {
20
20
  isOpen: expect.any(Boolean)
21
21
  },
22
22
  onClose: expect.any(Function)
23
- }));
23
+ };
24
+ expect(result.current).toEqual(obj);
24
25
  });
@@ -143,7 +143,15 @@ var useSelectField = function useSelectField(props, ref) {
143
143
  labelProps = _useSelect.labelProps,
144
144
  triggerProps = _useSelect.triggerProps,
145
145
  valueProps = _useSelect.valueProps,
146
- menuProps = _useSelect.menuProps;
146
+ menuProps = _useSelect.menuProps; // The following props are being passed into multiple
147
+ // DOM elements that leads to multiple test failures
148
+ // and these props are never used in any components
149
+ // that depend on useSelectField
150
+
151
+
152
+ delete menuProps.shouldSelectOnPressUp;
153
+ delete menuProps.shouldFocusOnHover;
154
+ delete menuProps.disallowEmptySelection;
147
155
 
148
156
  var _useField = (0, _.useField)(_objectSpread(_objectSpread({}, props), {}, {
149
157
  placeholder: props.labelMode === _constants.modes.FLOAT ? '' : placeholder,
@@ -182,26 +182,26 @@ export var Controlled = function Controlled() {
182
182
  fieldValues = _React$useState2[0],
183
183
  setFieldValues = _React$useState2[1];
184
184
 
185
- function handleOnChange(values) {
185
+ var handleOnChange = function handleOnChange(values) {
186
186
  setFieldValues(values);
187
- }
187
+ };
188
188
 
189
- function handleOnAdd() {
189
+ var handleOnAdd = function handleOnAdd() {
190
190
  setFieldValues(function (oldValues) {
191
191
  var _context;
192
192
 
193
193
  return _concatInstanceProperty(_context = []).call(_context, oldValues, [defaultEmptyField]);
194
194
  });
195
- }
195
+ };
196
196
 
197
- function handleOnDelete(fieldId) {
197
+ var handleOnDelete = function handleOnDelete(fieldId) {
198
198
  setFieldValues(function (oldValues) {
199
199
  return _filterInstanceProperty(oldValues).call(oldValues, function (_ref2) {
200
200
  var id = _ref2.id;
201
201
  return id !== fieldId;
202
202
  });
203
203
  });
204
- }
204
+ };
205
205
 
206
206
  return ___EmotionJSX(ArrayField, {
207
207
  value: fieldValues,
@@ -180,7 +180,10 @@ var FileInputField = /*#__PURE__*/forwardRef(function (props, ref) {
180
180
  variant: "boxes.fileInputFieldWrapper"
181
181
  }, mergeProps(fieldContainerProps, others), {
182
182
  className: classNames
183
- }, getRootProps()), ___EmotionJSX(Input, _extends({}, mergeProps(visuallyHiddenProps, fieldControlProps, getInputProps()), {
183
+ }, getRootProps(), {
184
+ // to pass accessibility test, this removes focusable dependents
185
+ role: "none"
186
+ }), ___EmotionJSX(Input, _extends({}, mergeProps(visuallyHiddenProps, fieldControlProps, getInputProps()), {
184
187
  "aria-label": "File Input",
185
188
  multiple: isMultiple,
186
189
  onChange: handleOnChange,
@@ -244,8 +247,8 @@ FileInputField.propTypes = {
244
247
  * */
245
248
  fileList: PropTypes.arrayOf(PropTypes.shape({
246
249
  fileObj: PropTypes.shape({}),
247
- id: PropTypes.string.required,
248
- name: PropTypes.string.required,
250
+ id: PropTypes.string.isRequired,
251
+ name: PropTypes.string.isRequired,
249
252
  downloadLink: PropTypes.string,
250
253
  status: PropTypes.oneOf(_Object$values(statuses))
251
254
  })),
@@ -253,8 +256,8 @@ FileInputField.propTypes = {
253
256
  /** Default array of objects for uploaded files. */
254
257
  defaultFileList: PropTypes.arrayOf(PropTypes.shape({
255
258
  fileObj: PropTypes.shape({}),
256
- id: PropTypes.string.required,
257
- name: PropTypes.string.required,
259
+ id: PropTypes.string.isRequired,
260
+ name: PropTypes.string.isRequired,
258
261
  downloadLink: PropTypes.string,
259
262
  status: PropTypes.oneOf(_Object$values(statuses))
260
263
  })),
@@ -131,7 +131,7 @@ LinkSelectField.propTypes = {
131
131
  * *For performance reasons, use this prop instead of Array.map when iteratively rendering Items*.
132
132
  * For use with [dynamic collections](https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections).
133
133
  */
134
- items: PropTypes.arrayOf(PropTypes.any),
134
+ items: PropTypes.arrayOf(PropTypes.shape({})),
135
135
 
136
136
  /** The label for the select element. */
137
137
  label: PropTypes.node,
@@ -86,7 +86,10 @@ Option.propTypes = {
86
86
  hasVirtualFocus: PropTypes.bool,
87
87
  item: PropTypes.shape({
88
88
  key: PropTypes.string,
89
- props: PropTypes.shape({}),
89
+ props: PropTypes.shape({
90
+ 'data-id': PropTypes.string,
91
+ isSeparator: PropTypes.bool
92
+ }),
90
93
  rendered: PropTypes.node
91
94
  }),
92
95
  state: PropTypes.shape({
@@ -141,7 +141,8 @@ MenuItem.propTypes = {
141
141
  key: PropTypes.string,
142
142
  props: PropTypes.shape({
143
143
  'data-id': PropTypes.string,
144
- isSeparator: PropTypes.bool
144
+ isSeparator: PropTypes.bool,
145
+ isPressed: PropTypes.bool
145
146
  }),
146
147
  rendered: PropTypes.node,
147
148
  isDisabled: PropTypes.bool
@@ -141,7 +141,8 @@ Message.propTypes = {
141
141
  icon: PropTypes.elementType,
142
142
 
143
143
  /* Hides the message with an animated transition */
144
- isHidden: PropTypes.bool
144
+ isHidden: PropTypes.bool,
145
+ 'data-id': PropTypes.string
145
146
  })
146
147
  }),
147
148
 
@@ -75,7 +75,7 @@ SelectField.propTypes = {
75
75
  * *For performance reasons, use this prop instead of Array.map when iteratively rendering Items*.
76
76
  * For use with [dynamic collections](https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections).
77
77
  */
78
- items: PropTypes.arrayOf(PropTypes.any),
78
+ items: PropTypes.arrayOf(PropTypes.shape({})),
79
79
 
80
80
  /** The label for the select element. */
81
81
  label: PropTypes.node,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["icon", "isDisabled", "separator", "tabLabelProps", "tabLineProps", "content", "titleAttr"];
3
+ var _excluded = ["icon", "isDisabled", "separator", "tabLabelProps", "tabLineProps", "content", "titleAttr", "title"];
4
4
  import React, { forwardRef, useContext, useImperativeHandle, useRef } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useTab } from '@react-aria/tabs';
@@ -38,6 +38,7 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
38
38
  tabLineProps = itemProps.tabLineProps,
39
39
  content = itemProps.content,
40
40
  titleAttr = itemProps.titleAttr,
41
+ title = itemProps.title,
41
42
  otherItemProps = _objectWithoutProperties(itemProps, _excluded);
42
43
 
43
44
  var state = useContext(TabsContext);
@@ -113,9 +114,19 @@ CollectionTab.propTypes = {
113
114
  isDisabled: PropTypes.bool,
114
115
  item: PropTypes.shape({
115
116
  key: PropTypes.string,
116
- props: PropTypes.shape({}),
117
- rendered: PropTypes.node,
118
- tabLineProps: PropTypes.shape({})
117
+ props: PropTypes.shape({
118
+ icon: PropTypes.shape({}),
119
+ isDisabled: PropTypes.bool,
120
+ textValue: PropTypes.string,
121
+ tabLineProps: PropTypes.shape({}),
122
+ tabLabelProps: PropTypes.shape({}),
123
+ content: PropTypes.shape({}),
124
+ titleAttr: PropTypes.string,
125
+ title: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.object]),
126
+ separator: PropTypes.oneOfType([PropTypes.element, PropTypes.bool]),
127
+ list: PropTypes.arrayOf(PropTypes.shape({}))
128
+ }),
129
+ rendered: PropTypes.node
119
130
  }),
120
131
  mode: PropTypes.oneOf(['default', 'tooltip', 'list']),
121
132
  orientation: PropTypes.oneOf(['horizontal', 'vertical']),
@@ -207,10 +207,10 @@ TabPicker.propTypes = {
207
207
  state: PropTypes.shape({
208
208
  collection: PropTypes.shape({}),
209
209
  selectedKey: PropTypes.string,
210
- setSelectedKey: PropTypes["function"],
210
+ setSelectedKey: PropTypes.func,
211
211
  selectionManager: PropTypes.shape({
212
212
  focusedKey: PropTypes.string,
213
- setFocusedKey: PropTypes["function"]
213
+ setFocusedKey: PropTypes.func
214
214
  })
215
215
  })
216
216
  };
@@ -6,7 +6,7 @@ test('default useOverlayPanelState', function () {
6
6
  }),
7
7
  result = _renderHook.result;
8
8
 
9
- expect(result.current).toEqual(expect.objectContaining({
9
+ var obj = {
10
10
  state: {
11
11
  open: expect.any(Function),
12
12
  close: expect.any(Function),
@@ -14,5 +14,6 @@ test('default useOverlayPanelState', function () {
14
14
  isOpen: expect.any(Boolean)
15
15
  },
16
16
  onClose: expect.any(Function)
17
- }));
17
+ };
18
+ expect(result.current).toEqual(obj);
18
19
  });
@@ -103,7 +103,15 @@ var useSelectField = function useSelectField(props, ref) {
103
103
  labelProps = _useSelect.labelProps,
104
104
  triggerProps = _useSelect.triggerProps,
105
105
  valueProps = _useSelect.valueProps,
106
- menuProps = _useSelect.menuProps;
106
+ menuProps = _useSelect.menuProps; // The following props are being passed into multiple
107
+ // DOM elements that leads to multiple test failures
108
+ // and these props are never used in any components
109
+ // that depend on useSelectField
110
+
111
+
112
+ delete menuProps.shouldSelectOnPressUp;
113
+ delete menuProps.shouldFocusOnHover;
114
+ delete menuProps.disallowEmptySelection;
107
115
 
108
116
  var _useField = useField(_objectSpread(_objectSpread({}, props), {}, {
109
117
  placeholder: props.labelMode === modes.FLOAT ? '' : placeholder,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.27.0-alpha.0",
3
+ "version": "1.27.0-alpha.1",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "ux-development@pingidentity.com",
6
6
  "license": "Apache-2.0",
@@ -137,7 +137,7 @@
137
137
  "emotion-normalize": "^11.0.1",
138
138
  "lodash": "^4.17.21",
139
139
  "mdi-react": "^7.4.0",
140
- "moment": "^2.29.1",
140
+ "moment": "^2.29.4",
141
141
  "prism-react-renderer": "1.2.1",
142
142
  "prismjs": "^1.27.0",
143
143
  "prop-types": "^15.7.2",