@hilum/ui 3.0.0 → 3.1.1
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.d.ts +2 -0
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/components/input-group.tsx +20 -3
package/dist/index.d.ts
CHANGED
|
@@ -599,6 +599,8 @@ interface InputGroupProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
599
599
|
trailingAddon?: React.ReactNode;
|
|
600
600
|
leadingIcon?: React.ReactNode;
|
|
601
601
|
trailingIcon?: React.ReactNode;
|
|
602
|
+
trailingAction?: React.ReactNode;
|
|
603
|
+
trailingActionClassName?: string;
|
|
602
604
|
trailingButton?: React.ReactNode;
|
|
603
605
|
error?: boolean;
|
|
604
606
|
pill?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -2455,6 +2455,8 @@ var InputGroup = React17.forwardRef(
|
|
|
2455
2455
|
trailingAddon,
|
|
2456
2456
|
leadingIcon,
|
|
2457
2457
|
trailingIcon,
|
|
2458
|
+
trailingAction,
|
|
2459
|
+
trailingActionClassName,
|
|
2458
2460
|
trailingButton,
|
|
2459
2461
|
error,
|
|
2460
2462
|
pill,
|
|
@@ -2464,7 +2466,8 @@ var InputGroup = React17.forwardRef(
|
|
|
2464
2466
|
}, ref) => {
|
|
2465
2467
|
const radius = pill ? "rounded-full" : "rounded-lg";
|
|
2466
2468
|
const hasLeading = leadingAddon || leadingIcon;
|
|
2467
|
-
const
|
|
2469
|
+
const hasInsetTrailing = trailingIcon || trailingAction || error;
|
|
2470
|
+
const hasTrailing = trailingAddon || hasInsetTrailing || trailingButton;
|
|
2468
2471
|
const baseInput = cn(
|
|
2469
2472
|
"flex h-9 w-full border bg-card body text-foreground placeholder:text-muted-foreground",
|
|
2470
2473
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:disabled:cursor-not-allowed disabled:opacity-50",
|
|
@@ -2494,13 +2497,24 @@ var InputGroup = React17.forwardRef(
|
|
|
2494
2497
|
className: cn(
|
|
2495
2498
|
baseInput,
|
|
2496
2499
|
// Border radius
|
|
2497
|
-
leadingAddon ? trailingAddon || trailingButton ? "rounded-none px-3" : pill ? "rounded-none rounded-r-full px-3" : "rounded-none rounded-r-lg px-3" : leadingIcon ? trailingAddon ? pill ? "rounded-l-full rounded-r-none pl-9 pr-3" : "rounded-l-lg rounded-r-none pl-9 pr-3" :
|
|
2500
|
+
leadingAddon ? trailingAddon || trailingButton ? "rounded-none px-3" : pill ? "rounded-none rounded-r-full px-3" : "rounded-none rounded-r-lg px-3" : leadingIcon ? trailingAddon ? pill ? "rounded-l-full rounded-r-none pl-9 pr-3" : "rounded-l-lg rounded-r-none pl-9 pr-3" : hasInsetTrailing ? cn(radius, "pl-9 pr-9") : cn(radius, "pl-9 pr-3") : trailingAddon ? pill ? "rounded-l-full rounded-r-none px-3" : "rounded-l-lg rounded-r-none px-3" : hasInsetTrailing ? cn(radius, "pl-3 pr-9") : cn(radius, "px-3"),
|
|
2501
|
+
trailingAction && "pr-14",
|
|
2498
2502
|
className
|
|
2499
2503
|
),
|
|
2500
2504
|
...props
|
|
2501
2505
|
}
|
|
2502
2506
|
),
|
|
2503
|
-
(trailingIcon || error) && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3", children: error ? /* @__PURE__ */ jsx(AlertCircle, { size: 15, className: "text-destructive" }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: trailingIcon }) })
|
|
2507
|
+
(trailingIcon || error) && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3", children: error ? /* @__PURE__ */ jsx(AlertCircle, { size: 15, className: "text-destructive" }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: trailingIcon }) }),
|
|
2508
|
+
trailingAction && /* @__PURE__ */ jsx(
|
|
2509
|
+
"div",
|
|
2510
|
+
{
|
|
2511
|
+
className: cn(
|
|
2512
|
+
"absolute inset-y-0 right-2 flex items-center",
|
|
2513
|
+
trailingActionClassName
|
|
2514
|
+
),
|
|
2515
|
+
children: trailingAction
|
|
2516
|
+
}
|
|
2517
|
+
)
|
|
2504
2518
|
] }),
|
|
2505
2519
|
trailingAddon && /* @__PURE__ */ jsx(
|
|
2506
2520
|
"span",
|