@keboola/design 5.0.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -511,7 +511,7 @@ var init_Skeleton = __esm({
511
511
  "tw-relative",
512
512
  "tw-overflow-hidden",
513
513
  "tw-pointer-events-none",
514
- "tw-bg-muted",
514
+ "tw-bg-skeleton",
515
515
  // before
516
516
  'before:tw-content-[""]',
517
517
  "before:tw-opacity-100",
@@ -590,11 +590,12 @@ var init_styles = __esm({
590
590
  "tw-items-center",
591
591
  "tw-justify-center",
592
592
  "tw-gap-2",
593
- // text
593
+ // text — chrome weight/tracking are brand-overridable tokens
594
+ // (`--font-weight-medium` / `--letter-spacing-chrome`); casing stays `tw-uppercase`.
594
595
  "tw-text-xs",
595
596
  "tw-leading-5",
596
597
  "tw-font-medium",
597
- "tw-tracking-[1px]",
598
+ "tw-tracking-chrome",
598
599
  "tw-uppercase",
599
600
  // border — legacy (non-argo) chrome uses a fixed radius, not the brand token.
600
601
  "tw-rounded",
@@ -3426,11 +3427,23 @@ var inputGroupVariants = cva(
3426
3427
  off: ["has-[:is(input,textarea):focus]:!tw-ring-0"]
3427
3428
  },
3428
3429
  variant: {
3429
- primary: ["tw-bg-white", "has-[:is(input,textarea):disabled]:tw-opacity-40"],
3430
+ primary: [
3431
+ "tw-bg-white",
3432
+ "has-[:is(input,textarea):disabled]:tw-opacity-40",
3433
+ // aria-invalid on the control surfaces the error chrome without a `state` prop — the
3434
+ // accessible path (mirrors the `state="error"` legacy tokens). Higher specificity than
3435
+ // the default focus selector, so it wins without `!important`.
3436
+ "has-[:is(input,textarea)[aria-invalid=true]]:tw-border-error-500",
3437
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-border-error-500",
3438
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-ring-error-200"
3439
+ ],
3430
3440
  secondary: [
3431
3441
  "tw-bg-neutral-100",
3432
3442
  "tw-border-neutral-100",
3433
- "has-[:is(input,textarea):disabled]:tw-opacity-40"
3443
+ "has-[:is(input,textarea):disabled]:tw-opacity-40",
3444
+ "has-[:is(input,textarea)[aria-invalid=true]]:tw-border-error-500",
3445
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-border-error-500",
3446
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-ring-error-200"
3434
3447
  ],
3435
3448
  argo: [
3436
3449
  // argo follows the brand radius token (overrides the static base)
@@ -3441,7 +3454,12 @@ var inputGroupVariants = cva(
3441
3454
  "tw-text-foreground",
3442
3455
  "has-[:is(input,textarea):disabled]:tw-opacity-50",
3443
3456
  // higher specificity than has-[:is(input,textarea):focus] — prevents focus border on readonly
3444
- "has-[:is(input,textarea)[readonly]:focus]:tw-border-neutral-150"
3457
+ "has-[:is(input,textarea)[readonly]:focus]:tw-border-neutral-150",
3458
+ // aria-invalid on the control surfaces the error chrome without a `state` prop — the
3459
+ // accessible path (uses the themeable `destructive` status token).
3460
+ "has-[:is(input,textarea)[aria-invalid=true]]:tw-border-destructive",
3461
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-border-destructive",
3462
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-ring-destructive/20"
3445
3463
  ]
3446
3464
  },
3447
3465
  sizing: {
@@ -3729,6 +3747,21 @@ var FormGroupColorInput = ({
3729
3747
  const { state } = useFormGroupContext();
3730
3748
  return /* @__PURE__ */ jsx(ColorInput, { state, ...props, ref });
3731
3749
  };
3750
+
3751
+ // src/components/FormGroup/FormGroupError.tsx
3752
+ init_utils2();
3753
+ var toMessage = (entry) => typeof entry === "string" ? entry : entry?.message;
3754
+ var FormGroupError = ({ children, className, errors, ...rest }) => {
3755
+ const content = useMemo(() => {
3756
+ if (children) return children;
3757
+ const messages = (errors ?? []).map(toMessage).filter((message) => !!message);
3758
+ if (messages.length === 0) return null;
3759
+ if (messages.length === 1) return messages[0];
3760
+ return /* @__PURE__ */ jsx("ul", { className: "tw-m-0 tw-flex tw-list-disc tw-flex-col tw-gap-0 tw-pl-4", children: messages.map((message, index) => /* @__PURE__ */ jsx("li", { children: message }, index)) });
3761
+ }, [children, errors]);
3762
+ if (!content) return null;
3763
+ return /* @__PURE__ */ jsx("div", { ...rest, role: "alert", className: cn("tw-m-0 tw-text-xs tw-text-destructive", className), children: content });
3764
+ };
3732
3765
  var helpVariants = cva(["tw-m-0", "tw-text-xs"], {
3733
3766
  defaultVariants: {
3734
3767
  state: "default"
@@ -3736,18 +3769,17 @@ var helpVariants = cva(["tw-m-0", "tw-text-xs"], {
3736
3769
  variants: {
3737
3770
  state: {
3738
3771
  default: ["tw-text-muted-foreground"],
3739
- error: ["tw-text-destructive"],
3740
3772
  warning: ["tw-text-warning"]
3741
3773
  }
3742
3774
  }
3743
3775
  });
3744
- var HelpBlock = ({ children, className, state = "default", testId }) => {
3776
+ var HelpBlock = ({ children, className, state = "default", ...rest }) => {
3745
3777
  if (!children) return null;
3746
- return /* @__PURE__ */ jsx("p", { "data-testid": testId, className: helpVariants({ state, className }), children });
3778
+ return /* @__PURE__ */ jsx("p", { ...rest, className: helpVariants({ state, className }), children });
3747
3779
  };
3748
3780
  var FormGroupHelp = ({ children, ...rest }) => {
3749
3781
  const formGroupContext = useFormGroupContext();
3750
- return /* @__PURE__ */ jsx(HelpBlock, { state: formGroupContext.state, ...rest, children });
3782
+ return /* @__PURE__ */ jsx(HelpBlock, { state: formGroupContext.state === "warning" ? "warning" : "default", ...rest, children });
3751
3783
  };
3752
3784
  var toNumberOrNull = (event) => Number.isNaN(event.target.valueAsNumber) ? null : event.target.valueAsNumber;
3753
3785
  var NumberInput = ({
@@ -4002,10 +4034,11 @@ var FormGroupTextInput = ({
4002
4034
  const { state } = useFormGroupContext();
4003
4035
  return /* @__PURE__ */ jsx(TextInput, { state, ...props, ref });
4004
4036
  };
4005
- var FormGroup = ({ className, children, state, testId }) => {
4006
- return /* @__PURE__ */ jsx(FormGroupProvider, { value: { state }, children: /* @__PURE__ */ jsx("div", { "data-testid": testId, className: cn("tw-flex tw-flex-col tw-gap-1", className), children }) });
4037
+ var FormGroup = ({ className, children, state, ...rest }) => {
4038
+ return /* @__PURE__ */ jsx(FormGroupProvider, { value: { state }, children: /* @__PURE__ */ jsx("div", { ...rest, className: cn("tw-flex tw-flex-col tw-gap-1", className), children }) });
4007
4039
  };
4008
4040
  FormGroup.Help = FormGroupHelp;
4041
+ FormGroup.Error = FormGroupError;
4009
4042
  FormGroup.TextInput = FormGroupTextInput;
4010
4043
  FormGroup.NumberInput = FormGroupNumberInput;
4011
4044
  FormGroup.ColorInput = FormGroupColorInput;
@@ -4013,23 +4046,23 @@ FormGroup.Textarea = FormGroupTextarea;
4013
4046
 
4014
4047
  // src/components/Label/Label.tsx
4015
4048
  init_utils2();
4016
- var Optional = ({ className }) => /* @__PURE__ */ jsx("span", { className: cn("tw-text-muted-foreground", className), children: "(optional)" });
4017
- var Label2 = ({ className, children, id, htmlFor, ...rest }) => {
4018
- return /* @__PURE__ */ jsx(
4019
- RLabel.Root,
4020
- {
4021
- ...rest,
4022
- id: id?.toString(),
4023
- htmlFor: htmlFor?.toString(),
4024
- className: cn(
4025
- "tw-m-0 tw-text-foreground tw-font-normal peer-disabled:tw-opacity-50",
4026
- className
4027
- ),
4028
- children
4029
- }
4030
- );
4031
- };
4049
+ var Optional = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-muted-foreground", className), children: "(optional)" });
4050
+ var Required = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-primary", className), children: "*" });
4051
+ var Label2 = ({ className, children, id, htmlFor, ...rest }) => /* @__PURE__ */ jsx(
4052
+ RLabel.Root,
4053
+ {
4054
+ ...rest,
4055
+ id: id?.toString(),
4056
+ htmlFor: htmlFor?.toString(),
4057
+ className: cn(
4058
+ "tw-m-0 tw-text-foreground tw-font-normal peer-disabled:tw-opacity-50",
4059
+ className
4060
+ ),
4061
+ children
4062
+ }
4063
+ );
4032
4064
  Label2.Optional = Optional;
4065
+ Label2.Required = Required;
4033
4066
 
4034
4067
  // src/components/MarkdownEditor/plugins/toolbar/ToolbarButton.tsx
4035
4068
  init_utils2();