@yuhuanowo/yunui 0.2.8 → 0.2.10
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/{chunk-EROX7LXU.js → chunk-65XAR7FY.js} +75 -49
- package/dist/chunk-65XAR7FY.js.map +1 -0
- package/dist/index.d.ts +31 -9
- package/dist/index.js +1 -1
- package/dist/patterns.js +1 -1
- package/icons/apps/dify.svg +1 -1
- package/icons/apps/doubao.svg +1 -0
- package/icons/apps/gemini.svg +1 -0
- package/icons/apps/google.svg +1 -1
- package/icons/apps/kimi.svg +1 -0
- package/icons/apps/longcat.svg +1 -1
- package/icons/apps/monica.svg +1 -0
- package/icons/apps/perplexity.svg +1 -0
- package/icons/apps/poe.svg +1 -0
- package/icons/apps/qingyan.svg +1 -0
- package/icons/apps/stepfun.svg +1 -0
- package/icons/apps/tiangong.svg +1 -0
- package/icons/apps/yuanbao.svg +1 -0
- package/icons/models/ai21.svg +1 -0
- package/icons/models/aimass.svg +1 -0
- package/icons/models/baichuan.svg +1 -0
- package/icons/models/chatglm.svg +1 -0
- package/icons/models/claude.svg +1 -0
- package/icons/models/codegeex.svg +1 -0
- package/icons/models/cogview3flash.svg +1 -0
- package/icons/models/cohere.svg +1 -0
- package/icons/models/copilot.svg +1 -0
- package/icons/models/dalle.svg +1 -0
- package/icons/models/dbrx.svg +1 -0
- package/icons/models/deepseek.svg +1 -0
- package/icons/models/doubao.svg +1 -0
- package/icons/models/gemini.svg +1 -0
- package/icons/models/gemma.svg +1 -0
- package/icons/models/google.svg +1 -0
- package/icons/models/hailuo.svg +1 -0
- package/icons/models/huggingface.svg +1 -0
- package/icons/models/hunyuan.svg +1 -0
- package/icons/models/internlm.svg +1 -0
- package/icons/models/llava.svg +1 -0
- package/icons/models/luma.svg +1 -0
- package/icons/models/microsoft.svg +1 -0
- package/icons/models/minimax.svg +1 -0
- package/icons/models/mistral.svg +1 -0
- package/icons/models/nvidia.svg +1 -0
- package/icons/models/palm.svg +1 -0
- package/icons/models/perplexity.svg +1 -0
- package/icons/models/qwen.svg +1 -0
- package/icons/models/stability.svg +1 -0
- package/icons/models/step.svg +1 -0
- package/icons/models/upstage.svg +1 -0
- package/icons/models/vidu.svg +1 -0
- package/icons/models/volcengine.svg +1 -0
- package/icons/models/voyageai.svg +1 -0
- package/icons/models/wenxin.svg +1 -0
- package/icons/models/yi.svg +1 -0
- package/icons/models/zero-one.svg +1 -0
- package/icons/models/zhipu.svg +1 -0
- package/icons/providers/302ai.svg +1 -0
- package/icons/providers/aihubmix.svg +1 -0
- package/icons/providers/aws-bedrock.svg +1 -0
- package/icons/providers/azure.svg +1 -0
- package/icons/providers/baichuan.svg +1 -0
- package/icons/providers/bailian.svg +1 -0
- package/icons/providers/bigModel.svg +1 -0
- package/icons/providers/burncloud.svg +1 -0
- package/icons/providers/bytedance.svg +1 -0
- package/icons/providers/cerebras.svg +1 -0
- package/icons/providers/cloudflare.svg +1 -0
- package/icons/providers/cogview3flash.svg +1 -0
- package/icons/providers/cohere.svg +1 -0
- package/icons/providers/deepseek.svg +1 -0
- package/icons/providers/doubao.svg +1 -0
- package/icons/providers/fireworks.svg +1 -0
- package/icons/providers/gemini.svg +1 -0
- package/icons/providers/google.svg +1 -0
- package/icons/providers/huggingface.svg +1 -0
- package/icons/providers/hyperbolic.svg +1 -0
- package/icons/providers/infini.svg +1 -0
- package/icons/providers/longcat.svg +1 -0
- package/icons/providers/minimax.svg +1 -0
- package/icons/providers/mistral.svg +1 -0
- package/icons/providers/modelscope.svg +1 -0
- package/icons/providers/newapi.svg +1 -0
- package/icons/providers/nvidia.svg +1 -0
- package/icons/providers/paddleocr.svg +1 -0
- package/icons/providers/perplexity.svg +1 -0
- package/icons/providers/ppio.svg +1 -0
- package/icons/providers/qiniu.svg +1 -0
- package/icons/providers/silicon.svg +1 -0
- package/icons/providers/sophnet.svg +1 -13
- package/icons/providers/step.svg +1 -0
- package/icons/providers/tencent-cloud-ti.svg +1 -0
- package/icons/providers/together.svg +1 -0
- package/icons/providers/vllm.svg +1 -0
- package/icons/providers/volcengine.svg +1 -0
- package/icons/providers/voyageai.svg +1 -0
- package/icons/providers/zero-one.svg +1 -0
- package/icons/providers/zhipu.svg +1 -0
- package/package.json +5 -3
- package/styles/yunui.css +54 -0
- package/dist/chunk-EROX7LXU.js.map +0 -1
- package/icons/apps/doubao.png +0 -0
- package/icons/apps/gemini.png +0 -0
- package/icons/apps/kimi.webp +0 -0
- package/icons/apps/monica.webp +0 -0
- package/icons/apps/perplexity.webp +0 -0
- package/icons/apps/poe.webp +0 -0
- package/icons/apps/qingyan.png +0 -0
- package/icons/apps/stepfun.png +0 -0
- package/icons/apps/tiangong.png +0 -0
- package/icons/apps/yuanbao.webp +0 -0
- package/icons/models/ai21.png +0 -0
- package/icons/models/aimass.png +0 -0
- package/icons/models/baichuan.png +0 -0
- package/icons/models/chatglm.png +0 -0
- package/icons/models/claude.png +0 -0
- package/icons/models/codegeex.png +0 -0
- package/icons/models/cogview3flash.png +0 -0
- package/icons/models/cohere.png +0 -0
- package/icons/models/cohere.webp +0 -0
- package/icons/models/copilot.png +0 -0
- package/icons/models/dalle.png +0 -0
- package/icons/models/dbrx.png +0 -0
- package/icons/models/deepseek.png +0 -0
- package/icons/models/doubao.png +0 -0
- package/icons/models/gemini.png +0 -0
- package/icons/models/gemma.png +0 -0
- package/icons/models/google.png +0 -0
- package/icons/models/hailuo.png +0 -0
- package/icons/models/huggingface.png +0 -0
- package/icons/models/hunyuan.png +0 -0
- package/icons/models/internlm.png +0 -0
- package/icons/models/llava.png +0 -0
- package/icons/models/luma.png +0 -0
- package/icons/models/microsoft.png +0 -0
- package/icons/models/minimax.png +0 -0
- package/icons/models/mistral.png +0 -0
- package/icons/models/nvidia.png +0 -0
- package/icons/models/palm.png +0 -0
- package/icons/models/perplexity.png +0 -0
- package/icons/models/qwen.png +0 -0
- package/icons/models/stability.png +0 -0
- package/icons/models/step.png +0 -0
- package/icons/models/upstage.png +0 -0
- package/icons/models/vidu.png +0 -0
- package/icons/models/volcengine.png +0 -0
- package/icons/models/voyageai.png +0 -0
- package/icons/models/wenxin.png +0 -0
- package/icons/models/yi.png +0 -0
- package/icons/models/zero-one.png +0 -0
- package/icons/models/zhipu.png +0 -0
- package/icons/providers/302ai.webp +0 -0
- package/icons/providers/aihubmix.png +0 -0
- package/icons/providers/aihubmix.webp +0 -0
- package/icons/providers/aws-bedrock.webp +0 -0
- package/icons/providers/azure.png +0 -0
- package/icons/providers/baichuan.png +0 -0
- package/icons/providers/bailian.png +0 -0
- package/icons/providers/bigModel.png +0 -0
- package/icons/providers/burncloud.png +0 -0
- package/icons/providers/bytedance.png +0 -0
- package/icons/providers/cerebras.webp +0 -0
- package/icons/providers/cloudflare.png +0 -0
- package/icons/providers/cogview3flash.png +0 -0
- package/icons/providers/cohere.png +0 -0
- package/icons/providers/deepseek.png +0 -0
- package/icons/providers/doubao.png +0 -0
- package/icons/providers/fireworks.png +0 -0
- package/icons/providers/gemini.png +0 -0
- package/icons/providers/google.png +0 -0
- package/icons/providers/huggingface.png +0 -0
- package/icons/providers/hyperbolic.png +0 -0
- package/icons/providers/infini.png +0 -0
- package/icons/providers/longcat.png +0 -0
- package/icons/providers/minimax.png +0 -0
- package/icons/providers/mistral.png +0 -0
- package/icons/providers/modelscope.png +0 -0
- package/icons/providers/newapi.png +0 -0
- package/icons/providers/nvidia.png +0 -0
- package/icons/providers/paddleocr.png +0 -0
- package/icons/providers/perplexity.png +0 -0
- package/icons/providers/perplexity.webp +0 -0
- package/icons/providers/ppio.png +0 -0
- package/icons/providers/qiniu.webp +0 -0
- package/icons/providers/silicon.png +0 -0
- package/icons/providers/step.png +0 -0
- package/icons/providers/tencent-cloud-ti.png +0 -0
- package/icons/providers/together.png +0 -0
- package/icons/providers/vllm.png +0 -0
- package/icons/providers/volcengine.png +0 -0
- package/icons/providers/voyageai.png +0 -0
- package/icons/providers/zero-one.png +0 -0
- package/icons/providers/zhipu.png +0 -0
|
@@ -12,7 +12,7 @@ import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
|
12
12
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
13
13
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
14
14
|
import { motion, AnimatePresence, useSpring, useTransform } from 'framer-motion';
|
|
15
|
-
import { Check, ChevronDown, ChevronLeft, ChevronRight, Loader2, AlertCircle, EyeOff, Eye,
|
|
15
|
+
import { Minus, Check, ChevronDown, ChevronLeft, ChevronRight, Loader2, AlertCircle, EyeOff, Eye, Plus, Search, X, CheckCircle2, CheckCircle, Info, RefreshCw, Trash2, ArrowRight, AlertTriangle } from 'lucide-react';
|
|
16
16
|
import { createPortal } from 'react-dom';
|
|
17
17
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
18
18
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
@@ -534,7 +534,7 @@ function RegenerateConfirmModal({
|
|
|
534
534
|
}
|
|
535
535
|
);
|
|
536
536
|
}
|
|
537
|
-
function Sheet({ open, onClose, children, title }) {
|
|
537
|
+
function Sheet({ open, onClose, children, title, mobileOnly = false }) {
|
|
538
538
|
const [mounted, setMounted] = useState(false);
|
|
539
539
|
useEffect(() => {
|
|
540
540
|
setMounted(true);
|
|
@@ -551,7 +551,7 @@ function Sheet({ open, onClose, children, title }) {
|
|
|
551
551
|
animate: { opacity: 1 },
|
|
552
552
|
exit: { opacity: 0 },
|
|
553
553
|
transition: { duration: 0.2 },
|
|
554
|
-
className: "fixed inset-0 bg-black/20 backdrop-blur-sm lg:hidden",
|
|
554
|
+
className: cn("fixed inset-0 bg-black/20 backdrop-blur-sm", mobileOnly && "lg:hidden"),
|
|
555
555
|
style: { zIndex: 40 },
|
|
556
556
|
onClick: onClose,
|
|
557
557
|
"aria-hidden": "true"
|
|
@@ -565,7 +565,7 @@ function Sheet({ open, onClose, children, title }) {
|
|
|
565
565
|
animate: { x: 0 },
|
|
566
566
|
exit: { x: "100%" },
|
|
567
567
|
transition: { type: "spring", damping: 30, stiffness: 300 },
|
|
568
|
-
className: "fixed inset-y-0 right-0 w-[85vw] min-w-72 max-w-sm bg-card shadow-xl flex flex-col lg:hidden",
|
|
568
|
+
className: cn("fixed inset-y-0 right-0 w-[85vw] min-w-72 max-w-sm bg-card shadow-xl flex flex-col", mobileOnly && "lg:hidden"),
|
|
569
569
|
style: { zIndex: 50 },
|
|
570
570
|
onClick: (e) => e.stopPropagation(),
|
|
571
571
|
children: [
|
|
@@ -592,25 +592,26 @@ function Sheet({ open, onClose, children, title }) {
|
|
|
592
592
|
}
|
|
593
593
|
var Checkbox = forwardRef(
|
|
594
594
|
({ checked, onCheckedChange, disabled = false, className = "", id }, ref) => {
|
|
595
|
+
const filled = checked === true || checked === "indeterminate";
|
|
595
596
|
return /* @__PURE__ */ jsx(
|
|
596
597
|
"button",
|
|
597
598
|
{
|
|
598
599
|
ref,
|
|
599
600
|
type: "button",
|
|
600
601
|
role: "checkbox",
|
|
601
|
-
"aria-checked": checked,
|
|
602
|
+
"aria-checked": checked === "indeterminate" ? "mixed" : checked,
|
|
602
603
|
id,
|
|
603
|
-
onClick: () => !disabled && onCheckedChange(
|
|
604
|
+
onClick: () => !disabled && onCheckedChange(checked !== true),
|
|
604
605
|
disabled,
|
|
605
606
|
className: `
|
|
606
607
|
w-4 h-4 rounded border-2 flex items-center justify-center
|
|
607
608
|
transition-all duration-200 ease-in-out
|
|
608
609
|
outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background
|
|
609
|
-
${
|
|
610
|
+
${filled ? "bg-primary border-primary text-primary-foreground" : "border-slate-300 dark:border-slate-600 bg-transparent hover:border-primary/50"}
|
|
610
611
|
${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
611
612
|
${className}
|
|
612
613
|
`,
|
|
613
|
-
children: checked && /* @__PURE__ */ jsx(Check, { size: 12, strokeWidth: 3 })
|
|
614
|
+
children: checked === "indeterminate" ? /* @__PURE__ */ jsx(Minus, { size: 12, strokeWidth: 3 }) : checked && /* @__PURE__ */ jsx(Check, { size: 12, strokeWidth: 3 })
|
|
614
615
|
}
|
|
615
616
|
);
|
|
616
617
|
}
|
|
@@ -624,7 +625,9 @@ function Combobox({
|
|
|
624
625
|
className = "",
|
|
625
626
|
disabled = false,
|
|
626
627
|
allowCustom = true,
|
|
627
|
-
creatableText
|
|
628
|
+
creatableText,
|
|
629
|
+
creatableFilter,
|
|
630
|
+
creatableIcon
|
|
628
631
|
}) {
|
|
629
632
|
const { Image: Image2, useT } = useYunUI();
|
|
630
633
|
const t = useT("common.combobox");
|
|
@@ -650,9 +653,9 @@ function Combobox({
|
|
|
650
653
|
const filteredOptions = inputValue ? options.filter(
|
|
651
654
|
(o) => o.label.toLowerCase().includes(inputValue.toLowerCase()) || o.value.toLowerCase().includes(inputValue.toLowerCase())
|
|
652
655
|
) : options;
|
|
653
|
-
const canCreateNew = allowCustom && inputValue && !options.some(
|
|
656
|
+
const canCreateNew = allowCustom && !!inputValue && !options.some(
|
|
654
657
|
(o) => o.value.toLowerCase() === inputValue.toLowerCase() || o.label.toLowerCase() === inputValue.toLowerCase()
|
|
655
|
-
);
|
|
658
|
+
) && (!creatableFilter || creatableFilter(inputValue));
|
|
656
659
|
const handleSelect = (selectedValue) => {
|
|
657
660
|
onChange(selectedValue);
|
|
658
661
|
setIsOpen(false);
|
|
@@ -777,7 +780,7 @@ function Combobox({
|
|
|
777
780
|
onClick: () => handleSelect(inputValue),
|
|
778
781
|
className: "\n w-full px-3 py-2 text-left text-sm\n flex items-center gap-2\n text-primary hover:bg-muted/50\n transition-colors\n ",
|
|
779
782
|
children: [
|
|
780
|
-
/* @__PURE__ */ jsx("span", { className: "text-lg", children: "+" }),
|
|
783
|
+
/* @__PURE__ */ jsx("span", { className: "text-lg", children: creatableIcon ?? "+" }),
|
|
781
784
|
/* @__PURE__ */ jsx("span", { children: resolvedCreatableText.replace("{value}", inputValue) })
|
|
782
785
|
]
|
|
783
786
|
}
|
|
@@ -1033,11 +1036,15 @@ var Stack = React7.forwardRef(
|
|
|
1033
1036
|
({ gap = 4, ...props }, ref) => /* @__PURE__ */ jsx(Flex, { ref, direction: "col", gap, ...props })
|
|
1034
1037
|
);
|
|
1035
1038
|
Stack.displayName = "Stack";
|
|
1036
|
-
var Table = React7.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn("relative w-full overflow-x-auto", containerClassName), children: /* @__PURE__ */ jsx(
|
|
1039
|
+
var Table = React7.forwardRef(({ className, containerClassName, responsive, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn("relative w-full overflow-x-auto", containerClassName), children: /* @__PURE__ */ jsx(
|
|
1037
1040
|
"table",
|
|
1038
1041
|
{
|
|
1039
1042
|
ref,
|
|
1040
|
-
className: cn(
|
|
1043
|
+
className: cn(
|
|
1044
|
+
"w-full caption-bottom border-collapse text-sm",
|
|
1045
|
+
responsive && "yunui-table-responsive",
|
|
1046
|
+
className
|
|
1047
|
+
),
|
|
1041
1048
|
...props
|
|
1042
1049
|
}
|
|
1043
1050
|
) }));
|
|
@@ -1096,10 +1103,11 @@ var TableHead = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1096
1103
|
}
|
|
1097
1104
|
));
|
|
1098
1105
|
TableHead.displayName = "TableHead";
|
|
1099
|
-
var TableCell = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1106
|
+
var TableCell = React7.forwardRef(({ className, label, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1100
1107
|
"td",
|
|
1101
1108
|
{
|
|
1102
1109
|
ref,
|
|
1110
|
+
"data-label": label,
|
|
1103
1111
|
className: cn("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0", className),
|
|
1104
1112
|
...props
|
|
1105
1113
|
}
|
|
@@ -1413,41 +1421,51 @@ var Textarea = React7.forwardRef(
|
|
|
1413
1421
|
);
|
|
1414
1422
|
Textarea.displayName = "Textarea";
|
|
1415
1423
|
var PasswordInput = React7.forwardRef(
|
|
1416
|
-
({ className, error, id, labels, "aria-describedby": describedBy, ...props }, ref) => {
|
|
1424
|
+
({ className, error, id, labels, disabled, "aria-describedby": describedBy, ...props }, ref) => {
|
|
1417
1425
|
const [show, setShow] = React7.useState(false);
|
|
1418
1426
|
const reactId = React7.useId();
|
|
1419
1427
|
const fieldId = id ?? reactId;
|
|
1420
1428
|
const errorId = error ? `${fieldId}-error` : void 0;
|
|
1421
1429
|
const describedByIds = [describedBy, errorId].filter(Boolean).join(" ") || void 0;
|
|
1422
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1423
|
-
/* @__PURE__ */
|
|
1424
|
-
"
|
|
1430
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
1431
|
+
/* @__PURE__ */ jsxs(
|
|
1432
|
+
"div",
|
|
1425
1433
|
{
|
|
1426
|
-
ref,
|
|
1427
|
-
id: fieldId,
|
|
1428
|
-
type: show ? "text" : "password",
|
|
1429
|
-
"aria-invalid": error ? true : void 0,
|
|
1430
|
-
"aria-describedby": describedByIds,
|
|
1431
1434
|
className: cn(
|
|
1432
|
-
"
|
|
1433
|
-
"
|
|
1434
|
-
"
|
|
1435
|
-
|
|
1435
|
+
"flex items-center h-10 rounded-xl border bg-background transition-colors",
|
|
1436
|
+
"focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",
|
|
1437
|
+
error ? "border-red-300 dark:border-red-700" : "border-border",
|
|
1438
|
+
disabled && "opacity-50",
|
|
1436
1439
|
className
|
|
1437
1440
|
),
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1441
|
+
children: [
|
|
1442
|
+
/* @__PURE__ */ jsx(
|
|
1443
|
+
"input",
|
|
1444
|
+
{
|
|
1445
|
+
ref,
|
|
1446
|
+
id: fieldId,
|
|
1447
|
+
type: show ? "text" : "password",
|
|
1448
|
+
"aria-invalid": error ? true : void 0,
|
|
1449
|
+
"aria-describedby": describedByIds,
|
|
1450
|
+
disabled,
|
|
1451
|
+
className: "min-w-0 flex-1 h-full bg-transparent rounded-xl px-4 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed",
|
|
1452
|
+
...props
|
|
1453
|
+
}
|
|
1454
|
+
),
|
|
1455
|
+
/* @__PURE__ */ jsx(
|
|
1456
|
+
"button",
|
|
1457
|
+
{
|
|
1458
|
+
type: "button",
|
|
1459
|
+
onClick: () => setShow((s) => !s),
|
|
1460
|
+
"aria-label": show ? labels?.hide ?? "Hide password" : labels?.show ?? "Show password",
|
|
1461
|
+
"aria-pressed": show,
|
|
1462
|
+
tabIndex: -1,
|
|
1463
|
+
disabled,
|
|
1464
|
+
className: "shrink-0 px-3 text-muted-foreground hover:text-foreground rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1465
|
+
children: show ? /* @__PURE__ */ jsx(EyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Eye, { className: "w-4 h-4" })
|
|
1466
|
+
}
|
|
1467
|
+
)
|
|
1468
|
+
]
|
|
1451
1469
|
}
|
|
1452
1470
|
),
|
|
1453
1471
|
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-red-500 flex items-center gap-1", children: [
|
|
@@ -1507,7 +1525,7 @@ var NumberInput = React7.forwardRef(
|
|
|
1507
1525
|
disabled,
|
|
1508
1526
|
"aria-invalid": error ? true : void 0,
|
|
1509
1527
|
"aria-describedby": describedByIds,
|
|
1510
|
-
className: "w-full min-w-0 bg-transparent px-1 text-center text-sm outline-none
|
|
1528
|
+
className: "yunui-number w-full min-w-0 bg-transparent px-1 text-center text-sm outline-none",
|
|
1511
1529
|
...props
|
|
1512
1530
|
}
|
|
1513
1531
|
),
|
|
@@ -1546,7 +1564,7 @@ function Kbd({ className, ...props }) {
|
|
|
1546
1564
|
);
|
|
1547
1565
|
}
|
|
1548
1566
|
var SearchInput = React7.forwardRef(
|
|
1549
|
-
({ className, value, onChange, clearable = true, clearLabel, disabled, ...props }, ref) => {
|
|
1567
|
+
({ className, value, onChange, clearable = true, clearLabel, disabled, size = "md", ...props }, ref) => {
|
|
1550
1568
|
const innerRef = React7.useRef(null);
|
|
1551
1569
|
const setRef = React7.useCallback(
|
|
1552
1570
|
(node) => {
|
|
@@ -1561,12 +1579,16 @@ var SearchInput = React7.forwardRef(
|
|
|
1561
1579
|
onChange?.("");
|
|
1562
1580
|
innerRef.current?.focus();
|
|
1563
1581
|
};
|
|
1582
|
+
const sm = size === "sm";
|
|
1564
1583
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1565
1584
|
/* @__PURE__ */ jsx(
|
|
1566
1585
|
Search,
|
|
1567
1586
|
{
|
|
1568
1587
|
"aria-hidden": "true",
|
|
1569
|
-
className:
|
|
1588
|
+
className: cn(
|
|
1589
|
+
"absolute top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none",
|
|
1590
|
+
sm ? "left-2.5" : "left-3"
|
|
1591
|
+
)
|
|
1570
1592
|
}
|
|
1571
1593
|
),
|
|
1572
1594
|
/* @__PURE__ */ jsx(
|
|
@@ -1579,11 +1601,12 @@ var SearchInput = React7.forwardRef(
|
|
|
1579
1601
|
onChange: (e) => onChange?.(e.target.value),
|
|
1580
1602
|
disabled,
|
|
1581
1603
|
className: cn(
|
|
1582
|
-
"w-full
|
|
1604
|
+
"w-full bg-background border border-border text-sm outline-none transition-colors",
|
|
1583
1605
|
"placeholder:text-muted-foreground",
|
|
1584
1606
|
"focus:border-ring focus:ring-2 focus:ring-ring/20",
|
|
1585
1607
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1586
|
-
|
|
1608
|
+
sm ? "h-8 rounded-lg pl-8" : "h-10 rounded-xl pl-10",
|
|
1609
|
+
sm ? showClear ? "pr-8" : "pr-3" : showClear ? "pr-10" : "pr-4",
|
|
1587
1610
|
className
|
|
1588
1611
|
),
|
|
1589
1612
|
...props
|
|
@@ -1595,7 +1618,10 @@ var SearchInput = React7.forwardRef(
|
|
|
1595
1618
|
type: "button",
|
|
1596
1619
|
onClick: handleClear,
|
|
1597
1620
|
"aria-label": clearLabel ?? "Clear search",
|
|
1598
|
-
className:
|
|
1621
|
+
className: cn(
|
|
1622
|
+
"absolute top-1/2 -translate-y-1/2 rounded-md p-0.5 text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1623
|
+
sm ? "right-1.5" : "right-2.5"
|
|
1624
|
+
),
|
|
1599
1625
|
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
1600
1626
|
}
|
|
1601
1627
|
)
|
|
@@ -2948,5 +2974,5 @@ function useYunUITheme(defaults = {}) {
|
|
|
2948
2974
|
}
|
|
2949
2975
|
|
|
2950
2976
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AnimatedNumber, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Column, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Flex, Grid, IconButton, InlineCode, Input, Kbd, Label2 as Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, NumberInput, PageLoader, Pagination, PasswordInput, Popover, PopoverClose2 as PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SearchInput, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Separator2 as Separator, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, StatusIndicator, Steps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, YUNUI_PALETTES, applyTheme, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useFocusTrap, useModalBehavior, useYunUITheme };
|
|
2951
|
-
//# sourceMappingURL=chunk-
|
|
2952
|
-
//# sourceMappingURL=chunk-
|
|
2977
|
+
//# sourceMappingURL=chunk-65XAR7FY.js.map
|
|
2978
|
+
//# sourceMappingURL=chunk-65XAR7FY.js.map
|