@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.
Files changed (171) hide show
  1. package/.github/workflows/tests.yml +3 -1
  2. package/__tests__/breadcrumbs.test.tsx +46 -28
  3. package/__tests__/button.test.tsx +18 -0
  4. package/__tests__/checkbox.test.tsx +19 -1
  5. package/__tests__/collection.test.tsx +9 -0
  6. package/__tests__/icon.test.tsx +19 -1
  7. package/__tests__/input.test.tsx +18 -0
  8. package/__tests__/messages.test.tsx +16 -0
  9. package/__tests__/modal.test.tsx +4 -4
  10. package/__tests__/notifications.test.tsx +6 -6
  11. package/__tests__/panel.test.tsx +19 -1
  12. package/__tests__/textarea.test.tsx +18 -0
  13. package/__tests__/tree.test.tsx +3 -1
  14. package/dist/components/Breadcrumbs/item.d.ts.map +1 -1
  15. package/dist/components/Breadcrumbs/item.js +6 -2
  16. package/dist/components/Breadcrumbs/item.js.map +1 -1
  17. package/dist/components/Button/index.d.ts.map +1 -1
  18. package/dist/components/Button/index.js +18 -4
  19. package/dist/components/Button/index.js.map +1 -1
  20. package/dist/components/Checkbox/index.d.ts.map +1 -1
  21. package/dist/components/Checkbox/index.js +8 -4
  22. package/dist/components/Checkbox/index.js.map +1 -1
  23. package/dist/components/Collection/index.d.ts +2 -1
  24. package/dist/components/Collection/index.d.ts.map +1 -1
  25. package/dist/components/Collection/index.js +15 -12
  26. package/dist/components/Collection/index.js.map +1 -1
  27. package/dist/components/Collection/item.js +2 -2
  28. package/dist/components/Collection/item.js.map +1 -1
  29. package/dist/components/Comment/index.d.ts +0 -1
  30. package/dist/components/Comment/index.d.ts.map +1 -1
  31. package/dist/components/ControlGroup/index.d.ts.map +1 -1
  32. package/dist/components/ControlGroup/index.js +5 -3
  33. package/dist/components/ControlGroup/index.js.map +1 -1
  34. package/dist/components/Drawer/index.d.ts +1 -1
  35. package/dist/components/Drawer/index.d.ts.map +1 -1
  36. package/dist/components/Drawer/index.js +1 -1
  37. package/dist/components/Drawer/index.js.map +1 -1
  38. package/dist/components/Dropdown/item.d.ts +0 -1
  39. package/dist/components/Dropdown/item.d.ts.map +1 -1
  40. package/dist/components/Icon/index.d.ts.map +1 -1
  41. package/dist/components/Icon/index.js +8 -4
  42. package/dist/components/Icon/index.js.map +1 -1
  43. package/dist/components/Input/index.d.ts.map +1 -1
  44. package/dist/components/Input/index.js +4 -4
  45. package/dist/components/Input/index.js.map +1 -1
  46. package/dist/components/InputClearButton/index.d.ts +0 -1
  47. package/dist/components/InputClearButton/index.d.ts.map +1 -1
  48. package/dist/components/InternalPopover/index.d.ts.map +1 -1
  49. package/dist/components/InternalPopover/index.js +2 -1
  50. package/dist/components/InternalPopover/index.js.map +1 -1
  51. package/dist/components/Menu/item.d.ts +1 -1
  52. package/dist/components/Menu/item.d.ts.map +1 -1
  53. package/dist/components/Menu/item.js +3 -6
  54. package/dist/components/Menu/item.js.map +1 -1
  55. package/dist/components/Message/index.d.ts.map +1 -1
  56. package/dist/components/Message/index.js +6 -2
  57. package/dist/components/Message/index.js.map +1 -1
  58. package/dist/components/Modal/index.d.ts +0 -1
  59. package/dist/components/Modal/index.d.ts.map +1 -1
  60. package/dist/components/Panel/index.d.ts +1 -0
  61. package/dist/components/Panel/index.d.ts.map +1 -1
  62. package/dist/components/Panel/index.js +13 -9
  63. package/dist/components/Panel/index.js.map +1 -1
  64. package/dist/components/Panel/panel.screenshot.d.ts +0 -1
  65. package/dist/components/Panel/panel.screenshot.d.ts.map +1 -1
  66. package/dist/components/Paragraph/index.js +1 -1
  67. package/dist/components/Sidebar/item.d.ts +0 -1
  68. package/dist/components/Sidebar/item.d.ts.map +1 -1
  69. package/dist/components/Sidebar/item.js +1 -3
  70. package/dist/components/Sidebar/item.js.map +1 -1
  71. package/dist/components/Spinner/index.d.ts +3 -3
  72. package/dist/components/Spinner/index.d.ts.map +1 -1
  73. package/dist/components/Spinner/index.js +13 -2
  74. package/dist/components/Spinner/index.js.map +1 -1
  75. package/dist/components/Table/header.d.ts +0 -1
  76. package/dist/components/Table/header.d.ts.map +1 -1
  77. package/dist/components/Tag/index.d.ts.map +1 -1
  78. package/dist/components/Tag/index.js +7 -4
  79. package/dist/components/Tag/index.js.map +1 -1
  80. package/dist/components/Textarea/index.d.ts.map +1 -1
  81. package/dist/components/Textarea/index.js +7 -6
  82. package/dist/components/Textarea/index.js.map +1 -1
  83. package/dist/components/Tree/index.d.ts +0 -1
  84. package/dist/components/Tree/index.d.ts.map +1 -1
  85. package/dist/components/Tree/index.js +2 -4
  86. package/dist/components/Tree/index.js.map +1 -1
  87. package/dist/containers/PopoverProvider.d.ts.map +1 -1
  88. package/dist/containers/PopoverProvider.js +2 -2
  89. package/dist/containers/PopoverProvider.js.map +1 -1
  90. package/dist/containers/ReqoreProvider.d.ts.map +1 -1
  91. package/dist/containers/ReqoreProvider.js +4 -0
  92. package/dist/containers/ReqoreProvider.js.map +1 -1
  93. package/dist/containers/ThemeProvider.d.ts +1 -2
  94. package/dist/containers/ThemeProvider.d.ts.map +1 -1
  95. package/dist/containers/ThemeProvider.js +3 -3
  96. package/dist/containers/ThemeProvider.js.map +1 -1
  97. package/dist/context/PopoverContext.d.ts +1 -2
  98. package/dist/context/PopoverContext.d.ts.map +1 -1
  99. package/dist/context/PopoverContext.js +2 -2
  100. package/dist/context/PopoverContext.js.map +1 -1
  101. package/dist/context/ReqoreContext.d.ts +3 -2
  102. package/dist/context/ReqoreContext.d.ts.map +1 -1
  103. package/dist/context/ReqoreContext.js +5 -3
  104. package/dist/context/ReqoreContext.js.map +1 -1
  105. package/dist/context/ThemeContext.d.ts +1 -2
  106. package/dist/context/ThemeContext.d.ts.map +1 -1
  107. package/dist/context/ThemeContext.js +2 -2
  108. package/dist/context/ThemeContext.js.map +1 -1
  109. package/dist/hooks/useLatestZIndex.d.ts.map +1 -1
  110. package/dist/hooks/useLatestZIndex.js +3 -2
  111. package/dist/hooks/useLatestZIndex.js.map +1 -1
  112. package/dist/hooks/usePopover.d.ts +0 -1
  113. package/dist/hooks/usePopover.d.ts.map +1 -1
  114. package/dist/hooks/usePopover.js +4 -3
  115. package/dist/hooks/usePopover.js.map +1 -1
  116. package/dist/hooks/useReqore.js +2 -2
  117. package/dist/hooks/useReqore.js.map +1 -1
  118. package/dist/hooks/useReqoreContext.d.ts +3 -0
  119. package/dist/hooks/useReqoreContext.d.ts.map +1 -0
  120. package/dist/hooks/useReqoreContext.js +19 -0
  121. package/dist/hooks/useReqoreContext.js.map +1 -0
  122. package/dist/hooks/useReqoreEffect.js +2 -5
  123. package/dist/hooks/useReqoreEffect.js.map +1 -1
  124. package/dist/hooks/useTheme.d.ts.map +1 -1
  125. package/dist/hooks/useTheme.js +20 -20
  126. package/dist/hooks/useTheme.js.map +1 -1
  127. package/dist/index.d.ts +2 -0
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.js +6 -2
  130. package/dist/index.js.map +1 -1
  131. package/package.json +18 -16
  132. package/src/components/Breadcrumbs/item.tsx +7 -3
  133. package/src/components/Button/index.tsx +25 -7
  134. package/src/components/Checkbox/index.tsx +9 -5
  135. package/src/components/Collection/index.tsx +21 -9
  136. package/src/components/Collection/item.tsx +3 -3
  137. package/src/components/ControlGroup/index.tsx +4 -2
  138. package/src/components/Drawer/index.tsx +4 -4
  139. package/src/components/Icon/index.tsx +9 -5
  140. package/src/components/Input/index.tsx +5 -9
  141. package/src/components/InternalPopover/index.tsx +2 -1
  142. package/src/components/Menu/item.tsx +6 -9
  143. package/src/components/Message/index.tsx +6 -2
  144. package/src/components/Panel/index.tsx +14 -7
  145. package/src/components/Paragraph/index.tsx +1 -1
  146. package/src/components/Sidebar/item.tsx +2 -4
  147. package/src/components/Spinner/index.tsx +11 -3
  148. package/src/components/Tag/index.tsx +9 -6
  149. package/src/components/Textarea/index.tsx +6 -8
  150. package/src/components/Tree/index.tsx +5 -8
  151. package/src/containers/PopoverProvider.tsx +2 -2
  152. package/src/containers/ReqoreProvider.tsx +5 -1
  153. package/src/containers/ThemeProvider.tsx +3 -13
  154. package/src/context/PopoverContext.tsx +1 -1
  155. package/src/context/ReqoreContext.tsx +4 -1
  156. package/src/context/ThemeContext.tsx +1 -1
  157. package/src/hooks/useLatestZIndex.ts +5 -3
  158. package/src/hooks/usePopover.tsx +4 -3
  159. package/src/hooks/useReqore.ts +1 -1
  160. package/src/hooks/useReqoreContext.ts +16 -0
  161. package/src/hooks/useReqoreEffect.ts +3 -3
  162. package/src/hooks/useTheme.ts +21 -17
  163. package/src/index.tsx +2 -0
  164. package/src/stories/Button/Button.stories.tsx +7 -0
  165. package/src/stories/Collection/Collection.stories.tsx +6 -3
  166. package/src/stories/Drawer/Drawer.stories.tsx +4 -3
  167. package/src/stories/Modal/Modal.stories.tsx +3 -4
  168. package/src/stories/Notifications/Interactive.stories.tsx +3 -4
  169. package/src/stories/Panel/Panel.stories.tsx +1 -0
  170. package/src/stories/Spinner/Spinner.stories.tsx +7 -2
  171. 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,4 @@
1
- import { createContext } from 'react';
1
+ import { createContext } from 'use-context-selector';
2
2
  import { IPopoverData } from '../containers/PopoverProvider';
3
3
 
4
4
  export default createContext<{
@@ -1,4 +1,5 @@
1
- import { createContext } from 'react';
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,4 +1,4 @@
1
- import { createContext } from 'react';
1
+ import { createContext } from 'use-context-selector';
2
2
  import { DEFAULT_THEME, IReqoreTheme } from '../constants/theme';
3
3
 
4
4
  export default createContext<IReqoreTheme>(DEFAULT_THEME);
@@ -1,8 +1,10 @@
1
- import { useContext, useMemo } from 'react';
2
- import { ReqoreContext } from '..';
1
+ import { useMemo } from 'react';
2
+ import { useReqoreProperty } from './useReqoreContext';
3
3
 
4
4
  const useLatestZIndex = (): number => {
5
- const { getAndIncreaseZIndex, latestZIndex } = useContext(ReqoreContext);
5
+ const getAndIncreaseZIndex = useReqoreProperty('getAndIncreaseZIndex');
6
+ const latestZIndex = useReqoreProperty('latestZIndex');
7
+
6
8
  const zIndex = useMemo(() => getAndIncreaseZIndex(), [latestZIndex]);
7
9
 
8
10
  return zIndex;
@@ -1,7 +1,9 @@
1
1
  import { Placement } from '@popperjs/core';
2
- import { MutableRefObject, useContext, useEffect, useMemo, useRef } from 'react';
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 { tooltips } = useReqore();
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
 
@@ -1,4 +1,4 @@
1
- import { useContext } from 'react';
1
+ import { useContext } from 'use-context-selector';
2
2
  import ReqoreContext, { IReqoreContext } from '../context/ReqoreContext';
3
3
 
4
4
  export const useReqore = (): IReqoreContext => {
@@ -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 { useContext, useMemo } from 'react';
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 ThemeContext from '../context/ThemeContext';
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 = useContext<IReqoreTheme>(ThemeContext);
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]) {
@@ -1,9 +1,9 @@
1
1
  import { cloneDeep } from 'lodash';
2
- import { useContext } from 'react';
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 = useContext<IReqoreTheme>(ThemeContext);
23
+ const theme: IReqoreTheme = useReqoreProperty('theme');
24
24
 
25
- if (!element) {
26
- return theme;
27
- }
25
+ const finalTheme = useMemo(() => {
26
+ if (!element) {
27
+ return theme;
28
+ }
28
29
 
29
- let _customTheme: IReqoreCustomTheme = cloneDeep(customTheme);
30
+ let _customTheme: IReqoreCustomTheme = cloneDeep(customTheme);
30
31
 
31
- if (_customTheme.main) {
32
- _customTheme.main = getColorFromMaybeString(theme, customTheme.main);
33
- }
32
+ if (_customTheme.main) {
33
+ _customTheme.main = getColorFromMaybeString(theme, customTheme.main);
34
+ }
34
35
 
35
- if (_customTheme.text?.color) {
36
- _customTheme.text.color = getColorFromMaybeString(theme, customTheme.text.color);
37
- }
36
+ if (_customTheme.text?.color) {
37
+ _customTheme.text.color = getColorFromMaybeString(theme, customTheme.text.color);
38
+ }
38
39
 
39
- if (element === 'main' && intent) {
40
- _customTheme.main = theme[intentsKey][intent];
41
- }
40
+ if (element === 'main' && intent) {
41
+ _customTheme.main = theme[intentsKey][intent];
42
+ }
42
43
 
43
- return mergeThemes(element, theme, _customTheme) as IReqoreTheme;
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 { argManager, IntentArg, SizeArg } from '../utils/args';
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
- inputPlaceholder(items) {
181
- return `Start typing to search in ${items.length} items`;
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 { confirmAction } = useContext(ReqoreContext);
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 { ReqoreContext, ReqoreModal, ReqorePanel } from '../../index';
7
- import { argManager, FlatArg, IntentArg } from '../utils/args';
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 { confirmAction } = useContext(ReqoreContext);
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 { ReqoreContext, ReqoreUIProvider } from '../../index';
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 { addNotification } = useContext(ReqoreContext);
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 { addNotification } = useContext(ReqoreContext);
37
+ const addNotification = useReqoreProperty('addNotification');
39
38
 
40
39
  return (
41
40
  <button
@@ -173,6 +173,7 @@ const Template: Story<IReqorePanelProps> = (args: IReqorePanelProps) => {
173
173
  ],
174
174
  },
175
175
  {
176
+ fixed: true,
176
177
  group: [
177
178
  { label: 'Stacked Action 1', icon: 'BallPenLine', intent: 'warning' },
178
179
  { icon: 'CopperCoinFill', intent: 'danger' },
@@ -35,8 +35,13 @@ const Template: Story<IReqoreSpinnerProps> = (args) => {
35
35
  {...args}
36
36
  type={4}
37
37
  iconColor='#f21616'
38
- labelEffect={{ gradient: { colors: 'warning' } }}
39
- size='big'
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>