@ark-ui/solid 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/README.md +24 -21
- package/cjs/index.js +104 -84
- package/cjs/index.js.map +1 -1
- package/esm/index.js +103 -84
- package/esm/index.js.map +1 -1
- package/package.json +51 -49
- package/source/date-picker/date-picker.jsx +1 -1
- package/source/editable/editable-area.jsx +2 -2
- package/source/editable/editable-cancel-trigger.jsx +2 -2
- package/source/editable/editable-control.jsx +2 -2
- package/source/editable/editable-edit-trigger.jsx +2 -2
- package/source/editable/editable-input.jsx +2 -2
- package/source/editable/editable-label.jsx +2 -2
- package/source/editable/editable-preview.jsx +2 -2
- package/source/editable/editable-submit-trigger.jsx +2 -2
- package/source/editable/editable.jsx +5 -7
- package/source/file-upload/file-upload-item-preview-image.jsx +13 -0
- package/source/file-upload/file-upload-item-preview.jsx +3 -10
- package/source/file-upload/file-upload.jsx +5 -1
- package/source/file-upload/index.js +7 -5
- package/source/number-input/index.js +1 -1
- package/source/pagination/pagination-ellipsis.jsx +2 -2
- package/source/pagination/pagination.jsx +2 -4
- package/source/pin-input/index.js +1 -1
- package/source/pin-input/pin-input.jsx +2 -2
- package/source/radio-group/radio-group-item-context.js +2 -2
- package/source/radio-group/radio-group-item.jsx +9 -6
- package/source/rating-group/rating-group-control.jsx +1 -1
- package/source/rating-group/rating-group-item.jsx +2 -2
- package/source/rating-group/rating-group.jsx +2 -2
- package/source/segment-group/segment-group-item-context.js +2 -2
- package/source/segment-group/segment-group-item.jsx +9 -6
- package/source/select/select-indicator.jsx +1 -1
- package/source/select/select-item-group.jsx +2 -2
- package/source/select/select.jsx +2 -2
- package/source/switch/switch-label.jsx +2 -2
- package/source/switch/switch-thumb.jsx +2 -2
- package/source/switch/switch.jsx +2 -2
- package/source/toast/create-toaster.jsx +3 -3
- package/source/toast/index.js +5 -3
- package/source/toast/toast-group.jsx +4 -0
- package/types/file-upload/file-upload-item-preview-image.d.ts +4 -0
- package/types/file-upload/file-upload-item-preview.d.ts +6 -1
- package/types/file-upload/index.d.ts +9 -7
- package/types/number-input/index.d.ts +1 -1
- package/types/pin-input/index.d.ts +1 -1
- package/types/radio-group/radio-group-item-context.d.ts +1 -1
- package/types/radio-group/radio-group-item.d.ts +6 -3
- package/types/rating-group/rating-group-item-context.d.ts +2 -3
- package/types/segment-group/segment-group-item-context.d.ts +3 -14
- package/types/segment-group/segment-group-item.d.ts +6 -2
- package/types/toast/index.d.ts +6 -4
- package/types/toast/toast-group.d.ts +4 -0
- /package/source/number-input/{number-input-field.jsx → number-input-input.jsx} +0 -0
- /package/source/pin-input/{pin-input-field.jsx → pin-input-input.jsx} +0 -0
- /package/types/number-input/{number-input-field.d.ts → number-input-input.d.ts} +0 -0
- /package/types/pin-input/{pin-input-field.d.ts → pin-input-input.d.ts} +0 -0
package/source/switch/switch.jsx
CHANGED
|
@@ -5,7 +5,7 @@ import { runIfFn } from '../run-if-fn';
|
|
|
5
5
|
import { SwitchProvider } from './switch-context';
|
|
6
6
|
import { useSwitch } from './use-switch';
|
|
7
7
|
export const Switch = (props) => {
|
|
8
|
-
const [switchProps,
|
|
8
|
+
const [switchProps, localProps] = createSplitProps()(props, [
|
|
9
9
|
'checked',
|
|
10
10
|
'dir',
|
|
11
11
|
'disabled',
|
|
@@ -21,7 +21,7 @@ export const Switch = (props) => {
|
|
|
21
21
|
'value',
|
|
22
22
|
]);
|
|
23
23
|
const api = useSwitch(switchProps);
|
|
24
|
-
const mergedProps = mergeProps(() => api().rootProps,
|
|
24
|
+
const mergedProps = mergeProps(() => api().rootProps, localProps);
|
|
25
25
|
const getChildren = () => runIfFn(props.children, api);
|
|
26
26
|
return (<SwitchProvider value={api}>
|
|
27
27
|
<ark.label {...mergedProps}>{getChildren()}</ark.label>
|
|
@@ -2,8 +2,8 @@ import { mergeProps, normalizeProps, useActor } from '@zag-js/solid';
|
|
|
2
2
|
import * as toast from '@zag-js/toast';
|
|
3
3
|
import { Index, createEffect, createMemo, onCleanup } from 'solid-js';
|
|
4
4
|
import { useEnvironmentContext } from '../environment';
|
|
5
|
-
import { ark } from '../factory';
|
|
6
5
|
import { ToastProvider } from './toast-context';
|
|
6
|
+
import { ToastGroup } from './toast-group';
|
|
7
7
|
export const createToaster = (props) => {
|
|
8
8
|
const service = toast.group.machine({ id: '1', ...props }).start();
|
|
9
9
|
const [state, send] = useActor(service);
|
|
@@ -15,11 +15,11 @@ export const createToaster = (props) => {
|
|
|
15
15
|
onCleanup(() => service.stop());
|
|
16
16
|
});
|
|
17
17
|
const mergedProps = mergeProps(() => api().getGroupProps({ placement: props.placement }), toasterProps);
|
|
18
|
-
return (<
|
|
18
|
+
return (<ToastGroup {...mergedProps}>
|
|
19
19
|
<Index each={api().toastsByPlacement[props.placement]}>
|
|
20
20
|
{(toast) => <ToastProviderFactory service={toast()}/>}
|
|
21
21
|
</Index>
|
|
22
|
-
</
|
|
22
|
+
</ToastGroup>);
|
|
23
23
|
};
|
|
24
24
|
return [Toaster, api];
|
|
25
25
|
};
|
package/source/toast/index.js
CHANGED
|
@@ -2,11 +2,13 @@ import { createToaster } from './create-toaster';
|
|
|
2
2
|
import { Toast as ToastRoot } from './toast';
|
|
3
3
|
import { ToastCloseTrigger } from './toast-close-trigger';
|
|
4
4
|
import { ToastDescription } from './toast-description';
|
|
5
|
+
import { ToastGroup } from './toast-group';
|
|
5
6
|
import { ToastTitle } from './toast-title';
|
|
6
7
|
const Toast = Object.assign(ToastRoot, {
|
|
7
8
|
Root: ToastRoot,
|
|
8
|
-
Title: ToastTitle,
|
|
9
|
-
Description: ToastDescription,
|
|
10
9
|
CloseTrigger: ToastCloseTrigger,
|
|
10
|
+
Description: ToastDescription,
|
|
11
|
+
Group: ToastGroup,
|
|
12
|
+
Title: ToastTitle,
|
|
11
13
|
});
|
|
12
|
-
export { createToaster, Toast, ToastCloseTrigger, ToastDescription, ToastTitle };
|
|
14
|
+
export { createToaster, Toast, ToastCloseTrigger, ToastDescription, ToastGroup, ToastTitle };
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type HTMLArkProps } from '../factory';
|
|
2
|
-
export interface FileUploadItemPreviewProps extends HTMLArkProps<'
|
|
2
|
+
export interface FileUploadItemPreviewProps extends HTMLArkProps<'div'> {
|
|
3
|
+
/**
|
|
4
|
+
* The file type to match against. Matches all file types by default.
|
|
5
|
+
* @default '.*'
|
|
6
|
+
*/
|
|
7
|
+
type?: string;
|
|
3
8
|
}
|
|
4
9
|
export declare const FileUploadItemPreview: (props: FileUploadItemPreviewProps) => import("solid-js").JSX.Element;
|
|
@@ -5,21 +5,23 @@ import { FileUploadItem, type FileUploadItemProps } from './file-upload-item';
|
|
|
5
5
|
import { FileUploadItemDeleteTrigger, type FileUploadItemDeleteTriggerProps } from './file-upload-item-delete-trigger';
|
|
6
6
|
import { FileUploadItemGroup, type FileUploadItemGroupProps } from './file-upload-item-group';
|
|
7
7
|
import { FileUploadItemName, type FileUploadItemNameProps } from './file-upload-item-name';
|
|
8
|
-
import {
|
|
8
|
+
import { type FileUploadItemPreviewProps } from './file-upload-item-preview';
|
|
9
|
+
import { FileUploadItemPreviewImage, type FileUploadItemPreviewImageProps } from './file-upload-item-preview-image';
|
|
9
10
|
import { FileUploadItemSizeText, type FileUploadItemSizeTextProps } from './file-upload-item-size-text';
|
|
10
11
|
import { FileUploadLabel, type FileUploadLabelProps } from './file-upload-label';
|
|
11
12
|
import { FileUploadTrigger, type FileUploadTriggerProps } from './file-upload-trigger';
|
|
12
13
|
declare const FileUpload: ((props: FileUploadProps) => import("solid-js").JSX.Element) & {
|
|
13
14
|
Root: (props: FileUploadProps) => import("solid-js").JSX.Element;
|
|
14
15
|
Dropzone: (props: FileUploadDropzoneProps) => import("solid-js").JSX.Element;
|
|
15
|
-
Label: (props: FileUploadLabelProps) => import("solid-js").JSX.Element;
|
|
16
|
-
Trigger: (props: FileUploadTriggerProps) => import("solid-js").JSX.Element;
|
|
17
|
-
ItemGroup: (props: FileUploadItemGroupProps) => import("solid-js").JSX.Element;
|
|
18
16
|
Item: (props: FileUploadItemProps) => import("solid-js").JSX.Element;
|
|
17
|
+
ItemDeleteTrigger: (props: FileUploadItemDeleteTriggerProps) => import("solid-js").JSX.Element;
|
|
18
|
+
ItemGroup: (props: FileUploadItemGroupProps) => import("solid-js").JSX.Element;
|
|
19
19
|
ItemName: (props: FileUploadItemNameProps) => import("solid-js").JSX.Element;
|
|
20
20
|
ItemPreview: (props: FileUploadItemPreviewProps) => import("solid-js").JSX.Element;
|
|
21
|
+
ItemPreviewImage: (props: FileUploadItemPreviewImageProps) => import("solid-js").JSX.Element;
|
|
21
22
|
ItemSizeText: (props: FileUploadItemSizeTextProps) => import("solid-js").JSX.Element;
|
|
22
|
-
|
|
23
|
+
Label: (props: FileUploadLabelProps) => import("solid-js").JSX.Element;
|
|
24
|
+
Trigger: (props: FileUploadTriggerProps) => import("solid-js").JSX.Element;
|
|
23
25
|
};
|
|
24
|
-
export { FileUpload, FileUploadDropzone, FileUploadItem, FileUploadItemDeleteTrigger, FileUploadItemGroup, FileUploadItemName,
|
|
25
|
-
export type { FileUploadContext, FileUploadDropzoneProps, FileUploadItemDeleteTriggerProps, FileUploadItemGroupProps, FileUploadItemNameProps, FileUploadItemPreviewProps, FileUploadItemProps, FileUploadItemSizeTextProps, FileUploadLabelProps, FileUploadProps, FileUploadTriggerProps, };
|
|
26
|
+
export { FileUpload, FileUploadDropzone, FileUploadItem, FileUploadItemDeleteTrigger, FileUploadItemGroup, FileUploadItemName, FileUploadItemPreviewImage, FileUploadItemSizeText, FileUploadLabel, FileUploadTrigger, useFileUploadContext, };
|
|
27
|
+
export type { FileUploadContext, FileUploadDropzoneProps, FileUploadItemDeleteTriggerProps, FileUploadItemGroupProps, FileUploadItemNameProps, FileUploadItemPreviewImageProps, FileUploadItemPreviewProps, FileUploadItemProps, FileUploadItemSizeTextProps, FileUploadLabelProps, FileUploadProps, FileUploadTriggerProps, };
|
|
@@ -2,8 +2,8 @@ import { type NumberInputProps } from './number-input';
|
|
|
2
2
|
import { useNumberInputContext, type NumberInputContext } from './number-input-context';
|
|
3
3
|
import { NumberInputControl, type NumberInputControlProps } from './number-input-control';
|
|
4
4
|
import { NumberInputDecrementTrigger, type NumberInputDecrementTriggerProps } from './number-input-decrement-trigger';
|
|
5
|
-
import { NumberInputInput, type NumberInputInputProps } from './number-input-field';
|
|
6
5
|
import { NumberInputIncrementTrigger, type NumberInputIncrementTriggerProps } from './number-input-increment-trigger';
|
|
6
|
+
import { NumberInputInput, type NumberInputInputProps } from './number-input-input';
|
|
7
7
|
import { NumberInputLabel, type NumberInputLabelProps } from './number-input-label';
|
|
8
8
|
import { NumberInputScrubber, type NumberInputScrubberProps } from './number-input-scrubber';
|
|
9
9
|
declare const NumberInput: ((props: NumberInputProps) => import("solid-js").JSX.Element) & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PinInputProps } from './pin-input';
|
|
2
2
|
import { usePinInputContext, type PinInputContext } from './pin-input-context';
|
|
3
3
|
import { PinInputControl, type PinInputControlProps } from './pin-input-control';
|
|
4
|
-
import { PinInputInput, type PinInputInputProps } from './pin-input-
|
|
4
|
+
import { PinInputInput, type PinInputInputProps } from './pin-input-input';
|
|
5
5
|
import { PinInputLabel, type PinInputLabelProps } from './pin-input-label';
|
|
6
6
|
declare const PinInput: ((props: PinInputProps) => import("solid-js").JSX.Element) & {
|
|
7
7
|
Root: (props: PinInputProps) => import("solid-js").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ItemProps } from '@zag-js/radio-group';
|
|
2
2
|
export interface RadioGroupItemContext extends ItemProps {
|
|
3
3
|
}
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const RadioGroupItemProvider: import("solid-js").ContextProviderComponent<RadioGroupItemContext>, useRadioGroupItemContext: () => RadioGroupItemContext;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import type { ItemProps } from '@zag-js/radio-group';
|
|
1
|
+
import type { ItemProps, ItemState } from '@zag-js/radio-group';
|
|
2
|
+
import type { JSX } from 'solid-js/jsx-runtime';
|
|
2
3
|
import { type HTMLArkProps } from '../factory';
|
|
3
4
|
import type { Assign } from '../types';
|
|
4
|
-
export interface RadioGroupItemProps extends Assign<HTMLArkProps<'label'>,
|
|
5
|
+
export interface RadioGroupItemProps extends Assign<HTMLArkProps<'label'>, {
|
|
6
|
+
children?: ((state: ItemState) => JSX.Element) | JSX.Element;
|
|
7
|
+
}>, ItemProps {
|
|
5
8
|
}
|
|
6
|
-
export declare const RadioGroupItem: (props: RadioGroupItemProps) =>
|
|
9
|
+
export declare const RadioGroupItem: (props: RadioGroupItemProps) => JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
export interface RatingGroupItemContext extends Accessor<ItemState> {
|
|
1
|
+
import { type ItemProps } from '@zag-js/rating-group';
|
|
2
|
+
export interface RatingGroupItemContext extends ItemProps {
|
|
4
3
|
}
|
|
5
4
|
export declare const RatingGroupItemProvider: import("solid-js").ContextProviderComponent<RatingGroupItemContext>, useRatingGroupItemContext: () => RatingGroupItemContext;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
disabled?: boolean;
|
|
4
|
-
invalid?: boolean;
|
|
1
|
+
import type { ItemProps } from '@zag-js/radio-group';
|
|
2
|
+
export interface SegmentGroupItemContext extends ItemProps {
|
|
5
3
|
}
|
|
6
|
-
export
|
|
7
|
-
isInvalid: boolean;
|
|
8
|
-
isDisabled: boolean;
|
|
9
|
-
isChecked: boolean;
|
|
10
|
-
isFocused: boolean;
|
|
11
|
-
isHovered: boolean;
|
|
12
|
-
isActive: boolean;
|
|
13
|
-
}
|
|
14
|
-
export type SegmentGroupItemContext = ItemProps;
|
|
15
|
-
export declare const SegmentProvider: import("solid-js").ContextProviderComponent<ItemProps>, useSegmentGroupItemContext: () => ItemProps;
|
|
4
|
+
export declare const SegmentGroupItemProvider: import("solid-js").ContextProviderComponent<SegmentGroupItemContext>, useSegmentGroupItemContext: () => SegmentGroupItemContext;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import type { ItemState } from '@zag-js/radio-group';
|
|
2
|
+
import type { JSX } from 'solid-js/jsx-runtime';
|
|
1
3
|
import { type HTMLArkProps } from '../factory';
|
|
2
4
|
import type { Assign } from '../types';
|
|
3
5
|
import { type SegmentGroupItemContext } from './segment-group-item-context';
|
|
4
|
-
export interface SegmentGroupItemProps extends Assign<HTMLArkProps<'label'>,
|
|
6
|
+
export interface SegmentGroupItemProps extends Assign<HTMLArkProps<'label'>, {
|
|
7
|
+
children?: ((state: ItemState) => JSX.Element) | JSX.Element;
|
|
8
|
+
}>, SegmentGroupItemContext {
|
|
5
9
|
}
|
|
6
|
-
export declare const SegmentGroupItem: (props: SegmentGroupItemProps) =>
|
|
10
|
+
export declare const SegmentGroupItem: (props: SegmentGroupItemProps) => JSX.Element;
|
package/types/toast/index.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ import { createToaster, type CreateToasterProps, type CreateToasterReturn } from
|
|
|
2
2
|
import { type ToastProps } from './toast';
|
|
3
3
|
import { ToastCloseTrigger, type ToastCloseTriggerProps } from './toast-close-trigger';
|
|
4
4
|
import { ToastDescription, type ToastDescriptionProps } from './toast-description';
|
|
5
|
+
import { ToastGroup, type ToastGroupProps } from './toast-group';
|
|
5
6
|
import { ToastTitle, type ToastTitleProps } from './toast-title';
|
|
6
7
|
declare const Toast: ((props: ToastProps) => import("solid-js").JSX.Element) & {
|
|
7
8
|
Root: (props: ToastProps) => import("solid-js").JSX.Element;
|
|
8
|
-
Title: (props: ToastTitleProps) => import("solid-js").JSX.Element;
|
|
9
|
-
Description: (props: ToastDescriptionProps) => import("solid-js").JSX.Element;
|
|
10
9
|
CloseTrigger: (props: ToastCloseTriggerProps) => import("solid-js").JSX.Element;
|
|
10
|
+
Description: (props: ToastDescriptionProps) => import("solid-js").JSX.Element;
|
|
11
|
+
Group: (props: ToastGroupProps) => import("solid-js").JSX.Element;
|
|
12
|
+
Title: (props: ToastTitleProps) => import("solid-js").JSX.Element;
|
|
11
13
|
};
|
|
12
|
-
export { createToaster, Toast, ToastCloseTrigger, ToastDescription, ToastTitle };
|
|
13
|
-
export type { CreateToasterProps, CreateToasterReturn, ToastCloseTriggerProps, ToastDescriptionProps, ToastProps, ToastTitleProps, };
|
|
14
|
+
export { createToaster, Toast, ToastCloseTrigger, ToastDescription, ToastGroup, ToastTitle };
|
|
15
|
+
export type { CreateToasterProps, CreateToasterReturn, ToastCloseTriggerProps, ToastDescriptionProps, ToastGroupProps, ToastProps, ToastTitleProps, };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|