Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panda CSS v3 #267

Open
wants to merge 22 commits into
base: v3
Choose a base branch
from
Open

Panda CSS v3 #267

wants to merge 22 commits into from

Conversation

ImExoOdeex
Copy link

No description provided.

Copy link

changeset-bot bot commented Jan 31, 2025

⚠️ No Changeset found

Latest commit: f08827a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jan 31, 2025

@ImExoOdeex is attempting to deploy a commit to the saas-js Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@Pagebakers Pagebakers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work so far!


## Panda
styled-system
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The styled-system folder was checked into git even though this rule was added.

Can you make sure it gets removed?

This should work I think

git rm -rf packages/saas-ui-panda/styled-system

@@ -0,0 +1,72 @@
{
"name": "@saas-ui/panda",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call it panda-preset, or do you think the preset should be a separate package?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, at the end it will only contain the preset

},
"author": "ImExoOdeex <[email protected]>",
"dependencies": {
"@chakra-ui/panda-preset": "^3.4.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Saas UI v3 has it's own tokens we should not extend the chakra ui panda preset.


export type AccordionProps = ComponentProps<typeof Root>

export const Root = withProvider(styled(ArkAccordion.Root), 'root')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wrap the primitives with styled in the withProvider and withContext factory functions instead. This will clean up the components itself.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted an example in the context.tsx file review. Ping me on discord if you're not sure how to do it.

Component: T,
slot?: StyleSlot<R>
): ComponentVariants<T, R> => {
const StyledComponent = forwardRef((props: any, ref) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be similar to how chakra ui does this.

const SuperComponent = styled(Component)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


return (
<StyleContext.Provider value={slotStyles}>
<Component
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then here <SuperComponent


return (
<Sidebar.Provider {...ctx}>
<Box ref={rest.ref} {...styleProps}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally the provider does not render any element, just the provider just like the Chakra UI version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants