@vuer-ai/vuer-uikit 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -0
- package/dist/chunk-25GQKTNF.mjs +105 -0
- package/dist/chunk-277NQUJD.js +99 -0
- package/dist/chunk-3FR3WKI4.mjs +24 -0
- package/dist/chunk-3Q75Z2CT.mjs +76 -0
- package/dist/chunk-5BIQ3IN7.js +93 -0
- package/dist/chunk-5GPQ7U5B.mjs +50 -0
- package/dist/chunk-66JQXJEV.mjs +272 -0
- package/dist/chunk-6ILSFDR5.mjs +161 -0
- package/dist/chunk-6L4KPPOD.mjs +90 -0
- package/dist/chunk-75QDQ67T.js +56 -0
- package/dist/chunk-7A7VNE3J.mjs +31 -0
- package/dist/chunk-7SXCVFSA.mjs +200 -0
- package/dist/chunk-7V4ELMOH.js +52 -0
- package/dist/chunk-7WUQTWQX.js +303 -0
- package/dist/chunk-A2Z57NAA.js +202 -0
- package/dist/chunk-ATDHGFVI.mjs +82 -0
- package/dist/chunk-ATEHWT2R.mjs +78 -0
- package/dist/chunk-B5EMQBVL.js +93 -0
- package/dist/chunk-CLTLT5XW.js +27 -0
- package/dist/chunk-COFRS37Z.mjs +337 -0
- package/dist/chunk-CP7QYV4N.mjs +110 -0
- package/dist/chunk-CZSRIDXN.mjs +165 -0
- package/dist/chunk-D4C5V4EN.mjs +53 -0
- package/dist/chunk-DWIK2CUV.mjs +45 -0
- package/dist/chunk-ECWCQWV5.js +148 -0
- package/dist/chunk-ENZI5WM7.js +108 -0
- package/dist/chunk-FVT46HEE.js +21 -0
- package/dist/chunk-FXIL4NQZ.js +58 -0
- package/dist/chunk-FYS6YECN.js +33 -0
- package/dist/chunk-G7XNQVPB.js +187 -0
- package/dist/chunk-GSXXTAQ3.js +373 -0
- package/dist/chunk-HUQZOPYD.js +2 -0
- package/dist/chunk-HW6SLBO3.mjs +9 -0
- package/dist/chunk-IPKCIMU4.mjs +156 -0
- package/dist/chunk-J7PTSP4Q.mjs +19 -0
- package/dist/chunk-KJ42IGH6.js +2 -0
- package/dist/chunk-KO7BQ6RR.js +83 -0
- package/dist/chunk-KQHNQQUZ.js +103 -0
- package/dist/chunk-KVFK3YC7.js +187 -0
- package/dist/chunk-KYKEJFJT.js +110 -0
- package/dist/chunk-LD7Y34QT.js +79 -0
- package/dist/chunk-LVSI4HYF.mjs +409 -0
- package/dist/chunk-M3KBBKQR.mjs +15 -0
- package/dist/chunk-MASRZTZC.mjs +34 -0
- package/dist/chunk-NN7R5DNL.mjs +119 -0
- package/dist/chunk-OE56M4MX.js +93 -0
- package/dist/chunk-OTDY2E2A.js +163 -0
- package/dist/chunk-PKGNHHWG.mjs +60 -0
- package/dist/chunk-Q3APPCB2.mjs +91 -0
- package/dist/chunk-QOUX33X5.mjs +111 -0
- package/dist/chunk-QS7WS6DD.mjs +1 -0
- package/dist/chunk-QZASHJNJ.js +24 -0
- package/dist/chunk-R6XNT4PN.js +431 -0
- package/dist/chunk-RACVRWME.js +136 -0
- package/dist/chunk-S2F2GRDB.mjs +1 -0
- package/dist/chunk-SI56IQWH.js +102 -0
- package/dist/chunk-ST4P6AN6.js +2 -0
- package/dist/chunk-TOZYLDAL.mjs +72 -0
- package/dist/chunk-UFR656UY.mjs +87 -0
- package/dist/chunk-UWO6RBCE.js +11 -0
- package/dist/chunk-VGCVIHBR.mjs +1 -0
- package/dist/chunk-WOG6UIG5.mjs +71 -0
- package/dist/chunk-X2QENXCS.mjs +54 -0
- package/dist/chunk-XACRGXGF.js +75 -0
- package/dist/chunk-XPNUQSKQ.mjs +94 -0
- package/dist/chunk-YQORMF34.js +110 -0
- package/dist/chunk-Z37VNICQ.js +67 -0
- package/dist/chunk-ZJXBC33M.js +112 -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 +36 -0
- package/dist/highlight-cursor/enhanced-components.mjs +11 -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 +50 -0
- package/dist/highlight-cursor/index.mjs +13 -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 +314 -0
- package/dist/index.d.mts +51 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +425 -6744
- package/dist/index.mjs +34 -0
- package/dist/styles/theme.css +191 -0
- package/dist/styles/theme.d.mts +2 -0
- package/dist/styles/theme.d.ts +2 -0
- package/dist/styles/toast.css +58 -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 +23 -0
- package/dist/ui/avatar.mjs +2 -0
- package/dist/ui/badge.d.mts +14 -0
- package/dist/ui/badge.d.ts +14 -0
- package/dist/ui/badge.js +16 -0
- package/dist/ui/badge.mjs +3 -0
- package/dist/ui/button.d.mts +16 -0
- package/dist/ui/button.d.ts +16 -0
- package/dist/ui/button.js +12 -0
- package/dist/ui/button.mjs +3 -0
- package/dist/ui/card.d.mts +12 -0
- package/dist/ui/card.d.ts +12 -0
- package/dist/ui/card.js +36 -0
- package/dist/ui/card.mjs +3 -0
- package/dist/ui/checkbox.d.mts +11 -0
- package/dist/ui/checkbox.d.ts +11 -0
- package/dist/ui/checkbox.js +12 -0
- package/dist/ui/checkbox.mjs +3 -0
- package/dist/ui/collapsible.d.mts +9 -0
- package/dist/ui/collapsible.d.ts +9 -0
- package/dist/ui/collapsible.js +20 -0
- package/dist/ui/collapsible.mjs +3 -0
- package/dist/ui/dropdown.d.mts +28 -0
- package/dist/ui/dropdown.d.ts +28 -0
- package/dist/ui/dropdown.js +68 -0
- package/dist/ui/dropdown.mjs +3 -0
- package/dist/ui/index.d.mts +44 -0
- package/dist/ui/index.d.ts +44 -0
- package/dist/ui/index.js +398 -0
- package/dist/ui/index.mjs +29 -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 +13 -0
- package/dist/ui/input-numbers.mjs +4 -0
- package/dist/ui/input.d.mts +22 -0
- package/dist/ui/input.d.ts +22 -0
- package/dist/ui/input.js +16 -0
- package/dist/ui/input.mjs +3 -0
- package/dist/ui/layout.d.mts +12 -0
- package/dist/ui/layout.d.ts +12 -0
- package/dist/ui/layout.js +12 -0
- package/dist/ui/layout.mjs +3 -0
- package/dist/ui/modal.d.mts +28 -0
- package/dist/ui/modal.d.ts +28 -0
- package/dist/ui/modal.js +48 -0
- package/dist/ui/modal.mjs +3 -0
- package/dist/ui/popover.d.mts +10 -0
- package/dist/ui/popover.d.ts +10 -0
- package/dist/ui/popover.js +23 -0
- package/dist/ui/popover.mjs +2 -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 +16 -0
- package/dist/ui/radio-group.mjs +3 -0
- package/dist/ui/select.d.mts +28 -0
- package/dist/{types/ui → ui}/select.d.ts +18 -14
- package/dist/ui/select.js +48 -0
- package/dist/ui/select.mjs +3 -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 +12 -0
- package/dist/ui/slider.mjs +3 -0
- package/dist/ui/switch.d.mts +7 -0
- package/dist/ui/switch.d.ts +7 -0
- package/dist/ui/switch.js +12 -0
- package/dist/ui/switch.mjs +3 -0
- package/dist/ui/tabs.d.mts +16 -0
- package/dist/ui/tabs.d.ts +16 -0
- package/dist/ui/tabs.js +25 -0
- package/dist/ui/tabs.mjs +4 -0
- package/dist/ui/textarea.d.mts +16 -0
- package/dist/ui/textarea.d.ts +16 -0
- package/dist/ui/textarea.js +12 -0
- package/dist/ui/textarea.mjs +3 -0
- package/dist/ui/theme-context.d.mts +17 -0
- package/dist/{types/ui → ui}/theme-context.d.ts +5 -3
- package/dist/ui/theme-context.js +14 -0
- package/dist/ui/theme-context.mjs +1 -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 +17 -0
- package/dist/ui/toggle-group.mjs +4 -0
- package/dist/ui/toggle.d.mts +13 -0
- package/dist/ui/toggle.d.ts +13 -0
- package/dist/ui/toggle.js +16 -0
- package/dist/ui/toggle.mjs +3 -0
- package/dist/ui/tooltip.d.mts +10 -0
- package/dist/ui/tooltip.d.ts +10 -0
- package/dist/ui/tooltip.js +23 -0
- package/dist/ui/tooltip.mjs +2 -0
- package/dist/ui/tree-view.d.mts +27 -0
- package/dist/ui/tree-view.d.ts +27 -0
- package/dist/ui/tree-view.js +11 -0
- package/dist/ui/tree-view.mjs +2 -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 +2 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +11 -0
- package/dist/utils/index.mjs +2 -0
- package/package.json +49 -27
- package/dist/index.umd.js +0 -74
- package/dist/types/index.d.ts +0 -4
- package/dist/types/lib/utils.d.ts +0 -2
- package/dist/types/ui/button.d.ts +0 -13
- package/dist/types/ui/input.d.ts +0 -19
- package/dist/vuer-uikit.css +0 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkENZI5WM7_js = require('./chunk-ENZI5WM7.js');
|
|
4
|
+
var chunkUWO6RBCE_js = require('./chunk-UWO6RBCE.js');
|
|
5
|
+
var react$1 = require('@use-gesture/react');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
var getHoverElementAndIndex = (element, inputs) => {
|
|
10
|
+
if (!element) return null;
|
|
11
|
+
const container = element == null ? void 0 : element.closest("[data-input]");
|
|
12
|
+
const currentInput = container == null ? void 0 : container.querySelector("input");
|
|
13
|
+
if (!currentInput) return null;
|
|
14
|
+
return Array.from(inputs.values()).indexOf(currentInput);
|
|
15
|
+
};
|
|
16
|
+
var changeElementsHoverState = (inputs, range, changed) => {
|
|
17
|
+
const [first, last] = range;
|
|
18
|
+
Array.from(inputs.values()).forEach((input, i) => {
|
|
19
|
+
const container = input == null ? void 0 : input.closest("[data-input]");
|
|
20
|
+
if (first === null || last === null) {
|
|
21
|
+
container == null ? void 0 : container.setAttribute("data-hover", "none");
|
|
22
|
+
} else if (i >= Math.min(first, last) && i <= Math.max(first, last)) {
|
|
23
|
+
container == null ? void 0 : container.setAttribute("data-hover", changed !== "none" ? changed : "down");
|
|
24
|
+
} else {
|
|
25
|
+
container == null ? void 0 : container.setAttribute("data-hover", "none");
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var InputNumbers = react.forwardRef(function InputNumbers2({ size, value, onValuesChange, prefix, step = 0.1 }, ref) {
|
|
30
|
+
const inputs = react.useRef(/* @__PURE__ */ new Map());
|
|
31
|
+
const selectRange = react.useRef([null, null]);
|
|
32
|
+
const inputChange = react.useRef(false);
|
|
33
|
+
const stopClick = react.useCallback(() => {
|
|
34
|
+
const stopClick2 = (e) => {
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
document.removeEventListener("click", stopClick2, true);
|
|
38
|
+
};
|
|
39
|
+
document.addEventListener("click", stopClick2, true);
|
|
40
|
+
}, []);
|
|
41
|
+
const bind = react$1.useGesture({
|
|
42
|
+
onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
if (selectRange.current[0] === null) {
|
|
46
|
+
selectRange.current[0] = getHoverElementAndIndex(
|
|
47
|
+
document.elementFromPoint(...initial),
|
|
48
|
+
inputs.current
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
let newMX = memo + dx / 2;
|
|
52
|
+
if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
|
|
53
|
+
const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
|
|
54
|
+
const newValue = value.map((v, i) => {
|
|
55
|
+
const [first, last] = selectRange.current;
|
|
56
|
+
if (first === null || last === null) {
|
|
57
|
+
return v;
|
|
58
|
+
} else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
|
|
59
|
+
return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
|
|
60
|
+
} else {
|
|
61
|
+
return v;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
onValuesChange == null ? void 0 : onValuesChange(newValue);
|
|
65
|
+
newMX = 0;
|
|
66
|
+
inputChange.current = true;
|
|
67
|
+
changeElementsHoverState(inputs.current, selectRange.current, "x");
|
|
68
|
+
stopClick();
|
|
69
|
+
}
|
|
70
|
+
if (!inputChange.current) {
|
|
71
|
+
const currentElement = document.elementFromPoint(...xy);
|
|
72
|
+
const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
|
|
73
|
+
selectRange.current[1] = currentIndex ?? selectRange.current[1];
|
|
74
|
+
changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
|
|
75
|
+
stopClick();
|
|
76
|
+
}
|
|
77
|
+
return newMX;
|
|
78
|
+
},
|
|
79
|
+
onDragEnd: () => {
|
|
80
|
+
selectRange.current = [null, null];
|
|
81
|
+
inputChange.current = false;
|
|
82
|
+
changeElementsHoverState(inputs.current, selectRange.current, "none");
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const valueChangeHandler = react.useCallback(
|
|
86
|
+
(index) => {
|
|
87
|
+
return (e) => {
|
|
88
|
+
const inputValue = e.target.value;
|
|
89
|
+
if (inputValue === "" || !isNaN(Number(inputValue))) {
|
|
90
|
+
const newValue = value.map((v, i) => {
|
|
91
|
+
if (inputValue === "") {
|
|
92
|
+
return "";
|
|
93
|
+
}
|
|
94
|
+
return i === index ? Number(inputValue) : v;
|
|
95
|
+
});
|
|
96
|
+
onValuesChange == null ? void 0 : onValuesChange(newValue);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
[onValuesChange, value]
|
|
101
|
+
);
|
|
102
|
+
if ((value == null ? void 0 : value.length) === 0) {
|
|
103
|
+
throw new Error("`value` cannot be an empty array");
|
|
104
|
+
}
|
|
105
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
ref,
|
|
109
|
+
...bind(),
|
|
110
|
+
className: chunkUWO6RBCE_js.cn("gap-xs flex cursor-crosshair touch-none select-none flex-col"),
|
|
111
|
+
children: value.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
+
chunkENZI5WM7_js.InputRoot,
|
|
113
|
+
{
|
|
114
|
+
ref: (r) => {
|
|
115
|
+
inputs.current.set(index.toString(), r);
|
|
116
|
+
return () => {
|
|
117
|
+
inputs.current.delete(index.toString());
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
size,
|
|
121
|
+
value: item,
|
|
122
|
+
onClick: () => {
|
|
123
|
+
var _a;
|
|
124
|
+
(_a = inputs.current.get(index.toString())) == null ? void 0 : _a.focus();
|
|
125
|
+
},
|
|
126
|
+
onChange: valueChangeHandler(index),
|
|
127
|
+
"data-hover": "none",
|
|
128
|
+
className: chunkUWO6RBCE_js.cn([
|
|
129
|
+
"group/number-input",
|
|
130
|
+
"cursor-crosshair",
|
|
131
|
+
"data-[hover=down]:bg-bg-tertiary",
|
|
132
|
+
"data-[hover=x]:bg-bg-tertiary",
|
|
133
|
+
"data-[hover=y]:bg-bg-tertiary",
|
|
134
|
+
"data-[hover=down]:cursor-move",
|
|
135
|
+
"data-[hover=x]:cursor-col-resize",
|
|
136
|
+
"data-[hover=y]:cursor-row-resize"
|
|
137
|
+
]),
|
|
138
|
+
inputClassName: chunkUWO6RBCE_js.cn([
|
|
139
|
+
"cursor-crosshair",
|
|
140
|
+
"group-data-[hover=down]/number-input:cursor-move",
|
|
141
|
+
"group-data-[hover=x]/number-input:cursor-col-resize",
|
|
142
|
+
"group-data-[hover=y]/number-input:cursor-row-resize"
|
|
143
|
+
]),
|
|
144
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
145
|
+
chunkENZI5WM7_js.InputSlot,
|
|
146
|
+
{
|
|
147
|
+
className: chunkUWO6RBCE_js.cn(
|
|
148
|
+
"cursor-crosshair",
|
|
149
|
+
"group-data-[hover=down]/number-input:cursor-move",
|
|
150
|
+
"group-data-[hover=x]/number-input:cursor-col-resize",
|
|
151
|
+
"group-data-[hover=y]/number-input:cursor-row-resize"
|
|
152
|
+
),
|
|
153
|
+
children: prefix == null ? void 0 : prefix[index]
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
},
|
|
157
|
+
index
|
|
158
|
+
))
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
exports.InputNumbers = InputNumbers;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { cn } from './chunk-HW6SLBO3.mjs';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function RadioGroup({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
RadioGroupPrimitive.Root,
|
|
8
|
+
{
|
|
9
|
+
"data-slot": "radio-group",
|
|
10
|
+
className: cn("grid gap-2", className),
|
|
11
|
+
...props
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
function RadioGroupItem({ className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
RadioGroupPrimitive.Item,
|
|
18
|
+
{
|
|
19
|
+
"data-slot": "radio-group-item",
|
|
20
|
+
className: cn(
|
|
21
|
+
"group",
|
|
22
|
+
"w-[16px]",
|
|
23
|
+
"h-[16px]",
|
|
24
|
+
"rounded-full",
|
|
25
|
+
"border-[1.5px]",
|
|
26
|
+
"border-solid",
|
|
27
|
+
"border-bg-tertiary",
|
|
28
|
+
"data-[state=checked]:border-brand-primary",
|
|
29
|
+
"disabled:cursor-not-allowed",
|
|
30
|
+
"disabled:bg-bg-secondary",
|
|
31
|
+
"disabled:data-[state=checked]:border-bg-tertiary",
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
...props,
|
|
35
|
+
children: /* @__PURE__ */ jsx(
|
|
36
|
+
RadioGroupPrimitive.Indicator,
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "radio-group-indicator",
|
|
39
|
+
className: "relative flex items-center justify-center",
|
|
40
|
+
children: /* @__PURE__ */ jsx(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: cn(
|
|
44
|
+
"absolute",
|
|
45
|
+
"inset-0",
|
|
46
|
+
"m-auto",
|
|
47
|
+
"size-[8px]",
|
|
48
|
+
"rounded-full",
|
|
49
|
+
"bg-brand-primary",
|
|
50
|
+
"group-disabled:bg-bg-tertiary"
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { cn } from './chunk-HW6SLBO3.mjs';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var buttonVariants = cva(
|
|
8
|
+
[
|
|
9
|
+
"inline-flex",
|
|
10
|
+
"items-center",
|
|
11
|
+
"justify-center",
|
|
12
|
+
"shrink-0",
|
|
13
|
+
"whitespace-nowrap",
|
|
14
|
+
"rounded-uk-sm",
|
|
15
|
+
"font-medium",
|
|
16
|
+
"transition-all",
|
|
17
|
+
"[&_svg]:shrink-0 ",
|
|
18
|
+
"[&_svg]:pointer-events-none",
|
|
19
|
+
"outline-none",
|
|
20
|
+
"disabled:pointer-events-none",
|
|
21
|
+
"disabled:bg-bg-tertiary",
|
|
22
|
+
"disabled:text-text-tertiary",
|
|
23
|
+
"focus-visible:border-ring",
|
|
24
|
+
"focus-visible:ring-ring/50",
|
|
25
|
+
"focus-visible:ring-[3px]",
|
|
26
|
+
"focus-visible:bg-brand-tertiary",
|
|
27
|
+
"aria-invalid:ring-destructive/20",
|
|
28
|
+
"aria-invalid:border-destructive"
|
|
29
|
+
],
|
|
30
|
+
{
|
|
31
|
+
variants: {
|
|
32
|
+
variant: {
|
|
33
|
+
primary: [
|
|
34
|
+
"bg-brand-primary",
|
|
35
|
+
"text-text-withbg",
|
|
36
|
+
"hover:bg-brand-secondary",
|
|
37
|
+
"active:bg-brand-tertiary"
|
|
38
|
+
],
|
|
39
|
+
secondary: [
|
|
40
|
+
"bg-bg-secondary",
|
|
41
|
+
"text-text-highlight",
|
|
42
|
+
"hover:bg-bg-quaternary",
|
|
43
|
+
"active:bg-bg-tertiary"
|
|
44
|
+
],
|
|
45
|
+
destructive: [
|
|
46
|
+
"bg-danger-primary",
|
|
47
|
+
"text-text-withbg",
|
|
48
|
+
"hover:bg-danger-secondary",
|
|
49
|
+
"active:bg-danger-tertiary"
|
|
50
|
+
],
|
|
51
|
+
ghost: [
|
|
52
|
+
"text-text-primary",
|
|
53
|
+
"hover:bg-bg-tertiary",
|
|
54
|
+
"hover:text-text-secondary",
|
|
55
|
+
"active:bg-bg-secondary"
|
|
56
|
+
],
|
|
57
|
+
link: ["text-text-primary", "underline-offset-4", "hover:underline"]
|
|
58
|
+
},
|
|
59
|
+
size: {
|
|
60
|
+
sm: ["text-xs", "h-5.5", "gap-xxs", "px-md", "[&_svg:not([class*='size-'])]:size-3"],
|
|
61
|
+
base: ["text-xs", "h-7 ", "gap-xs", " px-lg", "[&_svg:not([class*='size-'])]:size-3.5"],
|
|
62
|
+
lg: ["text-sm", "h-8", " gap-xs", "px-xl", "[&_svg:not([class*='size-'])]:size-4"]
|
|
63
|
+
},
|
|
64
|
+
icon: { false: null, true: null }
|
|
65
|
+
},
|
|
66
|
+
compoundVariants: [
|
|
67
|
+
{ size: "sm", icon: true, class: ["px-xs", "py-xs", " size-5.5"] },
|
|
68
|
+
{ size: "base", icon: true, class: ["px-sm", "py-sm", "size-7"] },
|
|
69
|
+
{ size: "lg", icon: true, class: ["px-md", "py-md", " size-8"] }
|
|
70
|
+
],
|
|
71
|
+
defaultVariants: {
|
|
72
|
+
variant: "primary",
|
|
73
|
+
size: "base",
|
|
74
|
+
icon: false
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
var Button = forwardRef(function Button2({ className, variant, size, icon, asChild = false, ...props }, ref) {
|
|
79
|
+
const Comp = asChild ? Slot : "button";
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
Comp,
|
|
82
|
+
{
|
|
83
|
+
ref,
|
|
84
|
+
"data-slot": "button",
|
|
85
|
+
className: cn(buttonVariants({ variant, size, icon, className })),
|
|
86
|
+
...props
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export { Button };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useTabsCursor, TabsCursorProvider } from './chunk-6L4KPPOD.mjs';
|
|
2
|
+
import { cn } from './chunk-HW6SLBO3.mjs';
|
|
3
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { createContext, useContext } from 'react';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var TabsContext = createContext(void 0);
|
|
9
|
+
var useTabsContext = () => {
|
|
10
|
+
const context = useContext(TabsContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error("Tabs components must be used within a Tabs component");
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
};
|
|
16
|
+
function Tabs({ className, size = "base", ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(TabsContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx(
|
|
18
|
+
TabsPrimitive.Root,
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "tabs",
|
|
21
|
+
className: cn("flex w-full flex-col gap-2", className),
|
|
22
|
+
...props
|
|
23
|
+
}
|
|
24
|
+
) });
|
|
25
|
+
}
|
|
26
|
+
var tabsListVariants = cva(["inline-flex", "items-center", "justify-center"], {
|
|
27
|
+
variants: {
|
|
28
|
+
size: {
|
|
29
|
+
sm: "p-0.5 gap-0.5",
|
|
30
|
+
base: "p-1 gap-1",
|
|
31
|
+
lg: "p-1.5 gap-1.5"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
size: "base"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
function TabsList({ className, ...props }) {
|
|
39
|
+
const { setCursorTarget } = useTabsCursor();
|
|
40
|
+
const { size } = useTabsContext();
|
|
41
|
+
return /* @__PURE__ */ jsx(TabsCursorProvider, { children: /* @__PURE__ */ jsx(
|
|
42
|
+
TabsPrimitive.List,
|
|
43
|
+
{
|
|
44
|
+
onMouseLeave: () => setCursorTarget(null),
|
|
45
|
+
"data-slot": "tabs-list",
|
|
46
|
+
className: cn(tabsListVariants({ size }), "justify-start", className),
|
|
47
|
+
...props
|
|
48
|
+
}
|
|
49
|
+
) });
|
|
50
|
+
}
|
|
51
|
+
var tabsTriggerVariants = cva(
|
|
52
|
+
[
|
|
53
|
+
"inline-flex",
|
|
54
|
+
"items-center",
|
|
55
|
+
"justify-center",
|
|
56
|
+
"whitespace-nowrap",
|
|
57
|
+
"text-sm",
|
|
58
|
+
"font-medium",
|
|
59
|
+
"transition-all",
|
|
60
|
+
"disabled:pointer-events-none",
|
|
61
|
+
"disabled:bg-bg-tertiary",
|
|
62
|
+
"[&_svg]:pointer-events-none",
|
|
63
|
+
"[&_svg:not([class*='size-'])]:size-xl",
|
|
64
|
+
"shrink-0",
|
|
65
|
+
"[&_svg]:shrink-0",
|
|
66
|
+
"outline-none",
|
|
67
|
+
"focus-visible:border-ring",
|
|
68
|
+
"focus-visible:ring-ring/50",
|
|
69
|
+
"focus-visible:ring-[3px]",
|
|
70
|
+
"text-text-secondary",
|
|
71
|
+
"data-[state=active]:text-text-highlight",
|
|
72
|
+
"data-[state=active]:bg-bg-secondary"
|
|
73
|
+
],
|
|
74
|
+
{
|
|
75
|
+
variants: {
|
|
76
|
+
size: {
|
|
77
|
+
sm: "text-[11px] h-[22px] gap-xs px-md py-xs rounded-sm",
|
|
78
|
+
base: "text-[12px] h-[28px] gap-sm px-lg py-sm rounded-md",
|
|
79
|
+
lg: "text-[14px] h-[32px] gap-md px-xl py-sm rounded-md"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
defaultVariants: {
|
|
83
|
+
size: "base"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
function TabsTrigger({ className, ...props }) {
|
|
88
|
+
const { setCursorTarget } = useTabsCursor();
|
|
89
|
+
const { size } = useTabsContext();
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
91
|
+
TabsPrimitive.Trigger,
|
|
92
|
+
{
|
|
93
|
+
onMouseEnter: (e) => setCursorTarget(e.currentTarget),
|
|
94
|
+
"data-slot": "tabs-trigger",
|
|
95
|
+
className: cn(tabsTriggerVariants({ size }), className),
|
|
96
|
+
...props
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
function TabsContent({ className, ...props }) {
|
|
101
|
+
return /* @__PURE__ */ jsx(
|
|
102
|
+
TabsPrimitive.Content,
|
|
103
|
+
{
|
|
104
|
+
"data-slot": "tabs-content",
|
|
105
|
+
className: cn("mt-2 flex-1 outline-none", className),
|
|
106
|
+
...props
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var sonner = require('sonner');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
// src/ui/toast.tsx
|
|
7
|
+
var Toaster = ({ ...props }) => {
|
|
8
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
|
+
sonner.Toaster,
|
|
10
|
+
{
|
|
11
|
+
toastOptions: {
|
|
12
|
+
className: "vk-toast liquid:liquid-bg",
|
|
13
|
+
descriptionClassName: "vk-toast-description"
|
|
14
|
+
},
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
Object.defineProperty(exports, "toast", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return sonner.toast; }
|
|
23
|
+
});
|
|
24
|
+
exports.Toaster = Toaster;
|