@pingux/astro 2.44.1-alpha.0 → 2.45.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.
Files changed (33) hide show
  1. package/lib/cjs/components/AccordionGroup/Accordion.styles.d.ts +70 -0
  2. package/lib/cjs/components/AccordionGroup/AccordionGroup.d.ts +13 -0
  3. package/lib/cjs/components/AccordionGroup/AccordionGroup.js +16 -32
  4. package/lib/cjs/components/AccordionGroup/AccordionGroup.stories.d.ts +52 -0
  5. package/lib/cjs/components/AccordionGroup/AccordionGroup.stories.js +12 -7
  6. package/lib/cjs/components/AccordionGroup/AccordionGroup.test.d.ts +1 -0
  7. package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +13 -11
  8. package/lib/cjs/components/AccordionGroup/index.d.ts +1 -0
  9. package/lib/cjs/components/AccordionItem/AccordionItem.d.ts +17 -0
  10. package/lib/cjs/components/AccordionItem/AccordionItem.js +9 -34
  11. package/lib/cjs/components/AccordionItem/index.d.ts +1 -0
  12. package/lib/cjs/components/ButtonBar/ButtonBar.d.ts +4 -0
  13. package/lib/cjs/components/ButtonBar/ButtonBar.js +0 -5
  14. package/lib/cjs/components/ButtonBar/ButtonBar.stories.d.ts +8 -0
  15. package/lib/cjs/components/ButtonBar/ButtonBar.styles.d.ts +17 -0
  16. package/lib/cjs/components/ButtonBar/ButtonBar.test.d.ts +1 -0
  17. package/lib/cjs/components/ButtonBar/ButtonBar.test.js +0 -7
  18. package/lib/cjs/hooks/useField/useField.d.ts +185 -185
  19. package/lib/cjs/hooks/useRockerButton/useRockerButton.d.ts +19 -19
  20. package/lib/cjs/types/buttonBar.d.ts +6 -0
  21. package/lib/cjs/types/buttonBar.js +6 -0
  22. package/lib/cjs/types/index.d.ts +1 -0
  23. package/lib/cjs/types/index.js +27 -16
  24. package/lib/cjs/types/item.d.ts +6 -2
  25. package/lib/components/AccordionGroup/AccordionGroup.js +18 -31
  26. package/lib/components/AccordionGroup/AccordionGroup.stories.js +12 -7
  27. package/lib/components/AccordionGroup/AccordionGroup.test.js +13 -11
  28. package/lib/components/AccordionItem/AccordionItem.js +13 -35
  29. package/lib/components/ButtonBar/ButtonBar.js +0 -5
  30. package/lib/components/ButtonBar/ButtonBar.test.js +0 -7
  31. package/lib/types/buttonBar.js +1 -0
  32. package/lib/types/index.js +1 -0
  33. package/package.json +3 -2
@@ -20,50 +20,50 @@ declare const useRockerButton: (props: RockerButtonProps, state: {
20
20
  style?: React.CSSProperties | undefined;
21
21
  className?: string | undefined;
22
22
  'aria-activedescendant'?: string | undefined;
23
- 'aria-atomic'?: (boolean | "true" | "false") | undefined;
24
- 'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
23
+ 'aria-atomic'?: (boolean | "false" | "true") | undefined;
24
+ 'aria-autocomplete'?: "list" | "none" | "both" | "inline" | undefined;
25
25
  'aria-braillelabel'?: string | undefined;
26
26
  'aria-brailleroledescription'?: string | undefined;
27
- 'aria-busy'?: (boolean | "true" | "false") | undefined;
28
- 'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
27
+ 'aria-busy'?: (boolean | "false" | "true") | undefined;
28
+ 'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
29
29
  'aria-colcount'?: number | undefined;
30
30
  'aria-colindex'?: number | undefined;
31
31
  'aria-colindextext'?: string | undefined;
32
32
  'aria-colspan'?: number | undefined;
33
33
  'aria-controls'?: string | undefined;
34
- 'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
34
+ 'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "location" | "date" | undefined;
35
35
  'aria-describedby'?: string | undefined;
36
36
  'aria-description'?: string | undefined;
37
37
  'aria-details'?: string | undefined;
38
- 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
38
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
39
39
  'aria-errormessage'?: string | undefined;
40
- 'aria-expanded'?: (boolean | "true" | "false") | undefined;
40
+ 'aria-expanded'?: (boolean | "false" | "true") | undefined;
41
41
  'aria-flowto'?: string | undefined;
42
- 'aria-grabbed'?: (boolean | "true" | "false") | undefined;
43
- 'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "true" | "false" | "listbox" | "tree" | undefined;
44
- 'aria-hidden'?: (boolean | "true" | "false") | undefined;
45
- 'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
42
+ 'aria-grabbed'?: (boolean | "false" | "true") | undefined;
43
+ 'aria-haspopup'?: boolean | "dialog" | "grid" | "listbox" | "menu" | "tree" | "false" | "true" | undefined;
44
+ 'aria-hidden'?: (boolean | "false" | "true") | undefined;
45
+ 'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
46
46
  'aria-keyshortcuts'?: string | undefined;
47
47
  'aria-label'?: string | undefined;
48
48
  'aria-labelledby'?: string | undefined;
49
49
  'aria-level'?: number | undefined;
50
50
  'aria-live'?: "off" | "assertive" | "polite" | undefined;
51
- 'aria-modal'?: (boolean | "true" | "false") | undefined;
52
- 'aria-multiline'?: (boolean | "true" | "false") | undefined;
53
- 'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
54
- 'aria-orientation'?: "horizontal" | "vertical" | undefined;
51
+ 'aria-modal'?: (boolean | "false" | "true") | undefined;
52
+ 'aria-multiline'?: (boolean | "false" | "true") | undefined;
53
+ 'aria-multiselectable'?: (boolean | "false" | "true") | undefined;
54
+ 'aria-orientation'?: "vertical" | "horizontal" | undefined;
55
55
  'aria-owns'?: string | undefined;
56
56
  'aria-placeholder'?: string | undefined;
57
57
  'aria-posinset'?: number | undefined;
58
- 'aria-readonly'?: (boolean | "true" | "false") | undefined;
59
- 'aria-relevant'?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
60
- 'aria-required'?: (boolean | "true" | "false") | undefined;
58
+ 'aria-readonly'?: (boolean | "false" | "true") | undefined;
59
+ 'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
60
+ 'aria-required'?: (boolean | "false" | "true") | undefined;
61
61
  'aria-roledescription'?: string | undefined;
62
62
  'aria-rowcount'?: number | undefined;
63
63
  'aria-rowindex'?: number | undefined;
64
64
  'aria-rowindextext'?: string | undefined;
65
65
  'aria-rowspan'?: number | undefined;
66
- 'aria-selected'?: (boolean | "true" | "false") | undefined;
66
+ 'aria-selected'?: (boolean | "false" | "true") | undefined;
67
67
  'aria-setsize'?: number | undefined;
68
68
  'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
69
69
  'aria-valuemax'?: number | undefined;
@@ -0,0 +1,6 @@
1
+ import { TestingAttributes } from './shared/test';
2
+ import { BoxProps } from './box';
3
+ export interface ButtonBarProps extends BoxProps, TestingAttributes {
4
+ /** Justifies the component's children. */
5
+ align?: 'left' | 'right';
6
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
@@ -2,6 +2,7 @@ export * from './badge';
2
2
  export * from './box';
3
3
  export * from './bracket';
4
4
  export * from './button';
5
+ export * from './buttonBar';
5
6
  export * from './card';
6
7
  export * from './fieldHelperText';
7
8
  export * from './icon';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19;
3
+ var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20;
4
4
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
5
5
  var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6
6
  var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
@@ -51,8 +51,19 @@ _forEachInstanceProperty(_context4 = _Object$keys(_button)).call(_context4, func
51
51
  }
52
52
  });
53
53
  });
54
+ var _buttonBar = require("./buttonBar");
55
+ _forEachInstanceProperty(_context5 = _Object$keys(_buttonBar)).call(_context5, function (key) {
56
+ if (key === "default" || key === "__esModule") return;
57
+ if (key in exports && exports[key] === _buttonBar[key]) return;
58
+ _Object$defineProperty(exports, key, {
59
+ enumerable: true,
60
+ get: function get() {
61
+ return _buttonBar[key];
62
+ }
63
+ });
64
+ });
54
65
  var _card = require("./card");
55
- _forEachInstanceProperty(_context5 = _Object$keys(_card)).call(_context5, function (key) {
66
+ _forEachInstanceProperty(_context6 = _Object$keys(_card)).call(_context6, function (key) {
56
67
  if (key === "default" || key === "__esModule") return;
57
68
  if (key in exports && exports[key] === _card[key]) return;
58
69
  _Object$defineProperty(exports, key, {
@@ -63,7 +74,7 @@ _forEachInstanceProperty(_context5 = _Object$keys(_card)).call(_context5, functi
63
74
  });
64
75
  });
65
76
  var _fieldHelperText = require("./fieldHelperText");
66
- _forEachInstanceProperty(_context6 = _Object$keys(_fieldHelperText)).call(_context6, function (key) {
77
+ _forEachInstanceProperty(_context7 = _Object$keys(_fieldHelperText)).call(_context7, function (key) {
67
78
  if (key === "default" || key === "__esModule") return;
68
79
  if (key in exports && exports[key] === _fieldHelperText[key]) return;
69
80
  _Object$defineProperty(exports, key, {
@@ -74,7 +85,7 @@ _forEachInstanceProperty(_context6 = _Object$keys(_fieldHelperText)).call(_conte
74
85
  });
75
86
  });
76
87
  var _icon = require("./icon");
77
- _forEachInstanceProperty(_context7 = _Object$keys(_icon)).call(_context7, function (key) {
88
+ _forEachInstanceProperty(_context8 = _Object$keys(_icon)).call(_context8, function (key) {
78
89
  if (key === "default" || key === "__esModule") return;
79
90
  if (key in exports && exports[key] === _icon[key]) return;
80
91
  _Object$defineProperty(exports, key, {
@@ -85,7 +96,7 @@ _forEachInstanceProperty(_context7 = _Object$keys(_icon)).call(_context7, functi
85
96
  });
86
97
  });
87
98
  var _iconBadge = require("./iconBadge");
88
- _forEachInstanceProperty(_context8 = _Object$keys(_iconBadge)).call(_context8, function (key) {
99
+ _forEachInstanceProperty(_context9 = _Object$keys(_iconBadge)).call(_context9, function (key) {
89
100
  if (key === "default" || key === "__esModule") return;
90
101
  if (key in exports && exports[key] === _iconBadge[key]) return;
91
102
  _Object$defineProperty(exports, key, {
@@ -96,7 +107,7 @@ _forEachInstanceProperty(_context8 = _Object$keys(_iconBadge)).call(_context8, f
96
107
  });
97
108
  });
98
109
  var _iconButton = require("./iconButton");
99
- _forEachInstanceProperty(_context9 = _Object$keys(_iconButton)).call(_context9, function (key) {
110
+ _forEachInstanceProperty(_context10 = _Object$keys(_iconButton)).call(_context10, function (key) {
100
111
  if (key === "default" || key === "__esModule") return;
101
112
  if (key in exports && exports[key] === _iconButton[key]) return;
102
113
  _Object$defineProperty(exports, key, {
@@ -107,7 +118,7 @@ _forEachInstanceProperty(_context9 = _Object$keys(_iconButton)).call(_context9,
107
118
  });
108
119
  });
109
120
  var _item = require("./item");
110
- _forEachInstanceProperty(_context10 = _Object$keys(_item)).call(_context10, function (key) {
121
+ _forEachInstanceProperty(_context11 = _Object$keys(_item)).call(_context11, function (key) {
111
122
  if (key === "default" || key === "__esModule") return;
112
123
  if (key in exports && exports[key] === _item[key]) return;
113
124
  _Object$defineProperty(exports, key, {
@@ -118,7 +129,7 @@ _forEachInstanceProperty(_context10 = _Object$keys(_item)).call(_context10, func
118
129
  });
119
130
  });
120
131
  var _link = require("./link");
121
- _forEachInstanceProperty(_context11 = _Object$keys(_link)).call(_context11, function (key) {
132
+ _forEachInstanceProperty(_context12 = _Object$keys(_link)).call(_context12, function (key) {
122
133
  if (key === "default" || key === "__esModule") return;
123
134
  if (key in exports && exports[key] === _link[key]) return;
124
135
  _Object$defineProperty(exports, key, {
@@ -129,7 +140,7 @@ _forEachInstanceProperty(_context11 = _Object$keys(_link)).call(_context11, func
129
140
  });
130
141
  });
131
142
  var _listItem = require("./listItem");
132
- _forEachInstanceProperty(_context12 = _Object$keys(_listItem)).call(_context12, function (key) {
143
+ _forEachInstanceProperty(_context13 = _Object$keys(_listItem)).call(_context13, function (key) {
133
144
  if (key === "default" || key === "__esModule") return;
134
145
  if (key in exports && exports[key] === _listItem[key]) return;
135
146
  _Object$defineProperty(exports, key, {
@@ -140,7 +151,7 @@ _forEachInstanceProperty(_context12 = _Object$keys(_listItem)).call(_context12,
140
151
  });
141
152
  });
142
153
  var _loader = require("./loader");
143
- _forEachInstanceProperty(_context13 = _Object$keys(_loader)).call(_context13, function (key) {
154
+ _forEachInstanceProperty(_context14 = _Object$keys(_loader)).call(_context14, function (key) {
144
155
  if (key === "default" || key === "__esModule") return;
145
156
  if (key in exports && exports[key] === _loader[key]) return;
146
157
  _Object$defineProperty(exports, key, {
@@ -151,7 +162,7 @@ _forEachInstanceProperty(_context13 = _Object$keys(_loader)).call(_context13, fu
151
162
  });
152
163
  });
153
164
  var _popoverContainer = require("./popoverContainer");
154
- _forEachInstanceProperty(_context14 = _Object$keys(_popoverContainer)).call(_context14, function (key) {
165
+ _forEachInstanceProperty(_context15 = _Object$keys(_popoverContainer)).call(_context15, function (key) {
155
166
  if (key === "default" || key === "__esModule") return;
156
167
  if (key in exports && exports[key] === _popoverContainer[key]) return;
157
168
  _Object$defineProperty(exports, key, {
@@ -162,7 +173,7 @@ _forEachInstanceProperty(_context14 = _Object$keys(_popoverContainer)).call(_con
162
173
  });
163
174
  });
164
175
  var _separator = require("./separator");
165
- _forEachInstanceProperty(_context15 = _Object$keys(_separator)).call(_context15, function (key) {
176
+ _forEachInstanceProperty(_context16 = _Object$keys(_separator)).call(_context16, function (key) {
166
177
  if (key === "default" || key === "__esModule") return;
167
178
  if (key in exports && exports[key] === _separator[key]) return;
168
179
  _Object$defineProperty(exports, key, {
@@ -173,7 +184,7 @@ _forEachInstanceProperty(_context15 = _Object$keys(_separator)).call(_context15,
173
184
  });
174
185
  });
175
186
  var _shared = require("./shared");
176
- _forEachInstanceProperty(_context16 = _Object$keys(_shared)).call(_context16, function (key) {
187
+ _forEachInstanceProperty(_context17 = _Object$keys(_shared)).call(_context17, function (key) {
177
188
  if (key === "default" || key === "__esModule") return;
178
189
  if (key in exports && exports[key] === _shared[key]) return;
179
190
  _Object$defineProperty(exports, key, {
@@ -184,7 +195,7 @@ _forEachInstanceProperty(_context16 = _Object$keys(_shared)).call(_context16, fu
184
195
  });
185
196
  });
186
197
  var _table = require("./table");
187
- _forEachInstanceProperty(_context17 = _Object$keys(_table)).call(_context17, function (key) {
198
+ _forEachInstanceProperty(_context18 = _Object$keys(_table)).call(_context18, function (key) {
188
199
  if (key === "default" || key === "__esModule") return;
189
200
  if (key in exports && exports[key] === _table[key]) return;
190
201
  _Object$defineProperty(exports, key, {
@@ -195,7 +206,7 @@ _forEachInstanceProperty(_context17 = _Object$keys(_table)).call(_context17, fun
195
206
  });
196
207
  });
197
208
  var _text = require("./text");
198
- _forEachInstanceProperty(_context18 = _Object$keys(_text)).call(_context18, function (key) {
209
+ _forEachInstanceProperty(_context19 = _Object$keys(_text)).call(_context19, function (key) {
199
210
  if (key === "default" || key === "__esModule") return;
200
211
  if (key in exports && exports[key] === _text[key]) return;
201
212
  _Object$defineProperty(exports, key, {
@@ -206,7 +217,7 @@ _forEachInstanceProperty(_context18 = _Object$keys(_text)).call(_context18, func
206
217
  });
207
218
  });
208
219
  var _tooltipTrigger = require("./tooltipTrigger");
209
- _forEachInstanceProperty(_context19 = _Object$keys(_tooltipTrigger)).call(_context19, function (key) {
220
+ _forEachInstanceProperty(_context20 = _Object$keys(_tooltipTrigger)).call(_context20, function (key) {
210
221
  if (key === "default" || key === "__esModule") return;
211
222
  if (key in exports && exports[key] === _tooltipTrigger[key]) return;
212
223
  _Object$defineProperty(exports, key, {
@@ -1,4 +1,4 @@
1
- import { ElementType } from 'react';
1
+ import { ElementType, Key } from 'react';
2
2
  import type { ItemProps } from '@react-types/shared';
3
3
  import { DOMAttributes, StyleProps } from './shared';
4
4
  export interface Status {
@@ -7,11 +7,13 @@ export interface Status {
7
7
  declare module '@react-types/shared' {
8
8
  interface ItemProps<T> extends StyleProps, DOMAttributes {
9
9
  /** The rendered label for the item. */
10
- label?: string;
10
+ label?: string | React.ReactNode;
11
11
  /** Props for the accordion item content element. */
12
12
  regionProps?: StyleProps;
13
13
  /** Props for the accordion item content element. */
14
14
  containerProps?: StyleProps;
15
+ /** Props for the accordion item button element. */
16
+ buttonProps?: StyleProps;
15
17
  /** Whether the item has a separator */
16
18
  isSeparator?: boolean;
17
19
  /** Whether the item is pressed */
@@ -24,6 +26,8 @@ declare module '@react-types/shared' {
24
26
  href?: string;
25
27
  /** Inline styling prop for item */
26
28
  sx?: StyleProps;
29
+ /** Key for the item. */
30
+ key?: Key;
27
31
  }
28
32
  }
29
33
  export default ItemProps;
@@ -9,20 +9,21 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
9
9
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
10
10
  import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
11
11
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
12
- var _excluded = ["defaultExpandedKeys", "expandedKeys", "labelHeadingTag", "onExpandedChange"],
12
+ var _excluded = ["labelHeadingTag", "onExpandedChange"],
13
13
  _excluded2 = ["onFocus"];
14
14
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
15
15
  import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
16
16
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
17
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
18
18
  import React, { forwardRef, useImperativeHandle, useRef } from 'react';
19
+ import { mergeProps } from 'react-aria';
19
20
  import { useTreeState } from 'react-stately';
20
21
  import { useAccordion } from '@react-aria/accordion';
21
- import { mergeProps } from '@react-aria/utils';
22
- import PropTypes from 'prop-types';
22
+
23
+ // eslint-disable-next-line import/no-unresolved
24
+
23
25
  import { AccordionContext } from '../../context/AccordionContext';
24
26
  import { Box } from '../../index';
25
- import { isIterableProp } from '../../utils/devUtils/props/isIterable';
26
27
  import AccordionItem from '../AccordionItem';
27
28
 
28
29
  /**
@@ -33,18 +34,15 @@ import AccordionItem from '../AccordionItem';
33
34
  import { jsx as ___EmotionJSX } from "@emotion/react";
34
35
  var AccordionGroup = /*#__PURE__*/forwardRef(function (props, ref) {
35
36
  var _context;
36
- var defaultExpandedKeys = props.defaultExpandedKeys,
37
- expandedKeys = props.expandedKeys,
38
- labelHeadingTag = props.labelHeadingTag,
37
+ var _props$labelHeadingTa = props.labelHeadingTag,
38
+ labelHeadingTag = _props$labelHeadingTa === void 0 ? 'span' : _props$labelHeadingTa,
39
39
  onExpandedChange = props.onExpandedChange,
40
40
  others = _objectWithoutProperties(props, _excluded);
41
41
  var state = useTreeState(props);
42
- var accordionRef = useRef();
42
+ var accordionRef = useRef(null);
43
43
 
44
44
  /* `autoFocus: true` is what makes the initial focus only take one click vs two. */
45
- var _useAccordion = useAccordion(_objectSpread({
46
- autoFocus: true
47
- }, props), state, accordionRef),
45
+ var _useAccordion = useAccordion(_objectSpread({}, props), state, accordionRef),
48
46
  accordionProps = _useAccordion.accordionProps;
49
47
  delete accordionProps.onMouseDown;
50
48
 
@@ -56,11 +54,19 @@ var AccordionGroup = /*#__PURE__*/forwardRef(function (props, ref) {
56
54
  useImperativeHandle(ref, function () {
57
55
  return accordionRef.current;
58
56
  });
57
+ var mergedProps = mergeProps(theseProps, others);
58
+ var onFocusGroup = function onFocusGroup() {
59
+ if (state.selectionManager.isFocused === false) {
60
+ state.selectionManager.setFocused(true);
61
+ }
62
+ };
59
63
  return ___EmotionJSX(AccordionContext.Provider, {
60
64
  value: state
61
65
  }, ___EmotionJSX(Box, _extends({
62
66
  ref: accordionRef
63
- }, mergeProps(theseProps, others)), _mapInstanceProperty(_context = _Array$from(state.collection)).call(_context, function (item) {
67
+ }, mergedProps, {
68
+ onFocus: onFocusGroup
69
+ }), _mapInstanceProperty(_context = _Array$from(state.collection)).call(_context, function (item) {
64
70
  return ___EmotionJSX(AccordionItem, {
65
71
  "data-id": item['data-id'],
66
72
  item: item,
@@ -69,24 +75,5 @@ var AccordionGroup = /*#__PURE__*/forwardRef(function (props, ref) {
69
75
  }, item.props.children);
70
76
  })));
71
77
  });
72
- AccordionGroup.propTypes = {
73
- /** Handler that is called when items are expanded or collapsed. */
74
- onExpandedChange: PropTypes.func,
75
- /** Item objects in the collection. */
76
- items: isIterableProp,
77
- /**
78
- * The item keys that are disabled. These items cannot be selected, focused, or otherwise
79
- * interacted with.
80
- */
81
- disabledKeys: isIterableProp,
82
- /** The currently expanded keys in the collection (controlled). */
83
- expandedKeys: isIterableProp,
84
- /** The initial expanded keys in the collection (uncontrolled). */
85
- defaultExpandedKeys: isIterableProp,
86
- /** Id of the selected element */
87
- id: PropTypes.string,
88
- /** HTML header element wrapping the label */
89
- labelHeadingTag: AccordionItem.propTypes.labelHeadingTag
90
- };
91
78
  AccordionGroup.displayName = 'AccordionGroup';
92
79
  export default AccordionGroup;
@@ -5,9 +5,9 @@ import { Item } from 'react-stately';
5
5
  import { withDesign } from 'storybook-addon-designs';
6
6
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
7
7
  import { AccordionGroup, Badge, Box, Button, Text, TextField } from '../../index';
8
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
8
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
9
9
  import { validHeadingTags } from '../AccordionItem/AccordionItem';
10
- import AccordionReadme from './AccordionGroup.mdx';
10
+ import AccordionReadme from './AccordionGroup';
11
11
  import { jsx as ___EmotionJSX } from "@emotion/react";
12
12
  var itemArray = [{
13
13
  key: 't1',
@@ -138,9 +138,10 @@ export var Multiple = function Multiple() {
138
138
  items: itemArray,
139
139
  labelHeadingTag: "h3"
140
140
  }, function (item) {
141
+ var _label;
141
142
  return ___EmotionJSX(Item, {
142
143
  key: item.key,
143
- textValue: item.label,
144
+ textValue: (_label = item.label) === null || _label === void 0 ? void 0 : _label.toString(),
144
145
  label: item.label
145
146
  }, item.children);
146
147
  })
@@ -175,9 +176,10 @@ export var ControlledExpanded = function ControlledExpanded() {
175
176
  items: itemArray,
176
177
  labelHeadingTag: "h3"
177
178
  }, function (item) {
179
+ var _label2;
178
180
  return ___EmotionJSX(Item, {
179
181
  key: item.key,
180
- textValue: item.label,
182
+ textValue: (_label2 = item.label) === null || _label2 === void 0 ? void 0 : _label2.toString(),
181
183
  label: item.label
182
184
  }, item.children);
183
185
  })
@@ -197,9 +199,10 @@ export var UncontrolledExpanded = function UncontrolledExpanded() {
197
199
  items: itemArray,
198
200
  labelHeadingTag: "h3"
199
201
  }, function (item) {
202
+ var _label3;
200
203
  return ___EmotionJSX(Item, {
201
204
  key: item.key,
202
- textValue: item.label,
205
+ textValue: (_label3 = item.label) === null || _label3 === void 0 ? void 0 : _label3.toString(),
203
206
  label: item.label
204
207
  }, item.children);
205
208
  })
@@ -219,9 +222,10 @@ export var DisabledState = function DisabledState() {
219
222
  items: itemArrayDisabled,
220
223
  labelHeadingTag: "h3"
221
224
  }, function (item) {
225
+ var _label4;
222
226
  return ___EmotionJSX(Item, {
223
227
  key: item.key,
224
- textValue: item.label,
228
+ textValue: (_label4 = item.label) === null || _label4 === void 0 ? void 0 : _label4.toString(),
225
229
  label: item.label
226
230
  }, item.children);
227
231
  })
@@ -246,9 +250,10 @@ export var CustomPresentation = function CustomPresentation() {
246
250
  items: itemArrayDisabled,
247
251
  labelHeadingTag: "h3"
248
252
  }, function (item) {
253
+ var _label5;
249
254
  return ___EmotionJSX(Item, {
250
255
  key: item.key,
251
- textValue: item.label,
256
+ textValue: (_label5 = item.label) === null || _label5 === void 0 ? void 0 : _label5.toString(),
252
257
  label: item.label,
253
258
  buttonProps: {
254
259
  bg: item.key === 't2' ? 'darkseagreen' : 'skyblue'
@@ -98,7 +98,9 @@ var getComponentWithPopover = function getComponentWithPopover() {
98
98
  }, ___EmotionJSX(PopoverMenu, null, ___EmotionJSX(Button, {
99
99
  "data-testid": "popoverbutton"
100
100
  }, "Click me"), ___EmotionJSX(Menu, {
101
- onAction: function onAction() {}
101
+ onAction: function onAction() {
102
+ return false;
103
+ }
102
104
  }, ___EmotionJSX(Item, {
103
105
  key: "edit"
104
106
  }, "Edit"), ___EmotionJSX(Item, {
@@ -111,13 +113,15 @@ var getComponentWithPopover = function getComponentWithPopover() {
111
113
  }, "Delete")))), ___EmotionJSX(AccordionGroup, {
112
114
  items: items,
113
115
  defaultExpandedKeys: selectedAccordionKeys
114
- }, function (item) {
115
- return ___EmotionJSX(Item, {
116
- key: item.key,
117
- textValue: item.label,
118
- label: item.label
119
- }, item.text);
120
- })));
116
+ }, ___EmotionJSX(Item, {
117
+ key: items[0].key,
118
+ textValue: items[0].label,
119
+ label: items[0].label
120
+ }, items[0].text), ___EmotionJSX(Item, {
121
+ key: items[1].key,
122
+ textValue: items[1].label,
123
+ label: items[1].label
124
+ }, items[1].text))));
121
125
  };
122
126
  var getComponentWithMultipleAccordion = function getComponentWithMultipleAccordion() {
123
127
  return render(___EmotionJSX(Box, {
@@ -242,9 +246,7 @@ test('allows users to navigate accordion headers through the tab key', function
242
246
  firstItem = _buttons2[0],
243
247
  secondItem = _buttons2[1],
244
248
  thirdItem = _buttons2[2];
245
- act(function () {
246
- firstItem.focus();
247
- });
249
+ userEvent.tab();
248
250
  expect(firstItem).toHaveFocus();
249
251
  userEvent.tab();
250
252
  expect(secondItem).toHaveFocus();
@@ -1,18 +1,17 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
3
- var _context;
4
- var _excluded = ["label", "children", "textValue", "containerProps", "buttonProps", "regionProps"];
3
+ var _excluded = ["containerProps", "buttonProps", "regionProps"];
5
4
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
6
- import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
7
- import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
8
- import React, { forwardRef, useContext, useImperativeHandle, useRef } from 'react';
5
+ import React, { useContext, useRef } from 'react';
9
6
  import { mergeProps, useButton } from 'react-aria';
10
7
  import MenuDown from '@pingux/mdi-react/MenuDownIcon';
11
8
  import MenuUp from '@pingux/mdi-react/MenuUpIcon';
12
9
  import { useAccordionItem } from '@react-aria/accordion';
13
10
  import { useFocusRing } from '@react-aria/focus';
14
11
  import { useHover } from '@react-aria/interactions';
15
- import PropTypes from 'prop-types';
12
+
13
+ // eslint-disable-next-line import/no-unresolved
14
+
16
15
  import { Button as ThemeUIButton } from 'theme-ui';
17
16
  import { AccordionContext } from '../../context/AccordionContext';
18
17
  import { useStatusClasses } from '../../hooks';
@@ -20,14 +19,11 @@ import { Box, Icon, Text } from '../../index';
20
19
  import { hoveredState } from '../AccordionGroup/Accordion.styles';
21
20
  import { jsx as ___EmotionJSX } from "@emotion/react";
22
21
  export var validHeadingTags = ['h1', 'h2', 'h3', 'h4'];
23
- var AccordionItem = /*#__PURE__*/forwardRef(function (props, ref) {
22
+ var AccordionItem = function AccordionItem(props) {
24
23
  var className = props.className,
25
24
  item = props.item,
26
25
  labelHeadingTag = props.labelHeadingTag;
27
26
  var _item$props = item.props,
28
- label = _item$props.label,
29
- children = _item$props.children,
30
- textValue = _item$props.textValue,
31
27
  _item$props$container = _item$props.containerProps,
32
28
  containerProps = _item$props$container === void 0 ? {} : _item$props$container,
33
29
  _item$props$buttonPro = _item$props.buttonProps,
@@ -36,23 +32,23 @@ var AccordionItem = /*#__PURE__*/forwardRef(function (props, ref) {
36
32
  regionProps = _item$props$regionPro === void 0 ? {} : _item$props$regionPro,
37
33
  others = _objectWithoutProperties(_item$props, _excluded);
38
34
  var state = useContext(AccordionContext);
39
- var buttonRef = useRef();
35
+ var buttonRef = useRef(null);
40
36
  var _useAccordionItem = useAccordionItem(props, state, buttonRef),
41
37
  accordionButtonProps = _useAccordionItem.buttonProps,
42
38
  accordionRegionProps = _useAccordionItem.regionProps;
43
- var _useHover = useHover(props),
44
- hoverProps = _useHover.hoverProps,
45
- isHovered = _useHover.isHovered;
46
39
  var _useFocusRing = useFocusRing(),
47
40
  focusProps = _useFocusRing.focusProps,
48
41
  isFocusVisible = _useFocusRing.isFocusVisible;
49
42
  var isOpen = state.expandedKeys.has(item.key);
50
43
  var isDisabled = state.disabledKeys.has(item.key);
44
+ var _useHover = useHover({
45
+ isDisabled: isDisabled
46
+ }),
47
+ hoverProps = _useHover.hoverProps,
48
+ isHovered = _useHover.isHovered;
51
49
 
52
50
  /* istanbul ignore next */
53
- useImperativeHandle(ref, function () {
54
- return buttonRef.current;
55
- });
51
+
56
52
  var _useButton = useButton(props, buttonRef),
57
53
  isPressed = _useButton.isPressed,
58
54
  raButtonProps = _useButton.buttonProps;
@@ -102,24 +98,6 @@ var AccordionItem = /*#__PURE__*/forwardRef(function (props, ref) {
102
98
  }, accordionRegionProps, regionProps, {
103
99
  className: itemClasses
104
100
  }), item.rendered));
105
- });
106
- AccordionItem.propTypes = {
107
- 'aria-label': PropTypes.string,
108
- labelHeadingTag: PropTypes.oneOf(_concatInstanceProperty(_context = []).call(_context, validHeadingTags, _mapInstanceProperty(validHeadingTags).call(validHeadingTags, function (heading) {
109
- return heading.toUpperCase();
110
- }))),
111
- item: PropTypes.shape({
112
- key: PropTypes.string,
113
- rendered: PropTypes.node,
114
- props: PropTypes.shape({
115
- label: PropTypes.node,
116
- children: PropTypes.node,
117
- textValue: PropTypes.string,
118
- containerProps: PropTypes.shape({}),
119
- buttonProps: PropTypes.shape({}),
120
- regionProps: PropTypes.shape({})
121
- })
122
- })
123
101
  };
124
102
  AccordionItem.displayName = 'AccordionItem';
125
103
  export default AccordionItem;
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
3
3
  var _excluded = ["align", "children"];
4
4
  import React, { forwardRef } from 'react';
5
- import PropTypes from 'prop-types';
6
5
  import { Box } from '../../index';
7
6
  import { jsx as ___EmotionJSX } from "@emotion/react";
8
7
  var ButtonBar = /*#__PURE__*/forwardRef(function (props, ref) {
@@ -15,10 +14,6 @@ var ButtonBar = /*#__PURE__*/forwardRef(function (props, ref) {
15
14
  variant: align === 'right' ? 'buttonBar.justifyRightContainer' : 'buttonBar.container'
16
15
  }, others), children);
17
16
  });
18
- ButtonBar.propTypes = {
19
- /** Justifies the component's children. */
20
- align: PropTypes.oneOf(['left', 'right'])
21
- };
22
17
  ButtonBar.defaultProps = {
23
18
  align: 'left'
24
19
  };
@@ -88,11 +88,4 @@ test('justify-content left when align prop is excluded', function () {
88
88
  getComponent();
89
89
  var element = screen.getByTestId(testId);
90
90
  expect(element).toHaveStyleRule('justify-content', 'left');
91
- });
92
- test('an error is thrown when align has invalid prop value', function () {
93
- expect(function () {
94
- return getComponent({
95
- align: 'rihgt'
96
- });
97
- }).toThrow('Failed prop type');
98
91
  });
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,7 @@ export * from './badge';
2
2
  export * from './box';
3
3
  export * from './bracket';
4
4
  export * from './button';
5
+ export * from './buttonBar';
5
6
  export * from './card';
6
7
  export * from './fieldHelperText';
7
8
  export * from './icon';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.44.1-alpha.0",
3
+ "version": "2.45.0-alpha.1",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",
@@ -80,7 +80,8 @@
80
80
  "@react-stately/table": "^3.9.0",
81
81
  "@react-stately/tree": "^3.7.4",
82
82
  "@react-stately/virtualizer": "~3.6.5",
83
- "@react-types/shared": "^3.20.0",
83
+ "@react-types/accordion": "^3.0.0-alpha.18",
84
+ "@react-types/shared": "^3.22.0",
84
85
  "@storybook/addon-actions": "^7.1.0",
85
86
  "@storybook/api": "^7.1.0",
86
87
  "@storybook/components": "^7.1.0",