myoperator-ui 0.0.216-beta.2 → 0.0.216-beta.3
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 +10 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2367,16 +2367,7 @@ export { Switch, switchVariants };
|
|
|
2367
2367
|
files: [
|
|
2368
2368
|
{
|
|
2369
2369
|
name: "text-field.tsx",
|
|
2370
|
-
content: prefixTailwindClasses(`import
|
|
2371
|
-
forwardRef,
|
|
2372
|
-
useRef,
|
|
2373
|
-
useCallback,
|
|
2374
|
-
useState,
|
|
2375
|
-
useId,
|
|
2376
|
-
type ChangeEvent,
|
|
2377
|
-
type ReactNode,
|
|
2378
|
-
type ComponentProps,
|
|
2379
|
-
} from "react";
|
|
2370
|
+
content: prefixTailwindClasses(`import * as React from "react";
|
|
2380
2371
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
2381
2372
|
import { Loader2, X } from "lucide-react";
|
|
2382
2373
|
|
|
@@ -2444,7 +2435,7 @@ const textFieldInputVariants = cva(
|
|
|
2444
2435
|
*/
|
|
2445
2436
|
export interface TextFieldProps
|
|
2446
2437
|
extends
|
|
2447
|
-
Omit<ComponentProps<"input">, "size">,
|
|
2438
|
+
Omit<React.ComponentProps<"input">, "size">,
|
|
2448
2439
|
VariantProps<typeof textFieldInputVariants> {
|
|
2449
2440
|
/** Size of the text field \u2014 \`default\` (42px) or \`sm\` (36px, compact) */
|
|
2450
2441
|
size?: "default" | "sm";
|
|
@@ -2457,9 +2448,9 @@ export interface TextFieldProps
|
|
|
2457
2448
|
/** Error message - shows error state with red styling */
|
|
2458
2449
|
error?: string;
|
|
2459
2450
|
/** Icon displayed on the left inside the input */
|
|
2460
|
-
leftIcon?: ReactNode;
|
|
2451
|
+
leftIcon?: React.ReactNode;
|
|
2461
2452
|
/** Icon displayed on the right inside the input */
|
|
2462
|
-
rightIcon?: ReactNode;
|
|
2453
|
+
rightIcon?: React.ReactNode;
|
|
2463
2454
|
/** Text prefix inside input (e.g., "https://") */
|
|
2464
2455
|
prefix?: string;
|
|
2465
2456
|
/** Text suffix inside input (e.g., ".com") */
|
|
@@ -2480,7 +2471,7 @@ export interface TextFieldProps
|
|
|
2480
2471
|
inputContainerClassName?: string;
|
|
2481
2472
|
}
|
|
2482
2473
|
|
|
2483
|
-
const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
2474
|
+
const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
|
|
2484
2475
|
(
|
|
2485
2476
|
{
|
|
2486
2477
|
className,
|
|
@@ -2514,8 +2505,8 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
|
2514
2505
|
ref
|
|
2515
2506
|
) => {
|
|
2516
2507
|
// Internal ref for programmatic control (e.g., clearable)
|
|
2517
|
-
const internalRef = useRef<HTMLInputElement>(null);
|
|
2518
|
-
const mergedRef = useCallback(
|
|
2508
|
+
const internalRef = React.useRef<HTMLInputElement>(null);
|
|
2509
|
+
const mergedRef = React.useCallback(
|
|
2519
2510
|
(node: HTMLInputElement | null) => {
|
|
2520
2511
|
internalRef.current = node;
|
|
2521
2512
|
if (typeof ref === "function") ref(node);
|
|
@@ -2525,7 +2516,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
|
2525
2516
|
);
|
|
2526
2517
|
|
|
2527
2518
|
// Internal state for character count in uncontrolled mode
|
|
2528
|
-
const [internalValue, setInternalValue] = useState(
|
|
2519
|
+
const [internalValue, setInternalValue] = React.useState(
|
|
2529
2520
|
defaultValue ?? ""
|
|
2530
2521
|
);
|
|
2531
2522
|
|
|
@@ -2537,7 +2528,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
|
2537
2528
|
const derivedState = error ? "error" : (state ?? "default");
|
|
2538
2529
|
|
|
2539
2530
|
// Handle change for both controlled and uncontrolled
|
|
2540
|
-
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
2531
|
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
2541
2532
|
if (!isControlled) {
|
|
2542
2533
|
setInternalValue(e.target.value);
|
|
2543
2534
|
}
|
|
@@ -2564,7 +2555,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
|
2564
2555
|
const charCount = String(currentValue).length;
|
|
2565
2556
|
|
|
2566
2557
|
// Generate unique IDs for accessibility
|
|
2567
|
-
const generatedId = useId();
|
|
2558
|
+
const generatedId = React.useId();
|
|
2568
2559
|
const inputId = id || generatedId;
|
|
2569
2560
|
const helperId = \`\${inputId}-helper\`;
|
|
2570
2561
|
const errorId = \`\${inputId}-error\`;
|