@pingux/astro 1.41.0-alpha.0 → 1.41.0-alpha.2

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 (68) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/lib/Patterns/AttributeMappingDisplayViewPattern.stories.hidden.js +138 -0
  3. package/lib/Patterns/AttributeMappingEditViewPattern.stories.hidden.js +145 -0
  4. package/lib/Patterns/ListAndPanelPattern.stories.hidden.js +381 -0
  5. package/lib/Patterns/MessagesPattern.stories.hidden.js +69 -0
  6. package/lib/Patterns/SaveBarPattern.stories.hidden.js +80 -0
  7. package/lib/Patterns/UnsavedChangesPattern.stories.hidden.js +106 -0
  8. package/lib/cjs/Patterns/AttributeMappingDisplayViewPattern.stories.hidden.js +158 -0
  9. package/lib/cjs/Patterns/AttributeMappingEditViewPattern.stories.hidden.js +167 -0
  10. package/lib/cjs/Patterns/ListAndPanelPattern.stories.hidden.js +418 -0
  11. package/lib/cjs/Patterns/MessagesPattern.stories.hidden.js +99 -0
  12. package/lib/cjs/Patterns/SaveBarPattern.stories.hidden.js +109 -0
  13. package/lib/cjs/Patterns/UnsavedChangesPattern.stories.hidden.js +136 -0
  14. package/lib/cjs/components/Bracket/Bracket.stories.js +1 -3
  15. package/lib/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -1
  16. package/lib/cjs/components/Breadcrumbs/Breadcrumbs.stories.js +2 -18
  17. package/lib/cjs/components/Card/Card.js +117 -2
  18. package/lib/cjs/components/Card/Card.stories.js +45 -17
  19. package/lib/cjs/components/Card/Card.test.js +50 -0
  20. package/lib/cjs/components/CheckboxField/CheckboxField.js +6 -1
  21. package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +13 -1
  22. package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +75 -4
  23. package/lib/cjs/components/DataTable/DataTable.js +56 -12
  24. package/lib/cjs/components/DataTable/DataTable.stories.js +84 -17
  25. package/lib/cjs/components/DataTable/DataTable.test.js +38 -6
  26. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +1 -1
  27. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +18 -3
  28. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +19 -5
  29. package/lib/cjs/components/Image/Image.stories.js +2 -2
  30. package/lib/cjs/components/ListBox/ListBoxSection.js +8 -1
  31. package/lib/cjs/components/ListView/ListView.stories.js +6 -4
  32. package/lib/cjs/components/ListView/ListView.test.js +39 -1
  33. package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +2 -1
  34. package/lib/cjs/components/SelectField/SelectField.stories.js +13 -1
  35. package/lib/cjs/components/SelectField/SelectField.test.js +75 -0
  36. package/lib/cjs/recipes/ConditionalFilter.stories.js +0 -1
  37. package/lib/cjs/recipes/ScrollableListView.stories.js +3 -2
  38. package/lib/cjs/recipes/TrialExperienceIndustryButtons.stories.js +4 -8
  39. package/lib/cjs/styles/variants/boxes.js +6 -6
  40. package/lib/cjs/utils/devUtils/constants/text.js +11 -0
  41. package/lib/components/Bracket/Bracket.stories.js +1 -3
  42. package/lib/components/Breadcrumbs/Breadcrumbs.js +1 -1
  43. package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +0 -13
  44. package/lib/components/Card/Card.js +110 -2
  45. package/lib/components/Card/Card.stories.js +35 -10
  46. package/lib/components/Card/Card.test.js +36 -0
  47. package/lib/components/CheckboxField/CheckboxField.js +5 -1
  48. package/lib/components/ComboBoxField/ComboBoxField.stories.js +13 -1
  49. package/lib/components/ComboBoxField/ComboBoxField.test.js +70 -5
  50. package/lib/components/DataTable/DataTable.js +56 -12
  51. package/lib/components/DataTable/DataTable.stories.js +75 -17
  52. package/lib/components/DataTable/DataTable.test.js +36 -6
  53. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +1 -1
  54. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +18 -3
  55. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +16 -5
  56. package/lib/components/Image/Image.stories.js +2 -2
  57. package/lib/components/ListBox/ListBoxSection.js +7 -2
  58. package/lib/components/ListView/ListView.stories.js +6 -4
  59. package/lib/components/ListView/ListView.test.js +35 -1
  60. package/lib/components/OverlayPanel/OverlayPanel.stories.js +2 -1
  61. package/lib/components/SelectField/SelectField.stories.js +13 -1
  62. package/lib/components/SelectField/SelectField.test.js +68 -1
  63. package/lib/recipes/ConditionalFilter.stories.js +0 -1
  64. package/lib/recipes/ScrollableListView.stories.js +3 -2
  65. package/lib/recipes/TrialExperienceIndustryButtons.stories.js +4 -8
  66. package/lib/styles/variants/boxes.js +6 -6
  67. package/lib/utils/devUtils/constants/text.js +1 -0
  68. package/package.json +1 -1
@@ -10,6 +10,7 @@ import { Item } from '@react-stately/collections';
10
10
  import { render, screen } from '../../utils/testUtils/testWrapper';
11
11
  import loadingStates from '../../utils/devUtils/constants/loadingStates';
12
12
  import ListView from './ListView';
13
+ import CheckboxField from '../CheckboxField';
13
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
14
15
  var items = [{
15
16
  key: 'Aardvark',
@@ -87,6 +88,31 @@ var getComponentEmpty = function getComponentEmpty() {
87
88
  }, ___EmotionJSX(ListView, _extends({}, defaultProps, props))));
88
89
  };
89
90
 
91
+ var getComponentWithCheckbox = function getComponentWithCheckbox() {
92
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
93
+
94
+ var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
95
+ _ref3$renderFn = _ref3.renderFn,
96
+ renderFn = _ref3$renderFn === void 0 ? render : _ref3$renderFn;
97
+
98
+ return renderFn(___EmotionJSX(FocusScope, {
99
+ restoreFocus: true
100
+ }, ___EmotionJSX(ListView, _extends({}, defaultProps, props, {
101
+ items: items
102
+ }), function (item) {
103
+ return ___EmotionJSX(Item, {
104
+ key: item.key,
105
+ textValue: item.name,
106
+ "data-id": item.key
107
+ }, ___EmotionJSX(CheckboxField, {
108
+ label: item.name,
109
+ containerProps: {
110
+ 'data-testid': 'TestID'
111
+ }
112
+ }));
113
+ })));
114
+ };
115
+
90
116
  test('renders listview component', function () {
91
117
  getComponent();
92
118
  var listView = screen.getByTestId(testId);
@@ -309,4 +335,12 @@ test('when user navigates with tab and arrows keys, onFocus is called and the is
309
335
  }
310
336
  }
311
337
  }, _callee7);
312
- })));
338
+ })));
339
+ test('list view not receive focus when click on checkbox', function () {
340
+ getComponentWithCheckbox();
341
+ var listItem = screen.getAllByRole('gridcell');
342
+ var checkbox = screen.getAllByTestId('TestID');
343
+ expect(listItem[0]).not.toHaveClass('is-focused');
344
+ checkbox[0].click();
345
+ expect(listItem[0]).not.toHaveClass('is-focused');
346
+ });
@@ -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) {
@@ -1,8 +1,10 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import React from 'react';
3
+ import { OverlayProvider } from '@react-aria/overlays';
4
+ import userEvent from '@testing-library/user-event';
3
5
  import axeTest from '../../utils/testUtils/testAxe';
4
6
  import { render, screen } from '../../utils/testUtils/testWrapper';
5
- import { SelectField, Item } from '../../index';
7
+ import { SelectField, Item, Section } from '../../index';
6
8
  import statuses from '../../utils/devUtils/constants/statuses';
7
9
  import { jsx as ___EmotionJSX } from "@emotion/react";
8
10
  var items = [{
@@ -12,6 +14,37 @@ var items = [{
12
14
  }, {
13
15
  name: 'c'
14
16
  }];
17
+ var withSection = [{
18
+ name: 'Animals',
19
+ key: 'Animals',
20
+ kids: [{
21
+ name: 'Aardvark'
22
+ }, {
23
+ name: 'Kangaroo'
24
+ }, {
25
+ name: 'Snake'
26
+ }]
27
+ }, {
28
+ name: 'People',
29
+ key: 'People',
30
+ kids: [{
31
+ name: 'Michael'
32
+ }, {
33
+ name: 'Dwight'
34
+ }, {
35
+ name: 'Creed'
36
+ }]
37
+ }, {
38
+ name: null,
39
+ key: 'Fruit',
40
+ kids: [{
41
+ name: 'Apple'
42
+ }, {
43
+ name: 'Strawberry'
44
+ }, {
45
+ name: 'Blueberry'
46
+ }]
47
+ }];
15
48
  var testId = 'test-dropdown';
16
49
  var controlTestId = "".concat(testId, "-input");
17
50
  var testValue = 'test';
@@ -37,6 +70,28 @@ var getComponent = function getComponent() {
37
70
  key: item.name
38
71
  }, item.name);
39
72
  }));
73
+ };
74
+
75
+ var getComponentWithSections = function getComponentWithSections() {
76
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
77
+
78
+ var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
79
+ _ref2$renderFn = _ref2.renderFn,
80
+ renderFn = _ref2$renderFn === void 0 ? render : _ref2$renderFn;
81
+
82
+ return renderFn(___EmotionJSX(OverlayProvider, null, ___EmotionJSX(SelectField, _extends({}, defaultProps, props, {
83
+ items: withSection
84
+ }), function (section) {
85
+ return ___EmotionJSX(Section, {
86
+ key: section.key,
87
+ items: section.kids,
88
+ title: section.name
89
+ }, function (item) {
90
+ return ___EmotionJSX(Item, {
91
+ key: item.name
92
+ }, item.name);
93
+ });
94
+ })));
40
95
  }; // Need to be added to each test file to test accessibility using axe.
41
96
 
42
97
 
@@ -82,4 +137,16 @@ test('passing helper text should display it and correct aria attributes on input
82
137
  expect(visibleInput).toHaveAttribute('aria-invalid', 'true');
83
138
  var helperTextID = helper.getAttribute('id');
84
139
  expect(screen.getByRole('button')).toHaveAttribute('aria-describedby', helperTextID);
140
+ });
141
+ test('passing sections, renders separators', function () {
142
+ getComponentWithSections();
143
+ var button = screen.getByRole('button');
144
+ userEvent.click(button);
145
+ expect(screen.queryAllByRole('separator')).toHaveLength(2);
146
+ });
147
+ test('a blank title does not render', function () {
148
+ getComponentWithSections();
149
+ var button = screen.getByRole('button');
150
+ userEvent.click(button);
151
+ expect(screen.queryByText('Fruit')).not.toBeInTheDocument();
85
152
  });
@@ -121,7 +121,6 @@ export var Default = function Default() {
121
121
  isRow: true,
122
122
  key: item.key
123
123
  }, ___EmotionJSX(Bracket, null), ___EmotionJSX(Box, {
124
- ml: "3px",
125
124
  width: "100%"
126
125
  }, ___EmotionJSX(Box, {
127
126
  variant: "forms.input.container",
@@ -94,14 +94,15 @@ export var Default = function Default(_ref) {
94
94
  }, ___EmotionJSX(Icon, {
95
95
  icon: FormSelectIcon,
96
96
  mr: "sm",
97
- color: "text.primary",
97
+ color: "accent.40",
98
98
  size: 25
99
99
  }), ___EmotionJSX(Text, {
100
100
  variant: "itemTitle",
101
101
  alignSelf: "center"
102
102
  }, item.name)), ___EmotionJSX(Box, {
103
103
  isRow: true,
104
- alignSelf: "center"
104
+ alignSelf: "center",
105
+ gap: "sm"
105
106
  }, ___EmotionJSX(IconButton, {
106
107
  "aria-label": "create-icon"
107
108
  }, ___EmotionJSX(Icon, {
@@ -646,14 +646,10 @@ var buttons = [{
646
646
  }];
647
647
  export var Default = function Default() {
648
648
  var state = useModalState();
649
- return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
650
- onPress: state.open,
651
- "aria-label": "Open modal"
652
- }, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, {
653
- isOpen: state.isOpen,
649
+ return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Modal, {
650
+ isOpen: true,
654
651
  onClose: state.close,
655
- contentProps: sx.contentProps,
656
- isDismissable: true
652
+ contentProps: sx.contentProps
657
653
  }, ___EmotionJSX(Box, {
658
654
  contentProps: true
659
655
  }, ___EmotionJSX(IconButton, {
@@ -680,7 +676,7 @@ export var Default = function Default() {
680
676
  }, ___EmotionJSX(Icon, {
681
677
  icon: button.icon,
682
678
  sx: sx.iconStyle,
683
- size: "58"
679
+ size: 58
684
680
  }), ___EmotionJSX(Text, {
685
681
  sx: sx.buttonLabelStyle
686
682
  }, button.name)));
@@ -17,13 +17,13 @@ var base = {
17
17
  display: 'flex'
18
18
  };
19
19
  var card = {
20
- boxShadow: 'standard',
20
+ boxShadow: '0px 1px 14px rgba(37, 55, 70, 0.15)',
21
+ borderRadius: '3px',
21
22
  p: 'lg',
22
- alignItems: 'center',
23
- justifyContent: 'center',
24
23
  flex: '1 1 0',
25
- fontWeight: 1,
26
- fontSize: 'md'
24
+ fontWeight: 0,
25
+ fontSize: 'md',
26
+ color: 'text.primary'
27
27
  }; // Used to give a border to radio elements
28
28
 
29
29
  var radioContainer = {
@@ -77,7 +77,7 @@ var listViewItem = _objectSpread(_objectSpread({}, base), {}, {
77
77
  },
78
78
  '&.has-separator': {
79
79
  borderBottom: '1px solid',
80
- borderBottomColor: 'line.hairline'
80
+ borderBottomColor: 'neutral.80'
81
81
  },
82
82
  '&.is-focused': {
83
83
  boxShadow: '0 0 0 1px inset #D033FF'
@@ -0,0 +1 @@
1
+ export var DummyText = "\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,\ntotam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae\ndicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, \nsed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, \nqui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora\nincidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum\nexercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel\neum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem \neum fugiat quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis \npraesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate \nnon provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. \nEt harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi \noptio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis \ndolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et \nvoluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut \nreiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.41.0-alpha.0",
3
+ "version": "1.41.0-alpha.2",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",