@pingux/astro 2.118.3-alpha.0 → 2.119.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 +12 -4
- package/lib/cjs/components/Modal/Modal.stories.js +87 -34
- package/lib/cjs/components/Text/Text.styles.d.ts +11 -0
- package/lib/cjs/components/Text/Text.styles.js +6 -0
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +17 -7
- package/lib/cjs/styles/themes/next-gen/variants/button.js +2 -2
- package/lib/cjs/styles/themes/next-gen/variants/text.d.ts +0 -6
- package/lib/cjs/styles/themes/next-gen/variants/text.js +0 -6
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +17 -1
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +17 -1
- package/lib/components/Modal/Modal.js +13 -5
- package/lib/components/Modal/Modal.stories.js +88 -35
- package/lib/components/Text/Text.styles.js +6 -0
- package/lib/styles/themes/next-gen/variants/button.js +2 -2
- package/lib/styles/themes/next-gen/variants/text.js +0 -6
- package/lib/styles/themes/next-gen/variants/variants.js +17 -1
- package/package.json +1 -1
- package/lib/cjs/recipes/NextGen/ModalNextGen.stories.d.ts +0 -6
- package/lib/cjs/recipes/NextGen/ModalNextGen.stories.js +0 -74
- package/lib/recipes/NextGen/ModalNextGen.stories.js +0 -64
@@ -66,6 +66,8 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
66
66
|
shouldCloseOnInteractOutside: shouldCloseOnInteractOutside,
|
67
67
|
children: children
|
68
68
|
}, propsContentProps);
|
69
|
+
var _useGetTheme = (0, _hooks.useGetTheme)(),
|
70
|
+
isOnyx = _useGetTheme.themeState.isOnyx;
|
69
71
|
var shouldShow = state ? (state === null || state === void 0 ? void 0 : state.isTransitioning) || isOpen : isOpen;
|
70
72
|
var modalState = {
|
71
73
|
close: onClose,
|
@@ -92,6 +94,15 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
92
94
|
var isOpenNoTransition = (state === null || state === void 0 ? void 0 : state.isTransitioning) === undefined && isOpen === true;
|
93
95
|
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)),
|
94
96
|
classNames = _useStatusClasses.classNames;
|
97
|
+
var titleContent = title && (isOnyx ? (0, _react2.jsx)(_Box["default"], {
|
98
|
+
variant: "modal.header"
|
99
|
+
}, (0, _react2.jsx)(_Text["default"], (0, _extends2["default"])({}, titleProps, {
|
100
|
+
variant: "modalTitle",
|
101
|
+
role: "heading"
|
102
|
+
}), title)) : (0, _react2.jsx)(_Text["default"], (0, _extends2["default"])({}, titleProps, {
|
103
|
+
variant: "variants.modal.title",
|
104
|
+
role: "heading"
|
105
|
+
}), title));
|
95
106
|
return (0, _react2.jsx)(_reactAria.OverlayContainer, null, (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
96
107
|
variant: "modal.container"
|
97
108
|
}, (0, _reactAria.mergeProps)(containerProps, underlayProps, others), {
|
@@ -118,10 +129,7 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
118
129
|
title: {
|
119
130
|
name: 'Close Icon'
|
120
131
|
}
|
121
|
-
}))),
|
122
|
-
variant: "variants.modal.title",
|
123
|
-
role: "heading"
|
124
|
-
}), title)), children))));
|
132
|
+
}))), titleContent), children))));
|
125
133
|
});
|
126
134
|
Modal.defaultProps = {
|
127
135
|
role: 'dialog',
|
@@ -91,27 +91,43 @@ var _default = {
|
|
91
91
|
}
|
92
92
|
},
|
93
93
|
args: {
|
94
|
-
title: 'Continue',
|
95
94
|
hasCloseButton: true
|
96
95
|
}
|
97
96
|
};
|
98
97
|
exports["default"] = _default;
|
99
98
|
var Default = function Default(args) {
|
100
99
|
var state = (0, _hooks.useModalState)();
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
},
|
108
|
-
|
109
|
-
|
110
|
-
|
100
|
+
var _useGetTheme = (0, _hooks.useGetTheme)(),
|
101
|
+
isOnyx = _useGetTheme.themeState.isOnyx;
|
102
|
+
var ModalBodyContent;
|
103
|
+
if (isOnyx) {
|
104
|
+
ModalBodyContent = (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.Box, {
|
105
|
+
p: "lg"
|
106
|
+
}, (0, _react2.jsx)(_index.Text, {
|
107
|
+
color: "text.primary"
|
108
|
+
}, "Do you want to continue with this action that you\u2018re performing?")), (0, _react2.jsx)(_index.Box, {
|
109
|
+
isRow: true,
|
110
|
+
variant: "modal.footer"
|
111
|
+
}, (0, _react2.jsx)(_index.Box, {
|
112
|
+
isRow: true,
|
113
|
+
ml: "auto"
|
114
|
+
}, (0, _react2.jsx)(_index.Button, {
|
115
|
+
variant: "link",
|
116
|
+
onPress: state.close,
|
117
|
+
"aria-label": "Cancel"
|
118
|
+
}, "Cancel"), (0, _react2.jsx)(_index.Button, {
|
119
|
+
variant: "primary",
|
120
|
+
onPress: state.close,
|
121
|
+
ml: "sm",
|
122
|
+
"aria-label": "Save"
|
123
|
+
}, "Save"))));
|
124
|
+
} else {
|
125
|
+
ModalBodyContent = (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.Text, {
|
111
126
|
pt: "lg"
|
112
127
|
}, "Do you want to continue with this action that you\u2018re performing?"), (0, _react2.jsx)(_index.Box, {
|
113
128
|
isRow: true,
|
114
129
|
pt: "lg",
|
130
|
+
mr: "auto",
|
115
131
|
variant: "modal.buttonsContainer"
|
116
132
|
}, (0, _react2.jsx)(_index.Button, {
|
117
133
|
variant: "primary",
|
@@ -122,7 +138,20 @@ var Default = function Default(args) {
|
|
122
138
|
variant: "link",
|
123
139
|
onPress: state.close,
|
124
140
|
"aria-label": "Cancel"
|
125
|
-
}, "Cancel")))
|
141
|
+
}, "Cancel")));
|
142
|
+
}
|
143
|
+
return (
|
144
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
145
|
+
// readers when an overlay opens.
|
146
|
+
(0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
|
147
|
+
onPress: state.open,
|
148
|
+
"aria-label": "Open modal"
|
149
|
+
}, "Open Modal"), (state.isOpen || state.isTransitioning) && (0, _react2.jsx)(_index.Modal, (0, _extends2["default"])({}, args, {
|
150
|
+
isOpen: state.isOpen,
|
151
|
+
onClose: state.close,
|
152
|
+
state: state,
|
153
|
+
title: "Continue"
|
154
|
+
}), ModalBodyContent))
|
126
155
|
);
|
127
156
|
};
|
128
157
|
exports.Default = Default;
|
@@ -142,6 +171,8 @@ Default.parameters = {
|
|
142
171
|
};
|
143
172
|
var LargeContent = function LargeContent(args) {
|
144
173
|
var state = (0, _hooks.useModalState)();
|
174
|
+
var _useGetTheme2 = (0, _hooks.useGetTheme)(),
|
175
|
+
isOnyx = _useGetTheme2.themeState.isOnyx;
|
145
176
|
return (
|
146
177
|
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
147
178
|
// readers when an overlay opens.
|
@@ -152,50 +183,72 @@ var LargeContent = function LargeContent(args) {
|
|
152
183
|
isOpen: state.isOpen,
|
153
184
|
onClose: state.close
|
154
185
|
}), (0, _react2.jsx)(_index.Text, {
|
155
|
-
pt: "lg"
|
186
|
+
pt: "lg",
|
187
|
+
px: isOnyx && 'lg'
|
156
188
|
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, {
|
157
|
-
pt: "lg"
|
189
|
+
pt: "lg",
|
190
|
+
px: isOnyx && 'lg'
|
158
191
|
}, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, {
|
159
|
-
pt: "lg"
|
192
|
+
pt: "lg",
|
193
|
+
px: isOnyx && 'lg'
|
160
194
|
}, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, {
|
161
|
-
pt: "lg"
|
195
|
+
pt: "lg",
|
196
|
+
px: isOnyx && 'lg'
|
162
197
|
}, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, {
|
163
|
-
pt: "lg"
|
198
|
+
pt: "lg",
|
199
|
+
px: isOnyx && 'lg'
|
164
200
|
}, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Text, {
|
165
|
-
pt: "lg"
|
201
|
+
pt: "lg",
|
202
|
+
px: isOnyx && 'lg'
|
166
203
|
}, "Eu fugiat nulla pariatur."), (0, _react2.jsx)(_index.Text, {
|
167
|
-
pt: "lg"
|
204
|
+
pt: "lg",
|
205
|
+
px: isOnyx && 'lg'
|
168
206
|
}, "Excepteur sint occaecat cupidatat non proident."), (0, _react2.jsx)(_index.Text, {
|
169
|
-
pt: "lg"
|
207
|
+
pt: "lg",
|
208
|
+
px: isOnyx && 'lg'
|
170
209
|
}, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), (0, _react2.jsx)(_index.Text, {
|
171
|
-
pt: "lg"
|
210
|
+
pt: "lg",
|
211
|
+
px: isOnyx && 'lg'
|
172
212
|
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, {
|
173
|
-
pt: "lg"
|
213
|
+
pt: "lg",
|
214
|
+
px: isOnyx && 'lg'
|
174
215
|
}, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, {
|
175
|
-
pt: "lg"
|
216
|
+
pt: "lg",
|
217
|
+
px: isOnyx && 'lg'
|
176
218
|
}, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, {
|
177
|
-
pt: "lg"
|
219
|
+
pt: "lg",
|
220
|
+
px: isOnyx && 'lg'
|
178
221
|
}, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, {
|
179
|
-
pt: "lg"
|
222
|
+
pt: "lg",
|
223
|
+
px: isOnyx && 'lg'
|
180
224
|
}, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Text, {
|
181
|
-
pt: "lg"
|
225
|
+
pt: "lg",
|
226
|
+
px: isOnyx && 'lg'
|
182
227
|
}, "Eu fugiat nulla pariatur."), (0, _react2.jsx)(_index.Text, {
|
183
|
-
pt: "lg"
|
228
|
+
pt: "lg",
|
229
|
+
px: isOnyx && 'lg'
|
184
230
|
}, "Excepteur sint occaecat cupidatat non proident."), (0, _react2.jsx)(_index.Text, {
|
185
|
-
pt: "lg"
|
231
|
+
pt: "lg",
|
232
|
+
px: isOnyx && 'lg'
|
186
233
|
}, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), (0, _react2.jsx)(_index.Text, {
|
187
|
-
pt: "lg"
|
234
|
+
pt: "lg",
|
235
|
+
px: isOnyx && 'lg'
|
188
236
|
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), (0, _react2.jsx)(_index.Text, {
|
189
|
-
pt: "lg"
|
237
|
+
pt: "lg",
|
238
|
+
px: isOnyx && 'lg'
|
190
239
|
}, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), (0, _react2.jsx)(_index.Text, {
|
191
|
-
pt: "lg"
|
240
|
+
pt: "lg",
|
241
|
+
px: isOnyx && 'lg'
|
192
242
|
}, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), (0, _react2.jsx)(_index.Text, {
|
193
|
-
pt: "lg"
|
243
|
+
pt: "lg",
|
244
|
+
px: isOnyx && 'lg'
|
194
245
|
}, "Nisi ut aliquip ex ea commodo consequat."), (0, _react2.jsx)(_index.Text, {
|
195
|
-
pt: "lg"
|
246
|
+
pt: "lg",
|
247
|
+
px: isOnyx && 'lg'
|
196
248
|
}, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), (0, _react2.jsx)(_index.Box, {
|
197
249
|
isRow: true,
|
198
|
-
variant: "modal.buttonsContainer"
|
250
|
+
variant: "modal.buttonsContainer",
|
251
|
+
px: isOnyx && 'lg'
|
199
252
|
}, (0, _react2.jsx)(_index.Button, {
|
200
253
|
variant: "primary",
|
201
254
|
onPress: state.close,
|
@@ -104,6 +104,17 @@ export declare const text: {
|
|
104
104
|
wordWrap: wordWrapText;
|
105
105
|
wordBreak: wordBreak;
|
106
106
|
};
|
107
|
+
modalTitle: {
|
108
|
+
fontSize: string;
|
109
|
+
fontWeight: number;
|
110
|
+
color: string;
|
111
|
+
fontFamily: string;
|
112
|
+
display: string;
|
113
|
+
overflowWrap: overflowWrap;
|
114
|
+
maxWidth: string;
|
115
|
+
wordWrap: wordWrapText;
|
116
|
+
wordBreak: wordBreak;
|
117
|
+
};
|
107
118
|
placeholder: {
|
108
119
|
fontWeight: number;
|
109
120
|
color: string;
|
@@ -206,6 +206,12 @@ var text = _objectSpread(_objectSpread(_objectSpread({
|
|
206
206
|
}, textEllipsis),
|
207
207
|
listViewItemSubtext: _objectSpread(_objectSpread({}, listViewItemSubtext), textEllipsis),
|
208
208
|
listViewItemText: _objectSpread(_objectSpread({}, listViewItemText), textEllipsis),
|
209
|
+
modalTitle: _objectSpread(_objectSpread({}, wordWrap), {}, {
|
210
|
+
fontSize: '20px',
|
211
|
+
fontWeight: 2,
|
212
|
+
color: 'text.primary',
|
213
|
+
fontFamily: 'standard'
|
214
|
+
}),
|
209
215
|
placeholder: {
|
210
216
|
fontWeight: -1,
|
211
217
|
color: 'text.secondary',
|
@@ -1289,12 +1289,6 @@ declare const _default: {
|
|
1289
1289
|
color: string;
|
1290
1290
|
lineHeight: string;
|
1291
1291
|
};
|
1292
|
-
modalTitle: {
|
1293
|
-
fontSize: string;
|
1294
|
-
fontWeight: string;
|
1295
|
-
color: string;
|
1296
|
-
fontFamily: string;
|
1297
|
-
};
|
1298
1292
|
tabLabel: {
|
1299
1293
|
color: string;
|
1300
1294
|
};
|
@@ -2223,7 +2217,7 @@ declare const _default: {
|
|
2223
2217
|
};
|
2224
2218
|
modal: {
|
2225
2219
|
content: {
|
2226
|
-
|
2220
|
+
p: number;
|
2227
2221
|
borderRadius: string;
|
2228
2222
|
opacity: number;
|
2229
2223
|
top: string;
|
@@ -2264,6 +2258,22 @@ declare const _default: {
|
|
2264
2258
|
container: {
|
2265
2259
|
justifyContent: string;
|
2266
2260
|
};
|
2261
|
+
header: {
|
2262
|
+
px: string;
|
2263
|
+
py: string;
|
2264
|
+
borderBottom: string;
|
2265
|
+
borderBottomColor: string;
|
2266
|
+
bg: string;
|
2267
|
+
};
|
2268
|
+
footer: {
|
2269
|
+
borderTop: string;
|
2270
|
+
borderTopColor: string;
|
2271
|
+
px: string;
|
2272
|
+
py: string;
|
2273
|
+
};
|
2274
|
+
buttonsContainer: {
|
2275
|
+
bottom: number;
|
2276
|
+
};
|
2267
2277
|
};
|
2268
2278
|
tab: {
|
2269
2279
|
borderRadius: string;
|
@@ -218,8 +218,8 @@ var baseIconButton = {
|
|
218
218
|
};
|
219
219
|
var modalCloseButton = _objectSpread(_objectSpread({}, baseIconButton), {}, {
|
220
220
|
position: 'absolute',
|
221
|
-
top:
|
222
|
-
right:
|
221
|
+
top: 32,
|
222
|
+
right: 42
|
223
223
|
});
|
224
224
|
var onyxIconButton = _objectSpread(_objectSpread(_objectSpread({}, baseIconButton), secondary), {}, {
|
225
225
|
path: {
|
@@ -71,12 +71,6 @@ var text = _objectSpread(_objectSpread({
|
|
71
71
|
color: 'text.primary',
|
72
72
|
lineHeight: '24px'
|
73
73
|
},
|
74
|
-
modalTitle: {
|
75
|
-
fontSize: '20px',
|
76
|
-
fontWeight: '2',
|
77
|
-
color: 'text.secondary',
|
78
|
-
fontFamily: 'standard'
|
79
|
-
},
|
80
74
|
tabLabel: {
|
81
75
|
color: 'text.primary'
|
82
76
|
},
|
@@ -406,7 +406,7 @@ declare const _default: {
|
|
406
406
|
};
|
407
407
|
modal: {
|
408
408
|
content: {
|
409
|
-
|
409
|
+
p: number;
|
410
410
|
borderRadius: string;
|
411
411
|
opacity: number;
|
412
412
|
top: string;
|
@@ -447,6 +447,22 @@ declare const _default: {
|
|
447
447
|
container: {
|
448
448
|
justifyContent: string;
|
449
449
|
};
|
450
|
+
header: {
|
451
|
+
px: string;
|
452
|
+
py: string;
|
453
|
+
borderBottom: string;
|
454
|
+
borderBottomColor: string;
|
455
|
+
bg: string;
|
456
|
+
};
|
457
|
+
footer: {
|
458
|
+
borderTop: string;
|
459
|
+
borderTopColor: string;
|
460
|
+
px: string;
|
461
|
+
py: string;
|
462
|
+
};
|
463
|
+
buttonsContainer: {
|
464
|
+
bottom: number;
|
465
|
+
};
|
450
466
|
};
|
451
467
|
tab: {
|
452
468
|
borderRadius: string;
|
@@ -143,7 +143,7 @@ var modalSize = {
|
|
143
143
|
};
|
144
144
|
var modal = {
|
145
145
|
content: {
|
146
|
-
|
146
|
+
p: 0,
|
147
147
|
borderRadius: '4px',
|
148
148
|
opacity: 0,
|
149
149
|
top: '0',
|
@@ -183,6 +183,22 @@ var modal = {
|
|
183
183
|
},
|
184
184
|
container: {
|
185
185
|
justifyContent: 'start'
|
186
|
+
},
|
187
|
+
header: {
|
188
|
+
px: 'lg',
|
189
|
+
py: 'md',
|
190
|
+
borderBottom: '1px solid',
|
191
|
+
borderBottomColor: 'border.base',
|
192
|
+
bg: 'background.base'
|
193
|
+
},
|
194
|
+
footer: {
|
195
|
+
borderTop: '1px solid',
|
196
|
+
borderTopColor: 'border.base',
|
197
|
+
px: 'lg',
|
198
|
+
py: 'md'
|
199
|
+
},
|
200
|
+
buttonsContainer: {
|
201
|
+
bottom: 0
|
186
202
|
}
|
187
203
|
};
|
188
204
|
var listBox = {
|
@@ -16,7 +16,7 @@ import React, { forwardRef } from 'react';
|
|
16
16
|
import { FocusScope, mergeProps, OverlayContainer, useDialog } from 'react-aria';
|
17
17
|
import CloseIcon from '@pingux/mdi-react/CloseIcon';
|
18
18
|
import { useModalOverlay } from '@react-aria/overlays';
|
19
|
-
import { useLocalOrForwardRef, useStatusClasses } from '../../hooks';
|
19
|
+
import { useGetTheme, useLocalOrForwardRef, useStatusClasses } from '../../hooks';
|
20
20
|
import Box from '../Box';
|
21
21
|
import Icon from '../Icon';
|
22
22
|
import IconButton from '../IconButton';
|
@@ -55,6 +55,8 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
55
55
|
shouldCloseOnInteractOutside: shouldCloseOnInteractOutside,
|
56
56
|
children: children
|
57
57
|
}, propsContentProps);
|
58
|
+
var _useGetTheme = useGetTheme(),
|
59
|
+
isOnyx = _useGetTheme.themeState.isOnyx;
|
58
60
|
var shouldShow = state ? (state === null || state === void 0 ? void 0 : state.isTransitioning) || isOpen : isOpen;
|
59
61
|
var modalState = {
|
60
62
|
close: onClose,
|
@@ -81,6 +83,15 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
81
83
|
var isOpenNoTransition = (state === null || state === void 0 ? void 0 : state.isTransitioning) === undefined && isOpen === true;
|
82
84
|
var _useStatusClasses = useStatusClasses(className, (_useStatusClasses2 = {}, _defineProperty(_useStatusClasses2, "is-".concat(size || 'custom'), size), _defineProperty(_useStatusClasses2, "isOpen", isOpen), _defineProperty(_useStatusClasses2, "isTransitioning", state === null || state === void 0 ? void 0 : state.isTransitioning), _defineProperty(_useStatusClasses2, "isOpenNoTransition", isOpenNoTransition), _useStatusClasses2)),
|
83
85
|
classNames = _useStatusClasses.classNames;
|
86
|
+
var titleContent = title && (isOnyx ? ___EmotionJSX(Box, {
|
87
|
+
variant: "modal.header"
|
88
|
+
}, ___EmotionJSX(Text, _extends({}, titleProps, {
|
89
|
+
variant: "modalTitle",
|
90
|
+
role: "heading"
|
91
|
+
}), title)) : ___EmotionJSX(Text, _extends({}, titleProps, {
|
92
|
+
variant: "variants.modal.title",
|
93
|
+
role: "heading"
|
94
|
+
}), title));
|
84
95
|
return ___EmotionJSX(OverlayContainer, null, ___EmotionJSX(Box, _extends({
|
85
96
|
variant: "modal.container"
|
86
97
|
}, mergeProps(containerProps, underlayProps, others), {
|
@@ -107,10 +118,7 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
107
118
|
title: {
|
108
119
|
name: 'Close Icon'
|
109
120
|
}
|
110
|
-
}))),
|
111
|
-
variant: "variants.modal.title",
|
112
|
-
role: "heading"
|
113
|
-
}), title)), children))));
|
121
|
+
}))), titleContent), children))));
|
114
122
|
});
|
115
123
|
Modal.defaultProps = {
|
116
124
|
role: 'dialog',
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
3
3
|
import { withDesign } from 'storybook-addon-designs';
|
4
4
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
5
|
-
import { useModalState } from '../../hooks';
|
5
|
+
import { useGetTheme, useModalState } from '../../hooks';
|
6
6
|
import { Box, Button, Modal, OverlayProvider, Text } from '../../index';
|
7
7
|
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
8
8
|
import { modalSizes } from '../../utils/devUtils/constants/modalSizes';
|
@@ -83,26 +83,42 @@ export default {
|
|
83
83
|
}
|
84
84
|
},
|
85
85
|
args: {
|
86
|
-
title: 'Continue',
|
87
86
|
hasCloseButton: true
|
88
87
|
}
|
89
88
|
};
|
90
89
|
export var Default = function Default(args) {
|
91
90
|
var state = useModalState();
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
},
|
99
|
-
|
100
|
-
|
101
|
-
|
91
|
+
var _useGetTheme = useGetTheme(),
|
92
|
+
isOnyx = _useGetTheme.themeState.isOnyx;
|
93
|
+
var ModalBodyContent;
|
94
|
+
if (isOnyx) {
|
95
|
+
ModalBodyContent = ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Box, {
|
96
|
+
p: "lg"
|
97
|
+
}, ___EmotionJSX(Text, {
|
98
|
+
color: "text.primary"
|
99
|
+
}, "Do you want to continue with this action that you\u2018re performing?")), ___EmotionJSX(Box, {
|
100
|
+
isRow: true,
|
101
|
+
variant: "modal.footer"
|
102
|
+
}, ___EmotionJSX(Box, {
|
103
|
+
isRow: true,
|
104
|
+
ml: "auto"
|
105
|
+
}, ___EmotionJSX(Button, {
|
106
|
+
variant: "link",
|
107
|
+
onPress: state.close,
|
108
|
+
"aria-label": "Cancel"
|
109
|
+
}, "Cancel"), ___EmotionJSX(Button, {
|
110
|
+
variant: "primary",
|
111
|
+
onPress: state.close,
|
112
|
+
ml: "sm",
|
113
|
+
"aria-label": "Save"
|
114
|
+
}, "Save"))));
|
115
|
+
} else {
|
116
|
+
ModalBodyContent = ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Text, {
|
102
117
|
pt: "lg"
|
103
118
|
}, "Do you want to continue with this action that you\u2018re performing?"), ___EmotionJSX(Box, {
|
104
119
|
isRow: true,
|
105
120
|
pt: "lg",
|
121
|
+
mr: "auto",
|
106
122
|
variant: "modal.buttonsContainer"
|
107
123
|
}, ___EmotionJSX(Button, {
|
108
124
|
variant: "primary",
|
@@ -113,7 +129,20 @@ export var Default = function Default(args) {
|
|
113
129
|
variant: "link",
|
114
130
|
onPress: state.close,
|
115
131
|
"aria-label": "Cancel"
|
116
|
-
}, "Cancel")))
|
132
|
+
}, "Cancel")));
|
133
|
+
}
|
134
|
+
return (
|
135
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
136
|
+
// readers when an overlay opens.
|
137
|
+
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
|
138
|
+
onPress: state.open,
|
139
|
+
"aria-label": "Open modal"
|
140
|
+
}, "Open Modal"), (state.isOpen || state.isTransitioning) && ___EmotionJSX(Modal, _extends({}, args, {
|
141
|
+
isOpen: state.isOpen,
|
142
|
+
onClose: state.close,
|
143
|
+
state: state,
|
144
|
+
title: "Continue"
|
145
|
+
}), ModalBodyContent))
|
117
146
|
);
|
118
147
|
};
|
119
148
|
Default.parameters = {
|
@@ -132,6 +161,8 @@ Default.parameters = {
|
|
132
161
|
};
|
133
162
|
export var LargeContent = function LargeContent(args) {
|
134
163
|
var state = useModalState();
|
164
|
+
var _useGetTheme2 = useGetTheme(),
|
165
|
+
isOnyx = _useGetTheme2.themeState.isOnyx;
|
135
166
|
return (
|
136
167
|
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
137
168
|
// readers when an overlay opens.
|
@@ -142,50 +173,72 @@ export var LargeContent = function LargeContent(args) {
|
|
142
173
|
isOpen: state.isOpen,
|
143
174
|
onClose: state.close
|
144
175
|
}), ___EmotionJSX(Text, {
|
145
|
-
pt: "lg"
|
176
|
+
pt: "lg",
|
177
|
+
px: isOnyx && 'lg'
|
146
178
|
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, {
|
147
|
-
pt: "lg"
|
179
|
+
pt: "lg",
|
180
|
+
px: isOnyx && 'lg'
|
148
181
|
}, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, {
|
149
|
-
pt: "lg"
|
182
|
+
pt: "lg",
|
183
|
+
px: isOnyx && 'lg'
|
150
184
|
}, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, {
|
151
|
-
pt: "lg"
|
185
|
+
pt: "lg",
|
186
|
+
px: isOnyx && 'lg'
|
152
187
|
}, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, {
|
153
|
-
pt: "lg"
|
188
|
+
pt: "lg",
|
189
|
+
px: isOnyx && 'lg'
|
154
190
|
}, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, {
|
155
|
-
pt: "lg"
|
191
|
+
pt: "lg",
|
192
|
+
px: isOnyx && 'lg'
|
156
193
|
}, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, {
|
157
|
-
pt: "lg"
|
194
|
+
pt: "lg",
|
195
|
+
px: isOnyx && 'lg'
|
158
196
|
}, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, {
|
159
|
-
pt: "lg"
|
197
|
+
pt: "lg",
|
198
|
+
px: isOnyx && 'lg'
|
160
199
|
}, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, {
|
161
|
-
pt: "lg"
|
200
|
+
pt: "lg",
|
201
|
+
px: isOnyx && 'lg'
|
162
202
|
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, {
|
163
|
-
pt: "lg"
|
203
|
+
pt: "lg",
|
204
|
+
px: isOnyx && 'lg'
|
164
205
|
}, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, {
|
165
|
-
pt: "lg"
|
206
|
+
pt: "lg",
|
207
|
+
px: isOnyx && 'lg'
|
166
208
|
}, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, {
|
167
|
-
pt: "lg"
|
209
|
+
pt: "lg",
|
210
|
+
px: isOnyx && 'lg'
|
168
211
|
}, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, {
|
169
|
-
pt: "lg"
|
212
|
+
pt: "lg",
|
213
|
+
px: isOnyx && 'lg'
|
170
214
|
}, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, {
|
171
|
-
pt: "lg"
|
215
|
+
pt: "lg",
|
216
|
+
px: isOnyx && 'lg'
|
172
217
|
}, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, {
|
173
|
-
pt: "lg"
|
218
|
+
pt: "lg",
|
219
|
+
px: isOnyx && 'lg'
|
174
220
|
}, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, {
|
175
|
-
pt: "lg"
|
221
|
+
pt: "lg",
|
222
|
+
px: isOnyx && 'lg'
|
176
223
|
}, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, {
|
177
|
-
pt: "lg"
|
224
|
+
pt: "lg",
|
225
|
+
px: isOnyx && 'lg'
|
178
226
|
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, {
|
179
|
-
pt: "lg"
|
227
|
+
pt: "lg",
|
228
|
+
px: isOnyx && 'lg'
|
180
229
|
}, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, {
|
181
|
-
pt: "lg"
|
230
|
+
pt: "lg",
|
231
|
+
px: isOnyx && 'lg'
|
182
232
|
}, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, {
|
183
|
-
pt: "lg"
|
233
|
+
pt: "lg",
|
234
|
+
px: isOnyx && 'lg'
|
184
235
|
}, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, {
|
185
|
-
pt: "lg"
|
236
|
+
pt: "lg",
|
237
|
+
px: isOnyx && 'lg'
|
186
238
|
}, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Box, {
|
187
239
|
isRow: true,
|
188
|
-
variant: "modal.buttonsContainer"
|
240
|
+
variant: "modal.buttonsContainer",
|
241
|
+
px: isOnyx && 'lg'
|
189
242
|
}, ___EmotionJSX(Button, {
|
190
243
|
variant: "primary",
|
191
244
|
onPress: state.close,
|
@@ -197,6 +197,12 @@ export var text = _objectSpread(_objectSpread(_objectSpread({
|
|
197
197
|
}, textEllipsis),
|
198
198
|
listViewItemSubtext: _objectSpread(_objectSpread({}, listViewItemSubtext), textEllipsis),
|
199
199
|
listViewItemText: _objectSpread(_objectSpread({}, listViewItemText), textEllipsis),
|
200
|
+
modalTitle: _objectSpread(_objectSpread({}, wordWrap), {}, {
|
201
|
+
fontSize: '20px',
|
202
|
+
fontWeight: 2,
|
203
|
+
color: 'text.primary',
|
204
|
+
fontFamily: 'standard'
|
205
|
+
}),
|
200
206
|
placeholder: {
|
201
207
|
fontWeight: -1,
|
202
208
|
color: 'text.secondary',
|
@@ -211,8 +211,8 @@ var baseIconButton = {
|
|
211
211
|
};
|
212
212
|
var modalCloseButton = _objectSpread(_objectSpread({}, baseIconButton), {}, {
|
213
213
|
position: 'absolute',
|
214
|
-
top:
|
215
|
-
right:
|
214
|
+
top: 32,
|
215
|
+
right: 42
|
216
216
|
});
|
217
217
|
var onyxIconButton = _objectSpread(_objectSpread(_objectSpread({}, baseIconButton), secondary), {}, {
|
218
218
|
path: {
|
@@ -64,12 +64,6 @@ export var text = _objectSpread(_objectSpread({
|
|
64
64
|
color: 'text.primary',
|
65
65
|
lineHeight: '24px'
|
66
66
|
},
|
67
|
-
modalTitle: {
|
68
|
-
fontSize: '20px',
|
69
|
-
fontWeight: '2',
|
70
|
-
color: 'text.secondary',
|
71
|
-
fontFamily: 'standard'
|
72
|
-
},
|
73
67
|
tabLabel: {
|
74
68
|
color: 'text.primary'
|
75
69
|
},
|
@@ -134,7 +134,7 @@ var modalSize = {
|
|
134
134
|
};
|
135
135
|
var modal = {
|
136
136
|
content: {
|
137
|
-
|
137
|
+
p: 0,
|
138
138
|
borderRadius: '4px',
|
139
139
|
opacity: 0,
|
140
140
|
top: '0',
|
@@ -174,6 +174,22 @@ var modal = {
|
|
174
174
|
},
|
175
175
|
container: {
|
176
176
|
justifyContent: 'start'
|
177
|
+
},
|
178
|
+
header: {
|
179
|
+
px: 'lg',
|
180
|
+
py: 'md',
|
181
|
+
borderBottom: '1px solid',
|
182
|
+
borderBottomColor: 'border.base',
|
183
|
+
bg: 'background.base'
|
184
|
+
},
|
185
|
+
footer: {
|
186
|
+
borderTop: '1px solid',
|
187
|
+
borderTopColor: 'border.base',
|
188
|
+
px: 'lg',
|
189
|
+
py: 'md'
|
190
|
+
},
|
191
|
+
buttonsContainer: {
|
192
|
+
bottom: 0
|
177
193
|
}
|
178
194
|
};
|
179
195
|
var listBox = {
|
package/package.json
CHANGED
@@ -1,74 +0,0 @@
|
|
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 _hooks = require("../../hooks");
|
11
|
-
var _index = require("../../index");
|
12
|
-
var _react2 = require("@emotion/react");
|
13
|
-
var _default = {
|
14
|
-
title: 'Onyx Recipes/Modal'
|
15
|
-
};
|
16
|
-
exports["default"] = _default;
|
17
|
-
var Default = function Default() {
|
18
|
-
var state = (0, _hooks.useModalState)();
|
19
|
-
return (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
|
20
|
-
onPress: state.open,
|
21
|
-
"aria-label": "Open modal"
|
22
|
-
}, "Open Modal"), (state.isOpen || state.isTransitioning) && (0, _react2.jsx)(_index.Modal, {
|
23
|
-
isOpen: state.isOpen,
|
24
|
-
onClose: state.close,
|
25
|
-
state: state,
|
26
|
-
hasCloseButton: true,
|
27
|
-
contentProps: {
|
28
|
-
sx: {
|
29
|
-
p: '0px !important'
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}, (0, _react2.jsx)(_index.Box, {
|
33
|
-
sx: {
|
34
|
-
p: '1rem 1.5rem',
|
35
|
-
borderBottom: '1px solid',
|
36
|
-
borderBottomColor: 'border.base',
|
37
|
-
bg: 'background.base'
|
38
|
-
}
|
39
|
-
}, (0, _react2.jsx)(_index.Text, {
|
40
|
-
variant: "modalTitle"
|
41
|
-
}, "Modal Title")), (0, _react2.jsx)(_index.Box, {
|
42
|
-
p: "1.5rem 1.5rem"
|
43
|
-
}, (0, _react2.jsx)(_index.Text, {
|
44
|
-
color: "text.primary"
|
45
|
-
}, "Do you want to continue with this action that you\u2018re performing?")), (0, _react2.jsx)(_index.Box, {
|
46
|
-
isRow: true,
|
47
|
-
sx: {
|
48
|
-
borderTop: '1px solid',
|
49
|
-
borderTopColor: 'border.base',
|
50
|
-
p: '1rem 1.5rem'
|
51
|
-
}
|
52
|
-
}, (0, _react2.jsx)(_index.Box, {
|
53
|
-
isRow: true,
|
54
|
-
mr: "auto"
|
55
|
-
}, (0, _react2.jsx)(_index.Button, {
|
56
|
-
variant: "link",
|
57
|
-
onPress: state.close,
|
58
|
-
"aria-label": "Continue"
|
59
|
-
}, "Previous")), (0, _react2.jsx)(_index.Box, {
|
60
|
-
isRow: true,
|
61
|
-
ml: "auto"
|
62
|
-
}, (0, _react2.jsx)(_index.Button, {
|
63
|
-
variant: "link",
|
64
|
-
onPress: state.close,
|
65
|
-
"aria-label": "Cancel"
|
66
|
-
}, "Cancel"), (0, _react2.jsx)(_index.Button, {
|
67
|
-
variant: "primary",
|
68
|
-
onPress: state.close,
|
69
|
-
ml: ".25rem",
|
70
|
-
"aria-label": "Continue",
|
71
|
-
isDisabled: true
|
72
|
-
}, "Next")))));
|
73
|
-
};
|
74
|
-
exports.Default = Default;
|
@@ -1,64 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { useModalState } from '../../hooks';
|
3
|
-
import { Box, Button, Modal, OverlayProvider, Text } from '../../index';
|
4
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
5
|
-
export default {
|
6
|
-
title: 'Onyx Recipes/Modal'
|
7
|
-
};
|
8
|
-
export var Default = function Default() {
|
9
|
-
var state = useModalState();
|
10
|
-
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
|
11
|
-
onPress: state.open,
|
12
|
-
"aria-label": "Open modal"
|
13
|
-
}, "Open Modal"), (state.isOpen || state.isTransitioning) && ___EmotionJSX(Modal, {
|
14
|
-
isOpen: state.isOpen,
|
15
|
-
onClose: state.close,
|
16
|
-
state: state,
|
17
|
-
hasCloseButton: true,
|
18
|
-
contentProps: {
|
19
|
-
sx: {
|
20
|
-
p: '0px !important'
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}, ___EmotionJSX(Box, {
|
24
|
-
sx: {
|
25
|
-
p: '1rem 1.5rem',
|
26
|
-
borderBottom: '1px solid',
|
27
|
-
borderBottomColor: 'border.base',
|
28
|
-
bg: 'background.base'
|
29
|
-
}
|
30
|
-
}, ___EmotionJSX(Text, {
|
31
|
-
variant: "modalTitle"
|
32
|
-
}, "Modal Title")), ___EmotionJSX(Box, {
|
33
|
-
p: "1.5rem 1.5rem"
|
34
|
-
}, ___EmotionJSX(Text, {
|
35
|
-
color: "text.primary"
|
36
|
-
}, "Do you want to continue with this action that you\u2018re performing?")), ___EmotionJSX(Box, {
|
37
|
-
isRow: true,
|
38
|
-
sx: {
|
39
|
-
borderTop: '1px solid',
|
40
|
-
borderTopColor: 'border.base',
|
41
|
-
p: '1rem 1.5rem'
|
42
|
-
}
|
43
|
-
}, ___EmotionJSX(Box, {
|
44
|
-
isRow: true,
|
45
|
-
mr: "auto"
|
46
|
-
}, ___EmotionJSX(Button, {
|
47
|
-
variant: "link",
|
48
|
-
onPress: state.close,
|
49
|
-
"aria-label": "Continue"
|
50
|
-
}, "Previous")), ___EmotionJSX(Box, {
|
51
|
-
isRow: true,
|
52
|
-
ml: "auto"
|
53
|
-
}, ___EmotionJSX(Button, {
|
54
|
-
variant: "link",
|
55
|
-
onPress: state.close,
|
56
|
-
"aria-label": "Cancel"
|
57
|
-
}, "Cancel"), ___EmotionJSX(Button, {
|
58
|
-
variant: "primary",
|
59
|
-
onPress: state.close,
|
60
|
-
ml: ".25rem",
|
61
|
-
"aria-label": "Continue",
|
62
|
-
isDisabled: true
|
63
|
-
}, "Next")))));
|
64
|
-
};
|