@la-batcave/ui 3.1.2
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 +95 -0
- package/dist/Alert.d.ts +27 -0
- package/dist/Alert.js +56 -0
- package/dist/Avatar.d.ts +20 -0
- package/dist/Avatar.js +40 -0
- package/dist/Badge.d.ts +56 -0
- package/dist/Badge.js +74 -0
- package/dist/Button.d.ts +53 -0
- package/dist/Button.js +66 -0
- package/dist/Card.d.ts +18 -0
- package/dist/Card.js +98 -0
- package/dist/CodeBlock.d.ts +45 -0
- package/dist/CodeBlock.js +306 -0
- package/dist/Collapse.d.ts +58 -0
- package/dist/Collapse.js +89 -0
- package/dist/Combobox.d.ts +44 -0
- package/dist/Combobox.js +409 -0
- package/dist/DarkMode.d.ts +59 -0
- package/dist/DarkMode.js +56 -0
- package/dist/DatePicker.d.ts +48 -0
- package/dist/DatePicker.js +2954 -0
- package/dist/Dialog.d.ts +119 -0
- package/dist/Dialog.js +337 -0
- package/dist/Drawer.d.ts +28 -0
- package/dist/Drawer.js +1126 -0
- package/dist/Dropdown.d.ts +23 -0
- package/dist/Dropdown.js +247 -0
- package/dist/EasyForm.d.ts +138 -0
- package/dist/EasyForm.js +286 -0
- package/dist/HoverCard.d.ts +10 -0
- package/dist/HoverCard.js +195 -0
- package/dist/Input.d.ts +230 -0
- package/dist/Input.js +2216 -0
- package/dist/LogViewer.d.ts +57 -0
- package/dist/LogViewer.js +120 -0
- package/dist/Menubar.d.ts +32 -0
- package/dist/Menubar.js +398 -0
- package/dist/Navbar.d.ts +20 -0
- package/dist/Navbar.js +31 -0
- package/dist/Pagination.d.ts +78 -0
- package/dist/Pagination.js +106 -0
- package/dist/Popover.d.ts +11 -0
- package/dist/Popover.js +28 -0
- package/dist/ProgressBar.d.ts +35 -0
- package/dist/ProgressBar.js +210 -0
- package/dist/Resizable.d.ts +23 -0
- package/dist/Resizable.js +1532 -0
- package/dist/Separator.d.ts +4 -0
- package/dist/Separator.js +46 -0
- package/dist/Sheet.d.ts +29 -0
- package/dist/Sheet.js +104 -0
- package/dist/Sidebar.d.ts +117 -0
- package/dist/Sidebar.js +237 -0
- package/dist/Skeleton.d.ts +57 -0
- package/dist/Skeleton.js +47 -0
- package/dist/Table.d.ts +71 -0
- package/dist/Table.js +94 -0
- package/dist/Tabs.d.ts +76 -0
- package/dist/Tabs.js +202 -0
- package/dist/Toast.d.ts +54 -0
- package/dist/Toast.js +827 -0
- package/dist/Tooltip.d.ts +29 -0
- package/dist/Tooltip.js +352 -0
- package/dist/Typography.d.ts +101 -0
- package/dist/Typography.js +123 -0
- package/dist/Widget.d.ts +133 -0
- package/dist/Widget.js +207 -0
- package/dist/_shared/Combination-D_l4PLF_.js +676 -0
- package/dist/_shared/index-B03TCNO5.js +142 -0
- package/dist/_shared/index-B1f-hyuh.js +31 -0
- package/dist/_shared/index-BC7vfx-u.js +13 -0
- package/dist/_shared/index-BrLJJgkl.js +67 -0
- package/dist/_shared/index-C0gNQvxa.js +269 -0
- package/dist/_shared/index-C3aZemLI.js +268 -0
- package/dist/_shared/index-CXeb1OMI.js +198 -0
- package/dist/_shared/index-CukUn3R0.js +626 -0
- package/dist/_shared/index-DLcqcWxM.js +29 -0
- package/dist/_shared/index-DlSuDb9N.js +283 -0
- package/dist/_shared/index-V-Ajw7Ac.js +79 -0
- package/dist/_shared/index-uPOYJZpG.js +34 -0
- package/dist/_shared/index-uu9PT5Nu.js +1588 -0
- package/dist/_shared/utils-eGXXUFl7.js +2935 -0
- package/dist/backgrounds/Aurora.d.ts +7 -0
- package/dist/backgrounds/Aurora.js +126 -0
- package/dist/backgrounds/Iridescence.d.ts +7 -0
- package/dist/backgrounds/Iridescence.js +77 -0
- package/dist/backgrounds/Lightning.d.ts +8 -0
- package/dist/backgrounds/Lightning.js +75 -0
- package/dist/backgrounds/LiquidChrome.d.ts +9 -0
- package/dist/backgrounds/LiquidChrome.js +89 -0
- package/dist/backgrounds/Particles.d.ts +15 -0
- package/dist/backgrounds/Particles.js +137 -0
- package/dist/backgrounds/PixelSnow.d.ts +9 -0
- package/dist/backgrounds/PixelSnow.js +52 -0
- package/dist/backgrounds/Silk.d.ts +8 -0
- package/dist/backgrounds/Silk.js +92 -0
- package/dist/backgrounds/Squares.d.ts +9 -0
- package/dist/backgrounds/Squares.js +75 -0
- package/dist/backgrounds/Threads.d.ts +7 -0
- package/dist/backgrounds/Threads.js +110 -0
- package/dist/backgrounds/Waves.d.ts +14 -0
- package/dist/backgrounds/Waves.js +139 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +318 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { P as T, c as l, a as k, u as F } from "./_shared/index-CXeb1OMI.js";
|
|
5
|
+
import { u as I } from "./_shared/index-DLcqcWxM.js";
|
|
6
|
+
import { C as U, c as x, R as $, A as W, a as z } from "./_shared/index-uu9PT5Nu.js";
|
|
7
|
+
import { P as B, D as G } from "./_shared/index-B03TCNO5.js";
|
|
8
|
+
import { P as K } from "./_shared/index-V-Ajw7Ac.js";
|
|
9
|
+
import { c as j } from "./_shared/utils-eGXXUFl7.js";
|
|
10
|
+
var E, S = "HoverCard", [O] = k(S, [
|
|
11
|
+
x
|
|
12
|
+
]), b = x(), [V, g] = O(S), y = (e) => {
|
|
13
|
+
const {
|
|
14
|
+
__scopeHoverCard: o,
|
|
15
|
+
children: t,
|
|
16
|
+
open: s,
|
|
17
|
+
defaultOpen: a,
|
|
18
|
+
onOpenChange: c,
|
|
19
|
+
openDelay: f = 700,
|
|
20
|
+
closeDelay: v = 300
|
|
21
|
+
} = e, d = b(o), C = n.useRef(0), u = n.useRef(0), h = n.useRef(!1), p = n.useRef(!1), [m, r] = F({
|
|
22
|
+
prop: s,
|
|
23
|
+
defaultProp: a ?? !1,
|
|
24
|
+
onChange: c,
|
|
25
|
+
caller: S
|
|
26
|
+
}), P = n.useCallback(() => {
|
|
27
|
+
clearTimeout(u.current), C.current = window.setTimeout(() => r(!0), f);
|
|
28
|
+
}, [f, r]), L = n.useCallback(() => {
|
|
29
|
+
clearTimeout(C.current), !h.current && !p.current && (u.current = window.setTimeout(() => r(!1), v));
|
|
30
|
+
}, [v, r]), M = n.useCallback(() => r(!1), [r]);
|
|
31
|
+
return n.useEffect(() => () => {
|
|
32
|
+
clearTimeout(C.current), clearTimeout(u.current);
|
|
33
|
+
}, []), /* @__PURE__ */ i(
|
|
34
|
+
V,
|
|
35
|
+
{
|
|
36
|
+
scope: o,
|
|
37
|
+
open: m,
|
|
38
|
+
onOpenChange: r,
|
|
39
|
+
onOpen: P,
|
|
40
|
+
onClose: L,
|
|
41
|
+
onDismiss: M,
|
|
42
|
+
hasSelectionRef: h,
|
|
43
|
+
isPointerDownOnContentRef: p,
|
|
44
|
+
children: /* @__PURE__ */ i($, { ...d, children: t })
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
y.displayName = S;
|
|
49
|
+
var N = "HoverCardTrigger", _ = n.forwardRef(
|
|
50
|
+
(e, o) => {
|
|
51
|
+
const { __scopeHoverCard: t, ...s } = e, a = g(N, t), c = b(t);
|
|
52
|
+
return /* @__PURE__ */ i(W, { asChild: !0, ...c, children: /* @__PURE__ */ i(
|
|
53
|
+
K.a,
|
|
54
|
+
{
|
|
55
|
+
"data-state": a.open ? "open" : "closed",
|
|
56
|
+
...s,
|
|
57
|
+
ref: o,
|
|
58
|
+
onPointerEnter: l(e.onPointerEnter, w(a.onOpen)),
|
|
59
|
+
onPointerLeave: l(e.onPointerLeave, w(a.onClose)),
|
|
60
|
+
onFocus: l(e.onFocus, a.onOpen),
|
|
61
|
+
onBlur: l(e.onBlur, a.onClose),
|
|
62
|
+
onTouchStart: l(e.onTouchStart, (f) => f.preventDefault())
|
|
63
|
+
}
|
|
64
|
+
) });
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
_.displayName = N;
|
|
68
|
+
var H = "HoverCardPortal", [q, J] = O(H, {
|
|
69
|
+
forceMount: void 0
|
|
70
|
+
}), D = (e) => {
|
|
71
|
+
const { __scopeHoverCard: o, forceMount: t, children: s, container: a } = e, c = g(H, o);
|
|
72
|
+
return /* @__PURE__ */ i(q, { scope: o, forceMount: t, children: /* @__PURE__ */ i(T, { present: t || c.open, children: /* @__PURE__ */ i(B, { asChild: !0, container: a, children: s }) }) });
|
|
73
|
+
};
|
|
74
|
+
D.displayName = H;
|
|
75
|
+
var R = "HoverCardContent", A = n.forwardRef(
|
|
76
|
+
(e, o) => {
|
|
77
|
+
const t = J(R, e.__scopeHoverCard), { forceMount: s = t.forceMount, ...a } = e, c = g(R, e.__scopeHoverCard);
|
|
78
|
+
return /* @__PURE__ */ i(T, { present: s || c.open, children: /* @__PURE__ */ i(
|
|
79
|
+
Q,
|
|
80
|
+
{
|
|
81
|
+
"data-state": c.open ? "open" : "closed",
|
|
82
|
+
...a,
|
|
83
|
+
onPointerEnter: l(e.onPointerEnter, w(c.onOpen)),
|
|
84
|
+
onPointerLeave: l(e.onPointerLeave, w(c.onClose)),
|
|
85
|
+
ref: o
|
|
86
|
+
}
|
|
87
|
+
) });
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
A.displayName = R;
|
|
91
|
+
var Q = n.forwardRef((e, o) => {
|
|
92
|
+
const {
|
|
93
|
+
__scopeHoverCard: t,
|
|
94
|
+
onEscapeKeyDown: s,
|
|
95
|
+
onPointerDownOutside: a,
|
|
96
|
+
onFocusOutside: c,
|
|
97
|
+
onInteractOutside: f,
|
|
98
|
+
...v
|
|
99
|
+
} = e, d = g(R, t), C = b(t), u = n.useRef(null), h = I(o, u), [p, m] = n.useState(!1);
|
|
100
|
+
return n.useEffect(() => {
|
|
101
|
+
if (p) {
|
|
102
|
+
const r = document.body;
|
|
103
|
+
return E = r.style.userSelect || r.style.webkitUserSelect, r.style.userSelect = "none", r.style.webkitUserSelect = "none", () => {
|
|
104
|
+
r.style.userSelect = E, r.style.webkitUserSelect = E;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}, [p]), n.useEffect(() => {
|
|
108
|
+
if (u.current) {
|
|
109
|
+
const r = () => {
|
|
110
|
+
m(!1), d.isPointerDownOnContentRef.current = !1, setTimeout(() => {
|
|
111
|
+
document.getSelection()?.toString() !== "" && (d.hasSelectionRef.current = !0);
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
return document.addEventListener("pointerup", r), () => {
|
|
115
|
+
document.removeEventListener("pointerup", r), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !1;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}, [d.isPointerDownOnContentRef, d.hasSelectionRef]), n.useEffect(() => {
|
|
119
|
+
u.current && Z(u.current).forEach((P) => P.setAttribute("tabindex", "-1"));
|
|
120
|
+
}), /* @__PURE__ */ i(
|
|
121
|
+
G,
|
|
122
|
+
{
|
|
123
|
+
asChild: !0,
|
|
124
|
+
disableOutsidePointerEvents: !1,
|
|
125
|
+
onInteractOutside: f,
|
|
126
|
+
onEscapeKeyDown: s,
|
|
127
|
+
onPointerDownOutside: a,
|
|
128
|
+
onFocusOutside: l(c, (r) => {
|
|
129
|
+
r.preventDefault();
|
|
130
|
+
}),
|
|
131
|
+
onDismiss: d.onDismiss,
|
|
132
|
+
children: /* @__PURE__ */ i(
|
|
133
|
+
U,
|
|
134
|
+
{
|
|
135
|
+
...C,
|
|
136
|
+
...v,
|
|
137
|
+
onPointerDown: l(v.onPointerDown, (r) => {
|
|
138
|
+
r.currentTarget.contains(r.target) && m(!0), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !0;
|
|
139
|
+
}),
|
|
140
|
+
ref: h,
|
|
141
|
+
style: {
|
|
142
|
+
...v.style,
|
|
143
|
+
userSelect: p ? "text" : void 0,
|
|
144
|
+
// Safari requires prefix
|
|
145
|
+
WebkitUserSelect: p ? "text" : void 0,
|
|
146
|
+
"--radix-hover-card-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
147
|
+
"--radix-hover-card-content-available-width": "var(--radix-popper-available-width)",
|
|
148
|
+
"--radix-hover-card-content-available-height": "var(--radix-popper-available-height)",
|
|
149
|
+
"--radix-hover-card-trigger-width": "var(--radix-popper-anchor-width)",
|
|
150
|
+
"--radix-hover-card-trigger-height": "var(--radix-popper-anchor-height)"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}), X = "HoverCardArrow", Y = n.forwardRef(
|
|
157
|
+
(e, o) => {
|
|
158
|
+
const { __scopeHoverCard: t, ...s } = e, a = b(t);
|
|
159
|
+
return /* @__PURE__ */ i(z, { ...a, ...s, ref: o });
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
Y.displayName = X;
|
|
163
|
+
function w(e) {
|
|
164
|
+
return (o) => o.pointerType === "touch" ? void 0 : e();
|
|
165
|
+
}
|
|
166
|
+
function Z(e) {
|
|
167
|
+
const o = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
168
|
+
acceptNode: (s) => s.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
169
|
+
});
|
|
170
|
+
for (; t.nextNode(); ) o.push(t.currentNode);
|
|
171
|
+
return o;
|
|
172
|
+
}
|
|
173
|
+
var ee = y, re = _, oe = D, te = A;
|
|
174
|
+
const pe = ee, fe = re, ne = n.forwardRef(({ className: e, align: o = "center", sideOffset: t = 4, container: s, ...a }, c) => /* @__PURE__ */ i(oe, { container: s, children: /* @__PURE__ */ i(
|
|
175
|
+
te,
|
|
176
|
+
{
|
|
177
|
+
ref: c,
|
|
178
|
+
align: o,
|
|
179
|
+
sideOffset: t,
|
|
180
|
+
className: j(
|
|
181
|
+
"z-50 bg-card border border-border rounded-lg shadow-lg p-4 w-64",
|
|
182
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
183
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
184
|
+
"outline-none",
|
|
185
|
+
e
|
|
186
|
+
),
|
|
187
|
+
...a
|
|
188
|
+
}
|
|
189
|
+
) }));
|
|
190
|
+
ne.displayName = "HoverCardContent";
|
|
191
|
+
export {
|
|
192
|
+
pe as HoverCard,
|
|
193
|
+
ne as HoverCardContent,
|
|
194
|
+
fe as HoverCardTrigger
|
|
195
|
+
};
|
package/dist/Input.d.ts
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
3
|
+
}
|
|
4
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'suffix'> {
|
|
5
|
+
/** Optional label text displayed above the input. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Error message displayed below the input. When set, the input border turns red. */
|
|
8
|
+
error?: React.ReactNode;
|
|
9
|
+
/** Icon component rendered inside the input. @default positioned left */
|
|
10
|
+
icon?: React.ComponentType<{
|
|
11
|
+
size?: number;
|
|
12
|
+
className?: string;
|
|
13
|
+
}>;
|
|
14
|
+
/** Side of the input where the icon is rendered. @default "left" */
|
|
15
|
+
iconPosition?: 'left' | 'right';
|
|
16
|
+
/** ReactNode rendered inside the input on the left (e.g. currency symbol). */
|
|
17
|
+
prefix?: React.ReactNode;
|
|
18
|
+
/** ReactNode rendered inside the input on the right (e.g. unit label). */
|
|
19
|
+
suffix?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export interface SelectProps {
|
|
22
|
+
/** Optional label text displayed above the select. */
|
|
23
|
+
label?: string;
|
|
24
|
+
/** Placeholder text shown when no value is selected. */
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/** Controlled value. */
|
|
27
|
+
value?: string;
|
|
28
|
+
/** Default value for uncontrolled usage. */
|
|
29
|
+
defaultValue?: string;
|
|
30
|
+
/** Callback fired when the selected value changes. */
|
|
31
|
+
onValueChange?: (value: string) => void;
|
|
32
|
+
/** Whether the select is disabled. */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Render a native `<select>` element instead of Radix UI.
|
|
36
|
+
* When true, children should be `<option>` and `<optgroup>` elements.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
native?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Show a clear button (X) when a value is selected.
|
|
42
|
+
* Calls onValueChange("") to reset.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
clearable?: boolean;
|
|
46
|
+
/** Additional CSS classes for the trigger. */
|
|
47
|
+
className?: string;
|
|
48
|
+
children?: React.ReactNode;
|
|
49
|
+
}
|
|
50
|
+
export interface SelectItemProps {
|
|
51
|
+
/** The value submitted when this item is selected. */
|
|
52
|
+
value: string;
|
|
53
|
+
/** Whether this item is disabled. */
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
/** Additional CSS classes. */
|
|
56
|
+
className?: string;
|
|
57
|
+
children?: React.ReactNode;
|
|
58
|
+
}
|
|
59
|
+
export interface SelectGroupProps {
|
|
60
|
+
/** Optional group label displayed above the items. */
|
|
61
|
+
label?: string;
|
|
62
|
+
children?: React.ReactNode;
|
|
63
|
+
}
|
|
64
|
+
export interface ToggleProps {
|
|
65
|
+
/** Optional label text displayed next to the switch. */
|
|
66
|
+
label?: string;
|
|
67
|
+
/** Optional description text displayed below the label. */
|
|
68
|
+
description?: string;
|
|
69
|
+
/** Controlled checked state. */
|
|
70
|
+
checked?: boolean;
|
|
71
|
+
/** Callback fired when the toggle state changes. */
|
|
72
|
+
onChange?: (checked: boolean) => void;
|
|
73
|
+
/** Whether the toggle is disabled. */
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
/** Side where the label is rendered. @default "right" */
|
|
76
|
+
labelPosition?: 'left' | 'right';
|
|
77
|
+
/** Additional CSS classes. */
|
|
78
|
+
className?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface CheckboxProps {
|
|
81
|
+
/** Optional label text displayed next to the checkbox. */
|
|
82
|
+
label?: string;
|
|
83
|
+
/** Optional description text displayed below the label. */
|
|
84
|
+
description?: string;
|
|
85
|
+
/** Controlled checked state. */
|
|
86
|
+
checked?: boolean;
|
|
87
|
+
/** Callback fired when the checkbox state changes. */
|
|
88
|
+
onChange?: (checked: boolean) => void;
|
|
89
|
+
/** Whether the checkbox is disabled. */
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
/** Side where the label is rendered. @default "right" */
|
|
92
|
+
labelPosition?: 'left' | 'right';
|
|
93
|
+
/** Additional CSS classes. */
|
|
94
|
+
className?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface RadioGroupProps {
|
|
97
|
+
/** Optional label text displayed above the radio group. */
|
|
98
|
+
label?: string;
|
|
99
|
+
/** Controlled value of the selected radio item. */
|
|
100
|
+
value?: string;
|
|
101
|
+
/** Callback fired when the selected value changes. */
|
|
102
|
+
onValueChange?: (value: string) => void;
|
|
103
|
+
/** Whether the entire group is disabled. */
|
|
104
|
+
disabled?: boolean;
|
|
105
|
+
/** Additional CSS classes. */
|
|
106
|
+
className?: string;
|
|
107
|
+
children?: React.ReactNode;
|
|
108
|
+
}
|
|
109
|
+
export interface RadioGroupItemProps {
|
|
110
|
+
/** The value submitted when this item is selected. */
|
|
111
|
+
value: string;
|
|
112
|
+
/** Label text displayed next to the radio. */
|
|
113
|
+
label?: string;
|
|
114
|
+
/** Optional description text displayed below the label. */
|
|
115
|
+
description?: string;
|
|
116
|
+
/** Whether this item is disabled. */
|
|
117
|
+
disabled?: boolean;
|
|
118
|
+
/** Additional CSS classes. */
|
|
119
|
+
className?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface SliderProps {
|
|
122
|
+
/** Optional label text displayed above the slider. */
|
|
123
|
+
label?: string;
|
|
124
|
+
/** Controlled value. Array for single or range slider. */
|
|
125
|
+
value?: number[];
|
|
126
|
+
/** Callback fired when the value changes. */
|
|
127
|
+
onValueChange?: (value: number[]) => void;
|
|
128
|
+
/** Minimum value. @default 0 */
|
|
129
|
+
min?: number;
|
|
130
|
+
/** Maximum value. @default 100 */
|
|
131
|
+
max?: number;
|
|
132
|
+
/** Step increment. @default 1 */
|
|
133
|
+
step?: number;
|
|
134
|
+
/** Whether the slider is disabled. */
|
|
135
|
+
disabled?: boolean;
|
|
136
|
+
/** Format function for displayed values. Receives the number, returns a string. @default String */
|
|
137
|
+
renderValue?: (value: number) => string;
|
|
138
|
+
/** Additional CSS classes. */
|
|
139
|
+
className?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'prefix'> {
|
|
142
|
+
/** Optional label text displayed above the textarea. */
|
|
143
|
+
label?: string;
|
|
144
|
+
/** Error message displayed below the textarea. When set, the border turns red. */
|
|
145
|
+
error?: React.ReactNode;
|
|
146
|
+
/** Icon component rendered inside the textarea container. @default positioned left */
|
|
147
|
+
icon?: React.ComponentType<{
|
|
148
|
+
size?: number;
|
|
149
|
+
className?: string;
|
|
150
|
+
}>;
|
|
151
|
+
/** Side of the textarea where the icon is rendered. @default "left" */
|
|
152
|
+
iconPosition?: 'left' | 'right';
|
|
153
|
+
/** ReactNode rendered inside the container on the left (e.g. label prefix). */
|
|
154
|
+
prefix?: React.ReactNode;
|
|
155
|
+
/** ReactNode rendered inside the container on the right. */
|
|
156
|
+
suffix?: React.ReactNode;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Styled form label with uppercase tracking and muted foreground color.
|
|
160
|
+
* Built on Radix UI Label primitive.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* <Label htmlFor="email">Email address</Label>
|
|
164
|
+
*/
|
|
165
|
+
declare function Label({ className, ...props }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
166
|
+
/**
|
|
167
|
+
* Text input field with optional label, icon, prefix/suffix, and error message.
|
|
168
|
+
* When `type="password"`, an eye toggle is automatically added on the right.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* <Input label="Email" placeholder="you@example.com" icon={Mail} />
|
|
172
|
+
*/
|
|
173
|
+
declare function Input({ label, error, icon: Icon, iconPosition, prefix, suffix, className, type, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
174
|
+
/**
|
|
175
|
+
* Select dropdown built on Radix UI Select. Styled to match the Input component.
|
|
176
|
+
* Use `SelectItem` for options and `SelectGroup` for grouped options.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* <Select label="Instance Type" placeholder="Selectionner...">
|
|
180
|
+
* <SelectItem value="docker">Docker</SelectItem>
|
|
181
|
+
* <SelectItem value="totanus">Totanus</SelectItem>
|
|
182
|
+
* </Select>
|
|
183
|
+
*/
|
|
184
|
+
declare function Select({ label, placeholder, children, className, native, clearable, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
185
|
+
/** Individual option inside a Select dropdown. */
|
|
186
|
+
declare function SelectItem({ children, className, ...props }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
187
|
+
/** Group of SelectItem options with an optional label. */
|
|
188
|
+
declare function SelectGroup({ children, label, ...props }: SelectGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
189
|
+
/**
|
|
190
|
+
* Toggle switch built on Radix UI Switch primitive with optional label and description.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* <Toggle label="Dark mode" checked={isDark} onChange={setIsDark} />
|
|
194
|
+
*/
|
|
195
|
+
declare function Toggle({ label, description, checked, onChange, disabled, labelPosition, className }: ToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
196
|
+
/**
|
|
197
|
+
* Checkbox built on Radix UI Checkbox primitive with optional label and description.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* <Checkbox label="Accept terms" checked={accepted} onChange={setAccepted} />
|
|
201
|
+
*/
|
|
202
|
+
declare function Checkbox({ label, description, checked, onChange, disabled, labelPosition, className }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
203
|
+
/**
|
|
204
|
+
* Radio group built on Radix UI RadioGroup primitive.
|
|
205
|
+
* Use with RadioGroupItem children.
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* <RadioGroup label="Plan" value={plan} onValueChange={setPlan}>
|
|
209
|
+
* <RadioGroupItem value="free" label="Free" />
|
|
210
|
+
* <RadioGroupItem value="pro" label="Pro" description="All features included" />
|
|
211
|
+
* </RadioGroup>
|
|
212
|
+
*/
|
|
213
|
+
declare function RadioGroup({ label, value, onValueChange, disabled, className, children }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
214
|
+
/** Individual radio option inside a RadioGroup. */
|
|
215
|
+
declare function RadioGroupItem({ value, label, description, disabled, className }: RadioGroupItemProps): import("react/jsx-runtime").JSX.Element;
|
|
216
|
+
/**
|
|
217
|
+
* Slider built on Radix UI Slider primitive with optional label and value display.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* <Slider label="Volume" value={[75]} onValueChange={setVolume} />
|
|
221
|
+
*/
|
|
222
|
+
declare function Slider({ label, value, onValueChange, min, max, step, disabled, renderValue, className, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
223
|
+
/**
|
|
224
|
+
* Resizable textarea with optional label, icon, prefix/suffix, and error message.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* <Textarea label="Description" placeholder="Enter details..." />
|
|
228
|
+
*/
|
|
229
|
+
declare function Textarea({ label, error, icon: Icon, iconPosition, prefix, suffix, className, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
230
|
+
export { Label, Input, Select, SelectItem, SelectGroup, Toggle, Checkbox, RadioGroup, RadioGroupItem, Slider, Textarea };
|