@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.
Files changed (39) hide show
  1. package/dist/esm/ob.react.js +1 -17
  2. package/dist/esm/ob.react.min.css.map +1 -1
  3. package/dist/esm/ob.react.min.js +1 -1
  4. package/dist/esm/ob.react.min.js.map +4 -4
  5. package/dist/iife/ob.react.js +1 -14
  6. package/dist/iife/ob.react.min.css.map +1 -1
  7. package/dist/iife/ob.react.min.js +1 -1
  8. package/dist/iife/ob.react.min.js.map +4 -4
  9. package/dist/styles/styles.css.map +1 -1
  10. package/es/DateNavigator/index.js +2 -2
  11. package/es/Portal/index.js +1 -1
  12. package/es/index.d.ts +0 -1
  13. package/es/index.js +0 -1
  14. package/package.json +3 -4
  15. package/src/Checkbox/index.scss +78 -78
  16. package/src/Checkbox/index.tsx +62 -62
  17. package/src/ColorCard/index.scss +135 -135
  18. package/src/ColorCard/index.tsx +38 -38
  19. package/src/DateNavigator/index.scss +33 -33
  20. package/src/DateNavigator/index.tsx +66 -66
  21. package/src/LinkedCardList/index.scss +49 -49
  22. package/src/LinkedCardList/index.tsx +24 -24
  23. package/src/PageBanner/index.scss +71 -71
  24. package/src/PageBanner/index.tsx +41 -41
  25. package/src/Portal/index.tsx +24 -24
  26. package/src/ProgressBar/index.scss +76 -76
  27. package/src/ProgressBar/index.tsx +3 -3
  28. package/src/Sidebar/index.scss +41 -41
  29. package/src/Sidebar/index.tsx +107 -107
  30. package/src/Spinner/index.scss +45 -45
  31. package/src/Spinner/index.tsx +11 -11
  32. package/src/SplitContainer/index.scss +23 -23
  33. package/src/SplitContainer/index.tsx +222 -222
  34. package/src/ValueToggle/index.scss +37 -37
  35. package/src/ValueToggle/index.tsx +54 -54
  36. package/src/global.d.ts +1 -1
  37. package/src/index.ts +10 -11
  38. package/src/styles/_mixins.scss +16 -16
  39. 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
- list-style-type: none;
8
- margin-left: 0;
9
- padding-left: 0;
7
+ list-style-type: none;
8
+ margin-left: 0;
9
+ padding-left: 0;
10
10
  }
11
11
 
12
12
  .ObLinkedList-item {
13
- display: flex;
14
- align-items: center;
15
- flex-direction: row;
13
+ display: flex;
14
+ align-items: center;
15
+ flex-direction: row;
16
16
  }
17
17
 
18
18
  .ObLinkedList-leftColumn {
19
- flex: 1 1 4em;
20
- font-size: 0.75em;
21
- padding: 0 1em;
22
- text-align: center;
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
- flex: 1 1 100%;
27
- padding: 1em 1em 1em 1.5em;
26
+ flex: 1 1 100%;
27
+ padding: 1em 1em 1em 1.5em;
28
28
  }
29
29
 
30
30
  .ObLinkedList-line {
31
- display: flex;
32
- align-self: stretch;
33
- flex: 0 0 $line-width;
34
- background: white;
35
- position: relative;
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
- background: white;
39
+ background: white;
40
40
 
41
- border: 1px solid rgba(50, 50, 50, 0.25);
42
- border-radius: 0.55em;
43
- height: $bullet-size;
44
- width: $bullet-size;
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
- position: absolute;
47
- left: 0;
48
- top: 50%;
46
+ position: absolute;
47
+ left: 0;
48
+ top: 50%;
49
49
 
50
- transform: translate(calc(-1 * ($bullet-size / 2) + ($line-width / 2)), -50%);
50
+ transform: translate(calc(-1 * ($bullet-size / 2) + ($line-width / 2)), -50%);
51
51
  }
52
52
 
53
53
  .ObLinkedList-card {
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;
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
- 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;
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
- background-color: $block-color-bg-hover !important;
80
- color: inherit;
81
- text-decoration: inherit;
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
- border-right-color: $block-color-bg-hover !important;
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
- return (
7
- <ul className={clsx("ObLinkedList-root", className)} {...other}>
8
- {children}
9
- </ul>
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
- children,
15
- className,
16
- label,
17
- ...other
14
+ children,
15
+ className,
16
+ label,
17
+ ...other
18
18
  }: React.HTMLProps<HTMLLIElement> & { label: React.ReactNode }) {
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
- );
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
- const Component = as || "div";
31
+ const Component = as || "div";
32
32
 
33
- return (
34
- <Component className={clsx("ObLinkedList-card", className)} {...other}>
35
- {children}
36
- </Component>
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
- 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
- }
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
- 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
- }
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
- font-size: 2rem;
26
+ font-size: 2rem;
27
27
 
28
- @media screen and (min-width: $screen-lg) {
29
- font-size: 3rem;
30
- }
28
+ @media screen and (min-width: $screen-lg) {
29
+ font-size: 3rem;
30
+ }
31
31
  }
32
32
 
33
33
  .ObPageBanner-bannerImage {
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
- }
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
- margin-bottom: 1rem;
60
- margin-top: 1rem;
61
- font-size: 2rem;
59
+ margin-bottom: 1rem;
60
+ margin-top: 1rem;
61
+ font-size: 2rem;
62
62
 
63
- @media screen and (min-width: $screen-md) {
64
- margin-top: 0;
65
- }
63
+ @media screen and (min-width: $screen-md) {
64
+ margin-top: 0;
65
+ }
66
66
 
67
- @media screen and (min-width: $screen-lg) {
68
- font-size: 3rem;
69
- }
67
+ @media screen and (min-width: $screen-lg) {
68
+ font-size: 3rem;
69
+ }
70
70
  }
71
71
 
72
72
  .ObPageBanner-tabList {
73
- &.sticky {
74
- position: -webkit-sticky;
75
- position: sticky;
76
- top: 0;
77
- z-index: 1000;
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
- overflow-x: auto;
83
- scrollbar-width: thin;
84
- white-space: nowrap;
82
+ overflow-x: auto;
83
+ scrollbar-width: thin;
84
+ white-space: nowrap;
85
85
  }
86
86
 
87
87
  .ObPageBanner-tab {
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
- }
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
  }
@@ -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
- as?: "header" | "section" | "div";
7
+ as?: "header" | "section" | "div";
8
8
  };
9
9
 
10
10
  export function PageBanner({ as, className, children, ...other }: PageBannerProps) {
11
- const Component = as ? as : "section";
11
+ const Component = as ? as : "section";
12
12
 
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
- );
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
- props: BannerImageProps,
26
- ref
25
+ props: BannerImageProps,
26
+ ref
27
27
  ) {
28
- const { className, ...other } = props;
29
- return <img ref={ref} className={clsx("ObPageBanner-bannerImage", className)} {...other} />;
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
- as?: "ul" | "ol" | "nav" | "div" | "span";
34
- sticky?: boolean;
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
- const Component = as ? as : "nav";
38
+ const Component = as ? as : "nav";
39
39
 
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
- );
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
- active?: boolean;
54
- as?: "a" | "li" | "div" | "span";
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
- const Component = as ? as : "a";
58
+ const Component = as ? as : "a";
59
59
 
60
- return (
61
- <Component className={clsx("ObPageBanner-tab", active && "active", className)} {...other}>
62
- {children}
63
- </Component>
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
- as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span" | "p";
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
- const Component = as ? as : "h1";
72
+ const Component = as ? as : "h1";
73
73
 
74
- return (
75
- <Component className={clsx("ObPageBanner-bannerTitle", className)} {...other}>
76
- {children}
77
- </Component>
78
- );
74
+ return (
75
+ <Component className={clsx("ObPageBanner-bannerTitle", className)} {...other}>
76
+ {children}
77
+ </Component>
78
+ );
79
79
  }
@@ -2,35 +2,35 @@ import { useEffect, useRef, useState } from "react";
2
2
  import { createPortal } from "react-dom";
3
3
 
4
4
  function useForceUpdate() {
5
- const [, setVal] = useState(false);
5
+ const [, setVal] = useState(false);
6
6
 
7
- return () => setVal(val => !val);
7
+ return () => setVal((val) => !val);
8
8
  }
9
9
 
10
10
  export function Portal({ children, root, type = "div" }) {
11
- const forceUpdate = useForceUpdate();
12
- const mountNode = useRef<HTMLDivElement>(null);
13
- const portalNode = useRef<HTMLElement>(null);
11
+ const forceUpdate = useForceUpdate();
12
+ const mountNode = useRef<HTMLDivElement>(null);
13
+ const portalNode = useRef<HTMLElement>(null);
14
14
 
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();
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
- return () => {
26
- parent.removeChild(node);
27
- };
28
- }
29
- }, []);
25
+ return () => {
26
+ parent.removeChild(node);
27
+ };
28
+ }
29
+ }, []);
30
30
 
31
- if (!portalNode.current) {
32
- return <div ref={mountNode} />;
33
- } else {
34
- return createPortal(children, portalNode.current);
35
- }
31
+ if (!portalNode.current) {
32
+ return <div ref={mountNode} />;
33
+ } else {
34
+ return createPortal(children, portalNode.current);
35
+ }
36
36
  }