Skip to content

Commit 67a9941

Browse files
committed
upgrade ui-library to chakra ui v3
1 parent 5a62d8c commit 67a9941

35 files changed

+3414
-4607
lines changed

.storybook/chakraTheme.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

.storybook/preview.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
import * as React from "react";
2-
import type { Preview } from "@storybook/react";
3-
import { ChakraProvider } from "@chakra-ui/react";
1+
import { ChakraProvider } from '@chakra-ui/react'
2+
import type { Preview } from '@storybook/react'
3+
import './styles.css'
4+
import type { PropsWithChildren } from 'react'
5+
import { system as theme } from './theme'
46

5-
import "./styles.css";
6-
7-
import { chakraTheme } from "./chakraTheme";
8-
9-
function StoryWrapper({ children }: { children: React.ReactNode }) {
10-
return <ChakraProvider theme={chakraTheme}>{children}</ChakraProvider>;
7+
function StoryWrapper({ children }: PropsWithChildren) {
8+
return <ChakraProvider value={theme}>{children}</ChakraProvider>
119
}
1210

1311
const preview: Preview = {
1412
parameters: {
15-
actions: { argTypesRegex: "^on[A-Z].*" },
13+
actions: { argTypesRegex: '^on[A-Z].*' },
1614
controls: {
1715
matchers: {
1816
color: /(background|color)$/i,
@@ -28,6 +26,6 @@ const preview: Preview = {
2826
</StoryWrapper>
2927
),
3028
],
31-
};
29+
}
3230

33-
export default preview;
31+
export default preview

.storybook/theme.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { createSystem, defaultConfig } from '@chakra-ui/react'
2+
import { config } from '@hivemq/ui-theme'
3+
4+
export const system = createSystem(defaultConfig, config)

src/modules/Buttons/index.ts renamed to index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
export {
18-
IconButtonWithTooltip,
19-
type IconButtonWithTooltipProps,
20-
} from './IconButtonWithTooltip'
17+
export * from './src/modules/Shell'
18+
export * from './src/modules/Content'
19+
export * from './src/modules/Header'
20+
export * from './src/modules/Sidebar'
21+
22+
export { useShellContext } from './src/context/ShellContext'

package.json

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hivemq/ui-library",
3-
"version": "1.1.0",
3+
"version": "2.0.0-rc.1",
44
"type": "module",
55
"main": "./dist/index.es.js",
66
"types": "./dist/index.d.ts",
@@ -31,58 +31,57 @@
3131
"lint:all": "pnpm run lint:check && pnpm run lint:headers && pnpm run lint:format",
3232
"test:unit": "TZ=UTC pnpm vitest run --outputFile.junit=./test-results/junit.xml",
3333
"test:unit:ci": "pnpm test:unit --coverage --silent",
34+
"generate:theme": "chakra typegen ./.storybook/theme.ts",
35+
"generate": "pnpm generate:theme",
36+
"postinstall": "pnpm generate",
3437
"preview": "vite preview",
3538
"storybook": "BUILD_ENV='storybook' storybook dev -p 6006",
3639
"storybook:build": "BUILD_ENV='storybook' storybook build"
3740
},
3841
"devDependencies": {
3942
"@biomejs/biome": "^1.9.4",
40-
"@chakra-ui/cli": "^2.4.1",
41-
"@chakra-ui/react": "^2.10.4",
42-
"@chakra-ui/styled-system": "^2.11.2",
43-
"@emotion/react": "^11.13.5",
44-
"@emotion/styled": "^11.13.5",
45-
"@fontsource/raleway": "^5.0.19",
46-
"@fontsource/roboto": "^5.0.13",
47-
"@radix-ui/react-slot": "^1.1.0",
48-
"@storybook/addon-a11y": "^8.2.6",
49-
"@storybook/addon-essentials": "^8.2.4",
50-
"@storybook/addon-interactions": "^8.2.4",
51-
"@storybook/addon-links": "^8.2.4",
52-
"@storybook/addon-onboarding": "^8.2.4",
43+
"@chakra-ui/cli": "^3.14.2",
44+
"@chakra-ui/react": "^3.14.2",
45+
"@emotion/react": "^11.14.0",
46+
"@fontsource/raleway": "^5.2.5",
47+
"@fontsource/roboto": "^5.2.5",
48+
"@radix-ui/react-slot": "^1.1.2",
49+
"@hivemq/ui-theme": "^1.0.0-rc.1",
50+
"@storybook/addon-a11y": "^8.6.8",
51+
"@storybook/addon-essentials": "^8.6.8",
52+
"@storybook/addon-interactions": "^8.6.8",
53+
"@storybook/addon-links": "^8.6.8",
54+
"@storybook/addon-onboarding": "^8.6.8",
5355
"@storybook/addon-styling": "^1.3.7",
54-
"@storybook/blocks": "^8.2.4",
55-
"@storybook/manager-api": "^8.2.4",
56-
"@storybook/react": "^8.2.4",
57-
"@storybook/react-vite": "^8.2.4",
56+
"@storybook/blocks": "^8.6.8",
57+
"@storybook/manager-api": "^8.6.8",
58+
"@storybook/react": "^8.6.8",
59+
"@storybook/react-vite": "^8.6.8",
5860
"@storybook/testing-library": "^0.2.2",
59-
"@storybook/theming": "^8.2.4",
60-
"@types/node": "^20.14.11",
61-
"@types/react": "^18.3.3",
62-
"@types/react-dom": "^18.3.0",
63-
"@vitejs/plugin-react": "^4.3.1",
64-
"@vitest/coverage-v8": "^2.0.3",
65-
"autoprefixer": "^10.4.19",
66-
"lucide-react": "^0.410.0",
67-
"postcss": "^8.4.39",
61+
"@storybook/theming": "^8.6.8",
62+
"@types/node": "^22.13.12",
63+
"@types/react": "^18.3.16",
64+
"@types/react-dom": "^18.3.5",
65+
"@vitejs/plugin-react": "^4.3.4",
66+
"@vitest/coverage-v8": "^3.0.9",
67+
"autoprefixer": "^10.4.21",
68+
"lucide-react": "^0.483.0",
69+
"postcss": "^8.5.3",
6870
"react": "^18.3.1",
6971
"react-dom": "^18.3.1",
70-
"storybook": "^8.2.4",
71-
"tailwindcss": "^3.4.6",
72-
"tsc-alias": "^1.8.10",
73-
"typescript": "^5.5.3",
74-
"vite": "^5.3.4",
75-
"vite-plugin-dts": "4.0.0-beta.1",
76-
"vite-plugin-static-copy": "^1.0.6",
77-
"vitest": "^2.0.3"
72+
"storybook": "^8.6.8",
73+
"tailwindcss": "^4.0.15",
74+
"tsc-alias": "^1.8.11",
75+
"typescript": "^5.8.2",
76+
"vite": "^6.2.2",
77+
"vite-plugin-dts": "4.5.3",
78+
"vite-plugin-static-copy": "^2.3.0",
79+
"vitest": "^3.0.9"
7880
},
7981
"peerDependencies": {
80-
"@chakra-ui/react": "^2.10.4",
81-
"@chakra-ui/styled-system": "^2.11.2",
82-
"@emotion/react": "^11.13.5",
83-
"@emotion/styled": "^11.13.5",
84-
"@hivemq/ui-theme": "^0.5.0",
85-
"react": "^18.2.0",
86-
"react-dom": "^18.2.0"
82+
"@chakra-ui/react": "^3.14.2",
83+
"@emotion/react": "^11.14.0",
84+
"react": "^18.3.1",
85+
"react-dom": "^18.3.1"
8786
}
8887
}

0 commit comments

Comments
 (0)