@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.
- package/bundle/bundle.umd.js +2 -2
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
- package/dist/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js +4 -10
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/TopItemMobile.js +1 -1
- package/dist/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/dist/ui-kit/DialogManager/Dialog.js +1 -1
- package/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
- package/lib/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js +4 -10
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/TopItemMobile.js +2 -2
- package/lib/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/lib/ui-kit/DialogManager/Dialog.js +1 -1
- package/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/lib/ui-kit/LocationDialog/renderForeignOffices.d.ts +1 -0
- package/lib/ui-kit/LocationDialog/renderRegion.d.ts +1 -0
- package/lib/ui-kit/LocationDialog/renderRegionGroup.d.ts +1 -0
- package/mobile/bundle/bundle.umd.js +17 -279
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js +4 -10
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/TopItemMobile.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.js +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js +4 -10
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/TopItemMobile.js +2 -2
- package/mobile/lib/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.js +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/src/components/StickyBottomMenu/ActiveSubMenuItem.tsx +21 -17
- package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +25 -44
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +1 -1
- package/mobile/src/components/StickyBottomMenu/TopItemMobile.tsx +5 -8
- package/mobile/src/ui-kit/DialogManager/Dialog.tsx +1 -1
- package/package.json +1 -1
- package/src/components/StickyBottomMenu/ActiveSubMenuItem.tsx +21 -17
- package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +25 -44
- package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +1 -1
- package/src/components/StickyBottomMenu/TopItemMobile.tsx +5 -8
- 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 {
|
|
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,
|
|
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={
|
|
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
|
|
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
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
13
|
-
<
|
|
14
|
-
{item.text}
|
|
15
|
-
</
|
|
16
|
-
|
|
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-
|
|
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
|
@@ -22,22 +22,26 @@ export const ActiveSubMenuItem = JSX<ActiveSubMenuItemProps>(({ item, basePath }
|
|
|
22
22
|
const isActive = isHrefActive(router)({ href });
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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 {
|
|
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,
|
|
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={
|
|
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
|
|
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
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
13
|
-
<
|
|
14
|
-
{item.text}
|
|
15
|
-
</
|
|
16
|
-
|
|
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-
|
|
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>
|