najm-kit 0.0.14 → 0.0.16
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 +4 -4
- package/dist/index.mjs +135 -136
- package/dist/json.mjs +0 -4
- package/dist/theme.css +909 -0
- package/package.json +8 -9
- package/dist/styles.css +0 -5078
- /package/dist/{styles.css.d.ts → theme.css.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -173,7 +173,7 @@ type NIconProps = Omit<React__default.HTMLAttributes<HTMLElement>, "children"> &
|
|
|
173
173
|
declare const NIcon: React__default.FC<NIconProps>;
|
|
174
174
|
|
|
175
175
|
declare const buttonVariants: (props?: {
|
|
176
|
-
variant?: "subtle" | "default" | "secondary" | "tertiary" | "destructive" | "
|
|
176
|
+
variant?: "subtle" | "default" | "secondary" | "tertiary" | "destructive" | "link" | "outline" | "ghost" | "success" | "warning" | "info" | "soft" | "plain";
|
|
177
177
|
size?: "default" | "icon" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-xl";
|
|
178
178
|
rounded?: "none" | "default" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
179
179
|
fullWidth?: boolean;
|
|
@@ -741,7 +741,7 @@ type AvatarShape$1 = "circle" | "rounded" | "square";
|
|
|
741
741
|
type AvatarStatusType = "online" | "offline" | "busy" | "away";
|
|
742
742
|
declare const avatarVariants: (props?: {
|
|
743
743
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
744
|
-
shape?: "
|
|
744
|
+
shape?: "circle" | "square" | "rounded";
|
|
745
745
|
ring?: boolean;
|
|
746
746
|
} & class_variance_authority_types.ClassProp) => string;
|
|
747
747
|
type AvatarRingColor = "background" | "primary" | "secondary" | "muted" | "destructive";
|
|
@@ -756,7 +756,7 @@ interface AvatarProps$1 extends Omit<React$1.ComponentProps<typeof AvatarPrimiti
|
|
|
756
756
|
}
|
|
757
757
|
declare function Avatar({ className, size, shape, ring, ringColor, src, alt, fallback, status, imageClassName, fallbackClassName, children, ...props }: AvatarProps$1): react_jsx_runtime.JSX.Element;
|
|
758
758
|
declare function AvatarImage({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Image>): react_jsx_runtime.JSX.Element;
|
|
759
|
-
declare function AvatarFallback({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Fallback>): react_jsx_runtime.JSX.Element;
|
|
759
|
+
declare function AvatarFallback({ className, delayMs: _delayMs, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Fallback>): react_jsx_runtime.JSX.Element;
|
|
760
760
|
declare function AvatarStatus({ status, size, className, }: {
|
|
761
761
|
status: AvatarStatusType;
|
|
762
762
|
size?: AvatarSize;
|
|
@@ -2310,7 +2310,7 @@ declare const createTableStore: () => {
|
|
|
2310
2310
|
declare const HEADER_COLORS: {
|
|
2311
2311
|
readonly primary: {
|
|
2312
2312
|
readonly bg: "bg-primary/15";
|
|
2313
|
-
readonly text: "[&_th]:text-
|
|
2313
|
+
readonly text: "[&_th]:text-foreground";
|
|
2314
2314
|
readonly row: "hover:bg-primary/5";
|
|
2315
2315
|
};
|
|
2316
2316
|
readonly violet: {
|
package/dist/index.mjs
CHANGED
|
@@ -39,100 +39,106 @@ import { getExpandedRowModel, getSortedRowModel, getPaginationRowModel, getFilte
|
|
|
39
39
|
|
|
40
40
|
// src/theme/presets/modes.ts
|
|
41
41
|
var lightMode = {
|
|
42
|
-
background: "0 0
|
|
43
|
-
foreground: "0 0
|
|
44
|
-
card: "0 0
|
|
45
|
-
"card-foreground": "0 0
|
|
46
|
-
popover: "0 0
|
|
47
|
-
"popover-foreground": "0 0
|
|
48
|
-
secondary: "0 0
|
|
49
|
-
"secondary-foreground": "0 0
|
|
50
|
-
muted: "0 0
|
|
51
|
-
"muted-foreground": "0 0
|
|
52
|
-
accent: "0 0
|
|
53
|
-
"accent-foreground": "0 0
|
|
54
|
-
destructive: "0
|
|
55
|
-
"destructive-foreground": "0 0
|
|
56
|
-
border: "0 0
|
|
57
|
-
"border-subtle": "0 0
|
|
58
|
-
"border-strong": "0 0
|
|
59
|
-
input: "0 0
|
|
42
|
+
background: "oklch(1 0 0)",
|
|
43
|
+
foreground: "oklch(0.1445 0 0)",
|
|
44
|
+
card: "oklch(1 0 0)",
|
|
45
|
+
"card-foreground": "oklch(0.1445 0 0)",
|
|
46
|
+
popover: "oklch(1 0 0)",
|
|
47
|
+
"popover-foreground": "oklch(0.1445 0 0)",
|
|
48
|
+
secondary: "oklch(0.9703 0 0)",
|
|
49
|
+
"secondary-foreground": "oklch(0.2044 0 0)",
|
|
50
|
+
muted: "oklch(0.9703 0 0)",
|
|
51
|
+
"muted-foreground": "oklch(0.5555 0 0)",
|
|
52
|
+
accent: "oklch(0.9703 0 0)",
|
|
53
|
+
"accent-foreground": "oklch(0.2044 0 0)",
|
|
54
|
+
destructive: "oklch(0.6368 0.2078 25.326)",
|
|
55
|
+
"destructive-foreground": "oklch(0.9848 0 0)",
|
|
56
|
+
border: "oklch(0.9219 0 0)",
|
|
57
|
+
"border-subtle": "oklch(0.9619 0 0)",
|
|
58
|
+
"border-strong": "oklch(0.4184 0 0)",
|
|
59
|
+
input: "oklch(0.9219 0 0)",
|
|
60
60
|
radius: "0.5rem"
|
|
61
61
|
};
|
|
62
62
|
var darkMode = {
|
|
63
|
-
background: "
|
|
64
|
-
foreground: "
|
|
65
|
-
card: "
|
|
66
|
-
"card-foreground": "
|
|
67
|
-
popover: "
|
|
68
|
-
"popover-foreground": "
|
|
69
|
-
secondary: "
|
|
70
|
-
"secondary-foreground": "
|
|
71
|
-
muted: "
|
|
72
|
-
"muted-foreground": "
|
|
73
|
-
accent: "
|
|
74
|
-
"accent-foreground": "
|
|
75
|
-
destructive: "0
|
|
76
|
-
"destructive-foreground": "0 0
|
|
77
|
-
border: "
|
|
78
|
-
"border-subtle": "
|
|
79
|
-
"border-strong": "0 0
|
|
80
|
-
input: "
|
|
63
|
+
background: "oklch(0.1417 0.0044 285.819)",
|
|
64
|
+
foreground: "oklch(0.9683 0.0014 286.375)",
|
|
65
|
+
card: "oklch(0.1872 0.0066 285.748)",
|
|
66
|
+
"card-foreground": "oklch(0.9683 0.0014 286.375)",
|
|
67
|
+
popover: "oklch(0.1872 0.0066 285.748)",
|
|
68
|
+
"popover-foreground": "oklch(0.9683 0.0014 286.375)",
|
|
69
|
+
secondary: "oklch(0.2313 0.007 285.839)",
|
|
70
|
+
"secondary-foreground": "oklch(0.9203 0.0034 286.332)",
|
|
71
|
+
muted: "oklch(0.2313 0.007 285.839)",
|
|
72
|
+
"muted-foreground": "oklch(0.6255 0.0171 285.896)",
|
|
73
|
+
accent: "oklch(0.2313 0.007 285.839)",
|
|
74
|
+
"accent-foreground": "oklch(0.9683 0.0014 286.375)",
|
|
75
|
+
destructive: "oklch(0.6356 0.2082 25.378)",
|
|
76
|
+
"destructive-foreground": "oklch(1 0 0)",
|
|
77
|
+
border: "oklch(0.262 0.0085 285.799)",
|
|
78
|
+
"border-subtle": "oklch(0.2208 0.0065 285.856)",
|
|
79
|
+
"border-strong": "oklch(0.8294 0 0)",
|
|
80
|
+
input: "oklch(0.262 0.0085 285.799)",
|
|
81
81
|
radius: "0.5rem"
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
// src/theme/presets/accents.ts
|
|
85
85
|
var accents = {
|
|
86
86
|
neutral: {
|
|
87
|
-
primary: "
|
|
88
|
-
"primary-foreground": "0 0
|
|
89
|
-
ring: "
|
|
90
|
-
accent: "
|
|
91
|
-
"accent-foreground": "0 0
|
|
87
|
+
primary: "oklch(0.2228 0.0043 286.044)",
|
|
88
|
+
"primary-foreground": "oklch(0.9848 0 0)",
|
|
89
|
+
ring: "oklch(0.2228 0.0043 286.044)",
|
|
90
|
+
accent: "oklch(0.2747 0.006 286.001)",
|
|
91
|
+
"accent-foreground": "oklch(0.9848 0 0)"
|
|
92
92
|
},
|
|
93
93
|
emerald: {
|
|
94
|
-
primary: "
|
|
95
|
-
"primary-foreground": "0 0
|
|
96
|
-
ring: "
|
|
97
|
-
accent: "
|
|
98
|
-
"accent-foreground": "
|
|
94
|
+
primary: "oklch(0.6902 0.1481 162.368)",
|
|
95
|
+
"primary-foreground": "oklch(1 0 0)",
|
|
96
|
+
ring: "oklch(0.6902 0.1481 162.368)",
|
|
97
|
+
accent: "oklch(0.3519 0.0714 164.26)",
|
|
98
|
+
"accent-foreground": "oklch(0.9131 0.0924 171.145)"
|
|
99
99
|
},
|
|
100
100
|
green: {
|
|
101
|
-
primary: "
|
|
102
|
-
"primary-foreground": "0 0
|
|
103
|
-
ring: "
|
|
104
|
-
accent: "
|
|
105
|
-
"accent-foreground": "
|
|
101
|
+
primary: "oklch(0.7205 0.192 149.493)",
|
|
102
|
+
"primary-foreground": "oklch(1 0 0)",
|
|
103
|
+
ring: "oklch(0.7205 0.192 149.493)",
|
|
104
|
+
accent: "oklch(0.333 0.0811 150.922)",
|
|
105
|
+
"accent-foreground": "oklch(0.8958 0.096 156.121)"
|
|
106
106
|
},
|
|
107
107
|
slate: {
|
|
108
|
-
primary: "
|
|
109
|
-
"primary-foreground": "0 0
|
|
110
|
-
ring: "
|
|
111
|
-
accent: "
|
|
112
|
-
"accent-foreground": "
|
|
108
|
+
primary: "oklch(0.6227 0.0463 256.82)",
|
|
109
|
+
"primary-foreground": "oklch(1 0 0)",
|
|
110
|
+
ring: "oklch(0.6227 0.0463 256.82)",
|
|
111
|
+
accent: "oklch(0.3115 0.0245 256.824)",
|
|
112
|
+
"accent-foreground": "oklch(0.8784 0.0141 256.711)"
|
|
113
113
|
},
|
|
114
114
|
blue: {
|
|
115
|
-
primary: "
|
|
116
|
-
"primary-foreground": "0 0
|
|
117
|
-
ring: "
|
|
118
|
-
accent: "
|
|
119
|
-
"accent-foreground": "
|
|
115
|
+
primary: "oklch(0.6261 0.1859 259.596)",
|
|
116
|
+
"primary-foreground": "oklch(1 0 0)",
|
|
117
|
+
ring: "oklch(0.6261 0.1859 259.596)",
|
|
118
|
+
accent: "oklch(0.2941 0.1092 259.917)",
|
|
119
|
+
"accent-foreground": "oklch(0.8064 0.0902 259.76)"
|
|
120
120
|
},
|
|
121
121
|
violet: {
|
|
122
|
-
primary: "
|
|
123
|
-
"primary-foreground": "0 0
|
|
124
|
-
ring: "
|
|
125
|
-
accent: "
|
|
126
|
-
"accent-foreground": "
|
|
122
|
+
primary: "oklch(0.4865 0.2423 291.866)",
|
|
123
|
+
"primary-foreground": "oklch(1 0 0)",
|
|
124
|
+
ring: "oklch(0.6016 0.2214 292.234)",
|
|
125
|
+
accent: "oklch(0.2467 0.109 294.41)",
|
|
126
|
+
"accent-foreground": "oklch(0.7817 0.1036 301.636)"
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
// src/theme/presets/compose.ts
|
|
131
131
|
function lightAccentFromPrimary(primary = "") {
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
const
|
|
135
|
-
|
|
132
|
+
const m = primary.trim().match(/^oklch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*\)$/i);
|
|
133
|
+
if (!m) return { accent: "oklch(0.95 0 0)", "accent-foreground": "oklch(0.42 0 0)" };
|
|
134
|
+
const c = Number(m[2]);
|
|
135
|
+
const h = Number(m[3]);
|
|
136
|
+
const tint = Math.min(c, 0.05);
|
|
137
|
+
const fg = Math.min(c, 0.12);
|
|
138
|
+
return {
|
|
139
|
+
accent: `oklch(0.95 ${tint} ${h})`,
|
|
140
|
+
"accent-foreground": `oklch(0.42 ${fg} ${h})`
|
|
141
|
+
};
|
|
136
142
|
}
|
|
137
143
|
function composePreset(mode, accent) {
|
|
138
144
|
const base = mode === "dark" ? darkMode : lightMode;
|
|
@@ -161,7 +167,7 @@ function tokensToStyle(tokens, accentOnly) {
|
|
|
161
167
|
const style = {};
|
|
162
168
|
for (const [key, value] of Object.entries(tokens)) {
|
|
163
169
|
if (value && (!accentOnly || ACCENT_KEYS.has(key))) {
|
|
164
|
-
style[
|
|
170
|
+
style[`--${key}`] = value;
|
|
165
171
|
}
|
|
166
172
|
}
|
|
167
173
|
return style;
|
|
@@ -187,30 +193,24 @@ function NajmThemeProvider({
|
|
|
187
193
|
children
|
|
188
194
|
}) {
|
|
189
195
|
const depth = React.useContext(NajmThemeDepthContext);
|
|
190
|
-
const isRoot = depth === 0;
|
|
191
196
|
const parentAppearance = React.useContext(NajmAppearanceContext);
|
|
192
|
-
const shouldApplyThemeTokens =
|
|
197
|
+
const shouldApplyThemeTokens = Boolean(preset || mode || tokens);
|
|
193
198
|
const resolved = React.useMemo(() => {
|
|
194
199
|
if (!shouldApplyThemeTokens) return null;
|
|
195
200
|
if (tokens) return tokens;
|
|
196
201
|
if (preset) return resolvePreset(preset);
|
|
197
|
-
|
|
198
|
-
return resolvePreset("light");
|
|
202
|
+
return composePreset(mode, accent ?? "neutral");
|
|
199
203
|
}, [preset, mode, accent, tokens, shouldApplyThemeTokens]);
|
|
200
|
-
const style = React.useMemo(
|
|
204
|
+
const style = React.useMemo(
|
|
205
|
+
() => resolved ? tokensToStyle(resolved, accentOnly) : void 0,
|
|
206
|
+
[resolved, accentOnly]
|
|
207
|
+
);
|
|
201
208
|
const Comp = asChild ? Slot : "div";
|
|
202
209
|
const [container, setContainer] = React.useState(null);
|
|
203
210
|
const resolvedAppearance = React.useMemo(
|
|
204
211
|
() => ({ ...parentAppearance, ...appearance ?? {} }),
|
|
205
212
|
[parentAppearance, appearance]
|
|
206
213
|
);
|
|
207
|
-
React.useEffect(() => {
|
|
208
|
-
if (!isRoot) return;
|
|
209
|
-
const root = document.documentElement;
|
|
210
|
-
const entries = Object.entries(style ?? {});
|
|
211
|
-
entries.forEach(([k, v]) => root.style.setProperty(k, v));
|
|
212
|
-
return () => entries.forEach(([k]) => root.style.removeProperty(k));
|
|
213
|
-
}, [style, isRoot]);
|
|
214
214
|
return /* @__PURE__ */ jsx(NajmThemeDepthContext.Provider, { value: depth + 1, children: /* @__PURE__ */ jsx(NajmAppearanceContext.Provider, { value: resolvedAppearance, children: /* @__PURE__ */ jsx(NajmThemeContainerCtx.Provider, { value: container, children: /* @__PURE__ */ jsx(
|
|
215
215
|
Comp,
|
|
216
216
|
{
|
|
@@ -1105,7 +1105,8 @@ function SheetClose({ ...props }) {
|
|
|
1105
1105
|
return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
|
|
1106
1106
|
}
|
|
1107
1107
|
function SheetPortal({ ...props }) {
|
|
1108
|
-
|
|
1108
|
+
const container = React.useContext(NajmThemeContainerCtx);
|
|
1109
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", container: container ?? void 0, ...props });
|
|
1109
1110
|
}
|
|
1110
1111
|
function SheetOverlay({ className, ...props }) {
|
|
1111
1112
|
return /* @__PURE__ */ jsx(
|
|
@@ -1187,10 +1188,6 @@ function NajmScroll({ className, axis = "y", autoHide = "never", viewportRef, ev
|
|
|
1187
1188
|
className: cn(className),
|
|
1188
1189
|
style: {
|
|
1189
1190
|
...style,
|
|
1190
|
-
display: "flex",
|
|
1191
|
-
alignItems: "stretch",
|
|
1192
|
-
flexDirection: "row",
|
|
1193
|
-
flexWrap: "nowrap",
|
|
1194
1191
|
overflow: "hidden",
|
|
1195
1192
|
minHeight: 0,
|
|
1196
1193
|
minWidth: 0
|
|
@@ -1257,14 +1254,14 @@ function NSheet({
|
|
|
1257
1254
|
side,
|
|
1258
1255
|
portalClassName: portal,
|
|
1259
1256
|
className: cn(
|
|
1260
|
-
"flex h-dvh max-h-dvh flex-col overflow-hidden bg-sidebar p-0 text-
|
|
1257
|
+
"flex h-dvh max-h-dvh flex-col overflow-hidden bg-sidebar p-0 text-foreground",
|
|
1261
1258
|
contentClassName
|
|
1262
1259
|
),
|
|
1263
1260
|
style,
|
|
1264
1261
|
children: [
|
|
1265
1262
|
/* @__PURE__ */ jsxs(SheetHeader, { className: "shrink-0 border-b border-border px-6 py-4 gap-1", children: [
|
|
1266
|
-
/* @__PURE__ */ jsx(SheetTitle, { className: "text-sm font-semibold text-
|
|
1267
|
-
description && /* @__PURE__ */ jsx(SheetDescription, { className: "text-xs text-
|
|
1263
|
+
/* @__PURE__ */ jsx(SheetTitle, { className: "text-sm font-semibold text-foreground", children: title }),
|
|
1264
|
+
description && /* @__PURE__ */ jsx(SheetDescription, { className: "text-xs text-muted-foreground", children: description })
|
|
1268
1265
|
] }),
|
|
1269
1266
|
/* @__PURE__ */ jsx(NajmScroll, { axis: "y", className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx("div", { className: cn("px-6 py-5", bodyClassName), children }) }),
|
|
1270
1267
|
footer && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-t border-border px-6 py-3", children: footer })
|
|
@@ -1279,7 +1276,8 @@ function DialogTrigger({ ...props }) {
|
|
|
1279
1276
|
return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
1280
1277
|
}
|
|
1281
1278
|
function DialogPortal({ ...props }) {
|
|
1282
|
-
|
|
1279
|
+
const container = React.useContext(NajmThemeContainerCtx);
|
|
1280
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "dialog-portal", container: container ?? void 0, ...props });
|
|
1283
1281
|
}
|
|
1284
1282
|
function DialogClose({ ...props }) {
|
|
1285
1283
|
return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "dialog-close cursor-pointer", ...props });
|
|
@@ -2148,7 +2146,7 @@ function useNajmPortalLayerStyles() {
|
|
|
2148
2146
|
if (document.getElementById(PORTAL_LAYER_STYLE_ID)) return;
|
|
2149
2147
|
const style = document.createElement("style");
|
|
2150
2148
|
style.id = PORTAL_LAYER_STYLE_ID;
|
|
2151
|
-
style.textContent = `[data-radix-popper-content-wrapper]{z-index:var(--
|
|
2149
|
+
style.textContent = `[data-radix-popper-content-wrapper]{z-index:var(--portal-z-index,10000)!important;}`;
|
|
2152
2150
|
document.head.appendChild(style);
|
|
2153
2151
|
}, []);
|
|
2154
2152
|
}
|
|
@@ -2406,7 +2404,7 @@ function Checkbox({ className, ...props }) {
|
|
|
2406
2404
|
{
|
|
2407
2405
|
"data-slot": "checkbox",
|
|
2408
2406
|
className: cn(
|
|
2409
|
-
"peer border-
|
|
2407
|
+
"peer border-foreground/40 dark:border-foreground/50 dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
2410
2408
|
className
|
|
2411
2409
|
),
|
|
2412
2410
|
...props,
|
|
@@ -2991,7 +2989,7 @@ function Avatar({
|
|
|
2991
2989
|
children: [
|
|
2992
2990
|
hasChildren ? children : hasShortcut ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2993
2991
|
src && /* @__PURE__ */ jsx(
|
|
2994
|
-
|
|
2992
|
+
"img",
|
|
2995
2993
|
{
|
|
2996
2994
|
"data-slot": "avatar-image",
|
|
2997
2995
|
src,
|
|
@@ -3000,7 +2998,7 @@ function Avatar({
|
|
|
3000
2998
|
}
|
|
3001
2999
|
),
|
|
3002
3000
|
/* @__PURE__ */ jsx(
|
|
3003
|
-
|
|
3001
|
+
"span",
|
|
3004
3002
|
{
|
|
3005
3003
|
"data-slot": "avatar-fallback",
|
|
3006
3004
|
className: cn(fallbackVariants({ size, shape }), fallbackClassName),
|
|
@@ -3025,7 +3023,7 @@ function Avatar({
|
|
|
3025
3023
|
}
|
|
3026
3024
|
function AvatarImage({ className, ...props }) {
|
|
3027
3025
|
return /* @__PURE__ */ jsx(
|
|
3028
|
-
|
|
3026
|
+
"img",
|
|
3029
3027
|
{
|
|
3030
3028
|
"data-slot": "avatar-image",
|
|
3031
3029
|
className: cn("aspect-square size-full", className),
|
|
@@ -3035,10 +3033,11 @@ function AvatarImage({ className, ...props }) {
|
|
|
3035
3033
|
}
|
|
3036
3034
|
function AvatarFallback({
|
|
3037
3035
|
className,
|
|
3036
|
+
delayMs: _delayMs,
|
|
3038
3037
|
...props
|
|
3039
3038
|
}) {
|
|
3040
3039
|
return /* @__PURE__ */ jsx(
|
|
3041
|
-
|
|
3040
|
+
"span",
|
|
3042
3041
|
{
|
|
3043
3042
|
"data-slot": "avatar-fallback",
|
|
3044
3043
|
className: cn("flex size-full items-center justify-center rounded-full bg-muted", className),
|
|
@@ -3576,7 +3575,7 @@ function TableHead({ className, ...props }) {
|
|
|
3576
3575
|
return /* @__PURE__ */ jsx("th", { "data-slot": "table-head", className: cn("text-foreground h-9 px-3 text-left align-middle text-xs font-medium uppercase tracking-wide whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className), ...props });
|
|
3577
3576
|
}
|
|
3578
3577
|
function TableCell({ className, ...props }) {
|
|
3579
|
-
return /* @__PURE__ */ jsx("td", { "data-slot": "table-cell", className: cn("
|
|
3578
|
+
return /* @__PURE__ */ jsx("td", { "data-slot": "table-cell", className: cn("px-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className), ...props });
|
|
3580
3579
|
}
|
|
3581
3580
|
function TableCaption({ className, ...props }) {
|
|
3582
3581
|
return /* @__PURE__ */ jsx("caption", { "data-slot": "table-caption", className: cn("text-muted-foreground mt-4 text-sm", className), ...props });
|
|
@@ -3707,7 +3706,7 @@ var NErrorBoundary = class extends React__default.Component {
|
|
|
3707
3706
|
render() {
|
|
3708
3707
|
if (this.state.hasError) {
|
|
3709
3708
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center h-full p-8 text-center", children: [
|
|
3710
|
-
/* @__PURE__ */ jsx("div", { className: "h-12 w-12 rounded-xl bg-
|
|
3709
|
+
/* @__PURE__ */ jsx("div", { className: "h-12 w-12 rounded-xl bg-destructive/10 flex items-center justify-center mb-4", children: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-6 w-6 text-destructive" }) }),
|
|
3711
3710
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-foreground mb-1", children: this.props.fallbackTitle ?? "Something went wrong" }),
|
|
3712
3711
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-md", children: this.state.error?.message ?? "An unexpected error occurred." }),
|
|
3713
3712
|
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: this.handleReset, className: "gap-1.5", children: [
|
|
@@ -4858,7 +4857,7 @@ function FloatingButtonSegment({
|
|
|
4858
4857
|
className: cn(
|
|
4859
4858
|
"flex items-center gap-2 px-4 h-11 text-sm transition-colors",
|
|
4860
4859
|
"hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4861
|
-
action.danger && "text-
|
|
4860
|
+
action.danger && "text-destructive hover:bg-destructive/10"
|
|
4862
4861
|
),
|
|
4863
4862
|
children: [
|
|
4864
4863
|
Icon2 ? /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4" }) : null,
|
|
@@ -5076,7 +5075,7 @@ function NFileTypeIcon({
|
|
|
5076
5075
|
const dim = DIMENSIONS[size];
|
|
5077
5076
|
const isDark = useIsDark();
|
|
5078
5077
|
if (showThumbnail && /^image\//.test(mimeType) && url) {
|
|
5079
|
-
return /* @__PURE__ */ jsx("span", { className: cn(dim, "block shrink-0 overflow-hidden rounded-lg bg-
|
|
5078
|
+
return /* @__PURE__ */ jsx("span", { className: cn(dim, "block shrink-0 overflow-hidden rounded-lg bg-secondary shadow-sm", className), children: /* @__PURE__ */ jsx(
|
|
5080
5079
|
"img",
|
|
5081
5080
|
{
|
|
5082
5081
|
src: url,
|
|
@@ -6022,23 +6021,23 @@ function PhoneInput({
|
|
|
6022
6021
|
"--react-international-phone-height": "40px",
|
|
6023
6022
|
"--react-international-phone-border-radius": "0",
|
|
6024
6023
|
"--react-international-phone-background-color": "transparent",
|
|
6025
|
-
"--react-international-phone-text-color": "
|
|
6024
|
+
"--react-international-phone-text-color": "var(--foreground)",
|
|
6026
6025
|
"--react-international-phone-border-color": "transparent",
|
|
6027
6026
|
"--react-international-phone-country-selector-background-color": "transparent",
|
|
6028
|
-
"--react-international-phone-country-selector-background-color-hover": "
|
|
6029
|
-
"--react-international-phone-country-selector-arrow-color": "
|
|
6027
|
+
"--react-international-phone-country-selector-background-color-hover": "var(--accent)",
|
|
6028
|
+
"--react-international-phone-country-selector-arrow-color": "var(--muted-foreground)",
|
|
6030
6029
|
"--react-international-phone-disabled-background-color": "transparent",
|
|
6031
|
-
"--react-international-phone-disabled-text-color": "
|
|
6030
|
+
"--react-international-phone-disabled-text-color": "var(--muted-foreground)",
|
|
6032
6031
|
"--react-international-phone-dropdown-top": "calc(100% + 6px)",
|
|
6033
6032
|
"--react-international-phone-dropdown-left": "0",
|
|
6034
|
-
"--react-international-phone-dropdown-item-background-color": "
|
|
6035
|
-
"--react-international-phone-dropdown-item-text-color": "
|
|
6036
|
-
"--react-international-phone-dropdown-item-dial-code-color": "
|
|
6037
|
-
"--react-international-phone-selected-dropdown-item-background-color": "
|
|
6038
|
-
"--react-international-phone-selected-dropdown-item-text-color": "
|
|
6039
|
-
"--react-international-phone-selected-dropdown-item-dial-code-color": "
|
|
6040
|
-
"--react-international-phone-dropdown-preferred-list-divider-color": "
|
|
6041
|
-
"--react-international-phone-dropdown-shadow": "0 16px 40px
|
|
6033
|
+
"--react-international-phone-dropdown-item-background-color": "var(--popover)",
|
|
6034
|
+
"--react-international-phone-dropdown-item-text-color": "var(--popover-foreground)",
|
|
6035
|
+
"--react-international-phone-dropdown-item-dial-code-color": "var(--muted-foreground)",
|
|
6036
|
+
"--react-international-phone-selected-dropdown-item-background-color": "var(--accent)",
|
|
6037
|
+
"--react-international-phone-selected-dropdown-item-text-color": "var(--accent-foreground)",
|
|
6038
|
+
"--react-international-phone-selected-dropdown-item-dial-code-color": "var(--muted-foreground)",
|
|
6039
|
+
"--react-international-phone-dropdown-preferred-list-divider-color": "var(--border)",
|
|
6040
|
+
"--react-international-phone-dropdown-shadow": "0 16px 40px color-mix(in oklch, var(--background), transparent 55%)"
|
|
6042
6041
|
};
|
|
6043
6042
|
return /* @__PURE__ */ jsx(BaseInput, { variant, status, bordered, borderDegree, borderColor, className: cn("gap-0 overflow-visible p-0!", className), disabled, children: /* @__PURE__ */ jsx(
|
|
6044
6043
|
PhoneInput$1,
|
|
@@ -6057,7 +6056,7 @@ function PhoneInput({
|
|
|
6057
6056
|
background: "transparent",
|
|
6058
6057
|
outline: "none",
|
|
6059
6058
|
fontSize: "14px",
|
|
6060
|
-
color: "
|
|
6059
|
+
color: "var(--foreground)"
|
|
6061
6060
|
},
|
|
6062
6061
|
countrySelectorStyleProps: {
|
|
6063
6062
|
style: {
|
|
@@ -6090,8 +6089,8 @@ function PhoneInput({
|
|
|
6090
6089
|
style: {
|
|
6091
6090
|
zIndex: 60,
|
|
6092
6091
|
width: "min(300px, calc(100vw - 32px))",
|
|
6093
|
-
backgroundColor: "
|
|
6094
|
-
border: "1px solid
|
|
6092
|
+
backgroundColor: "var(--popover)",
|
|
6093
|
+
border: "1px solid var(--border)",
|
|
6095
6094
|
borderRadius: "8px",
|
|
6096
6095
|
overflowX: "hidden"
|
|
6097
6096
|
}
|
|
@@ -6513,7 +6512,7 @@ function Combobox({
|
|
|
6513
6512
|
children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
|
|
6514
6513
|
}
|
|
6515
6514
|
),
|
|
6516
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 text-
|
|
6515
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
6517
6516
|
] })
|
|
6518
6517
|
]
|
|
6519
6518
|
}
|
|
@@ -6564,10 +6563,10 @@ var VARIANT_PRESETS = {
|
|
|
6564
6563
|
},
|
|
6565
6564
|
studio: {
|
|
6566
6565
|
item: "space-y-1.5 w-full",
|
|
6567
|
-
label: "text-[11px] uppercase tracking-[0.16em] text-
|
|
6566
|
+
label: "text-[11px] uppercase tracking-[0.16em] text-muted-foreground flex items-center gap-2",
|
|
6568
6567
|
input: "h-10 bg-card",
|
|
6569
|
-
description: "text-xs text-
|
|
6570
|
-
error: "text-xs text-
|
|
6568
|
+
description: "text-xs text-muted-foreground",
|
|
6569
|
+
error: "text-xs text-destructive"
|
|
6571
6570
|
},
|
|
6572
6571
|
compact: {
|
|
6573
6572
|
item: "flex flex-col w-full gap-1",
|
|
@@ -7678,7 +7677,7 @@ function useTableKeyboard(options = {}) {
|
|
|
7678
7677
|
|
|
7679
7678
|
// src/components/table/tableColors.ts
|
|
7680
7679
|
var HEADER_COLORS = {
|
|
7681
|
-
primary: { bg: "bg-primary/15", text: "[&_th]:text-
|
|
7680
|
+
primary: { bg: "bg-primary/15", text: "[&_th]:text-foreground", row: "hover:bg-primary/5" },
|
|
7682
7681
|
violet: { bg: "bg-violet-600/30", text: "[&_th]:text-violet-800 dark:[&_th]:text-violet-300", row: "hover:bg-violet-500/5" },
|
|
7683
7682
|
blue: { bg: "bg-blue-600/30", text: "[&_th]:text-blue-800 dark:[&_th]:text-blue-300", row: "hover:bg-blue-500/5" },
|
|
7684
7683
|
emerald: { bg: "bg-emerald-600/30", text: "[&_th]:text-emerald-800 dark:[&_th]:text-emerald-400", row: "hover:bg-emerald-500/5" },
|
|
@@ -7811,8 +7810,8 @@ function NTableContent({ effectiveMode }) {
|
|
|
7811
7810
|
),
|
|
7812
7811
|
onContextMenu: handleBackgroundContextMenu,
|
|
7813
7812
|
children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
7814
|
-
/* @__PURE__ */ jsx(TableHeader, { "data-ntable-table-header": true, className: cn("bg-card sticky top-0 z-10", colorStyle?.text, headerClassName,
|
|
7815
|
-
showCheckbox && /* @__PURE__ */ jsx(TableHead, { className: cn("w-10 text-foreground h-12", colorStyle?.bg), children: /* @__PURE__ */ jsx(
|
|
7813
|
+
/* @__PURE__ */ jsx(TableHeader, { "data-ntable-table-header": true, className: cn("bg-card sticky top-0 z-10", colorStyle?.text, headerClassName, useDegreeBorder && "[&_tr]:border-border", classNames?.tableHeader), children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsxs(TableRow, { className: cn("hover:bg-transparent", useDegreeBorder && "border-border"), children: [
|
|
7814
|
+
showCheckbox && /* @__PURE__ */ jsx(TableHead, { className: cn("w-10 text-foreground h-12 text-center", colorStyle?.bg), children: /* @__PURE__ */ jsx(
|
|
7816
7815
|
Checkbox,
|
|
7817
7816
|
{
|
|
7818
7817
|
"aria-label": "Select all rows",
|
|
@@ -7844,9 +7843,9 @@ function NTableContent({ effectiveMode }) {
|
|
|
7844
7843
|
e.nativeEvent[ROW_CONTEXT_HANDLED] = true;
|
|
7845
7844
|
onRowContextMenu(e, row.original);
|
|
7846
7845
|
} : void 0,
|
|
7847
|
-
className: cn(colorStyle?.row, classNames?.row, onRowClick && "cursor-pointer", isSelectedByRowId && "bg-
|
|
7846
|
+
className: cn(colorStyle?.row, classNames?.row, onRowClick && "cursor-pointer", isSelectedByRowId && "bg-primary/5 hover:bg-primary/5", useDegreeBorder && "border-border"),
|
|
7848
7847
|
children: [
|
|
7849
|
-
showCheckbox && /* @__PURE__ */ jsx(TableCell, { className: "h-14 w-10", children: /* @__PURE__ */ jsx(
|
|
7848
|
+
showCheckbox && /* @__PURE__ */ jsx(TableCell, { className: "h-14 w-10 text-center", children: /* @__PURE__ */ jsx(
|
|
7850
7849
|
Checkbox,
|
|
7851
7850
|
{
|
|
7852
7851
|
"aria-label": `Select row ${row.id}`,
|
|
@@ -7867,7 +7866,7 @@ function NTableContent({ effectiveMode }) {
|
|
|
7867
7866
|
},
|
|
7868
7867
|
className: cn(
|
|
7869
7868
|
"flex h-6 w-6 items-center justify-center rounded hover:bg-muted",
|
|
7870
|
-
|
|
7869
|
+
useDegreeBorder && `border ${tableBorderClass}`
|
|
7871
7870
|
),
|
|
7872
7871
|
children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
7873
7872
|
}
|
|
@@ -8885,7 +8884,7 @@ function buildDefaultFileColumns(options = {}) {
|
|
|
8885
8884
|
const node = row.original;
|
|
8886
8885
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8887
8886
|
renderThumb({ node, size: "sm" }),
|
|
8888
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-
|
|
8887
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: node.name })
|
|
8889
8888
|
] });
|
|
8890
8889
|
}
|
|
8891
8890
|
}
|
|
@@ -8906,7 +8905,7 @@ function buildDefaultFileColumns(options = {}) {
|
|
|
8906
8905
|
header: "Size",
|
|
8907
8906
|
cell: ({ row }) => {
|
|
8908
8907
|
const node = row.original;
|
|
8909
|
-
return /* @__PURE__ */ jsx("span", { className: "block text-right text-
|
|
8908
|
+
return /* @__PURE__ */ jsx("span", { className: "block text-right text-muted-foreground", children: node.isFolder ? "-" : formatFileBytes(node.size ?? 0) });
|
|
8910
8909
|
}
|
|
8911
8910
|
});
|
|
8912
8911
|
}
|
|
@@ -8916,7 +8915,7 @@ function buildDefaultFileColumns(options = {}) {
|
|
|
8916
8915
|
header: "Modified",
|
|
8917
8916
|
cell: ({ row }) => {
|
|
8918
8917
|
const node = row.original;
|
|
8919
|
-
return /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-
|
|
8918
|
+
return /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
8920
8919
|
/* @__PURE__ */ jsx(Clock, { size: 12 }),
|
|
8921
8920
|
node.isFolder || !node.updatedAt ? "-" : formatFileRelative(node.updatedAt)
|
|
8922
8921
|
] });
|
|
@@ -8939,8 +8938,8 @@ function DefaultFileTile({
|
|
|
8939
8938
|
card: { onClick, onContextMenu },
|
|
8940
8939
|
className: cn(
|
|
8941
8940
|
"group relative flex w-36 cursor-pointer flex-col items-center justify-start gap-2 rounded-xl border border-transparent p-4 transition-colors",
|
|
8942
|
-
"hover:bg-
|
|
8943
|
-
isSel && "bg-
|
|
8941
|
+
"hover:bg-card hover:border-white/10",
|
|
8942
|
+
isSel && "bg-primary/10 border-primary/40"
|
|
8944
8943
|
),
|
|
8945
8944
|
children: [
|
|
8946
8945
|
/* @__PURE__ */ jsxs("div", { className: "relative flex h-20 w-20 items-end justify-center", children: [
|
|
@@ -8956,7 +8955,7 @@ function DefaultFileTile({
|
|
|
8956
8955
|
},
|
|
8957
8956
|
onClick: (e) => e.stopPropagation(),
|
|
8958
8957
|
className: cn(
|
|
8959
|
-
"absolute left-0 top-0 rounded border-white/20 bg-
|
|
8958
|
+
"absolute left-0 top-0 rounded border-white/20 bg-background transition-opacity",
|
|
8960
8959
|
isSel ? "opacity-100" : "opacity-0 group-hover:opacity-100"
|
|
8961
8960
|
),
|
|
8962
8961
|
"aria-label": `Select ${data.name}`
|
|
@@ -8964,8 +8963,8 @@ function DefaultFileTile({
|
|
|
8964
8963
|
)
|
|
8965
8964
|
] }),
|
|
8966
8965
|
/* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col items-center text-center", children: [
|
|
8967
|
-
/* @__PURE__ */ jsx("span", { className: "max-w-full truncate text-xs font-semibold text-
|
|
8968
|
-
/* @__PURE__ */ jsx("span", { className: "mt-0.5 text-[10px] text-
|
|
8966
|
+
/* @__PURE__ */ jsx("span", { className: "max-w-full truncate text-xs font-semibold text-foreground", children: data.name }),
|
|
8967
|
+
/* @__PURE__ */ jsx("span", { className: "mt-0.5 text-[10px] text-muted-foreground", children: data.isFolder ? "Folder" : formatFileBytes(data.size ?? 0) })
|
|
8969
8968
|
] })
|
|
8970
8969
|
]
|
|
8971
8970
|
}
|
|
@@ -9144,7 +9143,7 @@ function NSmartPasteDialog({
|
|
|
9144
9143
|
)
|
|
9145
9144
|
] }),
|
|
9146
9145
|
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-3 min-h-0", children: [
|
|
9147
|
-
description && /* @__PURE__ */ jsx("p", { className: "text-xs text-
|
|
9146
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground leading-relaxed", children: description }),
|
|
9148
9147
|
/* @__PURE__ */ jsx(
|
|
9149
9148
|
Textarea,
|
|
9150
9149
|
{
|
package/dist/json.mjs
CHANGED
|
@@ -900,10 +900,6 @@ function NajmScroll({ className, axis = "y", autoHide = "never", viewportRef, ev
|
|
|
900
900
|
className: cn(className),
|
|
901
901
|
style: {
|
|
902
902
|
...style,
|
|
903
|
-
display: "flex",
|
|
904
|
-
alignItems: "stretch",
|
|
905
|
-
flexDirection: "row",
|
|
906
|
-
flexWrap: "nowrap",
|
|
907
903
|
overflow: "hidden",
|
|
908
904
|
minHeight: 0,
|
|
909
905
|
minWidth: 0
|