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