@vuer-ai/vuer-uikit 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2JCULHBM.js +58 -0
- package/dist/chunk-2TRYGIGT.mjs +76 -0
- package/dist/chunk-2YCL2ET2.js +431 -0
- package/dist/chunk-3FR3WKI4.mjs +24 -0
- package/dist/chunk-44KW6PTD.mjs +111 -0
- package/dist/chunk-5OUTEHVX.js +48 -0
- package/dist/chunk-5SR53QBZ.js +143 -0
- package/dist/chunk-5TVG5JK5.js +93 -0
- package/dist/chunk-5ZZC23M7.mjs +60 -0
- package/dist/chunk-6N5422RT.js +110 -0
- package/dist/chunk-AOUGWGQR.js +609 -0
- package/dist/chunk-B2E7AY66.mjs +86 -0
- package/dist/chunk-BOPZFNFS.mjs +54 -0
- package/dist/chunk-CLTLT5XW.js +27 -0
- package/dist/chunk-DDOX4EEM.mjs +46 -0
- package/dist/chunk-DZ4J7I7I.mjs +114 -0
- package/dist/chunk-E33MW663.js +179 -0
- package/dist/chunk-EAZQH4IX.mjs +27 -0
- package/dist/chunk-EFIRD3FN.js +69 -0
- package/dist/chunk-EOFYA6CS.js +53 -0
- package/dist/chunk-EUY74AXP.mjs +341 -0
- package/dist/chunk-EYIFKSU2.mjs +259 -0
- package/dist/chunk-F56ZKT7B.mjs +1 -0
- package/dist/chunk-F776EMXP.mjs +82 -0
- package/dist/chunk-FORVP7XH.js +164 -0
- package/dist/chunk-FP26SRGL.js +377 -0
- package/dist/chunk-FRT225GK.mjs +34 -0
- package/dist/chunk-G5KMD72J.mjs +162 -0
- package/dist/chunk-G6PRZVSE.mjs +71 -0
- package/dist/chunk-H5P4IX7R.js +67 -0
- package/dist/chunk-HLJ7PQA7.mjs +15 -0
- package/dist/chunk-IGBWUFZL.js +79 -0
- package/dist/chunk-IXHMIR5P.js +131 -0
- package/dist/chunk-JAMJUXBY.mjs +45 -0
- package/dist/chunk-JMPVDU2C.mjs +110 -0
- package/dist/chunk-KJ42IGH6.js +2 -0
- package/dist/chunk-KTNZSZ5Y.mjs +23 -0
- package/dist/chunk-LEPXSM36.mjs +46 -0
- package/dist/chunk-LLXRJYQB.mjs +31 -0
- package/dist/chunk-M4IVLZIH.mjs +1 -0
- package/dist/chunk-MRVMXKZO.mjs +106 -0
- package/dist/chunk-MZ4POL3U.js +301 -0
- package/dist/chunk-N7CINZS2.js +2 -0
- package/dist/chunk-NODFVSVC.mjs +39 -0
- package/dist/chunk-OOI3SJDU.mjs +206 -0
- package/dist/chunk-OQ237S4Z.js +94 -0
- package/dist/chunk-OTPUWWEB.js +98 -0
- package/dist/chunk-PIR7EZC6.js +187 -0
- package/dist/chunk-PVRQNCSJ.js +49 -0
- package/dist/chunk-Q5KEB4UK.mjs +51 -0
- package/dist/chunk-QEY7BWIR.js +208 -0
- package/dist/chunk-QJR6MCTR.js +32 -0
- package/dist/chunk-QVUX6LLD.mjs +270 -0
- package/dist/chunk-QYRRQ65X.mjs +115 -0
- package/dist/chunk-SKO72K64.js +118 -0
- package/dist/chunk-T3VSSE2L.mjs +165 -0
- package/dist/chunk-TMBKCIVQ.mjs +148 -0
- package/dist/chunk-U2ZLDPOE.js +261 -0
- package/dist/chunk-U7SNLMJR.js +110 -0
- package/dist/chunk-UFHMEEGL.js +113 -0
- package/dist/chunk-UKFVRXAR.mjs +409 -0
- package/dist/chunk-UPTTGNMB.js +41 -0
- package/dist/chunk-V4KNORQN.js +21 -0
- package/dist/chunk-VAXIFFOT.js +83 -0
- package/dist/chunk-VGCVIHBR.mjs +1 -0
- package/dist/chunk-VXHM7V6F.mjs +92 -0
- package/dist/chunk-WDUTW7HS.mjs +87 -0
- package/dist/chunk-WJ7T7FAH.js +135 -0
- package/dist/chunk-WO3WHXDP.mjs +66 -0
- package/dist/chunk-X55EAYE2.js +94 -0
- package/dist/chunk-XMG3IVGZ.mjs +95 -0
- package/dist/chunk-XWS4SIB5.js +2 -0
- package/dist/chunk-XXWQ4RVP.js +25 -0
- package/dist/chunk-Y5I2GI4V.js +33 -0
- package/dist/chunk-YXDJPCAF.js +99 -0
- package/dist/chunk-ZVG2UKKC.mjs +603 -0
- package/dist/highlight-cursor/cursor-context.d.mts +7 -0
- package/dist/highlight-cursor/cursor-context.d.ts +7 -0
- package/dist/highlight-cursor/cursor-context.js +14 -0
- package/dist/highlight-cursor/cursor-context.mjs +1 -0
- package/dist/highlight-cursor/cursor-provider.d.mts +7 -0
- package/dist/highlight-cursor/cursor-provider.d.ts +7 -0
- package/dist/highlight-cursor/cursor-provider.js +12 -0
- package/dist/highlight-cursor/cursor-provider.mjs +3 -0
- package/dist/highlight-cursor/enhanced-components.d.mts +20 -0
- package/dist/highlight-cursor/enhanced-components.d.ts +20 -0
- package/dist/highlight-cursor/enhanced-components.js +37 -0
- package/dist/highlight-cursor/enhanced-components.mjs +12 -0
- package/dist/highlight-cursor/index.d.mts +16 -0
- package/dist/highlight-cursor/index.d.ts +16 -0
- package/dist/highlight-cursor/index.js +51 -0
- package/dist/highlight-cursor/index.mjs +14 -0
- package/dist/highlight-cursor/tabs-cursor-context.d.mts +14 -0
- package/dist/highlight-cursor/tabs-cursor-context.d.ts +14 -0
- package/dist/highlight-cursor/tabs-cursor-context.js +14 -0
- package/dist/highlight-cursor/tabs-cursor-context.mjs +1 -0
- package/dist/highlight-cursor/types.d.mts +39 -0
- package/dist/highlight-cursor/types.d.ts +39 -0
- package/dist/highlight-cursor/types.js +2 -0
- package/dist/highlight-cursor/types.mjs +1 -0
- package/dist/highlight-cursor/with-cursor.d.mts +7 -0
- package/dist/highlight-cursor/with-cursor.d.ts +7 -0
- package/dist/highlight-cursor/with-cursor.js +11 -0
- package/dist/highlight-cursor/with-cursor.mjs +2 -0
- package/dist/index.css +318 -0
- package/dist/index.d.mts +55 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.js +131 -131
- package/dist/index.mjs +38 -0
- package/dist/styles/theme.css +192 -0
- package/dist/styles/theme.d.mts +2 -0
- package/dist/styles/theme.d.ts +2 -0
- package/dist/styles/toast.css +61 -0
- package/dist/styles/toast.d.mts +2 -0
- package/dist/styles/toast.d.ts +2 -0
- package/dist/styles/variables.css +188 -0
- package/dist/styles/variables.d.mts +2 -0
- package/dist/styles/variables.d.ts +2 -0
- package/dist/ui/avatar.d.mts +16 -0
- package/dist/ui/avatar.d.ts +16 -0
- package/dist/ui/avatar.js +25 -0
- package/dist/ui/avatar.mjs +4 -0
- package/dist/ui/badge.d.mts +14 -0
- package/dist/ui/badge.d.ts +14 -0
- package/dist/ui/badge.js +17 -0
- package/dist/ui/badge.mjs +4 -0
- package/dist/ui/button.d.mts +16 -0
- package/dist/ui/button.d.ts +16 -0
- package/dist/ui/button.js +13 -0
- package/dist/ui/button.mjs +4 -0
- package/dist/ui/card.d.mts +12 -0
- package/dist/ui/card.d.ts +12 -0
- package/dist/ui/card.js +37 -0
- package/dist/ui/card.mjs +4 -0
- package/dist/ui/checkbox.d.mts +11 -0
- package/dist/ui/checkbox.d.ts +11 -0
- package/dist/ui/checkbox.js +13 -0
- package/dist/ui/checkbox.mjs +4 -0
- package/dist/ui/collapsible.d.mts +9 -0
- package/dist/ui/collapsible.d.ts +9 -0
- package/dist/ui/collapsible.js +21 -0
- package/dist/ui/collapsible.mjs +4 -0
- package/dist/ui/dropdown.d.mts +28 -0
- package/dist/ui/dropdown.d.ts +28 -0
- package/dist/ui/dropdown.js +69 -0
- package/dist/ui/dropdown.mjs +4 -0
- package/dist/ui/index.d.mts +47 -0
- package/dist/ui/index.d.ts +47 -0
- package/dist/ui/index.js +414 -0
- package/dist/ui/index.mjs +33 -0
- package/dist/ui/input-numbers.d.mts +15 -0
- package/dist/ui/input-numbers.d.ts +15 -0
- package/dist/ui/input-numbers.js +14 -0
- package/dist/ui/input-numbers.mjs +5 -0
- package/dist/ui/input.d.mts +22 -0
- package/dist/ui/input.d.ts +22 -0
- package/dist/ui/input.js +17 -0
- package/dist/ui/input.mjs +4 -0
- package/dist/ui/layout.d.mts +12 -0
- package/dist/ui/layout.d.ts +12 -0
- package/dist/ui/layout.js +13 -0
- package/dist/ui/layout.mjs +4 -0
- package/dist/ui/modal.d.mts +28 -0
- package/dist/ui/modal.d.ts +28 -0
- package/dist/ui/modal.js +49 -0
- package/dist/ui/modal.mjs +4 -0
- package/dist/ui/popover.d.mts +10 -0
- package/dist/ui/popover.d.ts +10 -0
- package/dist/ui/popover.js +25 -0
- package/dist/ui/popover.mjs +4 -0
- package/dist/ui/radio-group.d.mts +8 -0
- package/dist/ui/radio-group.d.ts +8 -0
- package/dist/ui/radio-group.js +17 -0
- package/dist/ui/radio-group.mjs +4 -0
- package/dist/ui/select.d.mts +28 -0
- package/dist/ui/select.d.ts +28 -0
- package/dist/ui/select.js +49 -0
- package/dist/ui/select.mjs +4 -0
- package/dist/ui/sheet.d.mts +16 -0
- package/dist/ui/sheet.d.ts +16 -0
- package/dist/ui/sheet.js +39 -0
- package/dist/ui/sheet.mjs +2 -0
- package/dist/ui/slider.d.mts +10 -0
- package/dist/ui/slider.d.ts +10 -0
- package/dist/ui/slider.js +13 -0
- package/dist/ui/slider.mjs +4 -0
- package/dist/ui/switch.d.mts +7 -0
- package/dist/ui/switch.d.ts +7 -0
- package/dist/ui/switch.js +13 -0
- package/dist/ui/switch.mjs +4 -0
- package/dist/ui/tabs.d.mts +16 -0
- package/dist/ui/tabs.d.ts +16 -0
- package/dist/ui/tabs.js +26 -0
- package/dist/ui/tabs.mjs +5 -0
- package/dist/ui/textarea.d.mts +16 -0
- package/dist/ui/textarea.d.ts +16 -0
- package/dist/ui/textarea.js +13 -0
- package/dist/ui/textarea.mjs +4 -0
- package/dist/ui/theme-context.d.mts +17 -0
- package/dist/ui/theme-context.d.ts +17 -0
- package/dist/ui/theme-context.js +17 -0
- package/dist/ui/theme-context.mjs +4 -0
- package/dist/ui/timeline.d.mts +23 -0
- package/dist/ui/timeline.d.ts +23 -0
- package/dist/ui/timeline.js +15 -0
- package/dist/ui/timeline.mjs +6 -0
- package/dist/ui/toast.d.mts +7 -0
- package/dist/ui/toast.d.ts +7 -0
- package/dist/ui/toast.js +14 -0
- package/dist/ui/toast.mjs +1 -0
- package/dist/ui/toggle-group.d.mts +12 -0
- package/dist/ui/toggle-group.d.ts +12 -0
- package/dist/ui/toggle-group.js +18 -0
- package/dist/ui/toggle-group.mjs +5 -0
- package/dist/ui/toggle.d.mts +13 -0
- package/dist/ui/toggle.d.ts +13 -0
- package/dist/ui/toggle.js +17 -0
- package/dist/ui/toggle.mjs +4 -0
- package/dist/ui/tooltip.d.mts +10 -0
- package/dist/ui/tooltip.d.ts +10 -0
- package/dist/ui/tooltip.js +25 -0
- package/dist/ui/tooltip.mjs +4 -0
- package/dist/ui/tree-view-v2.d.mts +25 -0
- package/dist/ui/tree-view-v2.d.ts +25 -0
- package/dist/ui/tree-view-v2.js +14 -0
- package/dist/ui/tree-view-v2.mjs +5 -0
- package/dist/ui/tree-view.d.mts +28 -0
- package/dist/ui/tree-view.d.ts +28 -0
- package/dist/ui/tree-view.js +11 -0
- package/dist/ui/tree-view.mjs +2 -0
- package/dist/ui/version-badge.d.mts +26 -0
- package/dist/ui/version-badge.d.ts +26 -0
- package/dist/ui/version-badge.js +14 -0
- package/dist/ui/version-badge.mjs +5 -0
- package/dist/utils/cn.d.mts +5 -0
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.js +10 -0
- package/dist/utils/cn.mjs +1 -0
- package/dist/utils/index.d.mts +3 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/index.mjs +3 -0
- package/dist/utils/use-local-storage.d.mts +3 -0
- package/dist/utils/use-local-storage.d.ts +3 -0
- package/dist/utils/use-local-storage.js +10 -0
- package/dist/utils/use-local-storage.mjs +1 -0
- package/package.json +3 -2
- package/src/ui/version-badge.tsx +5 -2
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkXXWQ4RVP_js = require('./chunk-XXWQ4RVP.js');
|
|
4
|
+
var reactComposeRefs = require('@radix-ui/react-compose-refs');
|
|
5
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
var inputRootVariants = classVarianceAuthority.cva(
|
|
10
|
+
[
|
|
11
|
+
"px-1.5",
|
|
12
|
+
"flex",
|
|
13
|
+
"gap-md",
|
|
14
|
+
"items-center",
|
|
15
|
+
"rounded-uk-sm",
|
|
16
|
+
"overflow-hidden",
|
|
17
|
+
"bg-bg-secondary"
|
|
18
|
+
],
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
state: {
|
|
22
|
+
default: ["hover:bg-bg-tertiary", "has-[input:focus]:bg-bg-quaternary"],
|
|
23
|
+
disabled: ["disabled:cursor-not-allowed", "bg-bg-tertiary", "text-text-tertiary"],
|
|
24
|
+
error: ["hover:bg-danger-primary/10", "bg-danger-primary/20"]
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
sm: ["h-5.5", "text-uk-sm", "[&_.input-slot>svg:not([class*='size-'])]:size-lg"],
|
|
28
|
+
base: ["h-7", "text-uk-md", "[&_.input-slot>svg:not([class*='size-'])]:size-[14px]"],
|
|
29
|
+
lg: ["h-8", "text-uk-lg", "[&_.input-slot>svg:not([class*='size-'])]:size-xl"]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
state: "default",
|
|
34
|
+
size: "base"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
var InputRoot = react.forwardRef(function InputRoot2({ style, className, side, children, disabled, state, size, type, inputClassName, ...props }, ref) {
|
|
39
|
+
const inputRef = react.useRef(null);
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
style,
|
|
44
|
+
"data-input": true,
|
|
45
|
+
className: chunkXXWQ4RVP_js.cn(inputRootVariants({ size, state: disabled ? "disabled" : state }), className),
|
|
46
|
+
onClick: (event) => {
|
|
47
|
+
const target = event.target;
|
|
48
|
+
if (target.closest("input, button, a")) return;
|
|
49
|
+
const input = inputRef.current;
|
|
50
|
+
if (!input) return;
|
|
51
|
+
const isRightSlot = target.closest(`
|
|
52
|
+
.input-slot[data-side='right'],
|
|
53
|
+
.input-slot:not([data-side='right']) ~ .input-slot:not([data-side='left'])
|
|
54
|
+
`);
|
|
55
|
+
const cursorPosition = isRightSlot ? input.value.length : 0;
|
|
56
|
+
requestAnimationFrame(() => {
|
|
57
|
+
try {
|
|
58
|
+
input.setSelectionRange(cursorPosition, cursorPosition);
|
|
59
|
+
} catch {
|
|
60
|
+
}
|
|
61
|
+
input.focus();
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
66
|
+
"input",
|
|
67
|
+
{
|
|
68
|
+
spellCheck: "false",
|
|
69
|
+
...props,
|
|
70
|
+
type,
|
|
71
|
+
"data-side": side,
|
|
72
|
+
disabled,
|
|
73
|
+
name: type ?? "text",
|
|
74
|
+
ref: reactComposeRefs.composeRefs(inputRef, ref),
|
|
75
|
+
className: chunkXXWQ4RVP_js.cn(
|
|
76
|
+
[
|
|
77
|
+
"w-full",
|
|
78
|
+
"h-full",
|
|
79
|
+
"outline-none",
|
|
80
|
+
"data-[side=right]:text-right",
|
|
81
|
+
"[input[type=number]]:font-number-input",
|
|
82
|
+
"[&::-webkit-inner-spin-button]:appearance-none",
|
|
83
|
+
"[&::-webkit-outer-spin-button]:appearance-none"
|
|
84
|
+
],
|
|
85
|
+
inputClassName
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
children
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
var InputSlot = react.forwardRef(function({ className, children, side = "left", ...props }, ref) {
|
|
95
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
"data-side": side,
|
|
99
|
+
...props,
|
|
100
|
+
ref,
|
|
101
|
+
className: chunkXXWQ4RVP_js.cn(
|
|
102
|
+
[
|
|
103
|
+
"input-slot",
|
|
104
|
+
"cursor-text",
|
|
105
|
+
"shrink-0",
|
|
106
|
+
"order-[0]",
|
|
107
|
+
"text-text-tertiary",
|
|
108
|
+
"data-[side=left]:-order-1"
|
|
109
|
+
],
|
|
110
|
+
className
|
|
111
|
+
),
|
|
112
|
+
children
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
exports.InputRoot = InputRoot;
|
|
118
|
+
exports.InputSlot = InputSlot;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { cn } from './chunk-KTNZSZ5Y.mjs';
|
|
2
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
3
|
+
import { forwardRef, useState, useMemo } from 'react';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var Slider = forwardRef(function Slider2({
|
|
7
|
+
className,
|
|
8
|
+
defaultValue,
|
|
9
|
+
value,
|
|
10
|
+
onValueChange,
|
|
11
|
+
showStep = false,
|
|
12
|
+
step = 1,
|
|
13
|
+
min = 0,
|
|
14
|
+
max = 100,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) {
|
|
17
|
+
const [currentValue, setCurrentValue] = useState(value ?? defaultValue ?? [0]);
|
|
18
|
+
const _values = useMemo(
|
|
19
|
+
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
20
|
+
[value, defaultValue, min, max]
|
|
21
|
+
);
|
|
22
|
+
return /* @__PURE__ */ jsxs(
|
|
23
|
+
SliderPrimitive.Root,
|
|
24
|
+
{
|
|
25
|
+
"data-slot": "slider",
|
|
26
|
+
value,
|
|
27
|
+
defaultValue,
|
|
28
|
+
onValueChange: (v) => {
|
|
29
|
+
onValueChange == null ? void 0 : onValueChange(v);
|
|
30
|
+
setCurrentValue(v);
|
|
31
|
+
},
|
|
32
|
+
ref,
|
|
33
|
+
min,
|
|
34
|
+
max,
|
|
35
|
+
step,
|
|
36
|
+
className: cn(
|
|
37
|
+
"relative",
|
|
38
|
+
"flex",
|
|
39
|
+
"w-full",
|
|
40
|
+
"touch-none",
|
|
41
|
+
"select-none",
|
|
42
|
+
"items-center",
|
|
43
|
+
"data-[orientation=vertical]:h-full",
|
|
44
|
+
"data-[orientation=vertical]:min-h-44",
|
|
45
|
+
"data-[orientation=vertical]:w-auto",
|
|
46
|
+
"data-[orientation=vertical]:flex-col",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
...props,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
SliderPrimitive.Track,
|
|
53
|
+
{
|
|
54
|
+
"data-slot": "slider-track",
|
|
55
|
+
className: cn(
|
|
56
|
+
"peer/slider-track",
|
|
57
|
+
"bg-line-primary",
|
|
58
|
+
"relative",
|
|
59
|
+
"grow",
|
|
60
|
+
"overflow-hidden",
|
|
61
|
+
"rounded-full",
|
|
62
|
+
"data-[disabled]:bg-bg-secondary",
|
|
63
|
+
"data-[orientation=vertical]:w-0.5",
|
|
64
|
+
"data-[orientation=vertical]:h-full",
|
|
65
|
+
"data-[orientation=horizontal]:h-0.5",
|
|
66
|
+
"data-[orientation=horizontal]:w-full"
|
|
67
|
+
),
|
|
68
|
+
children: /* @__PURE__ */ jsx(
|
|
69
|
+
SliderPrimitive.Range,
|
|
70
|
+
{
|
|
71
|
+
"data-slot": "slider-range",
|
|
72
|
+
className: cn(
|
|
73
|
+
"bg-brand-primary",
|
|
74
|
+
"absolute",
|
|
75
|
+
"data-[disabled]:bg-bg-secondary",
|
|
76
|
+
"data-[orientation=vertical]:w-full",
|
|
77
|
+
"data-[orientation=horizontal]:h-full"
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
showStep && /* @__PURE__ */ jsx(SliderSteps, { currentValue, max, min, step }),
|
|
84
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx(
|
|
85
|
+
SliderPrimitive.Thumb,
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "slider-thumb",
|
|
88
|
+
className: cn(
|
|
89
|
+
"ring-brand-primary/50",
|
|
90
|
+
"bg-brand-primary",
|
|
91
|
+
"block",
|
|
92
|
+
"h-4",
|
|
93
|
+
"w-[0.6rem]",
|
|
94
|
+
"shrink-0",
|
|
95
|
+
"rounded-[3px]",
|
|
96
|
+
"transition-[color,box-shadow]",
|
|
97
|
+
"hover:ring-4",
|
|
98
|
+
"hover:cursor-ew-resize",
|
|
99
|
+
"focus-visible:ring-4",
|
|
100
|
+
"focus-visible:outline-hidden",
|
|
101
|
+
"data-[disabled]:bg-bg-tertiary",
|
|
102
|
+
"data-[disabled]:pointer-events-none"
|
|
103
|
+
)
|
|
104
|
+
},
|
|
105
|
+
index
|
|
106
|
+
))
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
function SliderSteps({ step, min, max, currentValue }) {
|
|
112
|
+
const steps = useMemo(() => {
|
|
113
|
+
const value = max - min;
|
|
114
|
+
const stepCount = Math.ceil(value / step);
|
|
115
|
+
return Array.from({ length: stepCount + 1 }, (_, i) => {
|
|
116
|
+
return { position: Math.min(100 / value * (i * step), 100), v: i * step + min };
|
|
117
|
+
});
|
|
118
|
+
}, [max, min, step]);
|
|
119
|
+
const [minRange, maxRange] = useMemo(() => {
|
|
120
|
+
if (currentValue.length > 1) {
|
|
121
|
+
return [Math.min(...currentValue), Math.max(...currentValue)];
|
|
122
|
+
} else {
|
|
123
|
+
return [0, ...currentValue];
|
|
124
|
+
}
|
|
125
|
+
}, [currentValue]);
|
|
126
|
+
return steps.map((step2, i) => {
|
|
127
|
+
const thumbInBoundsOffset = getThumbInBoundsOffset(9.6, step2.position, 1);
|
|
128
|
+
return /* @__PURE__ */ jsx(
|
|
129
|
+
"span",
|
|
130
|
+
{
|
|
131
|
+
"data-slot": "slider-step",
|
|
132
|
+
style: { left: `calc(${step2.position}% + ${thumbInBoundsOffset}px)` },
|
|
133
|
+
className: cn(
|
|
134
|
+
"absolute",
|
|
135
|
+
"top-1/2",
|
|
136
|
+
"translate-y-[-50%]",
|
|
137
|
+
"translate-x-[-50%]",
|
|
138
|
+
"bg-brand-primary",
|
|
139
|
+
"block",
|
|
140
|
+
"h-[5pt]",
|
|
141
|
+
"w-[1pt]",
|
|
142
|
+
"shrink-0",
|
|
143
|
+
"rounded-[1px]",
|
|
144
|
+
"peer-has-data-[disabled]/slider-track:bg-bg-tertiary",
|
|
145
|
+
{ "bg-bg-tertiary": step2.v < minRange || step2.v > maxRange }
|
|
146
|
+
)
|
|
147
|
+
},
|
|
148
|
+
i
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function getThumbInBoundsOffset(width, left, direction) {
|
|
153
|
+
const halfWidth = width / 2;
|
|
154
|
+
const halfPercent = 50;
|
|
155
|
+
const offset = linearScale([0, halfPercent], [0, halfWidth]);
|
|
156
|
+
return (halfWidth - offset(left) * direction) * direction;
|
|
157
|
+
}
|
|
158
|
+
function linearScale(input, output) {
|
|
159
|
+
return (value) => {
|
|
160
|
+
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
|
|
161
|
+
return output[0] + ratio * (value - input[0]);
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export { Slider };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { cn } from './chunk-KTNZSZ5Y.mjs';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { XIcon } from 'lucide-react';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function Modal({ ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "modal", ...props });
|
|
9
|
+
}
|
|
10
|
+
function ModalTrigger({ ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "modal-trigger", ...props });
|
|
12
|
+
}
|
|
13
|
+
function ModalPortal({ ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "modal-portal", ...props });
|
|
15
|
+
}
|
|
16
|
+
function ModalClose({ ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "modal-close", ...props });
|
|
18
|
+
}
|
|
19
|
+
var modalOverlayVariants = cva([
|
|
20
|
+
"fixed",
|
|
21
|
+
"inset-0",
|
|
22
|
+
"z-100",
|
|
23
|
+
"bg-bg-mask",
|
|
24
|
+
"transition-all",
|
|
25
|
+
"duration-200"
|
|
26
|
+
]);
|
|
27
|
+
function ModalOverlay({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
DialogPrimitive.Overlay,
|
|
30
|
+
{
|
|
31
|
+
"data-slot": "modal-overlay",
|
|
32
|
+
className: cn(modalOverlayVariants(), className),
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
var modalContentVariants = cva([
|
|
38
|
+
"pb-xl",
|
|
39
|
+
"px-xl",
|
|
40
|
+
"bg-bg-primary",
|
|
41
|
+
"rounded-uk-xl",
|
|
42
|
+
"shadow-[0_4px_16px_0_var(--color-shadow-secondary)]",
|
|
43
|
+
"min-w-[280px]",
|
|
44
|
+
"duration-200",
|
|
45
|
+
"transition-all",
|
|
46
|
+
"fixed",
|
|
47
|
+
"translate-x-[-50%]",
|
|
48
|
+
"translate-y-[-50%]",
|
|
49
|
+
"z-101",
|
|
50
|
+
"left-1/2",
|
|
51
|
+
"top-1/2",
|
|
52
|
+
"data-[state=open]:animate-in",
|
|
53
|
+
"data-[state=closed]:animate-out",
|
|
54
|
+
"data-[state=closed]:fade-out-0",
|
|
55
|
+
"data-[state=open]:fade-in-0",
|
|
56
|
+
"data-[state=closed]:zoom-out-95",
|
|
57
|
+
"data-[state=open]:zoom-in-95",
|
|
58
|
+
"liquid:liquid-bg"
|
|
59
|
+
]);
|
|
60
|
+
function ModalContent({
|
|
61
|
+
className,
|
|
62
|
+
children,
|
|
63
|
+
showCloseButton = true,
|
|
64
|
+
...props
|
|
65
|
+
}) {
|
|
66
|
+
return /* @__PURE__ */ jsxs(ModalPortal, { children: [
|
|
67
|
+
/* @__PURE__ */ jsx(ModalOverlay, {}),
|
|
68
|
+
/* @__PURE__ */ jsxs(
|
|
69
|
+
DialogPrimitive.Content,
|
|
70
|
+
{
|
|
71
|
+
"data-slot": "modal-content",
|
|
72
|
+
className: cn(modalContentVariants(), className),
|
|
73
|
+
...props,
|
|
74
|
+
children: [
|
|
75
|
+
children,
|
|
76
|
+
showCloseButton && /* @__PURE__ */ jsxs(
|
|
77
|
+
DialogPrimitive.Close,
|
|
78
|
+
{
|
|
79
|
+
"data-slot": "modal-close",
|
|
80
|
+
className: cn(
|
|
81
|
+
"absolute",
|
|
82
|
+
"right-[16px]",
|
|
83
|
+
"top-[16px]",
|
|
84
|
+
"w-[16px]",
|
|
85
|
+
"h-[16px]",
|
|
86
|
+
"rounded-uk-sm",
|
|
87
|
+
"cursor-pointer",
|
|
88
|
+
"hover:text-icon-highlight",
|
|
89
|
+
"text-icon-primary",
|
|
90
|
+
"flex",
|
|
91
|
+
"items-center",
|
|
92
|
+
"justify-center"
|
|
93
|
+
),
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsx(XIcon, {}),
|
|
96
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
function ModalHeader({ className, ...props }) {
|
|
106
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "modal-header", className: cn("flex flex-col", className), ...props });
|
|
107
|
+
}
|
|
108
|
+
function ModalTitle({ className, ...props }) {
|
|
109
|
+
return /* @__PURE__ */ jsx(
|
|
110
|
+
DialogPrimitive.Title,
|
|
111
|
+
{
|
|
112
|
+
"data-slot": "modal-title",
|
|
113
|
+
className: cn(
|
|
114
|
+
"text-text-highlight",
|
|
115
|
+
"text-uk-lg",
|
|
116
|
+
"leading-uk-lg",
|
|
117
|
+
"font-medium",
|
|
118
|
+
"py-lg",
|
|
119
|
+
"px-xl",
|
|
120
|
+
"text-center",
|
|
121
|
+
className
|
|
122
|
+
),
|
|
123
|
+
...props
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
function ModalDescription({ className, ...props }) {
|
|
128
|
+
return /* @__PURE__ */ jsx(
|
|
129
|
+
DialogPrimitive.Description,
|
|
130
|
+
{
|
|
131
|
+
"data-slot": "modal-description",
|
|
132
|
+
className: cn("text-text-primary", "text-uk-md", "leading-uk-md", "text-start", className),
|
|
133
|
+
...props
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
function ModalFooter({ className, ...props }) {
|
|
138
|
+
return /* @__PURE__ */ jsx(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
"data-slot": "modal-footer",
|
|
142
|
+
className: cn("w-full", "flex", "justify-end", "gap-xs", className),
|
|
143
|
+
...props
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export { Modal, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger };
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkWJ7T7FAH_js = require('./chunk-WJ7T7FAH.js');
|
|
4
|
+
var chunkXXWQ4RVP_js = require('./chunk-XXWQ4RVP.js');
|
|
5
|
+
var lucideReact = require('lucide-react');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function TreeView({
|
|
10
|
+
data,
|
|
11
|
+
getIcon,
|
|
12
|
+
onVisibleDataChange,
|
|
13
|
+
onItemHover,
|
|
14
|
+
className,
|
|
15
|
+
hoveredId
|
|
16
|
+
}) {
|
|
17
|
+
const [expandedItems, setExpandedItems] = react.useState(() => {
|
|
18
|
+
const initial = /* @__PURE__ */ new Set();
|
|
19
|
+
data.forEach((item) => {
|
|
20
|
+
if (item.isCollapsible) initial.add(item.id);
|
|
21
|
+
});
|
|
22
|
+
return initial;
|
|
23
|
+
});
|
|
24
|
+
const [searchQuery, setSearchQuery] = react.useState("");
|
|
25
|
+
const [isCaseSensitive, setIsCaseSensitive] = react.useState(false);
|
|
26
|
+
const [isRegex, setIsRegex] = react.useState(false);
|
|
27
|
+
const [isRegexValid, setIsRegexValid] = react.useState(true);
|
|
28
|
+
const toggleItem = (id) => {
|
|
29
|
+
setExpandedItems((prev) => {
|
|
30
|
+
const newSet = new Set(prev);
|
|
31
|
+
if (newSet.has(id)) {
|
|
32
|
+
newSet.delete(id);
|
|
33
|
+
} else {
|
|
34
|
+
newSet.add(id);
|
|
35
|
+
}
|
|
36
|
+
return newSet;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
const childrenMap = react.useMemo(() => {
|
|
40
|
+
const map = /* @__PURE__ */ new Map();
|
|
41
|
+
data.forEach((item) => {
|
|
42
|
+
if (!map.has(item.parentId)) {
|
|
43
|
+
map.set(item.parentId, []);
|
|
44
|
+
}
|
|
45
|
+
map.get(item.parentId).push(item);
|
|
46
|
+
});
|
|
47
|
+
return map;
|
|
48
|
+
}, [data]);
|
|
49
|
+
const dataWithMeta = react.useMemo(() => {
|
|
50
|
+
const dataMap = new Map(data.map((item) => [item.id, item]));
|
|
51
|
+
const getAncestors = (item) => {
|
|
52
|
+
const ancestors = [];
|
|
53
|
+
let current = item.parentId;
|
|
54
|
+
while (current) {
|
|
55
|
+
const parent = dataMap.get(current);
|
|
56
|
+
if (parent) {
|
|
57
|
+
ancestors.unshift(parent);
|
|
58
|
+
current = parent.parentId;
|
|
59
|
+
} else {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return ancestors;
|
|
64
|
+
};
|
|
65
|
+
return data.map((item) => {
|
|
66
|
+
const siblings = childrenMap.get(item.parentId) || [];
|
|
67
|
+
const isLast = siblings.length > 0 && siblings[siblings.length - 1].id === item.id;
|
|
68
|
+
const ancestors = getAncestors(item);
|
|
69
|
+
const indent = ancestors.length;
|
|
70
|
+
return { ...item, indent, isLast, ancestors };
|
|
71
|
+
});
|
|
72
|
+
}, [data, childrenMap]);
|
|
73
|
+
const visibleData = react.useMemo(() => {
|
|
74
|
+
const dataMap = new Map(data.map((item) => [item.id, item]));
|
|
75
|
+
if (!searchQuery) {
|
|
76
|
+
const isVisible = (item) => {
|
|
77
|
+
return item.ancestors.every((ancestor) => expandedItems.has(ancestor.id));
|
|
78
|
+
};
|
|
79
|
+
return dataWithMeta.filter(isVisible);
|
|
80
|
+
}
|
|
81
|
+
const matchingAndAncestorIds = /* @__PURE__ */ new Set();
|
|
82
|
+
let regex = null;
|
|
83
|
+
if (isRegex) {
|
|
84
|
+
try {
|
|
85
|
+
regex = new RegExp(searchQuery, isCaseSensitive ? "" : "i");
|
|
86
|
+
if (!isRegexValid) setIsRegexValid(true);
|
|
87
|
+
} catch {
|
|
88
|
+
if (isRegexValid) setIsRegexValid(false);
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
data.forEach((item) => {
|
|
93
|
+
let labelMatches = false;
|
|
94
|
+
if (regex) {
|
|
95
|
+
labelMatches = regex.test(item.label);
|
|
96
|
+
} else {
|
|
97
|
+
const source = isCaseSensitive ? item.label : item.label.toLowerCase();
|
|
98
|
+
const query = isCaseSensitive ? searchQuery : searchQuery.toLowerCase();
|
|
99
|
+
labelMatches = source.includes(query);
|
|
100
|
+
}
|
|
101
|
+
if (labelMatches) {
|
|
102
|
+
matchingAndAncestorIds.add(item.id);
|
|
103
|
+
let current = item.parentId;
|
|
104
|
+
while (current) {
|
|
105
|
+
const parent = dataMap.get(current);
|
|
106
|
+
if (parent) {
|
|
107
|
+
matchingAndAncestorIds.add(parent.id);
|
|
108
|
+
current = parent.parentId;
|
|
109
|
+
} else {
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return dataWithMeta.filter((item) => matchingAndAncestorIds.has(item.id));
|
|
116
|
+
}, [searchQuery, dataWithMeta, expandedItems, isCaseSensitive, isRegex, isRegexValid, data]);
|
|
117
|
+
react.useEffect(() => {
|
|
118
|
+
onVisibleDataChange == null ? void 0 : onVisibleDataChange(visibleData);
|
|
119
|
+
}, [visibleData, onVisibleDataChange]);
|
|
120
|
+
const renderLabel = (label) => {
|
|
121
|
+
if (!searchQuery || !isRegexValid) {
|
|
122
|
+
return label;
|
|
123
|
+
}
|
|
124
|
+
let regex;
|
|
125
|
+
try {
|
|
126
|
+
regex = new RegExp(`(${searchQuery})`, isCaseSensitive ? "g" : "gi");
|
|
127
|
+
} catch {
|
|
128
|
+
return label;
|
|
129
|
+
}
|
|
130
|
+
const parts = label.split(regex);
|
|
131
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: parts.map(
|
|
132
|
+
(part, i) => i % 2 === 1 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-uk-xs bg-yellow-300 dark:bg-yellow-700", children: part }, i) : part
|
|
133
|
+
) });
|
|
134
|
+
};
|
|
135
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkXXWQ4RVP_js.cn("border-line-secondary/20 flex flex-col", className), children: [
|
|
136
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-line-secondary/20 flex h-[32px] shrink-0 items-center gap-1 border-b px-2", children: [
|
|
137
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "text-text-secondary size-4" }),
|
|
138
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
139
|
+
"input",
|
|
140
|
+
{
|
|
141
|
+
type: "text",
|
|
142
|
+
placeholder: "Search...",
|
|
143
|
+
className: chunkXXWQ4RVP_js.cn(
|
|
144
|
+
"text-uk-md w-full bg-transparent focus:outline-none",
|
|
145
|
+
!isRegexValid && "text-red-500"
|
|
146
|
+
),
|
|
147
|
+
value: searchQuery,
|
|
148
|
+
onChange: (e) => setSearchQuery(e.target.value)
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkWJ7T7FAH_js.TooltipProvider, { delayDuration: 200, children: [
|
|
152
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkWJ7T7FAH_js.Tooltip, { children: [
|
|
153
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWJ7T7FAH_js.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
154
|
+
"button",
|
|
155
|
+
{
|
|
156
|
+
onClick: () => setIsCaseSensitive((prev) => !prev),
|
|
157
|
+
className: chunkXXWQ4RVP_js.cn("rounded-uk-sm p-1", isCaseSensitive && "bg-bg-tertiary"),
|
|
158
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CaseSensitive, { className: "size-4" })
|
|
159
|
+
}
|
|
160
|
+
) }),
|
|
161
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWJ7T7FAH_js.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Case Sensitive" }) })
|
|
162
|
+
] }),
|
|
163
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkWJ7T7FAH_js.Tooltip, { children: [
|
|
164
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWJ7T7FAH_js.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
165
|
+
"button",
|
|
166
|
+
{
|
|
167
|
+
onClick: () => setIsRegex((prev) => !prev),
|
|
168
|
+
className: chunkXXWQ4RVP_js.cn("rounded-uk-sm p-1", isRegex && "bg-bg-tertiary"),
|
|
169
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Regex, { className: "size-4" })
|
|
170
|
+
}
|
|
171
|
+
) }),
|
|
172
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWJ7T7FAH_js.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Use Regular Expression" }) })
|
|
173
|
+
] })
|
|
174
|
+
] })
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto", children: visibleData.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
className: chunkXXWQ4RVP_js.cn(
|
|
180
|
+
"group relative flex h-[32px] cursor-pointer items-center",
|
|
181
|
+
hoveredId === item.id && "bg-bg-secondary/80"
|
|
182
|
+
),
|
|
183
|
+
onMouseEnter: () => onItemHover == null ? void 0 : onItemHover(item.id),
|
|
184
|
+
onMouseLeave: () => onItemHover == null ? void 0 : onItemHover(null),
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-0 left-[-0.28rem] z-0 flex h-full items-center", children: [
|
|
187
|
+
item.ancestors.map((ancestor, index) => {
|
|
188
|
+
var _a;
|
|
189
|
+
const parentIsLast = (_a = dataWithMeta.find((d) => d.id === ancestor.id)) == null ? void 0 : _a.isLast;
|
|
190
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
191
|
+
"div",
|
|
192
|
+
{
|
|
193
|
+
className: chunkXXWQ4RVP_js.cn(
|
|
194
|
+
"h-full w-[1.25rem]",
|
|
195
|
+
parentIsLast ? "" : "border-l",
|
|
196
|
+
"border-line-secondary/20"
|
|
197
|
+
)
|
|
198
|
+
},
|
|
199
|
+
index
|
|
200
|
+
);
|
|
201
|
+
}),
|
|
202
|
+
item.indent > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-full w-[1.24rem]", children: [
|
|
203
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
204
|
+
"div",
|
|
205
|
+
{
|
|
206
|
+
className: chunkXXWQ4RVP_js.cn(
|
|
207
|
+
"absolute top-0 left-0 h-1/2 w-1/2 border-b border-l",
|
|
208
|
+
item.isLast ? "rounded-bl-md" : "",
|
|
209
|
+
"border-line-secondary/20"
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
!item.isLast && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-line-secondary/20 absolute top-1/2 left-0 h-1/2 w-1/2 border-l" })
|
|
214
|
+
] })
|
|
215
|
+
] }),
|
|
216
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
217
|
+
"div",
|
|
218
|
+
{
|
|
219
|
+
className: "text-uk-md z-10 flex w-full items-center gap-2 px-2 whitespace-nowrap",
|
|
220
|
+
style: { paddingLeft: `${item.indent * 1.25 + 0.5}rem` },
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex size-4 items-center justify-center", children: [
|
|
223
|
+
item.isCollapsible && /* @__PURE__ */ jsxRuntime.jsx(
|
|
224
|
+
"button",
|
|
225
|
+
{
|
|
226
|
+
onClick: () => toggleItem(item.id),
|
|
227
|
+
className: "absolute z-20 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",
|
|
228
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
229
|
+
lucideReact.ChevronDown,
|
|
230
|
+
{
|
|
231
|
+
className: chunkXXWQ4RVP_js.cn(
|
|
232
|
+
"size-4 transition-transform",
|
|
233
|
+
!expandedItems.has(item.id) && "-rotate-90"
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
240
|
+
"div",
|
|
241
|
+
{
|
|
242
|
+
className: chunkXXWQ4RVP_js.cn(
|
|
243
|
+
"transition-opacity",
|
|
244
|
+
item.isCollapsible && "group-hover:opacity-0"
|
|
245
|
+
),
|
|
246
|
+
children: getIcon(item)
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
] }),
|
|
250
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: renderLabel(item.label) })
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
item.id
|
|
257
|
+
)) })
|
|
258
|
+
] });
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
exports.TreeView = TreeView;
|