Skip to content

Commit

Permalink
Merge pull request #23 from BQXBQX/dev-bqx
Browse files Browse the repository at this point in the history
feat(ui): doc of dialog and sheet
  • Loading branch information
BQXBQX authored Mar 4, 2024
2 parents f551118 + 9f0ff4f commit a508918
Show file tree
Hide file tree
Showing 8 changed files with 343 additions and 195 deletions.
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

0 comments on commit a508918

Please sign in to comment.