@cerberus-design/react 0.16.0-next-7f1fa64 → 0.16.0-next-d049636

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 (85) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +94 -48
  2. package/build/legacy/components/admonition/admonition.cjs +314 -0
  3. package/build/legacy/components/admonition/admonition.cjs.map +1 -0
  4. package/build/legacy/components/admonition/index.cjs +326 -0
  5. package/build/legacy/components/admonition/index.cjs.map +1 -0
  6. package/build/legacy/components/{Admonition.client.cjs → admonition/match-avatar.cjs} +61 -65
  7. package/build/legacy/components/admonition/match-avatar.cjs.map +1 -0
  8. package/build/legacy/components/admonition/parts.cjs +88 -0
  9. package/build/legacy/components/admonition/parts.cjs.map +1 -0
  10. package/build/legacy/components/admonition/primitives.cjs +85 -0
  11. package/build/legacy/components/admonition/primitives.cjs.map +1 -0
  12. package/build/legacy/index.cjs +749 -718
  13. package/build/legacy/index.cjs.map +1 -1
  14. package/build/modern/_tsup-dts-rollup.d.ts +94 -48
  15. package/build/modern/chunk-572S5CLA.js +41 -0
  16. package/build/modern/chunk-572S5CLA.js.map +1 -0
  17. package/build/modern/{chunk-32M5JS5F.js → chunk-6I2FW4WI.js} +5 -5
  18. package/build/modern/{chunk-3B4SFTQB.js → chunk-A45TFOGO.js} +4 -4
  19. package/build/modern/{chunk-J7SAFAW3.js → chunk-EKIAT7N7.js} +4 -4
  20. package/build/modern/{chunk-Z6EXPMTS.js → chunk-EKZENP7X.js} +6 -6
  21. package/build/modern/{chunk-WA3QADO4.js → chunk-EQPYRZ3X.js} +4 -4
  22. package/build/modern/{chunk-R7IDIIST.js → chunk-LT62577B.js} +2 -2
  23. package/build/modern/{chunk-3J5D3O6Z.js → chunk-NTU5OYUF.js} +2 -2
  24. package/build/modern/chunk-RKGFPKKK.js +59 -0
  25. package/build/modern/chunk-RKGFPKKK.js.map +1 -0
  26. package/build/modern/chunk-RQCJKDXU.js +21 -0
  27. package/build/modern/chunk-RQCJKDXU.js.map +1 -0
  28. package/build/modern/chunk-TM6TVO2D.js +78 -0
  29. package/build/modern/chunk-TM6TVO2D.js.map +1 -0
  30. package/build/modern/chunk-UR2NYAQC.js +1 -0
  31. package/build/modern/{chunk-VNPLKMEM.js → chunk-VSTOSLFS.js} +4 -4
  32. package/build/modern/{chunk-R662TP4N.js → chunk-XYDJ5TRW.js} +12 -12
  33. package/build/modern/components/FileStatus.js +6 -6
  34. package/build/modern/components/admonition/admonition.js +15 -0
  35. package/build/modern/components/admonition/index.js +30 -0
  36. package/build/modern/components/admonition/index.js.map +1 -0
  37. package/build/modern/components/admonition/match-avatar.js +11 -0
  38. package/build/modern/components/admonition/match-avatar.js.map +1 -0
  39. package/build/modern/components/admonition/parts.js +8 -0
  40. package/build/modern/components/admonition/parts.js.map +1 -0
  41. package/build/modern/components/admonition/primitives.js +15 -0
  42. package/build/modern/components/admonition/primitives.js.map +1 -0
  43. package/build/modern/components/combobox/combobox.js +2 -2
  44. package/build/modern/components/combobox/index.js +6 -6
  45. package/build/modern/components/cta-dialog/index.js +2 -2
  46. package/build/modern/components/cta-dialog/provider.js +2 -2
  47. package/build/modern/components/deprecated/Label.js +5 -5
  48. package/build/modern/components/field/field.js +3 -3
  49. package/build/modern/components/field/index.js +6 -6
  50. package/build/modern/components/field/parts.js +3 -3
  51. package/build/modern/components/field/primitives.js +2 -2
  52. package/build/modern/context/confirm-modal.js +2 -2
  53. package/build/modern/context/field.js +2 -2
  54. package/build/modern/context/prompt-modal.js +9 -9
  55. package/build/modern/index.js +126 -113
  56. package/build/modern/index.js.map +1 -1
  57. package/package.json +2 -2
  58. package/src/components/admonition/admonition.tsx +65 -0
  59. package/src/components/admonition/index.ts +3 -0
  60. package/src/components/admonition/match-avatar.tsx +84 -0
  61. package/src/components/admonition/parts.ts +53 -0
  62. package/src/components/admonition/primitives.tsx +73 -0
  63. package/src/index.ts +1 -1
  64. package/build/legacy/components/Admonition.cjs +0 -273
  65. package/build/legacy/components/Admonition.cjs.map +0 -1
  66. package/build/legacy/components/Admonition.client.cjs.map +0 -1
  67. package/build/modern/chunk-2HOUQ2DX.js +0 -82
  68. package/build/modern/chunk-2HOUQ2DX.js.map +0 -1
  69. package/build/modern/chunk-DXBZ3HMY.js +0 -68
  70. package/build/modern/chunk-DXBZ3HMY.js.map +0 -1
  71. package/build/modern/components/Admonition.client.js +0 -11
  72. package/build/modern/components/Admonition.js +0 -15
  73. package/src/components/Admonition.client.tsx +0 -73
  74. package/src/components/Admonition.tsx +0 -117
  75. /package/build/modern/{chunk-32M5JS5F.js.map → chunk-6I2FW4WI.js.map} +0 -0
  76. /package/build/modern/{chunk-3B4SFTQB.js.map → chunk-A45TFOGO.js.map} +0 -0
  77. /package/build/modern/{chunk-J7SAFAW3.js.map → chunk-EKIAT7N7.js.map} +0 -0
  78. /package/build/modern/{chunk-Z6EXPMTS.js.map → chunk-EKZENP7X.js.map} +0 -0
  79. /package/build/modern/{chunk-WA3QADO4.js.map → chunk-EQPYRZ3X.js.map} +0 -0
  80. /package/build/modern/{chunk-R7IDIIST.js.map → chunk-LT62577B.js.map} +0 -0
  81. /package/build/modern/{chunk-3J5D3O6Z.js.map → chunk-NTU5OYUF.js.map} +0 -0
  82. /package/build/modern/{components/Admonition.client.js.map → chunk-UR2NYAQC.js.map} +0 -0
  83. /package/build/modern/{chunk-VNPLKMEM.js.map → chunk-VSTOSLFS.js.map} +0 -0
  84. /package/build/modern/{chunk-R662TP4N.js.map → chunk-XYDJ5TRW.js.map} +0 -0
  85. /package/build/modern/components/{Admonition.js.map → admonition/admonition.js.map} +0 -0
@@ -0,0 +1,326 @@
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/admonition/index.ts
21
+ var admonition_exports = {};
22
+ __export(admonition_exports, {
23
+ Admonition: () => Admonition,
24
+ AdmonitionContent: () => AdmonitionContent,
25
+ AdmonitionDescription: () => AdmonitionDescription,
26
+ AdmonitionHeading: () => AdmonitionHeading,
27
+ AdmonitionIndicator: () => AdmonitionIndicator,
28
+ AdmonitionParts: () => AdmonitionParts,
29
+ AdmonitionRoot: () => AdmonitionRoot
30
+ });
31
+ module.exports = __toCommonJS(admonition_exports);
32
+
33
+ // src/components/admonition/primitives.tsx
34
+ var import_factory = require("@ark-ui/react/factory");
35
+ var import_css = require("@cerberus/styled-system/css");
36
+ var import_recipes = require("@cerberus/styled-system/recipes");
37
+ var import_jsx_runtime = require("react/jsx-runtime");
38
+ function AdmonitionRoot(props) {
39
+ const { palette, usage, ...nativeProps } = props;
40
+ const styles = (0, import_recipes.admonition)({ palette, usage });
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
42
+ import_factory.ark.aside,
43
+ {
44
+ ...nativeProps,
45
+ className: (0, import_css.cx)(styles.root, nativeProps.className),
46
+ "data-scope": "admonition",
47
+ "data-part": "root"
48
+ }
49
+ );
50
+ }
51
+ function AdmonitionIndicator(props) {
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_factory.ark.span, { ...props, "data-scope": "admonition", "data-part": "indicator" });
53
+ }
54
+ function AdmonitionContent(props) {
55
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_factory.ark.div, { ...props, "data-scope": "admonition", "data-part": "content" });
56
+ }
57
+ function AdmonitionHeading(props) {
58
+ const styles = (0, import_recipes.admonition)();
59
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
60
+ import_factory.ark.p,
61
+ {
62
+ ...props,
63
+ className: (0, import_css.cx)(styles.heading, props.className),
64
+ "data-scope": "admonition",
65
+ "data-part": "heading"
66
+ }
67
+ );
68
+ }
69
+ function AdmonitionDescription(props) {
70
+ const styles = (0, import_recipes.admonition)();
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
+ import_factory.ark.p,
73
+ {
74
+ ...props,
75
+ className: (0, import_css.cx)(styles.description, props.className),
76
+ "data-scope": "admonition",
77
+ "data-part": "description"
78
+ }
79
+ );
80
+ }
81
+
82
+ // src/components/admonition/parts.ts
83
+ var AdmonitionParts = {
84
+ Root: AdmonitionRoot,
85
+ Indicator: AdmonitionIndicator,
86
+ Content: AdmonitionContent,
87
+ Heading: AdmonitionHeading,
88
+ Description: AdmonitionDescription
89
+ };
90
+
91
+ // src/utils/index.ts
92
+ function splitProps(props, ...keyGroups) {
93
+ const result = keyGroups.map(() => ({}));
94
+ const rest = {};
95
+ for (const key in props) {
96
+ let assigned = false;
97
+ for (let i = 0; i < keyGroups.length; i++) {
98
+ if (keyGroups[i].includes(key)) {
99
+ result[i][key] = props[key];
100
+ assigned = true;
101
+ break;
102
+ }
103
+ }
104
+ if (!assigned) {
105
+ rest[key] = props[key];
106
+ }
107
+ }
108
+ return [...result, rest];
109
+ }
110
+
111
+ // src/components/Show.tsx
112
+ var import_react = require("react");
113
+ function Show(props) {
114
+ const { when, children, fallback } = props;
115
+ const condition = (0, import_react.useMemo)(() => when ?? false, [when]);
116
+ return (0, import_react.useMemo)(() => {
117
+ if (condition) return children;
118
+ return fallback ?? null;
119
+ }, [condition, children, fallback]);
120
+ }
121
+
122
+ // src/context/cerberus.tsx
123
+ var import_react2 = require("react");
124
+ var import_jsx_runtime2 = require("react/jsx-runtime");
125
+ var CerberusContext = (0, import_react2.createContext)(null);
126
+ function useCerberusContext() {
127
+ const context = (0, import_react2.useContext)(CerberusContext);
128
+ if (!context) {
129
+ throw new Error("useCerberus must be used within a CerberusProvider");
130
+ }
131
+ return context;
132
+ }
133
+
134
+ // src/components/Avatar.tsx
135
+ var import_css2 = require("@cerberus/styled-system/css");
136
+ var import_patterns = require("@cerberus/styled-system/patterns");
137
+ var import_recipes2 = require("@cerberus/styled-system/recipes");
138
+ var import_jsx_runtime3 = require("react/jsx-runtime");
139
+ function Avatar(props) {
140
+ const {
141
+ ariaLabel,
142
+ as,
143
+ gradient,
144
+ size,
145
+ src,
146
+ width,
147
+ height,
148
+ icon,
149
+ ...nativeProps
150
+ } = props;
151
+ const { icons } = useCerberusContext();
152
+ const { avatar: AvatarIcon } = icons;
153
+ const initials = (ariaLabel || "").split(" ").map((word) => word[0]).join("").slice(0, 2);
154
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
155
+ "div",
156
+ {
157
+ ...nativeProps,
158
+ className: (0, import_css2.cx)(
159
+ nativeProps.className,
160
+ (0, import_recipes2.avatar)({ gradient, size }),
161
+ (0, import_patterns.circle)()
162
+ ),
163
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
164
+ Show,
165
+ {
166
+ when: Boolean(src) || Boolean(as),
167
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
168
+ Show,
169
+ {
170
+ when: Boolean(initials),
171
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
172
+ Show,
173
+ {
174
+ when: Boolean(icon),
175
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
176
+ AvatarIcon,
177
+ {
178
+ size: iconSizeMap[size]
179
+ }
180
+ ),
181
+ children: icon
182
+ }
183
+ ),
184
+ children: initials
185
+ }
186
+ ),
187
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
188
+ Show,
189
+ {
190
+ when: Boolean(as),
191
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
192
+ "img",
193
+ {
194
+ alt: props.ariaLabel,
195
+ className: (0, import_css2.css)({
196
+ h: "full",
197
+ objectFit: "cover",
198
+ w: "full"
199
+ }),
200
+ decoding: "async",
201
+ loading: "lazy",
202
+ src,
203
+ height,
204
+ width
205
+ }
206
+ ),
207
+ children: as
208
+ }
209
+ )
210
+ }
211
+ )
212
+ }
213
+ );
214
+ }
215
+ var iconSizeMap = {
216
+ xs: 16,
217
+ sm: 16,
218
+ md: 20,
219
+ lg: 34,
220
+ xl: 32,
221
+ "2xl": 32,
222
+ "3xl": 32,
223
+ "4xl": 32
224
+ };
225
+
226
+ // src/components/admonition/match-avatar.tsx
227
+ var import_react3 = require("react");
228
+ var import_jsx_runtime4 = require("react/jsx-runtime");
229
+ function MatchAvatar(props) {
230
+ const { palette = "page" } = props;
231
+ const { icons } = useCerberusContext();
232
+ const {
233
+ infoNotification: InfoIcon,
234
+ successNotification: SuccessIcon,
235
+ warningNotification: WarningIcon,
236
+ dangerNotification: DangerIcon
237
+ } = icons;
238
+ const elRef = (0, import_react3.useRef)({
239
+ page: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
240
+ Avatar,
241
+ {
242
+ gradient: "charon-light",
243
+ ariaLabel: "",
244
+ icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InfoIcon, {}),
245
+ size: "sm",
246
+ src: ""
247
+ }
248
+ ),
249
+ info: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
250
+ Avatar,
251
+ {
252
+ gradient: "amphiaraus-dark",
253
+ ariaLabel: "",
254
+ icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InfoIcon, {}),
255
+ size: "sm",
256
+ src: ""
257
+ }
258
+ ),
259
+ success: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
260
+ Avatar,
261
+ {
262
+ gradient: "thanatos-dark",
263
+ ariaLabel: "",
264
+ icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SuccessIcon, {}),
265
+ size: "sm",
266
+ src: ""
267
+ }
268
+ ),
269
+ warning: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
270
+ Avatar,
271
+ {
272
+ gradient: "asphodel-light",
273
+ ariaLabel: "",
274
+ icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(WarningIcon, {}),
275
+ size: "sm",
276
+ src: ""
277
+ }
278
+ ),
279
+ danger: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
280
+ Avatar,
281
+ {
282
+ gradient: "hades-light",
283
+ ariaLabel: "",
284
+ icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DangerIcon, {}),
285
+ size: "sm",
286
+ src: ""
287
+ }
288
+ )
289
+ });
290
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: elRef.current[palette] });
291
+ }
292
+
293
+ // src/components/admonition/admonition.tsx
294
+ var import_jsx_runtime5 = require("react/jsx-runtime");
295
+ function Admonition(props) {
296
+ const [elProps, styleProps, rootProps] = splitProps(
297
+ props,
298
+ ["heading", "icon", "children"],
299
+ ["palette", "usage"]
300
+ );
301
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(AdmonitionParts.Root, { ...styleProps, ...rootProps, children: [
302
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
303
+ Show,
304
+ {
305
+ when: Boolean(elProps.icon),
306
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MatchAvatar, { palette: styleProps.palette }),
307
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AdmonitionParts.Indicator, { children: elProps.icon })
308
+ }
309
+ ),
310
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(AdmonitionParts.Content, { children: [
311
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Show, { when: Boolean(elProps.heading), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AdmonitionParts.Heading, { children: elProps.heading }) }),
312
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AdmonitionParts.Description, { children: elProps.children })
313
+ ] })
314
+ ] });
315
+ }
316
+ // Annotate the CommonJS export names for ESM import in node:
317
+ 0 && (module.exports = {
318
+ Admonition,
319
+ AdmonitionContent,
320
+ AdmonitionDescription,
321
+ AdmonitionHeading,
322
+ AdmonitionIndicator,
323
+ AdmonitionParts,
324
+ AdmonitionRoot
325
+ });
326
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/admonition/index.ts","../../../../src/components/admonition/primitives.tsx","../../../../src/components/admonition/parts.ts","../../../../src/utils/index.ts","../../../../src/components/Show.tsx","../../../../src/context/cerberus.tsx","../../../../src/components/Avatar.tsx","../../../../src/components/admonition/match-avatar.tsx","../../../../src/components/admonition/admonition.tsx"],"sourcesContent":["export * from './parts'\nexport * from './primitives'\nexport * from './admonition'\n","import { ark, type HTMLArkProps } from '@ark-ui/react/factory'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n admonition,\n type AdmonitionVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the primitives of the Admonition components.\n * @module 'admonition/primitives'\n */\n\n/**\n * The `AdmonitionRoot` component is the container for the Admonition.\n */\nexport function AdmonitionRoot(\n props: HTMLArkProps<'aside'> & AdmonitionVariantProps,\n) {\n const { palette, usage, ...nativeProps } = props\n const styles = admonition({ palette, usage })\n return (\n <ark.aside\n {...nativeProps}\n className={cx(styles.root, nativeProps.className)}\n data-scope=\"admonition\"\n data-part=\"root\"\n />\n )\n}\n\n/**\n * The `AdmonitionIndicator` component is the indicator for the Admonition.\n */\nexport function AdmonitionIndicator(props: HTMLArkProps<'span'>) {\n return <ark.span {...props} data-scope=\"admonition\" data-part=\"indicator\" />\n}\n\n/**\n * The `AdmonitionContent` component is the content for the Admonition.\n */\nexport function AdmonitionContent(props: HTMLArkProps<'div'>) {\n return <ark.div {...props} data-scope=\"admonition\" data-part=\"content\" />\n}\n\n/**\n * The `AdmonitionHeading` component is the heading title for the Admonition.\n */\nexport function AdmonitionHeading(props: HTMLArkProps<'p'>) {\n const styles = admonition()\n return (\n <ark.p\n {...props}\n className={cx(styles.heading, props.className)}\n data-scope=\"admonition\"\n data-part=\"heading\"\n />\n )\n}\n\n/**\n * The `AdmonitionDescription` component is the description for the Admonition.\n */\nexport function AdmonitionDescription(props: HTMLArkProps<'p'>) {\n const styles = admonition()\n return (\n <ark.p\n {...props}\n className={cx(styles.description, props.className)}\n data-scope=\"admonition\"\n data-part=\"description\"\n />\n )\n}\n","import type { ElementType } from 'react'\nimport {\n AdmonitionContent,\n AdmonitionDescription,\n AdmonitionHeading,\n AdmonitionIndicator,\n AdmonitionRoot,\n} from './primitives'\n\n/**\n * This module contains the parts of the Admonition component.\n * @module 'admonition/parts'\n */\n\ninterface AdmonitionPartsValue {\n /**\n * The context provider of the Admonition.\n */\n Root: ElementType\n /**\n * The indicator of the Admonition.\n */\n Indicator: ElementType\n /**\n * The content of the Admonition.\n */\n Content: ElementType\n /**\n * The heading of the Admonition.\n */\n Heading: ElementType\n /**\n * The description of the Admonition.\n */\n Description: ElementType\n}\n\n/**\n * An Object containing the parts of the Accordion component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the AdmonitionParts object and\n * the entire family of components vs. only what you use.\n */\nexport const AdmonitionParts: AdmonitionPartsValue = {\n Root: AdmonitionRoot,\n Indicator: AdmonitionIndicator,\n Content: AdmonitionContent,\n Heading: AdmonitionHeading,\n Description: AdmonitionDescription,\n}\n","/**\n * This module contains utility functions that are used across your app.\n * @module Utils\n */\n\n/**\n * Formats the count of notifications to be displayed in the notification badge.\n * @param count - The number of notifications.\n * @returns The formatted count of notifications.\n * @example\n * ```tsx\n * const count = formatNotifyCount(100)\n * console.log(count) // '99+'\n * ```\n */\nexport function formatNotifyCount(count: number): string {\n if (count > 99) return '99+'\n return count.toString()\n}\n\n/**\n * Splits the properties of an object into multiple groups based on lists of keys.\n * @param props - The object to split.\n * @param keyGroups - The lists of keys to include in each group.\n * @returns An array of objects: each containing the properties specified in the corresponding key group, and the last object containing the remaining keys.\n */\nexport function splitProps<T extends object>(\n props: T,\n ...keyGroups: (keyof T)[][]\n): { [K in keyof T]?: T[K] }[] {\n const result = keyGroups.map(() => ({}) as { [K in keyof T]?: T[K] })\n const rest = {} as { [K in keyof T]?: T[K] }\n\n for (const key in props) {\n let assigned = false\n for (let i = 0; i < keyGroups.length; i++) {\n if (keyGroups[i].includes(key as keyof T)) {\n result[i][key as keyof T] = props[key]\n assigned = true\n break\n }\n }\n if (!assigned) {\n rest[key as keyof T] = props[key]\n }\n }\n\n return [...result, rest]\n}\n\nexport * from './localStorage'\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","'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 { 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","'use client'\n\nimport type { AdmonitionVariantProps } from '@cerberus/styled-system/recipes'\nimport { useCerberusContext } from '../../context/cerberus'\nimport { Avatar } from '../Avatar'\nimport { useRef, type ReactNode } from 'react'\n\n/**\n * This module provides a component for creating the admonition indicator.\n * @module 'admonition/match-avatar'\n */\n\ninterface AvatarRefProps {\n page: ReactNode\n info: ReactNode\n success: ReactNode\n warning: ReactNode\n danger: ReactNode\n}\n\ntype MatchAvatarProps = AdmonitionVariantProps\n\nexport function MatchAvatar(props: MatchAvatarProps) {\n const { palette = 'page' } = props\n\n const { icons } = useCerberusContext()\n const {\n infoNotification: InfoIcon,\n successNotification: SuccessIcon,\n warningNotification: WarningIcon,\n dangerNotification: DangerIcon,\n } = icons\n\n // cache the el since the result is static and the component is client side\n const elRef = useRef<AvatarRefProps>({\n page: (\n <Avatar\n gradient=\"charon-light\"\n ariaLabel=\"\"\n icon={<InfoIcon />}\n size=\"sm\"\n src=\"\"\n />\n ),\n info: (\n <Avatar\n gradient=\"amphiaraus-dark\"\n ariaLabel=\"\"\n icon={<InfoIcon />}\n size=\"sm\"\n src=\"\"\n />\n ),\n success: (\n <Avatar\n gradient=\"thanatos-dark\"\n ariaLabel=\"\"\n icon={<SuccessIcon />}\n size=\"sm\"\n src=\"\"\n />\n ),\n warning: (\n <Avatar\n gradient=\"asphodel-light\"\n ariaLabel=\"\"\n icon={<WarningIcon />}\n size=\"sm\"\n src=\"\"\n />\n ),\n danger: (\n <Avatar\n gradient=\"hades-light\"\n ariaLabel=\"\"\n icon={<DangerIcon />}\n size=\"sm\"\n src=\"\"\n />\n ),\n })\n\n return <>{elRef.current[palette]}</>\n}\n","import type { HTMLArkProps } from '@ark-ui/react/factory'\nimport type { AdmonitionVariantProps } from '@cerberus/styled-system/recipes'\nimport type { ReactNode } from 'react'\nimport { splitProps } from '../../utils/index'\nimport { AdmonitionParts } from './parts'\nimport { Show } from '../Show'\nimport { MatchAvatar } from './match-avatar'\n\n/**\n * This module provides an abstraction for the Admonition component.\n * @module 'admonition/admonition'\n */\n\nexport interface AdmonitionProps\n extends AdmonitionVariantProps,\n HTMLArkProps<'aside'> {\n /**\n * The heading title for the Admonition.\n */\n heading?: string\n /**\n * One off replacement for the icon.\n */\n icon?: ReactNode\n}\n\n/**\n * The Admonition component is an abstraction of the primitives which\n * displays a Admonition with a label.\n *\n * @description [Cerberus Docs](https://cerberus.digitalu.design/react/admonition)\n *\n * @remarks\n *\n * For a customizable Admonition, use the `AdmonitionParts` object to access the\n * individual primitives of the Admonition component.\n */\nexport function Admonition(props: AdmonitionProps) {\n const [elProps, styleProps, rootProps] = splitProps(\n props,\n ['heading', 'icon', 'children'],\n ['palette', 'usage'],\n )\n\n return (\n <AdmonitionParts.Root {...styleProps} {...rootProps}>\n <Show\n when={Boolean(elProps.icon)}\n fallback={<MatchAvatar palette={styleProps.palette} />}\n >\n <AdmonitionParts.Indicator>{elProps.icon}</AdmonitionParts.Indicator>\n </Show>\n\n <AdmonitionParts.Content>\n <Show when={Boolean(elProps.heading)}>\n <AdmonitionParts.Heading>{elProps.heading}</AdmonitionParts.Heading>\n </Show>\n\n <AdmonitionParts.Description>\n {elProps.children}\n </AdmonitionParts.Description>\n </AdmonitionParts.Content>\n </AdmonitionParts.Root>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,qBAAuC;AACvC,iBAAmB;AACnB,qBAGO;AAgBH;AANG,SAAS,eACd,OACA;AACA,QAAM,EAAE,SAAS,OAAO,GAAG,YAAY,IAAI;AAC3C,QAAM,aAAS,2BAAW,EAAE,SAAS,MAAM,CAAC;AAC5C,SACE;AAAA,IAAC,mBAAI;AAAA,IAAJ;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,MAAM,YAAY,SAAS;AAAA,MAChD,cAAW;AAAA,MACX,aAAU;AAAA;AAAA,EACZ;AAEJ;AAKO,SAAS,oBAAoB,OAA6B;AAC/D,SAAO,4CAAC,mBAAI,MAAJ,EAAU,GAAG,OAAO,cAAW,cAAa,aAAU,aAAY;AAC5E;AAKO,SAAS,kBAAkB,OAA4B;AAC5D,SAAO,4CAAC,mBAAI,KAAJ,EAAS,GAAG,OAAO,cAAW,cAAa,aAAU,WAAU;AACzE;AAKO,SAAS,kBAAkB,OAA0B;AAC1D,QAAM,aAAS,2BAAW;AAC1B,SACE;AAAA,IAAC,mBAAI;AAAA,IAAJ;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,MAAM,SAAS;AAAA,MAC7C,cAAW;AAAA,MACX,aAAU;AAAA;AAAA,EACZ;AAE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,IAEF,QACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,WAAU;AAAA,QACV,MAAM,6CAAC,cAAW;AAAA,QAClB,MAAK;AAAA,QACL,KAAI;AAAA;AAAA,IACN;AAAA,EAEJ,CAAC;AAED,SAAO,6EAAG,gBAAM,QAAQ,OAAO,GAAE;AACnC;;;ACnCkB,IAAAC,sBAAA;AAXX,SAAS,WAAW,OAAwB;AACjD,QAAM,CAAC,SAAS,YAAY,SAAS,IAAI;AAAA,IACvC;AAAA,IACA,CAAC,WAAW,QAAQ,UAAU;AAAA,IAC9B,CAAC,WAAW,OAAO;AAAA,EACrB;AAEA,SACE,8CAAC,gBAAgB,MAAhB,EAAsB,GAAG,YAAa,GAAG,WACxC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,QAAQ,QAAQ,IAAI;AAAA,QAC1B,UAAU,6CAAC,eAAY,SAAS,WAAW,SAAS;AAAA,QAEpD,uDAAC,gBAAgB,WAAhB,EAA2B,kBAAQ,MAAK;AAAA;AAAA,IAC3C;AAAA,IAEA,8CAAC,gBAAgB,SAAhB,EACC;AAAA,mDAAC,QAAK,MAAM,QAAQ,QAAQ,OAAO,GACjC,uDAAC,gBAAgB,SAAhB,EAAyB,kBAAQ,SAAQ,GAC5C;AAAA,MAEA,6CAAC,gBAAgB,aAAhB,EACE,kBAAQ,UACX;AAAA,OACF;AAAA,KACF;AAEJ;","names":["import_react","import_jsx_runtime","import_css","import_recipes","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime"]}
@@ -18,12 +18,12 @@ var __copyProps = (to, from, except, desc) => {
18
18
  };
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
 
21
- // src/components/Admonition.client.tsx
22
- var Admonition_client_exports = {};
23
- __export(Admonition_client_exports, {
21
+ // src/components/admonition/match-avatar.tsx
22
+ var match_avatar_exports = {};
23
+ __export(match_avatar_exports, {
24
24
  MatchAvatar: () => MatchAvatar
25
25
  });
26
- module.exports = __toCommonJS(Admonition_client_exports);
26
+ module.exports = __toCommonJS(match_avatar_exports);
27
27
 
28
28
  // src/context/cerberus.tsx
29
29
  var import_react = require("react");
@@ -142,9 +142,11 @@ var iconSizeMap = {
142
142
  "4xl": 32
143
143
  };
144
144
 
145
- // src/components/Admonition.client.tsx
145
+ // src/components/admonition/match-avatar.tsx
146
+ var import_react3 = require("react");
146
147
  var import_jsx_runtime3 = require("react/jsx-runtime");
147
148
  function MatchAvatar(props) {
149
+ const { palette = "page" } = props;
148
150
  const { icons } = useCerberusContext();
149
151
  const {
150
152
  infoNotification: InfoIcon,
@@ -152,68 +154,62 @@ function MatchAvatar(props) {
152
154
  warningNotification: WarningIcon,
153
155
  dangerNotification: DangerIcon
154
156
  } = icons;
155
- switch (props.palette) {
156
- case "page":
157
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
158
- Avatar,
159
- {
160
- gradient: "charon-light",
161
- ariaLabel: "",
162
- icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InfoIcon, {}),
163
- size: "sm",
164
- src: ""
165
- }
166
- );
167
- case "info":
168
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
169
- Avatar,
170
- {
171
- gradient: "amphiaraus-dark",
172
- ariaLabel: "",
173
- icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InfoIcon, {}),
174
- size: "sm",
175
- src: ""
176
- }
177
- );
178
- case "success":
179
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
180
- Avatar,
181
- {
182
- gradient: "thanatos-dark",
183
- ariaLabel: "",
184
- icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SuccessIcon, {}),
185
- size: "sm",
186
- src: ""
187
- }
188
- );
189
- case "warning":
190
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
191
- Avatar,
192
- {
193
- gradient: "asphodel-light",
194
- ariaLabel: "",
195
- icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(WarningIcon, {}),
196
- size: "sm",
197
- src: ""
198
- }
199
- );
200
- case "danger":
201
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
202
- Avatar,
203
- {
204
- gradient: "hades-light",
205
- ariaLabel: "",
206
- icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DangerIcon, {}),
207
- size: "sm",
208
- src: ""
209
- }
210
- );
211
- default:
212
- throw new Error("Unsupported admonition palette");
213
- }
157
+ const elRef = (0, import_react3.useRef)({
158
+ page: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
159
+ Avatar,
160
+ {
161
+ gradient: "charon-light",
162
+ ariaLabel: "",
163
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InfoIcon, {}),
164
+ size: "sm",
165
+ src: ""
166
+ }
167
+ ),
168
+ info: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
169
+ Avatar,
170
+ {
171
+ gradient: "amphiaraus-dark",
172
+ ariaLabel: "",
173
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InfoIcon, {}),
174
+ size: "sm",
175
+ src: ""
176
+ }
177
+ ),
178
+ success: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
179
+ Avatar,
180
+ {
181
+ gradient: "thanatos-dark",
182
+ ariaLabel: "",
183
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SuccessIcon, {}),
184
+ size: "sm",
185
+ src: ""
186
+ }
187
+ ),
188
+ warning: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
189
+ Avatar,
190
+ {
191
+ gradient: "asphodel-light",
192
+ ariaLabel: "",
193
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(WarningIcon, {}),
194
+ size: "sm",
195
+ src: ""
196
+ }
197
+ ),
198
+ danger: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
199
+ Avatar,
200
+ {
201
+ gradient: "hades-light",
202
+ ariaLabel: "",
203
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DangerIcon, {}),
204
+ size: "sm",
205
+ src: ""
206
+ }
207
+ )
208
+ });
209
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: elRef.current[palette] });
214
210
  }
215
211
  // Annotate the CommonJS export names for ESM import in node:
216
212
  0 && (module.exports = {
217
213
  MatchAvatar
218
214
  });
219
- //# sourceMappingURL=Admonition.client.cjs.map
215
+ //# sourceMappingURL=match-avatar.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/admonition/match-avatar.tsx","../../../../src/context/cerberus.tsx","../../../../src/components/Avatar.tsx","../../../../src/components/Show.tsx"],"sourcesContent":["'use client'\n\nimport type { AdmonitionVariantProps } from '@cerberus/styled-system/recipes'\nimport { useCerberusContext } from '../../context/cerberus'\nimport { Avatar } from '../Avatar'\nimport { useRef, type ReactNode } from 'react'\n\n/**\n * This module provides a component for creating the admonition indicator.\n * @module 'admonition/match-avatar'\n */\n\ninterface AvatarRefProps {\n page: ReactNode\n info: ReactNode\n success: ReactNode\n warning: ReactNode\n danger: ReactNode\n}\n\ntype MatchAvatarProps = AdmonitionVariantProps\n\nexport function MatchAvatar(props: MatchAvatarProps) {\n const { palette = 'page' } = props\n\n const { icons } = useCerberusContext()\n const {\n infoNotification: InfoIcon,\n successNotification: SuccessIcon,\n warningNotification: WarningIcon,\n dangerNotification: DangerIcon,\n } = icons\n\n // cache the el since the result is static and the component is client side\n const elRef = useRef<AvatarRefProps>({\n page: (\n <Avatar\n gradient=\"charon-light\"\n ariaLabel=\"\"\n icon={<InfoIcon />}\n size=\"sm\"\n src=\"\"\n />\n ),\n info: (\n <Avatar\n gradient=\"amphiaraus-dark\"\n ariaLabel=\"\"\n icon={<InfoIcon />}\n size=\"sm\"\n src=\"\"\n />\n ),\n success: (\n <Avatar\n gradient=\"thanatos-dark\"\n ariaLabel=\"\"\n icon={<SuccessIcon />}\n size=\"sm\"\n src=\"\"\n />\n ),\n warning: (\n <Avatar\n gradient=\"asphodel-light\"\n ariaLabel=\"\"\n icon={<WarningIcon />}\n size=\"sm\"\n src=\"\"\n />\n ),\n danger: (\n <Avatar\n gradient=\"hades-light\"\n ariaLabel=\"\"\n icon={<DangerIcon />}\n size=\"sm\"\n src=\"\"\n />\n ),\n })\n\n return <>{elRef.current[palette]}</>\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 { 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","'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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,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,iBAAwB;AACxB,sBAAuB;AACvB,qBAGO;;;ACLP,IAAAA,gBAAgE;AA4BzD,SAAS,KAAK,OAAgD;AACnE,QAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,QAAM,gBAAY,uBAAQ,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC;AAErD,aAAO,uBAAQ,MAAM;AACnB,QAAI,UAAW,QAAO;AACtB,WAAO,YAAY;AAAA,EACrB,GAAG,CAAC,WAAW,UAAU,QAAQ,CAAC;AACpC;;;AD4EkB,IAAAC,sBAAA;AAtCX,SAAS,OAAO,OAAoB;AACzC,QAA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BAAM,QAAQ,OAAO,GAAE;AACnC;","names":["import_react","import_jsx_runtime","import_react","import_jsx_runtime"]}
@@ -0,0 +1,88 @@
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/admonition/parts.ts
21
+ var parts_exports = {};
22
+ __export(parts_exports, {
23
+ AdmonitionParts: () => AdmonitionParts
24
+ });
25
+ module.exports = __toCommonJS(parts_exports);
26
+
27
+ // src/components/admonition/primitives.tsx
28
+ var import_factory = require("@ark-ui/react/factory");
29
+ var import_css = require("@cerberus/styled-system/css");
30
+ var import_recipes = require("@cerberus/styled-system/recipes");
31
+ var import_jsx_runtime = require("react/jsx-runtime");
32
+ function AdmonitionRoot(props) {
33
+ const { palette, usage, ...nativeProps } = props;
34
+ const styles = (0, import_recipes.admonition)({ palette, usage });
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
36
+ import_factory.ark.aside,
37
+ {
38
+ ...nativeProps,
39
+ className: (0, import_css.cx)(styles.root, nativeProps.className),
40
+ "data-scope": "admonition",
41
+ "data-part": "root"
42
+ }
43
+ );
44
+ }
45
+ function AdmonitionIndicator(props) {
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_factory.ark.span, { ...props, "data-scope": "admonition", "data-part": "indicator" });
47
+ }
48
+ function AdmonitionContent(props) {
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_factory.ark.div, { ...props, "data-scope": "admonition", "data-part": "content" });
50
+ }
51
+ function AdmonitionHeading(props) {
52
+ const styles = (0, import_recipes.admonition)();
53
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
+ import_factory.ark.p,
55
+ {
56
+ ...props,
57
+ className: (0, import_css.cx)(styles.heading, props.className),
58
+ "data-scope": "admonition",
59
+ "data-part": "heading"
60
+ }
61
+ );
62
+ }
63
+ function AdmonitionDescription(props) {
64
+ const styles = (0, import_recipes.admonition)();
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
+ import_factory.ark.p,
67
+ {
68
+ ...props,
69
+ className: (0, import_css.cx)(styles.description, props.className),
70
+ "data-scope": "admonition",
71
+ "data-part": "description"
72
+ }
73
+ );
74
+ }
75
+
76
+ // src/components/admonition/parts.ts
77
+ var AdmonitionParts = {
78
+ Root: AdmonitionRoot,
79
+ Indicator: AdmonitionIndicator,
80
+ Content: AdmonitionContent,
81
+ Heading: AdmonitionHeading,
82
+ Description: AdmonitionDescription
83
+ };
84
+ // Annotate the CommonJS export names for ESM import in node:
85
+ 0 && (module.exports = {
86
+ AdmonitionParts
87
+ });
88
+ //# sourceMappingURL=parts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/admonition/parts.ts","../../../../src/components/admonition/primitives.tsx"],"sourcesContent":["import type { ElementType } from 'react'\nimport {\n AdmonitionContent,\n AdmonitionDescription,\n AdmonitionHeading,\n AdmonitionIndicator,\n AdmonitionRoot,\n} from './primitives'\n\n/**\n * This module contains the parts of the Admonition component.\n * @module 'admonition/parts'\n */\n\ninterface AdmonitionPartsValue {\n /**\n * The context provider of the Admonition.\n */\n Root: ElementType\n /**\n * The indicator of the Admonition.\n */\n Indicator: ElementType\n /**\n * The content of the Admonition.\n */\n Content: ElementType\n /**\n * The heading of the Admonition.\n */\n Heading: ElementType\n /**\n * The description of the Admonition.\n */\n Description: ElementType\n}\n\n/**\n * An Object containing the parts of the Accordion component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the AdmonitionParts object and\n * the entire family of components vs. only what you use.\n */\nexport const AdmonitionParts: AdmonitionPartsValue = {\n Root: AdmonitionRoot,\n Indicator: AdmonitionIndicator,\n Content: AdmonitionContent,\n Heading: AdmonitionHeading,\n Description: AdmonitionDescription,\n}\n","import { ark, type HTMLArkProps } from '@ark-ui/react/factory'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n admonition,\n type AdmonitionVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the primitives of the Admonition components.\n * @module 'admonition/primitives'\n */\n\n/**\n * The `AdmonitionRoot` component is the container for the Admonition.\n */\nexport function AdmonitionRoot(\n props: HTMLArkProps<'aside'> & AdmonitionVariantProps,\n) {\n const { palette, usage, ...nativeProps } = props\n const styles = admonition({ palette, usage })\n return (\n <ark.aside\n {...nativeProps}\n className={cx(styles.root, nativeProps.className)}\n data-scope=\"admonition\"\n data-part=\"root\"\n />\n )\n}\n\n/**\n * The `AdmonitionIndicator` component is the indicator for the Admonition.\n */\nexport function AdmonitionIndicator(props: HTMLArkProps<'span'>) {\n return <ark.span {...props} data-scope=\"admonition\" data-part=\"indicator\" />\n}\n\n/**\n * The `AdmonitionContent` component is the content for the Admonition.\n */\nexport function AdmonitionContent(props: HTMLArkProps<'div'>) {\n return <ark.div {...props} data-scope=\"admonition\" data-part=\"content\" />\n}\n\n/**\n * The `AdmonitionHeading` component is the heading title for the Admonition.\n */\nexport function AdmonitionHeading(props: HTMLArkProps<'p'>) {\n const styles = admonition()\n return (\n <ark.p\n {...props}\n className={cx(styles.heading, props.className)}\n data-scope=\"admonition\"\n data-part=\"heading\"\n />\n )\n}\n\n/**\n * The `AdmonitionDescription` component is the description for the Admonition.\n */\nexport function AdmonitionDescription(props: HTMLArkProps<'p'>) {\n const styles = admonition()\n return (\n <ark.p\n {...props}\n className={cx(styles.description, props.className)}\n data-scope=\"admonition\"\n data-part=\"description\"\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,qBAAuC;AACvC,iBAAmB;AACnB,qBAGO;AAgBH;AANG,SAAS,eACd,OACA;AACA,QAAM,EAAE,SAAS,OAAO,GAAG,YAAY,IAAI;AAC3C,QAAM,aAAS,2BAAW,EAAE,SAAS,MAAM,CAAC;AAC5C,SACE;AAAA,IAAC,mBAAI;AAAA,IAAJ;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,MAAM,YAAY,SAAS;AAAA,MAChD,cAAW;AAAA,MACX,aAAU;AAAA;AAAA,EACZ;AAEJ;AAKO,SAAS,oBAAoB,OAA6B;AAC/D,SAAO,4CAAC,mBAAI,MAAJ,EAAU,GAAG,OAAO,cAAW,cAAa,aAAU,aAAY;AAC5E;AAKO,SAAS,kBAAkB,OAA4B;AAC5D,SAAO,4CAAC,mBAAI,KAAJ,EAAS,GAAG,OAAO,cAAW,cAAa,aAAU,WAAU;AACzE;AAKO,SAAS,kBAAkB,OAA0B;AAC1D,QAAM,aAAS,2BAAW;AAC1B,SACE;AAAA,IAAC,mBAAI;AAAA,IAAJ;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,MAAM,SAAS;AAAA,MAC7C,cAAW;AAAA,MACX,aAAU;AAAA;AAAA,EACZ;AAEJ;AAKO,SAAS,sBAAsB,OAA0B;AAC9D,QAAM,aAAS,2BAAW;AAC1B,SACE;AAAA,IAAC,mBAAI;AAAA,IAAJ;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,aAAa,MAAM,SAAS;AAAA,MACjD,cAAW;AAAA,MACX,aAAU;AAAA;AAAA,EACZ;AAEJ;;;AD1BO,IAAM,kBAAwC;AAAA,EACnD,MAAM;AAAA,EACN,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