@gravity-ui/page-constructor 1.26.0-alpha.2 → 2.0.0-alpha.0

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 (123) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/cjs/blocks/Header/Header.js +2 -5
  3. package/build/cjs/blocks/Icons/Icons.js +1 -1
  4. package/build/cjs/blocks/Map/schema.d.ts +0 -12
  5. package/build/cjs/blocks/Share/Share.js +1 -2
  6. package/build/cjs/components/BackLink/BackLink.js +1 -2
  7. package/build/cjs/components/Button/Button.js +1 -2
  8. package/build/cjs/components/FileLink/FileLink.js +1 -2
  9. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -2
  10. package/build/cjs/components/Link/Link.js +1 -2
  11. package/build/cjs/components/Map/GoogleMap.js +7 -5
  12. package/build/cjs/components/Map/Map.css +5 -0
  13. package/build/cjs/components/Map/YMap/YMap.d.ts +4 -2
  14. package/build/cjs/components/Map/YMap/YMap.js +18 -10
  15. package/build/cjs/components/Map/YMap/YandexMap.js +18 -9
  16. package/build/cjs/components/Title/Title.js +1 -2
  17. package/build/cjs/components/index.d.ts +0 -1
  18. package/build/cjs/components/index.js +1 -3
  19. package/build/cjs/constructor-items.d.ts +0 -1
  20. package/build/cjs/constructor-items.js +0 -1
  21. package/build/cjs/models/constructor-items/common.d.ts +0 -79
  22. package/build/cjs/models/constructor-items/common.js +1 -14
  23. package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -6
  24. package/build/cjs/models/constructor-items/sub-blocks.js +0 -1
  25. package/build/cjs/navigation/components/NavigationItem/components/GithubButton/GithubButton.js +1 -2
  26. package/build/cjs/navigation/components/SocialIcon/SocialIcon.js +1 -1
  27. package/build/cjs/schema/index.js +1 -3
  28. package/build/cjs/schema/validators/common.d.ts +0 -6
  29. package/build/cjs/schema/validators/common.js +0 -4
  30. package/build/cjs/schema/validators/sub-blocks.d.ts +0 -1
  31. package/build/cjs/schema/validators/sub-blocks.js +0 -1
  32. package/build/cjs/sub-blocks/Quote/Quote.js +1 -1
  33. package/build/cjs/sub-blocks/index.d.ts +0 -1
  34. package/build/cjs/sub-blocks/index.js +1 -3
  35. package/build/cjs/text-transform/blocks.js +0 -27
  36. package/build/esm/blocks/Header/Header.js +3 -6
  37. package/build/esm/blocks/Icons/Icons.js +2 -2
  38. package/build/esm/blocks/Map/schema.d.ts +0 -12
  39. package/build/esm/blocks/Share/Share.js +1 -2
  40. package/build/esm/components/BackLink/BackLink.js +1 -2
  41. package/build/esm/components/Button/Button.js +1 -2
  42. package/build/esm/components/FileLink/FileLink.js +1 -2
  43. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -2
  44. package/build/esm/components/Link/Link.js +1 -2
  45. package/build/esm/components/Map/GoogleMap.js +7 -5
  46. package/build/esm/components/Map/Map.css +5 -0
  47. package/build/esm/components/Map/YMap/YMap.d.ts +4 -2
  48. package/build/esm/components/Map/YMap/YMap.js +18 -10
  49. package/build/esm/components/Map/YMap/YandexMap.js +18 -9
  50. package/build/esm/components/Title/Title.js +1 -2
  51. package/build/esm/components/index.d.ts +0 -1
  52. package/build/esm/components/index.js +0 -1
  53. package/build/esm/constructor-items.d.ts +0 -1
  54. package/build/esm/constructor-items.js +1 -2
  55. package/build/esm/models/constructor-items/common.d.ts +0 -79
  56. package/build/esm/models/constructor-items/common.js +0 -13
  57. package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -6
  58. package/build/esm/models/constructor-items/sub-blocks.js +0 -1
  59. package/build/esm/navigation/components/NavigationItem/components/GithubButton/GithubButton.js +1 -2
  60. package/build/esm/navigation/components/SocialIcon/SocialIcon.js +2 -2
  61. package/build/esm/schema/index.js +2 -4
  62. package/build/esm/schema/validators/common.d.ts +0 -6
  63. package/build/esm/schema/validators/common.js +0 -4
  64. package/build/esm/schema/validators/sub-blocks.d.ts +0 -1
  65. package/build/esm/schema/validators/sub-blocks.js +0 -1
  66. package/build/esm/sub-blocks/Quote/Quote.js +2 -2
  67. package/build/esm/sub-blocks/index.d.ts +0 -1
  68. package/build/esm/sub-blocks/index.js +0 -1
  69. package/build/esm/text-transform/blocks.js +0 -27
  70. package/package.json +10 -6
  71. package/server/models/constructor-items/common.d.ts +0 -79
  72. package/server/models/constructor-items/common.js +1 -14
  73. package/server/models/constructor-items/sub-blocks.d.ts +2 -6
  74. package/server/models/constructor-items/sub-blocks.js +0 -1
  75. package/server/text-transform/blocks.js +0 -27
  76. package/build/cjs/components/LinkBase/LinkBase.d.ts +0 -3
  77. package/build/cjs/components/LinkBase/LinkBase.js +0 -18
  78. package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.css +0 -35
  79. package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +0 -12
  80. package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +0 -60
  81. package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.css +0 -62
  82. package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.d.ts +0 -10
  83. package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js +0 -54
  84. package/build/cjs/sub-blocks/PriceDetailed/PriceDetailed.d.ts +0 -3
  85. package/build/cjs/sub-blocks/PriceDetailed/PriceDetailed.js +0 -22
  86. package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/List.css +0 -11
  87. package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/List.d.ts +0 -7
  88. package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/List.js +0 -15
  89. package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.css +0 -20
  90. package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.d.ts +0 -8
  91. package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.js +0 -15
  92. package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.css +0 -43
  93. package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.d.ts +0 -11
  94. package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.js +0 -56
  95. package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.css +0 -9
  96. package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.d.ts +0 -10
  97. package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +0 -15
  98. package/build/cjs/sub-blocks/PriceDetailed/schema.d.ts +0 -93
  99. package/build/cjs/sub-blocks/PriceDetailed/schema.js +0 -155
  100. package/build/esm/components/LinkBase/LinkBase.d.ts +0 -3
  101. package/build/esm/components/LinkBase/LinkBase.js +0 -16
  102. package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.css +0 -35
  103. package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +0 -13
  104. package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +0 -58
  105. package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.css +0 -62
  106. package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.d.ts +0 -11
  107. package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js +0 -52
  108. package/build/esm/sub-blocks/PriceDetailed/PriceDetailed.d.ts +0 -3
  109. package/build/esm/sub-blocks/PriceDetailed/PriceDetailed.js +0 -19
  110. package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/List.css +0 -11
  111. package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/List.d.ts +0 -8
  112. package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/List.js +0 -13
  113. package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.css +0 -20
  114. package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.d.ts +0 -9
  115. package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.js +0 -13
  116. package/build/esm/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.css +0 -43
  117. package/build/esm/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.d.ts +0 -12
  118. package/build/esm/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.js +0 -54
  119. package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.css +0 -9
  120. package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.d.ts +0 -11
  121. package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +0 -13
  122. package/build/esm/sub-blocks/PriceDetailed/schema.d.ts +0 -93
  123. package/build/esm/sub-blocks/PriceDetailed/schema.js +0 -152
@@ -1,155 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PriceDetailedBlock = void 0;
4
- const common_1 = require("../../schema/validators/common");
5
- const utils_1 = require("../../schema/validators/utils");
6
- const PriceDetailedDetailsType = ['marked-list', 'settings'];
7
- const PriceDetailedDescriptionColor = ['cornflower', 'black'];
8
- const PriceLabelColor = ['blue', 'green', 'yellow', 'purple', 'red'];
9
- const LabelsDefaultTextProp = PriceLabelColor.reduce((result, labelColor) => {
10
- return Object.assign(Object.assign({}, result), { [labelColor]: {
11
- type: 'string',
12
- } });
13
- }, {});
14
- const PriceDetailedLabelsDefaultTextProps = {
15
- additionalProperties: false,
16
- required: [],
17
- properties: LabelsDefaultTextProp,
18
- };
19
- const PriceDetailedFoldableDetailsProps = {
20
- additionalProperties: false,
21
- required: ['title'],
22
- properties: {
23
- title: {
24
- type: 'string',
25
- contentType: 'text',
26
- },
27
- size: {
28
- type: 'string',
29
- enum: common_1.textSize,
30
- },
31
- titleColor: {
32
- type: 'string',
33
- enum: PriceDetailedDescriptionColor,
34
- },
35
- },
36
- };
37
- const PriceDetailedDetailsProps = {
38
- additionalProperties: false,
39
- required: [],
40
- properties: {
41
- titleSize: {
42
- type: 'string',
43
- enum: common_1.textSize,
44
- },
45
- descriptionSize: {
46
- type: 'string',
47
- enum: common_1.textSize,
48
- },
49
- },
50
- };
51
- const PriceDetailedDescriptionProps = {
52
- additionalProperties: false,
53
- required: [],
54
- properties: {
55
- titleSize: {
56
- type: 'string',
57
- enum: common_1.textSize,
58
- },
59
- descriptionSize: {
60
- type: 'string',
61
- enum: common_1.textSize,
62
- },
63
- titleColor: {
64
- type: 'string',
65
- enum: PriceDetailedDescriptionColor,
66
- },
67
- },
68
- };
69
- const PriceDescriptionLabelProps = {
70
- additionalProperties: false,
71
- required: ['color'],
72
- properties: {
73
- color: {
74
- type: 'string',
75
- enum: PriceLabelColor,
76
- },
77
- text: {
78
- type: 'string',
79
- contentType: 'text',
80
- },
81
- size: {
82
- type: 'string',
83
- enum: common_1.textSize,
84
- },
85
- },
86
- };
87
- const PriceDescriptionProps = {
88
- title: {
89
- type: 'string',
90
- contentType: 'text',
91
- },
92
- description: {
93
- type: 'string',
94
- contentType: 'yfm',
95
- },
96
- detailedTitle: {
97
- type: 'string',
98
- contentType: 'text',
99
- },
100
- label: PriceDescriptionLabelProps,
101
- };
102
- const PriceDetailsSettingsProps = {
103
- type: 'object',
104
- additionalProperties: false,
105
- required: ['title', 'description'],
106
- properties: {
107
- title: {
108
- type: 'string',
109
- contentType: 'text',
110
- },
111
- description: {
112
- type: 'string',
113
- contentType: 'yfm',
114
- },
115
- },
116
- };
117
- const PriceDetailsListProps = {
118
- type: 'object',
119
- additionalProperties: false,
120
- required: ['text'],
121
- properties: {
122
- text: {
123
- type: 'string',
124
- contentType: 'yfm',
125
- },
126
- },
127
- };
128
- const PriceDetailsProps = {
129
- items: {
130
- anyOf: [(0, utils_1.filteredArray)(PriceDetailsListProps), (0, utils_1.filteredArray)(PriceDetailsSettingsProps)],
131
- },
132
- };
133
- const PriceItem = {
134
- type: 'object',
135
- additionalProperties: false,
136
- required: ['title', 'description'],
137
- properties: Object.assign(Object.assign({}, PriceDetailsProps), PriceDescriptionProps),
138
- };
139
- exports.PriceDetailedBlock = {
140
- 'price-detailed': {
141
- additionalProperties: false,
142
- required: ['items'],
143
- properties: Object.assign(Object.assign(Object.assign({}, common_1.BaseProps), common_1.AnimatableProps), { items: (0, utils_1.filteredArray)(PriceItem), description: PriceDetailedDescriptionProps, details: PriceDetailedDetailsProps, priceType: {
144
- type: 'string',
145
- enum: PriceDetailedDetailsType,
146
- }, numberGroupItems: {
147
- type: 'number',
148
- enum: [3, 4, 5],
149
- }, isCombined: {
150
- type: 'boolean',
151
- }, useMixedView: {
152
- type: 'boolean',
153
- }, foldable: PriceDetailedFoldableDetailsProps, labelsDefaultText: PriceDetailedLabelsDefaultTextProps }),
154
- },
155
- };
@@ -1,3 +0,0 @@
1
- import { LinkBaseProps, WithChildren } from '../../models';
2
- declare const LinkBase: (props: WithChildren<LinkBaseProps>) => JSX.Element;
3
- export default LinkBase;
@@ -1,16 +0,0 @@
1
- import { __rest } from "tslib";
2
- import React, { useContext } from 'react';
3
- import { omit } from 'lodash';
4
- import { LocationContext } from '../../context/locationContext';
5
- import RouterLink from '../RouterLink/RouterLink';
6
- const LinkBase = (props) => {
7
- const { href, children } = props, linkProps = __rest(props, ["href", "children"]);
8
- const { Link } = useContext(LocationContext);
9
- if (Link && href && !(linkProps === null || linkProps === void 0 ? void 0 : linkProps.target)) {
10
- const extractedProps = omit(linkProps, ['rel', 'ref']);
11
- return (React.createElement(RouterLink, { href: href },
12
- React.createElement("a", Object.assign({}, extractedProps), children)));
13
- }
14
- return (React.createElement("a", Object.assign({ href: href }, linkProps), children));
15
- };
16
- export default LinkBase;
@@ -1,35 +0,0 @@
1
- /* use this for style redefinitions to awoid problems with
2
- unpredictable css rules order in build */
3
- .pc-combined-price-detailed-block__row {
4
- /* stylelint-disable declaration-no-important */
5
- margin: 0 !important;
6
- }
7
- .pc-combined-price-detailed-block__row .col {
8
- padding: 0;
9
- margin: 12px;
10
- }
11
- .pc-combined-price-detailed-block__row > * {
12
- display: flex;
13
- width: 100%;
14
- }
15
- .pc-combined-price-detailed-block__row:not(:last-child) {
16
- border-bottom: 1px solid var(--yc-color-line-generic);
17
- margin-bottom: 12px !important;
18
- padding-bottom: 12px;
19
- }
20
- @media (min-width: 1081px) {
21
- .pc-combined-price-detailed-block__description > * {
22
- padding-top: 12px;
23
- }
24
- .pc-combined-price-detailed-block__description_delimiter > * {
25
- border-top: 1px solid var(--yc-color-line-generic);
26
- }
27
- .pc-combined-price-detailed-block__empty-column {
28
- border-top: 0;
29
- }
30
- }
31
- @media (max-width: 1080px) {
32
- .pc-combined-price-detailed-block__description > * {
33
- margin-top: 0 !important;
34
- }
35
- }
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { CardBorder, PriceDescriptionProps, PriceDetailsListProps, PriceDetailsSettingsProps, PriceItemProps } from '../../../models';
3
- import './CombinedPriceDetailed.css';
4
- interface CombinedPriceDetailedProps {
5
- items: PriceItemProps[];
6
- numberGroupItems: number;
7
- useMixedView?: boolean;
8
- getDescriptionComponent: (priceDescription: PriceDescriptionProps) => JSX.Element;
9
- getDetailsComponent: (priceDetails?: PriceDetailsSettingsProps[] | PriceDetailsListProps[]) => JSX.Element;
10
- border?: CardBorder;
11
- }
12
- declare const CombinedPriceDetailed: (props: CombinedPriceDetailedProps) => JSX.Element;
13
- export default CombinedPriceDetailed;
@@ -1,58 +0,0 @@
1
- import _ from 'lodash';
2
- import React, { Fragment, useCallback, useEffect, useState } from 'react';
3
- import { block } from '../../../utils';
4
- import { CardBase } from '../../../components';
5
- import { Grid, Row, Col, GridColumnSize } from '../../../grid';
6
- import { BREAKPOINTS } from '../../../constants';
7
- import './CombinedPriceDetailed.css';
8
- const b = block('combined-price-detailed-block');
9
- const CombinedPricesGroupSize = {
10
- [GridColumnSize.Sm]: 1,
11
- [GridColumnSize.Md]: 2,
12
- [GridColumnSize.Lg]: 3,
13
- };
14
- const CombinedPriceDetailed = (props) => {
15
- const { items, numberGroupItems, border, useMixedView, getDescriptionComponent, getDetailsComponent, } = props;
16
- const [groupItemsSize, setGroupItemsSize] = useState(numberGroupItems);
17
- const updateGroupItemsSize = useCallback((windowWidth) => {
18
- if (windowWidth >= BREAKPOINTS.lg) {
19
- setGroupItemsSize(numberGroupItems);
20
- }
21
- else if (BREAKPOINTS.lg > windowWidth && windowWidth >= BREAKPOINTS.md) {
22
- setGroupItemsSize(CombinedPricesGroupSize[GridColumnSize.Lg]);
23
- }
24
- else if (BREAKPOINTS.md > windowWidth && windowWidth >= BREAKPOINTS.sm) {
25
- setGroupItemsSize(CombinedPricesGroupSize[GridColumnSize.Md]);
26
- }
27
- else {
28
- setGroupItemsSize(CombinedPricesGroupSize[GridColumnSize.Sm]);
29
- }
30
- }, [numberGroupItems]);
31
- useEffect(() => {
32
- function handleResize() {
33
- updateGroupItemsSize(window.innerWidth);
34
- }
35
- handleResize();
36
- window.addEventListener('resize', handleResize);
37
- return () => window.removeEventListener('resize', handleResize);
38
- }, [updateGroupItemsSize]);
39
- const getPrice = (groupPrices) => {
40
- const descriptionComponents = Array(groupItemsSize);
41
- const detailsComponents = Array(groupItemsSize);
42
- for (let id = 0; id < groupItemsSize; id++) {
43
- const price = groupPrices[id];
44
- descriptionComponents[id] = (React.createElement(Col, { key: `card_${id}` }, price && getDescriptionComponent(price)));
45
- detailsComponents[id] = (React.createElement(Col, { key: `details_${id}`, className: price ? '' : b('empty-column') }, price && getDetailsComponent(price.items)));
46
- }
47
- return (React.createElement(Fragment, null,
48
- React.createElement("div", null, descriptionComponents),
49
- React.createElement("div", { className: b('description', { delimiter: useMixedView }) }, detailsComponents)));
50
- };
51
- const chunkedItems = _.chunk(items, groupItemsSize);
52
- return (React.createElement(CardBase, { className: b(), border: border },
53
- React.createElement(CardBase.Content, null,
54
- React.createElement(Grid, null, chunkedItems.map((chunk, id) => {
55
- return (React.createElement(Row, { key: id, className: b('row') }, getPrice(chunk)));
56
- })))));
57
- };
58
- export default CombinedPriceDetailed;
@@ -1,62 +0,0 @@
1
- /* use this for style redefinitions to awoid problems with
2
- unpredictable css rules order in build */
3
- .pc-price-description {
4
- margin-bottom: 12px;
5
- }
6
- .pc-price-description__title_size_l, .pc-price-description__description_size_l, .pc-price-description__detailed-title_size_l, .pc-price-description__label_size_l {
7
- font-size: var(--yc-text-header-1-font-size);
8
- line-height: var(--yc-text-header-1-line-height);
9
- }
10
- .pc-price-description__title_size_m, .pc-price-description__description_size_m, .pc-price-description__detailed-title_size_m, .pc-price-description__label_size_m {
11
- font-size: var(--yc-text-body-2-font-size);
12
- line-height: var(--yc-text-body-2-line-height);
13
- }
14
- .pc-price-description__title_size_s, .pc-price-description__description_size_s, .pc-price-description__detailed-title_size_s, .pc-price-description__label_size_s {
15
- font-size: var(--yc-text-body-1-font-size);
16
- line-height: var(--yc-text-body-1-line-height);
17
- }
18
- .pc-price-description__main-title {
19
- font-weight: 500;
20
- }
21
- .pc-price-description__main-title_color_cornflower {
22
- color: var(--yc-my-color-brand-normal);
23
- }
24
- .pc-price-description__main-title_color_black {
25
- color: var(--yc-color-text-primary);
26
- }
27
- .pc-price-description__title {
28
- display: flex;
29
- padding: 16px 0 12px 0;
30
- align-items: flex-end;
31
- }
32
- .pc-price-description__description {
33
- font-weight: 400;
34
- }
35
- .pc-price-description__detailed-title {
36
- margin-left: 4px;
37
- }
38
- .pc-price-description__label {
39
- padding: 4px 12px;
40
- border-radius: 4px;
41
- width: fit-content;
42
- }
43
- .pc-price-description__label_color_blue {
44
- background: var(--yc-color-promo-highlight-sky);
45
- }
46
- .pc-price-description__label_color_green {
47
- background: var(--yc-color-promo-highlight-mint);
48
- }
49
- .pc-price-description__label_color_yellow {
50
- background: var(--yc-color-promo-highlight-gold);
51
- }
52
- .pc-price-description__label_color_purple {
53
- background: var(--yc-color-promo-highlight-neon);
54
- }
55
- .pc-price-description__label_color_red {
56
- background: var(--yc-color-promo-highlight-tomato);
57
- }
58
- @media (max-width: 577px) {
59
- .pc-price-description {
60
- min-width: 160px;
61
- }
62
- }
@@ -1,11 +0,0 @@
1
- import { PriceDescriptionColor, PriceDescriptionProps, PriceLabelColor, TextSize } from '../../../models';
2
- import './PriceDescription.css';
3
- interface PriceDescriptionExtendProps extends PriceDescriptionProps {
4
- titleSize?: TextSize;
5
- descriptionSize?: TextSize;
6
- colorTitle?: PriceDescriptionColor;
7
- labelsDefaultText?: Record<PriceLabelColor, string>;
8
- className?: string;
9
- }
10
- declare const PriceDescription: (props: PriceDescriptionExtendProps) => JSX.Element;
11
- export default PriceDescription;
@@ -1,52 +0,0 @@
1
- import React, { useCallback, useContext, useEffect, useMemo } from 'react';
2
- import { block } from '../../../utils';
3
- import { StylesContext } from '../../../context/stylesContext';
4
- import { YFMWrapper } from '../../../components';
5
- import './PriceDescription.css';
6
- const b = block('price-description');
7
- const PriceDescription = (props) => {
8
- const { title, detailedTitle = '', description, titleSize = 'l', descriptionSize = 'm', colorTitle = 'cornflower', label, labelsDefaultText, className, } = props;
9
- const descriptionRef = React.useRef(null);
10
- const { pricesDetailedDescriptionHeight, setStyles } = useContext(StylesContext);
11
- const setDescriptionHeight = useCallback(() => {
12
- var _a;
13
- if (!descriptionRef || !descriptionRef.current) {
14
- return;
15
- }
16
- const descriptionChildren = (_a = descriptionRef.current) === null || _a === void 0 ? void 0 : _a.children;
17
- if (!descriptionChildren) {
18
- return;
19
- }
20
- const childrenHeight = [...descriptionChildren].reduce((result, element) => result + element.clientHeight, 0);
21
- if (pricesDetailedDescriptionHeight === undefined ||
22
- Number(pricesDetailedDescriptionHeight) < childrenHeight) {
23
- setStyles({ pricesDetailedDescriptionHeight: childrenHeight.toString() });
24
- }
25
- else if (childrenHeight < Number(pricesDetailedDescriptionHeight)) {
26
- descriptionRef.current.style.height = `${pricesDetailedDescriptionHeight}px`;
27
- }
28
- }, [pricesDetailedDescriptionHeight, setStyles]);
29
- useEffect(() => {
30
- setDescriptionHeight();
31
- window.addEventListener('resize', setDescriptionHeight);
32
- return () => window.removeEventListener('resize', setDescriptionHeight);
33
- }, [setDescriptionHeight]);
34
- const labelElement = useMemo(() => {
35
- if (!label) {
36
- return null;
37
- }
38
- const labelTitle = label.text || (labelsDefaultText && labelsDefaultText[label.color]);
39
- return (React.createElement("div", { className: b('label', { color: label.color, size: label.size || descriptionSize }) }, labelTitle));
40
- }, [descriptionSize, label, labelsDefaultText]);
41
- const titleElement = useMemo(() => {
42
- return (React.createElement("div", { className: b('title', { size: titleSize }) },
43
- React.createElement("div", { className: b('main-title', { color: colorTitle }) }, title),
44
- React.createElement("div", { className: b('detailed-title', { size: descriptionSize }) }, detailedTitle)));
45
- }, [colorTitle, descriptionSize, detailedTitle, title, titleSize]);
46
- return (React.createElement("div", { className: b(null, className), ref: descriptionRef },
47
- labelElement,
48
- titleElement,
49
- React.createElement("div", { className: b('description', { size: descriptionSize }) },
50
- React.createElement(YFMWrapper, { content: description, modifiers: { constructor: true } }))));
51
- };
52
- export default PriceDescription;
@@ -1,3 +0,0 @@
1
- import { PriceDetailedProps } from '../../models';
2
- declare const PriceDetailed: (props: PriceDetailedProps) => JSX.Element;
3
- export default PriceDetailed;
@@ -1,19 +0,0 @@
1
- import React, { Fragment } from 'react';
2
- import { PriceDetailsType, } from '../../models';
3
- import PriceDescription from './PriceDescription/PriceDescription';
4
- import PriceDetails from './PriceDetails/PriceDetails';
5
- import CombinedPriceDetailed from './CombinedPriceDetailed/CombinedPriceDetailed';
6
- import SeparatePriceDetailed from './SeparatePriceDetailed/SeparatePriceDetailed';
7
- const PriceDetailed = (props) => {
8
- const { priceType = PriceDetailsType.SETTINGS, items, numberGroupItems = 1, description, details, foldable, labelsDefaultText, isCombined = false, useMixedView = false, border, } = props;
9
- const { titleSize: descriptionTitleSize = 'l', descriptionSize = 'm', titleColor: descriptionTitleColor = 'cornflower', } = description || {};
10
- const { titleSize: detailsTitleSize = 's', descriptionSize: detailsDescriptionSize = 'm' } = details || {};
11
- const getDescriptionComponent = (priceDescription) => {
12
- return (React.createElement(PriceDescription, Object.assign({}, priceDescription, { titleSize: descriptionTitleSize, descriptionSize: descriptionSize, colorTitle: descriptionTitleColor, labelsDefaultText: labelsDefaultText })));
13
- };
14
- const getDetailsComponent = (priceDetails) => {
15
- return (React.createElement(PriceDetails, { items: priceDetails, type: priceType, foldable: foldable, titleSize: detailsTitleSize, descriptionSize: detailsDescriptionSize, useMixedView: useMixedView }));
16
- };
17
- return (React.createElement(Fragment, null, isCombined ? (React.createElement(CombinedPriceDetailed, { items: items, numberGroupItems: numberGroupItems, border: border, useMixedView: useMixedView, getDescriptionComponent: getDescriptionComponent, getDetailsComponent: getDetailsComponent })) : (React.createElement(SeparatePriceDetailed, { items: items, border: border, getDescriptionComponent: getDescriptionComponent, getDetailsComponent: getDetailsComponent }))));
18
- };
19
- export default PriceDetailed;
@@ -1,11 +0,0 @@
1
- .pc-marked-list__list-item {
2
- display: flex;
3
- }
4
- .pc-marked-list__text {
5
- margin-left: 8px;
6
- }
7
- .pc-marked-list__img {
8
- margin-top: 5px;
9
- height: fit-content;
10
- content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTMiIGhlaWdodD0iOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0xLjUgNCA1IDcuNSAxMS41IDEiIHN0cm9rZT0iIzUyODJGRiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg==");
11
- }
@@ -1,8 +0,0 @@
1
- import { PriceDetailsListProps, TextSize } from '../../../../models';
2
- import './List.css';
3
- export interface ListProps {
4
- items: PriceDetailsListProps[];
5
- titleSize?: TextSize;
6
- }
7
- declare const List: (props: ListProps) => JSX.Element;
8
- export default List;
@@ -1,13 +0,0 @@
1
- import React, { Fragment } from 'react';
2
- import { block } from '../../../../utils';
3
- import { YFMWrapper } from '../../../../components';
4
- import './List.css';
5
- const b = block('marked-list');
6
- const List = (props) => {
7
- const { items = [], titleSize = 's' } = props;
8
- return (React.createElement(Fragment, null, items.map((item, id) => (React.createElement("div", { key: id, className: b('list-item') },
9
- React.createElement("img", { className: b('img') }),
10
- React.createElement("div", { className: b('text', { size: titleSize }) },
11
- React.createElement(YFMWrapper, { content: item.text, modifiers: { constructor: true } })))))));
12
- };
13
- export default List;
@@ -1,20 +0,0 @@
1
- /* use this for style redefinitions to awoid problems with
2
- unpredictable css rules order in build */
3
- .pc-settings-list__title, .pc-settings-list__description {
4
- font-weight: 400;
5
- }
6
- .pc-settings-list__title_size_l, .pc-settings-list__description_size_l {
7
- font-size: var(--yc-text-header-1-font-size);
8
- line-height: var(--yc-text-header-1-line-height);
9
- }
10
- .pc-settings-list__title_size_m, .pc-settings-list__description_size_m {
11
- font-size: var(--yc-text-body-2-font-size);
12
- line-height: var(--yc-text-body-2-line-height);
13
- }
14
- .pc-settings-list__title_size_s, .pc-settings-list__description_size_s {
15
- font-size: var(--yc-text-body-1-font-size);
16
- line-height: var(--yc-text-body-1-line-height);
17
- }
18
- .pc-settings-list__title {
19
- color: var(--yc-color-text-hint);
20
- }
@@ -1,9 +0,0 @@
1
- import { PriceDetailsSettingsProps, TextSize } from '../../../../models';
2
- import './Settings.css';
3
- export interface SettingsComponentProps {
4
- items: PriceDetailsSettingsProps[];
5
- titleSize?: TextSize;
6
- descriptionSize?: TextSize;
7
- }
8
- declare const Settings: (props: SettingsComponentProps) => JSX.Element;
9
- export default Settings;
@@ -1,13 +0,0 @@
1
- import React, { Fragment } from 'react';
2
- import { block } from '../../../../utils';
3
- import { YFMWrapper } from '../../../../components';
4
- import './Settings.css';
5
- const b = block('settings-list');
6
- const Settings = (props) => {
7
- const { items = [], titleSize = 's', descriptionSize = 'm' } = props;
8
- return (React.createElement(Fragment, null, items.map((item, id) => (React.createElement("div", { key: id },
9
- React.createElement("div", { className: b('title', { size: titleSize }) }, item.title),
10
- React.createElement("div", { className: b('description', { size: descriptionSize }) },
11
- React.createElement(YFMWrapper, { content: item.description, modifiers: { constructor: true } })))))));
12
- };
13
- export default Settings;
@@ -1,43 +0,0 @@
1
- /* use this for style redefinitions to awoid problems with
2
- unpredictable css rules order in build */
3
- @media (min-width: 1081px) {
4
- .pc-price-details__non_foldable {
5
- display: block;
6
- }
7
- .pc-price-details__foldable {
8
- display: none;
9
- }
10
- }
11
- @media (max-width: 1080px) {
12
- .pc-price-details__non_foldable {
13
- display: none;
14
- }
15
- .pc-price-details__foldable {
16
- display: block;
17
- }
18
- }
19
- .pc-price-details__delimiter-line {
20
- border-top: 1px solid var(--yc-color-line-generic);
21
- }
22
- .pc-price-details__arrow {
23
- margin: auto 10px;
24
- }
25
- .pc-price-details__foldable_title {
26
- cursor: pointer;
27
- display: flex;
28
- font-weight: 400;
29
- font-size: var(--yc-text-body-2-font-size);
30
- line-height: var(--yc-text-body-2-line-height);
31
- }
32
- .pc-price-details__foldable_title_color_cornflower {
33
- color: var(--yc-color-text-link);
34
- }
35
- .pc-price-details__foldable_title_color_black {
36
- color: var(--yc-color-text-primary);
37
- }
38
- .pc-price-details__foldable_block > * {
39
- padding-top: 12px;
40
- }
41
- .pc-price-details .pc-settings-list__title {
42
- margin-bottom: 2px;
43
- }
@@ -1,12 +0,0 @@
1
- import { PriceDetailsType, TextSize, PriceDetailsProps, PriceFoldableDetailsProps } from '../../../models';
2
- import './PriceDetails.css';
3
- interface PriceDetailsExtendProps extends PriceDetailsProps {
4
- type: PriceDetailsType;
5
- titleSize?: TextSize;
6
- descriptionSize?: TextSize;
7
- foldable?: PriceFoldableDetailsProps;
8
- useMixedView?: boolean;
9
- className?: string;
10
- }
11
- declare const PriceDetails: (props: PriceDetailsExtendProps) => JSX.Element;
12
- export default PriceDetails;
@@ -1,54 +0,0 @@
1
- import React, { Fragment, useCallback, useState } from 'react';
2
- import { block } from '../../../utils';
3
- import { Foldable, ToggleArrow } from '../../../components';
4
- import { PriceDetailsType, } from '../../../models';
5
- import List from './Details/List';
6
- import Settings from './Details/Settings';
7
- import './PriceDetails.css';
8
- const b = block('price-details');
9
- const PriceDetails = (props) => {
10
- const [isOpened, setIsOpened] = useState(false);
11
- const toggleOpen = useCallback(() => {
12
- setIsOpened(!isOpened);
13
- }, [isOpened]);
14
- const { items = [], type = PriceDetailsType.SETTINGS, titleSize = 's', descriptionSize = 'm', foldable, useMixedView, className, } = props;
15
- const { title: foldableTitle, size: foldableSize = descriptionSize, titleColor: foldableColor = 'cornflower', } = foldable || {};
16
- const getPriceDetails = () => {
17
- switch (type) {
18
- case PriceDetailsType.MARKED_LIST:
19
- return React.createElement(List, { items: items, titleSize: titleSize });
20
- case PriceDetailsType.SETTINGS:
21
- default:
22
- return (React.createElement(Settings, { items: items, titleSize: titleSize, descriptionSize: descriptionSize }));
23
- }
24
- };
25
- const getFoldableBlock = () => {
26
- return React.createElement("div", { className: b('foldable_block') }, getPriceDetails());
27
- };
28
- const getFoldableTitle = () => {
29
- return (React.createElement("div", { className: b('foldable_title', { color: foldableColor, size: foldableSize }), onClick: toggleOpen },
30
- foldableTitle,
31
- React.createElement(ToggleArrow, { open: isOpened, size: 14, type: 'vertical', className: b('arrow') })));
32
- };
33
- const getFoldableComponent = (customClassName = '') => {
34
- return (React.createElement("div", { className: customClassName },
35
- getFoldableTitle(),
36
- React.createElement(Foldable, { isOpened: isOpened }, getFoldableBlock())));
37
- };
38
- const getNonFoldableComponent = (customClassName = '') => {
39
- return React.createElement("div", { className: customClassName }, getFoldableBlock());
40
- };
41
- const getComponentMixedView = () => {
42
- if (foldable) {
43
- return (React.createElement(Fragment, null,
44
- getFoldableComponent(b('foldable')),
45
- getNonFoldableComponent(b('non_foldable'))));
46
- }
47
- return getNonFoldableComponent(b('delimiter-line'));
48
- };
49
- const getComponentSimpleView = () => {
50
- return foldable ? getFoldableComponent() : getNonFoldableComponent(b('delimiter-line'));
51
- };
52
- return (React.createElement("div", { className: b(null, className) }, useMixedView ? getComponentMixedView() : getComponentSimpleView()));
53
- };
54
- export default PriceDetails;
@@ -1,9 +0,0 @@
1
- .pc-separate-price-detailed-block .pc-price-description {
2
- margin-bottom: 0;
3
- }
4
- .pc-separate-price-detailed-block .pc-price-details > * {
5
- padding-top: 12px;
6
- }
7
- .pc-separate-price-detailed-block .pc-price-details {
8
- margin-top: 24px;
9
- }
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { CardBorder, PriceDescriptionProps, PriceDetailsListProps, PriceDetailsSettingsProps, PriceItemProps } from '../../../models';
3
- import './SeparatePriceDetailed.css';
4
- interface SeparatePriceDetailedProps {
5
- items: PriceItemProps[];
6
- getDescriptionComponent: (priceDescription: PriceDescriptionProps) => JSX.Element;
7
- getDetailsComponent: (priceDetails?: PriceDetailsSettingsProps[] | PriceDetailsListProps[]) => JSX.Element;
8
- border?: CardBorder;
9
- }
10
- declare const SeparatePriceDetailed: (props: SeparatePriceDetailedProps) => JSX.Element;
11
- export default SeparatePriceDetailed;