@domphy/ui 0.1.0
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 +69 -0
- package/dist/core-theme-ui.global.js +5 -0
- package/dist/core-theme-ui.global.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +422 -0
- package/dist/index.d.ts +422 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { PartialElement, ValueOrState, DomphyElement, Notifier, Handler } from '@domphy/core';
|
|
2
|
+
import { ThemeColor, ElementTone } from '@domphy/theme';
|
|
3
|
+
import { Placement as Placement$1 } from '@floating-ui/dom';
|
|
4
|
+
|
|
5
|
+
declare function abbreviation(props?: {
|
|
6
|
+
color?: ThemeColor;
|
|
7
|
+
accentColor?: ThemeColor;
|
|
8
|
+
}): PartialElement;
|
|
9
|
+
|
|
10
|
+
declare function card(props?: {
|
|
11
|
+
color?: ThemeColor;
|
|
12
|
+
}): PartialElement;
|
|
13
|
+
|
|
14
|
+
declare function splitter(props?: {
|
|
15
|
+
direction?: "horizontal" | "vertical";
|
|
16
|
+
defaultSize?: number;
|
|
17
|
+
min?: number;
|
|
18
|
+
max?: number;
|
|
19
|
+
}): PartialElement;
|
|
20
|
+
declare function splitterPanel(): PartialElement;
|
|
21
|
+
declare function splitterHandle(): PartialElement;
|
|
22
|
+
|
|
23
|
+
declare function command(): PartialElement;
|
|
24
|
+
declare function commandSearch(props?: {
|
|
25
|
+
color?: ThemeColor;
|
|
26
|
+
accentColor?: ThemeColor;
|
|
27
|
+
}): PartialElement;
|
|
28
|
+
declare function commandItem(props?: {
|
|
29
|
+
color?: ThemeColor;
|
|
30
|
+
accentColor?: ThemeColor;
|
|
31
|
+
}): PartialElement;
|
|
32
|
+
|
|
33
|
+
declare function toggle(props?: {
|
|
34
|
+
color?: ThemeColor;
|
|
35
|
+
accentColor?: ThemeColor;
|
|
36
|
+
}): PartialElement;
|
|
37
|
+
|
|
38
|
+
declare function toggleGroup(props?: {
|
|
39
|
+
value?: ValueOrState<string | string[]>;
|
|
40
|
+
multiple?: boolean;
|
|
41
|
+
color?: ThemeColor;
|
|
42
|
+
}): PartialElement;
|
|
43
|
+
|
|
44
|
+
declare function inputOTP(): PartialElement;
|
|
45
|
+
|
|
46
|
+
declare function alert(props?: {
|
|
47
|
+
color?: ThemeColor;
|
|
48
|
+
}): PartialElement;
|
|
49
|
+
|
|
50
|
+
declare function avatar(props?: {
|
|
51
|
+
color?: ThemeColor;
|
|
52
|
+
}): PartialElement;
|
|
53
|
+
|
|
54
|
+
declare function badge(props?: {
|
|
55
|
+
color?: ThemeColor;
|
|
56
|
+
label?: ValueOrState<string | number>;
|
|
57
|
+
}): PartialElement;
|
|
58
|
+
|
|
59
|
+
declare function breadcrumb(props?: {
|
|
60
|
+
color?: ThemeColor;
|
|
61
|
+
separator?: string;
|
|
62
|
+
}): PartialElement;
|
|
63
|
+
|
|
64
|
+
declare function breadcrumbEllipsis(props?: {
|
|
65
|
+
color?: ThemeColor;
|
|
66
|
+
}): PartialElement;
|
|
67
|
+
|
|
68
|
+
declare function combobox(props: {
|
|
69
|
+
multiple?: boolean;
|
|
70
|
+
value?: ValueOrState<Array<number | string | null | undefined> | number | string | null | undefined>;
|
|
71
|
+
options?: Array<{
|
|
72
|
+
label: string;
|
|
73
|
+
value: string;
|
|
74
|
+
}>;
|
|
75
|
+
placement?: ValueOrState<Placement$1>;
|
|
76
|
+
content: DomphyElement;
|
|
77
|
+
color?: ThemeColor;
|
|
78
|
+
open?: ValueOrState<boolean>;
|
|
79
|
+
onPlacement?: (anchor: HTMLElement, popover: HTMLElement, placement: Placement$1) => void;
|
|
80
|
+
input?: DomphyElement;
|
|
81
|
+
}): PartialElement;
|
|
82
|
+
|
|
83
|
+
declare function popoverArrow(props?: {
|
|
84
|
+
placement?: ValueOrState<Placement$1>;
|
|
85
|
+
sideOffset?: string;
|
|
86
|
+
color?: ThemeColor;
|
|
87
|
+
bordered?: boolean;
|
|
88
|
+
}): PartialElement;
|
|
89
|
+
|
|
90
|
+
declare function blockquote(props?: {
|
|
91
|
+
color?: ThemeColor;
|
|
92
|
+
}): PartialElement;
|
|
93
|
+
|
|
94
|
+
declare function button(props?: {
|
|
95
|
+
color?: ThemeColor;
|
|
96
|
+
}): PartialElement;
|
|
97
|
+
|
|
98
|
+
declare function inputCheckbox(props?: {
|
|
99
|
+
color?: ThemeColor;
|
|
100
|
+
accentColor?: ThemeColor;
|
|
101
|
+
}): PartialElement;
|
|
102
|
+
|
|
103
|
+
declare function code(props?: {
|
|
104
|
+
color?: ThemeColor;
|
|
105
|
+
}): PartialElement;
|
|
106
|
+
|
|
107
|
+
declare function details(props?: {
|
|
108
|
+
color?: ThemeColor;
|
|
109
|
+
accentColor?: ThemeColor;
|
|
110
|
+
duration?: number;
|
|
111
|
+
}): PartialElement;
|
|
112
|
+
|
|
113
|
+
declare function descriptionList(props?: {
|
|
114
|
+
color?: ThemeColor;
|
|
115
|
+
}): PartialElement;
|
|
116
|
+
|
|
117
|
+
declare function dialog(props?: {
|
|
118
|
+
color?: ThemeColor;
|
|
119
|
+
open?: ValueOrState<boolean>;
|
|
120
|
+
}): PartialElement;
|
|
121
|
+
|
|
122
|
+
declare function emphasis(props?: {
|
|
123
|
+
color?: ThemeColor;
|
|
124
|
+
}): PartialElement;
|
|
125
|
+
|
|
126
|
+
declare function figure(props?: {
|
|
127
|
+
color?: ThemeColor;
|
|
128
|
+
}): PartialElement;
|
|
129
|
+
|
|
130
|
+
declare function formGroup(props?: {
|
|
131
|
+
color?: ThemeColor;
|
|
132
|
+
layout?: "horizontal" | "vertical";
|
|
133
|
+
}): PartialElement;
|
|
134
|
+
|
|
135
|
+
declare function heading(props?: {
|
|
136
|
+
color?: ThemeColor;
|
|
137
|
+
}): PartialElement;
|
|
138
|
+
|
|
139
|
+
declare function horizontalRule(props?: {
|
|
140
|
+
color?: ThemeColor;
|
|
141
|
+
}): PartialElement;
|
|
142
|
+
|
|
143
|
+
declare function image(props?: {
|
|
144
|
+
color?: ThemeColor;
|
|
145
|
+
}): PartialElement;
|
|
146
|
+
|
|
147
|
+
declare function icon(): PartialElement;
|
|
148
|
+
|
|
149
|
+
declare function inputColor(props?: {
|
|
150
|
+
color?: ThemeColor;
|
|
151
|
+
accentColor?: ThemeColor;
|
|
152
|
+
}): PartialElement;
|
|
153
|
+
|
|
154
|
+
type InputDateTimeMode = "date" | "time" | "week" | "month" | "datetime-local";
|
|
155
|
+
declare function inputDateTime(props?: {
|
|
156
|
+
mode?: InputDateTimeMode;
|
|
157
|
+
color?: ThemeColor;
|
|
158
|
+
accentColor?: ThemeColor;
|
|
159
|
+
}): PartialElement;
|
|
160
|
+
|
|
161
|
+
declare function inputFile(props?: {
|
|
162
|
+
color?: ThemeColor;
|
|
163
|
+
accentColor?: ThemeColor;
|
|
164
|
+
}): PartialElement;
|
|
165
|
+
|
|
166
|
+
declare function inputSearch(props?: {
|
|
167
|
+
color?: ThemeColor;
|
|
168
|
+
accentColor?: ThemeColor;
|
|
169
|
+
}): PartialElement;
|
|
170
|
+
|
|
171
|
+
declare function inputText(props?: {
|
|
172
|
+
color?: ThemeColor;
|
|
173
|
+
accentColor?: ThemeColor;
|
|
174
|
+
}): PartialElement;
|
|
175
|
+
|
|
176
|
+
declare function inputRange(props?: {
|
|
177
|
+
color?: ThemeColor;
|
|
178
|
+
accentColor?: ThemeColor;
|
|
179
|
+
}): PartialElement;
|
|
180
|
+
|
|
181
|
+
declare function inputNumber(props?: {
|
|
182
|
+
color?: ThemeColor;
|
|
183
|
+
accentColor?: ThemeColor;
|
|
184
|
+
}): PartialElement;
|
|
185
|
+
|
|
186
|
+
declare function keyboard(props?: {
|
|
187
|
+
color?: ThemeColor;
|
|
188
|
+
}): PartialElement;
|
|
189
|
+
|
|
190
|
+
declare function label(props?: {
|
|
191
|
+
color?: ThemeColor;
|
|
192
|
+
accentColor?: ThemeColor;
|
|
193
|
+
}): PartialElement;
|
|
194
|
+
|
|
195
|
+
declare function link(props?: {
|
|
196
|
+
color?: ThemeColor;
|
|
197
|
+
accentColor?: ThemeColor;
|
|
198
|
+
}): PartialElement;
|
|
199
|
+
|
|
200
|
+
declare function mark(props?: {
|
|
201
|
+
accentColor?: ThemeColor;
|
|
202
|
+
tone?: ElementTone;
|
|
203
|
+
}): PartialElement;
|
|
204
|
+
|
|
205
|
+
declare function paragraph(props?: {
|
|
206
|
+
color?: ThemeColor;
|
|
207
|
+
}): PartialElement;
|
|
208
|
+
|
|
209
|
+
declare function preformated(props?: {
|
|
210
|
+
color?: ThemeColor;
|
|
211
|
+
}): PartialElement;
|
|
212
|
+
|
|
213
|
+
declare function progress(props?: {
|
|
214
|
+
color?: ThemeColor;
|
|
215
|
+
accentColor?: ThemeColor;
|
|
216
|
+
}): PartialElement;
|
|
217
|
+
|
|
218
|
+
declare function inputRadio(props?: {
|
|
219
|
+
color?: ThemeColor;
|
|
220
|
+
accentColor?: ThemeColor;
|
|
221
|
+
}): PartialElement;
|
|
222
|
+
|
|
223
|
+
declare function select(props?: {
|
|
224
|
+
color?: ThemeColor;
|
|
225
|
+
accentColor?: ThemeColor;
|
|
226
|
+
}): PartialElement;
|
|
227
|
+
|
|
228
|
+
declare function skeleton(props?: {
|
|
229
|
+
color?: ThemeColor;
|
|
230
|
+
}): PartialElement;
|
|
231
|
+
|
|
232
|
+
declare function spinner(props?: {
|
|
233
|
+
color?: ThemeColor;
|
|
234
|
+
}): PartialElement;
|
|
235
|
+
|
|
236
|
+
declare function selectList(props?: {
|
|
237
|
+
multiple?: boolean;
|
|
238
|
+
value?: ValueOrState<Array<number | string | null> | number | string | null>;
|
|
239
|
+
color?: ThemeColor;
|
|
240
|
+
name?: string;
|
|
241
|
+
}): PartialElement;
|
|
242
|
+
|
|
243
|
+
declare function selectItem(props?: {
|
|
244
|
+
accentColor?: ThemeColor;
|
|
245
|
+
color?: ThemeColor;
|
|
246
|
+
value?: number | string;
|
|
247
|
+
}): PartialElement;
|
|
248
|
+
|
|
249
|
+
declare function selectBox(props: {
|
|
250
|
+
multiple?: boolean;
|
|
251
|
+
value?: ValueOrState<Array<number | string | null | undefined> | number | string | null | undefined>;
|
|
252
|
+
options?: Array<{
|
|
253
|
+
label: string;
|
|
254
|
+
value: string;
|
|
255
|
+
}>;
|
|
256
|
+
placement?: ValueOrState<Placement$1>;
|
|
257
|
+
content: DomphyElement;
|
|
258
|
+
color?: ThemeColor;
|
|
259
|
+
open?: ValueOrState<boolean>;
|
|
260
|
+
onPlacement?: (anchor: HTMLElement, popover: HTMLElement, placement: Placement$1) => void;
|
|
261
|
+
}): PartialElement;
|
|
262
|
+
|
|
263
|
+
declare function inputSwitch(props?: {
|
|
264
|
+
accentColor?: ThemeColor;
|
|
265
|
+
}): PartialElement;
|
|
266
|
+
|
|
267
|
+
declare function buttonSwitch(props?: {
|
|
268
|
+
checked?: ValueOrState<boolean>;
|
|
269
|
+
accentColor?: ThemeColor;
|
|
270
|
+
color?: ThemeColor;
|
|
271
|
+
}): PartialElement;
|
|
272
|
+
|
|
273
|
+
declare function small(props?: {
|
|
274
|
+
color?: ThemeColor;
|
|
275
|
+
}): PartialElement;
|
|
276
|
+
|
|
277
|
+
declare function strong(props?: {
|
|
278
|
+
color?: ThemeColor;
|
|
279
|
+
}): PartialElement;
|
|
280
|
+
|
|
281
|
+
declare function subscript(props?: {
|
|
282
|
+
color?: ThemeColor;
|
|
283
|
+
}): PartialElement;
|
|
284
|
+
|
|
285
|
+
declare function superscript(props?: {
|
|
286
|
+
color?: ThemeColor;
|
|
287
|
+
}): PartialElement;
|
|
288
|
+
|
|
289
|
+
declare function table(props?: {
|
|
290
|
+
color?: ThemeColor;
|
|
291
|
+
}): PartialElement;
|
|
292
|
+
|
|
293
|
+
declare function textarea(props?: {
|
|
294
|
+
color?: ThemeColor;
|
|
295
|
+
accentColor?: ThemeColor;
|
|
296
|
+
}): PartialElement;
|
|
297
|
+
|
|
298
|
+
declare function unorderedList(props?: {
|
|
299
|
+
color?: ThemeColor;
|
|
300
|
+
}): PartialElement;
|
|
301
|
+
|
|
302
|
+
declare function orderedList(props?: {
|
|
303
|
+
color?: ThemeColor;
|
|
304
|
+
}): PartialElement;
|
|
305
|
+
|
|
306
|
+
declare function pagination(props: {
|
|
307
|
+
value?: ValueOrState<number>;
|
|
308
|
+
total: number;
|
|
309
|
+
color?: ThemeColor;
|
|
310
|
+
accentColor?: ThemeColor;
|
|
311
|
+
}): PartialElement;
|
|
312
|
+
|
|
313
|
+
declare function divider(props?: {
|
|
314
|
+
color?: ThemeColor;
|
|
315
|
+
}): PartialElement;
|
|
316
|
+
|
|
317
|
+
type Placement = "left" | "right" | "top" | "bottom";
|
|
318
|
+
declare function drawer(props?: {
|
|
319
|
+
color?: ThemeColor;
|
|
320
|
+
open?: ValueOrState<boolean>;
|
|
321
|
+
placement?: Placement;
|
|
322
|
+
size?: string;
|
|
323
|
+
}): PartialElement;
|
|
324
|
+
|
|
325
|
+
declare function popover(props: {
|
|
326
|
+
openOn: "click" | "hover";
|
|
327
|
+
open?: ValueOrState<boolean>;
|
|
328
|
+
placement?: ValueOrState<Placement$1>;
|
|
329
|
+
content: DomphyElement;
|
|
330
|
+
onPlacement?: (anchor: HTMLElement, popover: HTMLElement, placement: Placement$1) => void;
|
|
331
|
+
}): PartialElement;
|
|
332
|
+
|
|
333
|
+
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
334
|
+
declare function toast(props?: {
|
|
335
|
+
position?: ToastPosition;
|
|
336
|
+
color?: ThemeColor;
|
|
337
|
+
}): PartialElement;
|
|
338
|
+
|
|
339
|
+
declare function tooltip(props?: {
|
|
340
|
+
open?: ValueOrState<boolean>;
|
|
341
|
+
placement?: ValueOrState<Placement$1>;
|
|
342
|
+
content?: DomphyElement | string;
|
|
343
|
+
}): PartialElement;
|
|
344
|
+
|
|
345
|
+
declare function transitionGroup(props?: {
|
|
346
|
+
duration?: number;
|
|
347
|
+
delay?: number;
|
|
348
|
+
}): PartialElement;
|
|
349
|
+
|
|
350
|
+
declare function tabs(props?: {
|
|
351
|
+
activeKey?: ValueOrState<number | string>;
|
|
352
|
+
}): PartialElement;
|
|
353
|
+
|
|
354
|
+
declare function tab(props?: {
|
|
355
|
+
accentColor?: ThemeColor;
|
|
356
|
+
color?: ThemeColor;
|
|
357
|
+
}): PartialElement;
|
|
358
|
+
|
|
359
|
+
declare function tabPanel(): PartialElement;
|
|
360
|
+
|
|
361
|
+
declare function tag(props?: {
|
|
362
|
+
color?: ThemeColor;
|
|
363
|
+
removable?: boolean;
|
|
364
|
+
}): PartialElement;
|
|
365
|
+
|
|
366
|
+
declare function menu(props?: {
|
|
367
|
+
activeKey?: ValueOrState<number | string>;
|
|
368
|
+
color?: ThemeColor;
|
|
369
|
+
}): PartialElement;
|
|
370
|
+
|
|
371
|
+
declare function menuItem(props?: {
|
|
372
|
+
accentColor?: ThemeColor;
|
|
373
|
+
color?: ThemeColor;
|
|
374
|
+
}): PartialElement;
|
|
375
|
+
|
|
376
|
+
type FieldStatus = "error" | "warning" | "success" | undefined;
|
|
377
|
+
type FieldMessages = {
|
|
378
|
+
error?: string;
|
|
379
|
+
warning?: string;
|
|
380
|
+
success?: string;
|
|
381
|
+
};
|
|
382
|
+
type FieldValidator = (value: unknown) => FieldMessages | null | Promise<FieldMessages | null>;
|
|
383
|
+
declare class FieldState {
|
|
384
|
+
_notifier: Notifier;
|
|
385
|
+
_value: unknown;
|
|
386
|
+
_initValue: unknown;
|
|
387
|
+
_messages: FieldMessages;
|
|
388
|
+
_touched: boolean;
|
|
389
|
+
_validator: FieldValidator | undefined;
|
|
390
|
+
_pending: boolean;
|
|
391
|
+
_validationToken: number;
|
|
392
|
+
constructor(initValue: unknown, validator?: FieldValidator);
|
|
393
|
+
value(listener?: Handler): unknown;
|
|
394
|
+
setValue(val: unknown): void;
|
|
395
|
+
dirty(listener?: Handler): boolean;
|
|
396
|
+
touched(listener?: Handler): boolean;
|
|
397
|
+
setTouched(): void;
|
|
398
|
+
configure(initValue?: unknown, validator?: FieldValidator): void;
|
|
399
|
+
message(type: keyof FieldMessages, listener?: Handler): string | undefined;
|
|
400
|
+
status(listener?: Handler): FieldStatus;
|
|
401
|
+
setMessages(next: FieldMessages): void;
|
|
402
|
+
reset(): void;
|
|
403
|
+
validate(): void;
|
|
404
|
+
_dispose(): void;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
declare class FormState {
|
|
408
|
+
fields: Map<string, FieldState>;
|
|
409
|
+
setField(path: string, initValue?: unknown, validator?: FieldValidator): FieldState;
|
|
410
|
+
getField(path: string): FieldState;
|
|
411
|
+
removeField(path: string): void;
|
|
412
|
+
get valid(): boolean;
|
|
413
|
+
reset(): void;
|
|
414
|
+
snapshot(): Record<string, unknown>;
|
|
415
|
+
_dispose(): void;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
declare function form(state: FormState): PartialElement;
|
|
419
|
+
|
|
420
|
+
declare function field(path: string, validator?: FieldValidator): PartialElement;
|
|
421
|
+
|
|
422
|
+
export { type FieldMessages, FieldState, type FieldStatus, type FieldValidator, FormState, abbreviation, alert, avatar, badge, blockquote, breadcrumb, breadcrumbEllipsis, button, buttonSwitch, card, code, combobox, command, commandItem, commandSearch, descriptionList, details, dialog, divider, drawer, emphasis, field, figure, form, formGroup, heading, horizontalRule, icon, image, inputCheckbox, inputColor, inputDateTime, inputFile, inputNumber, inputOTP, inputRadio, inputRange, inputSearch, inputSwitch, inputText, keyboard, label, link, mark, menu, menuItem, orderedList, pagination, paragraph, popover, popoverArrow, preformated, progress, select, selectBox, selectItem, selectList, skeleton, small, spinner, splitter, splitterHandle, splitterPanel, strong, subscript, superscript, tab, tabPanel, table, tabs, tag, textarea, toast, toggle, toggleGroup, tooltip, transitionGroup, unorderedList };
|