diff --git a/.changeset/old-adults-admire.md b/.changeset/old-adults-admire.md new file mode 100644 index 000000000..f4b9ce688 --- /dev/null +++ b/.changeset/old-adults-admire.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/wonder-blocks-theming": minor +--- + +Add Panda preset diff --git a/.changeset/plenty-dolls-refuse.md b/.changeset/plenty-dolls-refuse.md new file mode 100644 index 000000000..91362652a --- /dev/null +++ b/.changeset/plenty-dolls-refuse.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/wonder-blocks-layout": major +--- + +Migrate Strut to PandaCss diff --git a/.changeset/polite-melons-peel.md b/.changeset/polite-melons-peel.md new file mode 100644 index 000000000..dddaab294 --- /dev/null +++ b/.changeset/polite-melons-peel.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/wonder-blocks-icon": major +--- + +Migrate PhosphorIcon to Panda CSS diff --git a/.changeset/rare-actors-boil.md b/.changeset/rare-actors-boil.md new file mode 100644 index 000000000..17ffec150 --- /dev/null +++ b/.changeset/rare-actors-boil.md @@ -0,0 +1,6 @@ +--- +"@khanacademy/wonder-blocks-form": major +"@khanacademy/wonder-blocks-typography": major +--- + +Migrate TextField and Typography to PandaCSS diff --git a/.changeset/sharp-nails-peel.md b/.changeset/sharp-nails-peel.md new file mode 100644 index 000000000..ca088a7ad --- /dev/null +++ b/.changeset/sharp-nails-peel.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/wonder-blocks-progress-spinner": major +--- + +Migrate ProgressSpinner to Panda" diff --git a/.changeset/small-parrots-smell.md b/.changeset/small-parrots-smell.md new file mode 100644 index 000000000..fdbf1269d --- /dev/null +++ b/.changeset/small-parrots-smell.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/wonder-blocks-core": major +--- + +Use PandaCSS in View diff --git a/.changeset/spotty-rivers-admire.md b/.changeset/spotty-rivers-admire.md new file mode 100644 index 000000000..668a0cf9c --- /dev/null +++ b/.changeset/spotty-rivers-admire.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/wonder-blocks-button": major +--- + +Add panda support to Button (including theming) diff --git a/.gitignore b/.gitignore index 534b41e9e..4d19becdc 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ storybook-static !.vscode .DS_Store yarn-error.log + +## Panda +styled-system +styled-system-studio \ No newline at end of file diff --git a/.storybook/index.css b/.storybook/index.css new file mode 100644 index 000000000..d331dc00c --- /dev/null +++ b/.storybook/index.css @@ -0,0 +1,2 @@ +@layer reset, base, tokens, recipes, utilities; +/* @layer utilities; */ \ No newline at end of file diff --git a/.storybook/main.ts b/.storybook/main.ts index 276a879c3..c43916f03 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -34,6 +34,13 @@ const config: StorybookConfig = { "../packages/wonder-blocks$1/src", ), }, + { + find: /^\@\/styled-system\/([\w]+)/, + replacement: resolve( + __dirname, + "../styled-system/$1", + ), + }, ], }, }); diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 00ec0c013..718349dc5 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -7,6 +7,8 @@ import {ThemeSwitcherContext} from "@khanacademy/wonder-blocks-theming"; import {RenderStateRoot} from "../packages/wonder-blocks-core/src"; import {Preview} from "@storybook/react"; +import "./index.css"; + /** * WB Official breakpoints * @see https://khanacademy.atlassian.net/wiki/spaces/WB/pages/2099970518/Layout+Breakpoints diff --git a/__docs__/wonder-blocks-button/button.stories.tsx b/__docs__/wonder-blocks-button/button.stories.tsx index 227f9a435..b8c9db025 100644 --- a/__docs__/wonder-blocks-button/button.stories.tsx +++ b/__docs__/wonder-blocks-button/button.stories.tsx @@ -1,11 +1,11 @@ import * as React from "react"; -import {StyleSheet} from "aphrodite"; +// import {StyleSheet} from "aphrodite"; import type {Meta, StoryObj} from "@storybook/react"; import {expect, fireEvent, userEvent, within} from "@storybook/test"; import {MemoryRouter, Route, Switch} from "react-router-dom"; -import type {StyleDeclaration} from "aphrodite"; +// import type {StyleDeclaration} from "aphrodite"; import pencilSimple from "@phosphor-icons/core/regular/pencil-simple.svg"; import pencilSimpleBold from "@phosphor-icons/core/bold/pencil-simple-bold.svg"; @@ -26,6 +26,8 @@ import ComponentInfo from "../../.storybook/components/component-info"; import ButtonArgTypes from "./button.argtypes"; import {ThemeSwitcherContext} from "@khanacademy/wonder-blocks-theming"; +import {SystemStyleObject} from "@/styled-system/types"; +import {css} from "@/styled-system/css"; /** * Reusable button component. @@ -132,35 +134,35 @@ export const Tertiary: StoryComponentType = { }, }; -export const styles: StyleDeclaration = StyleSheet.create({ - row: { +export const styles: Record = { + row: css.raw({ flexDirection: "row", alignItems: "center", - marginBottom: spacing.xSmall_8, - }, - button: { - marginRight: spacing.xSmall_8, - }, - truncatedButton: { + marginBottom: "xSmall_8", + }), + button: css.raw({ + marginRight: "xSmall_8", + }), + truncatedButton: css.raw({ maxWidth: 200, - marginBottom: spacing.medium_16, - }, - fillSpace: { + marginBottom: "medium_16", + }), + fillSpace: css.raw({ minWidth: 140, - }, - example: { - background: color.offWhite, - padding: spacing.medium_16, - }, - label: { - marginTop: spacing.large_24, - marginBottom: spacing.xSmall_8, - }, -}); + }), + example: css.raw({ + background: "offWhite", + padding: "medium_16", + }), + label: css.raw({ + marginTop: "large_24", + marginBottom: "xSmall_8", + }), +}; export const Variants: StoryComponentType = () => ( - - + + - + @@ -180,7 +182,7 @@ export const Variants: StoryComponentType = () => ( Hello, world! - + @@ -247,26 +249,28 @@ WithColor.parameters = { }; export const Dark: StoryComponentType = () => ( - - + + - - - - + - - - - + - -