@pingux/astro 2.148.0-alpha.0 → 2.148.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +13 -4
- package/lib/cjs/components/Modal/Modal.stories.d.ts +1 -0
- package/lib/cjs/components/Modal/Modal.stories.js +57 -47
- package/lib/cjs/components/Modal/Modal.styles.d.ts +43 -26
- package/lib/cjs/components/Modal/Modal.styles.js +41 -28
- 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 +46 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +3 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +18 -1
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +18 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +59 -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 +27 -12
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +28 -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 +13 -4
- package/lib/components/Modal/Modal.stories.js +57 -48
- package/lib/components/Modal/Modal.styles.js +39 -27
- 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/themeOverrides/nextGenDarkMode/variants/variants.js +18 -1
- package/lib/styles/themes/next-gen/variants/button.js +6 -5
- package/lib/styles/themes/next-gen/variants/variants.js +28 -13
- package/package.json +1 -1
|
@@ -199,6 +199,7 @@ test('should only hide the top-most overlay', function () {
|
|
|
199
199
|
});
|
|
200
200
|
test('should render a close button if hasCloseButton is true', function () {
|
|
201
201
|
getComponent({
|
|
202
|
+
title: 'Lorem Ipsum',
|
|
202
203
|
hasCloseButton: true
|
|
203
204
|
});
|
|
204
205
|
expect(_testWrapper.screen.queryByRole('button')).toBeInTheDocument();
|
|
@@ -210,6 +211,7 @@ test('should render a custom close button if hasCloseButton is true and custom b
|
|
|
210
211
|
});
|
|
211
212
|
};
|
|
212
213
|
getComponent({
|
|
214
|
+
title: 'Lorem Ipsum',
|
|
213
215
|
hasCloseButton: true,
|
|
214
216
|
closeButton: (0, _react2.jsx)(MyButton, null)
|
|
215
217
|
});
|
|
@@ -218,6 +220,7 @@ test('should render a custom close button if hasCloseButton is true and custom b
|
|
|
218
220
|
});
|
|
219
221
|
test('shouldn\'t auto focus the first tabbable element', function () {
|
|
220
222
|
getComponent({
|
|
223
|
+
title: 'Lorem Ipsum',
|
|
221
224
|
hasCloseButton: true
|
|
222
225
|
});
|
|
223
226
|
var button = _testWrapper.screen.queryByRole('button');
|
|
@@ -225,6 +228,7 @@ test('shouldn\'t auto focus the first tabbable element', function () {
|
|
|
225
228
|
});
|
|
226
229
|
test('should auto focus the first tabbable element if "hasAutoFocus" is true', function () {
|
|
227
230
|
getComponent({
|
|
231
|
+
title: 'Lorem Ipsum',
|
|
228
232
|
hasCloseButton: true,
|
|
229
233
|
hasAutoFocus: true
|
|
230
234
|
});
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -225,5 +225,5 @@ export { default as OnyxDarkTheme } from './styles/themeOverrides/nextGenDarkMod
|
|
|
225
225
|
export { default as NextGenTheme } from './styles/themes/next-gen';
|
|
226
226
|
export { default as OnyxTheme } from './styles/themes/next-gen';
|
|
227
227
|
export * from './types';
|
|
228
|
-
export { OverlayProvider, useOverlayPosition, useOverlayTrigger } from 'react-aria';
|
|
228
|
+
export { OverlayProvider, useOverlayPosition, useOverlayTrigger, } from 'react-aria';
|
|
229
229
|
export { Cell, Column, TableBody as DataTableBody, Cell as DataTableCell, Column as DataTableColumn, TableHeader as DataTableHeader, Row as DataTableRow, Item, Row, Section, TableBody as TBody, TableHeader as THead, useOverlayTriggerState, useTreeData, } from 'react-stately';
|
|
@@ -318,6 +318,29 @@ declare const buttons: {
|
|
|
318
318
|
};
|
|
319
319
|
};
|
|
320
320
|
};
|
|
321
|
+
modalHeaderCloseButton: {
|
|
322
|
+
path: {
|
|
323
|
+
fill: string;
|
|
324
|
+
};
|
|
325
|
+
'&.is-focused': {
|
|
326
|
+
outline: string;
|
|
327
|
+
outlineColor: string;
|
|
328
|
+
outlineOffset: string;
|
|
329
|
+
};
|
|
330
|
+
'&.is-hovered': {
|
|
331
|
+
path: {
|
|
332
|
+
fill: string;
|
|
333
|
+
};
|
|
334
|
+
backgroundColor: string;
|
|
335
|
+
};
|
|
336
|
+
'&.is-pressed': {
|
|
337
|
+
backgroundColor: string;
|
|
338
|
+
borderColor: string;
|
|
339
|
+
path: {
|
|
340
|
+
fill: string;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
};
|
|
321
344
|
messageCloseButton: {
|
|
322
345
|
'&.is-hovered': {
|
|
323
346
|
backgroundColor: string;
|
|
@@ -339,6 +362,29 @@ declare const buttons: {
|
|
|
339
362
|
};
|
|
340
363
|
};
|
|
341
364
|
};
|
|
365
|
+
modalCloseButton: {
|
|
366
|
+
path: {
|
|
367
|
+
fill: string;
|
|
368
|
+
};
|
|
369
|
+
'&.is-focused': {
|
|
370
|
+
outline: string;
|
|
371
|
+
outlineColor: string;
|
|
372
|
+
outlineOffset: string;
|
|
373
|
+
};
|
|
374
|
+
'&.is-hovered': {
|
|
375
|
+
path: {
|
|
376
|
+
fill: string;
|
|
377
|
+
};
|
|
378
|
+
backgroundColor: string;
|
|
379
|
+
};
|
|
380
|
+
'&.is-pressed': {
|
|
381
|
+
backgroundColor: string;
|
|
382
|
+
borderColor: string;
|
|
383
|
+
path: {
|
|
384
|
+
fill: string;
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
};
|
|
342
388
|
listBoxLink: {
|
|
343
389
|
color: string;
|
|
344
390
|
'&.is-pressed': {
|
|
@@ -42,6 +42,7 @@ var baseIconButton = {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
var hintButton = _objectSpread({}, baseIconButton);
|
|
45
|
+
var modalCloseButton = _objectSpread({}, baseIconButton);
|
|
45
46
|
var iconButtons = {
|
|
46
47
|
base: _objectSpread({}, baseIconButton),
|
|
47
48
|
inverted: _objectSpread(_objectSpread({}, baseIconButton), {}, {
|
|
@@ -85,6 +86,7 @@ var iconButtons = {
|
|
|
85
86
|
}
|
|
86
87
|
}),
|
|
87
88
|
modalCloseButton: _objectSpread({}, baseIconButton),
|
|
89
|
+
modalHeaderCloseButton: _objectSpread({}, baseIconButton),
|
|
88
90
|
messageCloseButton: _objectSpread(_objectSpread({}, baseIconButton), {}, {
|
|
89
91
|
'&.is-hovered': {
|
|
90
92
|
backgroundColor: '#455469'
|
|
@@ -283,6 +285,7 @@ var buttons = {
|
|
|
283
285
|
}
|
|
284
286
|
},
|
|
285
287
|
iconButtons: iconButtons,
|
|
288
|
+
modalCloseButton: modalCloseButton,
|
|
286
289
|
listBoxLink: {
|
|
287
290
|
color: 'blue-400',
|
|
288
291
|
'&.is-pressed': {
|
|
@@ -377,9 +377,26 @@ declare const _default: {
|
|
|
377
377
|
bg: string;
|
|
378
378
|
};
|
|
379
379
|
headingContainer: {
|
|
380
|
+
borderBottom: string;
|
|
381
|
+
borderBottomColor: string;
|
|
380
382
|
bg: string;
|
|
381
383
|
};
|
|
382
|
-
|
|
384
|
+
header: {
|
|
385
|
+
borderBottom: string;
|
|
386
|
+
borderBottomColor: string;
|
|
387
|
+
bg: string;
|
|
388
|
+
};
|
|
389
|
+
body: {
|
|
390
|
+
bg: string;
|
|
391
|
+
};
|
|
392
|
+
footer: {
|
|
393
|
+
borderTop: string;
|
|
394
|
+
borderTopColor: string;
|
|
395
|
+
bg: string;
|
|
396
|
+
};
|
|
397
|
+
footerContainer: {
|
|
398
|
+
borderTop: string;
|
|
399
|
+
borderTopColor: string;
|
|
383
400
|
bg: string;
|
|
384
401
|
};
|
|
385
402
|
};
|
|
@@ -54,9 +54,26 @@ var modal = {
|
|
|
54
54
|
bg: 'background.base'
|
|
55
55
|
},
|
|
56
56
|
headingContainer: {
|
|
57
|
+
borderBottom: '1px solid',
|
|
58
|
+
borderBottomColor: 'border.base',
|
|
57
59
|
bg: 'background.base'
|
|
58
60
|
},
|
|
59
|
-
|
|
61
|
+
header: {
|
|
62
|
+
borderBottom: '1px solid',
|
|
63
|
+
borderBottomColor: 'border.base',
|
|
64
|
+
bg: 'background.base'
|
|
65
|
+
},
|
|
66
|
+
body: {
|
|
67
|
+
bg: 'background.base'
|
|
68
|
+
},
|
|
69
|
+
footer: {
|
|
70
|
+
borderTop: '1px solid',
|
|
71
|
+
borderTopColor: 'border.base',
|
|
72
|
+
bg: 'background.base'
|
|
73
|
+
},
|
|
74
|
+
footerContainer: {
|
|
75
|
+
borderTop: '1px solid',
|
|
76
|
+
borderTopColor: 'border.base',
|
|
60
77
|
bg: 'background.base'
|
|
61
78
|
}
|
|
62
79
|
};
|
|
@@ -1296,9 +1296,38 @@ declare const _default: {
|
|
|
1296
1296
|
};
|
|
1297
1297
|
};
|
|
1298
1298
|
modalCloseButton: {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1299
|
+
cursor: string;
|
|
1300
|
+
transition: string;
|
|
1301
|
+
outline: string;
|
|
1302
|
+
borderRadius: string;
|
|
1303
|
+
border: string;
|
|
1304
|
+
borderColor: string;
|
|
1305
|
+
path: {
|
|
1306
|
+
fill: string;
|
|
1307
|
+
};
|
|
1308
|
+
'&.is-focused': {
|
|
1309
|
+
outline: string;
|
|
1310
|
+
outlineColor: string;
|
|
1311
|
+
outlineOffset: string;
|
|
1312
|
+
};
|
|
1313
|
+
'&.is-hovered': {
|
|
1314
|
+
backgroundColor: string;
|
|
1315
|
+
path: {
|
|
1316
|
+
fill: string;
|
|
1317
|
+
};
|
|
1318
|
+
};
|
|
1319
|
+
'&.is-pressed': {
|
|
1320
|
+
backgroundColor: string;
|
|
1321
|
+
borderColor: string;
|
|
1322
|
+
path: {
|
|
1323
|
+
fill: string;
|
|
1324
|
+
};
|
|
1325
|
+
};
|
|
1326
|
+
};
|
|
1327
|
+
modalHeaderCloseButton: {
|
|
1328
|
+
top: string;
|
|
1329
|
+
transform: string;
|
|
1330
|
+
right: string;
|
|
1302
1331
|
cursor: string;
|
|
1303
1332
|
transition: string;
|
|
1304
1333
|
outline: string;
|
|
@@ -1578,9 +1607,6 @@ declare const _default: {
|
|
|
1578
1607
|
};
|
|
1579
1608
|
};
|
|
1580
1609
|
modalCloseButton: {
|
|
1581
|
-
position: string;
|
|
1582
|
-
top: number;
|
|
1583
|
-
right: number;
|
|
1584
1610
|
cursor: string;
|
|
1585
1611
|
transition: string;
|
|
1586
1612
|
outline: string;
|
|
@@ -4243,17 +4269,10 @@ declare const _default: {
|
|
|
4243
4269
|
modal: {
|
|
4244
4270
|
content: {
|
|
4245
4271
|
boxShadow: string;
|
|
4246
|
-
px: string;
|
|
4247
|
-
pb: string;
|
|
4248
|
-
pt: number;
|
|
4249
4272
|
borderRadius: string;
|
|
4250
4273
|
opacity: number;
|
|
4251
|
-
top: string;
|
|
4252
|
-
transform: string;
|
|
4253
4274
|
transition: string;
|
|
4254
4275
|
m: string[];
|
|
4255
|
-
maxHeight: string;
|
|
4256
|
-
overflowY: string;
|
|
4257
4276
|
'&.is-open-no-transition': {
|
|
4258
4277
|
opacity: string;
|
|
4259
4278
|
transform: string;
|
|
@@ -4283,13 +4302,35 @@ declare const _default: {
|
|
|
4283
4302
|
maxWidth: string[];
|
|
4284
4303
|
};
|
|
4285
4304
|
};
|
|
4286
|
-
|
|
4287
|
-
|
|
4305
|
+
headingContainer: {
|
|
4306
|
+
borderBottom: string;
|
|
4307
|
+
borderBottomColor: string;
|
|
4308
|
+
bg: string;
|
|
4309
|
+
borderRadius: string;
|
|
4288
4310
|
};
|
|
4289
4311
|
header: {
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4312
|
+
borderBottom: string;
|
|
4313
|
+
borderBottomColor: string;
|
|
4314
|
+
borderRadius: string;
|
|
4315
|
+
px: string;
|
|
4316
|
+
py: string;
|
|
4317
|
+
};
|
|
4318
|
+
bodyContainer: {
|
|
4319
|
+
p: string;
|
|
4320
|
+
};
|
|
4321
|
+
body: {
|
|
4322
|
+
p: string;
|
|
4323
|
+
};
|
|
4324
|
+
footer: {
|
|
4325
|
+
borderTop: string;
|
|
4326
|
+
borderTopColor: string;
|
|
4327
|
+
borderRadius: string;
|
|
4328
|
+
p: string;
|
|
4329
|
+
};
|
|
4330
|
+
footerContainer: {
|
|
4331
|
+
borderTop: string;
|
|
4332
|
+
borderTopColor: string;
|
|
4333
|
+
borderRadius: string;
|
|
4293
4334
|
};
|
|
4294
4335
|
};
|
|
4295
4336
|
navBar: {
|
|
@@ -1003,9 +1003,38 @@ declare const buttons: {
|
|
|
1003
1003
|
};
|
|
1004
1004
|
};
|
|
1005
1005
|
modalCloseButton: {
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1006
|
+
cursor: string;
|
|
1007
|
+
transition: string;
|
|
1008
|
+
outline: string;
|
|
1009
|
+
borderRadius: string;
|
|
1010
|
+
border: string;
|
|
1011
|
+
borderColor: string;
|
|
1012
|
+
path: {
|
|
1013
|
+
fill: string;
|
|
1014
|
+
};
|
|
1015
|
+
'&.is-focused': {
|
|
1016
|
+
outline: string;
|
|
1017
|
+
outlineColor: string;
|
|
1018
|
+
outlineOffset: string;
|
|
1019
|
+
};
|
|
1020
|
+
'&.is-hovered': {
|
|
1021
|
+
backgroundColor: string;
|
|
1022
|
+
path: {
|
|
1023
|
+
fill: string;
|
|
1024
|
+
};
|
|
1025
|
+
};
|
|
1026
|
+
'&.is-pressed': {
|
|
1027
|
+
backgroundColor: string;
|
|
1028
|
+
borderColor: string;
|
|
1029
|
+
path: {
|
|
1030
|
+
fill: string;
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
};
|
|
1034
|
+
modalHeaderCloseButton: {
|
|
1035
|
+
top: string;
|
|
1036
|
+
transform: string;
|
|
1037
|
+
right: string;
|
|
1009
1038
|
cursor: string;
|
|
1010
1039
|
transition: string;
|
|
1011
1040
|
outline: string;
|
|
@@ -1285,9 +1314,6 @@ declare const buttons: {
|
|
|
1285
1314
|
};
|
|
1286
1315
|
};
|
|
1287
1316
|
modalCloseButton: {
|
|
1288
|
-
position: string;
|
|
1289
|
-
top: number;
|
|
1290
|
-
right: number;
|
|
1291
1317
|
cursor: string;
|
|
1292
1318
|
transition: string;
|
|
1293
1319
|
outline: string;
|
|
@@ -356,11 +356,7 @@ var baseIconButton = {
|
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
};
|
|
359
|
-
var modalCloseButton = _objectSpread(
|
|
360
|
-
position: 'absolute',
|
|
361
|
-
top: 32,
|
|
362
|
-
right: 18
|
|
363
|
-
});
|
|
359
|
+
var modalCloseButton = _objectSpread({}, baseIconButton);
|
|
364
360
|
var onyxIconButton = _objectSpread(_objectSpread(_objectSpread({}, baseIconButton), secondary), {}, {
|
|
365
361
|
path: {
|
|
366
362
|
fill: 'blue'
|
|
@@ -451,6 +447,11 @@ var iconButtons = {
|
|
|
451
447
|
display: 'inline-flex'
|
|
452
448
|
}),
|
|
453
449
|
modalCloseButton: modalCloseButton,
|
|
450
|
+
modalHeaderCloseButton: _objectSpread(_objectSpread({}, modalCloseButton), {}, {
|
|
451
|
+
top: '50%',
|
|
452
|
+
transform: 'translateY(-50%)',
|
|
453
|
+
right: '16px'
|
|
454
|
+
}),
|
|
454
455
|
badge: {
|
|
455
456
|
deleteButton: _objectSpread(_objectSpread({}, baseIconButton), {}, {
|
|
456
457
|
borderRadius: '50%',
|
|
@@ -749,17 +749,10 @@ declare const _default: {
|
|
|
749
749
|
modal: {
|
|
750
750
|
content: {
|
|
751
751
|
boxShadow: string;
|
|
752
|
-
px: string;
|
|
753
|
-
pb: string;
|
|
754
|
-
pt: number;
|
|
755
752
|
borderRadius: string;
|
|
756
753
|
opacity: number;
|
|
757
|
-
top: string;
|
|
758
|
-
transform: string;
|
|
759
754
|
transition: string;
|
|
760
755
|
m: string[];
|
|
761
|
-
maxHeight: string;
|
|
762
|
-
overflowY: string;
|
|
763
756
|
'&.is-open-no-transition': {
|
|
764
757
|
opacity: string;
|
|
765
758
|
transform: string;
|
|
@@ -789,13 +782,35 @@ declare const _default: {
|
|
|
789
782
|
maxWidth: string[];
|
|
790
783
|
};
|
|
791
784
|
};
|
|
792
|
-
|
|
793
|
-
|
|
785
|
+
headingContainer: {
|
|
786
|
+
borderBottom: string;
|
|
787
|
+
borderBottomColor: string;
|
|
788
|
+
bg: string;
|
|
789
|
+
borderRadius: string;
|
|
794
790
|
};
|
|
795
791
|
header: {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
792
|
+
borderBottom: string;
|
|
793
|
+
borderBottomColor: string;
|
|
794
|
+
borderRadius: string;
|
|
795
|
+
px: string;
|
|
796
|
+
py: string;
|
|
797
|
+
};
|
|
798
|
+
bodyContainer: {
|
|
799
|
+
p: string;
|
|
800
|
+
};
|
|
801
|
+
body: {
|
|
802
|
+
p: string;
|
|
803
|
+
};
|
|
804
|
+
footer: {
|
|
805
|
+
borderTop: string;
|
|
806
|
+
borderTopColor: string;
|
|
807
|
+
borderRadius: string;
|
|
808
|
+
p: string;
|
|
809
|
+
};
|
|
810
|
+
footerContainer: {
|
|
811
|
+
borderTop: string;
|
|
812
|
+
borderTopColor: string;
|
|
813
|
+
borderRadius: string;
|
|
799
814
|
};
|
|
800
815
|
};
|
|
801
816
|
navBar: {
|
|
@@ -83,17 +83,10 @@ var modalSize = {
|
|
|
83
83
|
var modal = {
|
|
84
84
|
content: {
|
|
85
85
|
boxShadow: '0px 8px 16px 0px rgba(0, 0, 0, 0.5)',
|
|
86
|
-
|
|
87
|
-
pb: 'lg',
|
|
88
|
-
pt: 0,
|
|
89
|
-
borderRadius: '4px',
|
|
86
|
+
borderRadius: '1em',
|
|
90
87
|
opacity: 0,
|
|
91
|
-
top: '0',
|
|
92
|
-
transform: 'translate(0, -50px)',
|
|
93
88
|
transition: 'opacity 300ms ease, transform 500ms ease-out',
|
|
94
89
|
m: ['sm', 'sm', '1.75rem auto'],
|
|
95
|
-
maxHeight: 'calc(100vh - 3.5rem)',
|
|
96
|
-
overflowY: 'auto',
|
|
97
90
|
'&.is-open-no-transition': {
|
|
98
91
|
opacity: '100%',
|
|
99
92
|
transform: 'none'
|
|
@@ -123,13 +116,35 @@ var modal = {
|
|
|
123
116
|
maxWidth: modalSize.full
|
|
124
117
|
}
|
|
125
118
|
},
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
headingContainer: {
|
|
120
|
+
borderBottom: '1px solid',
|
|
121
|
+
borderBottomColor: 'gray-200',
|
|
122
|
+
bg: 'background.base',
|
|
123
|
+
borderRadius: '1em 1em 0px 0px'
|
|
128
124
|
},
|
|
129
125
|
header: {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
borderBottom: '1px solid',
|
|
127
|
+
borderBottomColor: 'gray-200',
|
|
128
|
+
borderRadius: '1em 1em 0px 0px',
|
|
129
|
+
px: 'lg',
|
|
130
|
+
py: 'md'
|
|
131
|
+
},
|
|
132
|
+
bodyContainer: {
|
|
133
|
+
p: 'lg'
|
|
134
|
+
},
|
|
135
|
+
body: {
|
|
136
|
+
p: 'lg'
|
|
137
|
+
},
|
|
138
|
+
footer: {
|
|
139
|
+
borderTop: '1px solid',
|
|
140
|
+
borderTopColor: 'gray-200',
|
|
141
|
+
borderRadius: '0px 0px 1em 1em',
|
|
142
|
+
p: 'lg'
|
|
143
|
+
},
|
|
144
|
+
footerContainer: {
|
|
145
|
+
borderTop: '1px solid',
|
|
146
|
+
borderTopColor: 'gray-200',
|
|
147
|
+
borderRadius: '0px 0px 1em 1em'
|
|
133
148
|
}
|
|
134
149
|
};
|
|
135
150
|
var listBox = {
|
package/lib/cjs/types/Modal.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export interface ModalProps extends DOMAttributes, TestingAttributes {
|
|
|
33
33
|
* `() => void`
|
|
34
34
|
*/
|
|
35
35
|
onClose?: () => void;
|
|
36
|
+
onSubmit?: () => void;
|
|
37
|
+
onCancel?: () => void;
|
|
36
38
|
/**
|
|
37
39
|
* When a user interacts with the argument element outside of the overlay ref, return true if
|
|
38
40
|
* onClose should be called. This gives you a chance to filter out interaction with elements that
|
|
@@ -59,3 +61,20 @@ export interface ModalProps extends DOMAttributes, TestingAttributes {
|
|
|
59
61
|
containerProps?: object;
|
|
60
62
|
headerContainerProps?: object;
|
|
61
63
|
}
|
|
64
|
+
export type ModalHeaderProps = {
|
|
65
|
+
titleProps?: object;
|
|
66
|
+
containerProps?: object;
|
|
67
|
+
closeButton?: ReactNode;
|
|
68
|
+
hasCloseButton?: boolean;
|
|
69
|
+
onClose?: () => void;
|
|
70
|
+
title?: ReactNode;
|
|
71
|
+
hasNoSeparator?: boolean;
|
|
72
|
+
};
|
|
73
|
+
export type ModalFooterProps = {
|
|
74
|
+
onSubmit?: () => void;
|
|
75
|
+
onCancel?: () => void;
|
|
76
|
+
children?: ReactNode;
|
|
77
|
+
footerProps?: object;
|
|
78
|
+
primaryButtonText?: string;
|
|
79
|
+
secondaryButtonText?: string;
|
|
80
|
+
};
|
|
@@ -17,7 +17,7 @@ import { copyButton } from '../CopyText/CopyText.styles';
|
|
|
17
17
|
import { containedIcon } from '../DatePicker/DatePicker.styles';
|
|
18
18
|
import { hintButton } from '../HelpHint/HelpHint.styles';
|
|
19
19
|
import { messageCloseButton } from '../Messages/Message.styles';
|
|
20
|
-
import { modalCloseButton } from '../Modal/Modal.styles';
|
|
20
|
+
import { closeButton, modalCloseButton } from '../Modal/Modal.styles';
|
|
21
21
|
import { button } from '../TooltipTrigger/Tooltip.styles';
|
|
22
22
|
export var base = {
|
|
23
23
|
justifyContent: 'center',
|
|
@@ -43,7 +43,7 @@ export var base = {
|
|
|
43
43
|
boxShadow: 'standard'
|
|
44
44
|
},
|
|
45
45
|
'&.is-pressed': {
|
|
46
|
-
|
|
46
|
+
path: {
|
|
47
47
|
fill: 'white'
|
|
48
48
|
},
|
|
49
49
|
bg: 'active',
|
|
@@ -71,7 +71,7 @@ var bidirectional = {
|
|
|
71
71
|
var inverted = _objectSpread(_objectSpread({}, base), {}, {
|
|
72
72
|
bg: 'active',
|
|
73
73
|
borderColor: 'active',
|
|
74
|
-
|
|
74
|
+
path: {
|
|
75
75
|
fill: 'white'
|
|
76
76
|
},
|
|
77
77
|
'&.is-hovered': {
|
|
@@ -108,29 +108,29 @@ var applicationPortal = _objectSpread(_objectSpread({}, base), {}, {
|
|
|
108
108
|
background: 'transparent',
|
|
109
109
|
'&.is-focused': _objectSpread({}, defaultFocus),
|
|
110
110
|
'&.is-hovered': {
|
|
111
|
-
|
|
111
|
+
path: {
|
|
112
112
|
fill: 'active'
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
'&.is-pressed': {
|
|
116
|
-
|
|
116
|
+
path: {
|
|
117
117
|
fill: 'active'
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
var applicationPortalPinned = _objectSpread(_objectSpread({}, base), {}, {
|
|
122
|
-
|
|
122
|
+
path: {
|
|
123
123
|
fill: 'success.bright'
|
|
124
124
|
},
|
|
125
125
|
background: 'transparent',
|
|
126
126
|
'&.is-focused': _objectSpread({}, defaultFocus),
|
|
127
127
|
'&.is-hovered': {
|
|
128
|
-
|
|
128
|
+
path: {
|
|
129
129
|
fill: 'active'
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
132
|
'&.is-pressed': {
|
|
133
|
-
|
|
133
|
+
path: {
|
|
134
134
|
fill: 'active'
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -187,6 +187,7 @@ export default {
|
|
|
187
187
|
inverted: inverted,
|
|
188
188
|
messageCloseButton: _objectSpread(_objectSpread({}, base), messageCloseButton),
|
|
189
189
|
modalCloseButton: _objectSpread(_objectSpread({}, base), modalCloseButton),
|
|
190
|
+
modalHeaderCloseButton: _objectSpread(_objectSpread({}, base), closeButton),
|
|
190
191
|
invertedBadgeDeleteButton: invertedBadgeDeleteButton,
|
|
191
192
|
invertedSquare: invertedSquare,
|
|
192
193
|
square: square,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withDesign } from 'storybook-addon-designs';
|
|
3
|
+
import DocsLayout from '../../../../.storybook/storybookDocsLayout';
|
|
4
|
+
import { Box, ModalBody, Text } from '../../../index';
|
|
5
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Modal/Convenience/ModalBody',
|
|
8
|
+
component: ModalBody,
|
|
9
|
+
decorators: [withDesign],
|
|
10
|
+
parameters: {
|
|
11
|
+
docs: {
|
|
12
|
+
page: function page() {
|
|
13
|
+
return ___EmotionJSX(DocsLayout, null);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export var Default = function Default() {
|
|
19
|
+
return ___EmotionJSX(ModalBody, null, ___EmotionJSX(Box, null, ___EmotionJSX(Text, null, "Do you want to continue with this action that you\u2018re performing?")));
|
|
20
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withDesign } from 'storybook-addon-designs';
|
|
3
|
+
import DocsLayout from '../../../../.storybook/storybookDocsLayout';
|
|
4
|
+
import { useModalState } from '../../../hooks';
|
|
5
|
+
import { ModalFooter } from '../../../index';
|
|
6
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/Modal/Convenience/ModalFooter',
|
|
9
|
+
component: ModalFooter,
|
|
10
|
+
decorators: [withDesign],
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
page: function page() {
|
|
14
|
+
return ___EmotionJSX(DocsLayout, null);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export var Default = function Default() {
|
|
20
|
+
var state = useModalState();
|
|
21
|
+
return ___EmotionJSX(ModalFooter, {
|
|
22
|
+
onSubmit: state.close,
|
|
23
|
+
onCancel: state.close
|
|
24
|
+
});
|
|
25
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withDesign } from 'storybook-addon-designs';
|
|
3
|
+
import DocsLayout from '../../../../.storybook/storybookDocsLayout';
|
|
4
|
+
import { useModalState } from '../../../hooks';
|
|
5
|
+
import { ModalHeader } from '../../../index';
|
|
6
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/Modal/Convenience/ModalHeader',
|
|
9
|
+
component: ModalHeader,
|
|
10
|
+
decorators: [withDesign],
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
page: function page() {
|
|
14
|
+
return ___EmotionJSX(DocsLayout, null);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export var Default = function Default() {
|
|
20
|
+
var state = useModalState();
|
|
21
|
+
return ___EmotionJSX(ModalHeader, {
|
|
22
|
+
hasCloseButton: true,
|
|
23
|
+
onClose: state.close,
|
|
24
|
+
title: "Continue"
|
|
25
|
+
});
|
|
26
|
+
};
|