This is a React implementation of Mise. https://github.com/squareup/mise-theme
Repo: https://github.com/ericm-square/mise-react-sb
To view the current progress, go here: https://ericm-square.github.io/mise-react-sb/storybook-static
- Clone this repo and open it in VSCode
- Clone mise-theme and open it in VSCode
- Go here:
- Run Storybook in this repo
cd mise-react && pnpm run storybook
- Run storybook
cd mise-reactpnpm run storybook
- Create a new component
- Make a copy of
mise-react/src/components/theme/partials/ui/__Example - Go into each file and rename everything based on your new component
- Make a copy of
If you added some components and want them to appear on the website, do this:
cd mise-reactpnpm run build-storybook- It should build to the project root at
/storybook-static
- It should build to the project root at
- Make sure there are no errors!
- Commit your changes
- Wait a few minutes and the changes should be live, here: https://ericm-square.github.io/mise-react-sb/storybook-static
Here are a few prompts that you can use if you want
- With the
.html.twigfile open in VSCode, go to Github Copilot - Prompt:
Convert this to React. Use CSS modules. Keep all custom attributes and prefix them with data- if you have to. Keep all CSS class names exactly the same as they are. Make sure you keep the CSS class names exactly the same, even if they don't use standard variable name format!!!
Use the schema for the props in the component.
Use this format for the component:
import styles from './Example.module.css';
export interface IExampleProps {
text: string;
}
export default function Example(props: IExampleProps) {
const { text } = props;
return (
<div>{text}</div>
);
}- With the
.tsxcomponent open in VSCode, go to Github Copilot - Prompt:
Create some Storybook stories for this component. Use this format:
import type { Meta, StoryObj } from '@storybook/react';
import Example from './Example.js';
const meta: Meta = {
title: 'theme/partials/ui/Example',
component: Example,
} satisfies Meta<typeof Example>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
direction: 'left',
content: 'Hello, world!',
},
};Here is some data on the conversion process
| Component | Status | Notes | Time |
|---|---|---|---|
| partials/form/Autocomplete | Incomplete | ||
| partials/form/CheckboxSingle | |||
| partials/form/Checkbox | |||
| partials/form/ChoiceCarousel | |||
| partials/form/Choice | |||
| partials/form/Donation | |||
| partials/form/GiftOptions | |||
| partials/form/PriceRange | |||
| partials/form/Radio | |||
| partials/form/Search | |||
| partials/form/Select | |||
| partials/form/Stepper | |||
| partials/form/Subscriptions | |||
| partials/form/Swatches | |||
| partials/form/Text | |||
| partials/form/TextArea | 22:00 (Copilot) | ||
| partials/ui/Accordion | |||
| partials/ui/ActionBar | |||
| partials/ui/Breadcrumb | Complete | ||
| partials/ui/Button | Partial | - Sublabel doesn't work - Dropdown doesn't work |
|
| partials/ui/Card | Complete | ||
| partials/ui/CarouselSlide | |||
| partials/ui/Carousel | |||
| partials/ui/DialogButtons | |||
| partials/ui/DialogContent | |||
| partials/ui/DialogMultiPane | |||
| partials/ui/Dialog | |||
| partials/ui/GoogleMap | |||
| partials/ui/Image | |||
| partials/ui/Loader | Complete | ||
| partials/ui/Marquee | Complete | ||
| partials/ui/Menu | Complete | 39:13 (was working on Select and this was a dependency) | |
| partials/ui/Notice | Complete | - Would not convert the whole thing - Made up CSS classes - Mise possibly had a CSS bug ( font instead of font-size) |
23:02 (Copilot) |
| partials/ui/Overlay | |||
| partials/ui/Pagination | |||
| partials/ui/Pill | Complete | ||
| partials/ui/Placeholder | Partial | - Unsure if colors or positions are correct | |
| partials/ui/Price | Partial | Unsure if colors are correct | |
| partials/ui/Progress | Complete | ||
| partials/ui/Rating | Complete | ||
| partials/ui/Row | Complete | ||
| partials/ui/SegmentedControl | |||
| partials/ui/Toast | |||
| partials/ui/TooltipMenu | Partial | Selected value doesn't work | 38:02 - Part of Tooltip |
| partials/ui/Tooltip | Partial | Show/Hide doesn't work | 38:02 - was also working on Select, TooltipMenu, Menu (dependencies) |
| partials/ui/Video | |||
| Icons | Partial | Don't adapt to color. Look at macros.html.twig - it adds a material-icon-svg class to all icons |
21:39 (Goose) |