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

feat(ui): doc of dialog and sheet #23

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/competition/src/pages/login/page.module.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
@use "../../variables" as *;
.login-background {
background: radial-gradient(circle at 30% 30%, #20afff, transparent),
radial-gradient(circle at 65% 35%, #ffce20, transparent),
radial-gradient(circle at 25% 85%, #ff8b20, transparent),
radial-gradient(circle at 65% 100%, #20ffd7, transparent);
background-blend-mode: screen;
position: relative;
height: 100vh;
width: 100vw;
@include flex-center();
background: radial-gradient(circle at 30% 30%, #20afff, transparent),
radial-gradient(circle at 65% 35%, #ffce20, transparent),
radial-gradient(circle at 25% 85%, #ff8b20, transparent),
radial-gradient(circle at 65% 100%, #20ffd7, transparent);
.login-card-container {
animation-name: login-card-show;
animation-duration: 1s;
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { StorybookConfig } from '@storybook/react-vite';
import { withoutVitePlugins } from '@storybook/builder-vite';

const config: StorybookConfig = {
stories: ['../lib/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: ['@storybook/addon-essentials', '@storybook/addon-actions'],
stories: ['../lib/**/*.stories.@(js|jsx|mjs|ts|tsx)', '../lib/**/*.mdx'],
addons: ['@storybook/addon-essentials', '@storybook/addon-actions', '@storybook/addon-docs'],
framework: {
name: '@storybook/react-vite',
options: {},
Expand Down
25 changes: 25 additions & 0 deletions packages/ui/lib/Dialog/Dialog.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Meta } from '@storybook/blocks';
import { useState } from 'react';

import * as DialogStories from './Dialog.stories';
import { Dialog } from './Dialog';
import { Button } from '../Button';

<Meta of={DialogStories} />

# Dialog

export const ShowDialog = () => {
const [visible, setVisible] = useState(false);
return (
<>
<Button onClick={() => setVisible(true)}>Show Dialog</Button>
<Dialog
visible={visible}
onCancel={() => setVisible(false)}
/>
</>
);
};

<ShowDialog />
2 changes: 1 addition & 1 deletion packages/ui/lib/Dialog/Dialog.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const meta = {
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
// tags: ['autodocs'],
argTypes: {
size: {
options: ['small', 'medium', 'large'],
Expand Down
26 changes: 26 additions & 0 deletions packages/ui/lib/Sheet/Sheet.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Meta } from '@storybook/blocks';
import { useState } from 'react';

import * as SheetStories from './Sheet.stories';
import { Button } from '../Button';
import { Sheet, SheetWrapper } from '.';

<Meta of={SheetStories} />

# Sheet

export const ShowSheet = () => {
const [visible, setVisible] = useState(false);
return (
<>
<Button onClick={() => setVisible(true)}>Show Dialog</Button>
<Sheet
visible={visible}
onCancel={() => setVisible(false)}
/>
</>

);
};

<ShowSheet />
2 changes: 1 addition & 1 deletion packages/ui/lib/Sheet/Sheet.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const meta = {
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
// tags: ['autodocs'],
argTypes: {},
} satisfies Meta<typeof Sheet>;

Expand Down
1 change: 1 addition & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
},
"dependencies": {
"@monaco-editor/react": "^4.6.0",
"@storybook/addon-docs": "^7.6.17",
"@types/react-transition-group": "^4.4.10",
"zustand": "^4.4.7"
}
Expand Down
Loading
Loading