@cdx-ui/components 0.0.1-alpha.22 → 0.0.1-alpha.23
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/commonjs/components/AlertDialog/index.js +117 -0
- package/lib/commonjs/components/AlertDialog/index.js.map +1 -0
- package/lib/commonjs/components/Dialog/index.js +275 -0
- package/lib/commonjs/components/Dialog/index.js.map +1 -0
- package/lib/commonjs/components/Dialog/styles.js +63 -0
- package/lib/commonjs/components/Dialog/styles.js.map +1 -0
- package/lib/commonjs/components/index.js +36 -12
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/AlertDialog/index.js +112 -0
- package/lib/module/components/AlertDialog/index.js.map +1 -0
- package/lib/module/components/Dialog/index.js +267 -0
- package/lib/module/components/Dialog/index.js.map +1 -0
- package/lib/module/components/Dialog/styles.js +60 -0
- package/lib/module/components/Dialog/styles.js.map +1 -0
- package/lib/module/components/index.js +3 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/components/AlertDialog/index.d.ts +30 -0
- package/lib/typescript/components/AlertDialog/index.d.ts.map +1 -0
- package/lib/typescript/components/Chip/styles.d.ts +3 -3
- package/lib/typescript/components/Dialog/index.d.ts +62 -0
- package/lib/typescript/components/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/components/Dialog/styles.d.ts +14 -0
- package/lib/typescript/components/Dialog/styles.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +3 -1
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/AlertDialog/index.tsx +124 -0
- package/src/components/Dialog/index.tsx +306 -0
- package/src/components/Dialog/styles.ts +88 -0
- package/src/components/index.ts +3 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { useDialog } from '@cdx-ui/primitives';
|
|
5
|
+
import { composeEventHandlers } from '@cdx-ui/utils';
|
|
6
|
+
import { Button } from '../Button';
|
|
7
|
+
import { Dialog } from '../Dialog';
|
|
8
|
+
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// ALERT DIALOG ROOT (Dialog with non-dismissible defaults + alertdialog role)
|
|
11
|
+
// =============================================================================
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const AlertDialogRoot = /*#__PURE__*/forwardRef(({
|
|
14
|
+
closeOnBackdropPress = false,
|
|
15
|
+
closeOnEscKey = false,
|
|
16
|
+
role = 'alertdialog',
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
}, ref) => /*#__PURE__*/_jsx(Dialog, {
|
|
20
|
+
ref: ref,
|
|
21
|
+
closeOnBackdropPress: closeOnBackdropPress,
|
|
22
|
+
closeOnEscKey: closeOnEscKey,
|
|
23
|
+
role: role,
|
|
24
|
+
...props,
|
|
25
|
+
children: children
|
|
26
|
+
}));
|
|
27
|
+
AlertDialogRoot.displayName = 'AlertDialog';
|
|
28
|
+
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// ALERT DIALOG ACTION
|
|
31
|
+
// =============================================================================
|
|
32
|
+
|
|
33
|
+
const AlertDialogAction = /*#__PURE__*/forwardRef(({
|
|
34
|
+
asChild = false,
|
|
35
|
+
children,
|
|
36
|
+
color = 'action',
|
|
37
|
+
className,
|
|
38
|
+
...props
|
|
39
|
+
}, ref) => {
|
|
40
|
+
if (asChild && /*#__PURE__*/React.isValidElement(children)) {
|
|
41
|
+
return /*#__PURE__*/React.cloneElement(children, {
|
|
42
|
+
ref,
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
48
|
+
ref: ref,
|
|
49
|
+
variant: "strong",
|
|
50
|
+
color: color,
|
|
51
|
+
className: className,
|
|
52
|
+
...props,
|
|
53
|
+
children: /*#__PURE__*/_jsx(Button.Label, {
|
|
54
|
+
children: children
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
AlertDialogAction.displayName = 'AlertDialog.Action';
|
|
59
|
+
|
|
60
|
+
// =============================================================================
|
|
61
|
+
// ALERT DIALOG CANCEL
|
|
62
|
+
// =============================================================================
|
|
63
|
+
|
|
64
|
+
const AlertDialogCancel = /*#__PURE__*/forwardRef(({
|
|
65
|
+
asChild = false,
|
|
66
|
+
children,
|
|
67
|
+
onPress,
|
|
68
|
+
className,
|
|
69
|
+
...props
|
|
70
|
+
}, ref) => {
|
|
71
|
+
const {
|
|
72
|
+
onOpenChange
|
|
73
|
+
} = useDialog();
|
|
74
|
+
const handlePress = composeEventHandlers(onPress, () => onOpenChange(false));
|
|
75
|
+
if (asChild && /*#__PURE__*/React.isValidElement(children)) {
|
|
76
|
+
return /*#__PURE__*/React.cloneElement(children, {
|
|
77
|
+
ref,
|
|
78
|
+
onPress: handlePress,
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
84
|
+
ref: ref,
|
|
85
|
+
variant: "outline",
|
|
86
|
+
onPress: handlePress,
|
|
87
|
+
className: className,
|
|
88
|
+
...props,
|
|
89
|
+
children: /*#__PURE__*/_jsx(Button.Label, {
|
|
90
|
+
children: children
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
AlertDialogCancel.displayName = 'AlertDialog.Cancel';
|
|
95
|
+
|
|
96
|
+
// =============================================================================
|
|
97
|
+
// COMPOUND EXPORT
|
|
98
|
+
// =============================================================================
|
|
99
|
+
|
|
100
|
+
export const AlertDialog = Object.assign(AlertDialogRoot, {
|
|
101
|
+
Trigger: Dialog.Trigger,
|
|
102
|
+
Content: Dialog.Content,
|
|
103
|
+
Header: Dialog.Header,
|
|
104
|
+
Title: Dialog.Title,
|
|
105
|
+
Description: Dialog.Description,
|
|
106
|
+
Body: Dialog.Body,
|
|
107
|
+
Footer: Dialog.Footer,
|
|
108
|
+
Close: Dialog.Close,
|
|
109
|
+
Action: AlertDialogAction,
|
|
110
|
+
Cancel: AlertDialogCancel
|
|
111
|
+
});
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useDialog","composeEventHandlers","Button","Dialog","jsx","_jsx","AlertDialogRoot","closeOnBackdropPress","closeOnEscKey","role","children","props","ref","displayName","AlertDialogAction","asChild","color","className","isValidElement","cloneElement","variant","Label","AlertDialogCancel","onPress","onOpenChange","handlePress","AlertDialog","Object","assign","Trigger","Content","Header","Title","Description","Body","Footer","Close","Action","Cancel"],"sourceRoot":"../../../../src","sources":["components/AlertDialog/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAEzC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,MAAM,QAA0B,WAAW;AACpD,SAASC,MAAM,QAA8B,WAAW;;AAExD;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIA,MAAMC,eAAe,gBAAGP,UAAU,CAChC,CACE;EACEQ,oBAAoB,GAAG,KAAK;EAC5BC,aAAa,GAAG,KAAK;EACrBC,IAAI,GAAG,aAAa;EACpBC,QAAQ;EACR,GAAGC;AACL,CAAC,EACDC,GAAG,kBAEHP,IAAA,CAACF,MAAM;EACLS,GAAG,EAAEA,GAAI;EACTL,oBAAoB,EAAEA,oBAAqB;EAC3CC,aAAa,EAAEA,aAAc;EAC7BC,IAAI,EAAEA,IAAK;EAAA,GACPE,KAAK;EAAAD,QAAA,EAERA;AAAQ,CACH,CAEZ,CAAC;AACDJ,eAAe,CAACO,WAAW,GAAG,aAAa;;AAE3C;AACA;AACA;;AAMA,MAAMC,iBAAiB,gBAAGf,UAAU,CAClC,CAAC;EAAEgB,OAAO,GAAG,KAAK;EAAEL,QAAQ;EAAEM,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AAEE,WAAY;IAACR,SAAS,EAAEA,SAAU;IAAA,GAAKN,KAAK;IAAAD,QAAA,eACvFL,IAAA,CAACH,MAAM,CAACmB,KAAK;MAAAX,QAAA,EAAEA;IAAQ,CAAe;EAAC,CACjC,CAAC;AAEb,CACF,CAAC;AACDY,iBAAiB,CAACT,WAAW,GAAG,oBAAoB;;AAEpD;AACA;AACA;;AAeA,OAAO,MAAMa,WAAW,GAAGC,MAAM,CAACC,MAAM,CAACtB,eAAe,EAAE;EACxDuB,OAAO,EAAE1B,MAAM,CAAC0B,OAAO;EACvBC,OAAO,EAAE3B,MAAM,CAAC2B,OAAO;EACvBC,MAAM,EAAE5B,MAAM,CAAC4B,MAAM;EACrBC,KAAK,EAAE7B,MAAM,CAAC6B,KAAK;EACnBC,WAAW,EAAE9B,MAAM,CAAC8B,WAAW;EAC/BC,IAAI,EAAE/B,MAAM,CAAC+B,IAAI;EACjBC,MAAM,EAAEhC,MAAM,CAACgC,MAAM;EACrBC,KAAK,EAAEjC,MAAM,CAACiC,KAAK;EACnBC,MAAM,EAAEvB,iBAAiB;EACzBwB,MAAM,EAAEhB;AACV,CAAC,CAAiC","ignoreList":[]}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Pressable, Text, View } from 'react-native';
|
|
5
|
+
import { Close as CloseIcon } from '@cdx-ui/icons';
|
|
6
|
+
import { createDialog } from '@cdx-ui/primitives';
|
|
7
|
+
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
8
|
+
import { Icon } from '../Icon';
|
|
9
|
+
import { dialogBodyVariants, dialogCloseIconVariants, dialogCloseVariants, dialogContentVariants, dialogDescriptionVariants, dialogFooterVariants, dialogHeaderVariants, dialogOverlayVariants, dialogTitleVariants } from './styles';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
export { useDialog } from '@cdx-ui/primitives';
|
|
12
|
+
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// STYLE CONTEXT
|
|
15
|
+
// =============================================================================
|
|
16
|
+
|
|
17
|
+
const SCOPE = 'DIALOG';
|
|
18
|
+
const Root = withStyleContext(View, SCOPE);
|
|
19
|
+
const useDialogStyleContext = () => useStyleContext(SCOPE);
|
|
20
|
+
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// STYLED OVERLAY (internal — not consumer-facing)
|
|
23
|
+
// =============================================================================
|
|
24
|
+
|
|
25
|
+
const StyledOverlay = /*#__PURE__*/forwardRef(({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}, ref) => /*#__PURE__*/_jsx(Pressable, {
|
|
29
|
+
ref: ref,
|
|
30
|
+
className: cn(dialogOverlayVariants(), className),
|
|
31
|
+
...props
|
|
32
|
+
}));
|
|
33
|
+
StyledOverlay.displayName = 'Dialog.Overlay';
|
|
34
|
+
|
|
35
|
+
// =============================================================================
|
|
36
|
+
// CREATE DIALOG PRIMITIVE
|
|
37
|
+
// =============================================================================
|
|
38
|
+
|
|
39
|
+
const DialogPrimitive = createDialog({
|
|
40
|
+
Root,
|
|
41
|
+
Trigger: Pressable,
|
|
42
|
+
Overlay: StyledOverlay,
|
|
43
|
+
Content: View,
|
|
44
|
+
Header: View,
|
|
45
|
+
Title: Text,
|
|
46
|
+
Description: Text,
|
|
47
|
+
Body: View,
|
|
48
|
+
Footer: View,
|
|
49
|
+
Close: Pressable
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// =============================================================================
|
|
53
|
+
// STYLED ROOT
|
|
54
|
+
// =============================================================================
|
|
55
|
+
|
|
56
|
+
const DialogRoot = /*#__PURE__*/forwardRef(({
|
|
57
|
+
size = 'md',
|
|
58
|
+
className,
|
|
59
|
+
children,
|
|
60
|
+
style,
|
|
61
|
+
...props
|
|
62
|
+
}, ref) => /*#__PURE__*/_jsx(DialogPrimitive, {
|
|
63
|
+
ref: ref,
|
|
64
|
+
className: className,
|
|
65
|
+
style: style,
|
|
66
|
+
context: {
|
|
67
|
+
size
|
|
68
|
+
},
|
|
69
|
+
...props,
|
|
70
|
+
children: children
|
|
71
|
+
}));
|
|
72
|
+
DialogRoot.displayName = 'Dialog';
|
|
73
|
+
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// STYLED TRIGGER
|
|
76
|
+
// =============================================================================
|
|
77
|
+
|
|
78
|
+
const DialogTrigger = /*#__PURE__*/forwardRef(({
|
|
79
|
+
className,
|
|
80
|
+
children,
|
|
81
|
+
style,
|
|
82
|
+
...props
|
|
83
|
+
}, ref) => /*#__PURE__*/_jsx(DialogPrimitive.Trigger, {
|
|
84
|
+
ref: ref,
|
|
85
|
+
className: className,
|
|
86
|
+
style: style,
|
|
87
|
+
...props,
|
|
88
|
+
children: children
|
|
89
|
+
}));
|
|
90
|
+
DialogTrigger.displayName = 'Dialog.Trigger';
|
|
91
|
+
|
|
92
|
+
// =============================================================================
|
|
93
|
+
// STYLED CONTENT
|
|
94
|
+
// =============================================================================
|
|
95
|
+
|
|
96
|
+
const DialogContent = /*#__PURE__*/forwardRef(({
|
|
97
|
+
size: sizeProp,
|
|
98
|
+
className,
|
|
99
|
+
children,
|
|
100
|
+
style,
|
|
101
|
+
...props
|
|
102
|
+
}, ref) => {
|
|
103
|
+
const {
|
|
104
|
+
size: contextSize
|
|
105
|
+
} = useDialogStyleContext();
|
|
106
|
+
const size = sizeProp ?? contextSize;
|
|
107
|
+
const computedClassName = cn(dialogContentVariants({
|
|
108
|
+
size
|
|
109
|
+
}), className);
|
|
110
|
+
return /*#__PURE__*/_jsx(DialogPrimitive.Content, {
|
|
111
|
+
ref: ref,
|
|
112
|
+
className: computedClassName,
|
|
113
|
+
style: style,
|
|
114
|
+
...props,
|
|
115
|
+
children: children
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
DialogContent.displayName = 'Dialog.Content';
|
|
119
|
+
|
|
120
|
+
// =============================================================================
|
|
121
|
+
// STYLED HEADER
|
|
122
|
+
// =============================================================================
|
|
123
|
+
|
|
124
|
+
const DialogHeader = /*#__PURE__*/forwardRef(({
|
|
125
|
+
className,
|
|
126
|
+
children,
|
|
127
|
+
style,
|
|
128
|
+
...props
|
|
129
|
+
}, ref) => {
|
|
130
|
+
const computedClassName = cn(dialogHeaderVariants(), className);
|
|
131
|
+
return /*#__PURE__*/_jsx(DialogPrimitive.Header, {
|
|
132
|
+
ref: ref,
|
|
133
|
+
className: computedClassName,
|
|
134
|
+
style: style,
|
|
135
|
+
...props,
|
|
136
|
+
children: children
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
DialogHeader.displayName = 'Dialog.Header';
|
|
140
|
+
|
|
141
|
+
// =============================================================================
|
|
142
|
+
// STYLED TITLE
|
|
143
|
+
// =============================================================================
|
|
144
|
+
|
|
145
|
+
const DialogTitle = /*#__PURE__*/forwardRef(({
|
|
146
|
+
className,
|
|
147
|
+
children,
|
|
148
|
+
style,
|
|
149
|
+
...props
|
|
150
|
+
}, ref) => {
|
|
151
|
+
const computedClassName = cn(dialogTitleVariants(), className);
|
|
152
|
+
return /*#__PURE__*/_jsx(DialogPrimitive.Title, {
|
|
153
|
+
ref: ref,
|
|
154
|
+
className: computedClassName,
|
|
155
|
+
style: style,
|
|
156
|
+
...props,
|
|
157
|
+
children: children
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
DialogTitle.displayName = 'Dialog.Title';
|
|
161
|
+
|
|
162
|
+
// =============================================================================
|
|
163
|
+
// STYLED DESCRIPTION
|
|
164
|
+
// =============================================================================
|
|
165
|
+
|
|
166
|
+
const DialogDescription = /*#__PURE__*/forwardRef(({
|
|
167
|
+
className,
|
|
168
|
+
children,
|
|
169
|
+
style,
|
|
170
|
+
...props
|
|
171
|
+
}, ref) => {
|
|
172
|
+
const computedClassName = cn(dialogDescriptionVariants(), className);
|
|
173
|
+
return /*#__PURE__*/_jsx(DialogPrimitive.Description, {
|
|
174
|
+
ref: ref,
|
|
175
|
+
className: computedClassName,
|
|
176
|
+
style: style,
|
|
177
|
+
...props,
|
|
178
|
+
children: children
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
DialogDescription.displayName = 'Dialog.Description';
|
|
182
|
+
|
|
183
|
+
// =============================================================================
|
|
184
|
+
// STYLED BODY
|
|
185
|
+
// =============================================================================
|
|
186
|
+
|
|
187
|
+
const DialogBody = /*#__PURE__*/forwardRef(({
|
|
188
|
+
className,
|
|
189
|
+
children,
|
|
190
|
+
style,
|
|
191
|
+
...props
|
|
192
|
+
}, ref) => {
|
|
193
|
+
const computedClassName = cn(dialogBodyVariants(), className);
|
|
194
|
+
return /*#__PURE__*/_jsx(DialogPrimitive.Body, {
|
|
195
|
+
ref: ref,
|
|
196
|
+
className: computedClassName,
|
|
197
|
+
style: style,
|
|
198
|
+
...props,
|
|
199
|
+
children: children
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
DialogBody.displayName = 'Dialog.Body';
|
|
203
|
+
|
|
204
|
+
// =============================================================================
|
|
205
|
+
// STYLED FOOTER
|
|
206
|
+
// =============================================================================
|
|
207
|
+
|
|
208
|
+
const DialogFooter = /*#__PURE__*/forwardRef(({
|
|
209
|
+
className,
|
|
210
|
+
children,
|
|
211
|
+
style,
|
|
212
|
+
...props
|
|
213
|
+
}, ref) => {
|
|
214
|
+
const computedClassName = cn(dialogFooterVariants(), className);
|
|
215
|
+
return /*#__PURE__*/_jsx(DialogPrimitive.Footer, {
|
|
216
|
+
ref: ref,
|
|
217
|
+
className: computedClassName,
|
|
218
|
+
style: style,
|
|
219
|
+
...props,
|
|
220
|
+
children: children
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
DialogFooter.displayName = 'Dialog.Footer';
|
|
224
|
+
|
|
225
|
+
// =============================================================================
|
|
226
|
+
// STYLED CLOSE
|
|
227
|
+
// =============================================================================
|
|
228
|
+
|
|
229
|
+
const DialogClose = /*#__PURE__*/forwardRef(({
|
|
230
|
+
className,
|
|
231
|
+
accessibilityLabel = 'Close',
|
|
232
|
+
children,
|
|
233
|
+
style,
|
|
234
|
+
...props
|
|
235
|
+
}, ref) => {
|
|
236
|
+
const computedClassName = cn(dialogCloseVariants(), className);
|
|
237
|
+
return /*#__PURE__*/_jsx(DialogPrimitive.Close, {
|
|
238
|
+
ref: ref,
|
|
239
|
+
className: computedClassName,
|
|
240
|
+
style: style,
|
|
241
|
+
hitSlop: 12,
|
|
242
|
+
accessibilityRole: "button",
|
|
243
|
+
accessibilityLabel: accessibilityLabel,
|
|
244
|
+
...props,
|
|
245
|
+
children: children ?? /*#__PURE__*/_jsx(Icon, {
|
|
246
|
+
as: CloseIcon,
|
|
247
|
+
className: dialogCloseIconVariants()
|
|
248
|
+
})
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
DialogClose.displayName = 'Dialog.Close';
|
|
252
|
+
|
|
253
|
+
// =============================================================================
|
|
254
|
+
// COMPOUND COMPONENT
|
|
255
|
+
// =============================================================================
|
|
256
|
+
|
|
257
|
+
export const Dialog = Object.assign(DialogRoot, {
|
|
258
|
+
Trigger: DialogTrigger,
|
|
259
|
+
Content: DialogContent,
|
|
260
|
+
Header: DialogHeader,
|
|
261
|
+
Title: DialogTitle,
|
|
262
|
+
Description: DialogDescription,
|
|
263
|
+
Body: DialogBody,
|
|
264
|
+
Footer: DialogFooter,
|
|
265
|
+
Close: DialogClose
|
|
266
|
+
});
|
|
267
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Pressable","Text","View","Close","CloseIcon","createDialog","cn","useStyleContext","withStyleContext","Icon","dialogBodyVariants","dialogCloseIconVariants","dialogCloseVariants","dialogContentVariants","dialogDescriptionVariants","dialogFooterVariants","dialogHeaderVariants","dialogOverlayVariants","dialogTitleVariants","jsx","_jsx","useDialog","SCOPE","Root","useDialogStyleContext","StyledOverlay","className","props","ref","displayName","DialogPrimitive","Trigger","Overlay","Content","Header","Title","Description","Body","Footer","DialogRoot","size","children","style","context","DialogTrigger","DialogContent","sizeProp","contextSize","computedClassName","DialogHeader","DialogTitle","DialogDescription","DialogBody","DialogFooter","DialogClose","accessibilityLabel","hitSlop","accessibilityRole","as","Dialog","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Dialog/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,SAAS,EAAEC,IAAI,EAAEC,IAAI,QAA6C,cAAc;AACzF,SAASC,KAAK,IAAIC,SAAS,QAAQ,eAAe;AAClD,SACEC,YAAY,QAUP,oBAAoB;AAC3B,SAASC,EAAE,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,eAAe;AACrE,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAEEC,kBAAkB,EAClBC,uBAAuB,EACvBC,mBAAmB,EACnBC,qBAAqB,EACrBC,yBAAyB,EACzBC,oBAAoB,EACpBC,oBAAoB,EACpBC,qBAAqB,EACrBC,mBAAmB,QACd,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElB,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;;AAEA,MAAMC,KAAK,GAAG,QAAQ;AAEtB,MAAMC,IAAI,GAAGf,gBAAgB,CAACN,IAAI,EAAEoB,KAAK,CAAC;AAE1C,MAAME,qBAAqB,GAAGA,CAAA,KAAMjB,eAAe,CAACe,KAAK,CAAuB;;AAEhF;AACA;AACA;;AAEA,MAAMG,aAAa,gBAAG1B,UAAU,CAC9B,CAAC;EAAE2B,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,kBAC3BR,IAAA,CAACpB,SAAS;EAAC4B,GAAG,EAAEA,GAAI;EAACF,SAAS,EAAEpB,EAAE,CAACW,qBAAqB,CAAC,CAAC,EAAES,SAAS,CAAE;EAAA,GAAKC;AAAK,CAAG,CAExF,CAAC;AACDF,aAAa,CAACI,WAAW,GAAG,gBAAgB;;AAE5C;AACA;AACA;;AAEA,MAAMC,eAAe,GAAGz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Ea,aAAa;EACtBX,OAAO,EAAEY,aAAa;EACtBX,MAAM,EAAEe,YAAY;EACpBd,KAAK,EAAEe,WAAW;EAClBd,WAAW,EAAEe,iBAAiB;EAC9Bd,IAAI,EAAEe,UAAU;EAChBd,MAAM,EAAEe,YAAY;EACpBlD,KAAK,EAAEmD;AACT,CAAC,CAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { COLOR_BG_INVERSE, COLOR_BG_PRIMARY, COLOR_BORDER_DEFAULT, COLOR_TEXT_PRIMARY, COLOR_TEXT_SECONDARY, RADIUS_MD, SHADOW_MD, TRANSITION_COLORS } from '../../styles/primitives';
|
|
6
|
+
|
|
7
|
+
// ── Overlay ─────────────────────────────────────────────────
|
|
8
|
+
|
|
9
|
+
export const dialogOverlayVariants = cva(['absolute inset-0', COLOR_BG_INVERSE, 'opacity-50']);
|
|
10
|
+
|
|
11
|
+
// ── Content ─────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
export const dialogContentVariants = cva([COLOR_BG_PRIMARY, `border ${COLOR_BORDER_DEFAULT}`, RADIUS_MD, Platform.select({
|
|
14
|
+
web: SHADOW_MD,
|
|
15
|
+
default: ''
|
|
16
|
+
}), 'max-h-[85vh] overflow-hidden'], {
|
|
17
|
+
variants: {
|
|
18
|
+
size: {
|
|
19
|
+
sm: 'w-[90%] max-w-sm',
|
|
20
|
+
md: 'w-[90%] max-w-md',
|
|
21
|
+
lg: 'w-[90%] max-w-lg',
|
|
22
|
+
full: 'w-full mx-4'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
size: 'md'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// ── Header ──────────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
export const dialogHeaderVariants = cva(['flex-row items-center justify-between shrink-0', 'px-6 pt-6 pb-2']);
|
|
33
|
+
|
|
34
|
+
// ── Title ───────────────────────────────────────────────────
|
|
35
|
+
|
|
36
|
+
export const dialogTitleVariants = cva(['text-lg font-semibold', COLOR_TEXT_PRIMARY]);
|
|
37
|
+
|
|
38
|
+
// ── Description ─────────────────────────────────────────────
|
|
39
|
+
|
|
40
|
+
export const dialogDescriptionVariants = cva(['text-sm mt-1', COLOR_TEXT_SECONDARY]);
|
|
41
|
+
|
|
42
|
+
// ── Body ────────────────────────────────────────────────────
|
|
43
|
+
|
|
44
|
+
export const dialogBodyVariants = cva(['px-6 py-4 shrink min-h-0']);
|
|
45
|
+
|
|
46
|
+
// ── Footer ──────────────────────────────────────────────────
|
|
47
|
+
|
|
48
|
+
export const dialogFooterVariants = cva(['flex-row items-center justify-end shrink-0', 'gap-3 px-6 pt-2 pb-6']);
|
|
49
|
+
|
|
50
|
+
// ── Close ───────────────────────────────────────────────────
|
|
51
|
+
|
|
52
|
+
export const dialogCloseVariants = cva(['p-1 -m-1 rounded-full', TRANSITION_COLORS, Platform.select({
|
|
53
|
+
default: 'data-[active=true]:opacity-70',
|
|
54
|
+
web: ['data-[hover=true]:bg-slate-100', 'data-[active=true]:bg-slate-200', 'data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-slate-400/50 data-[focus-visible=true]:ring-offset-2'].join(' ')
|
|
55
|
+
})]);
|
|
56
|
+
|
|
57
|
+
// ── Close Icon ──────────────────────────────────────────────
|
|
58
|
+
|
|
59
|
+
export const dialogCloseIconVariants = cva(['size-5 text-slate-500']);
|
|
60
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","cva","COLOR_BG_INVERSE","COLOR_BG_PRIMARY","COLOR_BORDER_DEFAULT","COLOR_TEXT_PRIMARY","COLOR_TEXT_SECONDARY","RADIUS_MD","SHADOW_MD","TRANSITION_COLORS","dialogOverlayVariants","dialogContentVariants","select","web","default","variants","size","sm","md","lg","full","defaultVariants","dialogHeaderVariants","dialogTitleVariants","dialogDescriptionVariants","dialogBodyVariants","dialogFooterVariants","dialogCloseVariants","join","dialogCloseIconVariants"],"sourceRoot":"../../../../src","sources":["components/Dialog/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AACjE,SACEC,gBAAgB,EAChBC,gBAAgB,EAChBC,oBAAoB,EACpBC,kBAAkB,EAClBC,oBAAoB,EACpBC,SAAS,EACTC,SAAS,EACTC,iBAAiB,QACZ,yBAAyB;;AAEhC;;AAEA,OAAO,MAAMC,qBAAqB,GAAGT,GAAG,CAAC,CAAC,kBAAkB,EAAEC,gBAAgB,EAAE,YAAY,CAAC,CAAC;;AAE9F;;AAEA,OAAO,MAAMS,qBAAqB,GAAGV,GAAG,CACtC,CACEE,gBAAgB,EAChB,UAAUC,oBAAoB,EAAE,EAChCG,SAAS,EACTP,QAAQ,CAACY,MAAM,CAAC;EAAEC,GAAG,EAAEL,SAAS;EAAEM,OAAO,EAAE;AAAG,CAAC,CAAC,EAChD,8BAA8B,CAC/B,EACD;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,kBAAkB;MACtBC,EAAE,EAAE,kBAAkB;MACtBC,EAAE,EAAE,kBAAkB;MACtBC,IAAI,EAAE;IACR;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CACF,CAAC;;AAED;;AAEA,OAAO,MAAMM,oBAAoB,GAAGrB,GAAG,CAAC,CACtC,gDAAgD,EAChD,gBAAgB,CACjB,CAAC;;AAEF;;AAEA,OAAO,MAAMsB,mBAAmB,GAAGtB,GAAG,CAAC,CAAC,uBAAuB,EAAEI,kBAAkB,CAAC,CAAC;;AAErF;;AAEA,OAAO,MAAMmB,yBAAyB,GAAGvB,GAAG,CAAC,CAAC,cAAc,EAAEK,oBAAoB,CAAC,CAAC;;AAEpF;;AAEA,OAAO,MAAMmB,kBAAkB,GAAGxB,GAAG,CAAC,CAAC,0BAA0B,CAAC,CAAC;;AAEnE;;AAEA,OAAO,MAAMyB,oBAAoB,GAAGzB,GAAG,CAAC,CACtC,4CAA4C,EAC5C,sBAAsB,CACvB,CAAC;;AAEF;;AAEA,OAAO,MAAM0B,mBAAmB,GAAG1B,GAAG,CAAC,CACrC,uBAAuB,EACvBQ,iBAAiB,EACjBT,QAAQ,CAACY,MAAM,CAAC;EACdE,OAAO,EAAE,+BAA+B;EACxCD,GAAG,EAAE,CACH,gCAAgC,EAChC,iCAAiC,EACjC,sHAAsH,CACvH,CAACe,IAAI,CAAC,GAAG;AACZ,CAAC,CAAC,CACH,CAAC;;AAEF;;AAEA,OAAO,MAAMC,uBAAuB,GAAG5B,GAAG,CAAC,CAAC,uBAAuB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
export * from './AlertDialog';
|
|
3
4
|
export * from './Avatar';
|
|
4
5
|
export * from './BottomSheet';
|
|
5
6
|
export * from './Box';
|
|
6
7
|
export * from './Button';
|
|
7
|
-
export * from './Chip';
|
|
8
8
|
export * from './Card';
|
|
9
9
|
export * from './Checkbox';
|
|
10
|
+
export * from './Chip';
|
|
11
|
+
export * from './Dialog';
|
|
10
12
|
export * from './Input';
|
|
11
13
|
export * from './Link';
|
|
12
14
|
export * from './ProgressSegmented';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,
|
|
1
|
+
{"version":3,"names":["HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,qBAAqB;AACnC,cAAc,UAAU;AACxB,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,SAASA,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { type ButtonProps } from '../Button';
|
|
4
|
+
import { Dialog, type DialogRootProps } from '../Dialog';
|
|
5
|
+
export interface AlertDialogRootProps extends DialogRootProps {
|
|
6
|
+
}
|
|
7
|
+
declare const AlertDialogRoot: React.ForwardRefExoticComponent<AlertDialogRootProps & React.RefAttributes<View>>;
|
|
8
|
+
export interface AlertDialogActionProps extends Omit<ButtonProps, 'variant'> {
|
|
9
|
+
readonly asChild?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<View>>;
|
|
12
|
+
export interface AlertDialogCancelProps extends Omit<ButtonProps, 'variant'> {
|
|
13
|
+
readonly asChild?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<View>>;
|
|
16
|
+
type AlertDialogCompoundComponent = typeof AlertDialogRoot & {
|
|
17
|
+
Trigger: typeof Dialog.Trigger;
|
|
18
|
+
Content: typeof Dialog.Content;
|
|
19
|
+
Header: typeof Dialog.Header;
|
|
20
|
+
Title: typeof Dialog.Title;
|
|
21
|
+
Description: typeof Dialog.Description;
|
|
22
|
+
Body: typeof Dialog.Body;
|
|
23
|
+
Footer: typeof Dialog.Footer;
|
|
24
|
+
Close: typeof Dialog.Close;
|
|
25
|
+
Action: typeof AlertDialogAction;
|
|
26
|
+
Cancel: typeof AlertDialogCancel;
|
|
27
|
+
};
|
|
28
|
+
export declare const AlertDialog: AlertDialogCompoundComponent;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/AlertDialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAMzD,MAAM,WAAW,oBAAqB,SAAQ,eAAe;CAAG;AAEhE,QAAA,MAAM,eAAe,mFAqBpB,CAAC;AAOF,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,QAAA,MAAM,iBAAiB,qFAgBtB,CAAC;AAOF,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,QAAA,MAAM,iBAAiB,qFAoBtB,CAAC;AAOF,KAAK,4BAA4B,GAAG,OAAO,eAAe,GAAG;IAC3D,OAAO,EAAE,OAAO,MAAM,CAAC,OAAO,CAAC;IAC/B,OAAO,EAAE,OAAO,MAAM,CAAC,OAAO,CAAC;IAC/B,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,CAAC;IAC7B,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;IAC3B,WAAW,EAAE,OAAO,MAAM,CAAC,WAAW,CAAC;IACvC,IAAI,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC;IACzB,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,CAAC;IAC7B,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;IAC3B,MAAM,EAAE,OAAO,iBAAiB,CAAC;IACjC,MAAM,EAAE,OAAO,iBAAiB,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,WAAW,EAWlB,4BAA4B,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const chipRootVariants: (props?: ({
|
|
3
|
-
color?: "
|
|
3
|
+
color?: "warning" | "success" | "info" | "default" | "error" | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
5
|
export declare const chipLabelVariants: (props?: ({
|
|
6
|
-
color?: "
|
|
6
|
+
color?: "warning" | "success" | "info" | "default" | "error" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export declare const chipIconVariants: (props?: ({
|
|
9
|
-
color?: "
|
|
9
|
+
color?: "warning" | "success" | "info" | "default" | "error" | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
11
|
export type ChipVariants = VariantProps<typeof chipRootVariants>;
|
|
12
12
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { Text, View, type ViewProps } from 'react-native';
|
|
3
|
+
import { type IDialogBodyProps, type IDialogCloseProps, type IDialogContentProps, type IDialogDescriptionProps, type IDialogFooterProps, type IDialogHeaderProps, type IDialogRootProps, type IDialogTitleProps, type IDialogTriggerProps } from '@cdx-ui/primitives';
|
|
4
|
+
import { type DialogVariantProps } from './styles';
|
|
5
|
+
export { useDialog } from '@cdx-ui/primitives';
|
|
6
|
+
export interface DialogRootProps extends Omit<ViewProps, 'children' | 'role'>, IDialogRootProps, DialogVariantProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const DialogRoot: import("react").ForwardRefExoticComponent<DialogRootProps & import("react").RefAttributes<View>>;
|
|
10
|
+
export interface DialogTriggerProps extends IDialogTriggerProps {
|
|
11
|
+
className?: string;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
declare const DialogTrigger: import("react").ForwardRefExoticComponent<DialogTriggerProps & import("react").RefAttributes<View>>;
|
|
15
|
+
export interface DialogContentProps extends IDialogContentProps, DialogVariantProps {
|
|
16
|
+
className?: string;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare const DialogContent: import("react").ForwardRefExoticComponent<DialogContentProps & import("react").RefAttributes<View>>;
|
|
20
|
+
export interface DialogHeaderProps extends IDialogHeaderProps {
|
|
21
|
+
className?: string;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
declare const DialogHeader: import("react").ForwardRefExoticComponent<DialogHeaderProps & import("react").RefAttributes<View>>;
|
|
25
|
+
export interface DialogTitleProps extends IDialogTitleProps {
|
|
26
|
+
className?: string;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
declare const DialogTitle: import("react").ForwardRefExoticComponent<DialogTitleProps & import("react").RefAttributes<Text>>;
|
|
30
|
+
export interface DialogDescriptionProps extends IDialogDescriptionProps {
|
|
31
|
+
className?: string;
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
declare const DialogDescription: import("react").ForwardRefExoticComponent<DialogDescriptionProps & import("react").RefAttributes<Text>>;
|
|
35
|
+
export interface DialogBodyProps extends IDialogBodyProps {
|
|
36
|
+
className?: string;
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
declare const DialogBody: import("react").ForwardRefExoticComponent<DialogBodyProps & import("react").RefAttributes<View>>;
|
|
40
|
+
export interface DialogFooterProps extends IDialogFooterProps {
|
|
41
|
+
className?: string;
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
declare const DialogFooter: import("react").ForwardRefExoticComponent<DialogFooterProps & import("react").RefAttributes<View>>;
|
|
45
|
+
export interface DialogCloseProps extends IDialogCloseProps {
|
|
46
|
+
className?: string;
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
}
|
|
49
|
+
declare const DialogClose: import("react").ForwardRefExoticComponent<DialogCloseProps & import("react").RefAttributes<View>>;
|
|
50
|
+
type DialogCompoundComponent = typeof DialogRoot & {
|
|
51
|
+
Trigger: typeof DialogTrigger;
|
|
52
|
+
Content: typeof DialogContent;
|
|
53
|
+
Header: typeof DialogHeader;
|
|
54
|
+
Title: typeof DialogTitle;
|
|
55
|
+
Description: typeof DialogDescription;
|
|
56
|
+
Body: typeof DialogBody;
|
|
57
|
+
Footer: typeof DialogFooter;
|
|
58
|
+
Close: typeof DialogClose;
|
|
59
|
+
};
|
|
60
|
+
export declare const Dialog: DialogCompoundComponent;
|
|
61
|
+
export type { DialogVariantProps } from './styles';
|
|
62
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAa,IAAI,EAAE,IAAI,EAAuB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1F,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CA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;AAED,QAAA,MAAM,UAAU,kGAUf,CAAC;AAQF,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,YAAY,oGAUjB,CAAC;AAQF,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,mGAkBhB,CAAC;AAQF,KAAK,uBAAuB,GAAG,OAAO,UAAU,GAAG;IACjD,OAAO,EAAE,OAAO,aAAa,CAAC;IAC9B,OAAO,EAAE,OAAO,aAAa,CAAC;IAC9B,MAAM,EAAE,OAAO,YAAY,CAAC;IAC5B,KAAK,EAAE,OAAO,WAAW,CAAC;IAC1B,WAAW,EAAE,OAAO,iBAAiB,CAAC;IACtC,IAAI,EAAE,OAAO,UAAU,CAAC;IACxB,MAAM,EAAE,OAAO,YAAY,CAAC;IAC5B,KAAK,EAAE,OAAO,WAAW,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,MAAM,EASb,uBAAuB,CAAC;AAE9B,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const dialogOverlayVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const dialogContentVariants: (props?: ({
|
|
4
|
+
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export declare const dialogHeaderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
7
|
+
export declare const dialogTitleVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
|
+
export declare const dialogDescriptionVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
9
|
+
export declare const dialogBodyVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
10
|
+
export declare const dialogFooterVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
11
|
+
export declare const dialogCloseVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
12
|
+
export declare const dialogCloseIconVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
13
|
+
export type DialogVariantProps = VariantProps<typeof dialogContentVariants>;
|
|
14
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAclE,eAAO,MAAM,qBAAqB,oFAA4D,CAAC;AAI/F,eAAO,MAAM,qBAAqB;;8EAqBjC,CAAC;AAIF,eAAO,MAAM,oBAAoB,oFAG/B,CAAC;AAIH,eAAO,MAAM,mBAAmB,oFAAqD,CAAC;AAItF,eAAO,MAAM,yBAAyB,oFAA8C,CAAC;AAIrF,eAAO,MAAM,kBAAkB,oFAAoC,CAAC;AAIpE,eAAO,MAAM,oBAAoB,oFAG/B,CAAC;AAIH,eAAO,MAAM,mBAAmB,oFAW9B,CAAC;AAIH,eAAO,MAAM,uBAAuB,oFAAiC,CAAC;AAEtE,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
export * from './AlertDialog';
|
|
1
2
|
export * from './Avatar';
|
|
2
3
|
export * from './BottomSheet';
|
|
3
4
|
export * from './Box';
|
|
4
5
|
export * from './Button';
|
|
5
|
-
export * from './Chip';
|
|
6
6
|
export * from './Card';
|
|
7
7
|
export * from './Checkbox';
|
|
8
|
+
export * from './Chip';
|
|
9
|
+
export * from './Dialog';
|
|
8
10
|
export * from './Input';
|
|
9
11
|
export * from './Link';
|
|
10
12
|
export * from './ProgressSegmented';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|