@luxfi/ui 7.1.0 → 7.3.0
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/alert.cjs +22 -50
- package/dist/alert.js +22 -50
- package/dist/index.cjs +123 -179
- package/dist/index.js +123 -179
- package/dist/input.cjs +25 -36
- package/dist/input.js +25 -36
- package/dist/provider.cjs +35 -55
- package/dist/provider.js +16 -35
- package/dist/tag.cjs +15 -35
- package/dist/tag.js +15 -35
- package/dist/textarea.cjs +25 -36
- package/dist/textarea.js +25 -36
- package/package.json +6 -7
- package/src/alert.tsx +23 -51
- package/src/index.ts +1 -0
- package/src/input.tsx +27 -36
- package/src/provider.tsx +28 -6
- package/src/tag.tsx +17 -35
- package/src/textarea.tsx +27 -36
- package/dist/accordion.d.cts +0 -74
- package/dist/accordion.d.ts +0 -74
- package/dist/alert.d.cts +0 -30
- package/dist/alert.d.ts +0 -30
- package/dist/avatar.d.cts +0 -25
- package/dist/avatar.d.ts +0 -25
- package/dist/badge.d.cts +0 -19
- package/dist/badge.d.ts +0 -19
- package/dist/bank.d.cts +0 -76
- package/dist/bank.d.ts +0 -76
- package/dist/button.d.cts +0 -55
- package/dist/button.d.ts +0 -55
- package/dist/checkbox.d.cts +0 -31
- package/dist/checkbox.d.ts +0 -31
- package/dist/close-button.d.cts +0 -9
- package/dist/close-button.d.ts +0 -9
- package/dist/collapsible.d.cts +0 -23
- package/dist/collapsible.d.ts +0 -23
- package/dist/color-mode.d.cts +0 -25
- package/dist/color-mode.d.ts +0 -25
- package/dist/dialog.d.cts +0 -65
- package/dist/dialog.d.ts +0 -65
- package/dist/drawer.d.cts +0 -36
- package/dist/drawer.d.ts +0 -36
- package/dist/empty-state.d.cts +0 -13
- package/dist/empty-state.d.ts +0 -13
- package/dist/expiration-selector.d.cts +0 -16
- package/dist/expiration-selector.d.ts +0 -16
- package/dist/field.d.cts +0 -24
- package/dist/field.d.ts +0 -24
- package/dist/greeks-display.d.cts +0 -14
- package/dist/greeks-display.d.ts +0 -14
- package/dist/heading.d.cts +0 -10
- package/dist/heading.d.ts +0 -10
- package/dist/icon-button.d.cts +0 -33
- package/dist/icon-button.d.ts +0 -33
- package/dist/image.d.cts +0 -57
- package/dist/image.d.ts +0 -57
- package/dist/index.d.cts +0 -55
- package/dist/index.d.ts +0 -55
- package/dist/input-group.d.cts +0 -17
- package/dist/input-group.d.ts +0 -17
- package/dist/input.d.cts +0 -11
- package/dist/input.d.ts +0 -11
- package/dist/link.d.cts +0 -37
- package/dist/link.d.ts +0 -37
- package/dist/menu.d.cts +0 -84
- package/dist/menu.d.ts +0 -84
- package/dist/option-chain.d.cts +0 -37
- package/dist/option-chain.d.ts +0 -37
- package/dist/option-position.d.cts +0 -29
- package/dist/option-position.d.ts +0 -29
- package/dist/pin-input.d.cts +0 -25
- package/dist/pin-input.d.ts +0 -25
- package/dist/pnl-diagram.d.cts +0 -11
- package/dist/pnl-diagram.d.ts +0 -11
- package/dist/popover.d.cts +0 -73
- package/dist/popover.d.ts +0 -73
- package/dist/progress-circle.d.cts +0 -47
- package/dist/progress-circle.d.ts +0 -47
- package/dist/progress.d.cts +0 -28
- package/dist/progress.d.ts +0 -28
- package/dist/provider.d.cts +0 -7
- package/dist/provider.d.ts +0 -7
- package/dist/radio.d.cts +0 -53
- package/dist/radio.d.ts +0 -53
- package/dist/rating.d.cts +0 -14
- package/dist/rating.d.ts +0 -14
- package/dist/select.d.cts +0 -130
- package/dist/select.d.ts +0 -130
- package/dist/separator.d.cts +0 -13
- package/dist/separator.d.ts +0 -13
- package/dist/skeleton.d.cts +0 -60
- package/dist/skeleton.d.ts +0 -60
- package/dist/slider.d.cts +0 -24
- package/dist/slider.d.ts +0 -24
- package/dist/strategy-builder.d.cts +0 -26
- package/dist/strategy-builder.d.ts +0 -26
- package/dist/switch.d.cts +0 -27
- package/dist/switch.d.ts +0 -27
- package/dist/table.d.cts +0 -107
- package/dist/table.d.ts +0 -107
- package/dist/tabs.d.cts +0 -78
- package/dist/tabs.d.ts +0 -78
- package/dist/tag.d.cts +0 -21
- package/dist/tag.d.ts +0 -21
- package/dist/textarea.d.cts +0 -11
- package/dist/textarea.d.ts +0 -11
- package/dist/toaster.d.cts +0 -29
- package/dist/toaster.d.ts +0 -29
- package/dist/tooltip.d.cts +0 -38
- package/dist/tooltip.d.ts +0 -38
- package/dist/utils.d.cts +0 -5
- package/dist/utils.d.ts +0 -5
package/dist/input.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { clsx } from 'clsx';
|
|
5
4
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -9,46 +8,36 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
9
8
|
function cn(...inputs) {
|
|
10
9
|
return twMerge(clsx(inputs));
|
|
11
10
|
}
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
36
|
-
unstyled: "border-0 bg-transparent p-0 h-auto"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
defaultVariants: {
|
|
40
|
-
size: "md",
|
|
41
|
-
variant: "outline"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
11
|
+
var INPUT_BASE = [
|
|
12
|
+
"w-full appearance-none outline-none transition-colors",
|
|
13
|
+
"bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
|
|
14
|
+
"placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
|
|
15
|
+
"hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
|
|
16
|
+
"focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
|
|
17
|
+
"focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
|
|
18
|
+
"disabled:opacity-40 disabled:cursor-not-allowed",
|
|
19
|
+
"read-only:opacity-70",
|
|
20
|
+
"data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
|
|
21
|
+
].join(" ");
|
|
22
|
+
var INPUT_SIZE_CLASSES = {
|
|
23
|
+
xs: "h-6 px-2 text-xs rounded",
|
|
24
|
+
sm: "h-8 px-3 text-sm rounded-md",
|
|
25
|
+
md: "h-10 px-4 text-base rounded-md",
|
|
26
|
+
lg: "h-12 px-4 text-lg rounded-lg",
|
|
27
|
+
"2xl": "h-14 px-4 text-xl rounded-lg"
|
|
28
|
+
};
|
|
29
|
+
var INPUT_VARIANT_CLASSES = {
|
|
30
|
+
outline: "border border-solid",
|
|
31
|
+
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
32
|
+
unstyled: "border-0 bg-transparent p-0 h-auto"
|
|
33
|
+
};
|
|
45
34
|
var Input = React.forwardRef(
|
|
46
|
-
({ size, variant, className, ...rest }, ref) => {
|
|
35
|
+
({ size = "md", variant = "outline", className, ...rest }, ref) => {
|
|
47
36
|
return /* @__PURE__ */ jsx(
|
|
48
37
|
"input",
|
|
49
38
|
{
|
|
50
39
|
ref,
|
|
51
|
-
className: cn(
|
|
40
|
+
className: cn(INPUT_BASE, INPUT_SIZE_CLASSES[size], INPUT_VARIANT_CLASSES[variant], className),
|
|
52
41
|
...rest
|
|
53
42
|
}
|
|
54
43
|
);
|
package/dist/provider.cjs
CHANGED
|
@@ -1,62 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var core = require('@hanzogui/core');
|
|
5
|
+
var reactQuery = require('@tanstack/react-query');
|
|
5
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return e[k]; }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
n.default = e;
|
|
22
|
-
return Object.freeze(n);
|
|
8
|
+
var _guiInitialized = false;
|
|
9
|
+
function ensureGui() {
|
|
10
|
+
if (_guiInitialized) return;
|
|
11
|
+
core.createGui({ settings: { autocompleteSpecificTokens: "except-special" } });
|
|
12
|
+
_guiInitialized = true;
|
|
23
13
|
}
|
|
14
|
+
ensureGui();
|
|
15
|
+
var defaultQueryClient = new reactQuery.QueryClient({
|
|
16
|
+
defaultOptions: { queries: { refetchOnWindowFocus: false, retry: 1, staleTime: 3e4 } }
|
|
17
|
+
});
|
|
18
|
+
var AppProvider = ({ children, queryClient }) => {
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient ?? defaultQueryClient, children });
|
|
20
|
+
};
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
document.documentElement.classList.toggle("light", resolved === "light");
|
|
47
|
-
}
|
|
48
|
-
}, [onValueChange]);
|
|
49
|
-
const toggleColorMode = React__namespace.useCallback(() => {
|
|
50
|
-
setColorMode(colorMode === "dark" ? "light" : "dark");
|
|
51
|
-
}, [colorMode, setColorMode]);
|
|
52
|
-
const ctx = React__namespace.useMemo(
|
|
53
|
-
() => ({ colorMode, setColorMode, toggleColorMode }),
|
|
54
|
-
[colorMode, setColorMode, toggleColorMode]
|
|
55
|
-
);
|
|
56
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ColorModeContext.Provider, { value: ctx, children });
|
|
57
|
-
}
|
|
58
|
-
function Provider(props) {
|
|
59
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ColorModeProvider, { ...props });
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
exports.Provider = Provider;
|
|
22
|
+
Object.defineProperty(exports, "QueryClient", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return reactQuery.QueryClient; }
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "useInfiniteQuery", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return reactQuery.useInfiniteQuery; }
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "useMutation", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return reactQuery.useMutation; }
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "useQuery", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return reactQuery.useQuery; }
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "useQueryClient", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () { return reactQuery.useQueryClient; }
|
|
41
|
+
});
|
|
42
|
+
exports.AppProvider = AppProvider;
|
package/dist/provider.js
CHANGED
|
@@ -1,40 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { createGui } from '@hanzogui/core';
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
|
+
export { QueryClient, useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
3
5
|
import { jsx } from 'react/jsx-runtime';
|
|
4
6
|
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return controlledValue;
|
|
11
|
-
}
|
|
12
|
-
if (typeof document !== "undefined") {
|
|
13
|
-
if (document.documentElement.classList.contains("dark")) return "dark";
|
|
14
|
-
}
|
|
15
|
-
return defaultTheme === "dark" ? "dark" : "light";
|
|
16
|
-
});
|
|
17
|
-
const colorMode = controlledValue === "dark" || controlledValue === "light" ? controlledValue : internalMode;
|
|
18
|
-
const setColorMode = React.useCallback((mode) => {
|
|
19
|
-
const resolved = mode === "dark" ? "dark" : "light";
|
|
20
|
-
setInternalMode(resolved);
|
|
21
|
-
onValueChange?.(resolved);
|
|
22
|
-
if (typeof document !== "undefined") {
|
|
23
|
-
document.documentElement.classList.toggle("dark", resolved === "dark");
|
|
24
|
-
document.documentElement.classList.toggle("light", resolved === "light");
|
|
25
|
-
}
|
|
26
|
-
}, [onValueChange]);
|
|
27
|
-
const toggleColorMode = React.useCallback(() => {
|
|
28
|
-
setColorMode(colorMode === "dark" ? "light" : "dark");
|
|
29
|
-
}, [colorMode, setColorMode]);
|
|
30
|
-
const ctx = React.useMemo(
|
|
31
|
-
() => ({ colorMode, setColorMode, toggleColorMode }),
|
|
32
|
-
[colorMode, setColorMode, toggleColorMode]
|
|
33
|
-
);
|
|
34
|
-
return /* @__PURE__ */ jsx(ColorModeContext.Provider, { value: ctx, children });
|
|
35
|
-
}
|
|
36
|
-
function Provider(props) {
|
|
37
|
-
return /* @__PURE__ */ jsx(ColorModeProvider, { ...props });
|
|
7
|
+
var _guiInitialized = false;
|
|
8
|
+
function ensureGui() {
|
|
9
|
+
if (_guiInitialized) return;
|
|
10
|
+
createGui({ settings: { autocompleteSpecificTokens: "except-special" } });
|
|
11
|
+
_guiInitialized = true;
|
|
38
12
|
}
|
|
13
|
+
ensureGui();
|
|
14
|
+
var defaultQueryClient = new QueryClient({
|
|
15
|
+
defaultOptions: { queries: { refetchOnWindowFocus: false, retry: 1, staleTime: 3e4 } }
|
|
16
|
+
});
|
|
17
|
+
var AppProvider = ({ children, queryClient }) => {
|
|
18
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient ?? defaultQueryClient, children });
|
|
19
|
+
};
|
|
39
20
|
|
|
40
|
-
export {
|
|
21
|
+
export { AppProvider };
|
package/dist/tag.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
5
4
|
var React3 = require('react');
|
|
6
5
|
var clsx = require('clsx');
|
|
7
6
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -423,39 +422,18 @@ var nbsp = String.fromCharCode(160);
|
|
|
423
422
|
function TruncatedTextTooltip({ label, children }) {
|
|
424
423
|
return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
|
|
425
424
|
}
|
|
426
|
-
var
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
"hover:opacity-76"
|
|
439
|
-
].join(" "),
|
|
440
|
-
filter: "bg-[var(--color-tag-filter-bg)]",
|
|
441
|
-
select: [
|
|
442
|
-
"cursor-pointer",
|
|
443
|
-
"bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)]",
|
|
444
|
-
"hover:text-[var(--color-hover)] hover:opacity-76"
|
|
445
|
-
].join(" ")
|
|
446
|
-
},
|
|
447
|
-
size: {
|
|
448
|
-
sm: "px-1 py-0.5 min-h-5 gap-1 text-xs",
|
|
449
|
-
md: "px-1 py-0.5 min-h-6 gap-1 text-sm",
|
|
450
|
-
lg: "px-1.5 py-1.5 min-h-8 min-w-8 gap-1 text-sm"
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
defaultVariants: {
|
|
454
|
-
variant: "subtle",
|
|
455
|
-
size: "md"
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
);
|
|
425
|
+
var TAG_BASE = "inline-flex items-center align-top max-w-full select-text rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-500";
|
|
426
|
+
var TAG_VARIANT_CLASSES = {
|
|
427
|
+
subtle: "bg-[var(--color-tag-subtle-bg)] text-[var(--color-tag-subtle-fg)]",
|
|
428
|
+
clickable: "cursor-pointer bg-[var(--color-tag-clickable-bg)] text-[var(--color-tag-clickable-fg)] hover:opacity-76",
|
|
429
|
+
filter: "bg-[var(--color-tag-filter-bg)]",
|
|
430
|
+
select: "cursor-pointer bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)] hover:text-[var(--color-hover)] hover:opacity-76"
|
|
431
|
+
};
|
|
432
|
+
var TAG_SIZE_CLASSES = {
|
|
433
|
+
sm: "px-1 py-0.5 min-h-5 gap-1 text-xs",
|
|
434
|
+
md: "px-1 py-0.5 min-h-6 gap-1 text-sm",
|
|
435
|
+
lg: "px-1.5 py-1.5 min-h-8 min-w-8 gap-1 text-sm"
|
|
436
|
+
};
|
|
459
437
|
var TAG_SELECTED_CLASSES = [
|
|
460
438
|
"bg-[var(--color-tag-select-selected-bg)]",
|
|
461
439
|
"text-[var(--color-tag-select-selected-fg)]",
|
|
@@ -497,7 +475,9 @@ var Tag = React3__namespace.forwardRef(
|
|
|
497
475
|
{
|
|
498
476
|
ref,
|
|
499
477
|
className: cn(
|
|
500
|
-
|
|
478
|
+
TAG_BASE,
|
|
479
|
+
TAG_VARIANT_CLASSES[variant ?? "subtle"],
|
|
480
|
+
TAG_SIZE_CLASSES[size ?? "md"],
|
|
501
481
|
selected && !loading && TAG_SELECTED_CLASSES,
|
|
502
482
|
disabled && TAG_DISABLED_CLASSES,
|
|
503
483
|
className
|
package/dist/tag.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
2
|
import * as React3 from 'react';
|
|
4
3
|
import { clsx } from 'clsx';
|
|
5
4
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -401,39 +400,18 @@ var nbsp = String.fromCharCode(160);
|
|
|
401
400
|
function TruncatedTextTooltip({ label, children }) {
|
|
402
401
|
return /* @__PURE__ */ jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
|
|
403
402
|
}
|
|
404
|
-
var
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
"hover:opacity-76"
|
|
417
|
-
].join(" "),
|
|
418
|
-
filter: "bg-[var(--color-tag-filter-bg)]",
|
|
419
|
-
select: [
|
|
420
|
-
"cursor-pointer",
|
|
421
|
-
"bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)]",
|
|
422
|
-
"hover:text-[var(--color-hover)] hover:opacity-76"
|
|
423
|
-
].join(" ")
|
|
424
|
-
},
|
|
425
|
-
size: {
|
|
426
|
-
sm: "px-1 py-0.5 min-h-5 gap-1 text-xs",
|
|
427
|
-
md: "px-1 py-0.5 min-h-6 gap-1 text-sm",
|
|
428
|
-
lg: "px-1.5 py-1.5 min-h-8 min-w-8 gap-1 text-sm"
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
|
-
defaultVariants: {
|
|
432
|
-
variant: "subtle",
|
|
433
|
-
size: "md"
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
);
|
|
403
|
+
var TAG_BASE = "inline-flex items-center align-top max-w-full select-text rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-500";
|
|
404
|
+
var TAG_VARIANT_CLASSES = {
|
|
405
|
+
subtle: "bg-[var(--color-tag-subtle-bg)] text-[var(--color-tag-subtle-fg)]",
|
|
406
|
+
clickable: "cursor-pointer bg-[var(--color-tag-clickable-bg)] text-[var(--color-tag-clickable-fg)] hover:opacity-76",
|
|
407
|
+
filter: "bg-[var(--color-tag-filter-bg)]",
|
|
408
|
+
select: "cursor-pointer bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)] hover:text-[var(--color-hover)] hover:opacity-76"
|
|
409
|
+
};
|
|
410
|
+
var TAG_SIZE_CLASSES = {
|
|
411
|
+
sm: "px-1 py-0.5 min-h-5 gap-1 text-xs",
|
|
412
|
+
md: "px-1 py-0.5 min-h-6 gap-1 text-sm",
|
|
413
|
+
lg: "px-1.5 py-1.5 min-h-8 min-w-8 gap-1 text-sm"
|
|
414
|
+
};
|
|
437
415
|
var TAG_SELECTED_CLASSES = [
|
|
438
416
|
"bg-[var(--color-tag-select-selected-bg)]",
|
|
439
417
|
"text-[var(--color-tag-select-selected-fg)]",
|
|
@@ -475,7 +453,9 @@ var Tag = React3.forwardRef(
|
|
|
475
453
|
{
|
|
476
454
|
ref,
|
|
477
455
|
className: cn(
|
|
478
|
-
|
|
456
|
+
TAG_BASE,
|
|
457
|
+
TAG_VARIANT_CLASSES[variant ?? "subtle"],
|
|
458
|
+
TAG_SIZE_CLASSES[size ?? "md"],
|
|
479
459
|
selected && !loading && TAG_SELECTED_CLASSES,
|
|
480
460
|
disabled && TAG_DISABLED_CLASSES,
|
|
481
461
|
className
|
package/dist/textarea.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
5
4
|
var React = require('react');
|
|
6
5
|
var clsx = require('clsx');
|
|
7
6
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -15,46 +14,36 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
15
14
|
function cn(...inputs) {
|
|
16
15
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
17
16
|
}
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
42
|
-
unstyled: "border-0 bg-transparent p-0"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
defaultVariants: {
|
|
46
|
-
size: "md",
|
|
47
|
-
variant: "outline"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
);
|
|
17
|
+
var TEXTAREA_BASE = [
|
|
18
|
+
"w-full appearance-none outline-none transition-colors resize-y",
|
|
19
|
+
"bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
|
|
20
|
+
"placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
|
|
21
|
+
"hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
|
|
22
|
+
"focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
|
|
23
|
+
"focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
|
|
24
|
+
"disabled:opacity-40 disabled:cursor-not-allowed",
|
|
25
|
+
"read-only:opacity-70",
|
|
26
|
+
"data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
|
|
27
|
+
].join(" ");
|
|
28
|
+
var TEXTAREA_SIZE_CLASSES = {
|
|
29
|
+
xs: "px-2 py-1 text-xs rounded",
|
|
30
|
+
sm: "px-3 py-2 text-sm rounded-md",
|
|
31
|
+
md: "px-4 py-2 text-base rounded-md",
|
|
32
|
+
lg: "px-4 py-3 text-lg rounded-lg",
|
|
33
|
+
"2xl": "px-4 py-3 text-xl rounded-lg"
|
|
34
|
+
};
|
|
35
|
+
var TEXTAREA_VARIANT_CLASSES = {
|
|
36
|
+
outline: "border border-solid",
|
|
37
|
+
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
38
|
+
unstyled: "border-0 bg-transparent p-0"
|
|
39
|
+
};
|
|
51
40
|
var Textarea = React__default.default.forwardRef(
|
|
52
|
-
({ size, variant, className, ...rest }, ref) => {
|
|
41
|
+
({ size = "md", variant = "outline", className, ...rest }, ref) => {
|
|
53
42
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
54
43
|
"textarea",
|
|
55
44
|
{
|
|
56
45
|
ref,
|
|
57
|
-
className: cn(
|
|
46
|
+
className: cn(TEXTAREA_BASE, TEXTAREA_SIZE_CLASSES[size], TEXTAREA_VARIANT_CLASSES[variant], className),
|
|
58
47
|
...rest
|
|
59
48
|
}
|
|
60
49
|
);
|
package/dist/textarea.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { clsx } from 'clsx';
|
|
5
4
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -9,46 +8,36 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
9
8
|
function cn(...inputs) {
|
|
10
9
|
return twMerge(clsx(inputs));
|
|
11
10
|
}
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
36
|
-
unstyled: "border-0 bg-transparent p-0"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
defaultVariants: {
|
|
40
|
-
size: "md",
|
|
41
|
-
variant: "outline"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
11
|
+
var TEXTAREA_BASE = [
|
|
12
|
+
"w-full appearance-none outline-none transition-colors resize-y",
|
|
13
|
+
"bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
|
|
14
|
+
"placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
|
|
15
|
+
"hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
|
|
16
|
+
"focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
|
|
17
|
+
"focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
|
|
18
|
+
"disabled:opacity-40 disabled:cursor-not-allowed",
|
|
19
|
+
"read-only:opacity-70",
|
|
20
|
+
"data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
|
|
21
|
+
].join(" ");
|
|
22
|
+
var TEXTAREA_SIZE_CLASSES = {
|
|
23
|
+
xs: "px-2 py-1 text-xs rounded",
|
|
24
|
+
sm: "px-3 py-2 text-sm rounded-md",
|
|
25
|
+
md: "px-4 py-2 text-base rounded-md",
|
|
26
|
+
lg: "px-4 py-3 text-lg rounded-lg",
|
|
27
|
+
"2xl": "px-4 py-3 text-xl rounded-lg"
|
|
28
|
+
};
|
|
29
|
+
var TEXTAREA_VARIANT_CLASSES = {
|
|
30
|
+
outline: "border border-solid",
|
|
31
|
+
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
32
|
+
unstyled: "border-0 bg-transparent p-0"
|
|
33
|
+
};
|
|
45
34
|
var Textarea = React.forwardRef(
|
|
46
|
-
({ size, variant, className, ...rest }, ref) => {
|
|
35
|
+
({ size = "md", variant = "outline", className, ...rest }, ref) => {
|
|
47
36
|
return /* @__PURE__ */ jsx(
|
|
48
37
|
"textarea",
|
|
49
38
|
{
|
|
50
39
|
ref,
|
|
51
|
-
className: cn(
|
|
40
|
+
className: cn(TEXTAREA_BASE, TEXTAREA_SIZE_CLASSES[size], TEXTAREA_VARIANT_CLASSES[variant], className),
|
|
52
41
|
...rest
|
|
53
42
|
}
|
|
54
43
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxfi/ui",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Radix + Tailwind UI primitives for Lux apps. Drop-in replacements for Chakra compound components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -222,9 +222,8 @@
|
|
|
222
222
|
"require": "./dist/tooltip.cjs"
|
|
223
223
|
},
|
|
224
224
|
"./provider": {
|
|
225
|
-
"
|
|
226
|
-
"
|
|
227
|
-
"require": "./dist/provider.cjs"
|
|
225
|
+
"import": "./src/provider.tsx",
|
|
226
|
+
"types": "./src/provider.tsx"
|
|
228
227
|
},
|
|
229
228
|
"./utils": {
|
|
230
229
|
"types": "./dist/utils.d.ts",
|
|
@@ -273,16 +272,16 @@
|
|
|
273
272
|
"@radix-ui/react-switch": "^1.2.6",
|
|
274
273
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
275
274
|
"@uidotdev/usehooks": "^2.4.1",
|
|
276
|
-
"class-variance-authority": "^0.7.1",
|
|
277
275
|
"clsx": "^2.1.1",
|
|
278
276
|
"es-toolkit": "^1.31.0",
|
|
279
277
|
"react-icons": "^5.4.0",
|
|
280
278
|
"sonner": "^2.0.0",
|
|
281
|
-
"tailwind-merge": "^3.0.0"
|
|
279
|
+
"tailwind-merge": "^3.0.0",
|
|
280
|
+
"@tanstack/react-query": "^5.76.0"
|
|
282
281
|
},
|
|
283
282
|
"peerDependencies": {
|
|
284
283
|
"@hanzogui/core": "^3.0.6",
|
|
285
|
-
"react": "
|
|
284
|
+
"react": ">=18",
|
|
286
285
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
287
286
|
},
|
|
288
287
|
"devDependencies": {
|