Skip to content

Commit

Permalink
fix: improve theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Pagebakers committed Dec 15, 2024
1 parent ba3b566 commit 3a73bc8
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-pens-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@saas-ui/react': patch
---

Fixed incorrect props type for GridListRoot
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const buttonRecipe = defineRecipe({
sm: {
gap: '2',
h: '7',
minW: '8',
minW: '7',
textStyle: 'sm',
borderRadius: 'md',
px: '2.5',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineSlotRecipe } from '@chakra-ui/react'
import { type RecipeVariantProps, defineSlotRecipe } from '@chakra-ui/react'

export const gridListSlotRecipe = defineSlotRecipe({
className: 'sui-grid-list',
Expand Down Expand Up @@ -131,3 +131,5 @@ export const gridListSlotRecipe = defineSlotRecipe({
size: 'md',
},
})

export type GridListVariantProps = RecipeVariantProps<typeof gridListSlotRecipe>
9 changes: 6 additions & 3 deletions packages/saas-ui-react/src/components/grid-list/grid-list.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import type { HTMLChakraProps, SlotRecipeProps } from '@chakra-ui/react'
import type { HTMLChakraProps } from '@chakra-ui/react'
import { GridList } from '@saas-ui/core/grid-list'

import type { SlotRecipeProps } from '#types'

import { withContext, withProvider } from './grid-list.context.ts'
import type { GridListVariantProps } from './grid-list.recipe.ts'

interface GridListRootProps
extends GridList.RootProps,
HTMLChakraProps<'div'>,
SlotRecipeProps<'suiGridList'> {}
SlotRecipeProps<'suiGridList', GridListVariantProps> {}

const GridListRoot = withProvider<HTMLDivElement, GridList.RootProps>(
const GridListRoot = withProvider<HTMLDivElement, GridListRootProps>(
GridList.Root,
'root',
)
Expand Down
1 change: 1 addition & 0 deletions packages/saas-ui-react/src/components/icon-button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { IconButton, type IconButtonProps } from '@chakra-ui/react'
1 change: 1 addition & 0 deletions packages/saas-ui-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export * from './components/drawer/index.ts'
export * from './components/empty-state/index.ts'
export * from './components/grid-list/index.ts'
export * from './components/icon-badge/index.ts'
export * from './components/icon-button/index.ts'
export * from './components/input-group/index.ts'
export * from './components/link/index.ts'
export * from './components/loading-overlay/index.ts'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export const emptyStateSlotRecipe = defineSlotRecipe({
base: {
root: {
width: 'full',
height: 'full',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
},
content: {
display: 'flex',
Expand Down
9 changes: 6 additions & 3 deletions packages/saas-ui-react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
RecipeProps as ChakraRecipeProps,
SlotRecipeProps as ChakraSlotRecipeProps,
type RecipeDefinition,
type SlotRecipeDefinition,
} from '@chakra-ui/react'

export type RecipeProps<T, DefaultRecipe> =
Expand All @@ -10,6 +11,8 @@ export type RecipeProps<T, DefaultRecipe> =
: ChakraRecipeProps<T>

export type SlotRecipeProps<T, DefaultSlotRecipe> =
ChakraSlotRecipeProps<T> extends { recipe?: RecipeDefinition }
? ChakraSlotRecipeProps<T> & DefaultSlotRecipe
: ChakraSlotRecipeProps<T>
ChakraSlotRecipeProps<T> extends { variant?: any }
? ChakraSlotRecipeProps<T>
: ChakraSlotRecipeProps<T> & DefaultSlotRecipe

type Test = ChakraSlotRecipeProps<'suiGridList'>

0 comments on commit 3a73bc8

Please sign in to comment.