@pingux/astro 2.190.4-alpha.0 → 2.191.0-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.
- package/lib/cjs/components/Modal/Modal.js +3 -2
- package/lib/cjs/components/Modal/Modal.stories.js +25 -1
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +2 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +8 -0
- package/lib/cjs/styles/themes/next-gen/sizes.d.ts +3 -0
- package/lib/cjs/styles/themes/next-gen/sizes.js +7 -1
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +5 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +6 -0
- package/lib/cjs/types/Modal.d.ts +1 -0
- package/lib/components/Modal/Modal.js +3 -2
- package/lib/components/Modal/Modal.stories.js +24 -0
- package/lib/styles/themes/next-gen/convertedComponentList.js +2 -1
- package/lib/styles/themes/next-gen/sizes.js +7 -1
- package/lib/styles/themes/next-gen/variants/variants.js +6 -0
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
|
31
31
|
var _Text = _interopRequireDefault(require("../Text"));
|
|
32
32
|
var _ModalHeader = _interopRequireDefault(require("./ModalHeader"));
|
|
33
33
|
var _react2 = require("@emotion/react");
|
|
34
|
-
var _excluded = ["className", "closeButton", "hasAutoFocus", "hasCloseButton", "id", "isClosedOnBlur", "isDismissable", "isKeyboardDismissDisabled", "isOpen", "role", "size", "state", "title", "onClose", "shouldCloseOnInteractOutside", "children", "contentProps", "containerProps", "headerContainerProps"];
|
|
34
|
+
var _excluded = ["className", "closeButton", "hasAutoFocus", "hasCloseButton", "id", "isClosedOnBlur", "isDismissable", "isKeyboardDismissDisabled", "isOpen", "role", "size", "state", "title", "onClose", "shouldCloseOnInteractOutside", "children", "contentProps", "containerProps", "headerContainerProps", "isNotFullPage"];
|
|
35
35
|
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
36
36
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
37
37
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -55,6 +55,7 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
55
55
|
propsContentProps = props.contentProps,
|
|
56
56
|
containerProps = props.containerProps,
|
|
57
57
|
headerContainerProps = props.headerContainerProps,
|
|
58
|
+
isNotFullPage = props.isNotFullPage,
|
|
58
59
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
59
60
|
var contentProps = _objectSpread({
|
|
60
61
|
id: id,
|
|
@@ -94,7 +95,7 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
94
95
|
// useMountTransition hook will not break, because this className gives the
|
|
95
96
|
// component the styling properties that it needs.
|
|
96
97
|
var isOpenNoTransition = (state === null || state === void 0 ? void 0 : state.isTransitioning) === undefined && isOpen === true;
|
|
97
|
-
var _useStatusClasses = (0, _hooks.useStatusClasses)(className, (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, "is-".concat(size || 'custom'), size), "isOpen", isOpen), "isTransitioning", state === null || state === void 0 ? void 0 : state.isTransitioning), "isOpenNoTransition", isOpenNoTransition)),
|
|
98
|
+
var _useStatusClasses = (0, _hooks.useStatusClasses)(className, (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, "is-".concat(size || 'custom'), size), "isOpen", isOpen), "isTransitioning", state === null || state === void 0 ? void 0 : state.isTransitioning), "isOpenNoTransition", isOpenNoTransition), "isNotFullPage", isNotFullPage)),
|
|
98
99
|
classNames = _useStatusClasses.classNames;
|
|
99
100
|
var _React$Children$toArr = _react["default"].Children.toArray(children),
|
|
100
101
|
_React$Children$toArr2 = (0, _toArray2["default"])(_React$Children$toArr),
|
|
@@ -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.WithComboBoxField = exports.LargeContentWithScroll = exports.LargeContent = exports.Default = void 0;
|
|
11
|
+
exports["default"] = exports.WithPopoverMenu = exports.WithNotFullPage = exports.WithInputField = exports.WithComboBoxField = exports.LargeContentWithScroll = 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"));
|
|
@@ -299,4 +299,28 @@ var WithComboBoxField = exports.WithComboBoxField = function WithComboBoxField()
|
|
|
299
299
|
"data-id": item.name
|
|
300
300
|
}, item.name);
|
|
301
301
|
})))));
|
|
302
|
+
};
|
|
303
|
+
var WithNotFullPage = exports.WithNotFullPage = function WithNotFullPage(args) {
|
|
304
|
+
var state = (0, _hooks.useModalState)();
|
|
305
|
+
return (
|
|
306
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
|
307
|
+
// readers when an overlay opens.
|
|
308
|
+
(0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
|
|
309
|
+
onPress: state.open,
|
|
310
|
+
"aria-label": "Open modal",
|
|
311
|
+
tabIndex: state.isOpen ? -1 : 0
|
|
312
|
+
}, "Open Modal"), (state.isOpen || state.isTransitioning) && (0, _react2.jsx)(_index.Modal, (0, _extends2["default"])({}, args, {
|
|
313
|
+
isOpen: state.isOpen,
|
|
314
|
+
onClose: state.close,
|
|
315
|
+
isNotFullPage: true
|
|
316
|
+
}), (0, _react2.jsx)(_index.ModalHeader, {
|
|
317
|
+
hasCloseButton: true,
|
|
318
|
+
onClose: state.close,
|
|
319
|
+
title: "Continue"
|
|
320
|
+
}), (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, {
|
|
321
|
+
onSubmit: state.close,
|
|
322
|
+
onCancel: state.close,
|
|
323
|
+
primaryButtonText: "Continue"
|
|
324
|
+
})))
|
|
325
|
+
);
|
|
302
326
|
};
|
|
@@ -30,7 +30,8 @@ var astroBlacklistStory = exports.astroBlacklistStory = {
|
|
|
30
30
|
Loader: ['Circular', 'Custom Circular'],
|
|
31
31
|
Card: ['With Shadow'],
|
|
32
32
|
ListViewItem: ['With Expandable Item'],
|
|
33
|
-
MaterialSymbolIcon: ['Default', 'Sizes', 'Commonly Used']
|
|
33
|
+
MaterialSymbolIcon: ['Default', 'Sizes', 'Commonly Used'],
|
|
34
|
+
Modal: ['With Full Page']
|
|
34
35
|
};
|
|
35
36
|
var nextGenOnlyComponents = exports.nextGenOnlyComponents = ['NavigationHeader', 'Prompt', 'AI Panel', 'Response', 'Suggestions', 'Prompt Input', 'Footer', 'Onyx Input Patterns'];
|
|
36
37
|
var onyxOnlyRecipes = exports.onyxOnlyRecipes = ['Vertical Onyx Stepper'];
|
|
@@ -3219,6 +3219,9 @@ declare const _default: {
|
|
|
3219
3219
|
icons: {
|
|
3220
3220
|
xxxl: string;
|
|
3221
3221
|
};
|
|
3222
|
+
sideNav: {
|
|
3223
|
+
halfWidth: string;
|
|
3224
|
+
};
|
|
3222
3225
|
};
|
|
3223
3226
|
badges: {
|
|
3224
3227
|
dataTableBadge: {
|
|
@@ -5775,6 +5778,11 @@ declare const _default: {
|
|
|
5775
5778
|
width: string;
|
|
5776
5779
|
maxWidth: string[];
|
|
5777
5780
|
};
|
|
5781
|
+
'&.is-not-full-page': {
|
|
5782
|
+
position: string;
|
|
5783
|
+
margin: string;
|
|
5784
|
+
left: string;
|
|
5785
|
+
};
|
|
5778
5786
|
};
|
|
5779
5787
|
headingContainer: {
|
|
5780
5788
|
borderBottom: string;
|
|
@@ -6,6 +6,11 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _onyxTokens = require("@pingux/onyx-tokens");
|
|
9
|
+
var sidenavWidth = 230;
|
|
10
|
+
var halfSidenavWidth = sidenavWidth / 2;
|
|
11
|
+
var sideNav = {
|
|
12
|
+
halfWidth: "".concat(halfSidenavWidth, "px")
|
|
13
|
+
};
|
|
9
14
|
var fontSizes = _onyxTokens.astroTokens["default"]['font-size'];
|
|
10
15
|
var avatar = {
|
|
11
16
|
sm: "".concat(_onyxTokens.astroTokens.size.avatar.sm, "px"),
|
|
@@ -50,5 +55,6 @@ var _default = exports["default"] = {
|
|
|
50
55
|
avatarFontSize: avatarFontSize,
|
|
51
56
|
container: container,
|
|
52
57
|
iconBadge: iconBadge,
|
|
53
|
-
icons: icons
|
|
58
|
+
icons: icons,
|
|
59
|
+
sideNav: sideNav
|
|
54
60
|
};
|
|
@@ -1146,6 +1146,11 @@ declare const _default: {
|
|
|
1146
1146
|
width: string;
|
|
1147
1147
|
maxWidth: string[];
|
|
1148
1148
|
};
|
|
1149
|
+
'&.is-not-full-page': {
|
|
1150
|
+
position: string;
|
|
1151
|
+
margin: string;
|
|
1152
|
+
left: string;
|
|
1153
|
+
};
|
|
1149
1154
|
};
|
|
1150
1155
|
headingContainer: {
|
|
1151
1156
|
borderBottom: string;
|
|
@@ -20,6 +20,7 @@ var _onyxTokens = require("@pingux/onyx-tokens");
|
|
|
20
20
|
var _Attachment = _interopRequireDefault(require("../../../../components/AIComponents/Attachment/Attachment.styles"));
|
|
21
21
|
var _Skeleton = _interopRequireDefault(require("../../../../components/Skeleton/Skeleton.styles"));
|
|
22
22
|
var _codeView = _interopRequireDefault(require("../codeView/codeView"));
|
|
23
|
+
var _sizes = _interopRequireDefault(require("../sizes"));
|
|
23
24
|
var _accordion = _interopRequireDefault(require("./accordion"));
|
|
24
25
|
var _accordionGrid = _interopRequireDefault(require("./accordionGrid"));
|
|
25
26
|
var _avatar = require("./avatar");
|
|
@@ -116,6 +117,11 @@ var modal = {
|
|
|
116
117
|
'&.is-full': {
|
|
117
118
|
width: '100%',
|
|
118
119
|
maxWidth: modalSize.full
|
|
120
|
+
},
|
|
121
|
+
'&.is-not-full-page': {
|
|
122
|
+
position: 'relative',
|
|
123
|
+
margin: '4.75rem 0px',
|
|
124
|
+
left: _sizes["default"].sideNav.halfWidth // 115,
|
|
119
125
|
}
|
|
120
126
|
},
|
|
121
127
|
headingContainer: {
|
package/lib/cjs/types/Modal.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export interface ModalProps extends DOMAttributes, TestingAttributes {
|
|
|
60
60
|
/** Props object spread directly into the modal container Box. */
|
|
61
61
|
containerProps?: object;
|
|
62
62
|
headerContainerProps?: object;
|
|
63
|
+
isNotFullPage?: boolean;
|
|
63
64
|
}
|
|
64
65
|
export interface ModalHeaderProps extends StyleProps {
|
|
65
66
|
titleProps?: object;
|
|
@@ -10,7 +10,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
|
10
10
|
import _toArray from "@babel/runtime-corejs3/helpers/esm/toArray";
|
|
11
11
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
12
12
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
13
|
-
var _excluded = ["className", "closeButton", "hasAutoFocus", "hasCloseButton", "id", "isClosedOnBlur", "isDismissable", "isKeyboardDismissDisabled", "isOpen", "role", "size", "state", "title", "onClose", "shouldCloseOnInteractOutside", "children", "contentProps", "containerProps", "headerContainerProps"];
|
|
13
|
+
var _excluded = ["className", "closeButton", "hasAutoFocus", "hasCloseButton", "id", "isClosedOnBlur", "isDismissable", "isKeyboardDismissDisabled", "isOpen", "role", "size", "state", "title", "onClose", "shouldCloseOnInteractOutside", "children", "contentProps", "containerProps", "headerContainerProps", "isNotFullPage"];
|
|
14
14
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
15
15
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -45,6 +45,7 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
45
45
|
propsContentProps = props.contentProps,
|
|
46
46
|
containerProps = props.containerProps,
|
|
47
47
|
headerContainerProps = props.headerContainerProps,
|
|
48
|
+
isNotFullPage = props.isNotFullPage,
|
|
48
49
|
others = _objectWithoutProperties(props, _excluded);
|
|
49
50
|
var contentProps = _objectSpread({
|
|
50
51
|
id: id,
|
|
@@ -84,7 +85,7 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
84
85
|
// useMountTransition hook will not break, because this className gives the
|
|
85
86
|
// component the styling properties that it needs.
|
|
86
87
|
var isOpenNoTransition = (state === null || state === void 0 ? void 0 : state.isTransitioning) === undefined && isOpen === true;
|
|
87
|
-
var _useStatusClasses = useStatusClasses(className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "is-".concat(size || 'custom'), size), "isOpen", isOpen), "isTransitioning", state === null || state === void 0 ? void 0 : state.isTransitioning), "isOpenNoTransition", isOpenNoTransition)),
|
|
88
|
+
var _useStatusClasses = useStatusClasses(className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "is-".concat(size || 'custom'), size), "isOpen", isOpen), "isTransitioning", state === null || state === void 0 ? void 0 : state.isTransitioning), "isOpenNoTransition", isOpenNoTransition), "isNotFullPage", isNotFullPage)),
|
|
88
89
|
classNames = _useStatusClasses.classNames;
|
|
89
90
|
var _React$Children$toArr = React.Children.toArray(children),
|
|
90
91
|
_React$Children$toArr2 = _toArray(_React$Children$toArr),
|
|
@@ -287,4 +287,28 @@ export var WithComboBoxField = function WithComboBoxField() {
|
|
|
287
287
|
"data-id": item.name
|
|
288
288
|
}, item.name);
|
|
289
289
|
})))));
|
|
290
|
+
};
|
|
291
|
+
export var WithNotFullPage = function WithNotFullPage(args) {
|
|
292
|
+
var state = useModalState();
|
|
293
|
+
return (
|
|
294
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
|
295
|
+
// readers when an overlay opens.
|
|
296
|
+
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
|
|
297
|
+
onPress: state.open,
|
|
298
|
+
"aria-label": "Open modal",
|
|
299
|
+
tabIndex: state.isOpen ? -1 : 0
|
|
300
|
+
}, "Open Modal"), (state.isOpen || state.isTransitioning) && ___EmotionJSX(Modal, _extends({}, args, {
|
|
301
|
+
isOpen: state.isOpen,
|
|
302
|
+
onClose: state.close,
|
|
303
|
+
isNotFullPage: true
|
|
304
|
+
}), ___EmotionJSX(ModalHeader, {
|
|
305
|
+
hasCloseButton: true,
|
|
306
|
+
onClose: state.close,
|
|
307
|
+
title: "Continue"
|
|
308
|
+
}), ___EmotionJSX(ModalBody, null, ___EmotionJSX(Box, null, ___EmotionJSX(Text, null, "Do you want to continue with this action that you\u2018re performing?"))), ___EmotionJSX(ModalFooter, {
|
|
309
|
+
onSubmit: state.close,
|
|
310
|
+
onCancel: state.close,
|
|
311
|
+
primaryButtonText: "Continue"
|
|
312
|
+
})))
|
|
313
|
+
);
|
|
290
314
|
};
|
|
@@ -23,7 +23,8 @@ export var astroBlacklistStory = {
|
|
|
23
23
|
Loader: ['Circular', 'Custom Circular'],
|
|
24
24
|
Card: ['With Shadow'],
|
|
25
25
|
ListViewItem: ['With Expandable Item'],
|
|
26
|
-
MaterialSymbolIcon: ['Default', 'Sizes', 'Commonly Used']
|
|
26
|
+
MaterialSymbolIcon: ['Default', 'Sizes', 'Commonly Used'],
|
|
27
|
+
Modal: ['With Full Page']
|
|
27
28
|
};
|
|
28
29
|
export var nextGenOnlyComponents = ['NavigationHeader', 'Prompt', 'AI Panel', 'Response', 'Suggestions', 'Prompt Input', 'Footer', 'Onyx Input Patterns'];
|
|
29
30
|
export var onyxOnlyRecipes = ['Vertical Onyx Stepper'];
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { astroTokens } from '@pingux/onyx-tokens';
|
|
2
|
+
var sidenavWidth = 230;
|
|
3
|
+
var halfSidenavWidth = sidenavWidth / 2;
|
|
4
|
+
var sideNav = {
|
|
5
|
+
halfWidth: "".concat(halfSidenavWidth, "px")
|
|
6
|
+
};
|
|
2
7
|
var fontSizes = astroTokens["default"]['font-size'];
|
|
3
8
|
var avatar = {
|
|
4
9
|
sm: "".concat(astroTokens.size.avatar.sm, "px"),
|
|
@@ -43,5 +48,6 @@ export default {
|
|
|
43
48
|
avatarFontSize: avatarFontSize,
|
|
44
49
|
container: container,
|
|
45
50
|
iconBadge: iconBadge,
|
|
46
|
-
icons: icons
|
|
51
|
+
icons: icons,
|
|
52
|
+
sideNav: sideNav
|
|
47
53
|
};
|
|
@@ -13,6 +13,7 @@ import { astroTokens } from '@pingux/onyx-tokens';
|
|
|
13
13
|
import attachment from '../../../../components/AIComponents/Attachment/Attachment.styles';
|
|
14
14
|
import skeleton from '../../../../components/Skeleton/Skeleton.styles';
|
|
15
15
|
import codeView from '../codeView/codeView';
|
|
16
|
+
import sizes from '../sizes';
|
|
16
17
|
import accordion from './accordion';
|
|
17
18
|
import accordionGrid from './accordionGrid';
|
|
18
19
|
import { avatar } from './avatar';
|
|
@@ -106,6 +107,11 @@ var modal = {
|
|
|
106
107
|
'&.is-full': {
|
|
107
108
|
width: '100%',
|
|
108
109
|
maxWidth: modalSize.full
|
|
110
|
+
},
|
|
111
|
+
'&.is-not-full-page': {
|
|
112
|
+
position: 'relative',
|
|
113
|
+
margin: '4.75rem 0px',
|
|
114
|
+
left: sizes.sideNav.halfWidth // 115,
|
|
109
115
|
}
|
|
110
116
|
},
|
|
111
117
|
headingContainer: {
|