@pingux/astro 2.190.4 → 2.191.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.
- package/lib/cjs/components/IconWrapper/IconWrapper.js +15 -2
- package/lib/cjs/components/IconWrapper/IconWrapper.test.js +2 -1
- package/lib/cjs/components/ListView/ListView.stories.js +1 -3
- package/lib/cjs/components/ListViewItem/ListViewItem.js +1 -1
- 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/cjs/types/iconWrapper.d.ts +1 -0
- package/lib/components/IconWrapper/IconWrapper.js +16 -3
- package/lib/components/IconWrapper/IconWrapper.test.js +2 -1
- package/lib/components/ListView/ListView.stories.js +1 -3
- package/lib/components/ListViewItem/ListViewItem.js +1 -1
- 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
|
@@ -20,6 +20,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/he
|
|
|
20
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
21
|
var _hooks = require("../../hooks");
|
|
22
22
|
var _index = require("../../index");
|
|
23
|
+
var _constants = require("../Avatar/constants");
|
|
24
|
+
var _getColorFromUuid = _interopRequireDefault(require("../Avatar/getColorFromUuid"));
|
|
23
25
|
var _react2 = require("@emotion/react");
|
|
24
26
|
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); }
|
|
25
27
|
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; }
|
|
@@ -33,8 +35,19 @@ var IconWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
33
35
|
title = props.title,
|
|
34
36
|
className = props.className,
|
|
35
37
|
isCircle = props.isCircle,
|
|
38
|
+
colorId = props.colorId,
|
|
36
39
|
sx = props.sx;
|
|
37
40
|
var theme = (0, _hooks.useGetTheme)();
|
|
41
|
+
var safeColorId = colorId || '_INTERNAL_DEFAULT_ID_';
|
|
42
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
43
|
+
if (!color && !colorId) {
|
|
44
|
+
console.warn("[Astro] IconWrapper: No 'color' or 'colorId' provided. " + 'The component is falling back to a default generated color.');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
var finalColor = (0, _react.useMemo)(function () {
|
|
48
|
+
if (color) return color;
|
|
49
|
+
return (0, _getColorFromUuid["default"])(safeColorId, _constants.avatarColors);
|
|
50
|
+
}, [color, safeColorId]);
|
|
38
51
|
var _useTShirtSize = (0, _hooks.useTShirtSize)({
|
|
39
52
|
size: size,
|
|
40
53
|
sizes: theme.iconWrapperSizes
|
|
@@ -48,14 +61,14 @@ var IconWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
48
61
|
ref: ref,
|
|
49
62
|
variant: "iconWrapper.".concat(size),
|
|
50
63
|
sx: _objectSpread({
|
|
51
|
-
backgroundColor: "iconWrapper.wrapper.".concat(
|
|
64
|
+
backgroundColor: "iconWrapper.wrapper.".concat(finalColor)
|
|
52
65
|
}, sx),
|
|
53
66
|
className: classNames
|
|
54
67
|
}, wrapperProps), (0, _react2.jsx)(_index.Icon, (0, _extends2["default"])({
|
|
55
68
|
icon: icon,
|
|
56
69
|
size: sizeProps.size,
|
|
57
70
|
title: title,
|
|
58
|
-
color: "iconWrapper.icon.".concat(
|
|
71
|
+
color: "iconWrapper.icon.".concat(finalColor)
|
|
59
72
|
}, iconProps)));
|
|
60
73
|
});
|
|
61
74
|
var _default = exports["default"] = IconWrapper;
|
|
@@ -17,7 +17,8 @@ var defaultProps = {
|
|
|
17
17
|
name: 'earth icon'
|
|
18
18
|
},
|
|
19
19
|
icon: _EarthIcon["default"],
|
|
20
|
-
size: 'md'
|
|
20
|
+
size: 'md',
|
|
21
|
+
colorId: 'test-color-id'
|
|
21
22
|
};
|
|
22
23
|
var getComponent = function getComponent() {
|
|
23
24
|
return (0, _react2.render)((0, _react3.jsx)(_IconWrapper["default"], (0, _extends2["default"])({}, defaultProps, {
|
|
@@ -385,15 +385,13 @@ var InfiniteLoadingList = exports.InfiniteLoadingList = function InfiniteLoading
|
|
|
385
385
|
return (0, _react2.jsx)(_2.Item, {
|
|
386
386
|
key: item.name
|
|
387
387
|
}, (0, _react2.jsx)(_2.ListViewItem, {
|
|
388
|
+
id: item.name,
|
|
388
389
|
data: {
|
|
389
390
|
text: item.name,
|
|
390
391
|
icon: _FormSelectIcon["default"]
|
|
391
392
|
},
|
|
392
393
|
iconProps: {
|
|
393
394
|
color: 'text.secondary'
|
|
394
|
-
},
|
|
395
|
-
iconWrapperProps: {
|
|
396
|
-
color: 'cyan'
|
|
397
395
|
}
|
|
398
396
|
}, (0, _react2.jsx)(Controls, null)));
|
|
399
397
|
}));
|
|
@@ -69,7 +69,7 @@ var ListViewItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
69
69
|
name: (0, _concat["default"])(_context = "".concat(text)).call(_context, LIST_ITEM_ICON)
|
|
70
70
|
},
|
|
71
71
|
isCircle: true,
|
|
72
|
-
|
|
72
|
+
colorId: others.id
|
|
73
73
|
}, iconWrapperProps)) : (0, _react2.jsx)(_.Box, {
|
|
74
74
|
width: "25px",
|
|
75
75
|
variant: "listViewItem.iconContainer"
|
|
@@ -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,9 +10,11 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
|
-
import React, { forwardRef } from 'react';
|
|
13
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
14
14
|
import { useGetTheme, useStatusClasses, useTShirtSize } from '../../hooks';
|
|
15
15
|
import { Box, Icon } from '../../index';
|
|
16
|
+
import { avatarColors } from '../Avatar/constants';
|
|
17
|
+
import getColorFromUUID from '../Avatar/getColorFromUuid';
|
|
16
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
19
|
var IconWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
18
20
|
var icon = props.icon,
|
|
@@ -23,8 +25,19 @@ var IconWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
23
25
|
title = props.title,
|
|
24
26
|
className = props.className,
|
|
25
27
|
isCircle = props.isCircle,
|
|
28
|
+
colorId = props.colorId,
|
|
26
29
|
sx = props.sx;
|
|
27
30
|
var theme = useGetTheme();
|
|
31
|
+
var safeColorId = colorId || '_INTERNAL_DEFAULT_ID_';
|
|
32
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
33
|
+
if (!color && !colorId) {
|
|
34
|
+
console.warn("[Astro] IconWrapper: No 'color' or 'colorId' provided. " + 'The component is falling back to a default generated color.');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
var finalColor = useMemo(function () {
|
|
38
|
+
if (color) return color;
|
|
39
|
+
return getColorFromUUID(safeColorId, avatarColors);
|
|
40
|
+
}, [color, safeColorId]);
|
|
28
41
|
var _useTShirtSize = useTShirtSize({
|
|
29
42
|
size: size,
|
|
30
43
|
sizes: theme.iconWrapperSizes
|
|
@@ -38,14 +51,14 @@ var IconWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
38
51
|
ref: ref,
|
|
39
52
|
variant: "iconWrapper.".concat(size),
|
|
40
53
|
sx: _objectSpread({
|
|
41
|
-
backgroundColor: "iconWrapper.wrapper.".concat(
|
|
54
|
+
backgroundColor: "iconWrapper.wrapper.".concat(finalColor)
|
|
42
55
|
}, sx),
|
|
43
56
|
className: classNames
|
|
44
57
|
}, wrapperProps), ___EmotionJSX(Icon, _extends({
|
|
45
58
|
icon: icon,
|
|
46
59
|
size: sizeProps.size,
|
|
47
60
|
title: title,
|
|
48
|
-
color: "iconWrapper.icon.".concat(
|
|
61
|
+
color: "iconWrapper.icon.".concat(finalColor)
|
|
49
62
|
}, iconProps)));
|
|
50
63
|
});
|
|
51
64
|
export default IconWrapper;
|
|
@@ -375,15 +375,13 @@ export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
|
375
375
|
return ___EmotionJSX(Item, {
|
|
376
376
|
key: item.name
|
|
377
377
|
}, ___EmotionJSX(ListViewItem, {
|
|
378
|
+
id: item.name,
|
|
378
379
|
data: {
|
|
379
380
|
text: item.name,
|
|
380
381
|
icon: FormSelectIcon
|
|
381
382
|
},
|
|
382
383
|
iconProps: {
|
|
383
384
|
color: 'text.secondary'
|
|
384
|
-
},
|
|
385
|
-
iconWrapperProps: {
|
|
386
|
-
color: 'cyan'
|
|
387
385
|
}
|
|
388
386
|
}, ___EmotionJSX(Controls, null)));
|
|
389
387
|
}));
|
|
@@ -57,7 +57,7 @@ var ListViewItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
57
57
|
name: _concatInstanceProperty(_context = "".concat(text)).call(_context, LIST_ITEM_ICON)
|
|
58
58
|
},
|
|
59
59
|
isCircle: true,
|
|
60
|
-
|
|
60
|
+
colorId: others.id
|
|
61
61
|
}, iconWrapperProps)) : ___EmotionJSX(Box, {
|
|
62
62
|
width: "25px",
|
|
63
63
|
variant: "listViewItem.iconContainer"
|
|
@@ -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: {
|