@choice-ui/react 1.7.4 → 1.7.6

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.
Files changed (41) hide show
  1. package/dist/components/button/dist/index.d.ts +2 -9
  2. package/dist/components/button/dist/index.js +38 -19
  3. package/dist/components/button/src/button.d.ts +2 -9
  4. package/dist/components/button/src/button.js +22 -13
  5. package/dist/components/button/src/tv.d.ts +12 -0
  6. package/dist/components/button/src/tv.js +15 -5
  7. package/dist/components/comments/dist/index.d.ts +3 -0
  8. package/dist/components/comments/src/comment-input/comment-input.d.ts +3 -0
  9. package/dist/components/comments/src/comment-input/comment-input.js +8 -2
  10. package/dist/components/comments/src/comment-input/components/comment-input-footer.d.ts +3 -0
  11. package/dist/components/comments/src/comment-input/components/comment-input-footer.js +10 -9
  12. package/dist/components/comments/src/comment-input/components/comment-input-renderers.js +1 -1
  13. package/dist/components/comments/src/comment-item/tv.d.ts +3 -3
  14. package/dist/components/modal/dist/index.js +2 -2
  15. package/dist/components/modal/src/tv.d.ts +3 -3
  16. package/dist/components/modal/src/tv.js +2 -2
  17. package/dist/components/otp-input/src/otp-input.js +10 -31
  18. package/dist/components/otp-input/src/tv.d.ts +3 -3
  19. package/dist/components/otp-input/src/tv.js +1 -1
  20. package/dist/components/panel/dist/index.d.ts +16 -16
  21. package/dist/components/panel/src/components/panel-label.js +2 -1
  22. package/dist/components/panel/src/components/panel-previewer.js +2 -4
  23. package/dist/components/panel/src/components/panel-row-label.js +2 -4
  24. package/dist/components/panel/src/components/panel-row-many-icon.js +4 -5
  25. package/dist/components/panel/src/components/panel-row.d.ts +12 -12
  26. package/dist/components/panel/src/components/panel-row.js +3 -3
  27. package/dist/components/panel/src/components/panel-sortable-row.js +13 -12
  28. package/dist/components/panel/src/components/panel-sortable.d.ts +1 -1
  29. package/dist/components/panel/src/components/panel-sortable.js +21 -21
  30. package/dist/components/panel/src/components/panel-title.js +16 -19
  31. package/dist/components/panel/src/context/panel-context.d.ts +1 -2
  32. package/dist/components/panel/src/hooks/use-panel-drag-drop.js +7 -6
  33. package/dist/components/panel/src/panel.d.ts +2 -2
  34. package/dist/components/panel/src/panel.js +38 -37
  35. package/dist/components/panel/src/tv.d.ts +89 -0
  36. package/dist/components/panel/src/tv.js +38 -2
  37. package/dist/components/splitter/dist/index.d.ts +1 -1
  38. package/dist/components/splitter/src/splitter.d.ts +2 -2
  39. package/dist/styles/components.css +5 -18
  40. package/package.json +1 -1
  41. package/dist/components/splitter/src/tv.d.ts +0 -7
@@ -1,22 +1,15 @@
1
1
  import { HTMLProps } from 'react';
2
- import { TooltipProps } from '../../tooltip/src';
3
2
  import * as react from 'react';
4
3
 
5
- interface ButtonProps extends Omit<HTMLProps<HTMLButtonElement>, "size"> {
4
+ interface ButtonProps extends Omit<HTMLProps<HTMLButtonElement | HTMLAnchorElement>, "size" | "as"> {
6
5
  active?: boolean;
6
+ as?: React.ElementType;
7
7
  asChild?: boolean;
8
8
  className?: string;
9
9
  focused?: boolean;
10
10
  loading?: boolean;
11
11
  readOnly?: boolean;
12
- /**
13
- * @default "default"
14
- */
15
12
  size?: "default" | "large";
16
- tooltip?: TooltipProps;
17
- /**
18
- * @default "primary"
19
- */
20
13
  variant?: "primary" | "secondary" | "solid" | "destructive" | "secondary-destruct" | "inverse" | "success" | "link" | "link-danger" | "ghost" | "dark" | "reset";
21
14
  }
22
15
  declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
@@ -1,10 +1,9 @@
1
- import { LoaderCircle } from "@choiceform/icons-react";
2
1
  import { Slot } from "../../slot/dist/index.js";
3
- import { Tooltip } from "../../tooltip/dist/index.js";
4
- import { forwardRef, isValidElement, cloneElement, useMemo } from "react";
2
+ import { LoaderCircle } from "@choiceform/icons-react";
3
+ import { forwardRef, useMemo, isValidElement, cloneElement } from "react";
5
4
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
6
- import { isMultiElement } from "../../../shared/utils/assertion.js";
7
5
  import { tcv, tcx } from "../../../shared/utils/tcx/tcx.js";
6
+ import { isMultiElement } from "../../../shared/utils/assertion.js";
8
7
  var buttonTv = tcv({
9
8
  slots: {
10
9
  button: [
@@ -75,6 +74,10 @@ var buttonTv = tcv({
75
74
  focused: {
76
75
  true: "",
77
76
  false: ""
77
+ },
78
+ multiElement: {
79
+ true: "",
80
+ false: ""
78
81
  }
79
82
  },
80
83
  compoundVariants: [
@@ -123,10 +126,15 @@ var buttonTv = tcv({
123
126
  variant: ["link", "link-danger", "ghost"],
124
127
  disabled: true,
125
128
  class: {
126
- button: [
127
- "text-disabled-foreground pointer-events-none",
128
- "data-[multi-element=true]:border-default-boundary"
129
- ]
129
+ button: ["text-disabled-foreground pointer-events-none"]
130
+ }
131
+ },
132
+ {
133
+ variant: ["link", "link-danger", "ghost"],
134
+ disabled: true,
135
+ multiElement: true,
136
+ class: {
137
+ button: ["border-default-boundary"]
130
138
  }
131
139
  },
132
140
  {
@@ -244,7 +252,8 @@ var buttonTv = tcv({
244
252
  active: false,
245
253
  disabled: false,
246
254
  loading: false,
247
- focused: false
255
+ focused: false,
256
+ multiElement: false
248
257
  }
249
258
  });
250
259
  var Button = forwardRef(function Button2(props, ref) {
@@ -259,13 +268,25 @@ var Button = forwardRef(function Button2(props, ref) {
259
268
  loading,
260
269
  asChild,
261
270
  children,
262
- tooltip,
271
+ as,
263
272
  "aria-label": ariaLabel,
264
273
  onClick,
265
274
  ...rest
266
275
  } = props;
267
- const Button3 = asChild ? Slot : "button";
268
- const tv = buttonTv({ variant, size, active, disabled, loading, focused, className });
276
+ const As = as ?? "button";
277
+ const AsComponent = asChild ? Slot : As;
278
+ const elementProps = !asChild && As === "button" ? { type: rest.type ?? "button" } : {};
279
+ const tv = useMemo(
280
+ () => buttonTv({
281
+ variant,
282
+ size,
283
+ active,
284
+ disabled,
285
+ loading,
286
+ focused
287
+ }),
288
+ [variant, size, active, disabled, loading, focused]
289
+ );
269
290
  const content = isValidElement(children) ? cloneElement(children, {
270
291
  children: children.props.children
271
292
  }) : loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -279,23 +300,21 @@ var Button = forwardRef(function Button2(props, ref) {
279
300
  return props["aria-label"];
280
301
  }, [children, props]);
281
302
  const handleClick = readOnly ? void 0 : onClick;
282
- const button = /* @__PURE__ */ jsx(
283
- Button3,
303
+ return /* @__PURE__ */ jsx(
304
+ AsComponent,
284
305
  {
285
- ...rest,
286
306
  ref,
287
- type: rest.type || "button",
307
+ className: tcx(tv.button({ multiElement: isMultiElement(content) }), className),
308
+ ...elementProps,
309
+ ...rest,
288
310
  disabled: disabled || loading,
289
311
  onClick: handleClick,
290
- className: tcx(tv.button(), className),
291
- "data-multi-element": isMultiElement(content),
292
312
  "aria-disabled": disabled || loading,
293
313
  "aria-busy": loading,
294
314
  "aria-label": ariaLabelProps,
295
315
  children: content
296
316
  }
297
317
  );
298
- return tooltip ? /* @__PURE__ */ jsx(Tooltip, { ...tooltip, children: button }) : button;
299
318
  });
300
319
  Button.displayName = "Button";
301
320
  export {
@@ -1,20 +1,13 @@
1
- import { TooltipProps } from '../../tooltip/src';
2
1
  import { HTMLProps } from 'react';
3
- export interface ButtonProps extends Omit<HTMLProps<HTMLButtonElement>, "size"> {
2
+ export interface ButtonProps extends Omit<HTMLProps<HTMLButtonElement | HTMLAnchorElement>, "size" | "as"> {
4
3
  active?: boolean;
4
+ as?: React.ElementType;
5
5
  asChild?: boolean;
6
6
  className?: string;
7
7
  focused?: boolean;
8
8
  loading?: boolean;
9
9
  readOnly?: boolean;
10
- /**
11
- * @default "default"
12
- */
13
10
  size?: "default" | "large";
14
- tooltip?: TooltipProps;
15
- /**
16
- * @default "primary"
17
- */
18
11
  variant?: "primary" | "secondary" | "solid" | "destructive" | "secondary-destruct" | "inverse" | "success" | "link" | "link-danger" | "ghost" | "dark" | "reset";
19
12
  }
20
13
  export declare const Button: import('react').ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,8 +1,7 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { LoaderCircle } from "@choiceform/icons-react";
3
2
  import { Slot } from "../../slot/dist/index.js";
4
- import { Tooltip } from "../../tooltip/dist/index.js";
5
- import { forwardRef, isValidElement, cloneElement, useMemo } from "react";
3
+ import { LoaderCircle } from "@choiceform/icons-react";
4
+ import { forwardRef, useMemo, isValidElement, cloneElement } from "react";
6
5
  import { buttonTv } from "./tv.js";
7
6
  import { tcx } from "../../../shared/utils/tcx/tcx.js";
8
7
  import { isMultiElement } from "../../../shared/utils/assertion.js";
@@ -18,13 +17,25 @@ const Button = forwardRef(function Button2(props, ref) {
18
17
  loading,
19
18
  asChild,
20
19
  children,
21
- tooltip,
20
+ as,
22
21
  "aria-label": ariaLabel,
23
22
  onClick,
24
23
  ...rest
25
24
  } = props;
26
- const Button3 = asChild ? Slot : "button";
27
- const tv = buttonTv({ variant, size, active, disabled, loading, focused, className });
25
+ const As = as ?? "button";
26
+ const AsComponent = asChild ? Slot : As;
27
+ const elementProps = !asChild && As === "button" ? { type: rest.type ?? "button" } : {};
28
+ const tv = useMemo(
29
+ () => buttonTv({
30
+ variant,
31
+ size,
32
+ active,
33
+ disabled,
34
+ loading,
35
+ focused
36
+ }),
37
+ [variant, size, active, disabled, loading, focused]
38
+ );
28
39
  const content = isValidElement(children) ? cloneElement(children, {
29
40
  children: children.props.children
30
41
  }) : loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -38,23 +49,21 @@ const Button = forwardRef(function Button2(props, ref) {
38
49
  return props["aria-label"];
39
50
  }, [children, props]);
40
51
  const handleClick = readOnly ? void 0 : onClick;
41
- const button = /* @__PURE__ */ jsx(
42
- Button3,
52
+ return /* @__PURE__ */ jsx(
53
+ AsComponent,
43
54
  {
44
- ...rest,
45
55
  ref,
46
- type: rest.type || "button",
56
+ className: tcx(tv.button({ multiElement: isMultiElement(content) }), className),
57
+ ...elementProps,
58
+ ...rest,
47
59
  disabled: disabled || loading,
48
60
  onClick: handleClick,
49
- className: tcx(tv.button(), className),
50
- "data-multi-element": isMultiElement(content),
51
61
  "aria-disabled": disabled || loading,
52
62
  "aria-busy": loading,
53
63
  "aria-label": ariaLabelProps,
54
64
  children: content
55
65
  }
56
66
  );
57
- return tooltip ? /* @__PURE__ */ jsx(Tooltip, { ...tooltip, children: button }) : button;
58
67
  });
59
68
  Button.displayName = "Button";
60
69
  export {
@@ -61,6 +61,10 @@ export declare const buttonTv: import('tailwind-variants').TVReturnType<{
61
61
  true: string;
62
62
  false: string;
63
63
  };
64
+ multiElement: {
65
+ true: string;
66
+ false: string;
67
+ };
64
68
  }, {
65
69
  button: string[];
66
70
  spinner: string[];
@@ -128,6 +132,10 @@ export declare const buttonTv: import('tailwind-variants').TVReturnType<{
128
132
  true: string;
129
133
  false: string;
130
134
  };
135
+ multiElement: {
136
+ true: string;
137
+ false: string;
138
+ };
131
139
  }, {
132
140
  button: string[];
133
141
  spinner: string[];
@@ -195,6 +203,10 @@ export declare const buttonTv: import('tailwind-variants').TVReturnType<{
195
203
  true: string;
196
204
  false: string;
197
205
  };
206
+ multiElement: {
207
+ true: string;
208
+ false: string;
209
+ };
198
210
  }, {
199
211
  button: string[];
200
212
  spinner: string[];
@@ -69,6 +69,10 @@ const buttonTv = tcv({
69
69
  focused: {
70
70
  true: "",
71
71
  false: ""
72
+ },
73
+ multiElement: {
74
+ true: "",
75
+ false: ""
72
76
  }
73
77
  },
74
78
  compoundVariants: [
@@ -117,10 +121,15 @@ const buttonTv = tcv({
117
121
  variant: ["link", "link-danger", "ghost"],
118
122
  disabled: true,
119
123
  class: {
120
- button: [
121
- "text-disabled-foreground pointer-events-none",
122
- "data-[multi-element=true]:border-default-boundary"
123
- ]
124
+ button: ["text-disabled-foreground pointer-events-none"]
125
+ }
126
+ },
127
+ {
128
+ variant: ["link", "link-danger", "ghost"],
129
+ disabled: true,
130
+ multiElement: true,
131
+ class: {
132
+ button: ["border-default-boundary"]
124
133
  }
125
134
  },
126
135
  {
@@ -238,7 +247,8 @@ const buttonTv = tcv({
238
247
  active: false,
239
248
  disabled: false,
240
249
  loading: false,
241
- focused: false
250
+ focused: false,
251
+ multiElement: false
242
252
  }
243
253
  });
244
254
  export {
@@ -79,6 +79,9 @@ interface CommentInputProps {
79
79
  placeholder?: string;
80
80
  users?: User[];
81
81
  variant?: "default" | "solid";
82
+ showMentionButton?: boolean;
83
+ showEmojiButton?: boolean;
84
+ showImageUploadButton?: boolean;
82
85
  }
83
86
  declare const CommentInput: react.ForwardRefExoticComponent<CommentInputProps & react.RefAttributes<HTMLDivElement>>;
84
87
 
@@ -12,5 +12,8 @@ export interface CommentInputProps {
12
12
  placeholder?: string;
13
13
  users?: User[];
14
14
  variant?: "default" | "solid";
15
+ showMentionButton?: boolean;
16
+ showEmojiButton?: boolean;
17
+ showImageUploadButton?: boolean;
15
18
  }
16
19
  export declare const CommentInput: import('react').ForwardRefExoticComponent<CommentInputProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -31,7 +31,10 @@ const CommentInput = forwardRef((props, ref) => {
31
31
  ADD_EMOJI: "Add emoji",
32
32
  UPLOAD_ATTACHMENT: "Upload up to 5 images",
33
33
  REMOVE_IMAGE: "Remove image"
34
- }
34
+ },
35
+ showMentionButton = true,
36
+ showEmojiButton = true,
37
+ showImageUploadButton = true
35
38
  } = props;
36
39
  const [isEditMode, setIsEditMode] = useState(false);
37
40
  const [isComposing, setIsComposing] = useState(false);
@@ -230,7 +233,10 @@ const CommentInput = forwardRef((props, ref) => {
230
233
  imageCount,
231
234
  maxImageCount,
232
235
  hasOnlyImages,
233
- defaultText
236
+ defaultText,
237
+ showMentionButton: showMentionButton && users.length > 0,
238
+ showEmojiButton,
239
+ showImageUploadButton
234
240
  }
235
241
  ),
236
242
  shouldShowPlaceholder ? /* @__PURE__ */ jsx("div", { className: styles.placeholder(), children: /* @__PURE__ */ jsx("span", { className: "truncate", children: error || placeholder }) }) : null
@@ -17,6 +17,9 @@ interface CommentInputFooterProps {
17
17
  onMentionClick?: () => void;
18
18
  onSubmit?: () => void;
19
19
  typing?: boolean;
20
+ showMentionButton?: boolean;
21
+ showEmojiButton?: boolean;
22
+ showImageUploadButton?: boolean;
20
23
  }
21
24
  export declare const CommentInputFooter: (props: CommentInputFooterProps) => import("react/jsx-runtime").JSX.Element;
22
25
  export {};
@@ -1,6 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Button } from "../../../../button/dist/index.js";
3
3
  import { IconButton } from "../../../../icon-button/dist/index.js";
4
+ import { Tooltip } from "../../../../tooltip/dist/index.js";
4
5
  import { Smile, AtSign, Image, ArrowUp } from "@choiceform/icons-react";
5
6
  import { useRef } from "react";
6
7
  import { CommentInputTv } from "../tv.js";
@@ -21,7 +22,10 @@ const CommentInputFooter = (props) => {
21
22
  imageCount = 0,
22
23
  maxImageCount = 5,
23
24
  hasOnlyImages = false,
24
- defaultText
25
+ defaultText,
26
+ showMentionButton = true,
27
+ showEmojiButton = true,
28
+ showImageUploadButton = true
25
29
  } = props;
26
30
  const fileInputRef = useRef(null);
27
31
  const handleImageButtonClick = () => {
@@ -39,7 +43,7 @@ const CommentInputFooter = (props) => {
39
43
  const isSubmitDisabled = disabled || !allowSubmission || hasOnlyImages;
40
44
  return /* @__PURE__ */ jsxs("div", { className: styles.footer({ className }), children: [
41
45
  typing && /* @__PURE__ */ jsxs("div", { className: styles.footerActions(), children: [
42
- /* @__PURE__ */ jsx(
46
+ showEmojiButton && /* @__PURE__ */ jsx(
43
47
  IconButton,
44
48
  {
45
49
  ref: emojiButtonRef,
@@ -50,7 +54,7 @@ const CommentInputFooter = (props) => {
50
54
  children: /* @__PURE__ */ jsx(Smile, {})
51
55
  }
52
56
  ),
53
- /* @__PURE__ */ jsx(
57
+ showMentionButton && /* @__PURE__ */ jsx(
54
58
  IconButton,
55
59
  {
56
60
  onClick: onMentionClick,
@@ -60,7 +64,7 @@ const CommentInputFooter = (props) => {
60
64
  children: /* @__PURE__ */ jsx(AtSign, {})
61
65
  }
62
66
  ),
63
- /* @__PURE__ */ jsxs(
67
+ showImageUploadButton && /* @__PURE__ */ jsxs(
64
68
  IconButton,
65
69
  {
66
70
  onClick: handleImageButtonClick,
@@ -106,18 +110,15 @@ const CommentInputFooter = (props) => {
106
110
  )
107
111
  ] }) : (
108
112
  /* Submit Button */
109
- /* @__PURE__ */ jsx(
113
+ /* @__PURE__ */ jsx(Tooltip, { content: defaultText.SUBMIT, children: /* @__PURE__ */ jsx(
110
114
  Button,
111
115
  {
112
116
  onClick: onSubmit,
113
117
  disabled: isSubmitDisabled,
114
118
  className: "w-6 rounded-full border-none px-0",
115
- tooltip: {
116
- content: defaultText.SUBMIT
117
- },
118
119
  children: /* @__PURE__ */ jsx(ArrowUp, {})
119
120
  }
120
- )
121
+ ) })
121
122
  )
122
123
  ] });
123
124
  };
@@ -91,7 +91,7 @@ const renderLeaf = (props) => {
91
91
  formattedChildren = /* @__PURE__ */ jsx("u", { className: "underline", children: formattedChildren });
92
92
  }
93
93
  if (customLeaf.emoji) {
94
- formattedChildren = /* @__PURE__ */ jsx("span", { className: "font-emoji text-xl leading-6", children: formattedChildren });
94
+ formattedChildren = /* @__PURE__ */ jsx("span", { className: "font-emoji text-body-large leading-6", children: formattedChildren });
95
95
  }
96
96
  return /* @__PURE__ */ jsx("span", { ...attributes, children: formattedChildren });
97
97
  };
@@ -4,8 +4,8 @@ export declare const CommentItemTv: import('tailwind-variants').TVReturnType<{
4
4
  meta?: import('tailwind-merge').ClassNameValue;
5
5
  content?: import('tailwind-merge').ClassNameValue;
6
6
  date?: import('tailwind-merge').ClassNameValue;
7
- root?: import('tailwind-merge').ClassNameValue;
8
7
  name?: import('tailwind-merge').ClassNameValue;
8
+ root?: import('tailwind-merge').ClassNameValue;
9
9
  avatar?: import('tailwind-merge').ClassNameValue;
10
10
  actionMenu?: import('tailwind-merge').ClassNameValue;
11
11
  };
@@ -16,8 +16,8 @@ export declare const CommentItemTv: import('tailwind-variants').TVReturnType<{
16
16
  meta?: import('tailwind-merge').ClassNameValue;
17
17
  content?: import('tailwind-merge').ClassNameValue;
18
18
  date?: import('tailwind-merge').ClassNameValue;
19
- root?: import('tailwind-merge').ClassNameValue;
20
19
  name?: import('tailwind-merge').ClassNameValue;
20
+ root?: import('tailwind-merge').ClassNameValue;
21
21
  avatar?: import('tailwind-merge').ClassNameValue;
22
22
  actionMenu?: import('tailwind-merge').ClassNameValue;
23
23
  };
@@ -36,8 +36,8 @@ export declare const CommentItemTv: import('tailwind-variants').TVReturnType<{
36
36
  meta?: import('tailwind-merge').ClassNameValue;
37
37
  content?: import('tailwind-merge').ClassNameValue;
38
38
  date?: import('tailwind-merge').ClassNameValue;
39
- root?: import('tailwind-merge').ClassNameValue;
40
39
  name?: import('tailwind-merge').ClassNameValue;
40
+ root?: import('tailwind-merge').ClassNameValue;
41
41
  avatar?: import('tailwind-merge').ClassNameValue;
42
42
  actionMenu?: import('tailwind-merge').ClassNameValue;
43
43
  };
@@ -15,7 +15,7 @@ var ModalTv = tcv({
15
15
  });
16
16
  var ModalHeaderTv = tcv({
17
17
  slots: {
18
- root: "modal__header border-default-boundary w-full flex-none items-center border-b",
18
+ root: ["modal__header", "grid border-default-boundary w-full flex-none items-center border-b"],
19
19
  title: "text-body-medium flex min-w-0 items-center gap-2 p-2 font-strong [grid-area:title] select-none",
20
20
  close: "p-2 [grid-area:close]"
21
21
  },
@@ -30,7 +30,7 @@ var ModalHeaderTv = tcv({
30
30
  },
31
31
  close: {
32
32
  true: {
33
- root: "modal__header--action"
33
+ root: "grid-cols-[auto_1fr_2.5rem]"
34
34
  },
35
35
  false: {}
36
36
  }
@@ -39,7 +39,7 @@ export declare const ModalHeaderTv: import('tailwind-variants').TVReturnType<{
39
39
  false: {};
40
40
  };
41
41
  }, {
42
- root: string;
42
+ root: string[];
43
43
  title: string;
44
44
  close: string;
45
45
  }, undefined, {
@@ -58,7 +58,7 @@ export declare const ModalHeaderTv: import('tailwind-variants').TVReturnType<{
58
58
  false: {};
59
59
  };
60
60
  }, {
61
- root: string;
61
+ root: string[];
62
62
  title: string;
63
63
  close: string;
64
64
  }, import('tailwind-variants').TVReturnType<{
@@ -77,7 +77,7 @@ export declare const ModalHeaderTv: import('tailwind-variants').TVReturnType<{
77
77
  false: {};
78
78
  };
79
79
  }, {
80
- root: string;
80
+ root: string[];
81
81
  title: string;
82
82
  close: string;
83
83
  }, undefined, unknown, unknown, undefined>>;
@@ -6,7 +6,7 @@ const ModalTv = tcv({
6
6
  });
7
7
  const ModalHeaderTv = tcv({
8
8
  slots: {
9
- root: "modal__header border-default-boundary w-full flex-none items-center border-b",
9
+ root: ["modal__header", "grid border-default-boundary w-full flex-none items-center border-b"],
10
10
  title: "text-body-medium flex min-w-0 items-center gap-2 p-2 font-strong [grid-area:title] select-none",
11
11
  close: "p-2 [grid-area:close]"
12
12
  },
@@ -21,7 +21,7 @@ const ModalHeaderTv = tcv({
21
21
  },
22
22
  close: {
23
23
  true: {
24
- root: "modal__header--action"
24
+ root: "grid-cols-[auto_1fr_2.5rem]"
25
25
  },
26
26
  false: {}
27
27
  }
@@ -4,7 +4,6 @@ import { useMemo, createContext, useContext } from "react";
4
4
  import { otpInputTv } from "./tv.js";
5
5
  import { tcx } from "../../../shared/utils/tcx/tcx.js";
6
6
  const OTPInputCtx = createContext({
7
- styles: otpInputTv({}),
8
7
  slotProps: [],
9
8
  variant: "default",
10
9
  disabled: false,
@@ -32,30 +31,26 @@ function OTPInputRoot({
32
31
  autoComplete: "off",
33
32
  "data-disabled": disabled || void 0,
34
33
  "data-invalid": isInvalid || void 0,
35
- "data-slot": "otp-input",
36
34
  disabled,
37
- render: ({ slots: slotProps }) => /* @__PURE__ */ jsx(OTPInputCtx.Provider, { value: { styles: tv, slotProps, variant, disabled, isInvalid }, children }),
35
+ render: ({ slots: slotProps }) => /* @__PURE__ */ jsx(OTPInputCtx.Provider, { value: { slotProps, variant, disabled, isInvalid }, children }),
38
36
  ...props
39
37
  }
40
38
  );
41
39
  }
42
40
  function OTPInputGroup({ className, ...props }) {
43
- var _a;
44
- const { styles } = useContext(OTPInputCtx);
41
+ const tv = otpInputTv();
45
42
  return /* @__PURE__ */ jsx(
46
43
  "div",
47
44
  {
48
- className: (_a = styles == null ? void 0 : styles.group) == null ? void 0 : _a.call(styles, { className }),
49
- "data-slot": "otp-input-group",
45
+ className: tcx(tv.group(), className),
50
46
  ...props
51
47
  }
52
48
  );
53
49
  }
54
50
  function OTPInputSlot({ className, index, ...props }) {
55
- var _a, _b, _c, _d;
56
- const { styles, slotProps, variant, disabled, isInvalid } = useContext(OTPInputCtx);
51
+ const { slotProps, variant, disabled, isInvalid } = useContext(OTPInputCtx);
57
52
  const { char, hasFakeCaret, isActive } = (slotProps == null ? void 0 : slotProps[index]) ?? {};
58
- const slotStyles = otpInputTv({
53
+ const tv = otpInputTv({
59
54
  variant,
60
55
  selected: isActive,
61
56
  disabled,
@@ -65,40 +60,24 @@ function OTPInputSlot({ className, index, ...props }) {
65
60
  "div",
66
61
  {
67
62
  ...props,
68
- className: tcx((_a = styles == null ? void 0 : styles.slot) == null ? void 0 : _a.call(styles, { className }), (_b = slotStyles == null ? void 0 : slotStyles.slot) == null ? void 0 : _b.call(slotStyles)),
63
+ className: tcx(tv.slot(), className),
69
64
  "data-active": isActive || void 0,
70
65
  "data-disabled": disabled || void 0,
71
66
  "data-filled": !!char || void 0,
72
67
  "data-invalid": isInvalid || void 0,
73
- "data-slot": "otp-input-slot",
74
68
  children: [
75
- char ? /* @__PURE__ */ jsx(
76
- "div",
77
- {
78
- className: (_c = styles == null ? void 0 : styles.slotValue) == null ? void 0 : _c.call(styles),
79
- "data-slot": "otp-input-slot-value",
80
- children: char
81
- }
82
- ) : null,
83
- hasFakeCaret && isActive ? /* @__PURE__ */ jsx(
84
- "div",
85
- {
86
- className: tcx((_d = styles == null ? void 0 : styles.caret) == null ? void 0 : _d.call(styles), "otp-input__caret"),
87
- "data-slot": "otp-input-caret"
88
- }
89
- ) : null
69
+ char ? /* @__PURE__ */ jsx("div", { className: tv.slotValue(), children: char }) : null,
70
+ hasFakeCaret && isActive ? /* @__PURE__ */ jsx("div", { className: tv.caret() }) : null
90
71
  ]
91
72
  }
92
73
  );
93
74
  }
94
75
  function OTPInputSeparator({ className, children, ...props }) {
95
- var _a;
96
- const { styles } = useContext(OTPInputCtx);
76
+ const tv = otpInputTv();
97
77
  return /* @__PURE__ */ jsx(
98
78
  "div",
99
79
  {
100
- className: (_a = styles == null ? void 0 : styles.separator) == null ? void 0 : _a.call(styles, { className }),
101
- "data-slot": "otp-input-separator",
80
+ className: tcx(tv.separator(), className),
102
81
  ...props,
103
82
  children: children ?? /* @__PURE__ */ jsx("span", { children: "-" })
104
83
  }
@@ -36,7 +36,7 @@ export declare const otpInputTv: import('tailwind-variants').TVReturnType<{
36
36
  group: string;
37
37
  slot: string[];
38
38
  slotValue: string;
39
- caret: string;
39
+ caret: string[];
40
40
  separator: string;
41
41
  }, undefined, {
42
42
  variant: {
@@ -76,7 +76,7 @@ export declare const otpInputTv: import('tailwind-variants').TVReturnType<{
76
76
  group: string;
77
77
  slot: string[];
78
78
  slotValue: string;
79
- caret: string;
79
+ caret: string[];
80
80
  separator: string;
81
81
  }, import('tailwind-variants').TVReturnType<{
82
82
  variant: {
@@ -116,6 +116,6 @@ export declare const otpInputTv: import('tailwind-variants').TVReturnType<{
116
116
  group: string;
117
117
  slot: string[];
118
118
  slotValue: string;
119
- caret: string;
119
+ caret: string[];
120
120
  separator: string;
121
121
  }, undefined, unknown, unknown, undefined>>;
@@ -12,7 +12,7 @@ const otpInputTv = tcv({
12
12
  "border border-solid border-transparent"
13
13
  ],
14
14
  slotValue: "",
15
- caret: "absolute inset-y-2 left-1/2 w-px -translate-x-1/2",
15
+ caret: ["absolute inset-y-2 left-1/2 w-px -translate-x-1/2", "otp-input__caret"],
16
16
  separator: "text-secondary-foreground mx-1"
17
17
  },
18
18
  variants: {