@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
package/eslint.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { ActionSheet } from '@/Components/ActionSheet/ActionSheet';
|
|
1
|
+
import { ActionSheet } from './ActionSheet';
|
|
4
2
|
import { faCog, faHouse, faTrash, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
5
3
|
import { fn } from 'storybook/test';
|
|
6
4
|
import React, { useEffect, useRef } from 'react';
|
|
7
|
-
import type { ActionSheetHandle } from '
|
|
5
|
+
import type { ActionSheetHandle } from './ActionSheet';
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
8
7
|
|
|
9
8
|
const meta = {
|
|
10
9
|
component: ActionSheet,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Text } from '
|
|
2
|
+
import { BaseBlock } from '../Layout/BaseBlock';
|
|
3
|
+
import { BaseIcon } from '../Icon/BaseIcon';
|
|
4
|
+
import { BaseInlineBlock } from '../Layout/BaseInlineBlock';
|
|
5
|
+
import { Clickable } from '../Clickable/Clickable';
|
|
6
|
+
import { Container } from '../Layout/Container';
|
|
7
|
+
import { Flex } from '../Layout/Flex';
|
|
8
|
+
import { Text } from '../Text/Text';
|
|
9
9
|
import { faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
10
10
|
import { useCallback, useImperativeHandle, useState } from 'react';
|
|
11
|
-
import { withMemo } from '
|
|
12
|
-
import baseStyles from '
|
|
11
|
+
import { withMemo } from '../../helper/withMemo';
|
|
12
|
+
import baseStyles from '../../scss/baseClasses.module.scss';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
-
import styles from '
|
|
14
|
+
import styles from './actionSheet.module.scss';
|
|
15
15
|
import type { ForwardedRef } from 'react';
|
|
16
|
-
import type { IconSource } from '
|
|
17
|
-
import type { RbmComponentProps } from '
|
|
16
|
+
import type { IconSource } from '../Icon/BaseIcon';
|
|
17
|
+
import type { RbmComponentProps } from '../RbmComponentProps';
|
|
18
18
|
|
|
19
19
|
export type ActionSheetAction<ActionData> = {
|
|
20
20
|
name: string;
|
|
@@ -89,7 +89,9 @@ export const ActionSheet = withMemo(function ActionSheet({
|
|
|
89
89
|
onClick={onActionClick}
|
|
90
90
|
onClickData={action}
|
|
91
91
|
>
|
|
92
|
-
<
|
|
92
|
+
<BaseInlineBlock className={styles.actionIcon}>
|
|
93
|
+
{action.icon ? <BaseIcon icon={action.icon} /> : null}
|
|
94
|
+
</BaseInlineBlock>
|
|
93
95
|
<Text className={styles.actionName}>{action.name}</Text>
|
|
94
96
|
</Clickable>
|
|
95
97
|
);
|
|
@@ -103,9 +105,9 @@ export const ActionSheet = withMemo(function ActionSheet({
|
|
|
103
105
|
<Container fluid="xxl" className={baseStyles.fullHeight}>
|
|
104
106
|
<Flex className={styles.content}>
|
|
105
107
|
{title ? (
|
|
106
|
-
<
|
|
108
|
+
<BaseBlock className={styles.title}>
|
|
107
109
|
<Text>{title}</Text>
|
|
108
|
-
</
|
|
110
|
+
</BaseBlock>
|
|
109
111
|
) : null}
|
|
110
112
|
{actions.map(renderAction)}
|
|
111
113
|
<Clickable
|
|
@@ -113,9 +115,9 @@ export const ActionSheet = withMemo(function ActionSheet({
|
|
|
113
115
|
onClick={() => console.log('Cancel clicked')}
|
|
114
116
|
__allowChildren="all"
|
|
115
117
|
>
|
|
116
|
-
<
|
|
117
|
-
<
|
|
118
|
-
</
|
|
118
|
+
<BaseInlineBlock className={styles.actionIcon}>
|
|
119
|
+
<BaseIcon icon={faTimes} />
|
|
120
|
+
</BaseInlineBlock>
|
|
119
121
|
{cancelText}
|
|
120
122
|
</Clickable>
|
|
121
123
|
</Flex>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { Card } from '@/Components/Card/Card';
|
|
4
|
-
import { Text } from '@/Components/Text/Text';
|
|
1
|
+
import { Card } from './Card';
|
|
2
|
+
import { Text } from '../Text/Text';
|
|
5
3
|
import React from 'react';
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
5
|
|
|
7
6
|
const meta = {
|
|
8
7
|
component: Card,
|
|
@@ -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 './card.module.scss';
|
|
5
|
+
import type { RbmComponentProps } from '../RbmComponentProps';
|
|
6
6
|
import type { ReactElement } from 'react';
|
|
7
7
|
|
|
8
8
|
export type CardProps = RbmComponentProps<{
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useCallback, useEffect, useRef } from 'react';
|
|
3
|
-
import { useComposedRef } from '
|
|
4
|
-
import { useListener } from '
|
|
5
|
-
import { withMemo } from '
|
|
3
|
+
import { useComposedRef } from '../Hooks/useComposedRef';
|
|
4
|
+
import { useListener } from '../Hooks/useListener';
|
|
5
|
+
import { withMemo } from '../../helper/withMemo';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import styles from '
|
|
7
|
+
import styles from './clickable.module.scss';
|
|
8
8
|
import type { ForwardedRef, MouseEvent, PointerEvent, MouseEvent as ReactMouseEvent } from 'react';
|
|
9
|
-
import type { OptionalListener } from '
|
|
10
|
-
import type { RbmComponentProps } from '
|
|
9
|
+
import type { OptionalListener } from '../Hooks/useListener';
|
|
10
|
+
import type { RbmComponentProps } from '../RbmComponentProps';
|
|
11
11
|
|
|
12
12
|
type OnClickListener<Data> = OptionalListener<'onClick', Data>;
|
|
13
13
|
type OnPointerDownListener<Data> = OptionalListener<'onPointerDown', Data, PointerEvent>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { Grid } from '@/Components/Layout/Grid/Grid';
|
|
5
|
-
import { GridItem } from '@/Components/Layout/Grid/GridItem';
|
|
1
|
+
import { BaseBlock } from './Layout/BaseBlock';
|
|
2
|
+
import { Grid } from './Layout/Grid/Grid';
|
|
3
|
+
import { GridItem } from './Layout/Grid/GridItem';
|
|
6
4
|
import { ObjectHelper } from '@ainias42/js-helper';
|
|
7
|
-
import { Text } from '
|
|
5
|
+
import { Text } from './Text/Text';
|
|
8
6
|
import React from 'react';
|
|
7
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
9
8
|
|
|
10
9
|
const meta = {} satisfies Meta<typeof Text>;
|
|
11
10
|
|
|
@@ -40,7 +39,7 @@ export const Default: Story = {
|
|
|
40
39
|
return (
|
|
41
40
|
<div>
|
|
42
41
|
{ObjectHelper.entries(textColors).map(([category, colors]) => (
|
|
43
|
-
<
|
|
42
|
+
<BaseBlock>
|
|
44
43
|
<Text emphasized={true}>Text - {category}</Text>
|
|
45
44
|
<Grid>
|
|
46
45
|
{colors.map((color) => (
|
|
@@ -49,15 +48,15 @@ export const Default: Story = {
|
|
|
49
48
|
</GridItem>
|
|
50
49
|
))}
|
|
51
50
|
</Grid>
|
|
52
|
-
</
|
|
51
|
+
</BaseBlock>
|
|
53
52
|
))}
|
|
54
53
|
{ObjectHelper.entries(backgroundColors).map(([category, colors]) => (
|
|
55
|
-
<
|
|
54
|
+
<BaseBlock>
|
|
56
55
|
<Text emphasized={true}>Background - {category}</Text>
|
|
57
56
|
<Grid>
|
|
58
57
|
{colors.map((color) => (
|
|
59
58
|
<GridItem size={2}>
|
|
60
|
-
<
|
|
59
|
+
<BaseBlock
|
|
61
60
|
style={{
|
|
62
61
|
backgroundColor: `var(--${color})`,
|
|
63
62
|
padding: '0.5rem',
|
|
@@ -65,11 +64,11 @@ export const Default: Story = {
|
|
|
65
64
|
}}
|
|
66
65
|
>
|
|
67
66
|
<Text>{color}</Text>
|
|
68
|
-
</
|
|
67
|
+
</BaseBlock>
|
|
69
68
|
</GridItem>
|
|
70
69
|
))}
|
|
71
70
|
</Grid>
|
|
72
|
-
</
|
|
71
|
+
</BaseBlock>
|
|
73
72
|
))}
|
|
74
73
|
</div>
|
|
75
74
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AlertDialog } from '
|
|
2
|
-
import { Dialog } from '
|
|
1
|
+
import { AlertDialog } from './AlertDialog';
|
|
2
|
+
import { Dialog } from './Dialog';
|
|
3
3
|
import { fn } from 'storybook/test';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ButtonDialog } from '
|
|
2
|
+
import { ButtonDialog } from './ButtonDialog';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { withMemo } from '
|
|
4
|
+
import { withMemo } from '../../helper/withMemo';
|
|
5
5
|
|
|
6
6
|
export type AlertDialogProps = {
|
|
7
7
|
title?: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Clickable } from '
|
|
4
|
-
import { Flavor } from '
|
|
5
|
-
import { TEXT_SIZE, Text } from '
|
|
6
|
-
import { withMemo } from '
|
|
2
|
+
import { BaseBlock } from '../Layout/BaseBlock';
|
|
3
|
+
import { Clickable } from '../Clickable/Clickable';
|
|
4
|
+
import { Flavor } from '../Flavor';
|
|
5
|
+
import { TEXT_SIZE, Text } from '../Text/Text';
|
|
6
|
+
import { withMemo } from '../../helper/withMemo';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import styles from '
|
|
9
|
-
import type { RbmComponentProps, WithNoChildren } from '
|
|
8
|
+
import styles from './buttonDialog.module.scss';
|
|
9
|
+
import type { RbmComponentProps, WithNoChildren } from '../RbmComponentProps';
|
|
10
10
|
import type { ReactElement } from 'react';
|
|
11
11
|
|
|
12
12
|
export type ButtonDialogProps = RbmComponentProps<
|
|
@@ -37,27 +37,27 @@ function ButtonDialog({ title, message, buttons, style, className, extraContent
|
|
|
37
37
|
// Render Functions
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
|
-
<
|
|
40
|
+
<BaseBlock className={classNames(styles.buttonDialog, className)} style={style}>
|
|
41
41
|
{!!title && (
|
|
42
|
-
<
|
|
42
|
+
<BaseBlock>
|
|
43
43
|
<Text size={TEXT_SIZE.large} className={styles.title}>
|
|
44
44
|
{title}
|
|
45
45
|
</Text>
|
|
46
|
-
</
|
|
46
|
+
</BaseBlock>
|
|
47
47
|
)}
|
|
48
|
-
<
|
|
48
|
+
<BaseBlock>
|
|
49
49
|
<Text className={styles.message}>{message}</Text>
|
|
50
|
-
</
|
|
50
|
+
</BaseBlock>
|
|
51
51
|
{extraContent}
|
|
52
|
-
<
|
|
52
|
+
<BaseBlock className={styles.buttonContainer}>
|
|
53
53
|
{buttons.map((b, i) => (
|
|
54
54
|
// eslint-disable-next-line react/no-array-index-key
|
|
55
55
|
<Clickable onClick={b.callback} className={classNames(styles.button)} key={i + b.text}>
|
|
56
56
|
<Text className={classNames(styles.buttonText, b.flavor ?? Flavor.Accent)}>{b.text}</Text>
|
|
57
57
|
</Clickable>
|
|
58
58
|
))}
|
|
59
|
-
</
|
|
60
|
-
</
|
|
59
|
+
</BaseBlock>
|
|
60
|
+
</BaseBlock>
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { ConfirmDialog } from '@/Components/Dialog/ConfirmDialog';
|
|
4
|
-
import { Dialog } from '@/Components/Dialog/Dialog';
|
|
1
|
+
import { ConfirmDialog } from './ConfirmDialog';
|
|
2
|
+
import { Dialog } from './Dialog';
|
|
5
3
|
import { fn } from 'storybook/test';
|
|
6
4
|
import React from 'react';
|
|
5
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
7
6
|
|
|
8
7
|
const meta = {
|
|
9
8
|
component: ConfirmDialog,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ButtonDialog } from '
|
|
2
|
+
import { ButtonDialog } from './ButtonDialog';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { withMemo } from '
|
|
4
|
+
import { withMemo } from '../../helper/withMemo';
|
|
5
5
|
|
|
6
6
|
export type ConfirmDialogProps = {
|
|
7
7
|
title?: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { BaseBlock } from '../Layout/BaseBlock';
|
|
3
|
+
import { BaseInlineBlock } from '../Layout/BaseInlineBlock';
|
|
4
|
+
import { Clickable } from '../Clickable/Clickable';
|
|
5
5
|
import { useCallback, useState } from 'react';
|
|
6
|
-
import { withMemo } from '
|
|
6
|
+
import { withMemo } from '../../helper/withMemo';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import styles from '
|
|
9
|
-
import type { RbmComponentProps } from '
|
|
8
|
+
import styles from './dialog.module.scss';
|
|
9
|
+
import type { RbmComponentProps } from '../RbmComponentProps';
|
|
10
10
|
import type { ReactElement } from 'react';
|
|
11
11
|
|
|
12
12
|
export type DialogProps<ReturnData> = RbmComponentProps<
|
|
@@ -63,17 +63,17 @@ function Dialog<ReturnData>({
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
return (
|
|
66
|
-
<
|
|
66
|
+
<BaseBlock className={classNames(styles.dialogContainer, className)} __allowChildren="all" style={style}>
|
|
67
67
|
<Clickable onClick={onCurtainClick} className={styles.closeCurtain} interactable={closable} />
|
|
68
|
-
<
|
|
68
|
+
<BaseInlineBlock __allowChildren="all" className={styles.dialog}>
|
|
69
69
|
{React.Children.map(children, (child) => {
|
|
70
70
|
if (React.isValidElement(child)) {
|
|
71
71
|
return React.cloneElement(child, { close });
|
|
72
72
|
}
|
|
73
73
|
return child;
|
|
74
74
|
})}
|
|
75
|
-
</
|
|
76
|
-
</
|
|
75
|
+
</BaseInlineBlock>
|
|
76
|
+
</BaseBlock>
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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 { Heading } from '../Text/Heading';
|
|
8
8
|
import { faCircleXmark } from '@fortawesome/free-solid-svg-icons';
|
|
9
|
-
import { withMemo } from '
|
|
9
|
+
import { withMemo } from '../../helper/withMemo';
|
|
10
10
|
import classNames from 'classnames';
|
|
11
|
-
import styles from '
|
|
12
|
-
import type { RbmComponentProps } from '
|
|
11
|
+
import styles from './dialogBackground.module.scss';
|
|
12
|
+
import type { RbmComponentProps } from '../RbmComponentProps';
|
|
13
13
|
|
|
14
14
|
export type DialogBackgroundProps = RbmComponentProps<{ title?: string; onClose?: () => void }>;
|
|
15
15
|
|
|
@@ -37,7 +37,7 @@ export const DialogBackground = withMemo(function DialogBackground({
|
|
|
37
37
|
// Render Functions
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
|
-
<
|
|
40
|
+
<BaseBlock __allowChildren="all" className={classNames(styles.dialogBackground, className)} style={style}>
|
|
41
41
|
{(!!title || !!onClose) && (
|
|
42
42
|
<Flex horizontal={true} className={styles.title}>
|
|
43
43
|
{!!title && (
|
|
@@ -47,12 +47,12 @@ export const DialogBackground = withMemo(function DialogBackground({
|
|
|
47
47
|
)}
|
|
48
48
|
{!!onClose && (
|
|
49
49
|
<Clickable onClick={onClose}>
|
|
50
|
-
<
|
|
50
|
+
<BaseIcon size="lg" icon={faCircleXmark} />
|
|
51
51
|
</Clickable>
|
|
52
52
|
)}
|
|
53
53
|
</Flex>
|
|
54
54
|
)}
|
|
55
55
|
{children}
|
|
56
|
-
</
|
|
56
|
+
</BaseBlock>
|
|
57
57
|
);
|
|
58
58
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Dialog } from '
|
|
4
|
-
import { DialogProvider } from '
|
|
2
|
+
import { BaseBlock } from '../Layout/BaseBlock';
|
|
3
|
+
import { Dialog } from './Dialog';
|
|
4
|
+
import { DialogProvider } from './DialogContext';
|
|
5
5
|
import { PromiseWithHandlers } from '@ainias42/js-helper';
|
|
6
6
|
import { useCallback, useImperativeHandle, useState } from 'react';
|
|
7
|
-
import { withMemo } from '
|
|
7
|
+
import { withMemo } from '../../helper/withMemo';
|
|
8
8
|
import type { ComponentType, ForwardedRef, PropsWithChildren } from 'react';
|
|
9
|
-
import type { ShowDialog } from '
|
|
9
|
+
import type { ShowDialog } from './DialogContext';
|
|
10
10
|
|
|
11
11
|
export type DialogContainerProps = PropsWithChildren<{
|
|
12
12
|
dialogClassName?: string;
|
|
@@ -80,7 +80,7 @@ export const DialogContainer = withMemo(function DialogContainer({
|
|
|
80
80
|
return (
|
|
81
81
|
<DialogProvider value={showDialog}>
|
|
82
82
|
{children}
|
|
83
|
-
<
|
|
83
|
+
<BaseBlock className={dialogClassName}>
|
|
84
84
|
{dialogs.map((d) => {
|
|
85
85
|
const DialogComponent = d.component;
|
|
86
86
|
return (
|
|
@@ -89,7 +89,7 @@ export const DialogContainer = withMemo(function DialogContainer({
|
|
|
89
89
|
</Dialog>
|
|
90
90
|
);
|
|
91
91
|
})}
|
|
92
|
-
</
|
|
92
|
+
</BaseBlock>
|
|
93
93
|
</DialogProvider>
|
|
94
94
|
);
|
|
95
95
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AlertDialog } from '
|
|
1
|
+
import { AlertDialog } from './AlertDialog';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
|
-
import { useDialog } from '
|
|
3
|
+
import { useDialog } from './DialogContext';
|
|
4
4
|
|
|
5
5
|
export function useAlertDialog() {
|
|
6
6
|
const showDialog = useDialog();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ConfirmDialog } from '
|
|
1
|
+
import { ConfirmDialog } from './ConfirmDialog';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
|
-
import { useDialog } from '
|
|
3
|
+
import { useDialog } from './DialogContext';
|
|
4
4
|
|
|
5
5
|
export function useConfirmDialog() {
|
|
6
6
|
const showDialog = useDialog();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Draggable } from '@hello-pangea/dnd';
|
|
3
|
-
import { withMemo } from '
|
|
3
|
+
import { withMemo } from '../../helper/withMemo';
|
|
4
4
|
import type { DraggableProps } from '@hello-pangea/dnd';
|
|
5
|
-
import type { RbmComponentProps, WithNoStringAndChildrenProps } from '
|
|
5
|
+
import type { RbmComponentProps, WithNoStringAndChildrenProps } from '../RbmComponentProps';
|
|
6
6
|
|
|
7
7
|
export type DragItemProps = RbmComponentProps<Omit<DraggableProps, 'children'>, WithNoStringAndChildrenProps>;
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Droppable } from '@hello-pangea/dnd';
|
|
3
|
-
import { useStrictEnabled } from '
|
|
4
|
-
import { withMemo } from '
|
|
3
|
+
import { useStrictEnabled } from './useStrictEnabled';
|
|
4
|
+
import { withMemo } from '../../helper/withMemo';
|
|
5
5
|
import type { DroppableProps } from '@hello-pangea/dnd';
|
|
6
|
-
import type { RbmComponentProps, WithNoStringAndChildrenProps } from '
|
|
6
|
+
import type { RbmComponentProps, WithNoStringAndChildrenProps } from '../RbmComponentProps';
|
|
7
7
|
|
|
8
8
|
export type DropAreaProps = RbmComponentProps<Omit<DroppableProps, 'children'>, WithNoStringAndChildrenProps>;
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Heading } from '
|
|
3
|
-
import { Text } from '
|
|
1
|
+
import { BaseBlock } from './Layout/BaseBlock';
|
|
2
|
+
import { Heading } from './Text/Heading';
|
|
3
|
+
import { Text } from './Text/Text';
|
|
4
4
|
import React, { Component } from 'react';
|
|
5
5
|
import type { ReactNode } from 'react';
|
|
6
6
|
|
|
@@ -35,10 +35,10 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, State> {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
<
|
|
38
|
+
<BaseBlock>
|
|
39
39
|
<Heading>{message}</Heading>
|
|
40
40
|
{!!stack && showStack && <Text style={{ whiteSpace: 'pre' }}>{stack}</Text>}
|
|
41
|
-
</
|
|
41
|
+
</BaseBlock>
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
return children;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Button } from '
|
|
2
|
-
import { ButtonType } from '
|
|
3
|
-
import { Flavor } from '
|
|
4
|
-
import { Size } from '
|
|
5
|
-
import { Text } from '
|
|
1
|
+
import { Button } from './Button';
|
|
2
|
+
import { ButtonType } from './ButtonType';
|
|
3
|
+
import { Flavor } from '../../Flavor';
|
|
4
|
+
import { Size } from '../../../Size';
|
|
5
|
+
import { Text } from '../../Text/Text';
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import type { ButtonProps } from '
|
|
7
|
+
import type { ButtonProps } from './Button';
|
|
8
8
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
9
9
|
|
|
10
10
|
const meta = {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ButtonType } from '
|
|
3
|
-
import { Flavor } from '
|
|
4
|
-
import { Size } from '
|
|
2
|
+
import { ButtonType } from './ButtonType';
|
|
3
|
+
import { Flavor } from '../../Flavor';
|
|
4
|
+
import { Size } from '../../../Size';
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
|
-
import { useListenerWithExtractedProps } from '
|
|
7
|
-
import {
|
|
6
|
+
import { useListenerWithExtractedProps } from '../../Hooks/useListener';
|
|
7
|
+
import { withTitle } from '../../Title/withTitle';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
|
-
import styles from '
|
|
9
|
+
import styles from './button.module.scss';
|
|
10
10
|
import type { HTMLAttributes, MouseEvent } from 'react';
|
|
11
|
-
import type { OptionalListener } from '
|
|
11
|
+
import type { OptionalListener } from '../../Hooks/useListener';
|
|
12
12
|
import type { Override } from '@ainias42/js-helper';
|
|
13
|
-
import type { RbmComponentProps } from '
|
|
13
|
+
import type { RbmComponentProps } from '../../RbmComponentProps';
|
|
14
14
|
|
|
15
15
|
export type ButtonProps<ClickData> = RbmComponentProps<
|
|
16
16
|
Override<
|
|
@@ -26,7 +26,7 @@ export type ButtonProps<ClickData> = RbmComponentProps<
|
|
|
26
26
|
>
|
|
27
27
|
>;
|
|
28
28
|
|
|
29
|
-
export const Button =
|
|
29
|
+
export const Button = withTitle(function Button<ClickData>({
|
|
30
30
|
children,
|
|
31
31
|
className,
|
|
32
32
|
disabled,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { FormError } from '
|
|
2
|
+
import { FormError } from '../Error/FormError';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
|
-
import { useListenerWithExtractedProps } from '
|
|
5
|
-
import { withMemo } from '
|
|
4
|
+
import { useListenerWithExtractedProps } from '../../Hooks/useListener';
|
|
5
|
+
import { withMemo } from '../../../helper/withMemo';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import styles from '
|
|
7
|
+
import styles from './checkbox.module.scss';
|
|
8
8
|
import type { ChangeEventHandler, InputHTMLAttributes } from 'react';
|
|
9
|
-
import type { OptionalListener } from '
|
|
9
|
+
import type { OptionalListener } from '../../Hooks/useListener';
|
|
10
10
|
import type { Override } from '@ainias42/js-helper';
|
|
11
|
-
import type { RbmComponentProps } from '
|
|
11
|
+
import type { RbmComponentProps } from '../../RbmComponentProps';
|
|
12
12
|
|
|
13
13
|
export type CheckboxProps<OnChangeData, OnChangeCheckedData> = RbmComponentProps<
|
|
14
14
|
Override<
|