@teach-in/react 1.0.0 → 1.2.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.
Files changed (120) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +9 -9
  3. package/dist/{chunk-AMNORHD6.mjs → chunk-2ASQXBDD.mjs} +1 -1
  4. package/dist/{chunk-3VAZY2QK.mjs → chunk-2CEZXLZR.mjs} +1 -1
  5. package/dist/chunk-2UHA3DYG.mjs +62 -0
  6. package/dist/{chunk-LJIVY6GU.mjs → chunk-46SKVFMZ.mjs} +1 -1
  7. package/dist/{chunk-JDFRAN4S.mjs → chunk-5FFWQB7D.mjs} +12 -2
  8. package/dist/chunk-C2VWADF5.mjs +34 -0
  9. package/dist/{chunk-NLHQDWUK.mjs → chunk-CKJ5U5Q4.mjs} +1 -1
  10. package/dist/chunk-CUEG2BFV.mjs +34 -0
  11. package/dist/{chunk-CETCW7DS.mjs → chunk-IU2JYI7W.mjs} +1 -1
  12. package/dist/{chunk-KTUGFQWJ.mjs → chunk-KTWHCUYV.mjs} +1 -1
  13. package/dist/chunk-M5G6RR4Q.mjs +39 -0
  14. package/dist/chunk-MCQGBAUS.mjs +73 -0
  15. package/dist/chunk-NSU66J5E.mjs +59 -0
  16. package/dist/{chunk-CFG5V7VB.mjs → chunk-QCLLPJMB.mjs} +2 -2
  17. package/dist/{chunk-R7LDL5CU.mjs → chunk-R46SWVWL.mjs} +1 -1
  18. package/dist/chunk-SEJXJZSK.mjs +64 -0
  19. package/dist/chunk-TUIN5YJW.mjs +33 -0
  20. package/dist/chunk-UQAG7TKJ.mjs +1 -0
  21. package/dist/chunk-VXYV37IM.mjs +74 -0
  22. package/dist/index.js +609 -228
  23. package/dist/index.mjs +106 -86
  24. package/dist/ui/data/index.mjs +10 -10
  25. package/dist/ui/feedback/index.mjs +8 -8
  26. package/dist/ui/form/index.js +447 -106
  27. package/dist/ui/form/index.mjs +25 -15
  28. package/dist/ui/form/rhf/fields/autocomplete-field.mjs +16 -10
  29. package/dist/ui/form/rhf/fields/checkbox-field.mjs +16 -10
  30. package/dist/ui/form/rhf/fields/date-picker-field.mjs +16 -10
  31. package/dist/ui/form/rhf/fields/email-field.js +147 -10
  32. package/dist/ui/form/rhf/fields/email-field.mjs +17 -11
  33. package/dist/ui/form/rhf/fields/index.d.ts +1 -0
  34. package/dist/ui/form/rhf/fields/index.js +443 -102
  35. package/dist/ui/form/rhf/fields/index.mjs +25 -15
  36. package/dist/ui/form/rhf/fields/input-field.js +153 -6
  37. package/dist/ui/form/rhf/fields/input-field.mjs +17 -11
  38. package/dist/ui/form/rhf/fields/radio-field.mjs +16 -10
  39. package/dist/ui/form/rhf/fields/search-field.d.ts +10 -0
  40. package/dist/ui/form/rhf/fields/search-field.js +296 -0
  41. package/dist/ui/form/rhf/fields/search-field.mjs +37 -0
  42. package/dist/ui/form/rhf/fields/select-field.js +136 -26
  43. package/dist/ui/form/rhf/fields/select-field.mjs +17 -11
  44. package/dist/ui/form/rhf/fields/switch-field.mjs +16 -10
  45. package/dist/ui/form/rhf/fields/text-field.js +147 -10
  46. package/dist/ui/form/rhf/fields/text-field.mjs +17 -11
  47. package/dist/ui/form/rhf/fields/textarea-field.mjs +16 -10
  48. package/dist/ui/form/rhf/index.js +443 -102
  49. package/dist/ui/form/rhf/index.mjs +25 -15
  50. package/dist/ui/format/index.d.ts +1 -0
  51. package/dist/ui/format/index.js +41 -5
  52. package/dist/ui/format/index.mjs +15 -11
  53. package/dist/ui/format/uuid.d.ts +12 -0
  54. package/dist/ui/format/uuid.js +62 -0
  55. package/dist/ui/format/uuid.mjs +7 -0
  56. package/dist/ui/index.js +609 -228
  57. package/dist/ui/index.mjs +106 -86
  58. package/dist/ui/inputs/clear-button.d.ts +5 -0
  59. package/dist/ui/inputs/clear-button.js +67 -0
  60. package/dist/ui/inputs/clear-button.mjs +8 -0
  61. package/dist/ui/inputs/email/email.js +144 -7
  62. package/dist/ui/inputs/email/email.mjs +4 -2
  63. package/dist/ui/inputs/email/index.js +144 -7
  64. package/dist/ui/inputs/email/index.mjs +4 -2
  65. package/dist/ui/inputs/index.d.ts +2 -0
  66. package/dist/ui/inputs/index.js +363 -56
  67. package/dist/ui/inputs/index.mjs +27 -15
  68. package/dist/ui/inputs/input/index.js +140 -3
  69. package/dist/ui/inputs/input/index.mjs +3 -1
  70. package/dist/ui/inputs/input/input.d.ts +1 -0
  71. package/dist/ui/inputs/input/input.js +140 -3
  72. package/dist/ui/inputs/input/input.mjs +3 -1
  73. package/dist/ui/inputs/input/use-input.d.ts +19 -0
  74. package/dist/ui/inputs/input/use-input.js +82 -0
  75. package/dist/ui/inputs/input/use-input.mjs +7 -0
  76. package/dist/ui/inputs/radio/index.mjs +3 -3
  77. package/dist/ui/inputs/search/index.d.ts +1 -0
  78. package/dist/ui/inputs/search/index.js +270 -0
  79. package/dist/ui/inputs/search/index.mjs +13 -0
  80. package/dist/ui/inputs/search/search.d.ts +7 -0
  81. package/dist/ui/inputs/search/search.js +268 -0
  82. package/dist/ui/inputs/search/search.mjs +12 -0
  83. package/dist/ui/inputs/search/use-search.d.ts +12 -0
  84. package/dist/ui/inputs/search/use-search.js +57 -0
  85. package/dist/ui/inputs/search/use-search.mjs +7 -0
  86. package/dist/ui/inputs/select/index.js +132 -22
  87. package/dist/ui/inputs/select/index.mjs +3 -1
  88. package/dist/ui/inputs/select/select.d.ts +4 -0
  89. package/dist/ui/inputs/select/select.js +132 -22
  90. package/dist/ui/inputs/select/select.mjs +3 -1
  91. package/dist/ui/inputs/select/use-select.d.ts +17 -0
  92. package/dist/ui/inputs/select/use-select.js +85 -0
  93. package/dist/ui/inputs/select/use-select.mjs +7 -0
  94. package/dist/ui/inputs/text/index.js +144 -7
  95. package/dist/ui/inputs/text/index.mjs +4 -2
  96. package/dist/ui/inputs/text/text.js +144 -7
  97. package/dist/ui/inputs/text/text.mjs +4 -2
  98. package/dist/ui/layout/container/container.mjs +56 -48
  99. package/dist/ui/layout/container/index.mjs +56 -48
  100. package/dist/ui/layout/index.mjs +62 -54
  101. package/dist/ui/layout/page/index.mjs +4 -4
  102. package/dist/ui/layout/page/page-loading.mjs +4 -4
  103. package/dist/ui/layout/page/section-loading.mjs +4 -4
  104. package/dist/ui/navigation/index.mjs +8 -8
  105. package/dist/ui/overlays/index.mjs +5 -5
  106. package/dist/ui/provider/index.mjs +4 -4
  107. package/dist/ui/provider/ui-provider.mjs +4 -4
  108. package/dist/ui/theme/colors/common.mjs +5 -5
  109. package/dist/ui/theme/colors/index.mjs +8 -8
  110. package/dist/ui/theme/colors/semantic.mjs +6 -6
  111. package/dist/ui/theme/colors.mjs +8 -8
  112. package/dist/ui/theme/index.mjs +8 -8
  113. package/dist/ui/theme/theme.mjs +8 -8
  114. package/package.json +1 -1
  115. package/dist/chunk-3YOW5DEZ.mjs +0 -45
  116. package/dist/chunk-V2G5QHZZ.mjs +0 -14
  117. package/dist/{chunk-5IHVMMCK.mjs → chunk-5N3SIZHF.mjs} +0 -0
  118. package/dist/{chunk-CZEO3U25.mjs → chunk-5RNCFTW5.mjs} +0 -0
  119. package/dist/{chunk-STVN4B47.mjs → chunk-IXPMUODA.mjs} +12 -12
  120. /package/dist/{chunk-Q6JSJOU4.mjs → chunk-PTCNYQVY.mjs} +0 -0
@@ -36,12 +36,149 @@ __export(input_exports, {
36
36
  module.exports = __toCommonJS(input_exports);
37
37
 
38
38
  // src/ui/inputs/input/input.tsx
39
- var import_react = __toESM(require("react"));
39
+ var import_react3 = __toESM(require("react"));
40
40
  var import_input = require("@heroui/input");
41
+ var import_tailwind_variants = require("tailwind-variants");
42
+
43
+ // src/ui/inputs/clear-button.tsx
44
+ var import_react = __toESM(require("react"));
45
+ var import_button = require("@heroui/button");
46
+ var import_lucide_react = require("lucide-react");
41
47
  var import_jsx_runtime = require("react/jsx-runtime");
42
- var Input = import_react.default.forwardRef(({ ...props }, ref) => {
43
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { ref, ...props });
48
+ var ClearButton = import_react.default.forwardRef(
49
+ ({ onClear }, ref) => {
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
+ import_button.Button,
52
+ {
53
+ ref,
54
+ isIconOnly: true,
55
+ "aria-label": "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C",
56
+ as: "span",
57
+ className: "opacity-0 transition-opacity group-hover:opacity-100",
58
+ color: "default",
59
+ radius: "full",
60
+ size: "sm",
61
+ tabIndex: 0,
62
+ variant: "light",
63
+ onPress: onClear,
64
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.XIcon, { className: "size-4 text-default-500" })
65
+ }
66
+ );
67
+ }
68
+ );
69
+ ClearButton.displayName = "TeachInUI.ClearButton";
70
+
71
+ // src/ui/inputs/input/use-input.ts
72
+ var import_react2 = require("react");
73
+ function useInput({
74
+ value,
75
+ defaultValue,
76
+ onValueChange,
77
+ onClear,
78
+ isReadOnly,
79
+ isClearable = true,
80
+ ref
81
+ }) {
82
+ const inputRef = (0, import_react2.useRef)(null);
83
+ const [internalValue, setInternalValue] = (0, import_react2.useState)(defaultValue != null ? defaultValue : "");
84
+ const isControlled = value !== void 0;
85
+ const currentValue = isControlled ? value : internalValue;
86
+ const hasValue = String(currentValue).length > 0;
87
+ const handleValueChange = (0, import_react2.useCallback)(
88
+ (newValue) => {
89
+ if (!isControlled) {
90
+ setInternalValue(newValue);
91
+ }
92
+ onValueChange == null ? void 0 : onValueChange(newValue);
93
+ },
94
+ [isControlled, onValueChange]
95
+ );
96
+ const handleClear = (0, import_react2.useCallback)(() => {
97
+ var _a;
98
+ onClear == null ? void 0 : onClear();
99
+ handleValueChange("");
100
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
101
+ }, [onClear, handleValueChange]);
102
+ const mergedRef = (0, import_react2.useCallback)(
103
+ (node) => {
104
+ inputRef.current = node;
105
+ if (typeof ref === "function") {
106
+ ref(node);
107
+ } else if (ref) {
108
+ ref.current = node;
109
+ }
110
+ },
111
+ [ref]
112
+ );
113
+ const showClearButton = hasValue && !isReadOnly && isClearable;
114
+ return {
115
+ inputRef,
116
+ currentValue,
117
+ hasValue,
118
+ handleValueChange,
119
+ handleClear,
120
+ mergedRef,
121
+ showClearButton
122
+ };
123
+ }
124
+
125
+ // src/ui/inputs/input/input.tsx
126
+ var import_jsx_runtime2 = require("react/jsx-runtime");
127
+ var inputWrapperVariants = (0, import_tailwind_variants.tv)({
128
+ variants: {
129
+ variant: {
130
+ flat: "",
131
+ underlined: "",
132
+ bordered: "border-1",
133
+ faded: "border-1"
134
+ }
135
+ }
44
136
  });
137
+ var Input = import_react3.default.forwardRef(
138
+ ({
139
+ value,
140
+ defaultValue,
141
+ onClear,
142
+ onValueChange,
143
+ variant,
144
+ classNames,
145
+ endContent,
146
+ isReadOnly,
147
+ isClearable,
148
+ ...props
149
+ }, ref) => {
150
+ const { currentValue, handleValueChange, handleClear, mergedRef, showClearButton } = useInput({
151
+ value,
152
+ defaultValue,
153
+ onValueChange,
154
+ onClear,
155
+ isReadOnly,
156
+ isClearable,
157
+ ref
158
+ });
159
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
160
+ import_input.Input,
161
+ {
162
+ ref: mergedRef,
163
+ classNames: {
164
+ ...classNames,
165
+ inputWrapper: inputWrapperVariants({ variant }),
166
+ innerWrapper: "group"
167
+ },
168
+ defaultValue,
169
+ endContent: (endContent || showClearButton) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center gap-1", children: [
170
+ endContent,
171
+ showClearButton && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ClearButton, { onClear: handleClear })
172
+ ] }),
173
+ isReadOnly,
174
+ value: currentValue,
175
+ variant,
176
+ onValueChange: handleValueChange,
177
+ ...props
178
+ }
179
+ );
180
+ }
181
+ );
45
182
  Input.displayName = "TeachInUI.Input";
46
183
  // Annotate the CommonJS export names for ESM import in node:
47
184
  0 && (module.exports = {
@@ -2,7 +2,9 @@
2
2
  import "../../../chunk-ZRHEFEFS.mjs";
3
3
  import {
4
4
  Input
5
- } from "../../../chunk-V2G5QHZZ.mjs";
5
+ } from "../../../chunk-MCQGBAUS.mjs";
6
+ import "../../../chunk-NSU66J5E.mjs";
7
+ import "../../../chunk-TUIN5YJW.mjs";
6
8
  export {
7
9
  Input
8
10
  };
@@ -1,5 +1,6 @@
1
1
  import type { InputProps as HeroUIInputProps } from "@heroui/input";
2
2
  import React from "react";
3
3
  export interface InputProps extends HeroUIInputProps {
4
+ onClear?: () => void;
4
5
  }
5
6
  export declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -34,12 +34,149 @@ __export(input_exports, {
34
34
  Input: () => Input
35
35
  });
36
36
  module.exports = __toCommonJS(input_exports);
37
- var import_react = __toESM(require("react"));
37
+ var import_react3 = __toESM(require("react"));
38
38
  var import_input = require("@heroui/input");
39
+ var import_tailwind_variants = require("tailwind-variants");
40
+
41
+ // src/ui/inputs/clear-button.tsx
42
+ var import_react = __toESM(require("react"));
43
+ var import_button = require("@heroui/button");
44
+ var import_lucide_react = require("lucide-react");
39
45
  var import_jsx_runtime = require("react/jsx-runtime");
40
- var Input = import_react.default.forwardRef(({ ...props }, ref) => {
41
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { ref, ...props });
46
+ var ClearButton = import_react.default.forwardRef(
47
+ ({ onClear }, ref) => {
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
+ import_button.Button,
50
+ {
51
+ ref,
52
+ isIconOnly: true,
53
+ "aria-label": "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C",
54
+ as: "span",
55
+ className: "opacity-0 transition-opacity group-hover:opacity-100",
56
+ color: "default",
57
+ radius: "full",
58
+ size: "sm",
59
+ tabIndex: 0,
60
+ variant: "light",
61
+ onPress: onClear,
62
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.XIcon, { className: "size-4 text-default-500" })
63
+ }
64
+ );
65
+ }
66
+ );
67
+ ClearButton.displayName = "TeachInUI.ClearButton";
68
+
69
+ // src/ui/inputs/input/use-input.ts
70
+ var import_react2 = require("react");
71
+ function useInput({
72
+ value,
73
+ defaultValue,
74
+ onValueChange,
75
+ onClear,
76
+ isReadOnly,
77
+ isClearable = true,
78
+ ref
79
+ }) {
80
+ const inputRef = (0, import_react2.useRef)(null);
81
+ const [internalValue, setInternalValue] = (0, import_react2.useState)(defaultValue != null ? defaultValue : "");
82
+ const isControlled = value !== void 0;
83
+ const currentValue = isControlled ? value : internalValue;
84
+ const hasValue = String(currentValue).length > 0;
85
+ const handleValueChange = (0, import_react2.useCallback)(
86
+ (newValue) => {
87
+ if (!isControlled) {
88
+ setInternalValue(newValue);
89
+ }
90
+ onValueChange == null ? void 0 : onValueChange(newValue);
91
+ },
92
+ [isControlled, onValueChange]
93
+ );
94
+ const handleClear = (0, import_react2.useCallback)(() => {
95
+ var _a;
96
+ onClear == null ? void 0 : onClear();
97
+ handleValueChange("");
98
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
99
+ }, [onClear, handleValueChange]);
100
+ const mergedRef = (0, import_react2.useCallback)(
101
+ (node) => {
102
+ inputRef.current = node;
103
+ if (typeof ref === "function") {
104
+ ref(node);
105
+ } else if (ref) {
106
+ ref.current = node;
107
+ }
108
+ },
109
+ [ref]
110
+ );
111
+ const showClearButton = hasValue && !isReadOnly && isClearable;
112
+ return {
113
+ inputRef,
114
+ currentValue,
115
+ hasValue,
116
+ handleValueChange,
117
+ handleClear,
118
+ mergedRef,
119
+ showClearButton
120
+ };
121
+ }
122
+
123
+ // src/ui/inputs/input/input.tsx
124
+ var import_jsx_runtime2 = require("react/jsx-runtime");
125
+ var inputWrapperVariants = (0, import_tailwind_variants.tv)({
126
+ variants: {
127
+ variant: {
128
+ flat: "",
129
+ underlined: "",
130
+ bordered: "border-1",
131
+ faded: "border-1"
132
+ }
133
+ }
42
134
  });
135
+ var Input = import_react3.default.forwardRef(
136
+ ({
137
+ value,
138
+ defaultValue,
139
+ onClear,
140
+ onValueChange,
141
+ variant,
142
+ classNames,
143
+ endContent,
144
+ isReadOnly,
145
+ isClearable,
146
+ ...props
147
+ }, ref) => {
148
+ const { currentValue, handleValueChange, handleClear, mergedRef, showClearButton } = useInput({
149
+ value,
150
+ defaultValue,
151
+ onValueChange,
152
+ onClear,
153
+ isReadOnly,
154
+ isClearable,
155
+ ref
156
+ });
157
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
158
+ import_input.Input,
159
+ {
160
+ ref: mergedRef,
161
+ classNames: {
162
+ ...classNames,
163
+ inputWrapper: inputWrapperVariants({ variant }),
164
+ innerWrapper: "group"
165
+ },
166
+ defaultValue,
167
+ endContent: (endContent || showClearButton) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center gap-1", children: [
168
+ endContent,
169
+ showClearButton && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ClearButton, { onClear: handleClear })
170
+ ] }),
171
+ isReadOnly,
172
+ value: currentValue,
173
+ variant,
174
+ onValueChange: handleValueChange,
175
+ ...props
176
+ }
177
+ );
178
+ }
179
+ );
43
180
  Input.displayName = "TeachInUI.Input";
44
181
  // Annotate the CommonJS export names for ESM import in node:
45
182
  0 && (module.exports = {
@@ -1,7 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  Input
4
- } from "../../../chunk-V2G5QHZZ.mjs";
4
+ } from "../../../chunk-MCQGBAUS.mjs";
5
+ import "../../../chunk-NSU66J5E.mjs";
6
+ import "../../../chunk-TUIN5YJW.mjs";
5
7
  export {
6
8
  Input
7
9
  };
@@ -0,0 +1,19 @@
1
+ interface UseInputProps {
2
+ value?: string;
3
+ defaultValue?: string;
4
+ onValueChange?: (value: string) => void;
5
+ onClear?: () => void;
6
+ isReadOnly?: boolean;
7
+ isClearable?: boolean;
8
+ ref?: React.Ref<HTMLInputElement>;
9
+ }
10
+ export declare function useInput({ value, defaultValue, onValueChange, onClear, isReadOnly, isClearable, ref, }: UseInputProps): {
11
+ inputRef: import("react").RefObject<HTMLInputElement | null>;
12
+ currentValue: string;
13
+ hasValue: boolean;
14
+ handleValueChange: (newValue: string) => void;
15
+ handleClear: () => void;
16
+ mergedRef: (node: HTMLInputElement | null) => void;
17
+ showClearButton: boolean;
18
+ };
19
+ export {};
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/ui/inputs/input/use-input.ts
22
+ var use_input_exports = {};
23
+ __export(use_input_exports, {
24
+ useInput: () => useInput
25
+ });
26
+ module.exports = __toCommonJS(use_input_exports);
27
+ var import_react = require("react");
28
+ function useInput({
29
+ value,
30
+ defaultValue,
31
+ onValueChange,
32
+ onClear,
33
+ isReadOnly,
34
+ isClearable = true,
35
+ ref
36
+ }) {
37
+ const inputRef = (0, import_react.useRef)(null);
38
+ const [internalValue, setInternalValue] = (0, import_react.useState)(defaultValue != null ? defaultValue : "");
39
+ const isControlled = value !== void 0;
40
+ const currentValue = isControlled ? value : internalValue;
41
+ const hasValue = String(currentValue).length > 0;
42
+ const handleValueChange = (0, import_react.useCallback)(
43
+ (newValue) => {
44
+ if (!isControlled) {
45
+ setInternalValue(newValue);
46
+ }
47
+ onValueChange == null ? void 0 : onValueChange(newValue);
48
+ },
49
+ [isControlled, onValueChange]
50
+ );
51
+ const handleClear = (0, import_react.useCallback)(() => {
52
+ var _a;
53
+ onClear == null ? void 0 : onClear();
54
+ handleValueChange("");
55
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
56
+ }, [onClear, handleValueChange]);
57
+ const mergedRef = (0, import_react.useCallback)(
58
+ (node) => {
59
+ inputRef.current = node;
60
+ if (typeof ref === "function") {
61
+ ref(node);
62
+ } else if (ref) {
63
+ ref.current = node;
64
+ }
65
+ },
66
+ [ref]
67
+ );
68
+ const showClearButton = hasValue && !isReadOnly && isClearable;
69
+ return {
70
+ inputRef,
71
+ currentValue,
72
+ hasValue,
73
+ handleValueChange,
74
+ handleClear,
75
+ mergedRef,
76
+ showClearButton
77
+ };
78
+ }
79
+ // Annotate the CommonJS export names for ESM import in node:
80
+ 0 && (module.exports = {
81
+ useInput
82
+ });
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ useInput
4
+ } from "../../../chunk-NSU66J5E.mjs";
5
+ export {
6
+ useInput
7
+ };
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import "../../../chunk-RRA7GWP2.mjs";
3
- import {
4
- Radio
5
- } from "../../../chunk-2SNKT7I4.mjs";
6
3
  import {
7
4
  RadioGroup
8
5
  } from "../../../chunk-NOXFF2KJ.mjs";
6
+ import {
7
+ Radio
8
+ } from "../../../chunk-2SNKT7I4.mjs";
9
9
  export {
10
10
  Radio,
11
11
  RadioGroup
@@ -0,0 +1 @@
1
+ export { Search, type SearchProps } from "./search";