@qoretechnologies/reqore 0.32.0 → 0.32.3
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/.github/workflows/tests.yml +3 -1
- package/__tests__/breadcrumbs.test.tsx +46 -28
- package/__tests__/button.test.tsx +18 -0
- package/__tests__/checkbox.test.tsx +19 -1
- package/__tests__/collection.test.tsx +9 -0
- package/__tests__/icon.test.tsx +19 -1
- package/__tests__/input.test.tsx +18 -0
- package/__tests__/messages.test.tsx +16 -0
- package/__tests__/modal.test.tsx +4 -4
- package/__tests__/notifications.test.tsx +6 -6
- package/__tests__/panel.test.tsx +19 -1
- package/__tests__/textarea.test.tsx +18 -0
- package/__tests__/tree.test.tsx +3 -1
- package/dist/components/Breadcrumbs/item.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/item.js +6 -2
- package/dist/components/Breadcrumbs/item.js.map +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +18 -4
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +8 -4
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Collection/index.d.ts +2 -1
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +15 -12
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.js +2 -2
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Comment/index.d.ts +0 -1
- package/dist/components/Comment/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +5 -3
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/item.d.ts +0 -1
- package/dist/components/Dropdown/item.d.ts.map +1 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +8 -4
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +4 -4
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.d.ts +0 -1
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +2 -1
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/Menu/item.d.ts +1 -1
- package/dist/components/Menu/item.d.ts.map +1 -1
- package/dist/components/Menu/item.js +3 -6
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +6 -2
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/Modal/index.d.ts +0 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Panel/index.d.ts +1 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +13 -9
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Panel/panel.screenshot.d.ts +0 -1
- package/dist/components/Panel/panel.screenshot.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js +1 -1
- package/dist/components/Sidebar/item.d.ts +0 -1
- package/dist/components/Sidebar/item.d.ts.map +1 -1
- package/dist/components/Sidebar/item.js +1 -3
- package/dist/components/Sidebar/item.js.map +1 -1
- package/dist/components/Spinner/index.d.ts +3 -3
- package/dist/components/Spinner/index.d.ts.map +1 -1
- package/dist/components/Spinner/index.js +13 -2
- package/dist/components/Spinner/index.js.map +1 -1
- package/dist/components/Table/header.d.ts +0 -1
- package/dist/components/Table/header.d.ts.map +1 -1
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +7 -4
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +7 -6
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Tree/index.d.ts +0 -1
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +2 -4
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/containers/PopoverProvider.d.ts.map +1 -1
- package/dist/containers/PopoverProvider.js +2 -2
- package/dist/containers/PopoverProvider.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +4 -0
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/ThemeProvider.d.ts +1 -2
- package/dist/containers/ThemeProvider.d.ts.map +1 -1
- package/dist/containers/ThemeProvider.js +3 -3
- package/dist/containers/ThemeProvider.js.map +1 -1
- package/dist/context/PopoverContext.d.ts +1 -2
- package/dist/context/PopoverContext.d.ts.map +1 -1
- package/dist/context/PopoverContext.js +2 -2
- package/dist/context/PopoverContext.js.map +1 -1
- package/dist/context/ReqoreContext.d.ts +3 -2
- package/dist/context/ReqoreContext.d.ts.map +1 -1
- package/dist/context/ReqoreContext.js +5 -3
- package/dist/context/ReqoreContext.js.map +1 -1
- package/dist/context/ThemeContext.d.ts +1 -2
- package/dist/context/ThemeContext.d.ts.map +1 -1
- package/dist/context/ThemeContext.js +2 -2
- package/dist/context/ThemeContext.js.map +1 -1
- package/dist/hooks/useLatestZIndex.d.ts.map +1 -1
- package/dist/hooks/useLatestZIndex.js +3 -2
- package/dist/hooks/useLatestZIndex.js.map +1 -1
- package/dist/hooks/usePopover.d.ts +0 -1
- package/dist/hooks/usePopover.d.ts.map +1 -1
- package/dist/hooks/usePopover.js +4 -3
- package/dist/hooks/usePopover.js.map +1 -1
- package/dist/hooks/useReqore.js +2 -2
- package/dist/hooks/useReqore.js.map +1 -1
- package/dist/hooks/useReqoreContext.d.ts +3 -0
- package/dist/hooks/useReqoreContext.d.ts.map +1 -0
- package/dist/hooks/useReqoreContext.js +19 -0
- package/dist/hooks/useReqoreContext.js.map +1 -0
- package/dist/hooks/useReqoreEffect.js +2 -5
- package/dist/hooks/useReqoreEffect.js.map +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useTheme.js +20 -20
- package/dist/hooks/useTheme.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +18 -16
- package/src/components/Breadcrumbs/item.tsx +7 -3
- package/src/components/Button/index.tsx +25 -7
- package/src/components/Checkbox/index.tsx +9 -5
- package/src/components/Collection/index.tsx +21 -9
- package/src/components/Collection/item.tsx +3 -3
- package/src/components/ControlGroup/index.tsx +4 -2
- package/src/components/Drawer/index.tsx +4 -4
- package/src/components/Icon/index.tsx +9 -5
- package/src/components/Input/index.tsx +5 -9
- package/src/components/InternalPopover/index.tsx +2 -1
- package/src/components/Menu/item.tsx +6 -9
- package/src/components/Message/index.tsx +6 -2
- package/src/components/Panel/index.tsx +14 -7
- package/src/components/Paragraph/index.tsx +1 -1
- package/src/components/Sidebar/item.tsx +2 -4
- package/src/components/Spinner/index.tsx +11 -3
- package/src/components/Tag/index.tsx +9 -6
- package/src/components/Textarea/index.tsx +6 -8
- package/src/components/Tree/index.tsx +5 -8
- package/src/containers/PopoverProvider.tsx +2 -2
- package/src/containers/ReqoreProvider.tsx +5 -1
- package/src/containers/ThemeProvider.tsx +3 -13
- package/src/context/PopoverContext.tsx +1 -1
- package/src/context/ReqoreContext.tsx +4 -1
- package/src/context/ThemeContext.tsx +1 -1
- package/src/hooks/useLatestZIndex.ts +5 -3
- package/src/hooks/usePopover.tsx +4 -3
- package/src/hooks/useReqore.ts +1 -1
- package/src/hooks/useReqoreContext.ts +16 -0
- package/src/hooks/useReqoreEffect.ts +3 -3
- package/src/hooks/useTheme.ts +21 -17
- package/src/index.tsx +2 -0
- package/src/stories/Button/Button.stories.tsx +7 -0
- package/src/stories/Collection/Collection.stories.tsx +6 -3
- package/src/stories/Drawer/Drawer.stories.tsx +4 -3
- package/src/stories/Modal/Modal.stories.tsx +3 -4
- package/src/stories/Notifications/Interactive.stories.tsx +3 -4
- package/src/stories/Panel/Panel.stories.tsx +1 -0
- package/src/stories/Spinner/Spinner.stories.tsx +7 -2
- package/tests.json +1 -1
|
@@ -2,14 +2,16 @@ import { size } from 'lodash';
|
|
|
2
2
|
import React, { useRef, useState } from 'react';
|
|
3
3
|
import { useMedia } from 'react-use';
|
|
4
4
|
import shortid from 'shortid';
|
|
5
|
+
import { useContext } from 'use-context-selector';
|
|
5
6
|
import { ReqoreModal, ReqoreTextEffect } from '..';
|
|
6
7
|
import ReqoreNotificationsWrapper from '../components/Notifications';
|
|
7
8
|
import ReqoreNotification, {
|
|
8
9
|
IReqoreNotificationType,
|
|
9
10
|
} from '../components/Notifications/notification';
|
|
10
11
|
import { TSizes } from '../constants/sizes';
|
|
11
|
-
import { TReqoreIntent } from '../constants/theme';
|
|
12
|
+
import { IReqoreTheme, TReqoreIntent } from '../constants/theme';
|
|
12
13
|
import ReqoreContext from '../context/ReqoreContext';
|
|
14
|
+
import ThemeContext from '../context/ThemeContext';
|
|
13
15
|
import { IReqoreIconName } from '../types/icons';
|
|
14
16
|
import { IReqoreOptions } from './UIProvider';
|
|
15
17
|
|
|
@@ -50,6 +52,7 @@ export interface IReqoreConfirmationModal {
|
|
|
50
52
|
const ReqoreProvider: React.FC<IReqoreNotifications> = ({ children, options = {} }) => {
|
|
51
53
|
const [notifications, setNotifications] = useState<IReqoreNotificationData[] | null>([]);
|
|
52
54
|
const [confirmationModal, setConfirmationModal] = useState<IReqoreConfirmationModal>({});
|
|
55
|
+
const theme: IReqoreTheme = useContext<IReqoreTheme>(ThemeContext);
|
|
53
56
|
const latestZIndex = useRef<number>(9000);
|
|
54
57
|
|
|
55
58
|
const isMobile = process.env.NODE_ENV === 'test' ? false : useMedia('(max-width: 480px)');
|
|
@@ -114,6 +117,7 @@ const ReqoreProvider: React.FC<IReqoreNotifications> = ({ children, options = {}
|
|
|
114
117
|
<ReqoreContext.Provider
|
|
115
118
|
value={{
|
|
116
119
|
notifications,
|
|
120
|
+
theme,
|
|
117
121
|
addNotification,
|
|
118
122
|
removeNotification,
|
|
119
123
|
confirmAction,
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
1
|
import { ThemeProvider } from 'styled-components';
|
|
2
|
+
import { useContext } from 'use-context-selector';
|
|
3
3
|
import { IReqoreTheme } from '../constants/theme';
|
|
4
4
|
import ThemeContext from '../context/ThemeContext';
|
|
5
5
|
|
|
6
|
-
const ReqoreThemeProvider = ({
|
|
7
|
-
children,
|
|
8
|
-
theme,
|
|
9
|
-
}: {
|
|
10
|
-
children: any;
|
|
11
|
-
theme?: IReqoreTheme;
|
|
12
|
-
}) => {
|
|
6
|
+
const ReqoreThemeProvider = ({ children, theme }: { children: any; theme?: IReqoreTheme }) => {
|
|
13
7
|
const _theme: IReqoreTheme = useContext(ThemeContext);
|
|
14
8
|
|
|
15
|
-
return
|
|
16
|
-
<ThemeProvider theme={theme || _theme}>
|
|
17
|
-
<>{children}</>
|
|
18
|
-
</ThemeProvider>
|
|
19
|
-
);
|
|
9
|
+
return <ThemeProvider theme={theme || _theme}>{children}</ThemeProvider>;
|
|
20
10
|
};
|
|
21
11
|
|
|
22
12
|
export default ReqoreThemeProvider;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createContext } from '
|
|
1
|
+
import { createContext } from 'use-context-selector';
|
|
2
|
+
import { DEFAULT_THEME, IReqoreTheme } from '../constants/theme';
|
|
2
3
|
import { IReqoreConfirmationModal, IReqoreNotificationData } from '../containers/ReqoreProvider';
|
|
3
4
|
import { IReqoreOptions } from '../containers/UIProvider';
|
|
4
5
|
|
|
@@ -15,6 +16,7 @@ export interface IReqoreContext {
|
|
|
15
16
|
readonly tooltips?: IReqoreOptions['tooltips'];
|
|
16
17
|
readonly closePopoversOnEscPress?: boolean;
|
|
17
18
|
readonly latestZIndex?: number;
|
|
19
|
+
theme: IReqoreTheme;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export default createContext<IReqoreContext>({
|
|
@@ -27,4 +29,5 @@ export default createContext<IReqoreContext>({
|
|
|
27
29
|
dialogs: true,
|
|
28
30
|
},
|
|
29
31
|
closePopoversOnEscPress: true,
|
|
32
|
+
theme: DEFAULT_THEME,
|
|
30
33
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useReqoreProperty } from './useReqoreContext';
|
|
3
3
|
|
|
4
4
|
const useLatestZIndex = (): number => {
|
|
5
|
-
const
|
|
5
|
+
const getAndIncreaseZIndex = useReqoreProperty('getAndIncreaseZIndex');
|
|
6
|
+
const latestZIndex = useReqoreProperty('latestZIndex');
|
|
7
|
+
|
|
6
8
|
const zIndex = useMemo(() => getAndIncreaseZIndex(), [latestZIndex]);
|
|
7
9
|
|
|
8
10
|
return zIndex;
|
package/src/hooks/usePopover.tsx
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Placement } from '@popperjs/core';
|
|
2
|
-
import { MutableRefObject,
|
|
2
|
+
import { MutableRefObject, useEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import { useUnmount, useUpdateEffect } from 'react-use';
|
|
4
4
|
import shortid from 'shortid';
|
|
5
|
+
import { useContext } from 'use-context-selector';
|
|
6
|
+
import { useReqoreProperty } from '..';
|
|
5
7
|
import { IPopoverData } from '../containers/PopoverProvider';
|
|
6
8
|
import PopoverContext from '../context/PopoverContext';
|
|
7
9
|
import {
|
|
@@ -11,7 +13,6 @@ import {
|
|
|
11
13
|
IWithReqoreMinimal,
|
|
12
14
|
} from '../types/global';
|
|
13
15
|
import { IReqoreIconName } from '../types/icons';
|
|
14
|
-
import { useReqore } from './useReqore';
|
|
15
16
|
|
|
16
17
|
const startEvents = {
|
|
17
18
|
hover: 'mouseenter',
|
|
@@ -78,7 +79,7 @@ const usePopover = ({
|
|
|
78
79
|
}: IPopoverOptions): IPopoverControls => {
|
|
79
80
|
const { addPopover, removePopover, updatePopover, popovers, isPopoverOpen } =
|
|
80
81
|
useContext(PopoverContext);
|
|
81
|
-
const
|
|
82
|
+
const tooltips = useReqoreProperty('tooltips');
|
|
82
83
|
const { current }: MutableRefObject<string> = useRef(shortid.generate());
|
|
83
84
|
let { current: timeout }: MutableRefObject<any> = useRef(0);
|
|
84
85
|
|
package/src/hooks/useReqore.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useContextSelector } from 'use-context-selector';
|
|
2
|
+
import ReqoreContext, { IReqoreContext } from '../context/ReqoreContext';
|
|
3
|
+
|
|
4
|
+
export const useReqoreProperty = <T extends keyof IReqoreContext>(
|
|
5
|
+
property: T
|
|
6
|
+
): IReqoreContext[T] => {
|
|
7
|
+
const contextProperty = useContextSelector(ReqoreContext, (value) => {
|
|
8
|
+
if (!(property in value)) {
|
|
9
|
+
throw new Error(`Reqore context property ${property} not found`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return value[property];
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
return contextProperty;
|
|
16
|
+
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
IReqoreEffect,
|
|
4
4
|
TReqoreEffectGradientAnimationTrigger,
|
|
5
5
|
TReqoreHexColor,
|
|
6
6
|
} from '../components/Effect';
|
|
7
7
|
import { IReqoreTheme } from '../constants/theme';
|
|
8
|
-
import
|
|
8
|
+
import { useReqoreTheme } from './useTheme';
|
|
9
9
|
|
|
10
10
|
export const useReqoreEffect = (
|
|
11
11
|
component: 'buttons',
|
|
12
12
|
theme: IReqoreTheme,
|
|
13
13
|
effect?: IReqoreEffect
|
|
14
14
|
): IReqoreEffect => {
|
|
15
|
-
let _theme: IReqoreTheme =
|
|
15
|
+
let _theme: IReqoreTheme = useReqoreTheme();
|
|
16
16
|
|
|
17
17
|
// Return the effect if the component is not defined in the theme
|
|
18
18
|
if (!theme[component]) {
|
package/src/hooks/useTheme.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cloneDeep } from 'lodash';
|
|
2
|
-
import {
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
3
|
import { TReqoreEffectColor } from '../components/Effect';
|
|
4
4
|
import { IReqoreTheme, TReqoreIntent } from '../constants/theme';
|
|
5
|
-
import ThemeContext from '../context/ThemeContext';
|
|
6
5
|
import { getColorFromMaybeString, mergeThemes } from '../helpers/colors';
|
|
6
|
+
import { useReqoreProperty } from './useReqoreContext';
|
|
7
7
|
|
|
8
8
|
export interface IReqoreCustomTheme extends Partial<Omit<IReqoreTheme, 'main' | 'text'>> {
|
|
9
9
|
main?: TReqoreEffectColor;
|
|
@@ -20,25 +20,29 @@ export const useReqoreTheme = (
|
|
|
20
20
|
intent?: TReqoreIntent,
|
|
21
21
|
intentsKey: 'intents' | 'notifications' = 'intents'
|
|
22
22
|
): IReqoreTheme => {
|
|
23
|
-
const theme: IReqoreTheme =
|
|
23
|
+
const theme: IReqoreTheme = useReqoreProperty('theme');
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const finalTheme = useMemo(() => {
|
|
26
|
+
if (!element) {
|
|
27
|
+
return theme;
|
|
28
|
+
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
let _customTheme: IReqoreCustomTheme = cloneDeep(customTheme);
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
if (_customTheme.main) {
|
|
33
|
+
_customTheme.main = getColorFromMaybeString(theme, customTheme.main);
|
|
34
|
+
}
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
if (_customTheme.text?.color) {
|
|
37
|
+
_customTheme.text.color = getColorFromMaybeString(theme, customTheme.text.color);
|
|
38
|
+
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
if (element === 'main' && intent) {
|
|
41
|
+
_customTheme.main = theme[intentsKey][intent];
|
|
42
|
+
}
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
return mergeThemes(element, theme, _customTheme) as IReqoreTheme;
|
|
45
|
+
}, [JSON.stringify(theme), element, JSON.stringify(customTheme), intent, intentsKey]);
|
|
46
|
+
|
|
47
|
+
return finalTheme;
|
|
44
48
|
};
|
package/src/index.tsx
CHANGED
|
@@ -43,6 +43,7 @@ export { default as ReqorePopover } from './components/Popover';
|
|
|
43
43
|
export { default as ReqoreRadioGroup } from './components/RadioGroup';
|
|
44
44
|
export { default as ReqoreSidebar } from './components/Sidebar';
|
|
45
45
|
export { ReqoreHorizontalSpacer, ReqoreSpacer, ReqoreVerticalSpacer } from './components/Spacer';
|
|
46
|
+
export { ReqoreSpinner } from './components/Spinner';
|
|
46
47
|
export { default as ReqoreTable } from './components/Table';
|
|
47
48
|
export { default as ReqoreTabs } from './components/Tabs';
|
|
48
49
|
export { default as ReqoreTabsContent } from './components/Tabs/content';
|
|
@@ -62,4 +63,5 @@ export { default as ReqoreContext } from './context/ReqoreContext';
|
|
|
62
63
|
export { default as ReqoreThemeContext } from './context/ThemeContext';
|
|
63
64
|
export { default as useLatestZIndex } from './hooks/useLatestZIndex';
|
|
64
65
|
export { useReqore } from './hooks/useReqore';
|
|
66
|
+
export { useReqoreProperty } from './hooks/useReqoreContext';
|
|
65
67
|
export { useReqoreTheme } from './hooks/useTheme';
|
|
@@ -23,6 +23,13 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
23
23
|
<ReqoreControlGroup size={buttonProps.size} wrap>
|
|
24
24
|
<ReqoreButton {...buttonProps} icon='BankFill' rightIcon={null} />
|
|
25
25
|
<ReqoreButton {...buttonProps} />
|
|
26
|
+
<ReqoreButton
|
|
27
|
+
{...buttonProps}
|
|
28
|
+
icon='BankFill'
|
|
29
|
+
rightIcon={null}
|
|
30
|
+
textAlign='center'
|
|
31
|
+
style={{ width: '100px' }}
|
|
32
|
+
/>
|
|
26
33
|
<ReqoreButton {...buttonProps}>Default</ReqoreButton>
|
|
27
34
|
<ReqoreButton {...buttonProps} wrap maxWidth='150px'>
|
|
28
35
|
Default wrapped button with long text
|
|
@@ -4,7 +4,7 @@ import { IReqoreCollectionProps, ReqoreCollection } from '../../components/Colle
|
|
|
4
4
|
import { IReqoreColumnsProps } from '../../components/Columns';
|
|
5
5
|
import items from '../../mock/collectionData';
|
|
6
6
|
import data from '../../mock/data.json';
|
|
7
|
-
import {
|
|
7
|
+
import { IntentArg, SizeArg, argManager } from '../utils/args';
|
|
8
8
|
|
|
9
9
|
export interface IColumnsStoryArgs extends IReqoreColumnsProps {
|
|
10
10
|
multipleColumns?: boolean;
|
|
@@ -177,8 +177,11 @@ FilteringSearchingPaging.args = {
|
|
|
177
177
|
clearOnFocus: true,
|
|
178
178
|
},
|
|
179
179
|
},
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
displayButtonProps: {
|
|
181
|
+
fixed: false,
|
|
182
|
+
},
|
|
183
|
+
sortButtonProps: {
|
|
184
|
+
fixed: false,
|
|
182
185
|
},
|
|
183
186
|
size: 'big',
|
|
184
187
|
padded: false,
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
2
|
import { noop } from 'lodash';
|
|
3
|
-
import { useContext } from 'react';
|
|
4
3
|
import { IReqoreDrawerProps, ReqoreDrawer } from '../../components/Drawer';
|
|
5
4
|
import { IReqoreInputProps } from '../../components/Input';
|
|
6
5
|
import {
|
|
7
6
|
ReqoreButton,
|
|
8
|
-
ReqoreContext,
|
|
9
7
|
ReqoreInput,
|
|
10
8
|
ReqorePanel,
|
|
11
9
|
ReqoreTabs,
|
|
12
10
|
ReqoreTabsContent,
|
|
11
|
+
useReqoreProperty,
|
|
13
12
|
} from '../../index';
|
|
14
13
|
import { FlatArg, IntentArg, argManager } from '../utils/args';
|
|
15
14
|
|
|
@@ -82,7 +81,8 @@ export default {
|
|
|
82
81
|
} as Meta;
|
|
83
82
|
|
|
84
83
|
const Template: Story<IReqoreDrawerProps> = (args: IReqoreDrawerProps) => {
|
|
85
|
-
const
|
|
84
|
+
const confirmAction = useReqoreProperty('confirmAction');
|
|
85
|
+
|
|
86
86
|
return (
|
|
87
87
|
<>
|
|
88
88
|
<ReqorePanel label='Just some background text' padded>
|
|
@@ -147,6 +147,7 @@ const Template: Story<IReqoreDrawerProps> = (args: IReqoreDrawerProps) => {
|
|
|
147
147
|
],
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
|
+
fixed: true,
|
|
150
151
|
group: [
|
|
151
152
|
{ label: 'Stacked Action 1', icon: 'BallPenLine', intent: 'warning' },
|
|
152
153
|
{ icon: 'CopperCoinFill', intent: 'danger' },
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
2
|
import { noop } from 'lodash';
|
|
3
|
-
import { useContext } from 'react';
|
|
4
3
|
import { useMount } from 'react-use';
|
|
5
4
|
import { IReqoreModalProps } from '../../components/Modal';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { ReqoreModal, ReqorePanel, useReqoreProperty } from '../../index';
|
|
6
|
+
import { FlatArg, IntentArg, argManager } from '../utils/args';
|
|
8
7
|
|
|
9
8
|
const { createArg } = argManager<IReqoreModalProps>();
|
|
10
9
|
|
|
@@ -53,7 +52,7 @@ export default {
|
|
|
53
52
|
} as Meta<IReqoreModalProps>;
|
|
54
53
|
|
|
55
54
|
const Template: Story<IReqoreModalProps & { confirm?: boolean }> = (args) => {
|
|
56
|
-
const
|
|
55
|
+
const confirmAction = useReqoreProperty('confirmAction');
|
|
57
56
|
|
|
58
57
|
useMount(() => {
|
|
59
58
|
if (args.confirm) {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
|
-
import { useContext } from 'react';
|
|
3
2
|
import ReqoreNotification, {
|
|
4
3
|
IReqoreNotificationProps,
|
|
5
4
|
} from '../../components/Notifications/notification';
|
|
6
5
|
import { IReqoreUIProviderProps } from '../../containers/UIProvider';
|
|
7
|
-
import {
|
|
6
|
+
import { ReqoreUIProvider, useReqoreProperty } from '../../index';
|
|
8
7
|
|
|
9
8
|
export default {
|
|
10
9
|
title: 'Components/Notifications/Interactive',
|
|
@@ -12,7 +11,7 @@ export default {
|
|
|
12
11
|
} as Meta;
|
|
13
12
|
|
|
14
13
|
const AddingButton = ({ id, onClick, onClose, onFinish }: any) => {
|
|
15
|
-
const
|
|
14
|
+
const addNotification = useReqoreProperty('addNotification');
|
|
16
15
|
|
|
17
16
|
return (
|
|
18
17
|
<button
|
|
@@ -35,7 +34,7 @@ const AddingButton = ({ id, onClick, onClose, onFinish }: any) => {
|
|
|
35
34
|
};
|
|
36
35
|
|
|
37
36
|
const UpdatingButton = ({ id }) => {
|
|
38
|
-
const
|
|
37
|
+
const addNotification = useReqoreProperty('addNotification');
|
|
39
38
|
|
|
40
39
|
return (
|
|
41
40
|
<button
|
|
@@ -35,8 +35,13 @@ const Template: Story<IReqoreSpinnerProps> = (args) => {
|
|
|
35
35
|
{...args}
|
|
36
36
|
type={4}
|
|
37
37
|
iconColor='#f21616'
|
|
38
|
-
labelEffect={{
|
|
39
|
-
|
|
38
|
+
labelEffect={{
|
|
39
|
+
gradient: { colors: 'warning' },
|
|
40
|
+
uppercase: true,
|
|
41
|
+
spaced: 2,
|
|
42
|
+
textSize: 'small',
|
|
43
|
+
}}
|
|
44
|
+
size='huge'
|
|
40
45
|
>
|
|
41
46
|
{args.children}
|
|
42
47
|
</ReqoreSpinner>
|