@xqmsg/ui-core 0.16.0 → 0.16.2

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.
@@ -1,242 +0,0 @@
1
- declare const _default: {
2
- parts: string[];
3
- baseStyle: (props: Record<string, any>) => {
4
- overlay: {
5
- bg: string;
6
- zIndex: string;
7
- };
8
- dialogContainer: {
9
- display: string;
10
- zIndex: string;
11
- justifyContent: string;
12
- alignItems: string;
13
- overflow: string;
14
- WebkitOverflowScrolling: string;
15
- };
16
- dialog: {
17
- borderRadius: string;
18
- bg: string;
19
- color: string;
20
- mt: string | {
21
- base: number;
22
- md: string;
23
- };
24
- mb: string | {
25
- base: number;
26
- md: string;
27
- };
28
- mx: number;
29
- zIndex: string;
30
- maxH: string | undefined;
31
- boxShadow: string;
32
- };
33
- header: {
34
- px: number;
35
- py: number;
36
- minHeight: number;
37
- fontSize: string;
38
- display: string;
39
- alignItems: string;
40
- fontWeight: string;
41
- bg: string;
42
- color: string;
43
- userSelect: string;
44
- };
45
- closeButton: {
46
- position: string;
47
- top: number;
48
- right: number;
49
- };
50
- body: {
51
- px: (number | null)[];
52
- py: number;
53
- flex: number;
54
- overflow: string | undefined;
55
- };
56
- footer: {
57
- px: (number | null)[];
58
- pt: number;
59
- pb: number;
60
- };
61
- };
62
- sizes: {
63
- xs: {
64
- content: {
65
- maxW: string;
66
- h: string;
67
- };
68
- body?: undefined;
69
- footer?: undefined;
70
- } | {
71
- content: {
72
- maxW: string;
73
- h?: undefined;
74
- };
75
- body: any;
76
- footer: any;
77
- };
78
- sm: {
79
- content: {
80
- maxW: string;
81
- h: string;
82
- };
83
- body?: undefined;
84
- footer?: undefined;
85
- } | {
86
- content: {
87
- maxW: string;
88
- h?: undefined;
89
- };
90
- body: any;
91
- footer: any;
92
- };
93
- md: {
94
- content: {
95
- maxW: string;
96
- h: string;
97
- };
98
- body?: undefined;
99
- footer?: undefined;
100
- } | {
101
- content: {
102
- maxW: string;
103
- h?: undefined;
104
- };
105
- body: any;
106
- footer: any;
107
- };
108
- lg: {
109
- content: {
110
- maxW: string;
111
- h: string;
112
- };
113
- body?: undefined;
114
- footer?: undefined;
115
- } | {
116
- content: {
117
- maxW: string;
118
- h?: undefined;
119
- };
120
- body: any;
121
- footer: any;
122
- };
123
- xl: {
124
- content: {
125
- maxW: string;
126
- h: string;
127
- };
128
- body?: undefined;
129
- footer?: undefined;
130
- } | {
131
- content: {
132
- maxW: string;
133
- h?: undefined;
134
- };
135
- body: any;
136
- footer: any;
137
- };
138
- '2xl': {
139
- content: {
140
- maxW: string;
141
- h: string;
142
- };
143
- body?: undefined;
144
- footer?: undefined;
145
- } | {
146
- content: {
147
- maxW: string;
148
- h?: undefined;
149
- };
150
- body: any;
151
- footer: any;
152
- };
153
- '3xl': {
154
- content: {
155
- maxW: string;
156
- h: string;
157
- };
158
- body?: undefined;
159
- footer?: undefined;
160
- } | {
161
- content: {
162
- maxW: string;
163
- h?: undefined;
164
- };
165
- body: any;
166
- footer: any;
167
- };
168
- '4xl': {
169
- content: {
170
- maxW: string;
171
- h: string;
172
- };
173
- body?: undefined;
174
- footer?: undefined;
175
- } | {
176
- content: {
177
- maxW: string;
178
- h?: undefined;
179
- };
180
- body: any;
181
- footer: any;
182
- };
183
- '5xl': {
184
- content: {
185
- maxW: string;
186
- h: string;
187
- };
188
- body?: undefined;
189
- footer?: undefined;
190
- } | {
191
- content: {
192
- maxW: string;
193
- h?: undefined;
194
- };
195
- body: any;
196
- footer: any;
197
- };
198
- '6xl': {
199
- content: {
200
- maxW: string;
201
- h: string;
202
- };
203
- body?: undefined;
204
- footer?: undefined;
205
- } | {
206
- content: {
207
- maxW: string;
208
- h?: undefined;
209
- };
210
- body: any;
211
- footer: any;
212
- };
213
- full: {
214
- content: {
215
- maxW: string;
216
- h: string;
217
- };
218
- body?: undefined;
219
- footer?: undefined;
220
- } | {
221
- content: {
222
- maxW: string;
223
- h?: undefined;
224
- };
225
- body: any;
226
- footer: any;
227
- };
228
- };
229
- variants: {
230
- warning: () => {
231
- header: {
232
- bg: string;
233
- color: string;
234
- };
235
- };
236
- };
237
- defaultProps: {
238
- size: string;
239
- isCentered: boolean;
240
- };
241
- };
242
- export default _default;
@@ -1,216 +0,0 @@
1
- import { mode } from '@chakra-ui/theme-tools';
2
-
3
- const parts = [
4
- 'overlay',
5
- 'dialogContainer',
6
- 'dialog',
7
- 'header',
8
- 'closeButton',
9
- 'body',
10
- 'footer',
11
- ];
12
-
13
- const baseStyleOverlay = {
14
- bg: 'blackAlpha.600',
15
- zIndex: 'modal',
16
- };
17
-
18
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
- type Dict = Record<string, any>;
20
-
21
- function baseStyleDialogContainer(props: Dict) {
22
- const { scrollBehavior } = props;
23
-
24
- return {
25
- display: 'flex',
26
- zIndex: 'modal',
27
- justifyContent: 'center',
28
- alignItems: 'flex-start',
29
- overflow: scrollBehavior === 'inside' ? 'hidden' : 'auto',
30
- WebkitOverflowScrolling: 'touch',
31
- };
32
- }
33
-
34
- function baseStyleDialog(props: Dict) {
35
- const { isCentered, scrollBehavior } = props;
36
-
37
- return {
38
- borderRadius: 'lg',
39
- bg: mode('white', 'gray.700')(props),
40
- color: 'inherit',
41
- mt: isCentered ? { base: 8, md: 'auto' } : '3.75rem',
42
- mb: isCentered ? { base: 20, md: 'auto' } : '3.75rem',
43
- mx: 4,
44
- zIndex: 'modal',
45
- maxH: scrollBehavior === 'inside' ? 'calc(100vh - 7.5rem)' : undefined,
46
- boxShadow: mode('xl', 'dark-lg')(props),
47
- };
48
- }
49
-
50
- const baseStyleHeader = {
51
- px: 6,
52
- py: 4,
53
- minHeight: 20,
54
- fontSize: 'xl',
55
- display: 'flex',
56
- alignItems: 'center',
57
- fontWeight: 'bold',
58
- bg: 'primary.900',
59
- color: 'white',
60
- userSelect: 'none',
61
- };
62
-
63
- const baseStyleCloseButton = {
64
- position: 'absolute',
65
- top: 2,
66
- right: 3,
67
- };
68
-
69
- function baseStyleBody(props: Dict) {
70
- const { scrollBehavior } = props;
71
- return {
72
- px: [6, null, 20],
73
- py: 10,
74
- flex: 1,
75
- overflow: scrollBehavior === 'inside' ? 'auto' : undefined,
76
- };
77
- }
78
-
79
- const baseStyleFooter = {
80
- px: [6, null, 20],
81
- pt: 5,
82
- pb: 16,
83
- };
84
-
85
- const baseStyle = (props: Dict) => ({
86
- overlay: baseStyleOverlay,
87
- dialogContainer: baseStyleDialogContainer(props),
88
- dialog: baseStyleDialog(props),
89
- header: baseStyleHeader,
90
- closeButton: baseStyleCloseButton,
91
- body: baseStyleBody(props),
92
- footer: baseStyleFooter,
93
- });
94
-
95
- /**
96
- * Since the `maxWidth` prop references theme.sizes internally,
97
- * we can leverage that to size our modals.
98
- */
99
- function getSize(value: string) {
100
- const commonBodyFooterStyles: Dict = {
101
- xs: {
102
- px: 8,
103
- pb: 8,
104
- },
105
- sm: {
106
- px: 8,
107
- pb: 8,
108
- },
109
- md: {
110
- px: 8,
111
- pb: 8,
112
- },
113
- lg: {
114
- px: 10,
115
- pb: 10,
116
- },
117
- xl: {
118
- px: 12,
119
- pb: 10,
120
- },
121
- };
122
-
123
- const bodyStyles: Dict = {
124
- xs: {
125
- py: 6,
126
- },
127
- sm: {
128
- py: 6,
129
- },
130
- md: {
131
- py: 6,
132
- },
133
- lg: {
134
- py: 8,
135
- },
136
- xl: {
137
- py: 8,
138
- },
139
- };
140
-
141
- const footerStyles: Dict = {
142
- xs: {
143
- pb: 8,
144
- },
145
- sm: {
146
- pb: 8,
147
- },
148
- md: {
149
- pb: 8,
150
- },
151
- lg: {
152
- pb: 10,
153
- },
154
- xl: {
155
- pb: 10,
156
- },
157
- };
158
-
159
- if (value === 'full') {
160
- return { content: { maxW: '100vw', h: '100vh' } };
161
- }
162
-
163
- return {
164
- content: {
165
- maxW: value,
166
- },
167
- body: {
168
- ...commonBodyFooterStyles[value],
169
- ...bodyStyles[value],
170
- },
171
- footer: {
172
- ...commonBodyFooterStyles[value],
173
- ...footerStyles[value],
174
- },
175
- };
176
- }
177
-
178
- const sizes = {
179
- xs: getSize('xs'),
180
- sm: getSize('sm'),
181
- md: getSize('md'),
182
- lg: getSize('lg'),
183
- xl: getSize('xl'),
184
- '2xl': getSize('2xl'),
185
- '3xl': getSize('3xl'),
186
- '4xl': getSize('4xl'),
187
- '5xl': getSize('5xl'),
188
- '6xl': getSize('6xl'),
189
- full: getSize('full'),
190
- };
191
-
192
- const warningVariant = () => {
193
- return {
194
- header: {
195
- bg: 'warning.300',
196
- color: 'black',
197
- },
198
- };
199
- };
200
-
201
- const variants = {
202
- warning: warningVariant,
203
- };
204
-
205
- const defaultProps = {
206
- size: 'lg',
207
- isCentered: true,
208
- };
209
-
210
- export default {
211
- parts,
212
- baseStyle,
213
- sizes,
214
- variants,
215
- defaultProps,
216
- };