@blinkdotnew/ui 0.4.0 → 0.5.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.mts +235 -232
- package/dist/index.d.ts +235 -232
- package/dist/index.js +75 -121
- package/dist/index.mjs +74 -120
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var React66 = require('react');
|
|
4
|
-
var
|
|
5
|
+
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
5
6
|
var clsx = require('clsx');
|
|
6
7
|
var tailwindMerge = require('tailwind-merge');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
9
|
var reactSlot = require('@radix-ui/react-slot');
|
|
8
10
|
var classVarianceAuthority = require('class-variance-authority');
|
|
9
11
|
var SelectPrimitive = require('@radix-ui/react-select');
|
|
@@ -14,7 +16,6 @@ var SwitchPrimitive = require('@radix-ui/react-switch');
|
|
|
14
16
|
var SliderPrimitive = require('@radix-ui/react-slider');
|
|
15
17
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
16
18
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
17
|
-
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
18
19
|
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
19
20
|
var ContextMenuPrimitive = require('@radix-ui/react-context-menu');
|
|
20
21
|
var AvatarPrimitive = require('@radix-ui/react-avatar');
|
|
@@ -69,6 +70,7 @@ function _interopNamespace(e) {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
var React66__namespace = /*#__PURE__*/_interopNamespace(React66);
|
|
73
|
+
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
72
74
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
73
75
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
74
76
|
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
@@ -76,7 +78,6 @@ var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive)
|
|
|
76
78
|
var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
|
|
77
79
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
78
80
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
79
|
-
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
80
81
|
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
81
82
|
var ContextMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(ContextMenuPrimitive);
|
|
82
83
|
var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
|
|
@@ -99,11 +100,32 @@ var MenubarPrimitive__namespace = /*#__PURE__*/_interopNamespace(MenubarPrimitiv
|
|
|
99
100
|
var ResizablePrimitive__namespace = /*#__PURE__*/_interopNamespace(ResizablePrimitive);
|
|
100
101
|
|
|
101
102
|
// src/provider/blink-ui-provider.tsx
|
|
103
|
+
function cn(...inputs) {
|
|
104
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
105
|
+
}
|
|
106
|
+
var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
107
|
+
var Tooltip = TooltipPrimitive__namespace.Root;
|
|
108
|
+
var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
109
|
+
var TooltipContent = React66__namespace.default.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
110
|
+
TooltipPrimitive__namespace.Content,
|
|
111
|
+
{
|
|
112
|
+
ref,
|
|
113
|
+
sideOffset,
|
|
114
|
+
className: cn(
|
|
115
|
+
"z-50 overflow-hidden rounded-md bg-[hsl(var(--primary))] px-3 py-1.5 text-xs text-[hsl(var(--primary-foreground))] shadow-md",
|
|
116
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
117
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
118
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
119
|
+
className
|
|
120
|
+
),
|
|
121
|
+
...props
|
|
122
|
+
}
|
|
123
|
+
) }));
|
|
124
|
+
TooltipContent.displayName = TooltipPrimitive__namespace.Content.displayName;
|
|
102
125
|
var BlinkUIContext = React66.createContext(null);
|
|
103
126
|
function useBlinkUI() {
|
|
104
127
|
const ctx = React66.useContext(BlinkUIContext);
|
|
105
|
-
if (!ctx)
|
|
106
|
-
throw new Error("useBlinkUI must be used within <BlinkUIProvider>");
|
|
128
|
+
if (!ctx) throw new Error("useBlinkUI must be used within <BlinkUIProvider>");
|
|
107
129
|
return ctx;
|
|
108
130
|
}
|
|
109
131
|
function BlinkUIProvider({
|
|
@@ -131,10 +153,7 @@ function BlinkUIProvider({
|
|
|
131
153
|
root.classList.add(`theme-${theme}`);
|
|
132
154
|
root.classList.add(resolvedDark ? "dark" : "light");
|
|
133
155
|
}, [theme, resolvedDark]);
|
|
134
|
-
return /* @__PURE__ */ jsxRuntime.jsx(BlinkUIContext.Provider, { value: { theme, darkMode, resolvedDark, setTheme, setDarkMode }, children });
|
|
135
|
-
}
|
|
136
|
-
function cn(...inputs) {
|
|
137
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
156
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BlinkUIContext.Provider, { value: { theme, darkMode, resolvedDark, setTheme, setDarkMode }, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { delayDuration: 0, children }) });
|
|
138
157
|
}
|
|
139
158
|
var buttonVariants = classVarianceAuthority.cva(
|
|
140
159
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium font-sans transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
@@ -515,25 +534,6 @@ var PopoverContent = React66__namespace.default.forwardRef(({ className, align =
|
|
|
515
534
|
}
|
|
516
535
|
) }));
|
|
517
536
|
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
518
|
-
var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
519
|
-
var Tooltip = TooltipPrimitive__namespace.Root;
|
|
520
|
-
var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
521
|
-
var TooltipContent = React66__namespace.default.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
522
|
-
TooltipPrimitive__namespace.Content,
|
|
523
|
-
{
|
|
524
|
-
ref,
|
|
525
|
-
sideOffset,
|
|
526
|
-
className: cn(
|
|
527
|
-
"z-50 overflow-hidden rounded-md bg-[hsl(var(--primary))] px-3 py-1.5 text-xs text-[hsl(var(--primary-foreground))] shadow-md",
|
|
528
|
-
"animate-in fade-in-0 zoom-in-95",
|
|
529
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
530
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
531
|
-
className
|
|
532
|
-
),
|
|
533
|
-
...props
|
|
534
|
-
}
|
|
535
|
-
) }));
|
|
536
|
-
TooltipContent.displayName = TooltipPrimitive__namespace.Content.displayName;
|
|
537
537
|
var DropdownMenu = DropdownMenuPrimitive__namespace.Root;
|
|
538
538
|
var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
|
|
539
539
|
var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
|
|
@@ -941,8 +941,7 @@ var SidebarItem = React66__namespace.default.forwardRef(
|
|
|
941
941
|
!collapsed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 min-w-0 truncate", children: label }),
|
|
942
942
|
!collapsed && badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full bg-[hsl(var(--primary))] bg-opacity-10 text-[hsl(var(--primary))] shrink-0 font-medium", children: badge })
|
|
943
943
|
] });
|
|
944
|
-
if (href)
|
|
945
|
-
return /* @__PURE__ */ jsxRuntime.jsx("a", { href, className: cls, onClick, children: inner });
|
|
944
|
+
if (href) return /* @__PURE__ */ jsxRuntime.jsx("a", { href, className: cls, onClick, children: inner });
|
|
946
945
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, role: "button", tabIndex: 0, className: cls, onClick, ...props, children: inner });
|
|
947
946
|
}
|
|
948
947
|
);
|
|
@@ -1179,10 +1178,8 @@ FieldError.displayName = "FieldError";
|
|
|
1179
1178
|
function getStrength(value) {
|
|
1180
1179
|
const has = (re) => re.test(value);
|
|
1181
1180
|
const score = [value.length >= 8, has(/[A-Z]/), has(/[0-9]/), has(/[^A-Za-z0-9]/)].filter(Boolean).length;
|
|
1182
|
-
if (score <= 1)
|
|
1183
|
-
|
|
1184
|
-
if (score <= 3)
|
|
1185
|
-
return { level: "medium", width: "w-2/3", color: "bg-yellow-500" };
|
|
1181
|
+
if (score <= 1) return { level: "weak", width: "w-1/3", color: "bg-[hsl(var(--destructive))]" };
|
|
1182
|
+
if (score <= 3) return { level: "medium", width: "w-2/3", color: "bg-yellow-500" };
|
|
1186
1183
|
return { level: "strong", width: "w-full", color: "bg-green-500" };
|
|
1187
1184
|
}
|
|
1188
1185
|
var PasswordInput = React66__namespace.default.forwardRef(
|
|
@@ -1226,13 +1223,11 @@ var SearchInput = React66__namespace.default.forwardRef(
|
|
|
1226
1223
|
const isControlled = valueProp !== void 0;
|
|
1227
1224
|
const value = isControlled ? String(valueProp) : String(internalValue);
|
|
1228
1225
|
function handleChange(e) {
|
|
1229
|
-
if (!isControlled)
|
|
1230
|
-
setInternalValue(e.target.value);
|
|
1226
|
+
if (!isControlled) setInternalValue(e.target.value);
|
|
1231
1227
|
onChange?.(e.target.value);
|
|
1232
1228
|
}
|
|
1233
1229
|
function handleClear() {
|
|
1234
|
-
if (!isControlled)
|
|
1235
|
-
setInternalValue("");
|
|
1230
|
+
if (!isControlled) setInternalValue("");
|
|
1236
1231
|
onChange?.("");
|
|
1237
1232
|
onClear?.();
|
|
1238
1233
|
}
|
|
@@ -1268,10 +1263,8 @@ var SearchInput = React66__namespace.default.forwardRef(
|
|
|
1268
1263
|
);
|
|
1269
1264
|
SearchInput.displayName = "SearchInput";
|
|
1270
1265
|
function formatBytes(bytes) {
|
|
1271
|
-
if (bytes < 1024)
|
|
1272
|
-
|
|
1273
|
-
if (bytes < 1024 * 1024)
|
|
1274
|
-
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
1266
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
1267
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
1275
1268
|
return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
1276
1269
|
}
|
|
1277
1270
|
function filterBySize(files, maxSize) {
|
|
@@ -1281,16 +1274,14 @@ function FileUpload({ accept, multiple, maxSize, onFiles, className, disabled })
|
|
|
1281
1274
|
const inputRef = React66.useRef(null);
|
|
1282
1275
|
const [dragging, setDragging] = React66.useState(false);
|
|
1283
1276
|
function handleFiles(raw) {
|
|
1284
|
-
if (!raw)
|
|
1285
|
-
return;
|
|
1277
|
+
if (!raw) return;
|
|
1286
1278
|
const files = filterBySize(Array.from(raw), maxSize);
|
|
1287
1279
|
onFiles?.(files);
|
|
1288
1280
|
}
|
|
1289
1281
|
function handleDrop(e) {
|
|
1290
1282
|
e.preventDefault();
|
|
1291
1283
|
setDragging(false);
|
|
1292
|
-
if (!disabled)
|
|
1293
|
-
handleFiles(e.dataTransfer.files);
|
|
1284
|
+
if (!disabled) handleFiles(e.dataTransfer.files);
|
|
1294
1285
|
}
|
|
1295
1286
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1296
1287
|
"div",
|
|
@@ -1301,8 +1292,7 @@ function FileUpload({ accept, multiple, maxSize, onFiles, className, disabled })
|
|
|
1301
1292
|
onKeyDown: (e) => e.key === "Enter" && !disabled && inputRef.current?.click(),
|
|
1302
1293
|
onDragOver: (e) => {
|
|
1303
1294
|
e.preventDefault();
|
|
1304
|
-
if (!disabled)
|
|
1305
|
-
setDragging(true);
|
|
1295
|
+
if (!disabled) setDragging(true);
|
|
1306
1296
|
},
|
|
1307
1297
|
onDragLeave: () => setDragging(false),
|
|
1308
1298
|
onDrop: handleDrop,
|
|
@@ -1338,8 +1328,7 @@ function FileUpload({ accept, multiple, maxSize, onFiles, className, disabled })
|
|
|
1338
1328
|
);
|
|
1339
1329
|
}
|
|
1340
1330
|
function FileUploadPreview({ files, onRemove, className }) {
|
|
1341
|
-
if (!files.length)
|
|
1342
|
-
return null;
|
|
1331
|
+
if (!files.length) return null;
|
|
1343
1332
|
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: cn("flex flex-col gap-1", className), children: files.map((file, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center justify-between rounded-md border border-[hsl(var(--border))] px-3 py-2 text-sm", children: [
|
|
1344
1333
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate text-[hsl(var(--foreground))]", children: file.name }),
|
|
1345
1334
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-2 flex shrink-0 items-center gap-2", children: [
|
|
@@ -1375,8 +1364,7 @@ function CalendarGrid({ year, month, selected, onSelect }) {
|
|
|
1375
1364
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-7 gap-0.5", children: [
|
|
1376
1365
|
DAYS.map((d) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-1 text-center text-xs font-medium text-[hsl(var(--muted-foreground))]", children: d }, d)),
|
|
1377
1366
|
cells.map((day, i) => {
|
|
1378
|
-
if (!day)
|
|
1379
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", {}, i);
|
|
1367
|
+
if (!day) return /* @__PURE__ */ jsxRuntime.jsx("div", {}, i);
|
|
1380
1368
|
const date = new Date(year, month, day);
|
|
1381
1369
|
const isToday = isSameDay(date, today);
|
|
1382
1370
|
const isSelected = selected && isSameDay(date, selected);
|
|
@@ -1474,15 +1462,13 @@ function FormMessage({ className, children, name }) {
|
|
|
1474
1462
|
const { formState } = reactHookForm.useFormContext();
|
|
1475
1463
|
const error = name ? formState.errors[name] : void 0;
|
|
1476
1464
|
const message = error?.message ? String(error.message) : children;
|
|
1477
|
-
if (!message)
|
|
1478
|
-
return null;
|
|
1465
|
+
if (!message) return null;
|
|
1479
1466
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-xs text-[hsl(var(--destructive))]", className), children: message });
|
|
1480
1467
|
}
|
|
1481
1468
|
var StepFormContext = React66.createContext(null);
|
|
1482
1469
|
function useStepForm() {
|
|
1483
1470
|
const ctx = React66.useContext(StepFormContext);
|
|
1484
|
-
if (!ctx)
|
|
1485
|
-
throw new Error("useStepForm must be used within StepForm");
|
|
1471
|
+
if (!ctx) throw new Error("useStepForm must be used within StepForm");
|
|
1486
1472
|
return ctx;
|
|
1487
1473
|
}
|
|
1488
1474
|
function StepForm({ steps, onSubmit, children, className }) {
|
|
@@ -1545,8 +1531,7 @@ function ArrayField({
|
|
|
1545
1531
|
className
|
|
1546
1532
|
}) {
|
|
1547
1533
|
function add() {
|
|
1548
|
-
if (maxItems && value.length >= maxItems)
|
|
1549
|
-
return;
|
|
1534
|
+
if (maxItems && value.length >= maxItems) return;
|
|
1550
1535
|
onChange([...value, defaultItem]);
|
|
1551
1536
|
}
|
|
1552
1537
|
function remove(index) {
|
|
@@ -1616,10 +1601,8 @@ function toLabel(key) {
|
|
|
1616
1601
|
return key.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase());
|
|
1617
1602
|
}
|
|
1618
1603
|
function getInputType(field) {
|
|
1619
|
-
if (field instanceof z__namespace.ZodEmail)
|
|
1620
|
-
|
|
1621
|
-
if (field instanceof z__namespace.ZodURL)
|
|
1622
|
-
return "url";
|
|
1604
|
+
if (field instanceof z__namespace.ZodEmail) return "email";
|
|
1605
|
+
if (field instanceof z__namespace.ZodURL) return "url";
|
|
1623
1606
|
return "text";
|
|
1624
1607
|
}
|
|
1625
1608
|
function unwrapOptional(field) {
|
|
@@ -1687,8 +1670,7 @@ function AutoForm({ schema, onSubmit, defaultValues, submitLabel = "Submit" }) {
|
|
|
1687
1670
|
] });
|
|
1688
1671
|
}
|
|
1689
1672
|
function DataTableColumnHeader({ column, title }) {
|
|
1690
|
-
if (!column.getCanSort())
|
|
1691
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: title });
|
|
1673
|
+
if (!column.getCanSort()) return /* @__PURE__ */ jsxRuntime.jsx("span", { children: title });
|
|
1692
1674
|
const sorted = column.getIsSorted();
|
|
1693
1675
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1694
1676
|
"button",
|
|
@@ -1728,8 +1710,7 @@ function DataTablePagination({ table }) {
|
|
|
1728
1710
|
] });
|
|
1729
1711
|
}
|
|
1730
1712
|
function DataTableToolbar({ table, searchColumn }) {
|
|
1731
|
-
if (!searchColumn)
|
|
1732
|
-
return null;
|
|
1713
|
+
if (!searchColumn) return null;
|
|
1733
1714
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1734
1715
|
Input,
|
|
1735
1716
|
{
|
|
@@ -1753,8 +1734,7 @@ function DataTable({ columns, data, pageSize = 10, searchable, searchColumn, loa
|
|
|
1753
1734
|
initialState: { pagination: { pageSize } },
|
|
1754
1735
|
state: { sorting }
|
|
1755
1736
|
});
|
|
1756
|
-
if (loading)
|
|
1757
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-10 w-full" }, i)) });
|
|
1737
|
+
if (loading) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-10 w-full" }, i)) });
|
|
1758
1738
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
|
|
1759
1739
|
searchable && /* @__PURE__ */ jsxRuntime.jsx(DataTableToolbar, { table, searchColumn }),
|
|
1760
1740
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border border-[hsl(var(--border))] overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full text-sm", children: [
|
|
@@ -1784,10 +1764,8 @@ function EditableCell({ value: initial, onSave }) {
|
|
|
1784
1764
|
onChange: (e) => setVal(e.target.value),
|
|
1785
1765
|
onBlur: commit,
|
|
1786
1766
|
onKeyDown: (e) => {
|
|
1787
|
-
if (e.key === "Enter")
|
|
1788
|
-
|
|
1789
|
-
if (e.key === "Escape")
|
|
1790
|
-
setEditing(false);
|
|
1767
|
+
if (e.key === "Enter") commit();
|
|
1768
|
+
if (e.key === "Escape") setEditing(false);
|
|
1791
1769
|
}
|
|
1792
1770
|
}
|
|
1793
1771
|
);
|
|
@@ -1806,8 +1784,7 @@ function DataGrid({ columns, data: initialData, onDataChange, editable, classNam
|
|
|
1806
1784
|
const [rowSelection, setRowSelection] = React66__namespace.default.useState({});
|
|
1807
1785
|
const columnResizeMode = "onChange";
|
|
1808
1786
|
const editableColumns = React66__namespace.default.useMemo(() => {
|
|
1809
|
-
if (!editable)
|
|
1810
|
-
return columns;
|
|
1787
|
+
if (!editable) return columns;
|
|
1811
1788
|
return columns.map((col) => ({
|
|
1812
1789
|
...col,
|
|
1813
1790
|
cell: (info) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2116,8 +2093,7 @@ function Banner({
|
|
|
2116
2093
|
onDismiss?.();
|
|
2117
2094
|
}, 200);
|
|
2118
2095
|
};
|
|
2119
|
-
if (dismissed)
|
|
2120
|
-
return null;
|
|
2096
|
+
if (dismissed) return null;
|
|
2121
2097
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2122
2098
|
"div",
|
|
2123
2099
|
{
|
|
@@ -2247,8 +2223,7 @@ function Breadcrumb({ children, className }) {
|
|
|
2247
2223
|
const withSeparators = [];
|
|
2248
2224
|
items.forEach((item, i) => {
|
|
2249
2225
|
withSeparators.push(item);
|
|
2250
|
-
if (i < items.length - 1)
|
|
2251
|
-
withSeparators.push(/* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {}, `sep-${i}`));
|
|
2226
|
+
if (i < items.length - 1) withSeparators.push(/* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {}, `sep-${i}`));
|
|
2252
2227
|
});
|
|
2253
2228
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "breadcrumb", children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: cn("flex flex-wrap items-center gap-1", className), children: withSeparators }) });
|
|
2254
2229
|
}
|
|
@@ -2271,8 +2246,7 @@ function AddFilterPopover({ filters, onAdd }) {
|
|
|
2271
2246
|
const def = filters.find((f) => f.key === key);
|
|
2272
2247
|
const ops = def?.type === "number" ? numOps : textOps;
|
|
2273
2248
|
const handleAdd = () => {
|
|
2274
|
-
if (!key || !val)
|
|
2275
|
-
return;
|
|
2249
|
+
if (!key || !val) return;
|
|
2276
2250
|
onAdd({ key, operator: op || ops[0], value: val });
|
|
2277
2251
|
setKey("");
|
|
2278
2252
|
setOp("");
|
|
@@ -2317,8 +2291,7 @@ function Filters({ filters, value, onChange, className }) {
|
|
|
2317
2291
|
] });
|
|
2318
2292
|
}
|
|
2319
2293
|
function BulkActions({ count, actions, onClear, className }) {
|
|
2320
|
-
if (count === 0)
|
|
2321
|
-
return null;
|
|
2294
|
+
if (count === 0) return null;
|
|
2322
2295
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-4 py-2 shadow-lg", className), children: [
|
|
2323
2296
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-medium text-[hsl(var(--foreground))] pr-2 border-r border-[hsl(var(--border))]", children: [
|
|
2324
2297
|
count,
|
|
@@ -2371,8 +2344,7 @@ function ToggleButtonGroup(props) {
|
|
|
2371
2344
|
}
|
|
2372
2345
|
};
|
|
2373
2346
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("inline-flex items-center gap-1 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.4)] p-0.5", className), children: React66__namespace.default.Children.map(children, (child) => {
|
|
2374
|
-
if (!React66__namespace.default.isValidElement(child))
|
|
2375
|
-
return child;
|
|
2347
|
+
if (!React66__namespace.default.isValidElement(child)) return child;
|
|
2376
2348
|
const tb = child;
|
|
2377
2349
|
return React66__namespace.default.cloneElement(tb, {
|
|
2378
2350
|
pressed: isPressed(tb.props.value),
|
|
@@ -2434,8 +2406,7 @@ function CommandBar({ open, onOpenChange, children, placeholder = "Search comman
|
|
|
2434
2406
|
return;
|
|
2435
2407
|
}
|
|
2436
2408
|
const focusable = items.current?.querySelectorAll("button");
|
|
2437
|
-
if (!focusable?.length)
|
|
2438
|
-
return;
|
|
2409
|
+
if (!focusable?.length) return;
|
|
2439
2410
|
const arr = Array.from(focusable);
|
|
2440
2411
|
const idx = arr.indexOf(document.activeElement);
|
|
2441
2412
|
if (e.key === "ArrowDown") {
|
|
@@ -2517,18 +2488,14 @@ function Kanban({ columns: initialColumns, onMoveCard, className }) {
|
|
|
2517
2488
|
const onDragEnd = ({ active, over }) => {
|
|
2518
2489
|
setActiveCard(null);
|
|
2519
2490
|
setOverColId(null);
|
|
2520
|
-
if (!over || active.id === over.id)
|
|
2521
|
-
return;
|
|
2491
|
+
if (!over || active.id === over.id) return;
|
|
2522
2492
|
const fromCol = findColByCard(active.id);
|
|
2523
2493
|
const toCol = cols.find((c) => c.id === over.id) ?? findColByCard(over.id);
|
|
2524
|
-
if (!fromCol || !toCol || fromCol.id === toCol.id)
|
|
2525
|
-
return;
|
|
2494
|
+
if (!fromCol || !toCol || fromCol.id === toCol.id) return;
|
|
2526
2495
|
const card = fromCol.cards.find((c) => c.id === active.id);
|
|
2527
2496
|
setCols((prev) => prev.map((c) => {
|
|
2528
|
-
if (c.id === fromCol.id)
|
|
2529
|
-
|
|
2530
|
-
if (c.id === toCol.id)
|
|
2531
|
-
return { ...c, cards: [...c.cards, card] };
|
|
2497
|
+
if (c.id === fromCol.id) return { ...c, cards: c.cards.filter((card2) => card2.id !== active.id) };
|
|
2498
|
+
if (c.id === toCol.id) return { ...c, cards: [...c.cards, card] };
|
|
2532
2499
|
return c;
|
|
2533
2500
|
}));
|
|
2534
2501
|
onMoveCard?.(active.id, fromCol.id, toCol.id);
|
|
@@ -2700,8 +2667,7 @@ function LineChart({
|
|
|
2700
2667
|
] }) }) });
|
|
2701
2668
|
}
|
|
2702
2669
|
function buildPath(data, w, h) {
|
|
2703
|
-
if (data.length < 2)
|
|
2704
|
-
return "";
|
|
2670
|
+
if (data.length < 2) return "";
|
|
2705
2671
|
const min = Math.min(...data);
|
|
2706
2672
|
const max = Math.max(...data);
|
|
2707
2673
|
const range = max - min || 1;
|
|
@@ -2722,8 +2688,7 @@ function Sparkline({
|
|
|
2722
2688
|
className
|
|
2723
2689
|
}) {
|
|
2724
2690
|
const path = buildPath(data, width, height);
|
|
2725
|
-
if (!path)
|
|
2726
|
-
return null;
|
|
2691
|
+
if (!path) return null;
|
|
2727
2692
|
const min = Math.min(...data);
|
|
2728
2693
|
const max = Math.max(...data);
|
|
2729
2694
|
const range = max - min || 1;
|
|
@@ -2775,8 +2740,7 @@ function Beacon({ color = "primary", size = "md", children, className }) {
|
|
|
2775
2740
|
var TourContext = React66.createContext(null);
|
|
2776
2741
|
function useTour() {
|
|
2777
2742
|
const ctx = React66.useContext(TourContext);
|
|
2778
|
-
if (!ctx)
|
|
2779
|
-
throw new Error("useTour must be used within <Tour>");
|
|
2743
|
+
if (!ctx) throw new Error("useTour must be used within <Tour>");
|
|
2780
2744
|
return ctx;
|
|
2781
2745
|
}
|
|
2782
2746
|
function Tour({ totalSteps, children }) {
|
|
@@ -2791,15 +2755,11 @@ function Tour({ totalSteps, children }) {
|
|
|
2791
2755
|
const prev = React66.useCallback(() => setCurrentStep((s) => Math.max(s - 1, 0)), []);
|
|
2792
2756
|
const goTo = React66.useCallback((step) => setCurrentStep(Math.max(0, Math.min(step, totalSteps - 1))), [totalSteps]);
|
|
2793
2757
|
React66.useEffect(() => {
|
|
2794
|
-
if (!isActive)
|
|
2795
|
-
return;
|
|
2758
|
+
if (!isActive) return;
|
|
2796
2759
|
const onKey = (e) => {
|
|
2797
|
-
if (e.key === "Escape")
|
|
2798
|
-
|
|
2799
|
-
if (e.key === "
|
|
2800
|
-
next();
|
|
2801
|
-
if (e.key === "ArrowLeft")
|
|
2802
|
-
prev();
|
|
2760
|
+
if (e.key === "Escape") stop();
|
|
2761
|
+
if (e.key === "ArrowRight") next();
|
|
2762
|
+
if (e.key === "ArrowLeft") prev();
|
|
2803
2763
|
};
|
|
2804
2764
|
window.addEventListener("keydown", onKey);
|
|
2805
2765
|
return () => window.removeEventListener("keydown", onKey);
|
|
@@ -3338,8 +3298,7 @@ function InviteModal({ className }) {
|
|
|
3338
3298
|
const [role, setRole] = React66.useState("Member");
|
|
3339
3299
|
const [pending, setPending] = React66.useState(PENDING);
|
|
3340
3300
|
const invite = () => {
|
|
3341
|
-
if (!email.trim())
|
|
3342
|
-
return;
|
|
3301
|
+
if (!email.trim()) return;
|
|
3343
3302
|
setPending((p) => [...p, { email: email.trim(), role }]);
|
|
3344
3303
|
setEmail("");
|
|
3345
3304
|
};
|
|
@@ -3388,8 +3347,7 @@ function ManageTagsModal({ className }) {
|
|
|
3388
3347
|
const [newTag, setNewTag] = React66.useState("");
|
|
3389
3348
|
const [colorIdx, setColorIdx] = React66.useState(0);
|
|
3390
3349
|
const addTag = () => {
|
|
3391
|
-
if (!newTag.trim())
|
|
3392
|
-
return;
|
|
3350
|
+
if (!newTag.trim()) return;
|
|
3393
3351
|
const id = `tag-${Date.now()}`;
|
|
3394
3352
|
setTags((t) => [...t, { id, name: newTag.trim(), color: COLORS[colorIdx % COLORS.length] }]);
|
|
3395
3353
|
setNewTag("");
|
|
@@ -3652,8 +3610,7 @@ function ChatDetail({ className }) {
|
|
|
3652
3610
|
const [messages, setMessages] = React66.useState(INITIAL_MESSAGES);
|
|
3653
3611
|
const [input, setInput] = React66.useState("");
|
|
3654
3612
|
const send = () => {
|
|
3655
|
-
if (!input.trim())
|
|
3656
|
-
return;
|
|
3613
|
+
if (!input.trim()) return;
|
|
3657
3614
|
const now = (/* @__PURE__ */ new Date()).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
3658
3615
|
setMessages((m) => [...m, { id: `${Date.now()}`, author: "You", initials: "JD", text: input.trim(), time: now, self: true }]);
|
|
3659
3616
|
setInput("");
|
|
@@ -4288,11 +4245,9 @@ var Label4 = React66__namespace.forwardRef((props, forwardedRef) => {
|
|
|
4288
4245
|
ref: forwardedRef,
|
|
4289
4246
|
onMouseDown: (event) => {
|
|
4290
4247
|
const target = event.target;
|
|
4291
|
-
if (target.closest("button, input, select, textarea"))
|
|
4292
|
-
return;
|
|
4248
|
+
if (target.closest("button, input, select, textarea")) return;
|
|
4293
4249
|
props.onMouseDown?.(event);
|
|
4294
|
-
if (!event.defaultPrevented && event.detail > 1)
|
|
4295
|
-
event.preventDefault();
|
|
4250
|
+
if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
|
|
4296
4251
|
}
|
|
4297
4252
|
}
|
|
4298
4253
|
);
|
|
@@ -4917,8 +4872,7 @@ function CalendarDayButton({
|
|
|
4917
4872
|
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
4918
4873
|
const ref = React66__namespace.useRef(null);
|
|
4919
4874
|
React66__namespace.useEffect(() => {
|
|
4920
|
-
if (modifiers.focused)
|
|
4921
|
-
ref.current?.focus();
|
|
4875
|
+
if (modifiers.focused) ref.current?.focus();
|
|
4922
4876
|
}, [modifiers.focused]);
|
|
4923
4877
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4924
4878
|
Button,
|
|
@@ -5938,5 +5892,5 @@ exports.useBlinkUI = useBlinkUI;
|
|
|
5938
5892
|
exports.useCommandBar = useCommandBar;
|
|
5939
5893
|
exports.useFormField = useFormField;
|
|
5940
5894
|
exports.useTour = useTour;
|
|
5941
|
-
//# sourceMappingURL=
|
|
5895
|
+
//# sourceMappingURL=index.js.map
|
|
5942
5896
|
//# sourceMappingURL=index.js.map
|