@atom-learning/components 10.0.0 → 10.0.1
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/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/accordion/AccordionContent.js +1 -1
- package/dist/components/accordion/AccordionItem.js +1 -1
- package/dist/components/accordion/AccordionTrigger.js +2 -2
- package/dist/components/action-icon/ActionIcon.js +1 -1
- package/dist/components/alert-dialog/Alert.d.ts +3 -0
- package/dist/components/alert-dialog/Alert.js +7 -0
- package/dist/components/alert-dialog/Alert.js.map +1 -0
- package/dist/components/alert-dialog/alert-context/AlertDialog.js +1 -1
- package/dist/components/calendar/Calendar.js +2 -2
- package/dist/components/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/dist/components/data-table/DataTableBulkActionsFloating.js +1 -1
- package/dist/components/data-table/DataTableHeaderCell.js +1 -1
- package/dist/components/file-input/FileInput.js +1 -1
- package/dist/components/index.d.ts +1 -3
- package/dist/components/inline-message/InlineMessage.js +1 -1
- package/dist/components/markdown-content/MarkdownContent.js +5 -5
- package/dist/components/markdown-content/MarkdownContent.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownEmphasis.d.ts +2 -2
- package/dist/components/markdown-content/components/MarkdownEmphasis.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownHeading.d.ts +2 -2
- package/dist/components/markdown-content/components/MarkdownHeading.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownLink.d.ts +2 -2
- package/dist/components/markdown-content/components/MarkdownLink.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownList.d.ts +2 -2
- package/dist/components/markdown-content/components/MarkdownList.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownListItem.d.ts +2 -2
- package/dist/components/markdown-content/components/MarkdownListItem.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownParagraph.d.ts +2 -2
- package/dist/components/markdown-content/components/MarkdownParagraph.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownStrong.d.ts +2 -2
- package/dist/components/markdown-content/components/MarkdownStrong.js.map +1 -1
- package/dist/components/tabs/TabsTriggerList.js +1 -1
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +778 -781
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +7 -7
- package/package.json +11 -5
- package/dist/components/index.js +0 -102
- package/dist/components/index.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
enumerable: true
|
|
31
31
|
}) : target, mod));
|
|
32
32
|
//#endregion
|
|
33
|
+
let _radix_ui_react_accordion = require("@radix-ui/react-accordion");
|
|
33
34
|
let react = require("react");
|
|
34
35
|
react = __toESM(react, 1);
|
|
35
36
|
let _radix_ui_react_compose_refs = require("@radix-ui/react-compose-refs");
|
|
@@ -38,13 +39,12 @@ clsx = __toESM(clsx, 1);
|
|
|
38
39
|
let tailwind_merge = require("tailwind-merge");
|
|
39
40
|
let tailwind_variants = require("tailwind-variants");
|
|
40
41
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
-
let _radix_ui_react_alert_dialog = require("@radix-ui/react-alert-dialog");
|
|
42
42
|
let _atom_learning_icons = require("@atom-learning/icons");
|
|
43
|
-
let _radix_ui_react_accordion = require("@radix-ui/react-accordion");
|
|
44
43
|
let _radix_ui_react_slot = require("@radix-ui/react-slot");
|
|
45
44
|
let invariant = require("invariant");
|
|
46
45
|
invariant = __toESM(invariant, 1);
|
|
47
46
|
let _radix_ui_react_tooltip = require("@radix-ui/react-tooltip");
|
|
47
|
+
let _radix_ui_react_alert_dialog = require("@radix-ui/react-alert-dialog");
|
|
48
48
|
let throttle_debounce = require("throttle-debounce");
|
|
49
49
|
let embla_carousel_react = require("embla-carousel-react");
|
|
50
50
|
embla_carousel_react = __toESM(embla_carousel_react, 1);
|
|
@@ -73,11 +73,8 @@ let dayzed = require("dayzed");
|
|
|
73
73
|
let _radix_ui_react_dialog = require("@radix-ui/react-dialog");
|
|
74
74
|
let _radix_ui_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
75
75
|
let mdast_util_directive = require("mdast-util-directive");
|
|
76
|
-
mdast_util_directive = __toESM(mdast_util_directive, 1);
|
|
77
76
|
let mdast_util_from_markdown = require("mdast-util-from-markdown");
|
|
78
|
-
mdast_util_from_markdown = __toESM(mdast_util_from_markdown, 1);
|
|
79
77
|
let micromark_extension_directive = require("micromark-extension-directive");
|
|
80
|
-
micromark_extension_directive = __toESM(micromark_extension_directive, 1);
|
|
81
78
|
let _radix_ui_react_navigation_menu = require("@radix-ui/react-navigation-menu");
|
|
82
79
|
_radix_ui_react_navigation_menu = __toESM(_radix_ui_react_navigation_menu, 1);
|
|
83
80
|
let _radix_ui_react_progress = require("@radix-ui/react-progress");
|
|
@@ -91,18 +88,6 @@ let _radix_ui_react_tabs = require("@radix-ui/react-tabs");
|
|
|
91
88
|
let react_hot_toast = require("react-hot-toast");
|
|
92
89
|
let react_player_vimeo_js = require("react-player/vimeo.js");
|
|
93
90
|
react_player_vimeo_js = __toESM(react_player_vimeo_js, 1);
|
|
94
|
-
//#region src/utilities/hooks/useIsMountedRef.ts
|
|
95
|
-
var useIsMountedRef = () => {
|
|
96
|
-
const isMountedRef = (0, react.useRef)(void 0);
|
|
97
|
-
(0, react.useEffect)(() => {
|
|
98
|
-
isMountedRef.current = true;
|
|
99
|
-
return () => {
|
|
100
|
-
isMountedRef.current = false;
|
|
101
|
-
};
|
|
102
|
-
});
|
|
103
|
-
return isMountedRef;
|
|
104
|
-
};
|
|
105
|
-
//#endregion
|
|
106
91
|
//#region src/styled.tsx
|
|
107
92
|
tailwind_variants.defaultConfig.twMerge = false;
|
|
108
93
|
var isArbitraryNumber = (value) => /^\[[\d.]+\]$/.test(value) || !Number.isNaN(Number(value));
|
|
@@ -225,670 +210,181 @@ function styled(el, styles, options) {
|
|
|
225
210
|
return Comp;
|
|
226
211
|
}
|
|
227
212
|
//#endregion
|
|
228
|
-
//#region src/utilities/
|
|
229
|
-
var
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
213
|
+
//#region src/utilities/css-wrapper/CSSWrapper.tsx
|
|
214
|
+
var CSSWrapper = ({ className, children }) => className ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
215
|
+
className,
|
|
216
|
+
children
|
|
217
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
|
|
218
|
+
CSSWrapper.displayName = "CSSWrapper";
|
|
234
219
|
//#endregion
|
|
235
|
-
//#region src/components/
|
|
236
|
-
var
|
|
220
|
+
//#region src/components/accordion/AccordionContent.tsx
|
|
221
|
+
var StyledContent$4 = styled(_radix_ui_react_accordion.Content, { base: [
|
|
222
|
+
"border-none",
|
|
223
|
+
"w-full",
|
|
224
|
+
"bg-(--base-1)",
|
|
225
|
+
"overflow-hidden",
|
|
226
|
+
"data-[state=open]:rounded-b-sm",
|
|
227
|
+
"data-[state=open]:rounded-t-none",
|
|
228
|
+
"motion-safe:data-[state=open]:animate-accordion-open",
|
|
229
|
+
"motion-safe:data-[state=closed]:animate-accordion-close"
|
|
230
|
+
] });
|
|
231
|
+
var AccordionContent = ({ children, className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledContent$4, {
|
|
232
|
+
...rest,
|
|
233
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CSSWrapper, {
|
|
234
|
+
className,
|
|
235
|
+
children
|
|
236
|
+
})
|
|
237
|
+
});
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/components/accordion/AccordionItem.tsx
|
|
240
|
+
var AccordionItem = styled(_radix_ui_react_accordion.Item, { base: ["w-full", "not-last:mb-1"] }, { enablePolymorphism: false });
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region src/experiments/color-scheme/ColorScheme.config.ts
|
|
243
|
+
var generateColors = ({ prefix, colorName, color0 = "" }) => {
|
|
244
|
+
const colors = {};
|
|
245
|
+
let i = 1;
|
|
246
|
+
if (color0) {
|
|
247
|
+
colors[`--${prefix}-${i}`] = `var(--color-${color0})`;
|
|
248
|
+
i++;
|
|
249
|
+
}
|
|
250
|
+
let k = 1;
|
|
251
|
+
for (; i <= 11; i++) {
|
|
252
|
+
colors[`--${prefix}-${i}`] = `var(--color-${colorName}-${k * 100})`;
|
|
253
|
+
k++;
|
|
254
|
+
}
|
|
255
|
+
return colors;
|
|
256
|
+
};
|
|
257
|
+
var colorSchemes$4 = {};
|
|
258
|
+
colorSchemes$4["interactive-loContrast"] = {
|
|
259
|
+
"--interactive-foreground": "var(--foreground)",
|
|
260
|
+
"--interactive-1": "var(--accent-1)",
|
|
261
|
+
"--interactive-2": "var(--accent-2)",
|
|
262
|
+
"--interactive-3": "var(--accent-3)"
|
|
263
|
+
};
|
|
264
|
+
colorSchemes$4["interactive-hiContrast"] = {
|
|
265
|
+
"--interactive-foreground": "var(--foreground-7-plus)",
|
|
266
|
+
"--interactive-1": "var(--accent-9)",
|
|
267
|
+
"--interactive-2": "var(--accent-10)",
|
|
268
|
+
"--interactive-3": "var(--accent-11)"
|
|
269
|
+
};
|
|
270
|
+
var colorNames = [
|
|
271
|
+
"primary",
|
|
272
|
+
"grey",
|
|
273
|
+
"blue",
|
|
274
|
+
"pink",
|
|
275
|
+
"purple",
|
|
276
|
+
"cyan",
|
|
277
|
+
"green",
|
|
278
|
+
"magenta",
|
|
279
|
+
"red",
|
|
280
|
+
"teal",
|
|
281
|
+
"orange",
|
|
282
|
+
"yellow",
|
|
283
|
+
"lime"
|
|
284
|
+
];
|
|
285
|
+
var createVariants = () => Object.fromEntries(colorNames.flatMap((c) => [[`${c}1`, {
|
|
286
|
+
colorName: c,
|
|
287
|
+
color0: "white"
|
|
288
|
+
}], [`${c}2`, { colorName: c }]]));
|
|
289
|
+
var bases = createVariants();
|
|
290
|
+
var accents = bases;
|
|
291
|
+
(() => {
|
|
292
|
+
Object.entries(bases).forEach(([name, config]) => {
|
|
293
|
+
const themeName = `base-${name}`;
|
|
294
|
+
colorSchemes$4[themeName] = {
|
|
295
|
+
"--foreground": "var(--color-grey-1000)",
|
|
296
|
+
"--foreground-7-plus": "var(--color-white)",
|
|
297
|
+
...generateColors({
|
|
298
|
+
prefix: "base",
|
|
299
|
+
colorName: config.colorName,
|
|
300
|
+
color0: config.color0
|
|
301
|
+
})
|
|
302
|
+
};
|
|
303
|
+
});
|
|
304
|
+
Object.entries(accents).forEach(([name, config]) => {
|
|
305
|
+
colorSchemes$4[`accent-${name}`] = generateColors({
|
|
306
|
+
prefix: "accent",
|
|
307
|
+
colorName: config.colorName,
|
|
308
|
+
color0: config.color0
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
})();
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/experiments/color-scheme/ColorScheme.tsx
|
|
314
|
+
/**
|
|
315
|
+
* @experimental Component has not been finalised. Further design input required. Use with caution.
|
|
316
|
+
*/
|
|
317
|
+
var ColorScheme = ({ ref, base = "", accent = "", interactive, asChild = false, ...rest }) => {
|
|
318
|
+
const Component = asChild ? _radix_ui_react_slot.Slot : "div";
|
|
319
|
+
const style = {
|
|
320
|
+
...interactive && colorSchemes$4[`interactive-${interactive}`],
|
|
321
|
+
...accent && colorSchemes$4[`accent-${accent}`],
|
|
322
|
+
...base && colorSchemes$4[`base-${base}`]
|
|
323
|
+
};
|
|
324
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
325
|
+
...rest,
|
|
326
|
+
ref,
|
|
327
|
+
style
|
|
328
|
+
});
|
|
329
|
+
};
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region src/components/icon/Icon.tsx
|
|
332
|
+
var StyledIcon$3 = styled("svg", {
|
|
237
333
|
base: [
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
-
"
|
|
241
|
-
"
|
|
242
|
-
"
|
|
243
|
-
"
|
|
334
|
+
"inline-block",
|
|
335
|
+
"fill-none",
|
|
336
|
+
"shrink-0",
|
|
337
|
+
"stroke-current",
|
|
338
|
+
"[stroke-linecap:round]",
|
|
339
|
+
"[stroke-linejoin:round]",
|
|
340
|
+
"align-middle"
|
|
244
341
|
],
|
|
245
342
|
variants: { size: {
|
|
246
|
-
sm: ["size-
|
|
247
|
-
md: ["size-
|
|
248
|
-
lg: ["size-
|
|
343
|
+
sm: ["size-4", "stroke-[1.5]"],
|
|
344
|
+
md: ["size-6", "stroke-[1.75]"],
|
|
345
|
+
lg: ["size-8", "stroke-2"]
|
|
249
346
|
} }
|
|
250
|
-
});
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
|
|
347
|
+
}, { enableResponsiveVariants: true });
|
|
348
|
+
var Icon = ({ ref, is: SVG, size = "md", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIcon$3, {
|
|
349
|
+
size,
|
|
350
|
+
"aria-hidden": "true",
|
|
254
351
|
...rest,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
className: "sr-only",
|
|
258
|
-
children: message
|
|
259
|
-
}),
|
|
260
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size }),
|
|
261
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size }),
|
|
262
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size })
|
|
263
|
-
]
|
|
352
|
+
as: SVG,
|
|
353
|
+
ref
|
|
264
354
|
});
|
|
265
355
|
//#endregion
|
|
266
|
-
//#region src/components/
|
|
267
|
-
var
|
|
356
|
+
//#region src/components/accordion/AccordionTrigger.tsx
|
|
357
|
+
var RotatingIcon = styled(Icon, { base: [
|
|
358
|
+
"transition-transform",
|
|
359
|
+
"duration-300",
|
|
360
|
+
"[[data-state=open]>&]:rotate-180",
|
|
361
|
+
"[[data-state=closed]>&]:rotate-0"
|
|
362
|
+
] });
|
|
363
|
+
var StyledTrigger$1 = styled(_radix_ui_react_accordion.Trigger, {
|
|
268
364
|
base: [
|
|
365
|
+
"border-none",
|
|
366
|
+
"py-3",
|
|
367
|
+
"px-4",
|
|
368
|
+
"w-full",
|
|
369
|
+
"flex",
|
|
370
|
+
"justify-between",
|
|
269
371
|
"items-center",
|
|
270
|
-
"bg-[unset]",
|
|
271
|
-
"rounded-md",
|
|
272
372
|
"cursor-pointer",
|
|
273
|
-
"
|
|
274
|
-
"
|
|
275
|
-
"font-semibold",
|
|
276
|
-
"justify-center",
|
|
277
|
-
"no-underline",
|
|
278
|
-
"transition-all",
|
|
279
|
-
"duration-100",
|
|
280
|
-
"ease-out",
|
|
281
|
-
"whitespace-nowrap",
|
|
282
|
-
"w-max",
|
|
373
|
+
"bg-(--interactive-2)",
|
|
374
|
+
"text-(--interactive-foreground)",
|
|
283
375
|
"disabled:cursor-not-allowed",
|
|
284
|
-
"disabled:opacity-30"
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
"[--active:var(--color-primary-1200)]"
|
|
297
|
-
],
|
|
298
|
-
success: [
|
|
299
|
-
"[--base:var(--color-success)]",
|
|
300
|
-
"[--interact:var(--color-success-mid)]",
|
|
301
|
-
"[--active:var(--color-success-dark)]"
|
|
302
|
-
],
|
|
303
|
-
warning: [
|
|
304
|
-
"[--base:var(--color-warning)]",
|
|
305
|
-
"[--interact:var(--color-warning-mid)]",
|
|
306
|
-
"[--active:var(--color-warning-dark)]",
|
|
307
|
-
"[--text:var(--color-grey-800)]"
|
|
308
|
-
],
|
|
309
|
-
danger: [
|
|
310
|
-
"[--base:var(--color-danger)]",
|
|
311
|
-
"[--interact:var(--color-danger-mid)]",
|
|
312
|
-
"[--active:var(--color-danger-dark)]"
|
|
313
|
-
],
|
|
314
|
-
neutral: [
|
|
315
|
-
"[--base:white]",
|
|
316
|
-
"[--interact:rgba(255,255,255,0.9)]",
|
|
317
|
-
"[--active:rgba(255,255,255,0.75)]",
|
|
318
|
-
"[--text:var(--color-primary-800)]"
|
|
319
|
-
]
|
|
320
|
-
},
|
|
321
|
-
appearance: {
|
|
322
|
-
solid: [
|
|
323
|
-
"bg-(--base)",
|
|
324
|
-
"text-(--text,white)",
|
|
325
|
-
"disabled:opacity-30",
|
|
326
|
-
"disabled:cursor-not-allowed",
|
|
327
|
-
"not-disabled:hover:bg-(--interact)",
|
|
328
|
-
"not-disabled:hover:text-(--text,white)",
|
|
329
|
-
"not-disabled:focus:bg-(--interact)",
|
|
330
|
-
"not-disabled:focus:text-(--text,white)",
|
|
331
|
-
"not-disabled:active:bg-(--active)"
|
|
332
|
-
],
|
|
333
|
-
outline: [
|
|
334
|
-
"border",
|
|
335
|
-
"border-current",
|
|
336
|
-
"text-(--base)",
|
|
337
|
-
"disabled:opacity-30",
|
|
338
|
-
"disabled:cursor-not-allowed",
|
|
339
|
-
"not-disabled:hover:no-underline",
|
|
340
|
-
"not-disabled:hover:text-(--interact)",
|
|
341
|
-
"not-disabled:focus:no-underline",
|
|
342
|
-
"not-disabled:focus:text-(--interact)",
|
|
343
|
-
"not-disabled:active:text-(--active)"
|
|
344
|
-
]
|
|
345
|
-
},
|
|
346
|
-
size: {
|
|
347
|
-
sm: [
|
|
348
|
-
"text-sm",
|
|
349
|
-
"leading-[1.53]",
|
|
350
|
-
"h-8",
|
|
351
|
-
"px-4",
|
|
352
|
-
"gap-2",
|
|
353
|
-
"[&_svg]:size-4"
|
|
354
|
-
],
|
|
355
|
-
md: [
|
|
356
|
-
"text-md",
|
|
357
|
-
"leading-normal",
|
|
358
|
-
"h-10",
|
|
359
|
-
"px-8",
|
|
360
|
-
"gap-3",
|
|
361
|
-
"[&_svg]:size-5"
|
|
362
|
-
],
|
|
363
|
-
lg: [
|
|
364
|
-
"text-lg",
|
|
365
|
-
"leading-normal",
|
|
366
|
-
"h-12",
|
|
367
|
-
"px-8",
|
|
368
|
-
"gap-3",
|
|
369
|
-
"[&_svg]:size-[22px]"
|
|
370
|
-
],
|
|
371
|
-
xl: [
|
|
372
|
-
"text-lg",
|
|
373
|
-
"leading-normal",
|
|
374
|
-
"h-16",
|
|
375
|
-
"px-8",
|
|
376
|
-
"gap-3",
|
|
377
|
-
"[&_svg]:size-[22px]"
|
|
378
|
-
]
|
|
379
|
-
},
|
|
380
|
-
isLoading: { true: [
|
|
381
|
-
"cursor-not-allowed",
|
|
382
|
-
"opacity-60",
|
|
383
|
-
"pointer-events-none"
|
|
384
|
-
] },
|
|
385
|
-
fullWidth: {
|
|
386
|
-
true: ["w-full"],
|
|
387
|
-
false: ["w-max"]
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
defaultVariants: {
|
|
391
|
-
appearance: "solid",
|
|
392
|
-
size: "md",
|
|
393
|
-
theme: "primary"
|
|
394
|
-
}
|
|
395
|
-
}, { enableResponsiveVariants: true });
|
|
396
|
-
// @__PURE__ keeps this tree-shakable for consumers importing only
|
|
397
|
-
var LoaderContentsWrapper = /* @__PURE__ */ styled("span", {
|
|
398
|
-
base: [
|
|
399
|
-
"items-center",
|
|
400
|
-
"flex",
|
|
401
|
-
"justify-center",
|
|
402
|
-
"invisible"
|
|
403
|
-
],
|
|
404
|
-
variants: { size: {
|
|
405
|
-
sm: ["gap-2"],
|
|
406
|
-
md: ["gap-3"],
|
|
407
|
-
lg: ["gap-3"],
|
|
408
|
-
xl: ["gap-3"]
|
|
409
|
-
} },
|
|
410
|
-
defaultVariants: { size: "md" }
|
|
411
|
-
}, { enableResponsiveVariants: true });
|
|
412
|
-
var WithLoader = ({ size, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Loader, { className: "absolute" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoaderContentsWrapper, {
|
|
413
|
-
size,
|
|
414
|
-
children
|
|
415
|
-
})] });
|
|
416
|
-
var Button = (({ ref, children, as, href, isLoading = false, onClick, disabled, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton, {
|
|
417
|
-
as: as || (href ? "a" : void 0),
|
|
418
|
-
...!disabled && !isLoading && {
|
|
419
|
-
href,
|
|
420
|
-
onClick
|
|
421
|
-
},
|
|
422
|
-
isLoading,
|
|
423
|
-
type: !href ? "button" : void 0,
|
|
424
|
-
disabled,
|
|
425
|
-
...rest,
|
|
426
|
-
...getExternalAnchorProps(href),
|
|
427
|
-
ref,
|
|
428
|
-
children: isLoading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WithLoader, {
|
|
429
|
-
size: rest.size,
|
|
430
|
-
children
|
|
431
|
-
}) : children
|
|
432
|
-
}));
|
|
433
|
-
//#endregion
|
|
434
|
-
//#region src/components/heading/Heading.tsx
|
|
435
|
-
var Heading = styled("h2", {
|
|
436
|
-
base: ["m-0"],
|
|
437
|
-
variants: {
|
|
438
|
-
size: {
|
|
439
|
-
xs: [
|
|
440
|
-
"font-body",
|
|
441
|
-
"text-md",
|
|
442
|
-
"leading-normal",
|
|
443
|
-
"capsize-[0.3864]"
|
|
444
|
-
],
|
|
445
|
-
sm: [
|
|
446
|
-
"font-body",
|
|
447
|
-
"text-lg",
|
|
448
|
-
"leading-[1.14]",
|
|
449
|
-
"capsize-[0.2078]"
|
|
450
|
-
],
|
|
451
|
-
md: [
|
|
452
|
-
"font-display",
|
|
453
|
-
"text-xl",
|
|
454
|
-
"leading-[1.14]",
|
|
455
|
-
"tracking-[0.01em]",
|
|
456
|
-
"capsize-before-[0.2114]",
|
|
457
|
-
"capsize-after-[0.2634]"
|
|
458
|
-
],
|
|
459
|
-
lg: [
|
|
460
|
-
"font-display",
|
|
461
|
-
"text-2xl",
|
|
462
|
-
"leading-[1.08]",
|
|
463
|
-
"tracking-[0.01em]",
|
|
464
|
-
"capsize-before-[0.1405]",
|
|
465
|
-
"capsize-after-[0.2405]"
|
|
466
|
-
],
|
|
467
|
-
xl: [
|
|
468
|
-
"font-display",
|
|
469
|
-
"text-3xl",
|
|
470
|
-
"leading-[1.12]",
|
|
471
|
-
"capsize-before-[0.16]",
|
|
472
|
-
"capsize-after-[0.26]"
|
|
473
|
-
],
|
|
474
|
-
xxl: [
|
|
475
|
-
"font-display",
|
|
476
|
-
"text-4xl",
|
|
477
|
-
"leading-none",
|
|
478
|
-
"capsize-before-[0.1]",
|
|
479
|
-
"capsize-after-[0.2]"
|
|
480
|
-
]
|
|
481
|
-
},
|
|
482
|
-
noCapsize: { true: ["capsize-none"] },
|
|
483
|
-
weight: {
|
|
484
|
-
medium: ["font-medium"],
|
|
485
|
-
bold: ["font-bold"]
|
|
486
|
-
}
|
|
487
|
-
},
|
|
488
|
-
defaultVariants: {
|
|
489
|
-
size: "md",
|
|
490
|
-
weight: "bold"
|
|
491
|
-
}
|
|
492
|
-
}, { enableResponsiveVariants: true });
|
|
493
|
-
//#endregion
|
|
494
|
-
//#region src/components/text/Text.tsx
|
|
495
|
-
var Text = styled("p", {
|
|
496
|
-
base: ["m-0"],
|
|
497
|
-
variants: {
|
|
498
|
-
size: {
|
|
499
|
-
xs: [
|
|
500
|
-
"text-xs",
|
|
501
|
-
"leading-[1.6]",
|
|
502
|
-
"capsize-[0.4364]"
|
|
503
|
-
],
|
|
504
|
-
sm: [
|
|
505
|
-
"text-sm",
|
|
506
|
-
"leading-[1.53]",
|
|
507
|
-
"capsize-[0.4056]"
|
|
508
|
-
],
|
|
509
|
-
md: [
|
|
510
|
-
"text-md",
|
|
511
|
-
"leading-normal",
|
|
512
|
-
"capsize-[0.3864]"
|
|
513
|
-
],
|
|
514
|
-
lg: [
|
|
515
|
-
"text-lg",
|
|
516
|
-
"leading-[1.52]",
|
|
517
|
-
"capsize-[0.3983]"
|
|
518
|
-
],
|
|
519
|
-
xl: [
|
|
520
|
-
"text-xl",
|
|
521
|
-
"leading-[1.42]",
|
|
522
|
-
"capsize-[0.3506]"
|
|
523
|
-
],
|
|
524
|
-
"2xl": [
|
|
525
|
-
"text-2xl",
|
|
526
|
-
"leading-[1.40]",
|
|
527
|
-
"capsize-[0.3336]"
|
|
528
|
-
],
|
|
529
|
-
"3xl": [
|
|
530
|
-
"text-3xl",
|
|
531
|
-
"leading-[1.28]",
|
|
532
|
-
"capsize-[0.2709]"
|
|
533
|
-
],
|
|
534
|
-
"4xl": [
|
|
535
|
-
"text-4xl",
|
|
536
|
-
"leading-none",
|
|
537
|
-
"capsize-[0.1309]"
|
|
538
|
-
]
|
|
539
|
-
},
|
|
540
|
-
noCapsize: { true: ["capsize-none"] },
|
|
541
|
-
weight: {
|
|
542
|
-
normal: ["font-normal"],
|
|
543
|
-
bold: ["font-semibold"]
|
|
544
|
-
},
|
|
545
|
-
family: {
|
|
546
|
-
body: ["font-body"],
|
|
547
|
-
display: ["font-display"],
|
|
548
|
-
mono: ["font-mono"]
|
|
549
|
-
}
|
|
550
|
-
},
|
|
551
|
-
defaultVariants: {
|
|
552
|
-
size: "md",
|
|
553
|
-
family: "body"
|
|
554
|
-
}
|
|
555
|
-
}, { enableResponsiveVariants: true });
|
|
556
|
-
//#endregion
|
|
557
|
-
//#region src/components/alert-dialog/AlertDialogContent.tsx
|
|
558
|
-
var StyledAlertDialogOverlay = styled(_radix_ui_react_alert_dialog.Overlay, { base: [
|
|
559
|
-
"bg-alpha-600",
|
|
560
|
-
"top-0",
|
|
561
|
-
"right-0",
|
|
562
|
-
"bottom-0",
|
|
563
|
-
"left-0",
|
|
564
|
-
"fixed",
|
|
565
|
-
"z-1147483646",
|
|
566
|
-
"motion-safe:data-[state=open]:animate-fade-in",
|
|
567
|
-
"motion-safe:data-[state=closed]:animate-fade-out"
|
|
568
|
-
] });
|
|
569
|
-
var StyledAlertDialogContent = styled(_radix_ui_react_alert_dialog.Content, {
|
|
570
|
-
base: [
|
|
571
|
-
"transform-[translate(-50%,-50%)]",
|
|
572
|
-
"bg-white",
|
|
573
|
-
"rounded-md",
|
|
574
|
-
"shadow-xl",
|
|
575
|
-
"box-border",
|
|
576
|
-
"left-1/2",
|
|
577
|
-
"max-w-[90vw]",
|
|
578
|
-
"p-8",
|
|
579
|
-
"fixed",
|
|
580
|
-
"top-1/2",
|
|
581
|
-
"focus:outline-none",
|
|
582
|
-
"z-1147483646",
|
|
583
|
-
"motion-safe:data-[state=open]:animate-slide-in-center",
|
|
584
|
-
"motion-safe:data-[state=closed]:animate-slide-out-center"
|
|
585
|
-
],
|
|
586
|
-
variants: { size: {
|
|
587
|
-
sm: ["w-95"],
|
|
588
|
-
md: ["w-120"],
|
|
589
|
-
lg: ["w-150"]
|
|
590
|
-
} }
|
|
591
|
-
});
|
|
592
|
-
var AlertDialogContent = ({ size = "sm", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_alert_dialog.Portal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAlertDialogOverlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAlertDialogContent, {
|
|
593
|
-
size,
|
|
594
|
-
...rest
|
|
595
|
-
})] });
|
|
596
|
-
//#endregion
|
|
597
|
-
//#region src/components/alert-dialog/AlertDialog.tsx
|
|
598
|
-
var AlertDialog = /* @__PURE__ */ Object.assign(_radix_ui_react_alert_dialog.Root, {
|
|
599
|
-
Description: _radix_ui_react_alert_dialog.Description,
|
|
600
|
-
Title: _radix_ui_react_alert_dialog.Title,
|
|
601
|
-
Action: _radix_ui_react_alert_dialog.Action,
|
|
602
|
-
Cancel: _radix_ui_react_alert_dialog.Cancel,
|
|
603
|
-
Content: AlertDialogContent,
|
|
604
|
-
Trigger: _radix_ui_react_alert_dialog.Trigger
|
|
605
|
-
});
|
|
606
|
-
AlertDialog.displayName = "AlertDialog";
|
|
607
|
-
//#endregion
|
|
608
|
-
//#region src/components/icon/Icon.tsx
|
|
609
|
-
var StyledIcon$3 = styled("svg", {
|
|
610
|
-
base: [
|
|
611
|
-
"inline-block",
|
|
612
|
-
"fill-none",
|
|
613
|
-
"shrink-0",
|
|
614
|
-
"stroke-current",
|
|
615
|
-
"[stroke-linecap:round]",
|
|
616
|
-
"[stroke-linejoin:round]",
|
|
617
|
-
"align-middle"
|
|
618
|
-
],
|
|
619
|
-
variants: { size: {
|
|
620
|
-
sm: ["size-4", "stroke-[1.5]"],
|
|
621
|
-
md: ["size-6", "stroke-[1.75]"],
|
|
622
|
-
lg: ["size-8", "stroke-2"]
|
|
623
|
-
} }
|
|
624
|
-
}, { enableResponsiveVariants: true });
|
|
625
|
-
var Icon = ({ ref, is: SVG, size = "md", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIcon$3, {
|
|
626
|
-
size,
|
|
627
|
-
"aria-hidden": "true",
|
|
628
|
-
...rest,
|
|
629
|
-
as: SVG,
|
|
630
|
-
ref
|
|
631
|
-
});
|
|
632
|
-
//#endregion
|
|
633
|
-
//#region src/components/alert-dialog/alert-context/AlertDialogIcon.tsx
|
|
634
|
-
var StyledIcon$2 = styled(Icon, {
|
|
635
|
-
base: ["self-start"],
|
|
636
|
-
variants: { theme: {
|
|
637
|
-
info: ["text-info"],
|
|
638
|
-
warning: ["text-warning-mid"],
|
|
639
|
-
danger: ["rotate-180", "text-danger"],
|
|
640
|
-
success: ["text-success"]
|
|
641
|
-
} }
|
|
642
|
-
});
|
|
643
|
-
var iconMap = {
|
|
644
|
-
info: _atom_learning_icons.Info,
|
|
645
|
-
warning: _atom_learning_icons.Danger,
|
|
646
|
-
danger: _atom_learning_icons.Info,
|
|
647
|
-
success: _atom_learning_icons.OkCircle
|
|
648
|
-
};
|
|
649
|
-
var AlertDialogIcon = ({ theme }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIcon$2, {
|
|
650
|
-
theme,
|
|
651
|
-
is: iconMap[theme]
|
|
652
|
-
});
|
|
653
|
-
//#endregion
|
|
654
|
-
//#region src/components/alert-dialog/alert-context/AlertDialog.tsx
|
|
655
|
-
var Alert$1 = ({ title, size, theme, description, onAction, cancelActionText, confirmActionText, onClose, confirmElement, cancelElement, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog, {
|
|
656
|
-
defaultOpen: true,
|
|
657
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AlertDialog.Content, {
|
|
658
|
-
size,
|
|
659
|
-
onEscapeKeyDown: (e) => e.preventDefault(),
|
|
660
|
-
onCloseAutoFocus: onClose,
|
|
661
|
-
...rest,
|
|
662
|
-
className: "flex max-h-[90vh] flex-col gap-8",
|
|
663
|
-
children: [
|
|
664
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
665
|
-
className: "flex items-center gap-2",
|
|
666
|
-
children: [theme && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialogIcon, { theme }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
667
|
-
as: AlertDialog.Title,
|
|
668
|
-
size: "sm",
|
|
669
|
-
className: "mr-4",
|
|
670
|
-
children: title
|
|
671
|
-
})]
|
|
672
|
-
}),
|
|
673
|
-
description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
|
|
674
|
-
as: AlertDialog.Description,
|
|
675
|
-
className: "flex overflow-y-auto",
|
|
676
|
-
children: description
|
|
677
|
-
}),
|
|
678
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
679
|
-
className: "flex flex-wrap justify-end gap-2",
|
|
680
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog.Cancel, {
|
|
681
|
-
asChild: true,
|
|
682
|
-
children: cancelElement || cancelActionText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
683
|
-
size: "sm",
|
|
684
|
-
appearance: "outline",
|
|
685
|
-
onClick: () => onAction?.(false),
|
|
686
|
-
children: cancelActionText
|
|
687
|
-
})
|
|
688
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog.Action, {
|
|
689
|
-
asChild: true,
|
|
690
|
-
children: confirmElement || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
691
|
-
size: "sm",
|
|
692
|
-
onClick: () => onAction?.(true),
|
|
693
|
-
children: confirmActionText
|
|
694
|
-
})
|
|
695
|
-
})]
|
|
696
|
-
})
|
|
697
|
-
]
|
|
698
|
-
})
|
|
699
|
-
});
|
|
700
|
-
//#endregion
|
|
701
|
-
//#region src/components/alert-dialog/alert-context/reducer.ts
|
|
702
|
-
var initialState = [];
|
|
703
|
-
var reducer = (state, action) => {
|
|
704
|
-
switch (action.type) {
|
|
705
|
-
case "ADD": return [...state, action.payload];
|
|
706
|
-
case "REMOVE": return state.filter(({ id }) => id !== action.payload);
|
|
707
|
-
default: return state;
|
|
708
|
-
}
|
|
709
|
-
};
|
|
710
|
-
//#endregion
|
|
711
|
-
//#region src/components/alert-dialog/AlertDialog.context.tsx
|
|
712
|
-
var AlertContext = react.createContext(void 0);
|
|
713
|
-
var AlertProvider = ({ children }) => {
|
|
714
|
-
const [alerts, dispatch] = react.useReducer(reducer, initialState);
|
|
715
|
-
const isMountedRef = useIsMountedRef();
|
|
716
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AlertContext, {
|
|
717
|
-
value: react.useMemo(() => ({ showAlert: (content) => dispatch({
|
|
718
|
-
payload: {
|
|
719
|
-
...content,
|
|
720
|
-
id: crypto.randomUUID()
|
|
721
|
-
},
|
|
722
|
-
type: "ADD"
|
|
723
|
-
}) }), []),
|
|
724
|
-
children: [Boolean(alerts.length) && /* @__PURE__ */ (0, react.createElement)(Alert$1, {
|
|
725
|
-
...alerts[0],
|
|
726
|
-
key: alerts[0].id,
|
|
727
|
-
onClose: () => {
|
|
728
|
-
if (isMountedRef.current) dispatch({
|
|
729
|
-
payload: alerts[0].id,
|
|
730
|
-
type: "REMOVE"
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
}), children]
|
|
734
|
-
});
|
|
735
|
-
};
|
|
736
|
-
var useAlert = () => {
|
|
737
|
-
const context = react.use(AlertContext);
|
|
738
|
-
if (context === void 0) throw new Error("useAlert must be used within a AlertProvider");
|
|
739
|
-
return context;
|
|
740
|
-
};
|
|
741
|
-
//#endregion
|
|
742
|
-
//#region src/utilities/css-wrapper/CSSWrapper.tsx
|
|
743
|
-
var CSSWrapper = ({ className, children }) => className ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
744
|
-
className,
|
|
745
|
-
children
|
|
746
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
|
|
747
|
-
CSSWrapper.displayName = "CSSWrapper";
|
|
748
|
-
//#endregion
|
|
749
|
-
//#region src/components/accordion/AccordionContent.tsx
|
|
750
|
-
var StyledContent$4 = styled(_radix_ui_react_accordion.Content, { base: [
|
|
751
|
-
"border-none",
|
|
752
|
-
"w-full",
|
|
753
|
-
"bg-(--base-1)",
|
|
754
|
-
"overflow-hidden",
|
|
755
|
-
"data-[state=open]:rounded-b-sm",
|
|
756
|
-
"data-[state=open]:rounded-t-none",
|
|
757
|
-
"motion-safe:data-[state=open]:animate-accordion-open",
|
|
758
|
-
"motion-safe:data-[state=closed]:animate-accordion-close"
|
|
759
|
-
] });
|
|
760
|
-
var AccordionContent = ({ children, className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledContent$4, {
|
|
761
|
-
...rest,
|
|
762
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CSSWrapper, {
|
|
763
|
-
className,
|
|
764
|
-
children
|
|
765
|
-
})
|
|
766
|
-
});
|
|
767
|
-
//#endregion
|
|
768
|
-
//#region src/components/accordion/AccordionItem.tsx
|
|
769
|
-
var AccordionItem = styled(_radix_ui_react_accordion.Item, { base: ["w-full", "not-last:mb-1"] }, { enablePolymorphism: false });
|
|
770
|
-
//#endregion
|
|
771
|
-
//#region src/experiments/color-scheme/ColorScheme.config.ts
|
|
772
|
-
var generateColors = ({ prefix, colorName, color0 = "" }) => {
|
|
773
|
-
const colors = {};
|
|
774
|
-
let i = 1;
|
|
775
|
-
if (color0) {
|
|
776
|
-
colors[`--${prefix}-${i}`] = `var(--color-${color0})`;
|
|
777
|
-
i++;
|
|
778
|
-
}
|
|
779
|
-
let k = 1;
|
|
780
|
-
for (; i <= 11; i++) {
|
|
781
|
-
colors[`--${prefix}-${i}`] = `var(--color-${colorName}-${k * 100})`;
|
|
782
|
-
k++;
|
|
783
|
-
}
|
|
784
|
-
return colors;
|
|
785
|
-
};
|
|
786
|
-
var colorSchemes$4 = {};
|
|
787
|
-
colorSchemes$4["interactive-loContrast"] = {
|
|
788
|
-
"--interactive-foreground": "var(--foreground)",
|
|
789
|
-
"--interactive-1": "var(--accent-1)",
|
|
790
|
-
"--interactive-2": "var(--accent-2)",
|
|
791
|
-
"--interactive-3": "var(--accent-3)"
|
|
792
|
-
};
|
|
793
|
-
colorSchemes$4["interactive-hiContrast"] = {
|
|
794
|
-
"--interactive-foreground": "var(--foreground-7-plus)",
|
|
795
|
-
"--interactive-1": "var(--accent-9)",
|
|
796
|
-
"--interactive-2": "var(--accent-10)",
|
|
797
|
-
"--interactive-3": "var(--accent-11)"
|
|
798
|
-
};
|
|
799
|
-
var colorNames = [
|
|
800
|
-
"primary",
|
|
801
|
-
"grey",
|
|
802
|
-
"blue",
|
|
803
|
-
"pink",
|
|
804
|
-
"purple",
|
|
805
|
-
"cyan",
|
|
806
|
-
"green",
|
|
807
|
-
"magenta",
|
|
808
|
-
"red",
|
|
809
|
-
"teal",
|
|
810
|
-
"orange",
|
|
811
|
-
"yellow",
|
|
812
|
-
"lime"
|
|
813
|
-
];
|
|
814
|
-
var createVariants = () => Object.fromEntries(colorNames.flatMap((c) => [[`${c}1`, {
|
|
815
|
-
colorName: c,
|
|
816
|
-
color0: "white"
|
|
817
|
-
}], [`${c}2`, { colorName: c }]]));
|
|
818
|
-
var bases = createVariants();
|
|
819
|
-
var accents = bases;
|
|
820
|
-
(() => {
|
|
821
|
-
Object.entries(bases).forEach(([name, config]) => {
|
|
822
|
-
const themeName = `base-${name}`;
|
|
823
|
-
colorSchemes$4[themeName] = {
|
|
824
|
-
"--foreground": "var(--color-grey-1000)",
|
|
825
|
-
"--foreground-7-plus": "var(--color-white)",
|
|
826
|
-
...generateColors({
|
|
827
|
-
prefix: "base",
|
|
828
|
-
colorName: config.colorName,
|
|
829
|
-
color0: config.color0
|
|
830
|
-
})
|
|
831
|
-
};
|
|
832
|
-
});
|
|
833
|
-
Object.entries(accents).forEach(([name, config]) => {
|
|
834
|
-
colorSchemes$4[`accent-${name}`] = generateColors({
|
|
835
|
-
prefix: "accent",
|
|
836
|
-
colorName: config.colorName,
|
|
837
|
-
color0: config.color0
|
|
838
|
-
});
|
|
839
|
-
});
|
|
840
|
-
})();
|
|
841
|
-
//#endregion
|
|
842
|
-
//#region src/experiments/color-scheme/ColorScheme.tsx
|
|
843
|
-
/**
|
|
844
|
-
* @experimental Component has not been finalised. Further design input required. Use with caution.
|
|
845
|
-
*/
|
|
846
|
-
var ColorScheme = ({ ref, base = "", accent = "", interactive, asChild = false, ...rest }) => {
|
|
847
|
-
const Component = asChild ? _radix_ui_react_slot.Slot : "div";
|
|
848
|
-
const style = {
|
|
849
|
-
...interactive && colorSchemes$4[`interactive-${interactive}`],
|
|
850
|
-
...accent && colorSchemes$4[`accent-${accent}`],
|
|
851
|
-
...base && colorSchemes$4[`base-${base}`]
|
|
852
|
-
};
|
|
853
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
854
|
-
...rest,
|
|
855
|
-
ref,
|
|
856
|
-
style
|
|
857
|
-
});
|
|
858
|
-
};
|
|
859
|
-
//#endregion
|
|
860
|
-
//#region src/components/accordion/AccordionTrigger.tsx
|
|
861
|
-
var RotatingIcon = styled(Icon, { base: [
|
|
862
|
-
"transition-transform",
|
|
863
|
-
"duration-300",
|
|
864
|
-
"[[data-state=open]>&]:rotate-180",
|
|
865
|
-
"[[data-state=closed]>&]:rotate-0"
|
|
866
|
-
] });
|
|
867
|
-
var StyledTrigger$1 = styled(_radix_ui_react_accordion.Trigger, {
|
|
868
|
-
base: [
|
|
869
|
-
"border-none",
|
|
870
|
-
"py-3",
|
|
871
|
-
"px-4",
|
|
872
|
-
"w-full",
|
|
873
|
-
"flex",
|
|
874
|
-
"justify-between",
|
|
875
|
-
"items-center",
|
|
876
|
-
"cursor-pointer",
|
|
877
|
-
"bg-(--interactive-2)",
|
|
878
|
-
"text-(--interactive-foreground)",
|
|
879
|
-
"disabled:cursor-not-allowed",
|
|
880
|
-
"disabled:opacity-30",
|
|
881
|
-
"not-disabled:active:bg-(--interactive-3)",
|
|
882
|
-
"not-disabled:focus-visible:bg-(--interactive-3)",
|
|
883
|
-
"not-disabled:focus-visible:outline-none",
|
|
884
|
-
"not-disabled:focus-visible:relative",
|
|
885
|
-
"not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
|
|
886
|
-
"not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]",
|
|
887
|
-
"not-disabled:focus-visible:z-1",
|
|
888
|
-
"not-disabled:hover:bg-(--interactive-3)",
|
|
889
|
-
"data-[state=open]:rounded-b-none",
|
|
890
|
-
"data-[state=open]:rounded-t-sm",
|
|
891
|
-
"data-[state=closed]:rounded-sm"
|
|
376
|
+
"disabled:opacity-30",
|
|
377
|
+
"not-disabled:active:bg-(--interactive-3)",
|
|
378
|
+
"not-disabled:focus-visible:bg-(--interactive-3)",
|
|
379
|
+
"not-disabled:focus-visible:outline-none",
|
|
380
|
+
"not-disabled:focus-visible:relative",
|
|
381
|
+
"not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]",
|
|
382
|
+
"not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]",
|
|
383
|
+
"not-disabled:focus-visible:z-1",
|
|
384
|
+
"not-disabled:hover:bg-(--interactive-3)",
|
|
385
|
+
"data-[state=open]:rounded-b-none",
|
|
386
|
+
"data-[state=open]:rounded-t-sm",
|
|
387
|
+
"data-[state=closed]:rounded-sm"
|
|
892
388
|
],
|
|
893
389
|
variants: { arrowPosition: {
|
|
894
390
|
left: [
|
|
@@ -1000,142 +496,646 @@ var OptionalTooltipWrapper = ({ hasTooltip, label, tooltipSide, children }) => {
|
|
|
1000
496
|
})] });
|
|
1001
497
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
|
|
1002
498
|
};
|
|
1003
|
-
OptionalTooltipWrapper.displayName = "OptionalTooltipWrapper";
|
|
499
|
+
OptionalTooltipWrapper.displayName = "OptionalTooltipWrapper";
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/utilities/uri/index.ts
|
|
502
|
+
var isExternalUrl = (url) => !!url && /^https?:\/\//.test(url);
|
|
503
|
+
var getExternalAnchorProps = (url) => isExternalUrl(url) ? {
|
|
504
|
+
target: "_blank",
|
|
505
|
+
rel: "noopener noreferrer"
|
|
506
|
+
} : {};
|
|
507
|
+
//#endregion
|
|
508
|
+
//#region src/components/action-icon/ActionIcon.constants.ts
|
|
509
|
+
var ActionIconSizeMap = {
|
|
510
|
+
xs: "sm",
|
|
511
|
+
sm: "sm",
|
|
512
|
+
md: "md",
|
|
513
|
+
lg: "lg"
|
|
514
|
+
};
|
|
515
|
+
//#endregion
|
|
516
|
+
//#region src/components/action-icon/ActionIcon.tsx
|
|
517
|
+
var StyledButton$5 = styled("button", {
|
|
518
|
+
base: [
|
|
519
|
+
"items-center",
|
|
520
|
+
"appearance-none",
|
|
521
|
+
"bg-white",
|
|
522
|
+
"rounded-md",
|
|
523
|
+
"box-border",
|
|
524
|
+
"cursor-pointer",
|
|
525
|
+
"flex",
|
|
526
|
+
"shrink-0",
|
|
527
|
+
"justify-center",
|
|
528
|
+
"transition-all",
|
|
529
|
+
"duration-100",
|
|
530
|
+
"ease-out",
|
|
531
|
+
"disabled:cursor-not-allowed",
|
|
532
|
+
"disabled:opacity-30"
|
|
533
|
+
],
|
|
534
|
+
variants: {
|
|
535
|
+
theme: {
|
|
536
|
+
neutral: [
|
|
537
|
+
"[--solid-base:var(--color-white)]",
|
|
538
|
+
"[--solid-interact:var(--color-grey-100)]",
|
|
539
|
+
"[--solid-active:var(--color-grey-200)]",
|
|
540
|
+
"[--solid-text:var(--color-grey-1200)]",
|
|
541
|
+
"[--base:var(--color-grey-700)]",
|
|
542
|
+
"[--interact:var(--color-primary-900)]",
|
|
543
|
+
"[--active:var(--color-primary-1100)]"
|
|
544
|
+
],
|
|
545
|
+
primary: [
|
|
546
|
+
"[--base:var(--color-primary-800)]",
|
|
547
|
+
"[--interact:var(--color-primary-900)]",
|
|
548
|
+
"[--active:var(--color-primary-1000)]"
|
|
549
|
+
],
|
|
550
|
+
primaryDark: [
|
|
551
|
+
"[--base:var(--color-primary-1000)]",
|
|
552
|
+
"[--interact:var(--color-primary-1100)]",
|
|
553
|
+
"[--active:var(--color-primary-1200)]"
|
|
554
|
+
],
|
|
555
|
+
success: [
|
|
556
|
+
"[--base:var(--color-success)]",
|
|
557
|
+
"[--interact:var(--color-success-mid)]",
|
|
558
|
+
"[--active:var(--color-success-dark)]"
|
|
559
|
+
],
|
|
560
|
+
warning: [
|
|
561
|
+
"[--base:var(--color-warning)]",
|
|
562
|
+
"[--interact:var(--color-warning-mid)]",
|
|
563
|
+
"[--active:var(--color-warning-dark)]"
|
|
564
|
+
],
|
|
565
|
+
danger: [
|
|
566
|
+
"[--base:var(--color-danger)]",
|
|
567
|
+
"[--interact:var(--color-danger-mid)]",
|
|
568
|
+
"[--active:var(--color-danger-dark)]"
|
|
569
|
+
],
|
|
570
|
+
white: [
|
|
571
|
+
"[--base:var(--color-white)]",
|
|
572
|
+
"[--interact:var(--color-white)]",
|
|
573
|
+
"[--active:var(--color-white)]"
|
|
574
|
+
]
|
|
575
|
+
},
|
|
576
|
+
appearance: {
|
|
577
|
+
simple: [
|
|
578
|
+
"bg-transparent",
|
|
579
|
+
"text-(--base)",
|
|
580
|
+
"not-disabled:hover:text-(--interact)",
|
|
581
|
+
"not-disabled:focus:text-(--interact)",
|
|
582
|
+
"not-disabled:active:text-(--active)"
|
|
583
|
+
],
|
|
584
|
+
outline: [
|
|
585
|
+
"bg-[unset]",
|
|
586
|
+
"border",
|
|
587
|
+
"border-current",
|
|
588
|
+
"text-(--base)",
|
|
589
|
+
"not-disabled:hover:text-(--interact)",
|
|
590
|
+
"not-disabled:focus:text-(--interact)",
|
|
591
|
+
"not-disabled:active:text-(--active)"
|
|
592
|
+
],
|
|
593
|
+
solid: [
|
|
594
|
+
"bg-(--solid-base,var(--base))",
|
|
595
|
+
"text-(--solid-text,white)",
|
|
596
|
+
"not-disabled:hover:bg-(--solid-interact,var(--interact))",
|
|
597
|
+
"not-disabled:hover:text-(--solid-text,white)",
|
|
598
|
+
"not-disabled:focus:bg-(--solid-interact,var(--interact))",
|
|
599
|
+
"not-disabled:focus:text-(--solid-text,white)",
|
|
600
|
+
"not-disabled:active:bg-(--solid-active,var(--active))"
|
|
601
|
+
]
|
|
602
|
+
},
|
|
603
|
+
size: {
|
|
604
|
+
xs: ["size-6"],
|
|
605
|
+
sm: ["size-8"],
|
|
606
|
+
md: ["size-10"],
|
|
607
|
+
lg: ["size-12"]
|
|
608
|
+
},
|
|
609
|
+
isRounded: { true: ["rounded-full"] }
|
|
610
|
+
}
|
|
611
|
+
}, { enableResponsiveVariants: true });
|
|
612
|
+
var ActionIcon = ({ ref, children, theme = "primary", appearance = "simple", size = "sm", label, href, disabled, hasTooltip = true, tooltipSide, ...rest }) => {
|
|
613
|
+
const INVALID_CHILDREN_MESSAGE = `A single ${Icon.name} component is permitted as a child of ActionIcon`;
|
|
614
|
+
(0, invariant.default)(react.Children.count(children) === 1, INVALID_CHILDREN_MESSAGE);
|
|
615
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OptionalTooltipWrapper, {
|
|
616
|
+
hasTooltip,
|
|
617
|
+
label,
|
|
618
|
+
tooltipSide,
|
|
619
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton$5, {
|
|
620
|
+
...href ? {
|
|
621
|
+
as: "a",
|
|
622
|
+
href: disabled ? void 0 : href,
|
|
623
|
+
onClick: void 0,
|
|
624
|
+
"aria-disabled": !!disabled
|
|
625
|
+
} : { type: "button" },
|
|
626
|
+
...getExternalAnchorProps(href),
|
|
627
|
+
...rest,
|
|
628
|
+
"aria-label": label,
|
|
629
|
+
theme,
|
|
630
|
+
appearance,
|
|
631
|
+
size,
|
|
632
|
+
ref,
|
|
633
|
+
disabled,
|
|
634
|
+
children: react.Children.map(children, (child) => {
|
|
635
|
+
if (!react.isValidElement(child)) throw new Error(INVALID_CHILDREN_MESSAGE);
|
|
636
|
+
(0, invariant.default)(child.type === Icon, `Children of type ${child?.type} aren't permitted. Only an ${Icon.name} component is allowed in ActionIcon`);
|
|
637
|
+
return react.cloneElement(child, { size: ActionIconSizeMap[size] });
|
|
638
|
+
})
|
|
639
|
+
})
|
|
640
|
+
});
|
|
641
|
+
};
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region src/components/alert-dialog/AlertDialogContent.tsx
|
|
644
|
+
var StyledAlertDialogOverlay = styled(_radix_ui_react_alert_dialog.Overlay, { base: [
|
|
645
|
+
"bg-alpha-600",
|
|
646
|
+
"top-0",
|
|
647
|
+
"right-0",
|
|
648
|
+
"bottom-0",
|
|
649
|
+
"left-0",
|
|
650
|
+
"fixed",
|
|
651
|
+
"z-1147483646",
|
|
652
|
+
"motion-safe:data-[state=open]:animate-fade-in",
|
|
653
|
+
"motion-safe:data-[state=closed]:animate-fade-out"
|
|
654
|
+
] });
|
|
655
|
+
var StyledAlertDialogContent = styled(_radix_ui_react_alert_dialog.Content, {
|
|
656
|
+
base: [
|
|
657
|
+
"transform-[translate(-50%,-50%)]",
|
|
658
|
+
"bg-white",
|
|
659
|
+
"rounded-md",
|
|
660
|
+
"shadow-xl",
|
|
661
|
+
"box-border",
|
|
662
|
+
"left-1/2",
|
|
663
|
+
"max-w-[90vw]",
|
|
664
|
+
"p-8",
|
|
665
|
+
"fixed",
|
|
666
|
+
"top-1/2",
|
|
667
|
+
"focus:outline-none",
|
|
668
|
+
"z-1147483646",
|
|
669
|
+
"motion-safe:data-[state=open]:animate-slide-in-center",
|
|
670
|
+
"motion-safe:data-[state=closed]:animate-slide-out-center"
|
|
671
|
+
],
|
|
672
|
+
variants: { size: {
|
|
673
|
+
sm: ["w-95"],
|
|
674
|
+
md: ["w-120"],
|
|
675
|
+
lg: ["w-150"]
|
|
676
|
+
} }
|
|
677
|
+
});
|
|
678
|
+
var AlertDialogContent = ({ size = "sm", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_alert_dialog.Portal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAlertDialogOverlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAlertDialogContent, {
|
|
679
|
+
size,
|
|
680
|
+
...rest
|
|
681
|
+
})] });
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region src/components/alert-dialog/AlertDialog.tsx
|
|
684
|
+
var AlertDialog = /* @__PURE__ */ Object.assign(_radix_ui_react_alert_dialog.Root, {
|
|
685
|
+
Description: _radix_ui_react_alert_dialog.Description,
|
|
686
|
+
Title: _radix_ui_react_alert_dialog.Title,
|
|
687
|
+
Action: _radix_ui_react_alert_dialog.Action,
|
|
688
|
+
Cancel: _radix_ui_react_alert_dialog.Cancel,
|
|
689
|
+
Content: AlertDialogContent,
|
|
690
|
+
Trigger: _radix_ui_react_alert_dialog.Trigger
|
|
691
|
+
});
|
|
692
|
+
AlertDialog.displayName = "AlertDialog";
|
|
693
|
+
//#endregion
|
|
694
|
+
//#region src/utilities/hooks/useIsMountedRef.ts
|
|
695
|
+
var useIsMountedRef = () => {
|
|
696
|
+
const isMountedRef = (0, react.useRef)(void 0);
|
|
697
|
+
(0, react.useEffect)(() => {
|
|
698
|
+
isMountedRef.current = true;
|
|
699
|
+
return () => {
|
|
700
|
+
isMountedRef.current = false;
|
|
701
|
+
};
|
|
702
|
+
});
|
|
703
|
+
return isMountedRef;
|
|
704
|
+
};
|
|
1004
705
|
//#endregion
|
|
1005
|
-
//#region src/components/
|
|
1006
|
-
var
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
706
|
+
//#region src/components/loader/Loader.tsx
|
|
707
|
+
var Dot$1 = styled("div", {
|
|
708
|
+
base: [
|
|
709
|
+
"animate-pulse",
|
|
710
|
+
"bg-current",
|
|
711
|
+
"rounded-full",
|
|
712
|
+
"animation-duration-900",
|
|
713
|
+
"nth-3:animation-delay-300",
|
|
714
|
+
"nth-4:animation-delay-600"
|
|
715
|
+
],
|
|
716
|
+
variants: { size: {
|
|
717
|
+
sm: ["size-1", "mx-0.5"],
|
|
718
|
+
md: ["size-1.5", "mx-0.5"],
|
|
719
|
+
lg: ["size-2", "mx-[3px]"]
|
|
720
|
+
} }
|
|
721
|
+
});
|
|
722
|
+
var Loader = ({ className, message = "Loading", size = "md", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
723
|
+
className: cn("flex", "justify-center", className),
|
|
724
|
+
role: "alert",
|
|
725
|
+
...rest,
|
|
726
|
+
children: [
|
|
727
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
728
|
+
className: "sr-only",
|
|
729
|
+
children: message
|
|
730
|
+
}),
|
|
731
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size }),
|
|
732
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size }),
|
|
733
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dot$1, { size })
|
|
734
|
+
]
|
|
735
|
+
});
|
|
1012
736
|
//#endregion
|
|
1013
|
-
//#region src/components/
|
|
1014
|
-
var StyledButton
|
|
737
|
+
//#region src/components/button/Button.tsx
|
|
738
|
+
var StyledButton = styled("button", {
|
|
1015
739
|
base: [
|
|
1016
740
|
"items-center",
|
|
1017
|
-
"
|
|
1018
|
-
"bg-white",
|
|
741
|
+
"bg-[unset]",
|
|
1019
742
|
"rounded-md",
|
|
1020
|
-
"box-border",
|
|
1021
743
|
"cursor-pointer",
|
|
1022
744
|
"flex",
|
|
1023
|
-
"
|
|
745
|
+
"font-body",
|
|
746
|
+
"font-semibold",
|
|
1024
747
|
"justify-center",
|
|
748
|
+
"no-underline",
|
|
1025
749
|
"transition-all",
|
|
1026
750
|
"duration-100",
|
|
1027
751
|
"ease-out",
|
|
752
|
+
"whitespace-nowrap",
|
|
753
|
+
"w-max",
|
|
1028
754
|
"disabled:cursor-not-allowed",
|
|
1029
755
|
"disabled:opacity-30"
|
|
1030
756
|
],
|
|
1031
757
|
variants: {
|
|
1032
|
-
theme: {
|
|
1033
|
-
|
|
1034
|
-
"[--
|
|
1035
|
-
"[--
|
|
1036
|
-
"[--
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
"[--
|
|
1040
|
-
"[--
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
"[--
|
|
1045
|
-
"[--
|
|
758
|
+
theme: {
|
|
759
|
+
primary: [
|
|
760
|
+
"[--base:var(--color-primary-800)]",
|
|
761
|
+
"[--interact:var(--color-primary-900)]",
|
|
762
|
+
"[--active:var(--color-primary-1000)]"
|
|
763
|
+
],
|
|
764
|
+
secondary: [
|
|
765
|
+
"[--base:var(--color-primary-1000)]",
|
|
766
|
+
"[--interact:var(--color-primary-1100)]",
|
|
767
|
+
"[--active:var(--color-primary-1200)]"
|
|
768
|
+
],
|
|
769
|
+
success: [
|
|
770
|
+
"[--base:var(--color-success)]",
|
|
771
|
+
"[--interact:var(--color-success-mid)]",
|
|
772
|
+
"[--active:var(--color-success-dark)]"
|
|
773
|
+
],
|
|
774
|
+
warning: [
|
|
775
|
+
"[--base:var(--color-warning)]",
|
|
776
|
+
"[--interact:var(--color-warning-mid)]",
|
|
777
|
+
"[--active:var(--color-warning-dark)]",
|
|
778
|
+
"[--text:var(--color-grey-800)]"
|
|
779
|
+
],
|
|
780
|
+
danger: [
|
|
781
|
+
"[--base:var(--color-danger)]",
|
|
782
|
+
"[--interact:var(--color-danger-mid)]",
|
|
783
|
+
"[--active:var(--color-danger-dark)]"
|
|
784
|
+
],
|
|
785
|
+
neutral: [
|
|
786
|
+
"[--base:white]",
|
|
787
|
+
"[--interact:rgba(255,255,255,0.9)]",
|
|
788
|
+
"[--active:rgba(255,255,255,0.75)]",
|
|
789
|
+
"[--text:var(--color-primary-800)]"
|
|
790
|
+
]
|
|
791
|
+
},
|
|
792
|
+
appearance: {
|
|
793
|
+
solid: [
|
|
794
|
+
"bg-(--base)",
|
|
795
|
+
"text-(--text,white)",
|
|
796
|
+
"disabled:opacity-30",
|
|
797
|
+
"disabled:cursor-not-allowed",
|
|
798
|
+
"not-disabled:hover:bg-(--interact)",
|
|
799
|
+
"not-disabled:hover:text-(--text,white)",
|
|
800
|
+
"not-disabled:focus:bg-(--interact)",
|
|
801
|
+
"not-disabled:focus:text-(--text,white)",
|
|
802
|
+
"not-disabled:active:bg-(--active)"
|
|
803
|
+
],
|
|
804
|
+
outline: [
|
|
805
|
+
"border",
|
|
806
|
+
"border-current",
|
|
807
|
+
"text-(--base)",
|
|
808
|
+
"disabled:opacity-30",
|
|
809
|
+
"disabled:cursor-not-allowed",
|
|
810
|
+
"not-disabled:hover:no-underline",
|
|
811
|
+
"not-disabled:hover:text-(--interact)",
|
|
812
|
+
"not-disabled:focus:no-underline",
|
|
813
|
+
"not-disabled:focus:text-(--interact)",
|
|
814
|
+
"not-disabled:active:text-(--active)"
|
|
815
|
+
]
|
|
816
|
+
},
|
|
817
|
+
size: {
|
|
818
|
+
sm: [
|
|
819
|
+
"text-sm",
|
|
820
|
+
"leading-[1.53]",
|
|
821
|
+
"h-8",
|
|
822
|
+
"px-4",
|
|
823
|
+
"gap-2",
|
|
824
|
+
"[&_svg]:size-4"
|
|
825
|
+
],
|
|
826
|
+
md: [
|
|
827
|
+
"text-md",
|
|
828
|
+
"leading-normal",
|
|
829
|
+
"h-10",
|
|
830
|
+
"px-8",
|
|
831
|
+
"gap-3",
|
|
832
|
+
"[&_svg]:size-5"
|
|
833
|
+
],
|
|
834
|
+
lg: [
|
|
835
|
+
"text-lg",
|
|
836
|
+
"leading-normal",
|
|
837
|
+
"h-12",
|
|
838
|
+
"px-8",
|
|
839
|
+
"gap-3",
|
|
840
|
+
"[&_svg]:size-[22px]"
|
|
841
|
+
],
|
|
842
|
+
xl: [
|
|
843
|
+
"text-lg",
|
|
844
|
+
"leading-normal",
|
|
845
|
+
"h-16",
|
|
846
|
+
"px-8",
|
|
847
|
+
"gap-3",
|
|
848
|
+
"[&_svg]:size-[22px]"
|
|
849
|
+
]
|
|
850
|
+
},
|
|
851
|
+
isLoading: { true: [
|
|
852
|
+
"cursor-not-allowed",
|
|
853
|
+
"opacity-60",
|
|
854
|
+
"pointer-events-none"
|
|
855
|
+
] },
|
|
856
|
+
fullWidth: {
|
|
857
|
+
true: ["w-full"],
|
|
858
|
+
false: ["w-max"]
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
defaultVariants: {
|
|
862
|
+
appearance: "solid",
|
|
863
|
+
size: "md",
|
|
864
|
+
theme: "primary"
|
|
865
|
+
}
|
|
866
|
+
}, { enableResponsiveVariants: true });
|
|
867
|
+
// @__PURE__ keeps this tree-shakable for consumers importing only
|
|
868
|
+
var LoaderContentsWrapper = /* @__PURE__ */ styled("span", {
|
|
869
|
+
base: [
|
|
870
|
+
"items-center",
|
|
871
|
+
"flex",
|
|
872
|
+
"justify-center",
|
|
873
|
+
"invisible"
|
|
874
|
+
],
|
|
875
|
+
variants: { size: {
|
|
876
|
+
sm: ["gap-2"],
|
|
877
|
+
md: ["gap-3"],
|
|
878
|
+
lg: ["gap-3"],
|
|
879
|
+
xl: ["gap-3"]
|
|
880
|
+
} },
|
|
881
|
+
defaultVariants: { size: "md" }
|
|
882
|
+
}, { enableResponsiveVariants: true });
|
|
883
|
+
var WithLoader = ({ size, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Loader, { className: "absolute" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoaderContentsWrapper, {
|
|
884
|
+
size,
|
|
885
|
+
children
|
|
886
|
+
})] });
|
|
887
|
+
var Button = (({ ref, children, as, href, isLoading = false, onClick, disabled, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButton, {
|
|
888
|
+
as: as || (href ? "a" : void 0),
|
|
889
|
+
...!disabled && !isLoading && {
|
|
890
|
+
href,
|
|
891
|
+
onClick
|
|
892
|
+
},
|
|
893
|
+
isLoading,
|
|
894
|
+
type: !href ? "button" : void 0,
|
|
895
|
+
disabled,
|
|
896
|
+
...rest,
|
|
897
|
+
...getExternalAnchorProps(href),
|
|
898
|
+
ref,
|
|
899
|
+
children: isLoading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WithLoader, {
|
|
900
|
+
size: rest.size,
|
|
901
|
+
children
|
|
902
|
+
}) : children
|
|
903
|
+
}));
|
|
904
|
+
//#endregion
|
|
905
|
+
//#region src/components/heading/Heading.tsx
|
|
906
|
+
var Heading = styled("h2", {
|
|
907
|
+
base: ["m-0"],
|
|
908
|
+
variants: {
|
|
909
|
+
size: {
|
|
910
|
+
xs: [
|
|
911
|
+
"font-body",
|
|
912
|
+
"text-md",
|
|
913
|
+
"leading-normal",
|
|
914
|
+
"capsize-[0.3864]"
|
|
915
|
+
],
|
|
916
|
+
sm: [
|
|
917
|
+
"font-body",
|
|
918
|
+
"text-lg",
|
|
919
|
+
"leading-[1.14]",
|
|
920
|
+
"capsize-[0.2078]"
|
|
921
|
+
],
|
|
922
|
+
md: [
|
|
923
|
+
"font-display",
|
|
924
|
+
"text-xl",
|
|
925
|
+
"leading-[1.14]",
|
|
926
|
+
"tracking-[0.01em]",
|
|
927
|
+
"capsize-before-[0.2114]",
|
|
928
|
+
"capsize-after-[0.2634]"
|
|
929
|
+
],
|
|
930
|
+
lg: [
|
|
931
|
+
"font-display",
|
|
932
|
+
"text-2xl",
|
|
933
|
+
"leading-[1.08]",
|
|
934
|
+
"tracking-[0.01em]",
|
|
935
|
+
"capsize-before-[0.1405]",
|
|
936
|
+
"capsize-after-[0.2405]"
|
|
937
|
+
],
|
|
938
|
+
xl: [
|
|
939
|
+
"font-display",
|
|
940
|
+
"text-3xl",
|
|
941
|
+
"leading-[1.12]",
|
|
942
|
+
"capsize-before-[0.16]",
|
|
943
|
+
"capsize-after-[0.26]"
|
|
944
|
+
],
|
|
945
|
+
xxl: [
|
|
946
|
+
"font-display",
|
|
947
|
+
"text-4xl",
|
|
948
|
+
"leading-none",
|
|
949
|
+
"capsize-before-[0.1]",
|
|
950
|
+
"capsize-after-[0.2]"
|
|
951
|
+
]
|
|
952
|
+
},
|
|
953
|
+
noCapsize: { true: ["capsize-none"] },
|
|
954
|
+
weight: {
|
|
955
|
+
medium: ["font-medium"],
|
|
956
|
+
bold: ["font-bold"]
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
defaultVariants: {
|
|
960
|
+
size: "md",
|
|
961
|
+
weight: "bold"
|
|
962
|
+
}
|
|
963
|
+
}, { enableResponsiveVariants: true });
|
|
964
|
+
//#endregion
|
|
965
|
+
//#region src/components/text/Text.tsx
|
|
966
|
+
var Text = styled("p", {
|
|
967
|
+
base: ["m-0"],
|
|
968
|
+
variants: {
|
|
969
|
+
size: {
|
|
970
|
+
xs: [
|
|
971
|
+
"text-xs",
|
|
972
|
+
"leading-[1.6]",
|
|
973
|
+
"capsize-[0.4364]"
|
|
1046
974
|
],
|
|
1047
|
-
|
|
1048
|
-
"
|
|
1049
|
-
"[
|
|
1050
|
-
"[
|
|
975
|
+
sm: [
|
|
976
|
+
"text-sm",
|
|
977
|
+
"leading-[1.53]",
|
|
978
|
+
"capsize-[0.4056]"
|
|
1051
979
|
],
|
|
1052
|
-
|
|
1053
|
-
"
|
|
1054
|
-
"
|
|
1055
|
-
"[
|
|
980
|
+
md: [
|
|
981
|
+
"text-md",
|
|
982
|
+
"leading-normal",
|
|
983
|
+
"capsize-[0.3864]"
|
|
1056
984
|
],
|
|
1057
|
-
|
|
1058
|
-
"
|
|
1059
|
-
"[
|
|
1060
|
-
"[
|
|
985
|
+
lg: [
|
|
986
|
+
"text-lg",
|
|
987
|
+
"leading-[1.52]",
|
|
988
|
+
"capsize-[0.3983]"
|
|
1061
989
|
],
|
|
1062
|
-
|
|
1063
|
-
"
|
|
1064
|
-
"[
|
|
1065
|
-
"[
|
|
990
|
+
xl: [
|
|
991
|
+
"text-xl",
|
|
992
|
+
"leading-[1.42]",
|
|
993
|
+
"capsize-[0.3506]"
|
|
1066
994
|
],
|
|
1067
|
-
|
|
1068
|
-
"
|
|
1069
|
-
"[
|
|
1070
|
-
"[
|
|
1071
|
-
]
|
|
1072
|
-
},
|
|
1073
|
-
appearance: {
|
|
1074
|
-
simple: [
|
|
1075
|
-
"bg-transparent",
|
|
1076
|
-
"text-(--base)",
|
|
1077
|
-
"not-disabled:hover:text-(--interact)",
|
|
1078
|
-
"not-disabled:focus:text-(--interact)",
|
|
1079
|
-
"not-disabled:active:text-(--active)"
|
|
995
|
+
"2xl": [
|
|
996
|
+
"text-2xl",
|
|
997
|
+
"leading-[1.40]",
|
|
998
|
+
"capsize-[0.3336]"
|
|
1080
999
|
],
|
|
1081
|
-
|
|
1082
|
-
"
|
|
1083
|
-
"
|
|
1084
|
-
"
|
|
1085
|
-
"text-(--base)",
|
|
1086
|
-
"not-disabled:hover:text-(--interact)",
|
|
1087
|
-
"not-disabled:focus:text-(--interact)",
|
|
1088
|
-
"not-disabled:active:text-(--active)"
|
|
1000
|
+
"3xl": [
|
|
1001
|
+
"text-3xl",
|
|
1002
|
+
"leading-[1.28]",
|
|
1003
|
+
"capsize-[0.2709]"
|
|
1089
1004
|
],
|
|
1090
|
-
|
|
1091
|
-
"
|
|
1092
|
-
"
|
|
1093
|
-
"
|
|
1094
|
-
"not-disabled:hover:text-(--solid-text,white)",
|
|
1095
|
-
"not-disabled:focus:bg-(--solid-interact,var(--interact))",
|
|
1096
|
-
"not-disabled:focus:text-(--solid-text,white)",
|
|
1097
|
-
"not-disabled:active:bg-(--solid-active,var(--active))"
|
|
1005
|
+
"4xl": [
|
|
1006
|
+
"text-4xl",
|
|
1007
|
+
"leading-none",
|
|
1008
|
+
"capsize-[0.1309]"
|
|
1098
1009
|
]
|
|
1099
1010
|
},
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
lg: ["size-12"]
|
|
1011
|
+
noCapsize: { true: ["capsize-none"] },
|
|
1012
|
+
weight: {
|
|
1013
|
+
normal: ["font-normal"],
|
|
1014
|
+
bold: ["font-semibold"]
|
|
1105
1015
|
},
|
|
1106
|
-
|
|
1016
|
+
family: {
|
|
1017
|
+
body: ["font-body"],
|
|
1018
|
+
display: ["font-display"],
|
|
1019
|
+
mono: ["font-mono"]
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
1022
|
+
defaultVariants: {
|
|
1023
|
+
size: "md",
|
|
1024
|
+
family: "body"
|
|
1107
1025
|
}
|
|
1108
1026
|
}, { enableResponsiveVariants: true });
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1027
|
+
//#endregion
|
|
1028
|
+
//#region src/components/alert-dialog/alert-context/AlertDialogIcon.tsx
|
|
1029
|
+
var StyledIcon$2 = styled(Icon, {
|
|
1030
|
+
base: ["self-start"],
|
|
1031
|
+
variants: { theme: {
|
|
1032
|
+
info: ["text-info"],
|
|
1033
|
+
warning: ["text-warning-mid"],
|
|
1034
|
+
danger: ["rotate-180", "text-danger"],
|
|
1035
|
+
success: ["text-success"]
|
|
1036
|
+
} }
|
|
1037
|
+
});
|
|
1038
|
+
var iconMap = {
|
|
1039
|
+
info: _atom_learning_icons.Info,
|
|
1040
|
+
warning: _atom_learning_icons.Danger,
|
|
1041
|
+
danger: _atom_learning_icons.Info,
|
|
1042
|
+
success: _atom_learning_icons.OkCircle
|
|
1043
|
+
};
|
|
1044
|
+
var AlertDialogIcon = ({ theme }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIcon$2, {
|
|
1045
|
+
theme,
|
|
1046
|
+
is: iconMap[theme]
|
|
1047
|
+
});
|
|
1048
|
+
//#endregion
|
|
1049
|
+
//#region src/components/alert-dialog/alert-context/AlertDialog.tsx
|
|
1050
|
+
var Alert$1 = ({ title, size, theme, description, onAction, cancelActionText, confirmActionText, onClose, confirmElement, cancelElement, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog, {
|
|
1051
|
+
defaultOpen: true,
|
|
1052
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AlertDialog.Content, {
|
|
1053
|
+
size,
|
|
1054
|
+
onEscapeKeyDown: (e) => e.preventDefault(),
|
|
1055
|
+
onCloseAutoFocus: onClose,
|
|
1056
|
+
...rest,
|
|
1057
|
+
className: "flex max-h-[90vh] flex-col gap-8",
|
|
1058
|
+
children: [
|
|
1059
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1060
|
+
className: "flex items-center gap-2",
|
|
1061
|
+
children: [theme && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialogIcon, { theme }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
1062
|
+
as: AlertDialog.Title,
|
|
1063
|
+
size: "sm",
|
|
1064
|
+
className: "mr-4",
|
|
1065
|
+
children: title
|
|
1066
|
+
})]
|
|
1067
|
+
}),
|
|
1068
|
+
description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
|
|
1069
|
+
as: AlertDialog.Description,
|
|
1070
|
+
className: "flex overflow-y-auto",
|
|
1071
|
+
children: description
|
|
1072
|
+
}),
|
|
1073
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1074
|
+
className: "flex flex-wrap justify-end gap-2",
|
|
1075
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog.Cancel, {
|
|
1076
|
+
asChild: true,
|
|
1077
|
+
children: cancelElement || cancelActionText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
1078
|
+
size: "sm",
|
|
1079
|
+
appearance: "outline",
|
|
1080
|
+
onClick: () => onAction?.(false),
|
|
1081
|
+
children: cancelActionText
|
|
1082
|
+
})
|
|
1083
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialog.Action, {
|
|
1084
|
+
asChild: true,
|
|
1085
|
+
children: confirmElement || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
1086
|
+
size: "sm",
|
|
1087
|
+
onClick: () => onAction?.(true),
|
|
1088
|
+
children: confirmActionText
|
|
1089
|
+
})
|
|
1090
|
+
})]
|
|
1135
1091
|
})
|
|
1136
|
-
|
|
1092
|
+
]
|
|
1093
|
+
})
|
|
1094
|
+
});
|
|
1095
|
+
//#endregion
|
|
1096
|
+
//#region src/components/alert-dialog/alert-context/reducer.ts
|
|
1097
|
+
var initialState = [];
|
|
1098
|
+
var reducer = (state, action) => {
|
|
1099
|
+
switch (action.type) {
|
|
1100
|
+
case "ADD": return [...state, action.payload];
|
|
1101
|
+
case "REMOVE": return state.filter(({ id }) => id !== action.payload);
|
|
1102
|
+
default: return state;
|
|
1103
|
+
}
|
|
1104
|
+
};
|
|
1105
|
+
//#endregion
|
|
1106
|
+
//#region src/components/alert-dialog/AlertDialog.context.tsx
|
|
1107
|
+
var AlertContext = react.createContext(void 0);
|
|
1108
|
+
var AlertProvider = ({ children }) => {
|
|
1109
|
+
const [alerts, dispatch] = react.useReducer(reducer, initialState);
|
|
1110
|
+
const isMountedRef = useIsMountedRef();
|
|
1111
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AlertContext, {
|
|
1112
|
+
value: react.useMemo(() => ({ showAlert: (content) => dispatch({
|
|
1113
|
+
payload: {
|
|
1114
|
+
...content,
|
|
1115
|
+
id: crypto.randomUUID()
|
|
1116
|
+
},
|
|
1117
|
+
type: "ADD"
|
|
1118
|
+
}) }), []),
|
|
1119
|
+
children: [Boolean(alerts.length) && /* @__PURE__ */ (0, react.createElement)(Alert$1, {
|
|
1120
|
+
...alerts[0],
|
|
1121
|
+
key: alerts[0].id,
|
|
1122
|
+
onClose: () => {
|
|
1123
|
+
if (isMountedRef.current) dispatch({
|
|
1124
|
+
payload: alerts[0].id,
|
|
1125
|
+
type: "REMOVE"
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
}), children]
|
|
1137
1129
|
});
|
|
1138
1130
|
};
|
|
1131
|
+
var useAlert = () => {
|
|
1132
|
+
const context = react.use(AlertContext);
|
|
1133
|
+
if (context === void 0) throw new Error("useAlert must be used within a AlertProvider");
|
|
1134
|
+
return context;
|
|
1135
|
+
};
|
|
1136
|
+
//#endregion
|
|
1137
|
+
//#region src/components/alert-dialog/Alert.ts
|
|
1138
|
+
var Alert = { Provider: AlertProvider };
|
|
1139
1139
|
//#endregion
|
|
1140
1140
|
//#region src/components/avatar/Avatar.context.tsx
|
|
1141
1141
|
var AvatarRootContext = react.createContext({
|
|
@@ -7108,9 +7108,9 @@ var generateNodeKey = (node, index) => {
|
|
|
7108
7108
|
return `${node.type}${index}`;
|
|
7109
7109
|
};
|
|
7110
7110
|
var MarkdownContent = ({ content, customComponents = {}, className }) => {
|
|
7111
|
-
const AST = (0, mdast_util_from_markdown.
|
|
7112
|
-
extensions: [(0, micromark_extension_directive.
|
|
7113
|
-
mdastExtensions: [mdast_util_directive.
|
|
7111
|
+
const AST = (0, mdast_util_from_markdown.fromMarkdown)(content, {
|
|
7112
|
+
extensions: [(0, micromark_extension_directive.directive)()],
|
|
7113
|
+
mdastExtensions: [(0, mdast_util_directive.directiveFromMarkdown)()]
|
|
7114
7114
|
});
|
|
7115
7115
|
const componentsMap = {
|
|
7116
7116
|
...defaultComponentsMap,
|
|
@@ -11082,9 +11082,6 @@ FileDrop.displayName = "FileDrop";
|
|
|
11082
11082
|
//#region src/components/file-drop/useFileDrop.ts
|
|
11083
11083
|
var useFileDrop = () => react.use(FileDropContext);
|
|
11084
11084
|
//#endregion
|
|
11085
|
-
//#region src/components/index.ts
|
|
11086
|
-
var Alert = { Provider: AlertProvider };
|
|
11087
|
-
//#endregion
|
|
11088
11085
|
exports.Accordion = Accordion;
|
|
11089
11086
|
exports.ActionIcon = ActionIcon;
|
|
11090
11087
|
exports.Alert = Alert;
|