@cerberus-design/react 0.14.2-next-58af9c8 → 0.14.2-next-9116729
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/build/legacy/_tsup-dts-rollup.d.cts +186 -45
- package/build/legacy/components/DatePicker.client.cjs +12 -6
- package/build/legacy/components/DatePicker.client.cjs.map +1 -1
- package/build/legacy/components/Dialog.cjs +86 -0
- package/build/legacy/components/Dialog.cjs.map +1 -0
- package/build/legacy/components/Dialog.client.cjs +95 -0
- package/build/legacy/components/Dialog.client.cjs.map +1 -0
- package/build/legacy/components/Modal.cjs.map +1 -1
- package/build/legacy/components/ModalDescription.cjs.map +1 -1
- package/build/legacy/components/ModalHeader.cjs.map +1 -1
- package/build/legacy/components/ModalHeading.cjs.map +1 -1
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/cta-modal.cjs.map +1 -1
- package/build/legacy/context/notification-center.cjs +2 -2
- package/build/legacy/context/notification-center.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/index.cjs +608 -517
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +186 -45
- package/build/modern/chunk-6BN3XKQF.js +42 -0
- package/build/modern/chunk-6BN3XKQF.js.map +1 -0
- package/build/modern/{chunk-2UXE5PDG.js → chunk-7NN3SJ7W.js} +1 -1
- package/build/modern/chunk-7NN3SJ7W.js.map +1 -0
- package/build/modern/{chunk-YLMGZAKU.js → chunk-JAROS4Q3.js} +6 -6
- package/build/modern/chunk-JAROS4Q3.js.map +1 -0
- package/build/modern/{chunk-BE4EOU2P.js → chunk-JIRW4XOJ.js} +1 -1
- package/build/modern/chunk-JIRW4XOJ.js.map +1 -0
- package/build/modern/{chunk-YJI4Y7BH.js → chunk-MUTAYS3P.js} +5 -5
- package/build/modern/{chunk-XY6WL55R.js → chunk-NUMM4TNC.js} +1 -1
- package/build/modern/chunk-NUMM4TNC.js.map +1 -0
- package/build/modern/{chunk-USYM6XU6.js → chunk-O6LFWUHI.js} +4 -4
- package/build/modern/{chunk-XDDLXEFV.js → chunk-R4RFWDBM.js} +8 -8
- package/build/modern/chunk-TFL56AYR.js +56 -0
- package/build/modern/chunk-TFL56AYR.js.map +1 -0
- package/build/modern/{chunk-ZHBHPMTP.js → chunk-VGEK2DQB.js} +8 -8
- package/build/modern/{chunk-D252JE4V.js → chunk-YKKNWILF.js} +20 -14
- package/build/modern/chunk-YKKNWILF.js.map +1 -0
- package/build/modern/{chunk-Q7BRMIBR.js → chunk-ZL6ZITLA.js} +1 -1
- package/build/modern/chunk-ZL6ZITLA.js.map +1 -0
- package/build/modern/components/DatePicker.client.js +4 -4
- package/build/modern/components/Dialog.client.js +10 -0
- package/build/modern/components/Dialog.client.js.map +1 -0
- package/build/modern/components/Dialog.js +24 -0
- package/build/modern/components/Dialog.js.map +1 -0
- package/build/modern/components/FileStatus.js +2 -2
- package/build/modern/components/Modal.js +1 -1
- package/build/modern/components/ModalDescription.js +1 -1
- package/build/modern/components/ModalHeader.js +1 -1
- package/build/modern/components/ModalHeading.js +1 -1
- package/build/modern/context/confirm-modal.js +5 -5
- package/build/modern/context/cta-modal.js +6 -6
- package/build/modern/context/notification-center.js +2 -2
- package/build/modern/context/prompt-modal.js +6 -6
- package/build/modern/index.js +78 -54
- package/build/modern/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/DatePicker.client.tsx +32 -8
- package/src/components/Dialog.client.tsx +39 -0
- package/src/components/Dialog.tsx +165 -0
- package/src/components/Modal.tsx +1 -16
- package/src/components/ModalDescription.tsx +1 -8
- package/src/components/ModalHeader.tsx +1 -10
- package/src/components/ModalHeading.tsx +1 -8
- package/src/context/notification-center.tsx +2 -2
- package/src/index.ts +2 -0
- package/build/modern/chunk-2UXE5PDG.js.map +0 -1
- package/build/modern/chunk-BE4EOU2P.js.map +0 -1
- package/build/modern/chunk-D252JE4V.js.map +0 -1
- package/build/modern/chunk-Q7BRMIBR.js.map +0 -1
- package/build/modern/chunk-XY6WL55R.js.map +0 -1
- package/build/modern/chunk-YLMGZAKU.js.map +0 -1
- /package/build/modern/{chunk-YJI4Y7BH.js.map → chunk-MUTAYS3P.js.map} +0 -0
- /package/build/modern/{chunk-USYM6XU6.js.map → chunk-O6LFWUHI.js.map} +0 -0
- /package/build/modern/{chunk-XDDLXEFV.js.map → chunk-R4RFWDBM.js.map} +0 -0
- /package/build/modern/{chunk-ZHBHPMTP.js.map → chunk-VGEK2DQB.js.map} +0 -0
|
@@ -41,7 +41,13 @@ import { defaultCoordinates } from '@dnd-kit/core';
|
|
|
41
41
|
import { defaultDropAnimation } from '@dnd-kit/core';
|
|
42
42
|
import { defaultDropAnimationSideEffects } from '@dnd-kit/core';
|
|
43
43
|
import { defaultScreenReaderInstructions } from '@dnd-kit/core';
|
|
44
|
+
import { Dialog as Dialog_2 } from '@ark-ui/react';
|
|
45
|
+
import { DialogCloseTriggerProps } from '@ark-ui/react';
|
|
46
|
+
import { DialogContentProps } from '@ark-ui/react';
|
|
44
47
|
import { DialogHTMLAttributes } from 'react';
|
|
48
|
+
import { DialogRootProps } from '@ark-ui/react';
|
|
49
|
+
import { DialogTitleProps } from '@ark-ui/react';
|
|
50
|
+
import { DialogVariantProps } from '@cerberus/styled-system/recipes';
|
|
45
51
|
import type { Dispatch } from 'react';
|
|
46
52
|
import { DistanceMeasurement } from '@dnd-kit/core';
|
|
47
53
|
import { DndContext } from '@dnd-kit/core';
|
|
@@ -845,7 +851,9 @@ export { DatePicker as DatePicker_alias_1 }
|
|
|
845
851
|
* </Field>
|
|
846
852
|
* ```
|
|
847
853
|
*/
|
|
848
|
-
declare function DatePickerCalendar(
|
|
854
|
+
declare function DatePickerCalendar(props: {
|
|
855
|
+
withModal?: boolean;
|
|
856
|
+
}): JSX_2.Element;
|
|
849
857
|
export { DatePickerCalendar }
|
|
850
858
|
export { DatePickerCalendar as DatePickerCalendar_alias_1 }
|
|
851
859
|
|
|
@@ -863,7 +871,9 @@ export { DatePickerCalendar as DatePickerCalendar_alias_1 }
|
|
|
863
871
|
* </Field>
|
|
864
872
|
* ```
|
|
865
873
|
*/
|
|
866
|
-
declare function DatePickerContent(props: DatePickerContentProps
|
|
874
|
+
declare function DatePickerContent(props: DatePickerContentProps & {
|
|
875
|
+
withModal?: boolean;
|
|
876
|
+
}): JSX_2.Element;
|
|
867
877
|
export { DatePickerContent }
|
|
868
878
|
export { DatePickerContent as DatePickerContent_alias_1 }
|
|
869
879
|
|
|
@@ -1144,6 +1154,162 @@ declare interface DestructiveConfirmOptions extends BaseConfirmOptions {
|
|
|
1144
1154
|
export { DestructiveConfirmOptions }
|
|
1145
1155
|
export { DestructiveConfirmOptions as DestructiveConfirmOptions_alias_1 }
|
|
1146
1156
|
|
|
1157
|
+
/**
|
|
1158
|
+
* The content of the dialog. Must be used within the `DialogProvider` component.
|
|
1159
|
+
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1160
|
+
* @example
|
|
1161
|
+
* ```tsx
|
|
1162
|
+
* <DialogProvider>
|
|
1163
|
+
* <DialogTrigger asChild>
|
|
1164
|
+
* <Button>Open Dialog</Button>
|
|
1165
|
+
* </DialogTrigger>
|
|
1166
|
+
* <Dialog>
|
|
1167
|
+
* <Text>Dialog Content</Text>
|
|
1168
|
+
* </Dialog>
|
|
1169
|
+
* </DialogProvider>
|
|
1170
|
+
* ```
|
|
1171
|
+
*/
|
|
1172
|
+
declare function Dialog(props: DialogProps): JSX_2.Element;
|
|
1173
|
+
export { Dialog }
|
|
1174
|
+
export { Dialog as Dialog_alias_1 }
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* The backdrop of the dialog. Must be used within the `DialogProvider`
|
|
1178
|
+
* component.
|
|
1179
|
+
*/
|
|
1180
|
+
declare const DialogBackdrop: ForwardRefExoticComponent<Dialog_2.BackdropProps & RefAttributes<HTMLDivElement>>;
|
|
1181
|
+
export { DialogBackdrop }
|
|
1182
|
+
export { DialogBackdrop as DialogBackdrop_alias_1 }
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* This module contains client-side components for the Dialog family.
|
|
1186
|
+
* @module @cerberus-design/react/dialog
|
|
1187
|
+
*/
|
|
1188
|
+
declare function DialogCloseIconTrigger(props: DialogCloseTriggerProps): JSX_2.Element;
|
|
1189
|
+
export { DialogCloseIconTrigger }
|
|
1190
|
+
export { DialogCloseIconTrigger as DialogCloseIconTrigger_alias_1 }
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* The trigger that closes the dialog. Must be used within the `DialogProvider`
|
|
1194
|
+
* component.
|
|
1195
|
+
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1196
|
+
* @example
|
|
1197
|
+
* ```tsx
|
|
1198
|
+
* <DialogProvider>
|
|
1199
|
+
* <DialogTrigger asChild>
|
|
1200
|
+
* <Button>Open Dialog</Button>
|
|
1201
|
+
* </DialogTrigger>
|
|
1202
|
+
* <Dialog>
|
|
1203
|
+
* <Text>Dialog Content</Text>
|
|
1204
|
+
* <DialogCloseTrigger>Close</DialogCloseTrigger>
|
|
1205
|
+
* </Dialog>
|
|
1206
|
+
* </DialogProvider>
|
|
1207
|
+
* ```
|
|
1208
|
+
*/
|
|
1209
|
+
declare const DialogCloseTrigger: ForwardRefExoticComponent<Dialog_2.CloseTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
1210
|
+
export { DialogCloseTrigger }
|
|
1211
|
+
export { DialogCloseTrigger as DialogCloseTrigger_alias_1 }
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* The content of the dialog. Must be used within the `DialogProvider`
|
|
1215
|
+
* component.
|
|
1216
|
+
*/
|
|
1217
|
+
declare const DialogContent: ForwardRefExoticComponent<Dialog_2.ContentProps & RefAttributes<HTMLDivElement>>;
|
|
1218
|
+
export { DialogContent }
|
|
1219
|
+
export { DialogContent as DialogContent_alias_1 }
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* The description of the dialog. Must be used within the `DialogContent` component.
|
|
1223
|
+
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1224
|
+
* @example
|
|
1225
|
+
* ```tsx
|
|
1226
|
+
* <DialogProvider>
|
|
1227
|
+
* <DialogTrigger asChild>
|
|
1228
|
+
* <Button>Open Dialog</Button>
|
|
1229
|
+
* </DialogTrigger>
|
|
1230
|
+
* <Dialog>
|
|
1231
|
+
* <DialogHeading>Dialog Title</DialogHeading>
|
|
1232
|
+
* <DialogDescription>Dialog Description</DialogDescription>
|
|
1233
|
+
* </Dialog>
|
|
1234
|
+
* </DialogProvider>
|
|
1235
|
+
* ```
|
|
1236
|
+
*/
|
|
1237
|
+
declare function DialogDescription(props: DialogTitleProps): JSX_2.Element;
|
|
1238
|
+
export { DialogDescription }
|
|
1239
|
+
export { DialogDescription as DialogDescription_alias_1 }
|
|
1240
|
+
|
|
1241
|
+
/**
|
|
1242
|
+
* The heading of the dialog. Must be used within the `DialogContent` component.
|
|
1243
|
+
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1244
|
+
* @example
|
|
1245
|
+
* ```tsx
|
|
1246
|
+
* <DialogProvider>
|
|
1247
|
+
* <DialogTrigger asChild>
|
|
1248
|
+
* <Button>Open Dialog</Button>
|
|
1249
|
+
* </DialogTrigger>
|
|
1250
|
+
* <Dialog>
|
|
1251
|
+
* <DialogHeading>Dialog Title</DialogHeading>
|
|
1252
|
+
* <Text>Dialog Content</Text>
|
|
1253
|
+
* </Dialog>
|
|
1254
|
+
* </DialogProvider>
|
|
1255
|
+
* ```
|
|
1256
|
+
*/
|
|
1257
|
+
declare function DialogHeading(props: DialogTitleProps): JSX_2.Element;
|
|
1258
|
+
export { DialogHeading }
|
|
1259
|
+
export { DialogHeading as DialogHeading_alias_1 }
|
|
1260
|
+
|
|
1261
|
+
/**
|
|
1262
|
+
* The positioner of the dialog. Must be used within the `DialogProvider`
|
|
1263
|
+
* component.
|
|
1264
|
+
*/
|
|
1265
|
+
declare const DialogPositioner: ForwardRefExoticComponent<Dialog_2.PositionerProps & RefAttributes<HTMLDivElement>>;
|
|
1266
|
+
export { DialogPositioner }
|
|
1267
|
+
export { DialogPositioner as DialogPositioner_alias_1 }
|
|
1268
|
+
|
|
1269
|
+
declare interface DialogProps extends Omit<DialogContentProps, 'size'>, DialogVariantProps {
|
|
1270
|
+
}
|
|
1271
|
+
export { DialogProps }
|
|
1272
|
+
export { DialogProps as DialogProps_alias_1 }
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* The provider that controls the dialog components.
|
|
1276
|
+
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1277
|
+
* @example
|
|
1278
|
+
* ```tsx
|
|
1279
|
+
* <DialogProvider>
|
|
1280
|
+
* <DialogTrigger asChild>
|
|
1281
|
+
* <Button>Open Dialog</Button>
|
|
1282
|
+
* </DialogTrigger>
|
|
1283
|
+
* <Dialog>
|
|
1284
|
+
* <Text>Dialog Content</Text>
|
|
1285
|
+
* <DialogCloseTrigger>Close</DialogCloseTrigger>
|
|
1286
|
+
* </Dialog>
|
|
1287
|
+
* </DialogProvider>
|
|
1288
|
+
* ```
|
|
1289
|
+
*/
|
|
1290
|
+
declare function DialogProvider(props: DialogProviderProps): JSX_2.Element;
|
|
1291
|
+
export { DialogProvider }
|
|
1292
|
+
export { DialogProvider as DialogProvider_alias_1 }
|
|
1293
|
+
|
|
1294
|
+
declare type DialogProviderProps = DialogRootProps;
|
|
1295
|
+
export { DialogProviderProps }
|
|
1296
|
+
export { DialogProviderProps as DialogProviderProps_alias_1 }
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* The trigger that opens the dialog. Must be used within the `DialogProvider`
|
|
1300
|
+
* component.
|
|
1301
|
+
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1302
|
+
* @example
|
|
1303
|
+
* ```tsx
|
|
1304
|
+
* <DialogTrigger asChild>
|
|
1305
|
+
* <Button>Open Dialog</Button>
|
|
1306
|
+
* </DialogTrigger>
|
|
1307
|
+
* ```
|
|
1308
|
+
*/
|
|
1309
|
+
declare const DialogTrigger: ForwardRefExoticComponent<Dialog_2.TriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
1310
|
+
export { DialogTrigger }
|
|
1311
|
+
export { DialogTrigger as DialogTrigger_alias_1 }
|
|
1312
|
+
|
|
1147
1313
|
export { DistanceMeasurement }
|
|
1148
1314
|
|
|
1149
1315
|
export { DndContext }
|
|
@@ -1990,36 +2156,14 @@ export { MenuTrigger }
|
|
|
1990
2156
|
export { MenuTrigger as MenuTrigger_alias_1 }
|
|
1991
2157
|
|
|
1992
2158
|
/**
|
|
1993
|
-
*
|
|
1994
|
-
* @see https://cerberus.digitalu.design/react/modal
|
|
1995
|
-
* @example
|
|
1996
|
-
* ```tsx
|
|
1997
|
-
* const { modalRef } = useModal()
|
|
1998
|
-
*
|
|
1999
|
-
* <Modal ref={modalRef}>
|
|
2000
|
-
* <Avatar icon={SomeIcon} />
|
|
2001
|
-
* <ModalHeader>
|
|
2002
|
-
* <ModalHeading>Modal Heading</ModalHeading>
|
|
2003
|
-
* <ModalDescription>Modal description</ModalDescription>
|
|
2004
|
-
* </ModalHeader>
|
|
2005
|
-
*
|
|
2006
|
-
* {props.children}
|
|
2007
|
-
* </Modal>
|
|
2008
|
-
* ```
|
|
2159
|
+
* @deprecated use `Dialog` instead
|
|
2009
2160
|
*/
|
|
2010
2161
|
declare const Modal: ForwardRefExoticComponent<ModalProps & RefAttributes<HTMLDialogElement>>;
|
|
2011
2162
|
export { Modal }
|
|
2012
2163
|
export { Modal as Modal_alias_1 }
|
|
2013
2164
|
|
|
2014
2165
|
/**
|
|
2015
|
-
*
|
|
2016
|
-
* @see https://cerberus.digitalu.design/react/modal
|
|
2017
|
-
* @example
|
|
2018
|
-
* ```tsx
|
|
2019
|
-
* <Modal>
|
|
2020
|
-
* <ModalDescription>Modal Heading</ModalDescription>
|
|
2021
|
-
* </Modal>
|
|
2022
|
-
* ```
|
|
2166
|
+
* @deprecated use `DialogDescription` instead
|
|
2023
2167
|
*/
|
|
2024
2168
|
declare function ModalDescription(props: ModalDescriptionProps): JSX_2.Element;
|
|
2025
2169
|
export { ModalDescription }
|
|
@@ -2034,16 +2178,7 @@ export { ModalDescriptionProps }
|
|
|
2034
2178
|
export { ModalDescriptionProps as ModalDescriptionProps_alias_1 }
|
|
2035
2179
|
|
|
2036
2180
|
/**
|
|
2037
|
-
*
|
|
2038
|
-
* @see https://cerberus.digitalu.design/react/modal
|
|
2039
|
-
* @example
|
|
2040
|
-
* ```tsx
|
|
2041
|
-
* <Modal>
|
|
2042
|
-
* <ModalHeader>
|
|
2043
|
-
* <h2>Modal Heading</h2>
|
|
2044
|
-
* </ModalHeader>
|
|
2045
|
-
* </Modal>
|
|
2046
|
-
* ```
|
|
2181
|
+
* @deprecated there is no replacement for this component
|
|
2047
2182
|
*/
|
|
2048
2183
|
declare function ModalHeader(props: ModalHeaderProps): JSX_2.Element;
|
|
2049
2184
|
export { ModalHeader }
|
|
@@ -2058,14 +2193,7 @@ export { ModalHeaderProps }
|
|
|
2058
2193
|
export { ModalHeaderProps as ModalHeaderProps_alias_1 }
|
|
2059
2194
|
|
|
2060
2195
|
/**
|
|
2061
|
-
*
|
|
2062
|
-
* @see https://cerberus.digitalu.design/react/modal
|
|
2063
|
-
* @example
|
|
2064
|
-
* ```tsx
|
|
2065
|
-
* <Modal>
|
|
2066
|
-
* <ModalHeading>Modal Heading</ModalHeading>
|
|
2067
|
-
* </Modal>
|
|
2068
|
-
* ```
|
|
2196
|
+
* @deprecated use `DialogHeading` instead
|
|
2069
2197
|
*/
|
|
2070
2198
|
declare function ModalHeading(props: ModalHeadingProps): JSX_2.Element;
|
|
2071
2199
|
export { ModalHeading }
|
|
@@ -2649,10 +2777,23 @@ export { RadioRecipe as RadioRecipe_alias_1 }
|
|
|
2649
2777
|
* </Field>
|
|
2650
2778
|
* ```
|
|
2651
2779
|
*/
|
|
2652
|
-
declare function RangePickerInput(props:
|
|
2780
|
+
declare function RangePickerInput(props: RangePickerInputProps): JSX_2.Element;
|
|
2653
2781
|
export { RangePickerInput }
|
|
2654
2782
|
export { RangePickerInput as RangePickerInput_alias_1 }
|
|
2655
2783
|
|
|
2784
|
+
declare interface RangePickerInputProps extends Omit<DatePickerInputProps, 'defaultValue'> {
|
|
2785
|
+
/**
|
|
2786
|
+
* The defaultValue to add for the inputs. The first item is the start date
|
|
2787
|
+
* and the second item is the end date.
|
|
2788
|
+
*/
|
|
2789
|
+
defaultValue?: [
|
|
2790
|
+
InputHTMLAttributes<HTMLInputElement>['defaultValue'],
|
|
2791
|
+
InputHTMLAttributes<HTMLInputElement>['defaultValue']
|
|
2792
|
+
];
|
|
2793
|
+
}
|
|
2794
|
+
export { RangePickerInputProps }
|
|
2795
|
+
export { RangePickerInputProps as RangePickerInputProps_alias_1 }
|
|
2796
|
+
|
|
2656
2797
|
export { rectIntersection }
|
|
2657
2798
|
|
|
2658
2799
|
/**
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IconButton
|
|
3
|
+
} from "./chunk-APD6IX5R.js";
|
|
4
|
+
import {
|
|
5
|
+
useCerberusContext
|
|
6
|
+
} from "./chunk-GITT5645.js";
|
|
7
|
+
|
|
8
|
+
// src/components/Dialog.client.tsx
|
|
9
|
+
import {
|
|
10
|
+
Dialog as ArkDialog
|
|
11
|
+
} from "@ark-ui/react";
|
|
12
|
+
import { dialog } from "@cerberus/styled-system/recipes";
|
|
13
|
+
import { cx } from "@cerberus/styled-system/css";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
function DialogCloseIconTrigger(props) {
|
|
16
|
+
const { icons } = useCerberusContext();
|
|
17
|
+
const { close: CloseIcon } = icons;
|
|
18
|
+
const styles = dialog();
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
ArkDialog.CloseTrigger,
|
|
21
|
+
{
|
|
22
|
+
...props,
|
|
23
|
+
className: cx(props.className, styles.closeTrigger),
|
|
24
|
+
asChild: true,
|
|
25
|
+
children: /* @__PURE__ */ jsx(
|
|
26
|
+
IconButton,
|
|
27
|
+
{
|
|
28
|
+
ariaLabel: "Close dialog",
|
|
29
|
+
palette: "action",
|
|
30
|
+
size: "lg",
|
|
31
|
+
usage: "ghost",
|
|
32
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
DialogCloseIconTrigger
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=chunk-6BN3XKQF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Dialog.client.tsx"],"sourcesContent":["'use client'\n\nimport {\n Dialog as ArkDialog,\n type DialogCloseTriggerProps,\n} from '@ark-ui/react'\nimport { dialog } from '@cerberus/styled-system/recipes'\nimport { cx } from '@cerberus/styled-system/css'\nimport { IconButton } from './IconButton'\nimport { useCerberusContext } from '../context/cerberus'\n\n/**\n * This module contains client-side components for the Dialog family.\n * @module @cerberus-design/react/dialog\n */\n\nexport function DialogCloseIconTrigger(props: DialogCloseTriggerProps) {\n const { icons } = useCerberusContext()\n const { close: CloseIcon } = icons\n\n const styles = dialog()\n\n return (\n <ArkDialog.CloseTrigger\n {...props}\n className={cx(props.className, styles.closeTrigger)}\n asChild\n >\n <IconButton\n ariaLabel=\"Close dialog\"\n palette=\"action\"\n size=\"lg\"\n usage=\"ghost\"\n >\n <CloseIcon />\n </IconButton>\n </ArkDialog.CloseTrigger>\n )\n}\n"],"mappings":";;;;;;;;AAEA;AAAA,EACE,UAAU;AAAA,OAEL;AACP,SAAS,cAAc;AACvB,SAAS,UAAU;AA2BX;AAlBD,SAAS,uBAAuB,OAAgC;AACrE,QAAM,EAAE,MAAM,IAAI,mBAAmB;AACrC,QAAM,EAAE,OAAO,UAAU,IAAI;AAE7B,QAAM,SAAS,OAAO;AAEtB,SACE;AAAA,IAAC,UAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,MAAM,WAAW,OAAO,YAAY;AAAA,MAClD,SAAO;AAAA,MAEP;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,OAAM;AAAA,UAEN,8BAAC,aAAU;AAAA;AAAA,MACb;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/ModalHeading.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { modal } from '@cerberus/styled-system/recipes'\nimport type { HTMLAttributes } from 'react'\n\n/**\n * This module contains the ModalHeading component for a customizable modal.\n * @module\n */\n\nexport type ModalHeadingProps = HTMLAttributes<HTMLParagraphElement>\n\n/**\n * @deprecated use `DialogHeading` instead\n */\nexport function ModalHeading(props: ModalHeadingProps) {\n return <p {...props} className={cx(props.className, modal().heading)} />\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,aAAa;AAcb;AADF,SAAS,aAAa,OAA0B;AACrD,SAAO,oBAAC,OAAG,GAAG,OAAO,WAAW,GAAG,MAAM,WAAW,MAAM,EAAE,OAAO,GAAG;AACxE;","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Notification
|
|
3
|
+
} from "./chunk-RDRD6ACD.js";
|
|
1
4
|
import {
|
|
2
5
|
NotificationDescription
|
|
3
6
|
} from "./chunk-UXY3KCC3.js";
|
|
4
7
|
import {
|
|
5
8
|
NotificationHeading
|
|
6
9
|
} from "./chunk-SLHYBPJ5.js";
|
|
7
|
-
import {
|
|
8
|
-
Notification
|
|
9
|
-
} from "./chunk-RDRD6ACD.js";
|
|
10
10
|
import {
|
|
11
11
|
Portal
|
|
12
12
|
} from "./chunk-IQJDVFPP.js";
|
|
@@ -50,7 +50,7 @@ function NotificationCenter(props) {
|
|
|
50
50
|
id,
|
|
51
51
|
state: "closed"
|
|
52
52
|
});
|
|
53
|
-
setTimeout(() => {
|
|
53
|
+
window.setTimeout(() => {
|
|
54
54
|
removeNotification(dispatch, id);
|
|
55
55
|
}, 150);
|
|
56
56
|
},
|
|
@@ -64,7 +64,7 @@ function NotificationCenter(props) {
|
|
|
64
64
|
id,
|
|
65
65
|
state: "open"
|
|
66
66
|
});
|
|
67
|
-
setTimeout(() => {
|
|
67
|
+
window.setTimeout(() => {
|
|
68
68
|
closeNotification(id);
|
|
69
69
|
}, timeout);
|
|
70
70
|
},
|
|
@@ -177,4 +177,4 @@ export {
|
|
|
177
177
|
NotificationCenter,
|
|
178
178
|
useNotificationCenter
|
|
179
179
|
};
|
|
180
|
-
//# sourceMappingURL=chunk-
|
|
180
|
+
//# sourceMappingURL=chunk-JAROS4Q3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/context/notification-center.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useReducer,\n type MouseEvent,\n type PropsWithChildren,\n type ReactNode,\n} from 'react'\nimport { Show } from '../components/Show'\nimport { NotificationHeading } from '../components/NotificationHeading'\nimport { NotificationDescription } from '../components/NotificationDescription'\nimport { Notification } from '../components/Notification'\nimport { animateIn, vstack } from '@cerberus/styled-system/patterns'\nimport { Portal, type PortalProps } from '../components/Portal'\nimport { notification } from '@cerberus/styled-system/recipes'\nimport { Button } from '../components/Button'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n addNotification,\n clearNotificationState,\n notificationCenterReducer,\n removeNotification,\n updateNotificationState,\n} from './notification-center/store'\n\n/**\n * This module provides a context and hook for notifications.\n * @module\n */\n\nexport interface NotifyOptions {\n /**\n * The palette of the notification.\n * @default 'info'\n */\n palette: 'info' | 'success' | 'warning' | 'danger'\n /**\n * The heading of the notification.\n */\n heading: string\n /**\n * The unique id of the notification.\n */\n id?: string\n /**\n * The description of the notification.\n */\n description?: ReactNode\n /**\n * The action to take when the notification is closed\n */\n onClose?: () => void\n}\n\nexport interface NotificationsValue {\n notify: (options: NotifyOptions) => void\n}\n\nconst NotificationsContext = createContext<NotificationsValue | null>(null)\n\nexport type NotificationsProviderProps = PortalProps & {\n /**\n * The duration in milliseconds to show the notification.\n * @default 6000\n */\n duration?: number\n}\n\n/**\n * Provides a notification center to the app.\n * @see https://cerberus.digitalu.design/react/notification\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <Notifications>\n * <SomeFeatureSection />\n * </Notifications>\n *\n * // Use the hook to show a notification.\n * const notify = useNotifications()\n *\n * const handleClick = useCallback(() => {\n * notify({\n * palette: 'info',\n * heading: 'New feature!',\n * description: 'We have added a new feature to the app.',\n * })\n * }, [notify])\n * ```\n */\nexport function NotificationCenter(\n props: PropsWithChildren<NotificationsProviderProps>,\n) {\n const [state, dispatch] = useReducer(notificationCenterReducer, [])\n const styles = notification()\n\n const timeout = useMemo<number>(\n () => props.duration || 6000,\n [props.duration],\n )\n\n const closeNotification = useCallback(\n (id: string) => {\n updateNotificationState(dispatch, {\n id,\n state: 'closed',\n })\n window.setTimeout(() => {\n removeNotification(dispatch, id)\n }, 150)\n },\n [dispatch],\n )\n\n const handleNotify = useCallback(\n (options: NotifyOptions) => {\n const id = `${options.palette}:${state.length + 1}`\n addNotification(dispatch, {\n ...options,\n id,\n state: 'open',\n })\n\n window.setTimeout(() => {\n closeNotification(id)\n }, timeout)\n },\n [dispatch, state, timeout, closeNotification],\n )\n\n const handleClose = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n const target = e.currentTarget as HTMLButtonElement\n closeNotification(target.value)\n },\n [closeNotification],\n )\n\n const handleCloseAll = useCallback(() => {\n state.forEach((item) => {\n if (item.onClose) item.onClose()\n })\n // we don't want to animate out for this one\n clearNotificationState(dispatch)\n }, [state, dispatch])\n\n const value = useMemo(\n () => ({\n notify: handleNotify,\n }),\n [handleNotify],\n )\n\n // For some reason, the vstack pattern alignItems is not registering here.\n // So we are forcing it with the style prop.\n\n return (\n <NotificationsContext.Provider value={value}>\n {props.children}\n\n <Show when={state.length > 0}>\n <Portal container={props.container}>\n <div className={styles.center}>\n <Show when={state.length >= 4}>\n <Button\n className={cx(styles.closeAll, animateIn())}\n onClick={handleCloseAll}\n palette=\"action\"\n shape=\"rounded\"\n size=\"sm\"\n usage=\"ghost\"\n >\n Close all\n </Button>\n </Show>\n\n <div\n className={vstack({\n alignItems: 'flex-end',\n gap: '4',\n })}\n style={{\n alignItems: 'flex-end',\n }}\n >\n {state.map((option) => (\n <MatchNotification\n key={option.id}\n {...option}\n onClose={handleClose}\n open={option.state}\n />\n ))}\n </div>\n </div>\n </Portal>\n </Show>\n </NotificationsContext.Provider>\n )\n}\n\ninterface MatchNotificationProps extends Omit<NotifyOptions, 'onClose'> {\n open: 'open' | 'closed'\n onClose: (e: MouseEvent<HTMLButtonElement>) => void\n key: string | undefined\n}\n\nfunction MatchNotification(props: MatchNotificationProps) {\n const { palette, id, onClose, heading, description, open } = props\n const sharedProps = useMemo(\n () => ({\n id: id!,\n open: true,\n onClose,\n 'data-state': open,\n }),\n [id, open, onClose],\n )\n\n switch (palette) {\n case 'success':\n return (\n <Notification {...sharedProps} palette=\"success\">\n <NotificationHeading palette=\"success\">{heading}</NotificationHeading>\n <NotificationDescription palette=\"success\">\n {description}\n </NotificationDescription>\n </Notification>\n )\n\n case 'warning':\n return (\n <Notification {...sharedProps} palette=\"warning\">\n <NotificationHeading palette=\"warning\">{heading}</NotificationHeading>\n <NotificationDescription palette=\"warning\">\n {description}\n </NotificationDescription>\n </Notification>\n )\n\n case 'danger':\n return (\n <Notification {...sharedProps} palette=\"danger\">\n <NotificationHeading palette=\"danger\">{heading}</NotificationHeading>\n <NotificationDescription palette=\"danger\">\n {description}\n </NotificationDescription>\n </Notification>\n )\n\n case 'info':\n default:\n return (\n <Notification {...sharedProps} palette=\"info\">\n <NotificationHeading palette=\"info\">{heading}</NotificationHeading>\n <NotificationDescription palette=\"info\">\n {description}\n </NotificationDescription>\n </Notification>\n )\n }\n}\n\n/**\n * The hook to use the NotificationCenter.\n * @returns The notify method to trigger a notification.\n * @example\n * ```tsx\n * const {notify} = useNotificationCenter()\n * notify({\n * palette: 'info',\n * heading: 'New feature',\n * description: 'We have added a new feature to the app.',\n * })\n * ```\n */\nexport function useNotificationCenter(): NotificationsValue {\n const context = useContext(NotificationsContext)\n if (!context) {\n throw new Error(\n 'useNotificationCenter must be used within a NotificationsProvider',\n )\n }\n return context\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Modal.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { modal } from '@cerberus/styled-system/recipes'\nimport { forwardRef, type ForwardedRef, type HTMLAttributes } from 'react'\n\n/**\n * This module contains the Modal root component for a customizable modal.\n * @module\n */\n\n// Modal\n\nexport type ModalProps = HTMLAttributes<HTMLDialogElement>\n\nfunction ModalEl(props: ModalProps, ref: ForwardedRef<HTMLDialogElement>) {\n return (\n <dialog\n {...props}\n className={cx(props.className, modal().dialog)}\n ref={ref}\n />\n )\n}\n\n/**\n * @deprecated use `Dialog` instead\n */\nexport const Modal = forwardRef(ModalEl)\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,aAAa;AACtB,SAAS,kBAA0D;AAa/D;AAFJ,SAAS,QAAQ,OAAmB,KAAsC;AACxE,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,MAAM,WAAW,MAAM,EAAE,MAAM;AAAA,MAC7C;AAAA;AAAA,EACF;AAEJ;AAKO,IAAM,QAAQ,WAAW,OAAO;","names":[]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Modal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JIRW4XOJ.js";
|
|
4
4
|
import {
|
|
5
5
|
ModalDescription
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZL6ZITLA.js";
|
|
7
7
|
import {
|
|
8
8
|
ModalHeader
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NUMM4TNC.js";
|
|
10
10
|
import {
|
|
11
11
|
ModalHeading
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7NN3SJ7W.js";
|
|
13
13
|
import {
|
|
14
14
|
Portal
|
|
15
15
|
} from "./chunk-IQJDVFPP.js";
|
|
@@ -171,4 +171,4 @@ export {
|
|
|
171
171
|
ConfirmModal,
|
|
172
172
|
useConfirmModal
|
|
173
173
|
};
|
|
174
|
-
//# sourceMappingURL=chunk-
|
|
174
|
+
//# sourceMappingURL=chunk-MUTAYS3P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/ModalHeader.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { vstack } from '@cerberus/styled-system/patterns'\nimport type { HTMLAttributes } from 'react'\n\n/**\n * This module contains the ModalHeader component for a customizable modal.\n * @module\n */\n\nexport type ModalHeaderProps = HTMLAttributes<HTMLDivElement>\n\n/**\n * @deprecated there is no replacement for this component\n */\nexport function ModalHeader(props: ModalHeaderProps) {\n return (\n <div\n {...props}\n className={cx(\n props.className,\n vstack({\n alignItems: 'flex-start',\n gap: 'md',\n position: 'relative',\n }),\n )}\n />\n )\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,cAAc;AAenB;AAFG,SAAS,YAAY,OAAyB;AACnD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,UACL,YAAY;AAAA,UACZ,KAAK;AAAA,UACL,UAAU;AAAA,QACZ,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProgressBar
|
|
3
3
|
} from "./chunk-WZJ5UQNM.js";
|
|
4
|
-
import {
|
|
5
|
-
IconButton
|
|
6
|
-
} from "./chunk-APD6IX5R.js";
|
|
7
4
|
import {
|
|
8
5
|
FieldMessage
|
|
9
6
|
} from "./chunk-JWIJHSI6.js";
|
|
10
7
|
import {
|
|
11
8
|
Field
|
|
12
9
|
} from "./chunk-UZDVOIW5.js";
|
|
10
|
+
import {
|
|
11
|
+
IconButton
|
|
12
|
+
} from "./chunk-APD6IX5R.js";
|
|
13
13
|
import {
|
|
14
14
|
Avatar
|
|
15
15
|
} from "./chunk-GCQMH4QA.js";
|
|
@@ -227,4 +227,4 @@ export {
|
|
|
227
227
|
processStatus,
|
|
228
228
|
FileStatus
|
|
229
229
|
};
|
|
230
|
-
//# sourceMappingURL=chunk-
|
|
230
|
+
//# sourceMappingURL=chunk-O6LFWUHI.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Modal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JIRW4XOJ.js";
|
|
4
4
|
import {
|
|
5
5
|
ModalDescription
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZL6ZITLA.js";
|
|
7
7
|
import {
|
|
8
8
|
ModalHeader
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NUMM4TNC.js";
|
|
10
10
|
import {
|
|
11
11
|
ModalHeading
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
Portal
|
|
15
|
-
} from "./chunk-IQJDVFPP.js";
|
|
12
|
+
} from "./chunk-7NN3SJ7W.js";
|
|
16
13
|
import {
|
|
17
14
|
IconButton
|
|
18
15
|
} from "./chunk-APD6IX5R.js";
|
|
16
|
+
import {
|
|
17
|
+
Portal
|
|
18
|
+
} from "./chunk-IQJDVFPP.js";
|
|
19
19
|
import {
|
|
20
20
|
Avatar
|
|
21
21
|
} from "./chunk-GCQMH4QA.js";
|
|
@@ -151,4 +151,4 @@ export {
|
|
|
151
151
|
CTAModal,
|
|
152
152
|
useCTAModal
|
|
153
153
|
};
|
|
154
|
-
//# sourceMappingURL=chunk-
|
|
154
|
+
//# sourceMappingURL=chunk-R4RFWDBM.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Portal
|
|
3
|
+
} from "./chunk-IQJDVFPP.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Dialog.tsx
|
|
6
|
+
import {
|
|
7
|
+
Dialog as ArkDialog
|
|
8
|
+
} from "@ark-ui/react";
|
|
9
|
+
import {
|
|
10
|
+
dialog
|
|
11
|
+
} from "@cerberus/styled-system/recipes";
|
|
12
|
+
import { cx } from "@cerberus/styled-system/css";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
function DialogProvider(props) {
|
|
15
|
+
return /* @__PURE__ */ jsx(ArkDialog.Root, { ...props });
|
|
16
|
+
}
|
|
17
|
+
function Dialog(props) {
|
|
18
|
+
const { size, ...contentProps } = props;
|
|
19
|
+
const styles = dialog({ size });
|
|
20
|
+
return /* @__PURE__ */ jsxs(Portal, { children: [
|
|
21
|
+
/* @__PURE__ */ jsx(DialogBackdrop, { className: styles.backdrop }),
|
|
22
|
+
/* @__PURE__ */ jsx(DialogPositioner, { className: styles.positioner, children: /* @__PURE__ */ jsx(DialogContent, { className: styles.content, ...contentProps }) })
|
|
23
|
+
] });
|
|
24
|
+
}
|
|
25
|
+
function DialogHeading(props) {
|
|
26
|
+
const styles = dialog();
|
|
27
|
+
return /* @__PURE__ */ jsx(ArkDialog.Title, { ...props, className: cx(props.className, styles.title) });
|
|
28
|
+
}
|
|
29
|
+
function DialogDescription(props) {
|
|
30
|
+
const styles = dialog();
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
ArkDialog.Description,
|
|
33
|
+
{
|
|
34
|
+
...props,
|
|
35
|
+
className: cx(props.className, styles.description)
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
var DialogTrigger = ArkDialog.Trigger;
|
|
40
|
+
var DialogCloseTrigger = ArkDialog.CloseTrigger;
|
|
41
|
+
var DialogBackdrop = ArkDialog.Backdrop;
|
|
42
|
+
var DialogPositioner = ArkDialog.Positioner;
|
|
43
|
+
var DialogContent = ArkDialog.Content;
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
DialogProvider,
|
|
47
|
+
Dialog,
|
|
48
|
+
DialogHeading,
|
|
49
|
+
DialogDescription,
|
|
50
|
+
DialogTrigger,
|
|
51
|
+
DialogCloseTrigger,
|
|
52
|
+
DialogBackdrop,
|
|
53
|
+
DialogPositioner,
|
|
54
|
+
DialogContent
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=chunk-TFL56AYR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Dialog.tsx"],"sourcesContent":["import {\n Dialog as ArkDialog,\n type DialogContentProps as ArkDialogContentProps,\n type DialogRootProps,\n type DialogTitleProps,\n} from '@ark-ui/react'\nimport {\n dialog,\n type DialogVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport { Portal } from './Portal'\nimport { cx } from '@cerberus/styled-system/css'\n\nexport type DialogProviderProps = DialogRootProps\n\n/**\n * The provider that controls the dialog components.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <Text>Dialog Content</Text>\n * <DialogCloseTrigger>Close</DialogCloseTrigger>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function DialogProvider(props: DialogProviderProps) {\n return <ArkDialog.Root {...props} />\n}\n\nexport interface DialogProps\n extends Omit<ArkDialogContentProps, 'size'>,\n DialogVariantProps {}\n\n/**\n * The content of the dialog. Must be used within the `DialogProvider` component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <Text>Dialog Content</Text>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function Dialog(props: DialogProps) {\n const { size, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Portal>\n <DialogBackdrop className={styles.backdrop} />\n <DialogPositioner className={styles.positioner}>\n <DialogContent className={styles.content} {...contentProps} />\n </DialogPositioner>\n </Portal>\n )\n}\n\n/**\n * The heading of the dialog. Must be used within the `DialogContent` component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <DialogHeading>Dialog Title</DialogHeading>\n * <Text>Dialog Content</Text>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <ArkDialog.Title {...props} className={cx(props.className, styles.title)} />\n )\n}\n\n/**\n * The description of the dialog. Must be used within the `DialogContent` component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <DialogHeading>Dialog Title</DialogHeading>\n * <DialogDescription>Dialog Description</DialogDescription>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function DialogDescription(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <ArkDialog.Description\n {...props}\n className={cx(props.className, styles.description)}\n />\n )\n}\n\n/**\n * The trigger that opens the dialog. Must be used within the `DialogProvider`\n * component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @example\n * ```tsx\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * ```\n */\nexport const DialogTrigger = ArkDialog.Trigger\n\n/**\n * The trigger that closes the dialog. Must be used within the `DialogProvider`\n * component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <Text>Dialog Content</Text>\n * <DialogCloseTrigger>Close</DialogCloseTrigger>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport const DialogCloseTrigger = ArkDialog.CloseTrigger\n\n/**\n * The backdrop of the dialog. Must be used within the `DialogProvider`\n * component.\n */\nexport const DialogBackdrop = ArkDialog.Backdrop\n\n/**\n * The positioner of the dialog. Must be used within the `DialogProvider`\n * component.\n */\nexport const DialogPositioner = ArkDialog.Positioner\n\n/**\n * The content of the dialog. Must be used within the `DialogProvider`\n * component.\n */\nexport const DialogContent = ArkDialog.Content\n"],"mappings":";;;;;AAAA;AAAA,EACE,UAAU;AAAA,OAIL;AACP;AAAA,EACE;AAAA,OAEK;AAEP,SAAS,UAAU;AAqBV,cA0BL,YA1BK;AADF,SAAS,eAAe,OAA4B;AACzD,SAAO,oBAAC,UAAU,MAAV,EAAgB,GAAG,OAAO;AACpC;AAqBO,SAAS,OAAO,OAAoB;AACzC,QAAM,EAAE,MAAM,GAAG,aAAa,IAAI;AAClC,QAAM,SAAS,OAAO,EAAE,KAAK,CAAC;AAC9B,SACE,qBAAC,UACC;AAAA,wBAAC,kBAAe,WAAW,OAAO,UAAU;AAAA,IAC5C,oBAAC,oBAAiB,WAAW,OAAO,YAClC,8BAAC,iBAAc,WAAW,OAAO,SAAU,GAAG,cAAc,GAC9D;AAAA,KACF;AAEJ;AAkBO,SAAS,cAAc,OAAyB;AACrD,QAAM,SAAS,OAAO;AACtB,SACE,oBAAC,UAAU,OAAV,EAAiB,GAAG,OAAO,WAAW,GAAG,MAAM,WAAW,OAAO,KAAK,GAAG;AAE9E;AAkBO,SAAS,kBAAkB,OAAyB;AACzD,QAAM,SAAS,OAAO;AACtB,SACE;AAAA,IAAC,UAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,MAAM,WAAW,OAAO,WAAW;AAAA;AAAA,EACnD;AAEJ;AAaO,IAAM,gBAAgB,UAAU;AAmBhC,IAAM,qBAAqB,UAAU;AAMrC,IAAM,iBAAiB,UAAU;AAMjC,IAAM,mBAAmB,UAAU;AAMnC,IAAM,gBAAgB,UAAU;","names":[]}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Modal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JIRW4XOJ.js";
|
|
4
4
|
import {
|
|
5
5
|
ModalDescription
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZL6ZITLA.js";
|
|
7
7
|
import {
|
|
8
8
|
ModalHeader
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NUMM4TNC.js";
|
|
10
10
|
import {
|
|
11
11
|
ModalHeading
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7NN3SJ7W.js";
|
|
13
13
|
import {
|
|
14
14
|
Input
|
|
15
15
|
} from "./chunk-MZ3UCDUL.js";
|
|
16
16
|
import {
|
|
17
17
|
Label
|
|
18
18
|
} from "./chunk-NMF2HYWO.js";
|
|
19
|
-
import {
|
|
20
|
-
Portal
|
|
21
|
-
} from "./chunk-IQJDVFPP.js";
|
|
22
19
|
import {
|
|
23
20
|
Field
|
|
24
21
|
} from "./chunk-UZDVOIW5.js";
|
|
22
|
+
import {
|
|
23
|
+
Portal
|
|
24
|
+
} from "./chunk-IQJDVFPP.js";
|
|
25
25
|
import {
|
|
26
26
|
Avatar
|
|
27
27
|
} from "./chunk-GCQMH4QA.js";
|
|
@@ -241,4 +241,4 @@ export {
|
|
|
241
241
|
PromptModal,
|
|
242
242
|
usePromptModal
|
|
243
243
|
};
|
|
244
|
-
//# sourceMappingURL=chunk-
|
|
244
|
+
//# sourceMappingURL=chunk-VGEK2DQB.js.map
|