ui-ingredients 0.0.23 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -5
- package/dist/date-picker/date-picker.d.ts +1 -0
- package/dist/date-picker/date-picker.js +1 -0
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/date-picker/view-trigger.svelte +21 -0
- package/dist/date-picker/view-trigger.svelte.d.ts +18 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/progress.d.ts +1 -0
- package/dist/progress/progress.js +1 -0
- package/dist/progress/view.svelte +21 -0
- package/dist/progress/view.svelte.d.ts +18 -0
- package/dist/signature-pad/guide.svelte +2 -2
- package/dist/splitter/context.svelte.d.ts +3 -0
- package/dist/splitter/context.svelte.js +2 -0
- package/dist/splitter/create-splitter.svelte.d.ts +7 -0
- package/dist/splitter/create-splitter.svelte.js +17 -0
- package/dist/splitter/index.d.ts +4 -0
- package/dist/splitter/index.js +1 -0
- package/dist/splitter/panel.svelte +29 -0
- package/dist/splitter/panel.svelte.d.ts +18 -0
- package/dist/splitter/resize-trigger.svelte +41 -0
- package/dist/splitter/resize-trigger.svelte.d.ts +18 -0
- package/dist/splitter/root.svelte +44 -0
- package/dist/splitter/root.svelte.d.ts +18 -0
- package/dist/splitter/splitter.d.ts +4 -0
- package/dist/splitter/splitter.js +4 -0
- package/dist/time-picker/clear-trigger.svelte +20 -0
- package/dist/time-picker/clear-trigger.svelte.d.ts +18 -0
- package/dist/time-picker/column.svelte +21 -0
- package/dist/time-picker/column.svelte.d.ts +18 -0
- package/dist/time-picker/content.svelte +20 -0
- package/dist/time-picker/content.svelte.d.ts +18 -0
- package/dist/time-picker/context.svelte.d.ts +3 -0
- package/dist/time-picker/context.svelte.js +2 -0
- package/dist/time-picker/control.svelte +20 -0
- package/dist/time-picker/control.svelte.d.ts +18 -0
- package/dist/time-picker/create-time-picker.svelte.d.ts +8 -0
- package/dist/time-picker/create-time-picker.svelte.js +20 -0
- package/dist/time-picker/hour-cell.svelte +21 -0
- package/dist/time-picker/hour-cell.svelte.d.ts +18 -0
- package/dist/time-picker/index.d.ts +15 -0
- package/dist/time-picker/index.js +1 -0
- package/dist/time-picker/input.svelte +18 -0
- package/dist/time-picker/input.svelte.d.ts +18 -0
- package/dist/time-picker/label.svelte +20 -0
- package/dist/time-picker/label.svelte.d.ts +18 -0
- package/dist/time-picker/minute-cell.svelte +21 -0
- package/dist/time-picker/minute-cell.svelte.d.ts +18 -0
- package/dist/time-picker/period-cell.svelte +28 -0
- package/dist/time-picker/period-cell.svelte.d.ts +18 -0
- package/dist/time-picker/positioner.svelte +20 -0
- package/dist/time-picker/positioner.svelte.d.ts +18 -0
- package/dist/time-picker/root.svelte +70 -0
- package/dist/time-picker/root.svelte.d.ts +18 -0
- package/dist/time-picker/second-cell.svelte +21 -0
- package/dist/time-picker/second-cell.svelte.d.ts +18 -0
- package/dist/time-picker/spacer.svelte +20 -0
- package/dist/time-picker/spacer.svelte.d.ts +18 -0
- package/dist/time-picker/time-picker.d.ts +15 -0
- package/dist/time-picker/time-picker.js +15 -0
- package/dist/time-picker/trigger.svelte +20 -0
- package/dist/time-picker/trigger.svelte.d.ts +18 -0
- package/dist/tree-view/branch-content.svelte +21 -0
- package/dist/tree-view/branch-content.svelte.d.ts +18 -0
- package/dist/tree-view/branch-control.svelte +21 -0
- package/dist/tree-view/branch-control.svelte.d.ts +18 -0
- package/dist/tree-view/branch-indicator.svelte +21 -0
- package/dist/tree-view/branch-indicator.svelte.d.ts +18 -0
- package/dist/tree-view/branch-text.svelte +21 -0
- package/dist/tree-view/branch-text.svelte.d.ts +18 -0
- package/dist/tree-view/branch-trigger.svelte +21 -0
- package/dist/tree-view/branch-trigger.svelte.d.ts +18 -0
- package/dist/tree-view/branch.svelte +40 -0
- package/dist/tree-view/branch.svelte.d.ts +18 -0
- package/dist/tree-view/context.svelte.d.ts +6 -0
- package/dist/tree-view/context.svelte.js +4 -0
- package/dist/tree-view/create-tree-view.svelte.d.ts +7 -0
- package/dist/tree-view/create-tree-view.svelte.js +17 -0
- package/dist/tree-view/index.d.ts +13 -0
- package/dist/tree-view/index.js +1 -0
- package/dist/tree-view/item-indicator.svelte +21 -0
- package/dist/tree-view/item-indicator.svelte.d.ts +18 -0
- package/dist/tree-view/item-text.svelte +21 -0
- package/dist/tree-view/item-text.svelte.d.ts +18 -0
- package/dist/tree-view/item.svelte +39 -0
- package/dist/tree-view/item.svelte.d.ts +18 -0
- package/dist/tree-view/label.svelte +20 -0
- package/dist/tree-view/label.svelte.d.ts +18 -0
- package/dist/tree-view/root.svelte +54 -0
- package/dist/tree-view/root.svelte.d.ts +18 -0
- package/dist/tree-view/tree-view.d.ts +13 -0
- package/dist/tree-view/tree-view.js +13 -0
- package/dist/tree-view/tree.svelte +20 -0
- package/dist/tree-view/tree.svelte.d.ts +18 -0
- package/package.json +1 -1
- package/dist/time-picker/.gitkeep +0 -0
- package/dist/tree-view/.gitkeep +0 -0
package/README.md
CHANGED
@@ -41,7 +41,7 @@ npm install ui-ingredients
|
|
41
41
|
- 🟢 Checkbox
|
42
42
|
- 🟢 Clipboard
|
43
43
|
- 🟢 Collapsible
|
44
|
-
-
|
44
|
+
- ⚪ ColorPicker
|
45
45
|
- 🟢 Combobox
|
46
46
|
- 🟢 DatePicker
|
47
47
|
- 🟢 Dialog
|
@@ -55,7 +55,7 @@ npm install ui-ingredients
|
|
55
55
|
- 🟢 PinInput
|
56
56
|
- 🟢 Popover
|
57
57
|
- 🟢 Portal
|
58
|
-
-
|
58
|
+
- 🟡 Presence
|
59
59
|
- 🟢 Progress
|
60
60
|
- 🟢 QRCode
|
61
61
|
- 🟢 RadioGroup
|
@@ -64,17 +64,17 @@ npm install ui-ingredients
|
|
64
64
|
- 🟢 SegmentGroup
|
65
65
|
- 🟢 SignaturePad
|
66
66
|
- 🟢 Slider
|
67
|
-
-
|
67
|
+
- 🟢 Splitter
|
68
68
|
- 🟢 Steps
|
69
69
|
- 🟢 Switch
|
70
70
|
- 🟢 Tabs
|
71
71
|
- 🟢 TagsInput
|
72
|
-
-
|
72
|
+
- 🟢 TimePicker
|
73
73
|
- 🟢 Timer
|
74
74
|
- 🟢 Toast
|
75
75
|
- 🟢 ToggleGroup
|
76
76
|
- 🟢 Tooltip
|
77
77
|
- ⚪ Tour
|
78
|
-
-
|
78
|
+
- 🟢 TreeView
|
79
79
|
|
80
80
|
View components demo [here](https://ui-ingredients.vercel.app/)
|
@@ -23,6 +23,7 @@ export { default as TableRow } from './table-row.svelte';
|
|
23
23
|
export { default as Table } from './table.svelte';
|
24
24
|
export { default as Trigger } from './trigger.svelte';
|
25
25
|
export { default as ViewControl } from './view-control.svelte';
|
26
|
+
export { default as ViewTrigger } from './view-trigger.svelte';
|
26
27
|
export { default as View } from './view.svelte';
|
27
28
|
export { default as YearSelect } from './year-select.svelte';
|
28
29
|
export { default as YearTableCellTrigger } from './year-table-cell-trigger.svelte';
|
@@ -23,6 +23,7 @@ export { default as TableRow } from './table-row.svelte';
|
|
23
23
|
export { default as Table } from './table.svelte';
|
24
24
|
export { default as Trigger } from './trigger.svelte';
|
25
25
|
export { default as ViewControl } from './view-control.svelte';
|
26
|
+
export { default as ViewTrigger } from './view-trigger.svelte';
|
26
27
|
export { default as View } from './view.svelte';
|
27
28
|
export { default as YearSelect } from './year-select.svelte';
|
28
29
|
export { default as YearTableCellTrigger } from './year-table-cell-trigger.svelte';
|
@@ -22,6 +22,7 @@ export type { DatePickerTableRowProps } from './table-row.svelte';
|
|
22
22
|
export type { DatePickerTableProps } from './table.svelte';
|
23
23
|
export type { DatePickerTriggerProps } from './trigger.svelte';
|
24
24
|
export type { DatePickerViewControlProps } from './view-control.svelte';
|
25
|
+
export type { DatePickerViewTriggerProps } from './view-trigger.svelte';
|
25
26
|
export type { DatePickerViewProps } from './view.svelte';
|
26
27
|
export type { DatePickerYearSelectProps } from './year-select.svelte';
|
27
28
|
export type { DatePickerYearTableCellTriggerProps } from './year-table-cell-trigger.svelte';
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface DatePickerViewTriggerProps 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}: DatePickerViewTriggerProps = $props();
|
12
|
+
|
13
|
+
let datePicker = datePickerContext.get();
|
14
|
+
let viewProps = datePickerViewPropsContext.get();
|
15
|
+
|
16
|
+
let attrs = $derived(mergeProps(props, datePicker.getViewTriggerProps(viewProps)));
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<button type="button" {...attrs}>
|
20
|
+
{@render children?.()}
|
21
|
+
</button>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const ViewTrigger: $$__sveltets_2_IsomorphicComponent<DatePickerViewTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type ViewTrigger = InstanceType<typeof ViewTrigger>;
|
18
|
+
export default ViewTrigger;
|
package/dist/index.d.ts
CHANGED
@@ -27,11 +27,14 @@ export * from './segment-group/index.js';
|
|
27
27
|
export * from './select/index.js';
|
28
28
|
export * from './signature-pad/index.js';
|
29
29
|
export * from './slider/index.js';
|
30
|
+
export * from './splitter/index.js';
|
30
31
|
export * from './steps/index.js';
|
31
32
|
export * from './switch/index.js';
|
32
33
|
export * from './tabs/index.js';
|
33
34
|
export * from './tags-input/index.js';
|
35
|
+
export * from './time-picker/index.js';
|
34
36
|
export * from './timer/index.js';
|
35
37
|
export * from './toast/index.js';
|
36
38
|
export * from './toggle-group/index.js';
|
37
39
|
export * from './tooltip/index.js';
|
40
|
+
export * from './tree-view/index.js';
|
package/dist/index.js
CHANGED
@@ -27,11 +27,14 @@ export * from './segment-group/index.js';
|
|
27
27
|
export * from './select/index.js';
|
28
28
|
export * from './signature-pad/index.js';
|
29
29
|
export * from './slider/index.js';
|
30
|
+
export * from './splitter/index.js';
|
30
31
|
export * from './steps/index.js';
|
31
32
|
export * from './switch/index.js';
|
32
33
|
export * from './tabs/index.js';
|
33
34
|
export * from './tags-input/index.js';
|
35
|
+
export * from './time-picker/index.js';
|
34
36
|
export * from './timer/index.js';
|
35
37
|
export * from './toast/index.js';
|
36
38
|
export * from './toggle-group/index.js';
|
37
39
|
export * from './tooltip/index.js';
|
40
|
+
export * from './tree-view/index.js';
|
package/dist/progress/index.d.ts
CHANGED
@@ -7,3 +7,4 @@ export type { ProgressRangeProps } from './range.svelte';
|
|
7
7
|
export type { ProgressProps } from './root.svelte';
|
8
8
|
export type { ProgressTrackProps } from './track.svelte';
|
9
9
|
export type { ProgressValueTextProps } from './value-text.svelte';
|
10
|
+
export type { ProgressViewProps } from './view.svelte';
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
|
+
import type {ViewProps} from '@zag-js/progress';
|
4
|
+
|
5
|
+
export interface ProgressViewProps extends Assign<HtmlProps<'div'>, ViewProps> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '@zag-js/svelte';
|
10
|
+
import {progressContext} from './context.svelte.js';
|
11
|
+
|
12
|
+
let {state, children, ...props}: ProgressViewProps = $props();
|
13
|
+
|
14
|
+
let progress = progressContext.get();
|
15
|
+
|
16
|
+
let attrs = $derived(mergeProps(props, progress.getViewProps({state})));
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<div {...attrs}>
|
20
|
+
{@render children?.()}
|
21
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const View: $$__sveltets_2_IsomorphicComponent<ProgressViewProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type View = InstanceType<typeof View>;
|
18
|
+
export default View;
|
@@ -8,13 +8,13 @@
|
|
8
8
|
import {mergeProps} from '@zag-js/svelte';
|
9
9
|
import {signaturePadContext} from './context.svelte.js';
|
10
10
|
|
11
|
-
let {children
|
11
|
+
let {children, ...props}: SignaturePadGuideProps = $props();
|
12
12
|
|
13
13
|
let signaturePad = signaturePadContext.get();
|
14
14
|
|
15
15
|
let attrs = $derived(mergeProps(props, signaturePad.getGuideProps()));
|
16
16
|
</script>
|
17
17
|
|
18
|
-
<div
|
18
|
+
<div {...attrs}>
|
19
19
|
{@render children?.()}
|
20
20
|
</div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import * as splitter from '@zag-js/splitter';
|
2
|
+
export interface CreateSplitterProps extends Omit<splitter.Context, 'id' | 'dir' | 'getRootNode'> {
|
3
|
+
id?: string | null;
|
4
|
+
}
|
5
|
+
export interface CreateSplitterReturn extends splitter.Api {
|
6
|
+
}
|
7
|
+
export declare function createSplitter(props: CreateSplitterProps): CreateSplitterReturn;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
2
|
+
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
3
|
+
import { createUniqueId } from '../utils.svelte.js';
|
4
|
+
import * as splitter from '@zag-js/splitter';
|
5
|
+
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
6
|
+
export function createSplitter(props) {
|
7
|
+
const locale = getLocaleContext();
|
8
|
+
const environment = getEnvironmentContext();
|
9
|
+
const [state, send] = useMachine(splitter.machine({
|
10
|
+
...props,
|
11
|
+
id: props.id ?? createUniqueId(),
|
12
|
+
dir: locale?.dir,
|
13
|
+
getRootNode: environment?.getRootNode,
|
14
|
+
}));
|
15
|
+
const api = $derived(reflect(() => splitter.connect(state, send, normalizeProps)));
|
16
|
+
return api;
|
17
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * as Splitter from './splitter.js';
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
|
+
import type {PanelProps} from '@zag-js/splitter';
|
4
|
+
|
5
|
+
export interface SplitterPanelProps extends Assign<HtmlProps<'div'>, PanelProps> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '@zag-js/svelte';
|
10
|
+
import {splitterContext} from './context.svelte.js';
|
11
|
+
|
12
|
+
let {id, snapSize, children, ...props}: SplitterPanelProps = $props();
|
13
|
+
|
14
|
+
let splitter = splitterContext.get();
|
15
|
+
|
16
|
+
let attrs = $derived(
|
17
|
+
mergeProps(
|
18
|
+
props,
|
19
|
+
splitter.getPanelProps({
|
20
|
+
id,
|
21
|
+
snapSize,
|
22
|
+
}),
|
23
|
+
),
|
24
|
+
);
|
25
|
+
</script>
|
26
|
+
|
27
|
+
<div {...attrs}>
|
28
|
+
{@render children?.()}
|
29
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const Panel: $$__sveltets_2_IsomorphicComponent<SplitterPanelProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Panel = InstanceType<typeof Panel>;
|
18
|
+
export default Panel;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
|
+
import type {ResizeTriggerProps} from '@zag-js/splitter';
|
4
|
+
|
5
|
+
/* Currently not exported in zag */
|
6
|
+
interface ResizeTriggerState {
|
7
|
+
min: number | undefined;
|
8
|
+
max: number | undefined;
|
9
|
+
value: number;
|
10
|
+
focused: boolean;
|
11
|
+
disabled: boolean;
|
12
|
+
panelIds: string[];
|
13
|
+
}
|
14
|
+
|
15
|
+
export interface SplitterResizeTriggerProps
|
16
|
+
extends Assign<Omit<HtmlProps<'div'>, 'children'>, ResizeTriggerProps> {
|
17
|
+
children?: Snippet<[state: ResizeTriggerState]>;
|
18
|
+
}
|
19
|
+
</script>
|
20
|
+
|
21
|
+
<script lang="ts">
|
22
|
+
import {mergeProps} from '@zag-js/svelte';
|
23
|
+
import type {Snippet} from 'svelte';
|
24
|
+
import {splitterContext} from './context.svelte.js';
|
25
|
+
|
26
|
+
let {id, step, disabled, children, ...props}: SplitterResizeTriggerProps = $props();
|
27
|
+
|
28
|
+
let splitter = splitterContext.get();
|
29
|
+
let resizeTriggerProps: ResizeTriggerProps = $derived({
|
30
|
+
id,
|
31
|
+
step,
|
32
|
+
disabled,
|
33
|
+
});
|
34
|
+
|
35
|
+
let attrs = $derived(mergeProps(props, splitter.getResizeTriggerProps(resizeTriggerProps)));
|
36
|
+
let state = $derived(splitter.getResizeTriggerState(resizeTriggerProps));
|
37
|
+
</script>
|
38
|
+
|
39
|
+
<div {...attrs}>
|
40
|
+
{@render children?.(state)}
|
41
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const ResizeTrigger: $$__sveltets_2_IsomorphicComponent<SplitterResizeTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type ResizeTrigger = InstanceType<typeof ResizeTrigger>;
|
18
|
+
export default ResizeTrigger;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
4
|
+
import type {CreateSplitterProps, CreateSplitterReturn} from './create-splitter.svelte.js';
|
5
|
+
|
6
|
+
export interface SplitterProps
|
7
|
+
extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateSplitterProps> {
|
8
|
+
children?: Snippet<[splitter: CreateSplitterReturn]>;
|
9
|
+
}
|
10
|
+
</script>
|
11
|
+
|
12
|
+
<script lang="ts">
|
13
|
+
import {mergeProps} from '@zag-js/svelte';
|
14
|
+
import {splitterContext} from './context.svelte.js';
|
15
|
+
import {createSplitter} from './create-splitter.svelte.js';
|
16
|
+
|
17
|
+
let {
|
18
|
+
id,
|
19
|
+
ids,
|
20
|
+
size,
|
21
|
+
orientation,
|
22
|
+
onSizeChange,
|
23
|
+
onSizeChangeEnd,
|
24
|
+
children,
|
25
|
+
...props
|
26
|
+
}: SplitterProps = $props();
|
27
|
+
|
28
|
+
let splitter = createSplitter({
|
29
|
+
id,
|
30
|
+
ids,
|
31
|
+
size,
|
32
|
+
orientation,
|
33
|
+
onSizeChange,
|
34
|
+
onSizeChangeEnd,
|
35
|
+
});
|
36
|
+
|
37
|
+
let attrs = $derived(mergeProps(props, splitter.getRootProps()));
|
38
|
+
|
39
|
+
splitterContext.set(splitter);
|
40
|
+
</script>
|
41
|
+
|
42
|
+
<div {...attrs}>
|
43
|
+
{@render children?.(splitter)}
|
44
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const Root: $$__sveltets_2_IsomorphicComponent<SplitterProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Root = InstanceType<typeof Root>;
|
18
|
+
export default Root;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TimePickerClearTriggerProps extends HtmlProps<'button'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '@zag-js/svelte';
|
9
|
+
import {timePickerContext} from './context.svelte.js';
|
10
|
+
|
11
|
+
let {children, ...props}: TimePickerClearTriggerProps = $props();
|
12
|
+
|
13
|
+
let timePicker = timePickerContext.get();
|
14
|
+
|
15
|
+
let attrs = $derived(mergeProps(props, timePicker.getClearTriggerProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<button type="button" {...attrs}>
|
19
|
+
{@render children?.()}
|
20
|
+
</button>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const ClearTrigger: $$__sveltets_2_IsomorphicComponent<TimePickerClearTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type ClearTrigger = InstanceType<typeof ClearTrigger>;
|
18
|
+
export default ClearTrigger;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
|
+
import type {ColumnProps} from '@zag-js/time-picker';
|
4
|
+
|
5
|
+
export interface TimePickerColumnProps extends Assign<HtmlProps<'div'>, ColumnProps> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '@zag-js/svelte';
|
10
|
+
import {timePickerContext} from './context.svelte.js';
|
11
|
+
|
12
|
+
let {unit, children, ...props}: TimePickerColumnProps = $props();
|
13
|
+
|
14
|
+
let timePicker = timePickerContext.get();
|
15
|
+
|
16
|
+
let attrs = $derived(mergeProps(props, timePicker.getColumnProps({unit})));
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<div {...attrs}>
|
20
|
+
{@render children?.()}
|
21
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const Column: $$__sveltets_2_IsomorphicComponent<TimePickerColumnProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Column = InstanceType<typeof Column>;
|
18
|
+
export default Column;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TimePickerContentProps extends HtmlProps<'div'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '@zag-js/svelte';
|
9
|
+
import {timePickerContext} from './context.svelte.js';
|
10
|
+
|
11
|
+
let {children, ...props}: TimePickerContentProps = $props();
|
12
|
+
|
13
|
+
let timePicker = timePickerContext.get();
|
14
|
+
|
15
|
+
let attrs = $derived(mergeProps(props, timePicker.getContentProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<div {...attrs}>
|
19
|
+
{@render children?.()}
|
20
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const Content: $$__sveltets_2_IsomorphicComponent<TimePickerContentProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Content = InstanceType<typeof Content>;
|
18
|
+
export default Content;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TimePickerControlProps extends HtmlProps<'div'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '@zag-js/svelte';
|
9
|
+
import {timePickerContext} from './context.svelte.js';
|
10
|
+
|
11
|
+
let {children, ...props}: TimePickerControlProps = $props();
|
12
|
+
|
13
|
+
let timePicker = timePickerContext.get();
|
14
|
+
|
15
|
+
let attrs = $derived(mergeProps(props, timePicker.getControlProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<div {...attrs}>
|
19
|
+
{@render children?.()}
|
20
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const Control: $$__sveltets_2_IsomorphicComponent<TimePickerControlProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Control = InstanceType<typeof Control>;
|
18
|
+
export default Control;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import * as timePicker from '@zag-js/time-picker';
|
2
|
+
export interface CreateTimePickerProps extends Omit<timePicker.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
|
+
id?: string | null;
|
4
|
+
defaultOpen?: boolean;
|
5
|
+
}
|
6
|
+
export interface CreateTimePickerReturn extends timePicker.Api {
|
7
|
+
}
|
8
|
+
export declare function createTimePicker(props: CreateTimePickerProps): CreateTimePickerReturn;
|