-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
175 changed files
with
4,774 additions
and
13,031 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# .github/workflows/chromatic.yml | ||
|
||
# Workflow name | ||
name: 'Chromatic' | ||
|
||
# 👇 Workflow event to trigger execution | ||
on: | ||
push: | ||
branches-ignore: | ||
- 'production' | ||
- 'staging' | ||
|
||
jobs: | ||
chromatic-deployment: | ||
# Operating System | ||
runs-on: ubuntu-latest | ||
# Job steps | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
# 👇 Install dependencies with the same package manager used in the project (replace it as needed), e.g. yarn, npm, pnpm | ||
run: yarn | ||
# 👇 Adds Chromatic as a step in the workflow | ||
- name: Publish to Chromatic | ||
uses: chromaui/action@v1 | ||
# Chromatic GitHub Action options | ||
with: | ||
# 👇 Chromatic projectToken, refer to the manage page to obtain it. | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
workingDir: tooling/storybook |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.93 KB
.yarn/cache/@jest-test-sequencer-npm-28.1.3-456bc6e2ff-13f8905e6d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+63.4 KB
.yarn/cache/@storybook-addon-storyshots-npm-7.1.0-a973701760-e2137f9a71.zip
Binary file not shown.
Binary file added
BIN
+6.91 KB
.yarn/cache/@storybook-babel-plugin-require-context-hook-npm-1.0.1-fa7a2e2bbf-6f86f8b921.zip
Binary file not shown.
Binary file added
BIN
+2.99 KB
.yarn/cache/@storybook-client-api-npm-7.1.0-a4a65e5b78-44ef6ae705.zip
Binary file not shown.
Binary file added
BIN
+6.88 KB
.yarn/cache/@storybook-core-webpack-npm-7.1.0-e3eac10e31-a798672f44.zip
Binary file not shown.
Binary file added
BIN
+66.7 KB
.yarn/cache/@storybook-test-runner-npm-0.11.0-e964a30bf3-ced74b8aa6.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.31 KB
.yarn/cache/@types-jest-specific-snapshot-npm-0.5.6-08a194ee08-3acfe6f586.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.23 KB
.yarn/cache/babel-plugin-jest-hoist-npm-28.1.3-ffadc60ff3-648d89f9d8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+2.89 KB
.yarn/cache/default-require-extensions-npm-3.0.1-3e811bddf3-45882fc971.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+17.9 KB
.yarn/cache/istanbul-lib-instrument-npm-4.0.3-4d4c2263f8-fa1171d302.zip
Binary file not shown.
Binary file added
BIN
+6.57 KB
.yarn/cache/istanbul-lib-processinfo-npm-2.0.3-468806e0b3-501729e809.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.28 KB
.yarn/cache/jest-environment-node-npm-28.1.3-46a696a38b-1048fe306a.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+22.8 KB
.yarn/cache/jest-playwright-preset-npm-2.0.0-5c5b33e0e6-262e261c09.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.3 KB
.yarn/cache/jest-resolve-dependencies-npm-28.1.3-143d112ae5-4eea9ec33a.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+130 KB
.yarn/cache/preact-render-to-string-npm-5.2.6-5999db0763-be8d5d8fb5.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+2.94 KB
.yarn/cache/require-main-filename-npm-2.0.0-03eef65c84-e9e294695f.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,59 @@ | ||
import type { StoryObj } from '@storybook/react'; | ||
import { Meta } from '@storybook/react'; | ||
|
||
import { Button } from './Button'; | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export | ||
const meta = { | ||
title: 'Example/Button', | ||
component: Button, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout | ||
layout: 'centered', | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes | ||
argTypes: { | ||
backgroundColor: { control: 'color' }, | ||
}, | ||
} satisfies Meta<typeof Button>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args | ||
export const Primary: Story = { | ||
args: { | ||
primary: true, | ||
label: 'Button', | ||
}, | ||
}; | ||
|
||
export const Secondary: Story = { | ||
args: { | ||
label: 'Button', | ||
}, | ||
}; | ||
|
||
export const Large: Story = { | ||
args: { | ||
size: 'large', | ||
label: 'Button', | ||
}, | ||
}; | ||
|
||
export const Small: Story = { | ||
args: { | ||
size: 'small', | ||
label: 'Button', | ||
}, | ||
}; | ||
|
||
export const Warning: Story = { | ||
args: { | ||
primary: true, | ||
label: 'Delete now', | ||
backgroundColor: 'red', | ||
}, | ||
}; |
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,50 @@ | ||
import React from 'react'; | ||
|
||
interface ButtonProps { | ||
/** | ||
* Is this the principal call to action on the page? | ||
*/ | ||
primary?: boolean; | ||
/** | ||
* What background color to use | ||
*/ | ||
backgroundColor?: string; | ||
/** | ||
* How large should the button be? | ||
*/ | ||
size?: 'small' | 'medium' | 'large'; | ||
/** | ||
* Button contents | ||
*/ | ||
label: string; | ||
/** | ||
* Optional click handler | ||
*/ | ||
onClick?: () => void; | ||
} | ||
|
||
/** | ||
* Primary UI component for user interaction | ||
*/ | ||
export const Button = ({ | ||
primary = false, | ||
size = 'medium', | ||
backgroundColor, | ||
label, | ||
...props | ||
}: ButtonProps) => { | ||
const mode = primary | ||
? 'storybook-button--primary' | ||
: 'storybook-button--secondary'; | ||
|
||
return ( | ||
<button | ||
type="button" | ||
className="mr-24 bg-colorSecondarySolid" | ||
style={{ backgroundColor }} | ||
{...props} | ||
> | ||
{label} | ||
</button> | ||
); | ||
}; |
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 was deleted.
Oops, something went wrong.
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,60 @@ | ||
import path from 'path'; | ||
import Unocss from '@unocss/vite'; | ||
import { mergeConfig } from 'vite'; | ||
import getEnvVars from '@bangle.io/env-vars'; | ||
|
||
import type { StorybookConfig } from '@storybook/react-vite'; | ||
import { ALL_TOP_LEVEL_DIRS } from '@bangle.io/yarn-workspace-helpers'; | ||
|
||
const config: StorybookConfig = { | ||
stories: [ | ||
...ALL_TOP_LEVEL_DIRS.map( | ||
(dir) => `../../../${dir}/**/*.stories.@(js|jsx|ts|tsx)`, | ||
), | ||
], | ||
addons: [ | ||
path.dirname( | ||
require.resolve(path.join('@storybook/addon-links', 'package.json')), | ||
), | ||
path.dirname( | ||
require.resolve(path.join('@storybook/addon-essentials', 'package.json')), | ||
), | ||
path.dirname( | ||
require.resolve(path.join('@storybook/addon-onboarding', 'package.json')), | ||
), | ||
path.dirname( | ||
require.resolve( | ||
path.join('@storybook/addon-interactions', 'package.json'), | ||
), | ||
), | ||
], | ||
framework: { | ||
name: path.dirname( | ||
require.resolve(path.join('@storybook/react-vite', 'package.json')), | ||
), | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: 'tag', | ||
}, | ||
core: { | ||
builder: '@storybook/builder-vite', | ||
}, | ||
|
||
async viteFinal(config, { configType }) { | ||
const isProduction = configType === 'PRODUCTION'; | ||
|
||
const envVars = await getEnvVars({ | ||
isProduction: isProduction, | ||
isVite: true, | ||
isStorybook: true, | ||
}); | ||
return mergeConfig(config, { | ||
plugins: [Unocss()], | ||
define: { | ||
...envVars.appEnvs, | ||
}, | ||
}); | ||
}, | ||
}; | ||
export default config; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.