@onepercentio/one-ui 0.29.4 → 0.29.6
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/components/Portal/Portal.d.ts +5 -0
- package/dist/components/Portal/Portal.js +6 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/utils/e2e.d.ts +1 -1
- package/dist/utils/e2e.js +1 -1
- package/dist-ts/components/Portal/Portal.d.ts +5 -0
- package/dist-ts/components/Portal/Portal.js +5 -0
- package/dist-ts/components/Portal/Portal.js.map +1 -1
- package/dist-ts/components/Switch/Switch.d.ts +1 -1
- package/dist-ts/utils/e2e.d.ts +1 -1
- package/package.json +1 -1
- package/src/assets/img/svg/checkbox.svg +0 -3
- package/src/assets/styles/index.scss +0 -2
- package/src/assets/styles/mixins.scss +0 -12
- package/src/assets/styles/variables.scss +0 -49
- package/src/components/AdaptiveButton/AdaptiveButton.module.scss +0 -7
- package/src/components/AdaptiveButton/AdaptiveButton.tsx +0 -26
- package/src/components/AdaptiveButton/index.tsx +0 -2
- package/src/components/AdaptiveContainer/AdaptiveContainer.module.scss +0 -53
- package/src/components/AdaptiveContainer/AdaptiveContainer.tsx +0 -200
- package/src/components/AdaptiveContainer/index.tsx +0 -2
- package/src/components/AdaptiveDialog/AdaptiveDialog.module.scss +0 -147
- package/src/components/AdaptiveDialog/AdaptiveDialog.tsx +0 -97
- package/src/components/AdaptiveDialog/index.tsx +0 -2
- package/src/components/AdaptiveSidebar/AdaptiveSidebar.module.scss +0 -49
- package/src/components/AdaptiveSidebar/AdaptiveSidebar.sample.tsx +0 -10
- package/src/components/AdaptiveSidebar/AdaptiveSidebar.tsx +0 -123
- package/src/components/AdaptiveSidebar/index.tsx +0 -2
- package/src/components/AnchoredTooltip/AnchoredTooltip.module.scss +0 -64
- package/src/components/AnchoredTooltip/AnchoredTooltip.tsx +0 -250
- package/src/components/AnchoredTooltip/index.tsx +0 -2
- package/src/components/AnimatedEntrance/AnimatedEntrance.module.scss +0 -108
- package/src/components/AnimatedEntrance/AnimatedEntrance.tsx +0 -227
- package/src/components/AnimatedEntrance/index.tsx +0 -2
- package/src/components/AsyncWrapper/AsyncWrapper.tsx +0 -38
- package/src/components/AsyncWrapper/index.tsx +0 -2
- package/src/components/Avatar/Avatar.module.scss +0 -22
- package/src/components/Avatar/Avatar.tsx +0 -31
- package/src/components/Avatar/index.tsx +0 -2
- package/src/components/BucketFill/BucketFill.module.scss +0 -36
- package/src/components/BucketFill/BucketFill.tsx +0 -65
- package/src/components/BucketFill/index.tsx +0 -2
- package/src/components/Button/Button.module.scss +0 -45
- package/src/components/Button/Button.tsx +0 -40
- package/src/components/Button/index.tsx +0 -2
- package/src/components/Card/Card.module.scss +0 -12
- package/src/components/Card/Card.tsx +0 -9
- package/src/components/Card/index.tsx +0 -2
- package/src/components/Chart/Chart.e2e.ts +0 -4
- package/src/components/Chart/Chart.logic.tsx +0 -8
- package/src/components/Chart/Chart.module.scss +0 -58
- package/src/components/Chart/Chart.tsx +0 -2
- package/src/components/Chart/Chart.types.ts +0 -35
- package/src/components/Chart/Chart.view.tsx +0 -241
- package/src/components/Chart/index.tsx +0 -2
- package/src/components/CheckBox/CheckBox.module.scss +0 -36
- package/src/components/CheckBox/CheckBox.tsx +0 -63
- package/src/components/CheckBox/index.tsx +0 -2
- package/src/components/CodeInput/CodeInput.module.scss +0 -5
- package/src/components/CodeInput/CodeInput.tsx +0 -84
- package/src/components/CodeInput/index.tsx +0 -2
- package/src/components/Collapsable/Collapsable.module.scss +0 -42
- package/src/components/Collapsable/Collapsable.tsx +0 -253
- package/src/components/Collapsable/index.tsx +0 -2
- package/src/components/Countdown/Countdown.tsx +0 -130
- package/src/components/Countdown/index.tsx +0 -2
- package/src/components/CurrencyInput/CurrencyInput.hook.ts +0 -37
- package/src/components/CurrencyInput/CurrencyInput.tsx +0 -25
- package/src/components/CurrencyInput/index.tsx +0 -2
- package/src/components/Divider/Divider.module.scss +0 -7
- package/src/components/Divider/Divider.tsx +0 -13
- package/src/components/Divider/index.tsx +0 -2
- package/src/components/EmailInput/EmailInput.module.scss +0 -0
- package/src/components/EmailInput/EmailInput.tsx +0 -51
- package/src/components/EmailInput/index.tsx +0 -2
- package/src/components/FadeIn/FadeIn.module.scss +0 -9
- package/src/components/FadeIn/FadeIn.tsx +0 -77
- package/src/components/FadeIn/index.tsx +0 -2
- package/src/components/FileInput/FileInput.module.scss +0 -6
- package/src/components/FileInput/FileInput.tsx +0 -75
- package/src/components/FileInput/View/BigFactory/BigFactory.module.scss +0 -20
- package/src/components/FileInput/View/BigFactory/BigFactory.tsx +0 -48
- package/src/components/FileInput/View/BigFactory/index.tsx +0 -2
- package/src/components/FileInput/View/Compact/Compact.module.scss +0 -68
- package/src/components/FileInput/View/Compact/Compact.tsx +0 -151
- package/src/components/FileInput/View/Compact/index.tsx +0 -2
- package/src/components/FileInput/View/View.types.ts +0 -12
- package/src/components/FileInput/index.tsx +0 -2
- package/src/components/FlowController/FlowController.module.scss +0 -47
- package/src/components/FlowController/FlowController.tsx +0 -93
- package/src/components/FlowController/index.tsx +0 -2
- package/src/components/Form/Form.tsx +0 -243
- package/src/components/Form/index.ts +0 -2
- package/src/components/Form/v2/Form.hook.ts +0 -341
- package/src/components/Form/v2/Form.module.scss +0 -0
- package/src/components/Form/v2/Form.tsx +0 -78
- package/src/components/Form/v2/Form.types.ts +0 -118
- package/src/components/Form/v2/FormField/Extensions/DateField/DateField.module.scss +0 -0
- package/src/components/Form/v2/FormField/Extensions/DateField/DateField.tsx +0 -73
- package/src/components/Form/v2/FormField/Extensions/DateField/index.tsx +0 -2
- package/src/components/Form/v2/FormField/Extensions/PhoneField/PhoneField.module.scss +0 -0
- package/src/components/Form/v2/FormField/Extensions/PhoneField/PhoneField.tsx +0 -91
- package/src/components/Form/v2/FormField/Extensions/PhoneField/index.tsx +0 -2
- package/src/components/Form/v2/FormField/FormField.module.scss +0 -0
- package/src/components/Form/v2/FormField/FormField.tsx +0 -378
- package/src/components/Form/v2/FormField/FormField.types.ts +0 -129
- package/src/components/Form/v2/FormField/index.tsx +0 -2
- package/src/components/Form/v2/index.tsx +0 -2
- package/src/components/Freeze/Freeze.tsx +0 -9
- package/src/components/Freeze/index.tsx +0 -2
- package/src/components/HSForms/HSForms.tsx +0 -57
- package/src/components/HSForms/index.tsx +0 -2
- package/src/components/Header/Header.module.scss +0 -119
- package/src/components/Header/Header.tsx +0 -138
- package/src/components/Header/index.tsx +0 -2
- package/src/components/HeaderCloseBtn/HeaderCloseBtn.module.scss +0 -44
- package/src/components/HeaderCloseBtn/HeaderCloseBtn.tsx +0 -28
- package/src/components/HeaderCloseBtn/index.tsx +0 -2
- package/src/components/InfinityScroll/InfinityScroll.module.scss +0 -30
- package/src/components/InfinityScroll/InfinityScroll.tsx +0 -187
- package/src/components/InfinityScroll/index.tsx +0 -2
- package/src/components/Input/Input.module.scss +0 -71
- package/src/components/Input/Input.tsx +0 -134
- package/src/components/Input/index.tsx +0 -2
- package/src/components/InstantCounter/InstantCounter.tsx +0 -77
- package/src/components/InstantCounter/index.tsx +0 -2
- package/src/components/LavaLamp/LavaLamp.data.tsx +0 -114
- package/src/components/LavaLamp/LavaLamp.module.scss +0 -26
- package/src/components/LavaLamp/LavaLamp.tsx +0 -131
- package/src/components/LavaLamp/index.tsx +0 -2
- package/src/components/LavaLamp/v2/LavaLamp.module.scss +0 -23
- package/src/components/LavaLamp/v2/LavaLamp.tsx +0 -197
- package/src/components/LinkToId/LinkToId.module.scss +0 -4
- package/src/components/LinkToId/LinkToId.tsx +0 -51
- package/src/components/LinkToId/index.tsx +0 -2
- package/src/components/Loader/Loader.module.scss +0 -40
- package/src/components/Loader/Loader.tsx +0 -18
- package/src/components/Loader/index.tsx +0 -2
- package/src/components/LoaderDotsIndicator/LoaderDotsIndicator.tsx +0 -34
- package/src/components/LoaderDotsIndicator/index.tsx +0 -2
- package/src/components/LoopableVideo/LoopableVideo.tsx +0 -37
- package/src/components/LoopableVideo/index.tsx +0 -2
- package/src/components/MainGrid/MainGrid.module.scss +0 -28
- package/src/components/MainGrid/MainGrid.tsx +0 -68
- package/src/components/MainGrid/index.tsx +0 -2
- package/src/components/MutableHamburgerButton/MutableHamburgerButton.module.scss +0 -220
- package/src/components/MutableHamburgerButton/MutableHamburgerButton.tsx +0 -38
- package/src/components/MutableHamburgerButton/index.tsx +0 -2
- package/src/components/Notification/Notification.module.scss +0 -25
- package/src/components/Notification/Notification.tsx +0 -13
- package/src/components/Notification/index.tsx +0 -2
- package/src/components/OrderableList/OrderableList.module.scss +0 -98
- package/src/components/OrderableList/OrderableList.tsx +0 -564
- package/src/components/OrderableList/index.tsx +0 -2
- package/src/components/PaginationIndicator/PaginationIndicator.tsx +0 -365
- package/src/components/PaginationIndicator/index.tsx +0 -2
- package/src/components/Parallax/Parallax.module.scss +0 -28
- package/src/components/Parallax/Parallax.tsx +0 -225
- package/src/components/Parallax/index.tsx +0 -2
- package/src/components/Parallax/math/helpers.ts +0 -289
- package/src/components/PasswordInput/PasswordInput.module.scss +0 -17
- package/src/components/PasswordInput/PasswordInput.tsx +0 -154
- package/src/components/PasswordInput/index.tsx +0 -2
- package/src/components/PingPongText/PingPongText.module.scss +0 -4
- package/src/components/PingPongText/PingPongText.tsx +0 -83
- package/src/components/PingPongText/index.tsx +0 -2
- package/src/components/PixelatedScan/PixelatedScan.module.scss +0 -86
- package/src/components/PixelatedScan/PixelatedScan.tsx +0 -175
- package/src/components/PixelatedScan/index.tsx +0 -2
- package/src/components/Portal/Portal.module.scss +0 -3
- package/src/components/Portal/Portal.tsx +0 -68
- package/src/components/Portal/index.tsx +0 -2
- package/src/components/ProgressBar/ProgressBar.module.scss +0 -44
- package/src/components/ProgressBar/ProgressBar.tsx +0 -124
- package/src/components/ProgressBar/index.tsx +0 -2
- package/src/components/ProgressTexts/ProgressTexts.module.scss +0 -37
- package/src/components/ProgressTexts/ProgressTexts.tsx +0 -85
- package/src/components/ProgressTexts/index.tsx +0 -2
- package/src/components/Radio/Radio.module.scss +0 -36
- package/src/components/Radio/Radio.tsx +0 -53
- package/src/components/Radio/index.tsx +0 -2
- package/src/components/SectionContainer/SectionContainer.module.scss +0 -30
- package/src/components/SectionContainer/SectionContainer.tsx +0 -49
- package/src/components/SectionContainer/index.tsx +0 -2
- package/src/components/Select/Select.module.scss +0 -58
- package/src/components/Select/Select.tsx +0 -192
- package/src/components/Select/index.tsx +0 -2
- package/src/components/Skeleton/Skeleton.module.scss +0 -21
- package/src/components/Skeleton/Skeleton.tsx +0 -29
- package/src/components/Skeleton/index.tsx +0 -2
- package/src/components/Spacing/Spacing.module.scss +0 -13
- package/src/components/Spacing/Spacing.tsx +0 -24
- package/src/components/Spacing/index.tsx +0 -2
- package/src/components/StaticScroller/StaticScroller.module.scss +0 -14
- package/src/components/StaticScroller/StaticScroller.tsx +0 -83
- package/src/components/StaticScroller/index.tsx +0 -2
- package/src/components/Switch/Switch.module.scss +0 -43
- package/src/components/Switch/Switch.tsx +0 -41
- package/src/components/Switch/index.tsx +0 -2
- package/src/components/Table/Table.module.scss +0 -76
- package/src/components/Table/Table.tsx +0 -152
- package/src/components/Table/index.tsx +0 -2
- package/src/components/Tabs/Tabs.module.scss +0 -40
- package/src/components/Tabs/Tabs.tsx +0 -104
- package/src/components/Tabs/index.tsx +0 -2
- package/src/components/Text/Text.module.scss +0 -81
- package/src/components/Text/Text.tsx +0 -42
- package/src/components/Text/index.tsx +0 -2
- package/src/components/Transition/MasksFactory/DiagonalReveal.tsx +0 -47
- package/src/components/Transition/MasksFactory/DiagonalSquareToBalls.tsx +0 -78
- package/src/components/Transition/MasksFactory/PhysicsSquares.tsx +0 -106
- package/src/components/Transition/MasksFactory/SquareToBalls.tsx +0 -66
- package/src/components/Transition/MasksFactory/utils.ts +0 -35
- package/src/components/Transition/Transition.module.scss +0 -211
- package/src/components/Transition/Transition.tsx +0 -495
- package/src/components/Transition/index.tsx +0 -2
- package/src/components/UncontrolledTransition/UncontrolledTransition.ai.md +0 -9
- package/src/components/UncontrolledTransition/UncontrolledTransition.sample.tsx +0 -34
- package/src/components/UncontrolledTransition/UncontrolledTransition.tsx +0 -143
- package/src/components/UncontrolledTransition/index.tsx +0 -2
- package/src/components/WalletConnectionWrapper/WalletConnectionWrapper.tsx +0 -212
- package/src/components/WalletConnectionWrapper/index.tsx +0 -2
- package/src/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.module.scss +0 -5
- package/src/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.tsx +0 -52
- package/src/components/utilitary/ScrollAndFocusLock/index.tsx +0 -2
- package/src/context/AsyncProcess.tsx +0 -107
- package/src/context/ContextAsyncControl.tsx +0 -89
- package/src/context/CustomBrowserRouter.tsx +0 -55
- package/src/context/OneUIProvider.tsx +0 -308
- package/src/hooks/logs/useDependencyChangeDetection.ts +0 -25
- package/src/hooks/logs/useIsMounting.ts +0 -7
- package/src/hooks/persistence/useLocalStorage.ts +0 -45
- package/src/hooks/shims/ObjectWatchShim.ts +0 -56
- package/src/hooks/ui/useAdaptiveImage.tsx +0 -36
- package/src/hooks/ui/useAlternating.tsx +0 -22
- package/src/hooks/ui/useBreakpoint.tsx +0 -21
- package/src/hooks/ui/useCustomScrollbar.module.scss +0 -20
- package/src/hooks/ui/useCustomScrollbar.tsx +0 -22
- package/src/hooks/ui/useEffectIf.ts +0 -11
- package/src/hooks/ui/useMouseHover.tsx +0 -26
- package/src/hooks/ui/usePaginationControls.module.scss +0 -16
- package/src/hooks/ui/usePaginationControls.tsx +0 -176
- package/src/hooks/ui/useSnapToViewport.module.scss +0 -6
- package/src/hooks/ui/useSnapToViewport.ts +0 -28
- package/src/hooks/ui/useTilt.tsx +0 -219
- package/src/hooks/ui/useZoomable.module.scss +0 -34
- package/src/hooks/ui/useZoomable.tsx +0 -144
- package/src/hooks/useAsyncControl.ai.md +0 -25
- package/src/hooks/useAsyncControl.ts +0 -101
- package/src/hooks/useContainedRepositioning.ts +0 -110
- package/src/hooks/useCustomHistory.ts +0 -14
- package/src/hooks/useElementFit.ts +0 -82
- package/src/hooks/useFirestoreWatch.ts +0 -54
- package/src/hooks/useForm.ts +0 -49
- package/src/hooks/useFreeze.ts +0 -12
- package/src/hooks/useHero.module.scss +0 -41
- package/src/hooks/useHero.ts +0 -514
- package/src/hooks/useIntersection.ts +0 -32
- package/src/hooks/useMergeRefs.ts +0 -29
- package/src/hooks/useObserve.ts +0 -24
- package/src/hooks/usePagination.ts +0 -228
- package/src/hooks/usePooledOperation.ts +0 -54
- package/src/hooks/usePooling.ts +0 -46
- package/src/hooks/useRebound.ts +0 -23
- package/src/hooks/useShortIntl.ai.md +0 -5
- package/src/hooks/useShortIntl.ts +0 -97
- package/src/hooks/utility/useAsyncMemo.ts +0 -43
- package/src/hooks/utility/useDepChange.ts +0 -11
- package/src/hooks/utility/useEvents.ts +0 -33
- package/src/hooks/utility/useImmediate.ts +0 -8
- package/src/hooks/utility/useManualInit.ts +0 -24
- package/src/hooks/utility/useModule.ts +0 -15
- package/src/hooks/utility/useQuery.ts +0 -15
- package/src/hooks/utility/useUniqueEffect.ts +0 -22
- package/src/index.preprocess.ts +0 -82
- package/src/index.ts +0 -229
- package/src/models/DebugLogger.ts +0 -7
- package/src/models/GenericContract.ts +0 -169
- package/src/models/Orbs.ts +0 -97
- package/src/reac-app-env.d.ts +0 -6
- package/src/storybook/assets/video/txt-reversed.mp4 +0 -0
- package/src/storybookUtils/index.tsx +0 -53
- package/src/test.tsx +0 -0
- package/src/type-utils.ts +0 -49
- package/src/types.ts +0 -199
- package/src/utility.d.ts +0 -70
- package/src/utils/blockchain.ts +0 -43
- package/src/utils/e2e.ts +0 -55
- package/src/utils/flatten.ts +0 -17
- package/src/utils/formatters.ts +0 -36
- package/src/utils/html.utils.ts +0 -3
- package/src/utils/ownEvent.ts +0 -8
- package/src/utils/test.ts +0 -20
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
@import "../../assets/styles/variables.scss";
|
|
2
|
-
|
|
3
|
-
.root {
|
|
4
|
-
position: relative;
|
|
5
|
-
z-index: 1;
|
|
6
|
-
> :not(div) {
|
|
7
|
-
mix-blend-mode: color;
|
|
8
|
-
}
|
|
9
|
-
> div > * {
|
|
10
|
-
mix-blend-mode: color;
|
|
11
|
-
}
|
|
12
|
-
&::before,
|
|
13
|
-
&::after {
|
|
14
|
-
background: var(--bg);
|
|
15
|
-
width: 100%;
|
|
16
|
-
position: absolute;
|
|
17
|
-
content: " ";
|
|
18
|
-
z-index: -1;
|
|
19
|
-
transition: height $fast, background-size $fast;
|
|
20
|
-
}
|
|
21
|
-
&::before {
|
|
22
|
-
opacity: 0;
|
|
23
|
-
top: 0;
|
|
24
|
-
height: var(--fill-height);
|
|
25
|
-
}
|
|
26
|
-
&::after {
|
|
27
|
-
opacity: 0.6;
|
|
28
|
-
bottom: 0;
|
|
29
|
-
height: var(--empty-height);
|
|
30
|
-
background-size: 100% var(--bg-offset);
|
|
31
|
-
background-position: bottom;
|
|
32
|
-
}
|
|
33
|
-
.ignoreFill {
|
|
34
|
-
mix-blend-mode: multiply;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren, ReactNode, useEffect, useRef } from "react";
|
|
2
|
-
import Styles from "./BucketFill.module.scss";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A weird name for a component, but it's objective is to change element colors as the user progresses through a series of steps
|
|
6
|
-
*
|
|
7
|
-
* IT IS NOT READY (AND PROBABLY NEVER WILL) FOR FRAGMENT NODES
|
|
8
|
-
**/
|
|
9
|
-
export default function BucketFill({
|
|
10
|
-
children,
|
|
11
|
-
background,
|
|
12
|
-
fillTo,
|
|
13
|
-
}: {
|
|
14
|
-
children: ReactNode[];
|
|
15
|
-
fillTo: number;
|
|
16
|
-
background: string;
|
|
17
|
-
}) {
|
|
18
|
-
const rootRef = useRef<HTMLDivElement>(null);
|
|
19
|
-
function resize() {
|
|
20
|
-
const childs = rootRef.current!.children;
|
|
21
|
-
const s = rootRef.current!.style;
|
|
22
|
-
const elementAtPosition =
|
|
23
|
-
fillTo === 0 ? null : (childs.item(fillTo - 1) as HTMLElement);
|
|
24
|
-
const elementOffsetAndHeight =
|
|
25
|
-
elementAtPosition === null
|
|
26
|
-
? 0
|
|
27
|
-
: elementAtPosition.offsetTop + elementAtPosition.clientHeight;
|
|
28
|
-
const elementRootHeight = rootRef.current!.clientHeight;
|
|
29
|
-
const percentToFill = Math.min(
|
|
30
|
-
(elementOffsetAndHeight * 100) / elementRootHeight,
|
|
31
|
-
100
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
s.setProperty("--fill-height", `${percentToFill}%`);
|
|
35
|
-
s.setProperty("--empty-height", `${100 - percentToFill}%`);
|
|
36
|
-
s.setProperty(
|
|
37
|
-
"--bg-offset",
|
|
38
|
-
`${percentToFill === 100 ? -1000 : 100 / ((100 - percentToFill) / 100)}%`
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
resize();
|
|
43
|
-
window.addEventListener("resize", resize);
|
|
44
|
-
|
|
45
|
-
return () => window.removeEventListener("resize", resize);
|
|
46
|
-
}, [fillTo]);
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<div
|
|
50
|
-
ref={rootRef}
|
|
51
|
-
style={
|
|
52
|
-
{
|
|
53
|
-
"--bg": background,
|
|
54
|
-
} as any
|
|
55
|
-
}
|
|
56
|
-
className={Styles.root}
|
|
57
|
-
>
|
|
58
|
-
{children}
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function IgnoreFill({ children }: PropsWithChildren<{}>) {
|
|
64
|
-
return <div className={Styles.ignoreFill}>{children}</div>;
|
|
65
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
@import "../../assets/styles/variables.scss";
|
|
2
|
-
|
|
3
|
-
.button {
|
|
4
|
-
cursor: pointer;
|
|
5
|
-
display: block;
|
|
6
|
-
padding: 16px;
|
|
7
|
-
border: none;
|
|
8
|
-
transition: color $fast;
|
|
9
|
-
color: $digitalBlue;
|
|
10
|
-
border-radius: $buttonBorderRadius;
|
|
11
|
-
&:disabled {
|
|
12
|
-
cursor: initial;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
///"transparent" | "filled" | "outline";
|
|
17
|
-
|
|
18
|
-
.transparent {
|
|
19
|
-
background-color: transparent;
|
|
20
|
-
&:disabled {
|
|
21
|
-
color: $mediumGray;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.filled {
|
|
26
|
-
background-color: $buttonPrimaryBackgroundColor;
|
|
27
|
-
color: $buttonTextColor;
|
|
28
|
-
border-width: 0px;
|
|
29
|
-
&:disabled {
|
|
30
|
-
color: $mediumGray;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.outline {
|
|
35
|
-
border: 1px solid $digitalBlue;
|
|
36
|
-
background-color: transparent;
|
|
37
|
-
&:disabled {
|
|
38
|
-
color: $mediumGray;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.link {
|
|
43
|
-
padding: 0px;
|
|
44
|
-
@extend .transparent;
|
|
45
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React, { ElementRef, ForwardedRef, forwardRef } from "react";
|
|
2
|
-
import { useOneUIConfig } from "../../context/OneUIProvider";
|
|
3
|
-
|
|
4
|
-
type ButtonProps = React.PropsWithChildren<
|
|
5
|
-
React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
6
|
-
variant?: OnepercentUtility.UIElements.ButtonVariants;
|
|
7
|
-
}
|
|
8
|
-
>;
|
|
9
|
-
|
|
10
|
-
export function _Button(
|
|
11
|
-
{
|
|
12
|
-
children,
|
|
13
|
-
variant = "transparent",
|
|
14
|
-
className = "",
|
|
15
|
-
...otherProps
|
|
16
|
-
}: ButtonProps,
|
|
17
|
-
ref: ForwardedRef<HTMLButtonElement>
|
|
18
|
-
) {
|
|
19
|
-
const classNameType = useOneUIConfig("component.button.className", {});
|
|
20
|
-
const Component = useOneUIConfig(
|
|
21
|
-
"component.button.Component",
|
|
22
|
-
"button" as any
|
|
23
|
-
);
|
|
24
|
-
return (
|
|
25
|
-
<Component
|
|
26
|
-
ref={ref}
|
|
27
|
-
className={`${className} ${classNameType[variant] || ""}`}
|
|
28
|
-
variant={variant}
|
|
29
|
-
{...otherProps}
|
|
30
|
-
>
|
|
31
|
-
{children}
|
|
32
|
-
</Component>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* A simple button that can be customized via the provider
|
|
38
|
-
**/
|
|
39
|
-
const Button = forwardRef<HTMLButtonElement, ButtonProps>(_Button);
|
|
40
|
-
export default Button;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import Styles from "./Card.module.scss";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A card layout that holds content
|
|
6
|
-
**/
|
|
7
|
-
export default function Card({ children, className = "" }: PropsWithChildren<{className?: string}>) {
|
|
8
|
-
return <div className={`${Styles.container} ${className}`}>{children}</div>;
|
|
9
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
@import "../../assets/styles";
|
|
2
|
-
|
|
3
|
-
.tooltipContainer {
|
|
4
|
-
> * {
|
|
5
|
-
padding: 16px;
|
|
6
|
-
border-radius: 8px;
|
|
7
|
-
background-color: var(--line-color) !important;
|
|
8
|
-
color: var(--text-color);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&::after,
|
|
12
|
-
&::before {
|
|
13
|
-
border-color: var(--line-color) !important;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.chartRoot {
|
|
18
|
-
display: grid;
|
|
19
|
-
height: 100%;
|
|
20
|
-
width: 100%;
|
|
21
|
-
grid-template-columns: auto 1fr;
|
|
22
|
-
grid-template-rows: 1fr auto;
|
|
23
|
-
.chartContainer {
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 100%;
|
|
26
|
-
border-left: 2px solid $primaryColor;
|
|
27
|
-
border-bottom: 2px solid $primaryColor;
|
|
28
|
-
svg {
|
|
29
|
-
height: 100%;
|
|
30
|
-
width: 100%;
|
|
31
|
-
circle {
|
|
32
|
-
fill: var(--point-color);
|
|
33
|
-
}
|
|
34
|
-
polyline {
|
|
35
|
-
stroke: var(--line-color);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
.yAxis,
|
|
40
|
-
.xAxis {
|
|
41
|
-
display: flex;
|
|
42
|
-
flex-direction: column;
|
|
43
|
-
justify-content: space-around;
|
|
44
|
-
> * {
|
|
45
|
-
text-align: center;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
.xAxis {
|
|
49
|
-
border-left: 2px solid $primaryColor;
|
|
50
|
-
flex-direction: row;
|
|
51
|
-
> * {
|
|
52
|
-
flex: 1;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
.yAxis {
|
|
56
|
-
border-bottom: 2px solid $primaryColor;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
|
|
3
|
-
export type ChartProps = ChartViewProps;
|
|
4
|
-
export type ChartViewProps = {
|
|
5
|
-
bounds: Readonly<
|
|
6
|
-
[
|
|
7
|
-
horizontal: Readonly<[min: number, max: number, incrementRate: number]>,
|
|
8
|
-
vertical: Readonly<[min: number, max: number, incrementRate: number]>
|
|
9
|
-
]
|
|
10
|
-
>;
|
|
11
|
-
|
|
12
|
-
style?: (
|
|
13
|
-
| Partial<{
|
|
14
|
-
lineColor: string;
|
|
15
|
-
pointColor: string;
|
|
16
|
-
textColor: string;
|
|
17
|
-
}>
|
|
18
|
-
| undefined
|
|
19
|
-
)[];
|
|
20
|
-
|
|
21
|
-
data?: Readonly<Readonly<Readonly<[x: number, y: number]>[]>[]>;
|
|
22
|
-
|
|
23
|
-
points?: Readonly<
|
|
24
|
-
Readonly<
|
|
25
|
-
Readonly<
|
|
26
|
-
[x: number, y: number, label: ReactElement, onlyOnHover?: boolean]
|
|
27
|
-
>[]
|
|
28
|
-
>[]
|
|
29
|
-
>;
|
|
30
|
-
|
|
31
|
-
label: {
|
|
32
|
-
x: (val: number) => ReactElement;
|
|
33
|
-
y: (val: number) => ReactElement;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
ComponentRef,
|
|
3
|
-
ElementRef,
|
|
4
|
-
PropsWithChildren,
|
|
5
|
-
ReactNode,
|
|
6
|
-
useEffect,
|
|
7
|
-
useLayoutEffect,
|
|
8
|
-
useMemo,
|
|
9
|
-
useRef,
|
|
10
|
-
useState,
|
|
11
|
-
} from "react";
|
|
12
|
-
import throttle from "lodash/throttle";
|
|
13
|
-
import { ChartViewProps } from "./Chart.types";
|
|
14
|
-
import Styles from "./Chart.module.scss";
|
|
15
|
-
import { ChartDataTestIds } from "./Chart.e2e";
|
|
16
|
-
import AnchoredTooltip from "../AnchoredTooltip";
|
|
17
|
-
|
|
18
|
-
const DEFAULT_STYLE = {
|
|
19
|
-
lineColor: "#000",
|
|
20
|
-
pointColor: "#000",
|
|
21
|
-
textColor: "#fff",
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
function FloatingTooltip({
|
|
25
|
-
children,
|
|
26
|
-
x,
|
|
27
|
-
y,
|
|
28
|
-
hoverOnly,
|
|
29
|
-
height,
|
|
30
|
-
style,
|
|
31
|
-
}: {
|
|
32
|
-
children: ReactNode;
|
|
33
|
-
x: number;
|
|
34
|
-
y: number;
|
|
35
|
-
hoverOnly: boolean;
|
|
36
|
-
height: number;
|
|
37
|
-
style: Pick<
|
|
38
|
-
NonNullable<NonNullable<ChartViewProps["style"]>[number]>,
|
|
39
|
-
"pointColor" | "lineColor" | "textColor"
|
|
40
|
-
>;
|
|
41
|
-
}) {
|
|
42
|
-
const [ope, setOpen] = useState(() => (hoverOnly ? false : true));
|
|
43
|
-
const ref = useRef<ComponentRef<typeof AnchoredTooltip>>(null);
|
|
44
|
-
const circleRef = useRef<SVGCircleElement>(null);
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
const animateEl = circleRef.current!.children.item(0) as SVGAnimateElement;
|
|
47
|
-
let interval: NodeJS.Timeout;
|
|
48
|
-
animateEl.addEventListener("beginEvent", () => {
|
|
49
|
-
interval = setInterval(() => ref.current!.updatePosition(), 1000 / 24);
|
|
50
|
-
});
|
|
51
|
-
animateEl.addEventListener("endEvent", () => {
|
|
52
|
-
clearInterval(interval);
|
|
53
|
-
ref.current!.updatePosition();
|
|
54
|
-
});
|
|
55
|
-
}, []);
|
|
56
|
-
|
|
57
|
-
const actions = useMemo(
|
|
58
|
-
() =>
|
|
59
|
-
hoverOnly
|
|
60
|
-
? {
|
|
61
|
-
onMouseEnter: () => setOpen(true),
|
|
62
|
-
onMouseOut: () => setOpen(false),
|
|
63
|
-
}
|
|
64
|
-
: {},
|
|
65
|
-
[hoverOnly]
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<>
|
|
70
|
-
<circle
|
|
71
|
-
ref={circleRef}
|
|
72
|
-
r={height * 0.01}
|
|
73
|
-
cx={x}
|
|
74
|
-
cy={y}
|
|
75
|
-
style={
|
|
76
|
-
{
|
|
77
|
-
"--point-color": style.pointColor,
|
|
78
|
-
} as any
|
|
79
|
-
}
|
|
80
|
-
{...actions}
|
|
81
|
-
>
|
|
82
|
-
<animate attributeName="cy" values={`${height};${y}`} dur="1s" />
|
|
83
|
-
</circle>
|
|
84
|
-
<AnchoredTooltip
|
|
85
|
-
ref={ref}
|
|
86
|
-
containInViewport={false}
|
|
87
|
-
anchorRef={circleRef as any}
|
|
88
|
-
open={ope}
|
|
89
|
-
className={Styles.tooltipContainer}
|
|
90
|
-
style={{
|
|
91
|
-
"--line-color": style.lineColor,
|
|
92
|
-
"--text-color": style.textColor,
|
|
93
|
-
}}
|
|
94
|
-
>
|
|
95
|
-
{children as any}
|
|
96
|
-
</AnchoredTooltip>
|
|
97
|
-
</>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Draws a simple line chart with some animation
|
|
103
|
-
**/
|
|
104
|
-
export default function ChartView({
|
|
105
|
-
bounds: [[startX, endX, stepsX], [startY, endY, stepsY]],
|
|
106
|
-
data = [],
|
|
107
|
-
points = [],
|
|
108
|
-
label,
|
|
109
|
-
style: groupStyle = [],
|
|
110
|
-
}: ChartViewProps) {
|
|
111
|
-
const [dim, setDIm] = useState<{ width: number; height: number }>();
|
|
112
|
-
const chartRef = useRef<HTMLDivElement>(null);
|
|
113
|
-
useLayoutEffect(() => {
|
|
114
|
-
setDIm({
|
|
115
|
-
width: chartRef.current!.clientWidth,
|
|
116
|
-
height: chartRef.current!.clientHeight,
|
|
117
|
-
});
|
|
118
|
-
}, []);
|
|
119
|
-
const { width, height } = dim || {};
|
|
120
|
-
|
|
121
|
-
const howMuchStepsY = useMemo(
|
|
122
|
-
() => (endY - startY) / stepsY + 1,
|
|
123
|
-
[endY, startY, stepsY]
|
|
124
|
-
);
|
|
125
|
-
const yAxis = useMemo(() => {
|
|
126
|
-
return new Array(howMuchStepsY).fill(undefined).map((_, i) => {
|
|
127
|
-
return <span>{label.y(endY - i * stepsY)}</span>;
|
|
128
|
-
});
|
|
129
|
-
}, [startY, endY, stepsY, howMuchStepsY]);
|
|
130
|
-
|
|
131
|
-
const howMuchStepsX = useMemo(
|
|
132
|
-
() => (endX - startX) / stepsX + 1,
|
|
133
|
-
[endX, startX, stepsX]
|
|
134
|
-
);
|
|
135
|
-
const xAxis = useMemo(() => {
|
|
136
|
-
return new Array(howMuchStepsX).fill(undefined).map((_, i) => {
|
|
137
|
-
return <span>{label.x(startX + i * stepsX)}</span>;
|
|
138
|
-
});
|
|
139
|
-
}, [startX, endX, stepsX]);
|
|
140
|
-
|
|
141
|
-
const { polylines, tooltips } = useMemo(() => {
|
|
142
|
-
const calculate =
|
|
143
|
-
(end: number, start: number, overrideScale: number = 100) =>
|
|
144
|
-
(point: number) => {
|
|
145
|
-
const max = end - start;
|
|
146
|
-
const current = point - start;
|
|
147
|
-
|
|
148
|
-
return (current * overrideScale) / max;
|
|
149
|
-
};
|
|
150
|
-
const calculateX = calculate(endX, startX, width);
|
|
151
|
-
const calculateY = calculate(endY, startY, height);
|
|
152
|
-
return {
|
|
153
|
-
tooltips: points.map((pointsCategory, i) => {
|
|
154
|
-
const style = groupStyle[i] || DEFAULT_STYLE;
|
|
155
|
-
return pointsCategory.map(([x, y, label, onlyOnHover = false]) => {
|
|
156
|
-
return (
|
|
157
|
-
<FloatingTooltip
|
|
158
|
-
x={calculateX(x)}
|
|
159
|
-
y={height! - calculateY(y)}
|
|
160
|
-
height={height!}
|
|
161
|
-
style={style}
|
|
162
|
-
hoverOnly={onlyOnHover}
|
|
163
|
-
>
|
|
164
|
-
{label}
|
|
165
|
-
</FloatingTooltip>
|
|
166
|
-
);
|
|
167
|
-
});
|
|
168
|
-
}),
|
|
169
|
-
polylines: data.map((lineData, i) => {
|
|
170
|
-
const style = groupStyle[i] || DEFAULT_STYLE;
|
|
171
|
-
const calculateLines = (yOverride?: number) => {
|
|
172
|
-
return lineData
|
|
173
|
-
.map(
|
|
174
|
-
([x, y]) =>
|
|
175
|
-
`${calculateX(x)},${
|
|
176
|
-
yOverride === undefined ? height! - calculateY(y) : yOverride
|
|
177
|
-
}`
|
|
178
|
-
)
|
|
179
|
-
.join(" ");
|
|
180
|
-
};
|
|
181
|
-
return (
|
|
182
|
-
<polyline
|
|
183
|
-
strokeLinejoin="round"
|
|
184
|
-
strokeLinecap="round"
|
|
185
|
-
points={calculateLines()}
|
|
186
|
-
fill="none"
|
|
187
|
-
strokeWidth={5}
|
|
188
|
-
style={
|
|
189
|
-
{
|
|
190
|
-
"--line-color": style.lineColor,
|
|
191
|
-
} as any
|
|
192
|
-
}
|
|
193
|
-
>
|
|
194
|
-
<animate
|
|
195
|
-
attributeName="points"
|
|
196
|
-
attributeType="XML"
|
|
197
|
-
values={[calculateLines(height), calculateLines()].join("; ")}
|
|
198
|
-
dur="1s"
|
|
199
|
-
/>
|
|
200
|
-
</polyline>
|
|
201
|
-
);
|
|
202
|
-
}),
|
|
203
|
-
};
|
|
204
|
-
}, [data, width, height]);
|
|
205
|
-
|
|
206
|
-
const paddingY = useMemo(() => {
|
|
207
|
-
const stepSizeY = height! / (howMuchStepsY - 1);
|
|
208
|
-
return stepSizeY / 2;
|
|
209
|
-
}, [howMuchStepsY, height]);
|
|
210
|
-
|
|
211
|
-
const paddingX = useMemo(() => {
|
|
212
|
-
const stepSizeX = width! / (howMuchStepsX - 1);
|
|
213
|
-
return stepSizeX / 2;
|
|
214
|
-
}, [howMuchStepsX, width]);
|
|
215
|
-
|
|
216
|
-
return (
|
|
217
|
-
<div className={Styles.chartRoot}>
|
|
218
|
-
<div className={Styles.yAxis} data-testid={ChartDataTestIds.Y_AXIS}>
|
|
219
|
-
{yAxis}
|
|
220
|
-
</div>
|
|
221
|
-
<div ref={chartRef} className={Styles.chartContainer}>
|
|
222
|
-
{width && (
|
|
223
|
-
<svg
|
|
224
|
-
className={Styles.chart}
|
|
225
|
-
viewBox={`${-paddingX} ${-paddingY} ${width + paddingX * 2} ${
|
|
226
|
-
height! + paddingY * 2
|
|
227
|
-
}`}
|
|
228
|
-
preserveAspectRatio="none"
|
|
229
|
-
>
|
|
230
|
-
{polylines}
|
|
231
|
-
{tooltips}
|
|
232
|
-
</svg>
|
|
233
|
-
)}
|
|
234
|
-
</div>
|
|
235
|
-
|
|
236
|
-
<div className={Styles.xAxis} data-testid={ChartDataTestIds.X_AXIS}>
|
|
237
|
-
{xAxis}
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
);
|
|
241
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
@import "../../assets/styles/index.scss";
|
|
2
|
-
|
|
3
|
-
.container {
|
|
4
|
-
display: flex;
|
|
5
|
-
line-height: 1.5em;
|
|
6
|
-
vertical-align: middle;
|
|
7
|
-
input {
|
|
8
|
-
max-width: 0px;
|
|
9
|
-
max-height: 0px;
|
|
10
|
-
width: 0;
|
|
11
|
-
height: 0;
|
|
12
|
-
opacity: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
> span:first-child {
|
|
16
|
-
visibility: visible;
|
|
17
|
-
width: 1.5em;
|
|
18
|
-
height: 1.5em;
|
|
19
|
-
border-radius: 0.45em;
|
|
20
|
-
background-image: url("../../assets/img/svg/checkbox.svg");
|
|
21
|
-
background-color: transparent;
|
|
22
|
-
transition: background-color 250ms, border 250ms, box-shadow 250ms;
|
|
23
|
-
border: 1px solid rgb(40, 43, 53);
|
|
24
|
-
box-shadow: 0px 0px 0px -4px $digitalBlue;
|
|
25
|
-
flex-shrink: 0;
|
|
26
|
-
|
|
27
|
-
&.wContent {
|
|
28
|
-
margin-right: 0.45em;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
> span:first-child.checked {
|
|
32
|
-
background-color: $digitalBlue;
|
|
33
|
-
border: 1px solid $digitalBlue;
|
|
34
|
-
box-shadow: 0px 0px 12px -4px $digitalBlue;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { useOneUIConfig } from "../../context/OneUIProvider";
|
|
3
|
-
import Styles from "./CheckBox.module.scss";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A simple checkbox with nissan guidelines
|
|
7
|
-
**/
|
|
8
|
-
export default function CheckBox({
|
|
9
|
-
checked,
|
|
10
|
-
onToggle,
|
|
11
|
-
label,
|
|
12
|
-
className = "",
|
|
13
|
-
size = undefined,
|
|
14
|
-
groupId,
|
|
15
|
-
value,
|
|
16
|
-
...props
|
|
17
|
-
}: PropsWithChildren<{
|
|
18
|
-
checked: boolean;
|
|
19
|
-
onToggle: (checked: boolean) => void;
|
|
20
|
-
label: React.ReactNode;
|
|
21
|
-
className?: string;
|
|
22
|
-
size?: number;
|
|
23
|
-
groupId: string;
|
|
24
|
-
value: string;
|
|
25
|
-
}> &
|
|
26
|
-
Omit<
|
|
27
|
-
React.DetailedHTMLProps<
|
|
28
|
-
React.HTMLAttributes<HTMLSpanElement>,
|
|
29
|
-
HTMLSpanElement
|
|
30
|
-
>,
|
|
31
|
-
"onToggle"
|
|
32
|
-
>) {
|
|
33
|
-
const Checkbox = useOneUIConfig(
|
|
34
|
-
"component.checkbox.Component",
|
|
35
|
-
"span" as any
|
|
36
|
-
) as any;
|
|
37
|
-
return (
|
|
38
|
-
<label
|
|
39
|
-
className={`${Styles.container} ${className}`}
|
|
40
|
-
style={{ fontSize: size }}
|
|
41
|
-
onClick={(e) => {
|
|
42
|
-
onToggle(!checked);
|
|
43
|
-
e.preventDefault();
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
<Checkbox
|
|
47
|
-
{...props}
|
|
48
|
-
className={`${checked ? Styles.checked : ""} ${
|
|
49
|
-
label ? Styles.wContent : ""
|
|
50
|
-
}`}
|
|
51
|
-
/>
|
|
52
|
-
<input
|
|
53
|
-
type="checkbox"
|
|
54
|
-
name={groupId}
|
|
55
|
-
id={value}
|
|
56
|
-
checked={checked}
|
|
57
|
-
readOnly
|
|
58
|
-
/>
|
|
59
|
-
|
|
60
|
-
{label}
|
|
61
|
-
</label>
|
|
62
|
-
);
|
|
63
|
-
}
|