-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(novui,web): Setup Mantine v7 and demonstrate ability to style in…
… lib and app (#5651) * feat: Add mantine7 * feat: Centralized core type
- Loading branch information
Joel Anton
authored
May 31, 2024
1 parent
1c78e2a
commit a8c9857
Showing
11 changed files
with
651 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
module.exports = { | ||
/** | ||
* must use this syntax for vite + panda | ||
* Must use array + require syntax for vite + postcss & panda | ||
* https://vitejs.dev/config/shared-options.html#css-postcss | ||
* https://panda-css.com/docs/installation/storybook#install-panda | ||
*/ | ||
plugins: [require('@pandacss/dev/postcss')()], | ||
plugins: [ | ||
require('@pandacss/dev/postcss')(), | ||
require('postcss-preset-mantine')(), | ||
require('postcss-simple-vars')({ | ||
variables: { | ||
'mantine-breakpoint-xs': '36em', | ||
'mantine-breakpoint-sm': '48em', | ||
'mantine-breakpoint-md': '62em', | ||
'mantine-breakpoint-lg': '75em', | ||
'mantine-breakpoint-xl': '88em', | ||
}, | ||
}), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { MantineProvider } from '@mantine/core'; | ||
import { FC, PropsWithChildren } from 'react'; | ||
interface INovuiProviderProps extends PropsWithChildren {} | ||
|
||
/** Used to export a v7 Mantine provider */ | ||
export const NovuiProvider: FC<INovuiProviderProps> = ({ children }) => { | ||
return <MantineProvider>{children}</MantineProvider>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,33 @@ | ||
import { FC, MouseEventHandler } from 'react'; | ||
import { Button as ExternalButton } from '@mantine/core'; | ||
import { css } from '../../styled-system/css'; | ||
import { FC } from 'react'; | ||
import { CoreProps } from '../types'; | ||
|
||
/** | ||
* An example component using Panda. | ||
* TODO remove this in a future iteration. | ||
*/ | ||
export const Test: FC = () => { | ||
interface ITestProps extends CoreProps { | ||
onClick: MouseEventHandler<HTMLButtonElement>; | ||
} | ||
|
||
export const Test: FC<ITestProps> = ({ onClick, className }) => { | ||
return ( | ||
<p | ||
className={css({ | ||
bg: 'legacy.warning', | ||
textAlign: 'center', | ||
textStyle: 'title.page', | ||
})} | ||
<ExternalButton | ||
onClick={onClick} | ||
leftSection={'hello'} | ||
className={className} | ||
classNames={{ | ||
root: css({ | ||
color: 'typography.text.feedback.alert', | ||
fontSize: '225 !important', | ||
bg: 'typography.text.feedback.success', | ||
p: '100', | ||
}), | ||
inner: css({ | ||
color: 'typography.text.feedback.alert', | ||
fontSize: '225 !important', | ||
bg: 'typography.text.feedback.success', | ||
}), | ||
}} | ||
> | ||
Testing everything now | ||
</p> | ||
Test | ||
</ExternalButton> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './Test'; | ||
export * from './NovuiProvider'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Defines the foundational props from which all Novu components should inherit. | ||
*/ | ||
export interface CoreProps { | ||
className?: string; | ||
} | ||
|
||
export type CorePropsWithChildren = React.PropsWithChildren<CoreProps>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './CoreProps'; |
Oops, something went wrong.