@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.
- package/dist/Components/ActionSheet/ActionSheet.d.ts +2 -2
- package/dist/Components/ActionSheet/ActionSheet.stories.d.ts +3 -3
- package/dist/Components/Card/Card.d.ts +1 -1
- package/dist/Components/Card/Card.stories.d.ts +2 -2
- package/dist/Components/Clickable/Clickable.d.ts +2 -2
- package/dist/Components/Dialog/AlertDialog.stories.d.ts +1 -1
- package/dist/Components/Dialog/ButtonDialog.d.ts +2 -2
- package/dist/Components/Dialog/ConfirmDialog.stories.d.ts +2 -2
- package/dist/Components/Dialog/Dialog.d.ts +1 -1
- package/dist/Components/Dialog/DialogBackground.d.ts +1 -1
- package/dist/Components/Dialog/DialogContainer.d.ts +1 -1
- package/dist/Components/Dialog/DialogContext.d.ts +1 -1
- package/dist/Components/DragAndDrop/DragItem.d.ts +1 -1
- package/dist/Components/DragAndDrop/DropArea.d.ts +1 -1
- package/dist/Components/FormElements/Button/Button.d.ts +9 -6
- package/dist/Components/FormElements/Button/Button.stories.d.ts +12 -6
- package/dist/Components/FormElements/CheckBox/Checkbox.d.ts +2 -2
- package/dist/Components/FormElements/CheckBox/Checkbox.stories.d.ts +1 -1
- package/dist/Components/FormElements/ColorInput/ColorInput.d.ts +1 -1
- package/dist/Components/FormElements/ColorInput/ColorInput.stories.d.ts +1 -1
- package/dist/Components/FormElements/Controller/ColorInputController.d.ts +1 -1
- package/dist/Components/FormElements/Controller/FileInputController.d.ts +1 -1
- package/dist/Components/FormElements/Controller/InputController.d.ts +1 -1
- package/dist/Components/FormElements/Controller/MultipleFileInputController.d.ts +1 -1
- package/dist/Components/FormElements/Controller/PasswordInputController.d.ts +1 -1
- package/dist/Components/FormElements/Controller/SelectController.d.ts +1 -1
- package/dist/Components/FormElements/Controller/SliderController.d.ts +1 -1
- package/dist/Components/FormElements/Controller/SwitchController.d.ts +1 -1
- package/dist/Components/FormElements/Controller/TextareaController.d.ts +1 -1
- package/dist/Components/FormElements/Error/FormError.stories.d.ts +1 -1
- package/dist/Components/FormElements/Form.stories.d.ts +1 -1
- package/dist/Components/FormElements/Input/FileInput/FileInput.d.ts +5 -5
- package/dist/Components/FormElements/Input/FileInput/MultipleFileInput.d.ts +4 -4
- package/dist/Components/FormElements/Input/HiddenInput.d.ts +1 -1
- package/dist/Components/FormElements/Input/HiddenInput.stories.d.ts +1 -1
- package/dist/Components/FormElements/Input/Input.d.ts +3 -3
- package/dist/Components/FormElements/Input/Input.stories.d.ts +1 -1
- package/dist/Components/FormElements/Input/PasswordInput/PasswordInput.d.ts +2 -2
- package/dist/Components/FormElements/Input/PasswordInput/PasswordInput.stories.d.ts +1 -1
- package/dist/Components/FormElements/SearchSelectInput/SearchSelectInput.d.ts +3 -3
- package/dist/Components/FormElements/SearchSelectInput/SearchSelectInput.stories.d.ts +1 -1
- package/dist/Components/FormElements/Select/Select.d.ts +3 -3
- package/dist/Components/FormElements/Select/Select.stories.d.ts +1 -1
- package/dist/Components/FormElements/Slider/Slider.d.ts +3 -3
- package/dist/Components/FormElements/Slider/Slider.stories.d.ts +1 -1
- package/dist/Components/FormElements/Switch/Switch.d.ts +3 -3
- package/dist/Components/FormElements/Switch/Switch.stories.d.ts +1 -1
- package/dist/Components/FormElements/Textarea/Textarea.d.ts +3 -3
- package/dist/Components/FormElements/Textarea/Textarea.stories.d.ts +1 -1
- package/dist/Components/FullScreen/FullScreen.d.ts +2 -2
- package/dist/Components/Icon/BaseIcon.d.ts +15 -0
- package/dist/Components/Icon/DoubleIcon.d.ts +1 -1
- package/dist/Components/Icon/DoubleIcon.stories.d.ts +1 -1
- package/dist/Components/Icon/Icon.d.ts +4 -13
- package/dist/Components/Icon/Icon.stories.d.ts +1 -1
- package/dist/Components/Image/Image.d.ts +2 -2
- package/dist/Components/Image/Image.stories.d.ts +1 -1
- package/dist/Components/InViewport/InViewport.d.ts +1 -1
- package/dist/Components/Layout/BaseBlock.d.ts +10 -0
- package/dist/Components/Layout/BaseInlineBlock.d.ts +10 -0
- package/dist/Components/Layout/Block.d.ts +4 -10
- package/dist/Components/Layout/Container.d.ts +1 -1
- package/dist/Components/Layout/Flex.d.ts +8 -3
- package/dist/Components/Layout/Grid/Grid.d.ts +1 -1
- package/dist/Components/Layout/Grid/GridItem.d.ts +1 -1
- package/dist/Components/Layout/Grow.d.ts +1 -1
- package/dist/Components/Layout/Inline.d.ts +2 -2
- package/dist/Components/Layout/InlineBlock.d.ts +4 -10
- package/dist/Components/Layout/View.d.ts +4 -4
- package/dist/Components/Layout/ViewWithoutListeners.d.ts +1 -1
- package/dist/Components/LoadingArea/LoadingArea.d.ts +1 -1
- package/dist/Components/LoadingArea/LoadingArea.stories.d.ts +2 -2
- package/dist/Components/LoadingCircle/LoadingCircle.d.ts +2 -2
- package/dist/Components/LoadingCircle/LoadingCircle.stories.d.ts +2 -2
- package/dist/Components/Menu/HoverMenu.d.ts +1 -1
- package/dist/Components/Menu/HoverMenu.stories.d.ts +1 -1
- package/dist/Components/Menu/Menu.d.ts +2 -2
- package/dist/Components/Menu/Menu.stories.d.ts +1 -1
- package/dist/Components/Menu/MenuItem.d.ts +2 -2
- package/dist/Components/Menu/MenuItem.stories.d.ts +1 -1
- package/dist/Components/Menu/Submenu.d.ts +2 -2
- package/dist/Components/Menu/Submenu.stories.d.ts +1 -1
- package/dist/Components/Menu/useHoverMenu.d.ts +17 -0
- package/dist/Components/Menu/useMenu.d.ts +1 -1
- package/dist/Components/RbmComponentProps.d.ts +1 -1
- package/dist/Components/SizeCalculator/SizeCalculator.d.ts +1 -1
- package/dist/Components/SpoilerList/Spoiler/Spoiler.d.ts +3 -3
- package/dist/Components/SpoilerList/Spoiler/Spoiler.stories.d.ts +1 -1
- package/dist/Components/SpoilerList/SpoilerList.d.ts +1 -1
- package/dist/Components/TabBar/TabBar.d.ts +2 -2
- package/dist/Components/TabBar/TabBar.stories.d.ts +1 -1
- package/dist/Components/TabBar/TabBarButton.d.ts +2 -2
- package/dist/Components/Table/Table.d.ts +1 -1
- package/dist/Components/Text/Heading.d.ts +2 -2
- package/dist/Components/Text/Text.d.ts +2 -2
- package/dist/Components/Text/Text.stories.d.ts +1 -1
- package/dist/Components/Title/HoverTitle.d.ts +9 -0
- package/dist/Components/Title/Title.stories.d.ts +11 -0
- package/dist/Components/Title/withTitle.d.ts +6 -0
- package/dist/Components/Toast/Toast.d.ts +2 -2
- package/dist/Components/Toast/Toast.stories.d.ts +1 -1
- package/dist/Components/Toast/ToastContainer.d.ts +2 -2
- package/dist/Components/TopBar/MoreButton.d.ts +1 -1
- package/dist/Components/TopBar/TopBar.d.ts +2 -2
- package/dist/Components/TopBar/TopBar.stories.d.ts +1 -1
- package/dist/Components/TopBar/TopBarButton.d.ts +1 -1
- package/dist/helper/withMemo.d.ts +1 -1
- package/dist/helper/withRestrictedChildren.d.ts +1 -1
- package/dist/index.css +4 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +420 -205
- package/dist/index.js.map +1 -1
- package/eslint.config.js +1 -0
- package/package.json +1 -1
- package/src/Components/ActionSheet/ActionSheet.stories.tsx +3 -4
- package/src/Components/ActionSheet/ActionSheet.tsx +20 -18
- package/src/Components/Card/Card.stories.tsx +3 -4
- package/src/Components/Card/Card.tsx +3 -3
- package/src/Components/Clickable/Clickable.tsx +6 -6
- package/src/Components/Colors.stories.tsx +11 -12
- package/src/Components/Dialog/AlertDialog.stories.tsx +2 -2
- package/src/Components/Dialog/AlertDialog.tsx +2 -2
- package/src/Components/Dialog/ButtonDialog.tsx +15 -15
- package/src/Components/Dialog/ConfirmDialog.stories.tsx +3 -4
- package/src/Components/Dialog/ConfirmDialog.tsx +2 -2
- package/src/Components/Dialog/Dialog.tsx +10 -10
- package/src/Components/Dialog/DialogBackground.tsx +12 -12
- package/src/Components/Dialog/DialogContainer.tsx +7 -7
- package/src/Components/Dialog/DialogContext.ts +1 -1
- package/src/Components/Dialog/useAlertDialog.ts +2 -2
- package/src/Components/Dialog/useConfirmDialog.ts +2 -2
- package/src/Components/DragAndDrop/DragItem.tsx +2 -2
- package/src/Components/DragAndDrop/DropArea.tsx +3 -3
- package/src/Components/ErrorBoundary.tsx +5 -5
- package/src/Components/FormElements/Button/Button.stories.tsx +6 -6
- package/src/Components/FormElements/Button/Button.tsx +9 -9
- package/src/Components/FormElements/CheckBox/Checkbox.stories.tsx +1 -1
- package/src/Components/FormElements/CheckBox/Checkbox.tsx +6 -6
- package/src/Components/FormElements/ColorInput/ColorInput.stories.tsx +1 -1
- package/src/Components/FormElements/ColorInput/ColorInput.tsx +8 -8
- package/src/Components/FormElements/Controller/ColorInputController.ts +2 -2
- package/src/Components/FormElements/Controller/FileInputController.tsx +4 -4
- package/src/Components/FormElements/Controller/HookForm.tsx +4 -4
- package/src/Components/FormElements/Controller/InputController.ts +2 -2
- package/src/Components/FormElements/Controller/MultipleFileInputController.ts +2 -2
- package/src/Components/FormElements/Controller/PasswordInputController.ts +2 -2
- package/src/Components/FormElements/Controller/SelectController.ts +2 -2
- package/src/Components/FormElements/Controller/SliderController.ts +2 -2
- package/src/Components/FormElements/Controller/SwitchController.ts +2 -2
- package/src/Components/FormElements/Controller/TextareaController.ts +2 -2
- package/src/Components/FormElements/Controller/withHookController.tsx +2 -2
- package/src/Components/FormElements/Error/FormError.stories.tsx +1 -1
- package/src/Components/FormElements/Error/FormError.tsx +9 -9
- package/src/Components/FormElements/Form.stories.tsx +1 -1
- package/src/Components/FormElements/Input/FileInput/FileInput.tsx +8 -8
- package/src/Components/FormElements/Input/FileInput/MultipleFileInput.tsx +21 -21
- package/src/Components/FormElements/Input/HiddenInput.stories.tsx +1 -1
- package/src/Components/FormElements/Input/HiddenInput.tsx +4 -4
- package/src/Components/FormElements/Input/Input.stories.tsx +1 -1
- package/src/Components/FormElements/Input/Input.tsx +11 -11
- package/src/Components/FormElements/Input/PasswordInput/PasswordInput.stories.tsx +1 -1
- package/src/Components/FormElements/Input/PasswordInput/PasswordInput.tsx +10 -10
- package/src/Components/FormElements/SearchSelectInput/SearchSelectInput.stories.tsx +2 -2
- package/src/Components/FormElements/SearchSelectInput/SearchSelectInput.tsx +19 -19
- package/src/Components/FormElements/Select/Select.stories.tsx +1 -1
- package/src/Components/FormElements/Select/Select.tsx +7 -7
- package/src/Components/FormElements/Slider/Slider.stories.tsx +1 -1
- package/src/Components/FormElements/Slider/Slider.tsx +7 -7
- package/src/Components/FormElements/Switch/Switch.stories.tsx +1 -1
- package/src/Components/FormElements/Switch/Switch.tsx +7 -7
- package/src/Components/FormElements/Textarea/Textarea.stories.tsx +1 -1
- package/src/Components/FormElements/Textarea/Textarea.tsx +9 -9
- package/src/Components/FullScreen/FullScreen.tsx +4 -4
- package/src/Components/Hooks/useBreakpoint.ts +1 -1
- package/src/Components/Hooks/useDelayed.ts +5 -4
- package/src/Components/Hooks/useDelayedState.ts +1 -1
- package/src/Components/Hooks/useKeyListener.ts +1 -1
- package/src/Components/Hooks/useMousePosition.ts +1 -1
- package/src/Components/Hooks/useWindowDimensions.ts +1 -1
- package/src/Components/Icon/{Icon.tsx → BaseIcon.tsx} +10 -8
- package/src/Components/Icon/DoubleIcon.stories.tsx +1 -1
- package/src/Components/Icon/DoubleIcon.tsx +9 -9
- package/src/Components/Icon/Icon.stories.tsx +3 -3
- package/src/Components/Icon/Icon.ts +4 -0
- package/src/Components/Image/Image.stories.tsx +1 -1
- package/src/Components/Image/Image.tsx +4 -4
- package/src/Components/InViewport/InViewport.tsx +3 -3
- package/src/Components/Layout/{Block.tsx → BaseBlock.tsx} +8 -9
- package/src/Components/Layout/{InlineBlock.tsx → BaseInlineBlock.tsx} +6 -6
- package/src/Components/Layout/Block.ts +4 -0
- package/src/Components/Layout/Container.tsx +3 -3
- package/src/Components/Layout/Flex.tsx +21 -5
- package/src/Components/Layout/Grid/Grid.tsx +6 -6
- package/src/Components/Layout/Grid/GridItem.tsx +6 -6
- package/src/Components/Layout/Grow.tsx +3 -3
- package/src/Components/Layout/Inline.tsx +5 -5
- package/src/Components/Layout/InlineBlock.ts +4 -0
- package/src/Components/Layout/View.tsx +4 -4
- package/src/Components/Layout/ViewWithoutListeners.tsx +3 -3
- package/src/Components/Layout/layout.module.scss +13 -0
- package/src/Components/LoadingArea/LoadingArea.stories.tsx +5 -5
- package/src/Components/LoadingArea/LoadingArea.tsx +5 -5
- package/src/Components/LoadingCircle/LoadingCircle.stories.tsx +2 -2
- package/src/Components/LoadingCircle/LoadingCircle.tsx +4 -4
- package/src/Components/Menu/HoverMenu.stories.tsx +5 -5
- package/src/Components/Menu/HoverMenu.tsx +13 -33
- package/src/Components/Menu/Menu.stories.tsx +5 -5
- package/src/Components/Menu/Menu.tsx +12 -12
- package/src/Components/Menu/MenuDivider.tsx +4 -4
- package/src/Components/Menu/MenuItem.stories.tsx +1 -1
- package/src/Components/Menu/MenuItem.tsx +12 -12
- package/src/Components/Menu/Submenu.stories.tsx +3 -3
- package/src/Components/Menu/Submenu.tsx +16 -16
- package/src/Components/Menu/menu.module.scss +3 -2
- package/src/Components/Menu/useHoverMenu.ts +36 -0
- package/src/Components/Menu/useMenu.ts +1 -1
- package/src/Components/RbmComponentProps.ts +1 -1
- package/src/Components/SizeCalculator/SizeCalculator.tsx +5 -5
- package/src/Components/SpoilerList/Spoiler/Spoiler.stories.tsx +1 -1
- package/src/Components/SpoilerList/Spoiler/Spoiler.tsx +18 -18
- package/src/Components/SpoilerList/SpoilerList.tsx +7 -7
- package/src/Components/TabBar/TabBar.stories.tsx +1 -1
- package/src/Components/TabBar/TabBar.tsx +11 -11
- package/src/Components/TabBar/TabBarButton.tsx +5 -5
- package/src/Components/Table/Table.tsx +2 -2
- package/src/Components/Text/Heading.tsx +5 -5
- package/src/Components/Text/Text.stories.tsx +1 -1
- package/src/Components/Text/Text.tsx +6 -6
- package/src/Components/Title/HoverTitle.tsx +97 -0
- package/src/Components/Title/Title.stories.tsx +95 -0
- package/src/Components/Title/hoverTitle.module.scss +8 -0
- package/src/Components/Title/withTitle.module.scss +7 -0
- package/src/Components/Title/withTitle.tsx +48 -0
- package/src/Components/Toast/Toast.stories.tsx +1 -1
- package/src/Components/Toast/Toast.tsx +6 -6
- package/src/Components/Toast/ToastContainer.tsx +7 -7
- package/src/Components/TopBar/MoreButton.tsx +7 -8
- package/src/Components/TopBar/TopBar.stories.tsx +1 -1
- package/src/Components/TopBar/TopBar.tsx +18 -18
- package/src/Components/TopBar/TopBarButton.tsx +3 -3
- package/src/WrongChildError.ts +1 -0
- package/src/helper/nonEmptyString.ts +1 -1
- package/src/helper/withMemo.ts +3 -3
- package/src/helper/withRestrictedChildren.tsx +5 -3
- package/src/index.ts +6 -0
- package/tsconfig.json +2 -8
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { FormError } from '
|
|
2
|
+
import { FormError } from '../Error/FormError';
|
|
3
3
|
import { useCallback, useRef } from 'react';
|
|
4
|
-
import { useComposedRef } from '
|
|
5
|
-
import { useListenerWithExtractedProps } from '
|
|
6
|
-
import { useOnChangeDone } from '
|
|
7
|
-
import { withMemo } from '
|
|
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 '
|
|
9
|
+
import styles from './textarea.module.scss';
|
|
10
10
|
import type { CSSProperties, ChangeEvent, ForwardedRef, KeyboardEvent, TextareaHTMLAttributes } from 'react';
|
|
11
|
-
import type { OptionalListener } from '
|
|
12
|
-
import type { Override } from '
|
|
13
|
-
import type { RbmComponentProps } from '
|
|
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 '
|
|
5
|
-
import { withMemo } from '
|
|
4
|
+
import { useWindow } from '../../WindowContext/WindowContext';
|
|
5
|
+
import { withMemo } from '../../helper/withMemo';
|
|
6
6
|
import type { ComponentPropsWithoutRef } from 'react';
|
|
7
|
-
import type { Override } from '
|
|
8
|
-
import type { RbmComponentProps } from '
|
|
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<
|
|
@@ -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
|
-
|
|
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(
|
|
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 '
|
|
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,13 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
-
import { withMemo } from '
|
|
3
|
+
import { withMemo } from '../../helper/withMemo';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import styles from '
|
|
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 '
|
|
10
|
-
import type { RbmComponentProps } from '
|
|
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
|
|
27
|
+
export const BaseIcon = withMemo(function BaseIcon({
|
|
26
28
|
icon,
|
|
27
29
|
alt,
|
|
28
30
|
className,
|
|
29
31
|
noMargin = true,
|
|
30
32
|
style,
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
70
|
+
ref={ref as Ref<SVGSVGElement>}
|
|
69
71
|
/>
|
|
70
72
|
);
|
|
71
73
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { withMemo } from '
|
|
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 '
|
|
6
|
-
import type { IconProps, IconSource } from '
|
|
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
|
-
<
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
</
|
|
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 {
|
|
3
|
+
import { BaseIcon } from './BaseIcon';
|
|
4
4
|
import { faHouse, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
|
-
component:
|
|
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
|
|
17
|
+
} satisfies Meta<typeof BaseIcon>;
|
|
18
18
|
|
|
19
19
|
export default meta;
|
|
20
20
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { withMemo } from '
|
|
2
|
+
import { withMemo } from '../../helper/withMemo';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import styles from '
|
|
4
|
+
import styles from './image.module.scss';
|
|
5
5
|
import type { CSSProperties } from 'react';
|
|
6
|
-
import type { Override } from '
|
|
7
|
-
import type { RbmComponentProps, WithNoChildren } from '
|
|
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 '
|
|
3
|
+
import { withMemo } from '../../helper/withMemo';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import styles from '
|
|
6
|
-
import type { RbmComponentProps } from '
|
|
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 '
|
|
4
|
-
import { withMemo } from '@/helper/withMemo';
|
|
3
|
+
import { ViewWithoutListeners } from './ViewWithoutListeners';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
|
-
import styles from '
|
|
7
|
-
import type { ComponentRef,
|
|
8
|
-
import type { RbmComponentProps } from '
|
|
9
|
-
import type { ViewWithoutListenersProps } from '
|
|
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?:
|
|
14
|
+
ref?: Ref<ComponentRef<AsType>>;
|
|
16
15
|
}
|
|
17
16
|
>;
|
|
18
17
|
|
|
19
|
-
export const
|
|
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 '
|
|
4
|
-
import { withMemo } from '@/helper/withMemo';
|
|
3
|
+
import { ViewWithoutListeners } from './ViewWithoutListeners';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
|
-
import styles from '
|
|
7
|
-
import type { RbmComponentProps } from '
|
|
8
|
-
import type { ViewWithoutListenersProps } from '
|
|
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
|
|
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,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { withMemo } from '
|
|
2
|
+
import { withMemo } from '../../helper/withMemo';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import styles from '
|
|
5
|
-
import type { RbmComponentProps } from '
|
|
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 '
|
|
4
|
-
import { withMemo } from '
|
|
3
|
+
import { ViewWithoutListeners } from './ViewWithoutListeners';
|
|
4
|
+
import { withMemo } from '../../helper/withMemo';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import styles from '
|
|
7
|
-
import type { RbmComponentProps } from '
|
|
8
|
-
import type { ViewWithoutListenersProps } from '
|
|
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 {
|
|
2
|
+
import { BaseBlock } from '../BaseBlock';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { withMemo } from '
|
|
4
|
+
import { withMemo } from '../../../helper/withMemo';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import styles from '
|
|
6
|
+
import styles from './grid.module.scss';
|
|
7
7
|
import type { ForwardedRef } from 'react';
|
|
8
|
-
import type { RbmComponentProps } from '
|
|
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
|
-
<
|
|
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
|
-
</
|
|
59
|
+
</BaseBlock>
|
|
60
60
|
);
|
|
61
61
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { withMemo } from '
|
|
2
|
+
import { BaseInlineBlock } from '../BaseInlineBlock';
|
|
3
|
+
import { withMemo } from '../../../helper/withMemo';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import styles from '
|
|
6
|
-
import type { RbmComponentProps } from '
|
|
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
|
-
<
|
|
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
|
-
</
|
|
160
|
+
</BaseInlineBlock>
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { withMemo } from '
|
|
2
|
+
import { withMemo } from '../../helper/withMemo';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import styles from '
|
|
4
|
+
import styles from './layout.module.scss';
|
|
5
5
|
import type { ForwardedRef } from 'react';
|
|
6
|
-
import type { RbmComponentProps } from '
|
|
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 '
|
|
4
|
-
import { withMemo } from '
|
|
3
|
+
import { ViewWithoutListeners } from './ViewWithoutListeners';
|
|
4
|
+
import { withMemo } from '../../helper/withMemo';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import styles from '
|
|
7
|
-
import type { RbmComponentProps } from '
|
|
8
|
-
import type { ViewWithoutListenersProps } from '
|
|
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
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { JSX } from 'react/jsx-runtime';
|
|
3
|
-
import { withMemo } from '
|
|
4
|
-
import type { ComponentRef,
|
|
5
|
-
import type { Override } from '
|
|
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?:
|
|
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 '
|
|
4
|
-
import { withMemo } from '
|
|
3
|
+
import { View } from './View';
|
|
4
|
+
import { withMemo } from '../../helper/withMemo';
|
|
5
5
|
import type { DOMAttributes, ForwardedRef } from 'react';
|
|
6
|
-
import type { ViewProps } from '
|
|
6
|
+
import type { ViewProps } from './View';
|
|
7
7
|
|
|
8
8
|
import IntrinsicElements = JSX.IntrinsicElements;
|
|
9
9
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { LoadingArea } from '
|
|
5
|
-
import { Text } from '
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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 '
|
|
3
|
-
import { withMemo } from '
|
|
4
|
-
import baseStyles from '
|
|
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 '
|
|
7
|
-
import type { RbmComponentProps } from '
|
|
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 '
|
|
4
|
-
import { Size } from '
|
|
3
|
+
import { LoadingCircle } from './LoadingCircle';
|
|
4
|
+
import { Size } from '../../Size';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
const meta = {
|