@keboola/design 4.2.0 → 4.3.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
@@ -1443,9 +1443,9 @@ var variants = classVarianceAuthority.cva(
1443
1443
  "focus-visible:tw-outline",
1444
1444
  "focus-visible:tw-outline-1",
1445
1445
  "focus-visible:-tw-outline-offset-1",
1446
- "focus-visible:tw-outline-secondary-500",
1446
+ "focus-visible:tw-outline-ring",
1447
1447
  "focus-visible:tw-ring-4",
1448
- "focus-visible:tw-ring-secondary-200",
1448
+ "focus-visible:tw-ring-ring/30",
1449
1449
  // disabled
1450
1450
  "disabled:tw-opacity-40",
1451
1451
  "disabled:tw-cursor-not-allowed",
@@ -2489,9 +2489,10 @@ var toggleVariants = classVarianceAuthority.cva(
2489
2489
  // focus-visible
2490
2490
  "[&:not(:active)]:not-disabled:focus-visible:tw-outline",
2491
2491
  "!tw-outline-offset-0",
2492
- "[&:not(:active)]:not-disabled:focus-visible:tw-outline-secondary-500",
2492
+ "[&:not(:active)]:not-disabled:focus-visible:tw-outline-ring",
2493
2493
  "[&:not(:active)]:not-disabled:focus-visible:tw-outline-1",
2494
- "[&:not(:active)]:not-disabled:focus-visible:tw-shadow-[0_0_0_4px_rgba(31,143,255,0.2)]"
2494
+ "[&:not(:active)]:not-disabled:focus-visible:tw-ring-4",
2495
+ "[&:not(:active)]:not-disabled:focus-visible:tw-ring-ring/20"
2495
2496
  ],
2496
2497
  {
2497
2498
  variants: {
@@ -8832,7 +8833,7 @@ var inputGroupVariants = classVarianceAuthority.cva(
8832
8833
  variants: {
8833
8834
  focusVariant: {
8834
8835
  default: [],
8835
- on: ["!tw-border-secondary-500", "!tw-ring-secondary-200", "!tw-ring-4"],
8836
+ on: ["!tw-border-ring", "!tw-ring-ring/30", "!tw-ring-4"],
8836
8837
  off: ["has-[:is(input,textarea):focus]:!tw-ring-0"]
8837
8838
  },
8838
8839
  variant: {
@@ -8872,8 +8873,8 @@ var inputGroupVariants = classVarianceAuthority.cva(
8872
8873
  },
8873
8874
  state: {
8874
8875
  default: [
8875
- "has-[:is(input,textarea):focus]:tw-border-secondary-500",
8876
- "has-[:is(input,textarea):focus]:tw-ring-secondary-200"
8876
+ "has-[:is(input,textarea):focus]:tw-border-ring",
8877
+ "has-[:is(input,textarea):focus]:tw-ring-ring/30"
8877
8878
  ],
8878
8879
  error: [
8879
8880
  "tw-border-error-500",
@@ -9953,9 +9954,9 @@ var switchVariants = classVarianceAuthority.cva(
9953
9954
  "focus-visible:tw-outline-none",
9954
9955
  "before:focus-visible:tw-outline",
9955
9956
  "before:focus-visible:tw-outline-1",
9956
- "before:focus-visible:tw-outline-secondary-500",
9957
+ "before:focus-visible:tw-outline-ring",
9957
9958
  "before:focus-visible:tw-ring-4",
9958
- "before:focus-visible:tw-ring-secondary-200"
9959
+ "before:focus-visible:tw-ring-ring/30"
9959
9960
  ],
9960
9961
  argo: [
9961
9962
  "tw-peer",
@@ -10139,7 +10140,7 @@ var radioVariants = classVarianceAuthority.cva(
10139
10140
  "data-[state=unchecked]:hover:tw-border-primary",
10140
10141
  "data-[state=unchecked]:disabled:hover:tw-border-neutral-200",
10141
10142
  "focus-visible:tw-ring-2",
10142
- "focus-visible:tw-ring-secondary-200"
10143
+ "focus-visible:tw-ring-ring/30"
10143
10144
  ],
10144
10145
  argo: [
10145
10146
  "disabled:tw-opacity-50",
@@ -10219,9 +10220,9 @@ var radioItemButtonVariants = classVarianceAuthority.cva(
10219
10220
  "data-[state=checked]:tw-text-white",
10220
10221
  "data-[state=checked]:tw-cursor-default",
10221
10222
  "focus-visible:tw-outline",
10222
- "focus-visible:tw-outline-secondary-500",
10223
+ "focus-visible:tw-outline-ring",
10223
10224
  "focus-visible:tw-ring-4",
10224
- "focus-visible:tw-ring-secondary-200"
10225
+ "focus-visible:tw-ring-ring/30"
10225
10226
  ],
10226
10227
  argo: [
10227
10228
  "disabled:tw-opacity-50",
@@ -10690,8 +10691,8 @@ var searchWrapperVariants = classVarianceAuthority.cva(
10690
10691
  // focus
10691
10692
  "has-[input:focus]:tw-outline-1",
10692
10693
  "has-[input:focus]:tw-ring-4",
10693
- "has-[input:focus]:tw-outline-secondary-500",
10694
- "has-[input:focus]:tw-ring-secondary-200"
10694
+ "has-[input:focus]:tw-outline-ring",
10695
+ "has-[input:focus]:tw-ring-ring/30"
10695
10696
  ],
10696
10697
  ai: [
10697
10698
  "tailwindcss-preflight",
@@ -10708,7 +10709,7 @@ var searchWrapperVariants = classVarianceAuthority.cva(
10708
10709
  "tw-shadow-[inset_0_100vw_white]",
10709
10710
  // focus
10710
10711
  "has-[input:focus]:tw-ring-4",
10711
- "has-[input:focus]:tw-ring-secondary-200"
10712
+ "has-[input:focus]:tw-ring-ring/30"
10712
10713
  ]
10713
10714
  }
10714
10715
  }
@@ -11130,10 +11131,10 @@ var variants4 = classVarianceAuthority.cva(
11130
11131
  },
11131
11132
  state: {
11132
11133
  default: [
11133
- "focus:tw-border-secondary-500",
11134
- "focus:tw-ring-secondary-200",
11135
- "data-[state=open]:tw-border-secondary-500",
11136
- "data-[state=open]:tw-ring-secondary-200"
11134
+ "focus:tw-border-ring",
11135
+ "focus:tw-ring-ring/30",
11136
+ "data-[state=open]:tw-border-ring",
11137
+ "data-[state=open]:tw-ring-ring/30"
11137
11138
  ],
11138
11139
  error: [
11139
11140
  "tw-border-error-500",
@@ -11512,7 +11513,7 @@ var badgeRootVariants = classVarianceAuthority.cva(
11512
11513
  "focus-visible:tw-outline-none",
11513
11514
  "focus-visible:tw-ring-2",
11514
11515
  "focus-visible:tw-ring-inset",
11515
- "focus-visible:tw-ring-secondary-500"
11516
+ "focus-visible:tw-ring-ring"
11516
11517
  ],
11517
11518
  {
11518
11519
  defaultVariants: {
@@ -12636,6 +12637,43 @@ var ColorInput = ({
12636
12637
  }
12637
12638
  );
12638
12639
  };
12640
+ var OPTIONS = [
12641
+ { value: "light", label: "Light", icon: icons_exports.Sun },
12642
+ { value: "dark", label: "Dark", icon: icons_exports.Moon },
12643
+ { value: "system", label: "System", icon: icons_exports.Monitor }
12644
+ ];
12645
+ var triggerSizeMap = { small: "icon-sm", medium: "icon" };
12646
+ var ColorModeSwitch = ({ value, onValueChange, size = "small", className }) => {
12647
+ const active = OPTIONS.find((option) => option.value === value);
12648
+ const ActiveIcon = active?.icon ?? icons_exports.Monitor;
12649
+ const activeLabel = active?.label ?? "System";
12650
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
12651
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
12652
+ Button,
12653
+ {
12654
+ type: "button",
12655
+ variant: "outline",
12656
+ size: triggerSizeMap[size],
12657
+ "aria-label": `Color mode: ${activeLabel}`,
12658
+ title: `Color mode: ${activeLabel}`,
12659
+ className,
12660
+ children: /* @__PURE__ */ jsxRuntime.jsx(ActiveIcon, { className: "tw-size-4" })
12661
+ }
12662
+ ) }),
12663
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu.Content, { align: "end", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu.RadioGroup, { value, onValueChange, children: OPTIONS.map(({ value: option, label, icon: Icon2 }) => /* @__PURE__ */ jsxRuntime.jsx(
12664
+ DropdownMenu.RadioItem,
12665
+ {
12666
+ value: option,
12667
+ icon: /* @__PURE__ */ jsxRuntime.jsx(Icon2, {}),
12668
+ indicator: "check",
12669
+ indicatorAlign: "end",
12670
+ closeOnSelect: true,
12671
+ children: label
12672
+ },
12673
+ option
12674
+ )) }) })
12675
+ ] });
12676
+ };
12639
12677
  var toNumberOrNull = (event) => Number.isNaN(event.target.valueAsNumber) ? null : event.target.valueAsNumber;
12640
12678
  var NumberInput = ({
12641
12679
  ref,
@@ -14978,9 +15016,9 @@ FormGroup.NumberInput = FormGroupNumberInput;
14978
15016
  FormGroup.ColorInput = FormGroupColorInput;
14979
15017
  FormGroup.Textarea = FormGroupTextarea;
14980
15018
  var variantClasses = {
14981
- success: "tw-text-secondary-500 focus-visible:tw-outline-secondary-500 not-disabled:hover:tw-text-secondary-600",
15019
+ success: "tw-text-secondary-500 focus-visible:tw-outline-ring not-disabled:hover:tw-text-secondary-600",
14982
15020
  error: "tw-text-error-500 focus-visible:tw-outline-error-500 not-disabled:hover:tw-text-error-600",
14983
- processing: "tw-text-secondary-500 focus-visible:tw-outline-secondary-500 not-disabled:hover:tw-text-secondary-600",
15021
+ processing: "tw-text-secondary-500 focus-visible:tw-outline-ring not-disabled:hover:tw-text-secondary-600",
14984
15022
  dismissed: "tw-text-neutral-700 focus-visible:tw-outline-neutral-500 not-disabled:hover:tw-text-neutral-800"
14985
15023
  };
14986
15024
  var renderVariantIcon = (variant) => {
@@ -15113,8 +15151,8 @@ var Avatar = ({
15113
15151
  "tw-border",
15114
15152
  "tw-border-transparent",
15115
15153
  "focus-visible:tw-ring-4",
15116
- "focus-visible:tw-ring-secondary-200",
15117
- "focus-visible:tw-border-secondary-500",
15154
+ "focus-visible:tw-ring-ring/30",
15155
+ "focus-visible:tw-border-ring",
15118
15156
  className
15119
15157
  ),
15120
15158
  children: [
@@ -15225,7 +15263,7 @@ var ExpandToggle = ({
15225
15263
  type: "button",
15226
15264
  onClick: onToggle,
15227
15265
  "aria-expanded": isExpanded,
15228
- className: "tailwindcss-preflight tw-inline-flex tw-cursor-pointer tw-items-center tw-gap-1 tw-bg-transparent tw-p-0 tw-text-sm tw-font-medium tw-text-secondary-500 hover:tw-text-secondary-600 focus-visible:tw-outline focus-visible:tw-outline-2 focus-visible:tw-outline-offset-2 focus-visible:tw-outline-secondary-500",
15266
+ className: "tailwindcss-preflight tw-inline-flex tw-cursor-pointer tw-items-center tw-gap-1 tw-bg-transparent tw-p-0 tw-text-sm tw-font-medium tw-text-secondary-500 hover:tw-text-secondary-600 focus-visible:tw-outline focus-visible:tw-outline-2 focus-visible:tw-outline-offset-2 focus-visible:tw-outline-ring",
15229
15267
  children: [
15230
15268
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: isExpanded ? showLessLabel : showMoreLabel }),
15231
15269
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -15585,7 +15623,7 @@ var promptInputVariants = classVarianceAuthority.cva(
15585
15623
  "tw-shadow-[inset_0_100vw_white]",
15586
15624
  // focus
15587
15625
  "has-[textarea:focus]:tw-ring-4",
15588
- "has-[textarea:focus]:tw-ring-secondary-200",
15626
+ "has-[textarea:focus]:tw-ring-ring/30",
15589
15627
  "tw-cursor-text",
15590
15628
  "tw-px-2"
15591
15629
  ],
@@ -16455,7 +16493,7 @@ var Alert = ({
16455
16493
  "tw-rounded-sm",
16456
16494
  "focus-visible:tw-outline",
16457
16495
  "focus-visible:tw-outline-2",
16458
- "focus-visible:tw-outline-secondary-500"
16496
+ "focus-visible:tw-outline-ring"
16459
16497
  ),
16460
16498
  children: [
16461
16499
  !hideIcon && /* @__PURE__ */ jsxRuntime.jsx(AlertIcon, { variant, icon }),
@@ -18528,10 +18566,10 @@ var SidebarGroupAction = ({
18528
18566
  "hover:[&_svg]:tw-text-secondary-600",
18529
18567
  "hover:tw-bg-neutral-100",
18530
18568
  "focus-visible:tw-ring-4",
18531
- "focus-visible:tw-ring-secondary-200",
18569
+ "focus-visible:tw-ring-ring/30",
18532
18570
  "focus-visible:tw-outline",
18533
18571
  "focus-visible:tw-outline-1",
18534
- "focus-visible:tw-outline-secondary-500",
18572
+ "focus-visible:tw-outline-ring",
18535
18573
  className
18536
18574
  ),
18537
18575
  children
@@ -19808,7 +19846,7 @@ var BreadcrumbEllipsis = ({
19808
19846
  // focus
19809
19847
  "focus-visible:tw-outline-none",
19810
19848
  "focus-visible:tw-ring-2",
19811
- "focus-visible:tw-ring-secondary-500/50",
19849
+ "focus-visible:tw-ring-ring/50",
19812
19850
  "tw-p-1",
19813
19851
  className
19814
19852
  ),
@@ -19844,7 +19882,7 @@ var BreadcrumbLink = ({
19844
19882
  // focus
19845
19883
  "focus-visible:tw-outline-none",
19846
19884
  "focus-visible:tw-ring-2",
19847
- "focus-visible:tw-ring-secondary-500/50",
19885
+ "focus-visible:tw-ring-ring/50",
19848
19886
  "focus-visible:tw-rounded-sm",
19849
19887
  // Icon
19850
19888
  '[&_svg:not([class*="tw-size-"])]:tw-size-3.5',
@@ -22197,6 +22235,7 @@ exports.Collapsible = Collapsible;
22197
22235
  exports.CollapsiblePanel = CollapsiblePanel;
22198
22236
  exports.CollapsibleStepHeader = CollapsibleStepHeader;
22199
22237
  exports.ColorInput = ColorInput;
22238
+ exports.ColorModeSwitch = ColorModeSwitch;
22200
22239
  exports.Combobox = Combobox;
22201
22240
  exports.Command = Command;
22202
22241
  exports.CommandGroup = CommandGroup;