Skip to content

Commit

Permalink
feat: migrated to chakra v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mbret committed Jan 25, 2025
1 parent 3cf0079 commit 15ee7d7
Show file tree
Hide file tree
Showing 21 changed files with 1,468 additions and 2,293 deletions.
2,616 changes: 847 additions & 1,769 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"rollup-plugin-node-externals": "^8.0.0",
"rxjs": "*",
"serve": "^14.2.0",
"tailwindcss": "^3.4.1",
"ts-node": "^10.4.0",
"vite": "^6.0.0",
"vite-plugin-dts": "^4.0.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@babel/core": "^7.0.0",
"@chakra-ui/react": "^3.3.1",
"@chakra-ui/react": "^3.4.0",
"@chakra-ui/styled-system": "2.12.0",
"@chakra-ui/system": "^2.5.1",
"@emotion/react": "^11.14.0",
Expand All @@ -35,8 +35,8 @@
"next-themes": "^0.4.4",
"pdfjs-dist": "^4.7.76",
"rc-slider": "^11.1.5",
"react": "^18.2.0",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-dropzone": "^14.2.2",
"react-icons": "^5.4.0",
"react-router": "^7.1.1",
Expand Down
1 change: 1 addition & 0 deletions packages/demo/src/books/BookTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ export const BookTable = ({
</Table.Root>
</Box>
);

2 changes: 1 addition & 1 deletion packages/demo/src/books/BooksScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const BooksScreen = () => {
</Table.Cell>
<Table.Cell textAlign="right">
<IconButton
variant="surface"
variant="outline"
aria-label="Remove"
onClick={async () => {
await localforage.removeItem(name);
Expand Down
6 changes: 3 additions & 3 deletions packages/demo/src/common/AppBar.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type React from "react"
import { type ComponentProps, memo } from "react"
import { type Box, Stack, Text } from "@chakra-ui/react"
import { Stack, Text } from "@chakra-ui/react"

export const AppBar = memo(
({
leftElement,
middleElement,
rightElement,
...rest
}: ComponentProps<typeof Box> & {
}: ComponentProps<typeof Stack> & {
leftElement?: React.ReactElement
middleElement?: React.ReactElement | string
rightElement?: React.ReactElement
Expand All @@ -25,7 +25,7 @@ export const AppBar = memo(
>
{leftElement}
{typeof middleElement === "string" ? (
<Text as="h1" noOfLines={1}>
<Text as="h1" lineClamp={1}>
{middleElement}
</Text>
) : (
Expand Down
51 changes: 51 additions & 0 deletions packages/demo/src/common/FullScreenDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { IoMdClose } from "react-icons/io"
import { IconButton, Box } from "@chakra-ui/react"
import type { FC, ReactNode } from "react"
import { AppBar } from "./AppBar"
import {
DialogBackdrop,
DialogContent,
DialogRoot,
} from "../components/ui/dialog"

export const FullScreenDialog: FC<{
onClose: () => void
isOpen: boolean
title: string
children: ReactNode
}> = ({ onClose, isOpen, children, title }) => {
return (
<DialogRoot
lazyMount
open={isOpen}
size="full"
onOpenChange={(e) => {
if (!e.open) {
onClose()
}
}}
>
<DialogBackdrop />
<DialogContent height="100%">
<Box
style={{
height: "100%",
overflow: "hidden",
display: "flex",
flexDirection: "column",
}}
>
<AppBar
leftElement={
<IconButton aria-label="back" onClick={onClose}>
<IoMdClose />
</IconButton>
}
middleElement={title}
/>
{children}
</Box>
</DialogContent>
</DialogRoot>
)
}
45 changes: 0 additions & 45 deletions packages/demo/src/common/FullScreenModal.tsx

This file was deleted.

Loading

0 comments on commit 15ee7d7

Please sign in to comment.