@korsolutions/ui 0.0.37 → 0.0.38

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.
Files changed (108) hide show
  1. package/dist/module/components/alert-dialog/alert-dialog.js +41 -0
  2. package/dist/module/components/alert-dialog/alert-dialog.js.map +1 -0
  3. package/dist/module/components/alert-dialog/async-alert-dialog.js +117 -0
  4. package/dist/module/components/alert-dialog/async-alert-dialog.js.map +1 -0
  5. package/dist/module/components/alert-dialog/index.js +6 -0
  6. package/dist/module/components/alert-dialog/index.js.map +1 -0
  7. package/dist/module/components/alert-dialog/variants/default.js +93 -0
  8. package/dist/module/components/alert-dialog/variants/default.js.map +1 -0
  9. package/dist/module/components/alert-dialog/variants/index.js +7 -0
  10. package/dist/module/components/alert-dialog/variants/index.js.map +1 -0
  11. package/dist/module/components/index.js +1 -0
  12. package/dist/module/components/index.js.map +1 -1
  13. package/dist/module/index.js +2 -1
  14. package/dist/module/index.js.map +1 -1
  15. package/dist/module/primitives/alert-dialog/alert-dialog-action.js +34 -0
  16. package/dist/module/primitives/alert-dialog/alert-dialog-action.js.map +1 -0
  17. package/dist/module/primitives/alert-dialog/alert-dialog-cancel.js +34 -0
  18. package/dist/module/primitives/alert-dialog/alert-dialog-cancel.js.map +1 -0
  19. package/dist/module/primitives/alert-dialog/alert-dialog-content.js +23 -0
  20. package/dist/module/primitives/alert-dialog/alert-dialog-content.js.map +1 -0
  21. package/dist/module/primitives/alert-dialog/alert-dialog-description.js +23 -0
  22. package/dist/module/primitives/alert-dialog/alert-dialog-description.js.map +1 -0
  23. package/dist/module/primitives/alert-dialog/alert-dialog-footer.js +23 -0
  24. package/dist/module/primitives/alert-dialog/alert-dialog-footer.js.map +1 -0
  25. package/dist/module/primitives/alert-dialog/alert-dialog-overlay.js +26 -0
  26. package/dist/module/primitives/alert-dialog/alert-dialog-overlay.js.map +1 -0
  27. package/dist/module/primitives/alert-dialog/alert-dialog-portal.js +20 -0
  28. package/dist/module/primitives/alert-dialog/alert-dialog-portal.js.map +1 -0
  29. package/dist/module/primitives/alert-dialog/alert-dialog-root.js +22 -0
  30. package/dist/module/primitives/alert-dialog/alert-dialog-root.js.map +1 -0
  31. package/dist/module/primitives/alert-dialog/alert-dialog-title.js +23 -0
  32. package/dist/module/primitives/alert-dialog/alert-dialog-title.js.map +1 -0
  33. package/dist/module/primitives/alert-dialog/alert-dialog-trigger.js +28 -0
  34. package/dist/module/primitives/alert-dialog/alert-dialog-trigger.js.map +1 -0
  35. package/dist/module/primitives/alert-dialog/context.js +12 -0
  36. package/dist/module/primitives/alert-dialog/context.js.map +1 -0
  37. package/dist/module/primitives/alert-dialog/index.js +26 -0
  38. package/dist/module/primitives/alert-dialog/index.js.map +1 -0
  39. package/dist/module/primitives/alert-dialog/types.js +4 -0
  40. package/dist/module/primitives/alert-dialog/types.js.map +1 -0
  41. package/dist/module/primitives/index.js +1 -0
  42. package/dist/module/primitives/index.js.map +1 -1
  43. package/dist/module/primitives/popover/popover-portal.js +1 -1
  44. package/dist/module/primitives/popover/popover-portal.js.map +1 -1
  45. package/dist/typescript/src/components/alert-dialog/alert-dialog.d.ts +15 -0
  46. package/dist/typescript/src/components/alert-dialog/alert-dialog.d.ts.map +1 -0
  47. package/dist/typescript/src/components/alert-dialog/async-alert-dialog.d.ts +19 -0
  48. package/dist/typescript/src/components/alert-dialog/async-alert-dialog.d.ts.map +1 -0
  49. package/dist/typescript/src/components/alert-dialog/index.d.ts +4 -0
  50. package/dist/typescript/src/components/alert-dialog/index.d.ts.map +1 -0
  51. package/dist/typescript/src/components/alert-dialog/variants/default.d.ts +3 -0
  52. package/dist/typescript/src/components/alert-dialog/variants/default.d.ts.map +1 -0
  53. package/dist/typescript/src/components/alert-dialog/variants/index.d.ts +4 -0
  54. package/dist/typescript/src/components/alert-dialog/variants/index.d.ts.map +1 -0
  55. package/dist/typescript/src/components/index.d.ts +1 -0
  56. package/dist/typescript/src/components/index.d.ts.map +1 -1
  57. package/dist/typescript/src/index.d.ts.map +1 -1
  58. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-action.d.ts +8 -0
  59. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-action.d.ts.map +1 -0
  60. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-cancel.d.ts +8 -0
  61. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-cancel.d.ts.map +1 -0
  62. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-content.d.ts +8 -0
  63. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-content.d.ts.map +1 -0
  64. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-description.d.ts +8 -0
  65. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-description.d.ts.map +1 -0
  66. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-footer.d.ts +8 -0
  67. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-footer.d.ts.map +1 -0
  68. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-overlay.d.ts +7 -0
  69. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-overlay.d.ts.map +1 -0
  70. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-portal.d.ts +7 -0
  71. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-portal.d.ts.map +1 -0
  72. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-root.d.ts +8 -0
  73. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-root.d.ts.map +1 -0
  74. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-title.d.ts +8 -0
  75. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-title.d.ts.map +1 -0
  76. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-trigger.d.ts +154 -0
  77. package/dist/typescript/src/primitives/alert-dialog/alert-dialog-trigger.d.ts.map +1 -0
  78. package/dist/typescript/src/primitives/alert-dialog/context.d.ts +10 -0
  79. package/dist/typescript/src/primitives/alert-dialog/context.d.ts.map +1 -0
  80. package/dist/typescript/src/primitives/alert-dialog/index.d.ts +33 -0
  81. package/dist/typescript/src/primitives/alert-dialog/index.d.ts.map +1 -0
  82. package/dist/typescript/src/primitives/alert-dialog/types.d.ts +13 -0
  83. package/dist/typescript/src/primitives/alert-dialog/types.d.ts.map +1 -0
  84. package/dist/typescript/src/primitives/index.d.ts +1 -0
  85. package/dist/typescript/src/primitives/index.d.ts.map +1 -1
  86. package/package.json +1 -1
  87. package/src/components/alert-dialog/alert-dialog.tsx +38 -0
  88. package/src/components/alert-dialog/async-alert-dialog.tsx +121 -0
  89. package/src/components/alert-dialog/index.ts +3 -0
  90. package/src/components/alert-dialog/variants/default.tsx +82 -0
  91. package/src/components/alert-dialog/variants/index.ts +5 -0
  92. package/src/components/index.ts +1 -0
  93. package/src/index.tsx +2 -0
  94. package/src/primitives/alert-dialog/alert-dialog-action.tsx +27 -0
  95. package/src/primitives/alert-dialog/alert-dialog-cancel.tsx +27 -0
  96. package/src/primitives/alert-dialog/alert-dialog-content.tsx +21 -0
  97. package/src/primitives/alert-dialog/alert-dialog-description.tsx +21 -0
  98. package/src/primitives/alert-dialog/alert-dialog-footer.tsx +21 -0
  99. package/src/primitives/alert-dialog/alert-dialog-overlay.tsx +25 -0
  100. package/src/primitives/alert-dialog/alert-dialog-portal.tsx +20 -0
  101. package/src/primitives/alert-dialog/alert-dialog-root.tsx +25 -0
  102. package/src/primitives/alert-dialog/alert-dialog-title.tsx +21 -0
  103. package/src/primitives/alert-dialog/alert-dialog-trigger.tsx +27 -0
  104. package/src/primitives/alert-dialog/context.ts +18 -0
  105. package/src/primitives/alert-dialog/index.ts +34 -0
  106. package/src/primitives/alert-dialog/types.ts +13 -0
  107. package/src/primitives/index.ts +1 -0
  108. package/src/primitives/popover/popover-portal.tsx +1 -1
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ import { AlertDialogPrimitive } from "../../primitives/index.js";
4
+ import { AlertDialogVariants } from "./variants/index.js";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ export function AlertDialog(props) {
7
+ const {
8
+ title,
9
+ description,
10
+ actionLabel = "Continue",
11
+ cancelLabel = "Cancel",
12
+ onAction,
13
+ onCancel,
14
+ variant = "default"
15
+ } = props;
16
+ const useVariantStyles = AlertDialogVariants[variant];
17
+ const variantStyles = useVariantStyles();
18
+ return /*#__PURE__*/_jsxs(AlertDialogPrimitive.Root, {
19
+ styles: variantStyles,
20
+ children: [/*#__PURE__*/_jsx(AlertDialogPrimitive.Trigger, {
21
+ children: props.trigger
22
+ }), /*#__PURE__*/_jsxs(AlertDialogPrimitive.Portal, {
23
+ children: [/*#__PURE__*/_jsx(AlertDialogPrimitive.Overlay, {}), /*#__PURE__*/_jsxs(AlertDialogPrimitive.Content, {
24
+ children: [/*#__PURE__*/_jsx(AlertDialogPrimitive.Title, {
25
+ children: title
26
+ }), /*#__PURE__*/_jsx(AlertDialogPrimitive.Description, {
27
+ children: description
28
+ }), /*#__PURE__*/_jsxs(AlertDialogPrimitive.Footer, {
29
+ children: [/*#__PURE__*/_jsx(AlertDialogPrimitive.Cancel, {
30
+ onPress: onCancel,
31
+ children: cancelLabel
32
+ }), /*#__PURE__*/_jsx(AlertDialogPrimitive.Action, {
33
+ onPress: onAction,
34
+ children: actionLabel
35
+ })]
36
+ })]
37
+ })]
38
+ })]
39
+ });
40
+ }
41
+ //# sourceMappingURL=alert-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AlertDialogPrimitive","AlertDialogVariants","jsx","_jsx","jsxs","_jsxs","AlertDialog","props","title","description","actionLabel","cancelLabel","onAction","onCancel","variant","useVariantStyles","variantStyles","Root","styles","children","Trigger","trigger","Portal","Overlay","Content","Title","Description","Footer","Cancel","onPress","Action"],"sourceRoot":"../../../../src","sources":["components/alert-dialog/alert-dialog.tsx"],"mappings":";;AAAA,SAASA,oBAAoB;AAE7B,SAASC,mBAAmB;AAAqB,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;A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import { AlertDialogPrimitive } from "../../primitives/index.js";
4
+ import React, { useEffect, useState } from "react";
5
+ import { useAlertDialog } from "../../primitives/alert-dialog/context.js";
6
+ import { AlertDialogVariants } from "./variants/index.js";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ // Global state
9
+ const dialogQueue = [];
10
+ let currentDialog = null;
11
+ let setCurrentDialogFn = null;
12
+
13
+ // Process next dialog in queue
14
+ function processQueue() {
15
+ if (currentDialog || dialogQueue.length === 0) return;
16
+ currentDialog = dialogQueue.shift();
17
+ setCurrentDialogFn?.(currentDialog);
18
+ }
19
+
20
+ // Close current dialog
21
+ function closeDialog(confirmed) {
22
+ if (!currentDialog) return;
23
+ currentDialog.resolve({
24
+ confirmed
25
+ });
26
+ currentDialog = null;
27
+ setCurrentDialogFn?.(null);
28
+
29
+ // Process next in queue after a small delay
30
+ setTimeout(processQueue, 100);
31
+ }
32
+
33
+ // Inner component that has access to the dialog context
34
+ function AsyncAlertDialogContent({
35
+ instance
36
+ }) {
37
+ const {
38
+ title,
39
+ description,
40
+ actionLabel = "Continue",
41
+ cancelLabel = "Cancel"
42
+ } = instance.props;
43
+ const {
44
+ setIsOpen
45
+ } = useAlertDialog();
46
+ const handleAction = () => closeDialog(true);
47
+ const handleCancel = () => closeDialog(false);
48
+
49
+ // Automatically open the dialog when mounted
50
+ useEffect(() => {
51
+ setIsOpen(true);
52
+ }, [setIsOpen]);
53
+ return /*#__PURE__*/_jsxs(AlertDialogPrimitive.Portal, {
54
+ children: [/*#__PURE__*/_jsx(AlertDialogPrimitive.Overlay, {
55
+ onPress: handleCancel
56
+ }), /*#__PURE__*/_jsxs(AlertDialogPrimitive.Content, {
57
+ children: [/*#__PURE__*/_jsx(AlertDialogPrimitive.Title, {
58
+ children: title
59
+ }), /*#__PURE__*/_jsx(AlertDialogPrimitive.Description, {
60
+ children: description
61
+ }), /*#__PURE__*/_jsxs(AlertDialogPrimitive.Footer, {
62
+ children: [/*#__PURE__*/_jsx(AlertDialogPrimitive.Cancel, {
63
+ onPress: handleCancel,
64
+ children: cancelLabel
65
+ }), /*#__PURE__*/_jsx(AlertDialogPrimitive.Action, {
66
+ onPress: handleAction,
67
+ children: actionLabel
68
+ })]
69
+ })]
70
+ })]
71
+ });
72
+ }
73
+
74
+ // Component that renders a single dialog instance
75
+ function AsyncAlertDialogInstance({
76
+ instance
77
+ }) {
78
+ const {
79
+ variant = "default"
80
+ } = instance.props;
81
+ const useVariantStyles = AlertDialogVariants[variant];
82
+ const variantStyles = useVariantStyles();
83
+ return /*#__PURE__*/_jsx(AlertDialogPrimitive.Root, {
84
+ styles: variantStyles,
85
+ children: /*#__PURE__*/_jsx(AsyncAlertDialogContent, {
86
+ instance: instance
87
+ })
88
+ });
89
+ }
90
+ export function AsyncAlertDialogManager() {
91
+ const [dialog, setDialog] = useState(null);
92
+ useEffect(() => {
93
+ setCurrentDialogFn = setDialog;
94
+ return () => {
95
+ setCurrentDialogFn = null;
96
+ };
97
+ }, []);
98
+ if (!dialog) return null;
99
+ return /*#__PURE__*/_jsx(AsyncAlertDialogInstance, {
100
+ instance: dialog
101
+ });
102
+ }
103
+ function show(props) {
104
+ return new Promise(resolve => {
105
+ const instance = {
106
+ id: Date.now().toString(),
107
+ props,
108
+ resolve
109
+ };
110
+ dialogQueue.push(instance);
111
+ processQueue();
112
+ });
113
+ }
114
+ export const AsyncAlertDialog = {
115
+ show
116
+ };
117
+ //# sourceMappingURL=async-alert-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AlertDialogPrimitive","React","useEffect","useState","useAlertDialog","AlertDialogVariants","jsx","_jsx","jsxs","_jsxs","dialogQueue","currentDialog","setCurrentDialogFn","processQueue","length","shift","closeDialog","confirmed","resolve","setTimeout","AsyncAlertDialogContent","instance","title","description","actionLabel","cancelLabel","props","setIsOpen","handleAction","handleCancel","Portal","children","Overlay","onPress","Content","Title","Description","Footer","Cancel","Action","AsyncAlertDialogInstance","variant","useVariantStyles","variantStyles","Root","styles","AsyncAlertDialogManager","dialog","setDialog","show","Promise","id","Date","now","toString","push","AsyncAlertDialog"],"sourceRoot":"../../../../src","sources":["components/alert-dialog/async-alert-dialog.tsx"],"mappings":";;AAAA,SAASA,oBAAoB;AAC7B,OAAOC,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,cAAc;AACvB,SAASC,mBAAmB;AAAqB,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAoBjD;AACA,MAAMC,WAAuC,GAAG,EAAE;AAClD,IAAIC,aAA8C,GAAG,IAAI;AACzD,IAAIC,kBAA8E,GAAG,IAAI;;AAEzF;AACA,SAASC,YAAYA,CAAA,EAAG;EACtB,IAAIF,aAAa,IAAID,WAAW,CAACI,MAAM,KAAK,CAAC,EAAE;EAE/CH,aAAa,GAAGD,WAAW,CAACK,KAAK,CAAC,CAAE;EACpCH,kBAAkB,GAAGD,aAAa,CAAC;AACrC;;AAEA;AACA,SAASK,WAAWA,CAACC,SAAkB,EAAE;EACvC,IAAI,CAACN,aAAa,EAAE;EAEpBA,aAAa,CAACO,OAAO,CAAC;IAAED;EAAU,CAAC,CAAC;EACpCN,aAAa,GAAG,IAAI;EACpBC,kBAAkB,GAAG,IAAI,CAAC;;EAE1B;EACAO,UAAU,CAACN,YAAY,EAAE,GAAG,CAAC;AAC/B;;AAEA;AACA,SAASO,uBAAuBA,CAAC;EAAEC;AAAiD,CAAC,EAAE;EACrF,MAAM;IAAEC,KAAK;IAAEC,WAAW;IAAEC,WAAW,GAAG,UAAU;IAAEC,WAAW,GAAG;EAAS,CAAC,GAAGJ,QAAQ,CAACK,KAAK;EAC/F,MAAM;IAAEC;EAAU,CAAC,GAAGvB,cAAc,CAAC,CAAC;EAEtC,MAAMwB,YAAY,GAAGA,CAAA,KAAMZ,WAAW,CAAC,IAAI,CAAC;EAC5C,MAAMa,YAAY,GAAGA,CAAA,KAAMb,WAAW,CAAC,KAAK,CAAC;;E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yB,uBAAuBA,CAAA,EAAG;EACxC,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAG7C,QAAQ,CAAkC,IAAI,CAAC;EAE3ED,SAAS,CAAC,MAAM;IACdU,kBAAkB,GAAGoC,SAAS;IAC9B,OAAO,MAAM;MACXpC,kBAAkB,GAAG,IAAI;IAC3B,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,IAAI,CAACmC,MAAM,EAAE,OAAO,IAAI;EAExB,oBAAOxC,IAAA,CAACiC,wBAAwB;IAACnB,QAAQ,EAAE0B;EAAO,CAAE,CAAC;AACvD;AAEA,SAASE,IAAIA,CAACvB,KAA4B,EAAmC;EAC3E,OAAO,IAAIwB,OAAO,CAAEhC,OAAO,IAAK;IAC9B,MAAMG,QAAkC,GAAG;MACzC8B,EAAE,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;MACzB5B,KAAK;MACLR;IACF,CAAC;IAEDR,WAAW,CAAC6C,IAAI,CAAClC,QAAQ,CAAC;IAC1BR,YAAY,CAAC,CAAC;EAChB,CAAC,CAAC;AACJ;AAEA,OAAO,MAAM2C,gBAAgB,GAAG;EAC9BP;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ export { AlertDialog } from "./alert-dialog.js";
4
+ export { AlertDialogVariants } from "./variants/index.js";
5
+ export { AsyncAlertDialog, AsyncAlertDialogManager } from "./async-alert-dialog.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AlertDialog","AlertDialogVariants","AsyncAlertDialog","AsyncAlertDialogManager"],"sourceRoot":"../../../../src","sources":["components/alert-dialog/index.ts"],"mappings":";;AAAA,SAASA,WAAW;AACpB,SAASC,mBAAmB;AAC5B,SAASC,gBAAgB,EAAEC,uBAAuB","ignoreList":[]}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ import { useThemedStyles } from "../../../utils/use-themed-styles.js";
4
+ export const useAlertDialogVariantDefault = () => {
5
+ return useThemedStyles(({
6
+ colors,
7
+ radius,
8
+ fontFamily,
9
+ fontSize
10
+ }) => ({
11
+ overlay: {
12
+ position: "absolute",
13
+ top: 0,
14
+ left: 0,
15
+ right: 0,
16
+ bottom: 0,
17
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
18
+ justifyContent: "center",
19
+ alignItems: "center"
20
+ },
21
+ content: {
22
+ backgroundColor: colors.background,
23
+ borderRadius: radius,
24
+ padding: 24,
25
+ maxWidth: 400,
26
+ width: "90%",
27
+ shadowColor: "#000",
28
+ shadowOffset: {
29
+ width: 0,
30
+ height: 2
31
+ },
32
+ shadowOpacity: 0.25,
33
+ shadowRadius: 8,
34
+ elevation: 5,
35
+ position: "absolute",
36
+ top: "50%",
37
+ left: "50%",
38
+ transform: [{
39
+ translateX: "-50%"
40
+ }, {
41
+ translateY: "-50%"
42
+ }],
43
+ borderWidth: 1,
44
+ borderColor: colors.border
45
+ },
46
+ title: {
47
+ fontSize: fontSize * 1.25,
48
+ fontWeight: "600",
49
+ color: colors.foreground,
50
+ fontFamily,
51
+ marginBottom: 8
52
+ },
53
+ description: {
54
+ fontSize,
55
+ color: colors.mutedForeground,
56
+ fontFamily,
57
+ lineHeight: fontSize * 1.5
58
+ },
59
+ footer: {
60
+ flexDirection: "row",
61
+ justifyContent: "flex-end",
62
+ gap: 12,
63
+ marginTop: 24
64
+ },
65
+ cancel: {
66
+ paddingVertical: 10,
67
+ paddingHorizontal: 16,
68
+ borderRadius: radius,
69
+ borderWidth: 1,
70
+ borderColor: colors.border,
71
+ backgroundColor: colors.background
72
+ },
73
+ cancelText: {
74
+ color: colors.foreground,
75
+ fontSize,
76
+ fontWeight: "500",
77
+ fontFamily
78
+ },
79
+ action: {
80
+ paddingVertical: 10,
81
+ paddingHorizontal: 16,
82
+ borderRadius: radius,
83
+ backgroundColor: colors.primary
84
+ },
85
+ actionText: {
86
+ color: colors.primaryForeground,
87
+ fontSize,
88
+ fontWeight: "500",
89
+ fontFamily
90
+ }
91
+ }));
92
+ };
93
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useThemedStyles","useAlertDialogVariantDefault","colors","radius","fontFamily","fontSize","overlay","position","top","left","right","bottom","backgroundColor","justifyContent","alignItems","content","background","borderRadius","padding","maxWidth","width","shadowColor","shadowOffset","height","shadowOpacity","shadowRadius","elevation","transform","translateX","translateY","borderWidth","borderColor","border","title","fontWeight","color","foreground","marginBottom","description","mutedForeground","lineHeight","footer","flexDirection","gap","marginTop","cancel","paddingVertical","paddingHorizontal","cancelText","action","primary","actionText","primaryForeground"],"sourceRoot":"../../../../../src","sources":["components/alert-dialog/variants/default.tsx"],"mappings":";;AACA,SAASA,eAAe;AAExB,OAAO,MAAMC,4BAA4B,GAAGA,CAAA,KAAyB;EACnE,OAAOD,eAAe,CACpB,CAAC;IAAEE,MAAM;IAAEC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,MAAyB;IAChEC,OAAO,EAAE;MACPC,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,CAAC;MACNC,IAAI,EAAE,CAAC;MACPC,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE,CAAC;MACTC,eAAe,EAAE,oBAAoB;MACrCC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE;IACd,CAAC;IACDC,OAAO,EAAE;MACPH,eAAe,EAAEV,MAAM,CAACc,UAAU;MAClCC,YAAY,EAAEd,MAAM;MACpBe,OAAO,EAAE,EAAE;MACXC,QAAQ,EAAE,GAAG;MACbC,KAAK,EAAE,KAAK;MACZC,WAAW,EAAE,MAAM;MACnBC,YAAY,EAAE;QAAEF,KAAK,EAAE,CAAC;QAAEG,MAAM,EAAE;MAAE,CAAC;MACrCC,aAAa,EAAE,IAAI;MACnBC,YAAY,EAAE,CAAC;MACfC,SAAS,EAAE,CAAC;MACZnB,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,K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F,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ import { useAlertDialogVariantDefault } from "./default.js";
4
+ export const AlertDialogVariants = {
5
+ default: useAlertDialogVariantDefault
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useAlertDialogVariantDefault","AlertDialogVariants","default"],"sourceRoot":"../../../../../src","sources":["components/alert-dialog/variants/index.ts"],"mappings":";;AAAA,SAASA,4BAA4B;AAErC,OAAO,MAAMC,mBAAmB,GAAG;EACjCC,OAAO,EAAEF;AACX,CAAC","ignoreList":[]}
@@ -17,4 +17,5 @@ export * from "./popover/popover.js";
17
17
  export * from "./calendar/calendar.js";
18
18
  export * from "./tabs/index.js";
19
19
  export * from "./checkbox/index.js";
20
+ export * from "./alert-dialog/index.js";
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import { ThemeProvider } from "./themes/index.js";
4
+ import { AsyncAlertDialogManager } from "./components/alert-dialog/async-alert-dialog.js";
4
5
  import { ToastContainer } from "./components/toast/toast-manager.js";
5
6
  import { PortalHost } from "./primitives/portal/index.js";
6
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -11,7 +12,7 @@ export const UniversalUIProvider = ({
11
12
  return /*#__PURE__*/_jsxs(ThemeProvider, {
12
13
  children: [/*#__PURE__*/_jsx(ToastContainer, {}), children, /*#__PURE__*/_jsx(PortalHost, {
13
14
  container: portalContainer
14
- })]
15
+ }), /*#__PURE__*/_jsx(AsyncAlertDialogManager, {})]
15
16
  });
16
17
  };
17
18
  export * from "./themes/adapters/index.js";
@@ -1 +1 @@
1
- {"version":3,"names":["ThemeProvider","ToastContainer","PortalHost","jsx","_jsx","jsxs","_jsxs","UniversalUIProvider","children","portalContainer","container","useTheme"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa;AACtB,SAASC,cAAc;AACvB,SAASC,UAAU;AAA8B,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASjD,OAAO,MAAMC,mBAAmB,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAA+B,CAAC,KAAK;EACnF,oBACEH,KAAA,CAACN,aAAa;IAAAQ,QAAA,gBACZJ,IAAA,CAACH,cAAc,IAAE,CAAC,EACjBO,QAAQ,eACTJ,IAAA,CAACF,UAAU;MAACQ,SAAS,EAAED;IAAgB,CAAE,CAAC;EAAA,CAC7B,CAAC;AAEpB,CAAC;AAED;AACA,SAASE,QAAQ;AACjB","ignoreList":[]}
1
+ {"version":3,"names":["ThemeProvider","AsyncAlertDialogManager","ToastContainer","PortalHost","jsx","_jsx","jsxs","_jsxs","UniversalUIProvider","children","portalContainer","container","useTheme"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa;AACtB,SAASC,uBAAuB;AAChC,SAASC,cAAc;AACvB,SAASC,UAAU;AAA8B,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASjD,OAAO,MAAMC,mBAAmB,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAA+B,CAAC,KAAK;EACnF,oBACEH,KAAA,CAACP,aAAa;IAAAS,QAAA,gBACZJ,IAAA,CAACH,cAAc,IAAE,CAAC,EACjBO,QAAQ,eACTJ,IAAA,CAACF,UAAU;MAACQ,SAAS,EAAED;IAAgB,CAAE,CAAC,eAC1CL,IAAA,CAACJ,uBAAuB,IAAE,CAAC;EAAA,CACd,CAAC;AAEpB,CAAC;AAED;AACA,SAASW,QAAQ;AACjB","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { Pressable, Text } from "react-native";
5
+ import { useAlertDialog } from "./context.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export function AlertDialogAction(props) {
8
+ const {
9
+ children,
10
+ style,
11
+ onPress,
12
+ ...pressableProps
13
+ } = props;
14
+ const {
15
+ styles,
16
+ setIsOpen
17
+ } = useAlertDialog();
18
+ const handlePress = event => {
19
+ onPress?.(event);
20
+ setIsOpen(false);
21
+ };
22
+ const calculatedStyle = [styles?.action, style];
23
+ const textStyle = styles?.actionText;
24
+ return /*#__PURE__*/_jsx(Pressable, {
25
+ ...pressableProps,
26
+ style: calculatedStyle,
27
+ onPress: handlePress,
28
+ children: /*#__PURE__*/_jsx(Text, {
29
+ style: textStyle,
30
+ children: children
31
+ })
32
+ });
33
+ }
34
+ //# sourceMappingURL=alert-dialog-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Pressable","Text","useAlertDialog","jsx","_jsx","AlertDialogAction","props","children","style","onPress","pressableProps","styles","setIsOpen","handlePress","event","calculatedStyle","action","textStyle","actionText"],"sourceRoot":"../../../../src","sources":["primitives/alert-dialog/alert-dialog-action.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,IAAI,QAA6D,cAAc;AACnG,SAASC,cAAc;AAAoB,SAAAC,GAAA,IAAAC,IAAA;AAO3C,OAAO,SAASC,iBAAiBA,CAACC,KAAsC,EAAE;EACxE,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC,OAAO;IAAE,GAAGC;EAAe,CAAC,GAAGJ,KAAK;EAC7D,MAAM;IAAEK,MAAM;IAAEC;EAAU,CAAC,GAAGV,cAAc,CAAC,CAAC;EAE9C,MAAMW,WAAsC,GAAIC,KAAK,IAAK;IACxDL,OAAO,GAAGK,KAAK,CAAC;IAChBF,SAAS,CAAC,KAAK,CAAC;EAClB,CAAC;EAED,MAAMG,eAAe,GAAG,CAACJ,MAAM,EAAEK,MAAM,EAAER,KAAK,CAAC;EAC/C,MAAMS,SAAS,GAAGN,MAAM,EAAEO,UAAU;EAEpC,oBACEd,IAAA,CAACJ,SAAS;IAAA,GAAKU,cAAc;IAAEF,KAAK,EAAEO,eAAgB;IAACN,OAAO,EAAEI,WAAY;IAAAN,QAAA,eAC1EH,IAAA,CAACH,IAAI;MAACO,KAAK,EAAES,SAAU;MAAAV,QAAA,EAAEA;IAAQ,CAAO;EAAC,CAChC,CAAC;AAEhB","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { Pressable, Text } from "react-native";
5
+ import { useAlertDialog } from "./context.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export function AlertDialogCancel(props) {
8
+ const {
9
+ children,
10
+ style,
11
+ onPress,
12
+ ...pressableProps
13
+ } = props;
14
+ const {
15
+ styles,
16
+ setIsOpen
17
+ } = useAlertDialog();
18
+ const handlePress = event => {
19
+ onPress?.(event);
20
+ setIsOpen(false);
21
+ };
22
+ const calculatedStyle = [styles?.cancel, style];
23
+ const textStyle = styles?.cancelText;
24
+ return /*#__PURE__*/_jsx(Pressable, {
25
+ ...pressableProps,
26
+ style: calculatedStyle,
27
+ onPress: handlePress,
28
+ children: /*#__PURE__*/_jsx(Text, {
29
+ style: textStyle,
30
+ children: children
31
+ })
32
+ });
33
+ }
34
+ //# sourceMappingURL=alert-dialog-cancel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Pressable","Text","useAlertDialog","jsx","_jsx","AlertDialogCancel","props","children","style","onPress","pressableProps","styles","setIsOpen","handlePress","event","calculatedStyle","cancel","textStyle","cancelText"],"sourceRoot":"../../../../src","sources":["primitives/alert-dialog/alert-dialog-cancel.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,IAAI,QAA6D,cAAc;AACnG,SAASC,cAAc;AAAoB,SAAAC,GAAA,IAAAC,IAAA;AAO3C,OAAO,SAASC,iBAAiBA,CAACC,KAAsC,EAAE;EACxE,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC,OAAO;IAAE,GAAGC;EAAe,CAAC,GAAGJ,KAAK;EAC7D,MAAM;IAAEK,MAAM;IAAEC;EAAU,CAAC,GAAGV,cAAc,CAAC,CAAC;EAE9C,MAAMW,WAAsC,GAAIC,KAAK,IAAK;IACxDL,OAAO,GAAGK,KAAK,CAAC;IAChBF,SAAS,CAAC,KAAK,CAAC;EAClB,CAAC;EAED,MAAMG,eAAe,GAAG,CAACJ,MAAM,EAAEK,MAAM,EAAER,KAAK,CAAC;EAC/C,MAAMS,SAAS,GAAGN,MAAM,EAAEO,UAAU;EAEpC,oBACEd,IAAA,CAACJ,SAAS;IAAA,GAAKU,cAAc;IAAEF,KAAK,EAAEO,eAAgB;IAACN,OAAO,EAAEI,WAAY;IAAAN,QAAA,eAC1EH,IAAA,CAACH,IAAI;MAACO,KAAK,EAAES,SAAU;MAAAV,QAAA,EAAEA;IAAQ,CAAO;EAAC,CAChC,CAAC;AAEhB","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { View } from "react-native";
5
+ import { useAlertDialog } from "./context.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export function AlertDialogContent(props) {
8
+ const {
9
+ children,
10
+ style,
11
+ ...viewProps
12
+ } = props;
13
+ const {
14
+ styles
15
+ } = useAlertDialog();
16
+ const calculatedStyle = [styles?.content, style];
17
+ return /*#__PURE__*/_jsx(View, {
18
+ ...viewProps,
19
+ style: calculatedStyle,
20
+ children: children
21
+ });
22
+ }
23
+ //# sourceMappingURL=alert-dialog-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","useAlertDialog","jsx","_jsx","AlertDialogContent","props","children","style","viewProps","styles","calculatedStyle","content"],"sourceRoot":"../../../../src","sources":["primitives/alert-dialog/alert-dialog-content.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAwD,cAAc;AACnF,SAASC,cAAc;AAAoB,SAAAC,GAAA,IAAAC,IAAA;AAO3C,OAAO,SAASC,kBAAkBA,CAACC,KAAuC,EAAE;EAC1E,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EAC/C,MAAM;IAAEI;EAAO,CAAC,GAAGR,cAAc,CAAC,CAAC;EAEnC,MAAMS,eAAe,GAAG,CAACD,MAAM,EAAEE,OAAO,EAAEJ,KAAK,CAAC;EAEhD,oBACEJ,IAAA,CAACH,IAAI;IAAA,GAAKQ,SAAS;IAAED,KAAK,EAAEG,eAAgB;IAAAJ,QAAA,EACzCA;EAAQ,CACL,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { Text } from "react-native";
5
+ import { useAlertDialog } from "./context.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export function AlertDialogDescription(props) {
8
+ const {
9
+ children,
10
+ style,
11
+ ...textProps
12
+ } = props;
13
+ const {
14
+ styles
15
+ } = useAlertDialog();
16
+ const calculatedStyle = [styles?.description, style];
17
+ return /*#__PURE__*/_jsx(Text, {
18
+ ...textProps,
19
+ style: calculatedStyle,
20
+ children: children
21
+ });
22
+ }
23
+ //# sourceMappingURL=alert-dialog-description.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Text","useAlertDialog","jsx","_jsx","AlertDialogDescription","props","children","style","textProps","styles","calculatedStyle","description"],"sourceRoot":"../../../../src","sources":["primitives/alert-dialog/alert-dialog-description.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAwD,cAAc;AACnF,SAASC,cAAc;AAAoB,SAAAC,GAAA,IAAAC,IAAA;AAO3C,OAAO,SAASC,sBAAsBA,CAACC,KAA2C,EAAE;EAClF,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EAC/C,MAAM;IAAEI;EAAO,CAAC,GAAGR,cAAc,CAAC,CAAC;EAEnC,MAAMS,eAAe,GAAG,CAACD,MAAM,EAAEE,WAAW,EAAEJ,KAAK,CAAC;EAEpD,oBACEJ,IAAA,CAACH,IAAI;IAAA,GAAKQ,SAAS;IAAED,KAAK,EAAEG,eAAgB;IAAAJ,QAAA,EACzCA;EAAQ,CACL,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { View } from "react-native";
5
+ import { useAlertDialog } from "./context.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export function AlertDialogFooter(props) {
8
+ const {
9
+ children,
10
+ style,
11
+ ...viewProps
12
+ } = props;
13
+ const {
14
+ styles
15
+ } = useAlertDialog();
16
+ const calculatedStyle = [styles?.footer, style];
17
+ return /*#__PURE__*/_jsx(View, {
18
+ ...viewProps,
19
+ style: calculatedStyle,
20
+ children: children
21
+ });
22
+ }
23
+ //# sourceMappingURL=alert-dialog-footer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","useAlertDialog","jsx","_jsx","AlertDialogFooter","props","children","style","viewProps","styles","calculatedStyle","footer"],"sourceRoot":"../../../../src","sources":["primitives/alert-dialog/alert-dialog-footer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAwD,cAAc;AACnF,SAASC,cAAc;AAAoB,SAAAC,GAAA,IAAAC,IAAA;AAO3C,OAAO,SAASC,iBAAiBA,CAACC,KAAsC,EAAE;EACxE,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EAC/C,MAAM;IAAEI;EAAO,CAAC,GAAGR,cAAc,CAAC,CAAC;EAEnC,MAAMS,eAAe,GAAG,CAACD,MAAM,EAAEE,MAAM,EAAEJ,KAAK,CAAC;EAE/C,oBACEJ,IAAA,CAACH,IAAI;IAAA,GAAKQ,SAAS;IAAED,KAAK,EAAEG,eAAgB;IAAAJ,QAAA,EACzCA;EAAQ,CACL,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { Pressable } from "react-native";
5
+ import { useAlertDialog } from "./context.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export function AlertDialogOverlay(props) {
8
+ const {
9
+ style,
10
+ ...pressableProps
11
+ } = props;
12
+ const {
13
+ styles,
14
+ setIsOpen
15
+ } = useAlertDialog();
16
+ const calculatedStyle = [styles?.overlay, style];
17
+ return /*#__PURE__*/_jsx(Pressable, {
18
+ ...pressableProps,
19
+ style: calculatedStyle,
20
+ onPress: () => setIsOpen(false),
21
+ accessible: true,
22
+ accessibilityRole: "button",
23
+ accessibilityLabel: "Close alert dialog"
24
+ });
25
+ }
26
+ //# sourceMappingURL=alert-dialog-overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Pressable","useAlertDialog","jsx","_jsx","AlertDialogOverlay","props","style","pressableProps","styles","setIsOpen","calculatedStyle","overlay","onPress","accessible","accessibilityRole","accessibilityLabel"],"sourceRoot":"../../../../src","sources":["primitives/alert-dialog/alert-dialog-overlay.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAA6D,cAAc;AAC7F,SAASC,cAAc;AAAoB,SAAAC,GAAA,IAAAC,IAAA;AAM3C,OAAO,SAASC,kBAAkBA,CAACC,KAAuC,EAAE;EAC1E,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAe,CAAC,GAAGF,KAAK;EAC1C,MAAM;IAAEG,MAAM;IAAEC;EAAU,CAAC,GAAGR,cAAc,CAAC,CAAC;EAE9C,MAAMS,eAAe,GAAG,CAACF,MAAM,EAAEG,OAAO,EAAEL,KAAK,CAAC;EAEhD,oBACEH,IAAA,CAACH,SAAS;IAAA,GACJO,cAAc;IAClBD,KAAK,EAAEI,eAAgB;IACvBE,OAAO,EAAEA,CAAA,KAAMH,SAAS,CAAC,KAAK,CAAE;IAChCI,UAAU,EAAE,IAAK;IACjBC,iBAAiB,EAAC,QAAQ;IAC1BC,kBAAkB,EAAC;EAAoB,CACxC,CAAC;AAEN","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { Portal } from "../portal/index.js";
5
+ import { AlertDialogPrimitiveContext, useAlertDialog } from "./context.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export function AlertDialogPortal(props) {
8
+ const alertDialog = useAlertDialog();
9
+ if (!alertDialog.isOpen) {
10
+ return null;
11
+ }
12
+ return /*#__PURE__*/_jsx(Portal, {
13
+ name: "alert-dialog-content",
14
+ children: /*#__PURE__*/_jsx(AlertDialogPrimitiveContext.Provider, {
15
+ value: alertDialog,
16
+ children: props.children
17
+ })
18
+ });
19
+ }
20
+ //# sourceMappingURL=alert-dialog-portal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Portal","AlertDialogPrimitiveContext","useAlertDialog","jsx","_jsx","AlertDialogPortal","props","alertDialog","isOpen","name","children","Provider","value"],"sourceRoot":"../../../../src","sources":["primitives/alert-dialog/alert-dialog-portal.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM;AACf,SAASC,2BAA2B,EAAEC,cAAc;AAAoB,SAAAC,GAAA,IAAAC,IAAA;AAMxE,OAAO,SAASC,iBAAiBA,CAACC,KAA6B,EAAE;EAC/D,MAAMC,WAAW,GAAGL,cAAc,CAAC,CAAC;EAEpC,IAAI,CAACK,WAAW,CAACC,MAAM,EAAE;IACvB,OAAO,IAAI;EACb;EACA,oBACEJ,IAAA,CAACJ,MAAM;IAACS,IAAI,EAAC,sBAAsB;IAAAC,QAAA,eACjCN,IAAA,CAACH,2BAA2B,CAACU,QAAQ;MAACC,KAAK,EAAEL,WAAY;MAAAG,QAAA,EAAEJ,KAAK,CAACI;IAAQ,CAAuC;EAAC,CAC3G,CAAC;AAEb","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ import React, { useMemo, useState } from "react";
4
+ import { AlertDialogPrimitiveContext } from "./context.js";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ export function AlertDialogRoot(props) {
7
+ const {
8
+ children,
9
+ styles
10
+ } = props;
11
+ const [isOpen, setIsOpen] = useState(false);
12
+ const contextValue = useMemo(() => ({
13
+ isOpen,
14
+ setIsOpen,
15
+ styles
16
+ }), [isOpen, styles]);
17
+ return /*#__PURE__*/_jsx(AlertDialogPrimitiveContext.Provider, {
18
+ value: contextValue,
19
+ children: children
20
+ });
21
+ }
22
+ //# sourceMappingURL=alert-dialog-root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useMemo","useState","AlertDialogPrimitiveContext","jsx","_jsx","AlertDialogRoot","props","children","styles","isOpen","setIsOpen","contextValue","Provider","value"],"sourceRoot":"../../../../src","sources":["primitives/alert-dialog/alert-dialog-root.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAChD,SAASC,2BAA2B;AAAoB,SAAAC,GAAA,IAAAC,IAAA;AASxD,OAAO,SAASC,eAAeA,CAACC,KAAoC,EAAE;EACpE,MAAM;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGF,KAAK;EAClC,MAAM,CAACG,MAAM,EAAEC,SAAS,CAAC,GAAGT,QAAQ,CAAC,KAAK,CAAC;EAE3C,MAAMU,YAAY,GAAGX,OAAO,CAC1B,OAAO;IACLS,MAAM;IACNC,SAAS;IACTF;EACF,CAAC,CAAC,EACF,CAACC,MAAM,EAAED,MAAM,CACjB,CAAC;EAED,oBAAOJ,IAAA,CAACF,2BAA2B,CAACU,QAAQ;IAACC,KAAK,EAAEF,YAAa;IAAAJ,QAAA,EAAEA;EAAQ,CAAuC,CAAC;AACrH","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { Text } from "react-native";
5
+ import { useAlertDialog } from "./context.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export function AlertDialogTitle(props) {
8
+ const {
9
+ children,
10
+ style,
11
+ ...textProps
12
+ } = props;
13
+ const {
14
+ styles
15
+ } = useAlertDialog();
16
+ const calculatedStyle = [styles?.title, style];
17
+ return /*#__PURE__*/_jsx(Text, {
18
+ ...textProps,
19
+ style: calculatedStyle,
20
+ children: children
21
+ });
22
+ }
23
+ //# sourceMappingURL=alert-dialog-title.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Text","useAlertDialog","jsx","_jsx","AlertDialogTitle","props","children","style","textProps","styles","calculatedStyle","title"],"sourceRoot":"../../../../src","sources":["primitives/alert-dialog/alert-dialog-title.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAwD,cAAc;AACnF,SAASC,cAAc;AAAoB,SAAAC,GAAA,IAAAC,IAAA;AAO3C,OAAO,SAASC,gBAAgBA,CAACC,KAAqC,EAAE;EACtE,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EAC/C,MAAM;IAAEI;EAAO,CAAC,GAAGR,cAAc,CAAC,CAAC;EAEnC,MAAMS,eAAe,GAAG,CAACD,MAAM,EAAEE,KAAK,EAAEJ,KAAK,CAAC;EAE9C,oBACEJ,IAAA,CAACH,IAAI;IAAA,GAAKQ,SAAS;IAAED,KAAK,EAAEG,eAAgB;IAAAJ,QAAA,EACzCA;EAAQ,CACL,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { useAlertDialog } from "./context.js";
5
+ export function AlertDialogTrigger(props) {
6
+ const {
7
+ onPress
8
+ } = props;
9
+ const {
10
+ isOpen,
11
+ setIsOpen
12
+ } = useAlertDialog();
13
+ const handlePress = event => {
14
+ onPress?.(event);
15
+ setIsOpen(true);
16
+ };
17
+ return /*#__PURE__*/React.cloneElement(props.children, {
18
+ onPress: handlePress,
19
+ role: "button",
20
+ accessible: true,
21
+ accessibilityRole: "button",
22
+ accessibilityState: {
23
+ expanded: isOpen
24
+ },
25
+ ...props.children.props
26
+ });
27
+ }
28
+ //# sourceMappingURL=alert-dialog-trigger.js.map