@foxford/navigation-ui 1.0.0 → 1.0.1
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.mdx +48 -4
- package/footer/contacts-column.d.ts.map +1 -1
- package/footer/contacts-column.js +80 -48
- package/footer/contacts-styled.d.ts +44 -0
- package/footer/contacts-styled.d.ts.map +1 -0
- package/footer/contacts-styled.js +120 -0
- package/footer/footer.d.ts.map +1 -1
- package/footer/footer.js +3 -3
- package/footer/molecules/geoposition/index.js +1 -3
- package/footer/styled.d.ts +0 -22
- package/footer/styled.d.ts.map +1 -1
- package/footer/styled.js +7 -42
- package/footer/types.d.ts +6 -6
- package/footer/types.d.ts.map +1 -1
- package/header/atoms/action-button/assets/elementary/calendar.svg +1 -0
- package/header/atoms/action-button/assets/elementary/catalog.svg +1 -0
- package/header/atoms/action-button/assets/elementary/dashboard.svg +1 -0
- package/header/atoms/action-button/assets/elementary/externship.svg +1 -0
- package/header/atoms/action-button/assets/elementary/main.svg +1 -0
- package/header/atoms/action-button/assets/elementary/room.svg +1 -0
- package/header/atoms/action-button/elementary-icons.d.ts +14 -0
- package/header/atoms/action-button/elementary-icons.d.ts.map +1 -0
- package/header/atoms/action-button/elementary-icons.js +21 -0
- package/header/atoms/action-button/index.d.ts +5 -3
- package/header/atoms/action-button/index.d.ts.map +1 -1
- package/header/atoms/action-button/index.js +23 -4
- package/header/atoms/grades-list-item/index.d.ts +10 -0
- package/header/atoms/grades-list-item/index.d.ts.map +1 -0
- package/header/atoms/grades-list-item/index.js +21 -0
- package/header/atoms/grades-list-item/styled.d.ts +14 -0
- package/header/atoms/grades-list-item/styled.d.ts.map +1 -0
- package/header/atoms/grades-list-item/styled.js +27 -0
- package/header/atoms/profile-menu-item/index.d.ts +3 -1
- package/header/atoms/profile-menu-item/index.d.ts.map +1 -1
- package/header/atoms/profile-menu-item/index.js +2 -0
- package/header/atoms/profile-menu-item/styled.d.ts +4 -2
- package/header/atoms/profile-menu-item/styled.d.ts.map +1 -1
- package/header/atoms/profile-menu-item/styled.js +3 -1
- package/header/atoms/prolongation-title/assets/arrow.svg +1 -0
- package/header/atoms/prolongation-title/assets/lightning.svg +1 -0
- package/header/atoms/prolongation-title/index.d.ts +10 -0
- package/header/atoms/prolongation-title/index.d.ts.map +1 -0
- package/header/atoms/prolongation-title/index.js +44 -0
- package/header/atoms/prolongation-title/styled.d.ts +14 -0
- package/header/atoms/prolongation-title/styled.d.ts.map +1 -0
- package/header/atoms/prolongation-title/styled.js +38 -0
- package/header/header-desktop.d.ts +2 -2
- package/header/header-desktop.d.ts.map +1 -1
- package/header/header-desktop.js +16 -41
- package/header/header-mobile.d.ts +2 -2
- package/header/header-mobile.d.ts.map +1 -1
- package/header/header-mobile.js +3 -18
- package/header/molecules/cart-button/index.js +25 -0
- package/header/molecules/cart-button/styled.d.ts.map +1 -1
- package/header/molecules/cart-button/styled.js +14 -0
- package/header/molecules/container/index.d.ts +5 -1
- package/header/molecules/container/index.d.ts.map +1 -1
- package/header/molecules/container/index.js +5 -3
- package/header/molecules/entry-panel/index.d.ts +4 -1
- package/header/molecules/entry-panel/index.d.ts.map +1 -1
- package/header/molecules/entry-panel/index.js +26 -5
- package/header/molecules/list/index.d.ts.map +1 -1
- package/header/molecules/list/index.js +5 -1
- package/header/molecules/menu/segment-content.d.ts.map +1 -1
- package/header/molecules/menu/segment-content.js +20 -3
- package/header/molecules/menu/types.d.ts +18 -0
- package/header/molecules/menu/types.d.ts.map +1 -1
- package/header/molecules/support-button/index.d.ts +5 -0
- package/header/molecules/support-button/index.d.ts.map +1 -0
- package/header/molecules/support-button/index.js +108 -0
- package/header/molecules/support-button/modal.d.ts +9 -0
- package/header/molecules/support-button/modal.d.ts.map +1 -0
- package/header/molecules/support-button/modal.js +122 -0
- package/header/molecules/support-button/styled.d.ts +31 -0
- package/header/molecules/support-button/styled.d.ts.map +1 -0
- package/header/molecules/support-button/styled.js +43 -0
- package/header/molecules/support-button/theme.d.ts +5 -0
- package/header/molecules/support-button/theme.d.ts.map +1 -0
- package/header/molecules/support-button/theme.js +40 -0
- package/header/molecules/support-button/types.d.ts +20 -0
- package/header/molecules/support-button/types.d.ts.map +1 -0
- package/header/molecules/user-panel/index.d.ts +10 -3
- package/header/molecules/user-panel/index.d.ts.map +1 -1
- package/header/molecules/user-panel/index.js +48 -36
- package/header/molecules/user-panel/styled.d.ts +15 -0
- package/header/molecules/user-panel/styled.d.ts.map +1 -1
- package/header/molecules/user-panel/styled.js +41 -5
- package/header/molecules/user-panel-mobile/index.d.ts +1 -1
- package/header/molecules/user-panel-mobile/index.d.ts.map +1 -1
- package/header/molecules/user-panel-mobile/index.js +11 -3
- package/header/navigation.d.ts.map +1 -1
- package/header/navigation.js +66 -4
- package/header/styled.d.ts +7 -0
- package/header/styled.d.ts.map +1 -1
- package/header/styled.js +24 -4
- package/header/types.d.ts +9 -6
- package/header/types.d.ts.map +1 -1
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -1
- package/index.js +10 -0
- package/package.json +14 -4
- package/shared/constants.d.ts +8 -0
- package/shared/constants.d.ts.map +1 -1
- package/shared/constants.js +8 -0
- package/shared/slots.d.ts +64 -0
- package/shared/slots.d.ts.map +1 -0
- package/shared/slots.js +53 -0
- package/_virtual/preload-helper.js +0 -57
- package/header/molecules/phone-button/index.js +0 -15
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export interface NavigationContainerProps {
|
|
3
|
+
/** Слот над меню — внутри контейнера, поэтому уезжает вместе с ним под шапку. */
|
|
4
|
+
aboveMenu?: ReactNode;
|
|
5
|
+
/** Слот под меню. */
|
|
6
|
+
belowMenu?: ReactNode;
|
|
3
7
|
children: ReactNode;
|
|
4
8
|
/** Влияет на броню высоты до замера: одноклик-меню — это ещё одна строка шапки. */
|
|
5
9
|
hasOneClickMenu?: boolean;
|
|
@@ -7,5 +11,5 @@ export interface NavigationContainerProps {
|
|
|
7
11
|
onBackgroundClick?: () => void;
|
|
8
12
|
showBackground: boolean;
|
|
9
13
|
}
|
|
10
|
-
export declare function Container({ children, hasOneClickMenu, onBackgroundClick, showBackground, }: NavigationContainerProps): import("preact").JSX.Element;
|
|
14
|
+
export declare function Container({ aboveMenu, belowMenu, children, hasOneClickMenu, onBackgroundClick, showBackground, }: NavigationContainerProps): import("preact").JSX.Element;
|
|
11
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/container/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,SAAS,CAAA;IACnB,mFAAmF;IACnF,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC9B,cAAc,EAAE,OAAO,CAAA;CACxB;AAED,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,eAAuB,EACvB,iBAAiB,EACjB,cAAc,GACf,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/container/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,wBAAwB;IACvC,iFAAiF;IACjF,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,qBAAqB;IACrB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,QAAQ,EAAE,SAAS,CAAA;IACnB,mFAAmF;IACnF,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC9B,cAAc,EAAE,OAAO,CAAA;CACxB;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,eAAuB,EACvB,iBAAiB,EACjB,cAAc,GACf,EAAE,wBAAwB,gCAwC1B"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { useRef, useState, useEffect } from "react";
|
|
2
2
|
import { Container as Container$1, ContainerInner } from "./styled.js";
|
|
3
3
|
import { SELECTOR_IDS } from "../../../shared/constants.js";
|
|
4
|
-
import { jsx } from "preact/jsx-runtime";
|
|
4
|
+
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
5
5
|
function Container({
|
|
6
|
+
aboveMenu,
|
|
7
|
+
belowMenu,
|
|
6
8
|
children,
|
|
7
9
|
hasOneClickMenu = false,
|
|
8
10
|
onBackgroundClick,
|
|
@@ -27,9 +29,9 @@ function Container({
|
|
|
27
29
|
onClick: (event) => {
|
|
28
30
|
if (showBackground && event.target === event.currentTarget) onBackgroundClick == null ? void 0 : onBackgroundClick();
|
|
29
31
|
},
|
|
30
|
-
children:
|
|
32
|
+
children: jsxs(ContainerInner, {
|
|
31
33
|
ref: innerRef,
|
|
32
|
-
children
|
|
34
|
+
children: [aboveMenu, children, belowMenu]
|
|
33
35
|
})
|
|
34
36
|
});
|
|
35
37
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { SupportButtonProps } from '../support-button';
|
|
1
2
|
export interface EntryPanelProps {
|
|
2
3
|
hasBonusButton?: boolean;
|
|
3
4
|
isLoggedIn: boolean;
|
|
4
5
|
onLogout: () => void;
|
|
5
6
|
phone?: string;
|
|
7
|
+
/** Кнопка поддержки стоит на месте прежней кнопки телефона; не передана — места нет. */
|
|
8
|
+
supportButton?: SupportButtonProps;
|
|
6
9
|
}
|
|
7
|
-
export declare function EntryPanel({ hasBonusButton, isLoggedIn, onLogout, phone }: EntryPanelProps): import("preact").JSX.Element;
|
|
10
|
+
export declare function EntryPanel({ hasBonusButton, isLoggedIn, onLogout, phone, supportButton }: EntryPanelProps): import("preact").JSX.Element;
|
|
8
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/entry-panel/index.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/entry-panel/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wFAAwF;IACxF,aAAa,CAAC,EAAE,kBAAkB,CAAA;CACnC;AAED,wBAAgB,UAAU,CAAC,EAAE,cAAsB,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,eAAe,gCAgBjH"}
|
|
@@ -1,21 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1
20
|
import { Root, ButtonsWrapper, MobileOnlyButtons } from "./styled.js";
|
|
2
21
|
import { BonusButton } from "../../atoms/bonus-button/index.js";
|
|
3
22
|
import { LoginButton } from "../../atoms/login-button/index.js";
|
|
4
23
|
import { LogoutButton } from "../../atoms/logout-button/index.js";
|
|
5
|
-
import {
|
|
24
|
+
import { SupportButtonTablet } from "../support-button/index.js";
|
|
6
25
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
7
26
|
function EntryPanel({
|
|
8
27
|
hasBonusButton = false,
|
|
9
28
|
isLoggedIn,
|
|
10
29
|
onLogout,
|
|
11
|
-
phone
|
|
30
|
+
phone,
|
|
31
|
+
supportButton
|
|
12
32
|
}) {
|
|
33
|
+
var _a;
|
|
13
34
|
return jsx(Root, {
|
|
14
35
|
children: jsx(ButtonsWrapper, {
|
|
15
36
|
children: isLoggedIn ? jsxs(MobileOnlyButtons, {
|
|
16
|
-
children: [hasBonusButton && jsx(BonusButton, {}),
|
|
17
|
-
|
|
18
|
-
}), jsx(LogoutButton, {
|
|
37
|
+
children: [hasBonusButton && jsx(BonusButton, {}), supportButton && jsx(SupportButtonTablet, __spreadProps(__spreadValues({}, supportButton), {
|
|
38
|
+
phone: (_a = supportButton.phone) != null ? _a : phone
|
|
39
|
+
})), jsx(LogoutButton, {
|
|
19
40
|
onClick: onLogout
|
|
20
41
|
})]
|
|
21
42
|
}) : jsx(LoginButton, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/list/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/list/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,CAAA;IACd,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,SAAS,gCAiBpD"}
|
|
@@ -18,6 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import { Root } from "./styled.js";
|
|
21
|
+
import { GradesListItem } from "../../atoms/grades-list-item/index.js";
|
|
21
22
|
import { ListItem } from "../../atoms/list-item/index.js";
|
|
22
23
|
import { ListSpacer } from "../../atoms/list-spacer/index.js";
|
|
23
24
|
import { ListTitle } from "../../atoms/list-title/index.js";
|
|
@@ -35,7 +36,10 @@ function List({
|
|
|
35
36
|
children: [jsx(ListTitle, {
|
|
36
37
|
text: list.title,
|
|
37
38
|
url: list.url
|
|
38
|
-
}), list.items.map((item) => jsx(
|
|
39
|
+
}), list.items.map((item) => item.grades ? jsx(GradesListItem, {
|
|
40
|
+
items: item.grades,
|
|
41
|
+
onItemClick: () => onItemClick == null ? void 0 : onItemClick(item.id)
|
|
42
|
+
}, item.id) : jsx(ListItem, __spreadProps(__spreadValues({}, item), {
|
|
39
43
|
onClick: () => onItemClick == null ? void 0 : onItemClick(item.id)
|
|
40
44
|
}), item.id))]
|
|
41
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-content.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/menu/segment-content.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"segment-content.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/menu/segment-content.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAY,WAAW,EAAE,MAAM,SAAS,CAAA;AAEpD,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,OAAO,EAAE,WAAW,GAAG,SAAS,CAAA;CACjC;AAED,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,mBAAmB,uCAkC3E"}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
import { ContentInner, ContentTitle, ContentGrid, ContentColumn } from "./segment-content-styled.js";
|
|
2
18
|
import { SELECTOR_IDS } from "../../../shared/constants.js";
|
|
19
|
+
import { ProlongationTitle } from "../../atoms/prolongation-title/index.js";
|
|
3
20
|
import { Scrollbar } from "../../atoms/scrollbar/index.js";
|
|
4
21
|
import { SegmentTitle } from "../../atoms/segment-title/index.js";
|
|
5
22
|
import { List } from "../list/index.js";
|
|
@@ -19,12 +36,12 @@ function SegmentContent({
|
|
|
19
36
|
}
|
|
20
37
|
return jsx(Scrollbar, {
|
|
21
38
|
children: jsxs(ContentInner, {
|
|
22
|
-
children: [
|
|
23
|
-
children: jsx(SegmentTitle, {
|
|
39
|
+
children: [jsxs(ContentTitle, {
|
|
40
|
+
children: [jsx(SegmentTitle, {
|
|
24
41
|
id: SELECTOR_IDS.SEGMENT_CONTENT_TITLE,
|
|
25
42
|
text: segment.innerTitle,
|
|
26
43
|
url: (_b = segment.innerTitleUrl) != null ? _b : segment.url
|
|
27
|
-
})
|
|
44
|
+
}), segment.prolongation && jsx(ProlongationTitle, __spreadValues({}, segment.prolongation))]
|
|
28
45
|
}), jsx(ContentGrid, {
|
|
29
46
|
id: SELECTOR_IDS.SEGMENT_CONTENT,
|
|
30
47
|
children: columns.map((column, index) => jsx(ContentColumn, {
|
|
@@ -2,6 +2,14 @@ import type { IconName } from '@foxford/ui';
|
|
|
2
2
|
export interface MenuListItemData {
|
|
3
3
|
bold?: boolean;
|
|
4
4
|
description?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Пункт рисуется списком классов в две колонки, а не одной ссылкой. Бэкенд отдаёт его
|
|
7
|
+
* шаблоном адреса, разворачивает шаблон адаптер — вёрстка получает готовые ссылки.
|
|
8
|
+
*/
|
|
9
|
+
grades?: {
|
|
10
|
+
title: string;
|
|
11
|
+
url: string;
|
|
12
|
+
}[];
|
|
5
13
|
icon?: IconName;
|
|
6
14
|
id: string;
|
|
7
15
|
title?: string;
|
|
@@ -26,6 +34,16 @@ export interface MenuSegment {
|
|
|
26
34
|
innerTitle: string;
|
|
27
35
|
innerTitleUrl?: string;
|
|
28
36
|
lists: MenuList[];
|
|
37
|
+
/**
|
|
38
|
+
* Предложение продлить договор домашней школы — строкой под заголовком раздела. Ставит его на
|
|
39
|
+
* нужный сегмент адаптер: правило собирается из полей пользователя и окна дат, и вёрстка ни
|
|
40
|
+
* пользователя, ни адресов Фоксфорда не знает.
|
|
41
|
+
*/
|
|
42
|
+
prolongation?: {
|
|
43
|
+
discount: number;
|
|
44
|
+
url: string;
|
|
45
|
+
yearName: string;
|
|
46
|
+
};
|
|
29
47
|
title: string;
|
|
30
48
|
url: string;
|
|
31
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,QAAQ,GAChB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpH,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACzC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,QAAQ,GAChB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpH,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SupportButtonProps } from './types';
|
|
2
|
+
export type { SupportButtonProps, SupportContacts } from './types';
|
|
3
|
+
export declare function SupportButtonDesktop({ contacts, onOpen, phone, showIndicator }: SupportButtonProps): import("preact").JSX.Element;
|
|
4
|
+
export declare function SupportButtonTablet({ contacts, onOpen, phone, showIndicator }: SupportButtonProps): import("preact").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/support-button/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAGjD,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAwClE,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAqB,EAAE,EAAE,kBAAkB,gCAqB1G;AAED,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAqB,EAAE,EAAE,kBAAkB,gCA2BzG"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Button, Icon, Indicator } from "@foxford/ui";
|
|
3
|
+
import { Root, TabletRoot, TabletButton, IndicatorRoot } from "./styled.js";
|
|
4
|
+
import { SupportTheme } from "./theme.js";
|
|
5
|
+
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
6
|
+
function OpenIndicator() {
|
|
7
|
+
return jsx(IndicatorRoot, {
|
|
8
|
+
children: jsx(Indicator, {
|
|
9
|
+
pulse: true,
|
|
10
|
+
secondary: true
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function useSupportModal(onOpen) {
|
|
15
|
+
const [Modal, setModal] = useState(null);
|
|
16
|
+
const [open, setOpen] = useState(false);
|
|
17
|
+
return {
|
|
18
|
+
Modal,
|
|
19
|
+
close: () => setOpen(false),
|
|
20
|
+
handleClick: () => {
|
|
21
|
+
setOpen(true);
|
|
22
|
+
onOpen == null ? void 0 : onOpen();
|
|
23
|
+
if (Modal === null) {
|
|
24
|
+
void import("./modal.js").then((module) => setModal(() => module.SupportModal));
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
open
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function SupportButtonDesktop({
|
|
31
|
+
contacts,
|
|
32
|
+
onOpen,
|
|
33
|
+
phone,
|
|
34
|
+
showIndicator = false
|
|
35
|
+
}) {
|
|
36
|
+
const {
|
|
37
|
+
close,
|
|
38
|
+
handleClick,
|
|
39
|
+
Modal,
|
|
40
|
+
open
|
|
41
|
+
} = useSupportModal(onOpen);
|
|
42
|
+
return jsx(SupportTheme, {
|
|
43
|
+
children: jsxs(Root, {
|
|
44
|
+
children: [jsx(Button, {
|
|
45
|
+
base: true,
|
|
46
|
+
icon: "messageCircleQuestion",
|
|
47
|
+
iconProps: {
|
|
48
|
+
color: "content-oncolor-inverse"
|
|
49
|
+
},
|
|
50
|
+
onClick: handleClick,
|
|
51
|
+
palette: {
|
|
52
|
+
backgroundColor: "bg-onmain-main"
|
|
53
|
+
},
|
|
54
|
+
preset: "brand",
|
|
55
|
+
round: true,
|
|
56
|
+
size: "s"
|
|
57
|
+
}), showIndicator && jsx(OpenIndicator, {}), Modal !== null && jsx(Modal, {
|
|
58
|
+
contacts,
|
|
59
|
+
onClose: close,
|
|
60
|
+
open,
|
|
61
|
+
phone
|
|
62
|
+
})]
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function SupportButtonTablet({
|
|
67
|
+
contacts,
|
|
68
|
+
onOpen,
|
|
69
|
+
phone,
|
|
70
|
+
showIndicator = false
|
|
71
|
+
}) {
|
|
72
|
+
const {
|
|
73
|
+
close,
|
|
74
|
+
handleClick,
|
|
75
|
+
Modal,
|
|
76
|
+
open
|
|
77
|
+
} = useSupportModal(onOpen);
|
|
78
|
+
return jsx(SupportTheme, {
|
|
79
|
+
children: jsxs(TabletRoot, {
|
|
80
|
+
children: [jsx(TabletButton, {
|
|
81
|
+
icon: jsxs(Fragment, {
|
|
82
|
+
children: [jsx(Icon, {
|
|
83
|
+
name: "messageCircleQuestion",
|
|
84
|
+
size: 20
|
|
85
|
+
}), showIndicator && jsx(OpenIndicator, {})]
|
|
86
|
+
}),
|
|
87
|
+
onClick: handleClick,
|
|
88
|
+
palette: {
|
|
89
|
+
backgroundColorActive: "transparent",
|
|
90
|
+
backgroundColorHover: "transparent",
|
|
91
|
+
color: "mineShaft",
|
|
92
|
+
colorActive: "accent",
|
|
93
|
+
colorHover: "accent"
|
|
94
|
+
},
|
|
95
|
+
size: "s"
|
|
96
|
+
}), Modal !== null && jsx(Modal, {
|
|
97
|
+
contacts,
|
|
98
|
+
onClose: close,
|
|
99
|
+
open,
|
|
100
|
+
phone
|
|
101
|
+
})]
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
SupportButtonDesktop,
|
|
107
|
+
SupportButtonTablet
|
|
108
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SupportContacts } from './types';
|
|
2
|
+
export interface SupportModalProps {
|
|
3
|
+
contacts?: SupportContacts;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
open: boolean;
|
|
6
|
+
phone?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function SupportModal({ contacts, onClose, open, phone }: SupportModalProps): import("preact").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/support-button/modal.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAa,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,iBAAiB,gCA8DtF"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { Button, Text, IconButton } from "@foxford/ui";
|
|
21
|
+
import { SupportDialog, ModalFooter, SocialButtons } from "./styled.js";
|
|
22
|
+
import { formatPhone } from "../../../shared/phone.js";
|
|
23
|
+
import { BASE_ZINDEX } from "../../../shared/z-index.js";
|
|
24
|
+
import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
|
|
25
|
+
const KNOWLEDGE_BASE_URL = "/knowledgebase/main";
|
|
26
|
+
function SupportModal({
|
|
27
|
+
contacts = {},
|
|
28
|
+
onClose,
|
|
29
|
+
open,
|
|
30
|
+
phone
|
|
31
|
+
}) {
|
|
32
|
+
const socials = [{
|
|
33
|
+
href: contacts.telegram,
|
|
34
|
+
icon: "telegramSocial",
|
|
35
|
+
id: "telegram"
|
|
36
|
+
}, {
|
|
37
|
+
href: contacts.max,
|
|
38
|
+
icon: "maxSocial",
|
|
39
|
+
id: "max"
|
|
40
|
+
}, {
|
|
41
|
+
href: contacts.vkontakte,
|
|
42
|
+
icon: "vkSocial",
|
|
43
|
+
id: "vkontakte"
|
|
44
|
+
}, contacts.email === void 0 || contacts.email === "" ? {
|
|
45
|
+
href: void 0,
|
|
46
|
+
icon: "mailFill",
|
|
47
|
+
id: "email"
|
|
48
|
+
} : {
|
|
49
|
+
href: `mailto:${contacts.email}`,
|
|
50
|
+
icon: "mailFill",
|
|
51
|
+
id: "email"
|
|
52
|
+
}].flatMap((social) => social.href === void 0 || social.href === "" ? [] : [__spreadProps(__spreadValues({}, social), {
|
|
53
|
+
href: social.href
|
|
54
|
+
})]);
|
|
55
|
+
return jsxs(SupportDialog, {
|
|
56
|
+
zIndex: BASE_ZINDEX.MODAL,
|
|
57
|
+
closeButton: (props) => jsx(IconButton, __spreadProps(__spreadValues({}, props), {
|
|
58
|
+
icon: "close",
|
|
59
|
+
onClick: onClose
|
|
60
|
+
})),
|
|
61
|
+
onRequestClose: onClose,
|
|
62
|
+
open,
|
|
63
|
+
positionS: "bottom-center",
|
|
64
|
+
shouldCloseOnOverlayClick: true,
|
|
65
|
+
size: "l",
|
|
66
|
+
sizes: {
|
|
67
|
+
l: {
|
|
68
|
+
maxWidth: 440
|
|
69
|
+
},
|
|
70
|
+
xs: {
|
|
71
|
+
borderRadius: "20px 20px 0 0",
|
|
72
|
+
maxWidth: "100%",
|
|
73
|
+
width: "100%"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
sizeS: "xs",
|
|
77
|
+
subtitle: (props) => jsx(Text, __spreadProps(__spreadValues({}, props), {
|
|
78
|
+
size: 16,
|
|
79
|
+
sizeS: 14,
|
|
80
|
+
children: "Собрали ответы на частые вопросы по обучению в одном разделе"
|
|
81
|
+
})),
|
|
82
|
+
title: (props) => jsx(Text, __spreadProps(__spreadValues({}, props), {
|
|
83
|
+
fontFamily: "TT Foxford, sans-serif",
|
|
84
|
+
size: 20,
|
|
85
|
+
sizeS: 18,
|
|
86
|
+
children: "Нужна помощь?"
|
|
87
|
+
})),
|
|
88
|
+
children: [jsx(Button, {
|
|
89
|
+
fluid: true,
|
|
90
|
+
icon: "textNote",
|
|
91
|
+
primary: true,
|
|
92
|
+
size: "l",
|
|
93
|
+
target: "_blank",
|
|
94
|
+
textProps: {
|
|
95
|
+
weight: "normal"
|
|
96
|
+
},
|
|
97
|
+
to: KNOWLEDGE_BASE_URL,
|
|
98
|
+
children: "База знаний"
|
|
99
|
+
}), jsxs(ModalFooter, {
|
|
100
|
+
children: [jsx(Text, {
|
|
101
|
+
marginBottom: 12,
|
|
102
|
+
size: 14,
|
|
103
|
+
children: phone === void 0 || phone === "" ? jsx(Fragment, {
|
|
104
|
+
children: "Не нашли ответ? Напишите в поддержку"
|
|
105
|
+
}) : jsxs(Fragment, {
|
|
106
|
+
children: ["Не нашли ответ? Позвоните по телефону ", formatPhone(phone), " или напишите в поддержку"]
|
|
107
|
+
})
|
|
108
|
+
}), jsx(SocialButtons, {
|
|
109
|
+
children: socials.map((social) => jsx(Button, {
|
|
110
|
+
href: social.href,
|
|
111
|
+
icon: social.icon,
|
|
112
|
+
outline: true,
|
|
113
|
+
size: "l",
|
|
114
|
+
target: "_blank"
|
|
115
|
+
}, social.id))
|
|
116
|
+
})]
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export {
|
|
121
|
+
SupportModal
|
|
122
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const Root: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("preact").JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
2
|
+
style?: string | import("styled-components/dist/types").CSSPropertiesWithVars | import("preact").JSX.CSSProperties | import("preact").JSX.SignalLike<string | import("preact").JSX.CSSProperties | undefined> | undefined;
|
|
3
|
+
}> & string;
|
|
4
|
+
export declare const TabletRoot: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("styled-components").FastOmit<Omit<import("preact").JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
5
|
+
style?: string | import("styled-components/dist/types").CSSPropertiesWithVars | import("preact").JSX.CSSProperties | import("preact").JSX.SignalLike<string | import("preact").JSX.CSSProperties | undefined> | undefined;
|
|
6
|
+
}, "as" | "forwardedAs"> & {
|
|
7
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
8
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
9
|
+
}, "style"> & {
|
|
10
|
+
style?: string | import("styled-components/dist/types").CSSPropertiesWithVars | import("preact").JSX.CSSProperties | import("preact").JSX.SignalLike<string | import("preact").JSX.CSSProperties | undefined> | (import("styled-components").CSSProperties & {
|
|
11
|
+
[key: `--${string}`]: string | number | undefined;
|
|
12
|
+
}) | undefined;
|
|
13
|
+
}> & string;
|
|
14
|
+
export declare const TabletButton: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("@foxford/ui").IconButtonProps, "style"> & {
|
|
15
|
+
style?: string | import("styled-components/dist/types").CSSPropertiesWithVars | import("preact").JSX.CSSProperties | import("preact").JSX.SignalLike<string | import("preact").JSX.CSSProperties | undefined> | undefined;
|
|
16
|
+
}> & string & Omit<import("react-dom/src").ForwardRefExoticComponent<import("@foxford/ui").IconButtonProps>, keyof import("preact").Component<any, {}>>;
|
|
17
|
+
export declare const IndicatorRoot: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("preact").JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
18
|
+
style?: string | import("styled-components/dist/types").CSSPropertiesWithVars | import("preact").JSX.CSSProperties | import("preact").JSX.SignalLike<string | import("preact").JSX.CSSProperties | undefined> | undefined;
|
|
19
|
+
}> & string;
|
|
20
|
+
export declare const ModalFooter: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("preact").JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
21
|
+
style?: string | import("styled-components/dist/types").CSSPropertiesWithVars | import("preact").JSX.CSSProperties | import("preact").JSX.SignalLike<string | import("preact").JSX.CSSProperties | undefined> | undefined;
|
|
22
|
+
}> & string;
|
|
23
|
+
export declare const SocialButtons: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("preact").JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
24
|
+
style?: string | import("styled-components/dist/types").CSSPropertiesWithVars | import("preact").JSX.CSSProperties | import("preact").JSX.SignalLike<string | import("preact").JSX.CSSProperties | undefined> | undefined;
|
|
25
|
+
}> & string;
|
|
26
|
+
export declare const SupportDialog: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("@foxford/ui").DialogProps, "style"> & {
|
|
27
|
+
style?: string | import("styled-components/dist/types").CSSPropertiesWithVars | import("preact").JSX.CSSProperties | import("preact").JSX.SignalLike<string | import("preact").JSX.CSSProperties | undefined> | undefined;
|
|
28
|
+
}> & string & Omit<import("react-dom/src").ForwardRefExoticComponent<import("@foxford/ui").DialogProps> & {
|
|
29
|
+
Component: import("react-dom/src").ForwardRefExoticComponent<import("@foxford/ui").DialogComponentProps>;
|
|
30
|
+
}, keyof import("preact").Component<any, {}>>;
|
|
31
|
+
//# sourceMappingURL=styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/support-button/styled.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI;;WAEhB,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;;;;WAEtB,CAAA;AAED,eAAO,MAAM,YAAY;;uJAExB,CAAA;AAED,eAAO,MAAM,aAAa;;WAIzB,CAAA;AAED,eAAO,MAAM,WAAW;;WAIvB,CAAA;AAED,eAAO,MAAM,aAAa;;WAGzB,CAAA;AAQD,eAAO,MAAM,aAAa;;;;6CAEzB,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { styled } from "styled-components";
|
|
2
|
+
import { IconButton, Dialog } from "@foxford/ui";
|
|
3
|
+
const Root = styled.div.withConfig({
|
|
4
|
+
displayName: "styled__Root",
|
|
5
|
+
componentId: "sc-mwa5sc-0"
|
|
6
|
+
})(["position:relative;"]);
|
|
7
|
+
const TabletRoot = styled(Root).withConfig({
|
|
8
|
+
displayName: "styled__TabletRoot",
|
|
9
|
+
componentId: "sc-mwa5sc-1"
|
|
10
|
+
})(["display:flex;"]);
|
|
11
|
+
const TabletButton = styled(IconButton).withConfig({
|
|
12
|
+
displayName: "styled__TabletButton",
|
|
13
|
+
componentId: "sc-mwa5sc-2"
|
|
14
|
+
})(["box-sizing:content-box;"]);
|
|
15
|
+
const IndicatorRoot = styled.div.withConfig({
|
|
16
|
+
displayName: "styled__IndicatorRoot",
|
|
17
|
+
componentId: "sc-mwa5sc-3"
|
|
18
|
+
})(["position:absolute;top:-5px;right:2px;"]);
|
|
19
|
+
const ModalFooter = styled.div.withConfig({
|
|
20
|
+
displayName: "styled__ModalFooter",
|
|
21
|
+
componentId: "sc-mwa5sc-4"
|
|
22
|
+
})(["margin-top:20px;border-top:1px solid ", ";padding-top:16px;"], ({
|
|
23
|
+
theme
|
|
24
|
+
}) => theme.colors["border-onmain-soft-large"]);
|
|
25
|
+
const SocialButtons = styled.div.withConfig({
|
|
26
|
+
displayName: "styled__SocialButtons",
|
|
27
|
+
componentId: "sc-mwa5sc-5"
|
|
28
|
+
})(["display:flex;justify-content:space-between;"]);
|
|
29
|
+
const SupportDialog = styled(Dialog).withConfig({
|
|
30
|
+
displayName: "styled__SupportDialog",
|
|
31
|
+
componentId: "sc-mwa5sc-6"
|
|
32
|
+
})(["font-family:", ";"], ({
|
|
33
|
+
theme
|
|
34
|
+
}) => theme.fonts.primary);
|
|
35
|
+
export {
|
|
36
|
+
IndicatorRoot,
|
|
37
|
+
ModalFooter,
|
|
38
|
+
Root,
|
|
39
|
+
SocialButtons,
|
|
40
|
+
SupportDialog,
|
|
41
|
+
TabletButton,
|
|
42
|
+
TabletRoot
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/support-button/theme.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAsBtC,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,gCAIjE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { ThemeProvider, useTheme } from "styled-components";
|
|
21
|
+
import { foxfordDayTheme } from "@foxford/ui";
|
|
22
|
+
import { jsx } from "preact/jsx-runtime";
|
|
23
|
+
function toDayTheme(current) {
|
|
24
|
+
const day = foxfordDayTheme;
|
|
25
|
+
return __spreadProps(__spreadValues(__spreadValues({}, current), day), {
|
|
26
|
+
colors: __spreadValues(__spreadValues({}, current.colors), day.colors),
|
|
27
|
+
components: current.components
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function SupportTheme({
|
|
31
|
+
children
|
|
32
|
+
}) {
|
|
33
|
+
return jsx(ThemeProvider, {
|
|
34
|
+
theme: toDayTheme(useTheme()),
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
SupportTheme
|
|
40
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SupportContacts {
|
|
2
|
+
email?: string;
|
|
3
|
+
max?: string;
|
|
4
|
+
telegram?: string;
|
|
5
|
+
vkontakte?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SupportButtonProps {
|
|
8
|
+
/** Чаты и почта поддержки — кнопки в подвале модалки; пустые не рисуются. */
|
|
9
|
+
contacts?: SupportContacts;
|
|
10
|
+
/**
|
|
11
|
+
* Открытие кнопки. Побочные эффекты легаси — отправка аналитики и пометка настройки
|
|
12
|
+
* `supportButtonIndicatorHidden` — принадлежат рантайму: вёрстка о них не знает.
|
|
13
|
+
*/
|
|
14
|
+
onOpen?: () => void;
|
|
15
|
+
/** Телефон поддержки в тексте модалки; не передан — предложение позвонить не рисуется. */
|
|
16
|
+
phone?: string;
|
|
17
|
+
/** Точка у кнопки: посетитель ещё ни разу её не открывал. */
|
|
18
|
+
showIndicator?: boolean;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/header/molecules/support-button/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,0FAA0F;IAC1F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6DAA6D;IAC7D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB"}
|