@julseb-lib/react 0.0.3 → 0.0.5
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 +146 -145
- package/dist/index.es.js +666 -645
- package/dist/index.umd.js +169 -168
- package/dist/lib/components/Card/Card.tsx +21 -2
- package/dist/lib/components/Card/styles.tsx +20 -2
- package/dist/lib/components/Header/HeaderNav.tsx +13 -11
- package/package.json +1 -1
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from "react"
|
|
4
4
|
import { Link } from "react-router-dom"
|
|
5
|
-
import { Flexbox } from "../../"
|
|
6
5
|
import { StyledCard } from "./styles"
|
|
7
6
|
import type { ILibCard } from "./types"
|
|
8
7
|
|
|
@@ -61,6 +60,16 @@ export const Card = forwardRef<HTMLDivElement, ILibCard>(
|
|
|
61
60
|
to,
|
|
62
61
|
blank,
|
|
63
62
|
onClick,
|
|
63
|
+
inline,
|
|
64
|
+
flexDirection,
|
|
65
|
+
flexWrap,
|
|
66
|
+
justifyContent,
|
|
67
|
+
alignItems,
|
|
68
|
+
justifyItems,
|
|
69
|
+
alignContent,
|
|
70
|
+
gap,
|
|
71
|
+
columnGap,
|
|
72
|
+
rowGap,
|
|
64
73
|
...rest
|
|
65
74
|
},
|
|
66
75
|
ref
|
|
@@ -78,7 +87,7 @@ export const Card = forwardRef<HTMLDivElement, ILibCard>(
|
|
|
78
87
|
? "a"
|
|
79
88
|
: onClick
|
|
80
89
|
? "button"
|
|
81
|
-
:
|
|
90
|
+
: "div"
|
|
82
91
|
}
|
|
83
92
|
to={to}
|
|
84
93
|
href={href}
|
|
@@ -105,6 +114,16 @@ export const Card = forwardRef<HTMLDivElement, ILibCard>(
|
|
|
105
114
|
}
|
|
106
115
|
}
|
|
107
116
|
$textAlign={textAlign}
|
|
117
|
+
$inline={inline}
|
|
118
|
+
$flexDirection={flexDirection}
|
|
119
|
+
$flexWrap={flexWrap}
|
|
120
|
+
$justifyContent={justifyContent}
|
|
121
|
+
$alignItems={alignItems}
|
|
122
|
+
$justifyItems={justifyItems}
|
|
123
|
+
$alignContent={alignContent}
|
|
124
|
+
$gap={gap}
|
|
125
|
+
$columnGap={columnGap}
|
|
126
|
+
$rowGap={rowGap}
|
|
108
127
|
{...rest}
|
|
109
128
|
>
|
|
110
129
|
{children}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import styled from "styled-components"
|
|
4
4
|
import type { Property } from "csstype"
|
|
5
5
|
import { stringifyPx } from "ts-utils-julseb"
|
|
6
|
-
import { setDefaultTheme,
|
|
6
|
+
import { setDefaultTheme, Mixins } from "../../"
|
|
7
7
|
import type {
|
|
8
8
|
CssCursor,
|
|
9
9
|
LibAllColors,
|
|
@@ -12,9 +12,16 @@ import type {
|
|
|
12
12
|
ILibPadding,
|
|
13
13
|
ILibRadius,
|
|
14
14
|
CssTextAlign,
|
|
15
|
+
CssAlignContent,
|
|
16
|
+
CssAlignItems,
|
|
17
|
+
CssFlexDirection,
|
|
18
|
+
CssFlexWrap,
|
|
19
|
+
CssJustifyContent,
|
|
20
|
+
CssJustifyItems,
|
|
21
|
+
LibSpacers,
|
|
15
22
|
} from "../../types"
|
|
16
23
|
|
|
17
|
-
const StyledCard = styled
|
|
24
|
+
const StyledCard = styled.div<{
|
|
18
25
|
$border?: ILibBorder
|
|
19
26
|
$borderRadius?: ILibRadius
|
|
20
27
|
$padding?: ILibPadding
|
|
@@ -33,7 +40,18 @@ const StyledCard = styled(Flexbox)<{
|
|
|
33
40
|
$size?: Property.BackgroundSize
|
|
34
41
|
}
|
|
35
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
|
|
36
53
|
}>`
|
|
54
|
+
${Mixins.Flexbox};
|
|
37
55
|
text-decoration: none;
|
|
38
56
|
overflow: hidden;
|
|
39
57
|
position: relative;
|
|
@@ -36,8 +36,9 @@ export function HeaderNav({
|
|
|
36
36
|
|
|
37
37
|
const searchHeight = isMobile && !!search ? 32 : 0
|
|
38
38
|
|
|
39
|
-
const linksHeight =
|
|
40
|
-
|
|
39
|
+
const linksHeight = links
|
|
40
|
+
? links.length * 24 + ([...valueArr, searchHeight].length - 1) * 12
|
|
41
|
+
: 56
|
|
41
42
|
|
|
42
43
|
const navHeight = searchHeight + linksHeight
|
|
43
44
|
|
|
@@ -61,15 +62,16 @@ export function HeaderNav({
|
|
|
61
62
|
/>
|
|
62
63
|
)}
|
|
63
64
|
|
|
64
|
-
{links
|
|
65
|
-
links.map(link => (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
{links
|
|
66
|
+
? links.map(link => (
|
|
67
|
+
<HeaderNavLink
|
|
68
|
+
data-testid={testid}
|
|
69
|
+
className={className}
|
|
70
|
+
link={link}
|
|
71
|
+
key={uuid()}
|
|
72
|
+
/>
|
|
73
|
+
))
|
|
74
|
+
: null}
|
|
73
75
|
|
|
74
76
|
{children && children}
|
|
75
77
|
</Nav>
|