@pingux/astro 2.149.0 → 2.149.1-alpha.0

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 (61) hide show
  1. package/lib/cjs/components/IconButton/IconButton.styles.d.ts +0 -38
  2. package/lib/cjs/components/IconButton/IconButton.styles.js +7 -8
  3. package/lib/cjs/components/Modal/Modal.js +4 -13
  4. package/lib/cjs/components/Modal/Modal.stories.d.ts +0 -2
  5. package/lib/cjs/components/Modal/Modal.stories.js +47 -90
  6. package/lib/cjs/components/Modal/Modal.styles.d.ts +26 -43
  7. package/lib/cjs/components/Modal/Modal.styles.js +28 -41
  8. package/lib/cjs/components/Modal/index.d.ts +0 -3
  9. package/lib/cjs/components/Modal/index.js +1 -22
  10. package/lib/cjs/components/Modal/tests/Modal.integration.test.js +0 -4
  11. package/lib/cjs/components/Modal/tests/Modal.unit.test.js +0 -4
  12. package/lib/cjs/index.d.ts +1 -1
  13. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.d.ts +0 -46
  14. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +0 -3
  15. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +1 -18
  16. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +1 -18
  17. package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +18 -59
  18. package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +6 -32
  19. package/lib/cjs/styles/themes/next-gen/variants/button.js +5 -6
  20. package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +12 -27
  21. package/lib/cjs/styles/themes/next-gen/variants/variants.js +13 -28
  22. package/lib/cjs/types/Modal.d.ts +0 -19
  23. package/lib/components/IconButton/IconButton.styles.js +8 -9
  24. package/lib/components/Modal/Modal.js +4 -13
  25. package/lib/components/Modal/Modal.stories.js +48 -89
  26. package/lib/components/Modal/Modal.styles.js +27 -39
  27. package/lib/components/Modal/index.js +1 -4
  28. package/lib/components/Modal/tests/Modal.integration.test.js +0 -4
  29. package/lib/components/Modal/tests/Modal.unit.test.js +0 -4
  30. package/lib/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +0 -3
  31. package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +1 -18
  32. package/lib/styles/themes/next-gen/variants/button.js +5 -6
  33. package/lib/styles/themes/next-gen/variants/variants.js +13 -28
  34. package/package.json +1 -1
  35. package/lib/cjs/components/Modal/Convenience/ModalBody.stories.d.ts +0 -7
  36. package/lib/cjs/components/Modal/Convenience/ModalBody.stories.js +0 -30
  37. package/lib/cjs/components/Modal/Convenience/ModalFooter.stories.d.ts +0 -5
  38. package/lib/cjs/components/Modal/Convenience/ModalFooter.stories.js +0 -35
  39. package/lib/cjs/components/Modal/Convenience/ModalHeader.stories.d.ts +0 -5
  40. package/lib/cjs/components/Modal/Convenience/ModalHeader.stories.js +0 -36
  41. package/lib/cjs/components/Modal/ModalBody.d.ts +0 -9
  42. package/lib/cjs/components/Modal/ModalBody.js +0 -34
  43. package/lib/cjs/components/Modal/ModalBody.test.d.ts +0 -1
  44. package/lib/cjs/components/Modal/ModalBody.test.js +0 -64
  45. package/lib/cjs/components/Modal/ModalFooter.d.ts +0 -4
  46. package/lib/cjs/components/Modal/ModalFooter.js +0 -48
  47. package/lib/cjs/components/Modal/ModalFooter.test.d.ts +0 -1
  48. package/lib/cjs/components/Modal/ModalFooter.test.js +0 -98
  49. package/lib/cjs/components/Modal/ModalHeader.d.ts +0 -4
  50. package/lib/cjs/components/Modal/ModalHeader.js +0 -61
  51. package/lib/cjs/components/Modal/ModalHeader.test.d.ts +0 -1
  52. package/lib/cjs/components/Modal/ModalHeader.test.js +0 -96
  53. package/lib/components/Modal/Convenience/ModalBody.stories.js +0 -20
  54. package/lib/components/Modal/Convenience/ModalFooter.stories.js +0 -25
  55. package/lib/components/Modal/Convenience/ModalHeader.stories.js +0 -26
  56. package/lib/components/Modal/ModalBody.js +0 -20
  57. package/lib/components/Modal/ModalBody.test.js +0 -61
  58. package/lib/components/Modal/ModalFooter.js +0 -34
  59. package/lib/components/Modal/ModalFooter.test.js +0 -95
  60. package/lib/components/Modal/ModalHeader.js +0 -47
  61. package/lib/components/Modal/ModalHeader.test.js +0 -93
@@ -3,8 +3,8 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
3
3
  import React, { useState } from 'react';
4
4
  import { withDesign } from 'storybook-addon-designs';
5
5
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
6
- import { useGetTheme, useModalState } from '../../hooks';
7
- import { Box, Button, Item, Menu, Modal, ModalBody, ModalFooter, ModalHeader, OverlayProvider, PopoverMenu, RadioField, RadioGroupField, SearchField, SelectField, Text } from '../../index';
6
+ import { useModalState } from '../../hooks';
7
+ import { Box, Button, Item, Modal, OverlayProvider, RadioField, RadioGroupField, SearchField, SelectField, Text } from '../../index';
8
8
  import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
9
9
  import { modalSizes } from '../../utils/devUtils/constants/modalSizes';
10
10
  import ModalReadme from './Modal.mdx';
@@ -89,6 +89,21 @@ export default {
89
89
  };
90
90
  export var Default = function Default(args) {
91
91
  var state = useModalState();
92
+ var ModalBodyContent = ___EmotionJSX(Box, null, ___EmotionJSX(Text, null, "Do you want to continue with this action that you\u2018re performing?"), ___EmotionJSX(Box, {
93
+ isRow: true,
94
+ mr: "auto",
95
+ width: "100%",
96
+ variant: "modal.buttonsContainer"
97
+ }, ___EmotionJSX(Button, {
98
+ variant: "primary",
99
+ onPress: state.close,
100
+ mr: "md",
101
+ "aria-label": "Continue"
102
+ }, "Continue"), ___EmotionJSX(Button, {
103
+ variant: "link",
104
+ onPress: state.close,
105
+ "aria-label": "Cancel"
106
+ }, "Cancel")));
92
107
  return (
93
108
  // Application must be wrapped in an OverlayProvider so that it can be hidden from screen
94
109
  // readers when an overlay opens.
@@ -98,16 +113,10 @@ export var Default = function Default(args) {
98
113
  tabIndex: state.isOpen ? -1 : 0
99
114
  }, "Open Modal"), (state.isOpen || state.isTransitioning) && ___EmotionJSX(Modal, _extends({}, args, {
100
115
  isOpen: state.isOpen,
101
- state: state
102
- }), ___EmotionJSX(ModalHeader, {
103
- hasCloseButton: true,
104
116
  onClose: state.close,
117
+ state: state,
105
118
  title: "Continue"
106
- }), ___EmotionJSX(ModalBody, null, ___EmotionJSX(Box, null, ___EmotionJSX(Text, null, "Do you want to continue with this action that you\u2018re performing?"))), ___EmotionJSX(ModalFooter, {
107
- onSubmit: state.close,
108
- onCancel: state.close,
109
- primaryButtonText: "Continue"
110
- })))
119
+ }), ModalBodyContent))
111
120
  );
112
121
  };
113
122
  Default.parameters = {
@@ -127,53 +136,27 @@ export var LargeContent = function LargeContent(args) {
127
136
  tabIndex: state.isOpen ? -1 : 0
128
137
  }, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, _extends({}, args, {
129
138
  isOpen: state.isOpen,
130
- onClose: state.close
131
- }), ___EmotionJSX(ModalHeader, {
132
- hasCloseButton: true,
133
139
  onClose: state.close,
134
140
  title: "Lorem Ipsum"
135
- }), ___EmotionJSX(ModalBody, null, ___EmotionJSX(Box, {
141
+ }), ___EmotionJSX(Box, {
136
142
  gap: "lg"
137
- }, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."))), ___EmotionJSX(ModalFooter, {
138
- onSubmit: state.close,
139
- onCancel: state.close
140
- })))
141
- );
142
- };
143
- export var LargeContentWithScroll = function LargeContentWithScroll(args) {
144
- var state = useModalState();
145
- return (
146
- // Application must be wrapped in an OverlayProvider so that it can be hidden from screen
147
- // readers when an overlay opens.
148
- ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
149
- onPress: state.open,
150
- "aria-label": "Open modal",
151
- tabIndex: state.isOpen ? -1 : 0
152
- }, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, _extends({}, args, {
153
- isOpen: state.isOpen,
154
- onClose: state.close
155
- }), ___EmotionJSX(ModalHeader, {
156
- hasCloseButton: true,
157
- onClose: state.close,
158
- title: "Lorem Ipsum"
159
- }), ___EmotionJSX(ModalBody, {
160
- isScrollable: true,
161
- scrollProps: {
162
- maxHeight: '400px'
163
- }
164
- }, ___EmotionJSX(Box, {
165
- gap: "lg",
166
- pr: "lg"
167
- }, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."))), ___EmotionJSX(ModalFooter, {
168
- onSubmit: state.close,
169
- onCancel: state.close
170
- })))
143
+ }, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.")), ___EmotionJSX(Box, {
144
+ isRow: true,
145
+ variant: "modal.buttonsContainer"
146
+ }, ___EmotionJSX(Button, {
147
+ variant: "primary",
148
+ onPress: state.close,
149
+ mr: "md",
150
+ "aria-label": "Continue"
151
+ }, "Continue"), ___EmotionJSX(Button, {
152
+ variant: "link",
153
+ onPress: state.close,
154
+ "aria-label": "Cancel"
155
+ }, "Cancel"))))
171
156
  );
172
157
  };
173
158
  export var WithInputField = function WithInputField() {
174
159
  var state = useModalState();
175
- var _useGetTheme = useGetTheme(),
176
- isOnyx = _useGetTheme.themeState.isOnyx;
177
160
  var _useState = useState(''),
178
161
  _useState2 = _slicedToArray(_useState, 2),
179
162
  value = _useState2[0],
@@ -194,9 +177,8 @@ export var WithInputField = function WithInputField() {
194
177
  }, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, {
195
178
  isOpen: state.isOpen,
196
179
  onClose: state.close
197
- }, ___EmotionJSX(ModalBody, null, ___EmotionJSX(Box, {
198
- gap: "lg",
199
- pt: isOnyx ? '' : 'lg'
180
+ }, ___EmotionJSX(Box, {
181
+ gap: "lg"
200
182
  }, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet consectetur"), ___EmotionJSX(SelectField, {
201
183
  label: "Select an option"
202
184
  }, ___EmotionJSX(Item, null, "Red"), ___EmotionJSX(Item, null, "Green"), ___EmotionJSX(Item, null, "Blue")), ___EmotionJSX(RadioGroupField, {
@@ -235,42 +217,19 @@ export var WithInputField = function WithInputField() {
235
217
  key: item.key,
236
218
  textValue: item.name
237
219
  }, item.name);
238
- }))), ___EmotionJSX(ModalFooter, {
239
- onSubmit: state.close,
240
- onCancel: state.close
241
- })));
242
- };
243
- export var WithPopoverMenu = function WithPopoverMenu() {
244
- var state = useModalState();
245
- return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
246
- onPress: state.open,
247
- "aria-label": "Open modal"
248
- }, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, {
249
- isOpen: state.isOpen,
250
- onClose: state.close
251
- }, ___EmotionJSX(ModalHeader, {
252
- hasCloseButton: true,
253
- onClose: state.close,
254
- title: "Lorem Ipsum"
255
- }), ___EmotionJSX(ModalBody, null, ___EmotionJSX(Box, {
256
- gap: "lg"
257
- }, ___EmotionJSX(PopoverMenu, null, ___EmotionJSX(Button, null, "Click me"), ___EmotionJSX(Menu, {
258
- onAction: function onAction() {
259
- return console.log('on action');
260
- }
261
- }, ___EmotionJSX(Item, {
262
- key: "edit"
263
- }, "Edit"), ___EmotionJSX(Item, {
264
- key: "duplicate"
265
- }, "Duplicate"), ___EmotionJSX(Item, {
266
- key: "delete",
267
- textValue: "delete"
268
- }, ___EmotionJSX(Text, {
269
- color: "critical.bright"
270
- }, "Delete")))))), ___EmotionJSX(ModalFooter, {
271
- onSubmit: state.close,
272
- onCancel: state.close
273
- })));
220
+ }), ___EmotionJSX(Box, {
221
+ isRow: true,
222
+ variant: "modal.buttonsContainer"
223
+ }, ___EmotionJSX(Button, {
224
+ variant: "primary",
225
+ onPress: state.close,
226
+ mr: "md",
227
+ "aria-label": "Continue"
228
+ }, "Continue"), ___EmotionJSX(Button, {
229
+ variant: "link",
230
+ onPress: state.close,
231
+ "aria-label": "Cancel"
232
+ }, "Cancel")))));
274
233
  };
275
234
  WithInputField.parameters = {
276
235
  a11y: {
@@ -23,15 +23,22 @@ var container = {
23
23
  background: '#00000040',
24
24
  display: 'flex',
25
25
  alignItems: 'center',
26
- overflowY: 'auto'
26
+ justifyContent: 'center'
27
27
  };
28
28
  var content = {
29
+ position: 'relative',
29
30
  outline: 'none',
30
31
  background: 'white',
31
32
  color: 'black',
33
+ pt: 'md',
34
+ pr: 'lg',
35
+ pb: 'lg',
36
+ pl: 'lg',
32
37
  boxShadow: 'standard',
33
38
  borderRadius: 3,
34
- margin: 'auto',
39
+ maxHeight: 'calc(100vh - 80px)',
40
+ // 100% of the window minus 40px on top and bottom
41
+ overflowY: 'auto',
35
42
  '&.is-extra-small': {
36
43
  maxWidth: 'none',
37
44
  width: 'container.xs'
@@ -54,40 +61,27 @@ var content = {
54
61
  }
55
62
  };
56
63
  var headingContainer = {
57
- position: 'relative',
58
- backgroundColor: 'background.base',
59
- px: 'lg',
60
- py: 'md'
61
- };
62
- var header = {
63
- position: 'relative',
64
- backgroundColor: 'background.base',
65
- pb: 'md'
66
- };
67
- var body = {};
68
- export var closeButton = {
69
- position: 'absolute',
70
- top: 0,
71
- right: -14,
72
- alignSelf: 'auto',
73
- width: '22px',
74
- height: '22px'
75
- };
76
- var bodyContainer = {
77
- px: 'lg'
78
- };
79
- var footer = {
80
- py: 'lg',
81
- background: 'white',
82
- '& > button': {
83
- flexGrow: 0
84
- }
64
+ position: 'sticky',
65
+ top: '-md',
66
+ mt: '-md',
67
+ mb: '-md',
68
+ mr: '-lg',
69
+ pt: 'md',
70
+ pr: 'lg',
71
+ pb: 'md',
72
+ backgroundColor: 'background.base'
85
73
  };
86
74
  var buttonsContainer = {
75
+ position: 'sticky',
76
+ bottom: '-lg',
87
77
  p: 0,
78
+ mb: '-lg',
88
79
  pb: 'lg',
89
80
  pt: 'lg',
90
- background: 'white'
81
+ background: 'white',
82
+ '& > button': {
83
+ flexGrow: 0
84
+ }
91
85
  };
92
86
  var title = _objectSpread(_objectSpread({}, text.title), {}, {
93
87
  mr: 'sm',
@@ -97,7 +91,6 @@ export var modalCloseButton = {
97
91
  position: 'absolute',
98
92
  top: 14,
99
93
  right: 10,
100
- alignSelf: 'auto',
101
94
  width: '22px',
102
95
  height: '22px'
103
96
  };
@@ -106,12 +99,7 @@ export default {
106
99
  container: container,
107
100
  content: content,
108
101
  headingContainer: headingContainer,
109
- bodyContainer: bodyContainer,
110
- title: title,
111
- modalCloseButton: modalCloseButton,
112
102
  buttonsContainer: buttonsContainer,
113
- header: header,
114
- body: body,
115
- footer: footer,
116
- closeButton: closeButton
103
+ title: title,
104
+ modalCloseButton: modalCloseButton
117
105
  };
@@ -1,4 +1 @@
1
- export { default } from './Modal';
2
- export { default as ModalBody } from './ModalBody';
3
- export { default as ModalFooter } from './ModalFooter';
4
- export { default as ModalHeader } from './ModalHeader';
1
+ export { default } from './Modal';
@@ -78,8 +78,6 @@ test('keyboard interaction with the trigger should open the modal', function ()
78
78
  test('close button should close the modal', function () {
79
79
  getComposedComponent({
80
80
  isDefaultOpen: true
81
- }, {
82
- title: 'Lorem Ipsum'
83
81
  });
84
82
 
85
83
  // Target the close button
@@ -89,8 +87,6 @@ test('close button should close the modal', function () {
89
87
  test('keyboard interactions on the close button should close the modal', function () {
90
88
  getComposedComponent({
91
89
  isDefaultOpen: true
92
- }, {
93
- title: 'Lorem Ipsum'
94
90
  });
95
91
 
96
92
  // Target the close button
@@ -198,7 +198,6 @@ test('should only hide the top-most overlay', function () {
198
198
  });
199
199
  test('should render a close button if hasCloseButton is true', function () {
200
200
  getComponent({
201
- title: 'Lorem Ipsum',
202
201
  hasCloseButton: true
203
202
  });
204
203
  expect(screen.queryByRole('button')).toBeInTheDocument();
@@ -210,7 +209,6 @@ test('should render a custom close button if hasCloseButton is true and custom b
210
209
  });
211
210
  };
212
211
  getComponent({
213
- title: 'Lorem Ipsum',
214
212
  hasCloseButton: true,
215
213
  closeButton: ___EmotionJSX(MyButton, null)
216
214
  });
@@ -219,7 +217,6 @@ test('should render a custom close button if hasCloseButton is true and custom b
219
217
  });
220
218
  test('shouldn\'t auto focus the first tabbable element', function () {
221
219
  getComponent({
222
- title: 'Lorem Ipsum',
223
220
  hasCloseButton: true
224
221
  });
225
222
  var button = screen.queryByRole('button');
@@ -227,7 +224,6 @@ test('shouldn\'t auto focus the first tabbable element', function () {
227
224
  });
228
225
  test('should auto focus the first tabbable element if "hasAutoFocus" is true', function () {
229
226
  getComponent({
230
- title: 'Lorem Ipsum',
231
227
  hasCloseButton: true,
232
228
  hasAutoFocus: true
233
229
  });
@@ -35,7 +35,6 @@ var baseIconButton = {
35
35
  }
36
36
  };
37
37
  var hintButton = _objectSpread({}, baseIconButton);
38
- var modalCloseButton = _objectSpread({}, baseIconButton);
39
38
  var iconButtons = {
40
39
  base: _objectSpread({}, baseIconButton),
41
40
  inverted: _objectSpread(_objectSpread({}, baseIconButton), {}, {
@@ -79,7 +78,6 @@ var iconButtons = {
79
78
  }
80
79
  }),
81
80
  modalCloseButton: _objectSpread({}, baseIconButton),
82
- modalHeaderCloseButton: _objectSpread({}, baseIconButton),
83
81
  messageCloseButton: _objectSpread(_objectSpread({}, baseIconButton), {}, {
84
82
  '&.is-hovered': {
85
83
  backgroundColor: '#455469'
@@ -278,7 +276,6 @@ var buttons = {
278
276
  }
279
277
  },
280
278
  iconButtons: iconButtons,
281
- modalCloseButton: modalCloseButton,
282
279
  listBoxLink: {
283
280
  color: 'blue-400',
284
281
  '&.is-pressed': {
@@ -46,26 +46,9 @@ var modal = {
46
46
  bg: 'background.base'
47
47
  },
48
48
  headingContainer: {
49
- borderBottom: '1px solid',
50
- borderBottomColor: 'border.base',
51
49
  bg: 'background.base'
52
50
  },
53
- header: {
54
- borderBottom: '1px solid',
55
- borderBottomColor: 'border.base',
56
- bg: 'background.base'
57
- },
58
- body: {
59
- bg: 'background.base'
60
- },
61
- footer: {
62
- borderTop: '1px solid',
63
- borderTopColor: 'border.base',
64
- bg: 'background.base'
65
- },
66
- footerContainer: {
67
- borderTop: '1px solid',
68
- borderTopColor: 'border.base',
51
+ buttonsContainer: {
69
52
  bg: 'background.base'
70
53
  }
71
54
  };
@@ -348,7 +348,11 @@ var baseIconButton = {
348
348
  }
349
349
  }
350
350
  };
351
- var modalCloseButton = _objectSpread({}, baseIconButton);
351
+ var modalCloseButton = _objectSpread(_objectSpread({}, baseIconButton), {}, {
352
+ position: 'absolute',
353
+ top: 32,
354
+ right: 18
355
+ });
352
356
  var onyxIconButton = _objectSpread(_objectSpread(_objectSpread({}, baseIconButton), secondary), {}, {
353
357
  path: {
354
358
  fill: 'blue'
@@ -439,11 +443,6 @@ var iconButtons = {
439
443
  display: 'inline-flex'
440
444
  }),
441
445
  modalCloseButton: modalCloseButton,
442
- modalHeaderCloseButton: _objectSpread(_objectSpread({}, modalCloseButton), {}, {
443
- top: '50%',
444
- transform: 'translateY(-50%)',
445
- right: '16px'
446
- }),
447
446
  badge: {
448
447
  deleteButton: _objectSpread(_objectSpread({}, baseIconButton), {}, {
449
448
  borderRadius: '50%',
@@ -71,10 +71,17 @@ var modalSize = {
71
71
  var modal = {
72
72
  content: {
73
73
  boxShadow: '0px 8px 16px 0px rgba(0, 0, 0, 0.5)',
74
- borderRadius: '1em',
74
+ px: 'lg',
75
+ pb: 'lg',
76
+ pt: 0,
77
+ borderRadius: '4px',
75
78
  opacity: 0,
79
+ top: '0',
80
+ transform: 'translate(0, -50px)',
76
81
  transition: 'opacity 300ms ease, transform 500ms ease-out',
77
82
  m: ['sm', 'sm', '1.75rem auto'],
83
+ maxHeight: 'calc(100vh - 3.5rem)',
84
+ overflowY: 'auto',
78
85
  '&.is-open-no-transition': {
79
86
  opacity: '100%',
80
87
  transform: 'none'
@@ -104,35 +111,13 @@ var modal = {
104
111
  maxWidth: modalSize.full
105
112
  }
106
113
  },
107
- headingContainer: {
108
- borderBottom: '1px solid',
109
- borderBottomColor: 'gray-200',
110
- bg: 'background.base',
111
- borderRadius: '1em 1em 0px 0px'
114
+ container: {
115
+ justifyContent: 'start'
112
116
  },
113
117
  header: {
114
- borderBottom: '1px solid',
115
- borderBottomColor: 'gray-200',
116
- borderRadius: '1em 1em 0px 0px',
117
- px: 'lg',
118
- py: 'md'
119
- },
120
- bodyContainer: {
121
- p: 'lg'
122
- },
123
- body: {
124
- p: 'lg'
125
- },
126
- footer: {
127
- borderTop: '1px solid',
128
- borderTopColor: 'gray-200',
129
- borderRadius: '0px 0px 1em 1em',
130
- p: 'lg'
131
- },
132
- footerContainer: {
133
- borderTop: '1px solid',
134
- borderTopColor: 'gray-200',
135
- borderRadius: '0px 0px 1em 1em'
118
+ pt: 'lg',
119
+ bg: 'background.base',
120
+ mb: 'lg'
136
121
  }
137
122
  };
138
123
  var listBox = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.149.0",
3
+ "version": "2.149.1-alpha.0",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,7 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { StoryFn } from '@storybook/react';
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<{
6
- children?: ReactNode;
7
- }>;
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = exports.Default = void 0;
9
- var _react = _interopRequireDefault(require("react"));
10
- var _storybookAddonDesigns = require("storybook-addon-designs");
11
- var _storybookDocsLayout = _interopRequireDefault(require("../../../../.storybook/storybookDocsLayout"));
12
- var _index = require("../../../index");
13
- var _react2 = require("@emotion/react");
14
- var _default = {
15
- title: 'Components/Modal/Convenience/ModalBody',
16
- component: _index.ModalBody,
17
- decorators: [_storybookAddonDesigns.withDesign],
18
- parameters: {
19
- docs: {
20
- page: function page() {
21
- return (0, _react2.jsx)(_storybookDocsLayout["default"], null);
22
- }
23
- }
24
- }
25
- };
26
- exports["default"] = _default;
27
- var Default = function Default() {
28
- return (0, _react2.jsx)(_index.ModalBody, null, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Text, null, "Do you want to continue with this action that you\u2018re performing?")));
29
- };
30
- exports.Default = Default;
@@ -1,5 +0,0 @@
1
- import { StoryFn } from '@storybook/react';
2
- import { ModalFooterProps } from '../../../types/Modal';
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<ModalFooterProps>;
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = exports.Default = void 0;
9
- var _react = _interopRequireDefault(require("react"));
10
- var _storybookAddonDesigns = require("storybook-addon-designs");
11
- var _storybookDocsLayout = _interopRequireDefault(require("../../../../.storybook/storybookDocsLayout"));
12
- var _hooks = require("../../../hooks");
13
- var _index = require("../../../index");
14
- var _react2 = require("@emotion/react");
15
- var _default = {
16
- title: 'Components/Modal/Convenience/ModalFooter',
17
- component: _index.ModalFooter,
18
- decorators: [_storybookAddonDesigns.withDesign],
19
- parameters: {
20
- docs: {
21
- page: function page() {
22
- return (0, _react2.jsx)(_storybookDocsLayout["default"], null);
23
- }
24
- }
25
- }
26
- };
27
- exports["default"] = _default;
28
- var Default = function Default() {
29
- var state = (0, _hooks.useModalState)();
30
- return (0, _react2.jsx)(_index.ModalFooter, {
31
- onSubmit: state.close,
32
- onCancel: state.close
33
- });
34
- };
35
- exports.Default = Default;
@@ -1,5 +0,0 @@
1
- import { StoryFn } from '@storybook/react';
2
- import { ModalHeaderProps } from '../../../types/Modal';
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<ModalHeaderProps>;
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = exports.Default = void 0;
9
- var _react = _interopRequireDefault(require("react"));
10
- var _storybookAddonDesigns = require("storybook-addon-designs");
11
- var _storybookDocsLayout = _interopRequireDefault(require("../../../../.storybook/storybookDocsLayout"));
12
- var _hooks = require("../../../hooks");
13
- var _index = require("../../../index");
14
- var _react2 = require("@emotion/react");
15
- var _default = {
16
- title: 'Components/Modal/Convenience/ModalHeader',
17
- component: _index.ModalHeader,
18
- decorators: [_storybookAddonDesigns.withDesign],
19
- parameters: {
20
- docs: {
21
- page: function page() {
22
- return (0, _react2.jsx)(_storybookDocsLayout["default"], null);
23
- }
24
- }
25
- }
26
- };
27
- exports["default"] = _default;
28
- var Default = function Default() {
29
- var state = (0, _hooks.useModalState)();
30
- return (0, _react2.jsx)(_index.ModalHeader, {
31
- hasCloseButton: true,
32
- onClose: state.close,
33
- title: "Continue"
34
- });
35
- };
36
- exports.Default = Default;
@@ -1,9 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- type ModalBodyProps = {
3
- children?: ReactNode;
4
- isScrollable?: boolean;
5
- scrollProps?: object;
6
- containerProps?: object;
7
- };
8
- declare const ModalBody: React.ForwardRefExoticComponent<ModalBodyProps & React.RefAttributes<HTMLElement>>;
9
- export default ModalBody;