@keboola/design 4.3.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +68 -43
- package/COMPONENT-API.md +35 -6
- package/README.md +1 -1
- package/dist/charts.cjs +268 -0
- package/dist/charts.cjs.map +1 -0
- package/dist/charts.d.cts +181 -0
- package/dist/charts.d.ts +181 -0
- package/dist/charts.js +259 -0
- package/dist/charts.js.map +1 -0
- package/dist/editors.cjs +151 -77
- package/dist/editors.cjs.map +1 -1
- package/dist/editors.js +153 -79
- package/dist/editors.js.map +1 -1
- package/dist/index.cjs +2610 -1537
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +486 -467
- package/dist/index.d.ts +486 -467
- package/dist/index.js +2337 -1273
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.cjs +155 -119
- package/dist/markdown-editor.cjs.map +1 -1
- package/dist/markdown-editor.js +155 -119
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.cjs +62 -36
- package/dist/mermaid.cjs.map +1 -1
- package/dist/mermaid.js +63 -37
- package/dist/mermaid.js.map +1 -1
- package/dist/rjsf.cjs +10294 -0
- package/dist/rjsf.cjs.map +1 -0
- package/dist/rjsf.d.cts +55 -0
- package/dist/rjsf.d.ts +55 -0
- package/dist/rjsf.js +10256 -0
- package/dist/rjsf.js.map +1 -0
- package/dist/styles.css +4 -2
- package/dist/testing.cjs +238 -111
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +6 -0
- package/dist/testing.d.ts +6 -0
- package/dist/testing.js +240 -113
- package/dist/testing.js.map +1 -1
- package/package.json +51 -16
- package/src/styles.css +72 -30
package/dist/mermaid.cjs
CHANGED
|
@@ -69,13 +69,39 @@ var keyCodes = {
|
|
|
69
69
|
ENTER: "Enter",
|
|
70
70
|
SPACE: " "
|
|
71
71
|
};
|
|
72
|
-
var ThemeContext = react.createContext(null);
|
|
73
72
|
|
|
74
|
-
// src/components/
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
// src/components/ThemeProvider/utils.ts
|
|
74
|
+
var createTheme = (brand) => ({
|
|
75
|
+
id: brand.id,
|
|
76
|
+
name: brand.name,
|
|
77
|
+
shell: brand.shell,
|
|
78
|
+
logo: brand.logo
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// src/components/ThemeProvider/defaults.ts
|
|
82
|
+
[brandRegistry.keboolaLegacySidebar.id, brandRegistry.keboolaLegacyTopnav.id];
|
|
83
|
+
var DEFAULT_COLOR_SCHEME = "light";
|
|
84
|
+
var DEFAULT_BRAND_ID = "design-system";
|
|
85
|
+
var defaultBrand = {
|
|
86
|
+
id: DEFAULT_BRAND_ID,
|
|
87
|
+
name: "Design System",
|
|
88
|
+
shell: "sidebar"};
|
|
89
|
+
var defaultTheme = createTheme(defaultBrand);
|
|
90
|
+
|
|
91
|
+
// src/components/ThemeProvider/context.tsx
|
|
92
|
+
var noop = () => void 0;
|
|
93
|
+
var defaultContext = {
|
|
94
|
+
scheme: DEFAULT_COLOR_SCHEME,
|
|
95
|
+
resolvedScheme: DEFAULT_COLOR_SCHEME,
|
|
96
|
+
setScheme: noop,
|
|
97
|
+
brandId: defaultTheme.id,
|
|
98
|
+
setBrand: noop,
|
|
99
|
+
themes: [defaultTheme],
|
|
100
|
+
currentTheme: defaultTheme
|
|
78
101
|
};
|
|
102
|
+
react.createContext(defaultContext);
|
|
103
|
+
var ArgoDesignContext = react.createContext(true);
|
|
104
|
+
var useArgoDesign = () => react.use(ArgoDesignContext);
|
|
79
105
|
var tooltipVariants = classVarianceAuthority.cva(
|
|
80
106
|
[
|
|
81
107
|
"tailwindcss-preflight",
|
|
@@ -153,8 +179,7 @@ var TooltipContent = ({
|
|
|
153
179
|
placement = "right",
|
|
154
180
|
...rest
|
|
155
181
|
}) => {
|
|
156
|
-
const
|
|
157
|
-
const renderArgo = !isLegacy;
|
|
182
|
+
const renderArgo = useArgoDesign();
|
|
158
183
|
const handlePointerDownOutside = (event) => {
|
|
159
184
|
if (keepOpenOnPointerDownOutside) event.preventDefault();
|
|
160
185
|
onPointerDownOutside?.(event);
|
|
@@ -298,7 +323,7 @@ var ANIMATION_CLASS_NAME = cn(
|
|
|
298
323
|
"before:tw-bg-gradient-to-r",
|
|
299
324
|
"before:tw-from-transparent",
|
|
300
325
|
"before:tw-to-transparent",
|
|
301
|
-
"before:tw-via-
|
|
326
|
+
"before:tw-via-white/40"
|
|
302
327
|
);
|
|
303
328
|
var Skeleton = ({ height = "md", className, count = 1 }) => {
|
|
304
329
|
const prefixId = react.useId();
|
|
@@ -356,8 +381,8 @@ var variants = classVarianceAuthority.cva(
|
|
|
356
381
|
"tw-font-medium",
|
|
357
382
|
"tw-tracking-[1px]",
|
|
358
383
|
"tw-uppercase",
|
|
359
|
-
// border
|
|
360
|
-
"tw-rounded
|
|
384
|
+
// border — legacy (non-argo) chrome uses a fixed radius, not the brand token.
|
|
385
|
+
"tw-rounded",
|
|
361
386
|
"tw-border",
|
|
362
387
|
"tw-border-transparent",
|
|
363
388
|
// styling
|
|
@@ -552,14 +577,14 @@ var argoVariants = classVarianceAuthority.cva(
|
|
|
552
577
|
"hover:tw-text-primary-foreground",
|
|
553
578
|
"focus:tw-text-primary-foreground",
|
|
554
579
|
"focus-visible:tw-border-primary",
|
|
555
|
-
"focus-visible:tw-ring-
|
|
580
|
+
"focus-visible:tw-ring-ring/50"
|
|
556
581
|
],
|
|
557
582
|
secondary: [
|
|
558
583
|
"tw-bg-primary/10",
|
|
559
584
|
"tw-text-primary",
|
|
560
585
|
"hover:not-disabled:tw-bg-primary/20",
|
|
561
586
|
"focus-visible:tw-border-primary",
|
|
562
|
-
"focus-visible:tw-ring-
|
|
587
|
+
"focus-visible:tw-ring-ring/50"
|
|
563
588
|
],
|
|
564
589
|
// should be called "destructive" by Figma
|
|
565
590
|
danger: [
|
|
@@ -576,20 +601,22 @@ var argoVariants = classVarianceAuthority.cva(
|
|
|
576
601
|
// Semantic base text color so the label/icon flips in dark mode
|
|
577
602
|
// (matches `invisible`); previously unset → inherited a fixed dark color.
|
|
578
603
|
"tw-text-foreground",
|
|
579
|
-
|
|
580
|
-
|
|
604
|
+
// Hover follows the brand primary (translucent tint), matching the
|
|
605
|
+
// `secondary` variant — not the fixed `accent` blue.
|
|
606
|
+
"hover:not-disabled:tw-bg-primary/10",
|
|
607
|
+
"hover:not-disabled:tw-text-primary",
|
|
581
608
|
"hover:active:tw-bg-background",
|
|
582
609
|
"focus-visible:!tw-border-primary",
|
|
583
|
-
"focus-visible:tw-ring-
|
|
610
|
+
"focus-visible:tw-ring-ring/50"
|
|
584
611
|
],
|
|
585
612
|
// should be called "ghost" by Figma
|
|
586
613
|
invisible: [
|
|
587
614
|
"tw-bg-transparent",
|
|
588
615
|
"tw-text-foreground",
|
|
589
|
-
"hover:not-disabled:tw-bg-
|
|
590
|
-
"hover:not-disabled:tw-text-
|
|
591
|
-
"hover:not-disabled:tw-border-
|
|
592
|
-
"focus-visible:tw-ring-
|
|
616
|
+
"hover:not-disabled:tw-bg-primary/10",
|
|
617
|
+
"hover:not-disabled:tw-text-primary",
|
|
618
|
+
"hover:not-disabled:tw-border-primary/10",
|
|
619
|
+
"focus-visible:tw-ring-ring/50"
|
|
593
620
|
],
|
|
594
621
|
// should be called "link" by Figma
|
|
595
622
|
inline: [
|
|
@@ -597,7 +624,7 @@ var argoVariants = classVarianceAuthority.cva(
|
|
|
597
624
|
"tw-text-primary",
|
|
598
625
|
"hover:tw-underline",
|
|
599
626
|
"hover:active:tw-bg-transparent",
|
|
600
|
-
"focus-visible:tw-ring-
|
|
627
|
+
"focus-visible:tw-ring-ring/50"
|
|
601
628
|
]
|
|
602
629
|
},
|
|
603
630
|
size: {
|
|
@@ -632,8 +659,7 @@ var Button = ({
|
|
|
632
659
|
block = false,
|
|
633
660
|
...buttonProps
|
|
634
661
|
}) => {
|
|
635
|
-
const
|
|
636
|
-
const renderArgo = !isLegacy;
|
|
662
|
+
const renderArgo = useArgoDesign();
|
|
637
663
|
const Comp = asChild ? reactSlot.Root : "button";
|
|
638
664
|
const isIconOnly = String(size).startsWith("icon");
|
|
639
665
|
const classNames = renderArgo ? argoVariants({ variant, size, block, className }) : variants({ size, variant, block, className });
|
|
@@ -930,9 +956,9 @@ var getMermaid = () => {
|
|
|
930
956
|
securityLevel: "strict",
|
|
931
957
|
theme: "base",
|
|
932
958
|
themeVariables: {
|
|
933
|
-
primaryColor: colors__default.default.
|
|
959
|
+
primaryColor: colors__default.default.blue[100],
|
|
934
960
|
primaryTextColor: colors__default.default.neutral[800],
|
|
935
|
-
primaryBorderColor: colors__default.default.
|
|
961
|
+
primaryBorderColor: colors__default.default.blue[700],
|
|
936
962
|
secondaryColor: colors__default.default.white,
|
|
937
963
|
secondaryTextColor: colors__default.default.neutral[800],
|
|
938
964
|
secondaryBorderColor: colors__default.default.neutral[150],
|
|
@@ -941,38 +967,38 @@ var getMermaid = () => {
|
|
|
941
967
|
tertiaryBorderColor: colors__default.default.warning[500],
|
|
942
968
|
lineColor: colors__default.default.neutral[300],
|
|
943
969
|
textColor: colors__default.default.neutral[800],
|
|
944
|
-
mainBkg: colors__default.default.
|
|
945
|
-
nodeBorder: colors__default.default.
|
|
970
|
+
mainBkg: colors__default.default.blue[100],
|
|
971
|
+
nodeBorder: colors__default.default.blue[700],
|
|
946
972
|
clusterBkg: colors__default.default.white,
|
|
947
973
|
clusterBorder: colors__default.default.neutral[150],
|
|
948
974
|
titleColor: colors__default.default.neutral[800],
|
|
949
975
|
edgeLabelBackground: colors__default.default.white,
|
|
950
976
|
nodeTextColor: colors__default.default.neutral[800],
|
|
951
|
-
actorBorder: colors__default.default.
|
|
952
|
-
actorBkg: colors__default.default.
|
|
977
|
+
actorBorder: colors__default.default.blue[700],
|
|
978
|
+
actorBkg: colors__default.default.blue[100],
|
|
953
979
|
actorTextColor: colors__default.default.neutral[800],
|
|
954
980
|
actorLineColor: colors__default.default.neutral[300],
|
|
955
981
|
signalColor: colors__default.default.neutral[800],
|
|
956
982
|
signalTextColor: colors__default.default.neutral[800],
|
|
957
|
-
labelBoxBkgColor: colors__default.default.
|
|
958
|
-
labelBoxBorderColor: colors__default.default.
|
|
983
|
+
labelBoxBkgColor: colors__default.default.blue[100],
|
|
984
|
+
labelBoxBorderColor: colors__default.default.blue[700],
|
|
959
985
|
labelTextColor: colors__default.default.neutral[800],
|
|
960
986
|
loopTextColor: colors__default.default.neutral[800],
|
|
961
987
|
noteBorderColor: colors__default.default.warning[500],
|
|
962
988
|
noteBkgColor: colors__default.default.warning[100],
|
|
963
989
|
noteTextColor: colors__default.default.neutral[800],
|
|
964
|
-
sectionBkgColor: colors__default.default.
|
|
990
|
+
sectionBkgColor: colors__default.default.blue[100],
|
|
965
991
|
altSectionBkgColor: colors__default.default.white,
|
|
966
992
|
sectionBkgColor2: colors__default.default.neutral[100],
|
|
967
|
-
taskBorderColor: colors__default.default.
|
|
968
|
-
taskBkgColor: colors__default.default.
|
|
993
|
+
taskBorderColor: colors__default.default.blue[700],
|
|
994
|
+
taskBkgColor: colors__default.default.blue[100],
|
|
969
995
|
taskTextColor: colors__default.default.neutral[800],
|
|
970
996
|
taskTextDarkColor: colors__default.default.neutral[800],
|
|
971
997
|
taskTextLightColor: colors__default.default.neutral[800],
|
|
972
998
|
activeTaskBorderColor: resolvePrimary(),
|
|
973
|
-
activeTaskBkgColor: colors__default.default.
|
|
974
|
-
doneTaskBorderColor: colors__default.default.
|
|
975
|
-
doneTaskBkgColor: colors__default.default.
|
|
999
|
+
activeTaskBkgColor: colors__default.default.blue[200],
|
|
1000
|
+
doneTaskBorderColor: colors__default.default.green[600],
|
|
1001
|
+
doneTaskBkgColor: colors__default.default.green[100],
|
|
976
1002
|
critBorderColor: colors__default.default.error[500],
|
|
977
1003
|
critBkgColor: colors__default.default.error[100],
|
|
978
1004
|
fontFamily: "Inter, system-ui, sans-serif",
|
package/dist/mermaid.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/classNames.ts","../src/utils/copyToClipboard.ts","../src/constants/keyCodes.ts","../src/components/ThemeProvider/themeContext.ts","../src/components/internal/useIsLegacyBrand.ts","../src/components/Tooltip/TooltipContent.tsx","../src/components/Tooltip/TooltipRoot.tsx","../src/components/Tooltip/TooltipTrigger.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/Skeleton/Skeleton.tsx","../src/icons/index.ts","../src/icons/Keboola.tsx","../src/components/Button/styles.ts","../src/components/Button/Button.tsx","../src/components/Clipboard/Clipboard.tsx","../src/blocks/ClipboardButton/ClipboardButton.tsx","../src/components/ZoomableSvg/ZoomableSvg.tsx","../src/blocks/MermaidDiagram/MermaidDiagram.tsx"],"names":["extendTailwindMerge","clsx","createContext","use","keboolaLegacy","cva","Portal","jsx","Content","Root","Trigger","useState","jsxs","useId","Fragment","lucide_react_star","forwardRef","Slottable","text","useMemo","DOMPurify","useRef","useEffect","useCallback","colors","renderMermaidSVG"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAM,UAAUA,iCAAA,CAAoB;AAAA,EAClC,MAAA,EAAQ;AACV,CAAC,CAAA;AAEM,IAAM,KAAK,CAAA,GAAI,OAAA,KAA0B,QAAQC,SAAA,CAAK,GAAG,OAAO,CAAC,CAAA;;;ACPjE,IAAM,eAAA,GAAkB,CAAC,IAAA,KAAiB;AAC/C,EAAA,OAAO,SAAA,CAAU,SAAA,CAAU,SAAA,CAAU,IAAI,CAAA;AAC3C,CAAA;;;ACFO,IAAM,QAAA,GAAW;AAAA,EACtB,KAAA,EAAO,OAAA;AAAA,EAEP,KAAA,EAAO;AACT,CAAA;ACYO,IAAM,YAAA,GAAeC,oBAAwC,IAAI,CAAA;;;ACTjE,IAAM,mBAAmB,MAAe;AAC7C,EAAA,MAAM,OAAA,GAAUC,UAAI,YAAY,CAAA;AAChC,EAAA,OAAO,OAAA,KAAY,IAAA,IAAQ,OA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ChB,IAAA,uBACEA,cAAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QAEC,IAAA,EAAM,YAAA;AAAA,QACN,QAAA,EAAU,CAAA;AAAA,EAAkB,IAAI;AAAA,MAAA,CAAA;AAAA,QAChC,SAAA,EAAU;AAAA,OAAA;AAAA,MAHL;AAAA,KAIP;AAAA,EAEJ;AAEA,EAAA,uBACEA,cAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,kGAAA,EACb,0BAAAA,cAAAA,CAAC,QAAA,EAAA,EAAS,SAAA,EAAU,SAAA,EAAU,CAAA,EAChC,CAAA;AAEJ","file":"mermaid.cjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\nconst twMerge = extendTailwindMerge({\n prefix: 'tw-',\n});\n\nexport const cn = (...classes: ClassValue[]) => twMerge(clsx(...classes));\n","export const copyToClipboard = (text: string) => {\n return navigator.clipboard.writeText(text);\n};\n","export const keyCodes = {\n ENTER: 'Enter',\n ESCAPE: 'Escape',\n SPACE: ' ',\n};\n","import { createContext } from 'react';\n\nimport type { Brand } from '@keboola/brand-registry';\n\nexport type ColorScheme = 'light' | 'dark' | 'system';\nexport type ResolvedMode = 'light' | 'dark';\n\nexport type ThemeContextValue = {\n brand: Brand;\n setBrand?: (brand: Brand) => void;\n /** The configured color scheme (may be `'system'`). */\n colorScheme: ColorScheme;\n /** The effective light/dark mode after resolving `'system'`. */\n resolvedMode: ResolvedMode;\n};\n\nexport const ThemeContext = createContext<ThemeContextValue | null>(null);\n","import { use } from 'react';\n\nimport { keboolaLegacy } from '@keboola/brand-registry';\n\nimport { ThemeContext } from '../ThemeProvider/themeContext';\n\n// No provider mounted → legacy (preserves pre-brand-dispatch chrome for un-wrapped apps + tests).\nexport const useIsLegacyBrand = (): boolean => {\n const context = use(ThemeContext);\n return context === null || context.brand.id === keboolaLegacy.id;\n};\n","import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-tooltip';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { useIsLegacyBrand } from '../internal/useIsLegacyBrand';\n\nconst tooltipVariants = cva(\n [\n 'tailwindcss-preflight',\n 'tw-inline-block',\n 'tw-break-anywhere',\n 'tw-max-h-96',\n 'tw-overflow-y-auto',\n 'tw-z-[1060]',\n\n // legacy (dark) chrome — default\n 'tw-rounded',\n 'tw-bg-neutral-800',\n 'tw-text-white',\n\n // argo chrome overrides — semantic floating-panel tokens\n 'data-[argo=true]:tw-rounded-2xl',\n 'data-[argo=true]:tw-border',\n 'data-[argo=true]:tw-border-solid',\n 'data-[argo=true]:tw-border-border',\n 'data-[argo=true]:tw-bg-popover',\n 'data-[argo=true]:tw-text-popover-foreground',\n 'data-[argo=true]:tw-shadow-md',\n\n // argo open animation\n 'data-[argo=true]:data-[state=delayed-open]:tw-animate-in',\n 'data-[argo=true]:data-[state=instant-open]:tw-animate-in',\n 'data-[argo=true]:data-[state=delayed-open]:tw-fade-in-0',\n 'data-[argo=true]:data-[state=instant-open]:tw-fade-in-0',\n 'data-[argo=true]:data-[state=delayed-open]:tw-zoom-in-95',\n 'data-[argo=true]:data-[state=instant-open]:tw-zoom-in-95',\n\n // argo closed animation\n 'data-[argo=true]:data-[state=closed]:tw-animate-out',\n 'data-[argo=true]:data-[state=closed]:tw-fade-out-0',\n 'data-[argo=true]:data-[state=closed]:tw-zoom-out-95',\n\n // argo position animation\n 'data-[argo=true]:data-[side=bottom]:tw-slide-in-from-top-2',\n 'data-[argo=true]:data-[side=left]:tw-slide-in-from-right-2',\n 'data-[argo=true]:data-[side=right]:tw-slide-in-from-left-2',\n 'data-[argo=true]:data-[side=top]:tw-slide-in-from-bottom-2',\n ],\n {\n defaultVariants: {\n variant: 'action',\n },\n variants: {\n variant: {\n action: [\n 'tw-max-w-fit',\n 'tw-px-3',\n 'tw-py-2',\n\n 'tw-text-center',\n 'tw-text-xs',\n 'tw-font-medium',\n 'tw-uppercase',\n 'tw-tracking-wider',\n ],\n explanatory: [\n 'tw-max-w-80',\n 'tw-px-4',\n 'tw-py-3',\n 'tw-text-left',\n\n 'tw-text-sm',\n 'tw-font-normal',\n ],\n },\n },\n },\n);\n\ntype Props = {\n keepOpenOnPointerDownOutside?: boolean;\n placement?: ComponentProps<typeof Content>['side'];\n} & Omit<ComponentProps<typeof Content>, 'side'> &\n VariantProps<typeof tooltipVariants>;\n\nexport const TooltipContent = ({\n className,\n variant,\n keepOpenOnPointerDownOutside = false,\n children,\n onPointerDownOutside,\n sideOffset = 8,\n collisionPadding = 8,\n hideWhenDetached = true,\n placement = 'right',\n ...rest\n}: Props) => {\n const isLegacy = useIsLegacyBrand();\n const renderArgo = !isLegacy;\n\n const handlePointerDownOutside: ComponentProps<typeof Content>['onPointerDownOutside'] = (\n event,\n ) => {\n if (keepOpenOnPointerDownOutside) event.preventDefault();\n onPointerDownOutside?.(event);\n };\n\n return (\n <Portal>\n <Content\n {...rest}\n // Marks the dark (non-argo) tooltip chrome so styles.css can invert\n // nested `.tw-prose` for contrast.\n data-tooltip-content={renderArgo ? undefined : true}\n data-argo={renderArgo}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n onPointerDownOutside={handlePointerDownOutside}\n className={tooltipVariants({ className, variant })}\n hideWhenDetached={hideWhenDetached}\n side={placement}\n >\n {children}\n </Content>\n </Portal>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Root } from '@radix-ui/react-tooltip';\n\ntype Props = ComponentProps<typeof Root>;\n\nconst DELAY_SHOW_TOOLTIP = 300;\n\nexport const TooltipRoot = ({ children, delayDuration = DELAY_SHOW_TOOLTIP, ...rest }: Props) => (\n <Root {...rest} delayDuration={delayDuration}>\n {children}\n </Root>\n);\n","import type { ComponentProps, ElementRef, Ref } from 'react';\nimport { Trigger } from '@radix-ui/react-tooltip';\n\nimport { cn } from '../../utils';\n\ntype Props = {\n keepOpenOnClick?: boolean;\n} & ComponentProps<typeof Trigger>;\n\nexport const TooltipTrigger = ({\n ref,\n children,\n className,\n keepOpenOnClick = false,\n onClick,\n onPointerDown,\n asChild,\n ...rest\n}: Props & { ref?: Ref<ElementRef<'button'>> }) => {\n const handleClick: ComponentProps<typeof Trigger>['onClick'] = (event) => {\n if (keepOpenOnClick) event.preventDefault();\n onClick?.(event);\n };\n\n const handlePointerDown: ComponentProps<typeof Trigger>['onPointerDown'] = (event) => {\n if (keepOpenOnClick) event.preventDefault();\n onPointerDown?.(event);\n };\n\n return (\n <Trigger\n {...rest}\n asChild\n ref={ref}\n className={cn('tailwindcss-preflight', className)}\n onClick={handleClick}\n onPointerDown={handlePointerDown}\n >\n {asChild ? (\n children\n ) : (\n // Default-mode trigger wraps children in a span so Radix has a\n // single DOM element to attach handlers to. `tailwindcss-preflight`\n // (merged in via Slot) activates Tailwind's preflight inside the\n // span, which sets `svg { display: block }` — without an inline-flex\n // container that would stack any bare Lucide icon onto its own\n // line. `tw-inline-flex tw-items-center` keeps icon + text aligned.\n <span className=\"tw-inline-flex tw-items-center\">{children}</span>\n )}\n </Trigger>\n );\n};\n","import { useState } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport type { Content, Trigger } from '@radix-ui/react-tooltip';\nimport { Provider } from '@radix-ui/react-tooltip';\n\nimport { keyCodes } from '../../constants/keyCodes';\n\nimport { TooltipContent } from './TooltipContent';\nimport { TooltipRoot } from './TooltipRoot';\nimport { TooltipTrigger } from './TooltipTrigger';\n\nconst ACTION_TOOLTIP_LIMIT = 30;\n\ntype TriggerProps = {\n triggerAsChild?: boolean;\n};\n\n/**\n * Props for `Tooltip`. `tooltip` is the popup content; `children` is the trigger element.\n * `variant` auto-resolves to `\"explanatory\"` for strings >30 chars, else `\"action\"`.\n */\nexport type Props = {\n /** Keep the tooltip visible when the user clicks the trigger (useful for click-to-copy feedback). */\n keepOpenOnTriggerClick?: boolean;\n /** Content rendered inside the tooltip. Plain text only — no interactive elements (use `HoverCard` or `Popover` for that). */\n tooltip: ReactNode;\n children: ReactNode;\n placement?: ComponentProps<typeof Content>['side'];\n /** Forcibly hide the tooltip regardless of hover state. */\n forceHide?: boolean;\n /** Forcibly show the tooltip regardless of hover state. Useful for guided-tour overlays. */\n forceShow?: boolean;\n className?: string;\n} & TriggerProps &\n Pick<ComponentProps<typeof TooltipContent>, 'variant' | 'className'>;\n\n/** Re-export of Radix `Tooltip.Provider`. Mount once at the app root so tooltips share delay state. */\nexport const TooltipProvider = Provider;\n\n/**\n * Short plain-text label that appears on hover or focus.\n *\n * **When to use:** describing an icon-only `Button`, explaining a disabled control, or labelling a\n * truncated value. Plain text only — auto-switches to the longer `\"explanatory\"` variant when the string\n * exceeds 30 characters.\n * **When NOT to use:** for rich preview content (multiple lines, formatted text, structured data) use\n * `HoverCard`; for tooltips containing links or buttons use `Popover` (interactive elements break a11y\n * inside a `Tooltip`).\n * **Composition:** wrap any focusable element via `triggerAsChild` so the tooltip targets the underlying\n * native element. Mount `TooltipProvider` once at the app root.\n *\n * @see RECIPES.md#disabled-button-tooltip — for the disabled-button + tooltip pattern\n */\nexport const Tooltip = ({\n tooltip,\n children,\n className,\n keepOpenOnTriggerClick = false,\n variant,\n placement = 'right',\n forceHide = false,\n forceShow = false,\n // trigger props\n triggerAsChild = false,\n}: Props) => {\n const [open, setOpen] = useState(false);\n\n const resolvedVariant = (() => {\n if (!!variant) return variant;\n if (typeof tooltip === 'string' && tooltip.length > ACTION_TOOLTIP_LIMIT) return 'explanatory';\n\n return 'action';\n })();\n\n const isActionVariant = resolvedVariant === 'action';\n\n const handleKeyUp: ComponentProps<typeof Trigger>['onKeyUp'] = (event) => {\n if (![keyCodes.ENTER, keyCodes.SPACE].includes(event.key)) return;\n event.stopPropagation();\n };\n\n return (\n <TooltipRoot\n open={!!tooltip && (open || forceShow) && !forceHide}\n onOpenChange={setOpen}\n disableHoverableContent={isActionVariant}\n >\n <TooltipTrigger\n asChild={triggerAsChild}\n keepOpenOnClick={keepOpenOnTriggerClick}\n onKeyUp={handleKeyUp}\n >\n {children}\n </TooltipTrigger>\n\n <TooltipContent\n className={className}\n variant={resolvedVariant}\n placement={placement}\n keepOpenOnPointerDownOutside={keepOpenOnTriggerClick}\n >\n {tooltip}\n </TooltipContent>\n </TooltipRoot>\n );\n};\n\nTooltip.Root = TooltipRoot;\nTooltip.Content = TooltipContent;\nTooltip.Trigger = TooltipTrigger;\n","import { useId } from 'react';\n\nimport { cn } from '../../utils';\n\nexport type Height = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n/**\n * Props for `Skeleton`. `height` maps to the named token (xxs 12px → 2xl 48px); `count` renders multiple\n * stacked placeholders sharing the same shape.\n */\ntype SkeletonProps = {\n /** Named height token — `xxs` (12px) through `2xl` (48px). */\n height?: Height;\n className?: string;\n /** Number of stacked placeholder rows. Use for list-style loading states. */\n count?: number;\n};\n\nconst HEIGHT_CLASS_NAME: Record<Height, string> = {\n xxs: 'tw-h-3 tw-rounded',\n xs: 'tw-h-4 tw-rounded',\n sm: 'tw-h-5 tw-rounded',\n md: 'tw-h-6 tw-rounded-md',\n lg: 'tw-h-8 tw-rounded-lg',\n xl: 'tw-h-10 tw-rounded-lg',\n '2xl': 'tw-h-12 tw-rounded-lg',\n};\n\nconst ANIMATION_CLASS_NAME = cn(\n // base styles\n 'tw-relative',\n 'tw-overflow-hidden',\n 'tw-pointer-events-none',\n 'tw-bg-muted',\n\n // before\n 'before:tw-content-[\"\"]',\n 'before:tw-opacity-100',\n 'before:tw-absolute',\n 'before:tw-inset-0',\n 'before:-tw-translate-x-full',\n 'before:tw-animate-[shimmer_2s_infinite]',\n 'before:tw-bg-gradient-to-r',\n 'before:tw-from-transparent',\n 'before:tw-to-transparent',\n 'before:tw-via-neutral-50',\n);\n\n/**\n * Animated placeholder shown in place of content that is still loading.\n *\n * **When to use:** during initial page or section load while the real content is fetched. Match the\n * placeholder shape to the eventual content (one `Skeleton height=\"lg\"` per title row, several `xs` for\n * paragraph lines). For list shells use `count` to render N stacked placeholders.\n * **When NOT to use:** for indeterminate background work without a layout slot use `DotsLoader` or\n * `Button isLoading`; for empty / error states once the request resolves use `EmptyState` / `ErrorState`.\n * **Composition:** drop directly into the slot the real content will occupy. `SkeletonList` is the typical\n * shell for `Table` / `Card`-list pages.\n *\n * @see RECIPES.md#data-card-with-skeleton — for a loading card pattern\n */\nexport const Skeleton = ({ height = 'md', className, count = 1 }: SkeletonProps) => {\n const prefixId = useId();\n const keys = Array.from({ length: count }, (_, i) => `${prefixId}-${i}`);\n\n return (\n <>\n {keys.map((key) => (\n <div\n key={key}\n data-skeleton=\"true\"\n className={cn(HEIGHT_CLASS_NAME[height], ANIMATION_CLASS_NAME, className)}\n />\n ))}\n </>\n );\n};\n","export * from 'lucide-react';\nexport type { LucideIcon, LucideProps } from 'lucide-react';\n\nexport { Keboola } from './Keboola';\n","import { forwardRef } from 'react';\nimport type { LucideIcon, LucideProps } from 'lucide-react';\n\nimport { cn } from '../utils';\n\n// `forwardRef` here is required for type compatibility with `LucideIcon`\n// (a `ForwardRefExoticComponent` from lucide-react). React 19's ref-as-prop\n// pattern produces a plain function component which isn't structurally\n// assignable to `LucideIcon`, so consumers couldn't pass `Keboola`\n// interchangeably with imported Lucide icons (e.g. `<Button><Keboola className=\"tw-size-4\" /></Button>`).\n// oxlint-disable-next-line react-x/no-forward-ref\nexport const Keboola: LucideIcon = forwardRef<SVGSVGElement, LucideProps>(\n ({ size = 24, color = 'currentColor', className, children, ...rest }, ref) => (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox=\"0 0 300 512\"\n fill={color}\n className={cn('lucide', className)}\n {...rest}\n >\n <path d=\"M152 320C79.7 320 24.5 233.9 24.5 124.7C24.5 15.6 70.5 0 152 0s123.6 15.6 123.6 124.7C275.5 233.9 217.7 320 152 320zm-8.7-50.5c0-11.2-9.5-20.3-21.2-20.3s-21.2 9.1-21.2 20.3c0 11.2 9.5 20.3 21.2 20.3s21.2-9.1 21.2-20.3zm55.7 0c0-11.2-9.5-20.3-21.2-20.3s-21.2 9.1-21.2 20.3c0 11.2 9.5 20.3 21.2 20.3s21.2-9.1 21.2-20.3zm68.9 115.1c10.2 9.3 20.2 20.5 29 35c5.9 9.7 2.6 22.1-7.5 27.8c-3.4 1.9-7.1 2.8-10.7 2.8c-7.2 0-14.3-3.6-18.3-10c-6.8-11.1-13.8-18.9-21.7-26.1c-7.3-6.7-15.6-12.7-24.9-19.5c-.7-.5-1.4-1-2.1-1.5c-5-3.6-10-6.8-14.9-9.4c.6 1 1.2 2.1 1.8 3.2c14.4 26.4 29.2 63.1 29.2 104.9c0 11.2-9.5 20.3-21.2 20.3c-11.7 0-21.2-9.1-21.2-20.3c.1-31.8-11.6-62.3-23.8-84.9c-4-7.4-8-13.9-11.6-19.3c-3.4 5.2-7.2 11.3-11 18.3c-12.5 22.7-24.5 53.8-24.4 86c0 11.2-9.5 20.3-21.2 20.3s-21.2-9.1-21.2-20.3c.1-41.8 14.9-78.4 29.2-104.9c.6-1.1 1.2-2.1 1.8-3.2c-5 2.7-9.9 5.8-14.9 9.4c-.6 .5-1.3 .9-1.9 1.4c-9.5 6.9-17.8 12.9-25.1 19.7c-7.9 7.2-14.9 15.1-21.7 26.1c-5.9 9.7-18.9 12.9-29 7.2C.5 441.8-2.9 429.3 3.1 419.7c8.9-14.4 18.8-25.7 29-35c9.2-8.4 18.5-15.1 27.6-21.7c1-.7 2-1.4 3-2.2c4.7-3.5 9.6-6.7 14.6-9.6c-5-2.9-9.8-6.1-14.6-9.6C39.8 325 19.9 302.5 3.1 275.1c-5.9-9.7-2.6-22.1 7.5-27.8c10.1-5.7 23.1-2.5 29 7.2c14.6 23.7 31.1 42 48.7 54.9c18.9 13.7 37.4 20.5 56.5 21.5c1.7-.1 3.5-.1 5.2-.1c1.8 0 3.5 .1 5.2 .1c0 0 0 0 0 0c19.1-1.1 37.6-7.9 56.5-21.5c17.6-12.8 34.2-31.2 48.7-54.9c6-9.7 18.9-12.9 29-7.2c10.1 5.7 13.4 18.1 7.5 27.8c-16.8 27.4-36.7 49.9-59.6 66.6c-4.7 3.5-9.6 6.7-14.5 9.6c4.9 2.9 9.8 6.1 14.5 9.6c.9 .7 1.8 1.3 2.7 2c9.2 6.7 18.5 13.5 27.9 22z\" />\n {children}\n </svg>\n ),\n);\n\nKeboola.displayName = 'Keboola';\n","import { cva } from 'class-variance-authority';\n\nexport const variants = cva(\n [\n 'tailwindcss-preflight',\n 'tw-group/button',\n 'tw-border-box',\n\n // layout\n 'tw-relative',\n 'tw-flex',\n 'tw-items-center',\n 'tw-justify-center',\n 'tw-gap-2',\n\n // text\n 'tw-text-xs',\n 'tw-leading-5',\n 'tw-font-medium',\n 'tw-tracking-[1px]',\n 'tw-uppercase',\n\n // border\n 'tw-rounded-[var(--radius-lg,0.25rem)]',\n 'tw-border',\n 'tw-border-transparent',\n\n // styling\n 'tw-shadow-none',\n '[a]:tw-cursor-pointer', // explicitly set for anchor\n\n 'focus-visible:tw-outline',\n 'focus-visible:tw-outline-1',\n 'focus-visible:-tw-outline-offset-1',\n 'focus-visible:tw-outline-ring',\n 'focus-visible:tw-ring-4',\n 'focus-visible:tw-ring-ring/30',\n\n // disabled\n 'disabled:tw-opacity-40',\n 'disabled:tw-cursor-not-allowed',\n\n // anchor support\n '!tw-no-underline',\n 'aria-disabled:tw-opacity-40',\n 'aria-disabled:tw-cursor-not-allowed',\n\n '[&_svg]:tw-shrink-0',\n ],\n {\n defaultVariants: {\n size: 'medium',\n variant: 'primary',\n block: false,\n },\n variants: {\n block: {\n true: ['tw-w-full'],\n },\n variant: {\n primary: [\n 'tw-text-white',\n 'tw-bg-primary-500',\n\n 'focus:tw-text-white',\n 'hover:tw-text-white',\n 'hover:not-disabled:tw-bg-primary-600',\n 'active:not-disabled:tw-bg-primary-800',\n\n // anchor disabled override\n 'aria-disabled:!tw-bg-primary-500',\n ],\n secondary: [\n 'tw-text-white',\n 'tw-bg-secondary-500',\n\n 'focus:tw-text-white',\n 'hover:tw-text-white',\n 'hover:not-disabled:tw-bg-secondary-700',\n 'active:not-disabled:tw-bg-secondary-800',\n\n // anchor disabled override\n 'aria-disabled:!tw-bg-secondary-500',\n ],\n danger: [\n 'tw-text-white',\n 'tw-bg-error-500',\n\n 'focus:tw-text-white',\n 'hover:tw-text-white',\n 'hover:not-disabled:tw-bg-error-600',\n 'active:not-disabled:tw-bg-error-700',\n\n // anchor disabled override\n 'aria-disabled:!tw-bg-error-500',\n ],\n invisible: [\n 'tw-text-neutral-800',\n 'tw-bg-transparent',\n\n 'focus:tw-text-neutral-800',\n 'hover:not-disabled:tw-bg-neutral-100',\n 'hover:tw-text-neutral-800',\n 'active:not-disabled:tw-bg-neutral-150',\n\n // contrasting icon on hover/active\n '[&_svg]:tw-text-neutral-400',\n '[&_svg]:hover:not-disabled:tw-text-secondary-600',\n '[&_svg]:active:not-disabled:tw-text-secondary-600',\n\n // anchor disabled override\n 'aria-disabled:!tw-bg-transparent',\n ],\n outline: [\n 'tw-text-neutral-800',\n 'tw-bg-white',\n // border\n '!tw-border-neutral-200',\n 'hover:tw-text-neutral-800',\n 'focus:tw-text-neutral-800',\n 'hover:not-disabled:!tw-border-neutral-300',\n 'hover:not-disabled:tw-bg-neutral-100',\n 'active:not-disabled:tw-bg-neutral-200',\n\n // contrasting icon hover, same as invisible\n '[&_svg]:tw-text-neutral-400',\n '[&_svg]:not-disabled:hover:tw-text-secondary-600',\n '[&_svg]:active:not-disabled:tw-text-secondary-600',\n\n // anchor disabled override\n 'aria-disabled:!tw-bg-white',\n 'aria-disabled:!tw-border-neutral-200',\n ],\n\n inline: [\n 'tw-text-neutral-800',\n 'tw-bg-transparent',\n 'tw-rounded-full',\n\n '[&_svg]:tw-text-neutral-400',\n '[&_svg]:not-disabled:hover:tw-text-secondary-600',\n '[&_svg]:not-disabled:focus:tw-text-secondary-600',\n ],\n },\n size: {\n medium: [\n 'tw-max-h-10',\n 'tw-min-h-10',\n 'tw-px-4',\n 'tw-py-2.5',\n '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4',\n ],\n small: [\n 'tw-max-h-8',\n 'tw-min-h-8',\n 'tw-px-4',\n 'tw-py-1.5',\n '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4',\n ],\n large: [\n 'tw-max-h-12',\n 'tw-min-h-12',\n 'tw-px-4',\n 'tw-py-3.5',\n '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4',\n ],\n\n 'icon-lg': ['tw-size-12', 'tw-p-0', '[&_svg:not([class*=\"tw-size-\"])]:tw-size-6'],\n icon: ['tw-size-10', 'tw-p-0', '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4'],\n 'icon-sm': ['tw-size-8', 'tw-p-0', '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4'],\n 'icon-xs': ['tw-size-6', 'tw-p-0', '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4'],\n 'icon-2xs': [\n '!tw-inline-flex',\n 'tw-size-5',\n 'tw-max-h-5',\n '[&_svg:not([class*=\"tw-size-\"])]:tw-size-3',\n ],\n 'icon-3xs': ['tw-h-fit', 'tw-w-fit', '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4'],\n },\n },\n },\n);\n\nexport const argoVariants = cva(\n [\n 'tailwindcss-preflight',\n\n // layout\n 'tw-relative',\n 'tw-inline-flex',\n 'tw-items-center',\n 'tw-justify-center',\n 'tw-whitespace-nowrap',\n 'tw-gap-2',\n\n // border\n 'tw-border',\n 'tw-border-transparent',\n 'tw-rounded-[var(--radius-lg,0.25rem)]',\n\n // text\n 'tw-font-medium',\n 'tw-select-none',\n\n // focus visible\n '!tw-outline-none',\n 'focus-visible:tw-ring-2',\n\n // disabled\n 'disabled:tw-cursor-not-allowed',\n 'disabled:tw-opacity-50',\n 'active:tw-opacity-60',\n\n 'tw-transition-all',\n 'tw-bg-clip-padding',\n\n // anchor support\n '!tw-no-underline',\n 'aria-disabled:tw-cursor-not-allowed',\n 'aria-disabled:tw-opacity-50',\n\n // icon\n 'tw-shrink-0',\n '[&_svg]:tw-pointer-events-none',\n '[&_svg]:tw-shrink-0',\n \"[&_svg:not([class*='tw-size-'])]:tw-size-4\",\n ],\n {\n defaultVariants: {\n variant: 'primary',\n size: 'medium',\n },\n variants: {\n block: {\n true: ['tw-w-full'],\n },\n variant: {\n primary: [\n 'tw-bg-primary',\n 'tw-text-primary-foreground',\n '[a]:hover:tw-bg-primary/80',\n 'hover:not-disabled:tw-bg-primary/90',\n 'hover:tw-text-primary-foreground',\n 'focus:tw-text-primary-foreground',\n\n 'focus-visible:tw-border-primary',\n 'focus-visible:tw-ring-primary/50',\n ],\n secondary: [\n 'tw-bg-primary/10',\n 'tw-text-primary',\n 'hover:not-disabled:tw-bg-primary/20',\n\n 'focus-visible:tw-border-primary',\n 'focus-visible:tw-ring-primary/50',\n ],\n\n // should be called \"destructive\" by Figma\n danger: [\n 'tw-bg-destructive',\n 'tw-text-destructive-foreground',\n 'hover:tw-text-destructive-foreground',\n 'focus:tw-text-destructive-foreground',\n\n 'focus-visible:tw-border-destructive',\n 'focus-visible:tw-ring-destructive/20',\n ],\n outline: [\n '!tw-border-input',\n 'tw-bg-background',\n // Semantic base text color so the label/icon flips in dark mode\n // (matches `invisible`); previously unset → inherited a fixed dark color.\n 'tw-text-foreground',\n 'hover:not-disabled:tw-bg-accent',\n 'hover:not-disabled:tw-text-accent-foreground',\n 'hover:active:tw-bg-background',\n 'focus-visible:!tw-border-primary',\n 'focus-visible:tw-ring-primary/50',\n ],\n\n // should be called \"ghost\" by Figma\n invisible: [\n 'tw-bg-transparent',\n 'tw-text-foreground',\n 'hover:not-disabled:tw-bg-accent',\n 'hover:not-disabled:tw-text-accent-foreground',\n 'hover:not-disabled:tw-border-accent',\n\n 'focus-visible:tw-ring-primary/50',\n ],\n // should be called \"link\" by Figma\n inline: [\n 'tw-bg-transparent',\n 'tw-text-primary',\n 'hover:tw-underline',\n 'hover:active:tw-bg-transparent',\n 'focus-visible:tw-ring-primary/50',\n ],\n },\n size: {\n // should be called \"default\" by Figma\n medium: ['tw-max-h-9', 'tw-py-2', 'tw-px-4', 'tw-text-sm'],\n // should be called \"small\" by Figma\n small: ['tw-max-h-8', 'tw-py-2', 'tw-px-3', 'tw-text-xs'],\n // should be called \"large\" by Figma\n large: ['tw-max-h-10', 'tw-py-2.5', 'tw-px-6', 'tw-text-sm'],\n\n 'icon-lg': ['tw-size-10'],\n icon: ['tw-size-9'],\n 'icon-sm': ['tw-size-8'],\n // unsupported in ARGO, remove when old design is gone\n 'icon-xs': [],\n 'icon-2xs': [],\n 'icon-3xs': [],\n },\n },\n },\n);\n","import type { ComponentProps, ElementRef, Ref } from 'react';\nimport { Root, Slottable } from '@radix-ui/react-slot';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { Loader2 } from '../../icons';\nimport { cn } from '../../utils';\nimport { useIsLegacyBrand } from '../internal/useIsLegacyBrand';\n\nimport { argoVariants, variants } from './styles';\n\n/**\n * Props for the `Button` component.\n *\n * Pass `variant` for primary/secondary/danger/outline/invisible looks, `size`\n * for height (including `icon-*` sizes when rendering icon-only). Icons are\n * composed as children — `<Button><Trash2 className=\"tw-size-4\" /> Delete</Button>`.\n */\ntype Props = {\n /** Replaces the leading content with a spinner and disables the button visually. The caller still controls `disabled`. */\n isLoading?: boolean;\n /** Render as a Radix `Slot` so the parent JSX (e.g. a `react-router` `<Link>`) becomes the button element. */\n asChild?: boolean;\n} & ComponentProps<'button'> &\n VariantProps<typeof variants>;\n\n/**\n * Primary action surface for the design system — covers all clickable controls except inline text links.\n *\n * **When to use:** any user-initiated action (submit, save, open modal, run job). Use `size=\"icon-*\"` with no\n * children for an icon-only button; there is no separate `IconButton` component.\n * **When NOT to use:** for inline text-link actions inside body copy use `ButtonInline`; for navigation that\n * opens a URL use `Link`; for \"primary action + dropdown of related actions\" use `SplitButton`.\n * **Composition:** wrap in `Tooltip` when icon-only or when disabled state needs an explanation; pair with\n * `Popconfirm` for destructive confirmations; pass through `Modal.Trigger` / `DropdownMenu.Trigger` via `asChild`.\n *\n * @see RECIPES.md#disabled-button-tooltip — for the disabled-button + tooltip pattern\n * @see RECIPES.md#confirm-dialog — for destructive-action confirmation\n */\nexport const Button = ({\n ref,\n children,\n disabled = false,\n className,\n type = 'button',\n isLoading = false,\n asChild = false,\n onClick,\n variant = 'primary',\n size = 'medium',\n block = false,\n ...buttonProps\n}: Props & { ref?: Ref<ElementRef<'button'>> }) => {\n const isLegacy = useIsLegacyBrand();\n const renderArgo = !isLegacy;\n const Comp = asChild ? Root : 'button';\n const isIconOnly = String(size).startsWith('icon');\n const classNames = renderArgo\n ? argoVariants({ variant, size, block, className })\n : variants({ size, variant, block, className });\n\n const handleClick: ComponentProps<'button'>['onClick'] = (event) => {\n const isAnchor = event.currentTarget.tagName === 'A';\n\n // <a/> does not support disabled by default, and we cannot use pointer-events: none because cursor-not-allowed would not work.\n if (isAnchor && disabled) {\n event.preventDefault();\n return;\n }\n\n onClick?.(event);\n };\n\n return (\n <Comp\n {...buttonProps}\n ref={ref}\n disabled={disabled}\n aria-disabled={disabled}\n data-variant={variant}\n // `size=\"icon\"` / `size=\"icon-*\"` flags the button as icon-only — needed\n // by `ButtonGroup space=\"block\"` which stretches non-icon children to\n // equal width.\n data-icon-only={isIconOnly}\n type={type}\n onClick={handleClick}\n className={cn(classNames)}\n >\n {isLoading && <Loader2 className=\"tw-size-4 tw-shrink-0 tw-animate-spin\" />}\n <Slottable>{isLoading && isIconOnly ? null : children}</Slottable>\n </Comp>\n );\n};\n","import { useState } from 'react';\nimport type { ComponentProps, ElementRef, MouseEventHandler, Ref } from 'react';\n\nimport { cn, copyToClipboard } from '../../utils';\nimport { type Props as TooltipProps, Tooltip } from '../Tooltip';\n\ntype Props = {\n tooltip?: TooltipProps['tooltip'];\n tooltipPlacement?: TooltipProps['placement'];\n tooltipVariant?: TooltipProps['variant'];\n asChild?: TooltipProps['triggerAsChild'];\n text?: string | (() => string);\n} & ComponentProps<'button'>;\n\nexport const Clipboard = ({\n ref,\n text: textProp,\n children,\n tooltip = 'Copy to Clipboard',\n tooltipPlacement = 'top',\n tooltipVariant: tooltipVariantProp = 'action',\n asChild = false,\n onClick,\n className,\n ...restButtonProps\n}: Props & { ref?: Ref<ElementRef<'button'>> }) => {\n const [isTooltipOpen, setIsTooltipOpen] = useState(false);\n const [state, setState] = useState<'ready' | 'copied' | 'error'>('ready');\n const text = typeof textProp === 'function' ? textProp() : textProp;\n\n const copy = async (text: string) => {\n try {\n // For the clipboard feature to work reliably, the window must be in focus for security reasons.\n // However, the button can be clicked without the window being focused.\n if (!document.hasFocus()) window.focus();\n\n await copyToClipboard(text);\n setState('copied');\n } catch {\n setState('error');\n }\n };\n\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n if (text && state === 'ready') void copy(text);\n onClick?.(event);\n };\n\n const handleOnOpenChange: ComponentProps<typeof Tooltip.Root>['onOpenChange'] = (open) => {\n // Reset when the tooltip closes, allowing the user to leave the copy button.\n if (!open && state !== 'ready') setState('ready');\n setIsTooltipOpen(open);\n };\n\n const tooltipContent = (() => {\n if (!text) return 'Nothing to copy';\n if (state === 'error') return 'Failed to copy';\n if (state === 'copied') return 'Copied to Clipboard';\n return tooltip;\n })();\n\n const tooltipVariant: TooltipProps['variant'] =\n state === 'ready' && !!text ? tooltipVariantProp : 'action';\n\n return (\n <Tooltip.Root open={isTooltipOpen} onOpenChange={handleOnOpenChange}>\n <Tooltip.Trigger\n {...restButtonProps}\n asChild={asChild}\n keepOpenOnClick\n onClick={handleOnClick}\n className={cn('tw-cursor-pointer', className)}\n ref={ref}\n >\n {children ?? text}\n </Tooltip.Trigger>\n\n <Tooltip.Content\n keepOpenOnPointerDownOutside\n placement={tooltipPlacement}\n variant={tooltipVariant}\n >\n {tooltipContent}\n </Tooltip.Content>\n </Tooltip.Root>\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { Clipboard } from '../../components/Clipboard';\nimport { Copy } from '../../icons';\n\ntype ClipboardProps = Pick<\n ComponentProps<typeof Clipboard>,\n 'text' | 'tooltip' | 'tooltipPlacement' | 'tooltipVariant'\n>;\n\ntype ButtonProps = Omit<ComponentProps<typeof Button>, 'disabled' | 'icon'>;\n\ntype Props = ClipboardProps & ButtonProps & { icon?: ReactNode };\n\nconst DEFAULT_ICON: ReactNode = <Copy />;\n\nexport const ClipboardButton = ({\n // clipboard props\n text,\n tooltip,\n tooltipPlacement,\n tooltipVariant,\n\n // button props\n icon = DEFAULT_ICON,\n variant = 'outline',\n children,\n ...rest\n}: Props) => (\n <Clipboard\n asChild\n tooltip={tooltip}\n tooltipPlacement={tooltipPlacement}\n tooltipVariant={tooltipVariant}\n text={text}\n >\n <Button {...rest} variant={variant} disabled={!text}>\n {icon}\n {children}\n </Button>\n </Clipboard>\n);\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport DOMPurify from 'dompurify';\n\nimport { ClipboardButton } from '../../blocks/ClipboardButton';\nimport { Maximize2, Minimize2 } from '../../icons';\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { Tooltip } from '../Tooltip';\n\nconst MIN_SCALE = 0.5;\nconst MAX_SCALE = 3;\nconst ZOOM_STEP = 0.1;\n\ntype Props = {\n /** Raw SVG markup. Sanitized internally with DOMPurify (SVG profile) before rendering, so it is\n * safe even when it originates from user/LLM-controlled content. Non-SVG HTML is stripped. */\n html: string;\n copyText?: string;\n className?: string;\n};\n\nexport const ZoomableSvg = ({ html, copyText, className }: Props) => {\n const safeHtml = useMemo(\n () => DOMPurify.sanitize(html, { USE_PROFILES: { svg: true, svgFilters: true } }),\n [html],\n );\n\n const containerRef = useRef<HTMLDivElement>(null);\n const [scale, setScale] = useState(1);\n const [translate, setTranslate] = useState({ x: 0, y: 0 });\n const [isFullscreen, setIsFullscreen] = useState(false);\n\n useEffect(() => {\n if (!isFullscreen) return;\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n setIsFullscreen(false);\n }\n };\n document.addEventListener('keydown', onKeyDown, { capture: true });\n return () => document.removeEventListener('keydown', onKeyDown, { capture: true });\n }, [isFullscreen]);\n\n const dragRef = useRef<{\n startX: number;\n startY: number;\n startTx: number;\n startTy: number;\n } | null>(null);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n\n const onWheel = (e: WheelEvent) => {\n if (!e.ctrlKey && !e.metaKey) return;\n e.preventDefault();\n const delta = e.deltaY > 0 ? -ZOOM_STEP : ZOOM_STEP;\n setScale((s) => Math.min(MAX_SCALE, Math.max(MIN_SCALE, s + delta)));\n };\n\n el.addEventListener('wheel', onWheel, { passive: false });\n return () => el.removeEventListener('wheel', onWheel);\n }, []);\n\n const didDragRef = useRef(false);\n\n const handleMouseDown = useCallback(\n (e: React.MouseEvent) => {\n if (e.button !== 0) return;\n e.preventDefault();\n didDragRef.current = false;\n dragRef.current = {\n startX: e.clientX,\n startY: e.clientY,\n startTx: translate.x,\n startTy: translate.y,\n };\n },\n [translate],\n );\n\n const handleMouseMove = useCallback((e: React.MouseEvent) => {\n if (!dragRef.current) return;\n didDragRef.current = true;\n setTranslate({\n x: dragRef.current.startTx + e.clientX - dragRef.current.startX,\n y: dragRef.current.startTy + e.clientY - dragRef.current.startY,\n });\n }, []);\n\n const handleMouseUp = useCallback(() => {\n dragRef.current = null;\n }, []);\n\n const handleReset = useCallback(() => {\n setScale(1);\n setTranslate({ x: 0, y: 0 });\n }, []);\n\n const isZoomed = Math.abs(scale - 1) > 0.001 || translate.x !== 0 || translate.y !== 0;\n\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (didDragRef.current) {\n e.stopPropagation();\n }\n }, []);\n\n const stopPropagation = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n }, []);\n\n const diagramContent = (\n <div\n role=\"presentation\"\n className={cn('tw-group/zoom tw-relative', isFullscreen && 'tw-h-full')}\n onClick={handleClick}\n >\n <div\n role=\"presentation\"\n ref={containerRef}\n className={cn(\n 'tw-overflow-hidden tw-cursor-grab active:tw-cursor-grabbing tw-p-3',\n isFullscreen && 'tw-h-full',\n )}\n onMouseDown={handleMouseDown}\n onMouseMove={handleMouseMove}\n onMouseUp={handleMouseUp}\n onMouseLeave={handleMouseUp}\n >\n <div\n className={cn(\n 'tw-flex tw-justify-center tw-origin-center',\n isFullscreen && 'tw-h-full [&>svg]:tw-h-full',\n )}\n style={{ transform: `translate(${translate.x}px, ${translate.y}px) scale(${scale})` }}\n dangerouslySetInnerHTML={{ __html: safeHtml }}\n />\n </div>\n <div\n role=\"presentation\"\n className=\"tw-absolute tw-right-1 tw-top-1 tw-flex tw-gap-1 tw-opacity-0 tw-transition-opacity group-hover/zoom:tw-opacity-100\"\n onClick={stopPropagation}\n >\n {isZoomed && (\n <Tooltip tooltip=\"Reset zoom\" placement=\"top\" triggerAsChild>\n <Button size=\"small\" variant=\"outline\" onClick={handleReset}>\n Reset\n </Button>\n </Tooltip>\n )}\n {copyText && (\n <ClipboardButton text={copyText} tooltip=\"Copy code\" size=\"icon-sm\" variant=\"outline\" />\n )}\n <Tooltip\n tooltip={isFullscreen ? 'Exit fullscreen' : 'Fullscreen'}\n placement=\"top\"\n triggerAsChild\n >\n <Button\n size=\"icon-sm\"\n variant=\"outline\"\n aria-label={isFullscreen ? 'Exit fullscreen' : 'Fullscreen'}\n onClick={() => setIsFullscreen((f) => !f)}\n >\n {isFullscreen ? (\n <Minimize2 className=\"tw-size-4\" />\n ) : (\n <Maximize2 className=\"tw-size-4\" />\n )}\n </Button>\n </Tooltip>\n </div>\n </div>\n );\n\n if (isFullscreen) {\n return (\n <div\n role=\"presentation\"\n className=\"tw-fixed tw-inset-0 tw-z-[1060] tw-bg-muted tw-p-4\"\n onClick={stopPropagation}\n >\n {diagramContent}\n </div>\n );\n }\n\n return (\n <div\n className={cn(\n 'tw-overflow-hidden tw-rounded-md tw-border tw-border-border tw-bg-muted',\n className,\n )}\n >\n {diagramContent}\n </div>\n );\n};\n","import { useEffect, useId, useRef, useState } from 'react';\nimport { renderMermaidSVG } from 'beautiful-mermaid';\nimport type mermaid from 'mermaid';\n\nimport colors from '@keboola/tailwind-config/colors';\n\nimport { Skeleton } from '../../components/Skeleton/Skeleton';\nimport { ZoomableSvg } from '../../components/ZoomableSvg';\nimport { cn } from '../../utils';\n\ntype MermaidModule = { default: typeof mermaid };\n\nconst PRIMARY_FALLBACK_CHANNELS = '31 143 255';\n\nconst resolvePrimary = (): string => {\n const channels =\n typeof document === 'undefined'\n ? PRIMARY_FALLBACK_CHANNELS\n : getComputedStyle(document.documentElement).getPropertyValue('--color-primary').trim() ||\n PRIMARY_FALLBACK_CHANNELS;\n return `rgb(${channels})`;\n};\n\nlet mermaidPromise: Promise<MermaidModule> | null = null;\n\nconst getMermaid = (): Promise<MermaidModule> => {\n if (!mermaidPromise) {\n mermaidPromise = import('mermaid')\n .then((m) => {\n m.default.initialize({\n startOnLoad: false,\n securityLevel: 'strict',\n theme: 'base',\n themeVariables: {\n primaryColor: colors.secondary[100],\n primaryTextColor: colors.neutral[800],\n primaryBorderColor: colors.secondary[700],\n secondaryColor: colors.white,\n secondaryTextColor: colors.neutral[800],\n secondaryBorderColor: colors.neutral[150],\n tertiaryColor: colors.warning[100],\n tertiaryTextColor: colors.neutral[800],\n tertiaryBorderColor: colors.warning[500],\n lineColor: colors.neutral[300],\n textColor: colors.neutral[800],\n mainBkg: colors.secondary[100],\n nodeBorder: colors.secondary[700],\n clusterBkg: colors.white,\n clusterBorder: colors.neutral[150],\n titleColor: colors.neutral[800],\n edgeLabelBackground: colors.white,\n nodeTextColor: colors.neutral[800],\n actorBorder: colors.secondary[700],\n actorBkg: colors.secondary[100],\n actorTextColor: colors.neutral[800],\n actorLineColor: colors.neutral[300],\n signalColor: colors.neutral[800],\n signalTextColor: colors.neutral[800],\n labelBoxBkgColor: colors.secondary[100],\n labelBoxBorderColor: colors.secondary[700],\n labelTextColor: colors.neutral[800],\n loopTextColor: colors.neutral[800],\n noteBorderColor: colors.warning[500],\n noteBkgColor: colors.warning[100],\n noteTextColor: colors.neutral[800],\n sectionBkgColor: colors.secondary[100],\n altSectionBkgColor: colors.white,\n sectionBkgColor2: colors.neutral[100],\n taskBorderColor: colors.secondary[700],\n taskBkgColor: colors.secondary[100],\n taskTextColor: colors.neutral[800],\n taskTextDarkColor: colors.neutral[800],\n taskTextLightColor: colors.neutral[800],\n activeTaskBorderColor: resolvePrimary(),\n activeTaskBkgColor: colors.secondary[200],\n doneTaskBorderColor: colors.primary[600],\n doneTaskBkgColor: colors.primary[100],\n critBorderColor: colors.error[500],\n critBkgColor: colors.error[100],\n fontFamily: 'Inter, system-ui, sans-serif',\n fontSize: '14px',\n },\n });\n return m;\n })\n .catch((err) => {\n mermaidPromise = null;\n throw err;\n });\n }\n return mermaidPromise;\n};\n\nconst stripFontImports = (svg: string): string =>\n svg.replace(/@import\\s+url\\([^)]*fonts\\.googleapis\\.com[^)]*\\);?\\s*/g, '');\n\nconst tryFastRender = (code: string): string | null => {\n try {\n return stripFontImports(\n renderMermaidSVG(code, {\n bg: colors.white,\n fg: colors.neutral[800],\n transparent: true,\n font: 'Inter, system-ui, sans-serif',\n }),\n );\n } catch {\n return null;\n }\n};\n\nconst makeResponsive = (svgString: string): string => {\n const viewBoxMatch = svgString.match(/viewBox=\"[^\"]*\\s([\\d.]+)\\s[\\d.]+\"/);\n const vbWidth = viewBoxMatch ? Math.round(Number(viewBoxMatch[1])) : undefined;\n\n let result = svgString\n .replace(/(<svg[^>]*?)\\s+width=\"[^\"]*\"/i, '$1 width=\"100%\"')\n .replace(/(<svg[^>]*?)\\s+height=\"[^\"]*\"/i, '$1');\n\n if (!vbWidth) return result;\n\n const hasStyle = /(<svg[^>]*?)\\s+style=\"([^\"]*)\"/i.test(result);\n if (hasStyle) {\n result = result.replace(/(<svg[^>]*?)\\s+style=\"([^\"]*)\"/i, (_m, pre, styles) => {\n const cleaned = styles.replace(/max-width:\\s*[^;\"]*;?\\s*/g, '').trim();\n const combined = [cleaned, `max-width: ${vbWidth}px`].filter(Boolean).join('; ');\n return `${pre} style=\"${combined}\"`;\n });\n } else {\n result = result.replace(/<svg/, `<svg style=\"max-width: ${vbWidth}px\"`);\n }\n\n return result;\n};\n\nconst RENDER_DEBOUNCE_MS = 300;\n\n// Module-level SVG cache — persists across component remounts (e.g. tab switches\n// that cause React to remount the tree). Same code always produces the same SVG.\nconst svgCache = new Map<string, string>();\n\n// Resolve an SVG synchronously: cache hit first, otherwise a fast synchronous\n// render. Caches the result and returns it, or null when neither is available\n// (the caller then falls back to the async mermaid render).\nconst resolveSyncSvg = (code: string): string | null => {\n const cached = svgCache.get(code);\n if (cached) return cached;\n const fast = tryFastRender(code);\n if (fast) svgCache.set(code, fast);\n return fast;\n};\n\ntype Props = {\n /** Mermaid diagram source code. Supports flowchart, sequence, class, state, ER,\n * pie, gantt, and mindmap. Gantt `dateFormat HH:mm` (time-only) is not supported\n * by mermaid's dayjs parser — use `dateFormat YYYY-MM-DD HH:mm` with `axisFormat %H:%M` instead. */\n code: string;\n};\n\nexport const MermaidDiagram = ({ code }: Props) => {\n const id = useId();\n const [svg, setSvg] = useState<string | null>(() => resolveSyncSvg(code));\n const [renderFailed, setRenderFailed] = useState(false);\n const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const renderIdRef = useRef(0);\n\n // Synchronously reset stale state when code changes to avoid one-frame flash\n const [prevCode, setPrevCode] = useState(code);\n if (code !== prevCode) {\n setPrevCode(code);\n setSvg(resolveSyncSvg(code));\n setRenderFailed(false);\n }\n\n useEffect(() => {\n // Synchronous results (cache hit / fast render) are already applied and\n // cached by the useState initializer (mount) and the render-phase reset\n // (code change). Only the async fallback needs an effect.\n if (svgCache.has(code)) return;\n\n const currentRenderId = ++renderIdRef.current;\n\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n }\n\n debounceRef.current = setTimeout(() => {\n getMermaid()\n .then(async (mermaidModule) => {\n if (renderIdRef.current !== currentRenderId) return;\n const rendererId = `mermaid-${id.replaceAll(':', '')}`;\n const container = document.createElement('div');\n container.style.visibility = 'hidden';\n container.style.position = 'absolute';\n container.style.top = '-9999px';\n container.style.width = '900px';\n document.body.appendChild(container);\n try {\n const result = await mermaidModule.default.render(rendererId, code, container);\n if (renderIdRef.current === currentRenderId && result) {\n svgCache.set(code, result.svg);\n setSvg(result.svg);\n setRenderFailed(false);\n }\n } finally {\n container.remove();\n }\n })\n .catch((err) => {\n if (renderIdRef.current === currentRenderId) {\n console.error('[MermaidDiagram] fallback failed:', err);\n setSvg(null);\n setRenderFailed(true);\n }\n });\n }, RENDER_DEBOUNCE_MS);\n\n const timer = debounceRef.current;\n const renderId = renderIdRef;\n return () => {\n renderId.current++;\n if (timer) {\n clearTimeout(timer);\n }\n };\n }, [code, id]);\n\n const processedSvg = svg ? makeResponsive(svg) : null;\n\n if (renderFailed) {\n return (\n <pre\n className={cn(\n 'tw-my-3 tw-overflow-auto tw-whitespace-pre-wrap tw-break-all',\n 'tw-py-3 tw-px-4',\n 'tw-bg-neutral-50',\n 'tw-rounded-md tw-text-neutral-400',\n 'tw-text-sm tw-font-mono',\n )}\n >\n <code>{code}</code>\n </pre>\n );\n }\n\n if (processedSvg) {\n return (\n <ZoomableSvg\n key={code}\n html={processedSvg}\n copyText={`\\`\\`\\`mermaid\\n${code}\\n\\`\\`\\``}\n className=\"tw-my-3\"\n />\n );\n }\n\n return (\n <div className=\"tw-my-3 tw-overflow-hidden tw-rounded-md tw-border tw-border-neutral-150 tw-bg-neutral-50 tw-p-6\">\n <Skeleton className=\"tw-h-40\" />\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/classNames.ts","../src/utils/copyToClipboard.ts","../src/constants/keyCodes.ts","../src/components/ThemeProvider/utils.ts","../src/components/ThemeProvider/defaults.ts","../src/components/ThemeProvider/context.tsx","../src/components/Tooltip/TooltipContent.tsx","../src/components/Tooltip/TooltipRoot.tsx","../src/components/Tooltip/TooltipTrigger.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/Skeleton/Skeleton.tsx","../src/icons/index.ts","../src/icons/Keboola.tsx","../src/components/Button/styles.ts","../src/components/Button/Button.tsx","../src/components/Clipboard/Clipboard.tsx","../src/blocks/ClipboardButton/ClipboardButton.tsx","../src/components/ZoomableSvg/ZoomableSvg.tsx","../src/blocks/MermaidDiagram/MermaidDiagram.tsx"],"names":["extendTailwindMerge","clsx","keboolaLegacySidebar","keboolaLegacyTopnav","createContext","use","cva","Portal","jsx","Content","Root","Trigger","useState","jsxs","useId","Fragment","lucide_react_star","forwardRef","Slottable","text","useMemo","DOMPurify","useRef","useEffect","useCallback","colors","renderMermaidSVG"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAM,UAAUA,iCAAA,CAAoB;AAAA,EAClC,MAAA,EAAQ;AACV,CAAC,CAAA;AAEM,IAAM,KAAK,CAAA,GAAI,OAAA,KAA0B,QAAQC,SAAA,CAAK,GAAG,OAAO,CAAC,CAAA;;;ACPjE,IAAM,eAAA,GAAkB,CAAC,IAAA,KAAiB;AAC/C,EAAA,OAAO,SAAA,CAAU,SAAA,CAAU,SAAA,CAAU,IAAI,CAAA;AAC3C,CAAA;;;ACFO,IAAM,QAAA,GAAW;AAAA,EACtB,KAAA,EAAO,OAAA;AAAA,EAEP,KAAA,EAAO;AACT,CAAA;;;ACAO,IAAM,WAAA,GAAc,CAAC,KAAA,MAAyB;AAAA,EACnD,IAAI,KAAA,CAAM,EAAA;AAAA,EACV,MAAM,KAAA,CAAM,IAAA;AAAA,EACZ,OAAO,KAAA,CAAM,KAAA;AAAA,EACb,MAAM,KAAA,CAAM;AACd,CAAA,CAAA;;;ACHgC,CAACC,kCAAA,CAAqB,EAAA,EAAIC,kCAAoB,EAAE;AACzE,IAAM,oBAAA,GAA4C,OAAA;AAKlD,IAAM,gBAAA,GAAmB,eAAA;AAIzB,IAAM,YAAA,GAAsB;AAAA,EACjC,EAAA,EAAI,gBAAA;AAAA,EACJ,IA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M,cAAA,CAAe,GAAG,CAAA,GAAI,IAAA;AAEjD,EAAA,IAAI,YAAA,EAAc;AAChB,IAAA,uBACEf,cAAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,EAAA;AAAA,UACT,8DAAA;AAAA,UACA,iBAAA;AAAA,UACA,kBAAA;AAAA,UACA,mCAAA;AAAA,UACA;AAAA,SACF;AAAA,QAEA,QAAA,kBAAAA,cAAAA,CAAC,MAAA,EAAA,EAAM,QAAA,EAAA,IAAA,EAAK;AAAA;AAAA,KACd;AAAA,EAEJ;AAEA,EAAA,IAAI,YAAA,EAAc;AAChB,IAAA,uBACEA,cAAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QAEC,IAAA,EAAM,YAAA;AAAA,QACN,QAAA,EAAU,CAAA;AAAA,EAAkB,IAAI;AAAA,MAAA,CAAA;AAAA,QAChC,SAAA,EAAU;AAAA,OAAA;AAAA,MAHL;AAAA,KAIP;AAAA,EAEJ;AAEA,EAAA,uBACEA,cAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,kGAAA,EACb,0BAAAA,cAAAA,CAAC,QAAA,EAAA,EAAS,SAAA,EAAU,SAAA,EAAU,CAAA,EAChC,CAAA;AAEJ","file":"mermaid.cjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\nconst twMerge = extendTailwindMerge({\n prefix: 'tw-',\n});\n\nexport const cn = (...classes: ClassValue[]) => twMerge(clsx(...classes));\n","export const copyToClipboard = (text: string) => {\n return navigator.clipboard.writeText(text);\n};\n","export const keyCodes = {\n ENTER: 'Enter',\n ESCAPE: 'Escape',\n SPACE: ' ',\n};\n","import type { Brand } from '@keboola/brand-registry';\n\nimport type { Theme } from './types';\n\nexport const createTheme = (brand: Brand): Theme => ({\n id: brand.id,\n name: brand.name,\n shell: brand.shell,\n logo: brand.logo,\n});\n\nexport type CssVars = {\n set: (name: string, value: string | undefined) => void;\n expose: () => Record<string, string>;\n};\n\nexport const createCssVars = (): CssVars => {\n const vars: Record<string, string> = {};\n return {\n set: (name, value) => {\n if (value !== undefined) vars[name] = value;\n },\n expose: () => ({ ...vars }),\n };\n};\n","import type { Brand } from '@keboola/brand-registry';\nimport { keboolaLegacySidebar, keboolaLegacyTopnav } from '@keboola/brand-registry';\n\nimport type { ResolvedColorScheme } from './types';\nimport { createTheme } from './utils';\n\nexport const keboolaLegacyIds = [keboolaLegacySidebar.id, keboolaLegacyTopnav.id];\nexport const DEFAULT_COLOR_SCHEME: ResolvedColorScheme = 'light';\n\n// Sentinel active-brand id that maps to no registry brand. It resolves to\n// `defaultBrand` below, whose empty theme injects nothing — so the design-system\n// stylesheet defaults (`:root` / `[data-theme='dark']`) provide every token.\nexport const DEFAULT_BRAND_ID = 'design-system';\n\n// The \"no brand\" fallback: an empty theme → no CSS vars injected → the\n// stylesheet defaults win. Its shell/name still drive AppShell + switcher label.\nexport const defaultBrand: Brand = {\n id: DEFAULT_BRAND_ID,\n name: 'Design System',\n shell: 'sidebar',\n theme: {},\n};\nexport const defaultTheme = createTheme(defaultBrand);\n\nexport const DEFAULT_BRANDS: Brand[] = [];\n","import { createContext, use } from 'react';\n\nimport { DEFAULT_COLOR_SCHEME, defaultTheme } from './defaults';\nimport type { Theme } from './types';\nimport type { useBrandState } from './useBrandState';\nimport type { useColorSchemeState } from './useColorSchemeState';\n\nexport type ThemeContextValue = ReturnType<typeof useColorSchemeState> &\n ReturnType<typeof useBrandState> & {\n themes: Theme[];\n currentTheme: Theme;\n };\n\nconst noop = () => void 0;\n\nconst defaultContext: ThemeContextValue = {\n scheme: DEFAULT_COLOR_SCHEME,\n resolvedScheme: DEFAULT_COLOR_SCHEME,\n setScheme: noop,\n brandId: defaultTheme.id,\n setBrand: noop,\n\n themes: [defaultTheme],\n currentTheme: defaultTheme,\n};\n\nexport const ThemeContext = createContext(defaultContext);\n\nexport const useTheme = () => use(ThemeContext);\n\n/**\n * TEMPORARY — kbc-ui-internal only.\n *\n * Flags whether the subtree renders the argo design language. Defaults to argo\n * (`true`) — the modern default; legacy chrome is the exception. It exists\n * solely to bridge kbc-ui while its chrome is migrated off the legacy design\n * language: kbc-ui provides `false` for legacy brands/surfaces (see its\n * `AppThemeProvider`) and reads it via `useArgoDesign`. `ThemeProvider` does\n * not set it — argo is decoupled from the brand. Once every kbc-ui surface has\n * been migrated, this context and its hook can be deleted.\n */\nexport const ArgoDesignContext = createContext<boolean>(true);\n\nexport const useArgoDesign = () => use(ArgoDesignContext);\n","import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-tooltip';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nconst tooltipVariants = cva(\n [\n 'tailwindcss-preflight',\n 'tw-inline-block',\n 'tw-break-anywhere',\n 'tw-max-h-96',\n 'tw-overflow-y-auto',\n 'tw-z-[1060]',\n\n // legacy (dark) chrome — default\n 'tw-rounded',\n 'tw-bg-neutral-800',\n 'tw-text-white',\n\n // argo chrome overrides — semantic floating-panel tokens\n 'data-[argo=true]:tw-rounded-2xl',\n 'data-[argo=true]:tw-border',\n 'data-[argo=true]:tw-border-solid',\n 'data-[argo=true]:tw-border-border',\n 'data-[argo=true]:tw-bg-popover',\n 'data-[argo=true]:tw-text-popover-foreground',\n 'data-[argo=true]:tw-shadow-md',\n\n // argo open animation\n 'data-[argo=true]:data-[state=delayed-open]:tw-animate-in',\n 'data-[argo=true]:data-[state=instant-open]:tw-animate-in',\n 'data-[argo=true]:data-[state=delayed-open]:tw-fade-in-0',\n 'data-[argo=true]:data-[state=instant-open]:tw-fade-in-0',\n 'data-[argo=true]:data-[state=delayed-open]:tw-zoom-in-95',\n 'data-[argo=true]:data-[state=instant-open]:tw-zoom-in-95',\n\n // argo closed animation\n 'data-[argo=true]:data-[state=closed]:tw-animate-out',\n 'data-[argo=true]:data-[state=closed]:tw-fade-out-0',\n 'data-[argo=true]:data-[state=closed]:tw-zoom-out-95',\n\n // argo position animation\n 'data-[argo=true]:data-[side=bottom]:tw-slide-in-from-top-2',\n 'data-[argo=true]:data-[side=left]:tw-slide-in-from-right-2',\n 'data-[argo=true]:data-[side=right]:tw-slide-in-from-left-2',\n 'data-[argo=true]:data-[side=top]:tw-slide-in-from-bottom-2',\n ],\n {\n defaultVariants: {\n variant: 'action',\n },\n variants: {\n variant: {\n action: [\n 'tw-max-w-fit',\n 'tw-px-3',\n 'tw-py-2',\n\n 'tw-text-center',\n 'tw-text-xs',\n 'tw-font-medium',\n 'tw-uppercase',\n 'tw-tracking-wider',\n ],\n explanatory: [\n 'tw-max-w-80',\n 'tw-px-4',\n 'tw-py-3',\n 'tw-text-left',\n\n 'tw-text-sm',\n 'tw-font-normal',\n ],\n },\n },\n },\n);\n\ntype Props = {\n keepOpenOnPointerDownOutside?: boolean;\n placement?: ComponentProps<typeof Content>['side'];\n} & Omit<ComponentProps<typeof Content>, 'side'> &\n VariantProps<typeof tooltipVariants>;\n\nexport const TooltipContent = ({\n className,\n variant,\n keepOpenOnPointerDownOutside = false,\n children,\n onPointerDownOutside,\n sideOffset = 8,\n collisionPadding = 8,\n hideWhenDetached = true,\n placement = 'right',\n ...rest\n}: Props) => {\n const renderArgo = useArgoDesign();\n\n const handlePointerDownOutside: ComponentProps<typeof Content>['onPointerDownOutside'] = (\n event,\n ) => {\n if (keepOpenOnPointerDownOutside) event.preventDefault();\n onPointerDownOutside?.(event);\n };\n\n return (\n <Portal>\n <Content\n {...rest}\n // Marks the dark (non-argo) tooltip chrome so styles.css can invert\n // nested `.tw-prose` for contrast.\n data-tooltip-content={renderArgo ? undefined : true}\n data-argo={renderArgo}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n onPointerDownOutside={handlePointerDownOutside}\n className={tooltipVariants({ className, variant })}\n hideWhenDetached={hideWhenDetached}\n side={placement}\n >\n {children}\n </Content>\n </Portal>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Root } from '@radix-ui/react-tooltip';\n\ntype Props = ComponentProps<typeof Root>;\n\nconst DELAY_SHOW_TOOLTIP = 300;\n\nexport const TooltipRoot = ({ children, delayDuration = DELAY_SHOW_TOOLTIP, ...rest }: Props) => (\n <Root {...rest} delayDuration={delayDuration}>\n {children}\n </Root>\n);\n","import type { ComponentProps, ElementRef, Ref } from 'react';\nimport { Trigger } from '@radix-ui/react-tooltip';\n\nimport { cn } from '../../utils';\n\ntype Props = {\n keepOpenOnClick?: boolean;\n} & ComponentProps<typeof Trigger>;\n\nexport const TooltipTrigger = ({\n ref,\n children,\n className,\n keepOpenOnClick = false,\n onClick,\n onPointerDown,\n asChild,\n ...rest\n}: Props & { ref?: Ref<ElementRef<'button'>> }) => {\n const handleClick: ComponentProps<typeof Trigger>['onClick'] = (event) => {\n if (keepOpenOnClick) event.preventDefault();\n onClick?.(event);\n };\n\n const handlePointerDown: ComponentProps<typeof Trigger>['onPointerDown'] = (event) => {\n if (keepOpenOnClick) event.preventDefault();\n onPointerDown?.(event);\n };\n\n return (\n <Trigger\n {...rest}\n asChild\n ref={ref}\n className={cn('tailwindcss-preflight', className)}\n onClick={handleClick}\n onPointerDown={handlePointerDown}\n >\n {asChild ? (\n children\n ) : (\n // Default-mode trigger wraps children in a span so Radix has a\n // single DOM element to attach handlers to. `tailwindcss-preflight`\n // (merged in via Slot) activates Tailwind's preflight inside the\n // span, which sets `svg { display: block }` — without an inline-flex\n // container that would stack any bare Lucide icon onto its own\n // line. `tw-inline-flex tw-items-center` keeps icon + text aligned.\n <span className=\"tw-inline-flex tw-items-center\">{children}</span>\n )}\n </Trigger>\n );\n};\n","import { useState } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport type { Content, Trigger } from '@radix-ui/react-tooltip';\nimport { Provider } from '@radix-ui/react-tooltip';\n\nimport { keyCodes } from '../../constants/keyCodes';\n\nimport { TooltipContent } from './TooltipContent';\nimport { TooltipRoot } from './TooltipRoot';\nimport { TooltipTrigger } from './TooltipTrigger';\n\nconst ACTION_TOOLTIP_LIMIT = 30;\n\ntype TriggerProps = {\n triggerAsChild?: boolean;\n};\n\n/**\n * Props for `Tooltip`. `tooltip` is the popup content; `children` is the trigger element.\n * `variant` auto-resolves to `\"explanatory\"` for strings >30 chars, else `\"action\"`.\n */\nexport type Props = {\n /** Keep the tooltip visible when the user clicks the trigger (useful for click-to-copy feedback). */\n keepOpenOnTriggerClick?: boolean;\n /** Content rendered inside the tooltip. Plain text only — no interactive elements (use `HoverCard` or `Popover` for that). */\n tooltip: ReactNode;\n children: ReactNode;\n placement?: ComponentProps<typeof Content>['side'];\n /** Forcibly hide the tooltip regardless of hover state. */\n forceHide?: boolean;\n /** Forcibly show the tooltip regardless of hover state. Useful for guided-tour overlays. */\n forceShow?: boolean;\n className?: string;\n} & TriggerProps &\n Pick<ComponentProps<typeof TooltipContent>, 'variant' | 'className'>;\n\n/** Re-export of Radix `Tooltip.Provider`. Mount once at the app root so tooltips share delay state. */\nexport const TooltipProvider = Provider;\n\n/**\n * Short plain-text label that appears on hover or focus.\n *\n * **When to use:** describing an icon-only `Button`, explaining a disabled control, or labelling a\n * truncated value. Plain text only — auto-switches to the longer `\"explanatory\"` variant when the string\n * exceeds 30 characters.\n * **When NOT to use:** for rich preview content (multiple lines, formatted text, structured data) use\n * `HoverCard`; for tooltips containing links or buttons use `Popover` (interactive elements break a11y\n * inside a `Tooltip`).\n * **Composition:** wrap any focusable element via `triggerAsChild` so the tooltip targets the underlying\n * native element. Mount `TooltipProvider` once at the app root.\n *\n * @see RECIPES.md#disabled-button-tooltip — for the disabled-button + tooltip pattern\n */\nexport const Tooltip = ({\n tooltip,\n children,\n className,\n keepOpenOnTriggerClick = false,\n variant,\n placement = 'right',\n forceHide = false,\n forceShow = false,\n // trigger props\n triggerAsChild = false,\n}: Props) => {\n const [open, setOpen] = useState(false);\n\n const resolvedVariant = (() => {\n if (!!variant) return variant;\n if (typeof tooltip === 'string' && tooltip.length > ACTION_TOOLTIP_LIMIT) return 'explanatory';\n\n return 'action';\n })();\n\n const isActionVariant = resolvedVariant === 'action';\n\n const handleKeyUp: ComponentProps<typeof Trigger>['onKeyUp'] = (event) => {\n if (![keyCodes.ENTER, keyCodes.SPACE].includes(event.key)) return;\n event.stopPropagation();\n };\n\n return (\n <TooltipRoot\n open={!!tooltip && (open || forceShow) && !forceHide}\n onOpenChange={setOpen}\n disableHoverableContent={isActionVariant}\n >\n <TooltipTrigger\n asChild={triggerAsChild}\n keepOpenOnClick={keepOpenOnTriggerClick}\n onKeyUp={handleKeyUp}\n >\n {children}\n </TooltipTrigger>\n\n <TooltipContent\n className={className}\n variant={resolvedVariant}\n placement={placement}\n keepOpenOnPointerDownOutside={keepOpenOnTriggerClick}\n >\n {tooltip}\n </TooltipContent>\n </TooltipRoot>\n );\n};\n\nTooltip.Root = TooltipRoot;\nTooltip.Content = TooltipContent;\nTooltip.Trigger = TooltipTrigger;\n","import { useId } from 'react';\n\nimport { cn } from '../../utils';\n\nexport type Height = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n/**\n * Props for `Skeleton`. `height` maps to the named token (xxs 12px → 2xl 48px); `count` renders multiple\n * stacked placeholders sharing the same shape.\n */\ntype SkeletonProps = {\n /** Named height token — `xxs` (12px) through `2xl` (48px). */\n height?: Height;\n className?: string;\n /** Number of stacked placeholder rows. Use for list-style loading states. */\n count?: number;\n};\n\nconst HEIGHT_CLASS_NAME: Record<Height, string> = {\n xxs: 'tw-h-3 tw-rounded',\n xs: 'tw-h-4 tw-rounded',\n sm: 'tw-h-5 tw-rounded',\n md: 'tw-h-6 tw-rounded-md',\n lg: 'tw-h-8 tw-rounded-lg',\n xl: 'tw-h-10 tw-rounded-lg',\n '2xl': 'tw-h-12 tw-rounded-lg',\n};\n\nconst ANIMATION_CLASS_NAME = cn(\n // base styles\n 'tw-relative',\n 'tw-overflow-hidden',\n 'tw-pointer-events-none',\n 'tw-bg-muted',\n\n // before\n 'before:tw-content-[\"\"]',\n 'before:tw-opacity-100',\n 'before:tw-absolute',\n 'before:tw-inset-0',\n 'before:-tw-translate-x-full',\n 'before:tw-animate-[shimmer_2s_infinite]',\n 'before:tw-bg-gradient-to-r',\n 'before:tw-from-transparent',\n 'before:tw-to-transparent',\n 'before:tw-via-white/40',\n);\n\n/**\n * Animated placeholder shown in place of content that is still loading.\n *\n * **When to use:** during initial page or section load while the real content is fetched. Match the\n * placeholder shape to the eventual content (one `Skeleton height=\"lg\"` per title row, several `xs` for\n * paragraph lines). For list shells use `count` to render N stacked placeholders.\n * **When NOT to use:** for indeterminate background work without a layout slot use `DotsLoader` or\n * `Button isLoading`; for empty / error states once the request resolves use `EmptyState` / `ErrorState`.\n * **Composition:** drop directly into the slot the real content will occupy. `SkeletonList` is the typical\n * shell for `Table` / `Card`-list pages.\n *\n * @see RECIPES.md#data-card-with-skeleton — for a loading card pattern\n */\nexport const Skeleton = ({ height = 'md', className, count = 1 }: SkeletonProps) => {\n const prefixId = useId();\n const keys = Array.from({ length: count }, (_, i) => `${prefixId}-${i}`);\n\n return (\n <>\n {keys.map((key) => (\n <div\n key={key}\n data-skeleton=\"true\"\n className={cn(HEIGHT_CLASS_NAME[height], ANIMATION_CLASS_NAME, className)}\n />\n ))}\n </>\n );\n};\n","export * from 'lucide-react';\nexport type { LucideIcon, LucideProps } from 'lucide-react';\n\nexport { Keboola } from './Keboola';\n","import { forwardRef } from 'react';\nimport type { LucideIcon, LucideProps } from 'lucide-react';\n\nimport { cn } from '../utils';\n\n// `forwardRef` here is required for type compatibility with `LucideIcon`\n// (a `ForwardRefExoticComponent` from lucide-react). React 19's ref-as-prop\n// pattern produces a plain function component which isn't structurally\n// assignable to `LucideIcon`, so consumers couldn't pass `Keboola`\n// interchangeably with imported Lucide icons (e.g. `<Button><Keboola className=\"tw-size-4\" /></Button>`).\n// oxlint-disable-next-line react-x/no-forward-ref\nexport const Keboola: LucideIcon = forwardRef<SVGSVGElement, LucideProps>(\n ({ size = 24, color = 'currentColor', className, children, ...rest }, ref) => (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox=\"0 0 300 512\"\n fill={color}\n className={cn('lucide', className)}\n {...rest}\n >\n <path d=\"M152 320C79.7 320 24.5 233.9 24.5 124.7C24.5 15.6 70.5 0 152 0s123.6 15.6 123.6 124.7C275.5 233.9 217.7 320 152 320zm-8.7-50.5c0-11.2-9.5-20.3-21.2-20.3s-21.2 9.1-21.2 20.3c0 11.2 9.5 20.3 21.2 20.3s21.2-9.1 21.2-20.3zm55.7 0c0-11.2-9.5-20.3-21.2-20.3s-21.2 9.1-21.2 20.3c0 11.2 9.5 20.3 21.2 20.3s21.2-9.1 21.2-20.3zm68.9 115.1c10.2 9.3 20.2 20.5 29 35c5.9 9.7 2.6 22.1-7.5 27.8c-3.4 1.9-7.1 2.8-10.7 2.8c-7.2 0-14.3-3.6-18.3-10c-6.8-11.1-13.8-18.9-21.7-26.1c-7.3-6.7-15.6-12.7-24.9-19.5c-.7-.5-1.4-1-2.1-1.5c-5-3.6-10-6.8-14.9-9.4c.6 1 1.2 2.1 1.8 3.2c14.4 26.4 29.2 63.1 29.2 104.9c0 11.2-9.5 20.3-21.2 20.3c-11.7 0-21.2-9.1-21.2-20.3c.1-31.8-11.6-62.3-23.8-84.9c-4-7.4-8-13.9-11.6-19.3c-3.4 5.2-7.2 11.3-11 18.3c-12.5 22.7-24.5 53.8-24.4 86c0 11.2-9.5 20.3-21.2 20.3s-21.2-9.1-21.2-20.3c.1-41.8 14.9-78.4 29.2-104.9c.6-1.1 1.2-2.1 1.8-3.2c-5 2.7-9.9 5.8-14.9 9.4c-.6 .5-1.3 .9-1.9 1.4c-9.5 6.9-17.8 12.9-25.1 19.7c-7.9 7.2-14.9 15.1-21.7 26.1c-5.9 9.7-18.9 12.9-29 7.2C.5 441.8-2.9 429.3 3.1 419.7c8.9-14.4 18.8-25.7 29-35c9.2-8.4 18.5-15.1 27.6-21.7c1-.7 2-1.4 3-2.2c4.7-3.5 9.6-6.7 14.6-9.6c-5-2.9-9.8-6.1-14.6-9.6C39.8 325 19.9 302.5 3.1 275.1c-5.9-9.7-2.6-22.1 7.5-27.8c10.1-5.7 23.1-2.5 29 7.2c14.6 23.7 31.1 42 48.7 54.9c18.9 13.7 37.4 20.5 56.5 21.5c1.7-.1 3.5-.1 5.2-.1c1.8 0 3.5 .1 5.2 .1c0 0 0 0 0 0c19.1-1.1 37.6-7.9 56.5-21.5c17.6-12.8 34.2-31.2 48.7-54.9c6-9.7 18.9-12.9 29-7.2c10.1 5.7 13.4 18.1 7.5 27.8c-16.8 27.4-36.7 49.9-59.6 66.6c-4.7 3.5-9.6 6.7-14.5 9.6c4.9 2.9 9.8 6.1 14.5 9.6c.9 .7 1.8 1.3 2.7 2c9.2 6.7 18.5 13.5 27.9 22z\" />\n {children}\n </svg>\n ),\n);\n\nKeboola.displayName = 'Keboola';\n","import { cva } from 'class-variance-authority';\n\nexport const variants = cva(\n [\n 'tailwindcss-preflight',\n 'tw-group/button',\n 'tw-border-box',\n\n // layout\n 'tw-relative',\n 'tw-flex',\n 'tw-items-center',\n 'tw-justify-center',\n 'tw-gap-2',\n\n // text\n 'tw-text-xs',\n 'tw-leading-5',\n 'tw-font-medium',\n 'tw-tracking-[1px]',\n 'tw-uppercase',\n\n // border — legacy (non-argo) chrome uses a fixed radius, not the brand token.\n 'tw-rounded',\n 'tw-border',\n 'tw-border-transparent',\n\n // styling\n 'tw-shadow-none',\n '[a]:tw-cursor-pointer', // explicitly set for anchor\n\n 'focus-visible:tw-outline',\n 'focus-visible:tw-outline-1',\n 'focus-visible:-tw-outline-offset-1',\n 'focus-visible:tw-outline-ring',\n 'focus-visible:tw-ring-4',\n 'focus-visible:tw-ring-ring/30',\n\n // disabled\n 'disabled:tw-opacity-40',\n 'disabled:tw-cursor-not-allowed',\n\n // anchor support\n '!tw-no-underline',\n 'aria-disabled:tw-opacity-40',\n 'aria-disabled:tw-cursor-not-allowed',\n\n '[&_svg]:tw-shrink-0',\n ],\n {\n defaultVariants: {\n size: 'medium',\n variant: 'primary',\n block: false,\n },\n variants: {\n block: {\n true: ['tw-w-full'],\n },\n variant: {\n primary: [\n 'tw-text-white',\n 'tw-bg-primary-500',\n\n 'focus:tw-text-white',\n 'hover:tw-text-white',\n 'hover:not-disabled:tw-bg-primary-600',\n 'active:not-disabled:tw-bg-primary-800',\n\n // anchor disabled override\n 'aria-disabled:!tw-bg-primary-500',\n ],\n secondary: [\n 'tw-text-white',\n 'tw-bg-secondary-500',\n\n 'focus:tw-text-white',\n 'hover:tw-text-white',\n 'hover:not-disabled:tw-bg-secondary-700',\n 'active:not-disabled:tw-bg-secondary-800',\n\n // anchor disabled override\n 'aria-disabled:!tw-bg-secondary-500',\n ],\n danger: [\n 'tw-text-white',\n 'tw-bg-error-500',\n\n 'focus:tw-text-white',\n 'hover:tw-text-white',\n 'hover:not-disabled:tw-bg-error-600',\n 'active:not-disabled:tw-bg-error-700',\n\n // anchor disabled override\n 'aria-disabled:!tw-bg-error-500',\n ],\n invisible: [\n 'tw-text-neutral-800',\n 'tw-bg-transparent',\n\n 'focus:tw-text-neutral-800',\n 'hover:not-disabled:tw-bg-neutral-100',\n 'hover:tw-text-neutral-800',\n 'active:not-disabled:tw-bg-neutral-150',\n\n // contrasting icon on hover/active\n '[&_svg]:tw-text-neutral-400',\n '[&_svg]:hover:not-disabled:tw-text-secondary-600',\n '[&_svg]:active:not-disabled:tw-text-secondary-600',\n\n // anchor disabled override\n 'aria-disabled:!tw-bg-transparent',\n ],\n outline: [\n 'tw-text-neutral-800',\n 'tw-bg-white',\n // border\n '!tw-border-neutral-200',\n 'hover:tw-text-neutral-800',\n 'focus:tw-text-neutral-800',\n 'hover:not-disabled:!tw-border-neutral-300',\n 'hover:not-disabled:tw-bg-neutral-100',\n 'active:not-disabled:tw-bg-neutral-200',\n\n // contrasting icon hover, same as invisible\n '[&_svg]:tw-text-neutral-400',\n '[&_svg]:not-disabled:hover:tw-text-secondary-600',\n '[&_svg]:active:not-disabled:tw-text-secondary-600',\n\n // anchor disabled override\n 'aria-disabled:!tw-bg-white',\n 'aria-disabled:!tw-border-neutral-200',\n ],\n\n inline: [\n 'tw-text-neutral-800',\n 'tw-bg-transparent',\n 'tw-rounded-full',\n\n '[&_svg]:tw-text-neutral-400',\n '[&_svg]:not-disabled:hover:tw-text-secondary-600',\n '[&_svg]:not-disabled:focus:tw-text-secondary-600',\n ],\n },\n size: {\n medium: [\n 'tw-max-h-10',\n 'tw-min-h-10',\n 'tw-px-4',\n 'tw-py-2.5',\n '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4',\n ],\n small: [\n 'tw-max-h-8',\n 'tw-min-h-8',\n 'tw-px-4',\n 'tw-py-1.5',\n '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4',\n ],\n large: [\n 'tw-max-h-12',\n 'tw-min-h-12',\n 'tw-px-4',\n 'tw-py-3.5',\n '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4',\n ],\n\n 'icon-lg': ['tw-size-12', 'tw-p-0', '[&_svg:not([class*=\"tw-size-\"])]:tw-size-6'],\n icon: ['tw-size-10', 'tw-p-0', '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4'],\n 'icon-sm': ['tw-size-8', 'tw-p-0', '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4'],\n 'icon-xs': ['tw-size-6', 'tw-p-0', '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4'],\n 'icon-2xs': [\n '!tw-inline-flex',\n 'tw-size-5',\n 'tw-max-h-5',\n '[&_svg:not([class*=\"tw-size-\"])]:tw-size-3',\n ],\n 'icon-3xs': ['tw-h-fit', 'tw-w-fit', '[&_svg:not([class*=\"tw-size-\"])]:tw-size-4'],\n },\n },\n },\n);\n\nexport const argoVariants = cva(\n [\n 'tailwindcss-preflight',\n\n // layout\n 'tw-relative',\n 'tw-inline-flex',\n 'tw-items-center',\n 'tw-justify-center',\n 'tw-whitespace-nowrap',\n 'tw-gap-2',\n\n // border\n 'tw-border',\n 'tw-border-transparent',\n 'tw-rounded-[var(--radius-lg,0.25rem)]',\n\n // text\n 'tw-font-medium',\n 'tw-select-none',\n\n // focus visible\n '!tw-outline-none',\n 'focus-visible:tw-ring-2',\n\n // disabled\n 'disabled:tw-cursor-not-allowed',\n 'disabled:tw-opacity-50',\n 'active:tw-opacity-60',\n\n 'tw-transition-all',\n 'tw-bg-clip-padding',\n\n // anchor support\n '!tw-no-underline',\n 'aria-disabled:tw-cursor-not-allowed',\n 'aria-disabled:tw-opacity-50',\n\n // icon\n 'tw-shrink-0',\n '[&_svg]:tw-pointer-events-none',\n '[&_svg]:tw-shrink-0',\n \"[&_svg:not([class*='tw-size-'])]:tw-size-4\",\n ],\n {\n defaultVariants: {\n variant: 'primary',\n size: 'medium',\n },\n variants: {\n block: {\n true: ['tw-w-full'],\n },\n variant: {\n primary: [\n 'tw-bg-primary',\n 'tw-text-primary-foreground',\n '[a]:hover:tw-bg-primary/80',\n 'hover:not-disabled:tw-bg-primary/90',\n 'hover:tw-text-primary-foreground',\n 'focus:tw-text-primary-foreground',\n\n 'focus-visible:tw-border-primary',\n 'focus-visible:tw-ring-ring/50',\n ],\n secondary: [\n 'tw-bg-primary/10',\n 'tw-text-primary',\n 'hover:not-disabled:tw-bg-primary/20',\n\n 'focus-visible:tw-border-primary',\n 'focus-visible:tw-ring-ring/50',\n ],\n\n // should be called \"destructive\" by Figma\n danger: [\n 'tw-bg-destructive',\n 'tw-text-destructive-foreground',\n 'hover:tw-text-destructive-foreground',\n 'focus:tw-text-destructive-foreground',\n\n 'focus-visible:tw-border-destructive',\n 'focus-visible:tw-ring-destructive/20',\n ],\n outline: [\n '!tw-border-input',\n 'tw-bg-background',\n // Semantic base text color so the label/icon flips in dark mode\n // (matches `invisible`); previously unset → inherited a fixed dark color.\n 'tw-text-foreground',\n // Hover follows the brand primary (translucent tint), matching the\n // `secondary` variant — not the fixed `accent` blue.\n 'hover:not-disabled:tw-bg-primary/10',\n 'hover:not-disabled:tw-text-primary',\n 'hover:active:tw-bg-background',\n 'focus-visible:!tw-border-primary',\n 'focus-visible:tw-ring-ring/50',\n ],\n\n // should be called \"ghost\" by Figma\n invisible: [\n 'tw-bg-transparent',\n 'tw-text-foreground',\n 'hover:not-disabled:tw-bg-primary/10',\n 'hover:not-disabled:tw-text-primary',\n 'hover:not-disabled:tw-border-primary/10',\n\n 'focus-visible:tw-ring-ring/50',\n ],\n // should be called \"link\" by Figma\n inline: [\n 'tw-bg-transparent',\n 'tw-text-primary',\n 'hover:tw-underline',\n 'hover:active:tw-bg-transparent',\n 'focus-visible:tw-ring-ring/50',\n ],\n },\n size: {\n // should be called \"default\" by Figma\n medium: ['tw-max-h-9', 'tw-py-2', 'tw-px-4', 'tw-text-sm'],\n // should be called \"small\" by Figma\n small: ['tw-max-h-8', 'tw-py-2', 'tw-px-3', 'tw-text-xs'],\n // should be called \"large\" by Figma\n large: ['tw-max-h-10', 'tw-py-2.5', 'tw-px-6', 'tw-text-sm'],\n\n 'icon-lg': ['tw-size-10'],\n icon: ['tw-size-9'],\n 'icon-sm': ['tw-size-8'],\n // unsupported in ARGO, remove when old design is gone\n 'icon-xs': [],\n 'icon-2xs': [],\n 'icon-3xs': [],\n },\n },\n },\n);\n","import type { ComponentProps, ElementRef, Ref } from 'react';\nimport { Root, Slottable } from '@radix-ui/react-slot';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { Loader2 } from '../../icons';\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { argoVariants, variants } from './styles';\n\n/**\n * Props for the `Button` component.\n *\n * Pass `variant` for primary/secondary/danger/outline/invisible looks, `size`\n * for height (including `icon-*` sizes when rendering icon-only). Icons are\n * composed as children — `<Button><Trash2 className=\"tw-size-4\" /> Delete</Button>`.\n */\ntype Props = {\n /** Replaces the leading content with a spinner and disables the button visually. The caller still controls `disabled`. */\n isLoading?: boolean;\n /** Render as a Radix `Slot` so the parent JSX (e.g. a `react-router` `<Link>`) becomes the button element. */\n asChild?: boolean;\n} & ComponentProps<'button'> &\n VariantProps<typeof variants>;\n\n/**\n * Primary action surface for the design system — covers all clickable controls except inline text links.\n *\n * **When to use:** any user-initiated action (submit, save, open modal, run job). Use `size=\"icon-*\"` with no\n * children for an icon-only button; there is no separate `IconButton` component.\n * **When NOT to use:** for inline text-link actions inside body copy use `ButtonInline`; for navigation that\n * opens a URL use `Link`; for \"primary action + dropdown of related actions\" use `SplitButton`.\n * **Composition:** wrap in `Tooltip` when icon-only or when disabled state needs an explanation; pair with\n * `Popconfirm` for destructive confirmations; pass through `Modal.Trigger` / `DropdownMenu.Trigger` via `asChild`.\n *\n * @see RECIPES.md#disabled-button-tooltip — for the disabled-button + tooltip pattern\n * @see RECIPES.md#confirm-dialog — for destructive-action confirmation\n */\nexport const Button = ({\n ref,\n children,\n disabled = false,\n className,\n type = 'button',\n isLoading = false,\n asChild = false,\n onClick,\n variant = 'primary',\n size = 'medium',\n block = false,\n ...buttonProps\n}: Props & { ref?: Ref<ElementRef<'button'>> }) => {\n const renderArgo = useArgoDesign();\n const Comp = asChild ? Root : 'button';\n const isIconOnly = String(size).startsWith('icon');\n const classNames = renderArgo\n ? argoVariants({ variant, size, block, className })\n : variants({ size, variant, block, className });\n\n const handleClick: ComponentProps<'button'>['onClick'] = (event) => {\n const isAnchor = event.currentTarget.tagName === 'A';\n\n // <a/> does not support disabled by default, and we cannot use pointer-events: none because cursor-not-allowed would not work.\n if (isAnchor && disabled) {\n event.preventDefault();\n return;\n }\n\n onClick?.(event);\n };\n\n return (\n <Comp\n {...buttonProps}\n ref={ref}\n disabled={disabled}\n aria-disabled={disabled}\n data-variant={variant}\n // `size=\"icon\"` / `size=\"icon-*\"` flags the button as icon-only — needed\n // by `ButtonGroup space=\"block\"` which stretches non-icon children to\n // equal width.\n data-icon-only={isIconOnly}\n type={type}\n onClick={handleClick}\n className={cn(classNames)}\n >\n {isLoading && <Loader2 className=\"tw-size-4 tw-shrink-0 tw-animate-spin\" />}\n <Slottable>{isLoading && isIconOnly ? null : children}</Slottable>\n </Comp>\n );\n};\n","import { useState } from 'react';\nimport type { ComponentProps, ElementRef, MouseEventHandler, Ref } from 'react';\n\nimport { cn, copyToClipboard } from '../../utils';\nimport { type Props as TooltipProps, Tooltip } from '../Tooltip';\n\ntype Props = {\n tooltip?: TooltipProps['tooltip'];\n tooltipPlacement?: TooltipProps['placement'];\n tooltipVariant?: TooltipProps['variant'];\n asChild?: TooltipProps['triggerAsChild'];\n text?: string | (() => string);\n} & ComponentProps<'button'>;\n\nexport const Clipboard = ({\n ref,\n text: textProp,\n children,\n tooltip = 'Copy to Clipboard',\n tooltipPlacement = 'top',\n tooltipVariant: tooltipVariantProp = 'action',\n asChild = false,\n onClick,\n className,\n ...restButtonProps\n}: Props & { ref?: Ref<ElementRef<'button'>> }) => {\n const [isTooltipOpen, setIsTooltipOpen] = useState(false);\n const [state, setState] = useState<'ready' | 'copied' | 'error'>('ready');\n const text = typeof textProp === 'function' ? textProp() : textProp;\n\n const copy = async (text: string) => {\n try {\n // For the clipboard feature to work reliably, the window must be in focus for security reasons.\n // However, the button can be clicked without the window being focused.\n if (!document.hasFocus()) window.focus();\n\n await copyToClipboard(text);\n setState('copied');\n } catch {\n setState('error');\n }\n };\n\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n if (text && state === 'ready') void copy(text);\n onClick?.(event);\n };\n\n const handleOnOpenChange: ComponentProps<typeof Tooltip.Root>['onOpenChange'] = (open) => {\n // Reset when the tooltip closes, allowing the user to leave the copy button.\n if (!open && state !== 'ready') setState('ready');\n setIsTooltipOpen(open);\n };\n\n const tooltipContent = (() => {\n if (!text) return 'Nothing to copy';\n if (state === 'error') return 'Failed to copy';\n if (state === 'copied') return 'Copied to Clipboard';\n return tooltip;\n })();\n\n const tooltipVariant: TooltipProps['variant'] =\n state === 'ready' && !!text ? tooltipVariantProp : 'action';\n\n return (\n <Tooltip.Root open={isTooltipOpen} onOpenChange={handleOnOpenChange}>\n <Tooltip.Trigger\n {...restButtonProps}\n asChild={asChild}\n keepOpenOnClick\n onClick={handleOnClick}\n className={cn('tw-cursor-pointer', className)}\n ref={ref}\n >\n {children ?? text}\n </Tooltip.Trigger>\n\n <Tooltip.Content\n keepOpenOnPointerDownOutside\n placement={tooltipPlacement}\n variant={tooltipVariant}\n >\n {tooltipContent}\n </Tooltip.Content>\n </Tooltip.Root>\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { Clipboard } from '../../components/Clipboard';\nimport { Copy } from '../../icons';\n\ntype ClipboardProps = Pick<\n ComponentProps<typeof Clipboard>,\n 'text' | 'tooltip' | 'tooltipPlacement' | 'tooltipVariant'\n>;\n\ntype ButtonProps = Omit<ComponentProps<typeof Button>, 'disabled' | 'icon'>;\n\ntype Props = ClipboardProps & ButtonProps & { icon?: ReactNode };\n\nconst DEFAULT_ICON: ReactNode = <Copy />;\n\nexport const ClipboardButton = ({\n // clipboard props\n text,\n tooltip,\n tooltipPlacement,\n tooltipVariant,\n\n // button props\n icon = DEFAULT_ICON,\n variant = 'outline',\n children,\n ...rest\n}: Props) => (\n <Clipboard\n asChild\n tooltip={tooltip}\n tooltipPlacement={tooltipPlacement}\n tooltipVariant={tooltipVariant}\n text={text}\n >\n <Button {...rest} variant={variant} disabled={!text}>\n {icon}\n {children}\n </Button>\n </Clipboard>\n);\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport DOMPurify from 'dompurify';\n\nimport { ClipboardButton } from '../../blocks/ClipboardButton';\nimport { Maximize2, Minimize2 } from '../../icons';\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { Tooltip } from '../Tooltip';\n\nconst MIN_SCALE = 0.5;\nconst MAX_SCALE = 3;\nconst ZOOM_STEP = 0.1;\n\ntype Props = {\n /** Raw SVG markup. Sanitized internally with DOMPurify (SVG profile) before rendering, so it is\n * safe even when it originates from user/LLM-controlled content. Non-SVG HTML is stripped. */\n html: string;\n copyText?: string;\n className?: string;\n};\n\nexport const ZoomableSvg = ({ html, copyText, className }: Props) => {\n const safeHtml = useMemo(\n () => DOMPurify.sanitize(html, { USE_PROFILES: { svg: true, svgFilters: true } }),\n [html],\n );\n\n const containerRef = useRef<HTMLDivElement>(null);\n const [scale, setScale] = useState(1);\n const [translate, setTranslate] = useState({ x: 0, y: 0 });\n const [isFullscreen, setIsFullscreen] = useState(false);\n\n useEffect(() => {\n if (!isFullscreen) return;\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n setIsFullscreen(false);\n }\n };\n document.addEventListener('keydown', onKeyDown, { capture: true });\n return () => document.removeEventListener('keydown', onKeyDown, { capture: true });\n }, [isFullscreen]);\n\n const dragRef = useRef<{\n startX: number;\n startY: number;\n startTx: number;\n startTy: number;\n } | null>(null);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n\n const onWheel = (e: WheelEvent) => {\n if (!e.ctrlKey && !e.metaKey) return;\n e.preventDefault();\n const delta = e.deltaY > 0 ? -ZOOM_STEP : ZOOM_STEP;\n setScale((s) => Math.min(MAX_SCALE, Math.max(MIN_SCALE, s + delta)));\n };\n\n el.addEventListener('wheel', onWheel, { passive: false });\n return () => el.removeEventListener('wheel', onWheel);\n }, []);\n\n const didDragRef = useRef(false);\n\n const handleMouseDown = useCallback(\n (e: React.MouseEvent) => {\n if (e.button !== 0) return;\n e.preventDefault();\n didDragRef.current = false;\n dragRef.current = {\n startX: e.clientX,\n startY: e.clientY,\n startTx: translate.x,\n startTy: translate.y,\n };\n },\n [translate],\n );\n\n const handleMouseMove = useCallback((e: React.MouseEvent) => {\n if (!dragRef.current) return;\n didDragRef.current = true;\n setTranslate({\n x: dragRef.current.startTx + e.clientX - dragRef.current.startX,\n y: dragRef.current.startTy + e.clientY - dragRef.current.startY,\n });\n }, []);\n\n const handleMouseUp = useCallback(() => {\n dragRef.current = null;\n }, []);\n\n const handleReset = useCallback(() => {\n setScale(1);\n setTranslate({ x: 0, y: 0 });\n }, []);\n\n const isZoomed = Math.abs(scale - 1) > 0.001 || translate.x !== 0 || translate.y !== 0;\n\n const handleClick = useCallback((e: React.MouseEvent) => {\n if (didDragRef.current) {\n e.stopPropagation();\n }\n }, []);\n\n const stopPropagation = useCallback((e: React.SyntheticEvent) => {\n e.stopPropagation();\n }, []);\n\n const diagramContent = (\n <div\n role=\"presentation\"\n className={cn('tw-group/zoom tw-relative', isFullscreen && 'tw-h-full')}\n onClick={handleClick}\n >\n <div\n role=\"presentation\"\n ref={containerRef}\n className={cn(\n 'tw-overflow-hidden tw-cursor-grab active:tw-cursor-grabbing tw-p-3',\n isFullscreen && 'tw-h-full',\n )}\n onMouseDown={handleMouseDown}\n onMouseMove={handleMouseMove}\n onMouseUp={handleMouseUp}\n onMouseLeave={handleMouseUp}\n >\n <div\n className={cn(\n 'tw-flex tw-justify-center tw-origin-center',\n isFullscreen && 'tw-h-full [&>svg]:tw-h-full',\n )}\n style={{ transform: `translate(${translate.x}px, ${translate.y}px) scale(${scale})` }}\n dangerouslySetInnerHTML={{ __html: safeHtml }}\n />\n </div>\n <div\n role=\"presentation\"\n className=\"tw-absolute tw-right-1 tw-top-1 tw-flex tw-gap-1 tw-opacity-0 tw-transition-opacity group-hover/zoom:tw-opacity-100\"\n onClick={stopPropagation}\n >\n {isZoomed && (\n <Tooltip tooltip=\"Reset zoom\" placement=\"top\" triggerAsChild>\n <Button size=\"small\" variant=\"outline\" onClick={handleReset}>\n Reset\n </Button>\n </Tooltip>\n )}\n {copyText && (\n <ClipboardButton text={copyText} tooltip=\"Copy code\" size=\"icon-sm\" variant=\"outline\" />\n )}\n <Tooltip\n tooltip={isFullscreen ? 'Exit fullscreen' : 'Fullscreen'}\n placement=\"top\"\n triggerAsChild\n >\n <Button\n size=\"icon-sm\"\n variant=\"outline\"\n aria-label={isFullscreen ? 'Exit fullscreen' : 'Fullscreen'}\n onClick={() => setIsFullscreen((f) => !f)}\n >\n {isFullscreen ? (\n <Minimize2 className=\"tw-size-4\" />\n ) : (\n <Maximize2 className=\"tw-size-4\" />\n )}\n </Button>\n </Tooltip>\n </div>\n </div>\n );\n\n if (isFullscreen) {\n return (\n <div\n role=\"presentation\"\n className=\"tw-fixed tw-inset-0 tw-z-[1060] tw-bg-muted tw-p-4\"\n onClick={stopPropagation}\n >\n {diagramContent}\n </div>\n );\n }\n\n return (\n <div\n className={cn(\n 'tw-overflow-hidden tw-rounded-md tw-border tw-border-border tw-bg-muted',\n className,\n )}\n >\n {diagramContent}\n </div>\n );\n};\n","import { useEffect, useId, useRef, useState } from 'react';\nimport { renderMermaidSVG } from 'beautiful-mermaid';\nimport type mermaid from 'mermaid';\n\nimport colors from '@keboola/tailwind-config/colors';\n\nimport { Skeleton } from '../../components/Skeleton/Skeleton';\nimport { ZoomableSvg } from '../../components/ZoomableSvg';\nimport { cn } from '../../utils';\n\ntype MermaidModule = { default: typeof mermaid };\n\nconst PRIMARY_FALLBACK_CHANNELS = '31 143 255';\n\nconst resolvePrimary = (): string => {\n const channels =\n typeof document === 'undefined'\n ? PRIMARY_FALLBACK_CHANNELS\n : getComputedStyle(document.documentElement).getPropertyValue('--color-primary').trim() ||\n PRIMARY_FALLBACK_CHANNELS;\n return `rgb(${channels})`;\n};\n\nlet mermaidPromise: Promise<MermaidModule> | null = null;\n\nconst getMermaid = (): Promise<MermaidModule> => {\n if (!mermaidPromise) {\n mermaidPromise = import('mermaid')\n .then((m) => {\n m.default.initialize({\n startOnLoad: false,\n securityLevel: 'strict',\n theme: 'base',\n themeVariables: {\n primaryColor: colors.blue[100],\n primaryTextColor: colors.neutral[800],\n primaryBorderColor: colors.blue[700],\n secondaryColor: colors.white,\n secondaryTextColor: colors.neutral[800],\n secondaryBorderColor: colors.neutral[150],\n tertiaryColor: colors.warning[100],\n tertiaryTextColor: colors.neutral[800],\n tertiaryBorderColor: colors.warning[500],\n lineColor: colors.neutral[300],\n textColor: colors.neutral[800],\n mainBkg: colors.blue[100],\n nodeBorder: colors.blue[700],\n clusterBkg: colors.white,\n clusterBorder: colors.neutral[150],\n titleColor: colors.neutral[800],\n edgeLabelBackground: colors.white,\n nodeTextColor: colors.neutral[800],\n actorBorder: colors.blue[700],\n actorBkg: colors.blue[100],\n actorTextColor: colors.neutral[800],\n actorLineColor: colors.neutral[300],\n signalColor: colors.neutral[800],\n signalTextColor: colors.neutral[800],\n labelBoxBkgColor: colors.blue[100],\n labelBoxBorderColor: colors.blue[700],\n labelTextColor: colors.neutral[800],\n loopTextColor: colors.neutral[800],\n noteBorderColor: colors.warning[500],\n noteBkgColor: colors.warning[100],\n noteTextColor: colors.neutral[800],\n sectionBkgColor: colors.blue[100],\n altSectionBkgColor: colors.white,\n sectionBkgColor2: colors.neutral[100],\n taskBorderColor: colors.blue[700],\n taskBkgColor: colors.blue[100],\n taskTextColor: colors.neutral[800],\n taskTextDarkColor: colors.neutral[800],\n taskTextLightColor: colors.neutral[800],\n activeTaskBorderColor: resolvePrimary(),\n activeTaskBkgColor: colors.blue[200],\n doneTaskBorderColor: colors.green[600],\n doneTaskBkgColor: colors.green[100],\n critBorderColor: colors.error[500],\n critBkgColor: colors.error[100],\n fontFamily: 'Inter, system-ui, sans-serif',\n fontSize: '14px',\n },\n });\n return m;\n })\n .catch((err) => {\n mermaidPromise = null;\n throw err;\n });\n }\n return mermaidPromise;\n};\n\nconst stripFontImports = (svg: string): string =>\n svg.replace(/@import\\s+url\\([^)]*fonts\\.googleapis\\.com[^)]*\\);?\\s*/g, '');\n\nconst tryFastRender = (code: string): string | null => {\n try {\n return stripFontImports(\n renderMermaidSVG(code, {\n bg: colors.white,\n fg: colors.neutral[800],\n transparent: true,\n font: 'Inter, system-ui, sans-serif',\n }),\n );\n } catch {\n return null;\n }\n};\n\nconst makeResponsive = (svgString: string): string => {\n const viewBoxMatch = svgString.match(/viewBox=\"[^\"]*\\s([\\d.]+)\\s[\\d.]+\"/);\n const vbWidth = viewBoxMatch ? Math.round(Number(viewBoxMatch[1])) : undefined;\n\n let result = svgString\n .replace(/(<svg[^>]*?)\\s+width=\"[^\"]*\"/i, '$1 width=\"100%\"')\n .replace(/(<svg[^>]*?)\\s+height=\"[^\"]*\"/i, '$1');\n\n if (!vbWidth) return result;\n\n const hasStyle = /(<svg[^>]*?)\\s+style=\"([^\"]*)\"/i.test(result);\n if (hasStyle) {\n result = result.replace(/(<svg[^>]*?)\\s+style=\"([^\"]*)\"/i, (_m, pre, styles) => {\n const cleaned = styles.replace(/max-width:\\s*[^;\"]*;?\\s*/g, '').trim();\n const combined = [cleaned, `max-width: ${vbWidth}px`].filter(Boolean).join('; ');\n return `${pre} style=\"${combined}\"`;\n });\n } else {\n result = result.replace(/<svg/, `<svg style=\"max-width: ${vbWidth}px\"`);\n }\n\n return result;\n};\n\nconst RENDER_DEBOUNCE_MS = 300;\n\n// Module-level SVG cache — persists across component remounts (e.g. tab switches\n// that cause React to remount the tree). Same code always produces the same SVG.\nconst svgCache = new Map<string, string>();\n\n// Resolve an SVG synchronously: cache hit first, otherwise a fast synchronous\n// render. Caches the result and returns it, or null when neither is available\n// (the caller then falls back to the async mermaid render).\nconst resolveSyncSvg = (code: string): string | null => {\n const cached = svgCache.get(code);\n if (cached) return cached;\n const fast = tryFastRender(code);\n if (fast) svgCache.set(code, fast);\n return fast;\n};\n\ntype Props = {\n /** Mermaid diagram source code. Supports flowchart, sequence, class, state, ER,\n * pie, gantt, and mindmap. Gantt `dateFormat HH:mm` (time-only) is not supported\n * by mermaid's dayjs parser — use `dateFormat YYYY-MM-DD HH:mm` with `axisFormat %H:%M` instead. */\n code: string;\n};\n\nexport const MermaidDiagram = ({ code }: Props) => {\n const id = useId();\n const [svg, setSvg] = useState<string | null>(() => resolveSyncSvg(code));\n const [renderFailed, setRenderFailed] = useState(false);\n const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const renderIdRef = useRef(0);\n\n // Synchronously reset stale state when code changes to avoid one-frame flash\n const [prevCode, setPrevCode] = useState(code);\n if (code !== prevCode) {\n setPrevCode(code);\n setSvg(resolveSyncSvg(code));\n setRenderFailed(false);\n }\n\n useEffect(() => {\n // Synchronous results (cache hit / fast render) are already applied and\n // cached by the useState initializer (mount) and the render-phase reset\n // (code change). Only the async fallback needs an effect.\n if (svgCache.has(code)) return;\n\n const currentRenderId = ++renderIdRef.current;\n\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n }\n\n debounceRef.current = setTimeout(() => {\n getMermaid()\n .then(async (mermaidModule) => {\n if (renderIdRef.current !== currentRenderId) return;\n const rendererId = `mermaid-${id.replaceAll(':', '')}`;\n const container = document.createElement('div');\n container.style.visibility = 'hidden';\n container.style.position = 'absolute';\n container.style.top = '-9999px';\n container.style.width = '900px';\n document.body.appendChild(container);\n try {\n const result = await mermaidModule.default.render(rendererId, code, container);\n if (renderIdRef.current === currentRenderId && result) {\n svgCache.set(code, result.svg);\n setSvg(result.svg);\n setRenderFailed(false);\n }\n } finally {\n container.remove();\n }\n })\n .catch((err) => {\n if (renderIdRef.current === currentRenderId) {\n console.error('[MermaidDiagram] fallback failed:', err);\n setSvg(null);\n setRenderFailed(true);\n }\n });\n }, RENDER_DEBOUNCE_MS);\n\n const timer = debounceRef.current;\n const renderId = renderIdRef;\n return () => {\n renderId.current++;\n if (timer) {\n clearTimeout(timer);\n }\n };\n }, [code, id]);\n\n const processedSvg = svg ? makeResponsive(svg) : null;\n\n if (renderFailed) {\n return (\n <pre\n className={cn(\n 'tw-my-3 tw-overflow-auto tw-whitespace-pre-wrap tw-break-all',\n 'tw-py-3 tw-px-4',\n 'tw-bg-neutral-50',\n 'tw-rounded-md tw-text-neutral-400',\n 'tw-text-sm tw-font-mono',\n )}\n >\n <code>{code}</code>\n </pre>\n );\n }\n\n if (processedSvg) {\n return (\n <ZoomableSvg\n key={code}\n html={processedSvg}\n copyText={`\\`\\`\\`mermaid\\n${code}\\n\\`\\`\\``}\n className=\"tw-my-3\"\n />\n );\n }\n\n return (\n <div className=\"tw-my-3 tw-overflow-hidden tw-rounded-md tw-border tw-border-neutral-150 tw-bg-neutral-50 tw-p-6\">\n <Skeleton className=\"tw-h-40\" />\n </div>\n );\n};\n"]}
|