@cerberus-design/react 0.16.0-next-270c731 → 0.16.0
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 +25 -82
- package/build/legacy/components/for.cjs +4 -3
- package/build/legacy/components/for.cjs.map +1 -1
- package/build/legacy/{components/cta-dialog/provider.cjs → context/cta-modal.cjs} +150 -187
- package/build/legacy/context/cta-modal.cjs.map +1 -0
- package/build/legacy/index.cjs +715 -771
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +25 -82
- package/build/modern/{chunk-O542MPR7.js → chunk-CMYD5KWA.js} +4 -4
- package/build/modern/{chunk-Z4342DRO.js → chunk-FMRWRVUS.js} +4 -4
- package/build/modern/chunk-IIH363FO.js +13 -0
- package/build/modern/chunk-IIH363FO.js.map +1 -0
- package/build/modern/{chunk-6ICNCCPD.js → chunk-P3SF56LT.js} +4 -4
- package/build/modern/{chunk-QEM3M4N3.js → chunk-ZDANBCM3.js} +31 -22
- package/build/modern/chunk-ZDANBCM3.js.map +1 -0
- package/build/modern/components/for.js +1 -1
- package/build/modern/components/select/index.js +2 -2
- package/build/modern/components/select/select.js +2 -2
- package/build/modern/context/cta-modal.js +19 -0
- package/build/modern/context/notification-center.js +2 -2
- package/build/modern/context/prompt-modal.js +2 -2
- package/build/modern/index.js +76 -83
- package/build/modern/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/for.tsx +18 -13
- package/src/{components/cta-dialog/provider.tsx → context/cta-modal.tsx} +68 -34
- package/src/index.ts +1 -1
- package/build/legacy/components/cta-dialog/context.cjs +0 -33
- package/build/legacy/components/cta-dialog/context.cjs.map +0 -1
- package/build/legacy/components/cta-dialog/index.cjs +0 -433
- package/build/legacy/components/cta-dialog/index.cjs.map +0 -1
- package/build/legacy/components/cta-dialog/provider.cjs.map +0 -1
- package/build/legacy/components/cta-dialog/trigger-item.cjs +0 -99
- package/build/legacy/components/cta-dialog/trigger-item.cjs.map +0 -1
- package/build/legacy/components/cta-dialog/utils.cjs +0 -47
- package/build/legacy/components/cta-dialog/utils.cjs.map +0 -1
- package/build/modern/chunk-4LSTU6WU.js +0 -8
- package/build/modern/chunk-4LSTU6WU.js.map +0 -1
- package/build/modern/chunk-DXOKSZVQ.js +0 -12
- package/build/modern/chunk-DXOKSZVQ.js.map +0 -1
- package/build/modern/chunk-IKDXADLX.js +0 -1
- package/build/modern/chunk-MVO2GNUA.js +0 -47
- package/build/modern/chunk-MVO2GNUA.js.map +0 -1
- package/build/modern/chunk-PLHYOCY3.js +0 -23
- package/build/modern/chunk-PLHYOCY3.js.map +0 -1
- package/build/modern/chunk-QEM3M4N3.js.map +0 -1
- package/build/modern/components/cta-dialog/context.js +0 -8
- package/build/modern/components/cta-dialog/context.js.map +0 -1
- package/build/modern/components/cta-dialog/index.js +0 -26
- package/build/modern/components/cta-dialog/index.js.map +0 -1
- package/build/modern/components/cta-dialog/provider.js +0 -22
- package/build/modern/components/cta-dialog/provider.js.map +0 -1
- package/build/modern/components/cta-dialog/trigger-item.js +0 -10
- package/build/modern/components/cta-dialog/trigger-item.js.map +0 -1
- package/build/modern/components/cta-dialog/utils.js +0 -7
- package/build/modern/components/cta-dialog/utils.js.map +0 -1
- package/src/components/cta-dialog/context.tsx +0 -34
- package/src/components/cta-dialog/index.ts +0 -2
- package/src/components/cta-dialog/trigger-item.tsx +0 -53
- package/src/components/cta-dialog/utils.ts +0 -57
- /package/build/modern/{chunk-O542MPR7.js.map → chunk-CMYD5KWA.js.map} +0 -0
- /package/build/modern/{chunk-Z4342DRO.js.map → chunk-FMRWRVUS.js.map} +0 -0
- /package/build/modern/{chunk-6ICNCCPD.js.map → chunk-P3SF56LT.js.map} +0 -0
- /package/build/modern/{chunk-IKDXADLX.js.map → context/cta-modal.js.map} +0 -0
|
@@ -1,433 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/components/cta-dialog/index.ts
|
|
21
|
-
var cta_dialog_exports = {};
|
|
22
|
-
__export(cta_dialog_exports, {
|
|
23
|
-
CTAModal: () => CTAModal,
|
|
24
|
-
createCTAModalActions: () => createCTAModalActions,
|
|
25
|
-
useCTAModal: () => useCTAModal
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(cta_dialog_exports);
|
|
28
|
-
|
|
29
|
-
// src/components/cta-dialog/provider.tsx
|
|
30
|
-
var import_react8 = require("react");
|
|
31
|
-
var import_jsx2 = require("@cerberus/styled-system/jsx");
|
|
32
|
-
|
|
33
|
-
// src/context/cerberus.tsx
|
|
34
|
-
var import_react = require("react");
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var CerberusContext = (0, import_react.createContext)(null);
|
|
37
|
-
function useCerberusContext() {
|
|
38
|
-
const context = (0, import_react.useContext)(CerberusContext);
|
|
39
|
-
if (!context) {
|
|
40
|
-
throw new Error("useCerberus must be used within a CerberusProvider");
|
|
41
|
-
}
|
|
42
|
-
return context;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// src/components/Show.tsx
|
|
46
|
-
var import_react2 = require("react");
|
|
47
|
-
function Show(props) {
|
|
48
|
-
const { when, children, fallback } = props;
|
|
49
|
-
const condition = (0, import_react2.useMemo)(() => when ?? false, [when]);
|
|
50
|
-
return (0, import_react2.useMemo)(() => {
|
|
51
|
-
if (condition) return children;
|
|
52
|
-
return fallback ?? null;
|
|
53
|
-
}, [condition, children, fallback]);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// src/components/for.tsx
|
|
57
|
-
function For(props) {
|
|
58
|
-
var _a;
|
|
59
|
-
if (!props.each || !props.each.length) {
|
|
60
|
-
return props.fallback || null;
|
|
61
|
-
}
|
|
62
|
-
return (_a = props.each) == null ? void 0 : _a.map(props.children);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// src/components/Avatar.tsx
|
|
66
|
-
var import_css = require("@cerberus/styled-system/css");
|
|
67
|
-
var import_patterns = require("@cerberus/styled-system/patterns");
|
|
68
|
-
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
69
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
70
|
-
function Avatar(props) {
|
|
71
|
-
const {
|
|
72
|
-
ariaLabel,
|
|
73
|
-
as,
|
|
74
|
-
gradient,
|
|
75
|
-
size,
|
|
76
|
-
src,
|
|
77
|
-
width,
|
|
78
|
-
height,
|
|
79
|
-
icon,
|
|
80
|
-
...nativeProps
|
|
81
|
-
} = props;
|
|
82
|
-
const { icons } = useCerberusContext();
|
|
83
|
-
const { avatar: AvatarIcon } = icons;
|
|
84
|
-
const initials = (ariaLabel || "").split(" ").map((word) => word[0]).join("").slice(0, 2);
|
|
85
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
86
|
-
"div",
|
|
87
|
-
{
|
|
88
|
-
...nativeProps,
|
|
89
|
-
className: (0, import_css.cx)(
|
|
90
|
-
nativeProps.className,
|
|
91
|
-
(0, import_recipes.avatar)({ gradient, size }),
|
|
92
|
-
(0, import_patterns.circle)()
|
|
93
|
-
),
|
|
94
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
95
|
-
Show,
|
|
96
|
-
{
|
|
97
|
-
when: Boolean(src) || Boolean(as),
|
|
98
|
-
fallback: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
99
|
-
Show,
|
|
100
|
-
{
|
|
101
|
-
when: Boolean(initials),
|
|
102
|
-
fallback: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
103
|
-
Show,
|
|
104
|
-
{
|
|
105
|
-
when: Boolean(icon),
|
|
106
|
-
fallback: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
107
|
-
AvatarIcon,
|
|
108
|
-
{
|
|
109
|
-
size: iconSizeMap[size]
|
|
110
|
-
}
|
|
111
|
-
),
|
|
112
|
-
children: icon
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
children: initials
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
119
|
-
Show,
|
|
120
|
-
{
|
|
121
|
-
when: Boolean(as),
|
|
122
|
-
fallback: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
123
|
-
"img",
|
|
124
|
-
{
|
|
125
|
-
alt: props.ariaLabel,
|
|
126
|
-
className: (0, import_css.css)({
|
|
127
|
-
h: "full",
|
|
128
|
-
objectFit: "cover",
|
|
129
|
-
w: "full"
|
|
130
|
-
}),
|
|
131
|
-
decoding: "async",
|
|
132
|
-
loading: "lazy",
|
|
133
|
-
src,
|
|
134
|
-
height,
|
|
135
|
-
width
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
children: as
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
var iconSizeMap = {
|
|
147
|
-
xs: 16,
|
|
148
|
-
sm: 16,
|
|
149
|
-
md: 20,
|
|
150
|
-
lg: 34,
|
|
151
|
-
xl: 32,
|
|
152
|
-
"2xl": 32,
|
|
153
|
-
"3xl": 32,
|
|
154
|
-
"4xl": 32
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
// src/components/Dialog.tsx
|
|
158
|
-
var import_react4 = require("@ark-ui/react");
|
|
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
|
|
166
|
-
var import_css2 = require("@cerberus/styled-system/css");
|
|
167
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
168
|
-
function DialogProvider(props) {
|
|
169
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.Dialog.Root, { ...props });
|
|
170
|
-
}
|
|
171
|
-
function Dialog(props) {
|
|
172
|
-
const { size, ...contentProps } = props;
|
|
173
|
-
const styles = (0, import_recipes2.dialog)({ size });
|
|
174
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Portal, { children: [
|
|
175
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DialogBackdrop, { className: styles.backdrop }),
|
|
176
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DialogPositioner, { className: styles.positioner, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DialogContent, { className: styles.content, ...contentProps }) })
|
|
177
|
-
] });
|
|
178
|
-
}
|
|
179
|
-
function DialogHeading(props) {
|
|
180
|
-
const styles = (0, import_recipes2.dialog)();
|
|
181
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.Dialog.Title, { ...props, className: (0, import_css2.cx)(props.className, styles.title) });
|
|
182
|
-
}
|
|
183
|
-
function DialogDescription(props) {
|
|
184
|
-
const styles = (0, import_recipes2.dialog)();
|
|
185
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
186
|
-
import_react4.Dialog.Description,
|
|
187
|
-
{
|
|
188
|
-
...props,
|
|
189
|
-
className: (0, import_css2.cx)(props.className, styles.description)
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
var DialogTrigger = import_react4.Dialog.Trigger;
|
|
194
|
-
var DialogCloseTrigger = import_react4.Dialog.CloseTrigger;
|
|
195
|
-
var DialogBackdrop = import_react4.Dialog.Backdrop;
|
|
196
|
-
var DialogPositioner = import_react4.Dialog.Positioner;
|
|
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");
|
|
203
|
-
|
|
204
|
-
// src/components/IconButton.tsx
|
|
205
|
-
var import_css3 = require("@cerberus/styled-system/css");
|
|
206
|
-
var import_recipes3 = require("@cerberus/styled-system/recipes");
|
|
207
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
208
|
-
function IconButton(props) {
|
|
209
|
-
const { ariaLabel, palette, usage, size, ...nativeProps } = props;
|
|
210
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
211
|
-
"button",
|
|
212
|
-
{
|
|
213
|
-
...nativeProps,
|
|
214
|
-
"aria-label": ariaLabel ?? "Icon Button",
|
|
215
|
-
className: (0, import_css3.cx)(
|
|
216
|
-
nativeProps.className,
|
|
217
|
-
(0, import_recipes3.iconButton)({
|
|
218
|
-
palette,
|
|
219
|
-
usage,
|
|
220
|
-
size
|
|
221
|
-
})
|
|
222
|
-
)
|
|
223
|
-
}
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// src/components/Dialog.client.tsx
|
|
228
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
229
|
-
function DialogCloseIconTrigger(props) {
|
|
230
|
-
const { icons } = useCerberusContext();
|
|
231
|
-
const { close: CloseIcon } = icons;
|
|
232
|
-
const styles = (0, import_recipes4.dialog)();
|
|
233
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
234
|
-
import_react5.Dialog.CloseTrigger,
|
|
235
|
-
{
|
|
236
|
-
...props,
|
|
237
|
-
className: (0, import_css4.cx)(props.className, styles.closeTrigger),
|
|
238
|
-
asChild: true,
|
|
239
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
240
|
-
IconButton,
|
|
241
|
-
{
|
|
242
|
-
ariaLabel: "Close dialog",
|
|
243
|
-
palette: "action",
|
|
244
|
-
size: "lg",
|
|
245
|
-
usage: "ghost",
|
|
246
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CloseIcon, {})
|
|
247
|
-
}
|
|
248
|
-
)
|
|
249
|
-
}
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// src/components/cta-dialog/context.tsx
|
|
254
|
-
var import_react6 = require("react");
|
|
255
|
-
var CTAModalContext = (0, import_react6.createContext)(null);
|
|
256
|
-
|
|
257
|
-
// src/components/cta-dialog/trigger-item.tsx
|
|
258
|
-
var import_css6 = require("@cerberus/styled-system/css");
|
|
259
|
-
|
|
260
|
-
// src/components/button/button.tsx
|
|
261
|
-
var import_react7 = require("react");
|
|
262
|
-
var import_css5 = require("@cerberus/styled-system/css");
|
|
263
|
-
var import_recipes5 = require("@cerberus/styled-system/recipes");
|
|
264
|
-
var import_jsx = require("@cerberus/styled-system/jsx");
|
|
265
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
266
|
-
var ButtonContext = (0, import_react7.createContext)({
|
|
267
|
-
pending: false
|
|
268
|
-
});
|
|
269
|
-
function Button(props) {
|
|
270
|
-
const { palette, usage, shape, size, pending = false, ...nativeProps } = props;
|
|
271
|
-
const value = (0, import_react7.useMemo)(() => ({ pending }), [pending]);
|
|
272
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
273
|
-
"button",
|
|
274
|
-
{
|
|
275
|
-
...nativeProps,
|
|
276
|
-
disabled: pending || nativeProps.disabled,
|
|
277
|
-
className: (0, import_css5.cx)(
|
|
278
|
-
nativeProps.className,
|
|
279
|
-
(0, import_recipes5.button)({
|
|
280
|
-
palette,
|
|
281
|
-
usage,
|
|
282
|
-
shape,
|
|
283
|
-
size
|
|
284
|
-
})
|
|
285
|
-
)
|
|
286
|
-
}
|
|
287
|
-
) });
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
// src/components/cta-dialog/trigger-item.tsx
|
|
291
|
-
var import_factory = require("@ark-ui/react/factory");
|
|
292
|
-
var import_recipes6 = require("@cerberus/styled-system/recipes");
|
|
293
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
294
|
-
function TriggerItem(props) {
|
|
295
|
-
const { asChild, children, ...buttonProps } = props;
|
|
296
|
-
if (asChild) {
|
|
297
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
298
|
-
import_factory.ark.div,
|
|
299
|
-
{
|
|
300
|
-
className: (0, import_css6.cx)(
|
|
301
|
-
(0, import_recipes6.button)({
|
|
302
|
-
shape: "rounded",
|
|
303
|
-
usage: "ghost"
|
|
304
|
-
}),
|
|
305
|
-
(0, import_css6.css)({
|
|
306
|
-
w: "1/2"
|
|
307
|
-
})
|
|
308
|
-
),
|
|
309
|
-
asChild: true,
|
|
310
|
-
children
|
|
311
|
-
}
|
|
312
|
-
);
|
|
313
|
-
}
|
|
314
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
315
|
-
Button,
|
|
316
|
-
{
|
|
317
|
-
...buttonProps,
|
|
318
|
-
className: (0, import_css6.css)({
|
|
319
|
-
w: "1/2"
|
|
320
|
-
}),
|
|
321
|
-
shape: "rounded",
|
|
322
|
-
usage: "outlined",
|
|
323
|
-
children
|
|
324
|
-
}
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
// src/components/cta-dialog/provider.tsx
|
|
329
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
330
|
-
function CTAModal(props) {
|
|
331
|
-
const [open, setOpen] = (0, import_react8.useState)(false);
|
|
332
|
-
const [content, setContent] = (0, import_react8.useState)(null);
|
|
333
|
-
const confirmIcon = content == null ? void 0 : content.icon;
|
|
334
|
-
const { icons } = useCerberusContext();
|
|
335
|
-
const { confirmModal: FallbackIcon } = icons;
|
|
336
|
-
const handleShow = (0, import_react8.useCallback)(
|
|
337
|
-
(options) => {
|
|
338
|
-
setContent({ ...options });
|
|
339
|
-
setOpen(true);
|
|
340
|
-
},
|
|
341
|
-
[setOpen]
|
|
342
|
-
);
|
|
343
|
-
const handleActionClick = (0, import_react8.useCallback)(
|
|
344
|
-
(event) => {
|
|
345
|
-
var _a;
|
|
346
|
-
const index = Number(event.currentTarget.getAttribute("data-index"));
|
|
347
|
-
const contentActions = content == null ? void 0 : content.actions;
|
|
348
|
-
const action = contentActions._actions[index];
|
|
349
|
-
(_a = action == null ? void 0 : action.handleClick) == null ? void 0 : _a.call(action, event);
|
|
350
|
-
setOpen(false);
|
|
351
|
-
},
|
|
352
|
-
[content, setOpen]
|
|
353
|
-
);
|
|
354
|
-
const value = (0, import_react8.useMemo)(
|
|
355
|
-
() => ({
|
|
356
|
-
show: handleShow
|
|
357
|
-
}),
|
|
358
|
-
[handleShow]
|
|
359
|
-
);
|
|
360
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(CTAModalContext.Provider, { value, children: [
|
|
361
|
-
props.children,
|
|
362
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Dialog, { size: "sm", children: [
|
|
363
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogCloseIconTrigger, {}),
|
|
364
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx2.VStack, { gap: "xl", w: "full", children: [
|
|
365
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx2.VStack, { alignItems: "flex-start", gap: "md", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx2.VStack, { gap: "lg", w: "full", children: [
|
|
366
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
367
|
-
Avatar,
|
|
368
|
-
{
|
|
369
|
-
ariaLabel: "",
|
|
370
|
-
gradient: "charon-light",
|
|
371
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
372
|
-
Show,
|
|
373
|
-
{
|
|
374
|
-
when: Boolean(confirmIcon),
|
|
375
|
-
fallback: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FallbackIcon, { size: 24 }),
|
|
376
|
-
children: confirmIcon
|
|
377
|
-
}
|
|
378
|
-
),
|
|
379
|
-
src: ""
|
|
380
|
-
}
|
|
381
|
-
),
|
|
382
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogHeading, { children: content == null ? void 0 : content.heading }),
|
|
383
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogDescription, { children: content == null ? void 0 : content.description })
|
|
384
|
-
] }) }),
|
|
385
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx2.HStack, { gap: "md", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(For, { each: content == null ? void 0 : content.actions._actions, children: (action, index) => {
|
|
386
|
-
var _a;
|
|
387
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
388
|
-
Show,
|
|
389
|
-
{
|
|
390
|
-
when: ((_a = content == null ? void 0 : content.actions) == null ? void 0 : _a.type) === "btnAction",
|
|
391
|
-
fallback: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TriggerItem, { asChild: true, children: action }),
|
|
392
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TriggerItem, { "data-index": index, onClick: handleActionClick, children: action == null ? void 0 : action.text })
|
|
393
|
-
},
|
|
394
|
-
index
|
|
395
|
-
);
|
|
396
|
-
} }) })
|
|
397
|
-
] })
|
|
398
|
-
] }) })
|
|
399
|
-
] });
|
|
400
|
-
}
|
|
401
|
-
function useCTAModal() {
|
|
402
|
-
const context = (0, import_react8.useContext)(CTAModalContext);
|
|
403
|
-
if (context === null) {
|
|
404
|
-
throw new Error("useCTAModal must be used within a CTAModal Provider");
|
|
405
|
-
}
|
|
406
|
-
return context;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
// src/components/cta-dialog/utils.ts
|
|
410
|
-
function createCTAModalActions(providedActions) {
|
|
411
|
-
if (providedActions.length !== 2) {
|
|
412
|
-
throw new Error("CTAModal must include 2 actions");
|
|
413
|
-
}
|
|
414
|
-
if (providedActions.every(
|
|
415
|
-
(action) => action == null ? void 0 : action.handleClick
|
|
416
|
-
)) {
|
|
417
|
-
return {
|
|
418
|
-
type: "btnAction",
|
|
419
|
-
_actions: providedActions
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
return {
|
|
423
|
-
type: "reactNode",
|
|
424
|
-
_actions: providedActions
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
428
|
-
0 && (module.exports = {
|
|
429
|
-
CTAModal,
|
|
430
|
-
createCTAModalActions,
|
|
431
|
-
useCTAModal
|
|
432
|
-
});
|
|
433
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/cta-dialog/index.ts","../../../../src/components/cta-dialog/provider.tsx","../../../../src/context/cerberus.tsx","../../../../src/components/Show.tsx","../../../../src/components/for.tsx","../../../../src/components/Avatar.tsx","../../../../src/components/Dialog.tsx","../../../../src/components/Portal.tsx","../../../../src/components/Dialog.client.tsx","../../../../src/components/IconButton.tsx","../../../../src/components/cta-dialog/context.tsx","../../../../src/components/cta-dialog/trigger-item.tsx","../../../../src/components/button/button.tsx","../../../../src/components/cta-dialog/utils.ts"],"sourcesContent":["export * from './provider'\nexport * from './utils'\n","'use client'\n\nimport {\n useCallback,\n useContext,\n useMemo,\n useState,\n type MouseEvent,\n type PropsWithChildren,\n type ReactNode,\n} from 'react'\nimport { HStack, VStack } from '@cerberus/styled-system/jsx'\nimport { useCerberusContext } from '../../context/cerberus'\nimport { Show } from '../Show'\nimport { For } from '../for'\nimport { Avatar } from '../Avatar'\nimport {\n Dialog,\n DialogDescription,\n DialogHeading,\n DialogProvider,\n} from '../Dialog'\nimport { DialogCloseIconTrigger } from '../Dialog.client'\nimport type { CTAButtonAction, CTAModalActionReturn } from './utils'\nimport {\n CTAModalContext,\n type CTAModalValue,\n type ShowCTAModalOptions,\n} from './context'\nimport { TriggerItem } from './trigger-item'\n\n/**\n * This module provides the provider and hook for the cta modal.\n * @module 'react/cta-modal/provider'\n */\n\n/**\n * Provides a CTA modal to the app.\n * @see https://cerberus.digitalu.design/react/cta-modal\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <CTAModal>\n * <SomeFeatureSection />\n * </CTAModal>\n *\n * // Use the hook to show the cta modal.\n * const cta = useCTAModal()\n *\n * const handleClick = useCallback(async () => {\n * const userConsent = await cta.show({\n * heading: 'Create or copy a Cohort',\n * description:\n * 'Create a new cohort or copy and existing one.',\n * icon: <Copy size={24} />,\n * actions: [\n * {\n * text: 'Create Cohort',\n * onClick: () => {},\n * {\n * text: 'Copy Cohort',\n * onClick: () => {}\n * }\n * })\n * setConsent(userConsent)\n * }, [cta])\n * ```\n */\nexport function CTAModal(props: PropsWithChildren<object>) {\n const [open, setOpen] = useState<boolean>(false)\n const [content, setContent] = useState<ShowCTAModalOptions | null>(null)\n const confirmIcon = content?.icon\n\n const { icons } = useCerberusContext()\n const { confirmModal: FallbackIcon } = icons\n\n const handleShow = useCallback(\n (options: ShowCTAModalOptions) => {\n setContent({ ...options })\n setOpen(true)\n },\n [setOpen],\n )\n\n const handleActionClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n const index = Number(event.currentTarget.getAttribute('data-index'))\n const contentActions = content?.actions as CTAModalActionReturn\n const action = contentActions._actions[index] as CTAButtonAction\n action?.handleClick?.(event)\n setOpen(false)\n },\n [content, setOpen],\n )\n\n const value = useMemo(\n () => ({\n show: handleShow,\n }),\n [handleShow],\n )\n\n return (\n <CTAModalContext.Provider value={value}>\n {props.children}\n\n <DialogProvider open={open} onOpenChange={(e) => setOpen(e.open)}>\n <Dialog size=\"sm\">\n <DialogCloseIconTrigger />\n\n <VStack gap=\"xl\" w=\"full\">\n <VStack alignItems=\"flex-start\" gap=\"md\" w=\"full\">\n <VStack gap=\"lg\" w=\"full\">\n <Avatar\n ariaLabel=\"\"\n gradient=\"charon-light\"\n icon={\n <Show\n when={Boolean(confirmIcon)}\n fallback={<FallbackIcon size={24} />}\n >\n {confirmIcon}\n </Show>\n }\n src=\"\"\n />\n <DialogHeading>{content?.heading}</DialogHeading>\n <DialogDescription>{content?.description}</DialogDescription>\n </VStack>\n </VStack>\n\n <HStack gap=\"md\" w=\"full\">\n <For each={content?.actions._actions}>\n {(action, index) => (\n <Show\n key={index}\n when={content?.actions?.type === 'btnAction'}\n fallback={\n <TriggerItem asChild>{action as ReactNode}</TriggerItem>\n }\n >\n <TriggerItem data-index={index} onClick={handleActionClick}>\n {(action as CTAButtonAction)?.text}\n </TriggerItem>\n </Show>\n )}\n </For>\n </HStack>\n </VStack>\n </Dialog>\n </DialogProvider>\n </CTAModalContext.Provider>\n )\n}\n\nexport function useCTAModal(): CTAModalValue {\n const context = useContext(CTAModalContext)\n if (context === null) {\n throw new Error('useCTAModal must be used within a CTAModal Provider')\n }\n return context\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\n/**\n * This module contains the Show component.\n * @module\n */\n\nexport interface ShowProps {\n /**\n * The condition to render memoized children or the fallback content.\n */\n when: boolean | null | undefined\n /**\n * The children to render when the condition is false.\n */\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render a memoized version of the children or optional fallback\n * content.\n * @see https://cerberus.digitalu.design/react/show\n * @example\n * ```tsx\n * <Show when={isLoggedIn} fallback={<Navigate to=\"/login\" />}>\n * <Dashboard />\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n","import type { ReactNode, JSX } from 'react'\n\nexport interface ForProps<T extends readonly unknown[], U extends JSX.Element> {\n /**\n * The array to iterate over.\n */\n each: T | undefined | null | false\n /**\n * The fallback to render when the array is empty.\n */\n fallback?: JSX.Element\n /**\n * The children to render for each item in the array.\n */\n children: (item: T[number], index: number) => U\n}\n\n/**\n * The For component is used to iterate over an array and render a list of\n * components or display a fallback when the array is empty.\n * Inspired by the `<For>` component from SolidJS.\n *\n * @example\n * ```tsx\n * <For each={['a', 'b', 'c']}>\n * {(item, index) => <div key={index}>{item}</div>}\n * </For>\n * ```\n */\nexport function For<T extends readonly unknown[], U extends JSX.Element>(\n props: ForProps<T, U>,\n) {\n if (!props.each || !props.each.length) {\n return props.fallback || null\n }\n\n return props.each?.map(props.children) as ReactNode\n}\n","'use client'\n\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { circle } from '@cerberus/styled-system/patterns'\nimport {\n avatar,\n type AvatarVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport type { HtmlHTMLAttributes, ReactNode } from 'react'\nimport { Show } from './Show'\nimport { useCerberusContext } from '../context/cerberus'\n\n/**\n * This module contains the Avatar component.\n * @module\n */\n\nexport type SharedAvatarProps = {\n /**\n * An optional icon to show when no src or ariaLabel is provided.\n */\n icon?: ReactNode\n /**\n * The size of the avatar.\n */\n width?: number\n /**\n * The size of the avatar.\n */\n height?: number\n}\nexport type AvatarImageProps = HtmlHTMLAttributes<HTMLImageElement> &\n SharedAvatarProps & {\n /**\n * The aria-label for the avatar needed for accessibility.\n */\n ariaLabel: string\n /**\n * An optional element to replace the image. Recommended for Next.js Image component.\n */\n as?: never\n /**\n * The source of the image.\n */\n src: string\n }\nexport type AvatarAsProps = SharedAvatarProps & {\n /**\n * An optional element to replace the image. Recommended for Next.js Image component.\n */\n as: ReactNode\n /**\n * The aria-label for the avatar needed for accessibility.\n */\n ariaLabel?: never\n /**\n * The source of the image.\n */\n src?: never\n}\n\nexport type AvatarProps = (HtmlHTMLAttributes<HTMLDivElement> &\n AvatarVariantProps) &\n (AvatarImageProps | AvatarAsProps)\n\n/**\n * The Avatar component is used to represent a user or entity. It will show an image if src provided, otherwise it will show the ariaLabel of the ariaLabel. If the ariaLabel is empty, it will show a `defineIcons().avatar` icon.\n * @see https://cerberus.digitalu.design/react/avatar\n * @example\n * ```tsx\n * <Avatar\n * ariaLabel=\"Protector Cerberus\"\n * src=\"https://cerberus.digitalu.design/logo.svg\"\n * />\n * ```\n */\nexport function Avatar(props: AvatarProps) {\n const {\n ariaLabel,\n as,\n gradient,\n size,\n src,\n width,\n height,\n icon,\n ...nativeProps\n } = props\n const { icons } = useCerberusContext()\n const { avatar: AvatarIcon } = icons\n const initials = (ariaLabel || '')\n .split(' ')\n .map((word) => word[0])\n .join('')\n .slice(0, 2)\n\n return (\n <div\n {...nativeProps}\n className={cx(\n nativeProps.className,\n avatar({ gradient, size }),\n circle(),\n )}\n >\n <Show\n when={Boolean(src) || Boolean(as)}\n fallback={\n <Show\n when={Boolean(initials)}\n fallback={\n <Show\n when={Boolean(icon)}\n fallback={\n <AvatarIcon\n size={iconSizeMap[size as keyof typeof iconSizeMap]}\n />\n }\n >\n {icon}\n </Show>\n }\n >\n {initials}\n </Show>\n }\n >\n <Show\n when={Boolean(as)}\n fallback={\n <img\n alt={props.ariaLabel}\n className={css({\n h: 'full',\n objectFit: 'cover',\n w: 'full',\n })}\n decoding=\"async\"\n loading=\"lazy\"\n src={src}\n height={height}\n width={width}\n />\n }\n >\n {as}\n </Show>\n </Show>\n </div>\n )\n}\n\nconst iconSizeMap = {\n xs: 16,\n sm: 16,\n md: 20,\n lg: 34,\n xl: 32,\n '2xl': 32,\n '3xl': 32,\n '4xl': 32,\n}\n","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","import {\n Portal as ArkPortal,\n type PortalProps as ArkPortalProps,\n} from '@ark-ui/react'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport type PortalProps = ArkPortalProps\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @see https://cerberus.digitalu.design/react/portal\n * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)\n * @example\n * ```tsx\n * 'use client'\n *\n * import { Portal } from '@cerberus/react'\n *\n * function SomeFeatureWithinSSRPage() {\n * return (\n * <Portal>\n * <div>Portal Content outside of the React VDom tree</div>\n * </Portal>\n * )\n * }\n */\nexport const Portal = ArkPortal\n","'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","import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n iconButton,\n type IconButtonVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonRawProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The aria-label attribute for the icon button.\n */\n ariaLabel: string\n}\nexport type IconButtonProps = IconButtonRawProps & IconButtonVariantProps\n\n/**\n * A component that allows the user to perform actions using an icon\n * @see https://cerberus.digitalu.design/react/icon-button\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n","'use client'\n\nimport { createContext, type ReactNode } from 'react'\nimport type { CTAModalActionReturn } from './utils'\n\n/**\n * This module provides the context for the cta modal.\n * @module\n */\n\nexport interface ShowCTAModalOptions {\n /**\n * The heading of the cta modal.\n */\n heading: string\n /**\n * The description of the cta modal.\n */\n description?: string\n /**\n * The icon used for the modal Avatar.\n */\n icon?: ReactNode\n /**\n * The actions for the cta modal. Requires 2 actions.\n */\n actions: CTAModalActionReturn\n}\n\nexport interface CTAModalValue {\n show: (options: ShowCTAModalOptions) => void\n}\n\nexport const CTAModalContext = createContext<CTAModalValue | null>(null)\n","import { css, cx } from '@cerberus/styled-system/css'\nimport { Button, type ButtonProps } from '../button/button'\nimport { ark } from '@ark-ui/react/factory'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module provides the trigger item for the cta modal.\n * @module 'react/cta-modal/trigger-item'\n */\n\nexport interface TriggerItemProps extends ButtonProps {\n asChild?: boolean\n}\n\n/**\n * Trigger item for the cta modal which renders content based on the actions.\n * type.\n */\nexport function TriggerItem(props: TriggerItemProps) {\n const { asChild, children, ...buttonProps } = props\n\n if (asChild) {\n return (\n <ark.div\n className={cx(\n button({\n shape: 'rounded',\n usage: 'ghost',\n }),\n css({\n w: '1/2',\n }),\n )}\n asChild\n >\n {children}\n </ark.div>\n )\n }\n\n return (\n <Button\n {...buttonProps}\n className={css({\n w: '1/2',\n })}\n shape=\"rounded\"\n usage=\"outlined\"\n >\n {children}\n </Button>\n )\n}\n","'use client'\n\nimport {\n type ButtonHTMLAttributes,\n type PropsWithChildren,\n createContext,\n useContext,\n useMemo,\n} from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n button,\n type ButtonVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport { Box } from '@cerberus/styled-system/jsx'\nimport { Show } from '../Show'\nimport { Spinner } from '../Spinner'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\ninterface ButtonContextValue {\n pending: boolean\n}\n\nconst ButtonContext = createContext<ButtonContextValue>({\n pending: false,\n})\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n ButtonVariantProps & {\n pending?: boolean\n }\n\n/**\n * A component that allows the user to perform actions\n * @see https://cerberus.digitalu.design/react/button\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, size, pending = false, ...nativeProps } = props\n const value = useMemo(() => ({ pending }), [pending])\n\n return (\n <ButtonContext.Provider value={value}>\n <button\n {...nativeProps}\n disabled={pending || nativeProps.disabled}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n size,\n }),\n )}\n />\n </ButtonContext.Provider>\n )\n}\n\n/**\n * An icon to display in a button that utilizes the pending state to display\n * a loading spinner.\n */\nexport function ButtonIcon(props: PropsWithChildren<object>) {\n const { pending } = useContext(ButtonContext)\n return (\n <Show when={pending} fallback={<>{props.children}</>}>\n <Box w=\"4\">\n <Spinner />\n </Box>\n </Show>\n )\n}\n","import type { MouseEventHandler, ReactNode } from 'react'\n\n/**\n * This module provide utility functions for the cta modal.\n * @module 'react/cta-modal/utils'\n */\n\nexport type CTAButtonAction = {\n /**\n * The text of the button.\n */\n text: string\n /**\n * The onClick handler for the button.\n */\n handleClick: MouseEventHandler<HTMLButtonElement>\n}\n\nexport type CTAModalAction = (CTAButtonAction | ReactNode)[]\n\nexport interface CTAModalActionReturn {\n /**\n * The type of the action content.\n */\n type: 'reactNode' | 'btnAction'\n /**\n * The actions for the cta modal. Max of 2 actions.\n */\n _actions: CTAModalAction\n}\n\n/**\n * Creates the action data to pass to the cta modal `show` method.\n */\nexport function createCTAModalActions(\n providedActions: CTAModalAction,\n): CTAModalActionReturn {\n if (providedActions.length !== 2) {\n throw new Error('CTAModal must include 2 actions')\n }\n\n if (\n providedActions.every(\n (action) => (action as unknown as CTAButtonAction)?.handleClick,\n )\n ) {\n return {\n type: 'btnAction',\n _actions: providedActions as CTAButtonAction[],\n }\n }\n\n return {\n type: 'reactNode',\n _actions: providedActions as ReactNode[],\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,IAAAA,gBAQO;AACP,IAAAC,c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AAiC;AAAA,EACnD;AAEA,MACE,gBAAgB;AAAA,IACd,CAAC,WAAY,iCAAuC;AAAA,EACtD,GACA;AACA,WAAO;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,EACF;AAEA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AACF;","names":["import_react","import_jsx","import_react","import_jsx_runtime","import_react","import_recipes","import_react","ArkPortal","import_css","import_jsx_runtime","ArkDialog","import_react","import_recipes","import_css","import_css","import_recipes","import_jsx_runtime","import_jsx_runtime","ArkDialog","import_react","import_css","import_react","import_css","import_recipes","import_jsx_runtime","import_recipes","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/cta-dialog/provider.tsx","../../../../src/context/cerberus.tsx","../../../../src/components/Show.tsx","../../../../src/components/for.tsx","../../../../src/components/Avatar.tsx","../../../../src/components/Dialog.tsx","../../../../src/components/Portal.tsx","../../../../src/components/Dialog.client.tsx","../../../../src/components/IconButton.tsx","../../../../src/components/cta-dialog/context.tsx","../../../../src/components/cta-dialog/trigger-item.tsx","../../../../src/components/button/button.tsx"],"sourcesContent":["'use client'\n\nimport {\n useCallback,\n useContext,\n useMemo,\n useState,\n type MouseEvent,\n type PropsWithChildren,\n type ReactNode,\n} from 'react'\nimport { HStack, VStack } from '@cerberus/styled-system/jsx'\nimport { useCerberusContext } from '../../context/cerberus'\nimport { Show } from '../Show'\nimport { For } from '../for'\nimport { Avatar } from '../Avatar'\nimport {\n Dialog,\n DialogDescription,\n DialogHeading,\n DialogProvider,\n} from '../Dialog'\nimport { DialogCloseIconTrigger } from '../Dialog.client'\nimport type { CTAButtonAction, CTAModalActionReturn } from './utils'\nimport {\n CTAModalContext,\n type CTAModalValue,\n type ShowCTAModalOptions,\n} from './context'\nimport { TriggerItem } from './trigger-item'\n\n/**\n * This module provides the provider and hook for the cta modal.\n * @module 'react/cta-modal/provider'\n */\n\n/**\n * Provides a CTA modal to the app.\n * @see https://cerberus.digitalu.design/react/cta-modal\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <CTAModal>\n * <SomeFeatureSection />\n * </CTAModal>\n *\n * // Use the hook to show the cta modal.\n * const cta = useCTAModal()\n *\n * const handleClick = useCallback(async () => {\n * const userConsent = await cta.show({\n * heading: 'Create or copy a Cohort',\n * description:\n * 'Create a new cohort or copy and existing one.',\n * icon: <Copy size={24} />,\n * actions: [\n * {\n * text: 'Create Cohort',\n * onClick: () => {},\n * {\n * text: 'Copy Cohort',\n * onClick: () => {}\n * }\n * })\n * setConsent(userConsent)\n * }, [cta])\n * ```\n */\nexport function CTAModal(props: PropsWithChildren<object>) {\n const [open, setOpen] = useState<boolean>(false)\n const [content, setContent] = useState<ShowCTAModalOptions | null>(null)\n const confirmIcon = content?.icon\n\n const { icons } = useCerberusContext()\n const { confirmModal: FallbackIcon } = icons\n\n const handleShow = useCallback(\n (options: ShowCTAModalOptions) => {\n setContent({ ...options })\n setOpen(true)\n },\n [setOpen],\n )\n\n const handleActionClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n const index = Number(event.currentTarget.getAttribute('data-index'))\n const contentActions = content?.actions as CTAModalActionReturn\n const action = contentActions._actions[index] as CTAButtonAction\n action?.handleClick?.(event)\n setOpen(false)\n },\n [content, setOpen],\n )\n\n const value = useMemo(\n () => ({\n show: handleShow,\n }),\n [handleShow],\n )\n\n return (\n <CTAModalContext.Provider value={value}>\n {props.children}\n\n <DialogProvider open={open} onOpenChange={(e) => setOpen(e.open)}>\n <Dialog size=\"sm\">\n <DialogCloseIconTrigger />\n\n <VStack gap=\"xl\" w=\"full\">\n <VStack alignItems=\"flex-start\" gap=\"md\" w=\"full\">\n <VStack gap=\"lg\" w=\"full\">\n <Avatar\n ariaLabel=\"\"\n gradient=\"charon-light\"\n icon={\n <Show\n when={Boolean(confirmIcon)}\n fallback={<FallbackIcon size={24} />}\n >\n {confirmIcon}\n </Show>\n }\n src=\"\"\n />\n <DialogHeading>{content?.heading}</DialogHeading>\n <DialogDescription>{content?.description}</DialogDescription>\n </VStack>\n </VStack>\n\n <HStack gap=\"md\" w=\"full\">\n <For each={content?.actions._actions}>\n {(action, index) => (\n <Show\n key={index}\n when={content?.actions?.type === 'btnAction'}\n fallback={\n <TriggerItem asChild>{action as ReactNode}</TriggerItem>\n }\n >\n <TriggerItem data-index={index} onClick={handleActionClick}>\n {(action as CTAButtonAction)?.text}\n </TriggerItem>\n </Show>\n )}\n </For>\n </HStack>\n </VStack>\n </Dialog>\n </DialogProvider>\n </CTAModalContext.Provider>\n )\n}\n\nexport function useCTAModal(): CTAModalValue {\n const context = useContext(CTAModalContext)\n if (context === null) {\n throw new Error('useCTAModal must be used within a CTAModal Provider')\n }\n return context\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\n/**\n * This module contains the Show component.\n * @module\n */\n\nexport interface ShowProps {\n /**\n * The condition to render memoized children or the fallback content.\n */\n when: boolean | null | undefined\n /**\n * The children to render when the condition is false.\n */\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render a memoized version of the children or optional fallback\n * content.\n * @see https://cerberus.digitalu.design/react/show\n * @example\n * ```tsx\n * <Show when={isLoggedIn} fallback={<Navigate to=\"/login\" />}>\n * <Dashboard />\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n","import type { ReactNode, JSX } from 'react'\n\nexport interface ForProps<T extends readonly unknown[], U extends JSX.Element> {\n /**\n * The array to iterate over.\n */\n each: T | undefined | null | false\n /**\n * The fallback to render when the array is empty.\n */\n fallback?: JSX.Element\n /**\n * The children to render for each item in the array.\n */\n children: (item: T[number], index: number) => U\n}\n\n/**\n * The For component is used to iterate over an array and render a list of\n * components or display a fallback when the array is empty.\n * Inspired by the `<For>` component from SolidJS.\n *\n * @example\n * ```tsx\n * <For each={['a', 'b', 'c']}>\n * {(item, index) => <div key={index}>{item}</div>}\n * </For>\n * ```\n */\nexport function For<T extends readonly unknown[], U extends JSX.Element>(\n props: ForProps<T, U>,\n) {\n if (!props.each || !props.each.length) {\n return props.fallback || null\n }\n\n return props.each?.map(props.children) as ReactNode\n}\n","'use client'\n\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { circle } from '@cerberus/styled-system/patterns'\nimport {\n avatar,\n type AvatarVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport type { HtmlHTMLAttributes, ReactNode } from 'react'\nimport { Show } from './Show'\nimport { useCerberusContext } from '../context/cerberus'\n\n/**\n * This module contains the Avatar component.\n * @module\n */\n\nexport type SharedAvatarProps = {\n /**\n * An optional icon to show when no src or ariaLabel is provided.\n */\n icon?: ReactNode\n /**\n * The size of the avatar.\n */\n width?: number\n /**\n * The size of the avatar.\n */\n height?: number\n}\nexport type AvatarImageProps = HtmlHTMLAttributes<HTMLImageElement> &\n SharedAvatarProps & {\n /**\n * The aria-label for the avatar needed for accessibility.\n */\n ariaLabel: string\n /**\n * An optional element to replace the image. Recommended for Next.js Image component.\n */\n as?: never\n /**\n * The source of the image.\n */\n src: string\n }\nexport type AvatarAsProps = SharedAvatarProps & {\n /**\n * An optional element to replace the image. Recommended for Next.js Image component.\n */\n as: ReactNode\n /**\n * The aria-label for the avatar needed for accessibility.\n */\n ariaLabel?: never\n /**\n * The source of the image.\n */\n src?: never\n}\n\nexport type AvatarProps = (HtmlHTMLAttributes<HTMLDivElement> &\n AvatarVariantProps) &\n (AvatarImageProps | AvatarAsProps)\n\n/**\n * The Avatar component is used to represent a user or entity. It will show an image if src provided, otherwise it will show the ariaLabel of the ariaLabel. If the ariaLabel is empty, it will show a `defineIcons().avatar` icon.\n * @see https://cerberus.digitalu.design/react/avatar\n * @example\n * ```tsx\n * <Avatar\n * ariaLabel=\"Protector Cerberus\"\n * src=\"https://cerberus.digitalu.design/logo.svg\"\n * />\n * ```\n */\nexport function Avatar(props: AvatarProps) {\n const {\n ariaLabel,\n as,\n gradient,\n size,\n src,\n width,\n height,\n icon,\n ...nativeProps\n } = props\n const { icons } = useCerberusContext()\n const { avatar: AvatarIcon } = icons\n const initials = (ariaLabel || '')\n .split(' ')\n .map((word) => word[0])\n .join('')\n .slice(0, 2)\n\n return (\n <div\n {...nativeProps}\n className={cx(\n nativeProps.className,\n avatar({ gradient, size }),\n circle(),\n )}\n >\n <Show\n when={Boolean(src) || Boolean(as)}\n fallback={\n <Show\n when={Boolean(initials)}\n fallback={\n <Show\n when={Boolean(icon)}\n fallback={\n <AvatarIcon\n size={iconSizeMap[size as keyof typeof iconSizeMap]}\n />\n }\n >\n {icon}\n </Show>\n }\n >\n {initials}\n </Show>\n }\n >\n <Show\n when={Boolean(as)}\n fallback={\n <img\n alt={props.ariaLabel}\n className={css({\n h: 'full',\n objectFit: 'cover',\n w: 'full',\n })}\n decoding=\"async\"\n loading=\"lazy\"\n src={src}\n height={height}\n width={width}\n />\n }\n >\n {as}\n </Show>\n </Show>\n </div>\n )\n}\n\nconst iconSizeMap = {\n xs: 16,\n sm: 16,\n md: 20,\n lg: 34,\n xl: 32,\n '2xl': 32,\n '3xl': 32,\n '4xl': 32,\n}\n","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","import {\n Portal as ArkPortal,\n type PortalProps as ArkPortalProps,\n} from '@ark-ui/react'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport type PortalProps = ArkPortalProps\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @see https://cerberus.digitalu.design/react/portal\n * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)\n * @example\n * ```tsx\n * 'use client'\n *\n * import { Portal } from '@cerberus/react'\n *\n * function SomeFeatureWithinSSRPage() {\n * return (\n * <Portal>\n * <div>Portal Content outside of the React VDom tree</div>\n * </Portal>\n * )\n * }\n */\nexport const Portal = ArkPortal\n","'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","import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n iconButton,\n type IconButtonVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonRawProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The aria-label attribute for the icon button.\n */\n ariaLabel: string\n}\nexport type IconButtonProps = IconButtonRawProps & IconButtonVariantProps\n\n/**\n * A component that allows the user to perform actions using an icon\n * @see https://cerberus.digitalu.design/react/icon-button\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n","'use client'\n\nimport { createContext, type ReactNode } from 'react'\nimport type { CTAModalActionReturn } from './utils'\n\n/**\n * This module provides the context for the cta modal.\n * @module\n */\n\nexport interface ShowCTAModalOptions {\n /**\n * The heading of the cta modal.\n */\n heading: string\n /**\n * The description of the cta modal.\n */\n description?: string\n /**\n * The icon used for the modal Avatar.\n */\n icon?: ReactNode\n /**\n * The actions for the cta modal. Requires 2 actions.\n */\n actions: CTAModalActionReturn\n}\n\nexport interface CTAModalValue {\n show: (options: ShowCTAModalOptions) => void\n}\n\nexport const CTAModalContext = createContext<CTAModalValue | null>(null)\n","import { css, cx } from '@cerberus/styled-system/css'\nimport { Button, type ButtonProps } from '../button/button'\nimport { ark } from '@ark-ui/react/factory'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module provides the trigger item for the cta modal.\n * @module 'react/cta-modal/trigger-item'\n */\n\nexport interface TriggerItemProps extends ButtonProps {\n asChild?: boolean\n}\n\n/**\n * Trigger item for the cta modal which renders content based on the actions.\n * type.\n */\nexport function TriggerItem(props: TriggerItemProps) {\n const { asChild, children, ...buttonProps } = props\n\n if (asChild) {\n return (\n <ark.div\n className={cx(\n button({\n shape: 'rounded',\n usage: 'ghost',\n }),\n css({\n w: '1/2',\n }),\n )}\n asChild\n >\n {children}\n </ark.div>\n )\n }\n\n return (\n <Button\n {...buttonProps}\n className={css({\n w: '1/2',\n })}\n shape=\"rounded\"\n usage=\"outlined\"\n >\n {children}\n </Button>\n )\n}\n","'use client'\n\nimport {\n type ButtonHTMLAttributes,\n type PropsWithChildren,\n createContext,\n useContext,\n useMemo,\n} from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n button,\n type ButtonVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport { Box } from '@cerberus/styled-system/jsx'\nimport { Show } from '../Show'\nimport { Spinner } from '../Spinner'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\ninterface ButtonContextValue {\n pending: boolean\n}\n\nconst ButtonContext = createContext<ButtonContextValue>({\n pending: false,\n})\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n ButtonVariantProps & {\n pending?: boolean\n }\n\n/**\n * A component that allows the user to perform actions\n * @see https://cerberus.digitalu.design/react/button\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, size, pending = false, ...nativeProps } = props\n const value = useMemo(() => ({ pending }), [pending])\n\n return (\n <ButtonContext.Provider value={value}>\n <button\n {...nativeProps}\n disabled={pending || nativeProps.disabled}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n size,\n }),\n )}\n />\n </ButtonContext.Provider>\n )\n}\n\n/**\n * An icon to display in a button that utilizes the pending state to display\n * a loading spinner.\n */\nexport function ButtonIcon(props: PropsWithChildren<object>) {\n const { pending } = useContext(ButtonContext)\n return (\n <Show when={pending} fallback={<>{props.children}</>}>\n <Box w=\"4\">\n <Spinner />\n </Box>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,gBAQO;AACP,IAAAC,cAA+B;;;ACT/B,mBAAkE;AAyB9D;AAfJ,IAAM,sBAAkB,4BAA2C,IAAI;AAyBhE,SAAS,qBAAqB;AACnC,QAAM,cAAU,yBAAW,eAAe;AAC1C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;AACA,SAAO;AACT;;;ACzCA,IAAAC,gBAAgE;A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zC,wDAAC,sBAAO,KAAI,MAAK,GAAE,QACjB;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,UAAS;AAAA,cACT,MACE;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAM,QAAQ,WAAW;AAAA,kBACzB,UAAU,6CAAC,gBAAa,MAAM,IAAI;AAAA,kBAEjC;AAAA;AAAA,cACH;AAAA,cAEF,KAAI;AAAA;AAAA,UACN;AAAA,UACA,6CAAC,iBAAe,6CAAS,SAAQ;AAAA,UACjC,6CAAC,qBAAmB,6CAAS,aAAY;AAAA,WAC3C,GACF;AAAA,QAEA,6CAAC,sBAAO,KAAI,MAAK,GAAE,QACjB,uDAAC,OAAI,MAAM,mCAAS,QAAQ,UACzB,WAAC,QAAQ,UAAO;AArIjC;AAsIkB;AAAA,YAAC;AAAA;AAAA,cAEC,QAAM,wCAAS,YAAT,mBAAkB,UAAS;AAAA,cACjC,UACE,6CAAC,eAAY,SAAO,MAAE,kBAAoB;AAAA,cAG5C,uDAAC,eAAY,cAAY,OAAO,SAAS,mBACrC,2CAA4B,MAChC;AAAA;AAAA,YARK;AAAA,UASP;AAAA,WAEJ,GACF;AAAA,SACF;AAAA,OACF,GACF;AAAA,KACF;AAEJ;AAEO,SAAS,cAA6B;AAC3C,QAAM,cAAU,0BAAW,eAAe;AAC1C,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AACA,SAAO;AACT;","names":["import_react","import_jsx","import_react","import_jsx_runtime","import_react","import_recipes","import_react","ArkPortal","import_css","import_jsx_runtime","ArkDialog","import_react","import_recipes","import_css","import_css","import_recipes","import_jsx_runtime","import_jsx_runtime","ArkDialog","import_react","import_css","import_react","import_css","import_recipes","import_jsx_runtime","import_recipes","import_jsx_runtime","import_jsx_runtime"]}
|