@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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Slot, Root as Root$1, Slottable } from '@radix-ui/react-slot';
2
2
  export { Slot } from '@radix-ui/react-slot';
3
3
  import * as lucide_react_star from 'lucide-react';
4
- import React26, { createContext, forwardRef, useMemo, useRef, useEffect, useImperativeHandle, Fragment, use, useState, useReducer, useCallback, useId, useLayoutEffect, Children, useContext, useInsertionEffect, isValidElement } from 'react';
4
+ import React26, { createContext, forwardRef, useMemo, useRef, useEffect, use, useImperativeHandle, Fragment, useState, useReducer, useCallback, useId, useLayoutEffect, Children, useContext, useInsertionEffect, isValidElement } from 'react';
5
5
  import { clsx } from 'clsx';
6
6
  import { extendTailwindMerge } from 'tailwind-merge';
7
7
  import { Root as Root$6, Trigger, Portal, Content, Provider } from '@radix-ui/react-tooltip';
@@ -14,6 +14,7 @@ import { Root, Group, Trigger as Trigger$4 } from '@radix-ui/react-dropdown-menu
14
14
  import * as ScrollAreaPrimitive2 from '@radix-ui/react-scroll-area';
15
15
  import { Root as Root$7 } from '@radix-ui/react-toggle';
16
16
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
17
+ import * as RLabel from '@radix-ui/react-label';
17
18
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
18
19
  import { Root as Root$8, Trigger as Trigger$5, Portal as Portal$1, Content as Content$1, Cancel, Action, Overlay as Overlay$1, Title as Title$1 } from '@radix-ui/react-alert-dialog';
19
20
  import * as DialogPrimitive from '@radix-ui/react-dialog';
@@ -25,7 +26,6 @@ import { Root as Root$a, Trigger as Trigger$3, Portal as Portal$4, Content as Co
25
26
  import { Command as Command$1, CommandInput as CommandInput$1, defaultFilter, useCommandState } from 'cmdk';
26
27
  export { defaultFilter, useCommandState } from 'cmdk';
27
28
  import TextareaAutosize from 'react-textarea-autosize';
28
- import * as RLabel from '@radix-ui/react-label';
29
29
  import { Root as Root$3, Thumb } from '@radix-ui/react-switch';
30
30
  import * as RRadioGroup from '@radix-ui/react-radio-group';
31
31
  import { Item, Indicator as Indicator$2 } from '@radix-ui/react-radio-group';
@@ -1438,11 +1438,12 @@ var variants = cva(
1438
1438
  "tw-items-center",
1439
1439
  "tw-justify-center",
1440
1440
  "tw-gap-2",
1441
- // text
1441
+ // text — chrome weight/tracking are brand-overridable tokens
1442
+ // (`--font-weight-medium` / `--letter-spacing-chrome`); casing stays `tw-uppercase`.
1442
1443
  "tw-text-xs",
1443
1444
  "tw-leading-5",
1444
1445
  "tw-font-medium",
1445
- "tw-tracking-[1px]",
1446
+ "tw-tracking-chrome",
1446
1447
  "tw-uppercase",
1447
1448
  // border — legacy (non-argo) chrome uses a fixed radius, not the brand token.
1448
1449
  "tw-rounded",
@@ -2767,6 +2768,7 @@ var Clipboard = ({
2767
2768
  ] });
2768
2769
  };
2769
2770
  var DEFAULT_ICON = /* @__PURE__ */ jsx(icons_exports.Copy, {});
2771
+ var DEFAULT_ARIA_LABEL = "Copy";
2770
2772
  var ClipboardButton = ({
2771
2773
  // clipboard props
2772
2774
  text,
@@ -2778,20 +2780,24 @@ var ClipboardButton = ({
2778
2780
  variant = "outline",
2779
2781
  children,
2780
2782
  ...rest
2781
- }) => /* @__PURE__ */ jsx(
2782
- Clipboard,
2783
- {
2784
- asChild: true,
2785
- tooltip,
2786
- tooltipPlacement,
2787
- tooltipVariant,
2788
- text,
2789
- children: /* @__PURE__ */ jsxs(Button, { ...rest, variant, disabled: !text, children: [
2790
- icon,
2791
- children
2792
- ] })
2793
- }
2794
- );
2783
+ }) => {
2784
+ const defaultAriaLabel = typeof tooltip === "string" && tooltip.trim() ? tooltip : DEFAULT_ARIA_LABEL;
2785
+ const ariaLabel = rest["aria-label"] ?? (children == null ? defaultAriaLabel : void 0);
2786
+ return /* @__PURE__ */ jsx(
2787
+ Clipboard,
2788
+ {
2789
+ asChild: true,
2790
+ tooltip,
2791
+ tooltipPlacement,
2792
+ tooltipVariant,
2793
+ text,
2794
+ children: /* @__PURE__ */ jsxs(Button, { ...rest, "aria-label": ariaLabel, variant, disabled: !text, children: [
2795
+ icon,
2796
+ children
2797
+ ] })
2798
+ }
2799
+ );
2800
+ };
2795
2801
  var ClipboardInline = ({
2796
2802
  // clipboard props
2797
2803
  text,
@@ -2816,6 +2822,264 @@ var ClipboardInline = ({
2816
2822
  ] })
2817
2823
  }
2818
2824
  );
2825
+ var CopyContext = createContext(null);
2826
+ var useCopyContext = () => {
2827
+ const ctx = use(CopyContext);
2828
+ if (!ctx) throw new Error("CopyField.* components must be used within a CopyField.Root");
2829
+ return ctx;
2830
+ };
2831
+ var LINE_HEIGHT_REM = 1.25;
2832
+ var VERTICAL_PADDING_REM = 1.25;
2833
+ var CopyBox = ({ className, children }) => {
2834
+ const { copied, handleCopy, mono, minLines, maxLines, boxId, labelId, hasLabel } = useCopyContext();
2835
+ const multiline = maxLines > 1;
2836
+ const multilineStyle = multiline ? {
2837
+ minHeight: `${minLines * LINE_HEIGHT_REM + VERTICAL_PADDING_REM}rem`,
2838
+ maxHeight: `${maxLines * LINE_HEIGHT_REM + VERTICAL_PADDING_REM}rem`
2839
+ } : void 0;
2840
+ const handleKeyDown2 = (event) => {
2841
+ if (event.target !== event.currentTarget) return;
2842
+ if (event.key !== "Enter" && event.key !== " ") return;
2843
+ event.preventDefault();
2844
+ handleCopy();
2845
+ };
2846
+ return /* @__PURE__ */ jsx(Tooltip, { triggerAsChild: true, placement: "top", tooltip: copied ? "Copied" : "Copy", forceShow: copied, children: /* @__PURE__ */ jsx(
2847
+ "div",
2848
+ {
2849
+ role: "button",
2850
+ tabIndex: 0,
2851
+ id: boxId,
2852
+ "aria-labelledby": hasLabel ? labelId : void 0,
2853
+ onClick: handleCopy,
2854
+ onKeyDown: handleKeyDown2,
2855
+ style: multilineStyle,
2856
+ className: cn(
2857
+ "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]",
2858
+ multiline ? "tw-items-start tw-overflow-auto" : "tw-items-center tw-overflow-hidden",
2859
+ mono && "tw-font-mono tw-text-[13px]",
2860
+ className
2861
+ ),
2862
+ children
2863
+ }
2864
+ ) });
2865
+ };
2866
+ var CopyButton = ({ className }) => {
2867
+ const { copied, maxLines } = useCopyContext();
2868
+ return /* @__PURE__ */ jsx(
2869
+ "span",
2870
+ {
2871
+ "aria-hidden": true,
2872
+ className: cn(
2873
+ "tw-pointer-events-none tw-flex tw-shrink-0 tw-items-center tw-text-[#8b8b8b] group-hover:tw-text-[#5c5c5c]",
2874
+ maxLines > 1 && "tw-self-start tw-pt-0.5",
2875
+ className
2876
+ ),
2877
+ children: copied ? /* @__PURE__ */ jsx(icons_exports.Check, { className: "tw-size-4" }) : /* @__PURE__ */ jsx(icons_exports.Copy, { className: "tw-size-4" })
2878
+ }
2879
+ );
2880
+ };
2881
+ var CopyChildren = ({ children, className }) => {
2882
+ const { maxLines } = useCopyContext();
2883
+ const multiline = maxLines > 1;
2884
+ return /* @__PURE__ */ jsx(
2885
+ "span",
2886
+ {
2887
+ className: cn(
2888
+ "tw-min-w-0 tw-flex-1 tw-select-text tw-text-[#3f3f3f]",
2889
+ multiline ? "tw-whitespace-pre-wrap tw-break-words" : "tw-truncate",
2890
+ className
2891
+ ),
2892
+ children
2893
+ }
2894
+ );
2895
+ };
2896
+ var CopyFooter = ({ children, className }) => {
2897
+ if (!children) return null;
2898
+ return /* @__PURE__ */ jsx("p", { className: cn("tw-m-0 tw-text-xs tw-text-muted-foreground", className), children });
2899
+ };
2900
+ var MASK = "*".repeat(12);
2901
+ var CopyHidden = ({ children, revealable = true, className }) => {
2902
+ const { hidden, registerRevealable } = useCopyContext();
2903
+ useEffect(() => {
2904
+ if (!revealable) return void 0;
2905
+ return registerRevealable();
2906
+ }, [revealable, registerRevealable]);
2907
+ const masked = revealable ? hidden : true;
2908
+ return /* @__PURE__ */ jsx("span", { className: cn("tw-select-none", className), children: masked ? MASK : children });
2909
+ };
2910
+ var Optional = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-muted-foreground", className), children: "(optional)" });
2911
+ var Required = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-primary", className), children: "*" });
2912
+ var Label2 = ({ className, children, id, htmlFor, ...rest }) => /* @__PURE__ */ jsx(
2913
+ RLabel.Root,
2914
+ {
2915
+ ...rest,
2916
+ id: id?.toString(),
2917
+ htmlFor: htmlFor?.toString(),
2918
+ className: cn(
2919
+ "tw-m-0 tw-text-foreground tw-font-normal peer-disabled:tw-opacity-50",
2920
+ className
2921
+ ),
2922
+ children
2923
+ }
2924
+ );
2925
+ Label2.Optional = Optional;
2926
+ Label2.Required = Required;
2927
+ var CopyLabel = ({ children, leading, trailing, className }) => {
2928
+ const { labelId, registerLabel } = useCopyContext();
2929
+ useEffect(() => registerLabel(), [registerLabel]);
2930
+ return /* @__PURE__ */ jsxs("div", { className: cn("tw-flex tw-items-center tw-gap-1", className), children: [
2931
+ /* @__PURE__ */ jsx(Label2, { id: labelId, children }),
2932
+ leading,
2933
+ trailing != null && /* @__PURE__ */ jsx("span", { className: "tw-ml-auto tw-flex tw-items-center", children: trailing })
2934
+ ] });
2935
+ };
2936
+ var CopyPrefix = ({ children, className }) => /* @__PURE__ */ jsx(
2937
+ "span",
2938
+ {
2939
+ "aria-hidden": true,
2940
+ className: cn(
2941
+ "tw-shrink-0 tw-select-none tw-self-stretch tw-border-r tw-border-[#e4e4e4] tw-pr-2 tw-text-[#6b6b6b]",
2942
+ className
2943
+ ),
2944
+ children
2945
+ }
2946
+ );
2947
+ var CopyReveal = ({ className }) => {
2948
+ const { hidden, toggleHidden, hasRevealable, maxLines } = useCopyContext();
2949
+ if (!hasRevealable) return null;
2950
+ const handleClick = (event) => {
2951
+ event.stopPropagation();
2952
+ toggleHidden();
2953
+ };
2954
+ return /* @__PURE__ */ jsx(
2955
+ "button",
2956
+ {
2957
+ type: "button",
2958
+ onClick: handleClick,
2959
+ "aria-label": hidden ? "Show value" : "Hide value",
2960
+ className: cn(
2961
+ "tw-flex tw-shrink-0 tw-items-center tw-text-[#8b8b8b] hover:tw-text-[#5c5c5c]",
2962
+ maxLines > 1 && "tw-self-start tw-pt-0.5",
2963
+ className
2964
+ ),
2965
+ children: hidden ? /* @__PURE__ */ jsx(icons_exports.Eye, { className: "tw-size-4" }) : /* @__PURE__ */ jsx(icons_exports.EyeOff, { className: "tw-size-4" })
2966
+ }
2967
+ );
2968
+ };
2969
+ var CopyRoot = ({
2970
+ value,
2971
+ mono = false,
2972
+ onCopy,
2973
+ hiddenByDefault = false,
2974
+ minLines = 1,
2975
+ maxLines,
2976
+ className,
2977
+ children
2978
+ }) => {
2979
+ const [copied, setCopied] = useState(false);
2980
+ const [hidden, setHidden] = useState(hiddenByDefault);
2981
+ const [revealableCount, setRevealableCount] = useState(0);
2982
+ const [labelCount, setLabelCount] = useState(0);
2983
+ const resetTimerRef = useRef(void 0);
2984
+ const generatedId = useId();
2985
+ const labelId = `${generatedId}-label`;
2986
+ const boxId = `${generatedId}-box`;
2987
+ useEffect(() => () => clearTimeout(resetTimerRef.current), []);
2988
+ const handleCopy = useCallback(() => {
2989
+ const selection = window.getSelection();
2990
+ const boxEl = document.getElementById(boxId);
2991
+ if (selection && !selection.isCollapsed && selection.anchorNode && boxEl?.contains(selection.anchorNode)) {
2992
+ return;
2993
+ }
2994
+ copyToClipboard(value).then(() => {
2995
+ onCopy?.();
2996
+ setCopied(true);
2997
+ clearTimeout(resetTimerRef.current);
2998
+ resetTimerRef.current = setTimeout(() => setCopied(false), 1500);
2999
+ }).catch((error) => {
3000
+ console.error("Copy to clipboard failed", error);
3001
+ });
3002
+ }, [value, onCopy, boxId]);
3003
+ const toggleHidden = useCallback(() => setHidden((prev) => !prev), []);
3004
+ const registerRevealable = useCallback(() => {
3005
+ setRevealableCount((count) => count + 1);
3006
+ return () => setRevealableCount((count) => count - 1);
3007
+ }, []);
3008
+ const registerLabel = useCallback(() => {
3009
+ setLabelCount((count) => count + 1);
3010
+ return () => setLabelCount((count) => count - 1);
3011
+ }, []);
3012
+ const contextValue = useMemo(
3013
+ () => ({
3014
+ copied,
3015
+ handleCopy,
3016
+ value,
3017
+ mono,
3018
+ hidden,
3019
+ toggleHidden,
3020
+ registerRevealable,
3021
+ hasRevealable: revealableCount > 0,
3022
+ registerLabel,
3023
+ hasLabel: labelCount > 0,
3024
+ minLines,
3025
+ maxLines: maxLines ?? minLines,
3026
+ labelId,
3027
+ boxId
3028
+ }),
3029
+ [
3030
+ copied,
3031
+ handleCopy,
3032
+ value,
3033
+ mono,
3034
+ hidden,
3035
+ toggleHidden,
3036
+ registerRevealable,
3037
+ revealableCount,
3038
+ registerLabel,
3039
+ labelCount,
3040
+ minLines,
3041
+ maxLines,
3042
+ labelId,
3043
+ boxId
3044
+ ]
3045
+ );
3046
+ return /* @__PURE__ */ jsx(CopyContext, { value: contextValue, children: /* @__PURE__ */ jsx("div", { className: cn("tw-flex tw-w-fit tw-max-w-full tw-flex-col tw-gap-1", className), children }) });
3047
+ };
3048
+ var CopySuffix = ({ children, className }) => /* @__PURE__ */ jsx(
3049
+ "span",
3050
+ {
3051
+ "aria-hidden": true,
3052
+ className: cn(
3053
+ "tw-shrink-0 tw-select-none tw-self-stretch tw-border-l tw-border-[#e4e4e4] tw-pl-2 tw-text-[#6b6b6b]",
3054
+ className
3055
+ ),
3056
+ children
3057
+ }
3058
+ );
3059
+
3060
+ // src/blocks/CopyField/CopyField.tsx
3061
+ var CopyField = {
3062
+ /** Container. Owns the copied `value`, mask state, and copy context. */
3063
+ Root: CopyRoot,
3064
+ /** Visible label above the box, with optional `leading`/`trailing` slots. */
3065
+ Label: CopyLabel,
3066
+ /** The clickable copy target row. */
3067
+ Box: CopyBox,
3068
+ /** Muted, non-selectable prefix addon (not copied). */
3069
+ Prefix: CopyPrefix,
3070
+ /** Displayed value (truncates single-line, wraps multi-line). */
3071
+ Children: CopyChildren,
3072
+ /** Muted, non-selectable suffix addon (not copied). */
3073
+ Suffix: CopySuffix,
3074
+ /** Masks its children with dots; copy still copies the real value. */
3075
+ Hidden: CopyHidden,
3076
+ /** Eye toggle that reveals/masks revealable `CopyField.Hidden` content. */
3077
+ Reveal: CopyReveal,
3078
+ /** Copy affordance icon — shows Copy/Check with feedback. */
3079
+ Button: CopyButton,
3080
+ /** Small helper text below the box. */
3081
+ Footer: CopyFooter
3082
+ };
2819
3083
  var Link = ({
2820
3084
  ref,
2821
3085
  children,
@@ -6750,7 +7014,7 @@ __export(custom_components_exports, {
6750
7014
  NextMonthButton: () => NextMonthButton,
6751
7015
  Option: () => Option,
6752
7016
  PreviousMonthButton: () => PreviousMonthButton,
6753
- Root: () => Root16,
7017
+ Root: () => Root17,
6754
7018
  Select: () => Select,
6755
7019
  Week: () => Week,
6756
7020
  WeekNumber: () => WeekNumber,
@@ -6930,7 +7194,7 @@ function Option(props) {
6930
7194
  function PreviousMonthButton(props) {
6931
7195
  return React26.createElement("button", { ...props });
6932
7196
  }
6933
- function Root16(props) {
7197
+ function Root17(props) {
6934
7198
  const { rootRef, ...rest } = props;
6935
7199
  return React26.createElement("div", { ...rest, ref: rootRef });
6936
7200
  }
@@ -9011,11 +9275,23 @@ var inputGroupVariants = cva(
9011
9275
  off: ["has-[:is(input,textarea):focus]:!tw-ring-0"]
9012
9276
  },
9013
9277
  variant: {
9014
- primary: ["tw-bg-white", "has-[:is(input,textarea):disabled]:tw-opacity-40"],
9278
+ primary: [
9279
+ "tw-bg-white",
9280
+ "has-[:is(input,textarea):disabled]:tw-opacity-40",
9281
+ // aria-invalid on the control surfaces the error chrome without a `state` prop — the
9282
+ // accessible path (mirrors the `state="error"` legacy tokens). Higher specificity than
9283
+ // the default focus selector, so it wins without `!important`.
9284
+ "has-[:is(input,textarea)[aria-invalid=true]]:tw-border-error-500",
9285
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-border-error-500",
9286
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-ring-error-200"
9287
+ ],
9015
9288
  secondary: [
9016
9289
  "tw-bg-neutral-100",
9017
9290
  "tw-border-neutral-100",
9018
- "has-[:is(input,textarea):disabled]:tw-opacity-40"
9291
+ "has-[:is(input,textarea):disabled]:tw-opacity-40",
9292
+ "has-[:is(input,textarea)[aria-invalid=true]]:tw-border-error-500",
9293
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-border-error-500",
9294
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-ring-error-200"
9019
9295
  ],
9020
9296
  argo: [
9021
9297
  // argo follows the brand radius token (overrides the static base)
@@ -9026,7 +9302,12 @@ var inputGroupVariants = cva(
9026
9302
  "tw-text-foreground",
9027
9303
  "has-[:is(input,textarea):disabled]:tw-opacity-50",
9028
9304
  // higher specificity than has-[:is(input,textarea):focus] — prevents focus border on readonly
9029
- "has-[:is(input,textarea)[readonly]:focus]:tw-border-neutral-150"
9305
+ "has-[:is(input,textarea)[readonly]:focus]:tw-border-neutral-150",
9306
+ // aria-invalid on the control surfaces the error chrome without a `state` prop — the
9307
+ // accessible path (uses the themeable `destructive` status token).
9308
+ "has-[:is(input,textarea)[aria-invalid=true]]:tw-border-destructive",
9309
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-border-destructive",
9310
+ "has-[:is(input,textarea)[aria-invalid=true]:focus]:tw-ring-destructive/20"
9030
9311
  ]
9031
9312
  },
9032
9313
  sizing: {
@@ -9981,23 +10262,6 @@ var TimePicker = ({
9981
10262
  )
9982
10263
  ] });
9983
10264
  };
9984
- var Optional = ({ className }) => /* @__PURE__ */ jsx("span", { className: cn("tw-text-muted-foreground", className), children: "(optional)" });
9985
- var Label2 = ({ className, children, id, htmlFor, ...rest }) => {
9986
- return /* @__PURE__ */ jsx(
9987
- RLabel.Root,
9988
- {
9989
- ...rest,
9990
- id: id?.toString(),
9991
- htmlFor: htmlFor?.toString(),
9992
- className: cn(
9993
- "tw-m-0 tw-text-foreground tw-font-normal peer-disabled:tw-opacity-50",
9994
- className
9995
- ),
9996
- children
9997
- }
9998
- );
9999
- };
10000
- Label2.Optional = Optional;
10001
10265
  var FieldBoxDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(
10002
10266
  "span",
10003
10267
  {
@@ -11185,12 +11449,29 @@ var variants4 = cva(
11185
11449
  ],
11186
11450
  variants: {
11187
11451
  variant: {
11188
- primary: ["tw-bg-white", "disabled:tw-opacity-40", "aria-disabled:tw-opacity-40"],
11452
+ primary: [
11453
+ "tw-bg-white",
11454
+ "disabled:tw-opacity-40",
11455
+ "aria-disabled:tw-opacity-40",
11456
+ // aria-invalid on the trigger surfaces the error chrome without a `state` prop — the
11457
+ // accessible path (mirrors the `state="error"` legacy tokens). The extra attribute
11458
+ // selector outranks the default focus/open state, so it wins without `!important`.
11459
+ "aria-[invalid=true]:tw-border-error-500",
11460
+ "aria-[invalid=true]:focus:tw-border-error-500",
11461
+ "aria-[invalid=true]:focus:tw-ring-error-200",
11462
+ "aria-[invalid=true]:data-[state=open]:tw-border-error-500",
11463
+ "aria-[invalid=true]:data-[state=open]:tw-ring-error-200"
11464
+ ],
11189
11465
  secondary: [
11190
11466
  "tw-bg-neutral-100",
11191
11467
  "tw-border-neutral-100",
11192
11468
  "disabled:tw-opacity-40",
11193
- "aria-disabled:tw-opacity-40"
11469
+ "aria-disabled:tw-opacity-40",
11470
+ "aria-[invalid=true]:tw-border-error-500",
11471
+ "aria-[invalid=true]:focus:tw-border-error-500",
11472
+ "aria-[invalid=true]:focus:tw-ring-error-200",
11473
+ "aria-[invalid=true]:data-[state=open]:tw-border-error-500",
11474
+ "aria-[invalid=true]:data-[state=open]:tw-ring-error-200"
11194
11475
  ],
11195
11476
  argo: [
11196
11477
  // muted filled input surface — gray, distinct from white containers; not the app-background token
@@ -11200,7 +11481,14 @@ var variants4 = cva(
11200
11481
  "tw-rounded-[var(--radius-lg,0.25rem)]",
11201
11482
  "tw-text-foreground",
11202
11483
  "disabled:tw-opacity-50",
11203
- "aria-disabled:tw-opacity-50"
11484
+ "aria-disabled:tw-opacity-50",
11485
+ // aria-invalid on the trigger surfaces the error chrome without a `state` prop — the
11486
+ // accessible path (uses the themeable `destructive` status token).
11487
+ "aria-[invalid=true]:tw-border-destructive",
11488
+ "aria-[invalid=true]:focus:tw-border-destructive",
11489
+ "aria-[invalid=true]:focus:tw-ring-destructive/20",
11490
+ "aria-[invalid=true]:data-[state=open]:tw-border-destructive",
11491
+ "aria-[invalid=true]:data-[state=open]:tw-ring-destructive/20"
11204
11492
  ]
11205
11493
  },
11206
11494
  sizing: {
@@ -11252,7 +11540,7 @@ var SelectTrigger = ({
11252
11540
  ...props,
11253
11541
  children: [
11254
11542
  /* @__PURE__ */ jsx(SelectPrimitive.Value, { placeholder }),
11255
- /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(icons_exports.ChevronDown, { className: "tw-size-5 tw-text-muted-foreground" }) })
11543
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(icons_exports.ChevronDown, { className: "tw-size-4 tw-text-muted-foreground" }) })
11256
11544
  ]
11257
11545
  }
11258
11546
  );
@@ -11577,12 +11865,14 @@ var badgeRootVariants = cva(
11577
11865
  "tw-h-fit",
11578
11866
  "tw-shrink-0",
11579
11867
  "tw-overflow-hidden",
11580
- // text
11868
+ // text — chrome weight/tracking are brand-overridable tokens
11869
+ // (`--font-weight-medium` / `--letter-spacing-chrome`); casing lives on the
11870
+ // `default` variant below via `tw-uppercase`.
11581
11871
  "tw-whitespace-pre-wrap",
11582
11872
  "tw-break-normal",
11583
11873
  "tw-text-xs",
11584
11874
  "tw-font-medium",
11585
- "tw-tracking-[1px]",
11875
+ "tw-tracking-chrome",
11586
11876
  "tw-text-center",
11587
11877
  "tw-underline",
11588
11878
  // content
@@ -13029,18 +13319,12 @@ var TimeInput = ({
13029
13319
  }
13030
13320
  );
13031
13321
  };
13032
- var InputOtpVariantContext = createContext({
13033
- sizing: "md",
13034
- state: "default"
13035
- });
13036
- var useInputOtpVariant = () => use(InputOtpVariantContext);
13037
- var useInputOtpRenderContext = () => use(OTPInputContext);
13038
- var InputOtpGroup = ({
13322
+ var OtpInputGroup = ({
13039
13323
  ref,
13040
13324
  className,
13041
13325
  ...props
13042
13326
  }) => /* @__PURE__ */ jsx("div", { ref, className: cn("tw-flex tw-items-center tw-gap-2", className), ...props });
13043
- var InputOtpSeparator = ({
13327
+ var OtpInputSeparator = ({
13044
13328
  ref,
13045
13329
  children,
13046
13330
  className,
@@ -13056,61 +13340,46 @@ var InputOtpSeparator = ({
13056
13340
  children: children ?? /* @__PURE__ */ jsx(icons_exports.Minus, { className: "tw-size-4" })
13057
13341
  }
13058
13342
  );
13059
- var slotVariants = cva(
13060
- [
13061
- "tw-relative",
13062
- "tw-flex",
13063
- "tw-items-center",
13064
- "tw-justify-center",
13065
- "tw-border",
13066
- "tw-border-input",
13067
- // muted filled input surface — gray, distinct from white containers; not the app-background token
13068
- "tw-bg-muted",
13069
- "tw-text-foreground",
13070
- "tw-font-medium",
13071
- "tw-tabular-nums",
13072
- "tw-rounded-lg",
13073
- "tw-transition",
13074
- "tw-outline-none",
13075
- // active slot sits above its neighbours so its ring isn't clipped
13076
- "data-[active=true]:tw-z-10",
13077
- "data-[active=true]:tw-border-primary",
13078
- "data-[active=true]:tw-ring-2",
13079
- "data-[active=true]:tw-ring-ring/50"
13080
- ],
13081
- {
13082
- defaultVariants: {
13083
- sizing: "md",
13084
- state: "default"
13085
- },
13086
- variants: {
13087
- sizing: {
13088
- sm: ["tw-h-8", "tw-w-8", "tw-text-sm"],
13089
- md: ["tw-h-9", "tw-w-9", "tw-text-base"],
13090
- lg: ["tw-h-10", "tw-w-10", "tw-text-lg"]
13091
- },
13092
- // `!` forces the border colour over the base `tw-border-input` once tailwind-merge dedupes.
13093
- // Matches the pattern InputGroup uses for its argo error state.
13094
- state: {
13095
- default: [],
13096
- error: [
13097
- "!tw-border-destructive",
13098
- "tw-bg-destructive/5",
13099
- "data-[active=true]:!tw-border-destructive",
13100
- "data-[active=true]:tw-ring-destructive/40"
13101
- ]
13102
- }
13103
- }
13104
- }
13105
- );
13106
- var InputOtpSlot = ({
13343
+ var slotClassName = [
13344
+ // layout
13345
+ "tw-relative",
13346
+ "tw-flex",
13347
+ "tw-items-center",
13348
+ "tw-justify-center",
13349
+ "tw-font-medium",
13350
+ "tw-tabular-nums",
13351
+ "tw-outline-none",
13352
+ "tw-transition",
13353
+ // resting chrome — always-visible input border on a muted fill (matches InputGroup)
13354
+ "tw-border",
13355
+ "tw-border-solid",
13356
+ "tw-border-input",
13357
+ "tw-bg-muted",
13358
+ "tw-text-foreground",
13359
+ "tw-rounded-[var(--radius-lg,0.25rem)]",
13360
+ // focus — the active slot mirrors InputGroup's argo focus ring; z-10 so the ring isn't clipped
13361
+ "data-[active=true]:tw-z-10",
13362
+ "data-[active=true]:tw-border-primary",
13363
+ "data-[active=true]:tw-ring-4",
13364
+ "data-[active=true]:tw-ring-ring/50",
13365
+ // size — from `data-size` on the group/otp container
13366
+ "group-data-[size=sm]/otp:tw-h-8 group-data-[size=sm]/otp:tw-w-8 group-data-[size=sm]/otp:tw-text-sm",
13367
+ "group-data-[size=md]/otp:tw-h-9 group-data-[size=md]/otp:tw-w-9 group-data-[size=md]/otp:tw-text-base",
13368
+ "group-data-[size=lg]/otp:tw-h-10 group-data-[size=lg]/otp:tw-w-10 group-data-[size=lg]/otp:tw-text-lg",
13369
+ // error — from `aria-invalid` on the OTP input (mirrors InputGroup argo error chrome). `!` beats
13370
+ // the base/active border once tailwind-merge dedupes.
13371
+ "group-has-[input[aria-invalid=true]]/otp:!tw-border-destructive",
13372
+ "group-has-[input[aria-invalid=true]]/otp:data-[active=true]:!tw-border-destructive",
13373
+ "group-has-[input[aria-invalid=true]]/otp:data-[active=true]:tw-ring-destructive/20"
13374
+ ];
13375
+ var OtpInputSlot = ({
13107
13376
  ref,
13108
13377
  index,
13109
13378
  className,
13110
13379
  ...props
13111
13380
  }) => {
13112
- const { slots } = useInputOtpRenderContext();
13113
- const { sizing, state } = useInputOtpVariant();
13381
+ const { slots } = use(OTPInputContext);
13382
+ if (!slots) throw new Error("<OtpInput.Slot> must be rendered inside <OtpInput>.");
13114
13383
  const slot = slots[index];
13115
13384
  const char = slot?.char ?? null;
13116
13385
  const isActive = slot?.isActive ?? false;
@@ -13121,7 +13390,7 @@ var InputOtpSlot = ({
13121
13390
  ref,
13122
13391
  "data-active": isActive || void 0,
13123
13392
  "data-slot-index": index,
13124
- className: cn(slotVariants({ sizing, state }), className),
13393
+ className: cn(slotClassName, className),
13125
13394
  ...props,
13126
13395
  children: [
13127
13396
  char,
@@ -13140,19 +13409,19 @@ var InputOtpSlot = ({
13140
13409
  var Root23 = ({
13141
13410
  ref,
13142
13411
  sizing = "md",
13143
- state = "default",
13144
13412
  pattern = REGEXP_ONLY_DIGITS,
13145
13413
  containerClassName,
13146
13414
  className,
13147
13415
  children,
13416
+ "aria-invalid": ariaInvalid,
13148
13417
  ...rest
13149
- }) => /* @__PURE__ */ jsx(InputOtpVariantContext, { value: { sizing, state }, children: /* @__PURE__ */ jsx(
13418
+ }) => /* @__PURE__ */ jsx("div", { className: "tw-group/otp tw-w-fit", "data-size": sizing, children: /* @__PURE__ */ jsx(
13150
13419
  OTPInput,
13151
13420
  {
13152
13421
  ...rest,
13153
13422
  ref,
13154
13423
  pattern,
13155
- "aria-invalid": state === "error" || void 0,
13424
+ "aria-invalid": ariaInvalid,
13156
13425
  containerClassName: cn(
13157
13426
  "tw-flex tw-items-center tw-gap-2 has-[:disabled]:tw-opacity-50",
13158
13427
  containerClassName
@@ -13161,20 +13430,11 @@ var Root23 = ({
13161
13430
  children
13162
13431
  }
13163
13432
  ) });
13164
- var InputOtp = Object.assign(Root23, {
13165
- Group: InputOtpGroup,
13166
- Slot: InputOtpSlot,
13167
- Separator: InputOtpSeparator
13433
+ var OtpInput = Object.assign(Root23, {
13434
+ Group: OtpInputGroup,
13435
+ Slot: OtpInputSlot,
13436
+ Separator: OtpInputSeparator
13168
13437
  });
13169
-
13170
- // src/blocks/InputOtp/index.ts
13171
- var useInputOtpContext = () => {
13172
- const ctx = use(OTPInputContext);
13173
- if (!ctx.slots) {
13174
- throw new Error("useInputOtpContext must be used inside <InputOtp>.");
13175
- }
13176
- return ctx;
13177
- };
13178
13438
  var SearchInput = ({
13179
13439
  ref,
13180
13440
  // group props
@@ -15148,6 +15408,18 @@ var FormGroupColorInput = ({
15148
15408
  const { state } = useFormGroupContext();
15149
15409
  return /* @__PURE__ */ jsx(ColorInput, { state, ...props, ref });
15150
15410
  };
15411
+ var toMessage = (entry) => typeof entry === "string" ? entry : entry?.message;
15412
+ var FormGroupError = ({ children, className, errors, ...rest }) => {
15413
+ const content = useMemo(() => {
15414
+ if (children) return children;
15415
+ const messages = (errors ?? []).map(toMessage).filter((message2) => !!message2);
15416
+ if (messages.length === 0) return null;
15417
+ if (messages.length === 1) return messages[0];
15418
+ 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((message2, index) => /* @__PURE__ */ jsx("li", { children: message2 }, index)) });
15419
+ }, [children, errors]);
15420
+ if (!content) return null;
15421
+ return /* @__PURE__ */ jsx("div", { ...rest, role: "alert", className: cn("tw-m-0 tw-text-xs tw-text-destructive", className), children: content });
15422
+ };
15151
15423
  var helpVariants = cva(["tw-m-0", "tw-text-xs"], {
15152
15424
  defaultVariants: {
15153
15425
  state: "default"
@@ -15155,18 +15427,17 @@ var helpVariants = cva(["tw-m-0", "tw-text-xs"], {
15155
15427
  variants: {
15156
15428
  state: {
15157
15429
  default: ["tw-text-muted-foreground"],
15158
- error: ["tw-text-destructive"],
15159
15430
  warning: ["tw-text-warning"]
15160
15431
  }
15161
15432
  }
15162
15433
  });
15163
- var HelpBlock = ({ children, className, state = "default", testId }) => {
15434
+ var HelpBlock = ({ children, className, state = "default", ...rest }) => {
15164
15435
  if (!children) return null;
15165
- return /* @__PURE__ */ jsx("p", { "data-testid": testId, className: helpVariants({ state, className }), children });
15436
+ return /* @__PURE__ */ jsx("p", { ...rest, className: helpVariants({ state, className }), children });
15166
15437
  };
15167
15438
  var FormGroupHelp = ({ children, ...rest }) => {
15168
15439
  const formGroupContext = useFormGroupContext();
15169
- return /* @__PURE__ */ jsx(HelpBlock, { state: formGroupContext.state, ...rest, children });
15440
+ return /* @__PURE__ */ jsx(HelpBlock, { state: formGroupContext.state === "warning" ? "warning" : "default", ...rest, children });
15170
15441
  };
15171
15442
  var FormGroupNumberInput = ({
15172
15443
  ref,
@@ -15186,10 +15457,11 @@ var FormGroupTextInput = ({
15186
15457
  const { state } = useFormGroupContext();
15187
15458
  return /* @__PURE__ */ jsx(TextInput, { state, ...props, ref });
15188
15459
  };
15189
- var FormGroup = ({ className, children, state, testId }) => {
15190
- 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 }) });
15460
+ var FormGroup = ({ className, children, state, ...rest }) => {
15461
+ return /* @__PURE__ */ jsx(FormGroupProvider, { value: { state }, children: /* @__PURE__ */ jsx("div", { ...rest, className: cn("tw-flex tw-flex-col tw-gap-1", className), children }) });
15191
15462
  };
15192
15463
  FormGroup.Help = FormGroupHelp;
15464
+ FormGroup.Error = FormGroupError;
15193
15465
  FormGroup.TextInput = FormGroupTextInput;
15194
15466
  FormGroup.NumberInput = FormGroupNumberInput;
15195
15467
  FormGroup.ColorInput = FormGroupColorInput;
@@ -16342,6 +16614,12 @@ var PromptInputCommands = ({ items, open, onSelect, filterValue, children }) =>
16342
16614
  children
16343
16615
  ] });
16344
16616
  };
16617
+ var ARIA_LABEL_BY_STATUS = {
16618
+ ready: "Send message",
16619
+ streaming: "Stop",
16620
+ interrupted: "Continue",
16621
+ submitted: "Sending\u2026"
16622
+ };
16345
16623
  var PromptInputSubmit = ({
16346
16624
  ref,
16347
16625
  disabled,
@@ -16364,6 +16642,7 @@ var PromptInputSubmit = ({
16364
16642
  ref,
16365
16643
  type: "submit",
16366
16644
  disabled,
16645
+ "aria-label": ARIA_LABEL_BY_STATUS[status],
16367
16646
  size: "icon-sm",
16368
16647
  variant: "invisible",
16369
16648
  isLoading: status === "submitted",
@@ -17810,7 +18089,7 @@ var cardTitleClassnames = cn(
17810
18089
  "tw-text-base",
17811
18090
  "tw-text-card-foreground"
17812
18091
  );
17813
- var CardTitle = ({ children, className, ...rest }) => /* @__PURE__ */ jsx("h3", { className: cn(cardTitleClassnames, className), ...rest, children });
18092
+ var CardTitle = ({ children, className, as: Tag = "h3", ...rest }) => /* @__PURE__ */ jsx(Tag, { className: cn(cardTitleClassnames, className), ...rest, children });
17814
18093
  var Card = ({
17815
18094
  children,
17816
18095
  className,
@@ -18412,6 +18691,11 @@ var tokensToCssVars = ({
18412
18691
  vars.set("--font-sans", typography?.fontFamily?.trim() || void 0);
18413
18692
  vars.set("--font-display", typography?.fontDisplay?.trim() || void 0);
18414
18693
  vars.set("--font-mono", typography?.fontMono?.trim() || void 0);
18694
+ vars.set("--font-weight-normal", typography?.weight?.normal);
18695
+ vars.set("--font-weight-medium", typography?.weight?.medium);
18696
+ vars.set("--font-weight-semibold", typography?.weight?.semibold);
18697
+ vars.set("--font-weight-bold", typography?.weight?.bold);
18698
+ vars.set("--letter-spacing-chrome", typography?.letterSpacing?.chrome);
18415
18699
  vars.set("--radius-sm", radii?.sm);
18416
18700
  vars.set("--radius-md", radii?.md);
18417
18701
  vars.set("--radius-lg", radii?.lg);
@@ -22953,84 +23237,179 @@ var SubmitButton = ({ children = "Submit", ...buttonProps }) => {
22953
23237
  }
22954
23238
  );
22955
23239
  };
22956
- var errorMessage = (field) => {
22957
- const first = field.state.meta.errors[0];
22958
- if (!first) return void 0;
22959
- if (typeof first === "string") return first;
22960
- if (typeof first === "object" && first !== null && "message" in first) {
22961
- const message2 = first.message;
22962
- return typeof message2 === "string" ? message2 : void 0;
22963
- }
22964
- return void 0;
22965
- };
22966
- var FieldShell = ({ field, label, required, help, className, children }) => {
22967
- const error = errorMessage(field);
22968
- const showError = field.state.meta.isTouched && !!error;
22969
- return /* @__PURE__ */ jsxs(FormGroup, { className, state: showError ? "error" : void 0, children: [
22970
- label && /* @__PURE__ */ jsxs(Label2, { htmlFor: field.name, children: [
22971
- label,
22972
- required && /* @__PURE__ */ jsx("span", { className: "tw-ml-0.5 tw-text-primary", children: "*" })
23240
+ var FieldItem = ({
23241
+ label,
23242
+ required,
23243
+ requiredMark = "required",
23244
+ help,
23245
+ tooltip,
23246
+ className,
23247
+ "aria-describedby": ariaDescribedBy,
23248
+ children
23249
+ }) => {
23250
+ const field = useFieldContext();
23251
+ const { errors, isTouched } = field.state.meta;
23252
+ const isInvalid = isTouched && errors.length > 0;
23253
+ const errorId = `${field.name}-error`;
23254
+ const descriptionId = `${field.name}-description`;
23255
+ const describedBy = [ariaDescribedBy, !!help && descriptionId, isInvalid && errorId].filter(Boolean).join(" ") || void 0;
23256
+ return /* @__PURE__ */ jsxs(FormGroup, { className, children: [
23257
+ label && /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [
23258
+ /* @__PURE__ */ jsxs(Label2, { htmlFor: field.name, children: [
23259
+ label,
23260
+ requiredMark === "required" && required && /* @__PURE__ */ jsx(Label2.Required, {}),
23261
+ requiredMark === "optional" && !required && /* @__PURE__ */ jsx(Label2.Optional, {})
23262
+ ] }),
23263
+ tooltip && /* @__PURE__ */ jsx(Tooltip, { tooltip, placement: "top", triggerAsChild: true, children: /* @__PURE__ */ jsx(
23264
+ "button",
23265
+ {
23266
+ type: "button",
23267
+ "aria-label": typeof label === "string" ? `More information about ${label}` : "More information",
23268
+ className: "tailwindcss-preflight tw-text-muted-foreground focus:tw-outline-none focus-visible:tw-text-primary",
23269
+ children: /* @__PURE__ */ jsx(icons_exports.Info, { className: "tw-size-3" })
23270
+ }
23271
+ ) })
22973
23272
  ] }),
22974
- children,
22975
- showError ? /* @__PURE__ */ jsx(FormGroup.Help, { children: error }) : help && /* @__PURE__ */ jsx(FormGroup.Help, { children: help })
23273
+ children({
23274
+ id: field.name,
23275
+ name: field.name,
23276
+ "aria-required": required || void 0,
23277
+ "aria-invalid": isInvalid || void 0,
23278
+ "aria-describedby": describedBy
23279
+ }),
23280
+ (help || isInvalid) && /* @__PURE__ */ jsxs("div", { children: [
23281
+ help && /* @__PURE__ */ jsx(FormGroup.Help, { id: descriptionId, children: help }),
23282
+ isInvalid && /* @__PURE__ */ jsx(FormGroup.Error, { id: errorId, errors })
23283
+ ] })
22976
23284
  ] });
22977
23285
  };
22978
- var CheckboxField = ({ label, help, className, children, ...checkboxProps }) => {
23286
+ var CheckboxField = ({ className, children, ...checkboxProps }) => {
22979
23287
  const field = useFieldContext();
22980
- return /* @__PURE__ */ jsx(FieldShell, { field, help, className, children: /* @__PURE__ */ jsx(
23288
+ return /* @__PURE__ */ jsx(FieldItem, { className, children: (control) => /* @__PURE__ */ jsx(
22981
23289
  Checkbox,
22982
23290
  {
22983
- id: field.name,
22984
- name: field.name,
23291
+ ...checkboxProps,
23292
+ ...control,
22985
23293
  checked: field.state.value ?? false,
22986
- onCheckedChange: (checked) => {
22987
- field.handleChange(checked === true);
22988
- },
23294
+ onCheckedChange: (checked) => field.handleChange(checked === true),
22989
23295
  onBlur: field.handleBlur,
22990
- ...checkboxProps,
22991
- children: children ?? label
23296
+ children
22992
23297
  }
22993
23298
  ) });
22994
23299
  };
22995
- var NumberField = ({ label, required, help, className, ...inputProps }) => {
23300
+ var NumberField = ({
23301
+ label,
23302
+ required,
23303
+ requiredMark,
23304
+ help,
23305
+ tooltip,
23306
+ className,
23307
+ "aria-describedby": ariaDescribedBy,
23308
+ ...inputProps
23309
+ }) => {
22996
23310
  const field = useFieldContext();
22997
- return /* @__PURE__ */ jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsx(
22998
- FormGroup.NumberInput,
23311
+ return /* @__PURE__ */ jsx(
23312
+ FieldItem,
22999
23313
  {
23000
- id: field.name,
23001
- name: field.name,
23002
- value: field.state.value ?? null,
23003
- onValueChange: (value) => {
23004
- field.handleChange(value);
23005
- },
23006
- onBlur: field.handleBlur,
23007
- ...inputProps
23314
+ label,
23315
+ required,
23316
+ requiredMark,
23317
+ help,
23318
+ tooltip,
23319
+ className,
23320
+ "aria-describedby": ariaDescribedBy,
23321
+ children: (control) => /* @__PURE__ */ jsx(
23322
+ NumberInput,
23323
+ {
23324
+ ...inputProps,
23325
+ ...control,
23326
+ value: field.state.value ?? null,
23327
+ onValueChange: field.handleChange,
23328
+ onBlur: field.handleBlur
23329
+ }
23330
+ )
23008
23331
  }
23009
- ) });
23332
+ );
23010
23333
  };
23011
- var PasswordField = ({ label, required, help, className, ...inputProps }) => {
23334
+ var OtpInputField = ({
23335
+ label,
23336
+ required,
23337
+ requiredMark,
23338
+ help,
23339
+ tooltip,
23340
+ className,
23341
+ "aria-describedby": ariaDescribedBy,
23342
+ maxLength,
23343
+ ...otpProps
23344
+ }) => {
23012
23345
  const field = useFieldContext();
23013
- const showError = field.state.meta.isTouched && field.state.meta.errors.length > 0;
23014
- return /* @__PURE__ */ jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsx(
23015
- PasswordInput,
23346
+ return /* @__PURE__ */ jsx(
23347
+ FieldItem,
23016
23348
  {
23017
- id: field.name,
23018
- name: field.name,
23019
- value: field.state.value ?? "",
23020
- state: showError ? "error" : void 0,
23021
- onValueChange: (value) => {
23022
- field.handleChange(value);
23023
- },
23024
- onBlur: field.handleBlur,
23025
- ...inputProps
23349
+ label,
23350
+ required,
23351
+ requiredMark,
23352
+ help,
23353
+ tooltip,
23354
+ className,
23355
+ "aria-describedby": ariaDescribedBy,
23356
+ children: (control) => /* @__PURE__ */ jsx(
23357
+ OtpInput,
23358
+ {
23359
+ ...otpProps,
23360
+ ...control,
23361
+ maxLength,
23362
+ value: field.state.value ?? "",
23363
+ onChange: field.handleChange,
23364
+ onBlur: field.handleBlur,
23365
+ children: /* @__PURE__ */ jsx(OtpInput.Group, { children: Array.from({ length: maxLength }, (_, index) => /* @__PURE__ */ jsx(OtpInput.Slot, { index }, index)) })
23366
+ }
23367
+ )
23026
23368
  }
23027
- ) });
23369
+ );
23370
+ };
23371
+ var PasswordField = ({
23372
+ label,
23373
+ required,
23374
+ requiredMark,
23375
+ help,
23376
+ tooltip,
23377
+ className,
23378
+ "aria-describedby": ariaDescribedBy,
23379
+ ...inputProps
23380
+ }) => {
23381
+ const field = useFieldContext();
23382
+ return /* @__PURE__ */ jsx(
23383
+ FieldItem,
23384
+ {
23385
+ label,
23386
+ required,
23387
+ requiredMark,
23388
+ help,
23389
+ tooltip,
23390
+ className,
23391
+ "aria-describedby": ariaDescribedBy,
23392
+ children: (control) => /* @__PURE__ */ jsx(
23393
+ PasswordInput,
23394
+ {
23395
+ ...inputProps,
23396
+ ...control,
23397
+ value: field.state.value ?? "",
23398
+ onValueChange: field.handleChange,
23399
+ onBlur: field.handleBlur
23400
+ }
23401
+ )
23402
+ }
23403
+ );
23028
23404
  };
23029
23405
  var SelectField = ({
23030
23406
  label,
23031
23407
  required,
23408
+ requiredMark,
23032
23409
  help,
23410
+ tooltip,
23033
23411
  className,
23412
+ "aria-describedby": ariaDescribedBy,
23034
23413
  items,
23035
23414
  options,
23036
23415
  placeholder,
@@ -23042,80 +23421,125 @@ var SelectField = ({
23042
23421
  }) => {
23043
23422
  const field = useFieldContext();
23044
23423
  const resolved = items ?? options ?? [];
23045
- return /* @__PURE__ */ jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsxs(
23046
- Select2.Root,
23424
+ return /* @__PURE__ */ jsx(
23425
+ FieldItem,
23047
23426
  {
23048
- value: field.state.value ?? "",
23049
- onValueChange: (value) => {
23050
- field.handleChange(value);
23051
- },
23052
- ...rootProps,
23053
- children: [
23054
- /* @__PURE__ */ jsx(
23055
- Select2.Trigger,
23056
- {
23057
- id: field.name,
23058
- className: triggerClassName ?? "tw-w-full",
23059
- placeholder,
23060
- variant,
23061
- state,
23062
- sizing,
23063
- onBlur: field.handleBlur
23064
- }
23065
- ),
23066
- /* @__PURE__ */ jsx(Select2.Content, { children: resolved.map((option) => /* @__PURE__ */ jsx(Select2.Item, { value: option.value, children: option.label }, option.value)) })
23067
- ]
23427
+ label,
23428
+ required,
23429
+ requiredMark,
23430
+ help,
23431
+ tooltip,
23432
+ className,
23433
+ "aria-describedby": ariaDescribedBy,
23434
+ children: (control) => /* @__PURE__ */ jsxs(
23435
+ Select2.Root,
23436
+ {
23437
+ value: field.state.value ?? "",
23438
+ onValueChange: (value) => {
23439
+ field.handleChange(value);
23440
+ },
23441
+ ...rootProps,
23442
+ children: [
23443
+ /* @__PURE__ */ jsx(
23444
+ Select2.Trigger,
23445
+ {
23446
+ ...control,
23447
+ className: triggerClassName ?? "tw-w-full",
23448
+ placeholder,
23449
+ variant,
23450
+ state,
23451
+ sizing,
23452
+ onBlur: field.handleBlur
23453
+ }
23454
+ ),
23455
+ /* @__PURE__ */ jsx(Select2.Content, { children: resolved.map((option) => /* @__PURE__ */ jsx(Select2.Item, { value: option.value, children: option.label }, option.value)) })
23456
+ ]
23457
+ }
23458
+ )
23068
23459
  }
23069
- ) });
23460
+ );
23070
23461
  };
23071
- var SwitchField = ({ label, help, className, children, ...switchProps }) => {
23462
+ var SwitchField = ({ className, children, ...switchProps }) => {
23072
23463
  const field = useFieldContext();
23073
- return /* @__PURE__ */ jsx(FieldShell, { field, help, className, children: /* @__PURE__ */ jsx(
23464
+ return /* @__PURE__ */ jsx(FieldItem, { className, children: (control) => /* @__PURE__ */ jsx(
23074
23465
  Switch,
23075
23466
  {
23076
- id: field.name,
23077
- name: field.name,
23467
+ ...switchProps,
23468
+ ...control,
23078
23469
  checked: field.state.value ?? false,
23079
- onCheckedChange: (checked) => {
23080
- field.handleChange(checked);
23081
- },
23470
+ onCheckedChange: field.handleChange,
23082
23471
  onBlur: field.handleBlur,
23083
- ...switchProps,
23084
- children: children ?? label
23472
+ children
23085
23473
  }
23086
23474
  ) });
23087
23475
  };
23088
- var TextAreaField = ({ label, required, help, className, ...inputProps }) => {
23476
+ var TextareaField = ({
23477
+ label,
23478
+ required,
23479
+ requiredMark,
23480
+ help,
23481
+ tooltip,
23482
+ className,
23483
+ "aria-describedby": ariaDescribedBy,
23484
+ ...inputProps
23485
+ }) => {
23089
23486
  const field = useFieldContext();
23090
- return /* @__PURE__ */ jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsx(
23091
- FormGroup.Textarea,
23487
+ return /* @__PURE__ */ jsx(
23488
+ FieldItem,
23092
23489
  {
23093
- id: field.name,
23094
- name: field.name,
23095
- value: field.state.value ?? "",
23096
- onValueChange: (value) => {
23097
- field.handleChange(value);
23098
- },
23099
- onBlur: field.handleBlur,
23100
- ...inputProps
23490
+ label,
23491
+ required,
23492
+ requiredMark,
23493
+ help,
23494
+ tooltip,
23495
+ className,
23496
+ "aria-describedby": ariaDescribedBy,
23497
+ children: (control) => /* @__PURE__ */ jsx(
23498
+ Textarea,
23499
+ {
23500
+ ...inputProps,
23501
+ ...control,
23502
+ value: field.state.value ?? "",
23503
+ onValueChange: field.handleChange,
23504
+ onBlur: field.handleBlur
23505
+ }
23506
+ )
23101
23507
  }
23102
- ) });
23508
+ );
23103
23509
  };
23104
- var TextField = ({ label, required, help, className, ...inputProps }) => {
23510
+ var TextField = ({
23511
+ label,
23512
+ required,
23513
+ requiredMark,
23514
+ help,
23515
+ tooltip,
23516
+ className,
23517
+ "aria-describedby": ariaDescribedBy,
23518
+ ...inputProps
23519
+ }) => {
23105
23520
  const field = useFieldContext();
23106
- return /* @__PURE__ */ jsx(FieldShell, { field, label, required, help, className, children: /* @__PURE__ */ jsx(
23107
- FormGroup.TextInput,
23521
+ return /* @__PURE__ */ jsx(
23522
+ FieldItem,
23108
23523
  {
23109
- id: field.name,
23110
- name: field.name,
23111
- value: field.state.value ?? "",
23112
- onChange: (e) => {
23113
- field.handleChange(e.target.value);
23114
- },
23115
- onBlur: field.handleBlur,
23116
- ...inputProps
23524
+ label,
23525
+ required,
23526
+ requiredMark,
23527
+ help,
23528
+ tooltip,
23529
+ className,
23530
+ "aria-describedby": ariaDescribedBy,
23531
+ children: (control) => /* @__PURE__ */ jsx(
23532
+ TextInput,
23533
+ {
23534
+ ...inputProps,
23535
+ ...control,
23536
+ value: field.state.value ?? "",
23537
+ onValueChange: field.handleChange,
23538
+ onBlur: field.handleBlur
23539
+ }
23540
+ )
23117
23541
  }
23118
- ) });
23542
+ );
23119
23543
  };
23120
23544
 
23121
23545
  // src/blocks/Form/formHook.ts
@@ -23126,10 +23550,11 @@ var { useAppForm, withForm } = createFormHook({
23126
23550
  TextField,
23127
23551
  NumberField,
23128
23552
  PasswordField,
23129
- TextAreaField,
23553
+ TextareaField,
23130
23554
  SelectField,
23131
23555
  CheckboxField,
23132
- SwitchField
23556
+ SwitchField,
23557
+ OtpInputField
23133
23558
  },
23134
23559
  formComponents: {
23135
23560
  FormBody,
@@ -23245,6 +23670,6 @@ object-assign/index.js:
23245
23670
  *)
23246
23671
  */
23247
23672
 
23248
- export { Alert, AlertModal, AnswerSummary, AppShell, ArgoDesignContext, AutoSaveTextarea, Avatar, Badge, BrandLogo, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, Card, Checkbox, Clipboard, ClipboardButton, ClipboardInline, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, ColorModeSwitch, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DEFAULT_COLOR_SCHEME, DEFAULT_BRAND_ID as DEFAULT_KEBOOLA_BRAND_ID, DateInput, DatePicker, DateRangeInput, DateRangePicker, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, ErrorState, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, InlineStepLabel, InputGroup, InputOtp, Kbd, Label2 as Label, Link, Markdown, MarkedText, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, PlanRewritingIndicator, Popconfirm, Popover, Progress, PromptInput, Question, QuestionBlock, RadioGroup2 as RadioGroup, ResizableHandle, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select2 as Select, Separator2 as Separator, Sheet, Sidebar, SidebarProvider, Skeleton, SkeletonList, Slider, SplitButton, SpotlightBackdrop, Stepper, SuggestedPrompt, Switch, Table, Tabs2 as Tabs, TabsContent, Tagger, TextInput, Textarea, ThemeProvider, ThinkingIndicator, TimeInput, TimePicker, Timeline, Toaster, Toggle, ToggleGroup, ToolCallApproval, ToolCallChip, Tooltip, TooltipProvider, Truncated, UsageStats, UsageStatsRing, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, setServerFieldErrors, toast, useAppForm, useArgoDesign, useAutosizeInput, useInputOtpContext, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTargetRect, useTheme, withForm };
23673
+ export { Alert, AlertModal, AnswerSummary, AppShell, ArgoDesignContext, AutoSaveTextarea, Avatar, Badge, BrandLogo, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, Card, Checkbox, Clipboard, ClipboardButton, ClipboardInline, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, ColorModeSwitch, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, CopyField, DEFAULT_COLOR_SCHEME, DEFAULT_BRAND_ID as DEFAULT_KEBOOLA_BRAND_ID, DateInput, DatePicker, DateRangeInput, DateRangePicker, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, ErrorState, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, InlineStepLabel, InputGroup, Kbd, Label2 as Label, Link, Markdown, MarkedText, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, OtpInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, PlanRewritingIndicator, Popconfirm, Popover, Progress, PromptInput, Question, QuestionBlock, RadioGroup2 as RadioGroup, ResizableHandle, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select2 as Select, Separator2 as Separator, Sheet, Sidebar, SidebarProvider, Skeleton, SkeletonList, Slider, SplitButton, SpotlightBackdrop, Stepper, SuggestedPrompt, Switch, Table, Tabs2 as Tabs, TabsContent, Tagger, TextInput, Textarea, ThemeProvider, ThinkingIndicator, TimeInput, TimePicker, Timeline, Toaster, Toggle, ToggleGroup, ToolCallApproval, ToolCallChip, Tooltip, TooltipProvider, Truncated, UsageStats, UsageStatsRing, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, setServerFieldErrors, toast, useAppForm, useArgoDesign, useAutosizeInput, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTargetRect, useTheme, withForm };
23249
23674
  //# sourceMappingURL=index.js.map
23250
23675
  //# sourceMappingURL=index.js.map