@cloud-ru/uikit-product-price-summary 0.5.3 → 0.5.5

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 (164) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/components/ContentBlock/ContentBlock.d.ts +7 -0
  3. package/dist/cjs/components/ContentBlock/ContentBlock.js +23 -0
  4. package/dist/cjs/components/ContentBlock/index.d.ts +1 -0
  5. package/dist/cjs/components/ContentBlock/index.js +17 -0
  6. package/dist/cjs/components/ContentBlock/styles.module.css +12 -0
  7. package/dist/cjs/components/PriceSummary/PriceSummary.d.ts +17 -0
  8. package/dist/cjs/components/PriceSummary/PriceSummary.js +33 -0
  9. package/dist/cjs/components/PriceSummary/components/DiscountBlock/DiscountBlock.d.ts +6 -0
  10. package/dist/cjs/components/PriceSummary/components/DiscountBlock/DiscountBlock.js +17 -0
  11. package/dist/cjs/components/PriceSummary/components/DiscountBlock/index.d.ts +1 -0
  12. package/dist/cjs/components/PriceSummary/components/DiscountBlock/index.js +17 -0
  13. package/dist/cjs/components/PriceSummary/components/DiscountBlock/styles.module.css +16 -0
  14. package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.d.ts +6 -0
  15. package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.js +16 -0
  16. package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/index.d.ts +1 -0
  17. package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/index.js +17 -0
  18. package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/styles.module.css +5 -0
  19. package/dist/cjs/components/PriceSummary/components/Divider/Divider.d.ts +1 -0
  20. package/dist/cjs/components/PriceSummary/components/Divider/Divider.js +11 -0
  21. package/dist/cjs/components/PriceSummary/components/Divider/index.d.ts +1 -0
  22. package/dist/cjs/components/PriceSummary/components/Divider/index.js +17 -0
  23. package/dist/cjs/components/PriceSummary/components/Divider/styles.module.css +6 -0
  24. package/dist/cjs/components/PriceSummary/components/HeaderBlock/HeaderBlock.d.ts +6 -0
  25. package/dist/cjs/components/PriceSummary/components/HeaderBlock/HeaderBlock.js +16 -0
  26. package/dist/cjs/components/PriceSummary/components/HeaderBlock/index.d.ts +1 -0
  27. package/dist/cjs/components/PriceSummary/components/HeaderBlock/index.js +17 -0
  28. package/dist/cjs/components/PriceSummary/components/HeaderBlock/styles.module.css +14 -0
  29. package/dist/cjs/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.d.ts +7 -0
  30. package/dist/cjs/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.js +18 -0
  31. package/dist/cjs/components/PriceSummary/components/InvoiceBlock/index.d.ts +1 -0
  32. package/dist/cjs/components/PriceSummary/components/InvoiceBlock/index.js +17 -0
  33. package/dist/cjs/components/PriceSummary/components/InvoiceBlock/styles.module.css +18 -0
  34. package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.d.ts +6 -0
  35. package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.js +17 -0
  36. package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/index.d.ts +1 -0
  37. package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/index.js +17 -0
  38. package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.css +16 -0
  39. package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.d.ts +7 -0
  40. package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.js +24 -0
  41. package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/index.d.ts +1 -0
  42. package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/index.js +17 -0
  43. package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/styles.module.css +33 -0
  44. package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.d.ts +6 -0
  45. package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.js +16 -0
  46. package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/index.d.ts +1 -0
  47. package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/index.js +17 -0
  48. package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.css +14 -0
  49. package/dist/cjs/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.d.ts +8 -0
  50. package/dist/cjs/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.js +23 -0
  51. package/dist/cjs/components/PriceSummary/components/PeriodDropdown/index.d.ts +1 -0
  52. package/dist/cjs/components/PriceSummary/components/PeriodDropdown/index.js +17 -0
  53. package/dist/cjs/components/PriceSummary/components/PeriodDropdown/styles.module.css +15 -0
  54. package/dist/cjs/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.d.ts +24 -0
  55. package/dist/cjs/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.js +46 -0
  56. package/dist/cjs/components/PriceSummary/components/TotalValueBlock/index.d.ts +1 -0
  57. package/dist/cjs/components/PriceSummary/components/TotalValueBlock/index.js +17 -0
  58. package/dist/cjs/components/PriceSummary/components/TotalValueBlock/styles.module.css +51 -0
  59. package/dist/cjs/components/PriceSummary/index.d.ts +1 -0
  60. package/dist/cjs/components/PriceSummary/index.js +17 -0
  61. package/dist/cjs/components/PriceSummary/styles.module.css +12 -0
  62. package/dist/cjs/components/PriceSummarySmall/PriceSummarySmall.d.ts +12 -0
  63. package/dist/cjs/components/PriceSummarySmall/PriceSummarySmall.js +32 -0
  64. package/dist/cjs/components/PriceSummarySmall/index.d.ts +1 -0
  65. package/dist/cjs/components/PriceSummarySmall/index.js +17 -0
  66. package/dist/cjs/components/PriceSummarySmall/styles.module.css +23 -0
  67. package/dist/cjs/components/index.d.ts +2 -0
  68. package/dist/cjs/components/index.js +18 -0
  69. package/dist/cjs/helpers/formatters.d.ts +2 -0
  70. package/dist/cjs/helpers/formatters.js +14 -0
  71. package/dist/cjs/helpers/index.d.ts +1 -0
  72. package/dist/cjs/helpers/index.js +17 -0
  73. package/dist/cjs/hooks/index.d.ts +2 -0
  74. package/dist/cjs/hooks/index.js +18 -0
  75. package/dist/cjs/hooks/usePeriodFormat.d.ts +2 -0
  76. package/dist/cjs/hooks/usePeriodFormat.js +24 -0
  77. package/dist/cjs/hooks/usePriceTotalValueFormatter.d.ts +2 -0
  78. package/dist/cjs/hooks/usePriceTotalValueFormatter.js +10 -0
  79. package/dist/cjs/index.d.ts +3 -0
  80. package/dist/cjs/index.js +19 -0
  81. package/dist/cjs/types/index.d.ts +41 -0
  82. package/dist/cjs/types/index.js +11 -0
  83. package/dist/esm/components/ContentBlock/ContentBlock.d.ts +7 -0
  84. package/dist/esm/components/ContentBlock/ContentBlock.js +17 -0
  85. package/dist/esm/components/ContentBlock/index.d.ts +1 -0
  86. package/dist/esm/components/ContentBlock/index.js +1 -0
  87. package/dist/esm/components/ContentBlock/styles.module.css +12 -0
  88. package/dist/esm/components/PriceSummary/PriceSummary.d.ts +17 -0
  89. package/dist/esm/components/PriceSummary/PriceSummary.js +27 -0
  90. package/dist/esm/components/PriceSummary/components/DiscountBlock/DiscountBlock.d.ts +6 -0
  91. package/dist/esm/components/PriceSummary/components/DiscountBlock/DiscountBlock.js +11 -0
  92. package/dist/esm/components/PriceSummary/components/DiscountBlock/index.d.ts +1 -0
  93. package/dist/esm/components/PriceSummary/components/DiscountBlock/index.js +1 -0
  94. package/dist/esm/components/PriceSummary/components/DiscountBlock/styles.module.css +16 -0
  95. package/dist/esm/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.d.ts +6 -0
  96. package/dist/esm/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.js +10 -0
  97. package/dist/esm/components/PriceSummary/components/DiscountPercentCell/index.d.ts +1 -0
  98. package/dist/esm/components/PriceSummary/components/DiscountPercentCell/index.js +1 -0
  99. package/dist/esm/components/PriceSummary/components/DiscountPercentCell/styles.module.css +5 -0
  100. package/dist/esm/components/PriceSummary/components/Divider/Divider.d.ts +1 -0
  101. package/dist/esm/components/PriceSummary/components/Divider/Divider.js +5 -0
  102. package/dist/esm/components/PriceSummary/components/Divider/index.d.ts +1 -0
  103. package/dist/esm/components/PriceSummary/components/Divider/index.js +1 -0
  104. package/dist/esm/components/PriceSummary/components/Divider/styles.module.css +6 -0
  105. package/dist/esm/components/PriceSummary/components/HeaderBlock/HeaderBlock.d.ts +6 -0
  106. package/dist/esm/components/PriceSummary/components/HeaderBlock/HeaderBlock.js +10 -0
  107. package/dist/esm/components/PriceSummary/components/HeaderBlock/index.d.ts +1 -0
  108. package/dist/esm/components/PriceSummary/components/HeaderBlock/index.js +1 -0
  109. package/dist/esm/components/PriceSummary/components/HeaderBlock/styles.module.css +14 -0
  110. package/dist/esm/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.d.ts +7 -0
  111. package/dist/esm/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.js +12 -0
  112. package/dist/esm/components/PriceSummary/components/InvoiceBlock/index.d.ts +1 -0
  113. package/dist/esm/components/PriceSummary/components/InvoiceBlock/index.js +1 -0
  114. package/dist/esm/components/PriceSummary/components/InvoiceBlock/styles.module.css +18 -0
  115. package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.d.ts +6 -0
  116. package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.js +11 -0
  117. package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/index.d.ts +1 -0
  118. package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/index.js +1 -0
  119. package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.css +16 -0
  120. package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.d.ts +7 -0
  121. package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.js +18 -0
  122. package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/index.d.ts +1 -0
  123. package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/index.js +1 -0
  124. package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/styles.module.css +33 -0
  125. package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.d.ts +6 -0
  126. package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.js +10 -0
  127. package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/index.d.ts +1 -0
  128. package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/index.js +1 -0
  129. package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.css +14 -0
  130. package/dist/esm/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.d.ts +8 -0
  131. package/dist/esm/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.js +17 -0
  132. package/dist/esm/components/PriceSummary/components/PeriodDropdown/index.d.ts +1 -0
  133. package/dist/esm/components/PriceSummary/components/PeriodDropdown/index.js +1 -0
  134. package/dist/esm/components/PriceSummary/components/PeriodDropdown/styles.module.css +15 -0
  135. package/dist/esm/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.d.ts +24 -0
  136. package/dist/esm/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.js +39 -0
  137. package/dist/esm/components/PriceSummary/components/TotalValueBlock/index.d.ts +1 -0
  138. package/dist/esm/components/PriceSummary/components/TotalValueBlock/index.js +1 -0
  139. package/dist/esm/components/PriceSummary/components/TotalValueBlock/styles.module.css +51 -0
  140. package/dist/esm/components/PriceSummary/index.d.ts +1 -0
  141. package/dist/esm/components/PriceSummary/index.js +1 -0
  142. package/dist/esm/components/PriceSummary/styles.module.css +12 -0
  143. package/dist/esm/components/PriceSummarySmall/PriceSummarySmall.d.ts +12 -0
  144. package/dist/esm/components/PriceSummarySmall/PriceSummarySmall.js +26 -0
  145. package/dist/esm/components/PriceSummarySmall/index.d.ts +1 -0
  146. package/dist/esm/components/PriceSummarySmall/index.js +1 -0
  147. package/dist/esm/components/PriceSummarySmall/styles.module.css +23 -0
  148. package/dist/esm/components/index.d.ts +2 -0
  149. package/dist/esm/components/index.js +2 -0
  150. package/dist/esm/helpers/formatters.d.ts +2 -0
  151. package/dist/esm/helpers/formatters.js +10 -0
  152. package/dist/esm/helpers/index.d.ts +1 -0
  153. package/dist/esm/helpers/index.js +1 -0
  154. package/dist/esm/hooks/index.d.ts +2 -0
  155. package/dist/esm/hooks/index.js +2 -0
  156. package/dist/esm/hooks/usePeriodFormat.d.ts +2 -0
  157. package/dist/esm/hooks/usePeriodFormat.js +21 -0
  158. package/dist/esm/hooks/usePriceTotalValueFormatter.d.ts +2 -0
  159. package/dist/esm/hooks/usePriceTotalValueFormatter.js +7 -0
  160. package/dist/esm/index.d.ts +3 -0
  161. package/dist/esm/index.js +3 -0
  162. package/dist/esm/types/index.d.ts +41 -0
  163. package/dist/esm/types/index.js +8 -0
  164. package/package.json +7 -6
package/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 0.5.5 (2025-11-13)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@cloud-ru/uikit-product-button-predefined@0.7.6](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/button-predefined/CHANGELOG.md)
10
+ * [@cloud-ru/uikit-product-icons@15.1.3](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/icons/CHANGELOG.md)
11
+ * [@cloud-ru/uikit-product-mobile-tooltip@0.4.67](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-tooltip/CHANGELOG.md)
12
+ * [@cloud-ru/uikit-product-utils@7.0.2](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/utils/CHANGELOG.md)
13
+
14
+
15
+
16
+
17
+
18
+ ## 0.5.4 (2025-11-12)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * **PD-3377:** contributors update to publish all packages ([719fd3e](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/719fd3e1249e247443b125c47ea408d92c8395c3))
24
+
25
+
26
+
27
+
28
+
6
29
  ## 0.5.3 (2025-11-12)
7
30
 
8
31
  ### Only dependencies have been changed
@@ -0,0 +1,7 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export type ContentBlockProps = {
3
+ loading?: boolean;
4
+ dataError?: boolean;
5
+ onRetry?(): void;
6
+ };
7
+ export declare function ContentBlock({ loading, dataError, onRetry, children }: PropsWithChildren<ContentBlockProps>): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ContentBlock = ContentBlock;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
9
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
10
+ const button_1 = require("@snack-uikit/button");
11
+ const loaders_1 = require("@snack-uikit/loaders");
12
+ const typography_1 = require("@snack-uikit/typography");
13
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
14
+ function ContentBlock({ loading, dataError, onRetry, children }) {
15
+ const { t } = (0, uikit_product_locale_1.useLocale)('PriceSummary');
16
+ if (loading) {
17
+ return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.loadingBlock, children: (0, jsx_runtime_1.jsx)(loaders_1.Sun, {}) }));
18
+ }
19
+ if (dataError) {
20
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.dataErrorBlock, children: [onRetry && (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.RepeatSVG, {}), onClick: onRetry }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { children: t('dataError') })] }));
21
+ }
22
+ return children;
23
+ }
@@ -0,0 +1 @@
1
+ export * from './ContentBlock';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ContentBlock"), exports);
@@ -0,0 +1,12 @@
1
+ .loadingBlock{
2
+ display:flex;
3
+ justify-content:center;
4
+ padding:var(--dimension-050m, 4px);
5
+ }
6
+
7
+ .dataErrorBlock{
8
+ display:flex;
9
+ flex-direction:column;
10
+ align-items:center;
11
+ color:var(--sys-neutral-text-light, #8b8e9b);
12
+ }
@@ -0,0 +1,17 @@
1
+ import { WithLayoutType, WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { LinkProps } from '@snack-uikit/link';
3
+ import { DiscountDetails, InvoiceDetails } from '../../types';
4
+ import { ContentBlockProps } from '../ContentBlock';
5
+ import { HeaderBlockProps } from './components/HeaderBlock';
6
+ import { TotalValueBlockProps } from './components/TotalValueBlock';
7
+ export type PriceSummaryProps = WithLayoutType<WithSupportProps<TotalValueBlockProps & HeaderBlockProps & ContentBlockProps & {
8
+ discount?: DiscountDetails;
9
+ invoice?: InvoiceDetails[];
10
+ invoiceExpandedDefault?: boolean;
11
+ docsLink?: {
12
+ href?: LinkProps['href'];
13
+ text?: LinkProps['text'];
14
+ };
15
+ className?: string;
16
+ }>>;
17
+ export declare function PriceSummary({ value, totalSumType, hint, period, onPeriodChanged, periodOptions, promoBadge, loading, dataError, onRetry, discount, invoice, invoiceExpandedDefault, docsLink, className, layoutType, hintAppearance, showHintTooltip, hintTooltipText, hintLink, showHintLink, ...rest }: PriceSummaryProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.PriceSummary = PriceSummary;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const classnames_1 = __importDefault(require("classnames"));
20
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
21
+ const uikit_product_utils_1 = require("@sbercloud/uikit-product-utils");
22
+ const link_1 = require("@snack-uikit/link");
23
+ const ContentBlock_1 = require("../ContentBlock");
24
+ const DiscountBlock_1 = require("./components/DiscountBlock");
25
+ const HeaderBlock_1 = require("./components/HeaderBlock");
26
+ const InvoiceBlock_1 = require("./components/InvoiceBlock");
27
+ const TotalValueBlock_1 = require("./components/TotalValueBlock");
28
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
29
+ function PriceSummary(_a) {
30
+ var { value, totalSumType, hint, period, onPeriodChanged, periodOptions, promoBadge, loading, dataError, onRetry, discount, invoice, invoiceExpandedDefault = true, docsLink, className, layoutType, hintAppearance, showHintTooltip = false, hintTooltipText, hintLink, showHintLink } = _a, rest = __rest(_a, ["value", "totalSumType", "hint", "period", "onPeriodChanged", "periodOptions", "promoBadge", "loading", "dataError", "onRetry", "discount", "invoice", "invoiceExpandedDefault", "docsLink", "className", "layoutType", "hintAppearance", "showHintTooltip", "hintTooltipText", "hintLink", "showHintLink"]);
31
+ const { t } = (0, uikit_product_locale_1.useLocale)('PriceSummary');
32
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)(styles_module_scss_1.default.priceSummary, className) }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: [(0, jsx_runtime_1.jsx)(HeaderBlock_1.HeaderBlock, { period: period, onPeriodChanged: onPeriodChanged, periodOptions: periodOptions, promoBadge: promoBadge, layoutType: layoutType }), (0, jsx_runtime_1.jsxs)(ContentBlock_1.ContentBlock, { loading: loading, dataError: dataError, onRetry: onRetry, children: [discount && (0, jsx_runtime_1.jsx)(DiscountBlock_1.DiscountBlock, { value: discount, layoutType: layoutType }), (0, jsx_runtime_1.jsx)(TotalValueBlock_1.TotalValueBlock, { value: value, totalSumType: totalSumType, hint: hint, hintAppearance: hintAppearance, showHintTooltip: showHintTooltip, hintTooltipText: hintTooltipText, hintLink: hintLink, showHintLink: showHintLink }), (invoice === null || invoice === void 0 ? void 0 : invoice.length) && ((0, jsx_runtime_1.jsx)(InvoiceBlock_1.InvoiceBlock, { invoice: invoice, invoiceExpandedDefault: invoiceExpandedDefault, layoutType: layoutType })), (docsLink === null || docsLink === void 0 ? void 0 : docsLink.href) && ((0, jsx_runtime_1.jsx)(link_1.Link, { size: 'm', textMode: 'default', text: docsLink.text || t('docsLink'), href: docsLink.href, target: '_blank' }))] })] })));
33
+ }
@@ -0,0 +1,6 @@
1
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
2
+ import { DiscountDetails } from '../../../../types';
3
+ export type DiscountBlockProps = WithLayoutType<{
4
+ value: DiscountDetails;
5
+ }>;
6
+ export declare function DiscountBlock({ value, layoutType }: DiscountBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DiscountBlock = DiscountBlock;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
10
+ const typography_1 = require("@snack-uikit/typography");
11
+ const helpers_1 = require("../../../../helpers");
12
+ const DiscountPercentCell_1 = require("../DiscountPercentCell");
13
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
14
+ function DiscountBlock({ value, layoutType }) {
15
+ const { t } = (0, uikit_product_locale_1.useLocale)('PriceSummary');
16
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.discountGrid, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { tag: 'div', children: t('basePrice') }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansLabelM, { tag: 'div', className: styles_module_scss_1.default.priceCell, children: (0, helpers_1.formatCurrency)(value.price) })] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.discountGrid, children: value.discounts.map((discount, index) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DiscountPercentCell_1.DiscountPercentCell, { discount: discount, layoutType: layoutType }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansLabelM, { tag: 'div', className: styles_module_scss_1.default.discountCell, children: (0, helpers_1.formatCurrency)(-Math.abs(discount.value)) })] }, index))) })] }));
17
+ }
@@ -0,0 +1 @@
1
+ export * from './DiscountBlock';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./DiscountBlock"), exports);
@@ -0,0 +1,16 @@
1
+ .discountGrid{
2
+ display:grid;
3
+ grid-template-columns:1fr 1fr;
4
+ -moz-column-gap:var(--dimension-1m, 8px);
5
+ column-gap:var(--dimension-1m, 8px);
6
+ color:var(--sys-neutral-text-support, #6d707f);
7
+ }
8
+
9
+ .priceCell{
10
+ justify-self:end;
11
+ }
12
+
13
+ .discountCell{
14
+ justify-self:end;
15
+ color:var(--sys-red-text-support, #ae514c);
16
+ }
@@ -0,0 +1,6 @@
1
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
2
+ import { DiscountItem } from '../../../../types';
3
+ export type DiscountPercentCellProps = WithLayoutType<{
4
+ discount: DiscountItem;
5
+ }>;
6
+ export declare function DiscountPercentCell({ discount, layoutType }: DiscountPercentCellProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DiscountPercentCell = DiscountPercentCell;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const ft_formatters_1 = require("@cloud-ru/ft-formatters");
9
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
10
+ const uikit_product_mobile_tooltip_1 = require("@sbercloud/uikit-product-mobile-tooltip");
11
+ const typography_1 = require("@snack-uikit/typography");
12
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
13
+ function DiscountPercentCell({ discount, layoutType }) {
14
+ const { t } = (0, uikit_product_locale_1.useLocale)('PriceSummary');
15
+ return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.percentCell, children: discount.percent && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(typography_1.Typography.SansBodyS, { children: [t('discount'), " ", (0, ft_formatters_1.formatNumber)(-Math.abs(discount.percent)), "%"] }), discount.tooltip && ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.AdaptiveQuestionTooltip, { layoutType: layoutType, tip: discount.tooltip, trigger: layoutType === 'mobile' ? 'click' : 'hover' }))] })) }));
16
+ }
@@ -0,0 +1 @@
1
+ export * from './DiscountPercentCell';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./DiscountPercentCell"), exports);
@@ -0,0 +1,5 @@
1
+ .percentCell{
2
+ display:flex;
3
+ align-items:center;
4
+ gap:2px;
5
+ }
@@ -0,0 +1 @@
1
+ export declare function Divider(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Divider = Divider;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
9
+ function Divider() {
10
+ return (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.divider });
11
+ }
@@ -0,0 +1 @@
1
+ export * from './Divider';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Divider"), exports);
@@ -0,0 +1,6 @@
1
+ .divider{
2
+ width:100%;
3
+ height:0;
4
+ border-top:1px dashed var(--sys-neutral-decor-default, #dde0ea);
5
+ margin:var(--dimension-050m, 4px) 0;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { PromoTagProps } from '@snack-uikit/promo-tag';
2
+ import { PeriodDropdownProps } from '../PeriodDropdown';
3
+ export type HeaderBlockProps = PeriodDropdownProps & {
4
+ promoBadge?: Pick<PromoTagProps, 'text' | 'appearance'> | string;
5
+ };
6
+ export declare function HeaderBlock({ period, onPeriodChanged, periodOptions, promoBadge, layoutType }: HeaderBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.HeaderBlock = HeaderBlock;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
9
+ const promo_tag_1 = require("@snack-uikit/promo-tag");
10
+ const typography_1 = require("@snack-uikit/typography");
11
+ const PeriodDropdown_1 = require("../PeriodDropdown");
12
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
13
+ function HeaderBlock({ period, onPeriodChanged, periodOptions, promoBadge, layoutType }) {
14
+ const { t } = (0, uikit_product_locale_1.useLocale)('PriceSummary');
15
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [promoBadge && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.promoBadge, children: (0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, Object.assign({}, (typeof promoBadge === 'string' ? { text: promoBadge } : promoBadge))) })), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.headline, children: [(0, jsx_runtime_1.jsx)(PeriodDropdown_1.PeriodDropdown, { period: period, onPeriodChanged: onPeriodChanged, periodOptions: periodOptions, layoutType: layoutType }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyM, { className: styles_module_scss_1.default.vat, children: t('vat') })] })] }));
16
+ }
@@ -0,0 +1 @@
1
+ export * from './HeaderBlock';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./HeaderBlock"), exports);
@@ -0,0 +1,14 @@
1
+ .headline{
2
+ display:flex;
3
+ justify-content:space-between;
4
+ align-items:center;
5
+ gap:var(--dimension-050m, 4px);
6
+ }
7
+
8
+ .vat{
9
+ color:var(--sys-neutral-text-light, #8b8e9b);
10
+ }
11
+
12
+ .promoBadge{
13
+ display:flex;
14
+ }
@@ -0,0 +1,7 @@
1
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
2
+ import { InvoiceDetails } from '../../../../types';
3
+ export type InvoiceBlockProps = WithLayoutType<{
4
+ invoice: InvoiceDetails[];
5
+ invoiceExpandedDefault?: boolean;
6
+ }>;
7
+ export declare function InvoiceBlock({ invoice, invoiceExpandedDefault, layoutType }: InvoiceBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.InvoiceBlock = InvoiceBlock;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
10
+ const accordion_1 = require("@snack-uikit/accordion");
11
+ const typography_1 = require("@snack-uikit/typography");
12
+ const InvoiceDetailsBlock_1 = require("../InvoiceDetailsBlock");
13
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
14
+ function InvoiceBlock({ invoice, invoiceExpandedDefault, layoutType }) {
15
+ const { t } = (0, uikit_product_locale_1.useLocale)('PriceSummary');
16
+ const invoiceBlockId = (0, react_1.useId)();
17
+ return ((0, jsx_runtime_1.jsx)(accordion_1.AccordionSecondary, { expandedDefault: invoiceExpandedDefault ? invoiceBlockId : undefined, className: styles_module_scss_1.default.accordion, children: (0, jsx_runtime_1.jsx)(accordion_1.AccordionSecondary.CollapseBlock, { id: invoiceBlockId, header: (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyM, { className: styles_module_scss_1.default.accordionHeaderTitle, children: t('orderDetails') }), children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.accordionContent, children: invoice.map((invoice, index) => ((0, jsx_runtime_1.jsx)(InvoiceDetailsBlock_1.InvoiceDetailsBlock, { invoice: invoice, layoutType: layoutType }, index))) }) }) }));
18
+ }
@@ -0,0 +1 @@
1
+ export * from './InvoiceBlock';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./InvoiceBlock"), exports);
@@ -0,0 +1,18 @@
1
+ .accordion{
2
+ --space-accordion-collapse-block-secondary-horizontal-padding:0;
3
+ --space-accordion-collapse-block-secondary-vertical-padding:var(--dimension-1m, 8px);
4
+ --space-accordion-collapse-block-secondary-gap:var(--dimension-1m, 8px);
5
+ --border-width-accordion-collapse-block-secondary:0;
6
+ --accordion-header-padding-vertical:0;
7
+ }
8
+
9
+ .accordionHeaderTitle{
10
+ color:var(--sys-neutral-text-support, #6d707f);
11
+ padding:2px 0;
12
+ }
13
+
14
+ .accordionContent{
15
+ display:flex;
16
+ flex-direction:column;
17
+ gap:var(--dimension-1m, 8px);
18
+ }
@@ -0,0 +1,6 @@
1
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
2
+ import { InvoiceDetails } from '../../../../types';
3
+ export type InvoiceDetailsBlockProps = WithLayoutType<{
4
+ invoice: InvoiceDetails;
5
+ }>;
6
+ export declare function InvoiceDetailsBlock({ invoice, layoutType }: InvoiceDetailsBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.InvoiceDetailsBlock = InvoiceDetailsBlock;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
9
+ const typography_1 = require("@snack-uikit/typography");
10
+ const helpers_1 = require("../../../../helpers");
11
+ const Divider_1 = require("../Divider");
12
+ const InvoiceItemBlock_1 = require("../InvoiceItemBlock");
13
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
14
+ function InvoiceDetailsBlock({ invoice, layoutType }) {
15
+ const { t } = (0, uikit_product_locale_1.useLocale)('PriceSummary');
16
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.main, children: [invoice.title && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.header, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography.SansLabelM, { children: invoice.title }), invoice.quantity && (0, jsx_runtime_1.jsx)(typography_1.Typography.SansLabelM, { children: (0, helpers_1.formatQuantity)(invoice.quantity) })] }), (0, jsx_runtime_1.jsx)(Divider_1.Divider, {})] })), invoice.items.map((item, index) => ((0, jsx_runtime_1.jsx)(InvoiceItemBlock_1.InvoiceItemBlock, { item: item, index: index, layoutType: layoutType }, index))), invoice.price !== undefined && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Divider_1.Divider, {}), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.footer, children: (0, jsx_runtime_1.jsxs)(typography_1.Typography.SansLabelM, { children: [t('price'), ": ", (0, helpers_1.formatCurrency)(invoice.price)] }) })] }))] }));
17
+ }
@@ -0,0 +1 @@
1
+ export * from './InvoiceDetailsBlock';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./InvoiceDetailsBlock"), exports);
@@ -0,0 +1,16 @@
1
+ .main{
2
+ border-radius:var(--dimension-050m, 4px);
3
+ padding:var(--dimension-050m, 4px) var(--dimension-1m, 8px);
4
+ border:1px dashed var(--sys-neutral-decor-default, #dde0ea);
5
+ }
6
+
7
+ .header{
8
+ display:flex;
9
+ justify-content:space-between;
10
+ }
11
+
12
+ .footer{
13
+ display:flex;
14
+ align-items:center;
15
+ justify-content:flex-end;
16
+ }
@@ -0,0 +1,7 @@
1
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
2
+ import { InvoiceItem } from '../../../../types';
3
+ export type InvoiceItemBlockProps = WithLayoutType<{
4
+ item: InvoiceItem;
5
+ index: number;
6
+ }>;
7
+ export declare function InvoiceItemBlock({ item, index, layoutType }: InvoiceItemBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.InvoiceItemBlock = InvoiceItemBlock;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const typography_1 = require("@snack-uikit/typography");
9
+ const helpers_1 = require("../../../../helpers");
10
+ const DiscountPercentCell_1 = require("../DiscountPercentCell");
11
+ const Divider_1 = require("../Divider");
12
+ const InvoiceItemLabelCell_1 = require("../InvoiceItemLabelCell");
13
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
14
+ function InvoiceItemBlock({ item, index, layoutType }) {
15
+ const isEven = (index + 1) % 2 === 0;
16
+ const isSecondary = item.primary === undefined ? isEven : !item.primary;
17
+ const getPriceItem = () => {
18
+ if (item.hidePrice === false) {
19
+ return item.price !== undefined ? (0, helpers_1.formatCurrency)(item.price) : 'n/a';
20
+ }
21
+ return item.price !== undefined ? (0, helpers_1.formatCurrency)(item.price) : undefined;
22
+ };
23
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [item.topDivider && (0, jsx_runtime_1.jsx)(Divider_1.Divider, {}), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.itemGrid, "data-discount": Boolean(item.discount), children: ['label' in item && item.label !== undefined && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.labelCell, "data-secondary": isSecondary, children: (0, jsx_runtime_1.jsx)(InvoiceItemLabelCell_1.InvoiceItemLabelCell, { item: item, layoutType: layoutType }) }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { tag: 'div', className: styles_module_scss_1.default.priceCell, "data-secondary": isSecondary, children: getPriceItem() })] })), item.discount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.percentCell, "data-secondary": isSecondary, children: (0, jsx_runtime_1.jsx)(DiscountPercentCell_1.DiscountPercentCell, { discount: item.discount, layoutType: layoutType }) }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { tag: 'div', className: styles_module_scss_1.default.discountCell, "data-secondary": isSecondary, children: (0, helpers_1.formatCurrency)(-Math.abs(item.discount.value)) })] }))] }), item.bottomDivider && (0, jsx_runtime_1.jsx)(Divider_1.Divider, {})] }));
24
+ }
@@ -0,0 +1 @@
1
+ export * from './InvoiceItemBlock';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./InvoiceItemBlock"), exports);
@@ -0,0 +1,33 @@
1
+ .itemGrid{
2
+ display:grid;
3
+ grid-template-columns:1fr auto;
4
+ -moz-column-gap:var(--dimension-1m, 8px);
5
+ column-gap:var(--dimension-1m, 8px);
6
+ }
7
+ .itemGrid[data-discount=true]{
8
+ margin-bottom:var(--dimension-050m, 4px);
9
+ }
10
+
11
+ .labelCell{
12
+ display:flex;
13
+ overflow:hidden;
14
+ gap:var(--dimension-050m, 4px);
15
+ }
16
+
17
+ .priceCell{
18
+ justify-self:end;
19
+ }
20
+
21
+ .labelCell[data-secondary=true],
22
+ .priceCell[data-secondary=true],
23
+ .percentCell[data-secondary=true]{
24
+ color:var(--sys-neutral-text-light, #8b8e9b);
25
+ }
26
+
27
+ .discountCell{
28
+ justify-self:end;
29
+ color:var(--sys-red-accent-default, #cb3f3e);
30
+ }
31
+ .discountCell[data-secondary=true]{
32
+ color:var(--sys-red-text-disabled, #ee9285);
33
+ }
@@ -0,0 +1,6 @@
1
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
2
+ import { InvoiceItem } from '../../../../types';
3
+ export type InvoiceItemLabelCellProps = WithLayoutType<{
4
+ item: InvoiceItem;
5
+ }>;
6
+ export declare function InvoiceItemLabelCell({ item, layoutType }: InvoiceItemLabelCellProps): false | import("react/jsx-runtime").JSX.Element;