@nattui/react-components 0.0.6 → 0.0.8
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/.turbo/turbo-build.log +14 -14
- package/.turbo/turbo-dev.log +338 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -3
- package/src/button-background.tsx +3 -3
- package/src/button.tsx +4 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @nattui/react-components@0.0.
|
|
3
|
+
> @nattui/react-components@0.0.7 build /Users/snowshift/Documents/3-github/react-components/packages/ui
|
|
4
4
|
> tsup
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
[34mCLI[39m Cleaning output folder
|
|
12
12
|
[34mESM[39m Build start
|
|
13
13
|
[34mCJS[39m Build start
|
|
14
|
-
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
15
|
-
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
16
|
-
[32mCJS[39m [1mdist/button.module-N3Y5HX7N.module.css [22m[32m5.83 KB[39m
|
|
17
|
-
[32mCJS[39m [1mdist/index.js [22m[32m4.26 KB[39m
|
|
18
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m7.92 KB[39m
|
|
19
|
-
[32mCJS[39m ⚡️ Build success in 76ms
|
|
20
|
-
[32mESM[39m [1mdist/button.module-N3Y5HX7N.module.css [22m[32m5.83 KB[39m
|
|
21
14
|
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
22
15
|
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
23
|
-
[32mESM[39m [1mdist/
|
|
24
|
-
[32mESM[39m [1mdist/index.mjs
|
|
25
|
-
[32mESM[39m
|
|
16
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.54 KB[39m
|
|
18
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.92 KB[39m
|
|
19
|
+
[32mESM[39m ⚡️ Build success in 58ms
|
|
20
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
21
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
22
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
23
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.27 KB[39m
|
|
24
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.97 KB[39m
|
|
25
|
+
[32mCJS[39m ⚡️ Build success in 58ms
|
|
26
26
|
DTS Build start
|
|
27
|
-
DTS ⚡️ Build success in
|
|
28
|
-
DTS dist/index.d.mts 1.
|
|
29
|
-
DTS dist/index.d.ts 1.
|
|
27
|
+
DTS ⚡️ Build success in 497ms
|
|
28
|
+
DTS dist/index.d.mts 1.39 KB
|
|
29
|
+
DTS dist/index.d.ts 1.39 KB
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
|
|
2
|
+
> @nattui/react-components@0.0.7 dev /Users/snowshift/Documents/3-github/react-components/packages/ui
|
|
3
|
+
> tsup --watch
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.0
|
|
8
|
+
[34mCLI[39m Using tsup config: /Users/snowshift/Documents/3-github/react-components/packages/ui/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Running in watch mode
|
|
10
|
+
[34mCLI[39m Target: node16
|
|
11
|
+
[34mCLI[39m Cleaning output folder
|
|
12
|
+
[34mESM[39m Build start
|
|
13
|
+
[34mCJS[39m Build start
|
|
14
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
15
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.53 KB[39m
|
|
18
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.90 KB[39m
|
|
19
|
+
[32mESM[39m ⚡️ Build success in 84ms
|
|
20
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
21
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
22
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
23
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.26 KB[39m
|
|
24
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.96 KB[39m
|
|
25
|
+
[32mCJS[39m ⚡️ Build success in 84ms
|
|
26
|
+
[34mCLI[39m Watching for changes in "."
|
|
27
|
+
[34mCLI[39m Ignoring changes in "**/{.git,node_modules}/**" | "dist"
|
|
28
|
+
DTS Build start
|
|
29
|
+
DTS ⚡️ Build success in 582ms
|
|
30
|
+
[34mCLI[39m Change detected: change src/button.tsx
|
|
31
|
+
[34mCLI[39m Cleaning output folder
|
|
32
|
+
[34mESM[39m Build start
|
|
33
|
+
[34mCJS[39m Build start
|
|
34
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
35
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
36
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
37
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.54 KB[39m
|
|
38
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.93 KB[39m
|
|
39
|
+
[32mESM[39m ⚡️ Build success in 42ms
|
|
40
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
41
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
42
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
43
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.27 KB[39m
|
|
44
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.98 KB[39m
|
|
45
|
+
[32mCJS[39m ⚡️ Build success in 42ms
|
|
46
|
+
DTS Build start
|
|
47
|
+
src/button.tsx(43,5): error TS2339: Property 'isRounded' does not exist on type 'ButtonPropsInternal'.
|
|
48
|
+
src/button.tsx(56,7): error TS2552: Cannot find name 'rounded'. Did you mean 'isRounded'?
|
|
49
|
+
src/button.tsx(70,34): error TS2552: Cannot find name 'rounded'. Did you mean 'isRounded'?
|
|
50
|
+
|
|
51
|
+
DTS Build failed
|
|
52
|
+
RollupError: [plugin dts] src/button.tsx: Failed to compile. Check the logs above.
|
|
53
|
+
at getRollupError (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:285:41)
|
|
54
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:281:42)
|
|
55
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:913:32)
|
|
56
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:22390:42)
|
|
57
|
+
at generateDtsFromTs (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6376:22)
|
|
58
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:59
|
|
59
|
+
at _nullishCoalesce (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:1:472)
|
|
60
|
+
at Object.transform (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:18)
|
|
61
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:3392:40
|
|
62
|
+
[34mCLI[39m Change detected: change src/button.tsx
|
|
63
|
+
[34mCLI[39m Cleaning output folder
|
|
64
|
+
[34mESM[39m Build start
|
|
65
|
+
[34mCJS[39m Build start
|
|
66
|
+
DTS Build start
|
|
67
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
68
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
69
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
70
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.54 KB[39m
|
|
71
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.93 KB[39m
|
|
72
|
+
[32mESM[39m ⚡️ Build success in 22ms
|
|
73
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
74
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
75
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.27 KB[39m
|
|
76
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
77
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.98 KB[39m
|
|
78
|
+
[32mCJS[39m ⚡️ Build success in 22ms
|
|
79
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.mts' not found.
|
|
80
|
+
The file is in the program because:
|
|
81
|
+
Root file specified for compilation
|
|
82
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.ts' not found.
|
|
83
|
+
The file is in the program because:
|
|
84
|
+
Root file specified for compilation
|
|
85
|
+
|
|
86
|
+
RollupError: [plugin dts] src/index.ts: Failed to compile. Check the logs above.
|
|
87
|
+
at getRollupError (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:285:41)
|
|
88
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:281:42)
|
|
89
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:913:32)
|
|
90
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:22390:42)
|
|
91
|
+
at generateDtsFromTs (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6376:22)
|
|
92
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:59
|
|
93
|
+
at _nullishCoalesce (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:1:472)
|
|
94
|
+
at Object.transform (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:18)
|
|
95
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:3392:40
|
|
96
|
+
DTS Build failed
|
|
97
|
+
[34mCLI[39m Change detected: change src/button.tsx
|
|
98
|
+
[34mCLI[39m Cleaning output folder
|
|
99
|
+
[34mESM[39m Build start
|
|
100
|
+
[34mCJS[39m Build start
|
|
101
|
+
DTS Build start
|
|
102
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
103
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
104
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
105
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.54 KB[39m
|
|
106
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.93 KB[39m
|
|
107
|
+
[32mESM[39m ⚡️ Build success in 21ms
|
|
108
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
109
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
110
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
111
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.27 KB[39m
|
|
112
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.98 KB[39m
|
|
113
|
+
[32mCJS[39m ⚡️ Build success in 21ms
|
|
114
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.mts' not found.
|
|
115
|
+
The file is in the program because:
|
|
116
|
+
Root file specified for compilation
|
|
117
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.ts' not found.
|
|
118
|
+
The file is in the program because:
|
|
119
|
+
Root file specified for compilation
|
|
120
|
+
|
|
121
|
+
DTS Build failed
|
|
122
|
+
RollupError: [plugin dts] src/index.ts: Failed to compile. Check the logs above.
|
|
123
|
+
at getRollupError (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:285:41)
|
|
124
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:281:42)
|
|
125
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:913:32)
|
|
126
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:22390:42)
|
|
127
|
+
at generateDtsFromTs (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6376:22)
|
|
128
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:59
|
|
129
|
+
at _nullishCoalesce (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:1:472)
|
|
130
|
+
at Object.transform (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:18)
|
|
131
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:3392:40
|
|
132
|
+
[34mCLI[39m Change detected: change src/button.tsx
|
|
133
|
+
DTS Build start
|
|
134
|
+
[34mCLI[39m Cleaning output folder
|
|
135
|
+
[34mESM[39m Build start
|
|
136
|
+
[34mCJS[39m Build start
|
|
137
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
138
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
139
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
140
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.28 KB[39m
|
|
141
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.97 KB[39m
|
|
142
|
+
[32mCJS[39m ⚡️ Build success in 23ms
|
|
143
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
144
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
145
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
146
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.54 KB[39m
|
|
147
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.92 KB[39m
|
|
148
|
+
[32mESM[39m ⚡️ Build success in 23ms
|
|
149
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.mts' not found.
|
|
150
|
+
The file is in the program because:
|
|
151
|
+
Root file specified for compilation
|
|
152
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.ts' not found.
|
|
153
|
+
The file is in the program because:
|
|
154
|
+
Root file specified for compilation
|
|
155
|
+
|
|
156
|
+
DTS Build failed
|
|
157
|
+
RollupError: [plugin dts] src/index.ts: Failed to compile. Check the logs above.
|
|
158
|
+
at getRollupError (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:285:41)
|
|
159
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:281:42)
|
|
160
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:913:32)
|
|
161
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:22390:42)
|
|
162
|
+
at generateDtsFromTs (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6376:22)
|
|
163
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:59
|
|
164
|
+
at _nullishCoalesce (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:1:472)
|
|
165
|
+
at Object.transform (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:18)
|
|
166
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:3392:40
|
|
167
|
+
[34mCLI[39m Change detected: change src/button.tsx
|
|
168
|
+
[34mCLI[39m Cleaning output folder
|
|
169
|
+
[34mESM[39m Build start
|
|
170
|
+
[34mCJS[39m Build start
|
|
171
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
172
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
173
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
174
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.54 KB[39m
|
|
175
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.92 KB[39m
|
|
176
|
+
[32mESM[39m ⚡️ Build success in 20ms
|
|
177
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
178
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
179
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
180
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.28 KB[39m
|
|
181
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.97 KB[39m
|
|
182
|
+
[32mCJS[39m ⚡️ Build success in 21ms
|
|
183
|
+
[34mCLI[39m Change detected: change src/button-background.tsx
|
|
184
|
+
DTS Build start
|
|
185
|
+
[34mCLI[39m Cleaning output folder
|
|
186
|
+
[34mESM[39m Build start
|
|
187
|
+
[34mCJS[39m Build start
|
|
188
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
189
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
190
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
191
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.54 KB[39m
|
|
192
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.92 KB[39m
|
|
193
|
+
[32mESM[39m ⚡️ Build success in 21ms
|
|
194
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
195
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
196
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.28 KB[39m
|
|
197
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
198
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.97 KB[39m
|
|
199
|
+
[32mCJS[39m ⚡️ Build success in 21ms
|
|
200
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.mts' not found.
|
|
201
|
+
The file is in the program because:
|
|
202
|
+
Root file specified for compilation
|
|
203
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.ts' not found.
|
|
204
|
+
The file is in the program because:
|
|
205
|
+
Root file specified for compilation
|
|
206
|
+
|
|
207
|
+
DTS Build failed
|
|
208
|
+
RollupError: [plugin dts] src/index.ts: Failed to compile. Check the logs above.
|
|
209
|
+
at getRollupError (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:285:41)
|
|
210
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:281:42)
|
|
211
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:913:32)
|
|
212
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:22390:42)
|
|
213
|
+
at generateDtsFromTs (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6376:22)
|
|
214
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:59
|
|
215
|
+
at _nullishCoalesce (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:1:472)
|
|
216
|
+
at Object.transform (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:18)
|
|
217
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:3392:40
|
|
218
|
+
[34mCLI[39m Change detected: change src/button-background.tsx
|
|
219
|
+
[34mCLI[39m Cleaning output folder
|
|
220
|
+
[34mESM[39m Build start
|
|
221
|
+
[34mCJS[39m Build start
|
|
222
|
+
DTS Build start
|
|
223
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
224
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
225
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
226
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.55 KB[39m
|
|
227
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.92 KB[39m
|
|
228
|
+
[32mESM[39m ⚡️ Build success in 31ms
|
|
229
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
230
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
231
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
232
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.28 KB[39m
|
|
233
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.98 KB[39m
|
|
234
|
+
[32mCJS[39m ⚡️ Build success in 31ms
|
|
235
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.mts' not found.
|
|
236
|
+
The file is in the program because:
|
|
237
|
+
Root file specified for compilation
|
|
238
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.ts' not found.
|
|
239
|
+
The file is in the program because:
|
|
240
|
+
Root file specified for compilation
|
|
241
|
+
|
|
242
|
+
DTS Build failed
|
|
243
|
+
RollupError: [plugin dts] src/index.ts: Failed to compile. Check the logs above.
|
|
244
|
+
at getRollupError (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:285:41)
|
|
245
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:281:42)
|
|
246
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:913:32)
|
|
247
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:22390:42)
|
|
248
|
+
at generateDtsFromTs (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6376:22)
|
|
249
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:59
|
|
250
|
+
at _nullishCoalesce (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:1:472)
|
|
251
|
+
at Object.transform (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:18)
|
|
252
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:3392:40
|
|
253
|
+
[34mCLI[39m Change detected: change src/button-background.tsx
|
|
254
|
+
[34mCLI[39m Cleaning output folder
|
|
255
|
+
[34mESM[39m Build start
|
|
256
|
+
[34mCJS[39m Build start
|
|
257
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
258
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
259
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
260
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.55 KB[39m
|
|
261
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.92 KB[39m
|
|
262
|
+
[32mESM[39m ⚡️ Build success in 28ms
|
|
263
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
264
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
265
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.28 KB[39m
|
|
266
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
267
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.98 KB[39m
|
|
268
|
+
[32mCJS[39m ⚡️ Build success in 28ms
|
|
269
|
+
[34mCLI[39m Change detected: change src/button.tsx
|
|
270
|
+
DTS Build start
|
|
271
|
+
[34mCLI[39m Cleaning output folder
|
|
272
|
+
[34mESM[39m Build start
|
|
273
|
+
[34mCJS[39m Build start
|
|
274
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
275
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
276
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
277
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.54 KB[39m
|
|
278
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.92 KB[39m
|
|
279
|
+
[32mESM[39m ⚡️ Build success in 19ms
|
|
280
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
281
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
282
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
283
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.27 KB[39m
|
|
284
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.97 KB[39m
|
|
285
|
+
[32mCJS[39m ⚡️ Build success in 19ms
|
|
286
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.mts' not found.
|
|
287
|
+
The file is in the program because:
|
|
288
|
+
Root file specified for compilation
|
|
289
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.ts' not found.
|
|
290
|
+
The file is in the program because:
|
|
291
|
+
Root file specified for compilation
|
|
292
|
+
|
|
293
|
+
DTS Build failed
|
|
294
|
+
RollupError: [plugin dts] src/index.ts: Failed to compile. Check the logs above.
|
|
295
|
+
at getRollupError (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:285:41)
|
|
296
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:281:42)
|
|
297
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:913:32)
|
|
298
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:22390:42)
|
|
299
|
+
at generateDtsFromTs (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6376:22)
|
|
300
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:59
|
|
301
|
+
at _nullishCoalesce (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:1:472)
|
|
302
|
+
at Object.transform (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:18)
|
|
303
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:3392:40
|
|
304
|
+
[34mCLI[39m Change detected: change src/button.tsx
|
|
305
|
+
[34mCLI[39m Cleaning output folder
|
|
306
|
+
[34mESM[39m Build start
|
|
307
|
+
[34mCJS[39m Build start
|
|
308
|
+
[32mCJS[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
309
|
+
[32mCJS[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
310
|
+
[32mCJS[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
311
|
+
[32mCJS[39m [1mdist/index.js [22m[32m4.27 KB[39m
|
|
312
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m7.97 KB[39m
|
|
313
|
+
[32mCJS[39m ⚡️ Build success in 23ms
|
|
314
|
+
[32mESM[39m [1mdist/button-spinner.module-4TBETQ4T.module.css [22m[32m1.49 KB[39m
|
|
315
|
+
[32mESM[39m [1mdist/button.module-4G5LYXJH.module.css [22m[32m5.76 KB[39m
|
|
316
|
+
[32mESM[39m [1mdist/button-background.module-T5B7XZ2Z.module.css [22m[32m702.00 B[39m
|
|
317
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m3.54 KB[39m
|
|
318
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m7.92 KB[39m
|
|
319
|
+
[32mESM[39m ⚡️ Build success in 23ms
|
|
320
|
+
DTS Build start
|
|
321
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.mts' not found.
|
|
322
|
+
The file is in the program because:
|
|
323
|
+
Root file specified for compilation
|
|
324
|
+
error TS6053: File '/Users/snowshift/Documents/3-github/react-components/packages/ui/dist/index.d.ts' not found.
|
|
325
|
+
The file is in the program because:
|
|
326
|
+
Root file specified for compilation
|
|
327
|
+
|
|
328
|
+
DTS Build failed
|
|
329
|
+
RollupError: [plugin dts] src/index.ts: Failed to compile. Check the logs above.
|
|
330
|
+
at getRollupError (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:285:41)
|
|
331
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/parseAst.js:281:42)
|
|
332
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:913:32)
|
|
333
|
+
at Object.error (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:22390:42)
|
|
334
|
+
at generateDtsFromTs (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6376:22)
|
|
335
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:59
|
|
336
|
+
at _nullishCoalesce (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:1:472)
|
|
337
|
+
at Object.transform (/Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_typescript@5.9.2/node_modules/tsup/dist/rollup.js:6383:18)
|
|
338
|
+
at /Users/snowshift/Documents/3-github/react-components/node_modules/.pnpm/rollup@4.52.3/node_modules/rollup/dist/shared/rollup.js:3392:40
|
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ interface ButtonProps extends Omit<ComponentProps<"button">, "aria-pressed" | "d
|
|
|
8
8
|
isActive?: boolean;
|
|
9
9
|
isDisabled?: boolean;
|
|
10
10
|
isLoading?: boolean;
|
|
11
|
-
|
|
11
|
+
isRounded?: boolean;
|
|
12
12
|
size?: 32 | 36 | 40 | 48;
|
|
13
13
|
variant?: "accent" | "ghost" | "primary" | "secondary";
|
|
14
14
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface ButtonProps extends Omit<ComponentProps<"button">, "aria-pressed" | "d
|
|
|
8
8
|
isActive?: boolean;
|
|
9
9
|
isDisabled?: boolean;
|
|
10
10
|
isLoading?: boolean;
|
|
11
|
-
|
|
11
|
+
isRounded?: boolean;
|
|
12
12
|
size?: 32 | 36 | 40 | 48;
|
|
13
13
|
variant?: "accent" | "ghost" | "primary" | "secondary";
|
|
14
14
|
}
|
package/dist/index.js
CHANGED
|
@@ -13,10 +13,10 @@ var styles3__default = /*#__PURE__*/_interopDefault(styles3);
|
|
|
13
13
|
|
|
14
14
|
// src/button-background.tsx
|
|
15
15
|
function ButtonBackground(props) {
|
|
16
|
-
const {
|
|
16
|
+
const { isRounded = false, variant = "primary" } = props;
|
|
17
17
|
const combinedBackgroundStyles = `
|
|
18
18
|
${BUTTON_BACKGROUND_CLASS_NAME.BASE}
|
|
19
|
-
${
|
|
19
|
+
${isRounded ? BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.FULL : BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.BASE}
|
|
20
20
|
${variant === "accent" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.ACCENT : ""}
|
|
21
21
|
${variant === "primary" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.PRIMARY : ""}
|
|
22
22
|
`.replaceAll(/\s+/g, " ").trim();
|
|
@@ -62,7 +62,7 @@ function Button(props) {
|
|
|
62
62
|
isActive = false,
|
|
63
63
|
isDisabled = false,
|
|
64
64
|
isLoading = false,
|
|
65
|
-
|
|
65
|
+
isRounded = false,
|
|
66
66
|
size = 36,
|
|
67
67
|
type = "button",
|
|
68
68
|
variant = "primary",
|
|
@@ -74,7 +74,7 @@ function Button(props) {
|
|
|
74
74
|
${BUTTON_CLASS_NAME.VARIANT[variant.toUpperCase()]}
|
|
75
75
|
${fullWidth ? BUTTON_CLASS_NAME.WIDTH.FULL : BUTTON_CLASS_NAME.WIDTH.BASE}
|
|
76
76
|
${iconOnly ? BUTTON_CLASS_NAME.ICON_ONLY : ""}
|
|
77
|
-
${
|
|
77
|
+
${isRounded ? BUTTON_CLASS_NAME.ROUNDED.FULL : BUTTON_CLASS_NAME.ROUNDED.BASE}
|
|
78
78
|
${customClassName}
|
|
79
79
|
`.replaceAll(/\s+/g, " ").trim();
|
|
80
80
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -86,7 +86,7 @@ function Button(props) {
|
|
|
86
86
|
type,
|
|
87
87
|
...rest,
|
|
88
88
|
children: [
|
|
89
|
-
/* @__PURE__ */ jsxRuntime.jsx(ButtonBackground, {
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx(ButtonBackground, { isRounded, variant }),
|
|
90
90
|
isLoading && /* @__PURE__ */ jsxRuntime.jsx(ButtonSpinner, {}),
|
|
91
91
|
!isLoading && iconStart,
|
|
92
92
|
iconOnly ? children : /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/button-background.tsx","../src/button-spinner.tsx","../src/button.tsx"],"names":["jsx","Fragment","styles","jsxs"],"mappings":";;;;;;;;;;;;;;AAOO,SAAS,iBAAiB,KAAA,EAA2C;AAC1E,EAAA,MAAM,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/button-background.tsx","../src/button-spinner.tsx","../src/button.tsx"],"names":["jsx","Fragment","styles","jsxs"],"mappings":";;;;;;;;;;;;;;AAOO,SAAS,iBAAiB,KAAA,EAA2C;AAC1E,EAAA,MAAM,EAAE,SAAA,GAAY,KAAA,EAAO,OAAA,GAAU,WAAU,GAAI,KAAA;AAEnD,EAAA,MAAM,wBAAA,GAA2B;AAAA,IAAA,EAC7B,6BAA6B,IAAI;AAAA,IAAA,EACjC,YAAY,4BAAA,CAA6B,OAAA,CAAQ,IAAA,GAAO,4BAAA,CAA6B,QAAQ,IAAI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,IAAA;AAAA,MAEJ,QAAA,EAAA;AAAA,wBAAAH,cAAAA,CAAC,gBAAA,EAAA,EAAiB,SAAA,EAAsB,OAAA,EAAkB,CAAA;AAAA,QACzD,SAAA,oBAAaA,cAAAA,CAAC,aAAA,EAAA,EAAc,CAAA;AAAA,QAC5B,CAAC,SAAA,IAAa,SAAA;AAAA,QACd,QAAA,GAAW,QAAA,mBAAWA,cAAAA,CAAC,UAAM,QAAA,EAAS,CAAA;AAAA,QACtC,CAAC,SAAA,IAAa;AAAA;AAAA;AAAA,GACjB;AAEJ;AAEO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,MAAME,wBAAAA,CAAO,MAAA;AAAA,EACb,WAAWA,wBAAAA,CAAO,iBAAA;AAAA,EAClB,OAAA,EAAS;AAAA,IACP,MAAMA,wBAAAA,CAAO,oBAAA;AAAA,IACb,MAAMA,wBAAAA,CAAO;AAAA,GACf;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,IAAIA,wBAAAA,CAAO,eAAA;AAAA,IACX,IAAIA,wBAAAA,CAAO,eAAA;AAAA,IACX,IAAIA,wBAAAA,CAAO,eAAA;AAAA,IACX,IAAIA,wBAAAA,CAAO;AAAA,GACb;AAAA,EACA,OAAA,EAAS;AAAA,IACP,QAAQA,wBAAAA,CAAO,sBAAA;AAAA,IACf,OAAOA,wBAAAA,CAAO,qBAAA;AAAA,IACd,SAASA,wBAAAA,CAAO,uBAAA;AAAA,IAChB,WAAWA,wBAAAA,CAAO;AAAA,GACpB;AAAA,EACA,KAAA,EAAO;AAAA,IACL,MAAMA,wBAAAA,CAAO,kBAAA;AAAA,IACb,MAAMA,wBAAAA,CAAO;AAAA;AAEjB","file":"index.js","sourcesContent":["import type { JSX } from \"react\"\nimport type { ButtonProps } from \"@/button\"\nimport styles from \"@/button-background.module.css\"\n\nexport interface ButtonBackgroundProps\n extends Pick<ButtonProps, \"isRounded\" | \"variant\"> {}\n\nexport function ButtonBackground(props: ButtonBackgroundProps): JSX.Element {\n const { isRounded = false, variant = \"primary\" } = props\n\n const combinedBackgroundStyles = `\n ${BUTTON_BACKGROUND_CLASS_NAME.BASE}\n ${isRounded ? BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.FULL : BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.BASE}\n ${variant === \"accent\" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.ACCENT : \"\"}\n ${variant === \"primary\" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.PRIMARY : \"\"}\n `\n .replaceAll(/\\s+/g, \" \")\n .trim()\n\n if (!(variant === \"accent\" || variant === \"primary\")) return <></>\n\n return (\n <div\n className={combinedBackgroundStyles}\n data-element=\"button-background\"\n />\n )\n}\n\nexport const BUTTON_BACKGROUND_CLASS_NAME = {\n BASE: styles.button_background,\n ROUNDED: {\n BASE: styles.button_background__rounded_base,\n FULL: styles.button_background__rounded_full,\n },\n VARIANT: {\n ACCENT: styles.button_background__variant_accent,\n PRIMARY: styles.button_background__variant_primary,\n },\n} as const\n","import type { CSSProperties, JSX } from \"react\"\nimport styles from \"@/button-spinner.module.css\"\n\nexport interface ButtonSpinnerProps {\n size?: number\n}\n\nexport function ButtonSpinner(props: ButtonSpinnerProps): JSX.Element {\n const { size = 16 } = props\n\n return (\n <div\n className={styles.button_spinner}\n style={{ \"--size\": `${size}px` } as CSSProperties}\n >\n {Array.from({ length: 12 }).map((_, index) => (\n <div key={index} />\n ))}\n </div>\n )\n}\n","import type { ComponentProps, JSX, ReactNode } from \"react\"\nimport { ButtonBackground } from \"@/button-background\"\nimport { ButtonSpinner } from \"@/button-spinner\"\nimport styles from \"@/button.module.css\"\n\nexport interface ButtonProps\n extends Omit<ComponentProps<\"button\">, \"aria-pressed\" | \"disabled\"> {\n fullWidth?: boolean\n iconEnd?: ReactNode\n iconOnly?: boolean\n iconStart?: ReactNode\n isActive?: boolean\n isDisabled?: boolean\n isLoading?: boolean\n isRounded?: boolean\n size?: 32 | 36 | 40 | 48\n variant?: \"accent\" | \"ghost\" | \"primary\" | \"secondary\"\n}\n\ntype ButtonPropsInternal = ButtonPropsWithIcon | ButtonPropsWithText\n\ninterface ButtonPropsWithIcon extends ButtonProps {\n children?: ReactNode\n iconOnly: true\n}\n\ninterface ButtonPropsWithText extends ButtonProps {\n children?: string\n iconOnly?: false\n}\n\nexport function Button(props: ButtonPropsInternal): JSX.Element {\n const {\n children = \"\",\n className: customClassName = \"\",\n fullWidth = false,\n iconEnd = \"\",\n iconOnly = false,\n iconStart = \"\",\n isActive = false,\n isDisabled = false,\n isLoading = false,\n isRounded = false,\n size = 36,\n type = \"button\",\n variant = \"primary\",\n ...rest\n } = props\n\n const combinedClassName = `\n ${BUTTON_CLASS_NAME.BASE}\n ${BUTTON_CLASS_NAME.SIZE[size]}\n ${BUTTON_CLASS_NAME.VARIANT[variant.toUpperCase() as keyof typeof BUTTON_CLASS_NAME.VARIANT]}\n ${fullWidth ? BUTTON_CLASS_NAME.WIDTH.FULL : BUTTON_CLASS_NAME.WIDTH.BASE}\n ${iconOnly ? BUTTON_CLASS_NAME.ICON_ONLY : \"\"}\n ${isRounded ? BUTTON_CLASS_NAME.ROUNDED.FULL : BUTTON_CLASS_NAME.ROUNDED.BASE}\n ${customClassName}\n `\n .replaceAll(/\\s+/g, \" \")\n .trim()\n\n return (\n <button\n aria-pressed={isActive}\n className={combinedClassName}\n disabled={isDisabled || isLoading}\n type={type}\n {...rest}\n >\n <ButtonBackground isRounded={isRounded} variant={variant} />\n {isLoading && <ButtonSpinner />}\n {!isLoading && iconStart}\n {iconOnly ? children : <span>{children}</span>}\n {!isLoading && iconEnd}\n </button>\n )\n}\n\nexport const BUTTON_CLASS_NAME = {\n BASE: styles.button,\n ICON_ONLY: styles.button__icon_only,\n ROUNDED: {\n BASE: styles.button__rounded_base,\n FULL: styles.button__rounded_full,\n },\n SIZE: {\n 32: styles.button__size_32,\n 36: styles.button__size_36,\n 40: styles.button__size_40,\n 48: styles.button__size_48,\n },\n VARIANT: {\n ACCENT: styles.button__variant_accent,\n GHOST: styles.button__variant_ghost,\n PRIMARY: styles.button__variant_primary,\n SECONDARY: styles.button__variant_secondary,\n },\n WIDTH: {\n BASE: styles.button__width_base,\n FULL: styles.button__width_full,\n },\n} as const\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -5,10 +5,10 @@ import styles3 from './button.module-4G5LYXJH.module.css';
|
|
|
5
5
|
|
|
6
6
|
// src/button-background.tsx
|
|
7
7
|
function ButtonBackground(props) {
|
|
8
|
-
const {
|
|
8
|
+
const { isRounded = false, variant = "primary" } = props;
|
|
9
9
|
const combinedBackgroundStyles = `
|
|
10
10
|
${BUTTON_BACKGROUND_CLASS_NAME.BASE}
|
|
11
|
-
${
|
|
11
|
+
${isRounded ? BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.FULL : BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.BASE}
|
|
12
12
|
${variant === "accent" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.ACCENT : ""}
|
|
13
13
|
${variant === "primary" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.PRIMARY : ""}
|
|
14
14
|
`.replaceAll(/\s+/g, " ").trim();
|
|
@@ -54,7 +54,7 @@ function Button(props) {
|
|
|
54
54
|
isActive = false,
|
|
55
55
|
isDisabled = false,
|
|
56
56
|
isLoading = false,
|
|
57
|
-
|
|
57
|
+
isRounded = false,
|
|
58
58
|
size = 36,
|
|
59
59
|
type = "button",
|
|
60
60
|
variant = "primary",
|
|
@@ -66,7 +66,7 @@ function Button(props) {
|
|
|
66
66
|
${BUTTON_CLASS_NAME.VARIANT[variant.toUpperCase()]}
|
|
67
67
|
${fullWidth ? BUTTON_CLASS_NAME.WIDTH.FULL : BUTTON_CLASS_NAME.WIDTH.BASE}
|
|
68
68
|
${iconOnly ? BUTTON_CLASS_NAME.ICON_ONLY : ""}
|
|
69
|
-
${
|
|
69
|
+
${isRounded ? BUTTON_CLASS_NAME.ROUNDED.FULL : BUTTON_CLASS_NAME.ROUNDED.BASE}
|
|
70
70
|
${customClassName}
|
|
71
71
|
`.replaceAll(/\s+/g, " ").trim();
|
|
72
72
|
return /* @__PURE__ */ jsxs(
|
|
@@ -78,7 +78,7 @@ function Button(props) {
|
|
|
78
78
|
type,
|
|
79
79
|
...rest,
|
|
80
80
|
children: [
|
|
81
|
-
/* @__PURE__ */ jsx(ButtonBackground, {
|
|
81
|
+
/* @__PURE__ */ jsx(ButtonBackground, { isRounded, variant }),
|
|
82
82
|
isLoading && /* @__PURE__ */ jsx(ButtonSpinner, {}),
|
|
83
83
|
!isLoading && iconStart,
|
|
84
84
|
iconOnly ? children : /* @__PURE__ */ jsx("span", { children }),
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/button-background.tsx","../src/button-spinner.tsx","../src/button.tsx"],"names":["jsx","styles"],"mappings":";;;;;;AAOO,SAAS,iBAAiB,KAAA,EAA2C;AAC1E,EAAA,MAAM,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/button-background.tsx","../src/button-spinner.tsx","../src/button.tsx"],"names":["jsx","styles"],"mappings":";;;;;;AAOO,SAAS,iBAAiB,KAAA,EAA2C;AAC1E,EAAA,MAAM,EAAE,SAAA,GAAY,KAAA,EAAO,OAAA,GAAU,WAAU,GAAI,KAAA;AAEnD,EAAA,MAAM,wBAAA,GAA2B;AAAA,IAAA,EAC7B,6BAA6B,IAAI;AAAA,IAAA,EACjC,YAAY,4BAAA,CAA6B,OAAA,CAAQ,IAAA,GAAO,4BAAA,CAA6B,QAAQ,IAAI;AAAA,IAAA,EACjG,OAAA,KAAY,QAAA,GAAW,4BAAA,CAA6B,OAAA,CAAQ,SAAS,EAAE;AAAA,IAAA,EACvE,OAAA,KAAY,SAAA,GAAY,4BAAA,CAA6B,OAAA,CAAQ,UAAU,EAAE;AAAA,EAAA,CAAA,CAE1E,UAAA,CAAW,MAAA,EAAQ,GAAG,CAAA,CACtB,IAAA,EAAK;AAER,E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AAM,QAAA,EAAS,CAAA;AAAA,QACtC,CAAC,SAAA,IAAa;AAAA;AAAA;AAAA,GACjB;AAEJ;AAEO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,MAAMC,OAAAA,CAAO,MAAA;AAAA,EACb,WAAWA,OAAAA,CAAO,iBAAA;AAAA,EAClB,OAAA,EAAS;AAAA,IACP,MAAMA,OAAAA,CAAO,oBAAA;AAAA,IACb,MAAMA,OAAAA,CAAO;AAAA,GACf;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,IAAIA,OAAAA,CAAO,eAAA;AAAA,IACX,IAAIA,OAAAA,CAAO,eAAA;AAAA,IACX,IAAIA,OAAAA,CAAO,eAAA;AAAA,IACX,IAAIA,OAAAA,CAAO;AAAA,GACb;AAAA,EACA,OAAA,EAAS;AAAA,IACP,QAAQA,OAAAA,CAAO,sBAAA;AAAA,IACf,OAAOA,OAAAA,CAAO,qBAAA;AAAA,IACd,SAASA,OAAAA,CAAO,uBAAA;AAAA,IAChB,WAAWA,OAAAA,CAAO;AAAA,GACpB;AAAA,EACA,KAAA,EAAO;AAAA,IACL,MAAMA,OAAAA,CAAO,kBAAA;AAAA,IACb,MAAMA,OAAAA,CAAO;AAAA;AAEjB","file":"index.mjs","sourcesContent":["import type { JSX } from \"react\"\nimport type { ButtonProps } from \"@/button\"\nimport styles from \"@/button-background.module.css\"\n\nexport interface ButtonBackgroundProps\n extends Pick<ButtonProps, \"isRounded\" | \"variant\"> {}\n\nexport function ButtonBackground(props: ButtonBackgroundProps): JSX.Element {\n const { isRounded = false, variant = \"primary\" } = props\n\n const combinedBackgroundStyles = `\n ${BUTTON_BACKGROUND_CLASS_NAME.BASE}\n ${isRounded ? BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.FULL : BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.BASE}\n ${variant === \"accent\" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.ACCENT : \"\"}\n ${variant === \"primary\" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.PRIMARY : \"\"}\n `\n .replaceAll(/\\s+/g, \" \")\n .trim()\n\n if (!(variant === \"accent\" || variant === \"primary\")) return <></>\n\n return (\n <div\n className={combinedBackgroundStyles}\n data-element=\"button-background\"\n />\n )\n}\n\nexport const BUTTON_BACKGROUND_CLASS_NAME = {\n BASE: styles.button_background,\n ROUNDED: {\n BASE: styles.button_background__rounded_base,\n FULL: styles.button_background__rounded_full,\n },\n VARIANT: {\n ACCENT: styles.button_background__variant_accent,\n PRIMARY: styles.button_background__variant_primary,\n },\n} as const\n","import type { CSSProperties, JSX } from \"react\"\nimport styles from \"@/button-spinner.module.css\"\n\nexport interface ButtonSpinnerProps {\n size?: number\n}\n\nexport function ButtonSpinner(props: ButtonSpinnerProps): JSX.Element {\n const { size = 16 } = props\n\n return (\n <div\n className={styles.button_spinner}\n style={{ \"--size\": `${size}px` } as CSSProperties}\n >\n {Array.from({ length: 12 }).map((_, index) => (\n <div key={index} />\n ))}\n </div>\n )\n}\n","import type { ComponentProps, JSX, ReactNode } from \"react\"\nimport { ButtonBackground } from \"@/button-background\"\nimport { ButtonSpinner } from \"@/button-spinner\"\nimport styles from \"@/button.module.css\"\n\nexport interface ButtonProps\n extends Omit<ComponentProps<\"button\">, \"aria-pressed\" | \"disabled\"> {\n fullWidth?: boolean\n iconEnd?: ReactNode\n iconOnly?: boolean\n iconStart?: ReactNode\n isActive?: boolean\n isDisabled?: boolean\n isLoading?: boolean\n isRounded?: boolean\n size?: 32 | 36 | 40 | 48\n variant?: \"accent\" | \"ghost\" | \"primary\" | \"secondary\"\n}\n\ntype ButtonPropsInternal = ButtonPropsWithIcon | ButtonPropsWithText\n\ninterface ButtonPropsWithIcon extends ButtonProps {\n children?: ReactNode\n iconOnly: true\n}\n\ninterface ButtonPropsWithText extends ButtonProps {\n children?: string\n iconOnly?: false\n}\n\nexport function Button(props: ButtonPropsInternal): JSX.Element {\n const {\n children = \"\",\n className: customClassName = \"\",\n fullWidth = false,\n iconEnd = \"\",\n iconOnly = false,\n iconStart = \"\",\n isActive = false,\n isDisabled = false,\n isLoading = false,\n isRounded = false,\n size = 36,\n type = \"button\",\n variant = \"primary\",\n ...rest\n } = props\n\n const combinedClassName = `\n ${BUTTON_CLASS_NAME.BASE}\n ${BUTTON_CLASS_NAME.SIZE[size]}\n ${BUTTON_CLASS_NAME.VARIANT[variant.toUpperCase() as keyof typeof BUTTON_CLASS_NAME.VARIANT]}\n ${fullWidth ? BUTTON_CLASS_NAME.WIDTH.FULL : BUTTON_CLASS_NAME.WIDTH.BASE}\n ${iconOnly ? BUTTON_CLASS_NAME.ICON_ONLY : \"\"}\n ${isRounded ? BUTTON_CLASS_NAME.ROUNDED.FULL : BUTTON_CLASS_NAME.ROUNDED.BASE}\n ${customClassName}\n `\n .replaceAll(/\\s+/g, \" \")\n .trim()\n\n return (\n <button\n aria-pressed={isActive}\n className={combinedClassName}\n disabled={isDisabled || isLoading}\n type={type}\n {...rest}\n >\n <ButtonBackground isRounded={isRounded} variant={variant} />\n {isLoading && <ButtonSpinner />}\n {!isLoading && iconStart}\n {iconOnly ? children : <span>{children}</span>}\n {!isLoading && iconEnd}\n </button>\n )\n}\n\nexport const BUTTON_CLASS_NAME = {\n BASE: styles.button,\n ICON_ONLY: styles.button__icon_only,\n ROUNDED: {\n BASE: styles.button__rounded_base,\n FULL: styles.button__rounded_full,\n },\n SIZE: {\n 32: styles.button__size_32,\n 36: styles.button__size_36,\n 40: styles.button__size_40,\n 48: styles.button__size_48,\n },\n VARIANT: {\n ACCENT: styles.button__variant_accent,\n GHOST: styles.button__variant_ghost,\n PRIMARY: styles.button__variant_primary,\n SECONDARY: styles.button__variant_secondary,\n },\n WIDTH: {\n BASE: styles.button__width_base,\n FULL: styles.button__width_full,\n },\n} as const\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nattui/react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "A collection of reusable React components built with TypeScript and CSS Modules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -17,9 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"author": "Natt Nguyen <hello@natt.sh> (https://natt.sh)",
|
|
20
|
-
"exports":
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.mjs",
|
|
24
|
+
"require": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
21
27
|
"main": "./dist/index.js",
|
|
22
|
-
"module": "./dist/index.
|
|
28
|
+
"module": "./dist/index.mjs",
|
|
23
29
|
"types": "./dist/index.d.ts",
|
|
24
30
|
"devDependencies": {
|
|
25
31
|
"@eslint/js": "^9.32.0",
|
|
@@ -3,14 +3,14 @@ import type { ButtonProps } from "@/button"
|
|
|
3
3
|
import styles from "@/button-background.module.css"
|
|
4
4
|
|
|
5
5
|
export interface ButtonBackgroundProps
|
|
6
|
-
extends Pick<ButtonProps, "
|
|
6
|
+
extends Pick<ButtonProps, "isRounded" | "variant"> {}
|
|
7
7
|
|
|
8
8
|
export function ButtonBackground(props: ButtonBackgroundProps): JSX.Element {
|
|
9
|
-
const {
|
|
9
|
+
const { isRounded = false, variant = "primary" } = props
|
|
10
10
|
|
|
11
11
|
const combinedBackgroundStyles = `
|
|
12
12
|
${BUTTON_BACKGROUND_CLASS_NAME.BASE}
|
|
13
|
-
${
|
|
13
|
+
${isRounded ? BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.FULL : BUTTON_BACKGROUND_CLASS_NAME.ROUNDED.BASE}
|
|
14
14
|
${variant === "accent" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.ACCENT : ""}
|
|
15
15
|
${variant === "primary" ? BUTTON_BACKGROUND_CLASS_NAME.VARIANT.PRIMARY : ""}
|
|
16
16
|
`
|
package/src/button.tsx
CHANGED
|
@@ -12,7 +12,7 @@ export interface ButtonProps
|
|
|
12
12
|
isActive?: boolean
|
|
13
13
|
isDisabled?: boolean
|
|
14
14
|
isLoading?: boolean
|
|
15
|
-
|
|
15
|
+
isRounded?: boolean
|
|
16
16
|
size?: 32 | 36 | 40 | 48
|
|
17
17
|
variant?: "accent" | "ghost" | "primary" | "secondary"
|
|
18
18
|
}
|
|
@@ -40,7 +40,7 @@ export function Button(props: ButtonPropsInternal): JSX.Element {
|
|
|
40
40
|
isActive = false,
|
|
41
41
|
isDisabled = false,
|
|
42
42
|
isLoading = false,
|
|
43
|
-
|
|
43
|
+
isRounded = false,
|
|
44
44
|
size = 36,
|
|
45
45
|
type = "button",
|
|
46
46
|
variant = "primary",
|
|
@@ -53,7 +53,7 @@ export function Button(props: ButtonPropsInternal): JSX.Element {
|
|
|
53
53
|
${BUTTON_CLASS_NAME.VARIANT[variant.toUpperCase() as keyof typeof BUTTON_CLASS_NAME.VARIANT]}
|
|
54
54
|
${fullWidth ? BUTTON_CLASS_NAME.WIDTH.FULL : BUTTON_CLASS_NAME.WIDTH.BASE}
|
|
55
55
|
${iconOnly ? BUTTON_CLASS_NAME.ICON_ONLY : ""}
|
|
56
|
-
${
|
|
56
|
+
${isRounded ? BUTTON_CLASS_NAME.ROUNDED.FULL : BUTTON_CLASS_NAME.ROUNDED.BASE}
|
|
57
57
|
${customClassName}
|
|
58
58
|
`
|
|
59
59
|
.replaceAll(/\s+/g, " ")
|
|
@@ -67,7 +67,7 @@ export function Button(props: ButtonPropsInternal): JSX.Element {
|
|
|
67
67
|
type={type}
|
|
68
68
|
{...rest}
|
|
69
69
|
>
|
|
70
|
-
<ButtonBackground
|
|
70
|
+
<ButtonBackground isRounded={isRounded} variant={variant} />
|
|
71
71
|
{isLoading && <ButtonSpinner />}
|
|
72
72
|
{!isLoading && iconStart}
|
|
73
73
|
{iconOnly ? children : <span>{children}</span>}
|