@yuhuanowo/yunui 0.2.5 → 0.2.7
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/README.md +5 -1
- package/dist/{chunk-THKP6TBK.js → chunk-EROX7LXU.js} +412 -12
- package/dist/chunk-EROX7LXU.js.map +1 -0
- package/dist/index.d.ts +101 -2
- package/dist/index.js +1 -1
- package/dist/patterns.js +1 -1
- package/package.json +1 -1
- package/styles/yunui.css +18 -0
- package/dist/chunk-THKP6TBK.js.map +0 -1
package/README.md
CHANGED
|
@@ -85,9 +85,13 @@ Without a provider, YunUI uses zero-dependency defaults (`<a>` / `<img>` / ident
|
|
|
85
85
|
|
|
86
86
|
## Entry points
|
|
87
87
|
|
|
88
|
+
> See **[ARCHITECTURE.md](./ARCHITECTURE.md)** for the system design — the three
|
|
89
|
+
> layers (core / patterns / app-domain), the design-token system + runtime
|
|
90
|
+
> theming, the adapter pattern, and how to choose among overlapping components.
|
|
91
|
+
|
|
88
92
|
| Entry | Contents |
|
|
89
93
|
| --- | --- |
|
|
90
|
-
| `@yuhuanowo/yunui` | Atomic components: Button / IconButton / Input / Textarea / Card / Badge / Dialog / Select / Slider / Progress / Tabs / Avatar / Tooltip / DropdownMenu / Skeleton / Spinner / PageLoader / EmptyState / Label; layout primitives Flex / Grid / Row / Column / Stack; data display Table / Breadcrumb / Pagination; interactive Accordion / RadioGroup / Switch / Checkbox / Combobox / CustomSelect / SegmentedSelect / NavTabs / Collapsible / Popover / Modal / Sheet / ConfirmModal / ThemeToggle; plus ShinyButton / Marquee / BentoGrid / AnimatedNumber and the MotionDiv · fadeIn · stagger animation presets |
|
|
94
|
+
| `@yuhuanowo/yunui` | Atomic components: Button / IconButton / Input / Textarea / PasswordInput / NumberInput / SearchInput / Card / Badge / Kbd / Separator / Alert / Tag / AvatarGroup / StatusIndicator / InlineCode / Steps / Dialog / Select / Slider / Progress / Tabs / Avatar / Tooltip / DropdownMenu / Skeleton / Spinner / PageLoader / EmptyState / Label; layout primitives Flex / Grid / Row / Column / Stack; data display Table / Breadcrumb / Pagination; interactive Accordion / RadioGroup / Switch / Checkbox / Combobox / CustomSelect / SegmentedSelect / NavTabs / Collapsible / Popover / Modal / Sheet / ConfirmModal / ThemeToggle; plus ShinyButton / Marquee / BentoGrid / AnimatedNumber and the MotionDiv · fadeIn · stagger animation presets |
|
|
91
95
|
| `@yuhuanowo/yunui/css` | Design-system stylesheet (token variables, `@theme` mappings, global `.btn` / `.card` / `.glass` classes, animation keyframes) |
|
|
92
96
|
| `@yuhuanowo/yunui/adapters` | `YunUIProvider` / `useYunUI` and the adapter interfaces |
|
|
93
97
|
| `@yuhuanowo/yunui/patterns` | Page-level components: FAQ, StatCard (`tone` / `inline` / `valueFirst` variants), BlogCard, CodeBlock, Sidebar, PageHeader, BackgroundEffects, and more |
|
|
@@ -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, X, CheckCircle2, CheckCircle, Info, RefreshCw, Trash2,
|
|
15
|
+
import { Check, ChevronDown, ChevronLeft, ChevronRight, Loader2, AlertCircle, EyeOff, Eye, Minus, 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';
|
|
@@ -85,6 +85,43 @@ function useModalBehavior(isOpen, onClose) {
|
|
|
85
85
|
useEscapeKey(onClose, isOpen);
|
|
86
86
|
useBodyScrollLock(isOpen);
|
|
87
87
|
}
|
|
88
|
+
var FOCUSABLE_SELECTOR = 'a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
89
|
+
function useFocusTrap(containerRef, enabled = true) {
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (!enabled) return;
|
|
92
|
+
const container = containerRef.current;
|
|
93
|
+
if (!container) return;
|
|
94
|
+
const previouslyFocused = document.activeElement;
|
|
95
|
+
const getFocusable = () => Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR));
|
|
96
|
+
const initial = getFocusable();
|
|
97
|
+
(initial[0] ?? container).focus?.();
|
|
98
|
+
const onKeyDown = (event) => {
|
|
99
|
+
if (event.key !== "Tab") return;
|
|
100
|
+
const items = getFocusable();
|
|
101
|
+
if (items.length === 0) {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const first = items[0];
|
|
106
|
+
const last = items[items.length - 1];
|
|
107
|
+
const active = document.activeElement;
|
|
108
|
+
if (event.shiftKey) {
|
|
109
|
+
if (active === first || !container.contains(active)) {
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
last.focus();
|
|
112
|
+
}
|
|
113
|
+
} else if (active === last || !container.contains(active)) {
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
first.focus();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
container.addEventListener("keydown", onKeyDown);
|
|
119
|
+
return () => {
|
|
120
|
+
container.removeEventListener("keydown", onKeyDown);
|
|
121
|
+
previouslyFocused?.focus?.();
|
|
122
|
+
};
|
|
123
|
+
}, [enabled, containerRef]);
|
|
124
|
+
}
|
|
88
125
|
|
|
89
126
|
// src/primitives/modal/constants.ts
|
|
90
127
|
var Z_INDEX = {
|
|
@@ -185,14 +222,7 @@ function Modal({
|
|
|
185
222
|
}, []);
|
|
186
223
|
useEscapeKey(handleClose, isOpen);
|
|
187
224
|
useBodyScrollLock(isOpen);
|
|
188
|
-
|
|
189
|
-
if (isOpen && modalRef.current) {
|
|
190
|
-
const timer = setTimeout(() => {
|
|
191
|
-
modalRef.current?.focus();
|
|
192
|
-
}, 0);
|
|
193
|
-
return () => clearTimeout(timer);
|
|
194
|
-
}
|
|
195
|
-
}, [isOpen]);
|
|
225
|
+
useFocusTrap(modalRef, isOpen);
|
|
196
226
|
useEffect(() => {
|
|
197
227
|
if (isOpen && internalIsClosing) {
|
|
198
228
|
setInternalIsClosing(false);
|
|
@@ -1382,6 +1412,197 @@ var Textarea = React7.forwardRef(
|
|
|
1382
1412
|
}
|
|
1383
1413
|
);
|
|
1384
1414
|
Textarea.displayName = "Textarea";
|
|
1415
|
+
var PasswordInput = React7.forwardRef(
|
|
1416
|
+
({ className, error, id, labels, "aria-describedby": describedBy, ...props }, ref) => {
|
|
1417
|
+
const [show, setShow] = React7.useState(false);
|
|
1418
|
+
const reactId = React7.useId();
|
|
1419
|
+
const fieldId = id ?? reactId;
|
|
1420
|
+
const errorId = error ? `${fieldId}-error` : void 0;
|
|
1421
|
+
const describedByIds = [describedBy, errorId].filter(Boolean).join(" ") || void 0;
|
|
1422
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1423
|
+
/* @__PURE__ */ jsx(
|
|
1424
|
+
"input",
|
|
1425
|
+
{
|
|
1426
|
+
ref,
|
|
1427
|
+
id: fieldId,
|
|
1428
|
+
type: show ? "text" : "password",
|
|
1429
|
+
"aria-invalid": error ? true : void 0,
|
|
1430
|
+
"aria-describedby": describedByIds,
|
|
1431
|
+
className: cn(
|
|
1432
|
+
"w-full h-10 px-4 pr-10 bg-background border rounded-xl text-sm outline-none transition-colors",
|
|
1433
|
+
"placeholder:text-muted-foreground focus:border-ring focus:ring-2 focus:ring-ring/20",
|
|
1434
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1435
|
+
error ? "border-red-300 focus:border-red-400 dark:border-red-700" : "border-border",
|
|
1436
|
+
className
|
|
1437
|
+
),
|
|
1438
|
+
...props
|
|
1439
|
+
}
|
|
1440
|
+
),
|
|
1441
|
+
/* @__PURE__ */ jsx(
|
|
1442
|
+
"button",
|
|
1443
|
+
{
|
|
1444
|
+
type: "button",
|
|
1445
|
+
onClick: () => setShow((s) => !s),
|
|
1446
|
+
"aria-label": show ? labels?.hide ?? "Hide password" : labels?.show ?? "Show password",
|
|
1447
|
+
"aria-pressed": show,
|
|
1448
|
+
tabIndex: -1,
|
|
1449
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1450
|
+
children: show ? /* @__PURE__ */ jsx(EyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Eye, { className: "w-4 h-4" })
|
|
1451
|
+
}
|
|
1452
|
+
),
|
|
1453
|
+
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-red-500 flex items-center gap-1", children: [
|
|
1454
|
+
/* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
|
|
1455
|
+
error
|
|
1456
|
+
] })
|
|
1457
|
+
] });
|
|
1458
|
+
}
|
|
1459
|
+
);
|
|
1460
|
+
PasswordInput.displayName = "PasswordInput";
|
|
1461
|
+
var NumberInput = React7.forwardRef(
|
|
1462
|
+
({ className, value, onChange, min, max, step = 1, error, disabled, labels, id, "aria-describedby": describedBy, ...props }, ref) => {
|
|
1463
|
+
const reactId = React7.useId();
|
|
1464
|
+
const fieldId = id ?? reactId;
|
|
1465
|
+
const errorId = error ? `${fieldId}-error` : void 0;
|
|
1466
|
+
const describedByIds = [describedBy, errorId].filter(Boolean).join(" ") || void 0;
|
|
1467
|
+
const clamp = (n) => Math.min(max ?? Infinity, Math.max(min ?? -Infinity, n));
|
|
1468
|
+
const base = typeof value === "number" && !Number.isNaN(value) ? value : 0;
|
|
1469
|
+
const bump = (delta) => onChange?.(clamp(base + delta));
|
|
1470
|
+
const atMin = min != null && base <= min;
|
|
1471
|
+
const atMax = max != null && base >= max;
|
|
1472
|
+
const stepBtn = "flex h-10 w-10 shrink-0 items-center justify-center text-muted-foreground hover:text-foreground disabled:opacity-40 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
|
|
1473
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
1474
|
+
/* @__PURE__ */ jsxs(
|
|
1475
|
+
"div",
|
|
1476
|
+
{
|
|
1477
|
+
className: cn(
|
|
1478
|
+
"relative flex items-stretch rounded-xl border bg-background transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",
|
|
1479
|
+
error ? "border-red-300 dark:border-red-700" : "border-border",
|
|
1480
|
+
disabled && "opacity-50",
|
|
1481
|
+
className
|
|
1482
|
+
),
|
|
1483
|
+
children: [
|
|
1484
|
+
/* @__PURE__ */ jsx(
|
|
1485
|
+
"button",
|
|
1486
|
+
{
|
|
1487
|
+
type: "button",
|
|
1488
|
+
onClick: () => bump(-step),
|
|
1489
|
+
disabled: disabled || atMin,
|
|
1490
|
+
"aria-label": labels?.decrement ?? "Decrease",
|
|
1491
|
+
className: cn(stepBtn, "rounded-l-xl"),
|
|
1492
|
+
children: /* @__PURE__ */ jsx(Minus, { className: "w-4 h-4" })
|
|
1493
|
+
}
|
|
1494
|
+
),
|
|
1495
|
+
/* @__PURE__ */ jsx(
|
|
1496
|
+
"input",
|
|
1497
|
+
{
|
|
1498
|
+
ref,
|
|
1499
|
+
id: fieldId,
|
|
1500
|
+
type: "number",
|
|
1501
|
+
inputMode: "numeric",
|
|
1502
|
+
value: typeof value === "number" ? value : "",
|
|
1503
|
+
onChange: (e) => onChange?.(e.target.value === "" ? base : clamp(Number(e.target.value))),
|
|
1504
|
+
min,
|
|
1505
|
+
max,
|
|
1506
|
+
step,
|
|
1507
|
+
disabled,
|
|
1508
|
+
"aria-invalid": error ? true : void 0,
|
|
1509
|
+
"aria-describedby": describedByIds,
|
|
1510
|
+
className: "w-full min-w-0 bg-transparent px-1 text-center text-sm outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
1511
|
+
...props
|
|
1512
|
+
}
|
|
1513
|
+
),
|
|
1514
|
+
/* @__PURE__ */ jsx(
|
|
1515
|
+
"button",
|
|
1516
|
+
{
|
|
1517
|
+
type: "button",
|
|
1518
|
+
onClick: () => bump(step),
|
|
1519
|
+
disabled: disabled || atMax,
|
|
1520
|
+
"aria-label": labels?.increment ?? "Increase",
|
|
1521
|
+
className: cn(stepBtn, "rounded-r-xl"),
|
|
1522
|
+
children: /* @__PURE__ */ jsx(Plus, { className: "w-4 h-4" })
|
|
1523
|
+
}
|
|
1524
|
+
)
|
|
1525
|
+
]
|
|
1526
|
+
}
|
|
1527
|
+
),
|
|
1528
|
+
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-red-500 flex items-center gap-1", children: [
|
|
1529
|
+
/* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
|
|
1530
|
+
error
|
|
1531
|
+
] })
|
|
1532
|
+
] });
|
|
1533
|
+
}
|
|
1534
|
+
);
|
|
1535
|
+
NumberInput.displayName = "NumberInput";
|
|
1536
|
+
function Kbd({ className, ...props }) {
|
|
1537
|
+
return /* @__PURE__ */ jsx(
|
|
1538
|
+
"kbd",
|
|
1539
|
+
{
|
|
1540
|
+
className: cn(
|
|
1541
|
+
"inline-flex h-5 min-w-5 items-center justify-center rounded border border-border bg-muted px-1.5 font-mono text-[11px] font-medium text-muted-foreground",
|
|
1542
|
+
className
|
|
1543
|
+
),
|
|
1544
|
+
...props
|
|
1545
|
+
}
|
|
1546
|
+
);
|
|
1547
|
+
}
|
|
1548
|
+
var SearchInput = React7.forwardRef(
|
|
1549
|
+
({ className, value, onChange, clearable = true, clearLabel, disabled, ...props }, ref) => {
|
|
1550
|
+
const innerRef = React7.useRef(null);
|
|
1551
|
+
const setRef = React7.useCallback(
|
|
1552
|
+
(node) => {
|
|
1553
|
+
innerRef.current = node;
|
|
1554
|
+
if (typeof ref === "function") ref(node);
|
|
1555
|
+
else if (ref) ref.current = node;
|
|
1556
|
+
},
|
|
1557
|
+
[ref]
|
|
1558
|
+
);
|
|
1559
|
+
const showClear = clearable && !!value && !disabled;
|
|
1560
|
+
const handleClear = () => {
|
|
1561
|
+
onChange?.("");
|
|
1562
|
+
innerRef.current?.focus();
|
|
1563
|
+
};
|
|
1564
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1565
|
+
/* @__PURE__ */ jsx(
|
|
1566
|
+
Search,
|
|
1567
|
+
{
|
|
1568
|
+
"aria-hidden": "true",
|
|
1569
|
+
className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"
|
|
1570
|
+
}
|
|
1571
|
+
),
|
|
1572
|
+
/* @__PURE__ */ jsx(
|
|
1573
|
+
"input",
|
|
1574
|
+
{
|
|
1575
|
+
ref: setRef,
|
|
1576
|
+
type: "text",
|
|
1577
|
+
role: "searchbox",
|
|
1578
|
+
value,
|
|
1579
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
1580
|
+
disabled,
|
|
1581
|
+
className: cn(
|
|
1582
|
+
"w-full h-10 pl-10 bg-background border border-border rounded-xl text-sm outline-none transition-colors",
|
|
1583
|
+
"placeholder:text-muted-foreground",
|
|
1584
|
+
"focus:border-ring focus:ring-2 focus:ring-ring/20",
|
|
1585
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1586
|
+
showClear ? "pr-10" : "pr-4",
|
|
1587
|
+
className
|
|
1588
|
+
),
|
|
1589
|
+
...props
|
|
1590
|
+
}
|
|
1591
|
+
),
|
|
1592
|
+
showClear && /* @__PURE__ */ jsx(
|
|
1593
|
+
"button",
|
|
1594
|
+
{
|
|
1595
|
+
type: "button",
|
|
1596
|
+
onClick: handleClear,
|
|
1597
|
+
"aria-label": clearLabel ?? "Clear search",
|
|
1598
|
+
className: "absolute right-2.5 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",
|
|
1599
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
1600
|
+
}
|
|
1601
|
+
)
|
|
1602
|
+
] });
|
|
1603
|
+
}
|
|
1604
|
+
);
|
|
1605
|
+
SearchInput.displayName = "SearchInput";
|
|
1385
1606
|
var Card = React7.forwardRef(
|
|
1386
1607
|
({ className, hover, ...props }, ref) => {
|
|
1387
1608
|
return /* @__PURE__ */ jsx(
|
|
@@ -1421,6 +1642,165 @@ function Badge({ className, variant = "default", ...props }) {
|
|
|
1421
1642
|
}
|
|
1422
1643
|
);
|
|
1423
1644
|
}
|
|
1645
|
+
function Separator2({
|
|
1646
|
+
className,
|
|
1647
|
+
orientation = "horizontal",
|
|
1648
|
+
decorative = false,
|
|
1649
|
+
...props
|
|
1650
|
+
}) {
|
|
1651
|
+
return /* @__PURE__ */ jsx(
|
|
1652
|
+
"div",
|
|
1653
|
+
{
|
|
1654
|
+
role: decorative ? "none" : "separator",
|
|
1655
|
+
"aria-orientation": !decorative && orientation === "vertical" ? "vertical" : void 0,
|
|
1656
|
+
className: cn(
|
|
1657
|
+
"shrink-0 bg-border",
|
|
1658
|
+
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
1659
|
+
className
|
|
1660
|
+
),
|
|
1661
|
+
...props
|
|
1662
|
+
}
|
|
1663
|
+
);
|
|
1664
|
+
}
|
|
1665
|
+
function Alert({ className, variant = "info", title, icon, children, ...props }) {
|
|
1666
|
+
const styles = {
|
|
1667
|
+
info: "bg-blue-50 text-blue-800 border-blue-200 dark:bg-blue-900/20 dark:text-blue-300 dark:border-blue-900",
|
|
1668
|
+
success: "bg-green-50 text-green-800 border-green-200 dark:bg-green-900/20 dark:text-green-300 dark:border-green-900",
|
|
1669
|
+
warning: "bg-amber-50 text-amber-800 border-amber-200 dark:bg-amber-900/20 dark:text-amber-300 dark:border-amber-900",
|
|
1670
|
+
error: "bg-red-50 text-red-800 border-red-200 dark:bg-red-900/20 dark:text-red-300 dark:border-red-900"
|
|
1671
|
+
};
|
|
1672
|
+
const defaultIcon = {
|
|
1673
|
+
info: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4" }),
|
|
1674
|
+
success: /* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4" }),
|
|
1675
|
+
warning: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4" }),
|
|
1676
|
+
error: /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" })
|
|
1677
|
+
};
|
|
1678
|
+
const resolvedIcon = icon === void 0 ? defaultIcon[variant] : icon;
|
|
1679
|
+
return /* @__PURE__ */ jsxs(
|
|
1680
|
+
"div",
|
|
1681
|
+
{
|
|
1682
|
+
role: "alert",
|
|
1683
|
+
className: cn("flex gap-3 rounded-xl border p-3 text-sm", styles[variant], className),
|
|
1684
|
+
...props,
|
|
1685
|
+
children: [
|
|
1686
|
+
resolvedIcon && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "mt-0.5 shrink-0", children: resolvedIcon }),
|
|
1687
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1688
|
+
title && /* @__PURE__ */ jsx("p", { className: "font-medium", children: title }),
|
|
1689
|
+
children && /* @__PURE__ */ jsx("div", { className: cn(title && "mt-0.5", "opacity-90"), children })
|
|
1690
|
+
] })
|
|
1691
|
+
]
|
|
1692
|
+
}
|
|
1693
|
+
);
|
|
1694
|
+
}
|
|
1695
|
+
function Tag({ className, children, onRemove, removeLabel, ...props }) {
|
|
1696
|
+
return /* @__PURE__ */ jsxs(
|
|
1697
|
+
"span",
|
|
1698
|
+
{
|
|
1699
|
+
className: cn(
|
|
1700
|
+
"inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-xs font-medium text-foreground/80",
|
|
1701
|
+
className
|
|
1702
|
+
),
|
|
1703
|
+
...props,
|
|
1704
|
+
children: [
|
|
1705
|
+
children,
|
|
1706
|
+
onRemove && /* @__PURE__ */ jsx(
|
|
1707
|
+
"button",
|
|
1708
|
+
{
|
|
1709
|
+
type: "button",
|
|
1710
|
+
onClick: onRemove,
|
|
1711
|
+
"aria-label": removeLabel ?? "Remove",
|
|
1712
|
+
className: "-mr-0.5 rounded-sm p-0.5 text-muted-foreground hover:bg-foreground/10 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1713
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
|
|
1714
|
+
}
|
|
1715
|
+
)
|
|
1716
|
+
]
|
|
1717
|
+
}
|
|
1718
|
+
);
|
|
1719
|
+
}
|
|
1720
|
+
function StatusIndicator({
|
|
1721
|
+
status = "neutral",
|
|
1722
|
+
pulse = false,
|
|
1723
|
+
className,
|
|
1724
|
+
children,
|
|
1725
|
+
...props
|
|
1726
|
+
}) {
|
|
1727
|
+
const color = {
|
|
1728
|
+
online: "bg-green-500",
|
|
1729
|
+
offline: "bg-zinc-400",
|
|
1730
|
+
busy: "bg-red-500",
|
|
1731
|
+
away: "bg-amber-500",
|
|
1732
|
+
neutral: "bg-muted-foreground"
|
|
1733
|
+
}[status];
|
|
1734
|
+
return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-1.5 text-sm", className), ...props, children: [
|
|
1735
|
+
/* @__PURE__ */ jsxs("span", { className: "relative flex h-2 w-2 shrink-0", children: [
|
|
1736
|
+
pulse && /* @__PURE__ */ jsx(
|
|
1737
|
+
"span",
|
|
1738
|
+
{
|
|
1739
|
+
"aria-hidden": "true",
|
|
1740
|
+
className: cn("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75", color)
|
|
1741
|
+
}
|
|
1742
|
+
),
|
|
1743
|
+
/* @__PURE__ */ jsx("span", { className: cn("relative inline-flex h-2 w-2 rounded-full", color) })
|
|
1744
|
+
] }),
|
|
1745
|
+
children
|
|
1746
|
+
] });
|
|
1747
|
+
}
|
|
1748
|
+
function InlineCode({ className, ...props }) {
|
|
1749
|
+
return /* @__PURE__ */ jsx(
|
|
1750
|
+
"code",
|
|
1751
|
+
{
|
|
1752
|
+
className: cn(
|
|
1753
|
+
"rounded bg-muted px-1.5 py-0.5 font-mono text-[0.85em] text-foreground/90",
|
|
1754
|
+
className
|
|
1755
|
+
),
|
|
1756
|
+
...props
|
|
1757
|
+
}
|
|
1758
|
+
);
|
|
1759
|
+
}
|
|
1760
|
+
function Steps({ steps, current = 0, className, ...props }) {
|
|
1761
|
+
return /* @__PURE__ */ jsx("ol", { className: cn("flex flex-col", className), ...props, children: steps.map((step, i) => {
|
|
1762
|
+
const state = i < current ? "done" : i === current ? "active" : "upcoming";
|
|
1763
|
+
const isLast = i === steps.length - 1;
|
|
1764
|
+
return /* @__PURE__ */ jsxs("li", { className: "flex gap-3", children: [
|
|
1765
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
1766
|
+
/* @__PURE__ */ jsx(
|
|
1767
|
+
"span",
|
|
1768
|
+
{
|
|
1769
|
+
"aria-hidden": "true",
|
|
1770
|
+
className: cn(
|
|
1771
|
+
"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border text-xs font-medium",
|
|
1772
|
+
state === "done" && "border-transparent bg-primary text-primary-foreground",
|
|
1773
|
+
state === "active" && "border-primary text-primary",
|
|
1774
|
+
state === "upcoming" && "border-border text-muted-foreground"
|
|
1775
|
+
),
|
|
1776
|
+
children: state === "done" ? /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5" }) : i + 1
|
|
1777
|
+
}
|
|
1778
|
+
),
|
|
1779
|
+
!isLast && /* @__PURE__ */ jsx(
|
|
1780
|
+
"span",
|
|
1781
|
+
{
|
|
1782
|
+
"aria-hidden": "true",
|
|
1783
|
+
className: cn("w-px flex-1 my-1", i < current ? "bg-primary" : "bg-border")
|
|
1784
|
+
}
|
|
1785
|
+
)
|
|
1786
|
+
] }),
|
|
1787
|
+
/* @__PURE__ */ jsxs("div", { className: cn("pb-6", isLast && "pb-0"), children: [
|
|
1788
|
+
/* @__PURE__ */ jsx(
|
|
1789
|
+
"p",
|
|
1790
|
+
{
|
|
1791
|
+
className: cn(
|
|
1792
|
+
"text-sm font-medium leading-6",
|
|
1793
|
+
state === "upcoming" ? "text-muted-foreground" : "text-foreground"
|
|
1794
|
+
),
|
|
1795
|
+
"aria-current": state === "active" ? "step" : void 0,
|
|
1796
|
+
children: step.title
|
|
1797
|
+
}
|
|
1798
|
+
),
|
|
1799
|
+
step.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: step.description })
|
|
1800
|
+
] })
|
|
1801
|
+
] }, i);
|
|
1802
|
+
}) });
|
|
1803
|
+
}
|
|
1424
1804
|
var Dialog = DialogPrimitive.Root;
|
|
1425
1805
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
1426
1806
|
var DialogPortal = DialogPrimitive.Portal;
|
|
@@ -1660,6 +2040,26 @@ var AvatarFallback = React7.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1660
2040
|
}
|
|
1661
2041
|
));
|
|
1662
2042
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
2043
|
+
function AvatarGroup({ className, max, children, ...props }) {
|
|
2044
|
+
const items = React7.Children.toArray(children);
|
|
2045
|
+
const shown = max != null ? items.slice(0, max) : items;
|
|
2046
|
+
const overflow = items.length - shown.length;
|
|
2047
|
+
const ring = { boxShadow: "0 0 0 2px var(--color-background)" };
|
|
2048
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center -space-x-2", className), ...props, children: [
|
|
2049
|
+
shown.map((child, i) => /* @__PURE__ */ jsx("div", { className: "rounded-full", style: ring, children: child }, i)),
|
|
2050
|
+
overflow > 0 && /* @__PURE__ */ jsxs(
|
|
2051
|
+
"div",
|
|
2052
|
+
{
|
|
2053
|
+
className: "flex h-10 w-10 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground",
|
|
2054
|
+
style: ring,
|
|
2055
|
+
children: [
|
|
2056
|
+
"+",
|
|
2057
|
+
overflow
|
|
2058
|
+
]
|
|
2059
|
+
}
|
|
2060
|
+
)
|
|
2061
|
+
] });
|
|
2062
|
+
}
|
|
1663
2063
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
1664
2064
|
var Tooltip = TooltipPrimitive.Root;
|
|
1665
2065
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
@@ -2547,6 +2947,6 @@ function useYunUITheme(defaults = {}) {
|
|
|
2547
2947
|
return [theme, update];
|
|
2548
2948
|
}
|
|
2549
2949
|
|
|
2550
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedNumber, Avatar, AvatarFallback, 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, Input, Label2 as Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, PageLoader, Pagination, Popover, PopoverClose2 as PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, YUNUI_PALETTES, applyTheme, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior, useYunUITheme };
|
|
2551
|
-
//# sourceMappingURL=chunk-
|
|
2552
|
-
//# sourceMappingURL=chunk-
|
|
2950
|
+
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-EROX7LXU.js.map
|
|
2952
|
+
//# sourceMappingURL=chunk-EROX7LXU.js.map
|