@redneckz/wildless-cms-uni-blocks 0.14.252 → 0.14.253

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 (60) hide show
  1. package/bundle/bundle.umd.js +2 -2
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
  4. package/dist/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
  5. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js +4 -10
  6. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  7. package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +1 -1
  8. package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
  9. package/dist/components/StickyBottomMenu/TopItemMobile.js +1 -1
  10. package/dist/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
  11. package/dist/ui-kit/DialogManager/Dialog.js +1 -1
  12. package/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
  13. package/lib/common.css +1 -1
  14. package/lib/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
  15. package/lib/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
  16. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js +4 -10
  17. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  18. package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +1 -1
  19. package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
  20. package/lib/components/StickyBottomMenu/TopItemMobile.js +2 -2
  21. package/lib/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
  22. package/lib/ui-kit/DialogManager/Dialog.js +1 -1
  23. package/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
  24. package/lib/ui-kit/LocationDialog/renderForeignOffices.d.ts +1 -0
  25. package/lib/ui-kit/LocationDialog/renderRegion.d.ts +1 -0
  26. package/lib/ui-kit/LocationDialog/renderRegionGroup.d.ts +1 -0
  27. package/mobile/bundle/bundle.umd.js +17 -279
  28. package/mobile/bundle/bundle.umd.min.js +1 -1
  29. package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
  30. package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
  31. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js +4 -10
  32. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  33. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +1 -1
  34. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
  35. package/mobile/dist/components/StickyBottomMenu/TopItemMobile.js +1 -1
  36. package/mobile/dist/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
  37. package/mobile/dist/ui-kit/DialogManager/Dialog.js +1 -1
  38. package/mobile/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
  39. package/mobile/lib/common.css +1 -1
  40. package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
  41. package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
  42. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js +4 -10
  43. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  44. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +1 -1
  45. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
  46. package/mobile/lib/components/StickyBottomMenu/TopItemMobile.js +2 -2
  47. package/mobile/lib/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
  48. package/mobile/lib/ui-kit/DialogManager/Dialog.js +1 -1
  49. package/mobile/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
  50. package/mobile/src/components/StickyBottomMenu/ActiveSubMenuItem.tsx +21 -17
  51. package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +25 -44
  52. package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +1 -1
  53. package/mobile/src/components/StickyBottomMenu/TopItemMobile.tsx +5 -8
  54. package/mobile/src/ui-kit/DialogManager/Dialog.tsx +1 -1
  55. package/package.json +1 -1
  56. package/src/components/StickyBottomMenu/ActiveSubMenuItem.tsx +21 -17
  57. package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +25 -44
  58. package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +1 -1
  59. package/src/components/StickyBottomMenu/TopItemMobile.tsx +5 -8
  60. package/src/ui-kit/DialogManager/Dialog.tsx +1 -1
@@ -3,17 +3,13 @@ import { useCallback, useEffect, useMemo, useState } from '@redneckz/uni-jsx/lib
3
3
  import { type RefObject } from 'react';
4
4
  import { type SitemapData } from '../../data/SitemapData';
5
5
  import { useActiveRoute } from '../../hooks/useActiveRoute';
6
- import { useLocation } from '../../hooks/useLocation';
7
- import { type Region } from '../../hooks/useRegions';
8
6
  import { type LinkProps } from '../../model/LinkProps';
9
7
  import { Dialog } from '../../ui-kit/DialogManager/Dialog';
10
8
  import { Heading } from '../../ui-kit/Heading/Heading';
11
9
  import { Img } from '../../ui-kit/Img/Img';
12
- import { useLocationDialog } from '../../ui-kit/LocationDialog/useLocationDialog';
13
- import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
14
10
  import { SwipeListContainer } from '../../ui-kit/SwipeListControl/SwipeListContainer';
15
11
  import { useSwipeListScroll } from '../../ui-kit/SwipeListControl/useSwipeListScroll';
16
- import { Text } from '../../ui-kit/Text/Text';
12
+ import { style } from '../../utils/style';
17
13
  import { ActiveSubMenuItem } from './ActiveSubMenuItem';
18
14
  import { TopItemMobile } from './TopItemMobile';
19
15
 
@@ -22,10 +18,7 @@ export interface BurgerMenuDialogProps extends SitemapData {
22
18
  }
23
19
 
24
20
  export const BurgerMenuDialog = JSX<BurgerMenuDialogProps>((props) => {
25
- const { topItems, defaultLocation, officesLink } = props;
26
-
27
- const [location] = useLocation(defaultLocation);
28
- const locationDialog = useLocationDialog(props);
21
+ const { topItems, officesLink } = props;
29
22
 
30
23
  const [containerRef, scroll] = useSwipeListScroll<HTMLDivElement>({
31
24
  itemCount: topItems?.length ?? 0,
@@ -60,7 +53,7 @@ export const BurgerMenuDialog = JSX<BurgerMenuDialogProps>((props) => {
60
53
  <SwipeListContainer
61
54
  containerRef={containerRef}
62
55
  visibleItemCount={0}
63
- gap={20}
56
+ gap={10}
64
57
  className="pb-3"
65
58
  >
66
59
  {topItems?.map((item, i) => (
@@ -73,11 +66,9 @@ export const BurgerMenuDialog = JSX<BurgerMenuDialogProps>((props) => {
73
66
  ))}
74
67
  </SwipeListContainer>
75
68
  </div>
76
- <div className="relative grow overflow-auto">
69
+ <div className="relative grow">
77
70
  {renderActiveSubMenu(activeMenuSubItems, activeRoute?.href)}
78
- <SearchBar className="grow mb-5" {...props} />
79
71
  {renderOfficeLink(officesLink)}
80
- {renderLocation(location, () => locationDialog.open())}
81
72
  </div>
82
73
  </div>
83
74
  </Dialog>
@@ -95,35 +86,25 @@ const renderActiveSubMenu = (activeMenuSubItems: LinkProps[] | undefined, basePa
95
86
 
96
87
  const renderOfficeLink = (officesLink?: string) =>
97
88
  officesLink ? (
98
- <a
99
- className="flex items-center mb-3"
100
- href={officesLink}
101
- rel="noopener noreferrer"
102
- aria-label="Офисы и банкоматы"
103
- >
104
- <Img
105
- image={{ icon: 'MapOpenedIcon', iconVersion: 'black' }}
106
- width="24"
107
- height="24"
108
- className="text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"
109
- />
110
- <span>Офисы и банкоматы</span>
111
- </a>
112
- ) : null;
113
-
114
- const renderLocation = (location: Region, onClick?: () => void) => (
115
- <div className="flex items-center text-s cursor-pointer" onClick={onClick}>
116
- <Img
117
- image={{ icon: 'GeolocationIcon', iconVersion: 'black' }}
118
- width="24"
119
- height="24"
120
- className="text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"
121
- />
122
- <div className="flex flex-col items-start">
123
- <Text size="text-h5">{location.name}</Text>
124
- <Text color="text-secondary-text" size="text-s">
125
- Ваша локация
126
- </Text>
89
+ <div className="mt-3">
90
+ <a
91
+ className={style(
92
+ 'text-primary-text',
93
+ `py-4 px-4 text-h5 font-light flex justify-between cursor-pointer`,
94
+ 'shadow-main-black',
95
+ 'rounded-xl',
96
+ )}
97
+ href={officesLink}
98
+ rel="noopener noreferrer"
99
+ aria-label="Отделения и банкоматы"
100
+ >
101
+ <span>Отделения и банкоматы</span>
102
+ <Img
103
+ image={{ icon: 'ArrowRightIcon', iconVersion: 'color' }}
104
+ width="24"
105
+ height="24"
106
+ className="text-secondary-text opacity-30"
107
+ />
108
+ </a>
127
109
  </div>
128
- </div>
129
- );
110
+ ) : null;
@@ -22,7 +22,7 @@ export const StickyBottomMenu = UniBlock<StickyBottomMenuProps>(({ sticky, ...re
22
22
  const rightItems = menuItems.slice(middleIdx);
23
23
 
24
24
  return (
25
- <BlockWrapper className="h-[74px]" defaultPadding="p-0" {...rest}>
25
+ <BlockWrapper className="h-[74px] z-[100] relative" defaultPadding="p-0" {...rest}>
26
26
  <div className="ml-auto container bg-white flex justify-center shadow-blue-gray">
27
27
  {leftItems.map(renderMenuItem(activeItem, close))}
28
28
  <StickyBottomMenuBurger isActive={isBurgerMenuDialogOpen} onClick={toggle} />
@@ -9,12 +9,9 @@ interface TopItemProps {
9
9
  }
10
10
 
11
11
  export const TopItemMobile = ({ item, isActive, onClick }: TopItemProps) => (
12
- <button type="button" className="relative" onClick={onClick}>
13
- <span className={style('whitespace-nowrap', isActive ? 'text-primary-main' : '')}>
14
- {item.text}
15
- </span>
16
- {isActive ? (
17
- <div className="absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent" />
18
- ) : null}
19
- </button>
12
+ <div className={style('relative rounded-2xl p-2', isActive ? 'bg-primary-main' : 'bg-main-gray')}>
13
+ <button type="button" className="relative" onClick={onClick}>
14
+ <span className={style('whitespace-nowrap', isActive ? 'text-white' : '')}>{item.text}</span>
15
+ </button>
16
+ </div>
20
17
  );
@@ -20,7 +20,7 @@ export const Dialog = JSX<DialogProps>(({ className, head, children, onClose })
20
20
  }, [onClose]);
21
21
 
22
22
  return (
23
- <div className={style('relative min-h-full bg-white pt-0 p-5', className)} role="dialog">
23
+ <div className={style('relative min-h-full bg-white pt-0 p-lg', className)} role="dialog">
24
24
  <div className="sticky py-xl top-0 bg-white z-10">
25
25
  <CloseButton className="absolute top-0 right-0" onClose={handleClose} />
26
26
  <div className="container">{head}</div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.252",
3
+ "version": "0.14.253",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -22,22 +22,26 @@ export const ActiveSubMenuItem = JSX<ActiveSubMenuItemProps>(({ item, basePath }
22
22
  const isActive = isHrefActive(router)({ href });
23
23
 
24
24
  return (
25
- <a
26
- className={style(
27
- isActive ? 'text-primary-main' : 'text-primary-text',
28
- `py-3 text-h5 font-light flex justify-between cursor-pointer`,
29
- )}
30
- href={href}
31
- target={target}
32
- onClick={onClick}
33
- >
34
- {item.text}
35
- <Img
36
- image={{ icon: 'ChevronLeftIcon', iconVersion: 'black' }}
37
- width="24"
38
- height="24"
39
- className="text-secondary-text rotate-180 opacity-30"
40
- />
41
- </a>
25
+ <div className="mt-3">
26
+ <a
27
+ className={style(
28
+ isActive ? 'text-primary-main' : 'text-primary-text',
29
+ `py-4 px-4 text-h5 font-light flex justify-between cursor-pointer`,
30
+ 'shadow-main-black',
31
+ 'rounded-xl',
32
+ )}
33
+ href={href}
34
+ target={target}
35
+ onClick={onClick}
36
+ >
37
+ {item.text}
38
+ <Img
39
+ image={{ icon: 'ArrowRightIcon', iconVersion: 'color' }}
40
+ width="24"
41
+ height="24"
42
+ className="text-secondary-text opacity-30"
43
+ />
44
+ </a>
45
+ </div>
42
46
  );
43
47
  });
@@ -3,17 +3,13 @@ import { useCallback, useEffect, useMemo, useState } from '@redneckz/uni-jsx/lib
3
3
  import { type RefObject } from 'react';
4
4
  import { type SitemapData } from '../../data/SitemapData';
5
5
  import { useActiveRoute } from '../../hooks/useActiveRoute';
6
- import { useLocation } from '../../hooks/useLocation';
7
- import { type Region } from '../../hooks/useRegions';
8
6
  import { type LinkProps } from '../../model/LinkProps';
9
7
  import { Dialog } from '../../ui-kit/DialogManager/Dialog';
10
8
  import { Heading } from '../../ui-kit/Heading/Heading';
11
9
  import { Img } from '../../ui-kit/Img/Img';
12
- import { useLocationDialog } from '../../ui-kit/LocationDialog/useLocationDialog';
13
- import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
14
10
  import { SwipeListContainer } from '../../ui-kit/SwipeListControl/SwipeListContainer';
15
11
  import { useSwipeListScroll } from '../../ui-kit/SwipeListControl/useSwipeListScroll';
16
- import { Text } from '../../ui-kit/Text/Text';
12
+ import { style } from '../../utils/style';
17
13
  import { ActiveSubMenuItem } from './ActiveSubMenuItem';
18
14
  import { TopItemMobile } from './TopItemMobile';
19
15
 
@@ -22,10 +18,7 @@ export interface BurgerMenuDialogProps extends SitemapData {
22
18
  }
23
19
 
24
20
  export const BurgerMenuDialog = JSX<BurgerMenuDialogProps>((props) => {
25
- const { topItems, defaultLocation, officesLink } = props;
26
-
27
- const [location] = useLocation(defaultLocation);
28
- const locationDialog = useLocationDialog(props);
21
+ const { topItems, officesLink } = props;
29
22
 
30
23
  const [containerRef, scroll] = useSwipeListScroll<HTMLDivElement>({
31
24
  itemCount: topItems?.length ?? 0,
@@ -60,7 +53,7 @@ export const BurgerMenuDialog = JSX<BurgerMenuDialogProps>((props) => {
60
53
  <SwipeListContainer
61
54
  containerRef={containerRef}
62
55
  visibleItemCount={0}
63
- gap={20}
56
+ gap={10}
64
57
  className="pb-3"
65
58
  >
66
59
  {topItems?.map((item, i) => (
@@ -73,11 +66,9 @@ export const BurgerMenuDialog = JSX<BurgerMenuDialogProps>((props) => {
73
66
  ))}
74
67
  </SwipeListContainer>
75
68
  </div>
76
- <div className="relative grow overflow-auto">
69
+ <div className="relative grow">
77
70
  {renderActiveSubMenu(activeMenuSubItems, activeRoute?.href)}
78
- <SearchBar className="grow mb-5" {...props} />
79
71
  {renderOfficeLink(officesLink)}
80
- {renderLocation(location, () => locationDialog.open())}
81
72
  </div>
82
73
  </div>
83
74
  </Dialog>
@@ -95,35 +86,25 @@ const renderActiveSubMenu = (activeMenuSubItems: LinkProps[] | undefined, basePa
95
86
 
96
87
  const renderOfficeLink = (officesLink?: string) =>
97
88
  officesLink ? (
98
- <a
99
- className="flex items-center mb-3"
100
- href={officesLink}
101
- rel="noopener noreferrer"
102
- aria-label="Офисы и банкоматы"
103
- >
104
- <Img
105
- image={{ icon: 'MapOpenedIcon', iconVersion: 'black' }}
106
- width="24"
107
- height="24"
108
- className="text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"
109
- />
110
- <span>Офисы и банкоматы</span>
111
- </a>
112
- ) : null;
113
-
114
- const renderLocation = (location: Region, onClick?: () => void) => (
115
- <div className="flex items-center text-s cursor-pointer" onClick={onClick}>
116
- <Img
117
- image={{ icon: 'GeolocationIcon', iconVersion: 'black' }}
118
- width="24"
119
- height="24"
120
- className="text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"
121
- />
122
- <div className="flex flex-col items-start">
123
- <Text size="text-h5">{location.name}</Text>
124
- <Text color="text-secondary-text" size="text-s">
125
- Ваша локация
126
- </Text>
89
+ <div className="mt-3">
90
+ <a
91
+ className={style(
92
+ 'text-primary-text',
93
+ `py-4 px-4 text-h5 font-light flex justify-between cursor-pointer`,
94
+ 'shadow-main-black',
95
+ 'rounded-xl',
96
+ )}
97
+ href={officesLink}
98
+ rel="noopener noreferrer"
99
+ aria-label="Отделения и банкоматы"
100
+ >
101
+ <span>Отделения и банкоматы</span>
102
+ <Img
103
+ image={{ icon: 'ArrowRightIcon', iconVersion: 'color' }}
104
+ width="24"
105
+ height="24"
106
+ className="text-secondary-text opacity-30"
107
+ />
108
+ </a>
127
109
  </div>
128
- </div>
129
- );
110
+ ) : null;
@@ -22,7 +22,7 @@ export const StickyBottomMenu = UniBlock<StickyBottomMenuProps>(({ sticky, ...re
22
22
  const rightItems = menuItems.slice(middleIdx);
23
23
 
24
24
  return (
25
- <BlockWrapper className="h-[74px]" defaultPadding="p-0" {...rest}>
25
+ <BlockWrapper className="h-[74px] z-[100] relative" defaultPadding="p-0" {...rest}>
26
26
  <div className="ml-auto container bg-white flex justify-center shadow-blue-gray">
27
27
  {leftItems.map(renderMenuItem(activeItem, close))}
28
28
  <StickyBottomMenuBurger isActive={isBurgerMenuDialogOpen} onClick={toggle} />
@@ -9,12 +9,9 @@ interface TopItemProps {
9
9
  }
10
10
 
11
11
  export const TopItemMobile = ({ item, isActive, onClick }: TopItemProps) => (
12
- <button type="button" className="relative" onClick={onClick}>
13
- <span className={style('whitespace-nowrap', isActive ? 'text-primary-main' : '')}>
14
- {item.text}
15
- </span>
16
- {isActive ? (
17
- <div className="absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent" />
18
- ) : null}
19
- </button>
12
+ <div className={style('relative rounded-2xl p-2', isActive ? 'bg-primary-main' : 'bg-main-gray')}>
13
+ <button type="button" className="relative" onClick={onClick}>
14
+ <span className={style('whitespace-nowrap', isActive ? 'text-white' : '')}>{item.text}</span>
15
+ </button>
16
+ </div>
20
17
  );
@@ -20,7 +20,7 @@ export const Dialog = JSX<DialogProps>(({ className, head, children, onClose })
20
20
  }, [onClose]);
21
21
 
22
22
  return (
23
- <div className={style('relative min-h-full bg-white pt-0 p-5', className)} role="dialog">
23
+ <div className={style('relative min-h-full bg-white pt-0 p-lg', className)} role="dialog">
24
24
  <div className="sticky py-xl top-0 bg-white z-10">
25
25
  <CloseButton className="absolute top-0 right-0" onClose={handleClose} />
26
26
  <div className="container">{head}</div>