ui-ingredients 0.11.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/accordion/accordion-item-trigger.svelte +1 -1
- package/dist/alert-dialog/alert-dialog-close-trigger.svelte +1 -1
- package/dist/alert-dialog/alert-dialog-trigger.svelte +1 -1
- package/dist/carousel/carousel-indicator.svelte +1 -1
- package/dist/carousel/carousel-next-trigger.svelte +1 -1
- package/dist/carousel/carousel-prev-trigger.svelte +1 -1
- package/dist/clipboard/clipboard-trigger.svelte +1 -1
- package/dist/collapsible/collapsible-trigger.svelte +1 -1
- package/dist/color-picker/color-picker-channel-slider-label.svelte +2 -5
- package/dist/color-picker/color-picker-channel-slider-label.svelte.d.ts +2 -3
- package/dist/color-picker/color-picker-swatch-trigger.svelte +1 -1
- package/dist/color-picker/create-color-picker.svelte.d.ts +1 -2
- package/dist/color-picker/create-color-picker.svelte.js +0 -1
- package/dist/color-picker/index.d.ts +1 -0
- package/dist/combobox/combobox-clear-trigger.svelte +1 -1
- package/dist/combobox/combobox-root.svelte +6 -10
- package/dist/combobox/combobox-root.svelte.d.ts +16 -19
- package/dist/combobox/combobox-trigger.svelte +1 -1
- package/dist/combobox/combobox.d.ts +1 -0
- package/dist/combobox/combobox.js +1 -0
- package/dist/combobox/create-combobox.svelte.d.ts +3 -3
- package/dist/combobox/create-combobox.svelte.js +1 -10
- package/dist/create-context.svelte.d.ts +1 -1
- package/dist/date-picker/create-date-picker.svelte.d.ts +1 -5
- package/dist/date-picker/create-date-picker.svelte.js +0 -6
- package/dist/date-picker/date-picker-clear-trigger.svelte +1 -1
- package/dist/date-picker/date-picker-day-table-cell-trigger.svelte +1 -1
- package/dist/date-picker/date-picker-month-table-cell-trigger.svelte +1 -1
- package/dist/date-picker/date-picker-next-trigger.svelte +1 -1
- package/dist/date-picker/date-picker-preset-trigger.svelte +1 -1
- package/dist/date-picker/date-picker-prev-trigger.svelte +1 -1
- package/dist/date-picker/date-picker-trigger.svelte +1 -1
- package/dist/date-picker/date-picker-view-trigger.svelte +1 -1
- package/dist/date-picker/date-picker-year-table-cell-trigger.svelte +1 -1
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/dialog/dialog-close-trigger.svelte +1 -1
- package/dist/dialog/dialog-trigger.svelte +1 -1
- package/dist/drawer/drawer-close-trigger.svelte +1 -1
- package/dist/drawer/drawer-trigger.svelte +1 -1
- package/dist/editable/editable-cancel-trigger.svelte +1 -1
- package/dist/editable/editable-edit-trigger.svelte +1 -1
- package/dist/editable/editable-submit-trigger.svelte +1 -1
- package/dist/field/field-textarea.svelte +30 -4
- package/dist/field/field-textarea.svelte.d.ts +3 -1
- package/dist/file-upload/file-upload-clear-trigger.svelte +1 -1
- package/dist/file-upload/file-upload-item-delete-trigger.svelte +1 -1
- package/dist/file-upload/file-upload-trigger.svelte +1 -1
- package/dist/floating-panel/floating-panel-close-trigger.svelte +1 -1
- package/dist/floating-panel/floating-panel-drag-trigger.svelte +1 -1
- package/dist/floating-panel/floating-panel-maximize-trigger.svelte +1 -1
- package/dist/floating-panel/floating-panel-minimize-trigger.svelte +1 -1
- package/dist/floating-panel/floating-panel-resize-trigger.svelte +1 -1
- package/dist/floating-panel/floating-panel-restore-trigger.svelte +1 -1
- package/dist/floating-panel/floating-panel-trigger.svelte +1 -1
- package/dist/menu/menu-context-trigger.svelte +1 -1
- package/dist/menu/menu-trigger-item.svelte +1 -1
- package/dist/menu/menu-trigger.svelte +1 -1
- package/dist/number-input/number-input-decrement-trigger.svelte +1 -1
- package/dist/number-input/number-input-increment-trigger.svelte +1 -1
- package/dist/pagination/pagination-item.svelte +1 -1
- package/dist/pagination/pagination-next-trigger.svelte +1 -1
- package/dist/pagination/pagination-prev-trigger.svelte +1 -1
- package/dist/pin-input/create-pin-input.svelte.js +1 -0
- package/dist/pin-input/pin-input-clear-trigger.svelte +1 -1
- package/dist/popover/popover-close-trigger.svelte +1 -1
- package/dist/popover/popover-trigger.svelte +1 -1
- package/dist/segment-group/create-segment-group.svelte.js +26 -1
- package/dist/segment-group/segment-group-indicator.svelte +1 -2
- package/dist/segment-group/segment-group-item-control.svelte +1 -6
- package/dist/segment-group/segment-group-item-text.svelte +1 -6
- package/dist/segment-group/segment-group-item.svelte +1 -6
- package/dist/segment-group/segment-group-label.svelte +1 -4
- package/dist/segment-group/segment-group-root.svelte +1 -2
- package/dist/select/create-select.svelte.d.ts +3 -3
- package/dist/select/create-select.svelte.js +1 -10
- package/dist/select/select-clear-trigger.svelte +1 -1
- package/dist/select/select-root.svelte +6 -9
- package/dist/select/select-root.svelte.d.ts +16 -19
- package/dist/select/select-trigger.svelte +1 -1
- package/dist/select/select.d.ts +1 -0
- package/dist/select/select.js +1 -0
- package/dist/signature-pad/signature-pad-clear-trigger.svelte +1 -1
- package/dist/steps/steps-next-trigger.svelte +1 -1
- package/dist/steps/steps-prev-trigger.svelte +1 -1
- package/dist/steps/steps-trigger.svelte +1 -1
- package/dist/tabs/tabs-trigger.svelte +1 -1
- package/dist/tags-input/tags-input-clear-trigger.svelte +1 -1
- package/dist/tags-input/tags-input-item-delete-trigger.svelte +1 -1
- package/dist/time-picker/index.d.ts +1 -1
- package/dist/time-picker/time-picker-clear-trigger.svelte +1 -1
- package/dist/time-picker/time-picker-trigger.svelte +1 -1
- package/dist/timer/timer-action-trigger.svelte +1 -1
- package/dist/toast/create-toaster.svelte.d.ts +3 -17
- package/dist/toast/toast-action-trigger.svelte +1 -1
- package/dist/toast/toast-close-trigger.svelte +1 -1
- package/dist/toggle-group/toggle-group-item.svelte +1 -1
- package/dist/tooltip/tooltip-trigger.svelte +1 -1
- package/dist/tour/tour-action-trigger.svelte +1 -1
- package/dist/tour/tour-close-trigger.svelte +1 -1
- package/dist/tour/tour-trigger.svelte +1 -1
- package/dist/tree-view/index.d.ts +2 -0
- package/dist/tree-view/tree-view-branch-content.svelte +6 -7
- package/dist/tree-view/tree-view-branch-control.svelte +3 -5
- package/dist/tree-view/tree-view-branch-indent-guide.svelte +35 -0
- package/dist/tree-view/tree-view-branch-indent-guide.svelte.d.ts +21 -0
- package/dist/tree-view/tree-view-branch-indicator.svelte +6 -8
- package/dist/tree-view/tree-view-branch-indicator.svelte.d.ts +1 -1
- package/dist/tree-view/tree-view-branch-text.svelte +3 -5
- package/dist/tree-view/tree-view-branch-trigger.svelte +3 -5
- package/dist/tree-view/tree-view-branch.svelte +11 -20
- package/dist/tree-view/tree-view-branch.svelte.d.ts +2 -2
- package/dist/tree-view/tree-view-context.svelte.d.ts +2 -10
- package/dist/tree-view/tree-view-context.svelte.js +1 -3
- package/dist/tree-view/tree-view-item-indicator.svelte +3 -5
- package/dist/tree-view/tree-view-item-text.svelte +3 -5
- package/dist/tree-view/tree-view-item.svelte +9 -22
- package/dist/tree-view/tree-view-item.svelte.d.ts +2 -2
- package/dist/tree-view/tree-view-label.svelte +0 -1
- package/dist/tree-view/tree-view-root.svelte +1 -0
- package/dist/tree-view/tree-view-tree.svelte +2 -11
- package/dist/tree-view/tree-view-tree.svelte.d.ts +0 -1
- package/dist/tree-view/tree-view.d.ts +2 -0
- package/dist/tree-view/tree-view.js +2 -0
- package/dist/tree-view/types.d.ts +4 -0
- package/dist/tree-view/types.js +1 -0
- package/package.json +58 -57
@@ -1,8 +1,10 @@
|
|
1
1
|
import { createUniqueId } from '../create-unique-id.js';
|
2
2
|
import { getEnvironmentContext } from '../environment-provider/enviroment-provider-context.svelte.js';
|
3
3
|
import { getLocaleContext } from '../locale-provider/local-provider-context.svelte.js';
|
4
|
+
import { mergeProps } from '../merge-props.js';
|
4
5
|
import * as segmentGroup from '@zag-js/radio-group';
|
5
6
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
7
|
+
import { parts } from './segment-group-anatomy.js';
|
6
8
|
export function createSegmentGroup(props) {
|
7
9
|
const locale = getLocaleContext();
|
8
10
|
const environment = getEnvironmentContext();
|
@@ -14,5 +16,28 @@ export function createSegmentGroup(props) {
|
|
14
16
|
...props,
|
15
17
|
}));
|
16
18
|
const [state, send] = useMachine(segmentGroup.machine(context));
|
17
|
-
return reflect(() =>
|
19
|
+
return reflect(() => {
|
20
|
+
const o = segmentGroup.connect(state, send, normalizeProps);
|
21
|
+
return {
|
22
|
+
...o,
|
23
|
+
getIndicatorProps() {
|
24
|
+
return mergeProps(o.getIndicatorProps(), parts.indicator.attrs);
|
25
|
+
},
|
26
|
+
getItemControlProps(props) {
|
27
|
+
return mergeProps(o.getItemControlProps(props), parts.itemControl.attrs);
|
28
|
+
},
|
29
|
+
getItemProps(props) {
|
30
|
+
return mergeProps(o.getItemProps(props), parts.item.attrs);
|
31
|
+
},
|
32
|
+
getItemTextProps(props) {
|
33
|
+
return mergeProps(o.getItemTextProps(props), parts.itemText.attrs);
|
34
|
+
},
|
35
|
+
getLabelProps() {
|
36
|
+
return mergeProps(o.getLabelProps(), parts.label.attrs);
|
37
|
+
},
|
38
|
+
getRootProps() {
|
39
|
+
return mergeProps(o.getRootProps(), parts.root.attrs);
|
40
|
+
},
|
41
|
+
};
|
42
|
+
});
|
18
43
|
}
|
@@ -7,7 +7,6 @@
|
|
7
7
|
|
8
8
|
<script lang="ts">
|
9
9
|
import {mergeProps} from '../merge-props.js';
|
10
|
-
import {parts} from './segment-group-anatomy.js';
|
11
10
|
import {getSegmentGroupContext} from './segment-group-context.svelte.js';
|
12
11
|
|
13
12
|
let {
|
@@ -20,7 +19,7 @@
|
|
20
19
|
let segmentGroup = getSegmentGroupContext();
|
21
20
|
|
22
21
|
let mergedProps = $derived(
|
23
|
-
mergeProps(segmentGroup.getIndicatorProps(),
|
22
|
+
mergeProps(segmentGroup.getIndicatorProps(), props),
|
24
23
|
);
|
25
24
|
</script>
|
26
25
|
|
@@ -7,7 +7,6 @@
|
|
7
7
|
|
8
8
|
<script lang="ts">
|
9
9
|
import {mergeProps} from '../merge-props.js';
|
10
|
-
import {parts} from './segment-group-anatomy.js';
|
11
10
|
import {
|
12
11
|
getSegmentGroupContext,
|
13
12
|
getSegmentGroupItemPropsContext,
|
@@ -24,11 +23,7 @@
|
|
24
23
|
let itemProps = getSegmentGroupItemPropsContext();
|
25
24
|
|
26
25
|
let mergedProps = $derived(
|
27
|
-
mergeProps(
|
28
|
-
segmentGroup.getItemControlProps(itemProps),
|
29
|
-
parts.itemControl.attrs,
|
30
|
-
props,
|
31
|
-
),
|
26
|
+
mergeProps(segmentGroup.getItemControlProps(itemProps), props),
|
32
27
|
);
|
33
28
|
</script>
|
34
29
|
|
@@ -7,7 +7,6 @@
|
|
7
7
|
|
8
8
|
<script lang="ts">
|
9
9
|
import {mergeProps} from '../merge-props.js';
|
10
|
-
import {parts} from './segment-group-anatomy.js';
|
11
10
|
import {
|
12
11
|
getSegmentGroupContext,
|
13
12
|
getSegmentGroupItemPropsContext,
|
@@ -24,11 +23,7 @@
|
|
24
23
|
let itemProps = getSegmentGroupItemPropsContext();
|
25
24
|
|
26
25
|
let mergedProps = $derived(
|
27
|
-
mergeProps(
|
28
|
-
segmentGroup.getItemTextProps(itemProps),
|
29
|
-
parts.itemText.attrs,
|
30
|
-
props,
|
31
|
-
),
|
26
|
+
mergeProps(segmentGroup.getItemTextProps(itemProps), props),
|
32
27
|
);
|
33
28
|
</script>
|
34
29
|
|
@@ -12,7 +12,6 @@
|
|
12
12
|
<script lang="ts">
|
13
13
|
import {mergeProps} from '../merge-props.js';
|
14
14
|
import {createSplitProps} from '@zag-js/utils';
|
15
|
-
import {parts} from './segment-group-anatomy.js';
|
16
15
|
import {
|
17
16
|
getSegmentGroupContext,
|
18
17
|
setSegmentGroupItemPropsContext,
|
@@ -33,11 +32,7 @@
|
|
33
32
|
|
34
33
|
let itemState = $derived(segmentGroup.getItemState(itemProps));
|
35
34
|
let mergedProps = $derived(
|
36
|
-
mergeProps(
|
37
|
-
segmentGroup.getItemProps(itemProps),
|
38
|
-
parts.item.attrs,
|
39
|
-
localProps,
|
40
|
-
),
|
35
|
+
mergeProps(segmentGroup.getItemProps(itemProps), localProps),
|
41
36
|
);
|
42
37
|
|
43
38
|
setSegmentGroupItemPropsContext(() => itemProps);
|
@@ -7,7 +7,6 @@
|
|
7
7
|
|
8
8
|
<script lang="ts">
|
9
9
|
import {mergeProps} from '../merge-props.js';
|
10
|
-
import {parts} from './segment-group-anatomy.js';
|
11
10
|
import {getSegmentGroupContext} from './segment-group-context.svelte.js';
|
12
11
|
|
13
12
|
let {
|
@@ -19,9 +18,7 @@
|
|
19
18
|
|
20
19
|
let segmentGroup = getSegmentGroupContext();
|
21
20
|
|
22
|
-
let mergedProps = $derived(
|
23
|
-
mergeProps(segmentGroup.getLabelProps(), parts.label.attrs, props),
|
24
|
-
);
|
21
|
+
let mergedProps = $derived(mergeProps(segmentGroup.getLabelProps(), props));
|
25
22
|
</script>
|
26
23
|
|
27
24
|
{#if asChild}
|
@@ -17,7 +17,6 @@
|
|
17
17
|
import {reflect} from '@zag-js/svelte';
|
18
18
|
import {createSplitProps} from '@zag-js/utils';
|
19
19
|
import {createSegmentGroup} from './create-segment-group.svelte.js';
|
20
|
-
import {parts} from './segment-group-anatomy.js';
|
21
20
|
import {setSegmentGroupContext} from './segment-group-context.svelte.js';
|
22
21
|
|
23
22
|
let {
|
@@ -44,7 +43,7 @@
|
|
44
43
|
let segmentGroup = createSegmentGroup(reflect(() => createSegmentGroupProps));
|
45
44
|
|
46
45
|
let mergedProps = $derived(
|
47
|
-
mergeProps(segmentGroup.getRootProps(),
|
46
|
+
mergeProps(segmentGroup.getRootProps(), localProps),
|
48
47
|
);
|
49
48
|
|
50
49
|
setSegmentGroupContext(segmentGroup);
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import * as select from '@zag-js/select';
|
2
|
-
type Omitted = 'id' | 'dir' | 'getRootNode' | '
|
3
|
-
export interface CreateSelectProps
|
2
|
+
type Omitted = 'id' | 'dir' | 'getRootNode' | 'open.controlled';
|
3
|
+
export interface CreateSelectProps extends Omit<select.Context, Omitted> {
|
4
4
|
id?: string;
|
5
5
|
openControlled?: boolean;
|
6
6
|
}
|
7
7
|
export interface CreateSelectReturn extends select.Api {
|
8
8
|
}
|
9
|
-
export declare function createSelect
|
9
|
+
export declare function createSelect(props: CreateSelectProps): CreateSelectReturn;
|
10
10
|
export {};
|
@@ -4,15 +4,7 @@ import { getFieldContext } from '../field/field-context.svelte.js';
|
|
4
4
|
import { getLocaleContext } from '../locale-provider/local-provider-context.svelte.js';
|
5
5
|
import * as select from '@zag-js/select';
|
6
6
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
7
|
-
import { createSplitProps } from '@zag-js/utils';
|
8
7
|
export function createSelect(props) {
|
9
|
-
const [collectionProps, selectProps] = $derived(createSplitProps([
|
10
|
-
'items',
|
11
|
-
'itemToValue',
|
12
|
-
'itemToString',
|
13
|
-
'isItemDisabled',
|
14
|
-
])(props));
|
15
|
-
const collection = $derived(select.collection(collectionProps));
|
16
8
|
const field = getFieldContext();
|
17
9
|
const locale = getLocaleContext();
|
18
10
|
const environment = getEnvironmentContext();
|
@@ -28,10 +20,9 @@ export function createSelect(props) {
|
|
28
20
|
disabled: field?.disabled,
|
29
21
|
readOnly: field?.readOnly,
|
30
22
|
required: field?.required,
|
31
|
-
...
|
23
|
+
...props,
|
32
24
|
getRootNode: environment?.getRootNode,
|
33
25
|
'open.controlled': props.openControlled,
|
34
|
-
collection,
|
35
26
|
}));
|
36
27
|
const [state, send] = useMachine(select.machine(context), { context });
|
37
28
|
return reflect(() => {
|
@@ -6,15 +6,15 @@
|
|
6
6
|
CreateSelectReturn,
|
7
7
|
} from './create-select.svelte.js';
|
8
8
|
|
9
|
-
export interface SelectProps
|
9
|
+
export interface SelectProps
|
10
10
|
extends Assign<
|
11
11
|
HtmlIngredientProps<'div', HTMLDivElement, CreateSelectReturn>,
|
12
|
-
CreateSelectProps
|
12
|
+
CreateSelectProps
|
13
13
|
>,
|
14
14
|
PresenceStrategyProps {}
|
15
15
|
</script>
|
16
16
|
|
17
|
-
<script lang="ts"
|
17
|
+
<script lang="ts">
|
18
18
|
import {mergeProps} from '../merge-props.js';
|
19
19
|
import {createPresence} from '../presence/create-presence.svelte.js';
|
20
20
|
import {setPresenceContext} from '../presence/presence-context.svelte.js';
|
@@ -28,10 +28,10 @@
|
|
28
28
|
asChild,
|
29
29
|
children,
|
30
30
|
...props
|
31
|
-
}: SelectProps
|
31
|
+
}: SelectProps = $props();
|
32
32
|
|
33
33
|
let [createSelectProps, rest] = $derived(
|
34
|
-
createSplitProps<CreateSelectProps
|
34
|
+
createSplitProps<CreateSelectProps>([
|
35
35
|
'id',
|
36
36
|
'ids',
|
37
37
|
'form',
|
@@ -39,7 +39,6 @@
|
|
39
39
|
'open',
|
40
40
|
'openControlled',
|
41
41
|
'value',
|
42
|
-
'items',
|
43
42
|
'invalid',
|
44
43
|
'multiple',
|
45
44
|
'disabled',
|
@@ -51,9 +50,6 @@
|
|
51
50
|
'deselectable',
|
52
51
|
'closeOnSelect',
|
53
52
|
'highlightedValue',
|
54
|
-
'itemToValue',
|
55
|
-
'itemToString',
|
56
|
-
'isItemDisabled',
|
57
53
|
'onOpenChange',
|
58
54
|
'onValueChange',
|
59
55
|
'onFocusOutside',
|
@@ -61,6 +57,7 @@
|
|
61
57
|
'onInteractOutside',
|
62
58
|
'onPointerDownOutside',
|
63
59
|
'scrollToIndexFn',
|
60
|
+
'collection',
|
64
61
|
])(props),
|
65
62
|
);
|
66
63
|
|
@@ -1,26 +1,23 @@
|
|
1
1
|
import type { PresenceStrategyProps } from '../presence/create-presence.svelte.js';
|
2
2
|
import type { Assign, HtmlIngredientProps } from '../types.js';
|
3
3
|
import type { CreateSelectProps, CreateSelectReturn } from './create-select.svelte.js';
|
4
|
-
export interface SelectProps
|
4
|
+
export interface SelectProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, CreateSelectReturn>, CreateSelectProps>, PresenceStrategyProps {
|
5
5
|
}
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
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> {
|
7
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
8
|
+
$$bindings?: Bindings;
|
9
|
+
} & Exports;
|
10
|
+
(internal: unknown, props: Props & {
|
11
|
+
$$events?: Events;
|
12
|
+
$$slots?: Slots;
|
13
|
+
}): Exports & {
|
14
|
+
$set?: any;
|
15
|
+
$on?: any;
|
10
16
|
};
|
11
|
-
|
12
|
-
bindings(): "ref";
|
13
|
-
exports(): {};
|
17
|
+
z_$$bindings?: Bindings;
|
14
18
|
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {
|
20
|
-
$$events?: ReturnType<__sveltets_Render<T>['events']>;
|
21
|
-
}): ReturnType<__sveltets_Render<T>['exports']>;
|
22
|
-
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
23
|
-
}
|
24
|
-
declare const SelectRoot: $$IsomorphicComponent;
|
25
|
-
type SelectRoot<T> = InstanceType<typeof SelectRoot<T>>;
|
19
|
+
declare const SelectRoot: $$__sveltets_2_IsomorphicComponent<SelectProps, {
|
20
|
+
[evt: string]: CustomEvent<any>;
|
21
|
+
}, {}, {}, "ref">;
|
22
|
+
type SelectRoot = InstanceType<typeof SelectRoot>;
|
26
23
|
export default SelectRoot;
|
package/dist/select/select.d.ts
CHANGED
package/dist/select/select.js
CHANGED
@@ -13,5 +13,5 @@ export type { TimePickerProps } from './time-picker-root.svelte';
|
|
13
13
|
export type { TimePickerSecondCellProps } from './time-picker-second-cell.svelte';
|
14
14
|
export type { TimePickerSpacerProps } from './time-picker-spacer.svelte';
|
15
15
|
export type { TimePickerTriggerProps } from './time-picker-trigger.svelte';
|
16
|
-
export { anatomy as timePickerAnatomy } from '@zag-js/time-picker';
|
16
|
+
export { anatomy as timePickerAnatomy, type Time } from '@zag-js/time-picker';
|
17
17
|
export { getTimePickerContext } from './time-picker-context.svelte.js';
|