ds-learning 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/package.json +54 -0
- package/src/components/Avatar/Avatar.mdx +16 -0
- package/src/components/Avatar/Avatar.stories.ts +30 -0
- package/src/components/Avatar/Avatar.tsx +21 -0
- package/src/components/Avatar/styles/avatar.styles.ts +15 -0
- package/src/components/Avatar/variants/AvatarIcon.tsx +9 -0
- package/src/components/Avatar/variants/AvatarImage.tsx +12 -0
- package/src/components/Box/Box.mdx +16 -0
- package/src/components/Box/Box.stories.ts +36 -0
- package/src/components/Box/Box.tsx +18 -0
- package/src/components/Box/styles/box.styles.ts +19 -0
- package/src/components/Button/Button.mdx +30 -0
- package/src/components/Button/Button.stories.ts +88 -0
- package/src/components/Button/Button.tsx +31 -0
- package/src/components/Divider/Divider.mdx +16 -0
- package/src/components/Divider/Divider.stories.ts +23 -0
- package/src/components/Divider/Divider.tsx +25 -0
- package/src/components/Divider/styles/divider.styles.ts +25 -0
- package/src/components/Dropdown/Dropdown.stories.ts +22 -0
- package/src/components/Dropdown/Dropdrown.tsx +88 -0
- package/src/components/Input/Input.mdx +28 -0
- package/src/components/Input/Input.stories.ts +70 -0
- package/src/components/Input/Input.tsx +29 -0
- package/src/components/Link/Link.mdx +17 -0
- package/src/components/Link/Link.stories.ts +35 -0
- package/src/components/Link/Link.tsx +14 -0
- package/src/components/Modal/Modal.mdx +10 -0
- package/src/components/Modal/Modal.stories.tsx +46 -0
- package/src/components/Modal/Modal.tsx +63 -0
- package/src/components/Molecules.mdx +3 -0
- package/src/components/Notice/ExclamationIcon.tsx +23 -0
- package/src/components/Notice/Notice.mdx +20 -0
- package/src/components/Notice/Notice.stories.ts +40 -0
- package/src/components/Notice/Notice.tsx +41 -0
- package/src/components/Notice/styles/notice.styles.ts +14 -0
- package/src/components/Switch/Switch.tsx +53 -0
- package/src/components/Switch/styles/switch.styles.ts +40 -0
- package/src/components/TextBlock/TextBlock.mdx +18 -0
- package/src/components/TextBlock/TextBlock.stories.ts +48 -0
- package/src/components/TextBlock/TextBlock.tsx +39 -0
- package/src/components/TextBlock/styles/styles.text-block.ts +10 -0
- package/src/components/Typography/Typography.mdx +18 -0
- package/src/components/Typography/Typography.stories.ts +35 -0
- package/src/components/Typography/Typography.tsx +28 -0
- package/src/components/Typography/styles/typography.styles.ts +22 -0
- package/src/components/index.ts +15 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/nextjs'
|
|
2
|
+
import { Typography, TypographyProps } from "./Typography"
|
|
3
|
+
import { typographyStyles } from './styles/typography.styles';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<TypographyProps> = {
|
|
6
|
+
title: 'Atoms/Typography',
|
|
7
|
+
component: Typography,
|
|
8
|
+
args: {},
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
export const Primary: StoryObj<TypographyProps> = {
|
|
14
|
+
args: {
|
|
15
|
+
children: 'Typography',
|
|
16
|
+
variant: 'primary',
|
|
17
|
+
size: 'md',
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Secondary: StoryObj<TypographyProps> = {
|
|
22
|
+
args: {
|
|
23
|
+
children: 'Typography',
|
|
24
|
+
variant: 'secondary',
|
|
25
|
+
size: 'md',
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Tertiary: StoryObj<TypographyProps> = {
|
|
30
|
+
args: {
|
|
31
|
+
children: 'Typography',
|
|
32
|
+
variant: 'tertiary',
|
|
33
|
+
size: 'md',
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JSX } from "react"
|
|
2
|
+
import { VariantProps } from "class-variance-authority"
|
|
3
|
+
import { typographyStyles } from "./styles/typography.styles"
|
|
4
|
+
|
|
5
|
+
export type TypographyProps = VariantProps<typeof typographyStyles> & {
|
|
6
|
+
children?: React.ReactNode
|
|
7
|
+
element?: keyof JSX.IntrinsicElements
|
|
8
|
+
} & JSX.IntrinsicElements['p']
|
|
9
|
+
|
|
10
|
+
const Typography = ({
|
|
11
|
+
variant,
|
|
12
|
+
size,
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
element = "p",
|
|
16
|
+
...rest
|
|
17
|
+
}: TypographyProps) => {
|
|
18
|
+
const Element = element as any
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Element
|
|
22
|
+
className={`${typographyStyles({ variant: variant, size: size })} ${className}`}
|
|
23
|
+
{...rest}
|
|
24
|
+
>{children}</Element>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { Typography }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority"
|
|
2
|
+
|
|
3
|
+
export const typographyStyles = cva('text-text-primary text-sm font-normal', {
|
|
4
|
+
variants: {
|
|
5
|
+
variant: {
|
|
6
|
+
primary: 'text-text-primary',
|
|
7
|
+
secondary: 'text-text-secondary',
|
|
8
|
+
tertiary: 'text-text-tertiary',
|
|
9
|
+
},
|
|
10
|
+
size: {
|
|
11
|
+
xs: 'text-xs',
|
|
12
|
+
sm: 'text-sm',
|
|
13
|
+
md: 'text-md',
|
|
14
|
+
lg: 'text-lg',
|
|
15
|
+
xl: 'text-xl',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: 'primary',
|
|
20
|
+
size: 'md'
|
|
21
|
+
}
|
|
22
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './Avatar/Avatar'
|
|
2
|
+
export * from './Box/Box'
|
|
3
|
+
export * from './Button/Button'
|
|
4
|
+
export * from './Divider/Divider'
|
|
5
|
+
export * from './Dropdown/Dropdrown'
|
|
6
|
+
export * from './Input/Input'
|
|
7
|
+
export * from './Link/Link'
|
|
8
|
+
export * from './Modal/Modal'
|
|
9
|
+
export * from './Notice/Notice'
|
|
10
|
+
export * from './Switch/Switch'
|
|
11
|
+
export * from './TextBlock/TextBlock'
|
|
12
|
+
export * from './Typography/Typography'
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|