zc-ui-library 0.1.2 → 0.1.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/package.json +1 -1
- package/src/App.tsx +1 -3
- package/src/components/Button/ZcButton.tsx +4 -46
- package/src/index.ts +1 -1
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -1,49 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type ButtonVariant = 'primary' | 'secondary'
|
|
4
|
-
export type ButtonSize = 'sm' | 'md' | 'lg'
|
|
5
|
-
|
|
6
|
-
export interface ButtonProps
|
|
7
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
|
-
variant?: ButtonVariant
|
|
9
|
-
size?: ButtonSize
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const ZcButton = React.forwardRef<HTMLButtonElement, ButtonProps>(function ZcButton(
|
|
13
|
-
{
|
|
14
|
-
variant = 'primary',
|
|
15
|
-
size = 'md',
|
|
16
|
-
disabled,
|
|
17
|
-
children,
|
|
18
|
-
...props
|
|
19
|
-
},
|
|
20
|
-
ref
|
|
21
|
-
) {
|
|
1
|
+
export default function ZcButton() {
|
|
22
2
|
return (
|
|
23
|
-
<button
|
|
24
|
-
|
|
25
|
-
disabled={disabled}
|
|
26
|
-
data-variant={variant}
|
|
27
|
-
data-size={size}
|
|
28
|
-
style={{
|
|
29
|
-
padding:
|
|
30
|
-
size === 'sm'
|
|
31
|
-
? '6px 10px'
|
|
32
|
-
: size === 'lg'
|
|
33
|
-
? '12px 18px'
|
|
34
|
-
: '8px 14px',
|
|
35
|
-
borderRadius: 6,
|
|
36
|
-
border: '1px solid transparent',
|
|
37
|
-
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
38
|
-
background:
|
|
39
|
-
variant === 'secondary' ? '#fff' : '#2563eb',
|
|
40
|
-
color:
|
|
41
|
-
variant === 'secondary' ? '#111' : '#fff',
|
|
42
|
-
opacity: disabled ? 0.6 : 1,
|
|
43
|
-
}}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
3
|
+
<button>
|
|
4
|
+
clicked
|
|
47
5
|
</button>
|
|
48
6
|
)
|
|
49
|
-
}
|
|
7
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {ZcButton} from './components/Button/ZcButton.tsx';
|
|
1
|
+
export {default as ZcButton} from './components/Button/ZcButton.tsx';
|