@classytic/fluid 0.2.4 → 0.3.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/LICENSE +21 -0
- package/README.md +149 -62
- package/dist/api-pagination-CJ0vR_w6.d.mts +34 -0
- package/dist/api-pagination-DBTE0yk4.mjs +190 -0
- package/dist/chunk-DQk6qfdC.mjs +18 -0
- package/dist/client/calendar.d.mts +105 -0
- package/dist/client/calendar.mjs +202 -0
- package/dist/client/core.d.mts +1614 -0
- package/dist/client/core.mjs +2779 -0
- package/dist/client/error.d.mts +125 -0
- package/dist/client/error.mjs +166 -0
- package/dist/client/hooks.d.mts +162 -0
- package/dist/client/hooks.mjs +447 -0
- package/dist/client/table.d.mts +84 -0
- package/dist/client/table.mjs +373 -0
- package/dist/client/theme.d.mts +6 -0
- package/dist/client/theme.mjs +65 -0
- package/dist/command.d.mts +134 -0
- package/dist/command.mjs +132 -0
- package/dist/compact.d.mts +359 -0
- package/dist/compact.mjs +892 -0
- package/dist/dashboard.d.mts +778 -0
- package/dist/dashboard.mjs +1617 -0
- package/dist/filter-utils-DqMmy_v-.mjs +72 -0
- package/dist/filter-utils-IZ0GtuPo.d.mts +40 -0
- package/dist/forms.d.mts +1549 -0
- package/dist/forms.mjs +3740 -0
- package/dist/index.d.mts +296 -0
- package/dist/index.mjs +432 -0
- package/dist/layouts.d.mts +215 -0
- package/dist/layouts.mjs +460 -0
- package/dist/search-context-DR7DBs7S.mjs +19 -0
- package/dist/search.d.mts +254 -0
- package/dist/search.mjs +523 -0
- package/dist/sheet-wrapper-CWNCvYMD.mjs +211 -0
- package/dist/use-base-search-BGgWnWaF.d.mts +35 -0
- package/dist/use-debounce-xmZucz5e.mjs +53 -0
- package/dist/use-keyboard-shortcut-Bl6YM5Q7.mjs +82 -0
- package/dist/use-keyboard-shortcut-_mRCh3QO.d.mts +24 -0
- package/dist/use-media-query-BnVNIKT4.mjs +17 -0
- package/dist/use-mobile-BX3SQVo2.mjs +20 -0
- package/dist/use-scroll-detection-CsgsQYvy.mjs +43 -0
- package/dist/utils-CDue7cEt.d.mts +6 -0
- package/dist/utils-DQ5SCVoW.mjs +10 -0
- package/package.json +85 -45
- package/styles.css +2 -2
- package/dist/chunk-GUHK2DTW.js +0 -15
- package/dist/chunk-GUHK2DTW.js.map +0 -1
- package/dist/chunk-H3NFL3GJ.js +0 -57
- package/dist/chunk-H3NFL3GJ.js.map +0 -1
- package/dist/chunk-J2YRTQE4.js +0 -293
- package/dist/chunk-J2YRTQE4.js.map +0 -1
- package/dist/compact.d.ts +0 -217
- package/dist/compact.js +0 -986
- package/dist/compact.js.map +0 -1
- package/dist/dashboard.d.ts +0 -387
- package/dist/dashboard.js +0 -1032
- package/dist/dashboard.js.map +0 -1
- package/dist/index.d.ts +0 -2140
- package/dist/index.js +0 -6422
- package/dist/index.js.map +0 -1
- package/dist/layout.d.ts +0 -25
- package/dist/layout.js +0 -4
- package/dist/layout.js.map +0 -1
- package/dist/search.d.ts +0 -172
- package/dist/search.js +0 -341
- package/dist/search.js.map +0 -1
- package/dist/use-base-search-AS5Z3SAy.d.ts +0 -64
- package/dist/utils-Cbsgs0XP.d.ts +0 -5
package/dist/command.mjs
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { t as cn } from "./utils-DQ5SCVoW.mjs";
|
|
4
|
+
import { t as useKeyboardShortcut } from "./use-keyboard-shortcut-Bl6YM5Q7.mjs";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { createContext, useCallback, useContext, useState } from "react";
|
|
7
|
+
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "@/components/ui/command";
|
|
8
|
+
import { Kbd } from "@/components/ui/kbd";
|
|
9
|
+
|
|
10
|
+
//#region src/components/command/command-search.tsx
|
|
11
|
+
const CommandSearchContext = createContext(null);
|
|
12
|
+
/**
|
|
13
|
+
* useCommandSearch — Access command search open/close state.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* const { open, setOpen } = useCommandSearch();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
function useCommandSearch() {
|
|
21
|
+
const ctx = useContext(CommandSearchContext);
|
|
22
|
+
if (!ctx) throw new Error("useCommandSearch must be used within <CommandSearch>");
|
|
23
|
+
return ctx;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* CommandSearch — Command palette dialog with keyboard shortcut.
|
|
27
|
+
* Wraps consumer's @/components/ui/command (Base UI shadcn).
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <CommandSearch shortcut="mod+k">
|
|
32
|
+
* <CommandSearch.Input placeholder="Type a command or search..." />
|
|
33
|
+
* <CommandSearch.List>
|
|
34
|
+
* <CommandSearch.Empty>No results found.</CommandSearch.Empty>
|
|
35
|
+
* <CommandSearch.Group heading="Navigation">
|
|
36
|
+
* <CommandSearch.Item icon={<Home />} shortcut="⌘H" onSelect={() => navigate("/")}>
|
|
37
|
+
* Home
|
|
38
|
+
* </CommandSearch.Item>
|
|
39
|
+
* </CommandSearch.Group>
|
|
40
|
+
* </CommandSearch.List>
|
|
41
|
+
* </CommandSearch>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
function CommandSearchRoot({ children, open: controlledOpen, onOpenChange: controlledOnOpenChange, shortcut = "mod+k", enableShortcut = true, title = "Command Palette", description, className }) {
|
|
45
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
46
|
+
const isControlled = controlledOpen !== void 0;
|
|
47
|
+
const open = isControlled ? controlledOpen : internalOpen;
|
|
48
|
+
const setOpen = useCallback((value) => {
|
|
49
|
+
if (isControlled) controlledOnOpenChange?.(value);
|
|
50
|
+
else setInternalOpen(value);
|
|
51
|
+
}, [isControlled, controlledOnOpenChange]);
|
|
52
|
+
useKeyboardShortcut(shortcut, () => setOpen(!open), {
|
|
53
|
+
enabled: enableShortcut,
|
|
54
|
+
disableInInputs: false
|
|
55
|
+
});
|
|
56
|
+
return /* @__PURE__ */ jsx(CommandSearchContext.Provider, {
|
|
57
|
+
value: {
|
|
58
|
+
open,
|
|
59
|
+
setOpen
|
|
60
|
+
},
|
|
61
|
+
children: /* @__PURE__ */ jsx(CommandDialog, {
|
|
62
|
+
open,
|
|
63
|
+
onOpenChange: setOpen,
|
|
64
|
+
title,
|
|
65
|
+
description,
|
|
66
|
+
className,
|
|
67
|
+
children: /* @__PURE__ */ jsx(Command, { children })
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function CommandSearchInput({ placeholder = "Type a command or search...", className }) {
|
|
72
|
+
return /* @__PURE__ */ jsx(CommandInput, {
|
|
73
|
+
placeholder,
|
|
74
|
+
className
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function CommandSearchList({ children, className }) {
|
|
78
|
+
return /* @__PURE__ */ jsx(CommandList, {
|
|
79
|
+
className,
|
|
80
|
+
children
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function CommandSearchGroup({ heading, children, className }) {
|
|
84
|
+
return /* @__PURE__ */ jsx(CommandGroup, {
|
|
85
|
+
heading,
|
|
86
|
+
className,
|
|
87
|
+
children
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function CommandSearchItemComponent({ children, icon, shortcut: shortcutDisplay, onSelect, value, disabled, className }) {
|
|
91
|
+
const { setOpen } = useCommandSearch();
|
|
92
|
+
return /* @__PURE__ */ jsxs(CommandItem, {
|
|
93
|
+
onSelect: useCallback((val) => {
|
|
94
|
+
onSelect?.(val);
|
|
95
|
+
setOpen(false);
|
|
96
|
+
}, [onSelect, setOpen]),
|
|
97
|
+
value,
|
|
98
|
+
disabled,
|
|
99
|
+
className: cn("gap-2", className),
|
|
100
|
+
children: [
|
|
101
|
+
icon && /* @__PURE__ */ jsx("span", {
|
|
102
|
+
className: "shrink-0",
|
|
103
|
+
children: icon
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ jsx("span", {
|
|
106
|
+
className: "flex-1",
|
|
107
|
+
children
|
|
108
|
+
}),
|
|
109
|
+
shortcutDisplay && /* @__PURE__ */ jsx(Kbd, { children: shortcutDisplay })
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function CommandSearchEmpty({ children = "No results found.", className }) {
|
|
114
|
+
return /* @__PURE__ */ jsx(CommandEmpty, {
|
|
115
|
+
className,
|
|
116
|
+
children
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function CommandSearchSeparator({ className }) {
|
|
120
|
+
return /* @__PURE__ */ jsx(CommandSeparator, { className });
|
|
121
|
+
}
|
|
122
|
+
const CommandSearch = Object.assign(CommandSearchRoot, {
|
|
123
|
+
Input: CommandSearchInput,
|
|
124
|
+
List: CommandSearchList,
|
|
125
|
+
Group: CommandSearchGroup,
|
|
126
|
+
Item: CommandSearchItemComponent,
|
|
127
|
+
Empty: CommandSearchEmpty,
|
|
128
|
+
Separator: CommandSearchSeparator
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
export { CommandSearch, useCommandSearch, useKeyboardShortcut };
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { ChangeEvent, InputHTMLAttributes, ReactNode, Ref, TextareaHTMLAttributes } from "react";
|
|
3
|
+
import { Control, FieldValues, Path } from "react-hook-form";
|
|
4
|
+
|
|
5
|
+
//#region src/components/compact/compact-input.d.ts
|
|
6
|
+
interface CompactInputProps<T extends FieldValues = FieldValues> extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
|
|
7
|
+
control?: Control<T>;
|
|
8
|
+
name?: Path<T>;
|
|
9
|
+
description?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
label?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
type?: string;
|
|
15
|
+
addonLeft?: ReactNode;
|
|
16
|
+
addonRight?: ReactNode;
|
|
17
|
+
inputClassName?: string;
|
|
18
|
+
onValueChange?: (value: string) => void;
|
|
19
|
+
value?: string;
|
|
20
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
+
error?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* CompactInput - Enhanced form input with InputGroup support
|
|
25
|
+
*
|
|
26
|
+
* Features:
|
|
27
|
+
* - Floating label design
|
|
28
|
+
* - InputGroup support with icons, buttons, and text addons
|
|
29
|
+
* - Controller integration for react-hook-form
|
|
30
|
+
* - Direct usage without form
|
|
31
|
+
*/
|
|
32
|
+
declare function CompactInput<T extends FieldValues = FieldValues>({
|
|
33
|
+
control,
|
|
34
|
+
name,
|
|
35
|
+
description,
|
|
36
|
+
required,
|
|
37
|
+
label,
|
|
38
|
+
placeholder,
|
|
39
|
+
disabled,
|
|
40
|
+
type,
|
|
41
|
+
addonLeft,
|
|
42
|
+
addonRight,
|
|
43
|
+
className,
|
|
44
|
+
inputClassName,
|
|
45
|
+
onValueChange,
|
|
46
|
+
value,
|
|
47
|
+
onChange,
|
|
48
|
+
error,
|
|
49
|
+
autoComplete,
|
|
50
|
+
autoFocus,
|
|
51
|
+
maxLength,
|
|
52
|
+
minLength,
|
|
53
|
+
max,
|
|
54
|
+
min,
|
|
55
|
+
pattern,
|
|
56
|
+
readOnly,
|
|
57
|
+
step,
|
|
58
|
+
inputMode,
|
|
59
|
+
enterKeyHint,
|
|
60
|
+
ref,
|
|
61
|
+
...props
|
|
62
|
+
}: CompactInputProps<T> & {
|
|
63
|
+
ref?: Ref<HTMLInputElement>;
|
|
64
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/components/compact/compact-textarea.d.ts
|
|
67
|
+
interface CompactTextareaProps<T extends FieldValues = FieldValues> extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange"> {
|
|
68
|
+
control?: Control<T>;
|
|
69
|
+
name?: Path<T>;
|
|
70
|
+
description?: string;
|
|
71
|
+
required?: boolean;
|
|
72
|
+
label?: string;
|
|
73
|
+
placeholder?: string;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
rows?: number;
|
|
76
|
+
addonLeft?: ReactNode;
|
|
77
|
+
addonRight?: ReactNode;
|
|
78
|
+
inputClassName?: string;
|
|
79
|
+
onValueChange?: (value: string) => void;
|
|
80
|
+
value?: string;
|
|
81
|
+
onChange?: (e: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
82
|
+
error?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* CompactTextarea - Enhanced textarea with InputGroup support
|
|
86
|
+
*
|
|
87
|
+
* Features:
|
|
88
|
+
* - Floating label design
|
|
89
|
+
* - InputGroup support with addons
|
|
90
|
+
* - Character counter with maxLength
|
|
91
|
+
* - Controller integration for react-hook-form
|
|
92
|
+
* - Direct usage without form
|
|
93
|
+
*/
|
|
94
|
+
declare function CompactTextarea<T extends FieldValues = FieldValues>({
|
|
95
|
+
control,
|
|
96
|
+
name,
|
|
97
|
+
description,
|
|
98
|
+
required,
|
|
99
|
+
label,
|
|
100
|
+
placeholder,
|
|
101
|
+
disabled,
|
|
102
|
+
rows,
|
|
103
|
+
addonLeft,
|
|
104
|
+
addonRight,
|
|
105
|
+
className,
|
|
106
|
+
inputClassName,
|
|
107
|
+
onValueChange,
|
|
108
|
+
value,
|
|
109
|
+
onChange,
|
|
110
|
+
error,
|
|
111
|
+
cols,
|
|
112
|
+
wrap,
|
|
113
|
+
autoComplete,
|
|
114
|
+
autoFocus,
|
|
115
|
+
maxLength,
|
|
116
|
+
minLength,
|
|
117
|
+
readOnly,
|
|
118
|
+
spellCheck,
|
|
119
|
+
ref,
|
|
120
|
+
...props
|
|
121
|
+
}: CompactTextareaProps<T> & {
|
|
122
|
+
ref?: Ref<HTMLTextAreaElement>;
|
|
123
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/components/compact/compact-select.d.ts
|
|
126
|
+
interface SelectOption {
|
|
127
|
+
value: string;
|
|
128
|
+
label: string;
|
|
129
|
+
}
|
|
130
|
+
interface CompactSelectProps<T extends FieldValues = FieldValues> {
|
|
131
|
+
control?: Control<T>;
|
|
132
|
+
name?: Path<T>;
|
|
133
|
+
description?: string;
|
|
134
|
+
required?: boolean;
|
|
135
|
+
label?: string;
|
|
136
|
+
placeholder?: string;
|
|
137
|
+
disabled?: boolean;
|
|
138
|
+
items?: SelectOption[];
|
|
139
|
+
className?: string;
|
|
140
|
+
onValueChange?: (value: string) => void;
|
|
141
|
+
value?: string;
|
|
142
|
+
error?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* CompactSelect - Simple, clean select dropdown
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* <CompactSelect
|
|
149
|
+
* label="Status"
|
|
150
|
+
* items={[
|
|
151
|
+
* { value: "active", label: "Active" },
|
|
152
|
+
* { value: "inactive", label: "Inactive" }
|
|
153
|
+
* ]}
|
|
154
|
+
* />
|
|
155
|
+
*/
|
|
156
|
+
declare function CompactSelect<T extends FieldValues = FieldValues>({
|
|
157
|
+
control,
|
|
158
|
+
name,
|
|
159
|
+
description,
|
|
160
|
+
required,
|
|
161
|
+
label,
|
|
162
|
+
placeholder,
|
|
163
|
+
disabled,
|
|
164
|
+
items,
|
|
165
|
+
className,
|
|
166
|
+
onValueChange,
|
|
167
|
+
value,
|
|
168
|
+
error,
|
|
169
|
+
ref,
|
|
170
|
+
...props
|
|
171
|
+
}: CompactSelectProps<T> & {
|
|
172
|
+
ref?: Ref<HTMLButtonElement>;
|
|
173
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/components/compact/compact-number-input.d.ts
|
|
176
|
+
interface CompactNumberInputProps<T extends FieldValues = FieldValues> {
|
|
177
|
+
control?: Control<T>;
|
|
178
|
+
name?: Path<T>;
|
|
179
|
+
description?: string;
|
|
180
|
+
required?: boolean;
|
|
181
|
+
label?: string;
|
|
182
|
+
placeholder?: string;
|
|
183
|
+
disabled?: boolean;
|
|
184
|
+
min?: number;
|
|
185
|
+
max?: number;
|
|
186
|
+
step?: number;
|
|
187
|
+
prefix?: ReactNode;
|
|
188
|
+
suffix?: ReactNode;
|
|
189
|
+
showButtons?: boolean;
|
|
190
|
+
buttonVariant?: "ghost" | "outline" | "default";
|
|
191
|
+
className?: string;
|
|
192
|
+
inputClassName?: string;
|
|
193
|
+
labelClassName?: string;
|
|
194
|
+
containerClassName?: string;
|
|
195
|
+
onValueChange?: (value: number | string) => void;
|
|
196
|
+
value?: number | string;
|
|
197
|
+
defaultValue?: number | string;
|
|
198
|
+
onChange?: (value: number | string) => void;
|
|
199
|
+
error?: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* CompactNumberInput - A space-efficient number input with optional increment/decrement buttons
|
|
203
|
+
*
|
|
204
|
+
* Features:
|
|
205
|
+
* - Floating label design
|
|
206
|
+
* - Optional increment/decrement buttons
|
|
207
|
+
* - Support for min/max/step values
|
|
208
|
+
* - Prefix/suffix support
|
|
209
|
+
* - Form integration via control prop
|
|
210
|
+
* - Direct usage without form
|
|
211
|
+
*/
|
|
212
|
+
declare function CompactNumberInput<T extends FieldValues = FieldValues>({
|
|
213
|
+
control,
|
|
214
|
+
name,
|
|
215
|
+
description,
|
|
216
|
+
required,
|
|
217
|
+
label,
|
|
218
|
+
placeholder,
|
|
219
|
+
disabled,
|
|
220
|
+
min,
|
|
221
|
+
max,
|
|
222
|
+
step,
|
|
223
|
+
prefix,
|
|
224
|
+
suffix,
|
|
225
|
+
showButtons,
|
|
226
|
+
buttonVariant,
|
|
227
|
+
className,
|
|
228
|
+
inputClassName,
|
|
229
|
+
labelClassName,
|
|
230
|
+
containerClassName,
|
|
231
|
+
onValueChange,
|
|
232
|
+
value,
|
|
233
|
+
defaultValue,
|
|
234
|
+
onChange,
|
|
235
|
+
error,
|
|
236
|
+
ref,
|
|
237
|
+
...props
|
|
238
|
+
}: CompactNumberInputProps<T> & {
|
|
239
|
+
ref?: Ref<HTMLInputElement>;
|
|
240
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region src/components/compact/compact-tag-choice.d.ts
|
|
243
|
+
interface Choice {
|
|
244
|
+
value: string;
|
|
245
|
+
label: string;
|
|
246
|
+
}
|
|
247
|
+
interface CompactTagChoiceProps<T extends FieldValues = FieldValues> {
|
|
248
|
+
control?: Control<T>;
|
|
249
|
+
name?: Path<T>;
|
|
250
|
+
label?: string;
|
|
251
|
+
description?: string;
|
|
252
|
+
placeholder?: string;
|
|
253
|
+
required?: boolean;
|
|
254
|
+
disabled?: boolean;
|
|
255
|
+
choices?: Choice[];
|
|
256
|
+
maxSelections?: number;
|
|
257
|
+
className?: string;
|
|
258
|
+
containerClassName?: string;
|
|
259
|
+
labelClassName?: string;
|
|
260
|
+
inputClassName?: string;
|
|
261
|
+
value?: string[];
|
|
262
|
+
onChange?: (value: string[]) => void;
|
|
263
|
+
onValueChange?: (value: string[]) => void;
|
|
264
|
+
error?: string;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* CompactTagChoice - A compact tag selection input
|
|
268
|
+
*
|
|
269
|
+
* Features:
|
|
270
|
+
* - Multi-select tag interface
|
|
271
|
+
* - Maximum selection limit
|
|
272
|
+
* - Popover for selecting options
|
|
273
|
+
* - Form integration via control prop
|
|
274
|
+
* - Direct usage without form
|
|
275
|
+
*/
|
|
276
|
+
declare function CompactTagChoice<T extends FieldValues = FieldValues>({
|
|
277
|
+
control,
|
|
278
|
+
name,
|
|
279
|
+
label,
|
|
280
|
+
description,
|
|
281
|
+
placeholder,
|
|
282
|
+
required,
|
|
283
|
+
disabled,
|
|
284
|
+
choices,
|
|
285
|
+
maxSelections,
|
|
286
|
+
className,
|
|
287
|
+
containerClassName,
|
|
288
|
+
labelClassName,
|
|
289
|
+
inputClassName,
|
|
290
|
+
value: propValue,
|
|
291
|
+
onChange: propOnChange,
|
|
292
|
+
onValueChange,
|
|
293
|
+
error,
|
|
294
|
+
ref
|
|
295
|
+
}: CompactTagChoiceProps<T> & {
|
|
296
|
+
ref?: Ref<HTMLDivElement>;
|
|
297
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region src/components/compact/compact-slug-field.d.ts
|
|
300
|
+
/**
|
|
301
|
+
* Generates a URL-friendly slug from a string
|
|
302
|
+
*/
|
|
303
|
+
declare function generateSlug(text: string): string;
|
|
304
|
+
interface CompactSlugFieldProps<T extends FieldValues = FieldValues> {
|
|
305
|
+
control?: Control<T>;
|
|
306
|
+
name?: Path<T>;
|
|
307
|
+
description?: string;
|
|
308
|
+
required?: boolean;
|
|
309
|
+
label?: string;
|
|
310
|
+
placeholder?: string;
|
|
311
|
+
disabled?: boolean;
|
|
312
|
+
icon?: ReactNode;
|
|
313
|
+
sourceValue?: string;
|
|
314
|
+
onGenerate?: (source: string) => string;
|
|
315
|
+
className?: string;
|
|
316
|
+
inputClassName?: string;
|
|
317
|
+
onValueChange?: (value: string) => void;
|
|
318
|
+
value?: string;
|
|
319
|
+
onChange?: (e: ChangeEvent<HTMLInputElement> | {
|
|
320
|
+
target: {
|
|
321
|
+
value: string;
|
|
322
|
+
};
|
|
323
|
+
}) => void;
|
|
324
|
+
error?: string;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* CompactSlugField - Compact slug input with auto-generation
|
|
328
|
+
*
|
|
329
|
+
* Features:
|
|
330
|
+
* - Compact design with floating label
|
|
331
|
+
* - Auto-generate slug from source field
|
|
332
|
+
* - Manual editing support
|
|
333
|
+
* - InputGroup with generate button
|
|
334
|
+
* - Form integration via control prop
|
|
335
|
+
*/
|
|
336
|
+
declare function CompactSlugField<T extends FieldValues = FieldValues>({
|
|
337
|
+
control,
|
|
338
|
+
name,
|
|
339
|
+
description,
|
|
340
|
+
required,
|
|
341
|
+
label,
|
|
342
|
+
placeholder,
|
|
343
|
+
disabled,
|
|
344
|
+
icon,
|
|
345
|
+
sourceValue,
|
|
346
|
+
onGenerate,
|
|
347
|
+
className,
|
|
348
|
+
inputClassName,
|
|
349
|
+
onValueChange,
|
|
350
|
+
value,
|
|
351
|
+
onChange,
|
|
352
|
+
error,
|
|
353
|
+
ref,
|
|
354
|
+
...props
|
|
355
|
+
}: CompactSlugFieldProps<T> & {
|
|
356
|
+
ref?: Ref<HTMLInputElement>;
|
|
357
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
358
|
+
//#endregion
|
|
359
|
+
export { CompactInput, type CompactInputProps, CompactNumberInput, type CompactNumberInputProps, CompactSelect, type CompactSelectProps, CompactSlugField, type CompactSlugFieldProps, CompactTagChoice, type CompactTagChoiceProps, CompactTextarea, type CompactTextareaProps, generateSlug };
|