@pingux/astro 2.116.1-alpha.1 → 2.117.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -106,7 +106,9 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
106
106
  }, propsContentProps, dialogProps, modalProps, {
107
107
  ref: modalRef,
108
108
  "aria-modal": true
109
- }), hasCloseButton && (closeButton !== null && closeButton !== void 0 ? closeButton : (0, _react2.jsx)(_IconButton["default"], {
109
+ }), (0, _react2.jsx)(_Box["default"], {
110
+ variant: "modal.headingContainer"
111
+ }, hasCloseButton && (closeButton !== null && closeButton !== void 0 ? closeButton : (0, _react2.jsx)(_IconButton["default"], {
110
112
  "aria-label": "Close modal window",
111
113
  "data-id": "icon-button__close-modal-window",
112
114
  variant: "modalCloseButton",
@@ -119,7 +121,7 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
119
121
  }))), title && (0, _react2.jsx)(_Text["default"], (0, _extends2["default"])({}, titleProps, {
120
122
  variant: "variants.modal.title",
121
123
  role: "heading"
122
- }), title), children))));
124
+ }), title)), children))));
123
125
  });
124
126
  Modal.defaultProps = {
125
127
  role: 'dialog',
@@ -28,7 +28,6 @@ Modals should:
28
28
  Modals should not:
29
29
  - Be nested inside or replaced by another modal.
30
30
  - Be overused as it disrupts the user’s workflow and requires a response.
31
- - Have content that requires scrolling. If the content length is exceedingly large or requires complex forms, use the [OverlayPanel](./?path=/docs/components-overlaypanel--default) component.
32
31
  - Be used for brief warnings and alerts, use the [Messages](./?path=/docs/components-messages--default) component instead.
33
32
 
34
33
  ### Required Components
@@ -3,3 +3,4 @@ import { ModalProps } from '../../types';
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
4
4
  export default _default;
5
5
  export declare const Default: StoryFn<ModalProps>;
6
+ export declare const LargeContent: StoryFn<ModalProps>;
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
5
5
  _Object$defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = exports.Default = void 0;
8
+ exports["default"] = exports.LargeContent = exports.Default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _storybookAddonDesigns = require("storybook-addon-designs");
@@ -112,7 +112,7 @@ var Default = function Default(args) {
112
112
  }, "Do you want to continue with this action that you\u2018re performing?"), (0, _react2.jsx)(_index.Box, {
113
113
  isRow: true,
114
114
  pt: "lg",
115
- mr: "auto"
115
+ variant: "modal.buttonsContainer"
116
116
  }, (0, _react2.jsx)(_index.Button, {
117
117
  variant: "primary",
118
118
  onPress: state.close,
@@ -139,4 +139,73 @@ Default.parameters = {
139
139
  }]
140
140
  }
141
141
  }
142
- };
142
+ };
143
+ var LargeContent = function LargeContent(args) {
144
+ var state = (0, _hooks.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
+ (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
149
+ onPress: state.open,
150
+ "aria-label": "Open modal"
151
+ }, "Open Modal"), state.isOpen && (0, _react2.jsx)(_index.Modal, (0, _extends2["default"])({}, args, {
152
+ isOpen: state.isOpen,
153
+ onClose: state.close
154
+ }), (0, _react2.jsx)(_index.Text, {
155
+ pt: "lg"
156
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, {
157
+ pt: "lg"
158
+ }, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, {
159
+ pt: "lg"
160
+ }, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, {
161
+ pt: "lg"
162
+ }, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, {
163
+ pt: "lg"
164
+ }, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Text, {
165
+ pt: "lg"
166
+ }, "Eu fugiat nulla pariatur."), (0, _react2.jsx)(_index.Text, {
167
+ pt: "lg"
168
+ }, "Excepteur sint occaecat cupidatat non proident."), (0, _react2.jsx)(_index.Text, {
169
+ pt: "lg"
170
+ }, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), (0, _react2.jsx)(_index.Text, {
171
+ pt: "lg"
172
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, {
173
+ pt: "lg"
174
+ }, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, {
175
+ pt: "lg"
176
+ }, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, {
177
+ pt: "lg"
178
+ }, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, {
179
+ pt: "lg"
180
+ }, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Text, {
181
+ pt: "lg"
182
+ }, "Eu fugiat nulla pariatur."), (0, _react2.jsx)(_index.Text, {
183
+ pt: "lg"
184
+ }, "Excepteur sint occaecat cupidatat non proident."), (0, _react2.jsx)(_index.Text, {
185
+ pt: "lg"
186
+ }, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), (0, _react2.jsx)(_index.Text, {
187
+ pt: "lg"
188
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, {
189
+ pt: "lg"
190
+ }, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, {
191
+ pt: "lg"
192
+ }, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, {
193
+ pt: "lg"
194
+ }, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, {
195
+ pt: "lg"
196
+ }, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Box, {
197
+ isRow: true,
198
+ variant: "modal.buttonsContainer"
199
+ }, (0, _react2.jsx)(_index.Button, {
200
+ variant: "primary",
201
+ onPress: state.close,
202
+ mr: "md",
203
+ "aria-label": "Continue"
204
+ }, "Continue"), (0, _react2.jsx)(_index.Button, {
205
+ variant: "link",
206
+ onPress: state.close,
207
+ "aria-label": "Cancel"
208
+ }, "Cancel"))))
209
+ );
210
+ };
211
+ exports.LargeContent = LargeContent;
@@ -32,6 +32,8 @@ declare const _default: {
32
32
  pl: string;
33
33
  boxShadow: string;
34
34
  borderRadius: number;
35
+ maxHeight: string;
36
+ overflowY: string;
35
37
  '&.is-extra-small': {
36
38
  maxWidth: string;
37
39
  width: string;
@@ -53,6 +55,29 @@ declare const _default: {
53
55
  width: string;
54
56
  };
55
57
  };
58
+ headingContainer: {
59
+ position: string;
60
+ top: string;
61
+ mt: string;
62
+ mb: string;
63
+ mr: string;
64
+ pt: string;
65
+ pr: string;
66
+ pb: string;
67
+ background: string;
68
+ };
69
+ buttonsContainer: {
70
+ position: string;
71
+ bottom: string;
72
+ p: number;
73
+ mb: string;
74
+ pb: string;
75
+ pt: string;
76
+ background: string;
77
+ '& > button': {
78
+ flexGrow: number;
79
+ };
80
+ };
56
81
  title: {
57
82
  mr: string;
58
83
  fontWeight: number;
@@ -43,6 +43,9 @@ var content = {
43
43
  pl: 'lg',
44
44
  boxShadow: 'standard',
45
45
  borderRadius: 3,
46
+ maxHeight: 'calc(100vh - 80px)',
47
+ // 100% of the window minus 40px on top and bottom
48
+ overflowY: 'auto',
46
49
  '&.is-extra-small': {
47
50
  maxWidth: 'none',
48
51
  width: 'container.xs'
@@ -64,6 +67,29 @@ var content = {
64
67
  width: 'container.full'
65
68
  }
66
69
  };
70
+ var headingContainer = {
71
+ position: 'sticky',
72
+ top: '-md',
73
+ mt: '-md',
74
+ mb: '-md',
75
+ mr: '-lg',
76
+ pt: 'md',
77
+ pr: 'lg',
78
+ pb: 'md',
79
+ background: 'white'
80
+ };
81
+ var buttonsContainer = {
82
+ position: 'sticky',
83
+ bottom: '-lg',
84
+ p: 0,
85
+ mb: '-lg',
86
+ pb: 'lg',
87
+ pt: 'lg',
88
+ background: 'white',
89
+ '& > button': {
90
+ flexGrow: 0
91
+ }
92
+ };
67
93
  var title = _objectSpread(_objectSpread({}, _Text.text.title), {}, {
68
94
  mr: 'sm',
69
95
  fontWeight: 3
@@ -80,6 +106,8 @@ var _default = {
80
106
  closeIcon: closeIcon,
81
107
  container: container,
82
108
  content: content,
109
+ headingContainer: headingContainer,
110
+ buttonsContainer: buttonsContainer,
83
111
  title: title,
84
112
  modalCloseButton: modalCloseButton
85
113
  };
@@ -306,6 +306,12 @@ declare const _default: {
306
306
  content: {
307
307
  bg: string;
308
308
  };
309
+ headingContainer: {
310
+ bg: string;
311
+ };
312
+ buttonsContainer: {
313
+ bg: string;
314
+ };
309
315
  };
310
316
  tab: {
311
317
  '&.is-selected': {
@@ -54,6 +54,12 @@ var tab = {
54
54
  var modal = {
55
55
  content: {
56
56
  bg: 'background.base'
57
+ },
58
+ headingContainer: {
59
+ bg: 'background.base'
60
+ },
61
+ buttonsContainer: {
62
+ bg: 'background.base'
57
63
  }
58
64
  };
59
65
  var _default = {
@@ -2230,8 +2230,8 @@ declare const _default: {
2230
2230
  transform: string;
2231
2231
  transition: string;
2232
2232
  m: string[];
2233
- overflow: string;
2234
2233
  maxHeight: string;
2234
+ overflowY: string;
2235
2235
  '&.is-open-no-transition': {
2236
2236
  opacity: string;
2237
2237
  transform: string;
@@ -218,7 +218,7 @@ var baseIconButton = {
218
218
  };
219
219
  var modalCloseButton = _objectSpread(_objectSpread({}, baseIconButton), {}, {
220
220
  position: 'absolute',
221
- top: 22,
221
+ top: 23,
222
222
  right: 22
223
223
  });
224
224
  var onyxIconButton = _objectSpread(_objectSpread(_objectSpread({}, baseIconButton), secondary), {}, {
@@ -413,8 +413,8 @@ declare const _default: {
413
413
  transform: string;
414
414
  transition: string;
415
415
  m: string[];
416
- overflow: string;
417
416
  maxHeight: string;
417
+ overflowY: string;
418
418
  '&.is-open-no-transition': {
419
419
  opacity: string;
420
420
  transform: string;
@@ -150,8 +150,8 @@ var modal = {
150
150
  transform: 'translate(0, -50px)',
151
151
  transition: 'opacity 300ms ease, transform 500ms ease-out',
152
152
  m: ['sm', 'sm', '1.75rem auto'],
153
- overflow: 'hidden',
154
153
  maxHeight: 'calc(100vh - 3.5rem)',
154
+ overflowY: 'auto',
155
155
  '&.is-open-no-transition': {
156
156
  opacity: '100%',
157
157
  transform: 'none'
@@ -95,7 +95,9 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
95
95
  }, propsContentProps, dialogProps, modalProps, {
96
96
  ref: modalRef,
97
97
  "aria-modal": true
98
- }), hasCloseButton && (closeButton !== null && closeButton !== void 0 ? closeButton : ___EmotionJSX(IconButton, {
98
+ }), ___EmotionJSX(Box, {
99
+ variant: "modal.headingContainer"
100
+ }, hasCloseButton && (closeButton !== null && closeButton !== void 0 ? closeButton : ___EmotionJSX(IconButton, {
99
101
  "aria-label": "Close modal window",
100
102
  "data-id": "icon-button__close-modal-window",
101
103
  variant: "modalCloseButton",
@@ -108,7 +110,7 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
108
110
  }))), title && ___EmotionJSX(Text, _extends({}, titleProps, {
109
111
  variant: "variants.modal.title",
110
112
  role: "heading"
111
- }), title), children))));
113
+ }), title)), children))));
112
114
  });
113
115
  Modal.defaultProps = {
114
116
  role: 'dialog',
@@ -28,7 +28,6 @@ Modals should:
28
28
  Modals should not:
29
29
  - Be nested inside or replaced by another modal.
30
30
  - Be overused as it disrupts the user’s workflow and requires a response.
31
- - Have content that requires scrolling. If the content length is exceedingly large or requires complex forms, use the [OverlayPanel](./?path=/docs/components-overlaypanel--default) component.
32
31
  - Be used for brief warnings and alerts, use the [Messages](./?path=/docs/components-messages--default) component instead.
33
32
 
34
33
  ### Required Components
@@ -103,7 +103,7 @@ export var Default = function Default(args) {
103
103
  }, "Do you want to continue with this action that you\u2018re performing?"), ___EmotionJSX(Box, {
104
104
  isRow: true,
105
105
  pt: "lg",
106
- mr: "auto"
106
+ variant: "modal.buttonsContainer"
107
107
  }, ___EmotionJSX(Button, {
108
108
  variant: "primary",
109
109
  onPress: state.close,
@@ -129,4 +129,72 @@ Default.parameters = {
129
129
  }]
130
130
  }
131
131
  }
132
+ };
133
+ export var LargeContent = function LargeContent(args) {
134
+ var state = useModalState();
135
+ return (
136
+ // Application must be wrapped in an OverlayProvider so that it can be hidden from screen
137
+ // readers when an overlay opens.
138
+ ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
139
+ onPress: state.open,
140
+ "aria-label": "Open modal"
141
+ }, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, _extends({}, args, {
142
+ isOpen: state.isOpen,
143
+ onClose: state.close
144
+ }), ___EmotionJSX(Text, {
145
+ pt: "lg"
146
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, {
147
+ pt: "lg"
148
+ }, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, {
149
+ pt: "lg"
150
+ }, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, {
151
+ pt: "lg"
152
+ }, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, {
153
+ pt: "lg"
154
+ }, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, {
155
+ pt: "lg"
156
+ }, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, {
157
+ pt: "lg"
158
+ }, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, {
159
+ pt: "lg"
160
+ }, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, {
161
+ pt: "lg"
162
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, {
163
+ pt: "lg"
164
+ }, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, {
165
+ pt: "lg"
166
+ }, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, {
167
+ pt: "lg"
168
+ }, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, {
169
+ pt: "lg"
170
+ }, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, {
171
+ pt: "lg"
172
+ }, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, {
173
+ pt: "lg"
174
+ }, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, {
175
+ pt: "lg"
176
+ }, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, {
177
+ pt: "lg"
178
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, {
179
+ pt: "lg"
180
+ }, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, {
181
+ pt: "lg"
182
+ }, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, {
183
+ pt: "lg"
184
+ }, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, {
185
+ pt: "lg"
186
+ }, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Box, {
187
+ isRow: true,
188
+ variant: "modal.buttonsContainer"
189
+ }, ___EmotionJSX(Button, {
190
+ variant: "primary",
191
+ onPress: state.close,
192
+ mr: "md",
193
+ "aria-label": "Continue"
194
+ }, "Continue"), ___EmotionJSX(Button, {
195
+ variant: "link",
196
+ onPress: state.close,
197
+ "aria-label": "Cancel"
198
+ }, "Cancel"))))
199
+ );
132
200
  };
@@ -36,6 +36,9 @@ var content = {
36
36
  pl: 'lg',
37
37
  boxShadow: 'standard',
38
38
  borderRadius: 3,
39
+ maxHeight: 'calc(100vh - 80px)',
40
+ // 100% of the window minus 40px on top and bottom
41
+ overflowY: 'auto',
39
42
  '&.is-extra-small': {
40
43
  maxWidth: 'none',
41
44
  width: 'container.xs'
@@ -57,6 +60,29 @@ var content = {
57
60
  width: 'container.full'
58
61
  }
59
62
  };
63
+ var headingContainer = {
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
+ background: 'white'
73
+ };
74
+ var buttonsContainer = {
75
+ position: 'sticky',
76
+ bottom: '-lg',
77
+ p: 0,
78
+ mb: '-lg',
79
+ pb: 'lg',
80
+ pt: 'lg',
81
+ background: 'white',
82
+ '& > button': {
83
+ flexGrow: 0
84
+ }
85
+ };
60
86
  var title = _objectSpread(_objectSpread({}, text.title), {}, {
61
87
  mr: 'sm',
62
88
  fontWeight: 3
@@ -72,6 +98,8 @@ export default {
72
98
  closeIcon: closeIcon,
73
99
  container: container,
74
100
  content: content,
101
+ headingContainer: headingContainer,
102
+ buttonsContainer: buttonsContainer,
75
103
  title: title,
76
104
  modalCloseButton: modalCloseButton
77
105
  };
@@ -46,6 +46,12 @@ var tab = {
46
46
  var modal = {
47
47
  content: {
48
48
  bg: 'background.base'
49
+ },
50
+ headingContainer: {
51
+ bg: 'background.base'
52
+ },
53
+ buttonsContainer: {
54
+ bg: 'background.base'
49
55
  }
50
56
  };
51
57
  export default {
@@ -211,7 +211,7 @@ var baseIconButton = {
211
211
  };
212
212
  var modalCloseButton = _objectSpread(_objectSpread({}, baseIconButton), {}, {
213
213
  position: 'absolute',
214
- top: 22,
214
+ top: 23,
215
215
  right: 22
216
216
  });
217
217
  var onyxIconButton = _objectSpread(_objectSpread(_objectSpread({}, baseIconButton), secondary), {}, {
@@ -141,8 +141,8 @@ var modal = {
141
141
  transform: 'translate(0, -50px)',
142
142
  transition: 'opacity 300ms ease, transform 500ms ease-out',
143
143
  m: ['sm', 'sm', '1.75rem auto'],
144
- overflow: 'hidden',
145
144
  maxHeight: 'calc(100vh - 3.5rem)',
145
+ overflowY: 'auto',
146
146
  '&.is-open-no-transition': {
147
147
  opacity: '100%',
148
148
  transform: 'none'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.116.1-alpha.1",
3
+ "version": "2.117.0-alpha.1",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",