@itcase/storybook-config 1.2.40 → 1.2.41

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/README.md CHANGED
@@ -1,3 +1,70 @@
1
1
  # ITCase Storybook Config
2
2
 
3
+ Конфигурация Storybook для проектов на React, Next.js и React Native.
4
+
5
+ Сторисы находятся в папке **`stories`**.
6
+
7
+ ## Запуск Storybook
8
+
9
+ Перед запуском установите зависимости: `npm install`.
10
+
11
+ ### React (Webpack)
12
+
13
+ ```bash
14
+ npm run storybook-react-webpack
15
+ # или через Makefile (с очисткой кэша):
16
+ make storybook-react-webpack
17
+ ```
18
+
19
+ ### React (Vite)
20
+
21
+ ```bash
22
+ npm run storybook-vite
23
+ # или:
24
+ make storybook-vite
25
+ ```
26
+
27
+ ### Next.js
28
+
29
+ ```bash
30
+ npm run storybook-next-js
31
+ # или:
32
+ make storybook-next-js
33
+ ```
34
+
35
+ ### Next.js + Vite
36
+
37
+ ```bash
38
+ npm run storybook-next-js-vite
39
+ # или:
40
+ make storybook-next-js-vite
41
+ ```
42
+
43
+ ### React Native (нативное приложение)
44
+
45
+ **iOS:**
46
+
47
+ ```bash
48
+ npm run storybook-react-native-ios
49
+ # или:
50
+ make storybook-react-native-ios
51
+ ```
52
+
53
+ **Android:**
54
+
55
+ ```bash
56
+ npm run storybook-react-native-android
57
+ # или:
58
+ make storybook-react-native-android
59
+ ```
60
+
61
+ ### React Native Web
62
+
63
+ Storybook в браузере для React Native компонентов:
64
+
65
+ ```bash
66
+ npm run storybook-react-native-web
67
+ # или:
68
+ make storybook-react-native-web
69
+ ```
3
70
 
@@ -2852,24 +2852,185 @@ const useAppearanceConfig = (appearance, componentConfig, isDisabled) => {
2852
2852
  return appearanceConfig;
2853
2853
  };
2854
2854
 
2855
- const STATUSES$1 = {
2855
+ const STATUSES = {
2856
2856
  error: 'error',
2857
2857
  info: 'info',
2858
2858
  success: 'success',
2859
2859
  warning: 'warning',
2860
2860
  };
2861
- const NotificationsContext$1 = createContext([]);
2861
+ const NotificationsContext = createContext([]);
2862
2862
  /* eslint-disable @typescript-eslint/no-unused-vars */
2863
- const NotificationsAPIContext$1 = createContext({
2863
+ const NotificationsAPIContext = createContext({
2864
2864
  hideNotifications: (targetId) => { },
2865
2865
  showNotification: (notification, onClose) => { },
2866
- notificationStatuses: STATUSES$1,
2866
+ notificationStatuses: STATUSES,
2867
2867
  });
2868
+ /* eslint-enable @typescript-eslint/no-unused-vars */
2869
+ function NotificationsProvider(props) {
2870
+ const { initialNotificationsList = [], isLogRequestsErrors, children } = props;
2871
+ const [notificationsList, setNotificationsList] = useState(() => {
2872
+ // We need to set id to every notification item and original list also be have new id's
2873
+ return (initialNotificationsList || []).map((notificationItem) => {
2874
+ return createNotification(notificationItem, notificationItem.onClose);
2875
+ });
2876
+ });
2877
+ const hideNotifications = useCallback((targetId) => {
2878
+ // If not target, then nothing to hide
2879
+ if (!targetId) {
2880
+ return;
2881
+ }
2882
+ setNotificationsList((prevNotificationsList) => {
2883
+ const newState = prevNotificationsList.filter((notificationItem) => {
2884
+ // Check on need to hide, if current notification is target for hide
2885
+ const isNeedToHide = String(notificationItem.id) === String(targetId);
2886
+ // Callback for close if exists
2887
+ if (isNeedToHide) {
2888
+ clearTimeout(notificationItem._closeTimeout);
2889
+ // @typescript-eslint/no-unused-expressions
2890
+ notificationItem.onClose && notificationItem.onClose();
2891
+ }
2892
+ // Save in state if no need to hide
2893
+ return !isNeedToHide;
2894
+ });
2895
+ // Set new notifications list without target item to state
2896
+ return newState;
2897
+ });
2898
+ }, []);
2899
+ const showNotification = useCallback((notification, onClose) => {
2900
+ const newNotificationItem = createNotification(notification, onClose);
2901
+ setNotificationsList((prevNotificationsList) => {
2902
+ const newState = prevNotificationsList.slice();
2903
+ const existsNotificationIndex = newState.findIndex((notificationItem) => String(notificationItem.id) === String(newNotificationItem.id));
2904
+ // Add new notification
2905
+ if (existsNotificationIndex === -1) {
2906
+ return [...newState, newNotificationItem];
2907
+ }
2908
+ // Or update exists notification
2909
+ const updatedNotificationItem = newState[existsNotificationIndex];
2910
+ // Clear timeout to avoid close event for updated notification
2911
+ clearTimeout(updatedNotificationItem._closeTimeout);
2912
+ updatedNotificationItem._closeTimeout = undefined;
2913
+ // Replace exists notification by new one
2914
+ newState[existsNotificationIndex] = newNotificationItem;
2915
+ return newState;
2916
+ });
2917
+ if (newNotificationItem.closeByTime) {
2918
+ newNotificationItem._closeTimeout = setTimeout(() => hideNotifications(newNotificationItem.id), newNotificationItem.closeByTime);
2919
+ }
2920
+ return newNotificationItem;
2921
+ },
2922
+ // "hideNotifications" is never changed
2923
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2924
+ []);
2925
+ const notificationsAPI = useMemo(() => ({
2926
+ hideNotifications: hideNotifications,
2927
+ notificationStatuses: STATUSES,
2928
+ showNotification: showNotification,
2929
+ }),
2930
+ // Functions is never changes, no sense to set as dependencies
2931
+ // eslint-disable-next-line
2932
+ []);
2933
+ useEffect(() => {
2934
+ // Set timeout for initial notifications list one time on first render
2935
+ notificationsList.forEach((notificationItem) => {
2936
+ if (notificationItem.closeByTime) {
2937
+ setTimeout(() => hideNotifications(notificationItem.id), notificationItem.closeByTime);
2938
+ }
2939
+ });
2940
+ // Show notifications on all requests errors.
2941
+ // Enable one time without disabling. Use "isLogging" on request config level
2942
+ // to disable notifications logger.
2943
+ if (isLogRequestsErrors) {
2944
+ axiosInstanceITCase.responseErrorHandler.loggerManager = {
2945
+ log: (responseError) => {
2946
+ if (responseError.message) {
2947
+ // prevent from showing many network errors
2948
+ const errorListToDedupe = ['network'];
2949
+ const id = errorListToDedupe.includes(responseError.key)
2950
+ ? responseError.key
2951
+ : undefined;
2952
+ showNotification({
2953
+ id: id,
2954
+ title: responseError.message,
2955
+ status: 'error',
2956
+ closeByTime: 4000,
2957
+ });
2958
+ }
2959
+ },
2960
+ };
2961
+ }
2962
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2963
+ }, []);
2964
+ return (jsx(NotificationsAPIContext.Provider, { value: notificationsAPI, children: jsx(NotificationsContext.Provider, { value: notificationsList, children: children }) }));
2965
+ }
2868
2966
  function useNotifications() {
2869
- return useContext(NotificationsContext$1);
2967
+ return useContext(NotificationsContext);
2870
2968
  }
2871
2969
  function useNotificationsAPI() {
2872
- return useContext(NotificationsAPIContext$1);
2970
+ return useContext(NotificationsAPIContext);
2971
+ }
2972
+ const statusToAppearanceList = {
2973
+ error: 'errorPrimary sizeS solid rounded',
2974
+ info: 'infoPrimary sizeS solid rounded',
2975
+ success: 'successPrimary sizeS solid rounded',
2976
+ warning: 'warningPrimary sizeS solid rounded',
2977
+ };
2978
+ function createNotification(notification, onClose) {
2979
+ // Default notification item properties
2980
+ let id = v4().split('-')[0];
2981
+ let title = '';
2982
+ let text = '';
2983
+ let closeIcon = '';
2984
+ let closeIconSrc = '';
2985
+ let type = 'float';
2986
+ let buttonLabel = '';
2987
+ let status = STATUSES.warning;
2988
+ let closeByTime = 4500;
2989
+ let appearance = statusToAppearanceList[status];
2990
+ let after = null;
2991
+ let isLoading = false;
2992
+ let closeIconAppearance = '';
2993
+ let onClickButton = () => { };
2994
+ if (typeof notification === 'string') {
2995
+ text = notification;
2996
+ }
2997
+ else if (typeof notification === 'object') {
2998
+ id = String(notification.id ?? id);
2999
+ title = notification.title ?? title;
3000
+ text = notification.text ?? text;
3001
+ closeIconAppearance =
3002
+ notification.closeIconAppearance ?? closeIconAppearance;
3003
+ type = notification.type ?? type;
3004
+ closeIcon = notification.closeIcon ?? closeIcon;
3005
+ closeIconSrc = notification.closeIconSrc ?? closeIconSrc;
3006
+ buttonLabel = notification.buttonLabel ?? buttonLabel;
3007
+ onClickButton = notification.onClickButton ?? onClickButton;
3008
+ status = notification.status ?? status;
3009
+ closeByTime = notification.closeByTime ?? closeByTime;
3010
+ isLoading = notification.isLoading ?? isLoading;
3011
+ after = notification.after ?? after;
3012
+ appearance =
3013
+ notification.appearance ??
3014
+ statusToAppearanceList[notification.status] ??
3015
+ appearance;
3016
+ }
3017
+ return {
3018
+ id: id,
3019
+ appearance: appearance,
3020
+ type: type,
3021
+ title: title,
3022
+ status: status,
3023
+ text: text,
3024
+ buttonLabel: buttonLabel,
3025
+ after: after,
3026
+ closeByTime: closeByTime,
3027
+ closeIcon: closeIcon,
3028
+ closeIconAppearance: closeIconAppearance,
3029
+ closeIconSrc: closeIconSrc,
3030
+ isLoading: isLoading,
3031
+ onClickButton: onClickButton,
3032
+ onClose: onClose,
3033
+ };
2873
3034
  }
2874
3035
 
2875
3036
  var tablet = "48em";
@@ -3007,7 +3168,7 @@ const setViewportProperty = () => {
3007
3168
  document.documentElement.style.setProperty('--vh', `${vh}px`);
3008
3169
  };
3009
3170
 
3010
- const UserDeviceContext$1 = createContext({
3171
+ const UserDeviceContext = createContext({
3011
3172
  isMobile: false,
3012
3173
  isTablet: false,
3013
3174
  isDesktop: false,
@@ -3015,7 +3176,7 @@ const UserDeviceContext$1 = createContext({
3015
3176
  deviceCurrentType: '',
3016
3177
  deviceTypesList: [],
3017
3178
  });
3018
- memo(function UIProvider(props) {
3179
+ const UIProvider = memo(function UIProvider(props) {
3019
3180
  const { userDeviceState = {}, children } = props;
3020
3181
  /** NOTE:
3021
3182
  * Remember that the "useMediaQueries" hook works by next scenario:
@@ -3061,10 +3222,10 @@ memo(function UIProvider(props) {
3061
3222
  setViewportProperty();
3062
3223
  window.addEventListener('resize', setViewportProperty);
3063
3224
  }, []);
3064
- return (jsx(UserDeviceContext$1.Provider, { value: deviceContextState, children: children }));
3225
+ return (jsx(UserDeviceContext.Provider, { value: deviceContextState, children: children }));
3065
3226
  });
3066
3227
  function useUserDeviceContext() {
3067
- const context = useContext(UserDeviceContext$1);
3228
+ const context = useContext(UserDeviceContext);
3068
3229
  if (!context) {
3069
3230
  throw new Error('useUserDeviceContext is not defined');
3070
3231
  }
@@ -3456,7 +3617,7 @@ function useStyles(props) {
3456
3617
  }
3457
3618
  else {
3458
3619
  // Some properties doesn't have any units
3459
- const ignorePX = ['zIndex', 'order', 'flexGrow'].includes(styleAttributeKey);
3620
+ const ignorePX = ['zIndex', 'order', 'flexGrow', 'opacity'].includes(styleAttributeKey);
3460
3621
  if (!ignorePX) {
3461
3622
  // Add px to non-unit value
3462
3623
  value = `${value}px`;
@@ -5524,236 +5685,4 @@ function NotificationWrapper(props) {
5524
5685
  return (jsx("div", { className: clsx('notification', className), "data-testid": dataTestId, "data-tour": dataTour, children: jsx("div", { className: "notification__wrapper", children: notifications.map((notification) => (jsx(Notification, { id: notification.id, appearance: notification.appearance, type: notification.type, title: notification.title, status: notification.status, text: notification.text, buttonLabel: notification.buttonLabel, after: notification.after, closeIcon: notification.closeIcon, closeIconSrc: notification.closeIconSrc, isLoading: notification.isLoading, onClickButton: notification.onClickButton, onClickClose: hideNotifications }, notification.id))) }) }));
5525
5686
  }
5526
5687
 
5527
- const STATUSES = {
5528
- error: 'error',
5529
- info: 'info',
5530
- success: 'success',
5531
- warning: 'warning',
5532
- };
5533
- const NotificationsContext = createContext([]);
5534
- /* eslint-disable @typescript-eslint/no-unused-vars */
5535
- const NotificationsAPIContext = createContext({
5536
- hideNotifications: (targetId) => { },
5537
- showNotification: (notification, onClose) => { },
5538
- notificationStatuses: STATUSES,
5539
- });
5540
- /* eslint-enable @typescript-eslint/no-unused-vars */
5541
- function NotificationsProvider(props) {
5542
- const { initialNotificationsList = [], isLogRequestsErrors, children } = props;
5543
- const [notificationsList, setNotificationsList] = useState(() => {
5544
- // We need to set id to every notification item and original list also be have new id's
5545
- return (initialNotificationsList || []).map((notificationItem) => {
5546
- return createNotification(notificationItem, notificationItem.onClose);
5547
- });
5548
- });
5549
- const hideNotifications = useCallback((targetId) => {
5550
- // If not target, then nothing to hide
5551
- if (!targetId) {
5552
- return;
5553
- }
5554
- setNotificationsList((prevNotificationsList) => {
5555
- const newState = prevNotificationsList.filter((notificationItem) => {
5556
- // Check on need to hide, if current notification is target for hide
5557
- const isNeedToHide = String(notificationItem.id) === String(targetId);
5558
- // Callback for close if exists
5559
- if (isNeedToHide) {
5560
- clearTimeout(notificationItem._closeTimeout);
5561
- // @typescript-eslint/no-unused-expressions
5562
- notificationItem.onClose && notificationItem.onClose();
5563
- }
5564
- // Save in state if no need to hide
5565
- return !isNeedToHide;
5566
- });
5567
- // Set new notifications list without target item to state
5568
- return newState;
5569
- });
5570
- }, []);
5571
- const showNotification = useCallback((notification, onClose) => {
5572
- const newNotificationItem = createNotification(notification, onClose);
5573
- setNotificationsList((prevNotificationsList) => {
5574
- const newState = prevNotificationsList.slice();
5575
- const existsNotificationIndex = newState.findIndex((notificationItem) => String(notificationItem.id) === String(newNotificationItem.id));
5576
- // Add new notification
5577
- if (existsNotificationIndex === -1) {
5578
- return [...newState, newNotificationItem];
5579
- }
5580
- // Or update exists notification
5581
- const updatedNotificationItem = newState[existsNotificationIndex];
5582
- // Clear timeout to avoid close event for updated notification
5583
- clearTimeout(updatedNotificationItem._closeTimeout);
5584
- updatedNotificationItem._closeTimeout = undefined;
5585
- // Replace exists notification by new one
5586
- newState[existsNotificationIndex] = newNotificationItem;
5587
- return newState;
5588
- });
5589
- if (newNotificationItem.closeByTime) {
5590
- newNotificationItem._closeTimeout = setTimeout(() => hideNotifications(newNotificationItem.id), newNotificationItem.closeByTime);
5591
- }
5592
- return newNotificationItem;
5593
- },
5594
- // "hideNotifications" is never changed
5595
- // eslint-disable-next-line react-hooks/exhaustive-deps
5596
- []);
5597
- const notificationsAPI = useMemo(() => ({
5598
- hideNotifications: hideNotifications,
5599
- notificationStatuses: STATUSES,
5600
- showNotification: showNotification,
5601
- }),
5602
- // Functions is never changes, no sense to set as dependencies
5603
- // eslint-disable-next-line
5604
- []);
5605
- useEffect(() => {
5606
- // Set timeout for initial notifications list one time on first render
5607
- notificationsList.forEach((notificationItem) => {
5608
- if (notificationItem.closeByTime) {
5609
- setTimeout(() => hideNotifications(notificationItem.id), notificationItem.closeByTime);
5610
- }
5611
- });
5612
- // Show notifications on all requests errors.
5613
- // Enable one time without disabling. Use "isLogging" on request config level
5614
- // to disable notifications logger.
5615
- if (isLogRequestsErrors) {
5616
- axiosInstanceITCase.responseErrorHandler.loggerManager = {
5617
- log: (responseError) => {
5618
- if (responseError.message) {
5619
- // prevent from showing many network errors
5620
- const errorListToDedupe = ['network'];
5621
- const id = errorListToDedupe.includes(responseError.key)
5622
- ? responseError.key
5623
- : undefined;
5624
- showNotification({
5625
- id: id,
5626
- title: responseError.message,
5627
- status: 'error',
5628
- closeByTime: 4000,
5629
- });
5630
- }
5631
- },
5632
- };
5633
- }
5634
- // eslint-disable-next-line react-hooks/exhaustive-deps
5635
- }, []);
5636
- return (jsx(NotificationsAPIContext.Provider, { value: notificationsAPI, children: jsx(NotificationsContext.Provider, { value: notificationsList, children: children }) }));
5637
- }
5638
- const statusToAppearanceList = {
5639
- error: 'errorPrimary sizeS solid rounded',
5640
- info: 'infoPrimary sizeS solid rounded',
5641
- success: 'successPrimary sizeS solid rounded',
5642
- warning: 'warningPrimary sizeS solid rounded',
5643
- };
5644
- function createNotification(notification, onClose) {
5645
- // Default notification item properties
5646
- let id = v4().split('-')[0];
5647
- let title = '';
5648
- let text = '';
5649
- let closeIcon = '';
5650
- let closeIconSrc = '';
5651
- let type = 'float';
5652
- let buttonLabel = '';
5653
- let status = STATUSES.warning;
5654
- let closeByTime = 4500;
5655
- let appearance = statusToAppearanceList[status];
5656
- let after = null;
5657
- let isLoading = false;
5658
- let closeIconAppearance = '';
5659
- let onClickButton = () => { };
5660
- if (typeof notification === 'string') {
5661
- text = notification;
5662
- }
5663
- else if (typeof notification === 'object') {
5664
- id = String(notification.id ?? id);
5665
- title = notification.title ?? title;
5666
- text = notification.text ?? text;
5667
- closeIconAppearance =
5668
- notification.closeIconAppearance ?? closeIconAppearance;
5669
- type = notification.type ?? type;
5670
- closeIcon = notification.closeIcon ?? closeIcon;
5671
- closeIconSrc = notification.closeIconSrc ?? closeIconSrc;
5672
- buttonLabel = notification.buttonLabel ?? buttonLabel;
5673
- onClickButton = notification.onClickButton ?? onClickButton;
5674
- status = notification.status ?? status;
5675
- closeByTime = notification.closeByTime ?? closeByTime;
5676
- isLoading = notification.isLoading ?? isLoading;
5677
- after = notification.after ?? after;
5678
- appearance =
5679
- notification.appearance ??
5680
- statusToAppearanceList[notification.status] ??
5681
- appearance;
5682
- }
5683
- return {
5684
- id: id,
5685
- appearance: appearance,
5686
- type: type,
5687
- title: title,
5688
- status: status,
5689
- text: text,
5690
- buttonLabel: buttonLabel,
5691
- after: after,
5692
- closeByTime: closeByTime,
5693
- closeIcon: closeIcon,
5694
- closeIconAppearance: closeIconAppearance,
5695
- closeIconSrc: closeIconSrc,
5696
- isLoading: isLoading,
5697
- onClickButton: onClickButton,
5698
- onClose: onClose,
5699
- };
5700
- }
5701
-
5702
- const UserDeviceContext = createContext({
5703
- isMobile: false,
5704
- isTablet: false,
5705
- isDesktop: false,
5706
- deviceCurrentMainType: '',
5707
- deviceCurrentType: '',
5708
- deviceTypesList: [],
5709
- });
5710
- const UIProvider = memo(function UIProvider(props) {
5711
- const { userDeviceState = {}, children } = props;
5712
- /** NOTE:
5713
- * Remember that the "useMediaQueries" hook works by next scenario:
5714
- * when changing the device type(browser width), the hook will first "enable"
5715
- * the new type(set true), and then "disable" the previous one(set false),
5716
- * what provoke to double rendering, and in moment we have two different types as "true".
5717
- * We will need to look at how to change this behavior.
5718
- */
5719
- const allDevicesTypes = useMediaQueries(userDeviceState);
5720
- const { isMobile, isTablet, isDesktop, ...fullNamedDeviceTypes } = allDevicesTypes;
5721
- const deviceCurrentMainType = (isMobile && 'mobile') ||
5722
- (isTablet && 'tablet') ||
5723
- (isDesktop && 'desktop') ||
5724
- '';
5725
- const [deviceCurrentType, deviceTypesList] = useMemo(() => {
5726
- const deviceTypesList = Object.keys(allDevicesTypes).map((key) => camelCase(key.replace('is', '')));
5727
- // In same time "allDevicesTypes" can contain "isMobile" and "isMobileLarge" as true
5728
- let deviceCurrentType = Object.keys(fullNamedDeviceTypes).find(
5729
- // If "fullNamedDeviceTypes.isMobileLarge: true" - that our device
5730
- (key) => fullNamedDeviceTypes[key]);
5731
- // Or set main type (e.g. "isMobile")
5732
- if (!deviceCurrentType) {
5733
- deviceCurrentType = deviceCurrentMainType;
5734
- }
5735
- deviceCurrentType = camelCase(deviceCurrentType.replace('is', ''));
5736
- // On server side render we doesn't known user device and we need to set special word
5737
- return [deviceCurrentType || '_none_', deviceTypesList];
5738
- }, [allDevicesTypes, deviceCurrentMainType, fullNamedDeviceTypes]);
5739
- const deviceContextState = useMemo(() => {
5740
- return {
5741
- ...allDevicesTypes,
5742
- deviceCurrentMainType: deviceCurrentMainType,
5743
- deviceCurrentType: deviceCurrentType,
5744
- deviceTypesList: deviceTypesList,
5745
- };
5746
- }, [
5747
- allDevicesTypes,
5748
- deviceCurrentMainType,
5749
- deviceCurrentType,
5750
- deviceTypesList,
5751
- ]);
5752
- useEffect(() => {
5753
- setViewportProperty();
5754
- window.addEventListener('resize', setViewportProperty);
5755
- }, []);
5756
- return (jsx(UserDeviceContext.Provider, { value: deviceContextState, children: children }));
5757
- });
5758
-
5759
5688
  export { NotificationsProvider as N, UIProvider as U, NotificationWrapper as a };
@@ -2872,24 +2872,185 @@ const useAppearanceConfig = (appearance, componentConfig, isDisabled) => {
2872
2872
  return appearanceConfig;
2873
2873
  };
2874
2874
 
2875
- const STATUSES$1 = {
2875
+ const STATUSES = {
2876
2876
  error: 'error',
2877
2877
  info: 'info',
2878
2878
  success: 'success',
2879
2879
  warning: 'warning',
2880
2880
  };
2881
- const NotificationsContext$1 = React.createContext([]);
2881
+ const NotificationsContext = React.createContext([]);
2882
2882
  /* eslint-disable @typescript-eslint/no-unused-vars */
2883
- const NotificationsAPIContext$1 = React.createContext({
2883
+ const NotificationsAPIContext = React.createContext({
2884
2884
  hideNotifications: (targetId) => { },
2885
2885
  showNotification: (notification, onClose) => { },
2886
- notificationStatuses: STATUSES$1,
2886
+ notificationStatuses: STATUSES,
2887
2887
  });
2888
+ /* eslint-enable @typescript-eslint/no-unused-vars */
2889
+ function NotificationsProvider(props) {
2890
+ const { initialNotificationsList = [], isLogRequestsErrors, children } = props;
2891
+ const [notificationsList, setNotificationsList] = React.useState(() => {
2892
+ // We need to set id to every notification item and original list also be have new id's
2893
+ return (initialNotificationsList || []).map((notificationItem) => {
2894
+ return createNotification(notificationItem, notificationItem.onClose);
2895
+ });
2896
+ });
2897
+ const hideNotifications = React.useCallback((targetId) => {
2898
+ // If not target, then nothing to hide
2899
+ if (!targetId) {
2900
+ return;
2901
+ }
2902
+ setNotificationsList((prevNotificationsList) => {
2903
+ const newState = prevNotificationsList.filter((notificationItem) => {
2904
+ // Check on need to hide, if current notification is target for hide
2905
+ const isNeedToHide = String(notificationItem.id) === String(targetId);
2906
+ // Callback for close if exists
2907
+ if (isNeedToHide) {
2908
+ clearTimeout(notificationItem._closeTimeout);
2909
+ // @typescript-eslint/no-unused-expressions
2910
+ notificationItem.onClose && notificationItem.onClose();
2911
+ }
2912
+ // Save in state if no need to hide
2913
+ return !isNeedToHide;
2914
+ });
2915
+ // Set new notifications list without target item to state
2916
+ return newState;
2917
+ });
2918
+ }, []);
2919
+ const showNotification = React.useCallback((notification, onClose) => {
2920
+ const newNotificationItem = createNotification(notification, onClose);
2921
+ setNotificationsList((prevNotificationsList) => {
2922
+ const newState = prevNotificationsList.slice();
2923
+ const existsNotificationIndex = newState.findIndex((notificationItem) => String(notificationItem.id) === String(newNotificationItem.id));
2924
+ // Add new notification
2925
+ if (existsNotificationIndex === -1) {
2926
+ return [...newState, newNotificationItem];
2927
+ }
2928
+ // Or update exists notification
2929
+ const updatedNotificationItem = newState[existsNotificationIndex];
2930
+ // Clear timeout to avoid close event for updated notification
2931
+ clearTimeout(updatedNotificationItem._closeTimeout);
2932
+ updatedNotificationItem._closeTimeout = undefined;
2933
+ // Replace exists notification by new one
2934
+ newState[existsNotificationIndex] = newNotificationItem;
2935
+ return newState;
2936
+ });
2937
+ if (newNotificationItem.closeByTime) {
2938
+ newNotificationItem._closeTimeout = setTimeout(() => hideNotifications(newNotificationItem.id), newNotificationItem.closeByTime);
2939
+ }
2940
+ return newNotificationItem;
2941
+ },
2942
+ // "hideNotifications" is never changed
2943
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2944
+ []);
2945
+ const notificationsAPI = React.useMemo(() => ({
2946
+ hideNotifications: hideNotifications,
2947
+ notificationStatuses: STATUSES,
2948
+ showNotification: showNotification,
2949
+ }),
2950
+ // Functions is never changes, no sense to set as dependencies
2951
+ // eslint-disable-next-line
2952
+ []);
2953
+ React.useEffect(() => {
2954
+ // Set timeout for initial notifications list one time on first render
2955
+ notificationsList.forEach((notificationItem) => {
2956
+ if (notificationItem.closeByTime) {
2957
+ setTimeout(() => hideNotifications(notificationItem.id), notificationItem.closeByTime);
2958
+ }
2959
+ });
2960
+ // Show notifications on all requests errors.
2961
+ // Enable one time without disabling. Use "isLogging" on request config level
2962
+ // to disable notifications logger.
2963
+ if (isLogRequestsErrors) {
2964
+ common.axiosInstanceITCase.responseErrorHandler.loggerManager = {
2965
+ log: (responseError) => {
2966
+ if (responseError.message) {
2967
+ // prevent from showing many network errors
2968
+ const errorListToDedupe = ['network'];
2969
+ const id = errorListToDedupe.includes(responseError.key)
2970
+ ? responseError.key
2971
+ : undefined;
2972
+ showNotification({
2973
+ id: id,
2974
+ title: responseError.message,
2975
+ status: 'error',
2976
+ closeByTime: 4000,
2977
+ });
2978
+ }
2979
+ },
2980
+ };
2981
+ }
2982
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2983
+ }, []);
2984
+ return (jsxRuntime.jsx(NotificationsAPIContext.Provider, { value: notificationsAPI, children: jsxRuntime.jsx(NotificationsContext.Provider, { value: notificationsList, children: children }) }));
2985
+ }
2888
2986
  function useNotifications() {
2889
- return React.useContext(NotificationsContext$1);
2987
+ return React.useContext(NotificationsContext);
2890
2988
  }
2891
2989
  function useNotificationsAPI() {
2892
- return React.useContext(NotificationsAPIContext$1);
2990
+ return React.useContext(NotificationsAPIContext);
2991
+ }
2992
+ const statusToAppearanceList = {
2993
+ error: 'errorPrimary sizeS solid rounded',
2994
+ info: 'infoPrimary sizeS solid rounded',
2995
+ success: 'successPrimary sizeS solid rounded',
2996
+ warning: 'warningPrimary sizeS solid rounded',
2997
+ };
2998
+ function createNotification(notification, onClose) {
2999
+ // Default notification item properties
3000
+ let id = v4().split('-')[0];
3001
+ let title = '';
3002
+ let text = '';
3003
+ let closeIcon = '';
3004
+ let closeIconSrc = '';
3005
+ let type = 'float';
3006
+ let buttonLabel = '';
3007
+ let status = STATUSES.warning;
3008
+ let closeByTime = 4500;
3009
+ let appearance = statusToAppearanceList[status];
3010
+ let after = null;
3011
+ let isLoading = false;
3012
+ let closeIconAppearance = '';
3013
+ let onClickButton = () => { };
3014
+ if (typeof notification === 'string') {
3015
+ text = notification;
3016
+ }
3017
+ else if (typeof notification === 'object') {
3018
+ id = String(notification.id ?? id);
3019
+ title = notification.title ?? title;
3020
+ text = notification.text ?? text;
3021
+ closeIconAppearance =
3022
+ notification.closeIconAppearance ?? closeIconAppearance;
3023
+ type = notification.type ?? type;
3024
+ closeIcon = notification.closeIcon ?? closeIcon;
3025
+ closeIconSrc = notification.closeIconSrc ?? closeIconSrc;
3026
+ buttonLabel = notification.buttonLabel ?? buttonLabel;
3027
+ onClickButton = notification.onClickButton ?? onClickButton;
3028
+ status = notification.status ?? status;
3029
+ closeByTime = notification.closeByTime ?? closeByTime;
3030
+ isLoading = notification.isLoading ?? isLoading;
3031
+ after = notification.after ?? after;
3032
+ appearance =
3033
+ notification.appearance ??
3034
+ statusToAppearanceList[notification.status] ??
3035
+ appearance;
3036
+ }
3037
+ return {
3038
+ id: id,
3039
+ appearance: appearance,
3040
+ type: type,
3041
+ title: title,
3042
+ status: status,
3043
+ text: text,
3044
+ buttonLabel: buttonLabel,
3045
+ after: after,
3046
+ closeByTime: closeByTime,
3047
+ closeIcon: closeIcon,
3048
+ closeIconAppearance: closeIconAppearance,
3049
+ closeIconSrc: closeIconSrc,
3050
+ isLoading: isLoading,
3051
+ onClickButton: onClickButton,
3052
+ onClose: onClose,
3053
+ };
2893
3054
  }
2894
3055
 
2895
3056
  var tablet = "48em";
@@ -3027,7 +3188,7 @@ const setViewportProperty = () => {
3027
3188
  document.documentElement.style.setProperty('--vh', `${vh}px`);
3028
3189
  };
3029
3190
 
3030
- const UserDeviceContext$1 = React.createContext({
3191
+ const UserDeviceContext = React.createContext({
3031
3192
  isMobile: false,
3032
3193
  isTablet: false,
3033
3194
  isDesktop: false,
@@ -3035,7 +3196,7 @@ const UserDeviceContext$1 = React.createContext({
3035
3196
  deviceCurrentType: '',
3036
3197
  deviceTypesList: [],
3037
3198
  });
3038
- React.memo(function UIProvider(props) {
3199
+ const UIProvider = React.memo(function UIProvider(props) {
3039
3200
  const { userDeviceState = {}, children } = props;
3040
3201
  /** NOTE:
3041
3202
  * Remember that the "useMediaQueries" hook works by next scenario:
@@ -3081,10 +3242,10 @@ React.memo(function UIProvider(props) {
3081
3242
  setViewportProperty();
3082
3243
  window.addEventListener('resize', setViewportProperty);
3083
3244
  }, []);
3084
- return (jsxRuntime.jsx(UserDeviceContext$1.Provider, { value: deviceContextState, children: children }));
3245
+ return (jsxRuntime.jsx(UserDeviceContext.Provider, { value: deviceContextState, children: children }));
3085
3246
  });
3086
3247
  function useUserDeviceContext() {
3087
- const context = React.useContext(UserDeviceContext$1);
3248
+ const context = React.useContext(UserDeviceContext);
3088
3249
  if (!context) {
3089
3250
  throw new Error('useUserDeviceContext is not defined');
3090
3251
  }
@@ -3476,7 +3637,7 @@ function useStyles(props) {
3476
3637
  }
3477
3638
  else {
3478
3639
  // Some properties doesn't have any units
3479
- const ignorePX = ['zIndex', 'order', 'flexGrow'].includes(styleAttributeKey);
3640
+ const ignorePX = ['zIndex', 'order', 'flexGrow', 'opacity'].includes(styleAttributeKey);
3480
3641
  if (!ignorePX) {
3481
3642
  // Add px to non-unit value
3482
3643
  value = `${value}px`;
@@ -5544,238 +5705,6 @@ function NotificationWrapper(props) {
5544
5705
  return (jsxRuntime.jsx("div", { className: clsx('notification', className), "data-testid": dataTestId, "data-tour": dataTour, children: jsxRuntime.jsx("div", { className: "notification__wrapper", children: notifications.map((notification) => (jsxRuntime.jsx(Notification, { id: notification.id, appearance: notification.appearance, type: notification.type, title: notification.title, status: notification.status, text: notification.text, buttonLabel: notification.buttonLabel, after: notification.after, closeIcon: notification.closeIcon, closeIconSrc: notification.closeIconSrc, isLoading: notification.isLoading, onClickButton: notification.onClickButton, onClickClose: hideNotifications }, notification.id))) }) }));
5545
5706
  }
5546
5707
 
5547
- const STATUSES = {
5548
- error: 'error',
5549
- info: 'info',
5550
- success: 'success',
5551
- warning: 'warning',
5552
- };
5553
- const NotificationsContext = React.createContext([]);
5554
- /* eslint-disable @typescript-eslint/no-unused-vars */
5555
- const NotificationsAPIContext = React.createContext({
5556
- hideNotifications: (targetId) => { },
5557
- showNotification: (notification, onClose) => { },
5558
- notificationStatuses: STATUSES,
5559
- });
5560
- /* eslint-enable @typescript-eslint/no-unused-vars */
5561
- function NotificationsProvider(props) {
5562
- const { initialNotificationsList = [], isLogRequestsErrors, children } = props;
5563
- const [notificationsList, setNotificationsList] = React.useState(() => {
5564
- // We need to set id to every notification item and original list also be have new id's
5565
- return (initialNotificationsList || []).map((notificationItem) => {
5566
- return createNotification(notificationItem, notificationItem.onClose);
5567
- });
5568
- });
5569
- const hideNotifications = React.useCallback((targetId) => {
5570
- // If not target, then nothing to hide
5571
- if (!targetId) {
5572
- return;
5573
- }
5574
- setNotificationsList((prevNotificationsList) => {
5575
- const newState = prevNotificationsList.filter((notificationItem) => {
5576
- // Check on need to hide, if current notification is target for hide
5577
- const isNeedToHide = String(notificationItem.id) === String(targetId);
5578
- // Callback for close if exists
5579
- if (isNeedToHide) {
5580
- clearTimeout(notificationItem._closeTimeout);
5581
- // @typescript-eslint/no-unused-expressions
5582
- notificationItem.onClose && notificationItem.onClose();
5583
- }
5584
- // Save in state if no need to hide
5585
- return !isNeedToHide;
5586
- });
5587
- // Set new notifications list without target item to state
5588
- return newState;
5589
- });
5590
- }, []);
5591
- const showNotification = React.useCallback((notification, onClose) => {
5592
- const newNotificationItem = createNotification(notification, onClose);
5593
- setNotificationsList((prevNotificationsList) => {
5594
- const newState = prevNotificationsList.slice();
5595
- const existsNotificationIndex = newState.findIndex((notificationItem) => String(notificationItem.id) === String(newNotificationItem.id));
5596
- // Add new notification
5597
- if (existsNotificationIndex === -1) {
5598
- return [...newState, newNotificationItem];
5599
- }
5600
- // Or update exists notification
5601
- const updatedNotificationItem = newState[existsNotificationIndex];
5602
- // Clear timeout to avoid close event for updated notification
5603
- clearTimeout(updatedNotificationItem._closeTimeout);
5604
- updatedNotificationItem._closeTimeout = undefined;
5605
- // Replace exists notification by new one
5606
- newState[existsNotificationIndex] = newNotificationItem;
5607
- return newState;
5608
- });
5609
- if (newNotificationItem.closeByTime) {
5610
- newNotificationItem._closeTimeout = setTimeout(() => hideNotifications(newNotificationItem.id), newNotificationItem.closeByTime);
5611
- }
5612
- return newNotificationItem;
5613
- },
5614
- // "hideNotifications" is never changed
5615
- // eslint-disable-next-line react-hooks/exhaustive-deps
5616
- []);
5617
- const notificationsAPI = React.useMemo(() => ({
5618
- hideNotifications: hideNotifications,
5619
- notificationStatuses: STATUSES,
5620
- showNotification: showNotification,
5621
- }),
5622
- // Functions is never changes, no sense to set as dependencies
5623
- // eslint-disable-next-line
5624
- []);
5625
- React.useEffect(() => {
5626
- // Set timeout for initial notifications list one time on first render
5627
- notificationsList.forEach((notificationItem) => {
5628
- if (notificationItem.closeByTime) {
5629
- setTimeout(() => hideNotifications(notificationItem.id), notificationItem.closeByTime);
5630
- }
5631
- });
5632
- // Show notifications on all requests errors.
5633
- // Enable one time without disabling. Use "isLogging" on request config level
5634
- // to disable notifications logger.
5635
- if (isLogRequestsErrors) {
5636
- common.axiosInstanceITCase.responseErrorHandler.loggerManager = {
5637
- log: (responseError) => {
5638
- if (responseError.message) {
5639
- // prevent from showing many network errors
5640
- const errorListToDedupe = ['network'];
5641
- const id = errorListToDedupe.includes(responseError.key)
5642
- ? responseError.key
5643
- : undefined;
5644
- showNotification({
5645
- id: id,
5646
- title: responseError.message,
5647
- status: 'error',
5648
- closeByTime: 4000,
5649
- });
5650
- }
5651
- },
5652
- };
5653
- }
5654
- // eslint-disable-next-line react-hooks/exhaustive-deps
5655
- }, []);
5656
- return (jsxRuntime.jsx(NotificationsAPIContext.Provider, { value: notificationsAPI, children: jsxRuntime.jsx(NotificationsContext.Provider, { value: notificationsList, children: children }) }));
5657
- }
5658
- const statusToAppearanceList = {
5659
- error: 'errorPrimary sizeS solid rounded',
5660
- info: 'infoPrimary sizeS solid rounded',
5661
- success: 'successPrimary sizeS solid rounded',
5662
- warning: 'warningPrimary sizeS solid rounded',
5663
- };
5664
- function createNotification(notification, onClose) {
5665
- // Default notification item properties
5666
- let id = v4().split('-')[0];
5667
- let title = '';
5668
- let text = '';
5669
- let closeIcon = '';
5670
- let closeIconSrc = '';
5671
- let type = 'float';
5672
- let buttonLabel = '';
5673
- let status = STATUSES.warning;
5674
- let closeByTime = 4500;
5675
- let appearance = statusToAppearanceList[status];
5676
- let after = null;
5677
- let isLoading = false;
5678
- let closeIconAppearance = '';
5679
- let onClickButton = () => { };
5680
- if (typeof notification === 'string') {
5681
- text = notification;
5682
- }
5683
- else if (typeof notification === 'object') {
5684
- id = String(notification.id ?? id);
5685
- title = notification.title ?? title;
5686
- text = notification.text ?? text;
5687
- closeIconAppearance =
5688
- notification.closeIconAppearance ?? closeIconAppearance;
5689
- type = notification.type ?? type;
5690
- closeIcon = notification.closeIcon ?? closeIcon;
5691
- closeIconSrc = notification.closeIconSrc ?? closeIconSrc;
5692
- buttonLabel = notification.buttonLabel ?? buttonLabel;
5693
- onClickButton = notification.onClickButton ?? onClickButton;
5694
- status = notification.status ?? status;
5695
- closeByTime = notification.closeByTime ?? closeByTime;
5696
- isLoading = notification.isLoading ?? isLoading;
5697
- after = notification.after ?? after;
5698
- appearance =
5699
- notification.appearance ??
5700
- statusToAppearanceList[notification.status] ??
5701
- appearance;
5702
- }
5703
- return {
5704
- id: id,
5705
- appearance: appearance,
5706
- type: type,
5707
- title: title,
5708
- status: status,
5709
- text: text,
5710
- buttonLabel: buttonLabel,
5711
- after: after,
5712
- closeByTime: closeByTime,
5713
- closeIcon: closeIcon,
5714
- closeIconAppearance: closeIconAppearance,
5715
- closeIconSrc: closeIconSrc,
5716
- isLoading: isLoading,
5717
- onClickButton: onClickButton,
5718
- onClose: onClose,
5719
- };
5720
- }
5721
-
5722
- const UserDeviceContext = React.createContext({
5723
- isMobile: false,
5724
- isTablet: false,
5725
- isDesktop: false,
5726
- deviceCurrentMainType: '',
5727
- deviceCurrentType: '',
5728
- deviceTypesList: [],
5729
- });
5730
- const UIProvider = React.memo(function UIProvider(props) {
5731
- const { userDeviceState = {}, children } = props;
5732
- /** NOTE:
5733
- * Remember that the "useMediaQueries" hook works by next scenario:
5734
- * when changing the device type(browser width), the hook will first "enable"
5735
- * the new type(set true), and then "disable" the previous one(set false),
5736
- * what provoke to double rendering, and in moment we have two different types as "true".
5737
- * We will need to look at how to change this behavior.
5738
- */
5739
- const allDevicesTypes = useMediaQueries(userDeviceState);
5740
- const { isMobile, isTablet, isDesktop, ...fullNamedDeviceTypes } = allDevicesTypes;
5741
- const deviceCurrentMainType = (isMobile && 'mobile') ||
5742
- (isTablet && 'tablet') ||
5743
- (isDesktop && 'desktop') ||
5744
- '';
5745
- const [deviceCurrentType, deviceTypesList] = React.useMemo(() => {
5746
- const deviceTypesList = Object.keys(allDevicesTypes).map((key) => camelCase(key.replace('is', '')));
5747
- // In same time "allDevicesTypes" can contain "isMobile" and "isMobileLarge" as true
5748
- let deviceCurrentType = Object.keys(fullNamedDeviceTypes).find(
5749
- // If "fullNamedDeviceTypes.isMobileLarge: true" - that our device
5750
- (key) => fullNamedDeviceTypes[key]);
5751
- // Or set main type (e.g. "isMobile")
5752
- if (!deviceCurrentType) {
5753
- deviceCurrentType = deviceCurrentMainType;
5754
- }
5755
- deviceCurrentType = camelCase(deviceCurrentType.replace('is', ''));
5756
- // On server side render we doesn't known user device and we need to set special word
5757
- return [deviceCurrentType || '_none_', deviceTypesList];
5758
- }, [allDevicesTypes, deviceCurrentMainType, fullNamedDeviceTypes]);
5759
- const deviceContextState = React.useMemo(() => {
5760
- return {
5761
- ...allDevicesTypes,
5762
- deviceCurrentMainType: deviceCurrentMainType,
5763
- deviceCurrentType: deviceCurrentType,
5764
- deviceTypesList: deviceTypesList,
5765
- };
5766
- }, [
5767
- allDevicesTypes,
5768
- deviceCurrentMainType,
5769
- deviceCurrentType,
5770
- deviceTypesList,
5771
- ]);
5772
- React.useEffect(() => {
5773
- setViewportProperty();
5774
- window.addEventListener('resize', setViewportProperty);
5775
- }, []);
5776
- return (jsxRuntime.jsx(UserDeviceContext.Provider, { value: deviceContextState, children: children }));
5777
- });
5778
-
5779
5708
  exports.NotificationWrapper = NotificationWrapper;
5780
5709
  exports.NotificationsProvider = NotificationsProvider;
5781
5710
  exports.UIProvider = UIProvider;
@@ -2,12 +2,12 @@
2
2
 
3
3
  var _rollupPluginBabelHelpers = require('../../_rollupPluginBabelHelpers-Wvf9ehn_.js');
4
4
  var React = require('react');
5
- var UIContext = require('../../UIContext-Xx74DZVi.js');
5
+ var Notification = require('../../Notification-CVCYHdTh.js');
6
6
  require('react/jsx-runtime');
7
+ require('@itcase/common');
7
8
  require('lodash/camelCase');
8
9
  require('lodash/castArray');
9
10
  require('lodash/upperFirst');
10
- require('@itcase/common');
11
11
  require('lodash/maxBy');
12
12
 
13
13
  var _excluded = ["storesData"];
@@ -32,9 +32,9 @@ function withNextDecoratorFactory(_ref) {
32
32
  pageProps: appArgs
33
33
  });
34
34
  }
35
- return /*#__PURE__*/React.createElement(RootStoreProvider, appArgs.rootStoreInitialData, /*#__PURE__*/React.createElement(UIContext.UIProvider, null, /*#__PURE__*/React.createElement(UIContext.NotificationsProvider, {
35
+ return /*#__PURE__*/React.createElement(RootStoreProvider, appArgs.rootStoreInitialData, /*#__PURE__*/React.createElement(Notification.UIProvider, null, /*#__PURE__*/React.createElement(Notification.NotificationsProvider, {
36
36
  initialNotificationsList: parameters.initialNotificationsList || args.initialNotificationsList || []
37
- }, /*#__PURE__*/React.createElement(UIContext.NotificationWrapper, {
37
+ }, /*#__PURE__*/React.createElement(Notification.NotificationWrapper, {
38
38
  className: "notification_global notification_global_right_top"
39
39
  }), /*#__PURE__*/React.createElement(Story, appContext))));
40
40
  };
@@ -1,20 +1,20 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var UIContext = require('../../UIContext-Xx74DZVi.js');
4
+ var Notification = require('../../Notification-CVCYHdTh.js');
5
5
  require('react/jsx-runtime');
6
+ require('@itcase/common');
6
7
  require('lodash/camelCase');
7
8
  require('lodash/castArray');
8
9
  require('lodash/upperFirst');
9
- require('@itcase/common');
10
10
  require('lodash/maxBy');
11
11
 
12
12
  function withUiDecorator(Story, _ref) {
13
13
  var args = _ref.args,
14
14
  parameters = _ref.parameters;
15
- return /*#__PURE__*/React.createElement(UIContext.UIProvider, null, /*#__PURE__*/React.createElement(UIContext.NotificationsProvider, {
15
+ return /*#__PURE__*/React.createElement(Notification.UIProvider, null, /*#__PURE__*/React.createElement(Notification.NotificationsProvider, {
16
16
  initialNotificationsList: parameters.initialNotificationsList || args.initialNotificationsList || []
17
- }, /*#__PURE__*/React.createElement(UIContext.NotificationWrapper, null), /*#__PURE__*/React.createElement(Story, null)));
17
+ }, /*#__PURE__*/React.createElement(Notification.NotificationWrapper, null), /*#__PURE__*/React.createElement(Story, null)));
18
18
  }
19
19
 
20
20
  exports.withUiDecorator = withUiDecorator;
@@ -14,7 +14,7 @@ require('./components/FormSubmitWrapper.js');
14
14
  require('lodash/camelCase');
15
15
  require('@itcase/common');
16
16
  require('msw');
17
- require('../UIContext-Xx74DZVi.js');
17
+ require('../Notification-CVCYHdTh.js');
18
18
  require('react/jsx-runtime');
19
19
  require('lodash/upperFirst');
20
20
  require('lodash/maxBy');
@@ -1,11 +1,11 @@
1
1
  import { _ as _objectWithoutProperties } from '../_rollupPluginBabelHelpers-47UUmXIE.js';
2
2
  import React__default from 'react';
3
- import { U as UIProvider, N as NotificationsProvider, a as NotificationWrapper } from '../UIContext-7wI7giOz.js';
3
+ import { U as UIProvider, N as NotificationsProvider, a as NotificationWrapper } from '../Notification-CP4IyQPf.js';
4
4
  import 'react/jsx-runtime';
5
+ import '@itcase/common';
5
6
  import 'lodash/camelCase';
6
7
  import 'lodash/castArray';
7
8
  import 'lodash/upperFirst';
8
- import '@itcase/common';
9
9
  import 'lodash/maxBy';
10
10
 
11
11
  var _excluded = ["storesData"];
@@ -1,10 +1,10 @@
1
1
  import React__default from 'react';
2
- import { U as UIProvider, N as NotificationsProvider, a as NotificationWrapper } from '../UIContext-7wI7giOz.js';
2
+ import { U as UIProvider, N as NotificationsProvider, a as NotificationWrapper } from '../Notification-CP4IyQPf.js';
3
3
  import 'react/jsx-runtime';
4
+ import '@itcase/common';
4
5
  import 'lodash/camelCase';
5
6
  import 'lodash/castArray';
6
7
  import 'lodash/upperFirst';
7
- import '@itcase/common';
8
8
  import 'lodash/maxBy';
9
9
 
10
10
  function withUiDecorator(Story, _ref) {
@@ -12,7 +12,7 @@ import './components/FormSubmitWrapper.js';
12
12
  import 'lodash/camelCase';
13
13
  import '@itcase/common';
14
14
  import 'msw';
15
- import './UIContext-7wI7giOz.js';
15
+ import './Notification-CP4IyQPf.js';
16
16
  import 'react/jsx-runtime';
17
17
  import 'lodash/upperFirst';
18
18
  import 'lodash/maxBy';
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/storybook-config",
3
- "version": "1.2.40",
4
- "type": "module",
3
+ "version": "1.2.41",
5
4
  "author": "ITCase",
6
5
  "description": "Storybook configuration package",
7
6
  "engines": {
@@ -12,13 +11,11 @@
12
11
  "build-js": "rm -rf dist && NODE_ENV=production rollup -c",
13
12
  "prepare": "npx husky install",
14
13
  "prepack": "npm run build",
15
- "android": "react-native run-android",
16
- "ios": "react-native run-ios",
17
- "react-native-start": "react-native start -- --reset-cache",
18
- "storybook-react-native-start": "sb-rn-get-stories --config-path ./.storybook-react-native && STORYBOOK_ENABLED=true react-native start",
14
+ "ios": "react-native run-ios -- --reset-cache",
15
+ "android": "react-native run-android -- --reset-cache",
19
16
  "storybook-react-native-ios": "sb-rn-get-stories --config-path ./.storybook-react-native && react-native run-ios",
20
17
  "storybook-react-native-android": "sb-rn-get-stories --config-path ./.storybook-react-native && react-native run-android",
21
- "storybook-webpack": "storybook dev -p 6006 --config-dir .storybook-react-webpack5",
18
+ "storybook-react-webpack": "storybook dev -p 6006 --config-dir .storybook-react-webpack",
22
19
  "storybook-next-js": "storybook dev -p 6006 --config-dir .storybook-next-js",
23
20
  "storybook-vite": "storybook dev -p 6006 --config-dir .storybook-vite",
24
21
  "storybook-next-js-vite": "storybook dev -p 6006 --config-dir ..storybook-next-js-vite",
@@ -84,45 +81,34 @@
84
81
  "react": "19.2.4",
85
82
  "react-dom": "19.2.4"
86
83
  },
87
- "peerDependencies": {
88
- "storybook": "^10.2.8",
89
- "@storybook/nextjs-vite": "^10.2.8",
90
- "@storybook/addon-links": "^10.2.8",
91
- "@storybook/addon-themes": "^10.2.8",
92
- "@storybook/addon-designs": "^11.1.2",
93
- "@storybook/addon-docs": "^10.2.8",
94
- "@storybook/addon-vitest": "^10.2.8",
95
- "storybook-addon-source-link": "^2.0.1",
96
- "@storybook/builder-vite": "^10.2.8"
97
- },
98
84
  "dependencies": {
99
85
  "@gorhom/bottom-sheet": "^5.2.8",
100
86
  "@itcase/config": "^1.6.51",
101
87
  "@itcase/storybook-addon-auth": "^1.0.5",
102
- "@react-native-async-storage/async-storage": "^2.2.0",
88
+ "@react-native-async-storage/async-storage": "^3.0.1",
103
89
  "@react-native-community/datetimepicker": "^8.6.0",
104
- "@storybook/addon-designs": "^11.1.2",
105
- "@storybook/addon-docs": "^10.2.10",
106
- "@storybook/addon-links": "^10.2.10",
90
+ "@storybook/addon-docs": "^10.2.14",
91
+ "@storybook/addon-links": "^10.2.14",
107
92
  "@storybook/addon-ondevice-actions": "10.2.3",
108
93
  "@storybook/addon-ondevice-backgrounds": "10.2.3",
109
94
  "@storybook/addon-ondevice-controls": "10.2.3",
110
95
  "@storybook/addon-ondevice-notes": "^10.2.3",
111
96
  "@storybook/addon-react-native-web": "^0.0.29",
112
97
  "@storybook/addon-styling-webpack": "^3.0.0",
113
- "@storybook/addon-themes": "^10.2.10",
114
- "@storybook/addon-vitest": "^10.2.10",
98
+ "@storybook/addon-themes": "^10.2.14",
99
+ "@storybook/addon-vitest": "^10.2.14",
115
100
  "@storybook/addon-webpack5-compiler-swc": "^4.0.2",
116
- "@storybook/nextjs": "^10.2.10",
117
- "@storybook/nextjs-vite": "^10.2.10",
118
- "@storybook/react": "^10.2.10",
101
+ "@storybook/builder-vite": "^10.2.14",
102
+ "@storybook/nextjs": "^10.2.14",
103
+ "@storybook/nextjs-vite": "^10.2.14",
104
+ "@storybook/react": "^10.2.14",
119
105
  "@storybook/react-native": "10.2.3",
120
106
  "@storybook/react-native-ui-lite": "10.2.3",
121
- "@storybook/react-native-web-vite": "^10.2.10",
122
- "@storybook/react-vite": "^10.2.10",
123
- "@vitest/browser-playwright": "^4.0.18",
124
- "@storybook/react-webpack5": "^10.2.10",
107
+ "@storybook/react-native-web-vite": "^10.2.14",
108
+ "@storybook/react-vite": "^10.2.14",
109
+ "@storybook/react-webpack5": "^10.2.14",
125
110
  "@vitejs/plugin-react": "^5.1.4",
111
+ "@vitest/browser-playwright": "^4.0.18",
126
112
  "babel-loader": "^10.0.0",
127
113
  "babel-plugin-react-native-web": "^0.21.2",
128
114
  "babel-plugin-transform-inline-environment-variables": "^0.4.4",
@@ -131,16 +117,16 @@
131
117
  "msw": "^2.12.10",
132
118
  "msw-storybook-addon": "^2.0.6",
133
119
  "react": "19.2.4",
134
- "react-dom": "^19.2.4",
135
- "react-native": "0.84.0",
120
+ "react-dom": "19.2.4",
121
+ "react-native": "0.84.1",
136
122
  "react-native-gesture-handler": "^2.30.0",
137
123
  "react-native-reanimated": "^4.2.2",
138
- "react-native-safe-area-context": "^5.6.2",
124
+ "react-native-safe-area-context": "^5.7.0",
139
125
  "react-native-svg": "^15.15.3",
140
126
  "react-native-web": "^0.21.2",
141
127
  "react-native-worklets": "^0.7.4",
142
- "storybook": "^10.2.10",
143
- "storybook-addon-source-link": "^2.0.1",
128
+ "storybook": "^10.2.14",
129
+ "vite-plugin-babel": "^1.5.1",
144
130
  "vite-plugin-svgr": "^4.5.0",
145
131
  "vite-tsconfig-paths": "^6.1.1",
146
132
  "vitest": "^4.0.18",
@@ -155,40 +141,40 @@
155
141
  "@commitlint/config-conventional": "^20.4.2",
156
142
  "@itcase/common": "^1.2.41",
157
143
  "@itcase/lint": "^1.1.97",
158
- "@itcase/ui": "^1.9.61",
159
- "@react-native-community/cli": "20.1.1",
160
- "@react-native-community/cli-platform-android": "20.1.1",
161
- "@react-native-community/cli-platform-ios": "20.1.1",
162
- "@react-native/babel-preset": "0.84.0",
163
- "@react-native/eslint-config": "0.84.0",
164
- "@react-native/metro-config": "0.84.0",
165
- "@react-native/typescript-config": "0.84.0",
144
+ "@itcase/ui": "^1.9.66",
145
+ "@react-native-community/cli": "20.1.2",
146
+ "@react-native-community/cli-platform-android": "20.1.2",
147
+ "@react-native-community/cli-platform-ios": "20.1.2",
148
+ "@react-native/babel-preset": "0.84.1",
149
+ "@react-native/eslint-config": "0.84.1",
150
+ "@react-native/metro-config": "0.84.1",
151
+ "@react-native/typescript-config": "0.84.1",
166
152
  "@rollup/plugin-babel": "^6.1.0",
167
153
  "@rollup/plugin-commonjs": "^29.0.0",
168
154
  "@rollup/plugin-json": "^6.1.0",
169
155
  "@rollup/plugin-node-resolve": "^16.0.3",
170
- "@storybook/addon-docs": "^10.2.10",
156
+ "@storybook/addon-docs": "^10.2.14",
171
157
  "@types/react": "^19",
172
158
  "@types/react-dom": "^19",
173
159
  "babel-plugin-transform-inline-environment-variables": "^0.4.4",
174
- "conventional-changelog-conventionalcommits": "^9.1.0",
160
+ "conventional-changelog-conventionalcommits": "^9.2.0",
175
161
  "eslint": "9.39.2",
176
162
  "glob": "^13.0.6",
177
163
  "husky": "^9.1.7",
178
- "lint-staged": "^16.2.7",
164
+ "lint-staged": "^16.3.1",
179
165
  "next": "^16.1.6",
180
166
  "prettier": "^3.8.1",
181
167
  "react": "19.2.4",
182
168
  "react-docgen-typescript": "^2.4.0",
183
169
  "react-dom": "19.2.4",
184
- "react-native": "0.84.0",
170
+ "react-native": "0.84.1",
185
171
  "react-native-web": "^0.21.2",
186
- "rollup": "^4.57.1",
172
+ "rollup": "^4.59.0",
187
173
  "rollup-plugin-copy": "^3.5.0",
188
174
  "rollup-plugin-peer-deps-external": "^2.2.4",
189
175
  "semantic-release": "^25.0.3",
190
- "storybook": "^10.2.10",
191
- "stylelint": "^17.3.0",
176
+ "storybook": "^10.2.14",
177
+ "stylelint": "^17.4.0",
192
178
  "typescript": "^5.9.3",
193
179
  "vite": "^7.3.1",
194
180
  "vite-plugin-babel": "^1.5.1"