@dafaz-ui/react 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +1691 -1
- package/dist/index.d.ts +1691 -1
- package/dist/index.js +20 -3
- package/dist/index.mjs +11 -2
- package/package.json +1 -1
- package/src/components/Button.tsx +104 -104
- package/src/index.tsx +3 -1
- package/src/styles/index.ts +38 -38
- package/tsconfig.json +4 -4
package/dist/index.js
CHANGED
@@ -37,7 +37,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
37
37
|
// src/index.tsx
|
38
38
|
var src_exports = {};
|
39
39
|
__export(src_exports, {
|
40
|
-
Button: () => Button
|
40
|
+
Button: () => Button,
|
41
|
+
config: () => config,
|
42
|
+
createTheme: () => createTheme,
|
43
|
+
css: () => css,
|
44
|
+
getCssText: () => getCssText,
|
45
|
+
globalCss: () => globalCss,
|
46
|
+
keyframes: () => keyframes,
|
47
|
+
styled: () => styled,
|
48
|
+
theme: () => theme
|
41
49
|
});
|
42
50
|
module.exports = __toCommonJS(src_exports);
|
43
51
|
|
@@ -53,7 +61,8 @@ var colors = {
|
|
53
61
|
dafaz200: "#52D058",
|
54
62
|
dafaz400: "#2FC136",
|
55
63
|
dafaz600: "#229E45",
|
56
|
-
dafaz800: "#2A6A2D"
|
64
|
+
dafaz800: "#2A6A2D",
|
65
|
+
teste: "#FFF"
|
57
66
|
};
|
58
67
|
var opacities = {
|
59
68
|
opacity400: "0.4",
|
@@ -216,5 +225,13 @@ var Button = styled("button", {
|
|
216
225
|
});
|
217
226
|
// Annotate the CommonJS export names for ESM import in node:
|
218
227
|
0 && (module.exports = {
|
219
|
-
Button
|
228
|
+
Button,
|
229
|
+
config,
|
230
|
+
createTheme,
|
231
|
+
css,
|
232
|
+
getCssText,
|
233
|
+
globalCss,
|
234
|
+
keyframes,
|
235
|
+
styled,
|
236
|
+
theme
|
220
237
|
});
|
package/dist/index.mjs
CHANGED
@@ -30,7 +30,8 @@ var colors = {
|
|
30
30
|
dafaz200: "#52D058",
|
31
31
|
dafaz400: "#2FC136",
|
32
32
|
dafaz600: "#229E45",
|
33
|
-
dafaz800: "#2A6A2D"
|
33
|
+
dafaz800: "#2A6A2D",
|
34
|
+
teste: "#FFF"
|
34
35
|
};
|
35
36
|
var opacities = {
|
36
37
|
opacity400: "0.4",
|
@@ -192,5 +193,13 @@ var Button = styled("button", {
|
|
192
193
|
}
|
193
194
|
});
|
194
195
|
export {
|
195
|
-
Button
|
196
|
+
Button,
|
197
|
+
config,
|
198
|
+
createTheme,
|
199
|
+
css,
|
200
|
+
getCssText,
|
201
|
+
globalCss,
|
202
|
+
keyframes,
|
203
|
+
styled,
|
204
|
+
theme
|
196
205
|
};
|
package/package.json
CHANGED
@@ -1,104 +1,104 @@
|
|
1
|
-
import type { ComponentProps } from '@stitches/react'
|
2
|
-
import { styled } from '../styles'
|
3
|
-
import type { ElementType } from 'react'
|
4
|
-
|
5
|
-
/** Primary UI component for user interaction */
|
6
|
-
export const Button = styled('button', {
|
7
|
-
all: 'unset',
|
8
|
-
borderRadius: '$md',
|
9
|
-
fontSize: '$md',
|
10
|
-
fontWeight: '$regular',
|
11
|
-
fontFamily: '$app',
|
12
|
-
textAlign: 'center',
|
13
|
-
minWidth: 120,
|
14
|
-
boxSizing: 'border-box',
|
15
|
-
|
16
|
-
display: 'flex',
|
17
|
-
alignItems: 'center',
|
18
|
-
justifyContent: 'center',
|
19
|
-
gap: '$2',
|
20
|
-
padding: '$2 $5',
|
21
|
-
|
22
|
-
cursor: 'pointer',
|
23
|
-
|
24
|
-
'&:disabled': {
|
25
|
-
cursor: 'not-allowed',
|
26
|
-
},
|
27
|
-
|
28
|
-
svg: {
|
29
|
-
width: '$4',
|
30
|
-
height: '$4',
|
31
|
-
},
|
32
|
-
|
33
|
-
variants: {
|
34
|
-
variant: {
|
35
|
-
primary: {
|
36
|
-
color: '$white',
|
37
|
-
background: '$dafaz600',
|
38
|
-
opacity: 0.8,
|
39
|
-
|
40
|
-
'&:not(:disabled):hover': {
|
41
|
-
opacity: 1,
|
42
|
-
},
|
43
|
-
|
44
|
-
'&:disabled': {
|
45
|
-
background: '$gray200',
|
46
|
-
},
|
47
|
-
},
|
48
|
-
secondary: {
|
49
|
-
fontWeight: '$medium',
|
50
|
-
color: '$dafaz600',
|
51
|
-
border: '2px solid $dafaz600',
|
52
|
-
opacity: 0.8,
|
53
|
-
|
54
|
-
'&:not(:disabled):hover': {
|
55
|
-
opacity: 1,
|
56
|
-
},
|
57
|
-
|
58
|
-
'&:disabled': {
|
59
|
-
color: '$gray200',
|
60
|
-
border: '2px solid $gray200',
|
61
|
-
},
|
62
|
-
},
|
63
|
-
tertiary: {
|
64
|
-
fontWeight: '$medium',
|
65
|
-
color: '$gray400',
|
66
|
-
|
67
|
-
'&:not(:disabled):hover': {
|
68
|
-
color: '$gray800',
|
69
|
-
},
|
70
|
-
|
71
|
-
'&:disabled': {
|
72
|
-
color: '$gray200',
|
73
|
-
},
|
74
|
-
},
|
75
|
-
},
|
76
|
-
size: {
|
77
|
-
sm: {
|
78
|
-
height: 38,
|
79
|
-
},
|
80
|
-
md: {
|
81
|
-
height: 46,
|
82
|
-
},
|
83
|
-
},
|
84
|
-
},
|
85
|
-
|
86
|
-
defaultVariants: {
|
87
|
-
variant: 'primary',
|
88
|
-
size: 'md',
|
89
|
-
},
|
90
|
-
})
|
91
|
-
|
92
|
-
export interface ButtonProps extends ComponentProps<typeof Button> {
|
93
|
-
as?: ElementType
|
94
|
-
/** How large should the button be? */
|
95
|
-
size?: 'sm' | 'md'
|
96
|
-
/** Optional click handler */
|
97
|
-
onClick?: () => void
|
98
|
-
/** Button contents */
|
99
|
-
label: string
|
100
|
-
/** Button is disable? */
|
101
|
-
disabled?: boolean
|
102
|
-
//** Button UI mode */
|
103
|
-
variant?: 'primary' | 'secondary' | 'tertiary'
|
104
|
-
}
|
1
|
+
import type { ComponentProps } from '@stitches/react'
|
2
|
+
import { styled } from '../styles'
|
3
|
+
import type { ElementType } from 'react'
|
4
|
+
|
5
|
+
/** Primary UI component for user interaction */
|
6
|
+
export const Button = styled('button', {
|
7
|
+
all: 'unset',
|
8
|
+
borderRadius: '$md',
|
9
|
+
fontSize: '$md',
|
10
|
+
fontWeight: '$regular',
|
11
|
+
fontFamily: '$app',
|
12
|
+
textAlign: 'center',
|
13
|
+
minWidth: 120,
|
14
|
+
boxSizing: 'border-box',
|
15
|
+
|
16
|
+
display: 'flex',
|
17
|
+
alignItems: 'center',
|
18
|
+
justifyContent: 'center',
|
19
|
+
gap: '$2',
|
20
|
+
padding: '$2 $5',
|
21
|
+
|
22
|
+
cursor: 'pointer',
|
23
|
+
|
24
|
+
'&:disabled': {
|
25
|
+
cursor: 'not-allowed',
|
26
|
+
},
|
27
|
+
|
28
|
+
svg: {
|
29
|
+
width: '$4',
|
30
|
+
height: '$4',
|
31
|
+
},
|
32
|
+
|
33
|
+
variants: {
|
34
|
+
variant: {
|
35
|
+
primary: {
|
36
|
+
color: '$white',
|
37
|
+
background: '$dafaz600',
|
38
|
+
opacity: 0.8,
|
39
|
+
|
40
|
+
'&:not(:disabled):hover': {
|
41
|
+
opacity: 1,
|
42
|
+
},
|
43
|
+
|
44
|
+
'&:disabled': {
|
45
|
+
background: '$gray200',
|
46
|
+
},
|
47
|
+
},
|
48
|
+
secondary: {
|
49
|
+
fontWeight: '$medium',
|
50
|
+
color: '$dafaz600',
|
51
|
+
border: '2px solid $dafaz600',
|
52
|
+
opacity: 0.8,
|
53
|
+
|
54
|
+
'&:not(:disabled):hover': {
|
55
|
+
opacity: 1,
|
56
|
+
},
|
57
|
+
|
58
|
+
'&:disabled': {
|
59
|
+
color: '$gray200',
|
60
|
+
border: '2px solid $gray200',
|
61
|
+
},
|
62
|
+
},
|
63
|
+
tertiary: {
|
64
|
+
fontWeight: '$medium',
|
65
|
+
color: '$gray400',
|
66
|
+
|
67
|
+
'&:not(:disabled):hover': {
|
68
|
+
color: '$gray800',
|
69
|
+
},
|
70
|
+
|
71
|
+
'&:disabled': {
|
72
|
+
color: '$gray200',
|
73
|
+
},
|
74
|
+
},
|
75
|
+
},
|
76
|
+
size: {
|
77
|
+
sm: {
|
78
|
+
height: 38,
|
79
|
+
},
|
80
|
+
md: {
|
81
|
+
height: 46,
|
82
|
+
},
|
83
|
+
},
|
84
|
+
},
|
85
|
+
|
86
|
+
defaultVariants: {
|
87
|
+
variant: 'primary',
|
88
|
+
size: 'md',
|
89
|
+
},
|
90
|
+
})
|
91
|
+
|
92
|
+
export interface ButtonProps extends ComponentProps<typeof Button> {
|
93
|
+
as?: ElementType
|
94
|
+
/** How large should the button be? */
|
95
|
+
size?: 'sm' | 'md'
|
96
|
+
/** Optional click handler */
|
97
|
+
onClick?: () => void
|
98
|
+
/** Button contents */
|
99
|
+
label: string
|
100
|
+
/** Button is disable? */
|
101
|
+
disabled?: boolean
|
102
|
+
//** Button UI mode */
|
103
|
+
variant?: 'primary' | 'secondary' | 'tertiary'
|
104
|
+
}
|
package/src/index.tsx
CHANGED
package/src/styles/index.ts
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
import {
|
2
|
-
colors,
|
3
|
-
fontSizes,
|
4
|
-
fontWeights,
|
5
|
-
fonts,
|
6
|
-
lineHeights,
|
7
|
-
opacities,
|
8
|
-
radii,
|
9
|
-
space,
|
10
|
-
} from '@dafaz-ui/tokens'
|
11
|
-
import { createStitches, defaultThemeMap } from '@stitches/react'
|
12
|
-
|
13
|
-
export const {
|
14
|
-
styled,
|
15
|
-
css,
|
16
|
-
globalCss,
|
17
|
-
keyframes,
|
18
|
-
getCssText,
|
19
|
-
theme,
|
20
|
-
createTheme,
|
21
|
-
config,
|
22
|
-
} = createStitches({
|
23
|
-
themeMap: {
|
24
|
-
...defaultThemeMap,
|
25
|
-
height: 'space',
|
26
|
-
width: 'space',
|
27
|
-
},
|
28
|
-
theme: {
|
29
|
-
colors: colors,
|
30
|
-
fontSizes: fontSizes,
|
31
|
-
fontWeights: fontWeights,
|
32
|
-
fonts: fonts,
|
33
|
-
lineHeights: lineHeights,
|
34
|
-
radii: radii,
|
35
|
-
space: space,
|
36
|
-
opacities: opacities,
|
37
|
-
},
|
38
|
-
})
|
1
|
+
import {
|
2
|
+
colors,
|
3
|
+
fontSizes,
|
4
|
+
fontWeights,
|
5
|
+
fonts,
|
6
|
+
lineHeights,
|
7
|
+
opacities,
|
8
|
+
radii,
|
9
|
+
space,
|
10
|
+
} from '@dafaz-ui/tokens'
|
11
|
+
import { createStitches, defaultThemeMap } from '@stitches/react'
|
12
|
+
|
13
|
+
export const {
|
14
|
+
styled,
|
15
|
+
css,
|
16
|
+
globalCss,
|
17
|
+
keyframes,
|
18
|
+
getCssText,
|
19
|
+
theme,
|
20
|
+
createTheme,
|
21
|
+
config,
|
22
|
+
} = createStitches({
|
23
|
+
themeMap: {
|
24
|
+
...defaultThemeMap,
|
25
|
+
height: 'space',
|
26
|
+
width: 'space',
|
27
|
+
},
|
28
|
+
theme: {
|
29
|
+
colors: colors,
|
30
|
+
fontSizes: fontSizes,
|
31
|
+
fontWeights: fontWeights,
|
32
|
+
fonts: fonts,
|
33
|
+
lineHeights: lineHeights,
|
34
|
+
radii: radii,
|
35
|
+
space: space,
|
36
|
+
opacities: opacities,
|
37
|
+
},
|
38
|
+
})
|
package/tsconfig.json
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
{
|
2
|
-
"extends": "@dafaz-ui/ts-config/react.json",
|
3
|
-
"include": ["src"],
|
4
|
-
}
|
1
|
+
{
|
2
|
+
"extends": "@dafaz-ui/ts-config/react.json",
|
3
|
+
"include": ["src"],
|
4
|
+
}
|