@pingux/astro 1.0.0-alpha.9 → 1.1.0-alpha.10

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 (142) hide show
  1. package/CHANGELOG.md +257 -0
  2. package/README.md +5 -0
  3. package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.stories.js +4 -11
  4. package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +24 -0
  5. package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +1 -1
  6. package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.js +1 -1
  7. package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +33 -1
  8. package/lib/cjs/components/AccordionItem/AccordionItem.js +5 -4
  9. package/lib/cjs/components/Button/Button.js +6 -26
  10. package/lib/cjs/components/Button/Button.stories.js +7 -12
  11. package/lib/cjs/components/Button/Button.test.js +2 -25
  12. package/lib/cjs/components/Chip/Chip.js +26 -10
  13. package/lib/cjs/components/Chip/Chip.stories.js +44 -5
  14. package/lib/cjs/components/Chip/Chip.test.js +9 -0
  15. package/lib/cjs/components/{DropdownField/index.js → Chip/ChipContext.js} +8 -7
  16. package/lib/cjs/components/ColorField/ColorField.js +1 -0
  17. package/lib/cjs/components/ComboBoxField/ComboBoxField.js +7 -0
  18. package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +25 -1
  19. package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +44 -0
  20. package/lib/cjs/components/FileInputField/FileItem.js +2 -1
  21. package/lib/cjs/components/IconButton/IconButton.js +17 -7
  22. package/lib/cjs/components/IconButton/IconButton.stories.js +8 -17
  23. package/lib/cjs/components/IconButton/IconButton.test.js +4 -6
  24. package/lib/cjs/components/ImageUploadField/ImagePreviewButton.js +2 -1
  25. package/lib/cjs/components/List/List.js +3 -0
  26. package/lib/cjs/components/List/List.stories.js +7 -2
  27. package/lib/cjs/components/ListBox/ListBox.js +3 -6
  28. package/lib/cjs/components/ListBox/ListBox.test.js +2 -0
  29. package/lib/cjs/components/ListBox/Option.js +6 -0
  30. package/lib/cjs/components/ListItem/ListItem.stories.js +0 -2
  31. package/lib/cjs/components/ListView/ListView.js +4 -3
  32. package/lib/cjs/components/ListView/ListView.stories.js +580 -39
  33. package/lib/cjs/components/ListViewItem/ListViewItem.js +3 -6
  34. package/lib/cjs/components/Messages/Message.js +2 -2
  35. package/lib/cjs/components/MultivaluesField/MultivaluesField.js +3 -2
  36. package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +15 -14
  37. package/lib/cjs/components/PopoverContainer/PopoverContainer.test.js +15 -0
  38. package/lib/cjs/components/Stepper/Stepper.js +1 -0
  39. package/lib/cjs/components/Tab/Tab.js +5 -3
  40. package/lib/cjs/components/Tabs/Tabs.js +3 -0
  41. package/lib/cjs/components/Tabs/Tabs.stories.js +3 -4
  42. package/lib/cjs/components/Tabs/Tabs.test.js +44 -15
  43. package/lib/cjs/components/TextArea/TextArea.js +5 -1
  44. package/lib/cjs/components/TextAreaField/TextAreaField.test.js +10 -0
  45. package/lib/cjs/components/TooltipTrigger/TooltipTrigger.stories.js +45 -2
  46. package/lib/cjs/index.js +48 -136
  47. package/lib/cjs/layouts/ListLayout.stories.js +2 -1
  48. package/lib/cjs/layouts/SchemaFormLayout.stories.js +2 -21
  49. package/lib/cjs/recipes/ArrayField.stories.js +3 -3
  50. package/lib/cjs/styles/forms/input.js +4 -0
  51. package/lib/cjs/styles/theme.js +0 -3
  52. package/lib/cjs/styles/variants/accordion.js +7 -9
  53. package/lib/cjs/styles/variants/boxes.js +22 -19
  54. package/lib/cjs/styles/variants/buttons.js +48 -29
  55. package/lib/cjs/styles/variants/variants.js +0 -3
  56. package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +4 -11
  57. package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +23 -1
  58. package/lib/components/AccordionGridItem/AccordionGridItemBody.js +1 -1
  59. package/lib/components/AccordionGridItem/AccordionGridItemHeader.js +1 -1
  60. package/lib/components/AccordionGroup/AccordionGroup.test.js +30 -1
  61. package/lib/components/AccordionItem/AccordionItem.js +6 -5
  62. package/lib/components/Button/Button.js +8 -26
  63. package/lib/components/Button/Button.stories.js +7 -11
  64. package/lib/components/Button/Button.test.js +2 -21
  65. package/lib/components/Chip/Chip.js +25 -10
  66. package/lib/components/Chip/Chip.stories.js +41 -5
  67. package/lib/components/Chip/Chip.test.js +9 -0
  68. package/lib/components/Chip/ChipContext.js +3 -0
  69. package/lib/components/ColorField/ColorField.js +1 -0
  70. package/lib/components/ComboBoxField/ComboBoxField.js +7 -0
  71. package/lib/components/ComboBoxField/ComboBoxField.stories.js +21 -0
  72. package/lib/components/ComboBoxField/ComboBoxField.test.js +35 -0
  73. package/lib/components/FileInputField/FileItem.js +2 -1
  74. package/lib/components/IconButton/IconButton.js +17 -9
  75. package/lib/components/IconButton/IconButton.stories.js +7 -13
  76. package/lib/components/IconButton/IconButton.test.js +4 -6
  77. package/lib/components/ImageUploadField/ImagePreviewButton.js +2 -1
  78. package/lib/components/List/List.js +2 -0
  79. package/lib/components/List/List.stories.js +6 -2
  80. package/lib/components/ListBox/ListBox.js +3 -5
  81. package/lib/components/ListBox/ListBox.test.js +2 -0
  82. package/lib/components/ListBox/Option.js +6 -0
  83. package/lib/components/ListItem/ListItem.stories.js +0 -2
  84. package/lib/components/ListView/ListView.js +4 -3
  85. package/lib/components/ListView/ListView.stories.js +577 -39
  86. package/lib/components/ListViewItem/ListViewItem.js +3 -5
  87. package/lib/components/Messages/Message.js +2 -2
  88. package/lib/components/MultivaluesField/MultivaluesField.js +3 -2
  89. package/lib/components/OverlayPanel/OverlayPanel.stories.js +7 -5
  90. package/lib/components/PopoverContainer/PopoverContainer.test.js +16 -1
  91. package/lib/components/Stepper/Stepper.js +1 -0
  92. package/lib/components/Tab/Tab.js +5 -3
  93. package/lib/components/Tabs/Tabs.js +3 -0
  94. package/lib/components/Tabs/Tabs.stories.js +3 -4
  95. package/lib/components/Tabs/Tabs.test.js +40 -15
  96. package/lib/components/TextArea/TextArea.js +5 -1
  97. package/lib/components/TextAreaField/TextAreaField.test.js +8 -0
  98. package/lib/components/TooltipTrigger/TooltipTrigger.stories.js +33 -1
  99. package/lib/index.js +0 -8
  100. package/lib/layouts/ListLayout.stories.js +2 -1
  101. package/lib/layouts/SchemaFormLayout.stories.js +2 -19
  102. package/lib/recipes/ArrayField.stories.js +3 -3
  103. package/lib/styles/forms/input.js +4 -0
  104. package/lib/styles/theme.js +0 -3
  105. package/lib/styles/variants/accordion.js +7 -9
  106. package/lib/styles/variants/boxes.js +21 -19
  107. package/lib/styles/variants/buttons.js +47 -29
  108. package/lib/styles/variants/variants.js +0 -2
  109. package/package.json +1 -1
  110. package/lib/cjs/components/Dropdown/Dropdown.js +0 -112
  111. package/lib/cjs/components/Dropdown/Dropdown.test.js +0 -80
  112. package/lib/cjs/components/Dropdown/index.js +0 -18
  113. package/lib/cjs/components/DropdownField/DropdownField.js +0 -187
  114. package/lib/cjs/components/DropdownField/DropdownField.stories.js +0 -278
  115. package/lib/cjs/components/DropdownField/DropdownField.test.js +0 -80
  116. package/lib/cjs/components/Panel/Panel.js +0 -101
  117. package/lib/cjs/components/Panel/Panel.stories.js +0 -57
  118. package/lib/cjs/components/Panel/Panel.test.js +0 -72
  119. package/lib/cjs/components/Panel/index.js +0 -18
  120. package/lib/cjs/components/Popover/Popover.js +0 -87
  121. package/lib/cjs/components/Popover/Popover.stories.js +0 -80
  122. package/lib/cjs/components/Popover/Popover.test.js +0 -91
  123. package/lib/cjs/components/Popover/index.js +0 -18
  124. package/lib/cjs/recipes/InputBoxWithLinkedChip.stories.js +0 -67
  125. package/lib/cjs/styles/variants/popover.js +0 -86
  126. package/lib/components/Dropdown/Dropdown.js +0 -90
  127. package/lib/components/Dropdown/Dropdown.test.js +0 -62
  128. package/lib/components/Dropdown/index.js +0 -1
  129. package/lib/components/DropdownField/DropdownField.js +0 -155
  130. package/lib/components/DropdownField/DropdownField.stories.js +0 -222
  131. package/lib/components/DropdownField/DropdownField.test.js +0 -60
  132. package/lib/components/DropdownField/index.js +0 -1
  133. package/lib/components/Panel/Panel.js +0 -71
  134. package/lib/components/Panel/Panel.stories.js +0 -35
  135. package/lib/components/Panel/Panel.test.js +0 -52
  136. package/lib/components/Panel/index.js +0 -1
  137. package/lib/components/Popover/Popover.js +0 -65
  138. package/lib/components/Popover/Popover.stories.js +0 -52
  139. package/lib/components/Popover/Popover.test.js +0 -75
  140. package/lib/components/Popover/index.js +0 -2
  141. package/lib/recipes/InputBoxWithLinkedChip.stories.js +0 -43
  142. package/lib/styles/variants/popover.js +0 -76
@@ -27,20 +27,20 @@ var accordion = {
27
27
  alignItems: 'flex-start'
28
28
  };
29
29
  var accordionBody = {
30
- display: 'none !important',
30
+ display: 'none',
31
31
  pt: 'md',
32
32
  width: '100%',
33
33
  '.is-open &': {
34
- display: 'flex !important'
34
+ display: 'flex'
35
35
  }
36
36
  };
37
37
  var accordionGridHeader = {
38
38
  cursor: 'pointer',
39
39
  lineHeight: '30px',
40
- px: 'md',
40
+ pl: 'sm',
41
41
  outline: 'none',
42
42
  display: 'flex',
43
- justifyContent: 'flex-start',
43
+ justifyContent: 'center',
44
44
  flexShrink: 0,
45
45
  wordBreak: 'inherit',
46
46
  whiteSpace: 'nowrap',
@@ -54,12 +54,9 @@ var accordionGridHeader = {
54
54
  WebkitBoxShadow: 'focus',
55
55
  MozBoxShadow: 'focus'
56
56
  },
57
- padding: '0px',
57
+ minHeight: '64px',
58
58
  '&.is-hovered': {
59
- color: 'active',
60
- '& div > div > div > span': {
61
- color: 'active'
62
- }
59
+ backgroundColor: 'accent.99'
63
60
  },
64
61
  '&.is-pressed': {
65
62
  color: 'accent.20',
@@ -70,6 +67,7 @@ var accordionGridHeader = {
70
67
  };
71
68
  var accordionGridBody = {
72
69
  display: 'none !important',
70
+ pl: 'sm',
73
71
  width: '100%',
74
72
  '&.is-selected': {
75
73
  display: 'flex !important'
@@ -8,7 +8,7 @@ _Object$defineProperty2(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
10
 
11
- exports["default"] = void 0;
11
+ exports["default"] = exports.chip = void 0;
12
12
 
13
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/define-property"));
14
14
 
@@ -37,20 +37,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
37
37
  var base = {
38
38
  display: 'flex'
39
39
  };
40
- var panel = {
41
- outline: 'none',
42
- position: 'relative',
43
- bg: 'white',
44
- borderLeft: 'separator',
45
- transition: 'margin 0.25s ease-in',
46
- visibility: 'hidden',
47
- '&.is-focused': {
48
- boxShadow: 'focus'
49
- },
50
- '&.is-visible': {
51
- visibility: 'visible'
52
- }
53
- };
54
40
  var card = {
55
41
  boxShadow: 'standard',
56
42
  p: 'lg',
@@ -106,6 +92,10 @@ var listViewItem = _objectSpread(_objectSpread({}, base), {}, {
106
92
  },
107
93
  '&.is-focused': {
108
94
  boxShadow: 'inset 0 0 5px #5873bdbf'
95
+ },
96
+ '&.has-separator': {
97
+ borderBottom: '1px solid',
98
+ borderBottomColor: 'line.hairline'
109
99
  }
110
100
  });
111
101
 
@@ -119,15 +109,29 @@ var listBoxSectionTitle = {
119
109
  };
120
110
  var chip = {
121
111
  cursor: 'pointer',
122
- height: '15px',
123
- p: '10px',
112
+ p: '3px 5px 4px 5px',
124
113
  alignItems: 'center',
125
114
  justifyContent: 'center',
126
115
  minWidth: '50px',
127
116
  alignSelf: 'flex-start',
128
117
  display: 'inline-flex !important',
129
- borderRadius: '5px'
118
+ borderRadius: '5px',
119
+ fontWeight: 1,
120
+ '& button': {
121
+ backgroundColor: 'transparent',
122
+ marginLeft: 'xs',
123
+ marginTop: '1px',
124
+ padding: '0',
125
+ '&.is-hovered': {
126
+ backgroundColor: 'white'
127
+ },
128
+ '& .mdi-icon': {
129
+ marginLeft: '0',
130
+ padding: '2px'
131
+ }
132
+ }
130
133
  };
134
+ exports.chip = chip;
131
135
  var inputInContainerSlot = {
132
136
  position: 'absolute',
133
137
  bg: 'transparent',
@@ -284,7 +288,6 @@ var _default = {
284
288
  listItem: listItem,
285
289
  listBoxSectionTitle: listBoxSectionTitle,
286
290
  listViewItem: listViewItem,
287
- panel: panel,
288
291
  radioCheckedContent: radioCheckedContent,
289
292
  radioContainer: radioContainer,
290
293
  scrollbox: scrollbox,
@@ -32,6 +32,8 @@ var _text = require("./text");
32
32
 
33
33
  var _colors = require("../colors");
34
34
 
35
+ var _boxes = require("./boxes");
36
+
35
37
  function ownKeys(object, enumerableOnly) { var keys = (0, _keys["default"])(object); if (_getOwnPropertySymbols["default"]) { var symbols = (0, _getOwnPropertySymbols["default"])(object); if (enumerableOnly) symbols = (0, _filter["default"])(symbols).call(symbols, function (sym) { return (0, _getOwnPropertyDescriptor["default"])(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
36
38
 
37
39
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; (0, _forEach["default"])(_context = ownKeys(Object(source), true)).call(_context, function (key) { (0, _defineProperty3["default"])(target, key, source[key]); }); } else if (_getOwnPropertyDescriptors["default"]) { (0, _defineProperties["default"])(target, (0, _getOwnPropertyDescriptors["default"])(source)); } else { var _context2; (0, _forEach["default"])(_context2 = ownKeys(Object(source))).call(_context2, function (key) { (0, _defineProperty2["default"])(target, key, (0, _getOwnPropertyDescriptor["default"])(source, key)); }); } } return target; }
@@ -102,6 +104,10 @@ var iconButton = {
102
104
  }
103
105
  };
104
106
 
107
+ var square = _objectSpread(_objectSpread({}, iconButton), {}, {
108
+ borderRadius: '2px'
109
+ });
110
+
105
111
  var modalCloseButton = _objectSpread(_objectSpread({}, iconButton), {}, {
106
112
  position: 'absolute',
107
113
  top: 14,
@@ -179,32 +185,7 @@ var accordionHeader = _objectSpread(_objectSpread({}, base), {}, {
179
185
  color: 'accent.20'
180
186
  },
181
187
  '&.is-focused': _objectSpread({}, defaultFocus)
182
- }); // TODO: Remove this variant in Astro-UI 1.0.0
183
-
184
-
185
- var icon = {
186
- p: '3px',
187
- alignSelf: 'flex-start',
188
- flexGrow: 0,
189
- borderRadius: '100%',
190
- cursor: 'pointer',
191
- bg: 'transparent',
192
- 'path': {
193
- fill: 'text.secondary'
194
- },
195
- outline: 'none',
196
- color: 'white',
197
- '&.is-hovered': {
198
- bg: 'accent.90'
199
- },
200
- '&.is-pressed': {
201
- 'path': {
202
- fill: 'white'
203
- },
204
- bg: 'active'
205
- },
206
- '&.is-focused': _objectSpread({}, defaultFocus)
207
- };
188
+ });
208
189
 
209
190
  var primary = _objectSpread(_objectSpread({}, base), {}, {
210
191
  display: 'inline-flex',
@@ -264,6 +245,10 @@ var inverted = _objectSpread(_objectSpread({}, iconButton), {}, {
264
245
  }
265
246
  });
266
247
 
248
+ var invertedSquare = _objectSpread(_objectSpread({}, inverted), {}, {
249
+ borderRadius: '2px'
250
+ });
251
+
267
252
  var applicationPortal = _objectSpread(_objectSpread({}, iconButton), {}, {
268
253
  background: 'transparent',
269
254
  '&.is-focused': _objectSpread({}, defaultFocus),
@@ -330,7 +315,7 @@ var inline = _objectSpread(_objectSpread({}, base), {}, {
330
315
  bg: 'white',
331
316
  height: '22px',
332
317
  lineHeight: 1,
333
- fontSize: '14px',
318
+ fontSize: 'sm',
334
319
  borderRadius: '15px',
335
320
  border: '1px solid',
336
321
  borderColor: 'active',
@@ -492,6 +477,36 @@ var fileInputField = {
492
477
  boxShadow: 'focus'
493
478
  }
494
479
  };
480
+
481
+ var tooltipChip = _objectSpread(_objectSpread({}, _boxes.chip), {}, {
482
+ cursor: 'default',
483
+ '&.is-hovered, &.is-pressed': {
484
+ cursor: 'default',
485
+ outline: 'none'
486
+ }
487
+ });
488
+
489
+ var tooltipIconButton = _objectSpread(_objectSpread({}, iconButton), {}, {
490
+ cursor: 'default',
491
+ '&.is-hovered, &.is-pressed': {
492
+ backgroundColor: 'inherit',
493
+ cursor: 'default',
494
+ path: {
495
+ fill: 'neutral.20'
496
+ }
497
+ }
498
+ });
499
+
500
+ var tooltipInline = _objectSpread(_objectSpread({}, text), {}, {
501
+ cursor: 'default',
502
+ alignSelf: 'flex-start',
503
+ '&.is-hovered, &.is-pressed': {
504
+ backgroundColor: 'inherit',
505
+ cursor: 'default',
506
+ textDecoration: 'inherit'
507
+ }
508
+ });
509
+
495
510
  var _default = {
496
511
  accordionHeader: accordionHeader,
497
512
  chipDeleteButton: chipDeleteButton,
@@ -512,7 +527,6 @@ var _default = {
512
527
  expandableRow: expandableRow,
513
528
  fileInputField: fileInputField,
514
529
  iconButton: iconButton,
515
- icon: icon,
516
530
  imageUpload: imageUpload,
517
531
  inline: inline,
518
532
  inverted: inverted,
@@ -525,6 +539,11 @@ var _default = {
525
539
  helpHint: helpHint,
526
540
  modalCloseButton: modalCloseButton,
527
541
  applicationPortalPinned: applicationPortalPinned,
528
- applicationPortal: applicationPortal
542
+ applicationPortal: applicationPortal,
543
+ square: square,
544
+ invertedSquare: invertedSquare,
545
+ tooltipChip: tooltipChip,
546
+ tooltipIconButton: tooltipIconButton,
547
+ tooltipInline: tooltipInline
529
548
  };
530
549
  exports["default"] = _default;
@@ -54,8 +54,6 @@ var _messages = _interopRequireDefault(require("./messages"));
54
54
 
55
55
  var _numberField = _interopRequireDefault(require("./numberField"));
56
56
 
57
- var _popover = _interopRequireDefault(require("./popover"));
58
-
59
57
  var _overlayPanel = _interopRequireDefault(require("./overlayPanel"));
60
58
 
61
59
  var _popoverMenu = _interopRequireDefault(require("./popoverMenu"));
@@ -90,7 +88,6 @@ var _default = _objectSpread(_objectSpread({
90
88
  modal: _modal["default"],
91
89
  numberField: _numberField["default"],
92
90
  overlayPanel: _overlayPanel["default"],
93
- popover: _popover["default"],
94
91
  popoverMenu: _popoverMenu["default"],
95
92
  rockerbutton: _rockerbutton["default"],
96
93
  separator: _separator["default"],
@@ -83,8 +83,6 @@ export var Default = function Default() {
83
83
  return ___EmotionJSX(Box, {
84
84
  isRow: true,
85
85
  sx: {
86
- pt: '12px',
87
- pb: '12px',
88
86
  flexGrow: 1
89
87
  }
90
88
  }, ___EmotionJSX(Box, {
@@ -129,20 +127,14 @@ export var Default = function Default() {
129
127
  sx: {
130
128
  mr: '4px',
131
129
  height: '26px',
132
- width: '26px',
133
- 'path': {
134
- fill: 'active'
135
- }
130
+ width: '26px'
136
131
  }
137
132
  }, ___EmotionJSX(CreateIcon, null)), ___EmotionJSX(IconButton, {
138
133
  "aria-label": "vertical-lines-icon",
139
134
  sx: {
140
135
  mr: '4px',
141
136
  height: '26px',
142
- width: '26px',
143
- 'path': {
144
- fill: 'active'
145
- }
137
+ width: '26px'
146
138
  }
147
139
  }, ___EmotionJSX(MoreVertIcon, null)))));
148
140
  };
@@ -285,7 +277,8 @@ export var Default = function Default() {
285
277
  item: item
286
278
  }), item.key !== 'Organization' ? ___EmotionJSX(Separator, {
287
279
  sx: {
288
- m: 0
280
+ m: 0,
281
+ bg: 'neutral.90'
289
282
  }
290
283
  }) : null);
291
284
  }))
@@ -4,7 +4,7 @@ import { Item } from '@react-stately/collections';
4
4
  import userEvent from '@testing-library/user-event';
5
5
  import axeTest from '../../utils/testUtils/testAxe';
6
6
  import { act, fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
7
- import { Link, Box } from '../../index';
7
+ import { Link, Box, OverlayPanel } from '../../index';
8
8
  import AccordionGridGroup from '../AccordionGridGroup';
9
9
  import { jsx as ___EmotionJSX } from "@emotion/react";
10
10
  var testId = 'test-accordion';
@@ -26,6 +26,22 @@ var getComponent = function getComponent() {
26
26
  }, ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Header Button"), ___EmotionJSX(Link, null, "Second Header Button")), ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Body Button"), ___EmotionJSX(Link, null, "Second Body Button")))));
27
27
  };
28
28
 
29
+ var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
30
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
31
+ return render(___EmotionJSX(OverlayPanel, {
32
+ isOpen: true
33
+ }, ___EmotionJSX(AccordionGridGroup, _extends({}, defaultProps, props), ___EmotionJSX(Item, {
34
+ key: "first",
35
+ textValue: "Duplicate"
36
+ }, ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Header Button"), ___EmotionJSX(Link, null, "Second Header Button")), ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Body Button"), ___EmotionJSX(Link, null, "Second Body Button"))), ___EmotionJSX(Item, {
37
+ key: "second",
38
+ textValue: "Duplicate"
39
+ }, ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Header Button"), ___EmotionJSX(Link, null, "Second Header Button")), ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Body Button"), ___EmotionJSX(Link, null, "Second Body Button"))), ___EmotionJSX(Item, {
40
+ key: "third",
41
+ textValue: "Duplicate"
42
+ }, ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Header Button"), ___EmotionJSX(Link, null, "Second Header Button")), ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Body Button"), ___EmotionJSX(Link, null, "Second Body Button"))))));
43
+ };
44
+
29
45
  axeTest(getComponent, {
30
46
  // landmark-unique rule conflicts with react-aria role definition
31
47
  rules: {
@@ -166,4 +182,10 @@ test('default expanded keys expands an accordion item', function () {
166
182
  var row = screen.getAllByRole('row');
167
183
  var selectedRow = row[0];
168
184
  expect(selectedRow).toHaveAttribute('aria-selected', 'true');
185
+ });
186
+ test('items do not automatically expand if wrapped in an open OverlayPanel', function () {
187
+ getComponentInOverlayPanel();
188
+ var row = screen.getAllByRole('row');
189
+ var selectedRow = row[0];
190
+ expect(selectedRow).not.toHaveAttribute('aria-selected', 'true');
169
191
  });
@@ -52,7 +52,7 @@ var AccordionGridItemBody = /*#__PURE__*/forwardRef(function (props, ref) {
52
52
  }, mergedProps, {
53
53
  isSelected: isSelected,
54
54
  className: classNames,
55
- "aria-label": ariaLabel || 'Grid Cell'
55
+ "aria-label": ariaLabel
56
56
  }), children);
57
57
  });
58
58
  AccordionGridItemBody.propTypes = {
@@ -76,7 +76,7 @@ var AccordionGridItemHeader = /*#__PURE__*/forwardRef(function (props, ref) {
76
76
  isSelected: isSelected,
77
77
  className: classNames
78
78
  }, others, {
79
- "aria-label": ariaLabel || 'Grid Cell'
79
+ "aria-label": ariaLabel
80
80
  }), ___EmotionJSX(Box, {
81
81
  isRow: true
82
82
  }, children, ___EmotionJSX(Box, {
@@ -7,6 +7,7 @@ import axeTest from '../../utils/testUtils/testAxe';
7
7
  import { act, fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
8
8
  import Text from '../Text';
9
9
  import AccordionGroup from '../AccordionGroup';
10
+ import { OverlayPanel } from '../../index';
10
11
  import { jsx as ___EmotionJSX } from "@emotion/react";
11
12
  var testId = 'test-accordion';
12
13
  var defaultProps = {
@@ -16,6 +17,28 @@ var defaultProps = {
16
17
  var getComponent = function getComponent() {
17
18
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18
19
  return render(___EmotionJSX(AccordionGroup, _extends({}, defaultProps, props), ___EmotionJSX(Item, {
20
+ key: "first",
21
+ textValue: "Duplicate",
22
+ "data-id": "first",
23
+ label: "Accordion item"
24
+ }, ___EmotionJSX(Text, null, "Render me!")), ___EmotionJSX(Item, {
25
+ key: "second",
26
+ textValue: "Duplicate",
27
+ "data-id": "second",
28
+ label: "Accordion item"
29
+ }, ___EmotionJSX(Text, null, "Render me!")), ___EmotionJSX(Item, {
30
+ key: "third",
31
+ textValue: "Duplicate",
32
+ "data-id": "third",
33
+ label: "Accordion item"
34
+ }, ___EmotionJSX(Text, null, "Render me!"))));
35
+ };
36
+
37
+ var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
38
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
39
+ return render(___EmotionJSX(OverlayPanel, {
40
+ isOpen: true
41
+ }, ___EmotionJSX(AccordionGroup, _extends({}, defaultProps, props), ___EmotionJSX(Item, {
19
42
  key: "first",
20
43
  textValue: "Duplicate",
21
44
  "data-id": "first"
@@ -27,7 +50,7 @@ var getComponent = function getComponent() {
27
50
  key: "third",
28
51
  textValue: "Duplicate",
29
52
  "data-id": "third"
30
- }, ___EmotionJSX(Text, null, "Render me!"))));
53
+ }, ___EmotionJSX(Text, null, "Render me!")))));
31
54
  }; // Need to be added to each test file to test accessibility using axe.
32
55
 
33
56
 
@@ -197,4 +220,10 @@ test('Item accepts a data-id and the data-id can be found in the DOM', function
197
220
  var selectedItem = buttons[0];
198
221
  var parentElement = selectedItem.parentElement;
199
222
  expect(parentElement).toHaveAttribute('data-id', 'first');
223
+ });
224
+ test('items do not automatically expand if wrapped in an open OverlayPanel', function () {
225
+ getComponentInOverlayPanel();
226
+ var buttons = screen.getAllByRole('button');
227
+ var selectedItem = buttons[0];
228
+ expect(selectedItem).not.toHaveAttribute('aria-expanded', 'true');
200
229
  });
@@ -11,7 +11,7 @@ import { useAccordionItem } from '@react-aria/accordion';
11
11
  import { useButton } from '@react-aria/button';
12
12
  import { useFocusRing } from '@react-aria/focus';
13
13
  import { Text, Icon, Box } from '../../index';
14
- import { useAriaLabelWarning, useStatusClasses } from '../../hooks';
14
+ import { useStatusClasses } from '../../hooks';
15
15
  import { AccordionContext } from '../../context/AccordionContext';
16
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
17
17
  var AccordionItem = /*#__PURE__*/forwardRef(function (props, ref) {
@@ -72,12 +72,11 @@ var AccordionItem = /*#__PURE__*/forwardRef(function (props, ref) {
72
72
  buttonClasses = _useStatusClasses2.classNames;
73
73
 
74
74
  var ariaLabel = props['aria-label'] || item.props.label;
75
- useAriaLabelWarning('AccordionItem', ariaLabel);
76
75
  return ___EmotionJSX(Box, _extends({
77
76
  variant: "accordion.accordion",
78
77
  className: itemClasses
79
78
  }, others, containerProps), ___EmotionJSX(ThemeUIButton, _extends({
80
- "aria-label": ariaLabel || 'Accordion',
79
+ "aria-label": ariaLabel,
81
80
  ref: buttonRef,
82
81
  sx: {
83
82
  display: 'flex',
@@ -94,9 +93,11 @@ var AccordionItem = /*#__PURE__*/forwardRef(function (props, ref) {
94
93
  ml: "5px"
95
94
  }, ___EmotionJSX(Icon, {
96
95
  icon: isOpen ? MenuUp : MenuDown
97
- }))), ___EmotionJSX(Box, _extends({
96
+ }))), isOpen && ___EmotionJSX(Box, _extends({
98
97
  variant: "accordion.accordionBody"
99
- }, accordionRegionProps, regionProps), item.rendered));
98
+ }, accordionRegionProps, regionProps, {
99
+ className: itemClasses
100
+ }), item.rendered));
100
101
  });
101
102
  AccordionItem.propTypes = {
102
103
  'aria-label': PropTypes.string,
@@ -14,17 +14,15 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
14
14
 
15
15
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
16
16
 
17
- import React, { forwardRef, useRef, useImperativeHandle, useMemo } from 'react';
17
+ import React, { forwardRef, useRef, useImperativeHandle } from 'react';
18
18
  import PropTypes from 'prop-types';
19
19
  import { Button as ThemeUIButton } from 'theme-ui';
20
20
  import { useButton } from '@react-aria/button';
21
21
  import { useHover } from '@react-aria/interactions';
22
22
  import { useFocusRing } from '@react-aria/focus';
23
23
  import { mergeProps } from '@react-aria/utils';
24
- import { modes } from './constants';
25
- import { useAriaLabelWarning, useStatusClasses, useDeprecationWarning, usePropWarning } from '../../hooks';
24
+ import { useStatusClasses, usePropWarning } from '../../hooks';
26
25
  import Loader from '../Loader';
27
- import Box from '../Box';
28
26
  import { jsx as ___EmotionJSX } from "@emotion/react";
29
27
  var Button = /*#__PURE__*/forwardRef(function (props, ref) {
30
28
  var className = props.className,
@@ -39,8 +37,7 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
39
37
  onPressChange = props.onPressChange,
40
38
  onPressUp = props.onPressUp,
41
39
  children = props.children,
42
- mode = props.mode,
43
- others = _objectWithoutProperties(props, ["className", "isDisabled", "isLoading", "onHoverStart", "onHoverChange", "onHoverEnd", "onPress", "onPressStart", "onPressEnd", "onPressChange", "onPressUp", "children", "mode"]);
40
+ others = _objectWithoutProperties(props, ["className", "isDisabled", "isLoading", "onHoverStart", "onHoverChange", "onHoverEnd", "onPress", "onPressStart", "onPressEnd", "onPressChange", "onPressUp", "children"]);
44
41
 
45
42
  var buttonRef = useRef();
46
43
  usePropWarning(props, 'disabled', 'isDisabled');
@@ -49,20 +46,13 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
49
46
  useImperativeHandle(ref, function () {
50
47
  return buttonRef.current;
51
48
  });
52
- var ButtonBase = useMemo(function () {
53
- return mode === modes.ICON ? Box : ThemeUIButton;
54
- }, [mode]);
55
- var elementType = useMemo(function () {
56
- if (mode === modes.ICON) return 'div';
57
- return 'button';
58
- }, [mode]);
59
49
 
60
50
  var _useFocusRing = useFocusRing(),
61
51
  isFocusVisible = _useFocusRing.isFocusVisible,
62
52
  focusProps = _useFocusRing.focusProps;
63
53
 
64
54
  var _useButton = useButton(_objectSpread({
65
- elementType: elementType
55
+ elementType: 'button'
66
56
  }, props), buttonRef),
67
57
  buttonProps = _useButton.buttonProps,
68
58
  isPressed = _useButton.isPressed;
@@ -79,13 +69,9 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
79
69
  }),
80
70
  classNames = _useStatusClasses.classNames;
81
71
 
82
- useDeprecationWarning('The "icon" variant for `Button` will be deprecated in Astro-UI 1.0.0, use the `IconButton` component instead.', {
83
- isActive: props.variant === 'icon'
84
- });
85
72
  var ariaLabel = props['aria-label'];
86
- useAriaLabelWarning('Button', ariaLabel);
87
- return ___EmotionJSX(ButtonBase, _extends({
88
- "aria-label": ariaLabel || 'Button',
73
+ return ___EmotionJSX(ThemeUIButton, _extends({
74
+ "aria-label": ariaLabel,
89
75
  ref: buttonRef,
90
76
  className: classNames,
91
77
  role: "button",
@@ -167,15 +153,11 @@ Button.propTypes = {
167
153
  onPressUp: PropTypes.func,
168
154
 
169
155
  /** The styling variation of the button. */
170
- variant: PropTypes.string,
171
-
172
- /** The behavioral pattern to apply to the button. */
173
- mode: PropTypes.oneOf(['default', 'icon'])
156
+ variant: PropTypes.string
174
157
  };
175
158
  Button.defaultProps = {
176
159
  isDisabled: false,
177
- variant: 'default',
178
- mode: 'default'
160
+ variant: 'default'
179
161
  };
180
162
  Button.displayName = 'Button';
181
163
  export default Button;
@@ -1,8 +1,3 @@
1
- import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
2
- import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
3
-
4
- var _context;
5
-
6
1
  import React from 'react';
7
2
  import AddCircleIcon from 'mdi-react/AddCircleIcon';
8
3
  import Box from '../Box';
@@ -15,7 +10,9 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
15
10
  var variants = buttonVariants;
16
11
  delete variants.ICON;
17
12
  delete variants.ICON_BUTTON;
18
- delete variants.INVERTED;
13
+ delete variants.INVERTED; // add designer approved variants for devs to use here
14
+
15
+ var variantOptions = ['critical', 'danger', 'default', 'inline', 'link', 'primary', 'success', 'text'];
19
16
  export default {
20
17
  title: 'Button',
21
18
  component: Button,
@@ -23,11 +20,9 @@ export default {
23
20
  variant: {
24
21
  control: {
25
22
  type: 'select',
26
- options: _Object$values(variants)
23
+ options: variantOptions
27
24
  },
28
- defaultValue: _findInstanceProperty(_context = _Object$values(variants)).call(_context, function (value) {
29
- return value === 'default';
30
- })
25
+ defaultValue: 'default'
31
26
  },
32
27
  children: {
33
28
  description: 'Button text.',
@@ -67,7 +62,8 @@ export var TextIconButton = function TextIconButton() {
67
62
  export var TextButton = function TextButton() {
68
63
  return ___EmotionJSX(Button, {
69
64
  mb: "sm",
70
- variant: "text"
65
+ variant: "text",
66
+ "aria-label": "Add option"
71
67
  }, ___EmotionJSX(Text, {
72
68
  variant: "label",
73
69
  color: "active"
@@ -1,29 +1,19 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import React from 'react';
3
3
  import userEvent from '@testing-library/user-event';
4
- import AddCircleIcon from 'mdi-react/AddCircleIcon';
5
4
  import axeTest from '../../utils/testUtils/testAxe';
6
5
  import { fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
7
6
  import Button from '.';
8
- import Icon from '../Icon';
9
7
  import { jsx as ___EmotionJSX } from "@emotion/react";
10
8
  var testId = 'test-button';
11
9
  var defaultProps = {
12
- 'data-testid': testId
10
+ 'data-testid': testId,
11
+ 'aria-label': 'Test button'
13
12
  };
14
13
 
15
14
  var getComponent = function getComponent() {
16
15
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
17
16
  return render(___EmotionJSX(Button, _extends({}, defaultProps, props)));
18
- };
19
-
20
- var getIconButton = function getIconButton() {
21
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
22
- return render(___EmotionJSX(Button, _extends({}, defaultProps, props, {
23
- variant: "icon"
24
- }), ___EmotionJSX(Icon, {
25
- icon: AddCircleIcon
26
- })));
27
17
  }; // Need to be added to each test file to test accessibility using axe.
28
18
 
29
19
 
@@ -99,13 +89,4 @@ test('button renders children when not loading', function () {
99
89
  expect(childWrapper).toBeInTheDocument();
100
90
  expect(childWrapper).toBeVisible();
101
91
  expect(screen.queryByRole('progressbar')).not.toBeInTheDocument();
102
- });
103
- test('passing in an icon makes the button parent a div', function () {
104
- getIconButton({
105
- mode: 'icon'
106
- });
107
- var button = screen.getByRole('button');
108
- expect(button).toBeInTheDocument();
109
- expect(button).toBeVisible();
110
- expect(button).toBeInstanceOf(HTMLDivElement);
111
92
  });