Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
Pagebakers committed Nov 22, 2024
1 parent 770f4d1 commit 550e5a6
Show file tree
Hide file tree
Showing 92 changed files with 590 additions and 1,907 deletions.
22 changes: 22 additions & 0 deletions .changeset/gorgeous-masks-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@saas-ui/modals-provider': major
'@saas-ui/auth-provider': major
'@saas-ui/use-hotkeys': major
'@saas-ui/nprogress': major
'@saas-ui/supabase': major
'@saas-ui/assets': major
'@saas-ui/charts': major
'@saas-ui/modals': major
'@saas-ui/storybook-addon': major
'@saas-ui/auth0': major
'@saas-ui/clerk': major
'@saas-ui/forms': major
'@saas-ui/hooks': major
'@saas-ui/react': major
'@saas-ui/core': major
'saas-ui-storybook': major
'@saas-ui/props-docs': major
'@saas-ui/test-utils': major
---

Upgrade to Chakra v3
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"create:block": "yarn hygen blocks new",
"build:web": "yarn w website build",
"build:theme": "turbo run build --filter='./packages/saas-ui-theme'",
"build:tokens": "chakra typegen packages/saas-ui-core/src/preset.ts",
"build:tokens-dev": "cross-env LOCAL=1 chakra typegen packages/saas-ui-core/src/preset.ts",
"build:tokens": "chakra typegen packages/saas-ui-react/src/preset.ts",
"build:tokens-dev": "cross-env LOCAL=1 chakra typegen packages/saas-ui-react/src/preset.ts",
"build:packages": "turbo run build --filter='./packages/saas-ui-*' --filter='!./packages/pro/*' --concurrency=5 --continue && yarn build:tokens",
"build:packages:force": "turbo run build --filter='./packages/saas-ui-*' --filter='!./packages/pro/*' --concurrency=5 --continue --force && yarn build:tokens",
"watch:theme": "turbo run build --filter='./packages/saas-ui-theme' -- --watch",
Expand All @@ -72,7 +72,7 @@
"tooling/storybook-addon"
],
"devDependencies": {
"@chakra-ui/cli": "^3.1.2",
"@chakra-ui/cli": "^3.2.0",
"@changesets/cli": "^2.27.9",
"@manypkg/get-packages": "^2.2.2",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
Expand Down Expand Up @@ -105,7 +105,7 @@
"unist-util-visit": "4.0.0",
"react": "18.2.0",
"@emotion/react": "11.11.1",
"@chakra-ui/react": "3.0.2"
"@chakra-ui/react": "https://pkg.pr.new/chakra-ui/chakra-ui/@chakra-ui/react@9223#4"
},
"packageManager": "[email protected]"
}
3 changes: 1 addition & 2 deletions packages/saas-ui-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
"clean": "rm -rf dist"
},
"dependencies": {
"@chakra-ui/styled-system": "^2.12.1",
"recharts": "^2.13.3"
},
"peerDependencies": {
"@chakra-ui/react": ">=2.9.0 <3",
"@chakra-ui/react": "^3.0.0",
"@emotion/react": ">=11",
"react": ">=18",
"react-dom": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion packages/saas-ui-charts/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig({
},
clean: true,
sourcemap: true,
external: ['react', 'recharts', '@chakra-ui/react', '@chakra-ui/utils'],
external: ['react', 'recharts', '@chakra-ui/react'],
format: ['esm', 'cjs'],
banner: {
js: "'use client'",
Expand Down
43 changes: 22 additions & 21 deletions packages/saas-ui-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@
"import": "./dist/index.js"
},
"./grid-list": {
"sui": "./src/grid-list/index.ts",
"require": "./dist/grid-list/index.cjs",
"types": "./dist/grid-list/index.d.ts",
"import": "./dist/grid-list/index.js"
"sui": "./src/components/grid-list/index.ts",
"require": "./dist/components/grid-list/index.cjs",
"types": "./dist/components/grid-list/index.d.ts",
"import": "./dist/components/grid-list/index.js"
},
"./navbar": {
"sui": "./src/navbar/index.ts",
"require": "./dist/navbar/index.cjs",
"types": "./dist/navbar/index.d.ts",
"import": "./dist/navbar/index.js"
"sui": "./src/components/navbar/index.ts",
"require": "./dist/components/navbar/index.cjs",
"types": "./dist/components/navbar/index.d.ts",
"import": "./dist/components/navbar/index.js"
},
"./error-boundary": {
"sui": "./src/error-boundary/index.ts",
"require": "./dist/error-boundary/index.cjs",
"types": "./dist/error-boundary/index.d.ts",
"import": "./dist/error-boundary/index.js"
"sui": "./src/components/error-boundary/index.ts",
"require": "./dist/components/error-boundary/index.cjs",
"types": "./dist/components/error-boundary/index.d.ts",
"import": "./dist/components/error-boundary/index.js"
},
"./sidebar": {
"sui": "./src/sidebar/index.ts",
"require": "./dist/sidebar/index.cjs",
"types": "./dist/sidebar/index.d.ts",
"import": "./dist/sidebar/index.js"
"sui": "./src/components/sidebar/index.ts",
"require": "./dist/components/sidebar/index.cjs",
"types": "./dist/components/sidebar/index.d.ts",
"import": "./dist/components/sidebar/index.js"
},
"./steps": {
"sui": "./src/steps/index.ts",
"require": "./dist/steps/index.cjs",
"types": "./dist/steps/index.d.ts",
"import": "./dist/steps/index.js"
"sui": "./src/components/steps/index.ts",
"require": "./dist/components/steps/index.cjs",
"types": "./dist/components/steps/index.d.ts",
"import": "./dist/components/steps/index.js"
},
"./utils": {
"sui": "./src/utils/index.ts",
Expand All @@ -53,7 +53,7 @@
},
"scripts": {
"clean": "rimraf --no-glob ./dist",
"build": "tsup src/index.ts src/utils/index.ts src/icons/index.ts --config tsup.config.ts",
"build": "tsup --config tsup.config.ts",
"lint": "eslint src --ext .ts,.tsx,.js,.jsx --config ../../.eslintrc.js",
"lint:staged": "lint-staged --allow-empty --config ../../lint-staged.config.js",
"typecheck": "tsc --noEmit"
Expand Down Expand Up @@ -91,6 +91,7 @@
"dependencies": {
"@ark-ui/react": "^4.4.4",
"@react-aria/utils": "^3.25.3",
"@saas-ui/hooks": "workspace:*",
"@zag-js/dom-event": "^0.77.1",
"@zag-js/dom-utils": "^0.2.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { createContext } from '@chakra-ui/react'
import { nextById, prevById, queryAll } from '@zag-js/dom-utils'

import type { HTMLSystemProps } from '#system'
import { dataAttr } from '#utils'

import { callAll } from '../utils/call-all'
import { callAll, dataAttr } from '#utils'

interface GridListContext {
id: string
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,27 @@ export const NavbarRoot = forwardRef<HTMLDivElement, NavbarRootProps>(
},
)

export const NavbarBrand = sui.div
export const NavbarContent = sui.ul
export const NavbarItem = sui.li
export const NavbarLink = sui.a
export const NavbarBrand = forwardRef<HTMLDivElement, HTMLSystemProps<'div'>>(
(props, ref) => {
return <sui.div {...props} ref={ref} />
},
)

export const NavbarContent = forwardRef<
HTMLUListElement,
HTMLSystemProps<'ul'>
>((props, ref) => {
return <sui.ul {...props} ref={ref} />
})

export const NavbarItem = forwardRef<HTMLLIElement, HTMLSystemProps<'li'>>(
(props, ref) => {
return <sui.li {...props} ref={ref} />
},
)

export const NavbarLink = forwardRef<HTMLAnchorElement, HTMLSystemProps<'a'>>(
(props, ref) => {
return <sui.a {...props} ref={ref} />
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import React, { useEffect, useImperativeHandle, useRef, useState } from 'react'
import { useResizeObserver } from '@react-aria/utils'
import { useScrollPosition } from '@saas-ui/hooks'

import { dataAttr } from '../utils/data-attr.ts'
import { splitProps } from '../utils/split-props.ts'
import { dataAttr, splitProps } from '#utils'

export const splitNavbarProps = <T extends Record<string, any>>(props: T) =>
splitProps(props, [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
} from '@chakra-ui/react'

import type { HTMLSystemProps } from '#system'
import { callAll } from '#utils'

import { callAll } from '../utils/call-all.ts'
import type { SidebarProps } from './sidebar.types.ts'

export type SidebarMode = 'flyout' | 'collapsible'
export type SidebarMode = 'flyout' | 'collapsible' | 'compact'

export interface UseSidebarReturn {
open: boolean
Expand All @@ -33,8 +33,9 @@ const [SidebarContextProvider, useSidebar] = createContext<UseSidebarReturn>({
export interface SidebarProviderProps extends SidebarProps {
/**
* The mode of the sidebar.
* @default 'collapsible'
*/
mode: SidebarMode
mode?: SidebarMode
/**
* Control the default visibility of the sidebar.
*/
Expand All @@ -59,7 +60,7 @@ export function SidebarProvider(props: SidebarProviderProps) {
defaultOpen = true,
open,
onOpenChange,
mode: modeProp,
mode: modeProp = 'collapsible',
} = props

const isMobile = useBreakpointValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import React, { forwardRef, useState } from 'react'
import { Presence, type PresenceProps } from '@ark-ui/react'

import { type HTMLSystemProps, sui } from '#system'
import { callAll, dataAttr } from '#utils'

import { callAll, dataAttr } from '../utils/index.ts'
import { useSidebar, useSidebarTrigger } from './sidebar.context.tsx'
import { SidebarProps } from './sidebar.types.ts'

Expand Down Expand Up @@ -148,17 +148,46 @@ export const SidebarTrack = forwardRef<HTMLDivElement, HTMLSystemProps<'div'>>(
},
)

export const SidebarGroup = sui.div
export const SidebarGroup = forwardRef<HTMLDivElement, HTMLSystemProps<'div'>>(
(props, ref) => {
return <sui.div ref={ref} {...props} />
},
)

export const SidebarGroupHeader = sui.div
export const SidebarGroupHeader = forwardRef<
HTMLDivElement,
HTMLSystemProps<'div'>
>((props, ref) => {
return <sui.div ref={ref} {...props} />
})

export const SidebarGroupTitle = sui.h5
export const SidebarGroupTitle = forwardRef<
HTMLHeadingElement,
HTMLSystemProps<'h5'>
>((props, ref) => {
return <sui.h5 ref={ref} {...props} />
})

export const SidebarGroupEndElement = sui.div
export const SidebarGroupEndElement = forwardRef<
HTMLDivElement,
HTMLSystemProps<'div'>
>((props, ref) => {
return <sui.div ref={ref} {...props} />
})

export const SidebarGroupContent = sui.div
export const SidebarGroupContent = forwardRef<
HTMLDivElement,
HTMLSystemProps<'div'>
>((props, ref) => {
return <sui.div ref={ref} {...props} />
})

export const SidebarNavItem = sui.div
export const SidebarNavItem = forwardRef<
HTMLDivElement,
HTMLSystemProps<'div'>
>((props, ref) => {
return <sui.div ref={ref} {...props} />
})

export interface SidebarNavButtonProps extends HTMLSystemProps<'button'> {
active?: boolean
Expand All @@ -177,4 +206,9 @@ export const SidebarNavButton = forwardRef<
)
})

export const SidebarNavItemEndElement = sui.div
export const SidebarNavItemEndElement = forwardRef<
HTMLDivElement,
HTMLSystemProps<'div'>
>((props, ref) => {
return <sui.div ref={ref} {...props} />
})
File renamed without changes.
24 changes: 17 additions & 7 deletions packages/saas-ui-core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
export { ErrorBoundary } from './error-boundary'
export type { ErrorBoundaryProps, ErrorBoundaryState } from './error-boundary'
export { ErrorBoundary } from './components/error-boundary'
export type {
ErrorBoundaryProps,
ErrorBoundaryState,
} from './components/error-boundary'

export { GridList } from './grid-list'
export { Navbar } from './navbar'
export { Sidebar } from './sidebar'
export { GridList } from './components/grid-list'
export { Navbar } from './components/navbar'
export { Sidebar } from './components/sidebar'

export {
useStepper,
Expand All @@ -12,6 +15,13 @@ export {
useStepperContext,
useStepperNextButton,
useStepperPrevButton,
} from './steps'
} from './components/steps'

export type { UseStepProps, UseStepperProps, UseStepperReturn } from './steps'
export type {
UseStepProps,
UseStepperProps,
UseStepperReturn,
} from './components/steps'

export { sui } from './system/index.ts'
export type { HTMLSystemProps } from './system/index.ts'
6 changes: 5 additions & 1 deletion packages/saas-ui-core/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { defineConfig } from 'tsup'

import config from '../../tsup.config'

export default defineConfig(config)
export default defineConfig({
...config,
entry: ['src/index.ts', 'src/utils/index.ts', 'src/components/**/*.ts'],
})
1 change: 0 additions & 1 deletion packages/saas-ui-forms/ajv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"author": "Eelco Wiersma <[email protected]>",
"license": "MIT",
"peerDependencies": {
"@chakra-ui/utils": "^2.0.14",
"@hookform/resolvers": "^3.0.0",
"react-hook-form": "^7.43.9",
"ajv": "^8.12.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/saas-ui-forms/ajv/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig } from 'tsup'

import config from '../../../tsup.config'

export default defineConfig({
Expand All @@ -8,9 +9,7 @@ export default defineConfig({
'ajv',
'react-hook-form',
'@saas-ui/forms',
'@saas-ui/modals',
'@hookform/resolvers/ajv',
'@chakra-ui/utils',
],
clean: false,
})
2 changes: 1 addition & 1 deletion packages/saas-ui-forms/src/create-step-form.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { forwardRef, useMemo } from 'react'

import { runIfFn } from '@chakra-ui/utils'
import { StepperProvider } from '@saas-ui/core'
import { runIfFn } from '@saas-ui/core/utils'

import {
ArrayField,
Expand Down
Loading

0 comments on commit 550e5a6

Please sign in to comment.