@julseb-lib/react 0.0.93 → 0.0.95
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/dist/index.cjs.js +65 -63
- package/dist/index.es.js +373 -367
- package/dist/index.umd.js +65 -63
- package/dist/lib/components/Card/Card.tsx +79 -75
- package/dist/lib/components/Card/styles.tsx +63 -59
- package/dist/lib/components/Card/types.ts +24 -22
- package/package.json +2 -2
|
@@ -47,80 +47,84 @@ import type { ILibCard } from "./types"
|
|
|
47
47
|
* </Card>
|
|
48
48
|
*/
|
|
49
49
|
export const Card: FC<ILibCard> = ({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
50
|
+
"data-testid": testid,
|
|
51
|
+
as,
|
|
52
|
+
ref,
|
|
53
|
+
children,
|
|
54
|
+
border,
|
|
55
|
+
borderRadius,
|
|
56
|
+
padding,
|
|
57
|
+
cursor,
|
|
58
|
+
width = "100%",
|
|
59
|
+
maxWidth = "100%",
|
|
60
|
+
height,
|
|
61
|
+
maxHeight,
|
|
62
|
+
shadow,
|
|
63
|
+
backgroundColor = "background",
|
|
64
|
+
textColor = "font",
|
|
65
|
+
backgroundImg,
|
|
66
|
+
textAlign = "left",
|
|
67
|
+
href,
|
|
68
|
+
to,
|
|
69
|
+
blank,
|
|
70
|
+
onClick,
|
|
71
|
+
inline,
|
|
72
|
+
flexDirection,
|
|
73
|
+
flexWrap,
|
|
74
|
+
justifyContent,
|
|
75
|
+
alignItems,
|
|
76
|
+
justifyItems,
|
|
77
|
+
alignContent,
|
|
78
|
+
gap,
|
|
79
|
+
columnGap,
|
|
80
|
+
rowGap,
|
|
81
|
+
...rest
|
|
80
82
|
}) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
83
|
+
return (
|
|
84
|
+
<StyledCard
|
|
85
|
+
data-testid={testid}
|
|
86
|
+
ref={ref}
|
|
87
|
+
as={as ? as : to ? Link : href ? "a" : onClick ? "button" : "div"}
|
|
88
|
+
to={to}
|
|
89
|
+
href={href}
|
|
90
|
+
target={blank ? "_blank" : undefined}
|
|
91
|
+
rel={blank ? "noreferrer noopener" : undefined}
|
|
92
|
+
onClick={onClick}
|
|
93
|
+
$border={border}
|
|
94
|
+
$borderRadius={borderRadius}
|
|
95
|
+
$padding={padding}
|
|
96
|
+
$cursor={cursor}
|
|
97
|
+
$width={width}
|
|
98
|
+
$maxWidth={maxWidth}
|
|
99
|
+
$height={height}
|
|
100
|
+
$maxHeight={maxHeight}
|
|
101
|
+
$shadow={shadow}
|
|
102
|
+
$backgroundColor={backgroundColor}
|
|
103
|
+
$textColor={textColor}
|
|
104
|
+
$backgroundImg={
|
|
105
|
+
backgroundImg && {
|
|
106
|
+
$img: backgroundImg.img,
|
|
107
|
+
$clip: backgroundImg.clip,
|
|
108
|
+
$origin: backgroundImg.origin,
|
|
109
|
+
$position: backgroundImg.position,
|
|
110
|
+
$repeat: backgroundImg.repeat,
|
|
111
|
+
$size: backgroundImg.size,
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
$textAlign={textAlign}
|
|
115
|
+
$inline={inline}
|
|
116
|
+
$flexDirection={flexDirection}
|
|
117
|
+
$flexWrap={flexWrap}
|
|
118
|
+
$justifyContent={justifyContent}
|
|
119
|
+
$alignItems={alignItems}
|
|
120
|
+
$justifyItems={justifyItems}
|
|
121
|
+
$alignContent={alignContent}
|
|
122
|
+
$gap={gap}
|
|
123
|
+
$columnGap={columnGap}
|
|
124
|
+
$rowGap={rowGap}
|
|
125
|
+
{...rest}
|
|
126
|
+
>
|
|
127
|
+
{children}
|
|
128
|
+
</StyledCard>
|
|
129
|
+
)
|
|
126
130
|
}
|
|
@@ -3,69 +3,73 @@ import type { Property } from "csstype"
|
|
|
3
3
|
import { stringifyPx } from "@julseb-lib/utils"
|
|
4
4
|
import { setDefaultTheme, Mixins } from "../../"
|
|
5
5
|
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
CssCursor,
|
|
7
|
+
LibAllColors,
|
|
8
|
+
ILibBorder,
|
|
9
|
+
ILibBoxShadow,
|
|
10
|
+
ILibPadding,
|
|
11
|
+
ILibRadius,
|
|
12
|
+
CssTextAlign,
|
|
13
|
+
CssAlignContent,
|
|
14
|
+
CssAlignItems,
|
|
15
|
+
CssFlexDirection,
|
|
16
|
+
CssFlexWrap,
|
|
17
|
+
CssJustifyContent,
|
|
18
|
+
CssJustifyItems,
|
|
19
|
+
LibSpacers,
|
|
20
20
|
} from "../../types"
|
|
21
21
|
|
|
22
22
|
const StyledCard = styled.div<{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
23
|
+
$border?: ILibBorder
|
|
24
|
+
$borderRadius?: ILibRadius
|
|
25
|
+
$padding?: ILibPadding
|
|
26
|
+
$cursor?: CssCursor
|
|
27
|
+
$width?: string | number
|
|
28
|
+
$maxWidth?: string | number
|
|
29
|
+
$height?: string | number
|
|
30
|
+
$maxHeight?: string | number
|
|
31
|
+
$shadow?: ILibBoxShadow
|
|
32
|
+
$backgroundColor: LibAllColors
|
|
33
|
+
$textColor: LibAllColors
|
|
34
|
+
$backgroundImg?: {
|
|
35
|
+
$img: string
|
|
36
|
+
$clip?: Property.BackgroundClip
|
|
37
|
+
$origin?: Property.BackgroundOrigin
|
|
38
|
+
$position?: Property.BackgroundPosition
|
|
39
|
+
$repeat?: Property.BackgroundRepeat
|
|
40
|
+
$size?: Property.BackgroundSize
|
|
41
|
+
}
|
|
42
|
+
$textAlign?: CssTextAlign
|
|
43
|
+
$inline?: boolean
|
|
44
|
+
$flexDirection?: CssFlexDirection
|
|
45
|
+
$flexWrap?: CssFlexWrap
|
|
46
|
+
$justifyContent?: CssJustifyContent
|
|
47
|
+
$alignItems?: CssAlignItems
|
|
48
|
+
$justifyItems?: CssJustifyItems
|
|
49
|
+
$alignContent?: CssAlignContent
|
|
50
|
+
$gap?: LibSpacers
|
|
51
|
+
$columnGap?: LibSpacers
|
|
52
|
+
$rowGap?: LibSpacers
|
|
51
53
|
}>`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
${Mixins.Flexbox};
|
|
55
|
+
text-decoration: none;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
position: relative;
|
|
58
|
+
cursor: ${({ $cursor }) => $cursor};
|
|
59
|
+
width: ${({ $width }) => $width && stringifyPx($width)};
|
|
60
|
+
max-width: ${({ $maxWidth }) => $maxWidth && stringifyPx($maxWidth)};
|
|
61
|
+
height: ${({ $height }) => $height && stringifyPx($height)};
|
|
62
|
+
max-height: ${({ $maxHeight }) => $maxHeight && stringifyPx($maxHeight)};
|
|
63
|
+
background-color: ${({ theme, $backgroundColor }) =>
|
|
64
|
+
Mixins.AllColors($backgroundColor, theme)};
|
|
65
|
+
color: ${({ theme, $textColor }) => Mixins.AllColors($textColor, theme)};
|
|
66
|
+
text-align: ${({ $textAlign }) => $textAlign};
|
|
67
|
+
${({ $borderRadius }) => Mixins.BorderRadius($borderRadius)};
|
|
68
|
+
${({ $border }) => Mixins.Border($border)};
|
|
69
|
+
${({ $padding }) => Mixins.Padding($padding)};
|
|
70
|
+
${({ $shadow }) => Mixins.BoxShadow($shadow)};
|
|
71
|
+
${({ $backgroundImg }) =>
|
|
72
|
+
Mixins.BackgroundImage({ ...($backgroundImg as any) })};
|
|
69
73
|
`
|
|
70
74
|
|
|
71
75
|
setDefaultTheme([StyledCard])
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
LibComponentBase,
|
|
3
|
+
LibButtonLinkBlank,
|
|
4
|
+
ILibBackgroundImage,
|
|
5
|
+
ILibBorder,
|
|
6
|
+
ILibRadius,
|
|
7
|
+
CssCursor,
|
|
8
|
+
ILibBoxShadow,
|
|
9
|
+
LibAllColors,
|
|
10
|
+
CssTextAlign,
|
|
11
11
|
} from "../../types"
|
|
12
12
|
import type { ILibFlexbox } from "../Flexbox/types"
|
|
13
13
|
|
|
14
14
|
export type ILibCard = LibComponentBase<HTMLDivElement> &
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
LibButtonLinkBlank &
|
|
16
|
+
ILibFlexbox & {
|
|
17
|
+
border?: ILibBorder
|
|
18
|
+
borderRadius?: ILibRadius
|
|
19
|
+
cursor?: CssCursor
|
|
20
|
+
width?: string | number
|
|
21
|
+
maxWidth?: string | number
|
|
22
|
+
height?: string | number
|
|
23
|
+
maxHeight?: string | number
|
|
24
|
+
shadow?: ILibBoxShadow
|
|
25
|
+
backgroundColor?: LibAllColors
|
|
26
|
+
textColor?: LibAllColors
|
|
27
|
+
backgroundImg?: ILibBackgroundImage
|
|
28
|
+
textAlign?: CssTextAlign
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@julseb-lib/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.95",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"plop": "cross-env NODE_OPTIONS='--import tsx' plop --plopfile=./plop/plopfile.ts",
|
|
15
15
|
"plop:c": "yarn plop component",
|
|
16
16
|
"plop:p": "yarn plop preview",
|
|
17
|
-
"plop:st": "yarn plop subtype",
|
|
17
|
+
"plop:st": "yarn plop subtype",
|
|
18
18
|
"cy": "cypress",
|
|
19
19
|
"cy:open": "cypress open",
|
|
20
20
|
"cy:ct:run": "cypress run --component --browser electron",
|