@olenbetong/synergi-react 0.6.46 → 0.7.0

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
@@ -1,86 +1,86 @@
1
1
  @import "../styles/variables";
2
2
 
3
3
  .ObProgressBar-root {
4
- height: 1.5em;
5
- width: 100%;
6
- appearance: none;
7
- -webkit-appearance: none;
8
- background-color: whiteSmoke;
9
- border: none;
10
- border-radius: 3px;
11
- box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
12
- color: royalblue;
13
- position: relative;
4
+ height: 1.5em;
5
+ width: 100%;
6
+ appearance: none;
7
+ -webkit-appearance: none;
8
+ background-color: whiteSmoke;
9
+ border: none;
10
+ border-radius: 3px;
11
+ box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
12
+ color: royalblue;
13
+ position: relative;
14
14
 
15
- &::-webkit-progress-bar {
16
- background-color: whiteSmoke;
17
- border-radius: 3px;
18
- box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
19
- }
15
+ &::-webkit-progress-bar {
16
+ background-color: whiteSmoke;
17
+ border-radius: 3px;
18
+ box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
19
+ }
20
20
 
21
- &::-webkit-progress-value {
22
- background-image: linear-gradient(
23
- 135deg,
24
- transparent,
25
- transparent 33%,
26
- rgba(0, 0, 0, 0.1) 33%,
27
- rgba(0, 0, 0, 0.1) 66%,
28
- transparent 66%
29
- ),
30
- linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
31
- linear-gradient(left, var(--brand-primary, $brand-primary), var(--brand-light, $brand-light));
32
- background-image: -webkit-linear-gradient(
33
- 135deg,
34
- transparent,
35
- transparent 33%,
36
- rgba(0, 0, 0, 0.1) 33%,
37
- rgba(0, 0, 0, 0.1) 66%,
38
- transparent 66%
39
- ),
40
- -webkit-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
41
- -webkit-linear-gradient(left, var(--brand-primary), $brand-primary, var(--brand-light, $brand-light));
42
- background-size: 35px 20px, 100% 100%, 100% 100%;
43
- border-radius: 3px;
44
- position: relative;
45
- transition: width 0.5s ease-out;
46
- }
21
+ &::-webkit-progress-value {
22
+ background-image: linear-gradient(
23
+ 135deg,
24
+ transparent,
25
+ transparent 33%,
26
+ rgba(0, 0, 0, 0.1) 33%,
27
+ rgba(0, 0, 0, 0.1) 66%,
28
+ transparent 66%
29
+ ),
30
+ linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
31
+ linear-gradient(left, var(--brand-primary, $brand-primary), var(--brand-light, $brand-light));
32
+ background-image: -webkit-linear-gradient(
33
+ 135deg,
34
+ transparent,
35
+ transparent 33%,
36
+ rgba(0, 0, 0, 0.1) 33%,
37
+ rgba(0, 0, 0, 0.1) 66%,
38
+ transparent 66%
39
+ ),
40
+ -webkit-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
41
+ -webkit-linear-gradient(left, var(--brand-primary), $brand-primary, var(--brand-light, $brand-light));
42
+ background-size: 35px 20px, 100% 100%, 100% 100%;
43
+ border-radius: 3px;
44
+ position: relative;
45
+ transition: width 0.5s ease-out;
46
+ }
47
47
 
48
- &::-webkit-progress-value:after {
49
- background-color: white;
50
- content: "";
48
+ &::-webkit-progress-value:after {
49
+ background-color: white;
50
+ content: "";
51
51
 
52
- border-radius: 100%;
53
- height: 5px;
52
+ border-radius: 100%;
53
+ height: 5px;
54
54
 
55
- position: absolute;
56
- right: 7px;
57
- top: 7px;
58
- width: 5px;
59
- }
55
+ position: absolute;
56
+ right: 7px;
57
+ top: 7px;
58
+ width: 5px;
59
+ }
60
60
 
61
- &::-moz-progress-bar {
62
- background-image: linear-gradient(
63
- 135deg,
64
- transparent,
65
- transparent 33%,
66
- rgba(0, 0, 0, 0.1) 33%,
67
- rgba(0, 0, 0, 0.1) 66%,
68
- transparent 66%
69
- ),
70
- linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
71
- linear-gradient(left, var(--brand-primary), var(--brand-light));
72
- background-image: -moz-linear-gradient(
73
- 135deg,
74
- transparent,
75
- transparent 33%,
76
- rgba(0, 0, 0, 0.1) 33%,
77
- rgba(0, 0, 0, 0.1) 66%,
78
- transparent 66%
79
- ),
80
- -moz-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
81
- -moz-linear-gradient(left, var(--brand-primary), var(--brand-light));
82
- background-size: 35px 20px, 100% 100%, 100% 100%;
83
- border-radius: 3px;
84
- transition: width 0.5s ease-out;
85
- }
61
+ &::-moz-progress-bar {
62
+ background-image: linear-gradient(
63
+ 135deg,
64
+ transparent,
65
+ transparent 33%,
66
+ rgba(0, 0, 0, 0.1) 33%,
67
+ rgba(0, 0, 0, 0.1) 66%,
68
+ transparent 66%
69
+ ),
70
+ linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
71
+ linear-gradient(left, var(--brand-primary), var(--brand-light));
72
+ background-image: -moz-linear-gradient(
73
+ 135deg,
74
+ transparent,
75
+ transparent 33%,
76
+ rgba(0, 0, 0, 0.1) 33%,
77
+ rgba(0, 0, 0, 0.1) 66%,
78
+ transparent 66%
79
+ ),
80
+ -moz-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
81
+ -moz-linear-gradient(left, var(--brand-primary), var(--brand-light));
82
+ background-size: 35px 20px, 100% 100%, 100% 100%;
83
+ border-radius: 3px;
84
+ transition: width 0.5s ease-out;
85
+ }
86
86
  }
@@ -6,8 +6,8 @@ import { forwardRef } from "react";
6
6
  export type ProgressBarProps = React.HTMLProps<HTMLProgressElement>;
7
7
 
8
8
  export const ProgressBar = forwardRef<HTMLProgressElement, ProgressBarProps>(function ProgressBar(
9
- { className, ...props }: ProgressBarProps,
10
- ref
9
+ { className, ...props }: ProgressBarProps,
10
+ ref
11
11
  ) {
12
- return <progress className={clsx("ObProgressBar-root", className)} {...props} ref={ref} />;
12
+ return <progress className={clsx("ObProgressBar-root", className)} {...props} ref={ref} />;
13
13
  });
@@ -1,53 +1,53 @@
1
1
  .ObSidebar-root {
2
- position: fixed;
3
- bottom: 0;
4
- left: 0;
5
- top: 0;
6
- z-index: 2;
2
+ position: fixed;
3
+ bottom: 0;
4
+ left: 0;
5
+ top: 0;
6
+ z-index: 2;
7
7
 
8
- background-color: white;
8
+ background-color: white;
9
9
 
10
- transform: translateX(-100%);
11
- transition: transform 0.2s ease-out;
12
- will-change: transform;
10
+ transform: translateX(-100%);
11
+ transition: transform 0.2s ease-out;
12
+ will-change: transform;
13
13
 
14
- &.Ob-right {
15
- left: unset;
16
- right: 0;
17
- transform: translateX(100%);
18
- }
14
+ &.Ob-right {
15
+ left: unset;
16
+ right: 0;
17
+ transform: translateX(100%);
18
+ }
19
19
 
20
- overflow-y: auto;
20
+ overflow-y: auto;
21
21
 
22
- &.Ob-open {
23
- transform: translateX(0);
24
- }
22
+ &.Ob-open {
23
+ transform: translateX(0);
24
+ }
25
25
 
26
- &.ObSidebar-shadow {
27
- box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
26
+ &.ObSidebar-shadow {
27
+ box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
28
28
 
29
- &.Ob-right {
30
- box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.15);
31
- }
32
- }
29
+ &.Ob-right {
30
+ box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.15);
31
+ }
32
+ }
33
33
  }
34
34
 
35
35
  .ObSidebar-overlay {
36
- position: fixed;
37
- bottom: 0;
38
- left: 0;
39
- right: 0;
40
- top: 0;
41
- z-index: 1;
42
-
43
- opacity: 0;
44
- visibility: hidden;
45
-
46
- transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
47
- background-color: rgba(0, 0, 0, 0.3);
48
-
49
- &.Ob-open {
50
- opacity: 1;
51
- visibility: visible;
52
- }
36
+ position: fixed;
37
+ bottom: 0;
38
+ left: 0;
39
+ right: 0;
40
+ top: 0;
41
+ z-index: 1;
42
+
43
+ opacity: 0;
44
+ visibility: hidden;
45
+
46
+ transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
47
+ background-color: rgba(0, 0, 0, 0.3);
48
+
49
+ &.Ob-open {
50
+ opacity: 1;
51
+ visibility: visible;
52
+ }
53
53
  }
@@ -4,114 +4,114 @@ import clsx from "clsx";
4
4
  import { useEffect, useRef, useState } from "react";
5
5
 
6
6
  export type SidebarProps = React.HTMLProps<HTMLDivElement> & {
7
- open?: boolean;
8
- onClose?: () => void;
9
- overlayProps: React.HTMLProps<HTMLDivElement>;
10
- pullRight?: boolean;
11
- shadow?: boolean;
7
+ open?: boolean;
8
+ onClose?: () => void;
9
+ overlayProps: React.HTMLProps<HTMLDivElement>;
10
+ pullRight?: boolean;
11
+ shadow?: boolean;
12
12
  };
13
13
 
14
14
  export function Sidebar(props: SidebarProps) {
15
- const {
16
- children,
17
- className,
18
- open = false,
19
- onClose = () => {},
20
- overlayProps = {},
21
- pullRight = false,
22
- shadow = true,
23
- ...other
24
- } = props;
25
-
26
- const [hidden, setHidden] = useState(!open);
27
- const sidebar = useRef<HTMLDivElement>(null);
28
- const prevFocus = useRef<HTMLElement | null>(null);
29
-
30
- function closeSidebar() {
31
- if (open && typeof onClose === "function") {
32
- onClose();
33
- }
34
- }
35
-
36
- useEffect(() => {
37
- let element = sidebar.current;
38
-
39
- if (open) {
40
- setHidden(false);
41
- }
42
-
43
- function toggleHiddenContent() {
44
- setHidden(!open);
45
- }
46
-
47
- element?.addEventListener("transitionend", toggleHiddenContent);
48
-
49
- return () => element?.removeEventListener("transitionend", toggleHiddenContent);
50
- }, [open]);
51
-
52
- useEffect(() => {
53
- function handleCloseSidebar(evt) {
54
- if (evt.key === "Escape") {
55
- evt.stopPropagation();
56
- closeSidebar();
57
- }
58
- }
59
-
60
- window.addEventListener("keyup", handleCloseSidebar);
61
-
62
- return () => window.removeEventListener("keyup", handleCloseSidebar);
63
- }, [open, onClose]);
64
-
65
- useEffect(() => {
66
- if (open) {
67
- prevFocus.current = document.activeElement as HTMLElement | null;
68
-
69
- const firstFocusable = sidebar.current?.querySelector(
70
- 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
71
- ) as HTMLElement | undefined;
72
-
73
- if (firstFocusable) {
74
- firstFocusable.focus();
75
- }
76
- } else if (prevFocus.current) {
77
- prevFocus.current.focus();
78
- prevFocus.current = null;
79
- }
80
-
81
- let prevFocusElem = prevFocus.current;
82
-
83
- return () => {
84
- if (open && prevFocusElem) {
85
- prevFocusElem.focus();
86
- }
87
- };
88
- }, [open]);
89
-
90
- const { className: overlayClassName, ...overlayOther } = overlayProps;
91
-
92
- return (
93
- <>
94
- <div
95
- className={clsx(
96
- "ObSidebar-root",
97
- open && "Ob-open",
98
- pullRight && "Ob-right",
99
- shadow && "ObSidebar-shadow",
100
- className
101
- )}
102
- ref={sidebar}
103
- tabIndex={-1}
104
- {...other}
105
- >
106
- {(open || !hidden) && children}
107
- </div>
108
- <div
109
- role="presentation"
110
- tabIndex={-1}
111
- className={clsx("ObSidebar-overlay", open && "Ob-open", overlayClassName)}
112
- onClick={closeSidebar}
113
- {...overlayOther}
114
- />
115
- </>
116
- );
15
+ const {
16
+ children,
17
+ className,
18
+ open = false,
19
+ onClose = () => {},
20
+ overlayProps = {},
21
+ pullRight = false,
22
+ shadow = true,
23
+ ...other
24
+ } = props;
25
+
26
+ const [hidden, setHidden] = useState(!open);
27
+ const sidebar = useRef<HTMLDivElement>(null);
28
+ const prevFocus = useRef<HTMLElement | null>(null);
29
+
30
+ function closeSidebar() {
31
+ if (open && typeof onClose === "function") {
32
+ onClose();
33
+ }
34
+ }
35
+
36
+ useEffect(() => {
37
+ let element = sidebar.current;
38
+
39
+ if (open) {
40
+ setHidden(false);
41
+ }
42
+
43
+ function toggleHiddenContent() {
44
+ setHidden(!open);
45
+ }
46
+
47
+ element?.addEventListener("transitionend", toggleHiddenContent);
48
+
49
+ return () => element?.removeEventListener("transitionend", toggleHiddenContent);
50
+ }, [open]);
51
+
52
+ useEffect(() => {
53
+ function handleCloseSidebar(evt) {
54
+ if (evt.key === "Escape") {
55
+ evt.stopPropagation();
56
+ closeSidebar();
57
+ }
58
+ }
59
+
60
+ window.addEventListener("keyup", handleCloseSidebar);
61
+
62
+ return () => window.removeEventListener("keyup", handleCloseSidebar);
63
+ }, [open, onClose]);
64
+
65
+ useEffect(() => {
66
+ if (open) {
67
+ prevFocus.current = document.activeElement as HTMLElement | null;
68
+
69
+ const firstFocusable = sidebar.current?.querySelector(
70
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
71
+ ) as HTMLElement | undefined;
72
+
73
+ if (firstFocusable) {
74
+ firstFocusable.focus();
75
+ }
76
+ } else if (prevFocus.current) {
77
+ prevFocus.current.focus();
78
+ prevFocus.current = null;
79
+ }
80
+
81
+ let prevFocusElem = prevFocus.current;
82
+
83
+ return () => {
84
+ if (open && prevFocusElem) {
85
+ prevFocusElem.focus();
86
+ }
87
+ };
88
+ }, [open]);
89
+
90
+ const { className: overlayClassName, ...overlayOther } = overlayProps;
91
+
92
+ return (
93
+ <>
94
+ <div
95
+ className={clsx(
96
+ "ObSidebar-root",
97
+ open && "Ob-open",
98
+ pullRight && "Ob-right",
99
+ shadow && "ObSidebar-shadow",
100
+ className
101
+ )}
102
+ ref={sidebar}
103
+ tabIndex={-1}
104
+ {...other}
105
+ >
106
+ {(open || !hidden) && children}
107
+ </div>
108
+ <div
109
+ role="presentation"
110
+ tabIndex={-1}
111
+ className={clsx("ObSidebar-overlay", open && "Ob-open", overlayClassName)}
112
+ onClick={closeSidebar}
113
+ {...overlayOther}
114
+ />
115
+ </>
116
+ );
117
117
  }
@@ -1,71 +1,71 @@
1
1
  $bullet-size: 0.5em;
2
2
 
3
3
  .ObSpinner-root {
4
- display: inline-block;
4
+ display: inline-block;
5
5
  }
6
6
 
7
7
  .ObSpinner-fullPage {
8
- display: flex;
9
- align-items: center;
10
- justify-content: center;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
11
 
12
- height: 100vh;
13
- width: 100vw;
12
+ height: 100vh;
13
+ width: 100vw;
14
14
  }
15
15
 
16
16
  .ObSpinner-spinner {
17
- display: inline-block;
18
- height: $bullet-size * 1.5;
19
- position: relative;
20
- width: $bullet-size * 5;
17
+ display: inline-block;
18
+ height: $bullet-size * 1.5;
19
+ position: relative;
20
+ width: $bullet-size * 5;
21
21
  }
22
22
 
23
23
  .ObSpinner-bullet {
24
- animation-timing-function: cubic-bezier(0, 1, 1, 0);
25
- background: #666;
26
- border-radius: 50%;
27
- height: $bullet-size;
28
- position: absolute;
29
- top: 0.2rem;
30
- width: $bullet-size;
24
+ animation-timing-function: cubic-bezier(0, 1, 1, 0);
25
+ background: #666;
26
+ border-radius: 50%;
27
+ height: $bullet-size;
28
+ position: absolute;
29
+ top: 0.2rem;
30
+ width: $bullet-size;
31
31
 
32
- &:nth-child(1) {
33
- animation: scaleAnimation 0.6s infinite ease-in-out;
34
- left: $bullet-size * 0.5;
35
- }
32
+ &:nth-child(1) {
33
+ animation: scaleAnimation 0.6s infinite ease-in-out;
34
+ left: $bullet-size * 0.5;
35
+ }
36
36
 
37
- &:nth-child(2) {
38
- animation: translateAnimation 0.6s infinite ease-in-out;
39
- left: $bullet-size * 0.5;
40
- }
37
+ &:nth-child(2) {
38
+ animation: translateAnimation 0.6s infinite ease-in-out;
39
+ left: $bullet-size * 0.5;
40
+ }
41
41
 
42
- &:nth-child(3) {
43
- animation: translateAnimation 0.6s infinite ease-in-out;
44
- left: $bullet-size * 2.4;
45
- }
42
+ &:nth-child(3) {
43
+ animation: translateAnimation 0.6s infinite ease-in-out;
44
+ left: $bullet-size * 2.4;
45
+ }
46
46
 
47
- &:nth-child(4) {
48
- animation: scaleAnimation 0.6s infinite ease-in-out reverse;
49
- left: $bullet-size * 4;
50
- }
47
+ &:nth-child(4) {
48
+ animation: scaleAnimation 0.6s infinite ease-in-out reverse;
49
+ left: $bullet-size * 4;
50
+ }
51
51
  }
52
52
 
53
53
  @keyframes scaleAnimation {
54
- from {
55
- transform: scale(0);
56
- }
54
+ from {
55
+ transform: scale(0);
56
+ }
57
57
 
58
- to {
59
- transform: scale(1);
60
- }
58
+ to {
59
+ transform: scale(1);
60
+ }
61
61
  }
62
62
 
63
63
  @keyframes translateAnimation {
64
- from {
65
- transform: translate(0, 0);
66
- }
64
+ from {
65
+ transform: translate(0, 0);
66
+ }
67
67
 
68
- to {
69
- transform: translate($bullet-size * 1.65, 0);
70
- }
68
+ to {
69
+ transform: translate($bullet-size * 1.65, 0);
70
+ }
71
71
  }
@@ -4,18 +4,18 @@ import clsx from "clsx";
4
4
  import React from "react";
5
5
 
6
6
  export type SpinnerProps = React.HTMLProps<HTMLDivElement> & {
7
- fullPage?: boolean;
7
+ fullPage?: boolean;
8
8
  };
9
9
 
10
10
  export function Spinner({ className = "", fullPage = false, ...rest }) {
11
- return (
12
- <div className={clsx(className, fullPage ? "ObSpinner-fullPage" : "ObSpinner-wrapper")} {...rest}>
13
- <div className={"ObSpinner-spinner"}>
14
- <div className={"ObSpinner-bullet"} />
15
- <div className={"ObSpinner-bullet"} />
16
- <div className={"ObSpinner-bullet"} />
17
- <div className={"ObSpinner-bullet"} />
18
- </div>
19
- </div>
20
- );
11
+ return (
12
+ <div className={clsx(className, fullPage ? "ObSpinner-fullPage" : "ObSpinner-wrapper")} {...rest}>
13
+ <div className={"ObSpinner-spinner"}>
14
+ <div className={"ObSpinner-bullet"} />
15
+ <div className={"ObSpinner-bullet"} />
16
+ <div className={"ObSpinner-bullet"} />
17
+ <div className={"ObSpinner-bullet"} />
18
+ </div>
19
+ </div>
20
+ );
21
21
  }