Skip to content

Commit

Permalink
chore: upgrade zag-js to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Jan 13, 2025
1 parent 82e8852 commit 20ef906
Show file tree
Hide file tree
Showing 11 changed files with 751 additions and 721 deletions.
11 changes: 11 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ description: All notable changes will be documented in this file.

## [Unreleased]

## [4.8.1] - 2025-01-13

### Fixed

- **FileUpload**

- Fixed issue where the preview image shows a brief warning when a new image file is added.
- Improve click detection for dropzone and add support for `disableClick` prop on dropzone.

- **General**: Don't reset form-related components if reset event is cancelled

## [4.8.0] - 2025-01-11

### Added
Expand Down
104 changes: 52 additions & 52 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,57 +166,57 @@
"sideEffects": false,
"dependencies": {
"@internationalized/date": "3.6.0",
"@zag-js/accordion": "0.81.1",
"@zag-js/anatomy": "0.81.1",
"@zag-js/auto-resize": "0.81.1",
"@zag-js/avatar": "0.81.1",
"@zag-js/carousel": "0.81.1",
"@zag-js/checkbox": "0.81.1",
"@zag-js/clipboard": "0.81.1",
"@zag-js/collapsible": "0.81.1",
"@zag-js/collection": "0.81.1",
"@zag-js/color-picker": "0.81.1",
"@zag-js/color-utils": "0.81.1",
"@zag-js/combobox": "0.81.1",
"@zag-js/core": "0.81.1",
"@zag-js/date-picker": "0.81.1",
"@zag-js/date-utils": "0.81.1",
"@zag-js/dialog": "0.81.1",
"@zag-js/dom-query": "0.81.1",
"@zag-js/editable": "0.81.1",
"@zag-js/file-upload": "0.81.1",
"@zag-js/file-utils": "0.81.1",
"@zag-js/focus-trap": "0.81.1",
"@zag-js/highlight-word": "0.81.1",
"@zag-js/hover-card": "0.81.1",
"@zag-js/i18n-utils": "0.81.1",
"@zag-js/menu": "0.81.1",
"@zag-js/number-input": "0.81.1",
"@zag-js/pagination": "0.81.1",
"@zag-js/pin-input": "0.81.1",
"@zag-js/popover": "0.81.1",
"@zag-js/presence": "0.81.1",
"@zag-js/progress": "0.81.1",
"@zag-js/qr-code": "0.81.1",
"@zag-js/radio-group": "0.81.1",
"@zag-js/rating-group": "0.81.1",
"@zag-js/react": "0.81.1",
"@zag-js/select": "0.81.1",
"@zag-js/signature-pad": "0.81.1",
"@zag-js/slider": "0.81.1",
"@zag-js/splitter": "0.81.1",
"@zag-js/steps": "0.81.1",
"@zag-js/switch": "0.81.1",
"@zag-js/tabs": "0.81.1",
"@zag-js/tags-input": "0.81.1",
"@zag-js/time-picker": "0.81.1",
"@zag-js/timer": "0.81.1",
"@zag-js/toast": "0.81.1",
"@zag-js/toggle-group": "0.81.1",
"@zag-js/tooltip": "0.81.1",
"@zag-js/tour": "0.81.1",
"@zag-js/tree-view": "0.81.1",
"@zag-js/types": "0.81.1"
"@zag-js/accordion": "0.81.2",
"@zag-js/anatomy": "0.81.2",
"@zag-js/auto-resize": "0.81.2",
"@zag-js/avatar": "0.81.2",
"@zag-js/carousel": "0.81.2",
"@zag-js/checkbox": "0.81.2",
"@zag-js/clipboard": "0.81.2",
"@zag-js/collapsible": "0.81.2",
"@zag-js/collection": "0.81.2",
"@zag-js/color-picker": "0.81.2",
"@zag-js/color-utils": "0.81.2",
"@zag-js/combobox": "0.81.2",
"@zag-js/core": "0.81.2",
"@zag-js/date-picker": "0.81.2",
"@zag-js/date-utils": "0.81.2",
"@zag-js/dialog": "0.81.2",
"@zag-js/dom-query": "0.81.2",
"@zag-js/editable": "0.81.2",
"@zag-js/file-upload": "0.81.2",
"@zag-js/file-utils": "0.81.2",
"@zag-js/focus-trap": "0.81.2",
"@zag-js/highlight-word": "0.81.2",
"@zag-js/hover-card": "0.81.2",
"@zag-js/i18n-utils": "0.81.2",
"@zag-js/menu": "0.81.2",
"@zag-js/number-input": "0.81.2",
"@zag-js/pagination": "0.81.2",
"@zag-js/pin-input": "0.81.2",
"@zag-js/popover": "0.81.2",
"@zag-js/presence": "0.81.2",
"@zag-js/progress": "0.81.2",
"@zag-js/qr-code": "0.81.2",
"@zag-js/radio-group": "0.81.2",
"@zag-js/rating-group": "0.81.2",
"@zag-js/react": "0.81.2",
"@zag-js/select": "0.81.2",
"@zag-js/signature-pad": "0.81.2",
"@zag-js/slider": "0.81.2",
"@zag-js/splitter": "0.81.2",
"@zag-js/steps": "0.81.2",
"@zag-js/switch": "0.81.2",
"@zag-js/tabs": "0.81.2",
"@zag-js/tags-input": "0.81.2",
"@zag-js/time-picker": "0.81.2",
"@zag-js/timer": "0.81.2",
"@zag-js/toast": "0.81.2",
"@zag-js/toggle-group": "0.81.2",
"@zag-js/tooltip": "0.81.2",
"@zag-js/tour": "0.81.2",
"@zag-js/tree-view": "0.81.2",
"@zag-js/types": "0.81.2"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
Expand All @@ -233,7 +233,7 @@
"@types/react": "19.0.6",
"@types/react-dom": "19.0.3",
"@vitejs/plugin-react": "4.3.4",
"@zag-js/stringify-state": "0.81.1",
"@zag-js/stringify-state": "0.81.2",
"clean-package": "2.2.0",
"globby": "14.0.2",
"jsdom": "25.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
import { mergeProps } from '@zag-js/react'
import { forwardRef, useEffect, useState } from 'react'
import { type HTMLProps, type PolymorphicProps, ark } from '../factory'
import { useFileUploadContext } from './use-file-upload-context'
import { useFileUploadItemPropsContext } from './use-file-upload-item-props-context'
import { mergeProps } from "@zag-js/react";
import { forwardRef, useEffect, useState } from "react";
import { type HTMLProps, type PolymorphicProps, ark } from "../factory";
import { useFileUploadContext } from "./use-file-upload-context";
import { useFileUploadItemPropsContext } from "./use-file-upload-item-props-context";

export interface FileUploadItemPreviewImageBaseProps extends PolymorphicProps {}
export interface FileUploadItemPreviewImageProps
extends HTMLProps<'img'>,
FileUploadItemPreviewImageBaseProps {}
extends HTMLProps<"img">,
FileUploadItemPreviewImageBaseProps {}

export const FileUploadItemPreviewImage = forwardRef<
HTMLImageElement,
FileUploadItemPreviewImageProps
HTMLImageElement,
FileUploadItemPreviewImageProps
>((props, ref) => {
const [url, setUrl] = useState<string>('')
const fileUpload = useFileUploadContext()
const itemProps = useFileUploadItemPropsContext()
const mergedProps = mergeProps(fileUpload.getItemPreviewImageProps({ ...itemProps, url }), props)
const [url, setUrl] = useState<string>("");
const fileUpload = useFileUploadContext();
const itemProps = useFileUploadItemPropsContext();
const mergedProps = mergeProps(
fileUpload.getItemPreviewImageProps({ ...itemProps, url }),
props,
);

useEffect(() => {
return fileUpload.createFileUrl(itemProps.file, (url) => setUrl(url))
}, [itemProps, fileUpload])
useEffect(() => {
return fileUpload.createFileUrl(itemProps.file, (url) => setUrl(url));
}, [itemProps, fileUpload]);

return <ark.img {...mergedProps} ref={ref} />
})
if (!url) return null;

FileUploadItemPreviewImage.displayName = 'FileUploadItemPreviewImage'
return <ark.img {...mergedProps} ref={ref} />;
});

FileUploadItemPreviewImage.displayName = "FileUploadItemPreviewImage";
6 changes: 6 additions & 0 deletions packages/solid/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ description: All notable changes will be documented in this file.

- **HoverCard, Tooltip**: Resolved an issue where the controlled open state could become
inconsistent during the `opening` or `closing` phases.
- **FileUpload**

- Fixed issue where the preview image shows a brief warning when a new image file is added.
- Improve click detection for dropzone and add support for `disableClick` prop on dropzone.

- **General**: Don't reset form-related components if reset event is cancelled

## [4.8.0] - 2025-01-08

Expand Down
Loading

0 comments on commit 20ef906

Please sign in to comment.