@olenbetong/synergi-react 0.6.46 → 0.7.1
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/esm/ob.react.js +1 -17
- package/dist/esm/ob.react.min.css.map +1 -1
- package/dist/esm/ob.react.min.js +1 -1
- package/dist/esm/ob.react.min.js.map +4 -4
- package/dist/iife/ob.react.js +1 -14
- package/dist/iife/ob.react.min.css.map +1 -1
- package/dist/iife/ob.react.min.js +1 -1
- package/dist/iife/ob.react.min.js.map +4 -4
- package/dist/styles/styles.css.map +1 -1
- package/es/DateNavigator/index.js +2 -2
- package/es/Portal/index.js +1 -1
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/package.json +3 -4
- package/src/Checkbox/index.scss +78 -78
- package/src/Checkbox/index.tsx +62 -62
- package/src/ColorCard/index.scss +135 -135
- package/src/ColorCard/index.tsx +38 -38
- package/src/DateNavigator/index.scss +33 -33
- package/src/DateNavigator/index.tsx +66 -66
- package/src/LinkedCardList/index.scss +49 -49
- package/src/LinkedCardList/index.tsx +24 -24
- package/src/PageBanner/index.scss +71 -71
- package/src/PageBanner/index.tsx +41 -41
- package/src/Portal/index.tsx +24 -24
- package/src/ProgressBar/index.scss +76 -76
- package/src/ProgressBar/index.tsx +3 -3
- package/src/Sidebar/index.scss +41 -41
- package/src/Sidebar/index.tsx +107 -107
- package/src/Spinner/index.scss +45 -45
- package/src/Spinner/index.tsx +11 -11
- package/src/SplitContainer/index.scss +23 -23
- package/src/SplitContainer/index.tsx +222 -222
- package/src/ValueToggle/index.scss +37 -37
- package/src/ValueToggle/index.tsx +54 -54
- package/src/global.d.ts +1 -1
- package/src/index.ts +10 -11
- package/src/styles/_mixins.scss +16 -16
- package/src/useTranslation/index.ts +58 -58
|
@@ -4,83 +4,83 @@ $bullet-size: 0.7em;
|
|
|
4
4
|
$line-width: 0.2em;
|
|
5
5
|
|
|
6
6
|
.ObLinkedList-root {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
list-style-type: none;
|
|
8
|
+
margin-left: 0;
|
|
9
|
+
padding-left: 0;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.ObLinkedList-item {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
flex-direction: row;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.ObLinkedList-leftColumn {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
flex: 1 1 4em;
|
|
20
|
+
font-size: 0.75em;
|
|
21
|
+
padding: 0 1em;
|
|
22
|
+
text-align: center;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.ObLinkedList-rightColumn {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
flex: 1 1 100%;
|
|
27
|
+
padding: 1em 1em 1em 1.5em;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.ObLinkedList-line {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
display: flex;
|
|
32
|
+
align-self: stretch;
|
|
33
|
+
flex: 0 0 $line-width;
|
|
34
|
+
background: white;
|
|
35
|
+
position: relative;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.ObLinkedList-bullet {
|
|
39
|
-
|
|
39
|
+
background: white;
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
border: 1px solid rgba(50, 50, 50, 0.25);
|
|
42
|
+
border-radius: 0.55em;
|
|
43
|
+
height: $bullet-size;
|
|
44
|
+
width: $bullet-size;
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
position: absolute;
|
|
47
|
+
left: 0;
|
|
48
|
+
top: 50%;
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
transform: translate(calc(-1 * ($bullet-size / 2) + ($line-width / 2)), -50%);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.ObLinkedList-card {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
background: white;
|
|
55
|
+
border: 1px solid;
|
|
56
|
+
border-color: $color-border-top $color-border-side $color-border-bottom;
|
|
57
|
+
border-radius: 0.1875em;
|
|
58
|
+
color: inherit;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
flex: 100% 1 1;
|
|
61
|
+
position: relative;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.ObLinkedList-card::before {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
border-bottom: 0.5em solid transparent;
|
|
66
|
+
border-right: 1em solid white;
|
|
67
|
+
border-top: 0.5em solid transparent;
|
|
68
|
+
content: " ";
|
|
69
|
+
filter: drop-shadow(-1px 0px 1px rgba(50, 50, 50, 0.2));
|
|
70
|
+
height: 1em;
|
|
71
|
+
left: -1em;
|
|
72
|
+
margin-top: -0.5em;
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: 50%;
|
|
75
|
+
width: 1em;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.ObLinkedList-card:hover {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
background-color: $block-color-bg-hover !important;
|
|
80
|
+
color: inherit;
|
|
81
|
+
text-decoration: inherit;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.ObLinkedList-card:hover::before {
|
|
85
|
-
|
|
85
|
+
border-right-color: $block-color-bg-hover !important;
|
|
86
86
|
}
|
|
@@ -3,36 +3,36 @@ import "./index.scss";
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
|
|
5
5
|
export function List({ children, className, ...other }: React.HTMLProps<HTMLUListElement>) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
return (
|
|
7
|
+
<ul className={clsx("ObLinkedList-root", className)} {...other}>
|
|
8
|
+
{children}
|
|
9
|
+
</ul>
|
|
10
|
+
);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function ListItem({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
label,
|
|
17
|
+
...other
|
|
18
18
|
}: React.HTMLProps<HTMLLIElement> & { label: React.ReactNode }) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
return (
|
|
20
|
+
<li className={clsx("ObLinkedList-item", className)} {...other}>
|
|
21
|
+
{label && <div className="ObLinkedList-leftColumn">{label}</div>}
|
|
22
|
+
<div className="ObLinkedList-line">
|
|
23
|
+
<div className="ObLinkedList-bullet" />
|
|
24
|
+
</div>
|
|
25
|
+
<div className="ObLinkedList-rightColumn">{children}</div>
|
|
26
|
+
</li>
|
|
27
|
+
);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export function Card({ as, children, className, ...other }: React.HTMLProps<HTMLDivElement> & { as?: any }) {
|
|
31
|
-
|
|
31
|
+
const Component = as || "div";
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
return (
|
|
34
|
+
<Component className={clsx("ObLinkedList-card", className)} {...other}>
|
|
35
|
+
{children}
|
|
36
|
+
</Component>
|
|
37
|
+
);
|
|
38
38
|
}
|
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
@import "../styles/variables";
|
|
2
2
|
|
|
3
3
|
.ObPageBanner-root {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
background-color: $brand-primary;
|
|
5
|
+
background-color: var(--brand-dark);
|
|
6
|
+
box-shadow: 0px 8px 8px rgba(0, 0, 0, 0.2);
|
|
7
|
+
color: white;
|
|
8
|
+
|
|
9
|
+
a {
|
|
10
|
+
color: hsl(200, 50%, 80%);
|
|
11
|
+
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.ObPageBanner-inner {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
|
|
19
|
+
@media screen and (min-width: $screen-md) {
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.ObPageBanner-plantTitle {
|
|
26
|
-
|
|
26
|
+
font-size: 2rem;
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
@media screen and (min-width: $screen-lg) {
|
|
29
|
+
font-size: 3rem;
|
|
30
|
+
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.ObPageBanner-bannerImage {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
align-self: stretch;
|
|
35
|
+
background-color: #ddd;
|
|
36
|
+
display: inline-block;
|
|
37
|
+
height: 20vh;
|
|
38
|
+
object-fit: cover;
|
|
39
|
+
object-position: center center;
|
|
40
|
+
width: 100%;
|
|
41
|
+
|
|
42
|
+
@media screen and (min-width: $screen-sm) {
|
|
43
|
+
align-self: center;
|
|
44
|
+
margin: 0;
|
|
45
|
+
margin-right: 1rem;
|
|
46
|
+
border: 0.4rem solid white;
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
height: 150px;
|
|
49
|
+
width: 150px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media screen and (min-width: $screen-lg) {
|
|
53
|
+
height: 250px;
|
|
54
|
+
width: 250px;
|
|
55
|
+
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.ObPageBanner-bannerTitle {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
margin-bottom: 1rem;
|
|
60
|
+
margin-top: 1rem;
|
|
61
|
+
font-size: 2rem;
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
@media screen and (min-width: $screen-md) {
|
|
64
|
+
margin-top: 0;
|
|
65
|
+
}
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
@media screen and (min-width: $screen-lg) {
|
|
68
|
+
font-size: 3rem;
|
|
69
|
+
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.ObPageBanner-tabList {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
&.sticky {
|
|
74
|
+
position: -webkit-sticky;
|
|
75
|
+
position: sticky;
|
|
76
|
+
top: 0;
|
|
77
|
+
z-index: 1000;
|
|
78
|
+
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.ObPageBanner-tabListInner {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
overflow-x: auto;
|
|
83
|
+
scrollbar-width: thin;
|
|
84
|
+
white-space: nowrap;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
.ObPageBanner-tab {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
border-bottom: 0.25rem solid transparent;
|
|
89
|
+
display: inline-block;
|
|
90
|
+
margin-top: 0.5rem;
|
|
91
|
+
min-width: 8rem;
|
|
92
|
+
padding: 0.5rem 1rem;
|
|
93
|
+
text-align: center;
|
|
94
|
+
text-transform: capitalize;
|
|
95
|
+
|
|
96
|
+
&.active {
|
|
97
|
+
border-color: white;
|
|
98
|
+
}
|
|
99
99
|
}
|
package/src/PageBanner/index.tsx
CHANGED
|
@@ -4,76 +4,76 @@ import clsx from "clsx";
|
|
|
4
4
|
import React from "react";
|
|
5
5
|
|
|
6
6
|
export type PageBannerProps = React.HTMLProps<HTMLDivElement> & {
|
|
7
|
-
|
|
7
|
+
as?: "header" | "section" | "div";
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export function PageBanner({ as, className, children, ...other }: PageBannerProps) {
|
|
11
|
-
|
|
11
|
+
const Component = as ? as : "section";
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
return (
|
|
14
|
+
<Component className={clsx("ObPageBanner-root", className)} {...other}>
|
|
15
|
+
<div className="container px-0">
|
|
16
|
+
<div className={"ObPageBanner-pageBannerInner"}>{children}</div>
|
|
17
|
+
</div>
|
|
18
|
+
</Component>
|
|
19
|
+
);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export type BannerImageProps = React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
|
|
23
23
|
|
|
24
24
|
export const BannerImage = React.forwardRef<HTMLImageElement, BannerImageProps>(function BannerImage(
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
props: BannerImageProps,
|
|
26
|
+
ref
|
|
27
27
|
) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const { className, ...other } = props;
|
|
29
|
+
return <img ref={ref} className={clsx("ObPageBanner-bannerImage", className)} {...other} />;
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
export type TabListProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> & {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
as?: "ul" | "ol" | "nav" | "div" | "span";
|
|
34
|
+
sticky?: boolean;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export function TabList({ as, className, children, sticky, ...other }: TabListProps) {
|
|
38
|
-
|
|
38
|
+
const Component = as ? as : "nav";
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
return (
|
|
41
|
+
<Component
|
|
42
|
+
className={clsx("ObPageBanner-pageBanner", "ObPageBanner-tabList", sticky && "sticky", className)}
|
|
43
|
+
{...other}
|
|
44
|
+
>
|
|
45
|
+
<div className="container px-0">
|
|
46
|
+
<div className={"ObPageBanner-tabListInner"}>{children}</div>
|
|
47
|
+
</div>
|
|
48
|
+
</Component>
|
|
49
|
+
);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export type TabProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> & {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
active?: boolean;
|
|
54
|
+
as?: "a" | "li" | "div" | "span";
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
export function Tab({ active, as, className, children, ...other }: TabProps) {
|
|
58
|
-
|
|
58
|
+
const Component = as ? as : "a";
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
return (
|
|
61
|
+
<Component className={clsx("ObPageBanner-tab", active && "active", className)} {...other}>
|
|
62
|
+
{children}
|
|
63
|
+
</Component>
|
|
64
|
+
);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export type TitleProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> & {
|
|
68
|
-
|
|
68
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span" | "p";
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
export function Title({ as, className, children, ...other }) {
|
|
72
|
-
|
|
72
|
+
const Component = as ? as : "h1";
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
return (
|
|
75
|
+
<Component className={clsx("ObPageBanner-bannerTitle", className)} {...other}>
|
|
76
|
+
{children}
|
|
77
|
+
</Component>
|
|
78
|
+
);
|
|
79
79
|
}
|
package/src/Portal/index.tsx
CHANGED
|
@@ -2,35 +2,35 @@ import { useEffect, useRef, useState } from "react";
|
|
|
2
2
|
import { createPortal } from "react-dom";
|
|
3
3
|
|
|
4
4
|
function useForceUpdate() {
|
|
5
|
-
|
|
5
|
+
const [, setVal] = useState(false);
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
return () => setVal((val) => !val);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function Portal({ children, root, type = "div" }) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const forceUpdate = useForceUpdate();
|
|
12
|
+
const mountNode = useRef<HTMLDivElement>(null);
|
|
13
|
+
const portalNode = useRef<HTMLElement>(null);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const ownerDocument = mountNode.current?.ownerDocument;
|
|
17
|
+
let portalElem = portalNode.current;
|
|
18
|
+
if (ownerDocument && portalElem) {
|
|
19
|
+
let parent = root ? ownerDocument.querySelector(root) || ownerDocument.body : ownerDocument.body;
|
|
20
|
+
const node = ownerDocument.createElement(type);
|
|
21
|
+
portalElem = node;
|
|
22
|
+
parent.appendChild(node);
|
|
23
|
+
forceUpdate();
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
return () => {
|
|
26
|
+
parent.removeChild(node);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}, []);
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
if (!portalNode.current) {
|
|
32
|
+
return <div ref={mountNode} />;
|
|
33
|
+
} else {
|
|
34
|
+
return createPortal(children, portalNode.current);
|
|
35
|
+
}
|
|
36
36
|
}
|