@pingux/astro 2.147.1-alpha.1 → 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/Badge/Badge.styles.d.ts +5 -1
- package/lib/cjs/components/Badge/Badge.styles.js +6 -2
- 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/ListBox/Option.js +7 -3
- 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/components/MultivaluesField/DefaultMultivaluesField.js +0 -1
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +8 -103
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.d.ts +55 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +14 -2
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +24 -1
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +25 -2
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.d.ts +0 -1
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +0 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +62 -23
- package/lib/cjs/styles/themes/next-gen/variants/badges.d.ts +3 -5
- package/lib/cjs/styles/themes/next-gen/variants/badges.js +5 -2
- 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/Badge/Badge.styles.js +6 -2
- package/lib/components/IconButton/IconButton.styles.js +9 -8
- package/lib/components/ListBox/Option.js +7 -3
- 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/components/MultivaluesField/DefaultMultivaluesField.js +0 -1
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +8 -103
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +14 -2
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +25 -2
- package/lib/styles/themes/next-gen/convertedComponentList.js +0 -1
- package/lib/styles/themes/next-gen/variants/badges.js +5 -2
- 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
|
@@ -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
|
+
};
|
|
@@ -51,6 +51,7 @@ var multivaluesBadge = _objectSpread(_objectSpread({}, baseBadge), {}, {
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
var selectedItemBadge = _objectSpread(_objectSpread({}, multivaluesBadge), {}, {
|
|
54
|
+
bg: '#4462ED !important',
|
|
54
55
|
py: 3,
|
|
55
56
|
pr: 0,
|
|
56
57
|
my: 3
|
|
@@ -63,12 +64,15 @@ var readOnlyBadge = _objectSpread(_objectSpread({}, multivaluesBadge), {}, {
|
|
|
63
64
|
var itemBadgeWithSlot = _objectSpread(_objectSpread({}, readOnlyBadge), {}, {
|
|
64
65
|
p: 3,
|
|
65
66
|
my: 0,
|
|
66
|
-
|
|
67
|
+
bg: 'white !important',
|
|
67
68
|
'& span': {
|
|
68
69
|
color: 'text.primary',
|
|
69
70
|
mr: '2px',
|
|
70
71
|
lineHeight: '16px'
|
|
71
72
|
},
|
|
73
|
+
'& svg': {
|
|
74
|
+
fill: 'neutral.10'
|
|
75
|
+
},
|
|
72
76
|
maxHeight: '22px'
|
|
73
77
|
});
|
|
74
78
|
var environmentBadge = _objectSpread(_objectSpread({}, baseBadge), {}, {
|
|
@@ -105,7 +109,7 @@ export var badgeDeleteButton = _objectSpread(_objectSpread({}, deleteButton), {}
|
|
|
105
109
|
}
|
|
106
110
|
},
|
|
107
111
|
'&.is-pressed': {
|
|
108
|
-
|
|
112
|
+
path: {
|
|
109
113
|
fill: 'white'
|
|
110
114
|
},
|
|
111
115
|
bg: '#4462ED !important'
|
|
@@ -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,
|
|
@@ -125,19 +125,23 @@ var Option = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
125
125
|
onPointerOver: setFocusOnHover
|
|
126
126
|
}, theseOptionProps, others, {
|
|
127
127
|
"aria-label": ariaLabel
|
|
128
|
-
}), isCondensed ? ___EmotionJSX(
|
|
128
|
+
}), isCondensed ? ___EmotionJSX(Box, {
|
|
129
|
+
isRow: true,
|
|
130
|
+
alignItems: "center",
|
|
131
|
+
flex: "1"
|
|
132
|
+
}, ___EmotionJSX(Icon, {
|
|
129
133
|
icon: isSelected ? CheckedIcon : UncheckedIcon,
|
|
130
134
|
color: "active",
|
|
131
135
|
size: "24px",
|
|
132
136
|
mr: "xs",
|
|
133
137
|
className: classNames,
|
|
134
138
|
variant: "listBox.checkboxIcon"
|
|
135
|
-
}) : isSelected && !isOnyx && shouldShowSelectedOption && ___EmotionJSX(Icon, {
|
|
139
|
+
}), rendered) : ___EmotionJSX(React.Fragment, null, isSelected && !isOnyx && shouldShowSelectedOption && ___EmotionJSX(Icon, {
|
|
136
140
|
icon: CircleSmallIcon,
|
|
137
141
|
title: {
|
|
138
142
|
name: 'Circle Small Icon'
|
|
139
143
|
}
|
|
140
|
-
}), rendered, isSelected && isOnyx && shouldShowSelectedOption && ___EmotionJSX(Icon, {
|
|
144
|
+
}), rendered), isSelected && isOnyx && shouldShowSelectedOption && ___EmotionJSX(Icon, {
|
|
141
145
|
icon: CheckIcon,
|
|
142
146
|
title: {
|
|
143
147
|
name: 'Check Icon'
|
|
@@ -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
|
+
};
|
|
@@ -7,9 +7,11 @@ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-st
|
|
|
7
7
|
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
10
|
+
import _toArray from "@babel/runtime-corejs3/helpers/esm/toArray";
|
|
10
11
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
11
12
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
12
13
|
var _excluded = ["className", "closeButton", "hasAutoFocus", "hasCloseButton", "id", "isClosedOnBlur", "isDismissable", "isKeyboardDismissDisabled", "isOpen", "role", "size", "state", "title", "onClose", "shouldCloseOnInteractOutside", "children", "contentProps", "containerProps", "headerContainerProps"];
|
|
14
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
13
15
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
16
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
17
|
import React, { forwardRef } from 'react';
|
|
@@ -21,6 +23,7 @@ import Box from '../Box';
|
|
|
21
23
|
import Icon from '../Icon';
|
|
22
24
|
import IconButton from '../IconButton';
|
|
23
25
|
import Text from '../Text';
|
|
26
|
+
import ModalHeader from './ModalHeader';
|
|
24
27
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
25
28
|
var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
26
29
|
var _useStatusClasses2;
|
|
@@ -84,7 +87,12 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
84
87
|
var isOpenNoTransition = (state === null || state === void 0 ? void 0 : state.isTransitioning) === undefined && isOpen === true;
|
|
85
88
|
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)),
|
|
86
89
|
classNames = _useStatusClasses.classNames;
|
|
87
|
-
var
|
|
90
|
+
var _React$Children$toArr = React.Children.toArray(children),
|
|
91
|
+
_React$Children$toArr2 = _toArray(_React$Children$toArr),
|
|
92
|
+
header = _React$Children$toArr2[0],
|
|
93
|
+
siblings = _sliceInstanceProperty(_React$Children$toArr2).call(_React$Children$toArr2, 1);
|
|
94
|
+
var hasHeaderContent = /*#__PURE__*/React.isValidElement(header) && header.type === ModalHeader;
|
|
95
|
+
var titleContent = !hasHeaderContent && title && (isOnyx ? ___EmotionJSX(Box, {
|
|
88
96
|
variant: "modal.header"
|
|
89
97
|
}, ___EmotionJSX(Text, _extends({}, titleProps, {
|
|
90
98
|
variant: "modalTitle",
|
|
@@ -107,7 +115,7 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
107
115
|
}, propsContentProps, dialogProps, modalProps, {
|
|
108
116
|
ref: modalRef,
|
|
109
117
|
"aria-modal": true
|
|
110
|
-
}), ___EmotionJSX(Box, _extends({
|
|
118
|
+
}), titleContent && ___EmotionJSX(Box, _extends({
|
|
111
119
|
variant: "modal.headingContainer"
|
|
112
120
|
}, headerContainerProps), hasCloseButton && (closeButton !== null && closeButton !== void 0 ? closeButton : ___EmotionJSX(IconButton, {
|
|
113
121
|
"aria-label": "Close modal window",
|
|
@@ -119,8 +127,9 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
119
127
|
title: {
|
|
120
128
|
name: 'Close Icon'
|
|
121
129
|
}
|
|
122
|
-
}))), titleContent), ___EmotionJSX(Box, {
|
|
123
|
-
pt: "md"
|
|
130
|
+
}))), titleContent), isOnyx ? children : ___EmotionJSX(Box, {
|
|
131
|
+
pt: "md",
|
|
132
|
+
px: "lg"
|
|
124
133
|
}, children)))));
|
|
125
134
|
});
|
|
126
135
|
Modal.defaultProps = {
|
|
@@ -3,8 +3,8 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import { withDesign } from 'storybook-addon-designs';
|
|
5
5
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
6
|
-
import { useModalState } from '../../hooks';
|
|
7
|
-
import { Box, Button, Item, Menu, Modal, OverlayProvider, PopoverMenu, RadioField, RadioGroupField, SearchField, SelectField, Text } from '../../index';
|
|
6
|
+
import { useGetTheme, useModalState } from '../../hooks';
|
|
7
|
+
import { Box, Button, Item, Menu, Modal, ModalBody, ModalFooter, ModalHeader, OverlayProvider, PopoverMenu, RadioField, RadioGroupField, SearchField, SelectField, Text } from '../../index';
|
|
8
8
|
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
|
9
9
|
import { modalSizes } from '../../utils/devUtils/constants/modalSizes';
|
|
10
10
|
import ModalReadme from './Modal.mdx';
|
|
@@ -89,21 +89,6 @@ export default {
|
|
|
89
89
|
};
|
|
90
90
|
export var Default = function Default(args) {
|
|
91
91
|
var state = useModalState();
|
|
92
|
-
var ModalBodyContent = ___EmotionJSX(Box, null, ___EmotionJSX(Text, null, "Do you want to continue with this action that you\u2018re performing?"), ___EmotionJSX(Box, {
|
|
93
|
-
isRow: true,
|
|
94
|
-
mr: "auto",
|
|
95
|
-
width: "100%",
|
|
96
|
-
variant: "modal.buttonsContainer"
|
|
97
|
-
}, ___EmotionJSX(Button, {
|
|
98
|
-
variant: "primary",
|
|
99
|
-
onPress: state.close,
|
|
100
|
-
mr: "md",
|
|
101
|
-
"aria-label": "Continue"
|
|
102
|
-
}, "Continue"), ___EmotionJSX(Button, {
|
|
103
|
-
variant: "link",
|
|
104
|
-
onPress: state.close,
|
|
105
|
-
"aria-label": "Cancel"
|
|
106
|
-
}, "Cancel")));
|
|
107
92
|
return (
|
|
108
93
|
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
|
109
94
|
// readers when an overlay opens.
|
|
@@ -113,10 +98,16 @@ export var Default = function Default(args) {
|
|
|
113
98
|
tabIndex: state.isOpen ? -1 : 0
|
|
114
99
|
}, "Open Modal"), (state.isOpen || state.isTransitioning) && ___EmotionJSX(Modal, _extends({}, args, {
|
|
115
100
|
isOpen: state.isOpen,
|
|
101
|
+
state: state
|
|
102
|
+
}), ___EmotionJSX(ModalHeader, {
|
|
103
|
+
hasCloseButton: true,
|
|
116
104
|
onClose: state.close,
|
|
117
|
-
state: state,
|
|
118
105
|
title: "Continue"
|
|
119
|
-
}),
|
|
106
|
+
}), ___EmotionJSX(ModalBody, null, ___EmotionJSX(Box, null, ___EmotionJSX(Text, null, "Do you want to continue with this action that you\u2018re performing?"))), ___EmotionJSX(ModalFooter, {
|
|
107
|
+
onSubmit: state.close,
|
|
108
|
+
onCancel: state.close,
|
|
109
|
+
primaryButtonText: "Continue"
|
|
110
|
+
})))
|
|
120
111
|
);
|
|
121
112
|
};
|
|
122
113
|
Default.parameters = {
|
|
@@ -136,27 +127,53 @@ export var LargeContent = function LargeContent(args) {
|
|
|
136
127
|
tabIndex: state.isOpen ? -1 : 0
|
|
137
128
|
}, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, _extends({}, args, {
|
|
138
129
|
isOpen: state.isOpen,
|
|
130
|
+
onClose: state.close
|
|
131
|
+
}), ___EmotionJSX(ModalHeader, {
|
|
132
|
+
hasCloseButton: true,
|
|
139
133
|
onClose: state.close,
|
|
140
134
|
title: "Lorem Ipsum"
|
|
141
|
-
}), ___EmotionJSX(Box, {
|
|
135
|
+
}), ___EmotionJSX(ModalBody, null, ___EmotionJSX(Box, {
|
|
142
136
|
gap: "lg"
|
|
143
|
-
}, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.")), ___EmotionJSX(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
137
|
+
}, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."))), ___EmotionJSX(ModalFooter, {
|
|
138
|
+
onSubmit: state.close,
|
|
139
|
+
onCancel: state.close
|
|
140
|
+
})))
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
export var LargeContentWithScroll = function LargeContentWithScroll(args) {
|
|
144
|
+
var state = useModalState();
|
|
145
|
+
return (
|
|
146
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
|
147
|
+
// readers when an overlay opens.
|
|
148
|
+
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
|
|
149
|
+
onPress: state.open,
|
|
150
|
+
"aria-label": "Open modal",
|
|
151
|
+
tabIndex: state.isOpen ? -1 : 0
|
|
152
|
+
}, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, _extends({}, args, {
|
|
153
|
+
isOpen: state.isOpen,
|
|
154
|
+
onClose: state.close
|
|
155
|
+
}), ___EmotionJSX(ModalHeader, {
|
|
156
|
+
hasCloseButton: true,
|
|
157
|
+
onClose: state.close,
|
|
158
|
+
title: "Lorem Ipsum"
|
|
159
|
+
}), ___EmotionJSX(ModalBody, {
|
|
160
|
+
isScrollable: true,
|
|
161
|
+
scrollProps: {
|
|
162
|
+
maxHeight: '400px'
|
|
163
|
+
}
|
|
164
|
+
}, ___EmotionJSX(Box, {
|
|
165
|
+
gap: "lg",
|
|
166
|
+
pr: "lg"
|
|
167
|
+
}, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."), ___EmotionJSX(Text, null, "Eu fugiat nulla pariatur."), ___EmotionJSX(Text, null, "Excepteur sint occaecat cupidatat non proident."), ___EmotionJSX(Text, null, "Sunt in culpa qui officia deserunt mollit anim id est laborum."), ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."), ___EmotionJSX(Text, null, "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris."), ___EmotionJSX(Text, null, "Nisi ut aliquip ex ea commodo consequat."), ___EmotionJSX(Text, null, "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore."))), ___EmotionJSX(ModalFooter, {
|
|
168
|
+
onSubmit: state.close,
|
|
169
|
+
onCancel: state.close
|
|
170
|
+
})))
|
|
156
171
|
);
|
|
157
172
|
};
|
|
158
173
|
export var WithInputField = function WithInputField() {
|
|
159
174
|
var state = useModalState();
|
|
175
|
+
var _useGetTheme = useGetTheme(),
|
|
176
|
+
isOnyx = _useGetTheme.themeState.isOnyx;
|
|
160
177
|
var _useState = useState(''),
|
|
161
178
|
_useState2 = _slicedToArray(_useState, 2),
|
|
162
179
|
value = _useState2[0],
|
|
@@ -177,8 +194,9 @@ export var WithInputField = function WithInputField() {
|
|
|
177
194
|
}, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, {
|
|
178
195
|
isOpen: state.isOpen,
|
|
179
196
|
onClose: state.close
|
|
180
|
-
}, ___EmotionJSX(Box, {
|
|
181
|
-
gap: "lg"
|
|
197
|
+
}, ___EmotionJSX(ModalBody, null, ___EmotionJSX(Box, {
|
|
198
|
+
gap: "lg",
|
|
199
|
+
pt: isOnyx ? '' : 'lg'
|
|
182
200
|
}, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet consectetur"), ___EmotionJSX(SelectField, {
|
|
183
201
|
label: "Select an option"
|
|
184
202
|
}, ___EmotionJSX(Item, null, "Red"), ___EmotionJSX(Item, null, "Green"), ___EmotionJSX(Item, null, "Blue")), ___EmotionJSX(RadioGroupField, {
|
|
@@ -217,19 +235,10 @@ export var WithInputField = function WithInputField() {
|
|
|
217
235
|
key: item.key,
|
|
218
236
|
textValue: item.name
|
|
219
237
|
}, item.name);
|
|
220
|
-
}), ___EmotionJSX(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
variant: "primary",
|
|
225
|
-
onPress: state.close,
|
|
226
|
-
mr: "md",
|
|
227
|
-
"aria-label": "Continue"
|
|
228
|
-
}, "Continue"), ___EmotionJSX(Button, {
|
|
229
|
-
variant: "link",
|
|
230
|
-
onPress: state.close,
|
|
231
|
-
"aria-label": "Cancel"
|
|
232
|
-
}, "Cancel")))));
|
|
238
|
+
}))), ___EmotionJSX(ModalFooter, {
|
|
239
|
+
onSubmit: state.close,
|
|
240
|
+
onCancel: state.close
|
|
241
|
+
})));
|
|
233
242
|
};
|
|
234
243
|
export var WithPopoverMenu = function WithPopoverMenu() {
|
|
235
244
|
var state = useModalState();
|