ui-ingredients 0.0.18 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/collapsible/create-collapsible.svelte.d.ts +1 -0
- package/dist/collapsible/create-collapsible.svelte.js +1 -0
- package/dist/collapsible/root.svelte +4 -2
- package/dist/collapsible/trigger.svelte +2 -2
- package/dist/combobox/create-combobox.svelte.d.ts +1 -0
- package/dist/combobox/create-combobox.svelte.js +1 -0
- package/dist/combobox/root.svelte +2 -0
- package/dist/date-picker/anatomy.js +3 -0
- package/dist/date-picker/clear-trigger.svelte +19 -2
- package/dist/date-picker/clear-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/content.svelte +19 -2
- package/dist/date-picker/content.svelte.d.ts +3 -3
- package/dist/date-picker/context.svelte.d.ts +8 -8
- package/dist/date-picker/context.svelte.js +6 -14
- package/dist/date-picker/control.svelte +19 -2
- package/dist/date-picker/control.svelte.d.ts +3 -3
- package/dist/date-picker/create-date-picker.svelte.d.ts +14 -0
- package/dist/date-picker/create-date-picker.svelte.js +24 -0
- package/dist/date-picker/date-picker.d.ts +3 -3
- package/dist/date-picker/date-picker.js +3 -3
- package/dist/date-picker/day-table-cell-trigger.svelte +21 -2
- package/dist/date-picker/day-table-cell-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/day-table-cell.svelte +40 -2
- package/dist/date-picker/day-table-cell.svelte.d.ts +3 -3
- package/dist/date-picker/index.d.ts +29 -0
- package/dist/date-picker/index.js +2 -0
- package/dist/date-picker/input.svelte +18 -2
- package/dist/date-picker/input.svelte.d.ts +3 -3
- package/dist/date-picker/label.svelte +20 -2
- package/dist/date-picker/label.svelte.d.ts +3 -3
- package/dist/date-picker/month-select.svelte +40 -2
- package/dist/date-picker/month-select.svelte.d.ts +3 -3
- package/dist/date-picker/month-table-cell-trigger.svelte +21 -2
- package/dist/date-picker/month-table-cell-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/month-table-cell.svelte +40 -2
- package/dist/date-picker/month-table-cell.svelte.d.ts +3 -3
- package/dist/date-picker/next-trigger.svelte +21 -2
- package/dist/date-picker/next-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/positioner.svelte +19 -2
- package/dist/date-picker/positioner.svelte.d.ts +3 -3
- package/dist/date-picker/preset-trigger.svelte +21 -2
- package/dist/date-picker/preset-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/prev-trigger.svelte +21 -2
- package/dist/date-picker/prev-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/range-text.svelte +23 -2
- package/dist/date-picker/range-text.svelte.d.ts +3 -3
- package/dist/date-picker/root.svelte +85 -2
- package/dist/date-picker/root.svelte.d.ts +3 -3
- package/dist/date-picker/table-body.svelte +21 -2
- package/dist/date-picker/table-body.svelte.d.ts +3 -3
- package/dist/date-picker/table-head.svelte +21 -2
- package/dist/date-picker/table-head.svelte.d.ts +3 -3
- package/dist/date-picker/table-header.svelte +21 -2
- package/dist/date-picker/table-header.svelte.d.ts +3 -3
- package/dist/date-picker/table-row.svelte +21 -2
- package/dist/date-picker/table-row.svelte.d.ts +3 -3
- package/dist/date-picker/table.svelte +31 -2
- package/dist/date-picker/table.svelte.d.ts +3 -3
- package/dist/date-picker/trigger.svelte +19 -2
- package/dist/date-picker/trigger.svelte.d.ts +3 -3
- package/dist/date-picker/view-control.svelte +21 -2
- package/dist/date-picker/view-control.svelte.d.ts +3 -3
- package/dist/date-picker/view.svelte +24 -0
- package/dist/date-picker/{view-trigger.svelte.d.ts → view.svelte.d.ts} +5 -5
- package/dist/date-picker/year-select.svelte +40 -2
- package/dist/date-picker/year-select.svelte.d.ts +3 -3
- package/dist/date-picker/year-table-cell-trigger.svelte +21 -2
- package/dist/date-picker/year-table-cell-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/year-table-cell.svelte +40 -2
- package/dist/date-picker/year-table-cell.svelte.d.ts +3 -3
- package/dist/dialog/create-dialog.svelte.d.ts +1 -0
- package/dist/dialog/create-dialog.svelte.js +1 -0
- package/dist/editable/create-editable.svelte.d.ts +1 -0
- package/dist/editable/create-editable.svelte.js +1 -0
- package/dist/hover-card/create-hover-card.svelte.d.ts +1 -0
- package/dist/hover-card/create-hover-card.svelte.js +1 -0
- package/dist/menu/create-menu.svelte.d.ts +1 -0
- package/dist/menu/create-menu.svelte.js +1 -0
- package/dist/menu/option-item.svelte +5 -8
- package/dist/popover/create-popover.svelte.d.ts +1 -0
- package/dist/popover/create-popover.svelte.js +1 -0
- package/dist/select/create-select.svelte.d.ts +1 -0
- package/dist/select/create-select.svelte.js +1 -0
- package/dist/select/root.svelte +2 -0
- package/dist/tooltip/create-tooltip.svelte.d.ts +1 -0
- package/dist/tooltip/create-tooltip.svelte.js +1 -0
- package/dist/types.d.ts +2 -4
- package/package.json +1 -1
- package/dist/date-picker/view-trigger.svelte +0 -3
@@ -1,3 +1,32 @@
|
|
1
|
-
<script lang="ts" module
|
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
|
-
|
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>
|
@@ -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 Table: $$__sveltets_2_IsomorphicComponent<
|
14
|
+
declare const Table: $$__sveltets_2_IsomorphicComponent<DatePickerTableProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
|
-
}, {}, {},
|
16
|
+
}, {}, {}, "">;
|
17
17
|
type Table = InstanceType<typeof Table>;
|
18
18
|
export default Table;
|
@@ -1,3 +1,20 @@
|
|
1
|
-
<script lang="ts" module
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlProps} from '../types.js';
|
2
3
|
|
3
|
-
<
|
4
|
+
export interface DatePickerTriggerProps extends HtmlProps<'button'> {}
|
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}: DatePickerTriggerProps = $props();
|
12
|
+
|
13
|
+
let context = datePickerContext.get();
|
14
|
+
|
15
|
+
let attrs = $derived(mergeProps(props, context.getTriggerProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<button type="button" {...attrs}>
|
19
|
+
{@render children?.()}
|
20
|
+
</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 Trigger: $$__sveltets_2_IsomorphicComponent<
|
14
|
+
declare const Trigger: $$__sveltets_2_IsomorphicComponent<DatePickerTriggerProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
|
-
}, {}, {},
|
16
|
+
}, {}, {}, "">;
|
17
17
|
type Trigger = InstanceType<typeof Trigger>;
|
18
18
|
export default Trigger;
|
@@ -1,3 +1,22 @@
|
|
1
|
-
<script lang="ts" module
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlProps} from '../types.js';
|
2
3
|
|
3
|
-
<
|
4
|
+
export interface DatePickerViewControlProps extends HtmlProps<'div'> {}
|
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}: DatePickerViewControlProps = $props();
|
12
|
+
|
13
|
+
let context = datePickerContext.get();
|
14
|
+
|
15
|
+
let viewProps = datePickerViewPropsContext.get();
|
16
|
+
|
17
|
+
let attrs = $derived(mergeProps(props, context.getViewControlProps(viewProps)));
|
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 ViewControl: $$__sveltets_2_IsomorphicComponent<
|
14
|
+
declare const ViewControl: $$__sveltets_2_IsomorphicComponent<DatePickerViewControlProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
|
-
}, {}, {},
|
16
|
+
}, {}, {}, "">;
|
17
17
|
type ViewControl = InstanceType<typeof ViewControl>;
|
18
18
|
export default ViewControl;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
|
+
import type {ViewProps} from '@zag-js/date-picker';
|
4
|
+
|
5
|
+
export interface DatePickerViewProps extends Assign<HtmlProps<'div'>, ViewProps> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '@zag-js/svelte';
|
10
|
+
import {parts} from './anatomy.js';
|
11
|
+
import {datePickerContext, datePickerViewPropsContext} from './context.svelte.js';
|
12
|
+
|
13
|
+
let {view = 'day', children, ...props}: DatePickerViewProps = $props();
|
14
|
+
|
15
|
+
let context = datePickerContext.get();
|
16
|
+
|
17
|
+
let attrs = $derived(mergeProps(props, parts.view.attrs));
|
18
|
+
|
19
|
+
datePickerViewPropsContext.set(() => ({view}));
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<div hidden={context.view !== view} {...attrs}>
|
23
|
+
{@render children?.()}
|
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
|
14
|
+
declare const View: $$__sveltets_2_IsomorphicComponent<DatePickerViewProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
|
-
}, {}, {},
|
17
|
-
type
|
18
|
-
export default
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type View = InstanceType<typeof View>;
|
18
|
+
export default View;
|
@@ -1,3 +1,41 @@
|
|
1
|
-
<script lang="ts" module
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlProps} from '../types.js';
|
2
3
|
|
3
|
-
<
|
4
|
+
export interface DatePickerYearSelectProps extends HtmlProps<'select'> {}
|
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}: DatePickerYearSelectProps = $props();
|
12
|
+
|
13
|
+
let context = datePickerContext.get();
|
14
|
+
|
15
|
+
let attrs = $derived(mergeProps(props, context.getYearSelectProps()));
|
16
|
+
|
17
|
+
function getYears() {
|
18
|
+
const currentYear = new Date().getFullYear();
|
19
|
+
|
20
|
+
const start = currentYear - 1000;
|
21
|
+
const until = currentYear + 1000;
|
22
|
+
|
23
|
+
const years = [];
|
24
|
+
|
25
|
+
for (let i = start; i <= until; i++) {
|
26
|
+
years.unshift(i);
|
27
|
+
}
|
28
|
+
|
29
|
+
return years;
|
30
|
+
}
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<select {...attrs}>
|
34
|
+
{#if children}
|
35
|
+
{@render children()}
|
36
|
+
{:else}
|
37
|
+
{#each getYears() as year}
|
38
|
+
<option value={year}>{year}</option>
|
39
|
+
{/each}
|
40
|
+
{/if}
|
41
|
+
</select>
|
@@ -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 YearSelect: $$__sveltets_2_IsomorphicComponent<
|
14
|
+
declare const YearSelect: $$__sveltets_2_IsomorphicComponent<DatePickerYearSelectProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
|
-
}, {}, {},
|
16
|
+
}, {}, {}, "">;
|
17
17
|
type YearSelect = InstanceType<typeof YearSelect>;
|
18
18
|
export default YearSelect;
|
@@ -1,3 +1,22 @@
|
|
1
|
-
<script lang="ts" module
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlProps} from '../types.js';
|
2
3
|
|
3
|
-
<
|
4
|
+
export interface DatePickerYearTableCellTriggerProps extends HtmlProps<'button'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '@zag-js/svelte';
|
9
|
+
import {datePickerContext, datePickerTableCellPropsContext} from './context.svelte.js';
|
10
|
+
|
11
|
+
let {children, ...props}: DatePickerYearTableCellTriggerProps = $props();
|
12
|
+
|
13
|
+
let context = datePickerContext.get();
|
14
|
+
|
15
|
+
let tableCellProps = datePickerTableCellPropsContext.get();
|
16
|
+
|
17
|
+
let attrs = $derived(mergeProps(props, context.getYearTableCellTriggerProps(tableCellProps)));
|
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 YearTableCellTrigger: $$__sveltets_2_IsomorphicComponent<
|
14
|
+
declare const YearTableCellTrigger: $$__sveltets_2_IsomorphicComponent<DatePickerYearTableCellTriggerProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
|
-
}, {}, {},
|
16
|
+
}, {}, {}, "">;
|
17
17
|
type YearTableCellTrigger = InstanceType<typeof YearTableCellTrigger>;
|
18
18
|
export default YearTableCellTrigger;
|
@@ -1,3 +1,41 @@
|
|
1
|
-
<script lang="ts" module
|
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
|
-
|
6
|
+
export interface DatePickerYearTableCellProps
|
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
|
+
}: DatePickerYearTableCellProps = $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.getYearTableCellState(tableCellProps));
|
34
|
+
let attrs = $derived(mergeProps(props, context.getYearTableCellProps(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 YearTableCell: $$__sveltets_2_IsomorphicComponent<
|
14
|
+
declare const YearTableCell: $$__sveltets_2_IsomorphicComponent<DatePickerYearTableCellProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
|
-
}, {}, {},
|
16
|
+
}, {}, {}, "">;
|
17
17
|
type YearTableCell = InstanceType<typeof YearTableCell>;
|
18
18
|
export default YearTableCell;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as dialog from '@zag-js/dialog';
|
2
2
|
export interface CreateDialogProps extends Omit<dialog.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
3
|
id?: string | null;
|
4
|
+
defaultOpen?: boolean;
|
4
5
|
}
|
5
6
|
export interface CreateDialogReturn extends dialog.Api {
|
6
7
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as editable from '@zag-js/editable';
|
2
2
|
export interface CreateEditableProps extends Omit<editable.Context, 'id' | 'dir' | 'getRootNode' | 'edit.controlled'> {
|
3
3
|
id?: string | null;
|
4
|
+
defaultEdit?: boolean;
|
4
5
|
}
|
5
6
|
export interface CreateEditableReturn extends editable.Api {
|
6
7
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as hoverCard from '@zag-js/hover-card';
|
2
2
|
export interface CreateHoverCardProps extends Omit<hoverCard.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
3
|
id?: string | null;
|
4
|
+
defaultOpen?: boolean;
|
4
5
|
}
|
5
6
|
export interface CreateHoverCardReturn extends hoverCard.Api {
|
6
7
|
}
|
@@ -1,13 +1,10 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlProps
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {OptionItemProps, OptionItemState} from '@zag-js/menu';
|
4
4
|
import type {Snippet} from 'svelte';
|
5
5
|
|
6
6
|
export interface MenuOptionItemProps
|
7
|
-
extends Assign<
|
8
|
-
Omit<HtmlProps<'div'>, 'children'>,
|
9
|
-
PickPartial<OptionItemProps, 'type' | 'checked'>
|
10
|
-
> {
|
7
|
+
extends Assign<Omit<HtmlProps<'div'>, 'children'>, OptionItemProps> {
|
11
8
|
children?: Snippet<[state: OptionItemState]>;
|
12
9
|
}
|
13
10
|
</script>
|
@@ -17,9 +14,9 @@
|
|
17
14
|
import {menuContext, menuOptionItemPropsContext} from './context.svelte.js';
|
18
15
|
|
19
16
|
let {
|
20
|
-
type
|
17
|
+
type,
|
21
18
|
value,
|
22
|
-
checked
|
19
|
+
checked,
|
23
20
|
disabled,
|
24
21
|
valueText,
|
25
22
|
closeOnSelect,
|
@@ -30,7 +27,7 @@
|
|
30
27
|
|
31
28
|
let context = menuContext.get();
|
32
29
|
|
33
|
-
let itemProps = $derived({
|
30
|
+
let itemProps: OptionItemProps = $derived({
|
34
31
|
type,
|
35
32
|
value,
|
36
33
|
checked,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as popover from '@zag-js/popover';
|
2
2
|
export interface CreatePopoverProps extends Omit<popover.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
3
|
id?: string | null;
|
4
|
+
defaultOpen?: boolean;
|
4
5
|
}
|
5
6
|
export interface CreatePopoverReturn extends popover.Api {
|
6
7
|
}
|
@@ -5,6 +5,7 @@ export interface CreateSelectProps<T> extends Omit<select.Context, 'id' | 'dir'
|
|
5
5
|
itemToString?: (item: T) => string;
|
6
6
|
itemToValue?: (item: T) => string;
|
7
7
|
isItemDisabled?: (item: T) => boolean;
|
8
|
+
defaultOpen?: boolean;
|
8
9
|
}
|
9
10
|
export interface CreateSelectReturn extends select.Api {
|
10
11
|
}
|
package/dist/select/root.svelte
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as tooltip from '@zag-js/tooltip';
|
2
2
|
export interface CreateTooltipProps extends Omit<tooltip.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
3
|
id?: string | null;
|
4
|
+
defaultOpen?: boolean;
|
4
5
|
}
|
5
6
|
export interface CreateTooltipReturn extends tooltip.Api {
|
6
7
|
}
|
package/dist/types.d.ts
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
2
2
|
export type Assign<Target, Source> = Omit<Target, keyof Source> & Source;
|
3
|
-
type
|
4
|
-
[K in keyof
|
3
|
+
type IntrinsicElements = keyof {
|
4
|
+
[K in keyof SvelteHTMLElements as string extends K ? never : number extends K ? never : K]: string;
|
5
5
|
};
|
6
|
-
type IntrinsicElements = KnownKeys<SvelteHTMLElements>;
|
7
6
|
export type HtmlProps<T extends IntrinsicElements> = SvelteHTMLElements[T];
|
8
|
-
export type PickPartial<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;
|
9
7
|
export {};
|
package/package.json
CHANGED