@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,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Size } from '
|
|
2
|
+
import { Size } from '../../Size';
|
|
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 '
|
|
7
|
-
import type { RbmComponentProps } from '
|
|
6
|
+
import styles from './loadingCircle.module.scss';
|
|
7
|
+
import type { RbmComponentProps } from '../RbmComponentProps';
|
|
8
8
|
|
|
9
9
|
export type LoadingCircleProps = RbmComponentProps<{
|
|
10
10
|
size?: Size;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
|
|
3
|
-
import * as MenuStories from '
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import * as MenuStories from './Menu.stories';
|
|
4
|
+
import { BaseIcon } from '../Icon/BaseIcon';
|
|
5
|
+
import { HoverMenu } from './HoverMenu';
|
|
6
6
|
import { faCogs } from '@fortawesome/free-solid-svg-icons';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import type { ReactElement
|
|
8
|
+
import type { ReactElement } from 'react';
|
|
9
9
|
|
|
10
10
|
const meta = {
|
|
11
11
|
component: HoverMenu,
|
|
@@ -26,7 +26,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
26
26
|
export const Default: Story = {
|
|
27
27
|
args: {
|
|
28
28
|
openToSide: false,
|
|
29
|
-
children: <
|
|
29
|
+
children: <BaseIcon icon={faCogs} />,
|
|
30
30
|
items: MenuStories.Default.args?.children as ReactElement,
|
|
31
31
|
},
|
|
32
32
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Clickable } from '
|
|
2
|
-
import { Menu } from '
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { Clickable } from '../Clickable/Clickable';
|
|
2
|
+
import { Menu } from './Menu';
|
|
3
|
+
import { useHoverMenu } from './useHoverMenu';
|
|
4
|
+
import { withMemo } from '../../helper/withMemo';
|
|
5
|
+
import React, { useCallback, useRef } from 'react';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
|
-
import styles from '
|
|
7
|
+
import styles from './menu.module.scss';
|
|
7
8
|
import type {
|
|
8
9
|
RbmChildWithoutString,
|
|
9
10
|
RbmComponentProps,
|
|
10
11
|
WithNoStringAndChildrenProps,
|
|
11
|
-
} from '
|
|
12
|
+
} from '../RbmComponentProps';
|
|
12
13
|
|
|
13
14
|
export type HoverMenuProps = RbmComponentProps<
|
|
14
15
|
{
|
|
@@ -33,37 +34,16 @@ export const HoverMenu = withMemo(function HoverMenu({
|
|
|
33
34
|
|
|
34
35
|
// States/Variables/Selectors
|
|
35
36
|
const hoverItemRef = useRef<HTMLDivElement>(null);
|
|
36
|
-
|
|
37
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
38
|
-
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
39
|
-
const [offset, setOffset] = useState({ x: 0, y: 0 });
|
|
37
|
+
const { isOpen, position, offset, open, close } = useHoverMenu({ ref: hoverItemRef, openToSide });
|
|
40
38
|
|
|
41
39
|
// Dispatch
|
|
42
40
|
|
|
43
41
|
// Callbacks
|
|
44
|
-
const recalculatePosition = useCallback(() => {
|
|
45
|
-
if (!hoverItemRef.current) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const { top, left, bottom, right, width, height } = hoverItemRef.current.getBoundingClientRect();
|
|
49
|
-
if (openToSide) {
|
|
50
|
-
setPosition({ x: right, y: top });
|
|
51
|
-
setOffset({ x: width, y: -height });
|
|
52
|
-
} else {
|
|
53
|
-
setPosition({ x: left, y: bottom });
|
|
54
|
-
setOffset({ x: -width, y: height });
|
|
55
|
-
}
|
|
56
|
-
}, [openToSide]);
|
|
57
42
|
|
|
58
|
-
const
|
|
59
|
-
|
|
43
|
+
const innerOnClose = useCallback(() => {
|
|
44
|
+
close();
|
|
60
45
|
onClose?.();
|
|
61
|
-
}, [onClose]);
|
|
62
|
-
|
|
63
|
-
const open = useCallback(() => {
|
|
64
|
-
recalculatePosition();
|
|
65
|
-
setIsOpen(true);
|
|
66
|
-
}, [recalculatePosition]);
|
|
46
|
+
}, [onClose, close]);
|
|
67
47
|
|
|
68
48
|
const onClickInner = useCallback(() => {
|
|
69
49
|
if (onClick?.() !== false) {
|
|
@@ -80,7 +60,7 @@ export const HoverMenu = withMemo(function HoverMenu({
|
|
|
80
60
|
return (
|
|
81
61
|
<Clickable
|
|
82
62
|
onMouseEnter={open}
|
|
83
|
-
onMouseLeave={
|
|
63
|
+
onMouseLeave={innerOnClose}
|
|
84
64
|
useReactOnMouseLeave={true}
|
|
85
65
|
onClick={onClickInner}
|
|
86
66
|
className={classNames(styles.hoverMenu, { [styles.open]: isOpen }, className)}
|
|
@@ -93,7 +73,7 @@ export const HoverMenu = withMemo(function HoverMenu({
|
|
|
93
73
|
x={position.x}
|
|
94
74
|
y={position.y}
|
|
95
75
|
isOpen={true}
|
|
96
|
-
onClose={
|
|
76
|
+
onClose={innerOnClose}
|
|
97
77
|
offsetX={offset.x}
|
|
98
78
|
offsetY={offset.y}
|
|
99
79
|
className={classNames({ [styles.hidden]: !isOpen })}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
|
|
3
|
-
import { Menu } from '
|
|
4
|
-
import { MenuDivider } from '
|
|
5
|
-
import { MenuItem } from '
|
|
6
|
-
import { Submenu } from '
|
|
3
|
+
import { Menu } from './Menu';
|
|
4
|
+
import { MenuDivider } from './MenuDivider';
|
|
5
|
+
import { MenuItem } from './MenuItem';
|
|
6
|
+
import { Submenu } from './Submenu';
|
|
7
7
|
import { faCog, faCogs, faHome, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
8
8
|
import { fn } from 'storybook/test';
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import type { MenuProps } from '
|
|
10
|
+
import type { MenuProps } from './Menu';
|
|
11
11
|
|
|
12
12
|
const meta = {
|
|
13
13
|
component: Menu,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { MenuCloseContextProvider } from '
|
|
4
|
-
import { MenuItem } from '
|
|
2
|
+
import { BaseBlock } from '../Layout/BaseBlock';
|
|
3
|
+
import { MenuCloseContextProvider } from './MenuCloseContext';
|
|
4
|
+
import { MenuItem } from './MenuItem';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
|
-
import { useClientLayoutEffect } from '
|
|
6
|
+
import { useClientLayoutEffect } from '../Hooks/useClientLayoutEffect';
|
|
7
7
|
import { useEffect, useRef, useState } from 'react';
|
|
8
|
-
import { useWindow } from '
|
|
9
|
-
import { withMemo } from '
|
|
10
|
-
import { withRenderBrowserOnly } from '
|
|
8
|
+
import { useWindow } from '../../WindowContext/WindowContext';
|
|
9
|
+
import { withMemo } from '../../helper/withMemo';
|
|
10
|
+
import { withRenderBrowserOnly } from '../../helper/withRenderBrowserOnly';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
|
-
import styles from '
|
|
13
|
-
import type { IconSource } from '
|
|
14
|
-
import type { RbmComponentProps } from '
|
|
12
|
+
import styles from './menu.module.scss';
|
|
13
|
+
import type { IconSource } from '../Icon/BaseIcon';
|
|
14
|
+
import type { RbmComponentProps } from '../RbmComponentProps';
|
|
15
15
|
|
|
16
16
|
export type MenuItemType = {
|
|
17
17
|
label: string;
|
|
@@ -140,7 +140,7 @@ export const Menu = withMemo(
|
|
|
140
140
|
<>
|
|
141
141
|
{createPortal(
|
|
142
142
|
<MenuCloseContextProvider value={onClose}>
|
|
143
|
-
<
|
|
143
|
+
<BaseBlock
|
|
144
144
|
className={classNames(className, styles.menu)}
|
|
145
145
|
style={{ ...style, top: innerY, left: innerX }}
|
|
146
146
|
ref={menuRef}
|
|
@@ -171,7 +171,7 @@ export const Menu = withMemo(
|
|
|
171
171
|
);
|
|
172
172
|
})}
|
|
173
173
|
{children}
|
|
174
|
-
</
|
|
174
|
+
</BaseBlock>
|
|
175
175
|
</MenuCloseContextProvider>,
|
|
176
176
|
portalContainer,
|
|
177
177
|
)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { withMemo } from '
|
|
1
|
+
import { BaseBlock } from '../Layout/BaseBlock';
|
|
2
|
+
import { withMemo } from '../../helper/withMemo';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import styles from '
|
|
4
|
+
import styles from './menu.module.scss';
|
|
5
5
|
|
|
6
6
|
export const MenuDivider = withMemo(function MenuDivider() {
|
|
7
7
|
// Refs
|
|
@@ -18,5 +18,5 @@ export const MenuDivider = withMemo(function MenuDivider() {
|
|
|
18
18
|
|
|
19
19
|
// RenderFunctions
|
|
20
20
|
|
|
21
|
-
return <
|
|
21
|
+
return <BaseBlock className={styles.divider} />;
|
|
22
22
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
|
|
3
|
-
import { MenuItem } from '
|
|
3
|
+
import { MenuItem } from './MenuItem';
|
|
4
4
|
import { faCog, faHome, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
5
5
|
import { fn } from 'storybook/test';
|
|
6
6
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Text } from '
|
|
5
|
-
import { useMenuClose } from '
|
|
6
|
-
import { withMemo } from '
|
|
1
|
+
import { BaseBlock } from '../Layout/BaseBlock';
|
|
2
|
+
import { BaseIcon } from '../Icon/BaseIcon';
|
|
3
|
+
import { Clickable } from '../Clickable/Clickable';
|
|
4
|
+
import { Text } from '../Text/Text';
|
|
5
|
+
import { useMenuClose } from './MenuCloseContext';
|
|
6
|
+
import { withMemo } from '../../helper/withMemo';
|
|
7
7
|
import React, { useCallback } from 'react';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
|
-
import styles from '
|
|
10
|
-
import type { IconSource } from '
|
|
11
|
-
import type { RbmComponentProps, WithChildren } from '
|
|
9
|
+
import styles from './menu.module.scss';
|
|
10
|
+
import type { IconSource } from '../Icon/BaseIcon';
|
|
11
|
+
import type { RbmComponentProps, WithChildren } from '../RbmComponentProps';
|
|
12
12
|
import type { ReactNode } from 'react';
|
|
13
13
|
|
|
14
14
|
import Element = React.JSX.Element;
|
|
@@ -97,10 +97,10 @@ export const MenuItem = withMemo(function MenuItem<Item>({
|
|
|
97
97
|
onMouseLeave={onMouseLeaveInner}
|
|
98
98
|
__allowChildren="all"
|
|
99
99
|
>
|
|
100
|
-
<
|
|
101
|
-
{!!icon && <
|
|
100
|
+
<BaseBlock className={classNames(styles.itemChildren)}>
|
|
101
|
+
{!!icon && <BaseIcon icon={icon} color={iconColor} className={styles.icon} />}
|
|
102
102
|
{childElements}
|
|
103
|
-
</
|
|
103
|
+
</BaseBlock>
|
|
104
104
|
</Clickable>
|
|
105
105
|
);
|
|
106
106
|
}, 'text');
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
|
|
3
|
-
import { MenuItem } from '
|
|
4
|
-
import { Submenu } from '
|
|
3
|
+
import { MenuItem } from './MenuItem';
|
|
4
|
+
import { Submenu } from './Submenu';
|
|
5
5
|
import { faBook, faCog, faHome, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
6
6
|
import { fn } from 'storybook/test';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import type { SubmenuProps } from '
|
|
8
|
+
import type { SubmenuProps } from './Submenu';
|
|
9
9
|
|
|
10
10
|
const meta = {
|
|
11
11
|
component: Submenu,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { MenuCloseContextProvider, useMenuClose } from '
|
|
7
|
-
import { Text } from '
|
|
1
|
+
import { BaseBlock } from '../Layout/BaseBlock';
|
|
2
|
+
import { BaseIcon } from '../Icon/BaseIcon';
|
|
3
|
+
import { Clickable } from '../Clickable/Clickable';
|
|
4
|
+
import { Flex } from '../Layout/Flex';
|
|
5
|
+
import { Grow } from '../Layout/Grow';
|
|
6
|
+
import { MenuCloseContextProvider, useMenuClose } from './MenuCloseContext';
|
|
7
|
+
import { Text } from '../Text/Text';
|
|
8
8
|
import { faChevronRight } from '@fortawesome/free-solid-svg-icons';
|
|
9
|
-
import { useWindow } from '
|
|
10
|
-
import { withMemo } from '
|
|
9
|
+
import { useWindow } from '../../WindowContext/WindowContext';
|
|
10
|
+
import { withMemo } from '../../helper/withMemo';
|
|
11
11
|
import React, { useCallback, useRef, useState } from 'react';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
|
-
import styles from '
|
|
14
|
-
import type { IconSource } from '
|
|
15
|
-
import type { RbmComponentProps, WithNoStringAndChildrenProps } from '
|
|
13
|
+
import styles from './menu.module.scss';
|
|
14
|
+
import type { IconSource } from '../Icon/BaseIcon';
|
|
15
|
+
import type { RbmComponentProps, WithNoStringAndChildrenProps } from '../RbmComponentProps';
|
|
16
16
|
|
|
17
17
|
export type SubmenuProps = RbmComponentProps<
|
|
18
18
|
{
|
|
@@ -100,15 +100,15 @@ export const Submenu = withMemo(function Submenu({
|
|
|
100
100
|
style={style}
|
|
101
101
|
>
|
|
102
102
|
<Flex ref={submenuRef} className={classNames(styles.itemChildren)} horizontal={true}>
|
|
103
|
-
{!!icon && <
|
|
103
|
+
{!!icon && <BaseIcon icon={icon} color={iconColor} className={styles.icon} />}
|
|
104
104
|
<Grow>
|
|
105
105
|
<Text>{label}</Text>
|
|
106
106
|
</Grow>
|
|
107
|
-
<
|
|
107
|
+
<BaseIcon icon={faChevronRight} />
|
|
108
108
|
</Flex>
|
|
109
|
-
<
|
|
109
|
+
<BaseBlock className={styles.container} __allowChildren="all" ref={containerRef}>
|
|
110
110
|
{children}
|
|
111
|
-
</
|
|
111
|
+
</BaseBlock>
|
|
112
112
|
</Clickable>
|
|
113
113
|
</MenuCloseContextProvider>
|
|
114
114
|
);
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
padding-top: 1px;
|
|
31
31
|
margin-top: 1px;
|
|
32
32
|
border-top: 1px solid var(--menu-divider-color);
|
|
33
|
+
width: 100%;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
.item {
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
pointer-events: none;
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
&.open
|
|
84
|
+
&.open {
|
|
84
85
|
.menu {
|
|
85
86
|
visibility: visible;
|
|
86
87
|
pointer-events: initial;
|
|
@@ -113,7 +114,7 @@
|
|
|
113
114
|
bottom: 3px;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
&.open
|
|
117
|
+
&.open {
|
|
117
118
|
.container {
|
|
118
119
|
visibility: visible;
|
|
119
120
|
pointer-events: initial;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
import type { RefObject } from 'react';
|
|
3
|
+
|
|
4
|
+
export function useHoverMenu({ openToSide, ref }: { ref: RefObject<HTMLElement | null>; openToSide?: boolean }) {
|
|
5
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
6
|
+
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
7
|
+
const [offset, setOffset] = useState({ x: 0, y: 0 });
|
|
8
|
+
|
|
9
|
+
// Dispatch
|
|
10
|
+
|
|
11
|
+
// Callbacks
|
|
12
|
+
const recalculatePosition = useCallback(() => {
|
|
13
|
+
if (!ref.current) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const { top, left, bottom, right, width, height } = ref.current.getBoundingClientRect();
|
|
17
|
+
if (openToSide) {
|
|
18
|
+
setPosition({ x: right, y: top });
|
|
19
|
+
setOffset({ x: width, y: -height });
|
|
20
|
+
} else {
|
|
21
|
+
setPosition({ x: left, y: bottom });
|
|
22
|
+
setOffset({ x: -width, y: height });
|
|
23
|
+
}
|
|
24
|
+
}, [openToSide, ref]);
|
|
25
|
+
|
|
26
|
+
const close = useCallback(() => {
|
|
27
|
+
setIsOpen(false);
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
const open = useCallback(() => {
|
|
31
|
+
recalculatePosition();
|
|
32
|
+
setIsOpen(true);
|
|
33
|
+
}, [recalculatePosition]);
|
|
34
|
+
|
|
35
|
+
return { isOpen, position, open, close, offset };
|
|
36
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { JSX } from 'react/jsx-runtime';
|
|
3
|
-
import type { Recursive } from '
|
|
3
|
+
import type { Recursive } from '../TypeHelpers';
|
|
4
4
|
|
|
5
5
|
export type RbmChildWithoutString = Recursive<JSX.Element | undefined | null | RbmChildWithoutString[]> | false;
|
|
6
6
|
export type WithNoStringProps =
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseInlineBlock } from '../Layout/BaseInlineBlock';
|
|
3
3
|
import { useEffect, useRef } from 'react';
|
|
4
|
-
import { withMemo } from '
|
|
5
|
-
import type { WithNoStringAndChildrenProps } from '
|
|
4
|
+
import { withMemo } from '../../helper/withMemo';
|
|
5
|
+
import type { WithNoStringAndChildrenProps } from '../RbmComponentProps';
|
|
6
6
|
|
|
7
7
|
export type SizeCalculatorProps = {
|
|
8
8
|
onSize: (width: number, height: number) => void;
|
|
@@ -34,9 +34,9 @@ function SizeCalculator({ onSize, children, absolute = false }: SizeCalculatorPr
|
|
|
34
34
|
// Render Functions
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
|
-
<
|
|
37
|
+
<BaseInlineBlock ref={ref} __allowChildren="all" style={{ position: absolute ? 'absolute' : 'static' }}>
|
|
38
38
|
{children}
|
|
39
|
-
</
|
|
39
|
+
</BaseInlineBlock>
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { TEXT_SIZE, Text } from '
|
|
2
|
+
import { BaseBlock } from '../../Layout/BaseBlock';
|
|
3
|
+
import { BaseIcon } from '../../Icon/BaseIcon';
|
|
4
|
+
import { Clickable } from '../../Clickable/Clickable';
|
|
5
|
+
import { Flex } from '../../Layout/Flex';
|
|
6
|
+
import { Grow } from '../../Layout/Grow';
|
|
7
|
+
import { TEXT_SIZE, Text } from '../../Text/Text';
|
|
8
8
|
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
9
9
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
10
|
-
import { useListener } from '
|
|
11
|
-
import { withMemo } from '
|
|
10
|
+
import { useListener } from '../../Hooks/useListener';
|
|
11
|
+
import { withMemo } from '../../../helper/withMemo';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
|
-
import styles from '
|
|
14
|
-
import type { IconSource } from '
|
|
13
|
+
import styles from './spoiler.module.scss';
|
|
14
|
+
import type { IconSource } from '../../Icon/BaseIcon';
|
|
15
15
|
import type { MouseEvent, ReactNode } from 'react';
|
|
16
|
-
import type { OptionalListener } from '
|
|
17
|
-
import type { RbmComponentProps, WithChildren } from '
|
|
16
|
+
import type { OptionalListener } from '../../Hooks/useListener';
|
|
17
|
+
import type { RbmComponentProps, WithChildren } from '../../RbmComponentProps';
|
|
18
18
|
|
|
19
19
|
export type SpoilerProps<OnClickData> = RbmComponentProps<
|
|
20
20
|
{
|
|
@@ -59,7 +59,7 @@ export const Spoiler = withMemo(function Spoiler<OnClickData>({
|
|
|
59
59
|
const onClickListener = useListener<'onClick', OnClickData, boolean>('onClick', listenerProps);
|
|
60
60
|
|
|
61
61
|
const toggleOpen = useCallback(
|
|
62
|
-
(
|
|
62
|
+
(_: MouseEvent) => {
|
|
63
63
|
if (open !== undefined) {
|
|
64
64
|
onClickListener?.(!open);
|
|
65
65
|
} else {
|
|
@@ -100,14 +100,14 @@ export const Spoiler = withMemo(function Spoiler<OnClickData>({
|
|
|
100
100
|
<Clickable onClick={toggleOpen}>
|
|
101
101
|
<Flex horizontal={true}>
|
|
102
102
|
<Grow __allowChildren="all">{titleComponent}</Grow>
|
|
103
|
-
{icon ? <
|
|
103
|
+
{icon ? <BaseIcon icon={icon} className={styles.icon} /> : null}
|
|
104
104
|
</Flex>
|
|
105
105
|
</Clickable>
|
|
106
|
-
<
|
|
107
|
-
<
|
|
106
|
+
<BaseBlock className={styles.bodyContainer}>
|
|
107
|
+
<BaseBlock __allowChildren="all" className={styles.body}>
|
|
108
108
|
{children}
|
|
109
|
-
</
|
|
110
|
-
</
|
|
109
|
+
</BaseBlock>
|
|
110
|
+
</BaseBlock>
|
|
111
111
|
</Clickable>
|
|
112
112
|
);
|
|
113
113
|
}, 'all');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Spoiler } from '
|
|
4
|
-
import { useSpoilerGroup } from '
|
|
5
|
-
import { withMemo } from '
|
|
2
|
+
import { BaseBlock } from '../Layout/BaseBlock';
|
|
3
|
+
import { Spoiler } from './Spoiler/Spoiler';
|
|
4
|
+
import { useSpoilerGroup } from './useSpoilerGroup';
|
|
5
|
+
import { withMemo } from '../../helper/withMemo';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import type { RbmComponentProps, WithNoChildren } from '
|
|
7
|
+
import type { RbmComponentProps, WithNoChildren } from '../RbmComponentProps';
|
|
8
8
|
import type { ReactElement } from 'react';
|
|
9
9
|
|
|
10
10
|
export type SpoilerItem<BodyData, TitleData = string> = {
|
|
@@ -48,12 +48,12 @@ export const SpoilerList = withMemo(function SpoilerList<BodyData, TitleData = s
|
|
|
48
48
|
|
|
49
49
|
// Render Functions
|
|
50
50
|
return (
|
|
51
|
-
<
|
|
51
|
+
<BaseBlock className={classNames(className)} style={style}>
|
|
52
52
|
{data.map((item) => (
|
|
53
53
|
<Spoiler title={renderTitle(item)} {...propsGenerator(item.key)}>
|
|
54
54
|
{renderBody(item)}
|
|
55
55
|
</Spoiler>
|
|
56
56
|
))}
|
|
57
|
-
</
|
|
57
|
+
</BaseBlock>
|
|
58
58
|
);
|
|
59
59
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
|
|
3
|
-
import { TabBar } from '
|
|
3
|
+
import { TabBar } from './TabBar';
|
|
4
4
|
import { faCog, faHome, faSearch, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
5
5
|
import { fn } from 'storybook/test';
|
|
6
6
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Inline } from '
|
|
5
|
-
import { TabBarButton } from '
|
|
6
|
-
import { Text } from '
|
|
2
|
+
import { BaseIcon } from '../Icon/BaseIcon';
|
|
3
|
+
import { Container } from '../Layout/Container';
|
|
4
|
+
import { Inline } from '../Layout/Inline';
|
|
5
|
+
import { TabBarButton } from './TabBarButton';
|
|
6
|
+
import { Text } from '../Text/Text';
|
|
7
7
|
import { useCallback, useState } from 'react';
|
|
8
|
-
import { withMemo } from '
|
|
8
|
+
import { withMemo } from '../../helper/withMemo';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
|
-
import styles from '
|
|
10
|
+
import styles from './tabBar.module.scss';
|
|
11
11
|
import type { ComponentType } from 'react';
|
|
12
|
-
import type { IconSource } from '
|
|
13
|
-
import type { ListenerWithData } from '
|
|
14
|
-
import type { RbmComponentProps } from '
|
|
12
|
+
import type { IconSource } from '../Icon/BaseIcon';
|
|
13
|
+
import type { ListenerWithData } from '../Hooks/useListener';
|
|
14
|
+
import type { RbmComponentProps } from '../RbmComponentProps';
|
|
15
15
|
|
|
16
16
|
export type TabBarComponentButtonType = {
|
|
17
17
|
component: ComponentType<Record<string, any>>;
|
|
@@ -55,7 +55,7 @@ function getButtonComponents(buttons: TabBarButtonType[], activeTab: number, onS
|
|
|
55
55
|
return (
|
|
56
56
|
<TabBarButton key={key} active={isActive} onClickData={index} onClick={onSelect}>
|
|
57
57
|
<Inline>
|
|
58
|
-
{button.icon ? <
|
|
58
|
+
{button.icon ? <BaseIcon icon={button.icon} className={styles.buttonIcon} /> : null}
|
|
59
59
|
{button.title ? <Text className={styles.buttonTitle}>{button.title}</Text> : null}
|
|
60
60
|
</Inline>
|
|
61
61
|
</TabBarButton>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useListenerWithExtractedProps } from '
|
|
3
|
-
import { withMemo } from '
|
|
2
|
+
import { useListenerWithExtractedProps } from '../Hooks/useListener';
|
|
3
|
+
import { withMemo } from '../../helper/withMemo';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import styles from '
|
|
6
|
-
import type { Listener } from '
|
|
7
|
-
import type { RbmComponentProps } from '
|
|
5
|
+
import styles from './tabBar.module.scss';
|
|
6
|
+
import type { Listener } from '../Hooks/useListener';
|
|
7
|
+
import type { RbmComponentProps } from '../RbmComponentProps';
|
|
8
8
|
|
|
9
9
|
export type TabBarButtonProps = RbmComponentProps<
|
|
10
10
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useSortBy, useTable } from 'react-table';
|
|
3
|
-
import { withMemo } from '
|
|
3
|
+
import { withMemo } from '../../helper/withMemo';
|
|
4
4
|
import type {
|
|
5
5
|
Cell,
|
|
6
6
|
HeaderGroup,
|
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
TableOptions,
|
|
11
11
|
UseSortByOptions,
|
|
12
12
|
} from 'react-table';
|
|
13
|
-
import type { RbmComponentProps } from '
|
|
13
|
+
import type { RbmComponentProps } from '../RbmComponentProps';
|
|
14
14
|
import type { ReactNode } from 'react';
|
|
15
15
|
|
|
16
16
|
export type ColumnCellData<DataType extends string | number | Record<string, unknown>> = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { TEXT_PRIO, TEXT_SIZE, Text } from '
|
|
3
|
-
import { withMemo } from '
|
|
2
|
+
import { TEXT_PRIO, TEXT_SIZE, Text } from './Text';
|
|
3
|
+
import { withMemo } from '../../helper/withMemo';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import styles from '
|
|
6
|
-
import type { EmptyProps } from '
|
|
7
|
-
import type { RbmComponentProps, WithStringProps } from '
|
|
5
|
+
import styles from './heading.module.scss';
|
|
6
|
+
import type { EmptyProps } from '../../helper/EmptyProps';
|
|
7
|
+
import type { RbmComponentProps, WithStringProps } from '../RbmComponentProps';
|
|
8
8
|
|
|
9
9
|
export type HeadingProps = RbmComponentProps<EmptyProps, WithStringProps>;
|
|
10
10
|
|