@julseb-lib/react 0.0.88 → 0.0.89
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 +639 -639
- package/dist/index.es.js +3247 -2717
- package/dist/index.umd.js +586 -586
- package/dist/lib/Mixins.tsx +970 -970
- package/dist/lib/components/Image/Image.tsx +77 -73
- package/dist/lib/components/Image/ImageFunction.tsx +39 -37
- package/dist/lib/components/Timepicker/Timepicker.tsx +234 -235
- package/dist/lib/components/Youtube/types.ts +5 -4
- package/dist/lib/index.ts +56 -55
- package/dist/lib/types/global.ts +129 -128
- package/dist/lib/types/index.ts +0 -1
- package/license.md +21 -0
- package/package.json +1 -1
- /package/dist/lib/{types/design-tokens.ts → design-tokens.ts} +0 -0
|
@@ -40,81 +40,85 @@ import type { ILibImage } from "./types"
|
|
|
40
40
|
* />
|
|
41
41
|
*/
|
|
42
42
|
export const Image: FC<ILibImage> = ({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
43
|
+
"data-testid": testid,
|
|
44
|
+
ref,
|
|
45
|
+
role = "img",
|
|
46
|
+
className,
|
|
47
|
+
src,
|
|
48
|
+
alt,
|
|
49
|
+
caption,
|
|
50
|
+
width = "100%",
|
|
51
|
+
height = "auto",
|
|
52
|
+
aspectRatio,
|
|
53
|
+
borderRadius,
|
|
54
|
+
fit,
|
|
55
|
+
fallback = (
|
|
56
|
+
<Fallback
|
|
57
|
+
$aspectRatio={aspectRatio}
|
|
58
|
+
$width={width}
|
|
59
|
+
$height={height}
|
|
60
|
+
$borderRadius={borderRadius}
|
|
61
|
+
/>
|
|
62
|
+
),
|
|
63
|
+
containerStyle,
|
|
64
|
+
containerAs,
|
|
65
|
+
...rest
|
|
65
66
|
}) => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
const imageProps = {
|
|
68
|
+
"data-testid": testid,
|
|
69
|
+
ref,
|
|
70
|
+
role,
|
|
71
|
+
fallback,
|
|
72
|
+
caption,
|
|
73
|
+
className,
|
|
74
|
+
src,
|
|
75
|
+
alt,
|
|
76
|
+
aspectRatio,
|
|
77
|
+
width,
|
|
78
|
+
height,
|
|
79
|
+
borderRadius,
|
|
80
|
+
fit,
|
|
81
|
+
...rest,
|
|
82
|
+
}
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
84
|
+
if (caption)
|
|
85
|
+
return (
|
|
86
|
+
<ImgContainer
|
|
87
|
+
data-testid={testid}
|
|
88
|
+
className={className}
|
|
89
|
+
style={containerStyle}
|
|
90
|
+
as={containerAs}
|
|
91
|
+
role="figure"
|
|
92
|
+
$width={width}
|
|
93
|
+
$height={height}
|
|
94
|
+
$borderRadius={borderRadius}
|
|
95
|
+
>
|
|
96
|
+
<ImageFunction {...imageProps} />
|
|
94
97
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
98
|
+
<Caption
|
|
99
|
+
data-testid={testid && `${testid}.Caption`}
|
|
100
|
+
className={className && "Caption"}
|
|
101
|
+
role="contentinfo"
|
|
102
|
+
as={
|
|
103
|
+
typeof caption === "object" && caption.as
|
|
104
|
+
? caption.as
|
|
105
|
+
: "figcaption"
|
|
106
|
+
}
|
|
107
|
+
$backgroundColor={
|
|
108
|
+
typeof caption === "object" && caption.background
|
|
109
|
+
? caption?.background
|
|
110
|
+
: "black-50"
|
|
111
|
+
}
|
|
112
|
+
$textColor={
|
|
113
|
+
typeof caption === "object" && caption.textColor
|
|
114
|
+
? caption.textColor
|
|
115
|
+
: "white"
|
|
116
|
+
}
|
|
117
|
+
>
|
|
118
|
+
{typeof caption === "object" ? caption.text : caption}
|
|
119
|
+
</Caption>
|
|
120
|
+
</ImgContainer>
|
|
121
|
+
)
|
|
118
122
|
|
|
119
|
-
|
|
123
|
+
return <ImageFunction {...imageProps} />
|
|
120
124
|
}
|
|
@@ -4,42 +4,44 @@ import type { ILibImage } from "./types"
|
|
|
4
4
|
const StyledImage = lazy(() => import("./styles"))
|
|
5
5
|
|
|
6
6
|
export const ImageFunction: FC<ILibImage> = ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
"data-testid": testid,
|
|
8
|
+
ref,
|
|
9
|
+
role = "img",
|
|
10
|
+
fallback,
|
|
11
|
+
caption,
|
|
12
|
+
className,
|
|
13
|
+
src,
|
|
14
|
+
alt,
|
|
15
|
+
aspectRatio,
|
|
16
|
+
width = "100%",
|
|
17
|
+
height = "auto",
|
|
18
|
+
borderRadius,
|
|
19
|
+
fit,
|
|
20
|
+
loading = "lazy",
|
|
21
|
+
imgFallback,
|
|
22
|
+
...rest
|
|
22
23
|
}) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
return (
|
|
25
|
+
<Suspense fallback={fallback}>
|
|
26
|
+
<StyledImage
|
|
27
|
+
data-testid={!caption ? testid : testid && `${testid}.Image`}
|
|
28
|
+
className={!caption ? className : className && "Image"}
|
|
29
|
+
role={role}
|
|
30
|
+
ref={ref}
|
|
31
|
+
src={src}
|
|
32
|
+
alt={alt}
|
|
33
|
+
loading={loading}
|
|
34
|
+
data-fallback={imgFallback?.text}
|
|
35
|
+
$aspectRatio={aspectRatio}
|
|
36
|
+
$width={width}
|
|
37
|
+
$height={height}
|
|
38
|
+
$borderRadius={borderRadius}
|
|
39
|
+
$fit={fit}
|
|
40
|
+
$fallbackBackground={imgFallback?.background ?? "primary"}
|
|
41
|
+
$fallbackTextColor={imgFallback?.textColor ?? "background"}
|
|
42
|
+
$fallbackFontSize={imgFallback?.fontSize ?? "body"}
|
|
43
|
+
{...rest}
|
|
44
|
+
/>
|
|
45
|
+
</Suspense>
|
|
46
|
+
)
|
|
45
47
|
}
|