flufi-ui 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,369 @@
1
+ import * as preact from 'preact';
2
+ import { ComponentChildren, JSX, ComponentChild, ComponentProps, Ref } from 'preact';
3
+ import { Signal } from '@preact/signals';
4
+ import { S as Signalish, O as Option, C as CalendarDate, a as MaybeFunc, F as FileCategory, M as MaybeAsyncFunc, b as MaybeLoaded, c as MimeType } from '../mime-rhdyiokw.js';
5
+ import { C as Comparable, n as nullish } from '../misc-BNzd_rCz.js';
6
+ import { LucideIcon } from 'lucide-preact';
7
+
8
+ type ButtonVariant = "accent" | "accent-subtle" | "danger" | "danger-subtle" | "filled" | "always-transparent" | "panel";
9
+ type ButtonProps = {
10
+ children?: ComponentChildren;
11
+ class?: string;
12
+ variant?: ButtonVariant;
13
+ onClick?: (e: MouseEvent) => void;
14
+ title?: string;
15
+ disabled?: boolean;
16
+ extraPadding?: boolean;
17
+ noPadding?: boolean;
18
+ centered?: boolean;
19
+ role?: JSX.AriaRole;
20
+ tabIndex?: number;
21
+ };
22
+ declare function Button(props: ButtonProps & {
23
+ buttonClass?: string;
24
+ }): JSX.Element;
25
+ declare function TextButton(props: ButtonProps): JSX.Element;
26
+ declare function IconButton(props: ButtonProps): JSX.Element;
27
+ declare function TextIconButton(props: ButtonProps): JSX.Element;
28
+
29
+ type LinkButtonProps = {
30
+ children?: ComponentChildren;
31
+ class?: string;
32
+ variant?: ButtonVariant;
33
+ onClick?: (e: MouseEvent) => void;
34
+ href: string;
35
+ extraPadding?: boolean;
36
+ noPadding?: boolean;
37
+ centered?: boolean;
38
+ role?: JSX.AriaRole;
39
+ tabIndex?: number;
40
+ };
41
+ declare function LinkButton(props: LinkButtonProps & {
42
+ buttonClass?: string;
43
+ }): JSX.Element;
44
+ declare function TextLinkButton(props: LinkButtonProps): JSX.Element;
45
+ declare function IconLinkButton(props: LinkButtonProps): JSX.Element;
46
+ declare function TextIconLinkButton(props: LinkButtonProps): JSX.Element;
47
+
48
+ declare function CalendarInput(props: {
49
+ value?: Signalish<Option<CalendarDate>>;
50
+ onChange?: (value: Option<CalendarDate>) => void;
51
+ dirty?: Signal<boolean>;
52
+ placeholder?: string;
53
+ filter?: "after" | "before";
54
+ class?: string;
55
+ }): preact.JSX.Element;
56
+
57
+ declare function ClickFade(props: {
58
+ faded?: Signalish<boolean>;
59
+ before: MaybeFunc<ComponentChild>;
60
+ after: MaybeFunc<ComponentChild>;
61
+ onFade?: () => void;
62
+ }): preact.JSX.Element;
63
+
64
+ declare function If(props: {
65
+ cond: MaybeFunc<Signalish<any>>;
66
+ children?: MaybeFunc<ComponentChildren>;
67
+ }): ComponentChildren;
68
+ declare function Switch(props: {
69
+ value: MaybeFunc<Signalish<Comparable | nullish>>;
70
+ children?: ComponentChildren;
71
+ }): preact.JSX.Element;
72
+ declare function Case(props: {
73
+ value: Comparable | nullish;
74
+ children?: MaybeFunc<ComponentChildren>;
75
+ }): ComponentChildren;
76
+ declare function Branch(props: {
77
+ cond: MaybeFunc<Signalish<any>>;
78
+ children?: ComponentChildren;
79
+ }): preact.JSX.Element;
80
+ declare function Then(props: {
81
+ children?: MaybeFunc<ComponentChildren>;
82
+ }): ComponentChildren;
83
+ declare function Else(props: {
84
+ children?: MaybeFunc<ComponentChildren>;
85
+ }): ComponentChildren;
86
+
87
+ type ContainerProps = {
88
+ children?: ComponentChildren;
89
+ class?: string;
90
+ horizontal?: boolean;
91
+ vertical?: boolean;
92
+ no_gap?: boolean;
93
+ text_gap?: boolean;
94
+ extra_gap?: boolean;
95
+ centered_x?: boolean;
96
+ centered_y?: boolean;
97
+ box?: boolean;
98
+ wrap?: boolean;
99
+ other?: ComponentProps<any>;
100
+ };
101
+ declare function Container(props: ContainerProps): preact.JSX.Element;
102
+ declare function MainContainer(props: ContainerProps): preact.JSX.Element;
103
+ declare function HeaderContainer(props: ContainerProps): preact.JSX.Element;
104
+ declare function FooterContainer(props: ContainerProps): preact.JSX.Element;
105
+ declare function AsideContainer(props: ContainerProps): preact.JSX.Element;
106
+
107
+ declare function Content(props: {
108
+ class?: string;
109
+ wrapped?: boolean;
110
+ centered?: boolean;
111
+ children?: ComponentChildren;
112
+ }): preact.JSX.Element;
113
+
114
+ type ContextMenuPosition = {
115
+ x: number;
116
+ y: number;
117
+ };
118
+
119
+ type ContextMenuItem = string | (({
120
+ click: (event: MouseEvent) => void;
121
+ } | {
122
+ href: string;
123
+ }) & {
124
+ type: "button";
125
+ label?: ComponentChildren;
126
+ icon?: ComponentChildren;
127
+ disabled?: boolean;
128
+ variant?: ButtonVariant;
129
+ }) | {
130
+ type: "header";
131
+ label: ComponentChildren;
132
+ } | {
133
+ type: "separator";
134
+ };
135
+ declare function closeContextMenu(): void;
136
+ declare function openContextMenu(items: readonly ContextMenuItem[], position?: ContextMenuPosition | MouseEvent): void;
137
+ declare function openContextMenuOn(items: readonly ContextMenuItem[], element: Element): void;
138
+
139
+ declare function DotSeperator(props: {
140
+ noMargin?: boolean;
141
+ containerTextMargin?: boolean;
142
+ }): preact.JSX.Element;
143
+
144
+ declare function getFileIcon(category: FileCategory): LucideIcon;
145
+ declare function FileIcon(props: {
146
+ category: FileCategory;
147
+ size?: number;
148
+ }): preact.JSX.Element;
149
+
150
+ declare function FilePath(props: {
151
+ path: string;
152
+ }): preact.JSX.Element;
153
+
154
+ declare function FormalInput(props: {
155
+ label: string;
156
+ children: ComponentChildren;
157
+ }): preact.JSX.Element;
158
+
159
+ declare function Header1(props: {
160
+ children?: ComponentChildren;
161
+ class?: string;
162
+ underline?: boolean;
163
+ }): preact.JSX.Element;
164
+ declare function Header2(props: {
165
+ children?: ComponentChildren;
166
+ class?: string;
167
+ underline?: boolean;
168
+ }): preact.JSX.Element;
169
+ declare function Header3(props: {
170
+ children?: ComponentChildren;
171
+ class?: string;
172
+ underline?: boolean;
173
+ }): preact.JSX.Element;
174
+ declare function MiniHeader(props: {
175
+ children?: ComponentChildren;
176
+ class?: string;
177
+ dim?: boolean;
178
+ }): preact.JSX.Element;
179
+
180
+ declare function Image(props: {
181
+ src: Signalish<string | Blob | File | nullish>;
182
+ size?: number;
183
+ max_size?: number;
184
+ class?: string;
185
+ lazy?: boolean;
186
+ }): preact.JSX.Element;
187
+
188
+ declare function ImageInput(props: {
189
+ value?: Signalish<File | null>;
190
+ children?: ComponentChildren;
191
+ onInput?: (value: File | null) => void;
192
+ dirty?: Signal<boolean>;
193
+ size?: number;
194
+ width?: number;
195
+ height?: number;
196
+ class?: string;
197
+ }): preact.JSX.Element;
198
+
199
+ declare function Input(props: {
200
+ value?: Signalish<string>;
201
+ inputRef?: Ref<HTMLInputElement>;
202
+ onInput?: (value: string) => void;
203
+ onUnFocus?: (ev: FocusEvent, value: string) => void;
204
+ onEnter?: (value: string) => void;
205
+ dirty?: Signal<boolean>;
206
+ placeholder?: string;
207
+ class?: string;
208
+ }): preact.JSX.Element;
209
+
210
+ declare function Textarea(props: {
211
+ value?: Signalish<string>;
212
+ onInput?: (value: string) => void;
213
+ dirty?: Signal<boolean>;
214
+ rows?: number;
215
+ class?: string;
216
+ }): preact.JSX.Element;
217
+
218
+ declare function Label(props: {
219
+ text: string;
220
+ }): preact.JSX.Element;
221
+
222
+ type Loaded = MaybeAsyncFunc<Signalish<boolean>>;
223
+ declare function Loading(props: {
224
+ loaded: Loaded;
225
+ throbber_size?: number;
226
+ children?: MaybeFunc<ComponentChildren | nullish>;
227
+ class?: string;
228
+ }): string | number | bigint | boolean | object | null;
229
+
230
+ declare function PathInput(props: {
231
+ value?: Signalish<string>;
232
+ editing?: Signal<boolean>;
233
+ onChange?: (value: string) => void;
234
+ dirty?: Signal<boolean>;
235
+ placeholder?: string;
236
+ class?: string;
237
+ }): preact.JSX.Element;
238
+
239
+ type PopoutProps = {
240
+ open?: Signal<boolean>;
241
+ class?: string;
242
+ popoutClass?: string;
243
+ children?: ComponentChildren;
244
+ popout: () => ComponentChild;
245
+ };
246
+ declare function PopoutContainer(props: PopoutProps): preact.JSX.Element;
247
+ type PopoutButtonProps = {
248
+ buttonClass?: string;
249
+ disabled?: boolean;
250
+ extraPadding?: boolean;
251
+ centered?: boolean;
252
+ variant?: ButtonVariant;
253
+ title?: string;
254
+ };
255
+ declare function PopoutTextButton(props: PopoutProps & PopoutButtonProps): preact.JSX.Element;
256
+ declare function PopoutIconButton(props: PopoutProps & PopoutButtonProps): preact.JSX.Element;
257
+ declare function PopoutTextIconButton(props: PopoutProps & PopoutButtonProps): preact.JSX.Element;
258
+
259
+ interface SelectOption<T extends Comparable> {
260
+ value: T;
261
+ label: Signalish<string>;
262
+ }
263
+ interface SelectBoxProps<T extends Comparable> {
264
+ options: Signalish<SelectOption<T>[] | MaybeLoaded<SelectOption<T>[]>>;
265
+ value?: Signalish<Option<T>>;
266
+ onChange?: (value: Option<T>) => void;
267
+ dirty?: Signal<boolean>;
268
+ class?: string;
269
+ flat?: boolean;
270
+ }
271
+ declare function SelectBox<T extends Comparable>(props: SelectBoxProps<T>): preact.JSX.Element;
272
+
273
+ declare function Seperator(): preact.JSX.Element;
274
+
275
+ declare function Slider(props: {
276
+ value?: Signalish<number>;
277
+ dragging?: Signal<boolean>;
278
+ onChange?: (value: number) => void;
279
+ dirty?: Signal<boolean>;
280
+ start?: number;
281
+ end?: number;
282
+ step?: number;
283
+ scroll_speed?: number;
284
+ class?: string;
285
+ }): preact.JSX.Element;
286
+
287
+ declare function Table(props: {
288
+ children?: ComponentChildren;
289
+ class?: string;
290
+ }): preact.JSX.Element;
291
+ declare function TableHead(props: {
292
+ children?: ComponentChildren;
293
+ class?: string;
294
+ }): preact.JSX.Element;
295
+ declare function TableBody(props: {
296
+ children?: ComponentChildren;
297
+ class?: string;
298
+ }): preact.JSX.Element;
299
+ declare function TableRow(props: {
300
+ children?: ComponentChildren;
301
+ class?: string;
302
+ }): preact.JSX.Element;
303
+ declare function TableCell(props: {
304
+ children?: ComponentChildren;
305
+ class?: string;
306
+ }): preact.JSX.Element;
307
+ declare function TableHeader(props: {
308
+ children?: ComponentChildren;
309
+ class?: string;
310
+ }): preact.JSX.Element;
311
+
312
+ type TabsProps<T> = ({
313
+ value: Signalish<T>;
314
+ }) & ({
315
+ onChange?: (val: T) => void;
316
+ dirty?: Signal<boolean>;
317
+ tabs: {
318
+ name: string;
319
+ value: T;
320
+ onClose?: () => void;
321
+ }[];
322
+ });
323
+ declare function Tabs<T extends number | string>(props: TabsProps<T>): preact.JSX.Element;
324
+
325
+ declare function TagList(props: {
326
+ tags: Signalish<string[]>;
327
+ link?: boolean;
328
+ }): preact.JSX.Element;
329
+ declare function Tag(props: {
330
+ tag: string;
331
+ small?: boolean;
332
+ onDelete?: () => void;
333
+ }): preact.JSX.Element;
334
+
335
+ declare function TagListInput(props: {
336
+ value?: Signalish<string[]>;
337
+ onChange?: (tags: string[]) => void;
338
+ dirty?: Signal<boolean>;
339
+ inputPlaceholder?: string;
340
+ class?: string;
341
+ }): preact.JSX.Element;
342
+
343
+ declare function Text(props: {
344
+ content: Signalish<string | number | nullish>;
345
+ class?: string;
346
+ big?: boolean;
347
+ extra_big?: boolean;
348
+ dim?: boolean;
349
+ dark?: boolean;
350
+ selectable?: boolean;
351
+ }): false | preact.JSX.Element;
352
+
353
+ declare function Throbber(props: {
354
+ size?: number;
355
+ }): preact.JSX.Element;
356
+
357
+ declare function UploadBox(props: {
358
+ addFile?: (file: File) => void;
359
+ mime?: MimeType[];
360
+ class?: string;
361
+ children: ComponentChildren;
362
+ }): preact.JSX.Element;
363
+
364
+ declare function WrapList(props: {
365
+ children: ComponentChildren;
366
+ min_size?: number;
367
+ }): preact.JSX.Element;
368
+
369
+ export { AsideContainer, Branch, Button, type ButtonProps, type ButtonVariant, CalendarInput, Case, ClickFade, Container, type ContainerProps, Content, type ContextMenuItem, type ContextMenuPosition, DotSeperator, Else, FileIcon, FilePath, FooterContainer, FormalInput, Header1, Header2, Header3, HeaderContainer, IconButton, IconLinkButton, If, Image, ImageInput, Input, Label, LinkButton, type LinkButtonProps, type Loaded, Loading, MainContainer, MiniHeader, PathInput, type PopoutButtonProps, PopoutContainer, PopoutIconButton, type PopoutProps, PopoutTextButton, PopoutTextIconButton, SelectBox, Seperator, Slider, Switch, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, Tag, TagList, TagListInput, Text, TextButton, TextIconButton, TextIconLinkButton, TextLinkButton, Textarea, Then, Throbber, UploadBox, WrapList, closeContextMenu, getFileIcon, openContextMenu, openContextMenuOn };
@@ -0,0 +1,130 @@
1
+ import {
2
+ AsideContainer,
3
+ Branch,
4
+ Button,
5
+ CalendarInput,
6
+ Case,
7
+ ClickFade,
8
+ Container,
9
+ Content,
10
+ DotSeperator,
11
+ Else,
12
+ FileIcon,
13
+ FilePath,
14
+ FooterContainer,
15
+ FormalInput,
16
+ Header1,
17
+ Header2,
18
+ Header3,
19
+ HeaderContainer,
20
+ IconButton,
21
+ IconLinkButton,
22
+ If,
23
+ Image,
24
+ ImageInput,
25
+ Input,
26
+ Label,
27
+ LinkButton,
28
+ Loading,
29
+ MainContainer,
30
+ MiniHeader,
31
+ PathInput,
32
+ PopoutContainer,
33
+ PopoutIconButton,
34
+ PopoutTextButton,
35
+ PopoutTextIconButton,
36
+ SelectBox,
37
+ Seperator,
38
+ Slider,
39
+ Switch,
40
+ Table,
41
+ TableBody,
42
+ TableCell,
43
+ TableHead,
44
+ TableHeader,
45
+ TableRow,
46
+ Tabs,
47
+ Tag,
48
+ TagList,
49
+ TagListInput,
50
+ Text,
51
+ TextButton,
52
+ TextIconButton,
53
+ TextIconLinkButton,
54
+ TextLinkButton,
55
+ Textarea,
56
+ Then,
57
+ Throbber,
58
+ UploadBox,
59
+ WrapList,
60
+ closeContextMenu,
61
+ getFileIcon,
62
+ openContextMenu,
63
+ openContextMenuOn
64
+ } from "../chunk-M6LQH7LY.js";
65
+ import "../chunk-CE4YXNWV.js";
66
+ import "../chunk-6G3G7N5D.js";
67
+ export {
68
+ AsideContainer,
69
+ Branch,
70
+ Button,
71
+ CalendarInput,
72
+ Case,
73
+ ClickFade,
74
+ Container,
75
+ Content,
76
+ DotSeperator,
77
+ Else,
78
+ FileIcon,
79
+ FilePath,
80
+ FooterContainer,
81
+ FormalInput,
82
+ Header1,
83
+ Header2,
84
+ Header3,
85
+ HeaderContainer,
86
+ IconButton,
87
+ IconLinkButton,
88
+ If,
89
+ Image,
90
+ ImageInput,
91
+ Input,
92
+ Label,
93
+ LinkButton,
94
+ Loading,
95
+ MainContainer,
96
+ MiniHeader,
97
+ PathInput,
98
+ PopoutContainer,
99
+ PopoutIconButton,
100
+ PopoutTextButton,
101
+ PopoutTextIconButton,
102
+ SelectBox,
103
+ Seperator,
104
+ Slider,
105
+ Switch,
106
+ Table,
107
+ TableBody,
108
+ TableCell,
109
+ TableHead,
110
+ TableHeader,
111
+ TableRow,
112
+ Tabs,
113
+ Tag,
114
+ TagList,
115
+ TagListInput,
116
+ Text,
117
+ TextButton,
118
+ TextIconButton,
119
+ TextIconLinkButton,
120
+ TextLinkButton,
121
+ Textarea,
122
+ Then,
123
+ Throbber,
124
+ UploadBox,
125
+ WrapList,
126
+ closeContextMenu,
127
+ getFileIcon,
128
+ openContextMenu,
129
+ openContextMenuOn
130
+ };