@pingux/astro 2.152.0 → 2.153.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/IconButton/IconButton.styles.d.ts +38 -0
- package/lib/cjs/components/IconButton/IconButton.styles.js +8 -7
- package/lib/cjs/components/Modal/Convenience/ModalBody.stories.d.ts +7 -0
- package/lib/cjs/components/Modal/Convenience/ModalBody.stories.js +30 -0
- package/lib/cjs/components/Modal/Convenience/ModalFooter.stories.d.ts +5 -0
- package/lib/cjs/components/Modal/Convenience/ModalFooter.stories.js +35 -0
- package/lib/cjs/components/Modal/Convenience/ModalHeader.stories.d.ts +5 -0
- package/lib/cjs/components/Modal/Convenience/ModalHeader.stories.js +36 -0
- package/lib/cjs/components/Modal/Modal.js +14 -4
- package/lib/cjs/components/Modal/Modal.stories.d.ts +2 -0
- package/lib/cjs/components/Modal/Modal.stories.js +84 -48
- package/lib/cjs/components/Modal/Modal.styles.d.ts +42 -26
- package/lib/cjs/components/Modal/Modal.styles.js +39 -27
- package/lib/cjs/components/Modal/ModalBody.d.ts +9 -0
- package/lib/cjs/components/Modal/ModalBody.js +34 -0
- package/lib/cjs/components/Modal/ModalBody.test.d.ts +1 -0
- package/lib/cjs/components/Modal/ModalBody.test.js +64 -0
- package/lib/cjs/components/Modal/ModalFooter.d.ts +4 -0
- package/lib/cjs/components/Modal/ModalFooter.js +48 -0
- package/lib/cjs/components/Modal/ModalFooter.test.d.ts +1 -0
- package/lib/cjs/components/Modal/ModalFooter.test.js +98 -0
- package/lib/cjs/components/Modal/ModalHeader.d.ts +4 -0
- package/lib/cjs/components/Modal/ModalHeader.js +61 -0
- package/lib/cjs/components/Modal/ModalHeader.test.d.ts +1 -0
- package/lib/cjs/components/Modal/ModalHeader.test.js +96 -0
- package/lib/cjs/components/Modal/index.d.ts +3 -0
- package/lib/cjs/components/Modal/index.js +22 -1
- package/lib/cjs/components/Modal/tests/Modal.integration.test.js +4 -0
- package/lib/cjs/components/Modal/tests/Modal.unit.test.js +4 -0
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.d.ts +36 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +3 -0
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +54 -18
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +32 -6
- package/lib/cjs/styles/themes/next-gen/variants/button.js +6 -5
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +22 -12
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +23 -13
- package/lib/cjs/types/Modal.d.ts +19 -0
- package/lib/components/IconButton/IconButton.styles.js +9 -8
- package/lib/components/Modal/Convenience/ModalBody.stories.js +20 -0
- package/lib/components/Modal/Convenience/ModalFooter.stories.js +25 -0
- package/lib/components/Modal/Convenience/ModalHeader.stories.js +26 -0
- package/lib/components/Modal/Modal.js +14 -4
- package/lib/components/Modal/Modal.stories.js +82 -48
- package/lib/components/Modal/Modal.styles.js +37 -26
- package/lib/components/Modal/ModalBody.js +20 -0
- package/lib/components/Modal/ModalBody.test.js +61 -0
- package/lib/components/Modal/ModalFooter.js +34 -0
- package/lib/components/Modal/ModalFooter.test.js +95 -0
- package/lib/components/Modal/ModalHeader.js +47 -0
- package/lib/components/Modal/ModalHeader.test.js +93 -0
- package/lib/components/Modal/index.js +4 -1
- package/lib/components/Modal/tests/Modal.integration.test.js +4 -0
- package/lib/components/Modal/tests/Modal.unit.test.js +4 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +3 -0
- package/lib/styles/themes/next-gen/variants/button.js +6 -5
- package/lib/styles/themes/next-gen/variants/variants.js +23 -13
- package/package.json +1 -1
|
@@ -360,12 +360,50 @@ declare const _default: {
|
|
|
360
360
|
position: string;
|
|
361
361
|
top: number;
|
|
362
362
|
right: number;
|
|
363
|
+
alignSelf: string;
|
|
363
364
|
width: string;
|
|
364
365
|
height: string;
|
|
365
366
|
justifyContent: string;
|
|
366
367
|
appearance: string;
|
|
367
368
|
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;
|
|
368
401
|
alignSelf: string;
|
|
402
|
+
width: string;
|
|
403
|
+
height: string;
|
|
404
|
+
justifyContent: string;
|
|
405
|
+
appearance: string;
|
|
406
|
+
alignItems: string;
|
|
369
407
|
display: string;
|
|
370
408
|
flexGrow: number;
|
|
371
409
|
flexShrink: number;
|
|
@@ -50,7 +50,7 @@ var base = {
|
|
|
50
50
|
boxShadow: 'standard'
|
|
51
51
|
},
|
|
52
52
|
'&.is-pressed': {
|
|
53
|
-
|
|
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
|
-
|
|
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
|
-
|
|
120
|
+
path: {
|
|
121
121
|
fill: 'active'
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
'&.is-pressed': {
|
|
125
|
-
|
|
125
|
+
path: {
|
|
126
126
|
fill: 'active'
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
var applicationPortalPinned = _objectSpread(_objectSpread({}, base), {}, {
|
|
131
|
-
|
|
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
|
-
|
|
137
|
+
path: {
|
|
138
138
|
fill: 'active'
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
'&.is-pressed': {
|
|
142
|
-
|
|
142
|
+
path: {
|
|
143
143
|
fill: 'active'
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -196,6 +196,7 @@ 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),
|
|
199
200
|
invertedBadgeDeleteButton: _Badge.invertedBadgeDeleteButton,
|
|
200
201
|
invertedSquare: invertedSquare,
|
|
201
202
|
square: square,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StoryFn } from '@storybook/react';
|
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: StoryFn<{
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.Default = void 0;
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _storybookAddonDesigns = require("storybook-addon-designs");
|
|
11
|
+
var _storybookDocsLayout = _interopRequireDefault(require("../../../../.storybook/storybookDocsLayout"));
|
|
12
|
+
var _index = require("../../../index");
|
|
13
|
+
var _react2 = require("@emotion/react");
|
|
14
|
+
var _default = {
|
|
15
|
+
title: 'Components/Modal/Convenience/ModalBody',
|
|
16
|
+
component: _index.ModalBody,
|
|
17
|
+
decorators: [_storybookAddonDesigns.withDesign],
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
page: function page() {
|
|
21
|
+
return (0, _react2.jsx)(_storybookDocsLayout["default"], null);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports["default"] = _default;
|
|
27
|
+
var Default = function Default() {
|
|
28
|
+
return (0, _react2.jsx)(_index.ModalBody, null, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Text, null, "Do you want to continue with this action that you\u2018re performing?")));
|
|
29
|
+
};
|
|
30
|
+
exports.Default = Default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { StoryFn } from '@storybook/react';
|
|
2
|
+
import { ModalFooterProps } from '../../../types/Modal';
|
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: StoryFn<ModalFooterProps>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.Default = void 0;
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _storybookAddonDesigns = require("storybook-addon-designs");
|
|
11
|
+
var _storybookDocsLayout = _interopRequireDefault(require("../../../../.storybook/storybookDocsLayout"));
|
|
12
|
+
var _hooks = require("../../../hooks");
|
|
13
|
+
var _index = require("../../../index");
|
|
14
|
+
var _react2 = require("@emotion/react");
|
|
15
|
+
var _default = {
|
|
16
|
+
title: 'Components/Modal/Convenience/ModalFooter',
|
|
17
|
+
component: _index.ModalFooter,
|
|
18
|
+
decorators: [_storybookAddonDesigns.withDesign],
|
|
19
|
+
parameters: {
|
|
20
|
+
docs: {
|
|
21
|
+
page: function page() {
|
|
22
|
+
return (0, _react2.jsx)(_storybookDocsLayout["default"], null);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports["default"] = _default;
|
|
28
|
+
var Default = function Default() {
|
|
29
|
+
var state = (0, _hooks.useModalState)();
|
|
30
|
+
return (0, _react2.jsx)(_index.ModalFooter, {
|
|
31
|
+
onSubmit: state.close,
|
|
32
|
+
onCancel: state.close
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
exports.Default = Default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { StoryFn } from '@storybook/react';
|
|
2
|
+
import { ModalHeaderProps } from '../../../types/Modal';
|
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: StoryFn<ModalHeaderProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.Default = void 0;
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _storybookAddonDesigns = require("storybook-addon-designs");
|
|
11
|
+
var _storybookDocsLayout = _interopRequireDefault(require("../../../../.storybook/storybookDocsLayout"));
|
|
12
|
+
var _hooks = require("../../../hooks");
|
|
13
|
+
var _index = require("../../../index");
|
|
14
|
+
var _react2 = require("@emotion/react");
|
|
15
|
+
var _default = {
|
|
16
|
+
title: 'Components/Modal/Convenience/ModalHeader',
|
|
17
|
+
component: _index.ModalHeader,
|
|
18
|
+
decorators: [_storybookAddonDesigns.withDesign],
|
|
19
|
+
parameters: {
|
|
20
|
+
docs: {
|
|
21
|
+
page: function page() {
|
|
22
|
+
return (0, _react2.jsx)(_storybookDocsLayout["default"], null);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports["default"] = _default;
|
|
28
|
+
var Default = function Default() {
|
|
29
|
+
var state = (0, _hooks.useModalState)();
|
|
30
|
+
return (0, _react2.jsx)(_index.ModalHeader, {
|
|
31
|
+
hasCloseButton: true,
|
|
32
|
+
onClose: state.close,
|
|
33
|
+
title: "Continue"
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
exports.Default = Default;
|
|
@@ -15,7 +15,9 @@ _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"));
|
|
18
19
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
20
|
+
var _toArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toArray"));
|
|
19
21
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
20
22
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
21
23
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -27,6 +29,7 @@ var _Box = _interopRequireDefault(require("../Box"));
|
|
|
27
29
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
28
30
|
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
29
31
|
var _Text = _interopRequireDefault(require("../Text"));
|
|
32
|
+
var _ModalHeader = _interopRequireDefault(require("./ModalHeader"));
|
|
30
33
|
var _react2 = require("@emotion/react");
|
|
31
34
|
var _excluded = ["className", "closeButton", "hasAutoFocus", "hasCloseButton", "id", "isClosedOnBlur", "isDismissable", "isKeyboardDismissDisabled", "isOpen", "role", "size", "state", "title", "onClose", "shouldCloseOnInteractOutside", "children", "contentProps", "containerProps", "headerContainerProps"];
|
|
32
35
|
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); }
|
|
@@ -95,7 +98,12 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
95
98
|
var isOpenNoTransition = (state === null || state === void 0 ? void 0 : state.isTransitioning) === undefined && isOpen === true;
|
|
96
99
|
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)),
|
|
97
100
|
classNames = _useStatusClasses.classNames;
|
|
98
|
-
var
|
|
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 hasHeaderConvenienceComponent = /*#__PURE__*/_react["default"].isValidElement(header) && header.type === _ModalHeader["default"];
|
|
106
|
+
var titleContent = !hasHeaderConvenienceComponent && title && (isOnyx ? (0, _react2.jsx)(_Box["default"], {
|
|
99
107
|
variant: "modal.header"
|
|
100
108
|
}, (0, _react2.jsx)(_Text["default"], (0, _extends2["default"])({}, titleProps, {
|
|
101
109
|
variant: "modalTitle",
|
|
@@ -118,7 +126,7 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
118
126
|
}, propsContentProps, dialogProps, modalProps, {
|
|
119
127
|
ref: modalRef,
|
|
120
128
|
"aria-modal": true
|
|
121
|
-
}), (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
|
129
|
+
}), titleContent && (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
|
122
130
|
variant: "modal.headingContainer"
|
|
123
131
|
}, headerContainerProps), hasCloseButton && (closeButton !== null && closeButton !== void 0 ? closeButton : (0, _react2.jsx)(_IconButton["default"], {
|
|
124
132
|
"aria-label": "Close modal window",
|
|
@@ -130,8 +138,10 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
130
138
|
title: {
|
|
131
139
|
name: 'Close Icon'
|
|
132
140
|
}
|
|
133
|
-
}))), titleContent), (0, _react2.jsx)(_Box["default"], {
|
|
134
|
-
pt: "md"
|
|
141
|
+
}))), titleContent), isOnyx ? children : (0, _react2.jsx)(_Box["default"], {
|
|
142
|
+
pt: "md",
|
|
143
|
+
px: "lg",
|
|
144
|
+
pb: "lg"
|
|
135
145
|
}, children)))));
|
|
136
146
|
});
|
|
137
147
|
Modal.defaultProps = {
|
|
@@ -4,4 +4,6 @@ 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>;
|
|
7
8
|
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.WithInputField = exports.LargeContent = exports.Default = void 0;
|
|
11
|
+
exports["default"] = exports.WithPopoverMenu = exports.WithInputField = 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"));
|
|
@@ -104,21 +104,6 @@ var _default = {
|
|
|
104
104
|
exports["default"] = _default;
|
|
105
105
|
var Default = function Default(args) {
|
|
106
106
|
var state = (0, _hooks.useModalState)();
|
|
107
|
-
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, {
|
|
108
|
-
isRow: true,
|
|
109
|
-
mr: "auto",
|
|
110
|
-
width: "100%",
|
|
111
|
-
variant: "modal.buttonsContainer"
|
|
112
|
-
}, (0, _react2.jsx)(_index.Button, {
|
|
113
|
-
variant: "primary",
|
|
114
|
-
onPress: state.close,
|
|
115
|
-
mr: "md",
|
|
116
|
-
"aria-label": "Continue"
|
|
117
|
-
}, "Continue"), (0, _react2.jsx)(_index.Button, {
|
|
118
|
-
variant: "link",
|
|
119
|
-
onPress: state.close,
|
|
120
|
-
"aria-label": "Cancel"
|
|
121
|
-
}, "Cancel")));
|
|
122
107
|
return (
|
|
123
108
|
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
|
124
109
|
// readers when an overlay opens.
|
|
@@ -128,10 +113,16 @@ var Default = function Default(args) {
|
|
|
128
113
|
tabIndex: state.isOpen ? -1 : 0
|
|
129
114
|
}, "Open Modal"), (state.isOpen || state.isTransitioning) && (0, _react2.jsx)(_index.Modal, (0, _extends2["default"])({}, args, {
|
|
130
115
|
isOpen: state.isOpen,
|
|
116
|
+
state: state
|
|
117
|
+
}), (0, _react2.jsx)(_index.ModalHeader, {
|
|
118
|
+
hasCloseButton: true,
|
|
131
119
|
onClose: state.close,
|
|
132
|
-
state: state,
|
|
133
120
|
title: "Continue"
|
|
134
|
-
}),
|
|
121
|
+
}), (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, {
|
|
122
|
+
onSubmit: state.close,
|
|
123
|
+
onCancel: state.close,
|
|
124
|
+
primaryButtonText: "Continue"
|
|
125
|
+
})))
|
|
135
126
|
);
|
|
136
127
|
};
|
|
137
128
|
exports.Default = Default;
|
|
@@ -152,28 +143,55 @@ var LargeContent = function LargeContent(args) {
|
|
|
152
143
|
tabIndex: state.isOpen ? -1 : 0
|
|
153
144
|
}, "Open Modal"), state.isOpen && (0, _react2.jsx)(_index.Modal, (0, _extends2["default"])({}, args, {
|
|
154
145
|
isOpen: state.isOpen,
|
|
146
|
+
onClose: state.close
|
|
147
|
+
}), (0, _react2.jsx)(_index.ModalHeader, {
|
|
148
|
+
hasCloseButton: true,
|
|
155
149
|
onClose: state.close,
|
|
156
150
|
title: "Lorem Ipsum"
|
|
157
|
-
}), (0, _react2.jsx)(_index.Box, {
|
|
151
|
+
}), (0, _react2.jsx)(_index.ModalBody, null, (0, _react2.jsx)(_index.Box, {
|
|
158
152
|
gap: "lg"
|
|
159
|
-
}, (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.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
variant: "primary",
|
|
164
|
-
onPress: state.close,
|
|
165
|
-
mr: "md",
|
|
166
|
-
"aria-label": "Continue"
|
|
167
|
-
}, "Continue"), (0, _react2.jsx)(_index.Button, {
|
|
168
|
-
variant: "link",
|
|
169
|
-
onPress: state.close,
|
|
170
|
-
"aria-label": "Cancel"
|
|
171
|
-
}, "Cancel"))))
|
|
153
|
+
}, (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, {
|
|
154
|
+
onSubmit: state.close,
|
|
155
|
+
onCancel: state.close
|
|
156
|
+
})))
|
|
172
157
|
);
|
|
173
158
|
};
|
|
174
159
|
exports.LargeContent = LargeContent;
|
|
160
|
+
var LargeContentWithScroll = function LargeContentWithScroll(args) {
|
|
161
|
+
var state = (0, _hooks.useModalState)();
|
|
162
|
+
return (
|
|
163
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
|
164
|
+
// readers when an overlay opens.
|
|
165
|
+
(0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
|
|
166
|
+
onPress: state.open,
|
|
167
|
+
"aria-label": "Open modal",
|
|
168
|
+
tabIndex: state.isOpen ? -1 : 0
|
|
169
|
+
}, "Open Modal"), state.isOpen && (0, _react2.jsx)(_index.Modal, (0, _extends2["default"])({}, args, {
|
|
170
|
+
isOpen: state.isOpen,
|
|
171
|
+
onClose: state.close
|
|
172
|
+
}), (0, _react2.jsx)(_index.ModalHeader, {
|
|
173
|
+
hasCloseButton: true,
|
|
174
|
+
onClose: state.close,
|
|
175
|
+
title: "Lorem Ipsum"
|
|
176
|
+
}), (0, _react2.jsx)(_index.ModalBody, {
|
|
177
|
+
isScrollable: true,
|
|
178
|
+
scrollProps: {
|
|
179
|
+
maxHeight: '400px'
|
|
180
|
+
}
|
|
181
|
+
}, (0, _react2.jsx)(_index.Box, {
|
|
182
|
+
gap: "lg",
|
|
183
|
+
pr: "lg"
|
|
184
|
+
}, (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, {
|
|
185
|
+
onSubmit: state.close,
|
|
186
|
+
onCancel: state.close
|
|
187
|
+
})))
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
exports.LargeContentWithScroll = LargeContentWithScroll;
|
|
175
191
|
var WithInputField = function WithInputField() {
|
|
176
192
|
var state = (0, _hooks.useModalState)();
|
|
193
|
+
var _useGetTheme = (0, _hooks.useGetTheme)(),
|
|
194
|
+
isOnyx = _useGetTheme.themeState.isOnyx;
|
|
177
195
|
var _useState = (0, _react.useState)(''),
|
|
178
196
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
179
197
|
value = _useState2[0],
|
|
@@ -195,8 +213,9 @@ var WithInputField = function WithInputField() {
|
|
|
195
213
|
isOpen: state.isOpen,
|
|
196
214
|
onClose: state.close,
|
|
197
215
|
hasAutoFocus: true
|
|
198
|
-
}, (0, _react2.jsx)(_index.Box, {
|
|
199
|
-
gap: "lg"
|
|
216
|
+
}, (0, _react2.jsx)(_index.ModalBody, null, (0, _react2.jsx)(_index.Box, {
|
|
217
|
+
gap: "lg",
|
|
218
|
+
pt: isOnyx ? '' : 'lg'
|
|
200
219
|
}, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet consectetur"), (0, _react2.jsx)(_index.SelectField, {
|
|
201
220
|
label: "Select an option"
|
|
202
221
|
}, (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, {
|
|
@@ -235,19 +254,10 @@ var WithInputField = function WithInputField() {
|
|
|
235
254
|
key: item.key,
|
|
236
255
|
textValue: item.name
|
|
237
256
|
}, item.name);
|
|
238
|
-
}), (0, _react2.jsx)(_index.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
variant: "primary",
|
|
243
|
-
onPress: state.close,
|
|
244
|
-
mr: "md",
|
|
245
|
-
"aria-label": "Continue"
|
|
246
|
-
}, "Continue"), (0, _react2.jsx)(_index.Button, {
|
|
247
|
-
variant: "link",
|
|
248
|
-
onPress: state.close,
|
|
249
|
-
"aria-label": "Cancel"
|
|
250
|
-
}, "Cancel")))));
|
|
257
|
+
}))), (0, _react2.jsx)(_index.ModalFooter, {
|
|
258
|
+
onSubmit: state.close,
|
|
259
|
+
onCancel: state.close
|
|
260
|
+
})));
|
|
251
261
|
};
|
|
252
262
|
exports.WithInputField = WithInputField;
|
|
253
263
|
WithInputField.parameters = {
|
|
@@ -259,4 +269,30 @@ WithInputField.parameters = {
|
|
|
259
269
|
}]
|
|
260
270
|
}
|
|
261
271
|
}
|
|
262
|
-
};
|
|
272
|
+
};
|
|
273
|
+
var WithPopoverMenu = function WithPopoverMenu() {
|
|
274
|
+
var state = (0, _hooks.useModalState)();
|
|
275
|
+
return (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
|
|
276
|
+
onPress: state.open,
|
|
277
|
+
"aria-label": "Open modal"
|
|
278
|
+
}, "Open Modal"), state.isOpen && (0, _react2.jsx)(_index.Modal, {
|
|
279
|
+
isOpen: state.isOpen,
|
|
280
|
+
onClose: state.close
|
|
281
|
+
}, (0, _react2.jsx)(_index.ModalBody, null, (0, _react2.jsx)(_index.Box, {
|
|
282
|
+
gap: "lg"
|
|
283
|
+
}, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet consectetur"), (0, _react2.jsx)(_index.PopoverMenu, null, (0, _react2.jsx)(_index.Button, null, "Click me"), (0, _react2.jsx)(_index.Menu, {
|
|
284
|
+
onAction: function onAction() {
|
|
285
|
+
return console.log('on action');
|
|
286
|
+
}
|
|
287
|
+
}, (0, _react2.jsx)(_index.Item, {
|
|
288
|
+
key: "edit"
|
|
289
|
+
}, "Edit"), (0, _react2.jsx)(_index.Item, {
|
|
290
|
+
key: "duplicate"
|
|
291
|
+
}, "Duplicate"), (0, _react2.jsx)(_index.Item, {
|
|
292
|
+
key: "delete",
|
|
293
|
+
textValue: "delete"
|
|
294
|
+
}, (0, _react2.jsx)(_index.Text, {
|
|
295
|
+
color: "critical.bright"
|
|
296
|
+
}, "Delete"))))))));
|
|
297
|
+
};
|
|
298
|
+
exports.WithPopoverMenu = WithPopoverMenu;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
export declare const closeButton: {
|
|
2
|
+
position: string;
|
|
3
|
+
top: number;
|
|
4
|
+
right: number;
|
|
5
|
+
alignSelf: string;
|
|
6
|
+
width: string;
|
|
7
|
+
height: string;
|
|
8
|
+
};
|
|
1
9
|
export declare const modalCloseButton: {
|
|
2
10
|
position: string;
|
|
3
11
|
top: number;
|
|
4
12
|
right: number;
|
|
13
|
+
alignSelf: string;
|
|
5
14
|
width: string;
|
|
6
15
|
height: string;
|
|
7
16
|
};
|
|
@@ -19,21 +28,15 @@ declare const _default: {
|
|
|
19
28
|
background: string;
|
|
20
29
|
display: string;
|
|
21
30
|
alignItems: string;
|
|
22
|
-
|
|
31
|
+
overflowY: string;
|
|
23
32
|
};
|
|
24
33
|
content: {
|
|
25
|
-
position: string;
|
|
26
34
|
outline: string;
|
|
27
35
|
background: string;
|
|
28
36
|
color: string;
|
|
29
|
-
pt: string;
|
|
30
|
-
pr: string;
|
|
31
|
-
pb: string;
|
|
32
|
-
pl: string;
|
|
33
37
|
boxShadow: string;
|
|
34
38
|
borderRadius: number;
|
|
35
|
-
|
|
36
|
-
overflowY: string;
|
|
39
|
+
margin: string;
|
|
37
40
|
'&.is-extra-small': {
|
|
38
41
|
maxWidth: string;
|
|
39
42
|
width: string;
|
|
@@ -57,26 +60,12 @@ declare const _default: {
|
|
|
57
60
|
};
|
|
58
61
|
headingContainer: {
|
|
59
62
|
position: string;
|
|
60
|
-
top: string;
|
|
61
|
-
mt: string;
|
|
62
|
-
mb: string;
|
|
63
|
-
mr: string;
|
|
64
|
-
pt: string;
|
|
65
|
-
pr: string;
|
|
66
|
-
pb: string;
|
|
67
63
|
backgroundColor: string;
|
|
64
|
+
px: string;
|
|
65
|
+
py: string;
|
|
68
66
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
bottom: string;
|
|
72
|
-
p: number;
|
|
73
|
-
mb: string;
|
|
74
|
-
pb: string;
|
|
75
|
-
pt: string;
|
|
76
|
-
background: string;
|
|
77
|
-
'& > button': {
|
|
78
|
-
flexGrow: number;
|
|
79
|
-
};
|
|
67
|
+
bodyContainer: {
|
|
68
|
+
px: string;
|
|
80
69
|
};
|
|
81
70
|
title: {
|
|
82
71
|
mr: string;
|
|
@@ -94,6 +83,33 @@ declare const _default: {
|
|
|
94
83
|
position: string;
|
|
95
84
|
top: number;
|
|
96
85
|
right: number;
|
|
86
|
+
alignSelf: string;
|
|
87
|
+
width: string;
|
|
88
|
+
height: string;
|
|
89
|
+
};
|
|
90
|
+
buttonsContainer: {
|
|
91
|
+
p: number;
|
|
92
|
+
pt: string;
|
|
93
|
+
background: string;
|
|
94
|
+
};
|
|
95
|
+
header: {
|
|
96
|
+
position: string;
|
|
97
|
+
backgroundColor: string;
|
|
98
|
+
pb: string;
|
|
99
|
+
};
|
|
100
|
+
body: {};
|
|
101
|
+
footer: {
|
|
102
|
+
pt: string;
|
|
103
|
+
background: string;
|
|
104
|
+
'& > button': {
|
|
105
|
+
flexGrow: number;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
closeButton: {
|
|
109
|
+
position: string;
|
|
110
|
+
top: number;
|
|
111
|
+
right: number;
|
|
112
|
+
alignSelf: string;
|
|
97
113
|
width: string;
|
|
98
114
|
height: string;
|
|
99
115
|
};
|