@keboola/design 6.0.0 → 6.2.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/dist/index.cjs CHANGED
@@ -13,6 +13,7 @@ var DropdownMenuPrimitive3 = require('@radix-ui/react-dropdown-menu');
13
13
  var ScrollAreaPrimitive2 = require('@radix-ui/react-scroll-area');
14
14
  var reactToggle = require('@radix-ui/react-toggle');
15
15
  var ToggleGroupPrimitive = require('@radix-ui/react-toggle-group');
16
+ var RLabel = require('@radix-ui/react-label');
16
17
  var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
17
18
  var DialogPrimitive = require('@radix-ui/react-dialog');
18
19
  var RSeparator = require('@radix-ui/react-separator');
@@ -21,7 +22,6 @@ var reactPopover = require('@radix-ui/react-popover');
21
22
  var reactHoverCard = require('@radix-ui/react-hover-card');
22
23
  var cmdk = require('cmdk');
23
24
  var TextareaAutosize = require('react-textarea-autosize');
24
- var RLabel = require('@radix-ui/react-label');
25
25
  var reactSwitch = require('@radix-ui/react-switch');
26
26
  var RRadioGroup = require('@radix-ui/react-radio-group');
27
27
  var reactSlider = require('@radix-ui/react-slider');
@@ -70,11 +70,11 @@ var React26__default = /*#__PURE__*/_interopDefault(React26);
70
70
  var DropdownMenuPrimitive3__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive3);
71
71
  var ScrollAreaPrimitive2__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive2);
72
72
  var ToggleGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(ToggleGroupPrimitive);
73
+ var RLabel__namespace = /*#__PURE__*/_interopNamespace(RLabel);
73
74
  var AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(AlertDialogPrimitive);
74
75
  var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
75
76
  var RSeparator__namespace = /*#__PURE__*/_interopNamespace(RSeparator);
76
77
  var TextareaAutosize__default = /*#__PURE__*/_interopDefault(TextareaAutosize);
77
- var RLabel__namespace = /*#__PURE__*/_interopNamespace(RLabel);
78
78
  var RRadioGroup__namespace = /*#__PURE__*/_interopNamespace(RRadioGroup);
79
79
  var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
80
80
  var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
@@ -295,7 +295,7 @@ var require_react_is_development = __commonJS({
295
295
  var ContextProvider = REACT_PROVIDER_TYPE;
296
296
  var Element = REACT_ELEMENT_TYPE;
297
297
  var ForwardRef = REACT_FORWARD_REF_TYPE;
298
- var Fragment16 = REACT_FRAGMENT_TYPE;
298
+ var Fragment17 = REACT_FRAGMENT_TYPE;
299
299
  var Lazy = REACT_LAZY_TYPE;
300
300
  var Memo = REACT_MEMO_TYPE;
301
301
  var Portal10 = REACT_PORTAL_TYPE;
@@ -354,7 +354,7 @@ var require_react_is_development = __commonJS({
354
354
  exports$1.ContextProvider = ContextProvider;
355
355
  exports$1.Element = Element;
356
356
  exports$1.ForwardRef = ForwardRef;
357
- exports$1.Fragment = Fragment16;
357
+ exports$1.Fragment = Fragment17;
358
358
  exports$1.Lazy = Lazy;
359
359
  exports$1.Memo = Memo;
360
360
  exports$1.Portal = Portal10;
@@ -2800,6 +2800,7 @@ var Clipboard = ({
2800
2800
  ] });
2801
2801
  };
2802
2802
  var DEFAULT_ICON = /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Copy, {});
2803
+ var DEFAULT_ARIA_LABEL = "Copy";
2803
2804
  var ClipboardButton = ({
2804
2805
  // clipboard props
2805
2806
  text,
@@ -2811,20 +2812,24 @@ var ClipboardButton = ({
2811
2812
  variant = "outline",
2812
2813
  children,
2813
2814
  ...rest
2814
- }) => /* @__PURE__ */ jsxRuntime.jsx(
2815
- Clipboard,
2816
- {
2817
- asChild: true,
2818
- tooltip,
2819
- tooltipPlacement,
2820
- tooltipVariant,
2821
- text,
2822
- children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { ...rest, variant, disabled: !text, children: [
2823
- icon,
2824
- children
2825
- ] })
2826
- }
2827
- );
2815
+ }) => {
2816
+ const defaultAriaLabel = typeof tooltip === "string" && tooltip.trim() ? tooltip : DEFAULT_ARIA_LABEL;
2817
+ const ariaLabel = rest["aria-label"] ?? (children == null ? defaultAriaLabel : void 0);
2818
+ return /* @__PURE__ */ jsxRuntime.jsx(
2819
+ Clipboard,
2820
+ {
2821
+ asChild: true,
2822
+ tooltip,
2823
+ tooltipPlacement,
2824
+ tooltipVariant,
2825
+ text,
2826
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { ...rest, "aria-label": ariaLabel, variant, disabled: !text, children: [
2827
+ icon,
2828
+ children
2829
+ ] })
2830
+ }
2831
+ );
2832
+ };
2828
2833
  var ClipboardInline = ({
2829
2834
  // clipboard props
2830
2835
  text,
@@ -2849,6 +2854,264 @@ var ClipboardInline = ({
2849
2854
  ] })
2850
2855
  }
2851
2856
  );
2857
+ var CopyContext = React26.createContext(null);
2858
+ var useCopyContext = () => {
2859
+ const ctx = React26.use(CopyContext);
2860
+ if (!ctx) throw new Error("CopyField.* components must be used within a CopyField.Root");
2861
+ return ctx;
2862
+ };
2863
+ var LINE_HEIGHT_REM = 1.25;
2864
+ var VERTICAL_PADDING_REM = 1.25;
2865
+ var CopyBox = ({ className, children }) => {
2866
+ const { copied, handleCopy, mono, minLines, maxLines, boxId, labelId, hasLabel } = useCopyContext();
2867
+ const multiline = maxLines > 1;
2868
+ const multilineStyle = multiline ? {
2869
+ minHeight: `${minLines * LINE_HEIGHT_REM + VERTICAL_PADDING_REM}rem`,
2870
+ maxHeight: `${maxLines * LINE_HEIGHT_REM + VERTICAL_PADDING_REM}rem`
2871
+ } : void 0;
2872
+ const handleKeyDown2 = (event) => {
2873
+ if (event.target !== event.currentTarget) return;
2874
+ if (event.key !== "Enter" && event.key !== " ") return;
2875
+ event.preventDefault();
2876
+ handleCopy();
2877
+ };
2878
+ return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { triggerAsChild: true, placement: "top", tooltip: copied ? "Copied" : "Copy", forceShow: copied, children: /* @__PURE__ */ jsxRuntime.jsx(
2879
+ "div",
2880
+ {
2881
+ role: "button",
2882
+ tabIndex: 0,
2883
+ id: boxId,
2884
+ "aria-labelledby": hasLabel ? labelId : void 0,
2885
+ onClick: handleCopy,
2886
+ onKeyDown: handleKeyDown2,
2887
+ style: multilineStyle,
2888
+ className: cn(
2889
+ "tw-group tw-relative tw-flex tw-w-fit tw-max-w-full tw-cursor-pointer tw-gap-2 tw-rounded-2xl [corner-shape:superellipse(2)] tw-border tw-border-[#e4e4e4] tw-bg-[#fafafa] tw-px-3 tw-py-2.5 tw-text-left tw-shadow-sm tw-transition-colors hover:tw-bg-[#f2f2f2]",
2890
+ multiline ? "tw-items-start tw-overflow-auto" : "tw-items-center tw-overflow-hidden",
2891
+ mono && "tw-font-mono tw-text-[13px]",
2892
+ className
2893
+ ),
2894
+ children
2895
+ }
2896
+ ) });
2897
+ };
2898
+ var CopyButton = ({ className }) => {
2899
+ const { copied, maxLines } = useCopyContext();
2900
+ return /* @__PURE__ */ jsxRuntime.jsx(
2901
+ "span",
2902
+ {
2903
+ "aria-hidden": true,
2904
+ className: cn(
2905
+ "tw-pointer-events-none tw-flex tw-shrink-0 tw-items-center tw-text-[#8b8b8b] group-hover:tw-text-[#5c5c5c]",
2906
+ maxLines > 1 && "tw-self-start tw-pt-0.5",
2907
+ className
2908
+ ),
2909
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Check, { className: "tw-size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Copy, { className: "tw-size-4" })
2910
+ }
2911
+ );
2912
+ };
2913
+ var CopyChildren = ({ children, className }) => {
2914
+ const { maxLines } = useCopyContext();
2915
+ const multiline = maxLines > 1;
2916
+ return /* @__PURE__ */ jsxRuntime.jsx(
2917
+ "span",
2918
+ {
2919
+ className: cn(
2920
+ "tw-min-w-0 tw-flex-1 tw-select-text tw-text-[#3f3f3f]",
2921
+ multiline ? "tw-whitespace-pre-wrap tw-break-words" : "tw-truncate",
2922
+ className
2923
+ ),
2924
+ children
2925
+ }
2926
+ );
2927
+ };
2928
+ var CopyFooter = ({ children, className }) => {
2929
+ if (!children) return null;
2930
+ return /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("tw-m-0 tw-text-xs tw-text-muted-foreground", className), children });
2931
+ };
2932
+ var MASK = "*".repeat(12);
2933
+ var CopyHidden = ({ children, revealable = true, className }) => {
2934
+ const { hidden, registerRevealable } = useCopyContext();
2935
+ React26.useEffect(() => {
2936
+ if (!revealable) return void 0;
2937
+ return registerRevealable();
2938
+ }, [revealable, registerRevealable]);
2939
+ const masked = revealable ? hidden : true;
2940
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("tw-select-none", className), children: masked ? MASK : children });
2941
+ };
2942
+ var Optional = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-muted-foreground", className), children: "(optional)" });
2943
+ var Required = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-primary", className), children: "*" });
2944
+ var Label2 = ({ className, children, id, htmlFor, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
2945
+ RLabel__namespace.Root,
2946
+ {
2947
+ ...rest,
2948
+ id: id?.toString(),
2949
+ htmlFor: htmlFor?.toString(),
2950
+ className: cn(
2951
+ "tw-m-0 tw-text-foreground tw-font-normal peer-disabled:tw-opacity-50",
2952
+ className
2953
+ ),
2954
+ children
2955
+ }
2956
+ );
2957
+ Label2.Optional = Optional;
2958
+ Label2.Required = Required;
2959
+ var CopyLabel = ({ children, leading, trailing, className }) => {
2960
+ const { labelId, registerLabel } = useCopyContext();
2961
+ React26.useEffect(() => registerLabel(), [registerLabel]);
2962
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("tw-flex tw-items-center tw-gap-1", className), children: [
2963
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { id: labelId, children }),
2964
+ leading,
2965
+ trailing != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-ml-auto tw-flex tw-items-center", children: trailing })
2966
+ ] });
2967
+ };
2968
+ var CopyPrefix = ({ children, className }) => /* @__PURE__ */ jsxRuntime.jsx(
2969
+ "span",
2970
+ {
2971
+ "aria-hidden": true,
2972
+ className: cn(
2973
+ "tw-shrink-0 tw-select-none tw-self-stretch tw-border-r tw-border-[#e4e4e4] tw-pr-2 tw-text-[#6b6b6b]",
2974
+ className
2975
+ ),
2976
+ children
2977
+ }
2978
+ );
2979
+ var CopyReveal = ({ className }) => {
2980
+ const { hidden, toggleHidden, hasRevealable, maxLines } = useCopyContext();
2981
+ if (!hasRevealable) return null;
2982
+ const handleClick = (event) => {
2983
+ event.stopPropagation();
2984
+ toggleHidden();
2985
+ };
2986
+ return /* @__PURE__ */ jsxRuntime.jsx(
2987
+ "button",
2988
+ {
2989
+ type: "button",
2990
+ onClick: handleClick,
2991
+ "aria-label": hidden ? "Show value" : "Hide value",
2992
+ className: cn(
2993
+ "tw-flex tw-shrink-0 tw-items-center tw-text-[#8b8b8b] hover:tw-text-[#5c5c5c]",
2994
+ maxLines > 1 && "tw-self-start tw-pt-0.5",
2995
+ className
2996
+ ),
2997
+ children: hidden ? /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Eye, { className: "tw-size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(icons_exports.EyeOff, { className: "tw-size-4" })
2998
+ }
2999
+ );
3000
+ };
3001
+ var CopyRoot = ({
3002
+ value,
3003
+ mono = false,
3004
+ onCopy,
3005
+ hiddenByDefault = false,
3006
+ minLines = 1,
3007
+ maxLines,
3008
+ className,
3009
+ children
3010
+ }) => {
3011
+ const [copied, setCopied] = React26.useState(false);
3012
+ const [hidden, setHidden] = React26.useState(hiddenByDefault);
3013
+ const [revealableCount, setRevealableCount] = React26.useState(0);
3014
+ const [labelCount, setLabelCount] = React26.useState(0);
3015
+ const resetTimerRef = React26.useRef(void 0);
3016
+ const generatedId = React26.useId();
3017
+ const labelId = `${generatedId}-label`;
3018
+ const boxId = `${generatedId}-box`;
3019
+ React26.useEffect(() => () => clearTimeout(resetTimerRef.current), []);
3020
+ const handleCopy = React26.useCallback(() => {
3021
+ const selection = window.getSelection();
3022
+ const boxEl = document.getElementById(boxId);
3023
+ if (selection && !selection.isCollapsed && selection.anchorNode && boxEl?.contains(selection.anchorNode)) {
3024
+ return;
3025
+ }
3026
+ copyToClipboard(value).then(() => {
3027
+ onCopy?.();
3028
+ setCopied(true);
3029
+ clearTimeout(resetTimerRef.current);
3030
+ resetTimerRef.current = setTimeout(() => setCopied(false), 1500);
3031
+ }).catch((error) => {
3032
+ console.error("Copy to clipboard failed", error);
3033
+ });
3034
+ }, [value, onCopy, boxId]);
3035
+ const toggleHidden = React26.useCallback(() => setHidden((prev) => !prev), []);
3036
+ const registerRevealable = React26.useCallback(() => {
3037
+ setRevealableCount((count) => count + 1);
3038
+ return () => setRevealableCount((count) => count - 1);
3039
+ }, []);
3040
+ const registerLabel = React26.useCallback(() => {
3041
+ setLabelCount((count) => count + 1);
3042
+ return () => setLabelCount((count) => count - 1);
3043
+ }, []);
3044
+ const contextValue = React26.useMemo(
3045
+ () => ({
3046
+ copied,
3047
+ handleCopy,
3048
+ value,
3049
+ mono,
3050
+ hidden,
3051
+ toggleHidden,
3052
+ registerRevealable,
3053
+ hasRevealable: revealableCount > 0,
3054
+ registerLabel,
3055
+ hasLabel: labelCount > 0,
3056
+ minLines,
3057
+ maxLines: maxLines ?? minLines,
3058
+ labelId,
3059
+ boxId
3060
+ }),
3061
+ [
3062
+ copied,
3063
+ handleCopy,
3064
+ value,
3065
+ mono,
3066
+ hidden,
3067
+ toggleHidden,
3068
+ registerRevealable,
3069
+ revealableCount,
3070
+ registerLabel,
3071
+ labelCount,
3072
+ minLines,
3073
+ maxLines,
3074
+ labelId,
3075
+ boxId
3076
+ ]
3077
+ );
3078
+ return /* @__PURE__ */ jsxRuntime.jsx(CopyContext, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("tw-flex tw-w-fit tw-max-w-full tw-flex-col tw-gap-1", className), children }) });
3079
+ };
3080
+ var CopySuffix = ({ children, className }) => /* @__PURE__ */ jsxRuntime.jsx(
3081
+ "span",
3082
+ {
3083
+ "aria-hidden": true,
3084
+ className: cn(
3085
+ "tw-shrink-0 tw-select-none tw-self-stretch tw-border-l tw-border-[#e4e4e4] tw-pl-2 tw-text-[#6b6b6b]",
3086
+ className
3087
+ ),
3088
+ children
3089
+ }
3090
+ );
3091
+
3092
+ // src/blocks/CopyField/CopyField.tsx
3093
+ var CopyField = {
3094
+ /** Container. Owns the copied `value`, mask state, and copy context. */
3095
+ Root: CopyRoot,
3096
+ /** Visible label above the box, with optional `leading`/`trailing` slots. */
3097
+ Label: CopyLabel,
3098
+ /** The clickable copy target row. */
3099
+ Box: CopyBox,
3100
+ /** Muted, non-selectable prefix addon (not copied). */
3101
+ Prefix: CopyPrefix,
3102
+ /** Displayed value (truncates single-line, wraps multi-line). */
3103
+ Children: CopyChildren,
3104
+ /** Muted, non-selectable suffix addon (not copied). */
3105
+ Suffix: CopySuffix,
3106
+ /** Masks its children with dots; copy still copies the real value. */
3107
+ Hidden: CopyHidden,
3108
+ /** Eye toggle that reveals/masks revealable `CopyField.Hidden` content. */
3109
+ Reveal: CopyReveal,
3110
+ /** Copy affordance icon — shows Copy/Check with feedback. */
3111
+ Button: CopyButton,
3112
+ /** Small helper text below the box. */
3113
+ Footer: CopyFooter
3114
+ };
2852
3115
  var Link = ({
2853
3116
  ref,
2854
3117
  children,
@@ -3805,8 +4068,8 @@ var FullScreenModalHeader = ({
3805
4068
  {
3806
4069
  text: previousTitle,
3807
4070
  className: cn(
3808
- "tw-relative tw-top-0 tw-cursor-pointer tw-text-base tw-font-normal tw-text-neutral-400 tw-underline",
3809
- "hover:tw-text-neutral-800 hover:tw-no-underline",
4071
+ "tw-relative tw-top-0 tw-cursor-pointer tw-text-base tw-font-normal tw-text-muted-foreground tw-underline",
4072
+ "hover:tw-text-foreground hover:tw-no-underline",
3810
4073
  isTitleWithIcon && "tw-ml-14"
3811
4074
  )
3812
4075
  }
@@ -6783,7 +7046,7 @@ __export(custom_components_exports, {
6783
7046
  NextMonthButton: () => NextMonthButton,
6784
7047
  Option: () => Option,
6785
7048
  PreviousMonthButton: () => PreviousMonthButton,
6786
- Root: () => Root16,
7049
+ Root: () => Root17,
6787
7050
  Select: () => Select,
6788
7051
  Week: () => Week,
6789
7052
  WeekNumber: () => WeekNumber,
@@ -6963,7 +7226,7 @@ function Option(props) {
6963
7226
  function PreviousMonthButton(props) {
6964
7227
  return React26__default.default.createElement("button", { ...props });
6965
7228
  }
6966
- function Root16(props) {
7229
+ function Root17(props) {
6967
7230
  const { rootRef, ...rest } = props;
6968
7231
  return React26__default.default.createElement("div", { ...rest, ref: rootRef });
6969
7232
  }
@@ -10031,23 +10294,6 @@ var TimePicker = ({
10031
10294
  )
10032
10295
  ] });
10033
10296
  };
10034
- var Optional = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-muted-foreground", className), children: "(optional)" });
10035
- var Required = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-primary", className), children: "*" });
10036
- var Label2 = ({ className, children, id, htmlFor, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
10037
- RLabel__namespace.Root,
10038
- {
10039
- ...rest,
10040
- id: id?.toString(),
10041
- htmlFor: htmlFor?.toString(),
10042
- className: cn(
10043
- "tw-m-0 tw-text-foreground tw-font-normal peer-disabled:tw-opacity-50",
10044
- className
10045
- ),
10046
- children
10047
- }
10048
- );
10049
- Label2.Optional = Optional;
10050
- Label2.Required = Required;
10051
10297
  var FieldBoxDescription = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
10052
10298
  "span",
10053
10299
  {
@@ -10776,8 +11022,8 @@ var ClearButton = ({ onClick, testId }) => {
10776
11022
  "tw-flex",
10777
11023
  "tw-items-center",
10778
11024
  "tw-cursor-pointer",
10779
- "tw-text-neutral-300",
10780
- "hover:tw-text-neutral-800"
11025
+ "tw-text-muted-foreground",
11026
+ "hover:tw-text-foreground"
10781
11027
  ),
10782
11028
  "data-testid": testId,
10783
11029
  children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.X, { className: "tw-size-4" })
@@ -11618,23 +11864,23 @@ var BadgeLabel = ({
11618
11864
  var badgeColors = {
11619
11865
  gray: "tw-bg-neutral-400 tw-text-white tw-decoration-neutral-400",
11620
11866
  "gray-darker": "tw-bg-neutral-500 tw-text-white tw-decoration-neutral-500",
11621
- "gray-inverse": "tw-bg-neutral-100 tw-text-neutral-400 tw-decoration-neutral-100",
11867
+ "gray-inverse": "tw-bg-neutral-100 tw-text-neutral-400 tw-decoration-neutral-100 [[data-theme=dark]_&]:tw-bg-neutral-800 [[data-theme=dark]_&]:tw-text-neutral-300 [[data-theme=dark]_&]:tw-decoration-neutral-800",
11622
11868
  green: "tw-bg-green-500 tw-text-white tw-decoration-green-500",
11623
11869
  "green-darker": "tw-bg-green-600 tw-text-white tw-decoration-green-600",
11624
- "green-inverse": "tw-bg-green-100 tw-text-green-900 tw-decoration-green-100",
11870
+ "green-inverse": "tw-bg-green-100 tw-text-green-900 tw-decoration-green-100 [[data-theme=dark]_&]:tw-bg-green-900 [[data-theme=dark]_&]:tw-text-green-200 [[data-theme=dark]_&]:tw-decoration-green-900",
11625
11871
  blue: "tw-bg-blue-500 tw-text-white tw-decoration-blue-500",
11626
- "blue-inverse": "tw-bg-blue-100 tw-text-blue-600 tw-decoration-blue-100",
11872
+ "blue-inverse": "tw-bg-blue-100 tw-text-blue-600 tw-decoration-blue-100 [[data-theme=dark]_&]:tw-bg-blue-900 [[data-theme=dark]_&]:tw-text-blue-200 [[data-theme=dark]_&]:tw-decoration-blue-900",
11627
11873
  red: "tw-bg-error-500 tw-text-white tw-decoration-error-500",
11628
11874
  orange: "tw-bg-warning-500 tw-text-white tw-decoration-warning-500",
11629
- "orange-inverse": "tw-bg-warning-100 tw-text-warning-500 tw-decoration-warning-100",
11875
+ "orange-inverse": "tw-bg-warning-100 tw-text-warning-500 tw-decoration-warning-100 [[data-theme=dark]_&]:tw-bg-warning-900 [[data-theme=dark]_&]:tw-text-warning-200 [[data-theme=dark]_&]:tw-decoration-warning-900",
11630
11876
  amber: "tw-bg-warning-300 tw-text-warning-800 tw-decoration-warning-300",
11631
11877
  "amber-inverse": "tw-bg-warning-100 tw-text-warning-700 tw-decoration-warning-100",
11632
11878
  teal: "tw-bg-teal-500 tw-text-white tw-decoration-teal-500",
11633
- "teal-inverse": "tw-bg-teal-100 tw-text-teal-800 tw-decoration-teal-100",
11879
+ "teal-inverse": "tw-bg-teal-100 tw-text-teal-800 tw-decoration-teal-100 [[data-theme=dark]_&]:tw-bg-teal-900 [[data-theme=dark]_&]:tw-text-teal-200 [[data-theme=dark]_&]:tw-decoration-teal-900",
11634
11880
  purple: "tw-bg-purple-500 tw-text-white tw-decoration-purple-500",
11635
- "purple-inverse": "tw-bg-purple-100 tw-text-purple-800 tw-decoration-purple-100",
11881
+ "purple-inverse": "tw-bg-purple-100 tw-text-purple-800 tw-decoration-purple-100 [[data-theme=dark]_&]:tw-bg-purple-900 [[data-theme=dark]_&]:tw-text-purple-200 [[data-theme=dark]_&]:tw-decoration-purple-900",
11636
11882
  cyan: "tw-bg-cyan-500 tw-text-white tw-decoration-cyan-500",
11637
- "cyan-inverse": "tw-bg-cyan-100 tw-text-cyan-800 tw-decoration-cyan-100",
11883
+ "cyan-inverse": "tw-bg-cyan-100 tw-text-cyan-800 tw-decoration-cyan-100 [[data-theme=dark]_&]:tw-bg-cyan-900 [[data-theme=dark]_&]:tw-text-cyan-200 [[data-theme=dark]_&]:tw-decoration-cyan-900",
11638
11884
  "sidebar-primary": "tw-bg-sidebar-primary tw-text-white tw-decoration-sidebar-primary",
11639
11885
  white: "tw-bg-white/90 tw-text-neutral-600 tw-decoration-white/90"
11640
11886
  };
@@ -16400,6 +16646,12 @@ var PromptInputCommands = ({ items, open, onSelect, filterValue, children }) =>
16400
16646
  children
16401
16647
  ] });
16402
16648
  };
16649
+ var ARIA_LABEL_BY_STATUS = {
16650
+ ready: "Send message",
16651
+ streaming: "Stop",
16652
+ interrupted: "Continue",
16653
+ submitted: "Sending\u2026"
16654
+ };
16403
16655
  var PromptInputSubmit = ({
16404
16656
  ref,
16405
16657
  disabled,
@@ -16422,6 +16674,7 @@ var PromptInputSubmit = ({
16422
16674
  ref,
16423
16675
  type: "submit",
16424
16676
  disabled,
16677
+ "aria-label": ARIA_LABEL_BY_STATUS[status],
16425
16678
  size: "icon-sm",
16426
16679
  variant: "invisible",
16427
16680
  isLoading: status === "submitted",
@@ -17868,7 +18121,7 @@ var cardTitleClassnames = cn(
17868
18121
  "tw-text-base",
17869
18122
  "tw-text-card-foreground"
17870
18123
  );
17871
- var CardTitle = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("h3", { className: cn(cardTitleClassnames, className), ...rest, children });
18124
+ var CardTitle = ({ children, className, as: Tag = "h3", ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(Tag, { className: cn(cardTitleClassnames, className), ...rest, children });
17872
18125
  var Card = ({
17873
18126
  children,
17874
18127
  className,
@@ -18200,9 +18453,7 @@ var headerVariants = classVarianceAuthority.cva(
18200
18453
  variants: {
18201
18454
  variant: {
18202
18455
  default: "tw-bg-muted",
18203
- // White surface kept literal until a `card` token exists (UT-4396);
18204
- // `background` is the page base, not an elevated panel surface.
18205
- white: "tw-bg-white"
18456
+ white: "tw-bg-card"
18206
18457
  },
18207
18458
  isDisabled: {
18208
18459
  true: "tw-cursor-not-allowed tw-opacity-50",
@@ -18267,7 +18518,7 @@ var CollapsiblePanel = ({
18267
18518
  {
18268
18519
  open,
18269
18520
  className: cn(
18270
- "tw-rounded !tw-border !tw-border-solid !tw-border-border tw-bg-white",
18521
+ "tw-rounded !tw-border !tw-border-solid !tw-border-border tw-bg-card",
18271
18522
  className
18272
18523
  ),
18273
18524
  header: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -18475,6 +18726,18 @@ var tokensToCssVars = ({
18475
18726
  vars.set("--font-weight-semibold", typography?.weight?.semibold);
18476
18727
  vars.set("--font-weight-bold", typography?.weight?.bold);
18477
18728
  vars.set("--letter-spacing-chrome", typography?.letterSpacing?.chrome);
18729
+ vars.set("--type-display-size", typography?.typeScale?.display?.size);
18730
+ vars.set("--type-display-weight", typography?.typeScale?.display?.weight);
18731
+ vars.set("--type-display-leading", typography?.typeScale?.display?.leading);
18732
+ vars.set("--type-display-tracking", typography?.typeScale?.display?.tracking);
18733
+ vars.set("--type-heading-size", typography?.typeScale?.heading?.size);
18734
+ vars.set("--type-heading-weight", typography?.typeScale?.heading?.weight);
18735
+ vars.set("--type-heading-leading", typography?.typeScale?.heading?.leading);
18736
+ vars.set("--type-heading-tracking", typography?.typeScale?.heading?.tracking);
18737
+ vars.set("--type-body-size", typography?.typeScale?.body?.size);
18738
+ vars.set("--type-body-weight", typography?.typeScale?.body?.weight);
18739
+ vars.set("--type-body-leading", typography?.typeScale?.body?.leading);
18740
+ vars.set("--type-body-tracking", typography?.typeScale?.body?.tracking);
18478
18741
  vars.set("--radius-sm", radii?.sm);
18479
18742
  vars.set("--radius-md", radii?.md);
18480
18743
  vars.set("--radius-lg", radii?.lg);
@@ -22980,6 +23243,150 @@ var pairChunksIntoConflicts = (chunks) => {
22980
23243
  }
22981
23244
  return conflicts;
22982
23245
  };
23246
+ var DashboardHeroRoot = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
23247
+ "section",
23248
+ {
23249
+ className: cn(
23250
+ "tw-flex tw-flex-col tw-gap-6 tw-rounded-lg tw-border tw-border-solid tw-border-border tw-bg-card tw-p-8 tw-text-card-foreground",
23251
+ "md:tw-flex-row md:tw-items-center md:tw-justify-between",
23252
+ className
23253
+ ),
23254
+ ...rest,
23255
+ children
23256
+ }
23257
+ );
23258
+ var DashboardHeroBody = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("tw-flex tw-flex-col tw-gap-3", className), ...rest, children });
23259
+ var DashboardHeroEyebrow = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
23260
+ "p",
23261
+ {
23262
+ className: cn(
23263
+ "tw-m-0 tw-text-sm tw-font-semibold tw-uppercase tw-tracking-wide tw-text-primary",
23264
+ className
23265
+ ),
23266
+ ...rest,
23267
+ children
23268
+ }
23269
+ );
23270
+ var DashboardHeroTitle = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
23271
+ "h1",
23272
+ {
23273
+ className: cn(
23274
+ "tw-m-0 tw-text-3xl tw-font-semibold tw-leading-tight tw-tracking-tight tw-text-foreground",
23275
+ className
23276
+ ),
23277
+ ...rest,
23278
+ children
23279
+ }
23280
+ );
23281
+ var DashboardHeroDescription = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
23282
+ "p",
23283
+ {
23284
+ className: cn("tw-m-0 tw-max-w-prose tw-text-base tw-text-muted-foreground", className),
23285
+ ...rest,
23286
+ children
23287
+ }
23288
+ );
23289
+ var DashboardHeroActions = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("tw-mt-2 tw-flex tw-flex-wrap tw-items-center tw-gap-3", className), ...rest, children });
23290
+ var DashboardHeroAside = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("tw-flex tw-shrink-0 tw-flex-col tw-gap-2", className), ...rest, children });
23291
+ var DashboardHero = DashboardHeroRoot;
23292
+ DashboardHero.Body = DashboardHeroBody;
23293
+ DashboardHero.Eyebrow = DashboardHeroEyebrow;
23294
+ DashboardHero.Title = DashboardHeroTitle;
23295
+ DashboardHero.Description = DashboardHeroDescription;
23296
+ DashboardHero.Actions = DashboardHeroActions;
23297
+ DashboardHero.Aside = DashboardHeroAside;
23298
+ var trendClassnames = classVarianceAuthority.cva(
23299
+ ["tw-inline-flex", "tw-items-center", "tw-gap-1", "tw-text-sm", "tw-font-medium"],
23300
+ {
23301
+ variants: {
23302
+ direction: {
23303
+ up: "tw-text-success",
23304
+ down: "tw-text-destructive",
23305
+ flat: "tw-text-muted-foreground"
23306
+ }
23307
+ },
23308
+ defaultVariants: {
23309
+ direction: "flat"
23310
+ }
23311
+ }
23312
+ );
23313
+ var StatCardRoot = ({ className, children, bordered = true, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(Card, { bordered, className: cn("tw-gap-2", className), role: "group", ...rest, children });
23314
+ var StatCardIcon = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
23315
+ "div",
23316
+ {
23317
+ className: cn(
23318
+ "tw-flex tw-size-9 tw-items-center tw-justify-center tw-rounded-md tw-bg-accent tw-text-accent-foreground",
23319
+ '[&_svg:not([class*="tw-size-"])]:tw-size-5',
23320
+ className
23321
+ ),
23322
+ ...rest,
23323
+ children
23324
+ }
23325
+ );
23326
+ var StatCardLabel = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
23327
+ "p",
23328
+ {
23329
+ className: cn("tw-m-0 tw-text-sm tw-font-medium tw-text-muted-foreground", className),
23330
+ ...rest,
23331
+ children
23332
+ }
23333
+ );
23334
+ var StatCardValue = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
23335
+ "p",
23336
+ {
23337
+ className: cn(
23338
+ "tw-m-0 tw-text-3xl tw-font-semibold tw-leading-tight tw-tracking-tight tw-text-foreground",
23339
+ className
23340
+ ),
23341
+ ...rest,
23342
+ children
23343
+ }
23344
+ );
23345
+ var StatCardTrend = ({ className, direction = "flat", icon, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: trendClassnames({ direction, className }), ...rest, children: [
23346
+ icon,
23347
+ children
23348
+ ] });
23349
+ var StatCardFootnote = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("tw-m-0 tw-text-xs tw-text-muted-foreground", className), ...rest, children });
23350
+ var StatCard = StatCardRoot;
23351
+ StatCard.Icon = StatCardIcon;
23352
+ StatCard.Label = StatCardLabel;
23353
+ StatCard.Value = StatCardValue;
23354
+ StatCard.Trend = StatCardTrend;
23355
+ StatCard.Footnote = StatCardFootnote;
23356
+ var gridClassnames = classVarianceAuthority.cva(["tw-grid", "tw-gap-4"], {
23357
+ variants: {
23358
+ columns: {
23359
+ 2: "tw-grid-cols-1 sm:tw-grid-cols-2",
23360
+ 3: "tw-grid-cols-1 sm:tw-grid-cols-2 lg:tw-grid-cols-3",
23361
+ 4: "tw-grid-cols-1 sm:tw-grid-cols-2 lg:tw-grid-cols-4"
23362
+ }
23363
+ },
23364
+ defaultVariants: {
23365
+ columns: 4
23366
+ }
23367
+ });
23368
+ var StatCardGrid = ({ className, columns = 4, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: gridClassnames({ columns, className }), ...rest, children });
23369
+ var ChartPanel = ({
23370
+ title,
23371
+ description,
23372
+ titleAs = "h3",
23373
+ toolbar,
23374
+ footer,
23375
+ className,
23376
+ bordered = true,
23377
+ children,
23378
+ ...rest
23379
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(Card, { bordered, className: cn("tw-gap-4", className), ...rest, children: [
23380
+ /* @__PURE__ */ jsxRuntime.jsxs(Card.Header, { className: "tw-flex tw-items-start tw-justify-between tw-gap-4", children: [
23381
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
23382
+ /* @__PURE__ */ jsxRuntime.jsx(Card.Title, { as: titleAs, children: title }),
23383
+ description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tw-m-0 tw-text-sm tw-text-muted-foreground", children: description }) : null
23384
+ ] }),
23385
+ toolbar ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-shrink-0 tw-items-center tw-gap-2", children: toolbar }) : null
23386
+ ] }),
23387
+ /* @__PURE__ */ jsxRuntime.jsx(Card.Content, { children }),
23388
+ footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-border-0 tw-border-t tw-border-solid tw-border-border tw-pt-3 tw-text-sm tw-text-muted-foreground", children: footer }) : null
23389
+ ] });
22983
23390
  var { fieldContext, useFieldContext, formContext, useFormContext } = reactForm.createFormHookContexts();
22984
23391
  var FormBody = ({ children, className, ...formProps }) => {
22985
23392
  const form = useFormContext();
@@ -23419,6 +23826,686 @@ function useAutosizeInput({
23419
23826
  ] });
23420
23827
  return { inputRef, inputStyle, sizerElement };
23421
23828
  }
23829
+
23830
+ // src/blocks/BrandEditor/color.ts
23831
+ var hexToChannels = (hex) => {
23832
+ let h = hex.trim().replace(/^#/, "");
23833
+ if (h.length === 3 || h.length === 4) {
23834
+ h = h.slice(0, 3).split("").map((c) => c + c).join("");
23835
+ } else if (h.length === 8) {
23836
+ h = h.slice(0, 6);
23837
+ }
23838
+ if (!/^[0-9a-fA-F]{6}$/.test(h)) return "0 0 0";
23839
+ const n = parseInt(h, 16);
23840
+ return `${n >> 16 & 255} ${n >> 8 & 255} ${n & 255}`;
23841
+ };
23842
+ var channelsToHex = (channels) => {
23843
+ const [r = 0, g = 0, b = 0] = channels.trim().split(/\s+/).map((n) => Number(n) || 0);
23844
+ const to2 = (v) => Math.max(0, Math.min(255, v)).toString(16).padStart(2, "0");
23845
+ return `#${to2(r)}${to2(g)}${to2(b)}`;
23846
+ };
23847
+ var COMPLETE_HEX = /^([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
23848
+ var ColorField = ({ id, label, channels, onChange }) => {
23849
+ const hex = channelsToHex(channels);
23850
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-justify-between tw-gap-2", children: [
23851
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { htmlFor: id, className: "tw-text-xs tw-font-normal tw-text-foreground", children: label }),
23852
+ /* @__PURE__ */ jsxRuntime.jsx(
23853
+ ColorInput,
23854
+ {
23855
+ id,
23856
+ sizing: "medium",
23857
+ value: hex,
23858
+ className: "tw-w-36",
23859
+ onValueChange: (next) => {
23860
+ const clean = next.trim().replace(/^#/, "");
23861
+ if (COMPLETE_HEX.test(clean)) onChange(hexToChannels(`#${clean}`));
23862
+ }
23863
+ }
23864
+ )
23865
+ ] });
23866
+ };
23867
+
23868
+ // src/blocks/BrandEditor/contrast.ts
23869
+ var clampChannel = (n) => Number.isFinite(n) ? Math.min(255, Math.max(0, n)) : 0;
23870
+ var parseChannels = (channels) => {
23871
+ const [r = 0, g = 0, b = 0] = channels.trim().split(/\s+/).map((n) => clampChannel(Number(n)));
23872
+ return [r, g, b];
23873
+ };
23874
+ var relativeLuminance = (channels) => {
23875
+ const [r = 0, g = 0, b = 0] = parseChannels(channels).map((c) => {
23876
+ const s = c / 255;
23877
+ return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
23878
+ });
23879
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
23880
+ };
23881
+ var contrastRatio = (fg, bg) => {
23882
+ const l1 = relativeLuminance(fg);
23883
+ const l2 = relativeLuminance(bg);
23884
+ const [lighter, darker] = l1 >= l2 ? [l1, l2] : [l2, l1];
23885
+ return (lighter + 0.05) / (darker + 0.05);
23886
+ };
23887
+ var wcagLevel = (ratio) => ratio >= 7 ? "AAA" : ratio >= 4.5 ? "AA" : "fail";
23888
+ var ControlSection = ({ title, children }) => /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "tw-flex tw-flex-col tw-gap-3 tw-border-b tw-border-border tw-p-4", children: [
23889
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "tw-m-0 tw-text-xs tw-font-semibold tw-uppercase tw-tracking-wide tw-text-muted-foreground", children: title }),
23890
+ children
23891
+ ] });
23892
+ var LogoField = ({ id, label, value, onChange }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
23893
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { htmlFor: id, className: "tw-text-xs tw-font-normal tw-text-foreground", children: label }),
23894
+ /* @__PURE__ */ jsxRuntime.jsx(
23895
+ Textarea,
23896
+ {
23897
+ id,
23898
+ value,
23899
+ onValueChange: onChange,
23900
+ maxRows: 4,
23901
+ placeholder: "<svg\u2026>, a data: URI, or an https:// URL",
23902
+ className: "tw-font-mono tw-text-xs"
23903
+ }
23904
+ )
23905
+ ] });
23906
+ var TextField2 = ({ id, label, value, onChange, placeholder }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
23907
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { htmlFor: id, className: "tw-text-xs tw-font-normal tw-text-foreground", children: label }),
23908
+ /* @__PURE__ */ jsxRuntime.jsx(
23909
+ TextInput,
23910
+ {
23911
+ id,
23912
+ sizing: "small",
23913
+ value,
23914
+ onValueChange: onChange,
23915
+ placeholder,
23916
+ className: "tw-font-mono tw-text-xs"
23917
+ }
23918
+ )
23919
+ ] });
23920
+ var DEFAULT_FALLBACK_FONT = "'Inter', system-ui, sans-serif";
23921
+ var DEFAULT_FONT_OPTIONS = [
23922
+ { value: DEFAULT_FALLBACK_FONT, label: "Inter (default)" },
23923
+ { value: "'Space Grotesk', system-ui, sans-serif", label: "Space Grotesk" },
23924
+ { value: "'Poppins', system-ui, sans-serif", label: "Poppins" },
23925
+ { value: "'Manrope', system-ui, sans-serif", label: "Manrope" },
23926
+ { value: "'Quicksand', system-ui, sans-serif", label: "Quicksand" },
23927
+ { value: "'Baloo 2', system-ui, sans-serif", label: "Baloo 2" },
23928
+ { value: "'Fraunces', Georgia, serif", label: "Fraunces (serif)" },
23929
+ { value: "Georgia, 'Times New Roman', serif", label: "Georgia (serif)" },
23930
+ { value: "'JetBrains Mono', ui-monospace, monospace", label: "JetBrains Mono" },
23931
+ { value: "system-ui, sans-serif", label: "System UI" }
23932
+ ];
23933
+ var COLOR_LABELS = {
23934
+ primary: "Primary",
23935
+ primaryForeground: "Primary foreground",
23936
+ background: "Background",
23937
+ foreground: "Foreground",
23938
+ card: "Card",
23939
+ cardForeground: "Card foreground",
23940
+ popover: "Popover",
23941
+ popoverForeground: "Popover foreground",
23942
+ secondary: "Secondary",
23943
+ secondaryForeground: "Secondary foreground",
23944
+ muted: "Muted",
23945
+ mutedForeground: "Muted foreground",
23946
+ accent: "Accent",
23947
+ accentForeground: "Accent foreground",
23948
+ border: "Border",
23949
+ input: "Input",
23950
+ ring: "Ring",
23951
+ ringOffset: "Ring offset",
23952
+ destructive: "Destructive",
23953
+ destructiveForeground: "Destructive foreground",
23954
+ success: "Success",
23955
+ successForeground: "Success foreground",
23956
+ warning: "Warning",
23957
+ warningForeground: "Warning foreground",
23958
+ info: "Info",
23959
+ infoForeground: "Info foreground"
23960
+ };
23961
+ var SIDEBAR_LABELS = {
23962
+ sidebar: "Sidebar",
23963
+ sidebarForeground: "Foreground",
23964
+ sidebarPrimary: "Primary",
23965
+ sidebarPrimaryForeground: "Primary foreground",
23966
+ sidebarAccent: "Accent",
23967
+ sidebarAccentForeground: "Accent foreground",
23968
+ sidebarBorder: "Border",
23969
+ sidebarRing: "Ring"
23970
+ };
23971
+ var CHART_LABELS = {
23972
+ chart1: "Chart 1",
23973
+ chart2: "Chart 2",
23974
+ chart3: "Chart 3",
23975
+ chart4: "Chart 4",
23976
+ chart5: "Chart 5"
23977
+ };
23978
+ var WEIGHT_LABELS = {
23979
+ normal: "Normal",
23980
+ medium: "Medium",
23981
+ semibold: "Semibold",
23982
+ bold: "Bold"
23983
+ };
23984
+ var SHADOW_LABELS = {
23985
+ sm: "Small",
23986
+ md: "Medium",
23987
+ lg: "Large",
23988
+ lift: "Lift (raised)"
23989
+ };
23990
+ var SPACING_LABELS = {
23991
+ gutter: "Gutter (between sections)",
23992
+ inset: "Inset (in-container)"
23993
+ };
23994
+ var MOTION_LABELS = {
23995
+ duration: "Duration",
23996
+ easing: "Easing"
23997
+ };
23998
+ var COLOR_SLOTS = Object.keys(COLOR_LABELS);
23999
+ var SIDEBAR_SLOTS = Object.keys(SIDEBAR_LABELS);
24000
+ var CHART_SLOTS = Object.keys(CHART_LABELS);
24001
+ var WEIGHT_SLOTS = Object.keys(WEIGHT_LABELS);
24002
+ var SHADOW_SLOTS = Object.keys(SHADOW_LABELS);
24003
+ var SPACING_SLOTS = Object.keys(SPACING_LABELS);
24004
+ var MOTION_SLOTS = Object.keys(MOTION_LABELS);
24005
+ var RADIUS_SIZES = ["sm", "md", "lg"];
24006
+ var A11Y_PAIRS = [
24007
+ { label: "Text on background", fg: "foreground", bg: "background" },
24008
+ { label: "Text on card", fg: "cardForeground", bg: "card" },
24009
+ { label: "Primary button", fg: "primaryForeground", bg: "primary" },
24010
+ { label: "Muted text", fg: "mutedForeground", bg: "muted" },
24011
+ { label: "Accent", fg: "accentForeground", bg: "accent" }
24012
+ ];
24013
+ var DEFAULT_SIDEBAR = {
24014
+ light: {
24015
+ sidebar: "255 255 255",
24016
+ sidebarForeground: "30 41 59",
24017
+ sidebarPrimary: "31 143 255",
24018
+ sidebarPrimaryForeground: "255 255 255",
24019
+ sidebarAccent: "219 234 254",
24020
+ sidebarAccentForeground: "30 41 59",
24021
+ sidebarBorder: "229 231 235",
24022
+ sidebarRing: "31 143 255"
24023
+ },
24024
+ dark: {
24025
+ sidebar: "14 14 18",
24026
+ sidebarForeground: "229 230 236",
24027
+ sidebarPrimary: "31 143 255",
24028
+ sidebarPrimaryForeground: "255 255 255",
24029
+ sidebarAccent: "38 38 45",
24030
+ sidebarAccentForeground: "229 230 236",
24031
+ sidebarBorder: "48 49 57",
24032
+ sidebarRing: "31 143 255"
24033
+ }
24034
+ };
24035
+ var DEFAULT_RADII = {
24036
+ sm: "0.25rem",
24037
+ md: "0.375rem",
24038
+ lg: "0.5rem"
24039
+ };
24040
+ var DEFAULT_CHART = {
24041
+ light: {
24042
+ chart1: "31 143 255",
24043
+ chart2: "0 194 135",
24044
+ chart3: "146 92 255",
24045
+ chart4: "245 147 0",
24046
+ chart5: "237 94 223"
24047
+ },
24048
+ dark: {
24049
+ chart1: "92 173 255",
24050
+ chart2: "0 230 161",
24051
+ chart3: "173 133 255",
24052
+ chart4: "255 190 92",
24053
+ chart5: "242 140 232"
24054
+ }
24055
+ };
24056
+ var DEFAULT_FONT_WEIGHTS = {
24057
+ normal: "400",
24058
+ medium: "500",
24059
+ semibold: "600",
24060
+ bold: "700"
24061
+ };
24062
+ var DEFAULT_LETTER_SPACING = "1px";
24063
+ var MONO_FALLBACK = "'JetBrains Mono', ui-monospace, monospace";
24064
+ var DEFAULT_SHADOWS = {
24065
+ sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
24066
+ md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
24067
+ lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
24068
+ lift: "0 10px 30px -12px rgb(0 0 0 / 0.28), 0 2px 6px rgb(0 0 0 / 0.06)"
24069
+ };
24070
+ var DEFAULT_SPACING = {
24071
+ gutter: "1.5rem",
24072
+ inset: "1.5rem"
24073
+ };
24074
+ var DEFAULT_MOTION = {
24075
+ duration: "200ms",
24076
+ easing: "cubic-bezier(0.2, 0.7, 0.2, 1)"
24077
+ };
24078
+ var DEFAULT_GRADIENT = "linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-accent, var(--color-primary))))";
24079
+ var numOf = (value, fallback) => {
24080
+ const n = Number.parseFloat(value);
24081
+ return Number.isFinite(n) ? n : fallback;
24082
+ };
24083
+ var letterSpacingToPx = (value) => {
24084
+ const n = Number.parseFloat(value);
24085
+ if (!Number.isFinite(n)) return 0;
24086
+ return value.trim().endsWith("em") ? n * 16 : n;
24087
+ };
24088
+ var pxToLetterSpacing = (px, currentValue) => currentValue.trim().endsWith("em") ? `${Number((px / 16).toFixed(3))}em` : `${px}px`;
24089
+ var lengthToPx = (value) => {
24090
+ const n = Number.parseFloat(value);
24091
+ if (!Number.isFinite(n)) return 0;
24092
+ return Math.round(value.trim().endsWith("rem") ? n * 16 : n);
24093
+ };
24094
+ var pxToLength = (px, currentValue) => {
24095
+ const trimmed = currentValue.trim();
24096
+ if (trimmed.endsWith("rem")) return `${px / 16}rem`;
24097
+ if (/^-?\d*\.?\d+$/.test(trimmed)) return `${px}`;
24098
+ return `${px}px`;
24099
+ };
24100
+ var isSvgMarkup = (source) => source.trimStart().startsWith("<");
24101
+ var isImageSource = (source) => /^(data:|https?:\/\/)/.test(source.trim());
24102
+ var LogoPreviewImage = ({ source, className }) => {
24103
+ const safeSvg = React26.useMemo(
24104
+ () => isSvgMarkup(source) ? DOMPurify__default.default.sanitize(source, { USE_PROFILES: { svg: true, svgFilters: true } }) : null,
24105
+ [source]
24106
+ );
24107
+ if (safeSvg !== null) {
24108
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className, dangerouslySetInnerHTML: { __html: safeSvg } });
24109
+ }
24110
+ if (isImageSource(source)) {
24111
+ return /* @__PURE__ */ jsxRuntime.jsx("img", { src: source, alt: "", className });
24112
+ }
24113
+ return null;
24114
+ };
24115
+ var BrandEditor = ({
24116
+ value,
24117
+ onChange,
24118
+ colorScheme = "light",
24119
+ onColorSchemeChange,
24120
+ fontOptions = DEFAULT_FONT_OPTIONS
24121
+ }) => {
24122
+ const baseId = React26.useId();
24123
+ const { theme } = value;
24124
+ const coreColors = colorScheme === "light" ? theme.colors : theme.colorsDark;
24125
+ const sidebarColors = colorScheme === "light" ? theme.colors?.sidebar : theme.colorsDark?.sidebar;
24126
+ const chartColors = colorScheme === "light" ? theme.colors?.chart : theme.colorsDark?.chart;
24127
+ const defaultColors = colorScheme === "light" ? brandRegistry.keboola.theme.colors : brandRegistry.keboola.theme.colorsDark;
24128
+ const radii = theme.radii ?? DEFAULT_RADII;
24129
+ const typography = theme.typography;
24130
+ const setColor = (slot, channels) => {
24131
+ if (colorScheme === "light") {
24132
+ onChange({ ...value, theme: { ...theme, colors: { ...theme.colors, [slot]: channels } } });
24133
+ return;
24134
+ }
24135
+ onChange({
24136
+ ...value,
24137
+ theme: { ...theme, colorsDark: { ...theme.colorsDark, [slot]: channels } }
24138
+ });
24139
+ };
24140
+ const setSidebarColor = (slot, channels) => {
24141
+ if (colorScheme === "light") {
24142
+ const base = theme.colors?.sidebar ?? DEFAULT_SIDEBAR.light;
24143
+ onChange({
24144
+ ...value,
24145
+ theme: { ...theme, colors: { ...theme.colors, sidebar: { ...base, [slot]: channels } } }
24146
+ });
24147
+ return;
24148
+ }
24149
+ const sidebarBase = theme.colorsDark?.sidebar ?? DEFAULT_SIDEBAR.dark;
24150
+ onChange({
24151
+ ...value,
24152
+ theme: {
24153
+ ...theme,
24154
+ colorsDark: { ...theme.colorsDark, sidebar: { ...sidebarBase, [slot]: channels } }
24155
+ }
24156
+ });
24157
+ };
24158
+ const setChart = (slot, channels) => {
24159
+ const base = chartColors ?? DEFAULT_CHART[colorScheme];
24160
+ const chart = { ...base, [slot]: channels };
24161
+ if (colorScheme === "light") {
24162
+ onChange({ ...value, theme: { ...theme, colors: { ...theme.colors, chart } } });
24163
+ return;
24164
+ }
24165
+ onChange({ ...value, theme: { ...theme, colorsDark: { ...theme.colorsDark, chart } } });
24166
+ };
24167
+ const setRadius = (size, radius) => onChange({
24168
+ ...value,
24169
+ theme: { ...theme, radii: { ...theme.radii ?? DEFAULT_RADII, [size]: radius } }
24170
+ });
24171
+ const patchTypography = (patch) => onChange({ ...value, theme: { ...theme, typography: { ...theme.typography, ...patch } } });
24172
+ const setFontFace = (face, font) => patchTypography({ [face]: font.trim() || void 0 });
24173
+ const setFontWeight = (slot, weight) => patchTypography({ weight: { ...theme.typography?.weight, [slot]: weight || void 0 } });
24174
+ const setLetterSpacing = (chrome) => patchTypography({ letterSpacing: { chrome: chrome.trim() || void 0 } });
24175
+ const setShadow = (slot, shadow) => onChange({
24176
+ ...value,
24177
+ theme: { ...theme, shadows: { ...theme.shadows, [slot]: shadow.trim() || void 0 } }
24178
+ });
24179
+ const setSpacing = (slot, length) => onChange({
24180
+ ...value,
24181
+ theme: { ...theme, spacing: { ...theme.spacing, [slot]: length.trim() || void 0 } }
24182
+ });
24183
+ const setMotion = (slot, token) => onChange({
24184
+ ...value,
24185
+ theme: { ...theme, motion: { ...theme.motion, [slot]: token.trim() || void 0 } }
24186
+ });
24187
+ const setGradient = (gradient) => onChange({
24188
+ ...value,
24189
+ theme: { ...theme, gradient: { brand: gradient.trim() || void 0 } }
24190
+ });
24191
+ const setLogo = (slot, source) => {
24192
+ const trimmed = source.trim();
24193
+ const nextLogo = { ...value.logo };
24194
+ if (trimmed) nextLogo[slot] = trimmed;
24195
+ else delete nextLogo[slot];
24196
+ const { logo: _drop, ...rest } = value;
24197
+ onChange(Object.keys(nextLogo).length > 0 ? { ...value, logo: nextLogo } : rest);
24198
+ };
24199
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col", children: [
24200
+ /* @__PURE__ */ jsxRuntime.jsxs(ControlSection, { title: "Colors", children: [
24201
+ onColorSchemeChange ? /* @__PURE__ */ jsxRuntime.jsxs(
24202
+ ToggleGroup,
24203
+ {
24204
+ type: "single",
24205
+ value: colorScheme,
24206
+ onValueChange: (next) => {
24207
+ if (next === "light" || next === "dark") onColorSchemeChange(next);
24208
+ },
24209
+ "aria-label": "Color scheme",
24210
+ className: "tw-w-full",
24211
+ children: [
24212
+ /* @__PURE__ */ jsxRuntime.jsx(ToggleGroup.Item, { value: "light", className: "tw-flex-1", children: "Light" }),
24213
+ /* @__PURE__ */ jsxRuntime.jsx(ToggleGroup.Item, { value: "dark", className: "tw-flex-1", children: "Dark" })
24214
+ ]
24215
+ }
24216
+ ) : null,
24217
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-flex-col tw-gap-2", children: COLOR_SLOTS.map((slot) => /* @__PURE__ */ jsxRuntime.jsx(
24218
+ ColorField,
24219
+ {
24220
+ id: `${baseId}color-${colorScheme}-${slot}`,
24221
+ label: COLOR_LABELS[slot],
24222
+ channels: coreColors?.[slot] ?? defaultColors?.[slot] ?? "0 0 0",
24223
+ onChange: (channels) => setColor(slot, channels)
24224
+ },
24225
+ slot
24226
+ )) })
24227
+ ] }),
24228
+ /* @__PURE__ */ jsxRuntime.jsxs(ControlSection, { title: "Accessibility", children: [
24229
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "tw-m-0 tw-text-xs tw-text-muted-foreground", children: [
24230
+ "WCAG contrast for the ",
24231
+ colorScheme,
24232
+ " palette (AA needs 4.5:1)."
24233
+ ] }),
24234
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-flex-col tw-gap-1.5", children: A11Y_PAIRS.map((pair) => {
24235
+ const fg = coreColors?.[pair.fg] ?? defaultColors?.[pair.fg] ?? "0 0 0";
24236
+ const bg = coreColors?.[pair.bg] ?? defaultColors?.[pair.bg] ?? "255 255 255";
24237
+ const ratio = contrastRatio(fg, bg);
24238
+ const level = wcagLevel(ratio);
24239
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-justify-between tw-gap-2", children: [
24240
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-text-xs tw-text-foreground", children: pair.label }),
24241
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tw-flex tw-items-center tw-gap-1.5", children: [
24242
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tw-text-xs tw-tabular-nums tw-text-muted-foreground", children: [
24243
+ ratio.toFixed(1),
24244
+ ":1"
24245
+ ] }),
24246
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { color: level === "fail" ? "red" : "green", children: level === "fail" ? "Fail" : level })
24247
+ ] })
24248
+ ] }, pair.label);
24249
+ }) })
24250
+ ] }),
24251
+ /* @__PURE__ */ jsxRuntime.jsx(ControlSection, { title: "Sidebar colors", children: /* @__PURE__ */ jsxRuntime.jsxs(Collapsible, { className: "tw-flex tw-flex-col tw-gap-2", children: [
24252
+ /* @__PURE__ */ jsxRuntime.jsx(Collapsible.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "small", className: "tw-w-full", children: [
24253
+ "Toggle sidebar tokens (",
24254
+ colorScheme,
24255
+ ")"
24256
+ ] }) }),
24257
+ /* @__PURE__ */ jsxRuntime.jsx(Collapsible.Content, { className: "tw-flex tw-flex-col tw-gap-2", children: SIDEBAR_SLOTS.map((slot) => /* @__PURE__ */ jsxRuntime.jsx(
24258
+ ColorField,
24259
+ {
24260
+ id: `${baseId}sidebar-${colorScheme}-${slot}`,
24261
+ label: SIDEBAR_LABELS[slot],
24262
+ channels: sidebarColors?.[slot] ?? DEFAULT_SIDEBAR[colorScheme][slot],
24263
+ onChange: (channels) => setSidebarColor(slot, channels)
24264
+ },
24265
+ slot
24266
+ )) })
24267
+ ] }) }),
24268
+ /* @__PURE__ */ jsxRuntime.jsxs(ControlSection, { title: "Chart palette", children: [
24269
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "tw-m-0 tw-text-xs tw-text-muted-foreground", children: [
24270
+ "Categorical series colours for the ",
24271
+ colorScheme,
24272
+ " palette (`--color-chart-1\u20265`)."
24273
+ ] }),
24274
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-flex-col tw-gap-2", children: CHART_SLOTS.map((slot) => /* @__PURE__ */ jsxRuntime.jsx(
24275
+ ColorField,
24276
+ {
24277
+ id: `${baseId}chart-${colorScheme}-${slot}`,
24278
+ label: CHART_LABELS[slot],
24279
+ channels: chartColors?.[slot] ?? DEFAULT_CHART[colorScheme][slot],
24280
+ onChange: (channels) => setChart(slot, channels)
24281
+ },
24282
+ slot
24283
+ )) })
24284
+ ] }),
24285
+ /* @__PURE__ */ jsxRuntime.jsx(ControlSection, { title: "Radius", children: RADIUS_SIZES.map((size) => {
24286
+ const current = radii[size];
24287
+ const px = lengthToPx(current);
24288
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
24289
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-justify-between", children: [
24290
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { className: "tw-text-xs tw-font-normal tw-uppercase tw-text-foreground", children: size }),
24291
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-text-xs tw-tabular-nums tw-text-muted-foreground", children: radii[size] })
24292
+ ] }),
24293
+ /* @__PURE__ */ jsxRuntime.jsx(
24294
+ Slider,
24295
+ {
24296
+ min: 0,
24297
+ max: 24,
24298
+ step: 1,
24299
+ value: [px],
24300
+ onValueChange: (values) => setRadius(size, pxToLength(values[0] ?? 0, current))
24301
+ }
24302
+ )
24303
+ ] }, size);
24304
+ }) }),
24305
+ /* @__PURE__ */ jsxRuntime.jsxs(ControlSection, { title: "Typography", children: [
24306
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
24307
+ /* @__PURE__ */ jsxRuntime.jsx(
24308
+ Label2,
24309
+ {
24310
+ htmlFor: `${baseId}font-family`,
24311
+ className: "tw-text-xs tw-font-normal tw-text-foreground",
24312
+ children: "Font family"
24313
+ }
24314
+ ),
24315
+ /* @__PURE__ */ jsxRuntime.jsx(
24316
+ Select2,
24317
+ {
24318
+ id: `${baseId}font-family`,
24319
+ value: typography?.fontFamily ?? DEFAULT_FALLBACK_FONT,
24320
+ onValueChange: (font) => setFontFace("fontFamily", font),
24321
+ items: fontOptions
24322
+ }
24323
+ )
24324
+ ] }),
24325
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
24326
+ /* @__PURE__ */ jsxRuntime.jsx(
24327
+ Label2,
24328
+ {
24329
+ htmlFor: `${baseId}font-display`,
24330
+ className: "tw-text-xs tw-font-normal tw-text-foreground",
24331
+ children: "Display font (headings)"
24332
+ }
24333
+ ),
24334
+ /* @__PURE__ */ jsxRuntime.jsx(
24335
+ Select2,
24336
+ {
24337
+ id: `${baseId}font-display`,
24338
+ value: typography?.fontDisplay ?? typography?.fontFamily ?? DEFAULT_FALLBACK_FONT,
24339
+ onValueChange: (font) => setFontFace("fontDisplay", font),
24340
+ items: fontOptions
24341
+ }
24342
+ )
24343
+ ] }),
24344
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
24345
+ /* @__PURE__ */ jsxRuntime.jsx(
24346
+ Label2,
24347
+ {
24348
+ htmlFor: `${baseId}font-mono`,
24349
+ className: "tw-text-xs tw-font-normal tw-text-foreground",
24350
+ children: "Monospace font"
24351
+ }
24352
+ ),
24353
+ /* @__PURE__ */ jsxRuntime.jsx(
24354
+ Select2,
24355
+ {
24356
+ id: `${baseId}font-mono`,
24357
+ value: typography?.fontMono ?? MONO_FALLBACK,
24358
+ onValueChange: (font) => setFontFace("fontMono", font),
24359
+ items: fontOptions
24360
+ }
24361
+ )
24362
+ ] }),
24363
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-text-xs tw-text-muted-foreground", children: "Chrome font weights" }),
24364
+ WEIGHT_SLOTS.map((slot) => {
24365
+ const current = typography?.weight?.[slot] ?? DEFAULT_FONT_WEIGHTS[slot];
24366
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
24367
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-justify-between", children: [
24368
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { className: "tw-text-xs tw-font-normal tw-text-foreground", children: WEIGHT_LABELS[slot] }),
24369
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-text-xs tw-tabular-nums tw-text-muted-foreground", children: current })
24370
+ ] }),
24371
+ /* @__PURE__ */ jsxRuntime.jsx(
24372
+ Slider,
24373
+ {
24374
+ min: 100,
24375
+ max: 900,
24376
+ step: 25,
24377
+ value: [numOf(current, 400)],
24378
+ onValueChange: (values) => setFontWeight(slot, String(values[0] ?? 400))
24379
+ }
24380
+ )
24381
+ ] }, slot);
24382
+ }),
24383
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
24384
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-justify-between", children: [
24385
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { className: "tw-text-xs tw-font-normal tw-text-foreground", children: "Chrome letter spacing" }),
24386
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-text-xs tw-tabular-nums tw-text-muted-foreground", children: typography?.letterSpacing?.chrome ?? DEFAULT_LETTER_SPACING })
24387
+ ] }),
24388
+ /* @__PURE__ */ jsxRuntime.jsx(
24389
+ Slider,
24390
+ {
24391
+ min: -2,
24392
+ max: 4,
24393
+ step: 0.25,
24394
+ value: [letterSpacingToPx(typography?.letterSpacing?.chrome ?? DEFAULT_LETTER_SPACING)],
24395
+ onValueChange: (values) => setLetterSpacing(
24396
+ pxToLetterSpacing(
24397
+ values[0] ?? 0,
24398
+ typography?.letterSpacing?.chrome ?? DEFAULT_LETTER_SPACING
24399
+ )
24400
+ )
24401
+ }
24402
+ )
24403
+ ] })
24404
+ ] }),
24405
+ /* @__PURE__ */ jsxRuntime.jsxs(ControlSection, { title: "Elevation", children: [
24406
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tw-m-0 tw-text-xs tw-text-muted-foreground", children: "Box-shadow scale (`--shadow-*`), shared across light & dark. Empty inherits the default." }),
24407
+ SHADOW_SLOTS.map((slot) => /* @__PURE__ */ jsxRuntime.jsx(
24408
+ TextField2,
24409
+ {
24410
+ id: `${baseId}shadow-${slot}`,
24411
+ label: SHADOW_LABELS[slot],
24412
+ value: theme.shadows?.[slot] ?? "",
24413
+ placeholder: DEFAULT_SHADOWS[slot],
24414
+ onChange: (next) => setShadow(slot, next)
24415
+ },
24416
+ slot
24417
+ ))
24418
+ ] }),
24419
+ /* @__PURE__ */ jsxRuntime.jsxs(ControlSection, { title: "Density", children: [
24420
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tw-m-0 tw-text-xs tw-text-muted-foreground", children: "Semantic spacing (`--space-*`), as CSS lengths." }),
24421
+ SPACING_SLOTS.map((slot) => /* @__PURE__ */ jsxRuntime.jsx(
24422
+ TextField2,
24423
+ {
24424
+ id: `${baseId}spacing-${slot}`,
24425
+ label: SPACING_LABELS[slot],
24426
+ value: theme.spacing?.[slot] ?? "",
24427
+ placeholder: DEFAULT_SPACING[slot],
24428
+ onChange: (next) => setSpacing(slot, next)
24429
+ },
24430
+ slot
24431
+ ))
24432
+ ] }),
24433
+ /* @__PURE__ */ jsxRuntime.jsxs(ControlSection, { title: "Motion", children: [
24434
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tw-m-0 tw-text-xs tw-text-muted-foreground", children: "Base transition `duration` + `easing` (`--motion-*`)." }),
24435
+ MOTION_SLOTS.map((slot) => /* @__PURE__ */ jsxRuntime.jsx(
24436
+ TextField2,
24437
+ {
24438
+ id: `${baseId}motion-${slot}`,
24439
+ label: MOTION_LABELS[slot],
24440
+ value: theme.motion?.[slot] ?? "",
24441
+ placeholder: DEFAULT_MOTION[slot],
24442
+ onChange: (next) => setMotion(slot, next)
24443
+ },
24444
+ slot
24445
+ ))
24446
+ ] }),
24447
+ /* @__PURE__ */ jsxRuntime.jsx(ControlSection, { title: "Gradient", children: /* @__PURE__ */ jsxRuntime.jsx(
24448
+ TextField2,
24449
+ {
24450
+ id: `${baseId}gradient-brand`,
24451
+ label: "Brand gradient",
24452
+ value: theme.gradient?.brand ?? "",
24453
+ placeholder: DEFAULT_GRADIENT,
24454
+ onChange: setGradient
24455
+ }
24456
+ ) }),
24457
+ /* @__PURE__ */ jsxRuntime.jsxs(ControlSection, { title: "Logo", children: [
24458
+ /* @__PURE__ */ jsxRuntime.jsx(
24459
+ LogoField,
24460
+ {
24461
+ id: `${baseId}logo-mark`,
24462
+ label: "Mark (icon)",
24463
+ value: value.logo?.mark ?? "",
24464
+ onChange: (source) => setLogo("mark", source)
24465
+ }
24466
+ ),
24467
+ /* @__PURE__ */ jsxRuntime.jsx(
24468
+ LogoField,
24469
+ {
24470
+ id: `${baseId}logo-wordmark`,
24471
+ label: "Wordmark (full)",
24472
+ value: value.logo?.wordmark ?? "",
24473
+ onChange: (source) => setLogo("wordmark", source)
24474
+ }
24475
+ ),
24476
+ /* @__PURE__ */ jsxRuntime.jsxs(Collapsible, { className: "tw-flex tw-flex-col tw-gap-2", children: [
24477
+ /* @__PURE__ */ jsxRuntime.jsx(Collapsible.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "small", className: "tw-w-full", children: "Toggle dark-mode logos" }) }),
24478
+ /* @__PURE__ */ jsxRuntime.jsxs(Collapsible.Content, { className: "tw-flex tw-flex-col tw-gap-2", children: [
24479
+ /* @__PURE__ */ jsxRuntime.jsx(
24480
+ LogoField,
24481
+ {
24482
+ id: `${baseId}logo-mark-dark`,
24483
+ label: "Mark (dark)",
24484
+ value: value.logo?.markDark ?? "",
24485
+ onChange: (source) => setLogo("markDark", source)
24486
+ }
24487
+ ),
24488
+ /* @__PURE__ */ jsxRuntime.jsx(
24489
+ LogoField,
24490
+ {
24491
+ id: `${baseId}logo-wordmark-dark`,
24492
+ label: "Wordmark (dark)",
24493
+ value: value.logo?.wordmarkDark ?? "",
24494
+ onChange: (source) => setLogo("wordmarkDark", source)
24495
+ }
24496
+ )
24497
+ ] })
24498
+ ] }),
24499
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
24500
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-text-xs tw-text-muted-foreground", children: "Preview" }),
24501
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-min-h-12 tw-items-center tw-gap-4 tw-rounded-md tw-border tw-border-border tw-bg-background tw-p-3", children: value.logo?.mark || value.logo?.wordmark ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
24502
+ value.logo.mark ? /* @__PURE__ */ jsxRuntime.jsx(LogoPreviewImage, { source: value.logo.mark, className: "tw-h-8" }) : null,
24503
+ value.logo.wordmark ? /* @__PURE__ */ jsxRuntime.jsx(LogoPreviewImage, { source: value.logo.wordmark, className: "tw-h-8" }) : null
24504
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-text-xs tw-text-muted-foreground", children: "No logo set" }) })
24505
+ ] })
24506
+ ] })
24507
+ ] });
24508
+ };
23422
24509
  /*! Bundled license information:
23423
24510
 
23424
24511
  react-is/cjs/react-is.production.min.js:
@@ -23509,6 +24596,7 @@ exports.ArgoDesignContext = ArgoDesignContext;
23509
24596
  exports.AutoSaveTextarea = AutoSaveTextarea;
23510
24597
  exports.Avatar = Avatar;
23511
24598
  exports.Badge = Badge;
24599
+ exports.BrandEditor = BrandEditor;
23512
24600
  exports.BrandLogo = BrandLogo;
23513
24601
  exports.Breadcrumb = Breadcrumb;
23514
24602
  exports.Button = Button;
@@ -23516,6 +24604,7 @@ exports.ButtonGroup = ButtonGroup;
23516
24604
  exports.ButtonInline = ButtonInline;
23517
24605
  exports.Calendar = Calendar;
23518
24606
  exports.Card = Card;
24607
+ exports.ChartPanel = ChartPanel;
23519
24608
  exports.Checkbox = Checkbox;
23520
24609
  exports.Clipboard = Clipboard;
23521
24610
  exports.ClipboardButton = ClipboardButton;
@@ -23533,8 +24622,12 @@ exports.CommandInput = CommandInput;
23533
24622
  exports.CommandItem = CommandItem;
23534
24623
  exports.CommandList = CommandList;
23535
24624
  exports.ConflictStatusIndicator = ConflictStatusIndicator;
24625
+ exports.CopyField = CopyField;
23536
24626
  exports.DEFAULT_COLOR_SCHEME = DEFAULT_COLOR_SCHEME;
24627
+ exports.DEFAULT_FALLBACK_FONT = DEFAULT_FALLBACK_FONT;
24628
+ exports.DEFAULT_FONT_OPTIONS = DEFAULT_FONT_OPTIONS;
23537
24629
  exports.DEFAULT_KEBOOLA_BRAND_ID = DEFAULT_BRAND_ID;
24630
+ exports.DashboardHero = DashboardHero;
23538
24631
  exports.DateInput = DateInput;
23539
24632
  exports.DatePicker = DatePicker;
23540
24633
  exports.DateRangeInput = DateRangeInput;
@@ -23603,6 +24696,8 @@ exports.SkeletonList = SkeletonList;
23603
24696
  exports.Slider = Slider;
23604
24697
  exports.SplitButton = SplitButton;
23605
24698
  exports.SpotlightBackdrop = SpotlightBackdrop;
24699
+ exports.StatCard = StatCard;
24700
+ exports.StatCardGrid = StatCardGrid;
23606
24701
  exports.Stepper = Stepper;
23607
24702
  exports.SuggestedPrompt = SuggestedPrompt;
23608
24703
  exports.Switch = Switch;
@@ -23629,10 +24724,13 @@ exports.UsageStats = UsageStats;
23629
24724
  exports.UsageStatsRing = UsageStatsRing;
23630
24725
  exports.ZoomableSvg = ZoomableSvg;
23631
24726
  exports.argoVariants = argoVariants;
24727
+ exports.channelsToHex = channelsToHex;
23632
24728
  exports.cn = cn;
23633
24729
  exports.computeDiffRows = computeDiffRows;
23634
24730
  exports.computeLineInformation = computeLineInformation;
24731
+ exports.contrastRatio = contrastRatio;
23635
24732
  exports.copyToClipboard = copyToClipboard;
24733
+ exports.hexToChannels = hexToChannels;
23636
24734
  exports.isMac = isMac;
23637
24735
  exports.kbdVariants = kbdVariants;
23638
24736
  exports.keys = keys;
@@ -23648,6 +24746,7 @@ exports.useScrollbarPosition = useScrollbarPosition;
23648
24746
  exports.useSidebar = useSidebar;
23649
24747
  exports.useTargetRect = useTargetRect;
23650
24748
  exports.useTheme = useTheme;
24749
+ exports.wcagLevel = wcagLevel;
23651
24750
  exports.withForm = withForm;
23652
24751
  //# sourceMappingURL=index.cjs.map
23653
24752
  //# sourceMappingURL=index.cjs.map