@keboola/design 6.1.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
@@ -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;
@@ -4068,8 +4068,8 @@ var FullScreenModalHeader = ({
4068
4068
  {
4069
4069
  text: previousTitle,
4070
4070
  className: cn(
4071
- "tw-relative tw-top-0 tw-cursor-pointer tw-text-base tw-font-normal tw-text-neutral-400 tw-underline",
4072
- "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",
4073
4073
  isTitleWithIcon && "tw-ml-14"
4074
4074
  )
4075
4075
  }
@@ -11022,8 +11022,8 @@ var ClearButton = ({ onClick, testId }) => {
11022
11022
  "tw-flex",
11023
11023
  "tw-items-center",
11024
11024
  "tw-cursor-pointer",
11025
- "tw-text-neutral-300",
11026
- "hover:tw-text-neutral-800"
11025
+ "tw-text-muted-foreground",
11026
+ "hover:tw-text-foreground"
11027
11027
  ),
11028
11028
  "data-testid": testId,
11029
11029
  children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.X, { className: "tw-size-4" })
@@ -11864,23 +11864,23 @@ var BadgeLabel = ({
11864
11864
  var badgeColors = {
11865
11865
  gray: "tw-bg-neutral-400 tw-text-white tw-decoration-neutral-400",
11866
11866
  "gray-darker": "tw-bg-neutral-500 tw-text-white tw-decoration-neutral-500",
11867
- "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",
11868
11868
  green: "tw-bg-green-500 tw-text-white tw-decoration-green-500",
11869
11869
  "green-darker": "tw-bg-green-600 tw-text-white tw-decoration-green-600",
11870
- "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",
11871
11871
  blue: "tw-bg-blue-500 tw-text-white tw-decoration-blue-500",
11872
- "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",
11873
11873
  red: "tw-bg-error-500 tw-text-white tw-decoration-error-500",
11874
11874
  orange: "tw-bg-warning-500 tw-text-white tw-decoration-warning-500",
11875
- "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",
11876
11876
  amber: "tw-bg-warning-300 tw-text-warning-800 tw-decoration-warning-300",
11877
11877
  "amber-inverse": "tw-bg-warning-100 tw-text-warning-700 tw-decoration-warning-100",
11878
11878
  teal: "tw-bg-teal-500 tw-text-white tw-decoration-teal-500",
11879
- "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",
11880
11880
  purple: "tw-bg-purple-500 tw-text-white tw-decoration-purple-500",
11881
- "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",
11882
11882
  cyan: "tw-bg-cyan-500 tw-text-white tw-decoration-cyan-500",
11883
- "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",
11884
11884
  "sidebar-primary": "tw-bg-sidebar-primary tw-text-white tw-decoration-sidebar-primary",
11885
11885
  white: "tw-bg-white/90 tw-text-neutral-600 tw-decoration-white/90"
11886
11886
  };
@@ -18453,9 +18453,7 @@ var headerVariants = classVarianceAuthority.cva(
18453
18453
  variants: {
18454
18454
  variant: {
18455
18455
  default: "tw-bg-muted",
18456
- // White surface kept literal until a `card` token exists (UT-4396);
18457
- // `background` is the page base, not an elevated panel surface.
18458
- white: "tw-bg-white"
18456
+ white: "tw-bg-card"
18459
18457
  },
18460
18458
  isDisabled: {
18461
18459
  true: "tw-cursor-not-allowed tw-opacity-50",
@@ -18520,7 +18518,7 @@ var CollapsiblePanel = ({
18520
18518
  {
18521
18519
  open,
18522
18520
  className: cn(
18523
- "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",
18524
18522
  className
18525
18523
  ),
18526
18524
  header: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -18728,6 +18726,18 @@ var tokensToCssVars = ({
18728
18726
  vars.set("--font-weight-semibold", typography?.weight?.semibold);
18729
18727
  vars.set("--font-weight-bold", typography?.weight?.bold);
18730
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);
18731
18741
  vars.set("--radius-sm", radii?.sm);
18732
18742
  vars.set("--radius-md", radii?.md);
18733
18743
  vars.set("--radius-lg", radii?.lg);
@@ -23233,6 +23243,150 @@ var pairChunksIntoConflicts = (chunks) => {
23233
23243
  }
23234
23244
  return conflicts;
23235
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
+ ] });
23236
23390
  var { fieldContext, useFieldContext, formContext, useFormContext } = reactForm.createFormHookContexts();
23237
23391
  var FormBody = ({ children, className, ...formProps }) => {
23238
23392
  const form = useFormContext();
@@ -23672,6 +23826,686 @@ function useAutosizeInput({
23672
23826
  ] });
23673
23827
  return { inputRef, inputStyle, sizerElement };
23674
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
+ };
23675
24509
  /*! Bundled license information:
23676
24510
 
23677
24511
  react-is/cjs/react-is.production.min.js:
@@ -23762,6 +24596,7 @@ exports.ArgoDesignContext = ArgoDesignContext;
23762
24596
  exports.AutoSaveTextarea = AutoSaveTextarea;
23763
24597
  exports.Avatar = Avatar;
23764
24598
  exports.Badge = Badge;
24599
+ exports.BrandEditor = BrandEditor;
23765
24600
  exports.BrandLogo = BrandLogo;
23766
24601
  exports.Breadcrumb = Breadcrumb;
23767
24602
  exports.Button = Button;
@@ -23769,6 +24604,7 @@ exports.ButtonGroup = ButtonGroup;
23769
24604
  exports.ButtonInline = ButtonInline;
23770
24605
  exports.Calendar = Calendar;
23771
24606
  exports.Card = Card;
24607
+ exports.ChartPanel = ChartPanel;
23772
24608
  exports.Checkbox = Checkbox;
23773
24609
  exports.Clipboard = Clipboard;
23774
24610
  exports.ClipboardButton = ClipboardButton;
@@ -23788,7 +24624,10 @@ exports.CommandList = CommandList;
23788
24624
  exports.ConflictStatusIndicator = ConflictStatusIndicator;
23789
24625
  exports.CopyField = CopyField;
23790
24626
  exports.DEFAULT_COLOR_SCHEME = DEFAULT_COLOR_SCHEME;
24627
+ exports.DEFAULT_FALLBACK_FONT = DEFAULT_FALLBACK_FONT;
24628
+ exports.DEFAULT_FONT_OPTIONS = DEFAULT_FONT_OPTIONS;
23791
24629
  exports.DEFAULT_KEBOOLA_BRAND_ID = DEFAULT_BRAND_ID;
24630
+ exports.DashboardHero = DashboardHero;
23792
24631
  exports.DateInput = DateInput;
23793
24632
  exports.DatePicker = DatePicker;
23794
24633
  exports.DateRangeInput = DateRangeInput;
@@ -23857,6 +24696,8 @@ exports.SkeletonList = SkeletonList;
23857
24696
  exports.Slider = Slider;
23858
24697
  exports.SplitButton = SplitButton;
23859
24698
  exports.SpotlightBackdrop = SpotlightBackdrop;
24699
+ exports.StatCard = StatCard;
24700
+ exports.StatCardGrid = StatCardGrid;
23860
24701
  exports.Stepper = Stepper;
23861
24702
  exports.SuggestedPrompt = SuggestedPrompt;
23862
24703
  exports.Switch = Switch;
@@ -23883,10 +24724,13 @@ exports.UsageStats = UsageStats;
23883
24724
  exports.UsageStatsRing = UsageStatsRing;
23884
24725
  exports.ZoomableSvg = ZoomableSvg;
23885
24726
  exports.argoVariants = argoVariants;
24727
+ exports.channelsToHex = channelsToHex;
23886
24728
  exports.cn = cn;
23887
24729
  exports.computeDiffRows = computeDiffRows;
23888
24730
  exports.computeLineInformation = computeLineInformation;
24731
+ exports.contrastRatio = contrastRatio;
23889
24732
  exports.copyToClipboard = copyToClipboard;
24733
+ exports.hexToChannels = hexToChannels;
23890
24734
  exports.isMac = isMac;
23891
24735
  exports.kbdVariants = kbdVariants;
23892
24736
  exports.keys = keys;
@@ -23902,6 +24746,7 @@ exports.useScrollbarPosition = useScrollbarPosition;
23902
24746
  exports.useSidebar = useSidebar;
23903
24747
  exports.useTargetRect = useTargetRect;
23904
24748
  exports.useTheme = useTheme;
24749
+ exports.wcagLevel = wcagLevel;
23905
24750
  exports.withForm = withForm;
23906
24751
  //# sourceMappingURL=index.cjs.map
23907
24752
  //# sourceMappingURL=index.cjs.map