@onepercentio/one-ui 0.29.4 → 0.29.5

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 (286) hide show
  1. package/dist/components/Switch/Switch.d.ts +1 -1
  2. package/dist/components/Switch/Switch.js +1 -1
  3. package/dist-ts/components/Switch/Switch.d.ts +1 -1
  4. package/package.json +1 -1
  5. package/src/assets/img/svg/checkbox.svg +0 -3
  6. package/src/assets/styles/index.scss +0 -2
  7. package/src/assets/styles/mixins.scss +0 -12
  8. package/src/assets/styles/variables.scss +0 -49
  9. package/src/components/AdaptiveButton/AdaptiveButton.module.scss +0 -7
  10. package/src/components/AdaptiveButton/AdaptiveButton.tsx +0 -26
  11. package/src/components/AdaptiveButton/index.tsx +0 -2
  12. package/src/components/AdaptiveContainer/AdaptiveContainer.module.scss +0 -53
  13. package/src/components/AdaptiveContainer/AdaptiveContainer.tsx +0 -200
  14. package/src/components/AdaptiveContainer/index.tsx +0 -2
  15. package/src/components/AdaptiveDialog/AdaptiveDialog.module.scss +0 -147
  16. package/src/components/AdaptiveDialog/AdaptiveDialog.tsx +0 -97
  17. package/src/components/AdaptiveDialog/index.tsx +0 -2
  18. package/src/components/AdaptiveSidebar/AdaptiveSidebar.module.scss +0 -49
  19. package/src/components/AdaptiveSidebar/AdaptiveSidebar.sample.tsx +0 -10
  20. package/src/components/AdaptiveSidebar/AdaptiveSidebar.tsx +0 -123
  21. package/src/components/AdaptiveSidebar/index.tsx +0 -2
  22. package/src/components/AnchoredTooltip/AnchoredTooltip.module.scss +0 -64
  23. package/src/components/AnchoredTooltip/AnchoredTooltip.tsx +0 -250
  24. package/src/components/AnchoredTooltip/index.tsx +0 -2
  25. package/src/components/AnimatedEntrance/AnimatedEntrance.module.scss +0 -108
  26. package/src/components/AnimatedEntrance/AnimatedEntrance.tsx +0 -227
  27. package/src/components/AnimatedEntrance/index.tsx +0 -2
  28. package/src/components/AsyncWrapper/AsyncWrapper.tsx +0 -38
  29. package/src/components/AsyncWrapper/index.tsx +0 -2
  30. package/src/components/Avatar/Avatar.module.scss +0 -22
  31. package/src/components/Avatar/Avatar.tsx +0 -31
  32. package/src/components/Avatar/index.tsx +0 -2
  33. package/src/components/BucketFill/BucketFill.module.scss +0 -36
  34. package/src/components/BucketFill/BucketFill.tsx +0 -65
  35. package/src/components/BucketFill/index.tsx +0 -2
  36. package/src/components/Button/Button.module.scss +0 -45
  37. package/src/components/Button/Button.tsx +0 -40
  38. package/src/components/Button/index.tsx +0 -2
  39. package/src/components/Card/Card.module.scss +0 -12
  40. package/src/components/Card/Card.tsx +0 -9
  41. package/src/components/Card/index.tsx +0 -2
  42. package/src/components/Chart/Chart.e2e.ts +0 -4
  43. package/src/components/Chart/Chart.logic.tsx +0 -8
  44. package/src/components/Chart/Chart.module.scss +0 -58
  45. package/src/components/Chart/Chart.tsx +0 -2
  46. package/src/components/Chart/Chart.types.ts +0 -35
  47. package/src/components/Chart/Chart.view.tsx +0 -241
  48. package/src/components/Chart/index.tsx +0 -2
  49. package/src/components/CheckBox/CheckBox.module.scss +0 -36
  50. package/src/components/CheckBox/CheckBox.tsx +0 -63
  51. package/src/components/CheckBox/index.tsx +0 -2
  52. package/src/components/CodeInput/CodeInput.module.scss +0 -5
  53. package/src/components/CodeInput/CodeInput.tsx +0 -84
  54. package/src/components/CodeInput/index.tsx +0 -2
  55. package/src/components/Collapsable/Collapsable.module.scss +0 -42
  56. package/src/components/Collapsable/Collapsable.tsx +0 -253
  57. package/src/components/Collapsable/index.tsx +0 -2
  58. package/src/components/Countdown/Countdown.tsx +0 -130
  59. package/src/components/Countdown/index.tsx +0 -2
  60. package/src/components/CurrencyInput/CurrencyInput.hook.ts +0 -37
  61. package/src/components/CurrencyInput/CurrencyInput.tsx +0 -25
  62. package/src/components/CurrencyInput/index.tsx +0 -2
  63. package/src/components/Divider/Divider.module.scss +0 -7
  64. package/src/components/Divider/Divider.tsx +0 -13
  65. package/src/components/Divider/index.tsx +0 -2
  66. package/src/components/EmailInput/EmailInput.module.scss +0 -0
  67. package/src/components/EmailInput/EmailInput.tsx +0 -51
  68. package/src/components/EmailInput/index.tsx +0 -2
  69. package/src/components/FadeIn/FadeIn.module.scss +0 -9
  70. package/src/components/FadeIn/FadeIn.tsx +0 -77
  71. package/src/components/FadeIn/index.tsx +0 -2
  72. package/src/components/FileInput/FileInput.module.scss +0 -6
  73. package/src/components/FileInput/FileInput.tsx +0 -75
  74. package/src/components/FileInput/View/BigFactory/BigFactory.module.scss +0 -20
  75. package/src/components/FileInput/View/BigFactory/BigFactory.tsx +0 -48
  76. package/src/components/FileInput/View/BigFactory/index.tsx +0 -2
  77. package/src/components/FileInput/View/Compact/Compact.module.scss +0 -68
  78. package/src/components/FileInput/View/Compact/Compact.tsx +0 -151
  79. package/src/components/FileInput/View/Compact/index.tsx +0 -2
  80. package/src/components/FileInput/View/View.types.ts +0 -12
  81. package/src/components/FileInput/index.tsx +0 -2
  82. package/src/components/FlowController/FlowController.module.scss +0 -47
  83. package/src/components/FlowController/FlowController.tsx +0 -93
  84. package/src/components/FlowController/index.tsx +0 -2
  85. package/src/components/Form/Form.tsx +0 -243
  86. package/src/components/Form/index.ts +0 -2
  87. package/src/components/Form/v2/Form.hook.ts +0 -341
  88. package/src/components/Form/v2/Form.module.scss +0 -0
  89. package/src/components/Form/v2/Form.tsx +0 -78
  90. package/src/components/Form/v2/Form.types.ts +0 -118
  91. package/src/components/Form/v2/FormField/Extensions/DateField/DateField.module.scss +0 -0
  92. package/src/components/Form/v2/FormField/Extensions/DateField/DateField.tsx +0 -73
  93. package/src/components/Form/v2/FormField/Extensions/DateField/index.tsx +0 -2
  94. package/src/components/Form/v2/FormField/Extensions/PhoneField/PhoneField.module.scss +0 -0
  95. package/src/components/Form/v2/FormField/Extensions/PhoneField/PhoneField.tsx +0 -91
  96. package/src/components/Form/v2/FormField/Extensions/PhoneField/index.tsx +0 -2
  97. package/src/components/Form/v2/FormField/FormField.module.scss +0 -0
  98. package/src/components/Form/v2/FormField/FormField.tsx +0 -378
  99. package/src/components/Form/v2/FormField/FormField.types.ts +0 -129
  100. package/src/components/Form/v2/FormField/index.tsx +0 -2
  101. package/src/components/Form/v2/index.tsx +0 -2
  102. package/src/components/Freeze/Freeze.tsx +0 -9
  103. package/src/components/Freeze/index.tsx +0 -2
  104. package/src/components/HSForms/HSForms.tsx +0 -57
  105. package/src/components/HSForms/index.tsx +0 -2
  106. package/src/components/Header/Header.module.scss +0 -119
  107. package/src/components/Header/Header.tsx +0 -138
  108. package/src/components/Header/index.tsx +0 -2
  109. package/src/components/HeaderCloseBtn/HeaderCloseBtn.module.scss +0 -44
  110. package/src/components/HeaderCloseBtn/HeaderCloseBtn.tsx +0 -28
  111. package/src/components/HeaderCloseBtn/index.tsx +0 -2
  112. package/src/components/InfinityScroll/InfinityScroll.module.scss +0 -30
  113. package/src/components/InfinityScroll/InfinityScroll.tsx +0 -187
  114. package/src/components/InfinityScroll/index.tsx +0 -2
  115. package/src/components/Input/Input.module.scss +0 -71
  116. package/src/components/Input/Input.tsx +0 -134
  117. package/src/components/Input/index.tsx +0 -2
  118. package/src/components/InstantCounter/InstantCounter.tsx +0 -77
  119. package/src/components/InstantCounter/index.tsx +0 -2
  120. package/src/components/LavaLamp/LavaLamp.data.tsx +0 -114
  121. package/src/components/LavaLamp/LavaLamp.module.scss +0 -26
  122. package/src/components/LavaLamp/LavaLamp.tsx +0 -131
  123. package/src/components/LavaLamp/index.tsx +0 -2
  124. package/src/components/LavaLamp/v2/LavaLamp.module.scss +0 -23
  125. package/src/components/LavaLamp/v2/LavaLamp.tsx +0 -197
  126. package/src/components/LinkToId/LinkToId.module.scss +0 -4
  127. package/src/components/LinkToId/LinkToId.tsx +0 -51
  128. package/src/components/LinkToId/index.tsx +0 -2
  129. package/src/components/Loader/Loader.module.scss +0 -40
  130. package/src/components/Loader/Loader.tsx +0 -18
  131. package/src/components/Loader/index.tsx +0 -2
  132. package/src/components/LoaderDotsIndicator/LoaderDotsIndicator.tsx +0 -34
  133. package/src/components/LoaderDotsIndicator/index.tsx +0 -2
  134. package/src/components/LoopableVideo/LoopableVideo.tsx +0 -37
  135. package/src/components/LoopableVideo/index.tsx +0 -2
  136. package/src/components/MainGrid/MainGrid.module.scss +0 -28
  137. package/src/components/MainGrid/MainGrid.tsx +0 -68
  138. package/src/components/MainGrid/index.tsx +0 -2
  139. package/src/components/MutableHamburgerButton/MutableHamburgerButton.module.scss +0 -220
  140. package/src/components/MutableHamburgerButton/MutableHamburgerButton.tsx +0 -38
  141. package/src/components/MutableHamburgerButton/index.tsx +0 -2
  142. package/src/components/Notification/Notification.module.scss +0 -25
  143. package/src/components/Notification/Notification.tsx +0 -13
  144. package/src/components/Notification/index.tsx +0 -2
  145. package/src/components/OrderableList/OrderableList.module.scss +0 -98
  146. package/src/components/OrderableList/OrderableList.tsx +0 -564
  147. package/src/components/OrderableList/index.tsx +0 -2
  148. package/src/components/PaginationIndicator/PaginationIndicator.tsx +0 -365
  149. package/src/components/PaginationIndicator/index.tsx +0 -2
  150. package/src/components/Parallax/Parallax.module.scss +0 -28
  151. package/src/components/Parallax/Parallax.tsx +0 -225
  152. package/src/components/Parallax/index.tsx +0 -2
  153. package/src/components/Parallax/math/helpers.ts +0 -289
  154. package/src/components/PasswordInput/PasswordInput.module.scss +0 -17
  155. package/src/components/PasswordInput/PasswordInput.tsx +0 -154
  156. package/src/components/PasswordInput/index.tsx +0 -2
  157. package/src/components/PingPongText/PingPongText.module.scss +0 -4
  158. package/src/components/PingPongText/PingPongText.tsx +0 -83
  159. package/src/components/PingPongText/index.tsx +0 -2
  160. package/src/components/PixelatedScan/PixelatedScan.module.scss +0 -86
  161. package/src/components/PixelatedScan/PixelatedScan.tsx +0 -175
  162. package/src/components/PixelatedScan/index.tsx +0 -2
  163. package/src/components/Portal/Portal.module.scss +0 -3
  164. package/src/components/Portal/Portal.tsx +0 -68
  165. package/src/components/Portal/index.tsx +0 -2
  166. package/src/components/ProgressBar/ProgressBar.module.scss +0 -44
  167. package/src/components/ProgressBar/ProgressBar.tsx +0 -124
  168. package/src/components/ProgressBar/index.tsx +0 -2
  169. package/src/components/ProgressTexts/ProgressTexts.module.scss +0 -37
  170. package/src/components/ProgressTexts/ProgressTexts.tsx +0 -85
  171. package/src/components/ProgressTexts/index.tsx +0 -2
  172. package/src/components/Radio/Radio.module.scss +0 -36
  173. package/src/components/Radio/Radio.tsx +0 -53
  174. package/src/components/Radio/index.tsx +0 -2
  175. package/src/components/SectionContainer/SectionContainer.module.scss +0 -30
  176. package/src/components/SectionContainer/SectionContainer.tsx +0 -49
  177. package/src/components/SectionContainer/index.tsx +0 -2
  178. package/src/components/Select/Select.module.scss +0 -58
  179. package/src/components/Select/Select.tsx +0 -192
  180. package/src/components/Select/index.tsx +0 -2
  181. package/src/components/Skeleton/Skeleton.module.scss +0 -21
  182. package/src/components/Skeleton/Skeleton.tsx +0 -29
  183. package/src/components/Skeleton/index.tsx +0 -2
  184. package/src/components/Spacing/Spacing.module.scss +0 -13
  185. package/src/components/Spacing/Spacing.tsx +0 -24
  186. package/src/components/Spacing/index.tsx +0 -2
  187. package/src/components/StaticScroller/StaticScroller.module.scss +0 -14
  188. package/src/components/StaticScroller/StaticScroller.tsx +0 -83
  189. package/src/components/StaticScroller/index.tsx +0 -2
  190. package/src/components/Switch/Switch.module.scss +0 -43
  191. package/src/components/Switch/Switch.tsx +0 -41
  192. package/src/components/Switch/index.tsx +0 -2
  193. package/src/components/Table/Table.module.scss +0 -76
  194. package/src/components/Table/Table.tsx +0 -152
  195. package/src/components/Table/index.tsx +0 -2
  196. package/src/components/Tabs/Tabs.module.scss +0 -40
  197. package/src/components/Tabs/Tabs.tsx +0 -104
  198. package/src/components/Tabs/index.tsx +0 -2
  199. package/src/components/Text/Text.module.scss +0 -81
  200. package/src/components/Text/Text.tsx +0 -42
  201. package/src/components/Text/index.tsx +0 -2
  202. package/src/components/Transition/MasksFactory/DiagonalReveal.tsx +0 -47
  203. package/src/components/Transition/MasksFactory/DiagonalSquareToBalls.tsx +0 -78
  204. package/src/components/Transition/MasksFactory/PhysicsSquares.tsx +0 -106
  205. package/src/components/Transition/MasksFactory/SquareToBalls.tsx +0 -66
  206. package/src/components/Transition/MasksFactory/utils.ts +0 -35
  207. package/src/components/Transition/Transition.module.scss +0 -211
  208. package/src/components/Transition/Transition.tsx +0 -495
  209. package/src/components/Transition/index.tsx +0 -2
  210. package/src/components/UncontrolledTransition/UncontrolledTransition.ai.md +0 -9
  211. package/src/components/UncontrolledTransition/UncontrolledTransition.sample.tsx +0 -34
  212. package/src/components/UncontrolledTransition/UncontrolledTransition.tsx +0 -143
  213. package/src/components/UncontrolledTransition/index.tsx +0 -2
  214. package/src/components/WalletConnectionWrapper/WalletConnectionWrapper.tsx +0 -212
  215. package/src/components/WalletConnectionWrapper/index.tsx +0 -2
  216. package/src/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.module.scss +0 -5
  217. package/src/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.tsx +0 -52
  218. package/src/components/utilitary/ScrollAndFocusLock/index.tsx +0 -2
  219. package/src/context/AsyncProcess.tsx +0 -107
  220. package/src/context/ContextAsyncControl.tsx +0 -89
  221. package/src/context/CustomBrowserRouter.tsx +0 -55
  222. package/src/context/OneUIProvider.tsx +0 -308
  223. package/src/hooks/logs/useDependencyChangeDetection.ts +0 -25
  224. package/src/hooks/logs/useIsMounting.ts +0 -7
  225. package/src/hooks/persistence/useLocalStorage.ts +0 -45
  226. package/src/hooks/shims/ObjectWatchShim.ts +0 -56
  227. package/src/hooks/ui/useAdaptiveImage.tsx +0 -36
  228. package/src/hooks/ui/useAlternating.tsx +0 -22
  229. package/src/hooks/ui/useBreakpoint.tsx +0 -21
  230. package/src/hooks/ui/useCustomScrollbar.module.scss +0 -20
  231. package/src/hooks/ui/useCustomScrollbar.tsx +0 -22
  232. package/src/hooks/ui/useEffectIf.ts +0 -11
  233. package/src/hooks/ui/useMouseHover.tsx +0 -26
  234. package/src/hooks/ui/usePaginationControls.module.scss +0 -16
  235. package/src/hooks/ui/usePaginationControls.tsx +0 -176
  236. package/src/hooks/ui/useSnapToViewport.module.scss +0 -6
  237. package/src/hooks/ui/useSnapToViewport.ts +0 -28
  238. package/src/hooks/ui/useTilt.tsx +0 -219
  239. package/src/hooks/ui/useZoomable.module.scss +0 -34
  240. package/src/hooks/ui/useZoomable.tsx +0 -144
  241. package/src/hooks/useAsyncControl.ai.md +0 -25
  242. package/src/hooks/useAsyncControl.ts +0 -101
  243. package/src/hooks/useContainedRepositioning.ts +0 -110
  244. package/src/hooks/useCustomHistory.ts +0 -14
  245. package/src/hooks/useElementFit.ts +0 -82
  246. package/src/hooks/useFirestoreWatch.ts +0 -54
  247. package/src/hooks/useForm.ts +0 -49
  248. package/src/hooks/useFreeze.ts +0 -12
  249. package/src/hooks/useHero.module.scss +0 -41
  250. package/src/hooks/useHero.ts +0 -514
  251. package/src/hooks/useIntersection.ts +0 -32
  252. package/src/hooks/useMergeRefs.ts +0 -29
  253. package/src/hooks/useObserve.ts +0 -24
  254. package/src/hooks/usePagination.ts +0 -228
  255. package/src/hooks/usePooledOperation.ts +0 -54
  256. package/src/hooks/usePooling.ts +0 -46
  257. package/src/hooks/useRebound.ts +0 -23
  258. package/src/hooks/useShortIntl.ai.md +0 -5
  259. package/src/hooks/useShortIntl.ts +0 -97
  260. package/src/hooks/utility/useAsyncMemo.ts +0 -43
  261. package/src/hooks/utility/useDepChange.ts +0 -11
  262. package/src/hooks/utility/useEvents.ts +0 -33
  263. package/src/hooks/utility/useImmediate.ts +0 -8
  264. package/src/hooks/utility/useManualInit.ts +0 -24
  265. package/src/hooks/utility/useModule.ts +0 -15
  266. package/src/hooks/utility/useQuery.ts +0 -15
  267. package/src/hooks/utility/useUniqueEffect.ts +0 -22
  268. package/src/index.preprocess.ts +0 -82
  269. package/src/index.ts +0 -229
  270. package/src/models/DebugLogger.ts +0 -7
  271. package/src/models/GenericContract.ts +0 -169
  272. package/src/models/Orbs.ts +0 -97
  273. package/src/reac-app-env.d.ts +0 -6
  274. package/src/storybook/assets/video/txt-reversed.mp4 +0 -0
  275. package/src/storybookUtils/index.tsx +0 -53
  276. package/src/test.tsx +0 -0
  277. package/src/type-utils.ts +0 -49
  278. package/src/types.ts +0 -199
  279. package/src/utility.d.ts +0 -70
  280. package/src/utils/blockchain.ts +0 -43
  281. package/src/utils/e2e.ts +0 -55
  282. package/src/utils/flatten.ts +0 -17
  283. package/src/utils/formatters.ts +0 -36
  284. package/src/utils/html.utils.ts +0 -3
  285. package/src/utils/ownEvent.ts +0 -8
  286. package/src/utils/test.ts +0 -20
@@ -1,227 +0,0 @@
1
- import React, {
2
- ElementRef,
3
- Fragment,
4
- Key,
5
- ReactElement,
6
- TransitionEvent,
7
- useEffect,
8
- useLayoutEffect,
9
- useMemo,
10
- useRef,
11
- useState,
12
- } from "react";
13
- import { TransitionAnimationTypes } from "../Transition";
14
- import UncontrolledTransition from "../UncontrolledTransition";
15
- import Styles from "./AnimatedEntrance.module.scss";
16
-
17
- export enum EntranceType {
18
- SLIDE_AND_EXPAND,
19
- EXPAND,
20
- }
21
-
22
- const CONFIGS_BY_ENTRANCE_TYPE = {
23
- [EntranceType.SLIDE_AND_EXPAND]: {
24
- forward: {
25
- elementEntering: Styles.elementEntering,
26
- elementExiting: Styles.elementExiting,
27
- },
28
- backward: {
29
- elementEntering: Styles.elementEnteringReverse,
30
- elementExiting: Styles.elementExitingReverse,
31
- },
32
- },
33
- [EntranceType.EXPAND]: {
34
- forward: {
35
- elementEntering: Styles.elementExpanding,
36
- elementExiting: Styles.elementShrinking,
37
- },
38
- backward: {
39
- elementEntering: Styles.elementExpandingReverse,
40
- elementExiting: Styles.elementShrinkingReverse,
41
- },
42
- },
43
- };
44
-
45
- export function AnimatedEntranceItem({
46
- children,
47
- noEntranceAnimation,
48
- onRemoveChildren,
49
- entranceType,
50
- }: {
51
- children: ReactElement;
52
- noEntranceAnimation: boolean;
53
- onRemoveChildren: (key: Key) => void;
54
- entranceType: EntranceType;
55
- }) {
56
- const uncontRef = useRef<ElementRef<typeof UncontrolledTransition>>(null);
57
- const [screen, setScreen] = useState<ReactElement | string | null>(
58
- noEntranceAnimation ? children : <Fragment key={"null"} />
59
- );
60
- console.log(screen, children.key)
61
- useLayoutEffect(() => {
62
- if (String(children.key).includes("-nullated") && uncontRef.current) {
63
- uncontRef.current!.setOrientation("backward");
64
- }
65
- }, [children.key]);
66
-
67
- useEffect(() => {
68
- setScreen(String(children.key));
69
- }, [children.key]);
70
-
71
- useEffect(() => {
72
- if (screen === null) return;
73
- const x = setTimeout(() => {
74
- const key = String(typeof screen === "string" ? screen : screen.key!);
75
- if (key === "null" || key.includes("-nullated")) {
76
- uncontRef.current!.sectionRef.current!.style.maxHeight = `${uncontRef.current!.sectionRef.current!.scrollHeight
77
- }px`;
78
- setTimeout(() => {
79
- uncontRef.current!.sectionRef.current!.style.maxHeight = `0px`;
80
- }, 100);
81
- } else {
82
- uncontRef.current!.sectionRef.current!.style.maxHeight = `${uncontRef.current!.sectionRef.current!.scrollHeight
83
- }px`;
84
- if (!noEntranceAnimation) {
85
- const restoreAutoHeight = ({
86
- target,
87
- currentTarget,
88
- }: TransitionEvent<HTMLDivElement>) => {
89
- if (target !== currentTarget) return;
90
- uncontRef.current!.sectionRef.current!.style.removeProperty(
91
- "max-height"
92
- );
93
- uncontRef.current!.sectionRef.current!.classList.remove(
94
- Styles.maxHeight
95
- );
96
- uncontRef.current!.sectionRef.current!.removeEventListener(
97
- "transitionend",
98
- restoreAutoHeight as any
99
- );
100
- };
101
- uncontRef.current!.sectionRef.current!.addEventListener(
102
- "transitionend",
103
- restoreAutoHeight as any
104
- );
105
- } else {
106
- uncontRef.current!.sectionRef.current!.style.removeProperty(
107
- "max-height"
108
- );
109
- uncontRef.current!.sectionRef.current!.classList.remove(
110
- Styles.maxHeight
111
- );
112
- }
113
- }
114
- }, 100);
115
- return () => {
116
- clearTimeout(x);
117
- };
118
- }, [typeof screen === "object" ? screen?.key : screen]);
119
-
120
- const firstRenderClass = useMemo(
121
- () => (noEntranceAnimation ? "" : Styles.maxHeight),
122
- [screen === null]
123
- );
124
-
125
- return (
126
- <UncontrolledTransition
127
- ref={uncontRef}
128
- transitionType={TransitionAnimationTypes.CUSTOM}
129
- className={`${Styles.resetHeight} ${firstRenderClass}`}
130
- lockTransitionWidth
131
- key={String(children.key).replace("-nullated", "")}
132
- onDiscardStep={(k) => {
133
- if (k !== "null") {
134
- onRemoveChildren(k!);
135
- setScreen(null);
136
- }
137
- }}
138
- config={CONFIGS_BY_ENTRANCE_TYPE[entranceType]}
139
- >
140
- {screen === null ? (
141
- <Fragment key={"null"} />
142
- ) : typeof screen === "string" ? (
143
- (children.key?.endsWith("-nullated") && screen.endsWith("-nullated"))
144
- ? <Fragment key={children.key + "-null"} />
145
- : children
146
- ) : (
147
- screen
148
- )}
149
- </UncontrolledTransition>
150
- );
151
- }
152
-
153
- /**
154
- * Animates the entrance and exit of a component
155
- **/
156
- export default function AnimatedEntrance({
157
- children,
158
- entranceType = EntranceType.SLIDE_AND_EXPAND,
159
- }: {
160
- children: ReactElement[];
161
- entranceType?: EntranceType;
162
- }) {
163
- const firstRef = useRef(true);
164
- useEffect(() => {
165
- firstRef.current = false;
166
- }, []);
167
- const prevChildren = useRef([] as typeof children);
168
- const childrenDelayed = useMemo(() => {
169
- const newChildren = children.filter(
170
- (c) => !prevChildren.current.find((a) => a.key === c.key)
171
- );
172
- const filteredOutChildren = prevChildren.current.map((c) => {
173
- return children.find((a) => a.key === c.key) ? ( // If the previous child still exists, mantain
174
- c
175
- ) : (
176
- // If not, toggle to null to animate exit
177
- <Fragment
178
- key={
179
- String(c.key).includes("-nullated") ? c.key : `${c.key}-nullated`
180
- }
181
- >
182
- {prevChildren.current.find(a => a.key === c.key)}
183
- </Fragment>
184
- );
185
- });
186
-
187
- for (let child of newChildren) {
188
- const previousChildKey = children[children.indexOf(child) - 1]?.key;
189
- if (previousChildKey) {
190
- filteredOutChildren.splice(
191
- filteredOutChildren.findIndex((a) => a.key === previousChildKey) + 1,
192
- 0,
193
- child
194
- );
195
- } else {
196
- filteredOutChildren.unshift(child);
197
- }
198
- }
199
-
200
- return filteredOutChildren;
201
- }, [children]);
202
- prevChildren.current = childrenDelayed;
203
-
204
- console.log(childrenDelayed.map(a => a.key));
205
-
206
-
207
- return (
208
- <>
209
- {childrenDelayed.map((child) => (
210
- <AnimatedEntranceItem
211
- key={String(child.key!).replace("-nullated", "")}
212
- noEntranceAnimation={firstRef.current}
213
- entranceType={entranceType}
214
- onRemoveChildren={(k) => {
215
-
216
- (prevChildren.current = prevChildren.current.filter(
217
- (a) => a.key !== String(k) + "-nullated"
218
- ))
219
- }
220
- }
221
- >
222
- {children.find((c) => c.key === child.key) || child}
223
- </AnimatedEntranceItem>
224
- ))}
225
- </>
226
- );
227
- }
@@ -1,2 +0,0 @@
1
- export { default } from "./AnimatedEntrance";
2
- export * from "./AnimatedEntrance";
@@ -1,38 +0,0 @@
1
- import React, { PropsWithChildren } from "react";
2
- import { useOneUIContext } from "../../context/OneUIProvider";
3
- import AdaptiveDialog from "../AdaptiveDialog";
4
- import Button from "../Button";
5
- import Loader from "../Loader";
6
- import Text from "../Text";
7
-
8
- /**
9
- * This is a generic implementation of the loading, and error handling
10
- **/
11
- export default function AsyncWrapper({
12
- loading,
13
- error,
14
- onClose,
15
- onRetry,
16
- children,
17
- }: PropsWithChildren<{
18
- loading: boolean;
19
- error: boolean;
20
- onClose: () => void;
21
- onRetry: () => void;
22
- }>) {
23
- const {
24
- LoadingComponent = Loader,
25
- messages,
26
- } = useOneUIContext().component.asyncWrapper;
27
-
28
- return (
29
- <>
30
- {children}
31
- <AdaptiveDialog open={error} onClose={onClose}>
32
- <Text type="highlightTitle">{messages.error.title}</Text>
33
- <Button onClick={() => onRetry()}>{messages.error.retryBtn}</Button>
34
- </AdaptiveDialog>
35
- {loading ? <LoadingComponent /> : null}
36
- </>
37
- );
38
- }
@@ -1,2 +0,0 @@
1
- export { default } from "./AsyncWrapper";
2
- export * from "./AsyncWrapper";
@@ -1,22 +0,0 @@
1
- @import "../../assets/styles/index.scss";
2
-
3
- .container {
4
- &.noImg {
5
- background-color: $avatarBackgroundColor;
6
- }
7
- display: inline-block;
8
- width: 1em;
9
- height: 1em;
10
- border-radius: 0.5em;
11
-
12
- > span,
13
- > img {
14
- font-size: 0.4em;
15
- width: inherit;
16
- height: inherit;
17
- text-align: center;
18
- line-height: 2.5em;
19
- display: block;
20
- color: $digitalBlue;
21
- }
22
- }
@@ -1,31 +0,0 @@
1
- import React, { useMemo } from "react";
2
- import Styles from "./Avatar.module.scss";
3
-
4
- /**
5
- * A simple avatar that shows the image of the user or it's initials as fallback
6
- **/
7
- export default function Avatar({
8
- name,
9
- imgSrc,
10
- size = 48,
11
- }: {
12
- imgSrc?: string;
13
- name: string;
14
- size?: number;
15
- }) {
16
- const initials = useMemo(() => {
17
- const nameParts = name.trim().split(" ");
18
- if (nameParts.length === 1) return nameParts[0].charAt(0).toUpperCase();
19
- const [firstName, lastName] = [nameParts[0], nameParts.slice(-1)[0]];
20
- return `${firstName.charAt(0)}${lastName.charAt(0)}`.toUpperCase();
21
- }, [name]);
22
- return (
23
- <div
24
- className={`${Styles.container} ${imgSrc ? "" : Styles.noImg}`}
25
- style={{ fontSize: size }}
26
- title={name}
27
- >
28
- {imgSrc ? <img src={imgSrc} alt={name} /> : <span>{initials}</span>}
29
- </div>
30
- );
31
- }
@@ -1,2 +0,0 @@
1
- export { default } from "./Avatar";
2
- export * from "./Avatar";
@@ -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,2 +0,0 @@
1
- export { default } from "./BucketFill";
2
- export * from "./BucketFill";
@@ -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,2 +0,0 @@
1
- export { default } from "./Button";
2
- export * from "./Button";
@@ -1,12 +0,0 @@
1
- @import "../../assets/styles/index.scss";
2
-
3
- .container {
4
- background: $mainBackgroundColor;
5
- padding: 32px;
6
- max-width: 640px;
7
- width: 100%;
8
- display: flex;
9
- align-items: stretch;
10
- flex-direction: column;
11
- height: auto;
12
- }
@@ -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,2 +0,0 @@
1
- export { default } from "./Card";
2
- export * from "./Card";
@@ -1,4 +0,0 @@
1
- export enum ChartDataTestIds {
2
- Y_AXIS = "y",
3
- X_AXIS = "x",
4
- }
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import View from "./Chart.view";
3
- import { ChartProps } from "./Chart.types";
4
-
5
- /** An proprietary implementation of some chart variations */
6
- export default function ChartLogic(props: ChartProps) {
7
- return <View {...props} />;
8
- }
@@ -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,2 +0,0 @@
1
- export { default } from "./Chart.logic";
2
- export * from "./Chart.logic";
@@ -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
- };