@keboola/design 5.1.0 → 6.1.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);
@@ -1470,11 +1470,12 @@ var variants = classVarianceAuthority.cva(
1470
1470
  "tw-items-center",
1471
1471
  "tw-justify-center",
1472
1472
  "tw-gap-2",
1473
- // text
1473
+ // text — chrome weight/tracking are brand-overridable tokens
1474
+ // (`--font-weight-medium` / `--letter-spacing-chrome`); casing stays `tw-uppercase`.
1474
1475
  "tw-text-xs",
1475
1476
  "tw-leading-5",
1476
1477
  "tw-font-medium",
1477
- "tw-tracking-[1px]",
1478
+ "tw-tracking-chrome",
1478
1479
  "tw-uppercase",
1479
1480
  // border — legacy (non-argo) chrome uses a fixed radius, not the brand token.
1480
1481
  "tw-rounded",
@@ -2799,6 +2800,7 @@ var Clipboard = ({
2799
2800
  ] });
2800
2801
  };
2801
2802
  var DEFAULT_ICON = /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Copy, {});
2803
+ var DEFAULT_ARIA_LABEL = "Copy";
2802
2804
  var ClipboardButton = ({
2803
2805
  // clipboard props
2804
2806
  text,
@@ -2810,20 +2812,24 @@ var ClipboardButton = ({
2810
2812
  variant = "outline",
2811
2813
  children,
2812
2814
  ...rest
2813
- }) => /* @__PURE__ */ jsxRuntime.jsx(
2814
- Clipboard,
2815
- {
2816
- asChild: true,
2817
- tooltip,
2818
- tooltipPlacement,
2819
- tooltipVariant,
2820
- text,
2821
- children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { ...rest, variant, disabled: !text, children: [
2822
- icon,
2823
- children
2824
- ] })
2825
- }
2826
- );
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
+ };
2827
2833
  var ClipboardInline = ({
2828
2834
  // clipboard props
2829
2835
  text,
@@ -2848,6 +2854,264 @@ var ClipboardInline = ({
2848
2854
  ] })
2849
2855
  }
2850
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
+ };
2851
3115
  var Link = ({
2852
3116
  ref,
2853
3117
  children,
@@ -6782,7 +7046,7 @@ __export(custom_components_exports, {
6782
7046
  NextMonthButton: () => NextMonthButton,
6783
7047
  Option: () => Option,
6784
7048
  PreviousMonthButton: () => PreviousMonthButton,
6785
- Root: () => Root16,
7049
+ Root: () => Root17,
6786
7050
  Select: () => Select,
6787
7051
  Week: () => Week,
6788
7052
  WeekNumber: () => WeekNumber,
@@ -6962,7 +7226,7 @@ function Option(props) {
6962
7226
  function PreviousMonthButton(props) {
6963
7227
  return React26__default.default.createElement("button", { ...props });
6964
7228
  }
6965
- function Root16(props) {
7229
+ function Root17(props) {
6966
7230
  const { rootRef, ...rest } = props;
6967
7231
  return React26__default.default.createElement("div", { ...rest, ref: rootRef });
6968
7232
  }
@@ -9043,11 +9307,23 @@ var inputGroupVariants = classVarianceAuthority.cva(
9043
9307
  off: ["has-[:is(input,textarea):focus]:!tw-ring-0"]
9044
9308
  },
9045
9309
  variant: {
9046
- primary: ["tw-bg-white", "has-[:is(input,textarea):disabled]:tw-opacity-40"],
9310
+ primary: [
9311
+ "tw-bg-white",
9312
+ "has-[:is(input,textarea):disabled]:tw-opacity-40",
9313
+ // aria-invalid on the control surfaces the error chrome without a `state` prop — the
9314
+ // accessible path (mirrors the `state="error"` legacy tokens). Higher specificity than
9315
+ // the default focus selector, so it wins without `!important`.
9316
+ "has-[:is(input,textarea)[aria-invalid=true]]:tw-border-error-500",
9317
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-border-error-500",
9318
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-ring-error-200"
9319
+ ],
9047
9320
  secondary: [
9048
9321
  "tw-bg-neutral-100",
9049
9322
  "tw-border-neutral-100",
9050
- "has-[:is(input,textarea):disabled]:tw-opacity-40"
9323
+ "has-[:is(input,textarea):disabled]:tw-opacity-40",
9324
+ "has-[:is(input,textarea)[aria-invalid=true]]:tw-border-error-500",
9325
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-border-error-500",
9326
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-ring-error-200"
9051
9327
  ],
9052
9328
  argo: [
9053
9329
  // argo follows the brand radius token (overrides the static base)
@@ -9058,7 +9334,12 @@ var inputGroupVariants = classVarianceAuthority.cva(
9058
9334
  "tw-text-foreground",
9059
9335
  "has-[:is(input,textarea):disabled]:tw-opacity-50",
9060
9336
  // higher specificity than has-[:is(input,textarea):focus] — prevents focus border on readonly
9061
- "has-[:is(input,textarea)[readonly]:focus]:tw-border-neutral-150"
9337
+ "has-[:is(input,textarea)[readonly]:focus]:tw-border-neutral-150",
9338
+ // aria-invalid on the control surfaces the error chrome without a `state` prop — the
9339
+ // accessible path (uses the themeable `destructive` status token).
9340
+ "has-[:is(input,textarea)[aria-invalid=true]]:tw-border-destructive",
9341
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-border-destructive",
9342
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-ring-destructive/20"
9062
9343
  ]
9063
9344
  },
9064
9345
  sizing: {
@@ -10013,23 +10294,6 @@ var TimePicker = ({
10013
10294
  )
10014
10295
  ] });
10015
10296
  };
10016
- var Optional = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("tw-text-muted-foreground", className), children: "(optional)" });
10017
- var Label2 = ({ className, children, id, htmlFor, ...rest }) => {
10018
- return /* @__PURE__ */ jsxRuntime.jsx(
10019
- RLabel__namespace.Root,
10020
- {
10021
- ...rest,
10022
- id: id?.toString(),
10023
- htmlFor: htmlFor?.toString(),
10024
- className: cn(
10025
- "tw-m-0 tw-text-foreground tw-font-normal peer-disabled:tw-opacity-50",
10026
- className
10027
- ),
10028
- children
10029
- }
10030
- );
10031
- };
10032
- Label2.Optional = Optional;
10033
10297
  var FieldBoxDescription = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
10034
10298
  "span",
10035
10299
  {
@@ -11217,12 +11481,29 @@ var variants4 = classVarianceAuthority.cva(
11217
11481
  ],
11218
11482
  variants: {
11219
11483
  variant: {
11220
- primary: ["tw-bg-white", "disabled:tw-opacity-40", "aria-disabled:tw-opacity-40"],
11484
+ primary: [
11485
+ "tw-bg-white",
11486
+ "disabled:tw-opacity-40",
11487
+ "aria-disabled:tw-opacity-40",
11488
+ // aria-invalid on the trigger surfaces the error chrome without a `state` prop — the
11489
+ // accessible path (mirrors the `state="error"` legacy tokens). The extra attribute
11490
+ // selector outranks the default focus/open state, so it wins without `!important`.
11491
+ "aria-[invalid=true]:tw-border-error-500",
11492
+ "aria-[invalid=true]:focus:tw-border-error-500",
11493
+ "aria-[invalid=true]:focus:tw-ring-error-200",
11494
+ "aria-[invalid=true]:data-[state=open]:tw-border-error-500",
11495
+ "aria-[invalid=true]:data-[state=open]:tw-ring-error-200"
11496
+ ],
11221
11497
  secondary: [
11222
11498
  "tw-bg-neutral-100",
11223
11499
  "tw-border-neutral-100",
11224
11500
  "disabled:tw-opacity-40",
11225
- "aria-disabled:tw-opacity-40"
11501
+ "aria-disabled:tw-opacity-40",
11502
+ "aria-[invalid=true]:tw-border-error-500",
11503
+ "aria-[invalid=true]:focus:tw-border-error-500",
11504
+ "aria-[invalid=true]:focus:tw-ring-error-200",
11505
+ "aria-[invalid=true]:data-[state=open]:tw-border-error-500",
11506
+ "aria-[invalid=true]:data-[state=open]:tw-ring-error-200"
11226
11507
  ],
11227
11508
  argo: [
11228
11509
  // muted filled input surface — gray, distinct from white containers; not the app-background token
@@ -11232,7 +11513,14 @@ var variants4 = classVarianceAuthority.cva(
11232
11513
  "tw-rounded-[var(--radius-lg,0.25rem)]",
11233
11514
  "tw-text-foreground",
11234
11515
  "disabled:tw-opacity-50",
11235
- "aria-disabled:tw-opacity-50"
11516
+ "aria-disabled:tw-opacity-50",
11517
+ // aria-invalid on the trigger surfaces the error chrome without a `state` prop — the
11518
+ // accessible path (uses the themeable `destructive` status token).
11519
+ "aria-[invalid=true]:tw-border-destructive",
11520
+ "aria-[invalid=true]:focus:tw-border-destructive",
11521
+ "aria-[invalid=true]:focus:tw-ring-destructive/20",
11522
+ "aria-[invalid=true]:data-[state=open]:tw-border-destructive",
11523
+ "aria-[invalid=true]:data-[state=open]:tw-ring-destructive/20"
11236
11524
  ]
11237
11525
  },
11238
11526
  sizing: {
@@ -11284,7 +11572,7 @@ var SelectTrigger = ({
11284
11572
  ...props,
11285
11573
  children: [
11286
11574
  /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Value, { placeholder }),
11287
- /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.ChevronDown, { className: "tw-size-5 tw-text-muted-foreground" }) })
11575
+ /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.ChevronDown, { className: "tw-size-4 tw-text-muted-foreground" }) })
11288
11576
  ]
11289
11577
  }
11290
11578
  );
@@ -11609,12 +11897,14 @@ var badgeRootVariants = classVarianceAuthority.cva(
11609
11897
  "tw-h-fit",
11610
11898
  "tw-shrink-0",
11611
11899
  "tw-overflow-hidden",
11612
- // text
11900
+ // text — chrome weight/tracking are brand-overridable tokens
11901
+ // (`--font-weight-medium` / `--letter-spacing-chrome`); casing lives on the
11902
+ // `default` variant below via `tw-uppercase`.
11613
11903
  "tw-whitespace-pre-wrap",
11614
11904
  "tw-break-normal",
11615
11905
  "tw-text-xs",
11616
11906
  "tw-font-medium",
11617
- "tw-tracking-[1px]",
11907
+ "tw-tracking-chrome",
11618
11908
  "tw-text-center",
11619
11909
  "tw-underline",
11620
11910
  // content
@@ -13061,18 +13351,12 @@ var TimeInput = ({
13061
13351
  }
13062
13352
  );
13063
13353
  };
13064
- var InputOtpVariantContext = React26.createContext({
13065
- sizing: "md",
13066
- state: "default"
13067
- });
13068
- var useInputOtpVariant = () => React26.use(InputOtpVariantContext);
13069
- var useInputOtpRenderContext = () => React26.use(inputOtp.OTPInputContext);
13070
- var InputOtpGroup = ({
13354
+ var OtpInputGroup = ({
13071
13355
  ref,
13072
13356
  className,
13073
13357
  ...props
13074
13358
  }) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("tw-flex tw-items-center tw-gap-2", className), ...props });
13075
- var InputOtpSeparator = ({
13359
+ var OtpInputSeparator = ({
13076
13360
  ref,
13077
13361
  children,
13078
13362
  className,
@@ -13088,61 +13372,46 @@ var InputOtpSeparator = ({
13088
13372
  children: children ?? /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Minus, { className: "tw-size-4" })
13089
13373
  }
13090
13374
  );
13091
- var slotVariants = classVarianceAuthority.cva(
13092
- [
13093
- "tw-relative",
13094
- "tw-flex",
13095
- "tw-items-center",
13096
- "tw-justify-center",
13097
- "tw-border",
13098
- "tw-border-input",
13099
- // muted filled input surface — gray, distinct from white containers; not the app-background token
13100
- "tw-bg-muted",
13101
- "tw-text-foreground",
13102
- "tw-font-medium",
13103
- "tw-tabular-nums",
13104
- "tw-rounded-lg",
13105
- "tw-transition",
13106
- "tw-outline-none",
13107
- // active slot sits above its neighbours so its ring isn't clipped
13108
- "data-[active=true]:tw-z-10",
13109
- "data-[active=true]:tw-border-primary",
13110
- "data-[active=true]:tw-ring-2",
13111
- "data-[active=true]:tw-ring-ring/50"
13112
- ],
13113
- {
13114
- defaultVariants: {
13115
- sizing: "md",
13116
- state: "default"
13117
- },
13118
- variants: {
13119
- sizing: {
13120
- sm: ["tw-h-8", "tw-w-8", "tw-text-sm"],
13121
- md: ["tw-h-9", "tw-w-9", "tw-text-base"],
13122
- lg: ["tw-h-10", "tw-w-10", "tw-text-lg"]
13123
- },
13124
- // `!` forces the border colour over the base `tw-border-input` once tailwind-merge dedupes.
13125
- // Matches the pattern InputGroup uses for its argo error state.
13126
- state: {
13127
- default: [],
13128
- error: [
13129
- "!tw-border-destructive",
13130
- "tw-bg-destructive/5",
13131
- "data-[active=true]:!tw-border-destructive",
13132
- "data-[active=true]:tw-ring-destructive/40"
13133
- ]
13134
- }
13135
- }
13136
- }
13137
- );
13138
- var InputOtpSlot = ({
13375
+ var slotClassName = [
13376
+ // layout
13377
+ "tw-relative",
13378
+ "tw-flex",
13379
+ "tw-items-center",
13380
+ "tw-justify-center",
13381
+ "tw-font-medium",
13382
+ "tw-tabular-nums",
13383
+ "tw-outline-none",
13384
+ "tw-transition",
13385
+ // resting chrome — always-visible input border on a muted fill (matches InputGroup)
13386
+ "tw-border",
13387
+ "tw-border-solid",
13388
+ "tw-border-input",
13389
+ "tw-bg-muted",
13390
+ "tw-text-foreground",
13391
+ "tw-rounded-[var(--radius-lg,0.25rem)]",
13392
+ // focus — the active slot mirrors InputGroup's argo focus ring; z-10 so the ring isn't clipped
13393
+ "data-[active=true]:tw-z-10",
13394
+ "data-[active=true]:tw-border-primary",
13395
+ "data-[active=true]:tw-ring-4",
13396
+ "data-[active=true]:tw-ring-ring/50",
13397
+ // size — from `data-size` on the group/otp container
13398
+ "group-data-[size=sm]/otp:tw-h-8 group-data-[size=sm]/otp:tw-w-8 group-data-[size=sm]/otp:tw-text-sm",
13399
+ "group-data-[size=md]/otp:tw-h-9 group-data-[size=md]/otp:tw-w-9 group-data-[size=md]/otp:tw-text-base",
13400
+ "group-data-[size=lg]/otp:tw-h-10 group-data-[size=lg]/otp:tw-w-10 group-data-[size=lg]/otp:tw-text-lg",
13401
+ // error — from `aria-invalid` on the OTP input (mirrors InputGroup argo error chrome). `!` beats
13402
+ // the base/active border once tailwind-merge dedupes.
13403
+ "group-has-[input[aria-invalid=true]]/otp:!tw-border-destructive",
13404
+ "group-has-[input[aria-invalid=true]]/otp:data-[active=true]:!tw-border-destructive",
13405
+ "group-has-[input[aria-invalid=true]]/otp:data-[active=true]:tw-ring-destructive/20"
13406
+ ];
13407
+ var OtpInputSlot = ({
13139
13408
  ref,
13140
13409
  index,
13141
13410
  className,
13142
13411
  ...props
13143
13412
  }) => {
13144
- const { slots } = useInputOtpRenderContext();
13145
- const { sizing, state } = useInputOtpVariant();
13413
+ const { slots } = React26.use(inputOtp.OTPInputContext);
13414
+ if (!slots) throw new Error("<OtpInput.Slot> must be rendered inside <OtpInput>.");
13146
13415
  const slot = slots[index];
13147
13416
  const char = slot?.char ?? null;
13148
13417
  const isActive = slot?.isActive ?? false;
@@ -13153,7 +13422,7 @@ var InputOtpSlot = ({
13153
13422
  ref,
13154
13423
  "data-active": isActive || void 0,
13155
13424
  "data-slot-index": index,
13156
- className: cn(slotVariants({ sizing, state }), className),
13425
+ className: cn(slotClassName, className),
13157
13426
  ...props,
13158
13427
  children: [
13159
13428
  char,
@@ -13172,19 +13441,19 @@ var InputOtpSlot = ({
13172
13441
  var Root23 = ({
13173
13442
  ref,
13174
13443
  sizing = "md",
13175
- state = "default",
13176
13444
  pattern = inputOtp.REGEXP_ONLY_DIGITS,
13177
13445
  containerClassName,
13178
13446
  className,
13179
13447
  children,
13448
+ "aria-invalid": ariaInvalid,
13180
13449
  ...rest
13181
- }) => /* @__PURE__ */ jsxRuntime.jsx(InputOtpVariantContext, { value: { sizing, state }, children: /* @__PURE__ */ jsxRuntime.jsx(
13450
+ }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-group/otp tw-w-fit", "data-size": sizing, children: /* @__PURE__ */ jsxRuntime.jsx(
13182
13451
  inputOtp.OTPInput,
13183
13452
  {
13184
13453
  ...rest,
13185
13454
  ref,
13186
13455
  pattern,
13187
- "aria-invalid": state === "error" || void 0,
13456
+ "aria-invalid": ariaInvalid,
13188
13457
  containerClassName: cn(
13189
13458
  "tw-flex tw-items-center tw-gap-2 has-[:disabled]:tw-opacity-50",
13190
13459
  containerClassName
@@ -13193,20 +13462,11 @@ var Root23 = ({
13193
13462
  children
13194
13463
  }
13195
13464
  ) });
13196
- var InputOtp = Object.assign(Root23, {
13197
- Group: InputOtpGroup,
13198
- Slot: InputOtpSlot,
13199
- Separator: InputOtpSeparator
13465
+ var OtpInput = Object.assign(Root23, {
13466
+ Group: OtpInputGroup,
13467
+ Slot: OtpInputSlot,
13468
+ Separator: OtpInputSeparator
13200
13469
  });
13201
-
13202
- // src/blocks/InputOtp/index.ts
13203
- var useInputOtpContext = () => {
13204
- const ctx = React26.use(inputOtp.OTPInputContext);
13205
- if (!ctx.slots) {
13206
- throw new Error("useInputOtpContext must be used inside <InputOtp>.");
13207
- }
13208
- return ctx;
13209
- };
13210
13470
  var SearchInput = ({
13211
13471
  ref,
13212
13472
  // group props
@@ -15180,6 +15440,18 @@ var FormGroupColorInput = ({
15180
15440
  const { state } = useFormGroupContext();
15181
15441
  return /* @__PURE__ */ jsxRuntime.jsx(ColorInput, { state, ...props, ref });
15182
15442
  };
15443
+ var toMessage = (entry) => typeof entry === "string" ? entry : entry?.message;
15444
+ var FormGroupError = ({ children, className, errors, ...rest }) => {
15445
+ const content = React26.useMemo(() => {
15446
+ if (children) return children;
15447
+ const messages = (errors ?? []).map(toMessage).filter((message2) => !!message2);
15448
+ if (messages.length === 0) return null;
15449
+ if (messages.length === 1) return messages[0];
15450
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "tw-m-0 tw-flex tw-list-disc tw-flex-col tw-gap-0 tw-pl-4", children: messages.map((message2, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: message2 }, index)) });
15451
+ }, [children, errors]);
15452
+ if (!content) return null;
15453
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...rest, role: "alert", className: cn("tw-m-0 tw-text-xs tw-text-destructive", className), children: content });
15454
+ };
15183
15455
  var helpVariants = classVarianceAuthority.cva(["tw-m-0", "tw-text-xs"], {
15184
15456
  defaultVariants: {
15185
15457
  state: "default"
@@ -15187,18 +15459,17 @@ var helpVariants = classVarianceAuthority.cva(["tw-m-0", "tw-text-xs"], {
15187
15459
  variants: {
15188
15460
  state: {
15189
15461
  default: ["tw-text-muted-foreground"],
15190
- error: ["tw-text-destructive"],
15191
15462
  warning: ["tw-text-warning"]
15192
15463
  }
15193
15464
  }
15194
15465
  });
15195
- var HelpBlock = ({ children, className, state = "default", testId }) => {
15466
+ var HelpBlock = ({ children, className, state = "default", ...rest }) => {
15196
15467
  if (!children) return null;
15197
- return /* @__PURE__ */ jsxRuntime.jsx("p", { "data-testid": testId, className: helpVariants({ state, className }), children });
15468
+ return /* @__PURE__ */ jsxRuntime.jsx("p", { ...rest, className: helpVariants({ state, className }), children });
15198
15469
  };
15199
15470
  var FormGroupHelp = ({ children, ...rest }) => {
15200
15471
  const formGroupContext = useFormGroupContext();
15201
- return /* @__PURE__ */ jsxRuntime.jsx(HelpBlock, { state: formGroupContext.state, ...rest, children });
15472
+ return /* @__PURE__ */ jsxRuntime.jsx(HelpBlock, { state: formGroupContext.state === "warning" ? "warning" : "default", ...rest, children });
15202
15473
  };
15203
15474
  var FormGroupNumberInput = ({
15204
15475
  ref,
@@ -15218,10 +15489,11 @@ var FormGroupTextInput = ({
15218
15489
  const { state } = useFormGroupContext();
15219
15490
  return /* @__PURE__ */ jsxRuntime.jsx(TextInput, { state, ...props, ref });
15220
15491
  };
15221
- var FormGroup = ({ className, children, state, testId }) => {
15222
- return /* @__PURE__ */ jsxRuntime.jsx(FormGroupProvider, { value: { state }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": testId, className: cn("tw-flex tw-flex-col tw-gap-1", className), children }) });
15492
+ var FormGroup = ({ className, children, state, ...rest }) => {
15493
+ return /* @__PURE__ */ jsxRuntime.jsx(FormGroupProvider, { value: { state }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...rest, className: cn("tw-flex tw-flex-col tw-gap-1", className), children }) });
15223
15494
  };
15224
15495
  FormGroup.Help = FormGroupHelp;
15496
+ FormGroup.Error = FormGroupError;
15225
15497
  FormGroup.TextInput = FormGroupTextInput;
15226
15498
  FormGroup.NumberInput = FormGroupNumberInput;
15227
15499
  FormGroup.ColorInput = FormGroupColorInput;
@@ -16374,6 +16646,12 @@ var PromptInputCommands = ({ items, open, onSelect, filterValue, children }) =>
16374
16646
  children
16375
16647
  ] });
16376
16648
  };
16649
+ var ARIA_LABEL_BY_STATUS = {
16650
+ ready: "Send message",
16651
+ streaming: "Stop",
16652
+ interrupted: "Continue",
16653
+ submitted: "Sending\u2026"
16654
+ };
16377
16655
  var PromptInputSubmit = ({
16378
16656
  ref,
16379
16657
  disabled,
@@ -16396,6 +16674,7 @@ var PromptInputSubmit = ({
16396
16674
  ref,
16397
16675
  type: "submit",
16398
16676
  disabled,
16677
+ "aria-label": ARIA_LABEL_BY_STATUS[status],
16399
16678
  size: "icon-sm",
16400
16679
  variant: "invisible",
16401
16680
  isLoading: status === "submitted",
@@ -17842,7 +18121,7 @@ var cardTitleClassnames = cn(
17842
18121
  "tw-text-base",
17843
18122
  "tw-text-card-foreground"
17844
18123
  );
17845
- 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 });
17846
18125
  var Card = ({
17847
18126
  children,
17848
18127
  className,
@@ -18444,6 +18723,11 @@ var tokensToCssVars = ({
18444
18723
  vars.set("--font-sans", typography?.fontFamily?.trim() || void 0);
18445
18724
  vars.set("--font-display", typography?.fontDisplay?.trim() || void 0);
18446
18725
  vars.set("--font-mono", typography?.fontMono?.trim() || void 0);
18726
+ vars.set("--font-weight-normal", typography?.weight?.normal);
18727
+ vars.set("--font-weight-medium", typography?.weight?.medium);
18728
+ vars.set("--font-weight-semibold", typography?.weight?.semibold);
18729
+ vars.set("--font-weight-bold", typography?.weight?.bold);
18730
+ vars.set("--letter-spacing-chrome", typography?.letterSpacing?.chrome);
18447
18731
  vars.set("--radius-sm", radii?.sm);
18448
18732
  vars.set("--radius-md", radii?.md);
18449
18733
  vars.set("--radius-lg", radii?.lg);
@@ -22985,84 +23269,179 @@ var SubmitButton = ({ children = "Submit", ...buttonProps }) => {
22985
23269
  }
22986
23270
  );
22987
23271
  };
22988
- var errorMessage = (field) => {
22989
- const first = field.state.meta.errors[0];
22990
- if (!first) return void 0;
22991
- if (typeof first === "string") return first;
22992
- if (typeof first === "object" && first !== null && "message" in first) {
22993
- const message2 = first.message;
22994
- return typeof message2 === "string" ? message2 : void 0;
22995
- }
22996
- return void 0;
22997
- };
22998
- var FieldShell = ({ field, label, required, help, className, children }) => {
22999
- const error = errorMessage(field);
23000
- const showError = field.state.meta.isTouched && !!error;
23001
- return /* @__PURE__ */ jsxRuntime.jsxs(FormGroup, { className, state: showError ? "error" : void 0, children: [
23002
- label && /* @__PURE__ */ jsxRuntime.jsxs(Label2, { htmlFor: field.name, children: [
23003
- label,
23004
- required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-ml-0.5 tw-text-primary", children: "*" })
23272
+ var FieldItem = ({
23273
+ label,
23274
+ required,
23275
+ requiredMark = "required",
23276
+ help,
23277
+ tooltip,
23278
+ className,
23279
+ "aria-describedby": ariaDescribedBy,
23280
+ children
23281
+ }) => {
23282
+ const field = useFieldContext();
23283
+ const { errors, isTouched } = field.state.meta;
23284
+ const isInvalid = isTouched && errors.length > 0;
23285
+ const errorId = `${field.name}-error`;
23286
+ const descriptionId = `${field.name}-description`;
23287
+ const describedBy = [ariaDescribedBy, !!help && descriptionId, isInvalid && errorId].filter(Boolean).join(" ") || void 0;
23288
+ return /* @__PURE__ */ jsxRuntime.jsxs(FormGroup, { className, children: [
23289
+ label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [
23290
+ /* @__PURE__ */ jsxRuntime.jsxs(Label2, { htmlFor: field.name, children: [
23291
+ label,
23292
+ requiredMark === "required" && required && /* @__PURE__ */ jsxRuntime.jsx(Label2.Required, {}),
23293
+ requiredMark === "optional" && !required && /* @__PURE__ */ jsxRuntime.jsx(Label2.Optional, {})
23294
+ ] }),
23295
+ tooltip && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { tooltip, placement: "top", triggerAsChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
23296
+ "button",
23297
+ {
23298
+ type: "button",
23299
+ "aria-label": typeof label === "string" ? `More information about ${label}` : "More information",
23300
+ className: "tailwindcss-preflight tw-text-muted-foreground focus:tw-outline-none focus-visible:tw-text-primary",
23301
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Info, { className: "tw-size-3" })
23302
+ }
23303
+ ) })
23005
23304
  ] }),
23006
- children,
23007
- showError ? /* @__PURE__ */ jsxRuntime.jsx(FormGroup.Help, { children: error }) : help && /* @__PURE__ */ jsxRuntime.jsx(FormGroup.Help, { children: help })
23305
+ children({
23306
+ id: field.name,
23307
+ name: field.name,
23308
+ "aria-required": required || void 0,
23309
+ "aria-invalid": isInvalid || void 0,
23310
+ "aria-describedby": describedBy
23311
+ }),
23312
+ (help || isInvalid) && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
23313
+ help && /* @__PURE__ */ jsxRuntime.jsx(FormGroup.Help, { id: descriptionId, children: help }),
23314
+ isInvalid && /* @__PURE__ */ jsxRuntime.jsx(FormGroup.Error, { id: errorId, errors })
23315
+ ] })
23008
23316
  ] });
23009
23317
  };
23010
- var CheckboxField = ({ label, help, className, children, ...checkboxProps }) => {
23318
+ var CheckboxField = ({ className, children, ...checkboxProps }) => {
23011
23319
  const field = useFieldContext();
23012
- return /* @__PURE__ */ jsxRuntime.jsx(FieldShell, { field, help, className, children: /* @__PURE__ */ jsxRuntime.jsx(
23320
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldItem, { className, children: (control) => /* @__PURE__ */ jsxRuntime.jsx(
23013
23321
  Checkbox,
23014
23322
  {
23015
- id: field.name,
23016
- name: field.name,
23323
+ ...checkboxProps,
23324
+ ...control,
23017
23325
  checked: field.state.value ?? false,
23018
- onCheckedChange: (checked) => {
23019
- field.handleChange(checked === true);
23020
- },
23326
+ onCheckedChange: (checked) => field.handleChange(checked === true),
23021
23327
  onBlur: field.handleBlur,
23022
- ...checkboxProps,
23023
- children: children ?? label
23328
+ children
23024
23329
  }
23025
23330
  ) });
23026
23331
  };
23027
- var NumberField = ({ label, required, help, className, ...inputProps }) => {
23332
+ var NumberField = ({
23333
+ label,
23334
+ required,
23335
+ requiredMark,
23336
+ help,
23337
+ tooltip,
23338
+ className,
23339
+ "aria-describedby": ariaDescribedBy,
23340
+ ...inputProps
23341
+ }) => {
23028
23342
  const field = useFieldContext();
23029
- return /* @__PURE__ */ jsxRuntime.jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsxRuntime.jsx(
23030
- FormGroup.NumberInput,
23343
+ return /* @__PURE__ */ jsxRuntime.jsx(
23344
+ FieldItem,
23031
23345
  {
23032
- id: field.name,
23033
- name: field.name,
23034
- value: field.state.value ?? null,
23035
- onValueChange: (value) => {
23036
- field.handleChange(value);
23037
- },
23038
- onBlur: field.handleBlur,
23039
- ...inputProps
23346
+ label,
23347
+ required,
23348
+ requiredMark,
23349
+ help,
23350
+ tooltip,
23351
+ className,
23352
+ "aria-describedby": ariaDescribedBy,
23353
+ children: (control) => /* @__PURE__ */ jsxRuntime.jsx(
23354
+ NumberInput,
23355
+ {
23356
+ ...inputProps,
23357
+ ...control,
23358
+ value: field.state.value ?? null,
23359
+ onValueChange: field.handleChange,
23360
+ onBlur: field.handleBlur
23361
+ }
23362
+ )
23040
23363
  }
23041
- ) });
23364
+ );
23042
23365
  };
23043
- var PasswordField = ({ label, required, help, className, ...inputProps }) => {
23366
+ var OtpInputField = ({
23367
+ label,
23368
+ required,
23369
+ requiredMark,
23370
+ help,
23371
+ tooltip,
23372
+ className,
23373
+ "aria-describedby": ariaDescribedBy,
23374
+ maxLength,
23375
+ ...otpProps
23376
+ }) => {
23044
23377
  const field = useFieldContext();
23045
- const showError = field.state.meta.isTouched && field.state.meta.errors.length > 0;
23046
- return /* @__PURE__ */ jsxRuntime.jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsxRuntime.jsx(
23047
- PasswordInput,
23378
+ return /* @__PURE__ */ jsxRuntime.jsx(
23379
+ FieldItem,
23048
23380
  {
23049
- id: field.name,
23050
- name: field.name,
23051
- value: field.state.value ?? "",
23052
- state: showError ? "error" : void 0,
23053
- onValueChange: (value) => {
23054
- field.handleChange(value);
23055
- },
23056
- onBlur: field.handleBlur,
23057
- ...inputProps
23381
+ label,
23382
+ required,
23383
+ requiredMark,
23384
+ help,
23385
+ tooltip,
23386
+ className,
23387
+ "aria-describedby": ariaDescribedBy,
23388
+ children: (control) => /* @__PURE__ */ jsxRuntime.jsx(
23389
+ OtpInput,
23390
+ {
23391
+ ...otpProps,
23392
+ ...control,
23393
+ maxLength,
23394
+ value: field.state.value ?? "",
23395
+ onChange: field.handleChange,
23396
+ onBlur: field.handleBlur,
23397
+ children: /* @__PURE__ */ jsxRuntime.jsx(OtpInput.Group, { children: Array.from({ length: maxLength }, (_, index) => /* @__PURE__ */ jsxRuntime.jsx(OtpInput.Slot, { index }, index)) })
23398
+ }
23399
+ )
23058
23400
  }
23059
- ) });
23401
+ );
23402
+ };
23403
+ var PasswordField = ({
23404
+ label,
23405
+ required,
23406
+ requiredMark,
23407
+ help,
23408
+ tooltip,
23409
+ className,
23410
+ "aria-describedby": ariaDescribedBy,
23411
+ ...inputProps
23412
+ }) => {
23413
+ const field = useFieldContext();
23414
+ return /* @__PURE__ */ jsxRuntime.jsx(
23415
+ FieldItem,
23416
+ {
23417
+ label,
23418
+ required,
23419
+ requiredMark,
23420
+ help,
23421
+ tooltip,
23422
+ className,
23423
+ "aria-describedby": ariaDescribedBy,
23424
+ children: (control) => /* @__PURE__ */ jsxRuntime.jsx(
23425
+ PasswordInput,
23426
+ {
23427
+ ...inputProps,
23428
+ ...control,
23429
+ value: field.state.value ?? "",
23430
+ onValueChange: field.handleChange,
23431
+ onBlur: field.handleBlur
23432
+ }
23433
+ )
23434
+ }
23435
+ );
23060
23436
  };
23061
23437
  var SelectField = ({
23062
23438
  label,
23063
23439
  required,
23440
+ requiredMark,
23064
23441
  help,
23442
+ tooltip,
23065
23443
  className,
23444
+ "aria-describedby": ariaDescribedBy,
23066
23445
  items,
23067
23446
  options,
23068
23447
  placeholder,
@@ -23074,80 +23453,125 @@ var SelectField = ({
23074
23453
  }) => {
23075
23454
  const field = useFieldContext();
23076
23455
  const resolved = items ?? options ?? [];
23077
- return /* @__PURE__ */ jsxRuntime.jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsxRuntime.jsxs(
23078
- Select2.Root,
23456
+ return /* @__PURE__ */ jsxRuntime.jsx(
23457
+ FieldItem,
23079
23458
  {
23080
- value: field.state.value ?? "",
23081
- onValueChange: (value) => {
23082
- field.handleChange(value);
23083
- },
23084
- ...rootProps,
23085
- children: [
23086
- /* @__PURE__ */ jsxRuntime.jsx(
23087
- Select2.Trigger,
23088
- {
23089
- id: field.name,
23090
- className: triggerClassName ?? "tw-w-full",
23091
- placeholder,
23092
- variant,
23093
- state,
23094
- sizing,
23095
- onBlur: field.handleBlur
23096
- }
23097
- ),
23098
- /* @__PURE__ */ jsxRuntime.jsx(Select2.Content, { children: resolved.map((option) => /* @__PURE__ */ jsxRuntime.jsx(Select2.Item, { value: option.value, children: option.label }, option.value)) })
23099
- ]
23459
+ label,
23460
+ required,
23461
+ requiredMark,
23462
+ help,
23463
+ tooltip,
23464
+ className,
23465
+ "aria-describedby": ariaDescribedBy,
23466
+ children: (control) => /* @__PURE__ */ jsxRuntime.jsxs(
23467
+ Select2.Root,
23468
+ {
23469
+ value: field.state.value ?? "",
23470
+ onValueChange: (value) => {
23471
+ field.handleChange(value);
23472
+ },
23473
+ ...rootProps,
23474
+ children: [
23475
+ /* @__PURE__ */ jsxRuntime.jsx(
23476
+ Select2.Trigger,
23477
+ {
23478
+ ...control,
23479
+ className: triggerClassName ?? "tw-w-full",
23480
+ placeholder,
23481
+ variant,
23482
+ state,
23483
+ sizing,
23484
+ onBlur: field.handleBlur
23485
+ }
23486
+ ),
23487
+ /* @__PURE__ */ jsxRuntime.jsx(Select2.Content, { children: resolved.map((option) => /* @__PURE__ */ jsxRuntime.jsx(Select2.Item, { value: option.value, children: option.label }, option.value)) })
23488
+ ]
23489
+ }
23490
+ )
23100
23491
  }
23101
- ) });
23492
+ );
23102
23493
  };
23103
- var SwitchField = ({ label, help, className, children, ...switchProps }) => {
23494
+ var SwitchField = ({ className, children, ...switchProps }) => {
23104
23495
  const field = useFieldContext();
23105
- return /* @__PURE__ */ jsxRuntime.jsx(FieldShell, { field, help, className, children: /* @__PURE__ */ jsxRuntime.jsx(
23496
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldItem, { className, children: (control) => /* @__PURE__ */ jsxRuntime.jsx(
23106
23497
  Switch,
23107
23498
  {
23108
- id: field.name,
23109
- name: field.name,
23499
+ ...switchProps,
23500
+ ...control,
23110
23501
  checked: field.state.value ?? false,
23111
- onCheckedChange: (checked) => {
23112
- field.handleChange(checked);
23113
- },
23502
+ onCheckedChange: field.handleChange,
23114
23503
  onBlur: field.handleBlur,
23115
- ...switchProps,
23116
- children: children ?? label
23504
+ children
23117
23505
  }
23118
23506
  ) });
23119
23507
  };
23120
- var TextAreaField = ({ label, required, help, className, ...inputProps }) => {
23508
+ var TextareaField = ({
23509
+ label,
23510
+ required,
23511
+ requiredMark,
23512
+ help,
23513
+ tooltip,
23514
+ className,
23515
+ "aria-describedby": ariaDescribedBy,
23516
+ ...inputProps
23517
+ }) => {
23121
23518
  const field = useFieldContext();
23122
- return /* @__PURE__ */ jsxRuntime.jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsxRuntime.jsx(
23123
- FormGroup.Textarea,
23519
+ return /* @__PURE__ */ jsxRuntime.jsx(
23520
+ FieldItem,
23124
23521
  {
23125
- id: field.name,
23126
- name: field.name,
23127
- value: field.state.value ?? "",
23128
- onValueChange: (value) => {
23129
- field.handleChange(value);
23130
- },
23131
- onBlur: field.handleBlur,
23132
- ...inputProps
23522
+ label,
23523
+ required,
23524
+ requiredMark,
23525
+ help,
23526
+ tooltip,
23527
+ className,
23528
+ "aria-describedby": ariaDescribedBy,
23529
+ children: (control) => /* @__PURE__ */ jsxRuntime.jsx(
23530
+ Textarea,
23531
+ {
23532
+ ...inputProps,
23533
+ ...control,
23534
+ value: field.state.value ?? "",
23535
+ onValueChange: field.handleChange,
23536
+ onBlur: field.handleBlur
23537
+ }
23538
+ )
23133
23539
  }
23134
- ) });
23540
+ );
23135
23541
  };
23136
- var TextField = ({ label, required, help, className, ...inputProps }) => {
23542
+ var TextField = ({
23543
+ label,
23544
+ required,
23545
+ requiredMark,
23546
+ help,
23547
+ tooltip,
23548
+ className,
23549
+ "aria-describedby": ariaDescribedBy,
23550
+ ...inputProps
23551
+ }) => {
23137
23552
  const field = useFieldContext();
23138
- return /* @__PURE__ */ jsxRuntime.jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsxRuntime.jsx(
23139
- FormGroup.TextInput,
23553
+ return /* @__PURE__ */ jsxRuntime.jsx(
23554
+ FieldItem,
23140
23555
  {
23141
- id: field.name,
23142
- name: field.name,
23143
- value: field.state.value ?? "",
23144
- onChange: (e) => {
23145
- field.handleChange(e.target.value);
23146
- },
23147
- onBlur: field.handleBlur,
23148
- ...inputProps
23556
+ label,
23557
+ required,
23558
+ requiredMark,
23559
+ help,
23560
+ tooltip,
23561
+ className,
23562
+ "aria-describedby": ariaDescribedBy,
23563
+ children: (control) => /* @__PURE__ */ jsxRuntime.jsx(
23564
+ TextInput,
23565
+ {
23566
+ ...inputProps,
23567
+ ...control,
23568
+ value: field.state.value ?? "",
23569
+ onValueChange: field.handleChange,
23570
+ onBlur: field.handleBlur
23571
+ }
23572
+ )
23149
23573
  }
23150
- ) });
23574
+ );
23151
23575
  };
23152
23576
 
23153
23577
  // src/blocks/Form/formHook.ts
@@ -23158,10 +23582,11 @@ var { useAppForm, withForm } = reactForm.createFormHook({
23158
23582
  TextField,
23159
23583
  NumberField,
23160
23584
  PasswordField,
23161
- TextAreaField,
23585
+ TextareaField,
23162
23586
  SelectField,
23163
23587
  CheckboxField,
23164
- SwitchField
23588
+ SwitchField,
23589
+ OtpInputField
23165
23590
  },
23166
23591
  formComponents: {
23167
23592
  FormBody,
@@ -23361,6 +23786,7 @@ exports.CommandInput = CommandInput;
23361
23786
  exports.CommandItem = CommandItem;
23362
23787
  exports.CommandList = CommandList;
23363
23788
  exports.ConflictStatusIndicator = ConflictStatusIndicator;
23789
+ exports.CopyField = CopyField;
23364
23790
  exports.DEFAULT_COLOR_SCHEME = DEFAULT_COLOR_SCHEME;
23365
23791
  exports.DEFAULT_KEBOOLA_BRAND_ID = DEFAULT_BRAND_ID;
23366
23792
  exports.DateInput = DateInput;
@@ -23385,7 +23811,6 @@ exports.HoverCard = HoverCard;
23385
23811
  exports.InlineStepDetail = InlineStepDetail;
23386
23812
  exports.InlineStepLabel = InlineStepLabel;
23387
23813
  exports.InputGroup = InputGroup;
23388
- exports.InputOtp = InputOtp;
23389
23814
  exports.Kbd = Kbd;
23390
23815
  exports.Label = Label2;
23391
23816
  exports.Link = Link;
@@ -23397,6 +23822,7 @@ exports.MultiActionButtonGroup = MultiActionButtonGroup;
23397
23822
  exports.MultiCombobox = MultiCombobox;
23398
23823
  exports.Navbar = Navbar;
23399
23824
  exports.NumberInput = NumberInput;
23825
+ exports.OtpInput = OtpInput;
23400
23826
  exports.PageHeader = PageHeader;
23401
23827
  exports.PageLayout = PageLayout;
23402
23828
  exports.PageToolbar = PageToolbar;
@@ -23470,7 +23896,6 @@ exports.toast = toast;
23470
23896
  exports.useAppForm = useAppForm;
23471
23897
  exports.useArgoDesign = useArgoDesign;
23472
23898
  exports.useAutosizeInput = useAutosizeInput;
23473
- exports.useInputOtpContext = useInputOtpContext;
23474
23899
  exports.useMergeDiff = useMergeDiff;
23475
23900
  exports.useNotification = useNotification;
23476
23901
  exports.useScrollbarPosition = useScrollbarPosition;