daleui 0.0.2 → 0.0.3
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/.github/dependabot.yml +21 -0
- package/.github/workflows/chromatic.yml +13 -1
- package/bun.lock +226 -116
- package/package.json +20 -20
- package/panda.config.ts +3 -0
- package/src/components/Button/Button.stories.tsx +4 -4
- package/src/components/Button/Button.tsx +26 -27
- package/src/components/Checkbox/Checkbox.stories.tsx +5 -5
- package/src/components/Heading/Heading.stories.tsx +2 -2
- package/src/components/Icon/Icon.stories.tsx +3 -3
- package/src/components/Text/Text.stories.tsx +2 -2
- package/src/tokens/spacing.ts +65 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "daleui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": "github:DaleStudy/daleui",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,40 +28,40 @@
|
|
|
28
28
|
"@radix-ui/react-checkbox": "^1.1.4",
|
|
29
29
|
"axe-playwright": "^2.0.3",
|
|
30
30
|
"chromatic": "^11.25.1",
|
|
31
|
-
"lucide-react": "^0.
|
|
31
|
+
"lucide-react": "^0.486.0",
|
|
32
32
|
"react": "^19.0.0",
|
|
33
33
|
"react-dom": "^19.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@chromatic-com/storybook": "^3.2.
|
|
37
|
-
"@eslint/js": "^9.
|
|
36
|
+
"@chromatic-com/storybook": "^3.2.6",
|
|
37
|
+
"@eslint/js": "^9.23.0",
|
|
38
38
|
"@faker-js/faker": "^9.4.0",
|
|
39
|
-
"@pandacss/dev": "^0.
|
|
40
|
-
"@storybook/addon-a11y": "^8.
|
|
41
|
-
"@storybook/addon-essentials": "^8.
|
|
42
|
-
"@storybook/addon-interactions": "^8.
|
|
43
|
-
"@storybook/addon-links": "^8.
|
|
44
|
-
"@storybook/addon-themes": "^8.
|
|
45
|
-
"@storybook/blocks": "^8.
|
|
46
|
-
"@storybook/react": "^8.
|
|
47
|
-
"@storybook/react-vite": "^8.
|
|
48
|
-
"@storybook/test": "^8.
|
|
49
|
-
"@storybook/test-runner": "^0.
|
|
39
|
+
"@pandacss/dev": "^0.53.3",
|
|
40
|
+
"@storybook/addon-a11y": "^8.6.11",
|
|
41
|
+
"@storybook/addon-essentials": "^8.6.11",
|
|
42
|
+
"@storybook/addon-interactions": "^8.6.11",
|
|
43
|
+
"@storybook/addon-links": "^8.6.11",
|
|
44
|
+
"@storybook/addon-themes": "^8.6.11",
|
|
45
|
+
"@storybook/blocks": "^8.6.11",
|
|
46
|
+
"@storybook/react": "^8.6.11",
|
|
47
|
+
"@storybook/react-vite": "^8.6.11",
|
|
48
|
+
"@storybook/test": "^8.6.11",
|
|
49
|
+
"@storybook/test-runner": "^0.22.0",
|
|
50
50
|
"@testing-library/jest-dom": "^6.6.3",
|
|
51
51
|
"@testing-library/react": "^16.2.0",
|
|
52
52
|
"@testing-library/user-event": "^14.6.1",
|
|
53
53
|
"@types/react": "^19.0.8",
|
|
54
54
|
"@types/react-dom": "^19.0.3",
|
|
55
55
|
"@vitejs/plugin-react": "^4.3.4",
|
|
56
|
-
"eslint": "^9.
|
|
56
|
+
"eslint": "^9.23.0",
|
|
57
57
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
58
58
|
"eslint-plugin-react-refresh": "^0.4.18",
|
|
59
59
|
"eslint-plugin-storybook": "^0.11.2",
|
|
60
|
-
"globals": "^
|
|
61
|
-
"happy-dom": "^
|
|
62
|
-
"storybook": "^8.
|
|
60
|
+
"globals": "^16.0.0",
|
|
61
|
+
"happy-dom": "^17.4.4",
|
|
62
|
+
"storybook": "^8.6.11",
|
|
63
63
|
"typescript": "^5.7.3",
|
|
64
|
-
"typescript-eslint": "^8.
|
|
64
|
+
"typescript-eslint": "^8.28.0",
|
|
65
65
|
"vite": "^6.0.11",
|
|
66
66
|
"vite-plugin-svgr": "^4.3.0",
|
|
67
67
|
"vitest": "^3.0.4"
|
package/panda.config.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineConfig } from "@pandacss/dev";
|
|
2
2
|
import { globalCss } from "./src/styles/globalCss";
|
|
3
3
|
import { colors, semanticColors } from "./src/tokens/colors";
|
|
4
|
+
import { spacing, semanticSpacing } from "./src/tokens/spacing";
|
|
4
5
|
import {
|
|
5
6
|
textStyles,
|
|
6
7
|
fonts,
|
|
@@ -49,9 +50,11 @@ export default defineConfig({
|
|
|
49
50
|
fontSizes,
|
|
50
51
|
letterSpacings,
|
|
51
52
|
lineHeights,
|
|
53
|
+
spacing,
|
|
52
54
|
},
|
|
53
55
|
semanticTokens: {
|
|
54
56
|
colors: semanticColors,
|
|
57
|
+
spacing: semanticSpacing,
|
|
55
58
|
},
|
|
56
59
|
},
|
|
57
60
|
},
|
|
@@ -18,7 +18,7 @@ export const Basic: StoryObj<typeof Button> = {};
|
|
|
18
18
|
export const Variants: StoryObj<typeof Button> = {
|
|
19
19
|
render: (args) => {
|
|
20
20
|
return (
|
|
21
|
-
<div className={vstack({ gap: "
|
|
21
|
+
<div className={vstack({ gap: "gap.sm" })}>
|
|
22
22
|
<Button {...args} variant="solid">
|
|
23
23
|
솔리드 버튼
|
|
24
24
|
</Button>
|
|
@@ -41,7 +41,7 @@ export const Variants: StoryObj<typeof Button> = {
|
|
|
41
41
|
export const Tones: StoryObj<typeof Button> = {
|
|
42
42
|
render: (args) => {
|
|
43
43
|
return (
|
|
44
|
-
<div className={vstack({ gap: "
|
|
44
|
+
<div className={vstack({ gap: "gap.sm" })}>
|
|
45
45
|
<Button {...args} tone="neutral">
|
|
46
46
|
중립 색조
|
|
47
47
|
</Button>
|
|
@@ -70,7 +70,7 @@ export const Tones: StoryObj<typeof Button> = {
|
|
|
70
70
|
export const Sizes: StoryObj<typeof Button> = {
|
|
71
71
|
render: (args) => {
|
|
72
72
|
return (
|
|
73
|
-
<div className={vstack({ gap: "
|
|
73
|
+
<div className={vstack({ gap: "gap.sm" })}>
|
|
74
74
|
<Button {...args} size="sm">
|
|
75
75
|
작은 버튼
|
|
76
76
|
</Button>
|
|
@@ -96,7 +96,7 @@ export const Sizes: StoryObj<typeof Button> = {
|
|
|
96
96
|
export const Disabled: StoryObj<typeof Button> = {
|
|
97
97
|
render: (args) => {
|
|
98
98
|
return (
|
|
99
|
-
<div className={vstack({ gap: "
|
|
99
|
+
<div className={vstack({ gap: "gap.sm" })}>
|
|
100
100
|
<Button {...args} disabled>
|
|
101
101
|
비활성화 버튼
|
|
102
102
|
</Button>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type HTMLAttributes } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { cva } from "../../../styled-system/css";
|
|
3
3
|
import type { Tone } from "../../tokens/colors";
|
|
4
4
|
|
|
5
5
|
type ButtonVariant = "solid" | "outline";
|
|
@@ -42,7 +42,7 @@ export const Button = ({
|
|
|
42
42
|
}: ButtonProps) => {
|
|
43
43
|
return (
|
|
44
44
|
<button
|
|
45
|
-
className={
|
|
45
|
+
className={styles({ tone, variant, size })}
|
|
46
46
|
type={type}
|
|
47
47
|
onClick={onClick}
|
|
48
48
|
disabled={disabled}
|
|
@@ -53,43 +53,42 @@ export const Button = ({
|
|
|
53
53
|
);
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
const baseStyles = {
|
|
57
|
-
appearance: "none",
|
|
58
|
-
margin: "0",
|
|
59
|
-
fontWeight: 500,
|
|
60
|
-
textAlign: "center",
|
|
61
|
-
textDecoration: "none",
|
|
62
|
-
display: "flex",
|
|
63
|
-
alignItems: "center",
|
|
64
|
-
justifyContent: "center",
|
|
65
|
-
width: ["auto", "100%"],
|
|
66
|
-
borderRadius: "10px",
|
|
67
|
-
cursor: "pointer",
|
|
68
|
-
transition: "0.2s",
|
|
69
|
-
lineHeight: "1",
|
|
70
|
-
outline: "0",
|
|
71
|
-
"&:disabled": {
|
|
72
|
-
opacity: 0.5,
|
|
73
|
-
cursor: "not-allowed",
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
|
|
77
56
|
const styles = cva({
|
|
78
57
|
base: {
|
|
79
|
-
|
|
58
|
+
appearance: "none",
|
|
59
|
+
margin: "0",
|
|
60
|
+
fontWeight: 500,
|
|
61
|
+
textAlign: "center",
|
|
62
|
+
textDecoration: "none",
|
|
63
|
+
display: "flex",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
justifyContent: "center",
|
|
66
|
+
width: ["auto", "100%"],
|
|
67
|
+
borderRadius: "10px",
|
|
68
|
+
cursor: "pointer",
|
|
69
|
+
transition: "0.2s",
|
|
70
|
+
lineHeight: "1",
|
|
71
|
+
outline: "0",
|
|
72
|
+
"&:disabled": {
|
|
73
|
+
opacity: 0.5,
|
|
74
|
+
cursor: "not-allowed",
|
|
75
|
+
},
|
|
80
76
|
},
|
|
81
77
|
variants: {
|
|
82
78
|
size: {
|
|
83
79
|
sm: {
|
|
84
|
-
|
|
80
|
+
px: "px.sm",
|
|
81
|
+
py: "py.sm",
|
|
85
82
|
fontSize: "sm",
|
|
86
83
|
},
|
|
87
84
|
md: {
|
|
88
|
-
|
|
85
|
+
px: "px.md",
|
|
86
|
+
py: "py.md",
|
|
89
87
|
fontSize: "md",
|
|
90
88
|
},
|
|
91
89
|
lg: {
|
|
92
|
-
|
|
90
|
+
px: "px.lg",
|
|
91
|
+
py: "py.lg",
|
|
93
92
|
fontSize: "lg",
|
|
94
93
|
},
|
|
95
94
|
},
|
|
@@ -18,7 +18,7 @@ export const Basic: StoryObj<typeof Checkbox> = {};
|
|
|
18
18
|
export const Tones: StoryObj<typeof Checkbox> = {
|
|
19
19
|
render: (args) => {
|
|
20
20
|
return (
|
|
21
|
-
<div className={vstack({ gap: "
|
|
21
|
+
<div className={vstack({ gap: "gap.sm" })}>
|
|
22
22
|
<Checkbox {...args} id="neutral" label="중립 색조" tone="neutral" />
|
|
23
23
|
<Checkbox {...args} id="accent" label="강조 색조" tone="accent" />
|
|
24
24
|
<Checkbox {...args} id="danger" label="위험 색조" tone="danger" />
|
|
@@ -39,7 +39,7 @@ export const Tones: StoryObj<typeof Checkbox> = {
|
|
|
39
39
|
export const States: StoryObj<typeof Checkbox> = {
|
|
40
40
|
render: (args) => {
|
|
41
41
|
return (
|
|
42
|
-
<div className={vstack({ gap: "
|
|
42
|
+
<div className={vstack({ gap: "gap.sm" })}>
|
|
43
43
|
<Checkbox {...args} id="checked" label="체크된 상태" checked={true} />
|
|
44
44
|
<Checkbox
|
|
45
45
|
{...args}
|
|
@@ -63,7 +63,7 @@ export const States: StoryObj<typeof Checkbox> = {
|
|
|
63
63
|
export const Disabled: StoryObj<typeof Checkbox> = {
|
|
64
64
|
render: (args) => {
|
|
65
65
|
return (
|
|
66
|
-
<div className={vstack({ gap: "
|
|
66
|
+
<div className={vstack({ gap: "gap.sm" })}>
|
|
67
67
|
<Checkbox
|
|
68
68
|
{...args}
|
|
69
69
|
id="disabled-checked"
|
|
@@ -94,7 +94,7 @@ export const Disabled: StoryObj<typeof Checkbox> = {
|
|
|
94
94
|
export const Required: StoryObj<typeof Checkbox> = {
|
|
95
95
|
render: (args) => {
|
|
96
96
|
return (
|
|
97
|
-
<div className={vstack({ gap: "
|
|
97
|
+
<div className={vstack({ gap: "gap.sm" })}>
|
|
98
98
|
<Checkbox {...args} id="required" label="필수 체크박스" required />
|
|
99
99
|
<Checkbox {...args} id="optional" label="선택 체크박스" />
|
|
100
100
|
</div>
|
|
@@ -113,7 +113,7 @@ export const Required: StoryObj<typeof Checkbox> = {
|
|
|
113
113
|
export const WithValue: StoryObj<typeof Checkbox> = {
|
|
114
114
|
render: (args) => {
|
|
115
115
|
return (
|
|
116
|
-
<div className={vstack({ gap: "
|
|
116
|
+
<div className={vstack({ gap: "gap.sm" })}>
|
|
117
117
|
<Checkbox
|
|
118
118
|
{...args}
|
|
119
119
|
id="value-example"
|
|
@@ -18,7 +18,7 @@ export const Basic: StoryObj<typeof Heading> = {};
|
|
|
18
18
|
export const Levels: StoryObj<typeof Heading> = {
|
|
19
19
|
render: (args) => {
|
|
20
20
|
return (
|
|
21
|
-
<div className={vstack({ gap: "
|
|
21
|
+
<div className={vstack({ gap: "gap.md" })}>
|
|
22
22
|
<Heading {...args} level={1}>
|
|
23
23
|
1 단계
|
|
24
24
|
</Heading>
|
|
@@ -53,7 +53,7 @@ export const Levels: StoryObj<typeof Heading> = {
|
|
|
53
53
|
export const Contrasts: StoryObj<typeof Heading> = {
|
|
54
54
|
render: (args) => {
|
|
55
55
|
return (
|
|
56
|
-
<div className={vstack({ gap: "
|
|
56
|
+
<div className={vstack({ gap: "gap.md" })}>
|
|
57
57
|
<Heading {...args} muted>
|
|
58
58
|
낮은 명암비
|
|
59
59
|
</Heading>
|
|
@@ -25,7 +25,7 @@ export const Basic: StoryObj<typeof Icon> = {
|
|
|
25
25
|
export const Sizes: StoryObj<typeof Icon> = {
|
|
26
26
|
render: (args) => {
|
|
27
27
|
return (
|
|
28
|
-
<div className={vstack({ gap: "
|
|
28
|
+
<div className={vstack({ gap: "gap.md" })}>
|
|
29
29
|
<Icon {...args} size="xs" />
|
|
30
30
|
<Icon {...args} size="sm" />
|
|
31
31
|
<Icon {...args} size="md" />
|
|
@@ -48,7 +48,7 @@ export const Sizes: StoryObj<typeof Icon> = {
|
|
|
48
48
|
export const Tones: StoryObj<typeof Icon> = {
|
|
49
49
|
render: (args) => {
|
|
50
50
|
return (
|
|
51
|
-
<div className={vstack({ gap: "
|
|
51
|
+
<div className={vstack({ gap: "gap.md" })}>
|
|
52
52
|
<Icon {...args} tone="neutral" />
|
|
53
53
|
<Icon {...args} tone="accent" />
|
|
54
54
|
<Icon {...args} tone="danger" />
|
|
@@ -69,7 +69,7 @@ export const Tones: StoryObj<typeof Icon> = {
|
|
|
69
69
|
export const Contrasts: StoryObj<typeof Icon> = {
|
|
70
70
|
render: (args) => {
|
|
71
71
|
return (
|
|
72
|
-
<div className={vstack({ gap: "
|
|
72
|
+
<div className={vstack({ gap: "gap.md" })}>
|
|
73
73
|
<Text {...args} muted>
|
|
74
74
|
낮은 <Icon name="moon" /> 명암비
|
|
75
75
|
</Text>
|
|
@@ -17,7 +17,7 @@ export const Basic: StoryObj<typeof Text> = {};
|
|
|
17
17
|
export const Tones: StoryObj<typeof Text> = {
|
|
18
18
|
render: (args) => {
|
|
19
19
|
return (
|
|
20
|
-
<div className={vstack({ gap: "
|
|
20
|
+
<div className={vstack({ gap: "gap.md" })}>
|
|
21
21
|
<Text {...args} tone="neutral">
|
|
22
22
|
중립 색조
|
|
23
23
|
</Text>
|
|
@@ -46,7 +46,7 @@ export const Tones: StoryObj<typeof Text> = {
|
|
|
46
46
|
export const Contrasts: StoryObj<typeof Text> = {
|
|
47
47
|
render: (args) => {
|
|
48
48
|
return (
|
|
49
|
-
<div className={vstack({ gap: "
|
|
49
|
+
<div className={vstack({ gap: "gap.md" })}>
|
|
50
50
|
<Text {...args} muted>
|
|
51
51
|
낮은 명암비
|
|
52
52
|
</Text>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Tokens, SemanticTokens } from "@pandacss/types";
|
|
2
|
+
|
|
3
|
+
export const semanticSpacing: SemanticTokens["spacing"] = {
|
|
4
|
+
px: {
|
|
5
|
+
sm: {
|
|
6
|
+
value: "{spacing.6}", // 1.5rem
|
|
7
|
+
},
|
|
8
|
+
md: {
|
|
9
|
+
value: "{spacing.8}", // 2rem
|
|
10
|
+
},
|
|
11
|
+
lg: {
|
|
12
|
+
value: "{spacing.10}", // 2.5rem
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
py: {
|
|
16
|
+
sm: {
|
|
17
|
+
value: "{spacing.2}", // 0.5rem
|
|
18
|
+
},
|
|
19
|
+
md: {
|
|
20
|
+
value: "{spacing.3}", // 0.75rem
|
|
21
|
+
},
|
|
22
|
+
lg: {
|
|
23
|
+
value: "{spacing.4}", // 1rem
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
gap: {
|
|
27
|
+
sm: {
|
|
28
|
+
value: "{spacing.4}", // 1rem
|
|
29
|
+
},
|
|
30
|
+
md: {
|
|
31
|
+
value: "{spacing.6}", // 1.5rem
|
|
32
|
+
},
|
|
33
|
+
lg: {
|
|
34
|
+
value: "{spacing.8}", // 2rem
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const spacing: Tokens["spacing"] = {
|
|
40
|
+
0: { value: "0rem" },
|
|
41
|
+
0.5: { value: "0.125rem" },
|
|
42
|
+
1: { value: "0.25rem" },
|
|
43
|
+
1.5: { value: "0.375rem" },
|
|
44
|
+
2: { value: "0.5rem" },
|
|
45
|
+
2.5: { value: "0.625rem" },
|
|
46
|
+
3: { value: "0.75rem" },
|
|
47
|
+
3.5: { value: "0.875rem" },
|
|
48
|
+
4: { value: "1rem" },
|
|
49
|
+
5: { value: "1.25rem" },
|
|
50
|
+
6: { value: "1.5rem" },
|
|
51
|
+
7: { value: "1.75rem" },
|
|
52
|
+
8: { value: "2rem" },
|
|
53
|
+
9: { value: "2.25rem" },
|
|
54
|
+
10: { value: "2.5rem" },
|
|
55
|
+
11: { value: "2.75rem" },
|
|
56
|
+
12: { value: "3rem" },
|
|
57
|
+
14: { value: "3.5rem" },
|
|
58
|
+
16: { value: "4rem" },
|
|
59
|
+
20: { value: "5rem" },
|
|
60
|
+
24: { value: "6rem" },
|
|
61
|
+
28: { value: "7rem" },
|
|
62
|
+
32: { value: "8rem" },
|
|
63
|
+
36: { value: "9rem" },
|
|
64
|
+
40: { value: "10rem" },
|
|
65
|
+
};
|