@codefast/ui 0.3.11-canary.1 → 0.3.11

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 (149) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +34 -14
  3. package/dist/components/accordion.d.ts +29 -10
  4. package/dist/components/accordion.js +38 -37
  5. package/dist/components/alert-dialog.d.ts +60 -24
  6. package/dist/components/alert-dialog.js +69 -72
  7. package/dist/components/alert.d.ts +27 -15
  8. package/dist/components/alert.js +29 -31
  9. package/dist/components/aspect-ratio.d.ts +8 -4
  10. package/dist/components/aspect-ratio.js +7 -5
  11. package/dist/components/avatar.d.ts +17 -6
  12. package/dist/components/avatar.js +19 -17
  13. package/dist/components/badge.d.ts +21 -14
  14. package/dist/components/badge.js +19 -22
  15. package/dist/components/breadcrumb.d.ts +35 -12
  16. package/dist/components/breadcrumb.js +48 -54
  17. package/dist/components/button-group.d.ts +29 -14
  18. package/dist/components/button-group.js +27 -32
  19. package/dist/components/button.d.ts +35 -25
  20. package/dist/components/button.js +50 -48
  21. package/dist/components/calendar.d.ts +24 -9
  22. package/dist/components/calendar.js +92 -98
  23. package/dist/components/card.d.ts +34 -10
  24. package/dist/components/card.js +39 -37
  25. package/dist/components/carousel.d.ts +55 -24
  26. package/dist/components/carousel.js +113 -130
  27. package/dist/components/chart.d.ts +72 -36
  28. package/dist/components/chart.js +154 -166
  29. package/dist/components/checkbox-cards.d.ts +15 -8
  30. package/dist/components/checkbox-cards.js +22 -25
  31. package/dist/components/checkbox-group.d.ts +16 -8
  32. package/dist/components/checkbox-group.js +19 -19
  33. package/dist/components/checkbox.d.ts +9 -4
  34. package/dist/components/checkbox.js +14 -14
  35. package/dist/components/collapsible.d.ts +14 -6
  36. package/dist/components/collapsible.js +18 -16
  37. package/dist/components/command.d.ts +55 -23
  38. package/dist/components/command.js +70 -85
  39. package/dist/components/context-menu.d.ts +72 -22
  40. package/dist/components/context-menu.js +88 -109
  41. package/dist/components/dialog.d.ts +53 -22
  42. package/dist/components/dialog.js +71 -85
  43. package/dist/components/drawer.d.ts +60 -28
  44. package/dist/components/drawer.js +59 -67
  45. package/dist/components/dropdown-menu.d.ts +73 -22
  46. package/dist/components/dropdown-menu.js +95 -112
  47. package/dist/components/empty.d.ts +37 -15
  48. package/dist/components/empty.js +43 -45
  49. package/dist/components/field.d.ts +63 -25
  50. package/dist/components/field.js +88 -104
  51. package/dist/components/form.d.ts +37 -15
  52. package/dist/components/form.js +65 -70
  53. package/dist/components/hover-card.d.ts +21 -7
  54. package/dist/components/hover-card.js +24 -24
  55. package/dist/components/input-group.d.ts +53 -28
  56. package/dist/components/input-group.js +63 -77
  57. package/dist/components/input-number.d.ts +28 -7
  58. package/dist/components/input-number.js +55 -59
  59. package/dist/components/input-otp.d.ts +24 -10
  60. package/dist/components/input-otp.js +33 -37
  61. package/dist/components/input-password.d.ts +12 -5
  62. package/dist/components/input-password.js +31 -32
  63. package/dist/components/input-search.d.ts +18 -8
  64. package/dist/components/input-search.js +43 -41
  65. package/dist/components/input.d.ts +10 -4
  66. package/dist/components/input.js +9 -7
  67. package/dist/components/item.d.ts +69 -32
  68. package/dist/components/item.js +89 -92
  69. package/dist/components/kbd.d.ts +13 -5
  70. package/dist/components/kbd.js +13 -11
  71. package/dist/components/label.d.ts +9 -4
  72. package/dist/components/label.js +9 -7
  73. package/dist/components/menubar.d.ts +80 -23
  74. package/dist/components/menubar.js +97 -118
  75. package/dist/components/native-select.d.ts +16 -6
  76. package/dist/components/native-select.js +25 -26
  77. package/dist/components/navigation-menu.d.ts +36 -12
  78. package/dist/components/navigation-menu.js +60 -75
  79. package/dist/components/pagination.d.ts +35 -14
  80. package/dist/components/pagination.js +54 -69
  81. package/dist/components/popover.d.ts +24 -8
  82. package/dist/components/popover.js +28 -28
  83. package/dist/components/progress-circle.d.ts +106 -88
  84. package/dist/components/progress-circle.js +106 -138
  85. package/dist/components/progress.d.ts +10 -4
  86. package/dist/components/progress.js +14 -14
  87. package/dist/components/radio-cards.d.ts +10 -4
  88. package/dist/components/radio-cards.js +22 -23
  89. package/dist/components/radio-group.d.ts +13 -5
  90. package/dist/components/radio-group.js +18 -16
  91. package/dist/components/radio.d.ts +12 -5
  92. package/dist/components/radio.js +10 -8
  93. package/dist/components/resizable.d.ts +18 -7
  94. package/dist/components/resizable.js +22 -22
  95. package/dist/components/scroll-area.d.ts +33 -20
  96. package/dist/components/scroll-area.js +84 -88
  97. package/dist/components/select.d.ts +50 -16
  98. package/dist/components/select.js +77 -96
  99. package/dist/components/separator.d.ts +29 -19
  100. package/dist/components/separator.js +36 -34
  101. package/dist/components/sheet.d.ts +62 -29
  102. package/dist/components/sheet.js +79 -100
  103. package/dist/components/sidebar.d.ts +160 -66
  104. package/dist/components/sidebar.js +294 -336
  105. package/dist/components/skeleton.d.ts +9 -4
  106. package/dist/components/skeleton.js +8 -6
  107. package/dist/components/slider.d.ts +13 -4
  108. package/dist/components/slider.js +34 -40
  109. package/dist/components/sonner.d.ts +10 -7
  110. package/dist/components/sonner.js +16 -14
  111. package/dist/components/spinner.d.ts +12 -5
  112. package/dist/components/spinner.js +33 -35
  113. package/dist/components/switch.d.ts +9 -4
  114. package/dist/components/switch.js +13 -11
  115. package/dist/components/table.d.ts +37 -11
  116. package/dist/components/table.js +47 -45
  117. package/dist/components/tabs.d.ts +21 -7
  118. package/dist/components/tabs.js +24 -22
  119. package/dist/components/textarea.d.ts +9 -4
  120. package/dist/components/textarea.js +8 -6
  121. package/dist/components/toggle-group.d.ts +24 -9
  122. package/dist/components/toggle-group.js +41 -42
  123. package/dist/components/toggle.d.ts +25 -17
  124. package/dist/components/toggle.js +30 -28
  125. package/dist/components/tooltip.d.ts +24 -8
  126. package/dist/components/tooltip.js +29 -32
  127. package/dist/hooks/use-animated-value.d.ts +4 -1
  128. package/dist/hooks/use-animated-value.js +57 -36
  129. package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
  130. package/dist/hooks/use-copy-to-clipboard.js +39 -20
  131. package/dist/hooks/use-is-mobile.d.ts +4 -1
  132. package/dist/hooks/use-is-mobile.js +21 -1
  133. package/dist/hooks/use-media-query.d.ts +4 -1
  134. package/dist/hooks/use-media-query.js +45 -18
  135. package/dist/hooks/use-mutation-observer.d.ts +6 -2
  136. package/dist/hooks/use-mutation-observer.js +34 -16
  137. package/dist/hooks/use-pagination.d.ts +22 -14
  138. package/dist/hooks/use-pagination.js +100 -49
  139. package/dist/index.d.ts +69 -130
  140. package/dist/index.js +11 -11
  141. package/dist/primitives/checkbox-group.d.ts +105 -83
  142. package/dist/primitives/checkbox-group.js +111 -84
  143. package/dist/primitives/input-number.d.ts +51 -40
  144. package/dist/primitives/input-number.js +483 -350
  145. package/dist/primitives/input.d.ts +48 -42
  146. package/dist/primitives/input.js +65 -43
  147. package/dist/primitives/progress-circle.d.ts +79 -48
  148. package/dist/primitives/progress-circle.js +154 -105
  149. package/package.json +6 -7
@@ -1,65 +1,61 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { cn } from "@codefast/tailwind-variants";
4
- import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
5
2
  import { buttonVariants } from "./button.js";
6
3
  import { Spinner } from "./spinner.js";
7
- import { DecrementButton, Field, IncrementButton, Root } from "../primitives/input-number.js";
4
+ import { DecrementButton as InputNumberDecrementButton, Field as InputNumberField, IncrementButton as InputNumberIncrementButton, InputNumber as InputNumber$1 } from "../primitives/input-number.js";
5
+ import { cn } from "@codefast/tailwind-variants";
6
+ import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/input-number.tsx
8
9
  function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaultValue, disabled, formatOptions, id, loaderPosition, loading, max, min, onChange, prefix, readOnly, spinner, step, suffix, value, ...props }) {
9
- return /*#__PURE__*/ jsxs(Root, {
10
- ariaDecrementLabel: ariaDecrementLabel,
11
- ariaIncrementLabel: ariaIncrementLabel,
12
- className: cn("group peer flex h-9 w-full grow items-center gap-3 rounded-lg border border-input px-3 pr-0 text-base transition not-has-disabled:shadow-xs focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 hover:not-has-disabled:not-focus-within:border-ring/60 has-disabled:opacity-50 has-aria-invalid:border-destructive focus-within:has-aria-invalid:ring-destructive/20 hover:not-has-disabled:not-focus-within:has-aria-invalid:border-destructive/60 md:text-sm dark:bg-input/30 dark:focus-within:has-aria-invalid:ring-destructive/40 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>svg]:text-muted-foreground", className),
13
- "data-slot": "input-number",
14
- defaultValue: defaultValue,
15
- disabled: disabled,
16
- formatOptions: formatOptions,
17
- id: id,
18
- loaderPosition: loaderPosition,
19
- loading: loading,
20
- max: max,
21
- min: min,
22
- prefix: prefix,
23
- readOnly: readOnly,
24
- spinner: spinner ?? /*#__PURE__*/ jsx(Spinner, {}, "spinner"),
25
- step: step,
26
- suffix: suffix,
27
- value: value,
28
- onChange: onChange,
29
- children: [
30
- /*#__PURE__*/ jsx(Field, {
31
- autoCapitalize: "none",
32
- autoComplete: "off",
33
- autoCorrect: "off",
34
- className: "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
35
- spellCheck: "false",
36
- ...props
37
- }),
38
- /*#__PURE__*/ jsxs("div", {
39
- className: cn("group-hover:not-group-focus-within:not-has-disabled:border-l-border-ring/60 group-hover:not-group-focus-within:not-has-disabled:divide-border-ring/60 order-last ml-auto grid h-full shrink-0 divide-y divide-input border-l border-l-input transition group-focus-within:divide-ring group-focus-within:border-l-ring group-has-aria-invalid:divide-destructive group-has-aria-invalid:border-l-destructive group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:divide-destructive/60 group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:border-l-destructive/60", "*:[button]:focus-visible:bg-ring/50 *:[button]:focus-visible:ring-0 group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/20 dark:group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/40"),
40
- "data-slot": "input-number-buttons",
41
- children: [
42
- /*#__PURE__*/ jsx(IncrementButton, {
43
- "aria-label": "Increment",
44
- className: buttonVariants({
45
- className: "text-muted-foreground h-auto rounded-none rounded-tr-[calc(var(--radius-lg)-1px)]",
46
- variant: "ghost"
47
- }),
48
- "data-slot": "input-number-increment-button",
49
- children: /*#__PURE__*/ jsx(ChevronUpIcon, {})
50
- }),
51
- /*#__PURE__*/ jsx(DecrementButton, {
52
- "aria-label": "Decrement",
53
- className: buttonVariants({
54
- className: "text-muted-foreground h-auto rounded-none rounded-br-[calc(var(--radius-lg)-1px)]",
55
- variant: "ghost"
56
- }),
57
- "data-slot": "input-number-decrement-button",
58
- children: /*#__PURE__*/ jsx(ChevronDownIcon, {})
59
- })
60
- ]
61
- })
62
- ]
63
- });
10
+ return /* @__PURE__ */ jsxs(InputNumber$1, {
11
+ ariaDecrementLabel,
12
+ ariaIncrementLabel,
13
+ className: cn("group peer flex h-9 w-full grow items-center gap-3 rounded-lg border border-input px-3 pr-0 text-base transition not-has-disabled:shadow-xs focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 hover:not-has-disabled:not-focus-within:border-ring/60 has-disabled:opacity-50 has-aria-invalid:border-destructive focus-within:has-aria-invalid:ring-destructive/20 hover:not-has-disabled:not-focus-within:has-aria-invalid:border-destructive/60 md:text-sm dark:bg-input/30 dark:focus-within:has-aria-invalid:ring-destructive/40 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>svg]:text-muted-foreground", className),
14
+ "data-slot": "input-number",
15
+ defaultValue,
16
+ disabled,
17
+ formatOptions,
18
+ id,
19
+ loaderPosition,
20
+ loading,
21
+ max,
22
+ min,
23
+ prefix,
24
+ readOnly,
25
+ spinner: spinner ?? /* @__PURE__ */ jsx(Spinner, {}, "spinner"),
26
+ step,
27
+ suffix,
28
+ value,
29
+ onChange,
30
+ children: [/* @__PURE__ */ jsx(InputNumberField, {
31
+ autoCapitalize: "none",
32
+ autoComplete: "off",
33
+ autoCorrect: "off",
34
+ className: "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
35
+ spellCheck: "false",
36
+ ...props
37
+ }), /* @__PURE__ */ jsxs("div", {
38
+ className: cn("group-hover:not-group-focus-within:not-has-disabled:border-l-border-ring/60 group-hover:not-group-focus-within:not-has-disabled:divide-border-ring/60 order-last ml-auto grid h-full shrink-0 divide-y divide-input border-l border-l-input transition group-focus-within:divide-ring group-focus-within:border-l-ring group-has-aria-invalid:divide-destructive group-has-aria-invalid:border-l-destructive group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:divide-destructive/60 group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:border-l-destructive/60", "*:[button]:focus-visible:bg-ring/50 *:[button]:focus-visible:ring-0 group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/20 dark:group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/40"),
39
+ "data-slot": "input-number-buttons",
40
+ children: [/* @__PURE__ */ jsx(InputNumberIncrementButton, {
41
+ "aria-label": "Increment",
42
+ className: buttonVariants({
43
+ className: "text-muted-foreground h-auto rounded-none rounded-tr-[calc(var(--radius-lg)-1px)]",
44
+ variant: "ghost"
45
+ }),
46
+ "data-slot": "input-number-increment-button",
47
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, {})
48
+ }), /* @__PURE__ */ jsx(InputNumberDecrementButton, {
49
+ "aria-label": "Decrement",
50
+ className: buttonVariants({
51
+ className: "text-muted-foreground h-auto rounded-none rounded-br-[calc(var(--radius-lg)-1px)]",
52
+ variant: "ghost"
53
+ }),
54
+ "data-slot": "input-number-decrement-button",
55
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
56
+ })]
57
+ })]
58
+ });
64
59
  }
60
+ //#endregion
65
61
  export { InputNumber };
@@ -1,15 +1,29 @@
1
- import type { ComponentProps, JSX } from "react";
2
- import { OTPInput } from "input-otp";
1
+ import { ComponentProps, JSX } from "react";
2
+ import { OTPInput, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
3
+
4
+ //#region src/components/input-otp.d.ts
3
5
  type InputOTPProps = ComponentProps<typeof OTPInput>;
4
- declare function InputOTP({ className, containerClassName, ...props }: InputOTPProps): JSX.Element;
6
+ declare function InputOTP({
7
+ className,
8
+ containerClassName,
9
+ ...props
10
+ }: InputOTPProps): JSX.Element;
5
11
  type InputOTPGroupProps = ComponentProps<"div">;
6
- declare function InputOTPGroup({ className, ...props }: InputOTPGroupProps): JSX.Element;
12
+ declare function InputOTPGroup({
13
+ className,
14
+ ...props
15
+ }: InputOTPGroupProps): JSX.Element;
7
16
  interface InputOTPSlotProps extends ComponentProps<"div"> {
8
- index: number;
17
+ index: number;
9
18
  }
10
- declare function InputOTPSlot({ className, index, ...props }: InputOTPSlotProps): JSX.Element;
19
+ declare function InputOTPSlot({
20
+ className,
21
+ index,
22
+ ...props
23
+ }: InputOTPSlotProps): JSX.Element;
11
24
  type InputOTPSeparatorProps = ComponentProps<"div">;
12
- declare function InputOTPSeparator({ ...props }: InputOTPSeparatorProps): JSX.Element;
13
- export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
14
- export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
15
- export type { InputOTPGroupProps, InputOTPProps, InputOTPSeparatorProps, InputOTPSlotProps };
25
+ declare function InputOTPSeparator({
26
+ ...props
27
+ }: InputOTPSeparatorProps): JSX.Element;
28
+ //#endregion
29
+ export { InputOTP, InputOTPGroup, type InputOTPGroupProps, type InputOTPProps, InputOTPSeparator, type InputOTPSeparatorProps, InputOTPSlot, type InputOTPSlotProps, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS };
@@ -1,50 +1,46 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
2
  import { cn } from "@codefast/tailwind-variants";
4
- import { OTPInput, OTPInputContext, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
5
3
  import { MinusIcon } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
6
5
  import { use } from "react";
6
+ import { OTPInput, OTPInputContext, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
7
+ //#region src/components/input-otp.tsx
7
8
  function InputOTP({ className, containerClassName, ...props }) {
8
- return /*#__PURE__*/ jsx(OTPInput, {
9
- "aria-label": "One-time password",
10
- className: cn(className),
11
- containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
12
- "data-slot": "input-otp",
13
- ...props
14
- });
9
+ return /* @__PURE__ */ jsx(OTPInput, {
10
+ "aria-label": "One-time password",
11
+ className: cn(className),
12
+ containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
13
+ "data-slot": "input-otp",
14
+ ...props
15
+ });
15
16
  }
16
17
  function InputOTPGroup({ className, ...props }) {
17
- return /*#__PURE__*/ jsx("div", {
18
- className: cn("flex items-center -space-x-px", className),
19
- "data-slot": "input-otp-group",
20
- role: "group",
21
- ...props
22
- });
18
+ return /* @__PURE__ */ jsx("div", {
19
+ className: cn("flex items-center -space-x-px", className),
20
+ "data-slot": "input-otp-group",
21
+ role: "group",
22
+ ...props
23
+ });
23
24
  }
24
25
  function InputOTPSlot({ className, index, ...props }) {
25
- const inputOTPContext = use(OTPInputContext);
26
- const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
27
- return /*#__PURE__*/ jsxs("div", {
28
- className: cn("relative flex size-9 items-center justify-center border border-input text-sm outline-hidden transition-all not-has-disabled:shadow-xs first:rounded-l-lg last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", className),
29
- "data-active": isActive,
30
- "data-slot": "input-otp-slot",
31
- ...props,
32
- children: [
33
- char,
34
- hasFakeCaret ? /*#__PURE__*/ jsx("div", {
35
- className: "pointer-events-none absolute inset-0 flex items-center justify-center",
36
- children: /*#__PURE__*/ jsx("div", {
37
- className: "h-4 w-px animate-caret-blink bg-foreground animation-duration-1000"
38
- })
39
- }) : null
40
- ]
41
- });
26
+ const { char, hasFakeCaret, isActive } = use(OTPInputContext).slots[index];
27
+ return /* @__PURE__ */ jsxs("div", {
28
+ className: cn("relative flex size-9 items-center justify-center border border-input text-sm outline-hidden transition-all not-has-disabled:shadow-xs first:rounded-l-lg last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", className),
29
+ "data-active": isActive,
30
+ "data-slot": "input-otp-slot",
31
+ ...props,
32
+ children: [char, hasFakeCaret ? /* @__PURE__ */ jsx("div", {
33
+ className: "pointer-events-none absolute inset-0 flex items-center justify-center",
34
+ children: /* @__PURE__ */ jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground animation-duration-1000" })
35
+ }) : null]
36
+ });
42
37
  }
43
38
  function InputOTPSeparator({ ...props }) {
44
- return /*#__PURE__*/ jsx("div", {
45
- "data-slot": "input-otp-separator",
46
- ...props,
47
- children: /*#__PURE__*/ jsx(MinusIcon, {})
48
- });
39
+ return /* @__PURE__ */ jsx("div", {
40
+ "data-slot": "input-otp-separator",
41
+ ...props,
42
+ children: /* @__PURE__ */ jsx(MinusIcon, {})
43
+ });
49
44
  }
45
+ //#endregion
50
46
  export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS };
@@ -1,6 +1,13 @@
1
- import type { ComponentProps, JSX } from "react";
2
- import { InputGroupInput } from "./input-group";
1
+ import { InputGroupInput } from "./input-group.js";
2
+ import { ComponentProps, JSX } from "react";
3
+
4
+ //#region src/components/input-password.d.ts
3
5
  type InputPasswordProps = Omit<ComponentProps<typeof InputGroupInput>, "type">;
4
- declare function InputPassword({ className, disabled, readOnly, ...props }: InputPasswordProps): JSX.Element;
5
- export { InputPassword };
6
- export type { InputPasswordProps };
6
+ declare function InputPassword({
7
+ className,
8
+ disabled,
9
+ readOnly,
10
+ ...props
11
+ }: InputPasswordProps): JSX.Element;
12
+ //#endregion
13
+ export { InputPassword, type InputPasswordProps };
@@ -1,38 +1,37 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { InputGroup, InputGroupButton, InputGroupInput } from "./input-group.js";
3
3
  import { EyeIcon, EyeOffIcon } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
4
5
  import { useCallback, useState } from "react";
5
- import { InputGroup, InputGroupButton, InputGroupInput } from "./input-group.js";
6
+ //#region src/components/input-password.tsx
6
7
  function InputPassword({ className, disabled, readOnly, ...props }) {
7
- const [type, setType] = useState("password");
8
- const togglePasswordVisibility = useCallback(()=>{
9
- setType((previous)=>"password" === previous ? "text" : "password");
10
- }, []);
11
- return /*#__PURE__*/ jsxs(InputGroup, {
12
- className: className,
13
- "data-disabled": disabled ? "true" : void 0,
14
- "data-slot": "input-password",
15
- children: [
16
- /*#__PURE__*/ jsx(InputGroupInput, {
17
- autoCapitalize: "none",
18
- "data-slot": "input-password-item",
19
- disabled: disabled,
20
- readOnly: readOnly,
21
- type: type,
22
- ...props
23
- }),
24
- /*#__PURE__*/ jsx(InputGroupButton, {
25
- "aria-label": "password" === type ? "Show password" : "Hide password",
26
- className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
27
- "data-slot": "input-password-toggle",
28
- disabled: disabled,
29
- size: "icon-sm",
30
- type: "button",
31
- variant: "ghost",
32
- onClick: togglePasswordVisibility,
33
- children: "password" === type ? /*#__PURE__*/ jsx(EyeOffIcon, {}) : /*#__PURE__*/ jsx(EyeIcon, {})
34
- })
35
- ]
36
- });
8
+ const [type, setType] = useState("password");
9
+ const togglePasswordVisibility = useCallback(() => {
10
+ setType((previous) => previous === "password" ? "text" : "password");
11
+ }, []);
12
+ return /* @__PURE__ */ jsxs(InputGroup, {
13
+ className,
14
+ "data-disabled": disabled ? "true" : void 0,
15
+ "data-slot": "input-password",
16
+ children: [/* @__PURE__ */ jsx(InputGroupInput, {
17
+ autoCapitalize: "none",
18
+ "data-slot": "input-password-item",
19
+ disabled,
20
+ readOnly,
21
+ type,
22
+ ...props
23
+ }), /* @__PURE__ */ jsx(InputGroupButton, {
24
+ "aria-label": type === "password" ? "Show password" : "Hide password",
25
+ className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
26
+ "data-slot": "input-password-toggle",
27
+ disabled,
28
+ size: "icon-sm",
29
+ type: "button",
30
+ variant: "ghost",
31
+ onClick: togglePasswordVisibility,
32
+ children: type === "password" ? /* @__PURE__ */ jsx(EyeOffIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {})
33
+ })]
34
+ });
37
35
  }
36
+ //#endregion
38
37
  export { InputPassword };
@@ -1,10 +1,20 @@
1
- import type { ComponentProps, JSX } from "react";
2
- import { InputGroupInput } from "./input-group";
1
+ import { InputGroupInput } from "./input-group.js";
2
+ import { ComponentProps, JSX } from "react";
3
+
4
+ //#region src/components/input-search.d.ts
3
5
  interface InputSearchProps extends Omit<ComponentProps<typeof InputGroupInput>, "defaultValue" | "onChange" | "type" | "value"> {
4
- defaultValue?: string;
5
- onChange?: (value?: string) => void;
6
- value?: string;
6
+ defaultValue?: string;
7
+ onChange?: (value?: string) => void;
8
+ value?: string;
7
9
  }
8
- declare function InputSearch({ className, defaultValue, disabled, onChange, readOnly, value: valueProperty, ...props }: InputSearchProps): JSX.Element;
9
- export { InputSearch };
10
- export type { InputSearchProps };
10
+ declare function InputSearch({
11
+ className,
12
+ defaultValue,
13
+ disabled,
14
+ onChange,
15
+ readOnly,
16
+ value: valueProperty,
17
+ ...props
18
+ }: InputSearchProps): JSX.Element;
19
+ //#endregion
20
+ export { InputSearch, type InputSearchProps };
@@ -1,47 +1,49 @@
1
1
  "use client";
2
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
3
+ import { SearchIcon, XIcon } from "lucide-react";
2
4
  import { jsx, jsxs } from "react/jsx-runtime";
3
5
  import { useControllableState } from "@radix-ui/react-use-controllable-state";
4
- import { SearchIcon, XIcon } from "lucide-react";
5
- import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
6
+ //#region src/components/input-search.tsx
6
7
  function InputSearch({ className, defaultValue, disabled, onChange, readOnly, value: valueProperty, ...props }) {
7
- const [value, setValue] = useControllableState({
8
- defaultProp: defaultValue,
9
- onChange,
10
- prop: valueProperty
11
- });
12
- return /*#__PURE__*/ jsxs(InputGroup, {
13
- className: className,
14
- "data-disabled": disabled ? "true" : void 0,
15
- "data-slot": "input-search",
16
- children: [
17
- /*#__PURE__*/ jsx(InputGroupAddon, {
18
- align: "inline-start",
19
- children: /*#__PURE__*/ jsx(SearchIcon, {})
20
- }),
21
- /*#__PURE__*/ jsx(InputGroupInput, {
22
- "data-slot": "input-search-item",
23
- disabled: disabled,
24
- readOnly: readOnly,
25
- type: "search",
26
- value: value ?? "",
27
- onChange: (event)=>{
28
- setValue(event.target.value);
29
- },
30
- ...props
31
- }),
32
- value ? /*#__PURE__*/ jsx(InputGroupButton, {
33
- "aria-label": "Clear search",
34
- className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
35
- "data-slot": "input-search-clear",
36
- disabled: disabled ?? readOnly,
37
- size: "icon-sm",
38
- variant: "ghost",
39
- onClick: ()=>{
40
- setValue("");
41
- },
42
- children: /*#__PURE__*/ jsx(XIcon, {})
43
- }) : null
44
- ]
45
- });
8
+ const [value, setValue] = useControllableState({
9
+ defaultProp: defaultValue,
10
+ onChange,
11
+ prop: valueProperty
12
+ });
13
+ return /* @__PURE__ */ jsxs(InputGroup, {
14
+ className,
15
+ "data-disabled": disabled ? "true" : void 0,
16
+ "data-slot": "input-search",
17
+ children: [
18
+ /* @__PURE__ */ jsx(InputGroupAddon, {
19
+ align: "inline-start",
20
+ children: /* @__PURE__ */ jsx(SearchIcon, {})
21
+ }),
22
+ /* @__PURE__ */ jsx(InputGroupInput, {
23
+ "data-slot": "input-search-item",
24
+ disabled,
25
+ readOnly,
26
+ type: "search",
27
+ value: value ?? "",
28
+ onChange: (event) => {
29
+ setValue(event.target.value);
30
+ },
31
+ ...props
32
+ }),
33
+ value ? /* @__PURE__ */ jsx(InputGroupButton, {
34
+ "aria-label": "Clear search",
35
+ className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
36
+ "data-slot": "input-search-clear",
37
+ disabled: disabled ?? readOnly,
38
+ size: "icon-sm",
39
+ variant: "ghost",
40
+ onClick: () => {
41
+ setValue("");
42
+ },
43
+ children: /* @__PURE__ */ jsx(XIcon, {})
44
+ }) : null
45
+ ]
46
+ });
46
47
  }
48
+ //#endregion
47
49
  export { InputSearch };
@@ -1,5 +1,11 @@
1
- import type { ComponentProps, JSX } from "react";
1
+ import { ComponentProps, JSX } from "react";
2
+
3
+ //#region src/components/input.d.ts
2
4
  type InputProps = ComponentProps<"input">;
3
- declare function Input({ className, type, ...props }: InputProps): JSX.Element;
4
- export { Input };
5
- export type { InputProps };
5
+ declare function Input({
6
+ className,
7
+ type,
8
+ ...props
9
+ }: InputProps): JSX.Element;
10
+ //#endregion
11
+ export { Input, type InputProps };
@@ -1,12 +1,14 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { cn } from "@codefast/tailwind-variants";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/components/input.tsx
4
5
  function Input({ className, type, ...props }) {
5
- return /*#__PURE__*/ jsx("input", {
6
- className: cn("h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className),
7
- "data-slot": "input",
8
- type: type,
9
- ...props
10
- });
6
+ return /* @__PURE__ */ jsx("input", {
7
+ className: cn("h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className),
8
+ "data-slot": "input",
9
+ type,
10
+ ...props
11
+ });
11
12
  }
13
+ //#endregion
12
14
  export { Input };
@@ -1,45 +1,82 @@
1
- import type { VariantProps } from "@codefast/tailwind-variants";
2
- import type { ComponentProps, JSX } from "react";
3
- import { Separator } from "./separator";
4
- declare const itemVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
5
- size: {
6
- default: string;
7
- sm: string;
8
- };
9
- variant: {
10
- default: string;
11
- muted: string;
12
- outline: string;
13
- };
1
+ import { Separator } from "./separator.js";
2
+ import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
3
+ import { VariantProps } from "@codefast/tailwind-variants";
4
+ import { ComponentProps, JSX } from "react";
5
+
6
+ //#region src/components/item.d.ts
7
+ declare const itemVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
8
+ size: {
9
+ default: string;
10
+ sm: string;
11
+ };
12
+ variant: {
13
+ default: string;
14
+ muted: string;
15
+ outline: string;
16
+ };
14
17
  }, Record<string, never>>;
15
- declare const itemMediaVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
16
- variant: {
17
- default: string;
18
- icon: string;
19
- image: string;
20
- };
18
+ declare const itemMediaVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
19
+ variant: {
20
+ default: string;
21
+ icon: string;
22
+ image: string;
23
+ };
21
24
  }, Record<string, never>>;
22
25
  type ItemGroupProps = ComponentProps<"div">;
23
- declare function ItemGroup({ className, ...props }: ItemGroupProps): JSX.Element;
26
+ declare function ItemGroup({
27
+ className,
28
+ ...props
29
+ }: ItemGroupProps): JSX.Element;
24
30
  type ItemSeparatorProps = ComponentProps<typeof Separator>;
25
- declare function ItemSeparator({ className, ...props }: ItemSeparatorProps): JSX.Element;
31
+ declare function ItemSeparator({
32
+ className,
33
+ ...props
34
+ }: ItemSeparatorProps): JSX.Element;
26
35
  type ItemProps = ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
27
- asChild?: boolean;
36
+ asChild?: boolean;
28
37
  };
29
- declare function Item({ asChild, className, size, variant, ...props }: ItemProps): JSX.Element;
38
+ declare function Item({
39
+ asChild,
40
+ className,
41
+ size,
42
+ variant,
43
+ ...props
44
+ }: ItemProps): JSX.Element;
30
45
  type ItemMediaProps = ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>;
31
- declare function ItemMedia({ className, variant, ...props }: ItemMediaProps): JSX.Element;
46
+ declare function ItemMedia({
47
+ className,
48
+ variant,
49
+ ...props
50
+ }: ItemMediaProps): JSX.Element;
32
51
  type ItemContentProps = ComponentProps<"div">;
33
- declare function ItemContent({ className, ...props }: ItemContentProps): JSX.Element;
52
+ declare function ItemContent({
53
+ className,
54
+ ...props
55
+ }: ItemContentProps): JSX.Element;
34
56
  type ItemTitleProps = ComponentProps<"div">;
35
- declare function ItemTitle({ className, ...props }: ItemTitleProps): JSX.Element;
57
+ declare function ItemTitle({
58
+ className,
59
+ ...props
60
+ }: ItemTitleProps): JSX.Element;
36
61
  type ItemDescriptionProps = ComponentProps<"p">;
37
- declare function ItemDescription({ className, ...props }: ItemDescriptionProps): JSX.Element;
62
+ declare function ItemDescription({
63
+ className,
64
+ ...props
65
+ }: ItemDescriptionProps): JSX.Element;
38
66
  type ItemActionsProps = ComponentProps<"div">;
39
- declare function ItemActions({ className, ...props }: ItemActionsProps): JSX.Element;
67
+ declare function ItemActions({
68
+ className,
69
+ ...props
70
+ }: ItemActionsProps): JSX.Element;
40
71
  type ItemHeaderProps = ComponentProps<"div">;
41
- declare function ItemHeader({ className, ...props }: ItemHeaderProps): JSX.Element;
72
+ declare function ItemHeader({
73
+ className,
74
+ ...props
75
+ }: ItemHeaderProps): JSX.Element;
42
76
  type ItemFooterProps = ComponentProps<"div">;
43
- declare function ItemFooter({ className, ...props }: ItemFooterProps): JSX.Element;
44
- export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, itemMediaVariants, ItemSeparator, ItemTitle, itemVariants, };
45
- export type { ItemActionsProps, ItemContentProps, ItemDescriptionProps, ItemFooterProps, ItemGroupProps, ItemHeaderProps, ItemMediaProps, ItemProps, ItemSeparatorProps, ItemTitleProps, };
77
+ declare function ItemFooter({
78
+ className,
79
+ ...props
80
+ }: ItemFooterProps): JSX.Element;
81
+ //#endregion
82
+ export { Item, ItemActions, type ItemActionsProps, ItemContent, type ItemContentProps, ItemDescription, type ItemDescriptionProps, ItemFooter, type ItemFooterProps, ItemGroup, type ItemGroupProps, ItemHeader, type ItemHeaderProps, ItemMedia, type ItemMediaProps, type ItemProps, ItemSeparator, type ItemSeparatorProps, ItemTitle, type ItemTitleProps, itemMediaVariants, itemVariants };