@cerberus-design/react 0.16.0-next-22894bb → 0.16.0-next-1e5283a
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 +108 -90
- package/build/legacy/components/cta-dialog/index.cjs +91 -65
- package/build/legacy/components/cta-dialog/index.cjs.map +1 -1
- package/build/legacy/components/cta-dialog/provider.cjs +91 -65
- package/build/legacy/components/cta-dialog/provider.cjs.map +1 -1
- package/build/legacy/components/{Dialog.client.cjs → dialog/close-icon-trigger.cjs} +36 -28
- package/build/legacy/components/dialog/close-icon-trigger.cjs.map +1 -0
- package/build/legacy/components/dialog/dialog.cjs +80 -0
- package/build/legacy/components/dialog/dialog.cjs.map +1 -0
- package/build/legacy/components/dialog/index.cjs +208 -0
- package/build/legacy/components/dialog/index.cjs.map +1 -0
- package/build/legacy/components/dialog/parts.cjs +109 -0
- package/build/legacy/components/dialog/parts.cjs.map +1 -0
- package/build/legacy/components/dialog/primitives.cjs +112 -0
- package/build/legacy/components/dialog/primitives.cjs.map +1 -0
- package/build/legacy/context/confirm-modal.cjs +78 -49
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/notification-center.cjs +3 -9
- package/build/legacy/context/notification-center.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs +84 -58
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/index.cjs +489 -437
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +108 -90
- package/build/modern/{chunk-QEM3M4N3.js → chunk-4WKM2MJC.js} +9 -7
- package/build/modern/chunk-4WKM2MJC.js.map +1 -0
- package/build/modern/{chunk-H5WNUPGH.js → chunk-6DAOKE6Z.js} +1 -1
- package/build/modern/{chunk-H5WNUPGH.js.map → chunk-6DAOKE6Z.js.map} +1 -1
- package/build/modern/chunk-C45HS2C4.js +22 -0
- package/build/modern/chunk-C45HS2C4.js.map +1 -0
- package/build/modern/{chunk-ZFFW5ELD.js → chunk-CF3EHG42.js} +4 -4
- package/build/modern/chunk-D7UIWAFO.js +84 -0
- package/build/modern/chunk-D7UIWAFO.js.map +1 -0
- package/build/modern/chunk-DJOYRUNT.js +1 -0
- package/build/modern/chunk-FCSO6N2Y.js +27 -0
- package/build/modern/chunk-FCSO6N2Y.js.map +1 -0
- package/build/modern/{chunk-H54FR7IP.js → chunk-MTZDZXZM.js} +8 -6
- package/build/modern/{chunk-H54FR7IP.js.map → chunk-MTZDZXZM.js.map} +1 -1
- package/build/modern/{chunk-6BN3XKQF.js → chunk-NZKE7C53.js} +8 -8
- package/build/modern/chunk-NZKE7C53.js.map +1 -0
- package/build/modern/{chunk-O542MPR7.js → chunk-OOUNB643.js} +8 -6
- package/build/modern/{chunk-O542MPR7.js.map → chunk-OOUNB643.js.map} +1 -1
- package/build/modern/components/FileStatus.js +2 -2
- package/build/modern/components/cta-dialog/index.js +8 -5
- package/build/modern/components/cta-dialog/provider.js +7 -4
- package/build/modern/components/dialog/close-icon-trigger.js +11 -0
- package/build/modern/components/dialog/dialog.js +9 -0
- package/build/modern/components/dialog/dialog.js.map +1 -0
- package/build/modern/components/dialog/index.js +39 -0
- package/build/modern/components/dialog/index.js.map +1 -0
- package/build/modern/components/dialog/parts.js +8 -0
- package/build/modern/components/dialog/parts.js.map +1 -0
- package/build/modern/components/{Dialog.js → dialog/primitives.js} +4 -5
- package/build/modern/components/dialog/primitives.js.map +1 -0
- package/build/modern/components/select/index.js +4 -4
- package/build/modern/context/confirm-modal.js +7 -2
- package/build/modern/context/notification-center.js +1 -1
- package/build/modern/context/prompt-modal.js +7 -2
- package/build/modern/index.js +56 -47
- package/build/modern/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/cta-dialog/provider.tsx +2 -2
- package/src/components/{Dialog.client.tsx → dialog/close-icon-trigger.tsx} +11 -13
- package/src/components/dialog/dialog.tsx +41 -0
- package/src/components/dialog/index.ts +4 -0
- package/src/components/dialog/parts.ts +71 -0
- package/src/components/dialog/primitives.tsx +116 -0
- package/src/context/confirm-modal.tsx +1 -1
- package/src/context/notification-center.tsx +3 -3
- package/src/context/prompt-modal.tsx +1 -1
- package/src/index.ts +1 -2
- package/build/legacy/components/Dialog.cjs +0 -86
- package/build/legacy/components/Dialog.cjs.map +0 -1
- package/build/legacy/components/Dialog.client.cjs.map +0 -1
- package/build/modern/chunk-6BN3XKQF.js.map +0 -1
- package/build/modern/chunk-QEM3M4N3.js.map +0 -1
- package/build/modern/chunk-TFL56AYR.js +0 -56
- package/build/modern/chunk-TFL56AYR.js.map +0 -1
- package/build/modern/components/Dialog.client.js +0 -10
- package/src/components/Dialog.tsx +0 -165
- /package/build/modern/{chunk-ZFFW5ELD.js.map → chunk-CF3EHG42.js.map} +0 -0
- /package/build/modern/{components/Dialog.client.js.map → chunk-DJOYRUNT.js.map} +0 -0
- /package/build/modern/components/{Dialog.js.map → dialog/close-icon-trigger.js.map} +0 -0
|
@@ -46,12 +46,15 @@ import { defaultCoordinates } from '@dnd-kit/core';
|
|
|
46
46
|
import { defaultDropAnimation } from '@dnd-kit/core';
|
|
47
47
|
import { defaultDropAnimationSideEffects } from '@dnd-kit/core';
|
|
48
48
|
import { defaultScreenReaderInstructions } from '@dnd-kit/core';
|
|
49
|
-
import {
|
|
50
|
-
import { DialogCloseTriggerProps } from '@ark-ui/react';
|
|
51
|
-
import { DialogContentProps } from '@ark-ui/react';
|
|
49
|
+
import { DialogBackdropProps } from '@ark-ui/react/dialog';
|
|
50
|
+
import { DialogCloseTriggerProps } from '@ark-ui/react/dialog';
|
|
51
|
+
import { DialogContentProps } from '@ark-ui/react/dialog';
|
|
52
|
+
import { DialogDescriptionProps } from '@ark-ui/react/dialog';
|
|
52
53
|
import { DialogHTMLAttributes } from 'react';
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
54
|
+
import { DialogPositionerProps } from '@ark-ui/react/dialog';
|
|
55
|
+
import { DialogRootProps } from '@ark-ui/react/dialog';
|
|
56
|
+
import { DialogTitleProps } from '@ark-ui/react/dialog';
|
|
57
|
+
import { DialogTriggerProps } from '@ark-ui/react/dialog';
|
|
55
58
|
import { DialogVariantProps } from '@cerberus/styled-system/recipes';
|
|
56
59
|
import type { Dispatch } from 'react';
|
|
57
60
|
import { DistanceMeasurement } from '@dnd-kit/core';
|
|
@@ -1431,8 +1434,10 @@ export { DestructiveConfirmOptions }
|
|
|
1431
1434
|
export { DestructiveConfirmOptions as DestructiveConfirmOptions_alias_1 }
|
|
1432
1435
|
|
|
1433
1436
|
/**
|
|
1434
|
-
*
|
|
1437
|
+
* An abstraction of the Dialog primitives that controls the content of the
|
|
1438
|
+
* dialog. Must be used within the `DialogProvider` component.
|
|
1435
1439
|
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1440
|
+
* @definition [Ark Dialog docs](https://ark-ui.com/react/docs/components/dialog)
|
|
1436
1441
|
* @example
|
|
1437
1442
|
* ```tsx
|
|
1438
1443
|
* <DialogProvider>
|
|
@@ -1448,143 +1453,156 @@ export { DestructiveConfirmOptions as DestructiveConfirmOptions_alias_1 }
|
|
|
1448
1453
|
declare function Dialog(props: DialogProps): JSX_2.Element;
|
|
1449
1454
|
export { Dialog }
|
|
1450
1455
|
export { Dialog as Dialog_alias_1 }
|
|
1456
|
+
export { Dialog as Dialog_alias_2 }
|
|
1451
1457
|
|
|
1452
1458
|
/**
|
|
1453
|
-
* The
|
|
1454
|
-
* component.
|
|
1459
|
+
* The overlay of the dialog.
|
|
1455
1460
|
*/
|
|
1456
|
-
declare
|
|
1461
|
+
declare function DialogBackdrop(props: DialogBackdropProps): JSX_2.Element;
|
|
1457
1462
|
export { DialogBackdrop }
|
|
1458
1463
|
export { DialogBackdrop as DialogBackdrop_alias_1 }
|
|
1464
|
+
export { DialogBackdrop as DialogBackdrop_alias_2 }
|
|
1459
1465
|
|
|
1460
1466
|
/**
|
|
1461
|
-
* This module contains
|
|
1462
|
-
* @module
|
|
1467
|
+
* This module contains the close trigger for the dialog.
|
|
1468
|
+
* @module react/dialog
|
|
1463
1469
|
*/
|
|
1464
1470
|
declare function DialogCloseIconTrigger(props: DialogCloseTriggerProps): JSX_2.Element;
|
|
1465
1471
|
export { DialogCloseIconTrigger }
|
|
1466
1472
|
export { DialogCloseIconTrigger as DialogCloseIconTrigger_alias_1 }
|
|
1473
|
+
export { DialogCloseIconTrigger as DialogCloseIconTrigger_alias_2 }
|
|
1467
1474
|
|
|
1468
1475
|
/**
|
|
1469
|
-
* The trigger that closes the dialog.
|
|
1470
|
-
* component.
|
|
1471
|
-
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1472
|
-
* @example
|
|
1473
|
-
* ```tsx
|
|
1474
|
-
* <DialogProvider>
|
|
1475
|
-
* <DialogTrigger asChild>
|
|
1476
|
-
* <Button>Open Dialog</Button>
|
|
1477
|
-
* </DialogTrigger>
|
|
1478
|
-
* <Dialog>
|
|
1479
|
-
* <Text>Dialog Content</Text>
|
|
1480
|
-
* <DialogCloseTrigger>Close</DialogCloseTrigger>
|
|
1481
|
-
* </Dialog>
|
|
1482
|
-
* </DialogProvider>
|
|
1483
|
-
* ```
|
|
1476
|
+
* The trigger that closes the dialog.
|
|
1484
1477
|
*/
|
|
1485
|
-
declare
|
|
1478
|
+
declare function DialogCloseTrigger(props: DialogTriggerProps): JSX_2.Element;
|
|
1486
1479
|
export { DialogCloseTrigger }
|
|
1487
1480
|
export { DialogCloseTrigger as DialogCloseTrigger_alias_1 }
|
|
1481
|
+
export { DialogCloseTrigger as DialogCloseTrigger_alias_2 }
|
|
1488
1482
|
|
|
1489
1483
|
/**
|
|
1490
|
-
* The content of the dialog.
|
|
1491
|
-
* component.
|
|
1484
|
+
* The visible content of the dialog.
|
|
1492
1485
|
*/
|
|
1493
|
-
declare
|
|
1486
|
+
declare function DialogContent(props: DialogContentProps & DialogVariantProps): JSX_2.Element;
|
|
1494
1487
|
export { DialogContent }
|
|
1495
1488
|
export { DialogContent as DialogContent_alias_1 }
|
|
1489
|
+
export { DialogContent as DialogContent_alias_2 }
|
|
1496
1490
|
|
|
1497
1491
|
/**
|
|
1498
|
-
* The description of the dialog.
|
|
1499
|
-
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1500
|
-
* @example
|
|
1501
|
-
* ```tsx
|
|
1502
|
-
* <DialogProvider>
|
|
1503
|
-
* <DialogTrigger asChild>
|
|
1504
|
-
* <Button>Open Dialog</Button>
|
|
1505
|
-
* </DialogTrigger>
|
|
1506
|
-
* <Dialog>
|
|
1507
|
-
* <DialogHeading>Dialog Title</DialogHeading>
|
|
1508
|
-
* <DialogDescription>Dialog Description</DialogDescription>
|
|
1509
|
-
* </Dialog>
|
|
1510
|
-
* </DialogProvider>
|
|
1511
|
-
* ```
|
|
1492
|
+
* The description of the dialog.
|
|
1512
1493
|
*/
|
|
1513
|
-
declare function DialogDescription(props:
|
|
1494
|
+
declare function DialogDescription(props: DialogDescriptionProps): JSX_2.Element;
|
|
1514
1495
|
export { DialogDescription }
|
|
1515
1496
|
export { DialogDescription as DialogDescription_alias_1 }
|
|
1497
|
+
export { DialogDescription as DialogDescription_alias_2 }
|
|
1516
1498
|
|
|
1517
1499
|
/**
|
|
1518
|
-
* The heading of the dialog.
|
|
1519
|
-
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1520
|
-
* @example
|
|
1521
|
-
* ```tsx
|
|
1522
|
-
* <DialogProvider>
|
|
1523
|
-
* <DialogTrigger asChild>
|
|
1524
|
-
* <Button>Open Dialog</Button>
|
|
1525
|
-
* </DialogTrigger>
|
|
1526
|
-
* <Dialog>
|
|
1527
|
-
* <DialogHeading>Dialog Title</DialogHeading>
|
|
1528
|
-
* <Text>Dialog Content</Text>
|
|
1529
|
-
* </Dialog>
|
|
1530
|
-
* </DialogProvider>
|
|
1531
|
-
* ```
|
|
1500
|
+
* The heading of the dialog.
|
|
1532
1501
|
*/
|
|
1533
1502
|
declare function DialogHeading(props: DialogTitleProps): JSX_2.Element;
|
|
1534
1503
|
export { DialogHeading }
|
|
1535
1504
|
export { DialogHeading as DialogHeading_alias_1 }
|
|
1505
|
+
export { DialogHeading as DialogHeading_alias_2 }
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* An Object containing the parts of the dialog component. For users that
|
|
1509
|
+
* prefer Object component syntax.
|
|
1510
|
+
*
|
|
1511
|
+
* @remarks
|
|
1512
|
+
*
|
|
1513
|
+
* When using object component syntax, you import the DialogParts object and
|
|
1514
|
+
* the entire family of components vs. only what you use.
|
|
1515
|
+
*/
|
|
1516
|
+
declare const DialogParts: DialogPartsValue;
|
|
1517
|
+
export { DialogParts }
|
|
1518
|
+
export { DialogParts as DialogParts_alias_1 }
|
|
1519
|
+
export { DialogParts as DialogParts_alias_2 }
|
|
1520
|
+
|
|
1521
|
+
/**
|
|
1522
|
+
* This module contains the parts of the Dialog component.
|
|
1523
|
+
* @module 'dialog/parts'
|
|
1524
|
+
*/
|
|
1525
|
+
declare interface DialogPartsValue {
|
|
1526
|
+
/**
|
|
1527
|
+
* The context provider of the dialog.
|
|
1528
|
+
*/
|
|
1529
|
+
Root: ElementType;
|
|
1530
|
+
/**
|
|
1531
|
+
* The trigger that opens the dialog.
|
|
1532
|
+
*/
|
|
1533
|
+
Trigger: ElementType;
|
|
1534
|
+
/**
|
|
1535
|
+
* The overlay of the dialog.
|
|
1536
|
+
*/
|
|
1537
|
+
Backdrop: ElementType;
|
|
1538
|
+
/**
|
|
1539
|
+
* The container that positions the dialog.
|
|
1540
|
+
*/
|
|
1541
|
+
Positioner: ElementType;
|
|
1542
|
+
/**
|
|
1543
|
+
* The visible content of the dialog.
|
|
1544
|
+
*/
|
|
1545
|
+
Content: ElementType;
|
|
1546
|
+
/**
|
|
1547
|
+
* The heading of the dialog.
|
|
1548
|
+
*/
|
|
1549
|
+
Heading: ElementType;
|
|
1550
|
+
/**
|
|
1551
|
+
* The description of the dialog.
|
|
1552
|
+
*/
|
|
1553
|
+
Description: ElementType;
|
|
1554
|
+
/**
|
|
1555
|
+
* The trigger that closes the dialog.
|
|
1556
|
+
*/
|
|
1557
|
+
CloseTrigger: ElementType;
|
|
1558
|
+
}
|
|
1536
1559
|
|
|
1537
1560
|
/**
|
|
1538
|
-
* The
|
|
1539
|
-
* component.
|
|
1561
|
+
* The container that positions the dialog.
|
|
1540
1562
|
*/
|
|
1541
|
-
declare
|
|
1563
|
+
declare function DialogPositioner(props: DialogPositionerProps): JSX_2.Element;
|
|
1542
1564
|
export { DialogPositioner }
|
|
1543
1565
|
export { DialogPositioner as DialogPositioner_alias_1 }
|
|
1566
|
+
export { DialogPositioner as DialogPositioner_alias_2 }
|
|
1544
1567
|
|
|
1568
|
+
/**
|
|
1569
|
+
* This module contains and abstraction of the Dialog primitives.
|
|
1570
|
+
* @module 'dialog'
|
|
1571
|
+
*/
|
|
1545
1572
|
declare interface DialogProps extends Omit<DialogContentProps, 'size'>, DialogVariantProps {
|
|
1546
1573
|
}
|
|
1547
1574
|
export { DialogProps }
|
|
1548
1575
|
export { DialogProps as DialogProps_alias_1 }
|
|
1576
|
+
export { DialogProps as DialogProps_alias_2 }
|
|
1549
1577
|
|
|
1550
1578
|
/**
|
|
1551
|
-
* The provider that controls the dialog components.
|
|
1552
|
-
*
|
|
1553
|
-
* @example
|
|
1554
|
-
* ```tsx
|
|
1555
|
-
* <DialogProvider>
|
|
1556
|
-
* <DialogTrigger asChild>
|
|
1557
|
-
* <Button>Open Dialog</Button>
|
|
1558
|
-
* </DialogTrigger>
|
|
1559
|
-
* <Dialog>
|
|
1560
|
-
* <Text>Dialog Content</Text>
|
|
1561
|
-
* <DialogCloseTrigger>Close</DialogCloseTrigger>
|
|
1562
|
-
* </Dialog>
|
|
1563
|
-
* </DialogProvider>
|
|
1564
|
-
* ```
|
|
1579
|
+
* The provider that controls the dialog components. This is a named export of
|
|
1580
|
+
* the DialogRoot primitive.
|
|
1565
1581
|
*/
|
|
1566
|
-
declare
|
|
1582
|
+
declare const DialogProvider: typeof DialogRoot;
|
|
1567
1583
|
export { DialogProvider }
|
|
1568
1584
|
export { DialogProvider as DialogProvider_alias_1 }
|
|
1585
|
+
export { DialogProvider as DialogProvider_alias_2 }
|
|
1569
1586
|
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1587
|
+
/**
|
|
1588
|
+
* This module contains the primitives of the Dialog component.
|
|
1589
|
+
* @module 'dialog/primitives'
|
|
1590
|
+
*/
|
|
1591
|
+
/**
|
|
1592
|
+
* The provider that controls the dialog components.
|
|
1593
|
+
*/
|
|
1594
|
+
declare function DialogRoot(props: DialogRootProps): JSX_2.Element;
|
|
1595
|
+
export { DialogRoot }
|
|
1596
|
+
export { DialogRoot as DialogRoot_alias_1 }
|
|
1597
|
+
export { DialogRoot as DialogRoot_alias_2 }
|
|
1573
1598
|
|
|
1574
1599
|
/**
|
|
1575
|
-
* The trigger that opens the dialog.
|
|
1576
|
-
* component.
|
|
1577
|
-
* @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)
|
|
1578
|
-
* @example
|
|
1579
|
-
* ```tsx
|
|
1580
|
-
* <DialogTrigger asChild>
|
|
1581
|
-
* <Button>Open Dialog</Button>
|
|
1582
|
-
* </DialogTrigger>
|
|
1583
|
-
* ```
|
|
1600
|
+
* The trigger that opens the dialog.
|
|
1584
1601
|
*/
|
|
1585
|
-
declare
|
|
1602
|
+
declare function DialogTrigger(props: DialogTriggerProps): JSX_2.Element;
|
|
1586
1603
|
export { DialogTrigger }
|
|
1587
1604
|
export { DialogTrigger as DialogTrigger_alias_1 }
|
|
1605
|
+
export { DialogTrigger as DialogTrigger_alias_2 }
|
|
1588
1606
|
|
|
1589
1607
|
export { DistanceMeasurement }
|
|
1590
1608
|
|
|
@@ -27,7 +27,7 @@ __export(cta_dialog_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(cta_dialog_exports);
|
|
28
28
|
|
|
29
29
|
// src/components/cta-dialog/provider.tsx
|
|
30
|
-
var
|
|
30
|
+
var import_react6 = require("react");
|
|
31
31
|
var import_jsx2 = require("@cerberus/styled-system/jsx");
|
|
32
32
|
|
|
33
33
|
// src/context/cerberus.tsx
|
|
@@ -154,52 +154,63 @@ var iconSizeMap = {
|
|
|
154
154
|
"4xl": 32
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
-
// src/components/
|
|
158
|
-
var
|
|
159
|
-
var import_recipes2 = require("@cerberus/styled-system/recipes");
|
|
160
|
-
|
|
161
|
-
// src/components/Portal.tsx
|
|
162
|
-
var import_react3 = require("@ark-ui/react");
|
|
163
|
-
var Portal = import_react3.Portal;
|
|
164
|
-
|
|
165
|
-
// src/components/Dialog.tsx
|
|
157
|
+
// src/components/dialog/primitives.tsx
|
|
158
|
+
var import_dialog = require("@ark-ui/react/dialog");
|
|
166
159
|
var import_css2 = require("@cerberus/styled-system/css");
|
|
160
|
+
var import_recipes2 = require("@cerberus/styled-system/recipes");
|
|
167
161
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
168
|
-
function
|
|
169
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
162
|
+
function DialogRoot(props) {
|
|
163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dialog.Dialog.Root, { ...props });
|
|
170
164
|
}
|
|
171
|
-
function
|
|
165
|
+
function DialogBackdrop(props) {
|
|
166
|
+
const styles = (0, import_recipes2.dialog)();
|
|
167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
168
|
+
import_dialog.Dialog.Backdrop,
|
|
169
|
+
{
|
|
170
|
+
...props,
|
|
171
|
+
className: (0, import_css2.cx)(styles.backdrop, props.className)
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
function DialogPositioner(props) {
|
|
176
|
+
const styles = (0, import_recipes2.dialog)();
|
|
177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
178
|
+
import_dialog.Dialog.Positioner,
|
|
179
|
+
{
|
|
180
|
+
...props,
|
|
181
|
+
className: (0, import_css2.cx)(styles.positioner, props.className)
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
function DialogContent(props) {
|
|
172
186
|
const { size, ...contentProps } = props;
|
|
173
187
|
const styles = (0, import_recipes2.dialog)({ size });
|
|
174
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
189
|
+
import_dialog.Dialog.Content,
|
|
190
|
+
{
|
|
191
|
+
...contentProps,
|
|
192
|
+
className: (0, import_css2.cx)(styles.content, contentProps.className)
|
|
193
|
+
}
|
|
194
|
+
);
|
|
178
195
|
}
|
|
179
196
|
function DialogHeading(props) {
|
|
180
197
|
const styles = (0, import_recipes2.dialog)();
|
|
181
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dialog.Dialog.Title, { ...props, className: (0, import_css2.cx)(styles.title, props.className) });
|
|
182
199
|
}
|
|
183
200
|
function DialogDescription(props) {
|
|
184
201
|
const styles = (0, import_recipes2.dialog)();
|
|
185
202
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
186
|
-
|
|
203
|
+
import_dialog.Dialog.Description,
|
|
187
204
|
{
|
|
188
205
|
...props,
|
|
189
|
-
className: (0, import_css2.cx)(
|
|
206
|
+
className: (0, import_css2.cx)(styles.description, props.className)
|
|
190
207
|
}
|
|
191
208
|
);
|
|
192
209
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
var
|
|
197
|
-
var DialogContent = import_react4.Dialog.Content;
|
|
198
|
-
|
|
199
|
-
// src/components/Dialog.client.tsx
|
|
200
|
-
var import_react5 = require("@ark-ui/react");
|
|
201
|
-
var import_recipes4 = require("@cerberus/styled-system/recipes");
|
|
202
|
-
var import_css4 = require("@cerberus/styled-system/css");
|
|
210
|
+
function DialogCloseTrigger(props) {
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dialog.Dialog.CloseTrigger, { ...props });
|
|
212
|
+
}
|
|
213
|
+
var DialogProvider = DialogRoot;
|
|
203
214
|
|
|
204
215
|
// src/components/IconButton.tsx
|
|
205
216
|
var import_css3 = require("@cerberus/styled-system/css");
|
|
@@ -224,17 +235,19 @@ function IconButton(props) {
|
|
|
224
235
|
);
|
|
225
236
|
}
|
|
226
237
|
|
|
227
|
-
// src/components/
|
|
238
|
+
// src/components/dialog/close-icon-trigger.tsx
|
|
239
|
+
var import_recipes4 = require("@cerberus/styled-system/recipes");
|
|
240
|
+
var import_css4 = require("@cerberus/styled-system/css");
|
|
228
241
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
229
242
|
function DialogCloseIconTrigger(props) {
|
|
243
|
+
const styles = (0, import_recipes4.dialog)();
|
|
230
244
|
const { icons } = useCerberusContext();
|
|
231
245
|
const { close: CloseIcon } = icons;
|
|
232
|
-
const styles = (0, import_recipes4.dialog)();
|
|
233
246
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
234
|
-
|
|
247
|
+
DialogCloseTrigger,
|
|
235
248
|
{
|
|
236
249
|
...props,
|
|
237
|
-
className: (0, import_css4.cx)(
|
|
250
|
+
className: (0, import_css4.cx)(styles.closeTrigger, props.className),
|
|
238
251
|
asChild: true,
|
|
239
252
|
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
240
253
|
IconButton,
|
|
@@ -250,26 +263,39 @@ function DialogCloseIconTrigger(props) {
|
|
|
250
263
|
);
|
|
251
264
|
}
|
|
252
265
|
|
|
266
|
+
// src/components/Portal.tsx
|
|
267
|
+
var import_react3 = require("@ark-ui/react");
|
|
268
|
+
var Portal = import_react3.Portal;
|
|
269
|
+
|
|
270
|
+
// src/components/dialog/dialog.tsx
|
|
271
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
272
|
+
function Dialog2(props) {
|
|
273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Portal, { children: [
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogBackdrop, {}),
|
|
275
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogPositioner, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogContent, { ...props }) })
|
|
276
|
+
] });
|
|
277
|
+
}
|
|
278
|
+
|
|
253
279
|
// src/components/cta-dialog/context.tsx
|
|
254
|
-
var
|
|
255
|
-
var CTAModalContext = (0,
|
|
280
|
+
var import_react4 = require("react");
|
|
281
|
+
var CTAModalContext = (0, import_react4.createContext)(null);
|
|
256
282
|
|
|
257
283
|
// src/components/cta-dialog/trigger-item.tsx
|
|
258
284
|
var import_css6 = require("@cerberus/styled-system/css");
|
|
259
285
|
|
|
260
286
|
// src/components/button/button.tsx
|
|
261
|
-
var
|
|
287
|
+
var import_react5 = require("react");
|
|
262
288
|
var import_css5 = require("@cerberus/styled-system/css");
|
|
263
289
|
var import_recipes5 = require("@cerberus/styled-system/recipes");
|
|
264
290
|
var import_jsx = require("@cerberus/styled-system/jsx");
|
|
265
|
-
var
|
|
266
|
-
var ButtonContext = (0,
|
|
291
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
292
|
+
var ButtonContext = (0, import_react5.createContext)({
|
|
267
293
|
pending: false
|
|
268
294
|
});
|
|
269
295
|
function Button(props) {
|
|
270
296
|
const { palette, usage, shape, size, pending = false, ...nativeProps } = props;
|
|
271
|
-
const value = (0,
|
|
272
|
-
return /* @__PURE__ */ (0,
|
|
297
|
+
const value = (0, import_react5.useMemo)(() => ({ pending }), [pending]);
|
|
298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ButtonContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
273
299
|
"button",
|
|
274
300
|
{
|
|
275
301
|
...nativeProps,
|
|
@@ -290,11 +316,11 @@ function Button(props) {
|
|
|
290
316
|
// src/components/cta-dialog/trigger-item.tsx
|
|
291
317
|
var import_factory = require("@ark-ui/react/factory");
|
|
292
318
|
var import_recipes6 = require("@cerberus/styled-system/recipes");
|
|
293
|
-
var
|
|
319
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
294
320
|
function TriggerItem(props) {
|
|
295
321
|
const { asChild, children, ...buttonProps } = props;
|
|
296
322
|
if (asChild) {
|
|
297
|
-
return /* @__PURE__ */ (0,
|
|
323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
298
324
|
import_factory.ark.div,
|
|
299
325
|
{
|
|
300
326
|
className: (0, import_css6.cx)(
|
|
@@ -311,7 +337,7 @@ function TriggerItem(props) {
|
|
|
311
337
|
}
|
|
312
338
|
);
|
|
313
339
|
}
|
|
314
|
-
return /* @__PURE__ */ (0,
|
|
340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
315
341
|
Button,
|
|
316
342
|
{
|
|
317
343
|
...buttonProps,
|
|
@@ -326,21 +352,21 @@ function TriggerItem(props) {
|
|
|
326
352
|
}
|
|
327
353
|
|
|
328
354
|
// src/components/cta-dialog/provider.tsx
|
|
329
|
-
var
|
|
355
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
330
356
|
function CTAModal(props) {
|
|
331
|
-
const [open, setOpen] = (0,
|
|
332
|
-
const [content, setContent] = (0,
|
|
357
|
+
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
358
|
+
const [content, setContent] = (0, import_react6.useState)(null);
|
|
333
359
|
const confirmIcon = content == null ? void 0 : content.icon;
|
|
334
360
|
const { icons } = useCerberusContext();
|
|
335
361
|
const { confirmModal: FallbackIcon } = icons;
|
|
336
|
-
const handleShow = (0,
|
|
362
|
+
const handleShow = (0, import_react6.useCallback)(
|
|
337
363
|
(options) => {
|
|
338
364
|
setContent({ ...options });
|
|
339
365
|
setOpen(true);
|
|
340
366
|
},
|
|
341
367
|
[setOpen]
|
|
342
368
|
);
|
|
343
|
-
const handleActionClick = (0,
|
|
369
|
+
const handleActionClick = (0, import_react6.useCallback)(
|
|
344
370
|
(event) => {
|
|
345
371
|
var _a;
|
|
346
372
|
const index = Number(event.currentTarget.getAttribute("data-index"));
|
|
@@ -351,45 +377,45 @@ function CTAModal(props) {
|
|
|
351
377
|
},
|
|
352
378
|
[content, setOpen]
|
|
353
379
|
);
|
|
354
|
-
const value = (0,
|
|
380
|
+
const value = (0, import_react6.useMemo)(
|
|
355
381
|
() => ({
|
|
356
382
|
show: handleShow
|
|
357
383
|
}),
|
|
358
384
|
[handleShow]
|
|
359
385
|
);
|
|
360
|
-
return /* @__PURE__ */ (0,
|
|
386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(CTAModalContext.Provider, { value, children: [
|
|
361
387
|
props.children,
|
|
362
|
-
/* @__PURE__ */ (0,
|
|
363
|
-
/* @__PURE__ */ (0,
|
|
364
|
-
/* @__PURE__ */ (0,
|
|
365
|
-
/* @__PURE__ */ (0,
|
|
366
|
-
/* @__PURE__ */ (0,
|
|
388
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Dialog2, { size: "sm", children: [
|
|
389
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogCloseIconTrigger, {}),
|
|
390
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx2.VStack, { gap: "xl", w: "full", children: [
|
|
391
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx2.VStack, { alignItems: "flex-start", gap: "md", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx2.VStack, { gap: "lg", w: "full", children: [
|
|
392
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
367
393
|
Avatar,
|
|
368
394
|
{
|
|
369
395
|
ariaLabel: "",
|
|
370
396
|
gradient: "charon-light",
|
|
371
|
-
icon: /* @__PURE__ */ (0,
|
|
397
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
372
398
|
Show,
|
|
373
399
|
{
|
|
374
400
|
when: Boolean(confirmIcon),
|
|
375
|
-
fallback: /* @__PURE__ */ (0,
|
|
401
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FallbackIcon, { size: 24 }),
|
|
376
402
|
children: confirmIcon
|
|
377
403
|
}
|
|
378
404
|
),
|
|
379
405
|
src: ""
|
|
380
406
|
}
|
|
381
407
|
),
|
|
382
|
-
/* @__PURE__ */ (0,
|
|
383
|
-
/* @__PURE__ */ (0,
|
|
408
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogHeading, { children: content == null ? void 0 : content.heading }),
|
|
409
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogDescription, { children: content == null ? void 0 : content.description })
|
|
384
410
|
] }) }),
|
|
385
|
-
/* @__PURE__ */ (0,
|
|
411
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx2.HStack, { gap: "md", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(For, { each: content == null ? void 0 : content.actions._actions, children: (action, index) => {
|
|
386
412
|
var _a;
|
|
387
|
-
return /* @__PURE__ */ (0,
|
|
413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
388
414
|
Show,
|
|
389
415
|
{
|
|
390
416
|
when: ((_a = content == null ? void 0 : content.actions) == null ? void 0 : _a.type) === "btnAction",
|
|
391
|
-
fallback: /* @__PURE__ */ (0,
|
|
392
|
-
children: /* @__PURE__ */ (0,
|
|
417
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TriggerItem, { asChild: true, children: action }),
|
|
418
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TriggerItem, { "data-index": index, onClick: handleActionClick, children: action == null ? void 0 : action.text })
|
|
393
419
|
},
|
|
394
420
|
index
|
|
395
421
|
);
|
|
@@ -399,7 +425,7 @@ function CTAModal(props) {
|
|
|
399
425
|
] });
|
|
400
426
|
}
|
|
401
427
|
function useCTAModal() {
|
|
402
|
-
const context = (0,
|
|
428
|
+
const context = (0, import_react6.useContext)(CTAModalContext);
|
|
403
429
|
if (context === null) {
|
|
404
430
|
throw new Error("useCTAModal must be used within a CTAModal Provider");
|
|
405
431
|
}
|