ui-ingredients 0.0.19 → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. package/README.md +1 -1
  2. package/dist/collapsible/root.svelte +2 -2
  3. package/dist/collapsible/trigger.svelte +2 -2
  4. package/dist/date-picker/anatomy.js +3 -0
  5. package/dist/date-picker/clear-trigger.svelte +19 -2
  6. package/dist/date-picker/clear-trigger.svelte.d.ts +3 -3
  7. package/dist/date-picker/content.svelte +19 -2
  8. package/dist/date-picker/content.svelte.d.ts +3 -3
  9. package/dist/date-picker/context.svelte.d.ts +8 -8
  10. package/dist/date-picker/context.svelte.js +6 -14
  11. package/dist/date-picker/control.svelte +19 -2
  12. package/dist/date-picker/control.svelte.d.ts +3 -3
  13. package/dist/date-picker/create-date-picker.svelte.d.ts +14 -0
  14. package/dist/date-picker/create-date-picker.svelte.js +24 -0
  15. package/dist/date-picker/date-picker.d.ts +3 -3
  16. package/dist/date-picker/date-picker.js +3 -3
  17. package/dist/date-picker/day-table-cell-trigger.svelte +21 -2
  18. package/dist/date-picker/day-table-cell-trigger.svelte.d.ts +3 -3
  19. package/dist/date-picker/day-table-cell.svelte +40 -2
  20. package/dist/date-picker/day-table-cell.svelte.d.ts +3 -3
  21. package/dist/date-picker/index.d.ts +29 -0
  22. package/dist/date-picker/index.js +2 -0
  23. package/dist/date-picker/input.svelte +18 -2
  24. package/dist/date-picker/input.svelte.d.ts +3 -3
  25. package/dist/date-picker/label.svelte +20 -2
  26. package/dist/date-picker/label.svelte.d.ts +3 -3
  27. package/dist/date-picker/month-select.svelte +40 -2
  28. package/dist/date-picker/month-select.svelte.d.ts +3 -3
  29. package/dist/date-picker/month-table-cell-trigger.svelte +21 -2
  30. package/dist/date-picker/month-table-cell-trigger.svelte.d.ts +3 -3
  31. package/dist/date-picker/month-table-cell.svelte +40 -2
  32. package/dist/date-picker/month-table-cell.svelte.d.ts +3 -3
  33. package/dist/date-picker/next-trigger.svelte +21 -2
  34. package/dist/date-picker/next-trigger.svelte.d.ts +3 -3
  35. package/dist/date-picker/positioner.svelte +19 -2
  36. package/dist/date-picker/positioner.svelte.d.ts +3 -3
  37. package/dist/date-picker/preset-trigger.svelte +21 -2
  38. package/dist/date-picker/preset-trigger.svelte.d.ts +3 -3
  39. package/dist/date-picker/prev-trigger.svelte +21 -2
  40. package/dist/date-picker/prev-trigger.svelte.d.ts +3 -3
  41. package/dist/date-picker/range-text.svelte +23 -2
  42. package/dist/date-picker/range-text.svelte.d.ts +3 -3
  43. package/dist/date-picker/root.svelte +85 -2
  44. package/dist/date-picker/root.svelte.d.ts +3 -3
  45. package/dist/date-picker/table-body.svelte +21 -2
  46. package/dist/date-picker/table-body.svelte.d.ts +3 -3
  47. package/dist/date-picker/table-head.svelte +21 -2
  48. package/dist/date-picker/table-head.svelte.d.ts +3 -3
  49. package/dist/date-picker/table-header.svelte +21 -2
  50. package/dist/date-picker/table-header.svelte.d.ts +3 -3
  51. package/dist/date-picker/table-row.svelte +21 -2
  52. package/dist/date-picker/table-row.svelte.d.ts +3 -3
  53. package/dist/date-picker/table.svelte +31 -2
  54. package/dist/date-picker/table.svelte.d.ts +3 -3
  55. package/dist/date-picker/trigger.svelte +19 -2
  56. package/dist/date-picker/trigger.svelte.d.ts +3 -3
  57. package/dist/date-picker/view-control.svelte +21 -2
  58. package/dist/date-picker/view-control.svelte.d.ts +3 -3
  59. package/dist/date-picker/view.svelte +24 -0
  60. package/dist/date-picker/{view-trigger.svelte.d.ts → view.svelte.d.ts} +5 -5
  61. package/dist/date-picker/year-select.svelte +40 -2
  62. package/dist/date-picker/year-select.svelte.d.ts +3 -3
  63. package/dist/date-picker/year-table-cell-trigger.svelte +21 -2
  64. package/dist/date-picker/year-table-cell-trigger.svelte.d.ts +3 -3
  65. package/dist/date-picker/year-table-cell.svelte +40 -2
  66. package/dist/date-picker/year-table-cell.svelte.d.ts +3 -3
  67. package/package.json +2 -2
  68. package/dist/date-picker/view-trigger.svelte +0 -3
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const MonthTableCellTrigger: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const MonthTableCellTrigger: $$__sveltets_2_IsomorphicComponent<DatePickerMonthTableCellTriggerProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type MonthTableCellTrigger = InstanceType<typeof MonthTableCellTrigger>;
18
18
  export default MonthTableCellTrigger;
@@ -1,3 +1,41 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {Assign, HtmlProps} from '../types.js';
3
+ import type {TableCellProps, TableCellState} from '@zag-js/date-picker';
4
+ import type {Snippet} from 'svelte';
2
5
 
3
- <script lang="ts"></script>
6
+ export interface DatePickerMonthTableCellProps
7
+ extends Assign<Omit<HtmlProps<'div'>, 'children'>, TableCellProps> {
8
+ children?: Snippet<[state: TableCellState]>;
9
+ }
10
+ </script>
11
+
12
+ <script lang="ts">
13
+ import {mergeProps} from '@zag-js/svelte';
14
+ import {datePickerContext, datePickerTableCellPropsContext} from './context.svelte.js';
15
+
16
+ let {
17
+ /**/
18
+ value,
19
+ disabled,
20
+ columns,
21
+ children,
22
+ ...props
23
+ }: DatePickerMonthTableCellProps = $props();
24
+
25
+ let context = datePickerContext.get();
26
+
27
+ let tableCellProps: TableCellProps = $derived({
28
+ value,
29
+ disabled,
30
+ columns,
31
+ });
32
+
33
+ let state = $derived(context.getMonthTableCellState(tableCellProps));
34
+ let attrs = $derived(mergeProps(props, context.getMonthTableCellProps(tableCellProps)));
35
+
36
+ datePickerTableCellPropsContext.set(() => tableCellProps);
37
+ </script>
38
+
39
+ <div {...attrs}>
40
+ {@render children?.(state)}
41
+ </div>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const MonthTableCell: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const MonthTableCell: $$__sveltets_2_IsomorphicComponent<DatePickerMonthTableCellProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type MonthTableCell = InstanceType<typeof MonthTableCell>;
18
18
  export default MonthTableCell;
@@ -1,3 +1,22 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
2
3
 
3
- <script lang="ts"></script>
4
+ export interface DatePickerNextTriggerProps extends HtmlProps<'button'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {datePickerContext, datePickerViewPropsContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: DatePickerNextTriggerProps = $props();
12
+
13
+ let context = datePickerContext.get();
14
+
15
+ let viewProps = datePickerViewPropsContext.get();
16
+
17
+ let attrs = $derived(mergeProps(props, context.getNextTriggerProps(viewProps)));
18
+ </script>
19
+
20
+ <button type="button" {...attrs}>
21
+ {@render children?.()}
22
+ </button>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const NextTrigger: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const NextTrigger: $$__sveltets_2_IsomorphicComponent<DatePickerNextTriggerProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type NextTrigger = InstanceType<typeof NextTrigger>;
18
18
  export default NextTrigger;
@@ -1,3 +1,20 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
2
3
 
3
- <script lang="ts"></script>
4
+ export interface DatePickerPositionerProps extends HtmlProps<'div'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {datePickerContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: DatePickerPositionerProps = $props();
12
+
13
+ let context = datePickerContext.get();
14
+
15
+ let attrs = $derived(mergeProps(props, context.getPositionerProps()));
16
+ </script>
17
+
18
+ <div {...attrs}>
19
+ {@render children?.()}
20
+ </div>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const Positioner: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const Positioner: $$__sveltets_2_IsomorphicComponent<DatePickerPositionerProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type Positioner = InstanceType<typeof Positioner>;
18
18
  export default Positioner;
@@ -1,3 +1,22 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {Assign, HtmlProps} from '../types.js';
3
+ import type {PresetTriggerProps} from '@zag-js/date-picker';
2
4
 
3
- <script lang="ts"></script>
5
+ export interface DatePickerPresetTriggerProps
6
+ extends Assign<HtmlProps<'button'>, PresetTriggerProps> {}
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '@zag-js/svelte';
11
+ import {datePickerContext} from './context.svelte.js';
12
+
13
+ let {value, children, ...props}: DatePickerPresetTriggerProps = $props();
14
+
15
+ let context = datePickerContext.get();
16
+
17
+ let attrs = $derived(mergeProps(props, context.getPresetTriggerProps({value})));
18
+ </script>
19
+
20
+ <button type="button" {...attrs}>
21
+ {@render children?.()}
22
+ </button>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const PresetTrigger: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const PresetTrigger: $$__sveltets_2_IsomorphicComponent<DatePickerPresetTriggerProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type PresetTrigger = InstanceType<typeof PresetTrigger>;
18
18
  export default PresetTrigger;
@@ -1,3 +1,22 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
2
3
 
3
- <script lang="ts"></script>
4
+ export interface DatePickerPrevTriggerProps extends HtmlProps<'button'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {datePickerContext, datePickerViewPropsContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: DatePickerPrevTriggerProps = $props();
12
+
13
+ let context = datePickerContext.get();
14
+
15
+ let viewProps = datePickerViewPropsContext.get();
16
+
17
+ let attrs = $derived(mergeProps(props, context.getPrevTriggerProps(viewProps)));
18
+ </script>
19
+
20
+ <button type="button" {...attrs}>
21
+ {@render children?.()}
22
+ </button>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const PrevTrigger: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const PrevTrigger: $$__sveltets_2_IsomorphicComponent<DatePickerPrevTriggerProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type PrevTrigger = InstanceType<typeof PrevTrigger>;
18
18
  export default PrevTrigger;
@@ -1,3 +1,24 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
2
3
 
3
- <script lang="ts"></script>
4
+ export interface DatePickerRangeTextProps extends HtmlProps<'div'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {datePickerContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: DatePickerRangeTextProps = $props();
12
+
13
+ let context = datePickerContext.get();
14
+
15
+ let attrs = $derived(mergeProps(props, context.getRangeTextProps()));
16
+ </script>
17
+
18
+ <div {...attrs}>
19
+ {#if children}
20
+ {@render children()}
21
+ {:else}
22
+ {context.visibleRangeText.formatted}
23
+ {/if}
24
+ </div>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const RangeText: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const RangeText: $$__sveltets_2_IsomorphicComponent<DatePickerRangeTextProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type RangeText = InstanceType<typeof RangeText>;
18
18
  export default RangeText;
@@ -1,3 +1,86 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {Assign, HtmlProps} from '../types.js';
3
+ import type {Snippet} from 'svelte';
4
+ import type {CreateDatePickerProps, CreateDatePickerReturn} from './create-date-picker.svelte.js';
2
5
 
3
- <script lang="ts"></script>
6
+ export interface DatePickerProps
7
+ extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateDatePickerProps> {
8
+ children?: Snippet<[api: CreateDatePickerReturn]>;
9
+ }
10
+ </script>
11
+
12
+ <script lang="ts">
13
+ import {mergeProps} from '@zag-js/svelte';
14
+ import {datePickerContext} from './context.svelte.js';
15
+ import {createDatePicker} from './create-date-picker.svelte.js';
16
+
17
+ let {
18
+ id,
19
+ ids,
20
+ min,
21
+ max,
22
+ name,
23
+ open,
24
+ view,
25
+ value,
26
+ modal,
27
+ disabled,
28
+ readOnly,
29
+ timeZone,
30
+ fixedWeeks,
31
+ startOfWeek,
32
+ defaultOpen,
33
+ positioning,
34
+ numOfMonths,
35
+ translations,
36
+ focusedValue,
37
+ closeOnSelect,
38
+ selectionMode,
39
+ format,
40
+ onViewChange,
41
+ onOpenChange,
42
+ onValueChange,
43
+ onFocusChange,
44
+ isDateUnavailable,
45
+ children,
46
+ ...props
47
+ }: DatePickerProps = $props();
48
+
49
+ let context = createDatePicker({
50
+ id,
51
+ ids,
52
+ min,
53
+ max,
54
+ name,
55
+ open,
56
+ view,
57
+ value: $state.snapshot(value),
58
+ modal,
59
+ disabled,
60
+ readOnly,
61
+ timeZone,
62
+ fixedWeeks,
63
+ defaultOpen,
64
+ startOfWeek,
65
+ positioning,
66
+ numOfMonths,
67
+ translations,
68
+ focusedValue,
69
+ closeOnSelect,
70
+ selectionMode,
71
+ format,
72
+ onViewChange,
73
+ onOpenChange,
74
+ onValueChange,
75
+ onFocusChange,
76
+ isDateUnavailable,
77
+ });
78
+
79
+ let attrs = $derived(mergeProps(props, context.getRootProps()));
80
+
81
+ datePickerContext.set(context);
82
+ </script>
83
+
84
+ <div {...attrs}>
85
+ {@render children?.(context)}
86
+ </div>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const Root: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const Root: $$__sveltets_2_IsomorphicComponent<DatePickerProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type Root = InstanceType<typeof Root>;
18
18
  export default Root;
@@ -1,3 +1,22 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
2
3
 
3
- <script lang="ts"></script>
4
+ export interface DatePickerTableBodyProps extends HtmlProps<'div'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {datePickerContext, datePickerTablePropsContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: DatePickerTableBodyProps = $props();
12
+
13
+ let context = datePickerContext.get();
14
+
15
+ let tableProps = datePickerTablePropsContext.get();
16
+
17
+ let attrs = $derived(mergeProps(props, context.getTableBodyProps(tableProps)));
18
+ </script>
19
+
20
+ <div {...attrs}>
21
+ {@render children?.()}
22
+ </div>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const TableBody: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const TableBody: $$__sveltets_2_IsomorphicComponent<DatePickerTableBodyProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type TableBody = InstanceType<typeof TableBody>;
18
18
  export default TableBody;
@@ -1,3 +1,22 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
2
3
 
3
- <script lang="ts"></script>
4
+ export interface DatePickerTableHeadProps extends HtmlProps<'div'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {datePickerContext, datePickerTablePropsContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: DatePickerTableHeadProps = $props();
12
+
13
+ let context = datePickerContext.get();
14
+
15
+ let tableProps = datePickerTablePropsContext.get();
16
+
17
+ let attrs = $derived(mergeProps(props, context.getTableHeadProps(tableProps)));
18
+ </script>
19
+
20
+ <div {...attrs}>
21
+ {@render children?.()}
22
+ </div>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const TableHead: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const TableHead: $$__sveltets_2_IsomorphicComponent<DatePickerTableHeadProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type TableHead = InstanceType<typeof TableHead>;
18
18
  export default TableHead;
@@ -1,3 +1,22 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
2
3
 
3
- <script lang="ts"></script>
4
+ export interface DatePickerTableHeaderProps extends HtmlProps<'div'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {datePickerContext, datePickerTablePropsContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: DatePickerTableHeaderProps = $props();
12
+
13
+ let context = datePickerContext.get();
14
+
15
+ let tableProps = datePickerTablePropsContext.get();
16
+
17
+ let attrs = $derived(mergeProps(props, context.getTableHeaderProps(tableProps)));
18
+ </script>
19
+
20
+ <div {...attrs}>
21
+ {@render children?.()}
22
+ </div>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const TableHeader: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const TableHeader: $$__sveltets_2_IsomorphicComponent<DatePickerTableHeaderProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type TableHeader = InstanceType<typeof TableHeader>;
18
18
  export default TableHeader;
@@ -1,3 +1,22 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
2
3
 
3
- <script lang="ts"></script>
4
+ export interface DatePickerTableRowProps extends HtmlProps<'div'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {datePickerContext, datePickerTablePropsContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: DatePickerTableRowProps = $props();
12
+
13
+ let context = datePickerContext.get();
14
+
15
+ let tableProps = datePickerTablePropsContext.get();
16
+
17
+ let attrs = $derived(mergeProps(props, context.getTableRowProps(tableProps)));
18
+ </script>
19
+
20
+ <div {...attrs}>
21
+ {@render children?.()}
22
+ </div>
@@ -2,7 +2,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
2
2
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
3
  $$bindings?: Bindings;
4
4
  } & Exports;
5
- (internal: unknown, props: {
5
+ (internal: unknown, props: Props & {
6
6
  $$events?: Events;
7
7
  $$slots?: Slots;
8
8
  }): Exports & {
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
11
  };
12
12
  z_$$bindings?: Bindings;
13
13
  }
14
- declare const TableRow: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
14
+ declare const TableRow: $$__sveltets_2_IsomorphicComponent<DatePickerTableRowProps, {
15
15
  [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
16
+ }, {}, {}, "">;
17
17
  type TableRow = InstanceType<typeof TableRow>;
18
18
  export default TableRow;
@@ -1,3 +1,32 @@
1
- <script lang="ts" module></script>
1
+ <script lang="ts" module>
2
+ import type {Assign, HtmlProps} from '../types.js';
3
+ import type {TableProps} from '@zag-js/date-picker';
2
4
 
3
- <script lang="ts"></script>
5
+ export interface DatePickerTableProps
6
+ extends Assign<HtmlProps<'div'>, Omit<TableProps, 'view'>> {}
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '@zag-js/svelte';
11
+ import {
12
+ datePickerContext,
13
+ datePickerTablePropsContext,
14
+ datePickerViewPropsContext,
15
+ } from './context.svelte.js';
16
+
17
+ let {id, columns, children, ...props}: DatePickerTableProps = $props();
18
+
19
+ let context = datePickerContext.get();
20
+
21
+ let viewProps = datePickerViewPropsContext.get();
22
+
23
+ let tableProps: TableProps = $derived({...viewProps, id, columns});
24
+
25
+ let attrs = $derived(mergeProps(props, context.getTableProps(tableProps)));
26
+
27
+ datePickerTablePropsContext.set(() => tableProps);
28
+ </script>
29
+
30
+ <div {...attrs}>
31
+ {@render children?.()}
32
+ </div>