@qoretechnologies/reqore 0.31.2 → 0.32.2
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 +14 -1
- package/__tests__/icon.test.tsx +19 -1
- package/__tests__/input.test.tsx +435 -24
- package/__tests__/messages.test.tsx +16 -0
- package/__tests__/modal.test.tsx +4 -4
- package/__tests__/multiselect.test.tsx +8 -10
- package/__tests__/notifications.test.tsx +6 -6
- package/__tests__/panel.test.tsx +19 -1
- package/__tests__/textarea.test.tsx +423 -24
- 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 +4 -2
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +19 -13
- 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 +18 -57
- 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 +2 -0
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +17 -8
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Input/index.d.ts +4 -0
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +19 -7
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.d.ts +1 -1
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/InputClearButton/index.js +18 -8
- package/dist/components/InputClearButton/index.js.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 +18 -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/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 +0 -1
- package/dist/components/Spinner/index.d.ts.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 +2 -0
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +9 -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/useAutoFocus.d.ts +11 -0
- package/dist/hooks/useAutoFocus.d.ts.map +1 -0
- package/dist/hooks/useAutoFocus.js +80 -0
- package/dist/hooks/useAutoFocus.js.map +1 -0
- 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 +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +1 -1
- package/dist/styles.js.map +1 -1
- package/package.json +20 -16
- package/src/components/Breadcrumbs/item.tsx +7 -3
- package/src/components/Button/index.tsx +26 -7
- package/src/components/Checkbox/index.tsx +9 -5
- package/src/components/Collection/index.tsx +33 -11
- package/src/components/Collection/item.tsx +3 -3
- package/src/components/ControlGroup/index.tsx +26 -87
- package/src/components/Drawer/index.tsx +4 -4
- package/src/components/Icon/index.tsx +27 -9
- package/src/components/Input/index.tsx +35 -4
- package/src/components/InputClearButton/index.tsx +41 -17
- 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 +26 -9
- package/src/components/Sidebar/item.tsx +2 -4
- package/src/components/Tag/index.tsx +9 -6
- package/src/components/Textarea/index.tsx +16 -11
- 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/useAutoFocus.ts +104 -0
- 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 +1 -0
- package/src/stories/Button/Button.stories.tsx +7 -0
- package/src/stories/Collection/Collection.stories.tsx +56 -9
- package/src/stories/Drawer/Drawer.stories.tsx +4 -3
- package/src/stories/Input/Input.stories.tsx +29 -6
- 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 +4 -2
- package/src/stories/TextArea/TextArea.stories.tsx +1 -0
- package/src/styles.ts +0 -1
- package/tests.json +1 -1
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
|
@@ -62,4 +62,5 @@ export { default as ReqoreContext } from './context/ReqoreContext';
|
|
|
62
62
|
export { default as ReqoreThemeContext } from './context/ThemeContext';
|
|
63
63
|
export { default as useLatestZIndex } from './hooks/useLatestZIndex';
|
|
64
64
|
export { useReqore } from './hooks/useReqore';
|
|
65
|
+
export { useReqoreProperty } from './hooks/useReqoreContext';
|
|
65
66
|
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
|
|
@@ -3,6 +3,7 @@ import { ReqoreButton, ReqoreControlGroup } from '../..';
|
|
|
3
3
|
import { IReqoreCollectionProps, ReqoreCollection } from '../../components/Collection';
|
|
4
4
|
import { IReqoreColumnsProps } from '../../components/Columns';
|
|
5
5
|
import items from '../../mock/collectionData';
|
|
6
|
+
import data from '../../mock/data.json';
|
|
6
7
|
import { IntentArg, SizeArg, argManager } from '../utils/args';
|
|
7
8
|
|
|
8
9
|
export interface IColumnsStoryArgs extends IReqoreColumnsProps {
|
|
@@ -58,7 +59,7 @@ export default {
|
|
|
58
59
|
description: 'If true, the collection will fill the parent',
|
|
59
60
|
}),
|
|
60
61
|
...createArg('label', {
|
|
61
|
-
defaultValue:
|
|
62
|
+
defaultValue: undefined,
|
|
62
63
|
type: 'string',
|
|
63
64
|
name: 'Label',
|
|
64
65
|
description: 'Label of the collection',
|
|
@@ -70,20 +71,17 @@ export default {
|
|
|
70
71
|
} as Meta<IReqoreCollectionProps>;
|
|
71
72
|
|
|
72
73
|
const Template: Story<IReqoreCollectionProps> = (args) => {
|
|
73
|
-
return
|
|
74
|
-
<ReqoreCollection
|
|
75
|
-
{...args}
|
|
76
|
-
badge={10}
|
|
77
|
-
selectedIcon='CheckLine'
|
|
78
|
-
actions={[{ label: 'Custom action', icon: 'Home7Line' }, { actions: [{ value: 'Test' }] }]}
|
|
79
|
-
/>
|
|
80
|
-
);
|
|
74
|
+
return <ReqoreCollection {...args} selectedIcon='CheckLine' />;
|
|
81
75
|
};
|
|
82
76
|
|
|
83
77
|
export const Basic = Template.bind({});
|
|
84
78
|
Basic.args = {
|
|
85
79
|
label: 'Config Items',
|
|
86
80
|
items,
|
|
81
|
+
actions: [
|
|
82
|
+
{ label: 'Custom action', icon: 'Home7Line', fixed: true },
|
|
83
|
+
{ actions: [{ value: 'Test' }] },
|
|
84
|
+
],
|
|
87
85
|
};
|
|
88
86
|
|
|
89
87
|
export const WithHeight = Template.bind({});
|
|
@@ -91,6 +89,10 @@ WithHeight.args = {
|
|
|
91
89
|
label: 'Collection of items',
|
|
92
90
|
height: '600px',
|
|
93
91
|
items,
|
|
92
|
+
actions: [
|
|
93
|
+
{ label: 'Custom action', icon: 'Home7Line', fixed: true },
|
|
94
|
+
{ actions: [{ value: 'Test' }] },
|
|
95
|
+
],
|
|
94
96
|
};
|
|
95
97
|
|
|
96
98
|
export const Stacked = Template.bind({});
|
|
@@ -98,6 +100,10 @@ Stacked.args = {
|
|
|
98
100
|
label: 'Collection of items',
|
|
99
101
|
stacked: true,
|
|
100
102
|
items,
|
|
103
|
+
actions: [
|
|
104
|
+
{ label: 'Custom action', icon: 'Home7Line', fixed: true },
|
|
105
|
+
{ actions: [{ value: 'Test' }] },
|
|
106
|
+
],
|
|
101
107
|
};
|
|
102
108
|
|
|
103
109
|
export const Fill = Template.bind({});
|
|
@@ -105,6 +111,10 @@ Fill.args = {
|
|
|
105
111
|
label: 'Collection of items',
|
|
106
112
|
fill: true,
|
|
107
113
|
items,
|
|
114
|
+
actions: [
|
|
115
|
+
{ label: 'Custom action', icon: 'Home7Line', fixed: true },
|
|
116
|
+
{ actions: [{ value: 'Test' }] },
|
|
117
|
+
],
|
|
108
118
|
};
|
|
109
119
|
|
|
110
120
|
export const SelectedFirst = Template.bind({});
|
|
@@ -157,3 +167,40 @@ ChildrenBeforeAndAfter.args = {
|
|
|
157
167
|
</ReqoreControlGroup>
|
|
158
168
|
),
|
|
159
169
|
};
|
|
170
|
+
|
|
171
|
+
export const FilteringSearchingPaging = Template.bind({});
|
|
172
|
+
FilteringSearchingPaging.args = {
|
|
173
|
+
inputProps: {
|
|
174
|
+
focusRules: {
|
|
175
|
+
type: 'keypress',
|
|
176
|
+
shortcut: 'letters',
|
|
177
|
+
clearOnFocus: true,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
displayButtonProps: {
|
|
181
|
+
fixed: false,
|
|
182
|
+
},
|
|
183
|
+
sortButtonProps: {
|
|
184
|
+
fixed: false,
|
|
185
|
+
},
|
|
186
|
+
size: 'big',
|
|
187
|
+
padded: false,
|
|
188
|
+
fill: true,
|
|
189
|
+
items: data.slice(0, 100).map((datum) => ({
|
|
190
|
+
label: `${datum.firstName} ${datum.lastName}`,
|
|
191
|
+
badge: datum.id,
|
|
192
|
+
size: 'small',
|
|
193
|
+
expandable: true,
|
|
194
|
+
content: datum.address,
|
|
195
|
+
tags: [
|
|
196
|
+
{
|
|
197
|
+
labelKey: 'Age',
|
|
198
|
+
label: datum.age,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
labelKey: 'Occupation',
|
|
202
|
+
label: datum.occupation,
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
})),
|
|
206
|
+
} as IReqoreCollectionProps;
|
|
@@ -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' },
|
|
@@ -29,7 +29,13 @@ const Template: Story<IReqoreInputProps> = (args: IReqoreInputProps) => {
|
|
|
29
29
|
<>
|
|
30
30
|
<ReqoreControlGroup wrap>
|
|
31
31
|
<ReqoreInput {...args} placeholder='Reqore Input' onChange={handleValueChange} />
|
|
32
|
-
<ReqoreInput
|
|
32
|
+
<ReqoreInput
|
|
33
|
+
{...args}
|
|
34
|
+
placeholder='Minimal Input'
|
|
35
|
+
minimal
|
|
36
|
+
onChange={handleValueChange}
|
|
37
|
+
rightIcon='ClipboardLine'
|
|
38
|
+
/>
|
|
33
39
|
<ReqoreInput
|
|
34
40
|
{...args}
|
|
35
41
|
placeholder='Flat Input'
|
|
@@ -44,11 +50,22 @@ const Template: Story<IReqoreInputProps> = (args: IReqoreInputProps) => {
|
|
|
44
50
|
onClearClick={handleValueClear}
|
|
45
51
|
onChange={handleValueChange}
|
|
46
52
|
/>
|
|
53
|
+
<ReqoreInput
|
|
54
|
+
{...args}
|
|
55
|
+
iconColor='pending:lighten:2'
|
|
56
|
+
placeholder='Clearable Input w/ icon'
|
|
57
|
+
onClearClick={handleValueClear}
|
|
58
|
+
onChange={handleValueChange}
|
|
59
|
+
rightIcon='EraserFill'
|
|
60
|
+
rightIconColor='#8727b7'
|
|
61
|
+
/>
|
|
47
62
|
<ReqoreInput {...args} placeholder='Disabled Input' disabled onChange={handleValueChange} />
|
|
48
63
|
<ReqoreInput
|
|
49
64
|
{...args}
|
|
50
65
|
placeholder='Read Only Input'
|
|
51
66
|
readOnly
|
|
67
|
+
rightIcon='Bus2Fill'
|
|
68
|
+
rightIconColor='info'
|
|
52
69
|
onChange={handleValueChange}
|
|
53
70
|
/>
|
|
54
71
|
</ReqoreControlGroup>
|
|
@@ -73,6 +90,8 @@ const Template: Story<IReqoreInputProps> = (args: IReqoreInputProps) => {
|
|
|
73
90
|
flat
|
|
74
91
|
tooltip="I'm a tooltip"
|
|
75
92
|
onChange={handleValueChange}
|
|
93
|
+
rightIcon='DragMoveLine'
|
|
94
|
+
rightIconColor='#eb0e8c'
|
|
76
95
|
value={value}
|
|
77
96
|
/>
|
|
78
97
|
<ReqoreInput
|
|
@@ -84,18 +103,21 @@ const Template: Story<IReqoreInputProps> = (args: IReqoreInputProps) => {
|
|
|
84
103
|
/>
|
|
85
104
|
<ReqoreInput
|
|
86
105
|
{...args}
|
|
87
|
-
placeholder='
|
|
88
|
-
|
|
89
|
-
onChange={handleValueChange}
|
|
106
|
+
placeholder='Clearable Input w/ icon'
|
|
107
|
+
onClearClick={handleValueClear}
|
|
90
108
|
value={value}
|
|
109
|
+
rightIcon='FilePptFill'
|
|
110
|
+
rightIconColor='#508a90'
|
|
111
|
+
onChange={handleValueChange}
|
|
91
112
|
/>
|
|
92
113
|
<ReqoreInput
|
|
93
114
|
{...args}
|
|
94
|
-
placeholder='
|
|
95
|
-
|
|
115
|
+
placeholder='Disabled Input'
|
|
116
|
+
disabled
|
|
96
117
|
onChange={handleValueChange}
|
|
97
118
|
value={value}
|
|
98
119
|
/>
|
|
120
|
+
<ReqoreInput {...args} placeholder='Read Only Input' readOnly value={value} />
|
|
99
121
|
</ReqoreControlGroup>
|
|
100
122
|
<br />
|
|
101
123
|
<ReqoreControlGroup fluid>
|
|
@@ -104,6 +126,7 @@ const Template: Story<IReqoreInputProps> = (args: IReqoreInputProps) => {
|
|
|
104
126
|
placeholder='Fluid Input'
|
|
105
127
|
onChange={handleValueChange}
|
|
106
128
|
value={value}
|
|
129
|
+
focusRules={{ type: 'keypress', shortcut: 'k' }}
|
|
107
130
|
/>
|
|
108
131
|
</ReqoreControlGroup>
|
|
109
132
|
</>
|
|
@@ -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
|
|
@@ -3,7 +3,7 @@ import { noop } from 'lodash';
|
|
|
3
3
|
import ReqoreInput, { IReqoreInputProps } from '../../components/Input';
|
|
4
4
|
import { IReqorePanelAction, IReqorePanelProps, ReqorePanel } from '../../components/Panel';
|
|
5
5
|
import { ReqoreVerticalSpacer } from '../../components/Spacer';
|
|
6
|
-
import { FlatArg, IconArg, IntentArg, SizeArg
|
|
6
|
+
import { argManager, FlatArg, IconArg, IntentArg, SizeArg } from '../utils/args';
|
|
7
7
|
|
|
8
8
|
const { createArg } = argManager<IReqorePanelProps>();
|
|
9
9
|
|
|
@@ -168,10 +168,12 @@ const Template: Story<IReqorePanelProps> = (args: IReqorePanelProps) => {
|
|
|
168
168
|
{
|
|
169
169
|
icon: 'FullscreenExitLine',
|
|
170
170
|
customTheme: { main: '#a40a62' },
|
|
171
|
+
fixed: true,
|
|
171
172
|
},
|
|
172
173
|
],
|
|
173
174
|
},
|
|
174
175
|
{
|
|
176
|
+
fixed: true,
|
|
175
177
|
group: [
|
|
176
178
|
{ label: 'Stacked Action 1', icon: 'BallPenLine', intent: 'warning' },
|
|
177
179
|
{ icon: 'CopperCoinFill', intent: 'danger' },
|
|
@@ -199,7 +201,7 @@ const Template: Story<IReqorePanelProps> = (args: IReqorePanelProps) => {
|
|
|
199
201
|
position: 'left',
|
|
200
202
|
intent: 'success',
|
|
201
203
|
group: [
|
|
202
|
-
{ label: 'Test 1', icon: '24HoursFill' },
|
|
204
|
+
{ label: 'Test 1', icon: '24HoursFill', fixed: true },
|
|
203
205
|
{ label: 'Test 2', icon: '24HoursFill' },
|
|
204
206
|
],
|
|
205
207
|
},
|