@ainias42/react-bootstrap-mobile 1.0.4 → 1.0.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.
Files changed (247) hide show
  1. package/dist/Components/ActionSheet/ActionSheet.d.ts +2 -2
  2. package/dist/Components/ActionSheet/ActionSheet.stories.d.ts +3 -3
  3. package/dist/Components/Card/Card.d.ts +1 -1
  4. package/dist/Components/Card/Card.stories.d.ts +2 -2
  5. package/dist/Components/Clickable/Clickable.d.ts +2 -2
  6. package/dist/Components/Dialog/AlertDialog.stories.d.ts +1 -1
  7. package/dist/Components/Dialog/ButtonDialog.d.ts +2 -2
  8. package/dist/Components/Dialog/ConfirmDialog.stories.d.ts +2 -2
  9. package/dist/Components/Dialog/Dialog.d.ts +1 -1
  10. package/dist/Components/Dialog/DialogBackground.d.ts +1 -1
  11. package/dist/Components/Dialog/DialogContainer.d.ts +1 -1
  12. package/dist/Components/Dialog/DialogContext.d.ts +1 -1
  13. package/dist/Components/DragAndDrop/DragItem.d.ts +1 -1
  14. package/dist/Components/DragAndDrop/DropArea.d.ts +1 -1
  15. package/dist/Components/FormElements/Button/Button.d.ts +9 -6
  16. package/dist/Components/FormElements/Button/Button.stories.d.ts +12 -6
  17. package/dist/Components/FormElements/CheckBox/Checkbox.d.ts +2 -2
  18. package/dist/Components/FormElements/CheckBox/Checkbox.stories.d.ts +1 -1
  19. package/dist/Components/FormElements/ColorInput/ColorInput.d.ts +1 -1
  20. package/dist/Components/FormElements/ColorInput/ColorInput.stories.d.ts +1 -1
  21. package/dist/Components/FormElements/Controller/ColorInputController.d.ts +1 -1
  22. package/dist/Components/FormElements/Controller/FileInputController.d.ts +1 -1
  23. package/dist/Components/FormElements/Controller/InputController.d.ts +1 -1
  24. package/dist/Components/FormElements/Controller/MultipleFileInputController.d.ts +1 -1
  25. package/dist/Components/FormElements/Controller/PasswordInputController.d.ts +1 -1
  26. package/dist/Components/FormElements/Controller/SelectController.d.ts +1 -1
  27. package/dist/Components/FormElements/Controller/SliderController.d.ts +1 -1
  28. package/dist/Components/FormElements/Controller/SwitchController.d.ts +1 -1
  29. package/dist/Components/FormElements/Controller/TextareaController.d.ts +1 -1
  30. package/dist/Components/FormElements/Error/FormError.stories.d.ts +1 -1
  31. package/dist/Components/FormElements/Form.stories.d.ts +1 -1
  32. package/dist/Components/FormElements/Input/FileInput/FileInput.d.ts +5 -5
  33. package/dist/Components/FormElements/Input/FileInput/MultipleFileInput.d.ts +4 -4
  34. package/dist/Components/FormElements/Input/HiddenInput.d.ts +1 -1
  35. package/dist/Components/FormElements/Input/HiddenInput.stories.d.ts +1 -1
  36. package/dist/Components/FormElements/Input/Input.d.ts +3 -3
  37. package/dist/Components/FormElements/Input/Input.stories.d.ts +1 -1
  38. package/dist/Components/FormElements/Input/PasswordInput/PasswordInput.d.ts +2 -2
  39. package/dist/Components/FormElements/Input/PasswordInput/PasswordInput.stories.d.ts +1 -1
  40. package/dist/Components/FormElements/SearchSelectInput/SearchSelectInput.d.ts +3 -3
  41. package/dist/Components/FormElements/SearchSelectInput/SearchSelectInput.stories.d.ts +1 -1
  42. package/dist/Components/FormElements/Select/Select.d.ts +3 -3
  43. package/dist/Components/FormElements/Select/Select.stories.d.ts +1 -1
  44. package/dist/Components/FormElements/Slider/Slider.d.ts +3 -3
  45. package/dist/Components/FormElements/Slider/Slider.stories.d.ts +1 -1
  46. package/dist/Components/FormElements/Switch/Switch.d.ts +3 -3
  47. package/dist/Components/FormElements/Switch/Switch.stories.d.ts +1 -1
  48. package/dist/Components/FormElements/Textarea/Textarea.d.ts +3 -3
  49. package/dist/Components/FormElements/Textarea/Textarea.stories.d.ts +1 -1
  50. package/dist/Components/FullScreen/FullScreen.d.ts +2 -2
  51. package/dist/Components/Icon/BaseIcon.d.ts +15 -0
  52. package/dist/Components/Icon/DoubleIcon.d.ts +1 -1
  53. package/dist/Components/Icon/DoubleIcon.stories.d.ts +1 -1
  54. package/dist/Components/Icon/Icon.d.ts +4 -13
  55. package/dist/Components/Icon/Icon.stories.d.ts +1 -1
  56. package/dist/Components/Image/Image.d.ts +2 -2
  57. package/dist/Components/Image/Image.stories.d.ts +1 -1
  58. package/dist/Components/InViewport/InViewport.d.ts +1 -1
  59. package/dist/Components/Layout/BaseBlock.d.ts +10 -0
  60. package/dist/Components/Layout/BaseInlineBlock.d.ts +10 -0
  61. package/dist/Components/Layout/Block.d.ts +4 -10
  62. package/dist/Components/Layout/Container.d.ts +1 -1
  63. package/dist/Components/Layout/Flex.d.ts +8 -3
  64. package/dist/Components/Layout/Grid/Grid.d.ts +1 -1
  65. package/dist/Components/Layout/Grid/GridItem.d.ts +1 -1
  66. package/dist/Components/Layout/Grow.d.ts +1 -1
  67. package/dist/Components/Layout/Inline.d.ts +2 -2
  68. package/dist/Components/Layout/InlineBlock.d.ts +4 -10
  69. package/dist/Components/Layout/View.d.ts +4 -4
  70. package/dist/Components/Layout/ViewWithoutListeners.d.ts +1 -1
  71. package/dist/Components/LoadingArea/LoadingArea.d.ts +1 -1
  72. package/dist/Components/LoadingArea/LoadingArea.stories.d.ts +2 -2
  73. package/dist/Components/LoadingCircle/LoadingCircle.d.ts +2 -2
  74. package/dist/Components/LoadingCircle/LoadingCircle.stories.d.ts +2 -2
  75. package/dist/Components/Menu/HoverMenu.d.ts +1 -1
  76. package/dist/Components/Menu/HoverMenu.stories.d.ts +1 -1
  77. package/dist/Components/Menu/Menu.d.ts +2 -2
  78. package/dist/Components/Menu/Menu.stories.d.ts +1 -1
  79. package/dist/Components/Menu/MenuItem.d.ts +2 -2
  80. package/dist/Components/Menu/MenuItem.stories.d.ts +1 -1
  81. package/dist/Components/Menu/Submenu.d.ts +2 -2
  82. package/dist/Components/Menu/Submenu.stories.d.ts +1 -1
  83. package/dist/Components/Menu/useHoverMenu.d.ts +17 -0
  84. package/dist/Components/Menu/useMenu.d.ts +1 -1
  85. package/dist/Components/RbmComponentProps.d.ts +1 -1
  86. package/dist/Components/SizeCalculator/SizeCalculator.d.ts +1 -1
  87. package/dist/Components/SpoilerList/Spoiler/Spoiler.d.ts +3 -3
  88. package/dist/Components/SpoilerList/Spoiler/Spoiler.stories.d.ts +1 -1
  89. package/dist/Components/SpoilerList/SpoilerList.d.ts +1 -1
  90. package/dist/Components/TabBar/TabBar.d.ts +2 -2
  91. package/dist/Components/TabBar/TabBar.stories.d.ts +1 -1
  92. package/dist/Components/TabBar/TabBarButton.d.ts +2 -2
  93. package/dist/Components/Table/Table.d.ts +1 -1
  94. package/dist/Components/Text/Heading.d.ts +2 -2
  95. package/dist/Components/Text/Text.d.ts +2 -2
  96. package/dist/Components/Text/Text.stories.d.ts +1 -1
  97. package/dist/Components/Title/HoverTitle.d.ts +9 -0
  98. package/dist/Components/Title/Title.stories.d.ts +11 -0
  99. package/dist/Components/Title/withTitle.d.ts +6 -0
  100. package/dist/Components/Toast/Toast.d.ts +2 -2
  101. package/dist/Components/Toast/Toast.stories.d.ts +1 -1
  102. package/dist/Components/Toast/ToastContainer.d.ts +2 -2
  103. package/dist/Components/TopBar/MoreButton.d.ts +1 -1
  104. package/dist/Components/TopBar/TopBar.d.ts +2 -2
  105. package/dist/Components/TopBar/TopBar.stories.d.ts +1 -1
  106. package/dist/Components/TopBar/TopBarButton.d.ts +1 -1
  107. package/dist/helper/withMemo.d.ts +1 -1
  108. package/dist/helper/withRestrictedChildren.d.ts +1 -1
  109. package/dist/index.css +4 -3
  110. package/dist/index.css.map +1 -1
  111. package/dist/index.d.ts +6 -0
  112. package/dist/index.js +420 -205
  113. package/dist/index.js.map +1 -1
  114. package/eslint.config.js +1 -0
  115. package/package.json +1 -1
  116. package/src/Components/ActionSheet/ActionSheet.stories.tsx +3 -4
  117. package/src/Components/ActionSheet/ActionSheet.tsx +20 -18
  118. package/src/Components/Card/Card.stories.tsx +3 -4
  119. package/src/Components/Card/Card.tsx +3 -3
  120. package/src/Components/Clickable/Clickable.tsx +6 -6
  121. package/src/Components/Colors.stories.tsx +11 -12
  122. package/src/Components/Dialog/AlertDialog.stories.tsx +2 -2
  123. package/src/Components/Dialog/AlertDialog.tsx +2 -2
  124. package/src/Components/Dialog/ButtonDialog.tsx +15 -15
  125. package/src/Components/Dialog/ConfirmDialog.stories.tsx +3 -4
  126. package/src/Components/Dialog/ConfirmDialog.tsx +2 -2
  127. package/src/Components/Dialog/Dialog.tsx +10 -10
  128. package/src/Components/Dialog/DialogBackground.tsx +12 -12
  129. package/src/Components/Dialog/DialogContainer.tsx +7 -7
  130. package/src/Components/Dialog/DialogContext.ts +1 -1
  131. package/src/Components/Dialog/useAlertDialog.ts +2 -2
  132. package/src/Components/Dialog/useConfirmDialog.ts +2 -2
  133. package/src/Components/DragAndDrop/DragItem.tsx +2 -2
  134. package/src/Components/DragAndDrop/DropArea.tsx +3 -3
  135. package/src/Components/ErrorBoundary.tsx +5 -5
  136. package/src/Components/FormElements/Button/Button.stories.tsx +6 -6
  137. package/src/Components/FormElements/Button/Button.tsx +9 -9
  138. package/src/Components/FormElements/CheckBox/Checkbox.stories.tsx +1 -1
  139. package/src/Components/FormElements/CheckBox/Checkbox.tsx +6 -6
  140. package/src/Components/FormElements/ColorInput/ColorInput.stories.tsx +1 -1
  141. package/src/Components/FormElements/ColorInput/ColorInput.tsx +8 -8
  142. package/src/Components/FormElements/Controller/ColorInputController.ts +2 -2
  143. package/src/Components/FormElements/Controller/FileInputController.tsx +4 -4
  144. package/src/Components/FormElements/Controller/HookForm.tsx +4 -4
  145. package/src/Components/FormElements/Controller/InputController.ts +2 -2
  146. package/src/Components/FormElements/Controller/MultipleFileInputController.ts +2 -2
  147. package/src/Components/FormElements/Controller/PasswordInputController.ts +2 -2
  148. package/src/Components/FormElements/Controller/SelectController.ts +2 -2
  149. package/src/Components/FormElements/Controller/SliderController.ts +2 -2
  150. package/src/Components/FormElements/Controller/SwitchController.ts +2 -2
  151. package/src/Components/FormElements/Controller/TextareaController.ts +2 -2
  152. package/src/Components/FormElements/Controller/withHookController.tsx +2 -2
  153. package/src/Components/FormElements/Error/FormError.stories.tsx +1 -1
  154. package/src/Components/FormElements/Error/FormError.tsx +9 -9
  155. package/src/Components/FormElements/Form.stories.tsx +1 -1
  156. package/src/Components/FormElements/Input/FileInput/FileInput.tsx +8 -8
  157. package/src/Components/FormElements/Input/FileInput/MultipleFileInput.tsx +21 -21
  158. package/src/Components/FormElements/Input/HiddenInput.stories.tsx +1 -1
  159. package/src/Components/FormElements/Input/HiddenInput.tsx +4 -4
  160. package/src/Components/FormElements/Input/Input.stories.tsx +1 -1
  161. package/src/Components/FormElements/Input/Input.tsx +11 -11
  162. package/src/Components/FormElements/Input/PasswordInput/PasswordInput.stories.tsx +1 -1
  163. package/src/Components/FormElements/Input/PasswordInput/PasswordInput.tsx +10 -10
  164. package/src/Components/FormElements/SearchSelectInput/SearchSelectInput.stories.tsx +2 -2
  165. package/src/Components/FormElements/SearchSelectInput/SearchSelectInput.tsx +19 -19
  166. package/src/Components/FormElements/Select/Select.stories.tsx +1 -1
  167. package/src/Components/FormElements/Select/Select.tsx +7 -7
  168. package/src/Components/FormElements/Slider/Slider.stories.tsx +1 -1
  169. package/src/Components/FormElements/Slider/Slider.tsx +7 -7
  170. package/src/Components/FormElements/Switch/Switch.stories.tsx +1 -1
  171. package/src/Components/FormElements/Switch/Switch.tsx +7 -7
  172. package/src/Components/FormElements/Textarea/Textarea.stories.tsx +1 -1
  173. package/src/Components/FormElements/Textarea/Textarea.tsx +9 -9
  174. package/src/Components/FullScreen/FullScreen.tsx +4 -4
  175. package/src/Components/Hooks/useBreakpoint.ts +1 -1
  176. package/src/Components/Hooks/useDelayed.ts +5 -4
  177. package/src/Components/Hooks/useDelayedState.ts +1 -1
  178. package/src/Components/Hooks/useKeyListener.ts +1 -1
  179. package/src/Components/Hooks/useMousePosition.ts +1 -1
  180. package/src/Components/Hooks/useWindowDimensions.ts +1 -1
  181. package/src/Components/Icon/{Icon.tsx → BaseIcon.tsx} +10 -8
  182. package/src/Components/Icon/DoubleIcon.stories.tsx +1 -1
  183. package/src/Components/Icon/DoubleIcon.tsx +9 -9
  184. package/src/Components/Icon/Icon.stories.tsx +3 -3
  185. package/src/Components/Icon/Icon.ts +4 -0
  186. package/src/Components/Image/Image.stories.tsx +1 -1
  187. package/src/Components/Image/Image.tsx +4 -4
  188. package/src/Components/InViewport/InViewport.tsx +3 -3
  189. package/src/Components/Layout/{Block.tsx → BaseBlock.tsx} +8 -9
  190. package/src/Components/Layout/{InlineBlock.tsx → BaseInlineBlock.tsx} +6 -6
  191. package/src/Components/Layout/Block.ts +4 -0
  192. package/src/Components/Layout/Container.tsx +3 -3
  193. package/src/Components/Layout/Flex.tsx +21 -5
  194. package/src/Components/Layout/Grid/Grid.tsx +6 -6
  195. package/src/Components/Layout/Grid/GridItem.tsx +6 -6
  196. package/src/Components/Layout/Grow.tsx +3 -3
  197. package/src/Components/Layout/Inline.tsx +5 -5
  198. package/src/Components/Layout/InlineBlock.ts +4 -0
  199. package/src/Components/Layout/View.tsx +4 -4
  200. package/src/Components/Layout/ViewWithoutListeners.tsx +3 -3
  201. package/src/Components/Layout/layout.module.scss +13 -0
  202. package/src/Components/LoadingArea/LoadingArea.stories.tsx +5 -5
  203. package/src/Components/LoadingArea/LoadingArea.tsx +5 -5
  204. package/src/Components/LoadingCircle/LoadingCircle.stories.tsx +2 -2
  205. package/src/Components/LoadingCircle/LoadingCircle.tsx +4 -4
  206. package/src/Components/Menu/HoverMenu.stories.tsx +5 -5
  207. package/src/Components/Menu/HoverMenu.tsx +13 -33
  208. package/src/Components/Menu/Menu.stories.tsx +5 -5
  209. package/src/Components/Menu/Menu.tsx +12 -12
  210. package/src/Components/Menu/MenuDivider.tsx +4 -4
  211. package/src/Components/Menu/MenuItem.stories.tsx +1 -1
  212. package/src/Components/Menu/MenuItem.tsx +12 -12
  213. package/src/Components/Menu/Submenu.stories.tsx +3 -3
  214. package/src/Components/Menu/Submenu.tsx +16 -16
  215. package/src/Components/Menu/menu.module.scss +3 -2
  216. package/src/Components/Menu/useHoverMenu.ts +36 -0
  217. package/src/Components/Menu/useMenu.ts +1 -1
  218. package/src/Components/RbmComponentProps.ts +1 -1
  219. package/src/Components/SizeCalculator/SizeCalculator.tsx +5 -5
  220. package/src/Components/SpoilerList/Spoiler/Spoiler.stories.tsx +1 -1
  221. package/src/Components/SpoilerList/Spoiler/Spoiler.tsx +18 -18
  222. package/src/Components/SpoilerList/SpoilerList.tsx +7 -7
  223. package/src/Components/TabBar/TabBar.stories.tsx +1 -1
  224. package/src/Components/TabBar/TabBar.tsx +11 -11
  225. package/src/Components/TabBar/TabBarButton.tsx +5 -5
  226. package/src/Components/Table/Table.tsx +2 -2
  227. package/src/Components/Text/Heading.tsx +5 -5
  228. package/src/Components/Text/Text.stories.tsx +1 -1
  229. package/src/Components/Text/Text.tsx +6 -6
  230. package/src/Components/Title/HoverTitle.tsx +97 -0
  231. package/src/Components/Title/Title.stories.tsx +95 -0
  232. package/src/Components/Title/hoverTitle.module.scss +8 -0
  233. package/src/Components/Title/withTitle.module.scss +7 -0
  234. package/src/Components/Title/withTitle.tsx +48 -0
  235. package/src/Components/Toast/Toast.stories.tsx +1 -1
  236. package/src/Components/Toast/Toast.tsx +6 -6
  237. package/src/Components/Toast/ToastContainer.tsx +7 -7
  238. package/src/Components/TopBar/MoreButton.tsx +7 -8
  239. package/src/Components/TopBar/TopBar.stories.tsx +1 -1
  240. package/src/Components/TopBar/TopBar.tsx +18 -18
  241. package/src/Components/TopBar/TopBarButton.tsx +3 -3
  242. package/src/WrongChildError.ts +1 -0
  243. package/src/helper/nonEmptyString.ts +1 -1
  244. package/src/helper/withMemo.ts +3 -3
  245. package/src/helper/withRestrictedChildren.tsx +5 -3
  246. package/src/index.ts +6 -0
  247. package/tsconfig.json +2 -8
@@ -1,16 +1,16 @@
1
1
  import * as React from 'react';
2
- import { FormError } from '@/Components/FormElements/Error/FormError';
2
+ import { FormError } from '../Error/FormError';
3
3
  import { useCallback, useRef } from 'react';
4
- import { useComposedRef } from '@/Components/Hooks/useComposedRef';
5
- import { useListenerWithExtractedProps } from '@/Components/Hooks/useListener';
6
- import { useOnChangeDone } from '@/Components/FormElements/hooks/useOnChangeDone';
7
- import { withMemo } from '@/helper/withMemo';
4
+ import { useComposedRef } from '../../Hooks/useComposedRef';
5
+ import { useListenerWithExtractedProps } from '../../Hooks/useListener';
6
+ import { useOnChangeDone } from '../hooks/useOnChangeDone';
7
+ import { withMemo } from '../../../helper/withMemo';
8
8
  import classNames from 'classnames';
9
- import styles from '@/Components/FormElements/Textarea/textarea.module.scss';
9
+ import styles from './textarea.module.scss';
10
10
  import type { CSSProperties, ChangeEvent, ForwardedRef, KeyboardEvent, TextareaHTMLAttributes } from 'react';
11
- import type { OptionalListener } from '@/Components/Hooks/useListener';
12
- import type { Override } from '@/TypeHelpers';
13
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
11
+ import type { OptionalListener } from '../../Hooks/useListener';
12
+ import type { Override } from '../../../TypeHelpers';
13
+ import type { RbmComponentProps } from '../../RbmComponentProps';
14
14
 
15
15
  export type TextareaProps<OnChangeData, OnChangeDoneData> = RbmComponentProps<
16
16
  Override<
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
3
  import { useCallback, useEffect, useMemo, useRef } from 'react';
4
- import { useWindow } from '@/WindowContext/WindowContext';
5
- import { withMemo } from '@/helper/withMemo';
4
+ import { useWindow } from '../../WindowContext/WindowContext';
5
+ import { withMemo } from '../../helper/withMemo';
6
6
  import type { ComponentPropsWithoutRef } from 'react';
7
- import type { Override } from '@/TypeHelpers';
8
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
7
+ import type { Override } from '../../TypeHelpers';
8
+ import type { RbmComponentProps } from '../RbmComponentProps';
9
9
  import IntrinsicElements = JSX.IntrinsicElements;
10
10
 
11
11
  export type FullScreenProps<AsType extends keyof IntrinsicElements> = RbmComponentProps<
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { useWindow } from '@/WindowContext/WindowContext';
2
+ import { useWindow } from '../../WindowContext/WindowContext';
3
3
 
4
4
  export const BreakpointNames = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
5
5
 
@@ -13,7 +13,7 @@ export function useDelayed<Args extends any[]>(
13
13
 
14
14
  // eslint-disable-next-line react-hooks/exhaustive-deps
15
15
  const realCB = useCallback(callback, dependencies);
16
- const func = useCallback(
16
+ return useCallback(
17
17
  (...newArgs: Args) => {
18
18
  argsRef.current = newArgs;
19
19
 
@@ -25,13 +25,16 @@ export function useDelayed<Args extends any[]>(
25
25
 
26
26
  if (argsRef.current !== undefined) {
27
27
  realCB(...argsRef.current);
28
+ argsRef.current = undefined;
28
29
  }
29
30
  };
30
31
 
31
32
  if (timeoutRef.current) {
32
33
  clearTimeout(timeoutRef.current);
33
34
  }
34
- timeoutRef.current = setTimeout(triggerFunc, delay);
35
+ timeoutRef.current = setTimeout(() => {
36
+ triggerFunc();
37
+ }, delay);
35
38
 
36
39
  if (maxDelay && maxDelayTimeout.current === undefined) {
37
40
  maxDelayTimeout.current = setTimeout(() => {
@@ -41,6 +44,4 @@ export function useDelayed<Args extends any[]>(
41
44
  },
42
45
  [delay, maxDelay, realCB],
43
46
  );
44
-
45
- return func;
46
47
  }
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useState } from 'react';
2
- import { useDelayed } from '@/Components/Hooks/useDelayed';
2
+ import { useDelayed } from './useDelayed';
3
3
 
4
4
  export function useDelayedState<T>(initialState: T | (() => T), delay = 100, maxDelay: number | undefined = undefined) {
5
5
  const [immediateState, setImmediateState] = useState(initialState);
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { useWindow } from '@/WindowContext/WindowContext';
2
+ import { useWindow } from '../../WindowContext/WindowContext';
3
3
 
4
4
  function isFormElement(element: EventTarget | null) {
5
5
  return (
@@ -1,4 +1,4 @@
1
- import { useClientLayoutEffect } from '@/Components/Hooks/useClientLayoutEffect';
1
+ import { useClientLayoutEffect } from './useClientLayoutEffect';
2
2
  import { useRef } from 'react';
3
3
 
4
4
  export function useMousePosition() {
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useReducer } from 'react';
2
- import { useWindow } from '@/WindowContext/WindowContext';
2
+ import { useWindow } from '../../WindowContext/WindowContext';
3
3
 
4
4
  export function useWindowDimensions() {
5
5
  const [, redraw] = useReducer((x) => x + 1, 0);
@@ -1,13 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
- import { withMemo } from '@/helper/withMemo';
3
+ import { withMemo } from '../../helper/withMemo';
4
4
  import classNames from 'classnames';
5
- import styles from '@/Components/Icon/icon.module.scss';
5
+ import styles from './icon.module.scss';
6
6
  import type { FontAwesomeIconProps } from '@fortawesome/react-fontawesome';
7
7
  import type { IconDefinition } from '@fortawesome/free-regular-svg-icons';
8
8
  import type { IconProp } from '@fortawesome/fontawesome-svg-core';
9
- import type { Override } from '@/TypeHelpers';
10
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
9
+ import type { Override } from '../../TypeHelpers';
10
+ import type { RbmComponentProps } from '../RbmComponentProps';
11
+ import type { Ref } from 'react';
11
12
 
12
13
  export type IconSource = IconProp | string | IconDefinition;
13
14
 
@@ -18,17 +19,18 @@ export type IconProps = RbmComponentProps<
18
19
  noMargin?: boolean;
19
20
  icon: IconSource;
20
21
  alt?: string;
22
+ ref?: Ref<HTMLImageElement | null>;
21
23
  }
22
24
  >
23
25
  >;
24
26
 
25
- export const Icon = withMemo(function Icon({
27
+ export const BaseIcon = withMemo(function BaseIcon({
26
28
  icon,
27
29
  alt,
28
30
  className,
29
31
  noMargin = true,
30
32
  style,
31
- title,
33
+ ref,
32
34
  ...props
33
35
  }: IconProps) {
34
36
  // Variables
@@ -55,7 +57,7 @@ export const Icon = withMemo(function Icon({
55
57
  alt={alt}
56
58
  className={classNames(styles.imgIcon, className, { [styles.margin]: !noMargin })}
57
59
  style={style}
58
- title={title}
60
+ ref={ref}
59
61
  />
60
62
  );
61
63
  }
@@ -65,7 +67,7 @@ export const Icon = withMemo(function Icon({
65
67
  icon={icon as IconProp}
66
68
  className={classNames(className, { [styles.margin]: !noMargin })}
67
69
  style={style}
68
- title={title}
70
+ ref={ref as Ref<SVGSVGElement>}
69
71
  />
70
72
  );
71
73
  });
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
 
3
- import { DoubleIcon } from '@/Components/Icon/DoubleIcon';
3
+ import { DoubleIcon } from './DoubleIcon';
4
4
  import { faHouse, faUser } from '@fortawesome/free-solid-svg-icons';
5
5
 
6
6
  const meta = {
@@ -1,9 +1,9 @@
1
- import { Icon } from '@/Components/Icon/Icon';
2
- import { InlineBlock } from '@/Components/Layout/InlineBlock';
3
- import { withMemo } from '@/helper/withMemo';
1
+ import { BaseIcon } from './BaseIcon';
2
+ import { BaseInlineBlock } from '../Layout/BaseInlineBlock';
3
+ import { withMemo } from '../../helper/withMemo';
4
4
  import React from 'react';
5
- import styles from '@/Components/Icon/icon.module.scss';
6
- import type { IconProps, IconSource } from '@/Components/Icon/Icon';
5
+ import styles from './icon.module.scss';
6
+ import type { IconProps, IconSource } from './BaseIcon';
7
7
 
8
8
  export type DoubleIconProps = IconProps & {
9
9
  secondIcon: IconSource;
@@ -31,9 +31,9 @@ export const DoubleIcon = withMemo(function DoubleIcon({
31
31
  // RenderFunctions
32
32
 
33
33
  return (
34
- <InlineBlock className={styles.doubleIconContainer}>
35
- <Icon {...otherProps} color={color} />
36
- <Icon icon={secondIcon} size="xs" className={styles.secondIcon} color={secondIconColor ?? color} />
37
- </InlineBlock>
34
+ <BaseInlineBlock className={styles.doubleIconContainer}>
35
+ <BaseIcon {...otherProps} color={color} />
36
+ <BaseIcon icon={secondIcon} size="xs" className={styles.secondIcon} color={secondIconColor ?? color} />
37
+ </BaseInlineBlock>
38
38
  );
39
39
  });
@@ -1,10 +1,10 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
 
3
- import { Icon } from '@/Components/Icon/Icon';
3
+ import { BaseIcon } from './BaseIcon';
4
4
  import { faHouse, faUser } from '@fortawesome/free-solid-svg-icons';
5
5
 
6
6
  const meta = {
7
- component: Icon,
7
+ component: BaseIcon,
8
8
  argTypes: {
9
9
  icon: {
10
10
  options: ['house', 'user'],
@@ -14,7 +14,7 @@ const meta = {
14
14
  },
15
15
  },
16
16
  },
17
- } satisfies Meta<typeof Icon>;
17
+ } satisfies Meta<typeof BaseIcon>;
18
18
 
19
19
  export default meta;
20
20
 
@@ -0,0 +1,4 @@
1
+ import { BaseIcon } from './BaseIcon';
2
+ import { withTitle } from '../Title/withTitle';
3
+
4
+ export const Icon = withTitle(BaseIcon);
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
 
3
- import { Image } from '@/Components/Image/Image';
3
+ import { Image } from './Image';
4
4
 
5
5
  const meta = {
6
6
  component: Image,
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- import { withMemo } from '@/helper/withMemo';
2
+ import { withMemo } from '../../helper/withMemo';
3
3
  import classNames from 'classnames';
4
- import styles from '@/Components/Image/image.module.scss';
4
+ import styles from './image.module.scss';
5
5
  import type { CSSProperties } from 'react';
6
- import type { Override } from '@/TypeHelpers';
7
- import type { RbmComponentProps, WithNoChildren } from '@/Components/RbmComponentProps';
6
+ import type { Override } from '../../TypeHelpers';
7
+ import type { RbmComponentProps, WithNoChildren } from '../RbmComponentProps';
8
8
 
9
9
  export type ImageProps = RbmComponentProps<
10
10
  Override<
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { useEffect, useRef, useState } from 'react';
3
- import { withMemo } from '@/helper/withMemo';
3
+ import { withMemo } from '../../helper/withMemo';
4
4
  import classNames from 'classnames';
5
- import styles from '@/Components/InViewport/inViewport.module.scss';
6
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
5
+ import styles from './inViewport.module.scss';
6
+ import type { RbmComponentProps } from '../RbmComponentProps';
7
7
 
8
8
  export type InViewportProps = RbmComponentProps<{
9
9
  threshold?: number;
@@ -1,22 +1,21 @@
1
1
  import * as React from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
- import { ViewWithoutListeners } from '@/Components/Layout/ViewWithoutListeners';
4
- import { withMemo } from '@/helper/withMemo';
3
+ import { ViewWithoutListeners } from './ViewWithoutListeners';
5
4
  import classNames from 'classnames';
6
- import styles from '@/Components/Layout/layout.module.scss';
7
- import type { ComponentRef, ForwardedRef } from 'react';
8
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
9
- import type { ViewWithoutListenersProps } from '@/Components/Layout/ViewWithoutListeners';
10
-
5
+ import styles from './layout.module.scss';
6
+ import type { ComponentRef, Ref } from 'react';
7
+ import type { RbmComponentProps } from '../RbmComponentProps';
8
+ import type { ViewWithoutListenersProps } from './ViewWithoutListeners';
11
9
  import IntrinsicElements = JSX.IntrinsicElements;
10
+ import { withMemo } from '../../helper/withMemo';
12
11
 
13
12
  export type BlockProps<AsType extends keyof IntrinsicElements> = RbmComponentProps<
14
13
  ViewWithoutListenersProps<AsType> & {
15
- ref?: ForwardedRef<ComponentRef<AsType>>;
14
+ ref?: Ref<ComponentRef<AsType>>;
16
15
  }
17
16
  >;
18
17
 
19
- export const Block = withMemo(function Block<AsType extends keyof JSX.IntrinsicElements = 'div'>({
18
+ export const BaseBlock = withMemo(function Block<AsType extends keyof JSX.IntrinsicElements = 'div'>({
20
19
  children,
21
20
  as = 'div' as AsType,
22
21
  className,
@@ -1,13 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
- import { ViewWithoutListeners } from '@/Components/Layout/ViewWithoutListeners';
4
- import { withMemo } from '@/helper/withMemo';
3
+ import { ViewWithoutListeners } from './ViewWithoutListeners';
5
4
  import classNames from 'classnames';
6
- import styles from '@/Components/Layout/layout.module.scss';
7
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
8
- import type { ViewWithoutListenersProps } from '@/Components/Layout/ViewWithoutListeners';
5
+ import styles from './layout.module.scss';
6
+ import type { RbmComponentProps } from '../RbmComponentProps';
7
+ import type { ViewWithoutListenersProps } from './ViewWithoutListeners';
9
8
 
10
9
  import IntrinsicElements = JSX.IntrinsicElements;
10
+ import { withMemo } from '../../helper/withMemo';
11
11
 
12
12
  export type InlineBlockProps<AsType extends keyof IntrinsicElements> = RbmComponentProps<
13
13
  ViewWithoutListenersProps<AsType> & {
@@ -16,7 +16,7 @@ export type InlineBlockProps<AsType extends keyof IntrinsicElements> = RbmCompon
16
16
  }
17
17
  >;
18
18
 
19
- export const InlineBlock = withMemo(function InlineBlock<AsType extends keyof JSX.IntrinsicElements = 'span'>({
19
+ export const BaseInlineBlock = withMemo(function BaseInlineBlock<AsType extends keyof JSX.IntrinsicElements = 'span'>({
20
20
  children,
21
21
  as = 'span' as AsType,
22
22
  className,
@@ -0,0 +1,4 @@
1
+ import { BaseBlock } from './BaseBlock';
2
+ import { withTitle } from '../Title/withTitle';
3
+
4
+ export const Block = withTitle(BaseBlock);
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { withMemo } from '@/helper/withMemo';
2
+ import { withMemo } from '../../helper/withMemo';
3
3
  import classNames from 'classnames';
4
- import styles from '@/Components/Layout/container.module.scss';
5
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
4
+ import styles from './container.module.scss';
5
+ import type { RbmComponentProps } from '../RbmComponentProps';
6
6
 
7
7
  export const CONTAINER_CLASSES = {
8
8
  sm: styles['container-sm'],
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
- import { ViewWithoutListeners } from '@/Components/Layout/ViewWithoutListeners';
4
- import { withMemo } from '@/helper/withMemo';
3
+ import { ViewWithoutListeners } from './ViewWithoutListeners';
4
+ import { withMemo } from '../../helper/withMemo';
5
5
  import classNames from 'classnames';
6
- import styles from '@/Components/Layout/layout.module.scss';
7
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
8
- import type { ViewWithoutListenersProps } from '@/Components/Layout/ViewWithoutListeners';
6
+ import styles from './layout.module.scss';
7
+ import type { RbmComponentProps } from '../RbmComponentProps';
8
+ import type { ViewWithoutListenersProps } from './ViewWithoutListeners';
9
9
 
10
10
  import IntrinsicElements = JSX.IntrinsicElements;
11
11
 
@@ -13,6 +13,12 @@ export type FlexProps<AsType extends keyof IntrinsicElements> = RbmComponentProp
13
13
  ViewWithoutListenersProps<AsType> & {
14
14
  horizontal?: boolean;
15
15
  grow?: boolean;
16
+ unaligned?: boolean;
17
+ fillWidth?: boolean;
18
+ fillHeight?: boolean;
19
+ fill?: boolean;
20
+ // TODO gap as enum?
21
+ gap?: number;
16
22
  }
17
23
  >;
18
24
 
@@ -23,6 +29,12 @@ export const Flex = withMemo(function Flex<AsType extends keyof JSX.IntrinsicEle
23
29
  horizontal = false,
24
30
  ref,
25
31
  grow = false,
32
+ unaligned = false,
33
+ fill = false,
34
+ fillWidth = fill,
35
+ fillHeight = fill,
36
+ gap,
37
+ style,
26
38
  ...props
27
39
  }: FlexProps<AsType>) {
28
40
  // Variables
@@ -45,7 +57,11 @@ export const Flex = withMemo(function Flex<AsType extends keyof JSX.IntrinsicEle
45
57
  [styles.horizontal]: horizontal,
46
58
  [styles.grow]: grow,
47
59
  [styles.weight1]: grow,
60
+ [styles.unaligned]: unaligned,
61
+ [styles.fillWidth]: fillWidth,
62
+ [styles.fillHeight]: fillHeight,
48
63
  })}
64
+ style={{ gap, ...style }}
49
65
  as={as as AsType}
50
66
  ref={ref}
51
67
  {...(props as ViewWithoutListenersProps<AsType>)}
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
- import { Block } from '@/Components/Layout/Block';
2
+ import { BaseBlock } from '../BaseBlock';
3
3
  import { useMemo } from 'react';
4
- import { withMemo } from '@/helper/withMemo';
4
+ import { withMemo } from '../../../helper/withMemo';
5
5
  import classNames from 'classnames';
6
- import styles from '@/Components/Layout/Grid/grid.module.scss';
6
+ import styles from './grid.module.scss';
7
7
  import type { ForwardedRef } from 'react';
8
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
8
+ import type { RbmComponentProps } from '../../RbmComponentProps';
9
9
 
10
10
  export type GridProps = RbmComponentProps<{
11
11
  columns?: number;
@@ -49,13 +49,13 @@ export const Grid = withMemo(function Grid({
49
49
  // Render Functions
50
50
 
51
51
  return (
52
- <Block
52
+ <BaseBlock
53
53
  ref={ref}
54
54
  style={appliedStyle}
55
55
  className={classNames(styles.grid, className, { [styles.useContainerWidth]: useContainerWidth })}
56
56
  __allowChildren={__allowChildren as 'all'}
57
57
  >
58
58
  {children}
59
- </Block>
59
+ </BaseBlock>
60
60
  );
61
61
  });
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
- import { InlineBlock } from '@/Components/Layout/InlineBlock';
3
- import { withMemo } from '@/helper/withMemo';
2
+ import { BaseInlineBlock } from '../BaseInlineBlock';
3
+ import { withMemo } from '../../../helper/withMemo';
4
4
  import classNames from 'classnames';
5
- import styles from '@/Components/Layout/Grid/grid.module.scss';
6
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
5
+ import styles from './grid.module.scss';
6
+ import type { RbmComponentProps } from '../../RbmComponentProps';
7
7
 
8
8
  export type GridItemProps = RbmComponentProps<{
9
9
  size: number;
@@ -151,13 +151,13 @@ function GridItem({
151
151
 
152
152
  // Render Functions
153
153
  return (
154
- <InlineBlock
154
+ <BaseInlineBlock
155
155
  style={style}
156
156
  className={classNames(...classes.map((name) => styles[name]), styles.item, className)}
157
157
  __allowChildren={__allowChildren as 'all'}
158
158
  >
159
159
  {children}
160
- </InlineBlock>
160
+ </BaseInlineBlock>
161
161
  );
162
162
  }
163
163
 
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
- import { withMemo } from '@/helper/withMemo';
2
+ import { withMemo } from '../../helper/withMemo';
3
3
  import classNames from 'classnames';
4
- import styles from '@/Components/Layout/layout.module.scss';
4
+ import styles from './layout.module.scss';
5
5
  import type { ForwardedRef } from 'react';
6
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
6
+ import type { RbmComponentProps } from '../RbmComponentProps';
7
7
 
8
8
  export type GrowProps = RbmComponentProps<{
9
9
  center?: boolean;
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
- import { ViewWithoutListeners } from '@/Components/Layout/ViewWithoutListeners';
4
- import { withMemo } from '@/helper/withMemo';
3
+ import { ViewWithoutListeners } from './ViewWithoutListeners';
4
+ import { withMemo } from '../../helper/withMemo';
5
5
  import classNames from 'classnames';
6
- import styles from '@/Components/Layout/layout.module.scss';
7
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
8
- import type { ViewWithoutListenersProps } from '@/Components/Layout/ViewWithoutListeners';
6
+ import styles from './layout.module.scss';
7
+ import type { RbmComponentProps } from '../RbmComponentProps';
8
+ import type { ViewWithoutListenersProps } from './ViewWithoutListeners';
9
9
 
10
10
  import IntrinsicElements = JSX.IntrinsicElements;
11
11
 
@@ -0,0 +1,4 @@
1
+ import { BaseInlineBlock } from './BaseInlineBlock';
2
+ import { withTitle } from '../Title/withTitle';
3
+
4
+ export const InlineBlock = withTitle(BaseInlineBlock);
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
- import { withMemo } from '@/helper/withMemo';
4
- import type { ComponentRef, ForwardedRef, PropsWithChildren } from 'react';
5
- import type { Override } from '@/TypeHelpers';
3
+ import { withMemo } from '../../helper/withMemo';
4
+ import type { ComponentRef, PropsWithChildren, Ref } from 'react';
5
+ import type { Override } from '../../TypeHelpers';
6
6
 
7
7
  import IntrinsicElements = JSX.IntrinsicElements;
8
8
 
@@ -12,7 +12,7 @@ export type ViewProps<AsType extends keyof IntrinsicElements> = PropsWithChildre
12
12
  {
13
13
  as?: AsType;
14
14
  children?: React.ReactNode;
15
- ref?: ForwardedRef<ComponentRef<AsType>>;
15
+ ref?: Ref<ComponentRef<AsType>>;
16
16
  }
17
17
  >
18
18
  >;
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
- import { View } from '@/Components/Layout/View';
4
- import { withMemo } from '@/helper/withMemo';
3
+ import { View } from './View';
4
+ import { withMemo } from '../../helper/withMemo';
5
5
  import type { DOMAttributes, ForwardedRef } from 'react';
6
- import type { ViewProps } from '@/Components/Layout/View';
6
+ import type { ViewProps } from './View';
7
7
 
8
8
  import IntrinsicElements = JSX.IntrinsicElements;
9
9
 
@@ -7,6 +7,19 @@
7
7
  &.horizontal {
8
8
  flex-direction: row;
9
9
  }
10
+
11
+ &.unaligned {
12
+ align-items: unset;
13
+ justify-content: unset;
14
+ }
15
+
16
+ &.fillWidth {
17
+ width: 100%;
18
+ }
19
+
20
+ &.fillHeight {
21
+ height: 100%;
22
+ }
10
23
  }
11
24
 
12
25
  .grow {
@@ -1,22 +1,22 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
 
3
- import { Block } from '@/Components/Layout/Block';
4
- import { LoadingArea } from '@/Components/LoadingArea/LoadingArea';
5
- import { Text } from '@/Components/Text/Text';
3
+ import { BaseBlock } from '../Layout/BaseBlock';
4
+ import { LoadingArea } from './LoadingArea';
5
+ import { Text } from '../Text/Text';
6
6
  import React from 'react';
7
7
 
8
8
  const meta = {
9
9
  component: LoadingArea,
10
10
  render: (args) => (
11
11
  <LoadingArea {...args}>
12
- <Block
12
+ <BaseBlock
13
13
  style={{
14
14
  height: '200px',
15
15
  background: 'gray',
16
16
  }}
17
17
  >
18
18
  <Text>Content goes here Error within Story. Normally it would only cover the content and not more</Text>
19
- </Block>
19
+ </BaseBlock>
20
20
  </LoadingArea>
21
21
  ),
22
22
  } satisfies Meta<typeof LoadingArea>;
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- import { LoadingCircle } from '@/Components/LoadingCircle/LoadingCircle';
3
- import { withMemo } from '@/helper/withMemo';
4
- import baseStyles from '@/scss/baseClasses.module.scss';
2
+ import { LoadingCircle } from '../LoadingCircle/LoadingCircle';
3
+ import { withMemo } from '../../helper/withMemo';
4
+ import baseStyles from '../../scss/baseClasses.module.scss';
5
5
  import classNames from 'classnames';
6
- import styles from '@/Components/LoadingArea/loadingArea.module.scss';
7
- import type { RbmComponentProps } from '@/Components/RbmComponentProps';
6
+ import styles from './loadingArea.module.scss';
7
+ import type { RbmComponentProps } from '../RbmComponentProps';
8
8
 
9
9
  export type LoadingAreaProps = RbmComponentProps<{
10
10
  loading: boolean;
@@ -1,7 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
 
3
- import { LoadingCircle } from '@/Components/LoadingCircle/LoadingCircle';
4
- import { Size } from '@/Size';
3
+ import { LoadingCircle } from './LoadingCircle';
4
+ import { Size } from '../../Size';
5
5
  import React from 'react';
6
6
 
7
7
  const meta = {