@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
@@ -0,0 +1,70 @@
1
+ export declare const hoveredState: {
2
+ '&.is-hovered': {
3
+ color: string;
4
+ };
5
+ };
6
+ declare const _default: {
7
+ title: {
8
+ display: string;
9
+ overflowWrap: string;
10
+ maxWidth: string;
11
+ wordWrap: string;
12
+ wordBreak: string;
13
+ fontSize: string;
14
+ fontWeight: number;
15
+ color: string;
16
+ '&.is-pressed': {
17
+ color: string;
18
+ };
19
+ };
20
+ accordion: {
21
+ display: string;
22
+ mt: string;
23
+ mb: string;
24
+ alignItems: string;
25
+ };
26
+ body: {
27
+ display: string;
28
+ pt: string;
29
+ width: string;
30
+ '.is-open &': {
31
+ display: string;
32
+ };
33
+ };
34
+ header: {
35
+ '&.is-hovered': {
36
+ color: string;
37
+ };
38
+ display: string;
39
+ bg: string;
40
+ color: string;
41
+ padding: string;
42
+ flexGrow: number;
43
+ fontWeight: number;
44
+ '&.is-pressed': {
45
+ color: string;
46
+ };
47
+ '&.is-focused': {
48
+ outline: string;
49
+ outlineColor: string;
50
+ outlineOffset: string;
51
+ };
52
+ fontSize: string;
53
+ fontFamily: string;
54
+ overflowWrap: string;
55
+ maxWidth: string;
56
+ wordWrap: string;
57
+ wordBreak: string;
58
+ cursor: string;
59
+ height: string;
60
+ lineHeight: string;
61
+ minWidth: string;
62
+ outline: string;
63
+ alignItems: string;
64
+ justifyContent: string;
65
+ borderRadius: string;
66
+ flexShrink: number;
67
+ whiteSpace: string;
68
+ };
69
+ };
70
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import { TreeProps } from 'react-stately';
3
+ /**
4
+ * Console Warning: "Cannot update a component (`Unknown`)...`"
5
+ * when using controlledExpanded prop is expected
6
+ * and related to a known issue within React Stately.
7
+ */
8
+ interface AccordionProps extends Omit<TreeProps<object>, 'onExpandedChange'> {
9
+ labelHeadingTag?: string;
10
+ onExpandedChange?: Dispatch<SetStateAction<string[]>>;
11
+ }
12
+ declare const AccordionGroup: React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<unknown>>;
13
+ export default AccordionGroup;
@@ -21,17 +21,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
21
21
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
22
22
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
23
23
  var _react = _interopRequireWildcard(require("react"));
24
+ var _reactAria = require("react-aria");
24
25
  var _reactStately = require("react-stately");
25
26
  var _accordion = require("@react-aria/accordion");
26
- var _utils = require("@react-aria/utils");
27
- var _propTypes = _interopRequireDefault(require("prop-types"));
28
27
  var _AccordionContext = require("../../context/AccordionContext");
29
28
  var _index = require("../../index");
30
- var _isIterable = require("../../utils/devUtils/props/isIterable");
31
29
  var _AccordionItem = _interopRequireDefault(require("../AccordionItem"));
32
30
  var _react2 = require("@emotion/react");
33
- var _excluded = ["defaultExpandedKeys", "expandedKeys", "labelHeadingTag", "onExpandedChange"],
34
- _excluded2 = ["onFocus"];
31
+ var _excluded = ["labelHeadingTag", "onExpandedChange"],
32
+ _excluded2 = ["onFocus"]; // eslint-disable-next-line import/no-unresolved
35
33
  /**
36
34
  * Console Warning: "Cannot update a component (`Unknown`)...`"
37
35
  * when using controlledExpanded prop is expected
@@ -43,18 +41,15 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
43
41
  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) { (0, _defineProperty2["default"])(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; }
44
42
  var AccordionGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
45
43
  var _context;
46
- var defaultExpandedKeys = props.defaultExpandedKeys,
47
- expandedKeys = props.expandedKeys,
48
- labelHeadingTag = props.labelHeadingTag,
44
+ var _props$labelHeadingTa = props.labelHeadingTag,
45
+ labelHeadingTag = _props$labelHeadingTa === void 0 ? 'span' : _props$labelHeadingTa,
49
46
  onExpandedChange = props.onExpandedChange,
50
47
  others = (0, _objectWithoutProperties2["default"])(props, _excluded);
51
48
  var state = (0, _reactStately.useTreeState)(props);
52
- var accordionRef = (0, _react.useRef)();
49
+ var accordionRef = (0, _react.useRef)(null);
53
50
 
54
51
  /* `autoFocus: true` is what makes the initial focus only take one click vs two. */
55
- var _useAccordion = (0, _accordion.useAccordion)(_objectSpread({
56
- autoFocus: true
57
- }, props), state, accordionRef),
52
+ var _useAccordion = (0, _accordion.useAccordion)(_objectSpread({}, props), state, accordionRef),
58
53
  accordionProps = _useAccordion.accordionProps;
59
54
  delete accordionProps.onMouseDown;
60
55
 
@@ -66,11 +61,19 @@ var AccordionGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
66
61
  (0, _react.useImperativeHandle)(ref, function () {
67
62
  return accordionRef.current;
68
63
  });
64
+ var mergedProps = (0, _reactAria.mergeProps)(theseProps, others);
65
+ var onFocusGroup = function onFocusGroup() {
66
+ if (state.selectionManager.isFocused === false) {
67
+ state.selectionManager.setFocused(true);
68
+ }
69
+ };
69
70
  return (0, _react2.jsx)(_AccordionContext.AccordionContext.Provider, {
70
71
  value: state
71
72
  }, (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
72
73
  ref: accordionRef
73
- }, (0, _utils.mergeProps)(theseProps, others)), (0, _map["default"])(_context = (0, _from["default"])(state.collection)).call(_context, function (item) {
74
+ }, mergedProps, {
75
+ onFocus: onFocusGroup
76
+ }), (0, _map["default"])(_context = (0, _from["default"])(state.collection)).call(_context, function (item) {
74
77
  return (0, _react2.jsx)(_AccordionItem["default"], {
75
78
  "data-id": item['data-id'],
76
79
  item: item,
@@ -79,25 +82,6 @@ var AccordionGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
79
82
  }, item.props.children);
80
83
  })));
81
84
  });
82
- AccordionGroup.propTypes = {
83
- /** Handler that is called when items are expanded or collapsed. */
84
- onExpandedChange: _propTypes["default"].func,
85
- /** Item objects in the collection. */
86
- items: _isIterable.isIterableProp,
87
- /**
88
- * The item keys that are disabled. These items cannot be selected, focused, or otherwise
89
- * interacted with.
90
- */
91
- disabledKeys: _isIterable.isIterableProp,
92
- /** The currently expanded keys in the collection (controlled). */
93
- expandedKeys: _isIterable.isIterableProp,
94
- /** The initial expanded keys in the collection (uncontrolled). */
95
- defaultExpandedKeys: _isIterable.isIterableProp,
96
- /** Id of the selected element */
97
- id: _propTypes["default"].string,
98
- /** HTML header element wrapping the label */
99
- labelHeadingTag: _AccordionItem["default"].propTypes.labelHeadingTag
100
- };
101
85
  AccordionGroup.displayName = 'AccordionGroup';
102
86
  var _default = AccordionGroup;
103
87
  exports["default"] = _default;
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
3
+ export default _default;
4
+ export declare const Default: {
5
+ (args: any): React.JSX.Element;
6
+ parameters: {
7
+ design: {
8
+ type: string;
9
+ url: string;
10
+ };
11
+ };
12
+ };
13
+ export declare const DifferentLevels: {
14
+ (): React.JSX.Element;
15
+ parameters: {
16
+ design: {
17
+ type: string;
18
+ url: string;
19
+ };
20
+ };
21
+ };
22
+ export declare const Multiple: {
23
+ (): React.JSX.Element;
24
+ parameters: {
25
+ design: {
26
+ type: string;
27
+ url: string;
28
+ };
29
+ };
30
+ };
31
+ export declare const ControlledExpanded: () => React.JSX.Element;
32
+ export declare const UncontrolledExpanded: () => React.JSX.Element;
33
+ export declare const DisabledState: {
34
+ (): React.JSX.Element;
35
+ parameters: {
36
+ design: {
37
+ type: string;
38
+ url: string;
39
+ };
40
+ };
41
+ };
42
+ export declare const CustomPresentation: {
43
+ (): React.JSX.Element;
44
+ parameters: {
45
+ docs: {
46
+ description: {
47
+ story: string;
48
+ };
49
+ };
50
+ };
51
+ };
52
+ export declare const LabelWithBadge: (args: any) => React.JSX.Element;
@@ -16,9 +16,9 @@ var _reactStately = require("react-stately");
16
16
  var _storybookAddonDesigns = require("storybook-addon-designs");
17
17
  var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
18
18
  var _index = require("../../index");
19
- var _figmaLinks = require("../../utils/designUtils/figmaLinks.ts");
19
+ var _figmaLinks = require("../../utils/designUtils/figmaLinks");
20
20
  var _AccordionItem = require("../AccordionItem/AccordionItem");
21
- var _AccordionGroup = _interopRequireDefault(require("./AccordionGroup.mdx"));
21
+ var _AccordionGroup = _interopRequireDefault(require("./AccordionGroup"));
22
22
  var _react2 = require("@emotion/react");
23
23
  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); }
24
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -154,9 +154,10 @@ var Multiple = function Multiple() {
154
154
  items: itemArray,
155
155
  labelHeadingTag: "h3"
156
156
  }, function (item) {
157
+ var _label;
157
158
  return (0, _react2.jsx)(_reactStately.Item, {
158
159
  key: item.key,
159
- textValue: item.label,
160
+ textValue: (_label = item.label) === null || _label === void 0 ? void 0 : _label.toString(),
160
161
  label: item.label
161
162
  }, item.children);
162
163
  })
@@ -192,9 +193,10 @@ var ControlledExpanded = function ControlledExpanded() {
192
193
  items: itemArray,
193
194
  labelHeadingTag: "h3"
194
195
  }, function (item) {
196
+ var _label2;
195
197
  return (0, _react2.jsx)(_reactStately.Item, {
196
198
  key: item.key,
197
- textValue: item.label,
199
+ textValue: (_label2 = item.label) === null || _label2 === void 0 ? void 0 : _label2.toString(),
198
200
  label: item.label
199
201
  }, item.children);
200
202
  })
@@ -215,9 +217,10 @@ var UncontrolledExpanded = function UncontrolledExpanded() {
215
217
  items: itemArray,
216
218
  labelHeadingTag: "h3"
217
219
  }, function (item) {
220
+ var _label3;
218
221
  return (0, _react2.jsx)(_reactStately.Item, {
219
222
  key: item.key,
220
- textValue: item.label,
223
+ textValue: (_label3 = item.label) === null || _label3 === void 0 ? void 0 : _label3.toString(),
221
224
  label: item.label
222
225
  }, item.children);
223
226
  })
@@ -238,9 +241,10 @@ var DisabledState = function DisabledState() {
238
241
  items: itemArrayDisabled,
239
242
  labelHeadingTag: "h3"
240
243
  }, function (item) {
244
+ var _label4;
241
245
  return (0, _react2.jsx)(_reactStately.Item, {
242
246
  key: item.key,
243
- textValue: item.label,
247
+ textValue: (_label4 = item.label) === null || _label4 === void 0 ? void 0 : _label4.toString(),
244
248
  label: item.label
245
249
  }, item.children);
246
250
  })
@@ -266,9 +270,10 @@ var CustomPresentation = function CustomPresentation() {
266
270
  items: itemArrayDisabled,
267
271
  labelHeadingTag: "h3"
268
272
  }, function (item) {
273
+ var _label5;
269
274
  return (0, _react2.jsx)(_reactStately.Item, {
270
275
  key: item.key,
271
- textValue: item.label,
276
+ textValue: (_label5 = item.label) === null || _label5 === void 0 ? void 0 : _label5.toString(),
272
277
  label: item.label,
273
278
  buttonProps: {
274
279
  bg: item.key === 't2' ? 'darkseagreen' : 'skyblue'
@@ -101,7 +101,9 @@ var getComponentWithPopover = function getComponentWithPopover() {
101
101
  }, (0, _react2.jsx)(_index.PopoverMenu, null, (0, _react2.jsx)(_index.Button, {
102
102
  "data-testid": "popoverbutton"
103
103
  }, "Click me"), (0, _react2.jsx)(_index.Menu, {
104
- onAction: function onAction() {}
104
+ onAction: function onAction() {
105
+ return false;
106
+ }
105
107
  }, (0, _react2.jsx)(_reactStately.Item, {
106
108
  key: "edit"
107
109
  }, "Edit"), (0, _react2.jsx)(_reactStately.Item, {
@@ -114,13 +116,15 @@ var getComponentWithPopover = function getComponentWithPopover() {
114
116
  }, "Delete")))), (0, _react2.jsx)(_["default"], {
115
117
  items: items,
116
118
  defaultExpandedKeys: selectedAccordionKeys
117
- }, function (item) {
118
- return (0, _react2.jsx)(_reactStately.Item, {
119
- key: item.key,
120
- textValue: item.label,
121
- label: item.label
122
- }, item.text);
123
- })));
119
+ }, (0, _react2.jsx)(_reactStately.Item, {
120
+ key: items[0].key,
121
+ textValue: items[0].label,
122
+ label: items[0].label
123
+ }, items[0].text), (0, _react2.jsx)(_reactStately.Item, {
124
+ key: items[1].key,
125
+ textValue: items[1].label,
126
+ label: items[1].label
127
+ }, items[1].text))));
124
128
  };
125
129
  var getComponentWithMultipleAccordion = function getComponentWithMultipleAccordion() {
126
130
  return (0, _testWrapper.render)((0, _react2.jsx)(_index.Box, {
@@ -245,9 +249,7 @@ test('allows users to navigate accordion headers through the tab key', function
245
249
  firstItem = _buttons2[0],
246
250
  secondItem = _buttons2[1],
247
251
  thirdItem = _buttons2[2];
248
- (0, _testWrapper.act)(function () {
249
- firstItem.focus();
250
- });
252
+ _userEvent["default"].tab();
251
253
  expect(firstItem).toHaveFocus();
252
254
  _userEvent["default"].tab();
253
255
  expect(secondItem).toHaveFocus();
@@ -0,0 +1 @@
1
+ export { default } from './AccordionGroup';
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Node } from '@react-types/shared';
3
+ export declare const validHeadingTags: string[];
4
+ interface AccordionItemProps<T> {
5
+ item: Node<T>;
6
+ className?: string;
7
+ labelHeadingTag: string;
8
+ 'aria-label'?: string;
9
+ 'data-id'?: string;
10
+ children: React.ReactNode;
11
+ buttonProps?: object;
12
+ }
13
+ declare const AccordionItem: {
14
+ (props: AccordionItemProps<object>): React.JSX.Element;
15
+ displayName: string;
16
+ };
17
+ export default AccordionItem;
@@ -10,8 +10,6 @@ _Object$defineProperty(exports, "__esModule", {
10
10
  });
11
11
  exports.validHeadingTags = exports["default"] = void 0;
12
12
  var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
13
- var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
14
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
15
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
16
14
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
17
15
  var _react = _interopRequireWildcard(require("react"));
@@ -21,27 +19,22 @@ var _MenuUpIcon = _interopRequireDefault(require("@pingux/mdi-react/MenuUpIcon")
21
19
  var _accordion = require("@react-aria/accordion");
22
20
  var _focus = require("@react-aria/focus");
23
21
  var _interactions = require("@react-aria/interactions");
24
- var _propTypes = _interopRequireDefault(require("prop-types"));
25
22
  var _themeUi = require("theme-ui");
26
23
  var _AccordionContext = require("../../context/AccordionContext");
27
24
  var _hooks = require("../../hooks");
28
25
  var _index = require("../../index");
29
26
  var _Accordion = require("../AccordionGroup/Accordion.styles");
30
27
  var _react2 = require("@emotion/react");
31
- var _context;
32
- var _excluded = ["label", "children", "textValue", "containerProps", "buttonProps", "regionProps"];
28
+ var _excluded = ["containerProps", "buttonProps", "regionProps"]; // eslint-disable-next-line import/no-unresolved
33
29
  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); }
34
30
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
31
  var validHeadingTags = ['h1', 'h2', 'h3', 'h4'];
36
32
  exports.validHeadingTags = validHeadingTags;
37
- var AccordionItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
33
+ var AccordionItem = function AccordionItem(props) {
38
34
  var className = props.className,
39
35
  item = props.item,
40
36
  labelHeadingTag = props.labelHeadingTag;
41
37
  var _item$props = item.props,
42
- label = _item$props.label,
43
- children = _item$props.children,
44
- textValue = _item$props.textValue,
45
38
  _item$props$container = _item$props.containerProps,
46
39
  containerProps = _item$props$container === void 0 ? {} : _item$props$container,
47
40
  _item$props$buttonPro = _item$props.buttonProps,
@@ -50,23 +43,23 @@ var AccordionItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
50
43
  regionProps = _item$props$regionPro === void 0 ? {} : _item$props$regionPro,
51
44
  others = (0, _objectWithoutProperties2["default"])(_item$props, _excluded);
52
45
  var state = (0, _react.useContext)(_AccordionContext.AccordionContext);
53
- var buttonRef = (0, _react.useRef)();
46
+ var buttonRef = (0, _react.useRef)(null);
54
47
  var _useAccordionItem = (0, _accordion.useAccordionItem)(props, state, buttonRef),
55
48
  accordionButtonProps = _useAccordionItem.buttonProps,
56
49
  accordionRegionProps = _useAccordionItem.regionProps;
57
- var _useHover = (0, _interactions.useHover)(props),
58
- hoverProps = _useHover.hoverProps,
59
- isHovered = _useHover.isHovered;
60
50
  var _useFocusRing = (0, _focus.useFocusRing)(),
61
51
  focusProps = _useFocusRing.focusProps,
62
52
  isFocusVisible = _useFocusRing.isFocusVisible;
63
53
  var isOpen = state.expandedKeys.has(item.key);
64
54
  var isDisabled = state.disabledKeys.has(item.key);
55
+ var _useHover = (0, _interactions.useHover)({
56
+ isDisabled: isDisabled
57
+ }),
58
+ hoverProps = _useHover.hoverProps,
59
+ isHovered = _useHover.isHovered;
65
60
 
66
61
  /* istanbul ignore next */
67
- (0, _react.useImperativeHandle)(ref, function () {
68
- return buttonRef.current;
69
- });
62
+
70
63
  var _useButton = (0, _reactAria.useButton)(props, buttonRef),
71
64
  isPressed = _useButton.isPressed,
72
65
  raButtonProps = _useButton.buttonProps;
@@ -116,24 +109,6 @@ var AccordionItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
116
109
  }, accordionRegionProps, regionProps, {
117
110
  className: itemClasses
118
111
  }), item.rendered));
119
- });
120
- AccordionItem.propTypes = {
121
- 'aria-label': _propTypes["default"].string,
122
- labelHeadingTag: _propTypes["default"].oneOf((0, _concat["default"])(_context = []).call(_context, validHeadingTags, (0, _map["default"])(validHeadingTags).call(validHeadingTags, function (heading) {
123
- return heading.toUpperCase();
124
- }))),
125
- item: _propTypes["default"].shape({
126
- key: _propTypes["default"].string,
127
- rendered: _propTypes["default"].node,
128
- props: _propTypes["default"].shape({
129
- label: _propTypes["default"].node,
130
- children: _propTypes["default"].node,
131
- textValue: _propTypes["default"].string,
132
- containerProps: _propTypes["default"].shape({}),
133
- buttonProps: _propTypes["default"].shape({}),
134
- regionProps: _propTypes["default"].shape({})
135
- })
136
- })
137
112
  };
138
113
  AccordionItem.displayName = 'AccordionItem';
139
114
  var _default = AccordionItem;
@@ -0,0 +1 @@
1
+ export { default } from './AccordionItem';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ButtonBarProps } from '../../types';
3
+ declare const ButtonBar: React.ForwardRefExoticComponent<ButtonBarProps & React.RefAttributes<HTMLDivElement>>;
4
+ export default ButtonBar;
@@ -12,7 +12,6 @@ exports["default"] = void 0;
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
13
13
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
14
14
  var _react = _interopRequireWildcard(require("react"));
15
- var _propTypes = _interopRequireDefault(require("prop-types"));
16
15
  var _index = require("../../index");
17
16
  var _react2 = require("@emotion/react");
18
17
  var _excluded = ["align", "children"];
@@ -28,10 +27,6 @@ var ButtonBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
28
27
  variant: align === 'right' ? 'buttonBar.justifyRightContainer' : 'buttonBar.container'
29
28
  }, others), children);
30
29
  });
31
- ButtonBar.propTypes = {
32
- /** Justifies the component's children. */
33
- align: _propTypes["default"].oneOf(['left', 'right'])
34
- };
35
30
  ButtonBar.defaultProps = {
36
31
  align: 'left'
37
32
  };
@@ -0,0 +1,8 @@
1
+ import { StoryFn } from '@storybook/react';
2
+ import { ButtonBarProps } from '../../types';
3
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
4
+ export default _default;
5
+ export declare const Default: StoryFn<ButtonBarProps>;
6
+ export declare const RightAligned: StoryFn;
7
+ export declare const Secondary: StoryFn;
8
+ export declare const SecondaryRightAligned: StoryFn;
@@ -0,0 +1,17 @@
1
+ declare const _default: {
2
+ container: {
3
+ bg: string;
4
+ gap: string;
5
+ justifyContent: string;
6
+ px: string;
7
+ py: string;
8
+ };
9
+ justifyRightContainer: {
10
+ justifyContent: string;
11
+ bg: string;
12
+ gap: string;
13
+ px: string;
14
+ py: string;
15
+ };
16
+ };
17
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -91,11 +91,4 @@ test('justify-content left when align prop is excluded', function () {
91
91
  getComponent();
92
92
  var element = _testWrapper.screen.getByTestId(testId);
93
93
  expect(element).toHaveStyleRule('justify-content', 'left');
94
- });
95
- test('an error is thrown when align has invalid prop value', function () {
96
- expect(function () {
97
- return getComponent({
98
- align: 'rihgt'
99
- });
100
- }).toThrow('Failed prop type');
101
94
  });