@pingux/astro 1.41.0-alpha.1 → 1.41.0-alpha.3

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 (89) hide show
  1. package/lib/Patterns/AttributeMappingDisplayViewPattern.stories.hidden.js +138 -0
  2. package/lib/Patterns/AttributeMappingEditViewPattern.stories.hidden.js +145 -0
  3. package/lib/Patterns/ListAndPanelPattern.stories.hidden.js +381 -0
  4. package/lib/Patterns/MessagesPattern.stories.hidden.js +69 -0
  5. package/lib/Patterns/SaveBarPattern.stories.hidden.js +80 -0
  6. package/lib/Patterns/UnsavedChangesPattern.stories.hidden.js +106 -0
  7. package/lib/cjs/Patterns/AttributeMappingDisplayViewPattern.stories.hidden.js +158 -0
  8. package/lib/cjs/Patterns/AttributeMappingEditViewPattern.stories.hidden.js +167 -0
  9. package/lib/cjs/Patterns/ListAndPanelPattern.stories.hidden.js +418 -0
  10. package/lib/cjs/Patterns/MessagesPattern.stories.hidden.js +99 -0
  11. package/lib/cjs/Patterns/SaveBarPattern.stories.hidden.js +109 -0
  12. package/lib/cjs/Patterns/UnsavedChangesPattern.stories.hidden.js +136 -0
  13. package/lib/cjs/components/Bracket/Bracket.stories.js +1 -3
  14. package/lib/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -1
  15. package/lib/cjs/components/Breadcrumbs/Breadcrumbs.stories.js +2 -18
  16. package/lib/cjs/components/Card/Card.js +117 -6
  17. package/lib/cjs/components/Card/Card.stories.js +55 -16
  18. package/lib/cjs/components/Card/Card.test.js +50 -0
  19. package/lib/cjs/components/Chip/Badge.js +0 -5
  20. package/lib/cjs/components/Chip/Badge.stories.js +11 -0
  21. package/lib/cjs/components/Chip/Chip.js +0 -5
  22. package/lib/cjs/components/CodeView/CodeView.js +0 -4
  23. package/lib/cjs/components/CodeView/CodeView.stories.js +9 -0
  24. package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.js +0 -4
  25. package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.stories.js +7 -0
  26. package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +13 -1
  27. package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +75 -4
  28. package/lib/cjs/components/CopyText/CopyText.js +0 -4
  29. package/lib/cjs/components/CopyText/CopyText.stories.js +11 -0
  30. package/lib/cjs/components/DataTable/DataTable.js +33 -15
  31. package/lib/cjs/components/DataTable/DataTable.stories.js +91 -17
  32. package/lib/cjs/components/DataTable/DataTable.test.js +38 -6
  33. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +1 -3
  34. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +25 -3
  35. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +19 -5
  36. package/lib/cjs/components/HelpHint/HelpHint.js +0 -7
  37. package/lib/cjs/components/HelpHint/HelpHint.stories.js +11 -0
  38. package/lib/cjs/components/Icon/Icon.js +0 -12
  39. package/lib/cjs/components/Icon/Icon.stories.js +7 -0
  40. package/lib/cjs/components/Image/Image.stories.js +2 -2
  41. package/lib/cjs/components/ListBox/ListBoxSection.js +8 -1
  42. package/lib/cjs/components/ListView/ListView.stories.js +6 -4
  43. package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +2 -1
  44. package/lib/cjs/components/SelectField/SelectField.stories.js +13 -1
  45. package/lib/cjs/components/SelectField/SelectField.test.js +75 -0
  46. package/lib/cjs/recipes/ConditionalFilter.stories.js +0 -1
  47. package/lib/cjs/recipes/ScrollableListView.stories.js +3 -2
  48. package/lib/cjs/recipes/TrialExperienceIndustryButtons.stories.js +4 -8
  49. package/lib/cjs/styles/variants/boxes.js +6 -6
  50. package/lib/cjs/utils/devUtils/constants/text.js +11 -0
  51. package/lib/components/Bracket/Bracket.stories.js +1 -3
  52. package/lib/components/Breadcrumbs/Breadcrumbs.js +1 -1
  53. package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +0 -13
  54. package/lib/components/Card/Card.js +110 -7
  55. package/lib/components/Card/Card.stories.js +44 -10
  56. package/lib/components/Card/Card.test.js +36 -0
  57. package/lib/components/Chip/Badge.js +0 -6
  58. package/lib/components/Chip/Badge.stories.js +9 -0
  59. package/lib/components/Chip/Chip.js +0 -6
  60. package/lib/components/CodeView/CodeView.js +0 -5
  61. package/lib/components/CodeView/CodeView.stories.js +7 -0
  62. package/lib/components/CollapsiblePanel/CollapsiblePanel.js +0 -5
  63. package/lib/components/CollapsiblePanel/CollapsiblePanel.stories.js +5 -0
  64. package/lib/components/ComboBoxField/ComboBoxField.stories.js +13 -1
  65. package/lib/components/ComboBoxField/ComboBoxField.test.js +70 -5
  66. package/lib/components/CopyText/CopyText.js +0 -4
  67. package/lib/components/CopyText/CopyText.stories.js +9 -0
  68. package/lib/components/DataTable/DataTable.js +33 -15
  69. package/lib/components/DataTable/DataTable.stories.js +80 -17
  70. package/lib/components/DataTable/DataTable.test.js +36 -6
  71. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +1 -3
  72. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +23 -3
  73. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +16 -5
  74. package/lib/components/HelpHint/HelpHint.js +0 -7
  75. package/lib/components/HelpHint/HelpHint.stories.js +9 -0
  76. package/lib/components/Icon/Icon.js +0 -13
  77. package/lib/components/Icon/Icon.stories.js +5 -0
  78. package/lib/components/Image/Image.stories.js +2 -2
  79. package/lib/components/ListBox/ListBoxSection.js +7 -2
  80. package/lib/components/ListView/ListView.stories.js +6 -4
  81. package/lib/components/OverlayPanel/OverlayPanel.stories.js +2 -1
  82. package/lib/components/SelectField/SelectField.stories.js +13 -1
  83. package/lib/components/SelectField/SelectField.test.js +68 -1
  84. package/lib/recipes/ConditionalFilter.stories.js +0 -1
  85. package/lib/recipes/ScrollableListView.stories.js +3 -2
  86. package/lib/recipes/TrialExperienceIndustryButtons.stories.js +4 -8
  87. package/lib/styles/variants/boxes.js +6 -6
  88. package/lib/utils/devUtils/constants/text.js +1 -0
  89. package/package.json +1 -1
@@ -1,6 +1,17 @@
1
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
2
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
4
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
5
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
6
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
7
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
8
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
1
9
  import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
2
10
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
11
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
3
12
  import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
13
+ import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
14
+ import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
4
15
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
5
16
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
6
17
  import _keysInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/keys";
@@ -8,12 +19,20 @@ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign"
8
19
  import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
9
20
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
10
21
  import _parseInt from "@babel/runtime-corejs3/core-js-stable/parse-int";
22
+
23
+ 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; }
24
+
25
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context8 = ownKeys(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context9 = ownKeys(Object(source))).call(_context9, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
26
+
11
27
  import React from 'react';
12
28
  import { useAsyncList } from '@react-stately/data';
13
29
  import ApplicationIcon from 'mdi-react/ApplicationIcon';
14
30
  import { action } from '@storybook/addon-actions';
15
31
  import { faker } from '@faker-js/faker';
16
32
  import isChromatic from 'chromatic/isChromatic';
33
+ import DocsLayout from '../../../.storybook/storybookDocsLayout';
34
+ import DataTableReadme from './DataTable.mdx';
35
+ import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
17
36
  import { DataTable, DataTableBody, DataTableCell, DataTableColumn, DataTableHeader, DataTableRow, DataTableChip, DataTableMenu, DataTableMultiLine } from '../../index';
18
37
  import { jsx as ___EmotionJSX } from "@emotion/react";
19
38
  export default {
@@ -21,39 +40,76 @@ export default {
21
40
  component: DataTable,
22
41
  parameters: {
23
42
  docs: {
43
+ page: function page() {
44
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(DataTableReadme, null), ___EmotionJSX(DocsLayout, null));
45
+ },
24
46
  source: {
25
47
  type: 'code'
26
48
  }
27
49
  }
28
50
  },
29
- argTypes: {
51
+ argTypes: _objectSpread({
30
52
  density: {
31
53
  control: {
32
- type: 'radio',
33
- options: ['compact', 'regular', 'spacious']
54
+ disable: true
34
55
  },
35
56
  defaultValue: 'spacious'
36
57
  },
37
58
  overflowMode: {
38
59
  control: {
39
- type: 'radio',
40
- options: ['truncate', 'wrap']
60
+ disable: true
41
61
  },
42
62
  defaultValue: 'truncate'
43
63
  },
44
64
  width: {
45
- defaultValue: '100%',
65
+ description: 'Sets the width of the data table.',
46
66
  control: {
47
- type: 'text'
67
+ disable: true
48
68
  }
49
69
  },
50
70
  height: {
51
- defaultValue: 565,
71
+ description: 'Sets the height of the data table.',
72
+ control: {
73
+ disable: true
74
+ }
75
+ },
76
+ sortDescriptor: {
77
+ description: 'Defines the current column key to sort by and the sort direction.',
52
78
  control: {
53
- type: 'number'
79
+ disable: true
54
80
  }
81
+ },
82
+ onSortChange: {
83
+ description: 'Callback function that fires when sortable column header is pressed.'
84
+ },
85
+ allowsSorting: {
86
+ description: 'Determine if the column supports sorting.',
87
+ control: {
88
+ disable: true
89
+ }
90
+ },
91
+ hideHeader: {
92
+ description: 'Determine if the header should be hidden.',
93
+ control: {
94
+ disable: true
95
+ }
96
+ },
97
+ loadingState: {
98
+ description: 'Reflects current loading state.',
99
+ control: {
100
+ disable: true
101
+ }
102
+ },
103
+ onLoadMore: {
104
+ description: 'Callback function that fires when more data should be loaded on demand as user scrolls.'
105
+ },
106
+ items: {
107
+ control: {
108
+ disable: true
109
+ },
110
+ description: 'The list of DataTable items.'
55
111
  }
56
- }
112
+ }, ariaAttributeBaseArgTypes)
57
113
  };
58
114
  export var Default = function Default(args) {
59
115
  var columns = [{
@@ -88,7 +144,8 @@ export var Default = function Default(args) {
88
144
  continent: 'Europe'
89
145
  }];
90
146
  return ___EmotionJSX(DataTable, _extends({}, args, {
91
- "aria-label": "Static table"
147
+ "aria-label": "Static table",
148
+ height: "100%"
92
149
  }), ___EmotionJSX(DataTableHeader, {
93
150
  columns: columns
94
151
  }, function (column) {
@@ -135,12 +192,17 @@ export var CustomContent = function CustomContent(args) {
135
192
  key: 'menu',
136
193
  isSortable: false
137
194
  }];
195
+
196
+ var random = function random(items) {
197
+ return items[Math.floor(Math.random() * items.length)];
198
+ };
199
+
138
200
  var list = useAsyncList({
139
201
  load: function load(_ref) {
140
202
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
141
203
  var _context, _context2, _context3;
142
204
 
143
- var signal, cursor, res, json, random, fakeData, tableData;
205
+ var signal, cursor, res, json, fakeData, tableData;
144
206
  return _regeneratorRuntime.wrap(function _callee$(_context5) {
145
207
  while (1) {
146
208
  switch (_context5.prev = _context5.next) {
@@ -164,11 +226,12 @@ export var CustomContent = function CustomContent(args) {
164
226
 
165
227
  case 7:
166
228
  json = _context5.sent;
229
+ _context5.next = 10;
230
+ return new _Promise(function (resolve) {
231
+ return _setTimeout(resolve, cursor ? 2000 : 3000);
232
+ });
167
233
 
168
- random = function random(items) {
169
- return items[Math.floor(Math.random() * items.length)];
170
- };
171
-
234
+ case 10:
172
235
  fakeData = _mapInstanceProperty(_context = _concatInstanceProperty(_context2 = []).call(_context2, _keysInstanceProperty(_context3 = Array(json.results.length)).call(_context3))).call(_context, function (key) {
173
236
  var _context4;
174
237
 
@@ -198,7 +261,7 @@ export var CustomContent = function CustomContent(args) {
198
261
  cursor: json.next
199
262
  });
200
263
 
201
- case 12:
264
+ case 13:
202
265
  case "end":
203
266
  return _context5.stop();
204
267
  }
@@ -885,7 +885,7 @@ describe('Sortable DataTable with useAsyncList', function () {
885
885
  var sortableDataTable = function sortableDataTable(_ref16) {
886
886
  var result = _ref16.result;
887
887
  return render(___EmotionJSX(DataTable, _extends({}, defaultProps, {
888
- sortDescriptor: result.current.sortDescriptor,
888
+ sortDescriptor: result.current.sortDescriptor.direction,
889
889
  onSortChange: _sortInstanceProperty(result.current)
890
890
  }), ___EmotionJSX(DataTableHeader, {
891
891
  columns: columns
@@ -1239,16 +1239,46 @@ describe('Sortable DataTable with useAsyncList', function () {
1239
1239
  })));
1240
1240
 
1241
1241
  case 31:
1242
- expect(result.current.items[0].country).toBe('USA');
1243
- expect(result.current.items[1].country).toBe('France');
1244
- expect(result.current.items[2].country).toBe('China');
1245
- expect(result.current.items[3].country).toBe('Canada');
1242
+ expect(result.current.items[0].country).toBe('Canada');
1243
+ expect(result.current.items[1].country).toBe('China');
1244
+ expect(result.current.items[2].country).toBe('France');
1245
+ expect(result.current.items[3].country).toBe('USA');
1246
+ expect(result.current.items[0].continent).toBe('North America');
1247
+ expect(result.current.items[1].continent).toBe('Asia');
1248
+ expect(result.current.items[2].continent).toBe('Europe');
1249
+ expect(result.current.items[3].continent).toBe('North America');
1250
+ expect(result.current.items[0].population).toBe(37000000);
1251
+ expect(result.current.items[1].population).toBe(1398000000);
1252
+ expect(result.current.items[2].population).toBe(67000000);
1253
+ expect(result.current.items[3].population).toBe(320000000);
1246
1254
 
1247
- case 35:
1255
+ case 43:
1248
1256
  case "end":
1249
1257
  return _context34.stop();
1250
1258
  }
1251
1259
  }
1252
1260
  }, _callee30);
1253
1261
  })));
1262
+ });
1263
+ describe('Empty DataTable', function () {
1264
+ var staticDataTable = function staticDataTable() {
1265
+ return render(___EmotionJSX(DataTable, {
1266
+ "aria-label": "Table"
1267
+ }, ___EmotionJSX(DataTableHeader, {
1268
+ columns: columns
1269
+ }, function (column) {
1270
+ return ___EmotionJSX(DataTableColumn, {
1271
+ align: "center"
1272
+ }, column.name);
1273
+ }), ___EmotionJSX(DataTableBody, null, [])));
1274
+ };
1275
+
1276
+ it('should display header row only when there are no items', function () {
1277
+ staticDataTable();
1278
+ var staticTable = screen.getByRole('grid');
1279
+ var tRows = within(staticTable).getByRole('row');
1280
+ expect(staticTable).toBeInTheDocument();
1281
+ expect(staticTable).toBeVisible();
1282
+ expect(tRows).toBeInTheDocument();
1283
+ });
1254
1284
  });
@@ -39,8 +39,6 @@ export var breadCrumbDataIds = {
39
39
  environmentButton: 'breadcrumb--environment-button',
40
40
  orgButton: 'breadcrumb--org-button'
41
41
  };
42
- /** The Environment Picker with Search and Sections support */
43
-
44
42
  var EnvironmentBreadcrumb = /*#__PURE__*/forwardRef(function (props, ref) {
45
43
  var children = props.children,
46
44
  imperativeDisabledKeys = props.disabledKeys,
@@ -271,7 +269,7 @@ var EnvironmentBreadcrumb = /*#__PURE__*/forwardRef(function (props, ref) {
271
269
  iconProps: {
272
270
  color: 'neutral.70',
273
271
  mx: 5,
274
- size: 16
272
+ size: 'xs'
275
273
  }
276
274
  }, others), ___EmotionJSX(Item, {
277
275
  key: "name",
@@ -22,12 +22,17 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
22
22
  import React, { useState } from 'react';
23
23
  import EnvironmentBreadcrumb from './EnvironmentBreadcrumb';
24
24
  import { Item, Section, Chip, Box, Text } from '../../index';
25
+ import DocsLayout from '../../../.storybook/storybookDocsLayout';
26
+ import EnvironmentBreadcrumbReadme from './EnvironmentBreadcrumb.mdx';
25
27
  import { jsx as ___EmotionJSX } from "@emotion/react";
26
28
  export default {
27
29
  title: 'Components/EnvironmentBreadcrumb',
28
30
  component: EnvironmentBreadcrumb,
29
31
  parameters: {
30
32
  docs: {
33
+ page: function page() {
34
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EnvironmentBreadcrumbReadme, null), ___EmotionJSX(DocsLayout, null));
35
+ },
31
36
  source: {
32
37
  type: 'code'
33
38
  }
@@ -68,6 +73,7 @@ var defaultEnvironments = [{
68
73
  }];
69
74
  var environmentsWithSections = [{
70
75
  name: 'Recent',
76
+ key: 'Recent',
71
77
  options: [{
72
78
  name: 'Default'
73
79
  }, {
@@ -77,6 +83,7 @@ var environmentsWithSections = [{
77
83
  }]
78
84
  }, {
79
85
  name: 'All',
86
+ key: 'All',
80
87
  options: [{
81
88
  name: 'Consumer Banking Prod'
82
89
  }, {
@@ -93,6 +100,17 @@ var environmentsWithSections = [{
93
100
  }, {
94
101
  name: 'Mine'
95
102
  }]
103
+ }, {
104
+ name: null,
105
+ key: 'Other',
106
+ options: [{
107
+ name: 'Default'
108
+ }, {
109
+ name: 'Auth test',
110
+ isSandbox: true
111
+ }, {
112
+ name: 'Mike’s Workforce'
113
+ }]
96
114
  }];
97
115
  export var Default = function Default(args) {
98
116
  var _useState = useState({
@@ -230,12 +248,14 @@ export var WithSections = function WithSections() {
230
248
  items: environments,
231
249
  name: "Globochem",
232
250
  selectedItem: envNode,
233
- onSelectionChange: handleEnvPress
251
+ onSelectionChange: handleEnvPress,
252
+ isDefaultOpen: true
234
253
  }, function (_ref3) {
235
254
  var sectionName = _ref3.name,
236
- sectionOptions = _ref3.options;
255
+ sectionOptions = _ref3.options,
256
+ sectionKey = _ref3.key;
237
257
  return ___EmotionJSX(Section, {
238
- key: sectionName,
258
+ key: sectionKey,
239
259
  title: sectionName,
240
260
  items: sectionOptions
241
261
  }, function (_ref4) {
@@ -37,6 +37,7 @@ var items = [{
37
37
  }];
38
38
  var itemsWithSections = [{
39
39
  name: 'Heading 1',
40
+ key: 'Heading 1',
40
41
  options: [{
41
42
  name: 'Foo'
42
43
  }, {
@@ -46,12 +47,13 @@ var itemsWithSections = [{
46
47
  }]
47
48
  }, {
48
49
  name: 'Heading 2',
50
+ key: 'Heading 2',
49
51
  options: [{
50
- name: 'Foo'
52
+ name: 'Foo1'
51
53
  }, {
52
- name: 'Zod'
54
+ name: 'Bar1'
53
55
  }, {
54
- name: 'Zay'
56
+ name: 'Baz1'
55
57
  }]
56
58
  }];
57
59
  var defaultProps = {
@@ -92,7 +94,8 @@ var getSectionsComponent = function getSectionsComponent() {
92
94
  return render(___EmotionJSX(OverlayProvider, null, ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, defaultWithSectionsProps, props), function (section) {
93
95
  return (// eslint-disable-next-line testing-library/no-node-access
94
96
  ___EmotionJSX(Section, {
95
- key: section.name,
97
+ key: section.key,
98
+ name: section.name,
96
99
  title: section.name,
97
100
  items: section.options
98
101
  }, function (item) {
@@ -199,6 +202,14 @@ test('should render items with sections passed in props', function () {
199
202
  expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
200
203
  expect(screen.queryByRole('option')).not.toBeInTheDocument();
201
204
  userEvent.click(screen.getByText(testSelectedItem));
205
+ expect(screen.getAllByRole('group')).toHaveLength(2);
206
+ expect(screen.queryByRole('listbox')).toBeInTheDocument();
207
+ expect(screen.queryAllByRole('option')).toHaveLength(6);
208
+ });
209
+ test('should render the separators', function () {
210
+ getSectionsComponent();
211
+ userEvent.click(screen.getByText(testSelectedItem));
212
+ expect(screen.queryAllByRole('separator')).toHaveLength(3);
202
213
  var groups = screen.getAllByRole('group');
203
214
  expect(groups).toHaveLength(2);
204
215
  expect(screen.queryByRole('listbox')).toBeInTheDocument();
@@ -342,7 +353,7 @@ test('should hide section title if no search results within it', function () {
342
353
 
343
354
  userEvent.click(screen.getByText(testSelectedItem)); // Search for option exclusive to only one section
344
355
 
345
- userEvent.type(screen.getByRole('searchbox'), 'Zod'); // 'Heading 1' should not be rendered, but 'Heading 2' should be
356
+ userEvent.type(screen.getByRole('searchbox'), 'Bar1'); // 'Heading 1' should not be rendered, but 'Heading 2' should be
346
357
 
347
358
  expect(screen.queryByText(itemsWithSections[0].name)).not.toBeInTheDocument();
348
359
  expect(screen.queryByText(itemsWithSections[1].name)).toBeInTheDocument();
@@ -21,13 +21,6 @@ var HelpIcon = function HelpIcon() {
21
21
  fill: "#3B4A58"
22
22
  }));
23
23
  };
24
- /**
25
- * A `HelpHint` is a composed component using tooltip trigger and icon button.
26
- *
27
- * For customization the trigger icon,
28
- * please see the [TooltipTrigger](./?path=/docs/tooltiptrigger--default) docs.
29
- */
30
-
31
24
 
32
25
  var HelpHint = /*#__PURE__*/forwardRef(function (props, ref) {
33
26
  var children = props.children,
@@ -1,10 +1,19 @@
1
1
  import React from 'react';
2
2
  import HelpHint from '.';
3
3
  import Box from '../Box';
4
+ import DocsLayout from '../../../.storybook/storybookDocsLayout';
5
+ import HelpHintReadme from './HelpHint.mdx';
4
6
  import { jsx as ___EmotionJSX } from "@emotion/react";
5
7
  export default {
6
8
  title: 'Components/HelpHint',
7
9
  component: HelpHint,
10
+ parameters: {
11
+ docs: {
12
+ page: function page() {
13
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(HelpHintReadme, null), ___EmotionJSX(DocsLayout, null));
14
+ }
15
+ }
16
+ },
8
17
  argTypes: {
9
18
  children: {
10
19
  description: 'Tooltip content',
@@ -17,19 +17,6 @@ import React, { forwardRef } from 'react';
17
17
  import PropTypes from 'prop-types';
18
18
  import Box from '../Box';
19
19
  import { useTShirtSize } from '../../hooks';
20
- /**
21
- * Basic icon component.
22
- * Icons will fill the given container, which is '1em' x '1em' by default, and will maintain their
23
- * aspect ratio.
24
- * Use SVGR to import SVG files as React components and pass them into this component, and you can
25
- * use the theme to color the icon. But ensure you pass `dimensions: false` in webpack config
26
- * (see [SVGR docs](https://react-svgr.com/docs/options/#dimensions)).
27
- * Otherwise icon will not be resizable by `size` prop.
28
- * Icons can also be used from the [Material UI Icon Library](https://materialdesignicons.com/).
29
- * Built on top of the [Box from Theme-UI](https://theme-ui.com/components/box/) and uses the
30
- * available [props from Theme-UI](https://theme-ui.com/sx-prop).
31
- */
32
-
33
20
  import { jsx as ___EmotionJSX } from "@emotion/react";
34
21
  var Icon = /*#__PURE__*/forwardRef(function (props, ref) {
35
22
  var color = props.color,
@@ -12,12 +12,17 @@ import { v4 as uuid } from 'uuid';
12
12
  import { Box, Icon, Table, TableBody, TableCell, TableHead, TableRow, Text } from '../../index';
13
13
  import { flatColorList } from '../../styles/colors';
14
14
  import { tShirtSizes } from '../../utils/devUtils/constants/tShirtSizes';
15
+ import DocsLayout from '../../../.storybook/storybookDocsLayout';
16
+ import IconReadme from './Icon.mdx';
15
17
  import { jsx as ___EmotionJSX } from "@emotion/react";
16
18
  export default {
17
19
  title: 'Components/Icon',
18
20
  component: Icon,
19
21
  parameters: {
20
22
  docs: {
23
+ page: function page() {
24
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(IconReadme, null), ___EmotionJSX(DocsLayout, null));
25
+ },
21
26
  source: {
22
27
  type: 'code'
23
28
  }
@@ -78,7 +78,7 @@ export var FallbackImage = function FallbackImage() {
78
78
  };
79
79
  export var WithSkeletonLoadSuccess = function WithSkeletonLoadSuccess(_ref2) {
80
80
  var useLocalSrc = _ref2.useLocalSrc;
81
- var imageSrc = useLocalSrc ? pingImg : 'https://deelay.me/3000/https://picsum.photos/150/150';
81
+ var imageSrc = useLocalSrc ? pingImg : 'https://app.requestly.io/delay/3000/https://picsum.photos/150/150';
82
82
  return ___EmotionJSX(Image, {
83
83
  src: imageSrc,
84
84
  sx: {
@@ -93,7 +93,7 @@ WithSkeletonLoadSuccess.args = {
93
93
  };
94
94
  export var WithSkeletonLoadTimeout = function WithSkeletonLoadTimeout() {
95
95
  return ___EmotionJSX(Image, {
96
- src: "https://deelay.me/7000/https://picsum.photos/150/150",
96
+ src: "https://app.requestly.io/delay/7000/https://picsum.photos/150/150",
97
97
  sx: {
98
98
  width: '150px',
99
99
  height: '150px'
@@ -1,10 +1,12 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
- import React, { useRef } from 'react';
2
+ import React, { useRef, useContext } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { useListBoxSection } from '@react-aria/listbox';
5
5
  import { useLocale } from '@react-aria/i18n';
6
6
  import { layoutInfoToStyle, useVirtualizerItem } from '@react-aria/virtualizer';
7
+ import { ListBoxContext } from './ListBoxContext';
7
8
  import Box from '../Box';
9
+ import Separator from '../Separator';
8
10
  import { jsx as ___EmotionJSX } from "@emotion/react";
9
11
 
10
12
  var ListBoxSection = function ListBoxSection(props) {
@@ -29,6 +31,7 @@ var ListBoxSection = function ListBoxSection(props) {
29
31
  var _useLocale = useLocale(),
30
32
  direction = _useLocale.direction;
31
33
 
34
+ var state = useContext(ListBoxContext);
32
35
  return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Box, _extends({
33
36
  as: "ul",
34
37
  ref: headerRef,
@@ -37,7 +40,9 @@ var ListBoxSection = function ListBoxSection(props) {
37
40
  sx: {
38
41
  paddingInlineStart: '0px'
39
42
  }
40
- }, groupProps), item.rendered && ___EmotionJSX(Box, _extends({}, headingProps, {
43
+ }, groupProps), item.key !== state.collection.getFirstKey() && ___EmotionJSX(Separator, {
44
+ mt: "0px"
45
+ }), item.rendered && ___EmotionJSX(Box, _extends({}, headingProps, {
41
46
  variant: "boxes.listBoxSectionTitle"
42
47
  }), item.rendered)), ___EmotionJSX(Box, {
43
48
  style: layoutInfoToStyle(reusableView.layoutInfo, direction)
@@ -536,14 +536,15 @@ var ListElement = function ListElement(_ref) {
536
536
  }, ___EmotionJSX(Icon, {
537
537
  icon: FormSelectIcon,
538
538
  mr: "sm",
539
- color: "text.primary",
539
+ color: "accent.40",
540
540
  size: "md"
541
541
  }), ___EmotionJSX(Text, {
542
542
  variant: "itemTitle",
543
543
  alignSelf: "center"
544
544
  }, item.name)), ___EmotionJSX(Box, {
545
545
  isRow: true,
546
- alignSelf: "center"
546
+ alignSelf: "center",
547
+ gap: "sm"
547
548
  }, ___EmotionJSX(IconButton, {
548
549
  "aria-label": "create-icon"
549
550
  }, ___EmotionJSX(Icon, {
@@ -576,14 +577,15 @@ export var Default = function Default(_ref2) {
576
577
  }, ___EmotionJSX(Icon, {
577
578
  icon: FormSelectIcon,
578
579
  mr: "sm",
579
- color: "text.primary",
580
+ color: "accent.40",
580
581
  size: "md"
581
582
  }), ___EmotionJSX(Text, {
582
583
  variant: "itemTitle",
583
584
  alignSelf: "center"
584
585
  }, item.name)), ___EmotionJSX(Box, {
585
586
  isRow: true,
586
- alignSelf: "center"
587
+ alignSelf: "center",
588
+ gap: "sm"
587
589
  }, ___EmotionJSX(IconButton, {
588
590
  "aria-label": "create-icon"
589
591
  }, ___EmotionJSX(Icon, {
@@ -167,7 +167,8 @@ export var InnerPanel = function InnerPanel(_ref2) {
167
167
  }, "Open Panel"), outer), messagesOpen && ___EmotionJSX(Messages, {
168
168
  sx: {
169
169
  zIndex: 11
170
- }
170
+ },
171
+ onClose: toggleMessagesOpen
171
172
  }, ___EmotionJSX(Item, {
172
173
  key: "message2",
173
174
  status: "success"
@@ -80,6 +80,7 @@ var animals = [{
80
80
  }];
81
81
  var withSection = [{
82
82
  name: 'Animals',
83
+ key: 'Animals',
83
84
  children: [{
84
85
  name: 'Aardvark'
85
86
  }, {
@@ -89,6 +90,7 @@ var withSection = [{
89
90
  }]
90
91
  }, {
91
92
  name: 'People',
93
+ key: 'People',
92
94
  children: [{
93
95
  name: 'Michael'
94
96
  }, {
@@ -96,6 +98,16 @@ var withSection = [{
96
98
  }, {
97
99
  name: 'Creed'
98
100
  }]
101
+ }, {
102
+ name: null,
103
+ key: 'Fruit',
104
+ children: [{
105
+ name: 'Apple'
106
+ }, {
107
+ name: 'Strawberry'
108
+ }, {
109
+ name: 'Blueberry'
110
+ }]
99
111
  }];
100
112
  export default {
101
113
  title: 'Form/SelectField',
@@ -174,7 +186,7 @@ export var WithSections = function WithSections(args) {
174
186
  items: withSection
175
187
  }, args), function (section) {
176
188
  return ___EmotionJSX(Section, {
177
- key: section.name,
189
+ key: section.key,
178
190
  items: section.children,
179
191
  title: section.name
180
192
  }, function (item) {