@qoretechnologies/reqore 0.30.4 → 0.30.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/CODE_OF_CONDUCT.md +105 -0
- package/CONTRIBUTING.MD +78 -0
- package/LICENSE +1 -1
- package/README.md +44 -2
- package/SECURITY.md +5 -0
- package/__tests__/collection.test.tsx +1 -1
- package/__tests__/{control_group.test.tsx → control_group.text.tsx} +2 -4
- package/__tests__/modal.test.tsx +2 -74
- package/__tests__/panel.test.tsx +24 -96
- package/__tests__/popover.test.tsx +2 -24
- package/__tests__/tabs.test.tsx +0 -75
- package/dist/components/Button/index.d.ts +1 -4
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +7 -10
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Collection/index.d.ts +2 -7
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +53 -57
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.d.ts +5 -5
- package/dist/components/Collection/item.d.ts.map +1 -1
- package/dist/components/Collection/item.js +4 -15
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Columns/column.d.ts.map +1 -1
- package/dist/components/Columns/column.js +1 -1
- package/dist/components/Columns/column.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts +4 -20
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +55 -241
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/Drawer/index.d.ts +3 -3
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +16 -27
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/index.d.ts +0 -1
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.js +2 -2
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts +3 -3
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Effect/index.d.ts +9 -9
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +1 -1
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/Icon/index.d.ts +6 -5
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +7 -14
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Input/index.d.ts +0 -2
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +6 -9
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +10 -12
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Message/index.d.ts +0 -2
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +2 -2
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +2 -2
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.js +10 -10
- package/dist/components/MultiSelect/index.js.map +1 -1
- package/dist/components/Notifications/index.d.ts +1 -1
- package/dist/components/Notifications/index.d.ts.map +1 -1
- package/dist/components/Notifications/notification.d.ts +1 -1
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Panel/index.d.ts +6 -13
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +44 -78
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Popover/index.d.ts +2 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +2 -2
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/Spacer/index.d.ts +0 -2
- package/dist/components/Spacer/index.d.ts.map +1 -1
- package/dist/components/Spacer/index.js +7 -29
- package/dist/components/Spacer/index.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +2 -3
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +3 -6
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +3 -4
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Tabs/content.d.ts +1 -3
- package/dist/components/Tabs/content.d.ts.map +1 -1
- package/dist/components/Tabs/content.js +3 -8
- package/dist/components/Tabs/content.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +1 -4
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js +4 -12
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/item.d.ts +0 -1
- package/dist/components/Tabs/item.d.ts.map +1 -1
- package/dist/components/Tabs/item.js +7 -7
- package/dist/components/Tabs/item.js.map +1 -1
- package/dist/components/Tabs/list.d.ts +1 -1
- package/dist/components/Tabs/list.d.ts.map +1 -1
- package/dist/components/Tabs/list.js +3 -4
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tag/group.d.ts +2 -2
- package/dist/components/Tag/group.d.ts.map +1 -1
- package/dist/components/Tag/group.js +8 -7
- package/dist/components/Tag/group.js.map +1 -1
- package/dist/components/Tag/index.d.ts +2 -6
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +12 -20
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Tree/index.js +1 -1
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/constants/animations.js +1 -1
- package/dist/constants/sizes.d.ts +2 -2
- package/dist/constants/sizes.d.ts.map +1 -1
- package/dist/constants/sizes.js +10 -10
- package/dist/constants/sizes.js.map +1 -1
- package/dist/constants/theme.d.ts +1 -1
- package/dist/constants/theme.d.ts.map +1 -1
- package/dist/containers/PopoverProvider.d.ts.map +1 -1
- package/dist/containers/PopoverProvider.js +8 -10
- package/dist/containers/PopoverProvider.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +2 -4
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts +0 -7
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/context/ReqoreContext.d.ts +0 -2
- package/dist/context/ReqoreContext.d.ts.map +1 -1
- package/dist/context/ReqoreContext.js.map +1 -1
- package/dist/helpers/utils.d.ts +0 -2
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/helpers/utils.js +2 -4
- package/dist/helpers/utils.js.map +1 -1
- package/dist/hooks/useLatestZIndex.js +2 -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 +6 -8
- package/dist/hooks/usePopover.js.map +1 -1
- package/dist/styles.d.ts +0 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +5 -6
- package/dist/styles.js.map +1 -1
- package/dist/types/global.d.ts +1 -27
- package/dist/types/global.d.ts.map +1 -1
- package/dist/types/icons.d.ts +1 -1
- package/dist/types/icons.d.ts.map +1 -1
- package/package.json +1 -1
- package/public/logo-dark.png +0 -0
- package/public/logo.png +0 -0
- package/public/q-symbol.png +0 -0
- package/public/qoreLogo-dark.png +0 -0
- package/public/qoreLogo.png +0 -0
- package/src/components/Button/index.tsx +5 -17
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/Collection/index.tsx +60 -93
- package/src/components/Collection/item.tsx +9 -29
- package/src/components/Columns/column.tsx +0 -1
- package/src/components/ControlGroup/index.tsx +103 -426
- package/src/components/Drawer/index.tsx +27 -28
- package/src/components/Dropdown/index.tsx +1 -3
- package/src/components/Effect/index.tsx +0 -1
- package/src/components/Icon/index.tsx +62 -81
- package/src/components/Input/index.tsx +4 -8
- package/src/components/InternalPopover/index.tsx +126 -131
- package/src/components/Menu/index.tsx +1 -7
- package/src/components/Message/index.tsx +1 -9
- package/src/components/MultiSelect/index.tsx +188 -180
- package/src/components/Panel/index.tsx +100 -227
- package/src/components/Popover/index.tsx +3 -1
- package/src/components/Spacer/index.tsx +14 -63
- package/src/components/Table/helpers.ts +6 -12
- package/src/components/Table/index.tsx +0 -1
- package/src/components/Tabs/content.tsx +3 -11
- package/src/components/Tabs/index.tsx +3 -14
- package/src/components/Tabs/item.tsx +5 -28
- package/src/components/Tabs/list.tsx +0 -4
- package/src/components/Tag/group.tsx +12 -6
- package/src/components/Tag/index.tsx +35 -67
- package/src/components/Tree/index.tsx +1 -1
- package/src/constants/animations.ts +1 -1
- package/src/constants/sizes.ts +10 -10
- package/src/containers/PopoverProvider.tsx +8 -11
- package/src/containers/ReqoreProvider.tsx +35 -40
- package/src/containers/UIProvider.tsx +0 -7
- package/src/context/ReqoreContext.tsx +0 -2
- package/src/helpers/utils.ts +0 -3
- package/src/hooks/useLatestZIndex.ts +2 -2
- package/src/hooks/usePopover.tsx +6 -9
- package/src/mock/collectionData.tsx +2 -33
- package/src/stories/Button/Button.stories.tsx +6 -14
- package/src/stories/Checkbox/Checkbox.stories.tsx +3 -6
- package/src/stories/Collection/Collection.stories.tsx +2 -18
- package/src/stories/ControlGroup/ControlGroup.stories.tsx +34 -220
- package/src/stories/Drawer/Drawer.stories.tsx +3 -70
- package/src/stories/Dropdown/Dropdown.stories.tsx +3 -13
- package/src/stories/Icon/Icon.stories.tsx +0 -1
- package/src/stories/Input/Input.stories.tsx +3 -5
- package/src/stories/Menu/Menu.stories.tsx +0 -2
- package/src/stories/Message/Message.stories.tsx +0 -7
- package/src/stories/Panel/Panel.stories.tsx +13 -147
- package/src/stories/Popover/Popover.stories.tsx +82 -88
- package/src/stories/Tabs/Tabs.stories.tsx +15 -32
- package/src/stories/Tag/Tag.stories.tsx +3 -23
- package/src/stories/TextArea/TextArea.stories.tsx +3 -3
- package/src/styles.ts +0 -6
- package/src/types/global.ts +0 -28
- package/tests.json +1 -1
|
@@ -22,15 +22,12 @@ const PopoverProvider: React.FC<IReqorePopoverProviderProps> = ({ children, uiSc
|
|
|
22
22
|
const handleClick = useCallback(
|
|
23
23
|
(event: MouseEvent) => {
|
|
24
24
|
popovers.forEach(({ popperRef, closeOnAnyClick, closeOnOutsideClick, id, targetElement }) => {
|
|
25
|
-
if (closeOnAnyClick) {
|
|
26
|
-
removePopover(id);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
25
|
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
closeOnAnyClick ||
|
|
27
|
+
(closeOnOutsideClick &&
|
|
28
|
+
popperRef?.current &&
|
|
29
|
+
!popperRef.current.contains(event.target) &&
|
|
30
|
+
!targetElement?.contains(event.target as Node))
|
|
34
31
|
) {
|
|
35
32
|
removePopover(id);
|
|
36
33
|
}
|
|
@@ -69,21 +66,21 @@ const PopoverProvider: React.FC<IReqorePopoverProviderProps> = ({ children, uiSc
|
|
|
69
66
|
};
|
|
70
67
|
|
|
71
68
|
useEffect(() => {
|
|
72
|
-
document.addEventListener('click', handleClick
|
|
69
|
+
document.addEventListener('click', handleClick);
|
|
73
70
|
|
|
74
71
|
if (closePopoversOnEscPress) {
|
|
75
72
|
document.addEventListener('keydown', handleKeyDown);
|
|
76
73
|
}
|
|
77
74
|
|
|
78
75
|
return () => {
|
|
79
|
-
document.removeEventListener('click', handleClick
|
|
76
|
+
document.removeEventListener('click', handleClick);
|
|
80
77
|
document.removeEventListener('keydown', handleKeyDown);
|
|
81
78
|
};
|
|
82
79
|
}, [popovers]);
|
|
83
80
|
|
|
84
81
|
useEffect(() => {
|
|
85
82
|
if (!size(popovers)) {
|
|
86
|
-
document.removeEventListener('click', handleClick
|
|
83
|
+
document.removeEventListener('click', handleClick);
|
|
87
84
|
document.removeEventListener('keydown', handleKeyDown);
|
|
88
85
|
}
|
|
89
86
|
}, [popovers]);
|
|
@@ -120,10 +120,8 @@ const ReqoreProvider: React.FC<IReqoreNotifications> = ({ children, options = {}
|
|
|
120
120
|
isMobile,
|
|
121
121
|
isTablet,
|
|
122
122
|
isMobileOrTablet,
|
|
123
|
-
latestZIndex: latestZIndex.current,
|
|
124
123
|
getAndIncreaseZIndex,
|
|
125
124
|
animations: options.animations || { buttons: true, dialogs: true },
|
|
126
|
-
tooltips: options.tooltips || { delay: 0 },
|
|
127
125
|
closePopoversOnEscPress:
|
|
128
126
|
'closePopoversOnEscPress' in options ? options.closePopoversOnEscPress : true,
|
|
129
127
|
}}
|
|
@@ -158,47 +156,44 @@ const ReqoreProvider: React.FC<IReqoreNotifications> = ({ children, options = {}
|
|
|
158
156
|
</ReqoreNotificationsWrapper>
|
|
159
157
|
) : null}
|
|
160
158
|
{children}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
confirmationModal?.onCancel?.();
|
|
178
|
-
closeConfirmationModal();
|
|
179
|
-
},
|
|
180
|
-
position: 'left',
|
|
159
|
+
<ReqoreModal
|
|
160
|
+
isOpen={confirmationModal.isOpen}
|
|
161
|
+
flat
|
|
162
|
+
opacity={0.9}
|
|
163
|
+
blur={2}
|
|
164
|
+
width='500px'
|
|
165
|
+
intent={confirmationModal.intent}
|
|
166
|
+
label={confirmationModal.title || 'Confirm your action'}
|
|
167
|
+
icon='ErrorWarningFill'
|
|
168
|
+
bottomActions={[
|
|
169
|
+
{
|
|
170
|
+
label: confirmationModal.cancelLabel || 'Cancel',
|
|
171
|
+
icon: 'CloseLine',
|
|
172
|
+
onClick: () => {
|
|
173
|
+
confirmationModal?.onCancel?.();
|
|
174
|
+
closeConfirmationModal();
|
|
181
175
|
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
176
|
+
position: 'left',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
label: confirmationModal.confirmLabel || 'Confirm',
|
|
180
|
+
intent: confirmationModal.confirmButtonIntent || 'success',
|
|
181
|
+
icon: confirmationModal.confirmIcon || 'CheckLine',
|
|
182
|
+
onClick: () => {
|
|
183
|
+
confirmationModal?.onConfirm?.();
|
|
184
|
+
closeConfirmationModal();
|
|
191
185
|
},
|
|
192
|
-
|
|
186
|
+
position: 'right',
|
|
187
|
+
},
|
|
188
|
+
]}
|
|
189
|
+
>
|
|
190
|
+
<ReqoreTextEffect
|
|
191
|
+
as='p'
|
|
192
|
+
effect={{ textAlign: 'center', weight: 'bold', textSize: 'big' }}
|
|
193
193
|
>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
>
|
|
198
|
-
{confirmationModal.description || 'Are you sure you want to proceed?'}
|
|
199
|
-
</ReqoreTextEffect>
|
|
200
|
-
</ReqoreModal>
|
|
201
|
-
)}
|
|
194
|
+
{confirmationModal.description || 'Are you sure you want to proceed?'}
|
|
195
|
+
</ReqoreTextEffect>
|
|
196
|
+
</ReqoreModal>
|
|
202
197
|
</ReqoreContext.Provider>
|
|
203
198
|
</>
|
|
204
199
|
);
|
|
@@ -18,13 +18,6 @@ export interface IReqoreOptions {
|
|
|
18
18
|
buttons?: boolean;
|
|
19
19
|
dialogs?: boolean;
|
|
20
20
|
};
|
|
21
|
-
tooltips?: {
|
|
22
|
-
/**
|
|
23
|
-
* Delay in ms before showing the tooltip
|
|
24
|
-
* @default 0
|
|
25
|
-
* */
|
|
26
|
-
delay?: number;
|
|
27
|
-
};
|
|
28
21
|
closePopoversOnEscPress?: boolean;
|
|
29
22
|
}
|
|
30
23
|
export interface IReqoreUIProviderProps {
|
|
@@ -12,9 +12,7 @@ export interface IReqoreContext {
|
|
|
12
12
|
readonly isMobileOrTablet?: boolean;
|
|
13
13
|
readonly getAndIncreaseZIndex?: () => number;
|
|
14
14
|
readonly animations?: IReqoreOptions['animations'];
|
|
15
|
-
readonly tooltips?: IReqoreOptions['tooltips'];
|
|
16
15
|
readonly closePopoversOnEscPress?: boolean;
|
|
17
|
-
readonly latestZIndex?: number;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
export default createContext<IReqoreContext>({
|
package/src/helpers/utils.ts
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
isString,
|
|
9
9
|
isUndefined,
|
|
10
10
|
} from 'lodash';
|
|
11
|
-
import { IReqorePanelAction } from '../components/Panel';
|
|
12
11
|
import { NUMBER_TO_SIZE, SIZES, SIZE_TO_NUMBER, TSizes } from '../constants/sizes';
|
|
13
12
|
|
|
14
13
|
export const sleep = async (ms: number) => await new Promise((r) => setTimeout(r, ms));
|
|
@@ -89,5 +88,3 @@ export const getOneLessSize = (size: TSizes): TSizes => {
|
|
|
89
88
|
// Get the size name from the number
|
|
90
89
|
return NUMBER_TO_SIZE[oneLessSizeNumber];
|
|
91
90
|
};
|
|
92
|
-
|
|
93
|
-
export const isActionShown = (action: IReqorePanelAction) => action.show !== false;
|
|
@@ -2,8 +2,8 @@ import { useContext, useMemo } from 'react';
|
|
|
2
2
|
import { ReqoreContext } from '..';
|
|
3
3
|
|
|
4
4
|
const useLatestZIndex = (): number => {
|
|
5
|
-
const { getAndIncreaseZIndex
|
|
6
|
-
const zIndex = useMemo(() => getAndIncreaseZIndex(), [
|
|
5
|
+
const { getAndIncreaseZIndex } = useContext(ReqoreContext);
|
|
6
|
+
const zIndex = useMemo(() => getAndIncreaseZIndex(), []);
|
|
7
7
|
|
|
8
8
|
return zIndex;
|
|
9
9
|
};
|
package/src/hooks/usePopover.tsx
CHANGED
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
IWithReqoreMinimal,
|
|
12
12
|
} from '../types/global';
|
|
13
13
|
import { IReqoreIconName } from '../types/icons';
|
|
14
|
-
import { useReqore } from './useReqore';
|
|
15
14
|
|
|
16
15
|
const startEvents = {
|
|
17
16
|
hover: 'mouseenter',
|
|
@@ -45,7 +44,6 @@ export interface IPopover
|
|
|
45
44
|
show?: boolean;
|
|
46
45
|
openOnMount?: boolean;
|
|
47
46
|
noArrow?: boolean;
|
|
48
|
-
noWrapper?: boolean;
|
|
49
47
|
useTargetWidth?: boolean;
|
|
50
48
|
closeOnOutsideClick?: boolean;
|
|
51
49
|
closeOnAnyClick?: boolean;
|
|
@@ -78,7 +76,6 @@ const usePopover = ({
|
|
|
78
76
|
}: IPopoverOptions): IPopoverControls => {
|
|
79
77
|
const { addPopover, removePopover, updatePopover, popovers, isPopoverOpen } =
|
|
80
78
|
useContext(PopoverContext);
|
|
81
|
-
const { tooltips } = useReqore();
|
|
82
79
|
const { current }: MutableRefObject<string> = useRef(shortid.generate());
|
|
83
80
|
let { current: timeout }: MutableRefObject<any> = useRef(0);
|
|
84
81
|
|
|
@@ -98,11 +95,11 @@ const usePopover = ({
|
|
|
98
95
|
noArrow,
|
|
99
96
|
useTargetWidth,
|
|
100
97
|
closeOnOutsideClick,
|
|
101
|
-
closeOnAnyClick: handler === 'hover',
|
|
98
|
+
closeOnAnyClick: handler === 'hover' || handler === 'hoverStay',
|
|
102
99
|
...rest,
|
|
103
100
|
});
|
|
104
101
|
|
|
105
|
-
if (rest
|
|
102
|
+
if (rest?.blur > 0) {
|
|
106
103
|
targetElement.style.position = 'relative';
|
|
107
104
|
targetElement.style.zIndex = '999999';
|
|
108
105
|
}
|
|
@@ -111,13 +108,13 @@ const usePopover = ({
|
|
|
111
108
|
const _addPopover = () => {
|
|
112
109
|
if (currentPopover) {
|
|
113
110
|
if (handler !== 'hoverStay' && handler !== 'focus') {
|
|
114
|
-
_removePopover();
|
|
111
|
+
_removePopover?.();
|
|
115
112
|
}
|
|
116
113
|
} else if (show) {
|
|
117
|
-
if (delay
|
|
114
|
+
if (delay) {
|
|
118
115
|
timeout = setTimeout(() => {
|
|
119
116
|
openPopover();
|
|
120
|
-
}, delay
|
|
117
|
+
}, delay);
|
|
121
118
|
} else {
|
|
122
119
|
openPopover();
|
|
123
120
|
}
|
|
@@ -144,7 +141,7 @@ const usePopover = ({
|
|
|
144
141
|
noArrow,
|
|
145
142
|
useTargetWidth,
|
|
146
143
|
closeOnOutsideClick,
|
|
147
|
-
closeOnAnyClick: handler === 'hover',
|
|
144
|
+
closeOnAnyClick: handler === 'hover' || handler === 'hoverStay',
|
|
148
145
|
...rest,
|
|
149
146
|
});
|
|
150
147
|
}
|
|
@@ -32,8 +32,6 @@ export default [
|
|
|
32
32
|
tooltip: 'This is a test item',
|
|
33
33
|
headerSize: 2,
|
|
34
34
|
contentSize: 'huge',
|
|
35
|
-
selected: true,
|
|
36
|
-
icon: 'Hashtag',
|
|
37
35
|
content:
|
|
38
36
|
'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
|
|
39
37
|
tags: [
|
|
@@ -53,21 +51,13 @@ export default [
|
|
|
53
51
|
},
|
|
54
52
|
{
|
|
55
53
|
icon: 'TextWrap',
|
|
56
|
-
label: '
|
|
54
|
+
label: 'Item that is not minimal',
|
|
57
55
|
tooltip: 'This is a test item',
|
|
58
|
-
size: 'small',
|
|
59
56
|
content:
|
|
60
57
|
'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
|
|
61
58
|
minimal: false,
|
|
62
59
|
badge: 0,
|
|
63
60
|
},
|
|
64
|
-
{
|
|
65
|
-
icon: 'ZcoolLine',
|
|
66
|
-
label: 'Item without fade',
|
|
67
|
-
content:
|
|
68
|
-
'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long Hello I am a test item content and I am very long so will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long Hello I am a test item content and I am very long so will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
|
|
69
|
-
showContentFade: false,
|
|
70
|
-
},
|
|
71
61
|
{
|
|
72
62
|
icon: 'FolderWarningFill',
|
|
73
63
|
label: 'Expandable item',
|
|
@@ -92,7 +82,6 @@ export default [
|
|
|
92
82
|
{
|
|
93
83
|
label: 'Item with custom content when expanded',
|
|
94
84
|
tooltip: 'Expandable item with custom content',
|
|
95
|
-
selected: true,
|
|
96
85
|
content:
|
|
97
86
|
'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
|
|
98
87
|
expandable: true,
|
|
@@ -105,22 +94,6 @@ export default [
|
|
|
105
94
|
weight: 'thin',
|
|
106
95
|
spaced: 2,
|
|
107
96
|
},
|
|
108
|
-
expandedActions: [
|
|
109
|
-
{
|
|
110
|
-
label: 'Action 1',
|
|
111
|
-
id: 'action1',
|
|
112
|
-
icon: 'CapsuleFill',
|
|
113
|
-
onClick: () => alert('Action 1 clicked'),
|
|
114
|
-
position: 'left',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
label: 'Action 2',
|
|
118
|
-
id: 'action2',
|
|
119
|
-
icon: 'CapsuleFill',
|
|
120
|
-
onClick: () => alert('Action 2 clicked'),
|
|
121
|
-
position: 'right',
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
97
|
expandedContent: (
|
|
125
98
|
<>
|
|
126
99
|
<ReqoreMessage intent='info'>Hello I am a custom content</ReqoreMessage>
|
|
@@ -208,9 +181,6 @@ export default [
|
|
|
208
181
|
},
|
|
209
182
|
{
|
|
210
183
|
label: 'I have intent!',
|
|
211
|
-
transparent: true,
|
|
212
|
-
minimal: false,
|
|
213
|
-
flat: false,
|
|
214
184
|
content: (
|
|
215
185
|
<ReqoreP>
|
|
216
186
|
'Well would you look at that. Lorem ipsum dolor{' '}
|
|
@@ -262,14 +232,13 @@ export default [
|
|
|
262
232
|
{
|
|
263
233
|
label: 'I have actions',
|
|
264
234
|
content:
|
|
265
|
-
'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long
|
|
235
|
+
'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
|
|
266
236
|
actions: [
|
|
267
237
|
{
|
|
268
238
|
label: 'Action 1',
|
|
269
239
|
id: 'action1',
|
|
270
240
|
icon: 'CapsuleFill',
|
|
271
241
|
onClick: () => alert('Action 1 clicked'),
|
|
272
|
-
show: false,
|
|
273
242
|
},
|
|
274
243
|
{
|
|
275
244
|
label: 'Action 2',
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
21
21
|
return (
|
|
22
22
|
<>
|
|
23
|
-
<ReqoreControlGroup size={buttonProps.size}
|
|
23
|
+
<ReqoreControlGroup size={buttonProps.size}>
|
|
24
24
|
<ReqoreButton {...buttonProps} icon='BankFill' rightIcon={null} />
|
|
25
25
|
<ReqoreButton {...buttonProps} />
|
|
26
26
|
<ReqoreButton {...buttonProps}>Default</ReqoreButton>
|
|
@@ -41,21 +41,14 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
41
41
|
</ReqoreButton>
|
|
42
42
|
</ReqoreControlGroup>
|
|
43
43
|
<br />
|
|
44
|
-
<ReqoreControlGroup size={buttonProps.size}
|
|
44
|
+
<ReqoreControlGroup size={buttonProps.size}>
|
|
45
45
|
<ReqoreButton {...buttonProps} active flat={false} tooltip='hello'>
|
|
46
46
|
Active Not Flat
|
|
47
47
|
</ReqoreButton>
|
|
48
48
|
<ReqoreButton {...buttonProps} flat={false}>
|
|
49
49
|
Not Flat
|
|
50
50
|
</ReqoreButton>
|
|
51
|
-
<ReqoreButton
|
|
52
|
-
{...buttonProps}
|
|
53
|
-
minimal
|
|
54
|
-
flat={false}
|
|
55
|
-
iconColor='#38fdb2'
|
|
56
|
-
leftIconColor='#33023c:lighten:3'
|
|
57
|
-
rightIconColor='#0a487b:lighten:3'
|
|
58
|
-
>
|
|
51
|
+
<ReqoreButton {...buttonProps} minimal flat={false}>
|
|
59
52
|
Minimal not flat
|
|
60
53
|
</ReqoreButton>
|
|
61
54
|
<ReqoreButton {...buttonProps} readOnly onClick={alert} flat={false}>
|
|
@@ -66,17 +59,16 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
66
59
|
</ReqoreButton>
|
|
67
60
|
</ReqoreControlGroup>
|
|
68
61
|
<br />
|
|
69
|
-
<ReqoreControlGroup fluid
|
|
62
|
+
<ReqoreControlGroup fluid>
|
|
70
63
|
<ReqoreButton {...buttonProps} fluid>
|
|
71
64
|
Fluid button
|
|
72
65
|
</ReqoreButton>
|
|
73
66
|
</ReqoreControlGroup>
|
|
74
67
|
<br />
|
|
75
|
-
<ReqoreControlGroup
|
|
68
|
+
<ReqoreControlGroup>
|
|
76
69
|
<ReqoreButton
|
|
77
70
|
{...buttonProps}
|
|
78
71
|
description='This is a very interesting description for a button, I like it very much'
|
|
79
|
-
iconColor='#38fdb2'
|
|
80
72
|
>
|
|
81
73
|
With Default Description
|
|
82
74
|
</ReqoreButton>
|
|
@@ -117,7 +109,7 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
117
109
|
/>
|
|
118
110
|
</ReqoreControlGroup>
|
|
119
111
|
<br />
|
|
120
|
-
<ReqoreControlGroup
|
|
112
|
+
<ReqoreControlGroup>
|
|
121
113
|
<ReqoreButton {...buttonProps} readOnly badge={10} onClick={alert}>
|
|
122
114
|
Read only with badge
|
|
123
115
|
</ReqoreButton>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
2
|
import Checkbox from '../../components/Checkbox';
|
|
3
|
-
import { ReqoreCheckbox, ReqoreControlGroup
|
|
3
|
+
import { ReqoreCheckbox, ReqoreControlGroup } from '../../index';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Components/Checkbox',
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
const Template: ComponentStory<typeof Checkbox> = (args) => {
|
|
11
11
|
return (
|
|
12
12
|
<ReqoreControlGroup vertical>
|
|
13
|
-
<ReqoreControlGroup
|
|
13
|
+
<ReqoreControlGroup>
|
|
14
14
|
<ReqoreCheckbox {...args} />
|
|
15
15
|
<ReqoreCheckbox {...args} label='Label' labelDetail='Detail' labelDetailPosition='left' />
|
|
16
16
|
<ReqoreCheckbox {...args} checked tooltip='I am checked' />
|
|
@@ -18,8 +18,7 @@ const Template: ComponentStory<typeof Checkbox> = (args) => {
|
|
|
18
18
|
<ReqoreCheckbox {...args} label='Label' labelDetail='Detail' labelPosition='left' />
|
|
19
19
|
<ReqoreCheckbox {...args} label='Read Only' labelPosition='left' readOnly />
|
|
20
20
|
</ReqoreControlGroup>
|
|
21
|
-
<
|
|
22
|
-
<ReqoreControlGroup wrap>
|
|
21
|
+
<ReqoreControlGroup>
|
|
23
22
|
<ReqoreCheckbox {...args} intent='info' checked />
|
|
24
23
|
<ReqoreCheckbox
|
|
25
24
|
{...args}
|
|
@@ -35,8 +34,6 @@ const Template: ComponentStory<typeof Checkbox> = (args) => {
|
|
|
35
34
|
effect={{ gradient: { colors: { 0: '#00fafd', 100: '#ff00d0' } } }}
|
|
36
35
|
/>
|
|
37
36
|
<ReqoreCheckbox {...args} disabled onText='yes' offText='no' />
|
|
38
|
-
<ReqoreCheckbox {...args} onText='yes' offText='no' />
|
|
39
|
-
<ReqoreCheckbox {...args} onText='yes' offText='no' checked />
|
|
40
37
|
<ReqoreCheckbox
|
|
41
38
|
{...args}
|
|
42
39
|
label='Label'
|
|
@@ -2,7 +2,7 @@ import { Meta, Story } from '@storybook/react';
|
|
|
2
2
|
import { IReqoreCollectionProps, ReqoreCollection } from '../../components/Collection';
|
|
3
3
|
import { IReqoreColumnsProps } from '../../components/Columns';
|
|
4
4
|
import items from '../../mock/collectionData';
|
|
5
|
-
import { IntentArg, SizeArg
|
|
5
|
+
import { argManager, IntentArg, SizeArg } from '../utils/args';
|
|
6
6
|
|
|
7
7
|
export interface IColumnsStoryArgs extends IReqoreColumnsProps {
|
|
8
8
|
multipleColumns?: boolean;
|
|
@@ -45,7 +45,7 @@ export default {
|
|
|
45
45
|
description: 'If true, the collection will be rounded when stacked',
|
|
46
46
|
}),
|
|
47
47
|
...createArg('height', {
|
|
48
|
-
defaultValue:
|
|
48
|
+
defaultValue: '600px',
|
|
49
49
|
type: 'string',
|
|
50
50
|
name: 'Height',
|
|
51
51
|
description: 'Height of the collection',
|
|
@@ -72,8 +72,6 @@ const Template: Story<IReqoreCollectionProps> = (args) => {
|
|
|
72
72
|
return (
|
|
73
73
|
<ReqoreCollection
|
|
74
74
|
{...args}
|
|
75
|
-
badge={10}
|
|
76
|
-
selectedIcon='CheckLine'
|
|
77
75
|
actions={[{ label: 'Custom action', icon: 'Home7Line' }, { actions: [{ value: 'Test' }] }]}
|
|
78
76
|
/>
|
|
79
77
|
);
|
|
@@ -85,13 +83,6 @@ Basic.args = {
|
|
|
85
83
|
items,
|
|
86
84
|
};
|
|
87
85
|
|
|
88
|
-
export const WithHeight = Template.bind({});
|
|
89
|
-
WithHeight.args = {
|
|
90
|
-
label: 'Collection of items',
|
|
91
|
-
height: '600px',
|
|
92
|
-
items,
|
|
93
|
-
};
|
|
94
|
-
|
|
95
86
|
export const Stacked = Template.bind({});
|
|
96
87
|
Stacked.args = {
|
|
97
88
|
label: 'Collection of items',
|
|
@@ -105,10 +96,3 @@ Fill.args = {
|
|
|
105
96
|
fill: true,
|
|
106
97
|
items,
|
|
107
98
|
};
|
|
108
|
-
|
|
109
|
-
export const SelectedFirst = Template.bind({});
|
|
110
|
-
SelectedFirst.args = {
|
|
111
|
-
label: 'Collection of items',
|
|
112
|
-
items,
|
|
113
|
-
showSelectedFirst: true,
|
|
114
|
-
};
|