@ktjs/mui 0.20.2 → 0.23.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/dist/index.d.ts CHANGED
@@ -1,3 +1,17 @@
1
+ type otherstring = string & {};
2
+
3
+ // declare function $throw(message: string): never;
4
+ // declare const $warn: typeof console.warn;
5
+ // declare const $error: typeof console.error;
6
+ // declare const $debug: typeof console.debug;
7
+ declare global {
8
+ const $throw: (message?: string) => never;
9
+ const $warn: typeof console.warn;
10
+ const $log: typeof console.log;
11
+ const $error: typeof console.error;
12
+ const $debug: typeof console.debug;
13
+ }
14
+
1
15
  interface KTMuiAlertProps {
2
16
  class?: string;
3
17
  style?: string | Partial<CSSStyleDeclaration>;
@@ -5,46 +19,64 @@ interface KTMuiAlertProps {
5
19
  severity?: 'error' | 'warning' | 'info' | 'success';
6
20
  variant?: 'standard' | 'filled' | 'outlined';
7
21
  icon?: HTMLElement | false;
8
- 'kt:close'?: () => void;
22
+ 'on:close'?: () => void;
9
23
  }
10
24
  declare function Alert(props: KTMuiAlertProps): JSX.Element;
11
25
 
12
- interface KTMuiButtonProps {
13
- class?: string;
14
- style?: string | Partial<CSSStyleDeclaration>;
15
- children?: string | HTMLElement | JSX.Element;
16
- variant?: 'contained' | 'outlined' | 'text';
17
- color?: 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
18
- size?: 'small' | 'medium' | 'large';
19
- disabled?: boolean;
20
- fullWidth?: boolean;
21
- iconOnly?: boolean;
22
- startIcon?: HTMLElement | JSX.Element;
23
- endIcon?: HTMLElement | JSX.Element;
24
- type?: 'button' | 'submit' | 'reset';
25
- 'on:click'?: (event: Event) => void;
26
+ declare class KTComputed<T> {
27
+ /**
28
+ * Indicates that this is a KTRef instance
29
+ */
30
+ isKT: true;
31
+ ktType: KTReactiveType;
32
+ constructor(_calculator: () => T, reactives: Array<KTReactive<unknown>>);
33
+ /**
34
+ * If new value and old value are both nodes, the old one will be replaced in the DOM
35
+ */
36
+ get value(): T;
37
+ set value(_newValue: T);
38
+ /**
39
+ * Register a callback when the value changes
40
+ * @param callback (newValue, oldValue) => xxx
41
+ */
42
+ addOnChange(callback: ReactiveChangeHandler<T>): void;
43
+ /**
44
+ * Unregister a callback
45
+ * @param callback (newValue, oldValue) => xxx
46
+ */
47
+ removeOnChange(callback: ReactiveChangeHandler<T>): boolean;
26
48
  }
27
- /**
28
- * Button component - mimics MUI Button appearance and behavior
29
- */
30
- declare function Button(props: KTMuiButtonProps): JSX.Element;
31
49
 
32
- type otherstring = string & {};
50
+ type KTReactive<T> = KTRef<T> | KTComputed<T>;
51
+ type KTReactify<T> = T extends boolean ? KTReactive<boolean> : T extends any ? KTReactive<T> : never;
52
+ type KTReactifyProps<T extends object> = {
53
+ [K in keyof T]: KTReactify<Exclude<T[K], undefined>> | T[K];
54
+ };
55
+
56
+ declare const enum KTReactiveType {
57
+ REF = 1,
58
+ COMPUTED = 2
59
+ }
60
+ type ReactiveChangeHandler<T> = (newValue: T, oldValue: T) => void;
33
61
 
34
- type RefChangeHandler<T> = (newValue: T, oldValue: T) => void;
35
62
  declare class KTRef<T> {
36
63
  /**
37
64
  * Indicates that this is a KTRef instance
38
65
  */
39
- isKT: boolean;
40
- constructor(_value: T, _onChanges: Array<RefChangeHandler<T>>);
66
+ isKT: true;
67
+ ktType: KTReactiveType;
68
+ constructor(_value: T, _onChanges: Array<ReactiveChangeHandler<T>>);
41
69
  /**
42
70
  * If new value and old value are both nodes, the old one will be replaced in the DOM
43
71
  */
44
72
  get value(): T;
45
73
  set value(newValue: T);
46
- addOnChange(callback: RefChangeHandler<T>): void;
47
- removeOnChange(callback: RefChangeHandler<T>): boolean;
74
+ /**
75
+ * Register a callback when the value changes
76
+ * @param callback (newValue, oldValue) => xxx
77
+ */
78
+ addOnChange(callback: ReactiveChangeHandler<T>): void;
79
+ removeOnChange(callback: ReactiveChangeHandler<T>): boolean;
48
80
  }
49
81
 
50
82
  type SingleContent = KTRef<any> | HTMLElement | Element | Node | string | number | boolean | null | undefined;
@@ -59,8 +91,24 @@ interface KTBaseAttribute {
59
91
 
60
92
  // # kt-specific attributes
61
93
  ref?: KTRef<JSX.Element>;
94
+
95
+ /**
96
+ * If a `KTRef` is bound, it will be reactive; otherwise, it will be static.
97
+ */
62
98
  'k-if'?: any;
63
99
 
100
+ /**
101
+ * Register two-way data binding between an input element and a KTRef.
102
+ * - Default to regist `input` event and `value` property(`checked` for checkboxes and radios).
103
+ */
104
+ 'k-model'?: KTRef<any>;
105
+
106
+ /**
107
+ * Directly apply html string to `innerHTML`.
108
+ * - Would be reactive if `KTRef` instance is provided
109
+ */
110
+ 'k-html'?: any;
111
+
64
112
  // # normal HTML attributes
65
113
  id?: string;
66
114
  class?: string;
@@ -114,202 +162,70 @@ interface KTBaseAttribute {
114
162
  method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring;
115
163
  }
116
164
 
117
- type KTPrefixedEventHandlers = {
165
+ type KTPrefixedEventAttribute = {
118
166
  [EventName in keyof HTMLElementEventMap as `on:${EventName}`]?: (ev: HTMLElementEventMap[EventName]) => void;
119
167
  };
120
168
 
121
- type KTAttribute = KTBaseAttribute & KTPrefixedEventHandlers;
169
+ type KTAttribute = KTBaseAttribute & KTPrefixedEventAttribute;
122
170
 
123
171
  // Base events available to all HTML elements
124
- interface BaseAttr {
125
- [k: string]: any;
126
-
127
- // # base attributes
128
- class?: string;
129
- className?: string;
130
- style?: string | Partial<CSSStyleDeclaration>;
131
-
132
- // # Events
133
- // Mouse events
134
- 'on:click'?: (ev: PointerEvent) => void;
135
- 'on:dblclick'?: (ev: PointerEvent) => void;
136
- 'on:mousedown'?: (ev: PointerEvent) => void;
137
- 'on:mouseup'?: (ev: MouseEvent) => void;
138
- 'on:mousemove'?: (ev: MouseEvent) => void;
139
- 'on:mouseenter'?: (ev: MouseEvent) => void;
140
- 'on:mouseleave'?: (ev: MouseEvent) => void;
141
- 'on:mouseover'?: (ev: MouseEvent) => void;
142
- 'on:mouseout'?: (ev: MouseEvent) => void;
143
- 'on:contextmenu'?: (ev: PointerEvent) => void;
144
-
145
- // Keyboard events
146
- 'on:keydown'?: (ev: KeyboardEvent) => void;
147
- 'on:keyup'?: (ev: KeyboardEvent) => void;
148
- 'on:keypress'?: (ev: KeyboardEvent) => void;
149
-
150
- // Focus events
151
- 'on:focus'?: (ev: FocusEvent) => void;
152
- 'on:blur'?: (ev: FocusEvent) => void;
153
- 'on:focusin'?: (ev: FocusEvent) => void;
154
- 'on:focusout'?: (ev: FocusEvent) => void;
155
-
156
- // Input events
157
- 'on:input'?: (ev: Event) => void;
158
- 'on:change'?: (ev: Event) => void;
159
- 'on:beforeinput'?: (ev: InputEvent) => void;
160
-
161
- // Drag events
162
- 'on:drag'?: (ev: DragEvent) => void;
163
- 'on:dragstart'?: (ev: DragEvent) => void;
164
- 'on:dragend'?: (ev: DragEvent) => void;
165
- 'on:dragenter'?: (ev: DragEvent) => void;
166
- 'on:dragleave'?: (ev: DragEvent) => void;
167
- 'on:dragover'?: (ev: DragEvent) => void;
168
- 'on:drop'?: (ev: DragEvent) => void;
169
-
170
- // Clipboard events
171
- 'on:copy'?: (ev: ClipboardEvent) => void;
172
- 'on:cut'?: (ev: ClipboardEvent) => void;
173
- 'on:paste'?: (ev: ClipboardEvent) => void;
174
-
175
- // Touch events
176
- 'on:touchstart'?: (ev: TouchEvent) => void;
177
- 'on:touchmove'?: (ev: TouchEvent) => void;
178
- 'on:touchend'?: (ev: TouchEvent) => void;
179
- 'on:touchcancel'?: (ev: TouchEvent) => void;
180
-
181
- // Wheel event
182
- 'on:wheel'?: (ev: WheelEvent) => void;
183
-
184
- // Animation events
185
- 'on:animationstart'?: (ev: AnimationEvent) => void;
186
- 'on:animationend'?: (ev: AnimationEvent) => void;
187
- 'on:animationiteration'?: (ev: AnimationEvent) => void;
188
-
189
- // Transition events
190
- 'on:transitionstart'?: (ev: TransitionEvent) => void;
191
- 'on:transitionend'?: (ev: TransitionEvent) => void;
192
- 'on:transitionrun'?: (ev: TransitionEvent) => void;
193
- 'on:transitioncancel'?: (ev: TransitionEvent) => void;
194
-
195
- // Pointer events
196
- 'on:pointerdown'?: (ev: PointerEvent) => void;
197
- 'on:pointerup'?: (ev: PointerEvent) => void;
198
- 'on:pointermove'?: (ev: PointerEvent) => void;
199
- 'on:pointerenter'?: (ev: PointerEvent) => void;
200
- 'on:pointerleave'?: (ev: PointerEvent) => void;
201
- 'on:pointerover'?: (ev: PointerEvent) => void;
202
- 'on:pointerout'?: (ev: PointerEvent) => void;
203
- 'on:pointercancel'?: (ev: PointerEvent) => void;
204
- 'on:gotpointercapture'?: (ev: PointerEvent) => void;
205
- 'on:lostpointercapture'?: (ev: PointerEvent) => void;
206
-
207
- // Selection events
208
- 'on:select'?: (ev: Event) => void;
209
- 'on:selectstart'?: (ev: Event) => void;
210
-
211
- // Scroll event
212
- 'on:scroll'?: (ev: Event) => void;
213
-
214
- // Resize event
215
- 'on:resize'?: (ev: UIEvent) => void;
216
- }
217
-
218
- // Form-specific events
219
- interface FormElementEvents {
220
- 'on:submit'?: (ev: SubmitEvent) => void;
221
- 'on:reset'?: (ev: Event) => void;
222
- 'on:invalid'?: (ev: Event) => void;
223
- }
224
-
225
- // Media-specific events
226
- interface MediaElementEvents {
227
- 'on:play'?: (ev: Event) => void;
228
- 'on:pause'?: (ev: Event) => void;
229
- 'on:playing'?: (ev: Event) => void;
230
- 'on:ended'?: (ev: Event) => void;
231
- 'on:canplay'?: (ev: Event) => void;
232
- 'on:canplaythrough'?: (ev: Event) => void;
233
- 'on:durationchange'?: (ev: Event) => void;
234
- 'on:emptied'?: (ev: Event) => void;
235
- 'on:loadeddata'?: (ev: Event) => void;
236
- 'on:loadedmetadata'?: (ev: Event) => void;
237
- 'on:loadstart'?: (ev: Event) => void;
238
- 'on:progress'?: (ev: ProgressEvent) => void;
239
- 'on:ratechange'?: (ev: Event) => void;
240
- 'on:seeked'?: (ev: Event) => void;
241
- 'on:seeking'?: (ev: Event) => void;
242
- 'on:stalled'?: (ev: Event) => void;
243
- 'on:suspend'?: (ev: Event) => void;
244
- 'on:timeupdate'?: (ev: Event) => void;
245
- 'on:volumechange'?: (ev: Event) => void;
246
- 'on:waiting'?: (ev: Event) => void;
247
- 'on:abort'?: (ev: UIEvent) => void;
248
- 'on:error'?: (ev: ErrorEvent) => void;
249
- }
250
-
251
- // Details-specific events
252
- interface DetailsElementEvents {
253
- 'on:toggle'?: (ev: Event) => void;
254
- }
172
+ type BaseAttr = KTPrefixedEventAttribute &
173
+ KTReactifyProps<{
174
+ [k: string]: any;
255
175
 
256
- // Dialog-specific events
257
- interface DialogElementEvents {
258
- 'on:cancel'?: (ev: Event) => void;
259
- 'on:close'?: (ev: Event) => void;
260
- }
261
-
262
- // Image-specific events
263
- interface ImageElementEvents {
264
- 'on:load'?: (ev: Event) => void;
265
- 'on:error'?: (ev: ErrorEvent) => void;
266
- }
176
+ // # base attributes
177
+ class?: string;
178
+ className?: string;
179
+ style?: string | Partial<CSSStyleDeclaration>;
180
+ }>;
267
181
 
268
182
  interface AttributesMap {
269
183
  // Anchor element
270
- a: BaseAttr & {
271
- download?: string;
272
- href?: string;
273
- hreflang?: string;
274
- ping?: string;
275
- referrerpolicy?:
276
- | 'no-referrer'
277
- | 'no-referrer-when-downgrade'
278
- | 'origin'
279
- | 'origin-when-cross-origin'
280
- | 'same-origin'
281
- | 'strict-origin'
282
- | 'strict-origin-when-cross-origin'
283
- | 'unsafe-url';
284
- rel?: string;
285
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
286
- type?: string;
287
- };
184
+ a: BaseAttr &
185
+ KTReactifyProps<{
186
+ download?: string;
187
+ href?: string;
188
+ hreflang?: string;
189
+ ping?: string;
190
+ referrerpolicy?:
191
+ | 'no-referrer'
192
+ | 'no-referrer-when-downgrade'
193
+ | 'origin'
194
+ | 'origin-when-cross-origin'
195
+ | 'same-origin'
196
+ | 'strict-origin'
197
+ | 'strict-origin-when-cross-origin'
198
+ | 'unsafe-url';
199
+ rel?: string;
200
+ target?: '_self' | '_blank' | '_parent' | '_top' | string;
201
+ type?: string;
202
+ }>;
288
203
 
289
204
  // Area element
290
- area: BaseAttr & {
291
- alt?: string;
292
- coords?: string;
293
- download?: string;
294
- href?: string;
295
- ping?: string;
296
- referrerpolicy?:
297
- | 'no-referrer'
298
- | 'no-referrer-when-downgrade'
299
- | 'origin'
300
- | 'origin-when-cross-origin'
301
- | 'same-origin'
302
- | 'strict-origin'
303
- | 'strict-origin-when-cross-origin'
304
- | 'unsafe-url';
305
- rel?: string;
306
- shape?: 'rect' | 'circle' | 'poly' | 'default';
307
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
308
- };
205
+ area: BaseAttr &
206
+ KTReactifyProps<{
207
+ alt?: string;
208
+ coords?: string;
209
+ download?: string;
210
+ href?: string;
211
+ ping?: string;
212
+ referrerpolicy?:
213
+ | 'no-referrer'
214
+ | 'no-referrer-when-downgrade'
215
+ | 'origin'
216
+ | 'origin-when-cross-origin'
217
+ | 'same-origin'
218
+ | 'strict-origin'
219
+ | 'strict-origin-when-cross-origin'
220
+ | 'unsafe-url';
221
+ rel?: string;
222
+ shape?: 'rect' | 'circle' | 'poly' | 'default';
223
+ target?: '_self' | '_blank' | '_parent' | '_top' | string;
224
+ }>;
309
225
 
310
226
  // Audio element
311
227
  audio: BaseAttr &
312
- MediaElementEvents & {
228
+ KTReactifyProps<{
313
229
  autoplay?: boolean;
314
230
  controls?: boolean;
315
231
  crossorigin?: 'anonymous' | 'use-credentials' | '';
@@ -317,97 +233,106 @@ interface AttributesMap {
317
233
  muted?: boolean;
318
234
  preload?: 'none' | 'metadata' | 'auto' | '';
319
235
  src?: string;
320
- };
236
+ }>;
321
237
 
322
238
  // Base element
323
- base: BaseAttr & {
324
- href?: string;
325
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
326
- };
239
+ base: BaseAttr &
240
+ KTReactifyProps<{
241
+ href?: string;
242
+ target?: '_self' | '_blank' | '_parent' | '_top' | string;
243
+ }>;
327
244
 
328
245
  // Body element
329
- body: BaseAttr & {};
246
+ body: BaseAttr & KTReactifyProps<{}>;
330
247
 
331
248
  // BR element
332
- br: BaseAttr & {};
249
+ br: BaseAttr & KTReactifyProps<{}>;
333
250
 
334
251
  // Button element
335
- button: BaseAttr & {
336
- disabled?: boolean;
337
- form?: string;
338
- formaction?: string;
339
- formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
340
- formmethod?: 'get' | 'post' | 'dialog';
341
- formnovalidate?: boolean;
342
- formtarget?: '_self' | '_blank' | '_parent' | '_top' | string;
343
- name?: string;
344
- type?: 'submit' | 'reset' | 'button';
345
- value?: string;
346
- };
252
+ button: BaseAttr &
253
+ KTReactifyProps<{
254
+ disabled?: boolean;
255
+ form?: string;
256
+ formaction?: string;
257
+ formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
258
+ formmethod?: 'get' | 'post' | 'dialog';
259
+ formnovalidate?: boolean;
260
+ formtarget?: '_self' | '_blank' | '_parent' | '_top' | string;
261
+ name?: string;
262
+ type?: 'submit' | 'reset' | 'button';
263
+ value?: string;
264
+ }>;
347
265
 
348
266
  // Canvas element
349
- canvas: BaseAttr & {
350
- height?: number | string;
351
- width?: number | string;
352
- };
267
+ canvas: BaseAttr &
268
+ KTReactifyProps<{
269
+ height?: number | string;
270
+ width?: number | string;
271
+ }>;
353
272
 
354
273
  // Table caption element
355
- caption: BaseAttr & {};
274
+ caption: BaseAttr & KTReactifyProps<{}>;
356
275
 
357
276
  // Col element
358
- col: BaseAttr & {
359
- span?: number | string;
360
- };
277
+ col: BaseAttr &
278
+ KTReactifyProps<{
279
+ span?: number | string;
280
+ }>;
361
281
 
362
282
  // Colgroup element
363
- colgroup: BaseAttr & {
364
- span?: number | string;
365
- };
283
+ colgroup: BaseAttr &
284
+ KTReactifyProps<{
285
+ span?: number | string;
286
+ }>;
366
287
 
367
288
  // Data element
368
- data: BaseAttr & {
369
- value?: string;
370
- };
289
+ data: BaseAttr &
290
+ KTReactifyProps<{
291
+ value?: string;
292
+ }>;
371
293
 
372
294
  // Datalist element
373
- datalist: BaseAttr & {};
295
+ datalist: BaseAttr & KTReactifyProps<{}>;
374
296
 
375
297
  // Del element
376
- del: BaseAttr & {
377
- cite?: string;
378
- datetime?: string;
379
- };
298
+ del: BaseAttr &
299
+ KTReactifyProps<{
300
+ cite?: string;
301
+ datetime?: string;
302
+ }>;
380
303
 
381
304
  // Details element
382
305
  details: BaseAttr &
383
- DetailsElementEvents & {
306
+ KTReactifyProps<{
384
307
  open?: boolean;
385
- };
308
+ }>;
386
309
 
387
310
  // Dialog element
388
311
  dialog: BaseAttr &
389
- DialogElementEvents & {
312
+ KTReactifyProps<{
390
313
  open?: boolean;
391
- };
314
+ }>;
392
315
 
393
316
  // Embed element
394
- embed: BaseAttr & {
395
- height?: number | string;
396
- src?: string;
397
- type?: string;
398
- width?: number | string;
399
- };
317
+ embed: BaseAttr &
318
+ KTReactifyProps<{
319
+ height?: number | string;
320
+ src?: string;
321
+ type?: string;
322
+ width?: number | string;
323
+ }>;
400
324
 
401
325
  // Fieldset element
402
- fieldset: BaseAttr & {
403
- disabled?: boolean;
404
- form?: string;
405
- name?: string;
406
- };
326
+ fieldset: BaseAttr &
327
+ KTReactifyProps<{
328
+ disabled?: boolean;
329
+ form?: string;
330
+ name?: string;
331
+ }>;
407
332
 
408
333
  // Form element
409
334
  form: BaseAttr &
410
- FormElementEvents & {
335
+ KTReactifyProps<{
411
336
  'accept-charset'?: string;
412
337
  action?: string;
413
338
  autocomplete?: 'on' | 'off';
@@ -417,20 +342,20 @@ interface AttributesMap {
417
342
  name?: string;
418
343
  novalidate?: boolean;
419
344
  target?: '_self' | '_blank' | '_parent' | '_top' | string;
420
- };
345
+ }>;
421
346
 
422
347
  // Head element
423
- head: BaseAttr & {};
348
+ head: BaseAttr & KTReactifyProps<{}>;
424
349
 
425
350
  // HR element
426
- hr: BaseAttr & {};
351
+ hr: BaseAttr & KTReactifyProps<{}>;
427
352
 
428
353
  // HTML element
429
- html: BaseAttr & {};
354
+ html: BaseAttr & KTReactifyProps<{}>;
430
355
 
431
356
  // IFrame element
432
357
  iframe: BaseAttr &
433
- ImageElementEvents & {
358
+ KTReactifyProps<{
434
359
  allow?: string;
435
360
  allowfullscreen?: boolean;
436
361
  allowpaymentrequest?: boolean;
@@ -450,11 +375,11 @@ interface AttributesMap {
450
375
  src?: string;
451
376
  srcdoc?: string;
452
377
  width?: number | string;
453
- };
378
+ }>;
454
379
 
455
380
  // Image element
456
381
  img: BaseAttr &
457
- ImageElementEvents & {
382
+ KTReactifyProps<{
458
383
  alt?: string;
459
384
  crossorigin?: 'anonymous' | 'use-credentials' | '';
460
385
  decoding?: 'sync' | 'async' | 'auto';
@@ -475,86 +400,90 @@ interface AttributesMap {
475
400
  srcset?: string;
476
401
  usemap?: string;
477
402
  width?: number | string;
478
- };
403
+ }>;
479
404
 
480
405
  // Input element
481
- input: BaseAttr & {
482
- accept?: string;
483
- alt?: string;
484
- autocomplete?: string;
485
- checked?: boolean;
486
- dirname?: string;
487
- disabled?: boolean;
488
- form?: string;
489
- formaction?: string;
490
- formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
491
- formmethod?: 'get' | 'post';
492
- formnovalidate?: boolean;
493
- formtarget?: '_self' | '_blank' | '_parent' | '_top' | string;
494
- height?: number | string;
495
- list?: string;
496
- max?: number | string;
497
- maxlength?: number | string;
498
- min?: number | string;
499
- minlength?: number | string;
500
- multiple?: boolean;
501
- name?: string;
502
- pattern?: string;
503
- placeholder?: string;
504
- readonly?: boolean;
505
- required?: boolean;
506
- size?: number | string;
507
- src?: string;
508
- step?: number | string;
509
- type?:
510
- | 'button'
511
- | 'checkbox'
512
- | 'color'
513
- | 'date'
514
- | 'datetime-local'
515
- | 'email'
516
- | 'file'
517
- | 'hidden'
518
- | 'image'
519
- | 'month'
520
- | 'number'
521
- | 'password'
522
- | 'radio'
523
- | 'range'
524
- | 'reset'
525
- | 'search'
526
- | 'submit'
527
- | 'tel'
528
- | 'text'
529
- | 'time'
530
- | 'url'
531
- | 'week';
532
- value?: string;
533
- width?: number | string;
534
- };
406
+ input: BaseAttr &
407
+ KTReactifyProps<{
408
+ accept?: string;
409
+ alt?: string;
410
+ autocomplete?: string;
411
+ checked?: boolean;
412
+ dirname?: string;
413
+ disabled?: boolean;
414
+ form?: string;
415
+ formaction?: string;
416
+ formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
417
+ formmethod?: 'get' | 'post';
418
+ formnovalidate?: boolean;
419
+ formtarget?: '_self' | '_blank' | '_parent' | '_top' | string;
420
+ height?: number | string;
421
+ list?: string;
422
+ max?: number | string;
423
+ maxlength?: number | string;
424
+ min?: number | string;
425
+ minlength?: number | string;
426
+ multiple?: boolean;
427
+ name?: string;
428
+ pattern?: string;
429
+ placeholder?: string;
430
+ readonly?: boolean;
431
+ required?: boolean;
432
+ size?: number | string;
433
+ src?: string;
434
+ step?: number | string;
435
+ type?:
436
+ | 'button'
437
+ | 'checkbox'
438
+ | 'color'
439
+ | 'date'
440
+ | 'datetime-local'
441
+ | 'email'
442
+ | 'file'
443
+ | 'hidden'
444
+ | 'image'
445
+ | 'month'
446
+ | 'number'
447
+ | 'password'
448
+ | 'radio'
449
+ | 'range'
450
+ | 'reset'
451
+ | 'search'
452
+ | 'submit'
453
+ | 'tel'
454
+ | 'text'
455
+ | 'time'
456
+ | 'url'
457
+ | 'week';
458
+ value?: string;
459
+ width?: number | string;
460
+ }>;
535
461
 
536
462
  // Ins element
537
- ins: BaseAttr & {
538
- cite?: string;
539
- datetime?: string;
540
- };
463
+ ins: BaseAttr &
464
+ KTReactifyProps<{
465
+ cite?: string;
466
+ datetime?: string;
467
+ }>;
541
468
 
542
469
  // Label element
543
- label: BaseAttr & {
544
- for?: string;
545
- };
470
+ label: BaseAttr &
471
+ KTReactifyProps<{
472
+ for?: string;
473
+ }>;
546
474
 
547
475
  // Legend element
548
- legend: BaseAttr & {};
476
+ legend: BaseAttr & KTReactifyProps<{}>;
549
477
 
550
478
  // LI element
551
- li: BaseAttr & {
552
- value?: number | string;
553
- };
479
+ li: BaseAttr &
480
+ KTReactifyProps<{
481
+ value?: number | string;
482
+ }>;
554
483
 
555
484
  // Link element
556
485
  link: BaseAttr &
557
- ImageElementEvents & {
486
+ KTReactifyProps<{
558
487
  as?: string;
559
488
  crossorigin?: 'anonymous' | 'use-credentials' | '';
560
489
  disabled?: boolean;
@@ -576,38 +505,41 @@ interface AttributesMap {
576
505
  rel?: string;
577
506
  sizes?: string;
578
507
  type?: string;
579
- };
508
+ }>;
580
509
 
581
510
  // Map element
582
- map: BaseAttr & {
583
- name?: string;
584
- };
511
+ map: BaseAttr &
512
+ KTReactifyProps<{
513
+ name?: string;
514
+ }>;
585
515
 
586
516
  // Menu element
587
- menu: BaseAttr & {};
517
+ menu: BaseAttr & KTReactifyProps<{}>;
588
518
 
589
519
  // Meta element
590
- meta: BaseAttr & {
591
- charset?: string;
592
- content?: string;
593
- 'http-equiv'?: 'content-security-policy' | 'content-type' | 'default-style' | 'refresh' | string;
594
- name?: string;
595
- };
520
+ meta: BaseAttr &
521
+ KTReactifyProps<{
522
+ charset?: string;
523
+ content?: string;
524
+ 'http-equiv'?: 'content-security-policy' | 'content-type' | 'default-style' | 'refresh' | string;
525
+ name?: string;
526
+ }>;
596
527
 
597
528
  // Meter element
598
- meter: BaseAttr & {
599
- form?: string;
600
- high?: number | string;
601
- low?: number | string;
602
- max?: number | string;
603
- min?: number | string;
604
- optimum?: number | string;
605
- value?: number | string;
606
- };
529
+ meter: BaseAttr &
530
+ KTReactifyProps<{
531
+ form?: string;
532
+ high?: number | string;
533
+ low?: number | string;
534
+ max?: number | string;
535
+ min?: number | string;
536
+ optimum?: number | string;
537
+ value?: number | string;
538
+ }>;
607
539
 
608
540
  // Object element
609
541
  object: BaseAttr &
610
- ImageElementEvents & {
542
+ KTReactifyProps<{
611
543
  data?: string;
612
544
  form?: string;
613
545
  height?: number | string;
@@ -615,60 +547,67 @@ interface AttributesMap {
615
547
  type?: string;
616
548
  usemap?: string;
617
549
  width?: number | string;
618
- };
550
+ }>;
619
551
 
620
552
  // OL element
621
- ol: BaseAttr & {
622
- reversed?: boolean;
623
- start?: number | string;
624
- type?: '1' | 'a' | 'A' | 'i' | 'I';
625
- };
553
+ ol: BaseAttr &
554
+ KTReactifyProps<{
555
+ reversed?: boolean;
556
+ start?: number | string;
557
+ type?: '1' | 'a' | 'A' | 'i' | 'I';
558
+ }>;
626
559
 
627
560
  // Optgroup element
628
- optgroup: BaseAttr & {
629
- disabled?: boolean;
630
- label?: string;
631
- };
561
+ optgroup: BaseAttr &
562
+ KTReactifyProps<{
563
+ disabled?: boolean;
564
+ label?: string;
565
+ }>;
632
566
 
633
567
  // Option element
634
- option: BaseAttr & {
635
- disabled?: boolean;
636
- label?: string;
637
- selected?: boolean;
638
- value?: string;
639
- };
568
+ option: BaseAttr &
569
+ KTReactifyProps<{
570
+ disabled?: boolean;
571
+ label?: string;
572
+ selected?: boolean;
573
+ value?: string;
574
+ }>;
640
575
 
641
576
  // Output element
642
- output: BaseAttr & {
643
- for?: string;
644
- form?: string;
645
- name?: string;
646
- };
577
+ output: BaseAttr &
578
+ KTReactifyProps<{
579
+ for?: string;
580
+ form?: string;
581
+ name?: string;
582
+ }>;
647
583
 
648
584
  // Picture element
649
- picture: BaseAttr & {};
585
+ picture: BaseAttr & KTReactifyProps<{}>;
650
586
 
651
587
  // Pre element
652
- pre: BaseAttr & {};
588
+ pre: BaseAttr & KTReactifyProps<{}>;
653
589
 
654
590
  // Progress element
655
- progress: BaseAttr & {
656
- max?: number | string;
657
- value?: number | string;
658
- };
591
+ progress: BaseAttr &
592
+ KTReactifyProps<{
593
+ max?: number | string;
594
+ value?: number | string;
595
+ }>;
659
596
 
660
597
  // Quote element (q and blockquote)
661
- q: BaseAttr & {
662
- cite?: string;
663
- };
598
+ q: BaseAttr &
599
+ KTReactifyProps<{
600
+ cite?: string;
601
+ }>;
664
602
 
665
- blockquote: BaseAttr & {
666
- cite?: string;
667
- };
603
+ blockquote: BaseAttr &
604
+ KTReactifyProps<{
605
+ cite?: string;
606
+ }>;
668
607
 
669
608
  // Script element
670
609
  script: BaseAttr &
671
- ImageElementEvents & {
610
+ KTReactifyProps<{
672
611
  async?: boolean;
673
612
  crossorigin?: 'anonymous' | 'use-credentials' | '';
674
613
  defer?: boolean;
@@ -685,112 +624,120 @@ interface AttributesMap {
685
624
  | 'unsafe-url';
686
625
  src?: string;
687
626
  type?: string;
688
- };
627
+ }>;
689
628
 
690
629
  // Select element
691
- select: BaseAttr & {
692
- autocomplete?: string;
693
- disabled?: boolean;
694
- form?: string;
695
- multiple?: boolean;
696
- name?: string;
697
- required?: boolean;
698
- size?: number | string;
699
- };
630
+ select: BaseAttr &
631
+ KTReactifyProps<{
632
+ autocomplete?: string;
633
+ disabled?: boolean;
634
+ form?: string;
635
+ multiple?: boolean;
636
+ name?: string;
637
+ required?: boolean;
638
+ size?: number | string;
639
+ }>;
700
640
 
701
641
  // Slot element
702
- slot: BaseAttr & {
703
- name?: string;
704
- };
642
+ slot: BaseAttr &
643
+ KTReactifyProps<{
644
+ name?: string;
645
+ }>;
705
646
 
706
647
  // Source element
707
- source: BaseAttr & {
708
- height?: number | string;
709
- media?: string;
710
- sizes?: string;
711
- src?: string;
712
- srcset?: string;
713
- type?: string;
714
- width?: number | string;
715
- };
648
+ source: BaseAttr &
649
+ KTReactifyProps<{
650
+ height?: number | string;
651
+ media?: string;
652
+ sizes?: string;
653
+ src?: string;
654
+ srcset?: string;
655
+ type?: string;
656
+ width?: number | string;
657
+ }>;
716
658
 
717
659
  // Style element
718
660
  style: BaseAttr &
719
- ImageElementEvents & {
661
+ KTReactifyProps<{
720
662
  media?: string;
721
- };
663
+ }>;
722
664
 
723
665
  // Table element
724
- table: BaseAttr & {};
666
+ table: BaseAttr & KTReactifyProps<{}>;
725
667
 
726
668
  // Table body/footer/header elements
727
- tbody: BaseAttr & {};
669
+ tbody: BaseAttr & KTReactifyProps<{}>;
728
670
 
729
- tfoot: BaseAttr & {};
671
+ tfoot: BaseAttr & KTReactifyProps<{}>;
730
672
 
731
- thead: BaseAttr & {};
673
+ thead: BaseAttr & KTReactifyProps<{}>;
732
674
 
733
675
  // Table cell elements
734
- td: BaseAttr & {
735
- colspan?: number | string;
736
- headers?: string;
737
- rowspan?: number | string;
738
- };
739
-
740
- th: BaseAttr & {
741
- abbr?: string;
742
- colspan?: number | string;
743
- headers?: string;
744
- rowspan?: number | string;
745
- scope?: 'row' | 'col' | 'rowgroup' | 'colgroup';
746
- };
676
+ td: BaseAttr &
677
+ KTReactifyProps<{
678
+ colspan?: number | string;
679
+ headers?: string;
680
+ rowspan?: number | string;
681
+ }>;
682
+
683
+ th: BaseAttr &
684
+ KTReactifyProps<{
685
+ abbr?: string;
686
+ colspan?: number | string;
687
+ headers?: string;
688
+ rowspan?: number | string;
689
+ scope?: 'row' | 'col' | 'rowgroup' | 'colgroup';
690
+ }>;
747
691
 
748
692
  // Template element
749
- template: BaseAttr & {};
693
+ template: BaseAttr & KTReactifyProps<{}>;
750
694
 
751
695
  // Textarea element
752
- textarea: BaseAttr & {
753
- autocomplete?: string;
754
- cols?: number | string;
755
- dirname?: string;
756
- disabled?: boolean;
757
- form?: string;
758
- maxlength?: number | string;
759
- minlength?: number | string;
760
- name?: string;
761
- placeholder?: string;
762
- readonly?: boolean;
763
- required?: boolean;
764
- rows?: number | string;
765
- wrap?: 'hard' | 'soft' | 'off';
766
- };
696
+ textarea: BaseAttr &
697
+ KTReactifyProps<{
698
+ autocomplete?: string;
699
+ cols?: number | string;
700
+ dirname?: string;
701
+ disabled?: boolean;
702
+ form?: string;
703
+ maxlength?: number | string;
704
+ minlength?: number | string;
705
+ name?: string;
706
+ placeholder?: string;
707
+ readonly?: boolean;
708
+ required?: boolean;
709
+ rows?: number | string;
710
+ wrap?: 'hard' | 'soft' | 'off';
711
+ }>;
767
712
 
768
713
  // Time element
769
- time: BaseAttr & {
770
- datetime?: string;
771
- };
714
+ time: BaseAttr &
715
+ KTReactifyProps<{
716
+ datetime?: string;
717
+ }>;
772
718
 
773
719
  // Title element
774
- title: BaseAttr & {};
720
+ title: BaseAttr & KTReactifyProps<{}>;
775
721
 
776
722
  // TR element
777
- tr: BaseAttr & {};
723
+ tr: BaseAttr & KTReactifyProps<{}>;
778
724
 
779
725
  // Track element
780
- track: BaseAttr & {
781
- default?: boolean;
782
- kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
783
- label?: string;
784
- src?: string;
785
- srclang?: string;
786
- };
726
+ track: BaseAttr &
727
+ KTReactifyProps<{
728
+ default?: boolean;
729
+ kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
730
+ label?: string;
731
+ src?: string;
732
+ srclang?: string;
733
+ }>;
787
734
 
788
735
  // UL element
789
- ul: BaseAttr & {};
736
+ ul: BaseAttr & KTReactifyProps<{}>;
790
737
 
791
738
  // Video element
792
739
  video: BaseAttr &
793
- MediaElementEvents & {
740
+ KTReactifyProps<{
794
741
  autoplay?: boolean;
795
742
  controls?: boolean;
796
743
  crossorigin?: 'anonymous' | 'use-credentials' | '';
@@ -802,58 +749,58 @@ interface AttributesMap {
802
749
  preload?: 'none' | 'metadata' | 'auto' | '';
803
750
  src?: string;
804
751
  width?: number | string;
805
- };
752
+ }>;
806
753
 
807
754
  // Generic HTMLElement (no specific attributes beyond BaseEvent)
808
- abbr: BaseAttr & {};
809
- address: BaseAttr & {};
810
- article: BaseAttr & {};
811
- aside: BaseAttr & {};
812
- b: BaseAttr & {};
813
- bdi: BaseAttr & {};
814
- bdo: BaseAttr & {};
815
- cite: BaseAttr & {};
816
- code: BaseAttr & {};
817
- dd: BaseAttr & {};
818
- dfn: BaseAttr & {};
819
- div: BaseAttr & {};
820
- dl: BaseAttr & {};
821
- dt: BaseAttr & {};
822
- em: BaseAttr & {};
823
- figcaption: BaseAttr & {};
824
- figure: BaseAttr & {};
825
- footer: BaseAttr & {};
826
- h1: BaseAttr & {};
827
- h2: BaseAttr & {};
828
- h3: BaseAttr & {};
829
- h4: BaseAttr & {};
830
- h5: BaseAttr & {};
831
- h6: BaseAttr & {};
832
- header: BaseAttr & {};
833
- hgroup: BaseAttr & {};
834
- i: BaseAttr & {};
835
- kbd: BaseAttr & {};
836
- main: BaseAttr & {};
837
- mark: BaseAttr & {};
838
- nav: BaseAttr & {};
839
- noscript: BaseAttr & {};
840
- p: BaseAttr & {};
841
- rp: BaseAttr & {};
842
- rt: BaseAttr & {};
843
- ruby: BaseAttr & {};
844
- s: BaseAttr & {};
845
- samp: BaseAttr & {};
846
- search: BaseAttr & {};
847
- section: BaseAttr & {};
848
- small: BaseAttr & {};
849
- span: BaseAttr & {};
850
- strong: BaseAttr & {};
851
- sub: BaseAttr & {};
852
- summary: BaseAttr & {};
853
- sup: BaseAttr & {};
854
- u: BaseAttr & {};
855
- var: BaseAttr & {};
856
- wbr: BaseAttr & {};
755
+ abbr: BaseAttr & KTReactifyProps<{}>;
756
+ address: BaseAttr & KTReactifyProps<{}>;
757
+ article: BaseAttr & KTReactifyProps<{}>;
758
+ aside: BaseAttr & KTReactifyProps<{}>;
759
+ b: BaseAttr & KTReactifyProps<{}>;
760
+ bdi: BaseAttr & KTReactifyProps<{}>;
761
+ bdo: BaseAttr & KTReactifyProps<{}>;
762
+ cite: BaseAttr & KTReactifyProps<{}>;
763
+ code: BaseAttr & KTReactifyProps<{}>;
764
+ dd: BaseAttr & KTReactifyProps<{}>;
765
+ dfn: BaseAttr & KTReactifyProps<{}>;
766
+ div: BaseAttr & KTReactifyProps<{}>;
767
+ dl: BaseAttr & KTReactifyProps<{}>;
768
+ dt: BaseAttr & KTReactifyProps<{}>;
769
+ em: BaseAttr & KTReactifyProps<{}>;
770
+ figcaption: BaseAttr & KTReactifyProps<{}>;
771
+ figure: BaseAttr & KTReactifyProps<{}>;
772
+ footer: BaseAttr & KTReactifyProps<{}>;
773
+ h1: BaseAttr & KTReactifyProps<{}>;
774
+ h2: BaseAttr & KTReactifyProps<{}>;
775
+ h3: BaseAttr & KTReactifyProps<{}>;
776
+ h4: BaseAttr & KTReactifyProps<{}>;
777
+ h5: BaseAttr & KTReactifyProps<{}>;
778
+ h6: BaseAttr & KTReactifyProps<{}>;
779
+ header: BaseAttr & KTReactifyProps<{}>;
780
+ hgroup: BaseAttr & KTReactifyProps<{}>;
781
+ i: BaseAttr & KTReactifyProps<{}>;
782
+ kbd: BaseAttr & KTReactifyProps<{}>;
783
+ main: BaseAttr & KTReactifyProps<{}>;
784
+ mark: BaseAttr & KTReactifyProps<{}>;
785
+ nav: BaseAttr & KTReactifyProps<{}>;
786
+ noscript: BaseAttr & KTReactifyProps<{}>;
787
+ p: BaseAttr & KTReactifyProps<{}>;
788
+ rp: BaseAttr & KTReactifyProps<{}>;
789
+ rt: BaseAttr & KTReactifyProps<{}>;
790
+ ruby: BaseAttr & KTReactifyProps<{}>;
791
+ s: BaseAttr & KTReactifyProps<{}>;
792
+ samp: BaseAttr & KTReactifyProps<{}>;
793
+ search: BaseAttr & KTReactifyProps<{}>;
794
+ section: BaseAttr & KTReactifyProps<{}>;
795
+ small: BaseAttr & KTReactifyProps<{}>;
796
+ span: BaseAttr & KTReactifyProps<{}>;
797
+ strong: BaseAttr & KTReactifyProps<{}>;
798
+ sub: BaseAttr & KTReactifyProps<{}>;
799
+ summary: BaseAttr & KTReactifyProps<{}>;
800
+ sup: BaseAttr & KTReactifyProps<{}>;
801
+ u: BaseAttr & KTReactifyProps<{}>;
802
+ var: BaseAttr & KTReactifyProps<{}>;
803
+ wbr: BaseAttr & KTReactifyProps<{}>;
857
804
 
858
805
  svg: BaseAttr & {
859
806
  class?: string;
@@ -1274,74 +1221,33 @@ declare global {
1274
1221
  tspan: SVGAttributesMap['tspan'];
1275
1222
  use: SVGAttributesMap['use'];
1276
1223
  view: SVGAttributesMap['view'];
1277
-
1278
- // 'svg:svg': AttributesMap['svg'];
1279
- // 'svg:a': SVGAttributesMap['a'];
1280
- // 'svg:animate': SVGAttributesMap['animate'];
1281
- // 'svg:animateMotion': SVGAttributesMap['animateMotion'];
1282
- // 'svg:animateTransform': SVGAttributesMap['animateTransform'];
1283
- // 'svg:circle': SVGAttributesMap['circle'];
1284
- // 'svg:clipPath': SVGAttributesMap['clipPath'];
1285
- // 'svg:defs': SVGAttributesMap['defs'];
1286
- // 'svg:desc': SVGAttributesMap['desc'];
1287
- // 'svg:ellipse': SVGAttributesMap['ellipse'];
1288
- // 'svg:feBlend': SVGAttributesMap['feBlend'];
1289
- // 'svg:feColorMatrix': SVGAttributesMap['feColorMatrix'];
1290
- // 'svg:feComponentTransfer': SVGAttributesMap['feComponentTransfer'];
1291
- // 'svg:feComposite': SVGAttributesMap['feComposite'];
1292
- // 'svg:feConvolveMatrix': SVGAttributesMap['feConvolveMatrix'];
1293
- // 'svg:feDiffuseLighting': SVGAttributesMap['feDiffuseLighting'];
1294
- // 'svg:feDisplacementMap': SVGAttributesMap['feDisplacementMap'];
1295
- // 'svg:feDistantLight': SVGAttributesMap['feDistantLight'];
1296
- // 'svg:feDropShadow': SVGAttributesMap['feDropShadow'];
1297
- // 'svg:feFlood': SVGAttributesMap['feFlood'];
1298
- // 'svg:feFuncA': SVGAttributesMap['feFuncA'];
1299
- // 'svg:feFuncB': SVGAttributesMap['feFuncB'];
1300
- // 'svg:feFuncG': SVGAttributesMap['feFuncG'];
1301
- // 'svg:feFuncR': SVGAttributesMap['feFuncR'];
1302
- // 'svg:feGaussianBlur': SVGAttributesMap['feGaussianBlur'];
1303
- // 'svg:feImage': SVGAttributesMap['feImage'];
1304
- // 'svg:feMerge': SVGAttributesMap['feMerge'];
1305
- // 'svg:feMergeNode': SVGAttributesMap['feMergeNode'];
1306
- // 'svg:feMorphology': SVGAttributesMap['feMorphology'];
1307
- // 'svg:feOffset': SVGAttributesMap['feOffset'];
1308
- // 'svg:fePointLight': SVGAttributesMap['fePointLight'];
1309
- // 'svg:feSpecularLighting': SVGAttributesMap['feSpecularLighting'];
1310
- // 'svg:feSpotLight': SVGAttributesMap['feSpotLight'];
1311
- // 'svg:feTile': SVGAttributesMap['feTile'];
1312
- // 'svg:feTurbulence': SVGAttributesMap['feTurbulence'];
1313
- // 'svg:filter': SVGAttributesMap['filter'];
1314
- // 'svg:foreignObject': SVGAttributesMap['foreignObject'];
1315
- // 'svg:g': SVGAttributesMap['g'];
1316
- // 'svg:image': SVGAttributesMap['image'];
1317
- // 'svg:line': SVGAttributesMap['line'];
1318
- // 'svg:linearGradient': SVGAttributesMap['linearGradient'];
1319
- // 'svg:marker': SVGAttributesMap['marker'];
1320
- // 'svg:mask': SVGAttributesMap['mask'];
1321
- // 'svg:metadata': SVGAttributesMap['metadata'];
1322
- // 'svg:mpath': SVGAttributesMap['mpath'];
1323
- // 'svg:path': SVGAttributesMap['path'];
1324
- // 'svg:pattern': SVGAttributesMap['pattern'];
1325
- // 'svg:polygon': SVGAttributesMap['polygon'];
1326
- // 'svg:polyline': SVGAttributesMap['polyline'];
1327
- // 'svg:radialGradient': SVGAttributesMap['radialGradient'];
1328
- // 'svg:rect': SVGAttributesMap['rect'];
1329
- // 'svg:set': SVGAttributesMap['set'];
1330
- // 'svg:stop': SVGAttributesMap['stop'];
1331
- // 'svg:switch': SVGAttributesMap['switch'];
1332
- // 'svg:symbol': SVGAttributesMap['symbol'];
1333
- // 'svg:text': SVGAttributesMap['text'];
1334
- // 'svg:textPath': SVGAttributesMap['textPath'];
1335
- // 'svg:tspan': SVGAttributesMap['tspan'];
1336
- // 'svg:use': SVGAttributesMap['use'];
1337
- // 'svg:view': SVGAttributesMap['view'];
1338
1224
  }
1339
1225
 
1340
- interface IntrinsicAttributes {
1226
+ type IntrinsicAttributes = {
1227
+ /**
1228
+ * Make a reference to the created element
1229
+ */
1341
1230
  ref?: KTRef<any>;
1231
+
1232
+ /**
1233
+ * Conditional rendering
1234
+ * - Provide a `KTRef` to make it reactive
1235
+ */
1342
1236
  'k-if'?: any;
1237
+
1238
+ /**
1239
+ * 2-way binding
1240
+ * - Provide a `KTRef` to make it reactive
1241
+ */
1242
+ 'k-model'?: KTRef<any>;
1243
+
1244
+ /**
1245
+ * Raw html binding
1246
+ * - Provide a `KTRef` to make it reactive
1247
+ */
1248
+ 'k-html'?: any;
1343
1249
  children?: KTRawContent;
1344
- }
1250
+ };
1345
1251
 
1346
1252
  interface ElementChildrenAttribute {
1347
1253
  children: {};
@@ -1349,12 +1255,31 @@ declare global {
1349
1255
  }
1350
1256
  }
1351
1257
 
1258
+ interface KTMuiButtonProps {
1259
+ class?: string;
1260
+ style?: string | Partial<CSSStyleDeclaration>;
1261
+ children?: string | HTMLElement | JSX.Element | Array<string | HTMLElement | JSX.Element>;
1262
+ variant?: 'contained' | 'outlined' | 'text';
1263
+ color?: 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
1264
+ size?: 'small' | 'medium' | 'large';
1265
+ disabled?: boolean | KTReactive<boolean>;
1266
+ fullWidth?: boolean;
1267
+ iconOnly?: boolean;
1268
+ startIcon?: SVGElement | HTMLElement | JSX.Element;
1269
+ endIcon?: SVGElement | HTMLElement | JSX.Element;
1270
+ type?: 'button' | 'submit' | 'reset';
1271
+ }
1272
+ /**
1273
+ * Button component - mimics MUI Button appearance and behavior
1274
+ */
1275
+ declare function Button(props: KTMuiButtonProps & KTPrefixedEventAttribute): JSX.Element;
1276
+
1352
1277
  interface KTMuiCheckboxProps {
1353
- value: string;
1278
+ value?: string;
1354
1279
  label?: string | JSX.Element | HTMLElement;
1355
1280
  checked?: boolean;
1356
1281
  size?: 'small' | 'medium';
1357
- 'kt:change'?: ((checked: boolean, value: string) => void) | KTRef<boolean>;
1282
+ 'on:change'?: (checked: boolean, value: string) => void;
1358
1283
  disabled?: boolean;
1359
1284
  color?: 'primary' | 'secondary' | 'default' | 'success' | 'error' | 'warning';
1360
1285
  indeterminate?: boolean;
@@ -1365,8 +1290,8 @@ interface KTMuiCheckboxGroupProps {
1365
1290
  style?: string;
1366
1291
  value?: string[];
1367
1292
  size?: 'small' | 'medium';
1368
- options: KTMuiCheckboxProps[];
1369
- 'kt:change'?: ((values: string[]) => void) | KTRef<string[]>;
1293
+ options: (Omit<KTMuiCheckboxProps, 'value'> & { value: string })[];
1294
+ 'on:change'?: (values: string[]) => void;
1370
1295
  row?: boolean;
1371
1296
  }
1372
1297
 
@@ -1376,12 +1301,7 @@ type KTMuiCheckbox = JSX.Element & {
1376
1301
  disabled: boolean;
1377
1302
  };
1378
1303
 
1379
- type KTMuiCheckboxGroup = JSX.Element & {
1380
- value: string[];
1381
- disabled: boolean[];
1382
- disableAll: () => void;
1383
- enableAll: () => void;
1384
- };
1304
+ type KTMuiCheckboxGroup = JSX.Element & {};
1385
1305
 
1386
1306
  /**
1387
1307
  * Checkbox component - mimics MUI Checkbox appearance and behavior
@@ -1392,21 +1312,21 @@ declare function Checkbox(props: KTMuiCheckboxProps): KTMuiCheckbox;
1392
1312
  */
1393
1313
  declare function CheckboxGroup(props: KTMuiCheckboxGroupProps): KTMuiCheckboxGroup;
1394
1314
 
1315
+ type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;
1395
1316
  interface KTMuiDialogProps {
1396
- open?: boolean;
1397
- 'kt:close'?: () => void;
1317
+ /**
1318
+ * Controls whether the dialog is open or closed
1319
+ * - Provide a `KTReactive` to make it reactive
1320
+ */
1321
+ open?: boolean | KTReactive<boolean>;
1322
+ 'on:close'?: () => void;
1398
1323
  title?: string;
1399
1324
  children?: HTMLElement | HTMLElement[] | JSX.Element | JSX.Element[] | string;
1400
1325
  actions?: HTMLElement | HTMLElement[];
1401
- maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;
1402
- fullWidth?: boolean;
1326
+ size?: DialogSize | KTReactive<DialogSize>;
1327
+ fullWidth?: boolean | KTReactive<boolean>;
1403
1328
  }
1404
- type KTMuiDialog = JSX.Element & {
1405
- /**
1406
- * Controls whether the dialog is open or closed
1407
- */
1408
- open: boolean;
1409
- };
1329
+ type KTMuiDialog = JSX.Element;
1410
1330
  /**
1411
1331
  * Dialog component - mimics MUI Dialog appearance and behavior
1412
1332
  * Only handles open/close state, title and content are passed as props
@@ -1435,15 +1355,7 @@ interface LinearProgressProps {
1435
1355
  progress?: number;
1436
1356
  color?: 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
1437
1357
  }
1438
- type KTMuiLinearProgress = JSX.Element & {
1439
- /**
1440
- * Reactive property to get or set the current progress value (0-100)
1441
- */
1442
- progress: number;
1443
- };
1444
- /**
1445
- * LinearProgress component - mimics MUI LinearProgress appearance and behavior
1446
- */
1358
+ type KTMuiLinearProgress = JSX.Element & {};
1447
1359
  declare function LinearProgress(props: LinearProgressProps): KTMuiLinearProgress;
1448
1360
 
1449
1361
  type ChangeHandler<T = string> = (value: T, ...args: any[]) => void;
@@ -1451,90 +1363,102 @@ type ChangeHandler<T = string> = (value: T, ...args: any[]) => void;
1451
1363
  type InputTypes = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
1452
1364
 
1453
1365
  interface KTMuiTextFieldProps<T extends InputTypes = 'text'> {
1366
+ /**
1367
+ * Two-way binding for the input value
1368
+ * - Provide a `KTReactive` to make it reactive
1369
+ */
1370
+ 'k-model'?: T extends 'number' ? KTReactive<number> : KTReactive<string>;
1371
+
1454
1372
  class?: string;
1455
1373
  style?: string | Partial<CSSStyleDeclaration>;
1456
- label?: string;
1457
- placeholder?: string;
1374
+ /**
1375
+ * Label text for the input field
1376
+ * - Provide a `KTReactive` to make it reactive
1377
+ */
1378
+ label?: string | KTReactive<string>;
1379
+ /**
1380
+ * Placeholder text for the input field
1381
+ * - Provide a `KTReactive` to make it reactive
1382
+ */
1383
+ placeholder?: string | KTReactive<string>;
1384
+ /**
1385
+ * Current value of the input field
1386
+ * - Provide a `KTReactive` to make it reactive
1387
+ * - If both `value` and `k-model` are provided, `k-model` takes precedence
1388
+ */
1458
1389
  value?: any;
1459
- type?: T;
1460
- disabled?: boolean;
1461
- readonly?: boolean;
1462
- required?: boolean;
1463
- error?: boolean;
1464
- helperText?: string;
1465
- fullWidth?: boolean;
1466
- multiline?: boolean;
1467
- rows?: number;
1468
- size?: 'small' | 'medium';
1469
- 'kt:input'?: T extends 'number' ? ChangeHandler<number> | KTRef<number> : ChangeHandler | KTRef<string>;
1470
- 'kt-trim:input'?: T extends 'number' ? ChangeHandler<number> | KTRef<number> : ChangeHandler | KTRef<string>;
1471
- 'kt:change'?: T extends 'number' ? ChangeHandler<number> | KTRef<number> : ChangeHandler | KTRef<string>;
1472
- 'kt-trim:change'?: T extends 'number' ? ChangeHandler<number> | KTRef<number> : ChangeHandler | KTRef<string>;
1473
- 'kt:blur'?: () => void;
1474
- 'kt:focus'?: () => void;
1475
- }
1476
-
1477
- type KTMuiTextField = JSX.Element & {
1478
1390
  /**
1479
- * Reactive `value` of the input field
1391
+ * Type of the input field
1392
+ * - Provide a `KTReactive` to make it reactive
1480
1393
  */
1481
- value: string;
1482
-
1394
+ type?: T | KTReactive<T>;
1483
1395
  /**
1484
- * Reactive `label` of the input field
1396
+ * Whether the input is disabled
1397
+ * - Provide a `KTReactive` to make it reactive
1485
1398
  */
1486
- label: string;
1487
-
1399
+ disabled?: boolean | KTReactive<boolean>;
1488
1400
  /**
1489
- * Reactive `placeholder` of the input field
1401
+ * Whether the input is readonly
1402
+ * - Provide a `KTReactive` to make it reactive
1403
+ *
1404
+ * __Note:__ The correct prop name is `readOnly` with a capital "O". Same as it is in DOM.
1490
1405
  */
1491
- placeholder: string;
1492
-
1406
+ readOnly?: boolean | KTReactive<boolean>;
1493
1407
  /**
1494
- * Reactive `type` of the input field
1408
+ * Whether the input is required
1409
+ * - Provide a `KTReactive` to make it reactive
1495
1410
  */
1496
- type: string;
1497
-
1411
+ required?: boolean | KTReactive<boolean>;
1498
1412
  /**
1499
- * Reactive `disabled` state of the input field
1413
+ * Whether the input is in error state
1414
+ * - Provide a `KTReactive` to make it reactive
1500
1415
  */
1501
- disabled: boolean;
1502
-
1416
+ error?: boolean | KTReactive<boolean>;
1503
1417
  /**
1504
- * Reactive `readonly` state of the input field
1418
+ * Helper text displayed below the input
1419
+ * - Provide a `KTReactive` to make it reactive
1505
1420
  */
1506
- readonly: boolean;
1507
-
1421
+ helperText?: string | KTReactive<string>;
1508
1422
  /**
1509
- * `required` state of the input field
1510
- * @readonly
1423
+ * Whether the input should take full width
1424
+ * - Provide a `KTReactive` to make it reactive
1511
1425
  */
1512
- readonly required: boolean;
1513
-
1426
+ fullWidth?: boolean | KTReactive<boolean>;
1514
1427
  /**
1515
- * Reactive `error` state of the input field
1428
+ * Whether the input is multiline (textarea)
1429
+ * - Provide a `KTReactive` to make it reactive
1516
1430
  */
1517
- error: boolean;
1518
-
1431
+ multiline?: boolean | KTReactive<boolean>;
1519
1432
  /**
1520
- * Reactive `helperText` of the input field
1433
+ * Number of rows for multiline input
1434
+ * - Provide a `KTReactive` to make it reactive
1521
1435
  */
1522
- helperText: string;
1523
- };
1436
+ rows?: number | KTReactive<number>;
1437
+ /**
1438
+ * Size of the input field
1439
+ * - Provide a `KTReactive` to make it reactive
1440
+ */
1441
+ size?: 'small' | 'medium' | KTReactive<'small' | 'medium'>;
1442
+ 'on:input'?: ChangeHandler<T extends 'number' ? number : string>;
1443
+ 'on-trim:input'?: ChangeHandler<T extends 'number' ? number : string>;
1444
+ 'on:change'?: ChangeHandler<T extends 'number' ? number : string>;
1445
+ 'on-trim:change'?: ChangeHandler<T extends 'number' ? number : string>;
1446
+ 'on:blur'?: () => void;
1447
+ 'on:focus'?: () => void;
1448
+ }
1524
1449
 
1525
- /**
1526
- * TextField component - mimics MUI TextField appearance and behavior
1527
- */
1528
- declare function TextField<T extends InputTypes>(props: KTMuiTextFieldProps<T>): KTMuiTextField;
1450
+ type KTMuiTextField = JSX.Element;
1451
+
1452
+ declare function TextField<T extends InputTypes = 'text'>(props: KTMuiTextFieldProps<T>): KTMuiTextField;
1529
1453
 
1530
1454
  interface KTMuiRadioProps {
1531
1455
  class?: string;
1532
1456
  style?: string | Partial<CSSStyleDeclaration>;
1533
1457
  value: string;
1534
- label: string | JSX.Element | HTMLElement;
1458
+ label: string | JSX.Element | HTMLElement | KTReactive<string | JSX.Element | HTMLElement>;
1535
1459
  checked?: boolean;
1536
1460
  size?: 'small' | 'medium';
1537
- 'kt:change'?: (checked: boolean, value: string) => void;
1461
+ 'on:change'?: (checked: boolean, value: string) => void;
1538
1462
  disabled?: boolean;
1539
1463
  color?: 'primary' | 'secondary' | 'default';
1540
1464
  }
@@ -1546,8 +1470,8 @@ interface KTMuiRadioGroupProps {
1546
1470
  name?: string;
1547
1471
  size?: 'small' | 'medium';
1548
1472
  options: KTMuiRadioProps[];
1549
- 'kt:change'?: ((value: string) => void) | KTRef<string>;
1550
- 'kt:click'?: (checked: boolean) => void;
1473
+ 'on:change'?: (value: string) => void;
1474
+ 'on:click'?: (checked: boolean) => void;
1551
1475
  row?: boolean;
1552
1476
  }
1553
1477
 
@@ -1579,37 +1503,60 @@ declare function Radio(props: KTMuiRadioProps): KTMuiRadio;
1579
1503
  */
1580
1504
  declare function RadioGroup(props: KTMuiRadioGroupProps): KTMuiRadioGroup;
1581
1505
 
1506
+ interface KTMuiProps {
1507
+ class?: string | KTReactive<string>;
1508
+ style?: string | Partial<CSSStyleDeclaration> | KTReactive<string> | KTReactive<Partial<CSSStyleDeclaration>>;
1509
+ children?: JSX.Element | JSX.Element[];
1510
+ }
1511
+
1582
1512
  interface KTMuiSelectOption {
1583
1513
  value: string;
1584
1514
  label: string;
1585
1515
  }
1586
- interface KTMuiSelectProps {
1587
- class?: string;
1588
- style?: string | Partial<CSSStyleDeclaration>;
1516
+ interface KTMuiSelectProps extends KTMuiProps {
1589
1517
  size?: 'small' | 'medium';
1590
1518
  value?: string;
1591
- options: KTMuiSelectOption[];
1592
- label?: string;
1519
+ options: KTMuiSelectOption[] | KTReactive<KTMuiSelectOption[]>;
1520
+ label?: string | KTReactive<string>;
1593
1521
  placeholder?: string;
1594
- 'kt:change'?: (value: string) => void;
1522
+ 'on:change'?: (value: string) => void;
1595
1523
  fullWidth?: boolean;
1596
- disabled?: boolean;
1524
+ disabled?: boolean | KTReactive<boolean>;
1597
1525
  }
1598
- type KTMuiSelect = JSX.Element & {
1599
- /**
1600
- * Reactive `value` of the select component
1601
- */
1602
- value: string;
1603
- /**
1604
- * Reactive `disabled` state of the select component
1605
- */
1606
- disabled: boolean;
1607
- };
1526
+ type KTMuiSelect = JSX.Element & {};
1608
1527
  /**
1609
1528
  * Select component - mimics MUI Select appearance and behavior
1610
1529
  */
1611
1530
  declare function Select(props: KTMuiSelectProps): KTMuiSelect;
1612
1531
 
1532
+ interface KTMuiCardProps extends KTMuiProps {
1533
+ variant?: 'elevation' | 'outlined' | 'contained';
1534
+ elevation?: number | KTReactive<number>;
1535
+ square?: boolean | KTReactive<boolean>;
1536
+ raised?: boolean | KTReactive<boolean>;
1537
+ 'on:click'?: (event: MouseEvent) => void;
1538
+ }
1539
+ type KTMuiCard = JSX.Element & {};
1540
+ /**
1541
+ * Card component - mimics MUI Card appearance and behavior
1542
+ */
1543
+ declare function Card(props: KTMuiCardProps): KTMuiCard;
1544
+
1545
+ interface KTMuiSwitchProps extends KTMuiProps {
1546
+ checked?: boolean;
1547
+ value?: string;
1548
+ label?: string;
1549
+ disabled?: boolean;
1550
+ color?: 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
1551
+ size?: 'small' | 'medium' | 'large';
1552
+ 'on:change'?: (checked: boolean, value?: string) => void;
1553
+ }
1554
+ type KTMuiSwitch = JSX.Element & {};
1555
+ /**
1556
+ * Switch component - mimics MUI Switch appearance and behavior
1557
+ */
1558
+ declare function Switch(props: KTMuiSwitchProps): KTMuiSwitch;
1559
+
1613
1560
  declare function DownloadIcon(props: KTAttribute): JSX.Element;
1614
1561
 
1615
1562
  declare function CompressIcon(props: KTAttribute): JSX.Element;
@@ -1654,5 +1601,5 @@ declare function ContentCopyIcon(props: KTAttribute): JSX.Element;
1654
1601
 
1655
1602
  declare function SelectAllIcon(props: KTAttribute): JSX.Element;
1656
1603
 
1657
- export { Alert, Button, Checkbox, CheckboxGroup, ColorLensIcon, CompressIcon, ContentCopyIcon, ContentPasteIcon, DeleteIcon, Dialog, DownloadIcon, ExpandMoreIcon, FileOpenIcon, FolderOpenIcon, FormLabel, HomeIcon, LinearProgress, MenuIcon, NewReleasesIcon, PlayArrowIcon, QueuePlayNextIcon, Radio, RadioGroup, SaveIcon, Select, SelectAllIcon, SettingsIcon, StopIcon, SubtitlesIcon, TextField, UploadFileIcon, VideoFileIcon, WallpaperIcon };
1658
- export type { KTMuiDialog, KTMuiLinearProgress, KTMuiRadio, KTMuiRadioGroup, KTMuiRadioProps, KTMuiSelectProps, KTMuiTextField, KTMuiTextFieldProps };
1604
+ export { Alert, Button, Card, Checkbox, CheckboxGroup, ColorLensIcon, CompressIcon, ContentCopyIcon, ContentPasteIcon, DeleteIcon, Dialog, DownloadIcon, ExpandMoreIcon, FileOpenIcon, FolderOpenIcon, FormLabel, HomeIcon, LinearProgress, MenuIcon, NewReleasesIcon, PlayArrowIcon, QueuePlayNextIcon, Radio, RadioGroup, SaveIcon, Select, SelectAllIcon, SettingsIcon, StopIcon, SubtitlesIcon, Switch, TextField, UploadFileIcon, VideoFileIcon, WallpaperIcon };
1605
+ export type { KTMuiCard, KTMuiCardProps, KTMuiDialog, KTMuiLinearProgress, KTMuiRadio, KTMuiRadioGroup, KTMuiRadioProps, KTMuiSelectProps, KTMuiSwitch, KTMuiSwitchProps, KTMuiTextField, KTMuiTextFieldProps };