@pingux/astro 2.149.0 → 2.149.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.
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
@@ -360,50 +360,12 @@ declare const _default: {
360
360
  position: string;
361
361
  top: number;
362
362
  right: number;
363
- alignSelf: string;
364
363
  width: string;
365
364
  height: string;
366
365
  justifyContent: string;
367
366
  appearance: string;
368
367
  alignItems: string;
369
- display: string;
370
- flexGrow: number;
371
- flexShrink: number;
372
- borderRadius: string;
373
- cursor: string;
374
- bg: string;
375
- p: string;
376
- path: {
377
- fill: string;
378
- };
379
- outline: string;
380
- '&.is-focused': {
381
- outline: string;
382
- outlineColor: string;
383
- outlineOffset: string;
384
- };
385
- '&.is-hovered': {
386
- bg: string;
387
- boxShadow: string;
388
- };
389
- '&.is-pressed': {
390
- path: {
391
- fill: string;
392
- };
393
- bg: string;
394
- boxShadow: string;
395
- };
396
- };
397
- modalHeaderCloseButton: {
398
- position: string;
399
- top: number;
400
- right: number;
401
368
  alignSelf: string;
402
- width: string;
403
- height: string;
404
- justifyContent: string;
405
- appearance: string;
406
- alignItems: string;
407
369
  display: string;
408
370
  flexGrow: number;
409
371
  flexShrink: number;
@@ -50,7 +50,7 @@ var base = {
50
50
  boxShadow: 'standard'
51
51
  },
52
52
  '&.is-pressed': {
53
- path: {
53
+ 'path': {
54
54
  fill: 'white'
55
55
  },
56
56
  bg: 'active',
@@ -79,7 +79,7 @@ var bidirectional = {
79
79
  var inverted = _objectSpread(_objectSpread({}, base), {}, {
80
80
  bg: 'active',
81
81
  borderColor: 'active',
82
- path: {
82
+ 'path': {
83
83
  fill: 'white'
84
84
  },
85
85
  '&.is-hovered': {
@@ -117,29 +117,29 @@ var applicationPortal = _objectSpread(_objectSpread({}, base), {}, {
117
117
  background: 'transparent',
118
118
  '&.is-focused': _objectSpread({}, _Buttons.defaultFocus),
119
119
  '&.is-hovered': {
120
- path: {
120
+ 'path': {
121
121
  fill: 'active'
122
122
  }
123
123
  },
124
124
  '&.is-pressed': {
125
- path: {
125
+ 'path': {
126
126
  fill: 'active'
127
127
  }
128
128
  }
129
129
  });
130
130
  var applicationPortalPinned = _objectSpread(_objectSpread({}, base), {}, {
131
- path: {
131
+ 'path': {
132
132
  fill: 'success.bright'
133
133
  },
134
134
  background: 'transparent',
135
135
  '&.is-focused': _objectSpread({}, _Buttons.defaultFocus),
136
136
  '&.is-hovered': {
137
- path: {
137
+ 'path': {
138
138
  fill: 'active'
139
139
  }
140
140
  },
141
141
  '&.is-pressed': {
142
- path: {
142
+ 'path': {
143
143
  fill: 'active'
144
144
  }
145
145
  }
@@ -196,7 +196,6 @@ var _default = {
196
196
  inverted: inverted,
197
197
  messageCloseButton: _objectSpread(_objectSpread({}, base), _Message.messageCloseButton),
198
198
  modalCloseButton: _objectSpread(_objectSpread({}, base), _Modal.modalCloseButton),
199
- modalHeaderCloseButton: _objectSpread(_objectSpread({}, base), _Modal.closeButton),
200
199
  invertedBadgeDeleteButton: _Badge.invertedBadgeDeleteButton,
201
200
  invertedSquare: invertedSquare,
202
201
  square: square,
@@ -15,9 +15,7 @@ _Object$defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
17
  exports["default"] = void 0;
18
- var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
19
18
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
20
- var _toArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toArray"));
21
19
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
22
20
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
23
21
  var _react = _interopRequireWildcard(require("react"));
@@ -29,7 +27,6 @@ var _Box = _interopRequireDefault(require("../Box"));
29
27
  var _Icon = _interopRequireDefault(require("../Icon"));
30
28
  var _IconButton = _interopRequireDefault(require("../IconButton"));
31
29
  var _Text = _interopRequireDefault(require("../Text"));
32
- var _ModalHeader = _interopRequireDefault(require("./ModalHeader"));
33
30
  var _react2 = require("@emotion/react");
34
31
  var _excluded = ["className", "closeButton", "hasAutoFocus", "hasCloseButton", "id", "isClosedOnBlur", "isDismissable", "isKeyboardDismissDisabled", "isOpen", "role", "size", "state", "title", "onClose", "shouldCloseOnInteractOutside", "children", "contentProps", "containerProps", "headerContainerProps"];
35
32
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -98,12 +95,7 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
98
95
  var isOpenNoTransition = (state === null || state === void 0 ? void 0 : state.isTransitioning) === undefined && isOpen === true;
99
96
  var _useStatusClasses = (0, _hooks.useStatusClasses)(className, (_useStatusClasses2 = {}, (0, _defineProperty2["default"])(_useStatusClasses2, "is-".concat(size || 'custom'), size), (0, _defineProperty2["default"])(_useStatusClasses2, "isOpen", isOpen), (0, _defineProperty2["default"])(_useStatusClasses2, "isTransitioning", state === null || state === void 0 ? void 0 : state.isTransitioning), (0, _defineProperty2["default"])(_useStatusClasses2, "isOpenNoTransition", isOpenNoTransition), _useStatusClasses2)),
100
97
  classNames = _useStatusClasses.classNames;
101
- var _React$Children$toArr = _react["default"].Children.toArray(children),
102
- _React$Children$toArr2 = (0, _toArray2["default"])(_React$Children$toArr),
103
- header = _React$Children$toArr2[0],
104
- siblings = (0, _slice["default"])(_React$Children$toArr2).call(_React$Children$toArr2, 1);
105
- var hasHeaderContent = /*#__PURE__*/_react["default"].isValidElement(header) && header.type === _ModalHeader["default"];
106
- var titleContent = !hasHeaderContent && title && (isOnyx ? (0, _react2.jsx)(_Box["default"], {
98
+ var titleContent = title && (isOnyx ? (0, _react2.jsx)(_Box["default"], {
107
99
  variant: "modal.header"
108
100
  }, (0, _react2.jsx)(_Text["default"], (0, _extends2["default"])({}, titleProps, {
109
101
  variant: "modalTitle",
@@ -126,7 +118,7 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
126
118
  }, propsContentProps, dialogProps, modalProps, {
127
119
  ref: modalRef,
128
120
  "aria-modal": true
129
- }), titleContent && (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
121
+ }), (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
130
122
  variant: "modal.headingContainer"
131
123
  }, headerContainerProps), hasCloseButton && (closeButton !== null && closeButton !== void 0 ? closeButton : (0, _react2.jsx)(_IconButton["default"], {
132
124
  "aria-label": "Close modal window",
@@ -138,9 +130,8 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
138
130
  title: {
139
131
  name: 'Close Icon'
140
132
  }
141
- }))), titleContent), isOnyx ? children : (0, _react2.jsx)(_Box["default"], {
142
- pt: "md",
143
- px: "lg"
133
+ }))), titleContent), (0, _react2.jsx)(_Box["default"], {
134
+ pt: "md"
144
135
  }, children)))));
145
136
  });
146
137
  Modal.defaultProps = {
@@ -4,6 +4,4 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
4
4
  export default _default;
5
5
  export declare const Default: StoryFn<ModalProps>;
6
6
  export declare const LargeContent: StoryFn<ModalProps>;
7
- export declare const LargeContentWithScroll: StoryFn<ModalProps>;
8
7
  export declare const WithInputField: StoryFn<ModalProps>;
9
- export declare const WithPopoverMenu: StoryFn<ModalProps>;
@@ -8,7 +8,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
8
8
  _Object$defineProperty(exports, "__esModule", {
9
9
  value: true
10
10
  });
11
- exports["default"] = exports.WithPopoverMenu = exports.WithInputField = exports.LargeContentWithScroll = exports.LargeContent = exports.Default = void 0;
11
+ exports["default"] = exports.WithInputField = exports.LargeContent = exports.Default = void 0;
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
13
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
14
14
  var _react = _interopRequireWildcard(require("react"));
@@ -103,6 +103,21 @@ var _default = {
103
103
  exports["default"] = _default;
104
104
  var Default = function Default(args) {
105
105
  var state = (0, _hooks.useModalState)();
106
+ var ModalBodyContent = (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Text, null, "Do you want to continue with this action that you\u2018re performing?"), (0, _react2.jsx)(_index.Box, {
107
+ isRow: true,
108
+ mr: "auto",
109
+ width: "100%",
110
+ variant: "modal.buttonsContainer"
111
+ }, (0, _react2.jsx)(_index.Button, {
112
+ variant: "primary",
113
+ onPress: state.close,
114
+ mr: "md",
115
+ "aria-label": "Continue"
116
+ }, "Continue"), (0, _react2.jsx)(_index.Button, {
117
+ variant: "link",
118
+ onPress: state.close,
119
+ "aria-label": "Cancel"
120
+ }, "Cancel")));
106
121
  return (
107
122
  // Application must be wrapped in an OverlayProvider so that it can be hidden from screen
108
123
  // readers when an overlay opens.
@@ -112,16 +127,10 @@ var Default = function Default(args) {
112
127
  tabIndex: state.isOpen ? -1 : 0
113
128
  }, "Open Modal"), (state.isOpen || state.isTransitioning) && (0, _react2.jsx)(_index.Modal, (0, _extends2["default"])({}, args, {
114
129
  isOpen: state.isOpen,
115
- state: state
116
- }), (0, _react2.jsx)(_index.ModalHeader, {
117
- hasCloseButton: true,
118
130
  onClose: state.close,
131
+ state: state,
119
132
  title: "Continue"
120
- }), (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?"))), (0, _react2.jsx)(_index.ModalFooter, {
121
- onSubmit: state.close,
122
- onCancel: state.close,
123
- primaryButtonText: "Continue"
124
- })))
133
+ }), ModalBodyContent))
125
134
  );
126
135
  };
127
136
  exports.Default = Default;
@@ -142,55 +151,28 @@ var LargeContent = function LargeContent(args) {
142
151
  tabIndex: state.isOpen ? -1 : 0
143
152
  }, "Open Modal"), state.isOpen && (0, _react2.jsx)(_index.Modal, (0, _extends2["default"])({}, args, {
144
153
  isOpen: state.isOpen,
145
- onClose: state.close
146
- }), (0, _react2.jsx)(_index.ModalHeader, {
147
- hasCloseButton: true,
148
154
  onClose: state.close,
149
155
  title: "Lorem Ipsum"
150
- }), (0, _react2.jsx)(_index.ModalBody, null, (0, _react2.jsx)(_index.Box, {
156
+ }), (0, _react2.jsx)(_index.Box, {
151
157
  gap: "lg"
152
- }, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, null, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Text, null, "Eu fugiat nulla pariatur."), (0, _react2.jsx)(_index.Text, null, "Excepteur sint occaecat cupidatat non proident."), (0, _react2.jsx)(_index.Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, null, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Text, null, "Eu fugiat nulla pariatur."), (0, _react2.jsx)(_index.Text, null, "Excepteur sint occaecat cupidatat non proident."), (0, _react2.jsx)(_index.Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, null, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."))), (0, _react2.jsx)(_index.ModalFooter, {
153
- onSubmit: state.close,
154
- onCancel: state.close
155
- })))
158
+ }, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, null, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Text, null, "Eu fugiat nulla pariatur."), (0, _react2.jsx)(_index.Text, null, "Excepteur sint occaecat cupidatat non proident."), (0, _react2.jsx)(_index.Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, null, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Text, null, "Eu fugiat nulla pariatur."), (0, _react2.jsx)(_index.Text, null, "Excepteur sint occaecat cupidatat non proident."), (0, _react2.jsx)(_index.Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, null, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.")), (0, _react2.jsx)(_index.Box, {
159
+ isRow: true,
160
+ variant: "modal.buttonsContainer"
161
+ }, (0, _react2.jsx)(_index.Button, {
162
+ variant: "primary",
163
+ onPress: state.close,
164
+ mr: "md",
165
+ "aria-label": "Continue"
166
+ }, "Continue"), (0, _react2.jsx)(_index.Button, {
167
+ variant: "link",
168
+ onPress: state.close,
169
+ "aria-label": "Cancel"
170
+ }, "Cancel"))))
156
171
  );
157
172
  };
158
173
  exports.LargeContent = LargeContent;
159
- var LargeContentWithScroll = function LargeContentWithScroll(args) {
160
- var state = (0, _hooks.useModalState)();
161
- return (
162
- // Application must be wrapped in an OverlayProvider so that it can be hidden from screen
163
- // readers when an overlay opens.
164
- (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
165
- onPress: state.open,
166
- "aria-label": "Open modal",
167
- tabIndex: state.isOpen ? -1 : 0
168
- }, "Open Modal"), state.isOpen && (0, _react2.jsx)(_index.Modal, (0, _extends2["default"])({}, args, {
169
- isOpen: state.isOpen,
170
- onClose: state.close
171
- }), (0, _react2.jsx)(_index.ModalHeader, {
172
- hasCloseButton: true,
173
- onClose: state.close,
174
- title: "Lorem Ipsum"
175
- }), (0, _react2.jsx)(_index.ModalBody, {
176
- isScrollable: true,
177
- scrollProps: {
178
- maxHeight: '400px'
179
- }
180
- }, (0, _react2.jsx)(_index.Box, {
181
- gap: "lg",
182
- pr: "lg"
183
- }, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, null, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Text, null, "Eu fugiat nulla pariatur."), (0, _react2.jsx)(_index.Text, null, "Excepteur sint occaecat cupidatat non proident."), (0, _react2.jsx)(_index.Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, null, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Text, null, "Eu fugiat nulla pariatur."), (0, _react2.jsx)(_index.Text, null, "Excepteur sint occaecat cupidatat non proident."), (0, _react2.jsx)(_index.Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, null, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."))), (0, _react2.jsx)(_index.ModalFooter, {
184
- onSubmit: state.close,
185
- onCancel: state.close
186
- })))
187
- );
188
- };
189
- exports.LargeContentWithScroll = LargeContentWithScroll;
190
174
  var WithInputField = function WithInputField() {
191
175
  var state = (0, _hooks.useModalState)();
192
- var _useGetTheme = (0, _hooks.useGetTheme)(),
193
- isOnyx = _useGetTheme.themeState.isOnyx;
194
176
  var _useState = (0, _react.useState)(''),
195
177
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
196
178
  value = _useState2[0],
@@ -211,9 +193,8 @@ var WithInputField = function WithInputField() {
211
193
  }, "Open Modal"), state.isOpen && (0, _react2.jsx)(_index.Modal, {
212
194
  isOpen: state.isOpen,
213
195
  onClose: state.close
214
- }, (0, _react2.jsx)(_index.ModalBody, null, (0, _react2.jsx)(_index.Box, {
215
- gap: "lg",
216
- pt: isOnyx ? '' : 'lg'
196
+ }, (0, _react2.jsx)(_index.Box, {
197
+ gap: "lg"
217
198
  }, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet consectetur"), (0, _react2.jsx)(_index.SelectField, {
218
199
  label: "Select an option"
219
200
  }, (0, _react2.jsx)(_index.Item, null, "Red"), (0, _react2.jsx)(_index.Item, null, "Green"), (0, _react2.jsx)(_index.Item, null, "Blue")), (0, _react2.jsx)(_index.RadioGroupField, {
@@ -252,45 +233,21 @@ var WithInputField = function WithInputField() {
252
233
  key: item.key,
253
234
  textValue: item.name
254
235
  }, item.name);
255
- }))), (0, _react2.jsx)(_index.ModalFooter, {
256
- onSubmit: state.close,
257
- onCancel: state.close
258
- })));
236
+ }), (0, _react2.jsx)(_index.Box, {
237
+ isRow: true,
238
+ variant: "modal.buttonsContainer"
239
+ }, (0, _react2.jsx)(_index.Button, {
240
+ variant: "primary",
241
+ onPress: state.close,
242
+ mr: "md",
243
+ "aria-label": "Continue"
244
+ }, "Continue"), (0, _react2.jsx)(_index.Button, {
245
+ variant: "link",
246
+ onPress: state.close,
247
+ "aria-label": "Cancel"
248
+ }, "Cancel")))));
259
249
  };
260
250
  exports.WithInputField = WithInputField;
261
- var WithPopoverMenu = function WithPopoverMenu() {
262
- var state = (0, _hooks.useModalState)();
263
- return (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
264
- onPress: state.open,
265
- "aria-label": "Open modal"
266
- }, "Open Modal"), state.isOpen && (0, _react2.jsx)(_index.Modal, {
267
- isOpen: state.isOpen,
268
- onClose: state.close
269
- }, (0, _react2.jsx)(_index.ModalHeader, {
270
- hasCloseButton: true,
271
- onClose: state.close,
272
- title: "Lorem Ipsum"
273
- }), (0, _react2.jsx)(_index.ModalBody, null, (0, _react2.jsx)(_index.Box, {
274
- gap: "lg"
275
- }, (0, _react2.jsx)(_index.PopoverMenu, null, (0, _react2.jsx)(_index.Button, null, "Click me"), (0, _react2.jsx)(_index.Menu, {
276
- onAction: function onAction() {
277
- return console.log('on action');
278
- }
279
- }, (0, _react2.jsx)(_index.Item, {
280
- key: "edit"
281
- }, "Edit"), (0, _react2.jsx)(_index.Item, {
282
- key: "duplicate"
283
- }, "Duplicate"), (0, _react2.jsx)(_index.Item, {
284
- key: "delete",
285
- textValue: "delete"
286
- }, (0, _react2.jsx)(_index.Text, {
287
- color: "critical.bright"
288
- }, "Delete")))))), (0, _react2.jsx)(_index.ModalFooter, {
289
- onSubmit: state.close,
290
- onCancel: state.close
291
- })));
292
- };
293
- exports.WithPopoverMenu = WithPopoverMenu;
294
251
  WithInputField.parameters = {
295
252
  a11y: {
296
253
  config: {
@@ -1,16 +1,7 @@
1
- export declare const closeButton: {
2
- position: string;
3
- top: number;
4
- right: number;
5
- alignSelf: string;
6
- width: string;
7
- height: string;
8
- };
9
1
  export declare const modalCloseButton: {
10
2
  position: string;
11
3
  top: number;
12
4
  right: number;
13
- alignSelf: string;
14
5
  width: string;
15
6
  height: string;
16
7
  };
@@ -28,15 +19,21 @@ declare const _default: {
28
19
  background: string;
29
20
  display: string;
30
21
  alignItems: string;
31
- overflowY: string;
22
+ justifyContent: string;
32
23
  };
33
24
  content: {
25
+ position: string;
34
26
  outline: string;
35
27
  background: string;
36
28
  color: string;
29
+ pt: string;
30
+ pr: string;
31
+ pb: string;
32
+ pl: string;
37
33
  boxShadow: string;
38
34
  borderRadius: number;
39
- margin: string;
35
+ maxHeight: string;
36
+ overflowY: string;
40
37
  '&.is-extra-small': {
41
38
  maxWidth: string;
42
39
  width: string;
@@ -60,12 +57,26 @@ declare const _default: {
60
57
  };
61
58
  headingContainer: {
62
59
  position: string;
60
+ top: string;
61
+ mt: string;
62
+ mb: string;
63
+ mr: string;
64
+ pt: string;
65
+ pr: string;
66
+ pb: string;
63
67
  backgroundColor: string;
64
- px: string;
65
- py: string;
66
68
  };
67
- bodyContainer: {
68
- px: string;
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
+ };
69
80
  };
70
81
  title: {
71
82
  mr: string;
@@ -83,34 +94,6 @@ declare const _default: {
83
94
  position: string;
84
95
  top: number;
85
96
  right: number;
86
- alignSelf: string;
87
- width: string;
88
- height: string;
89
- };
90
- buttonsContainer: {
91
- p: number;
92
- pb: string;
93
- pt: string;
94
- background: string;
95
- };
96
- header: {
97
- position: string;
98
- backgroundColor: string;
99
- pb: string;
100
- };
101
- body: {};
102
- footer: {
103
- py: string;
104
- background: string;
105
- '& > button': {
106
- flexGrow: number;
107
- };
108
- };
109
- closeButton: {
110
- position: string;
111
- top: number;
112
- right: number;
113
- alignSelf: string;
114
97
  width: string;
115
98
  height: string;
116
99
  };
@@ -12,7 +12,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
12
12
  _Object$defineProperty(exports, "__esModule", {
13
13
  value: true
14
14
  });
15
- exports.modalCloseButton = exports["default"] = exports.closeButton = void 0;
15
+ exports.modalCloseButton = exports["default"] = void 0;
16
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
17
17
  var _Text = require("../Text/Text.styles");
18
18
  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; }
@@ -30,15 +30,22 @@ var container = {
30
30
  background: '#00000040',
31
31
  display: 'flex',
32
32
  alignItems: 'center',
33
- overflowY: 'auto'
33
+ justifyContent: 'center'
34
34
  };
35
35
  var content = {
36
+ position: 'relative',
36
37
  outline: 'none',
37
38
  background: 'white',
38
39
  color: 'black',
40
+ pt: 'md',
41
+ pr: 'lg',
42
+ pb: 'lg',
43
+ pl: 'lg',
39
44
  boxShadow: 'standard',
40
45
  borderRadius: 3,
41
- margin: 'auto',
46
+ maxHeight: 'calc(100vh - 80px)',
47
+ // 100% of the window minus 40px on top and bottom
48
+ overflowY: 'auto',
42
49
  '&.is-extra-small': {
43
50
  maxWidth: 'none',
44
51
  width: 'container.xs'
@@ -61,41 +68,27 @@ var content = {
61
68
  }
62
69
  };
63
70
  var headingContainer = {
64
- position: 'relative',
65
- backgroundColor: 'background.base',
66
- px: 'lg',
67
- py: 'md'
68
- };
69
- var header = {
70
- position: 'relative',
71
- backgroundColor: 'background.base',
72
- pb: 'md'
73
- };
74
- var body = {};
75
- var closeButton = {
76
- position: 'absolute',
77
- top: 0,
78
- right: -14,
79
- alignSelf: 'auto',
80
- width: '22px',
81
- height: '22px'
82
- };
83
- exports.closeButton = closeButton;
84
- var bodyContainer = {
85
- px: 'lg'
86
- };
87
- var footer = {
88
- py: 'lg',
89
- background: 'white',
90
- '& > button': {
91
- flexGrow: 0
92
- }
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
+ backgroundColor: 'background.base'
93
80
  };
94
81
  var buttonsContainer = {
82
+ position: 'sticky',
83
+ bottom: '-lg',
95
84
  p: 0,
85
+ mb: '-lg',
96
86
  pb: 'lg',
97
87
  pt: 'lg',
98
- background: 'white'
88
+ background: 'white',
89
+ '& > button': {
90
+ flexGrow: 0
91
+ }
99
92
  };
100
93
  var title = _objectSpread(_objectSpread({}, _Text.text.title), {}, {
101
94
  mr: 'sm',
@@ -105,7 +98,6 @@ var modalCloseButton = {
105
98
  position: 'absolute',
106
99
  top: 14,
107
100
  right: 10,
108
- alignSelf: 'auto',
109
101
  width: '22px',
110
102
  height: '22px'
111
103
  };
@@ -115,13 +107,8 @@ var _default = {
115
107
  container: container,
116
108
  content: content,
117
109
  headingContainer: headingContainer,
118
- bodyContainer: bodyContainer,
119
- title: title,
120
- modalCloseButton: modalCloseButton,
121
110
  buttonsContainer: buttonsContainer,
122
- header: header,
123
- body: body,
124
- footer: footer,
125
- closeButton: closeButton
111
+ title: title,
112
+ modalCloseButton: modalCloseButton
126
113
  };
127
114
  exports["default"] = _default;
@@ -1,4 +1 @@
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';
@@ -5,31 +5,10 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
5
5
  _Object$defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- _Object$defineProperty(exports, "ModalBody", {
9
- enumerable: true,
10
- get: function get() {
11
- return _ModalBody["default"];
12
- }
13
- });
14
- _Object$defineProperty(exports, "ModalFooter", {
15
- enumerable: true,
16
- get: function get() {
17
- return _ModalFooter["default"];
18
- }
19
- });
20
- _Object$defineProperty(exports, "ModalHeader", {
21
- enumerable: true,
22
- get: function get() {
23
- return _ModalHeader["default"];
24
- }
25
- });
26
8
  _Object$defineProperty(exports, "default", {
27
9
  enumerable: true,
28
10
  get: function get() {
29
11
  return _Modal["default"];
30
12
  }
31
13
  });
32
- var _Modal = _interopRequireDefault(require("./Modal"));
33
- var _ModalBody = _interopRequireDefault(require("./ModalBody"));
34
- var _ModalFooter = _interopRequireDefault(require("./ModalFooter"));
35
- var _ModalHeader = _interopRequireDefault(require("./ModalHeader"));
14
+ var _Modal = _interopRequireDefault(require("./Modal"));
@@ -79,8 +79,6 @@ test('keyboard interaction with the trigger should open the modal', function ()
79
79
  test('close button should close the modal', function () {
80
80
  getComposedComponent({
81
81
  isDefaultOpen: true
82
- }, {
83
- title: 'Lorem Ipsum'
84
82
  });
85
83
 
86
84
  // Target the close button
@@ -90,8 +88,6 @@ test('close button should close the modal', function () {
90
88
  test('keyboard interactions on the close button should close the modal', function () {
91
89
  getComposedComponent({
92
90
  isDefaultOpen: true
93
- }, {
94
- title: 'Lorem Ipsum'
95
91
  });
96
92
 
97
93
  // Target the close button