Skip to content

Commit

Permalink
chore: update react-aria-components version to 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbychan committed May 6, 2024
1 parent a5d388f commit 45ade4a
Show file tree
Hide file tree
Showing 5 changed files with 911 additions and 780 deletions.
6 changes: 6 additions & 0 deletions .changeset/purple-kids-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@alice-ui/react": patch
"@alice-ui/theme": patch
---

update react-aria-components version to 1.2.0
22 changes: 11 additions & 11 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@
"postpack": "clean-package restore"
},
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"dependencies": {
"@alice-ui/hooks": "workspace:*",
"@alice-ui/icons": "workspace:*",
"@alice-ui/react-utils": "workspace:*",
"@alice-ui/shared-utils": "workspace:*",
"@alice-ui/theme": "workspace:*",
"@react-aria/focus": "^3.16.2",
"@react-aria/interactions": "^3.21.1",
"@react-aria/overlays": "^3.21.1",
"@react-aria/utils": "^3.23.2",
"@react-stately/utils": "^3.9.1",
"@react-types/shared": "^3.22.1",
"react-aria": "^3.32.1",
"react-aria-components": "1.1.1",
"react-stately": "^3.30.1",
"@react-aria/focus": "^3.17.0",
"@react-aria/interactions": "^3.21.2",
"@react-aria/overlays": "^3.22.0",
"@react-aria/utils": "^3.24.0",
"@react-stately/utils": "^3.10.0",
"@react-types/shared": "^3.23.0",
"react-aria": "^3.33.0",
"react-aria-components": "^1.2.0",
"react-stately": "^3.31.0",
"react-textarea-autosize": "^8.5.3"
},
"devDependencies": {
Expand Down
16 changes: 15 additions & 1 deletion packages/react/src/provider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ModalProviderProps } from '@react-aria/overlays';
import type { Href } from '@react-types/shared';

import { I18nProvider, I18nProviderProps, OverlayProvider, RouterProvider } from 'react-aria';

Expand All @@ -14,18 +15,31 @@ export interface AliceUIProviderProps extends Omit<ModalProviderProps, 'children
* Link, Menu, Tabs, Table, etc.
*/
navigate?: (path: string) => void;
/**
* Convert an `href` provided to a link component to a native `href`
* For example, a router might accept hrefs relative to a base path,
* or offer additional custom ways of specifying link destinations.
* The original href specified on the link is passed to the navigate function of the RouterProvider,
* and useHref is used to generate the full native href to put on the actual DOM element.
*/
useHref?: (href: Href) => string;
}

export const AliceUIProvider: React.FC<AliceUIProviderProps> = ({
children,
locale = 'en-US',
navigate,
useHref,
...otherProps
}) => {
let contents = children;

if (navigate) {
contents = <RouterProvider navigate={navigate}>{contents}</RouterProvider>;
contents = (
<RouterProvider navigate={navigate} useHref={useHref}>
{contents}
</RouterProvider>
);
}

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/components/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const modal = tv({
],
backdrop: ['z-50', 'fixed', 'inset-0', 'w-screen', 'h-screen'],
dialog: ['outline-none', 'flex', 'flex-col', 'overflow-hidden'],
header: ['text-lg', 'font-semibold', 'flex', 'py-4', 'px-6', 'flex-initial'],
header: ['text-lg', 'font-semibold', 'py-4', 'px-6'],
body: ['flex', 'flex-1', 'flex-col', 'gap-3', 'px-6', 'py-2'],
footer: ['flex', 'flex-row', 'gap-2', 'justify-end', 'px-6', 'py-4'],
closeButton: ['absolute', 'top-2', 'right-2', 'rtl:left-2', 'rtl:right-[unset]'],
Expand Down
Loading

0 comments on commit 45ade4a

Please sign in to comment.