@cloud-ru/ds-uikit-product-price-summary 1.0.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.
- package/CHANGELOG.md +8 -0
- package/LICENSE +201 -0
- package/README.md +408 -0
- package/dist/cjs/components/ContentBlock/ContentBlock.d.ts +7 -0
- package/dist/cjs/components/ContentBlock/ContentBlock.js +24 -0
- package/dist/cjs/components/ContentBlock/index.d.ts +1 -0
- package/dist/cjs/components/ContentBlock/index.js +17 -0
- package/dist/cjs/components/ContentBlock/styles.module.css +12 -0
- package/dist/cjs/components/PriceSummary/PriceSummary.d.ts +22 -0
- package/dist/cjs/components/PriceSummary/PriceSummary.js +23 -0
- package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.d.ts +5 -0
- package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.js +16 -0
- package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/styles.module.css +6 -0
- package/dist/cjs/components/PriceSummary/components/DiscountBlock/DiscountBlock.d.ts +5 -0
- package/dist/cjs/components/PriceSummary/components/DiscountBlock/DiscountBlock.js +17 -0
- package/dist/cjs/components/PriceSummary/components/DiscountBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/DiscountBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/DiscountBlock/styles.module.css +16 -0
- package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.d.ts +5 -0
- package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.js +16 -0
- package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/styles.module.css +5 -0
- package/dist/cjs/components/PriceSummary/components/Divider/Divider.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/Divider/Divider.js +11 -0
- package/dist/cjs/components/PriceSummary/components/Divider/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/Divider/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/Divider/styles.module.css +6 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/HeaderBlock.d.ts +8 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/HeaderBlock.js +17 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/constants.d.ts +4 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/constants.js +7 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/styles.module.css +14 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/types.d.ts +3 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/types.js +2 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.d.ts +6 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.js +18 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceBlock/styles.module.css +13 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.d.ts +5 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.js +23 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.css +16 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.d.ts +7 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.js +27 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/styles.module.css +36 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.d.ts +5 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.js +19 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.css +14 -0
- package/dist/cjs/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.d.ts +7 -0
- package/dist/cjs/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.js +26 -0
- package/dist/cjs/components/PriceSummary/components/PeriodDropdown/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/PeriodDropdown/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/PeriodDropdown/styles.module.css +15 -0
- package/dist/cjs/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.d.ts +17 -0
- package/dist/cjs/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.js +22 -0
- package/dist/cjs/components/PriceSummary/components/TotalValueBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/TotalValueBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/TotalValueBlock/styles.module.css +51 -0
- package/dist/cjs/components/PriceSummary/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/index.js +17 -0
- package/dist/cjs/components/PriceSummary/styles.module.css +227 -0
- package/dist/cjs/components/PriceSummarySmall/PriceSummarySmall.d.ts +18 -0
- package/dist/cjs/components/PriceSummarySmall/PriceSummarySmall.js +23 -0
- package/dist/cjs/components/PriceSummarySmall/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummarySmall/index.js +17 -0
- package/dist/cjs/components/PriceSummarySmall/styles.module.css +242 -0
- package/dist/cjs/components/index.d.ts +2 -0
- package/dist/cjs/components/index.js +18 -0
- package/dist/cjs/constants.d.ts +34 -0
- package/dist/cjs/constants.js +37 -0
- package/dist/cjs/helpers/formatters.d.ts +2 -0
- package/dist/cjs/helpers/formatters.js +14 -0
- package/dist/cjs/helpers/index.d.ts +1 -0
- package/dist/cjs/helpers/index.js +17 -0
- package/dist/cjs/hooks/index.d.ts +1 -0
- package/dist/cjs/hooks/index.js +17 -0
- package/dist/cjs/hooks/usePeriodFormat.d.ts +5 -0
- package/dist/cjs/hooks/usePeriodFormat.js +21 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/locale/index.d.ts +107 -0
- package/dist/cjs/locale/index.js +58 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/style.css +673 -0
- package/dist/cjs/types.d.ts +79 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/utils/getAppearanceIcon.d.ts +2 -0
- package/dist/cjs/utils/getAppearanceIcon.js +25 -0
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/cjs/utils/index.js +17 -0
- package/dist/esm/components/ContentBlock/ContentBlock.d.ts +7 -0
- package/dist/esm/components/ContentBlock/ContentBlock.js +18 -0
- package/dist/esm/components/ContentBlock/index.d.ts +1 -0
- package/dist/esm/components/ContentBlock/index.js +1 -0
- package/dist/esm/components/ContentBlock/styles.module.css +12 -0
- package/dist/esm/components/PriceSummary/PriceSummary.d.ts +22 -0
- package/dist/esm/components/PriceSummary/PriceSummary.js +17 -0
- package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.d.ts +5 -0
- package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.js +10 -0
- package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/styles.module.css +6 -0
- package/dist/esm/components/PriceSummary/components/DiscountBlock/DiscountBlock.d.ts +5 -0
- package/dist/esm/components/PriceSummary/components/DiscountBlock/DiscountBlock.js +11 -0
- package/dist/esm/components/PriceSummary/components/DiscountBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/DiscountBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/DiscountBlock/styles.module.css +16 -0
- package/dist/esm/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.d.ts +5 -0
- package/dist/esm/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.js +10 -0
- package/dist/esm/components/PriceSummary/components/DiscountPercentCell/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/DiscountPercentCell/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/DiscountPercentCell/styles.module.css +5 -0
- package/dist/esm/components/PriceSummary/components/Divider/Divider.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/Divider/Divider.js +5 -0
- package/dist/esm/components/PriceSummary/components/Divider/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/Divider/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/Divider/styles.module.css +6 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/HeaderBlock.d.ts +8 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/HeaderBlock.js +11 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/constants.d.ts +4 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/constants.js +4 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/styles.module.css +14 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/types.d.ts +3 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/types.js +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.d.ts +6 -0
- package/dist/esm/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.js +12 -0
- package/dist/esm/components/PriceSummary/components/InvoiceBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceBlock/styles.module.css +13 -0
- package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.d.ts +5 -0
- package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.js +17 -0
- package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.css +16 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.d.ts +7 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.js +21 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/styles.module.css +36 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.d.ts +5 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.js +13 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.css +14 -0
- package/dist/esm/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.d.ts +7 -0
- package/dist/esm/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.js +20 -0
- package/dist/esm/components/PriceSummary/components/PeriodDropdown/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/PeriodDropdown/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/PeriodDropdown/styles.module.css +15 -0
- package/dist/esm/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.d.ts +17 -0
- package/dist/esm/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.js +16 -0
- package/dist/esm/components/PriceSummary/components/TotalValueBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/TotalValueBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/TotalValueBlock/styles.module.css +51 -0
- package/dist/esm/components/PriceSummary/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/index.js +1 -0
- package/dist/esm/components/PriceSummary/styles.module.css +227 -0
- package/dist/esm/components/PriceSummarySmall/PriceSummarySmall.d.ts +18 -0
- package/dist/esm/components/PriceSummarySmall/PriceSummarySmall.js +17 -0
- package/dist/esm/components/PriceSummarySmall/index.d.ts +1 -0
- package/dist/esm/components/PriceSummarySmall/index.js +1 -0
- package/dist/esm/components/PriceSummarySmall/styles.module.css +242 -0
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/constants.d.ts +34 -0
- package/dist/esm/constants.js +34 -0
- package/dist/esm/helpers/formatters.d.ts +2 -0
- package/dist/esm/helpers/formatters.js +10 -0
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/hooks/index.d.ts +1 -0
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/usePeriodFormat.d.ts +5 -0
- package/dist/esm/hooks/usePeriodFormat.js +17 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/locale/index.d.ts +107 -0
- package/dist/esm/locale/index.js +55 -0
- package/dist/esm/style.css +673 -0
- package/dist/esm/types.d.ts +79 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/utils/getAppearanceIcon.d.ts +2 -0
- package/dist/esm/utils/getAppearanceIcon.js +22 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +61 -0
- package/src/components/ContentBlock/ContentBlock.tsx +41 -0
- package/src/components/ContentBlock/index.ts +1 -0
- package/src/components/ContentBlock/styles.module.scss +14 -0
- package/src/components/PriceSummary/PriceSummary.tsx +107 -0
- package/src/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.tsx +32 -0
- package/src/components/PriceSummary/components/CoveredByGrantLabel/index.ts +1 -0
- package/src/components/PriceSummary/components/CoveredByGrantLabel/styles.module.scss +8 -0
- package/src/components/PriceSummary/components/DiscountBlock/DiscountBlock.tsx +42 -0
- package/src/components/PriceSummary/components/DiscountBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/DiscountBlock/styles.module.scss +17 -0
- package/src/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.tsx +30 -0
- package/src/components/PriceSummary/components/DiscountPercentCell/index.ts +1 -0
- package/src/components/PriceSummary/components/DiscountPercentCell/styles.module.scss +7 -0
- package/src/components/PriceSummary/components/Divider/Divider.tsx +5 -0
- package/src/components/PriceSummary/components/Divider/index.ts +1 -0
- package/src/components/PriceSummary/components/Divider/styles.module.scss +8 -0
- package/src/components/PriceSummary/components/HeaderBlock/HeaderBlock.tsx +41 -0
- package/src/components/PriceSummary/components/HeaderBlock/constants.ts +4 -0
- package/src/components/PriceSummary/components/HeaderBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/HeaderBlock/styles.module.scss +16 -0
- package/src/components/PriceSummary/components/HeaderBlock/types.ts +5 -0
- package/src/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.tsx +37 -0
- package/src/components/PriceSummary/components/InvoiceBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceBlock/styles.module.scss +15 -0
- package/src/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.tsx +63 -0
- package/src/components/PriceSummary/components/InvoiceDetailsBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.scss +18 -0
- package/src/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.tsx +82 -0
- package/src/components/PriceSummary/components/InvoiceItemBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceItemBlock/styles.module.scss +42 -0
- package/src/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.tsx +37 -0
- package/src/components/PriceSummary/components/InvoiceItemLabelCell/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.scss +16 -0
- package/src/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.tsx +54 -0
- package/src/components/PriceSummary/components/PeriodDropdown/index.ts +1 -0
- package/src/components/PriceSummary/components/PeriodDropdown/styles.module.scss +18 -0
- package/src/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.tsx +82 -0
- package/src/components/PriceSummary/components/TotalValueBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/TotalValueBlock/styles.module.scss +54 -0
- package/src/components/PriceSummary/index.ts +1 -0
- package/src/components/PriceSummary/styles.module.scss +27 -0
- package/src/components/PriceSummarySmall/PriceSummarySmall.tsx +89 -0
- package/src/components/PriceSummarySmall/index.ts +1 -0
- package/src/components/PriceSummarySmall/styles.module.scss +42 -0
- package/src/components/index.ts +2 -0
- package/src/constants.ts +37 -0
- package/src/helpers/formatters.ts +12 -0
- package/src/helpers/index.ts +1 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/usePeriodFormat.ts +30 -0
- package/src/index.ts +5 -0
- package/src/locale/index.ts +59 -0
- package/src/types.ts +93 -0
- package/src/utils/getAppearanceIcon.tsx +26 -0
- package/src/utils/index.ts +1 -0
package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionTooltip } from '@cloud-ru/ds-tooltip';
|
|
3
|
+
import { TruncateString } from '@cloud-ru/ds-truncate-string';
|
|
4
|
+
import { SIZE, Typography, VARIANT } from '@cloud-ru/ds-typography';
|
|
5
|
+
import { formatQuantity } from '../../../../helpers/index.js';
|
|
6
|
+
import styles from './styles.module.css';
|
|
7
|
+
export function InvoiceItemLabelCell({ item }) {
|
|
8
|
+
const isLabelVisible = 'label' in item && item.label !== undefined;
|
|
9
|
+
if (!isLabelVisible) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: styles.labelCell, children: [_jsx(Typography, { variant: VARIANT.body, size: SIZE.s, className: styles.label, children: item.labelMaxLines ? _jsx(TruncateString, { text: item.label, maxLines: item.labelMaxLines }) : item.label }), item.labelTooltip && _jsx(QuestionTooltip, { tip: item.labelTooltip })] }), item.quantity && (_jsx(Typography, { variant: VARIANT.body, size: SIZE.s, className: styles.quantity, children: formatQuantity(item.quantity) }))] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InvoiceItemLabelCell.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InvoiceItemLabelCell.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PricePeriod } from '../../../../types.js';
|
|
2
|
+
export type PeriodDropdownProps = {
|
|
3
|
+
period: PricePeriod;
|
|
4
|
+
periodOptions: PricePeriod[];
|
|
5
|
+
onPeriodChanged?(period: PricePeriod): void;
|
|
6
|
+
};
|
|
7
|
+
export declare function PeriodDropdown({ period, onPeriodChanged, periodOptions }: PeriodDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SIZE, Typography, VARIANT } from '@cloud-ru/ds-typography';
|
|
3
|
+
import { ButtonDropdown } from '@cloud-ru/ds-uikit-product-button-predefined';
|
|
4
|
+
import { PERIOD_OPTION_TEST_IDS, TEST_IDS } from '../../../../constants.js';
|
|
5
|
+
import { usePeriodFormat } from '../../../../hooks/index.js';
|
|
6
|
+
import { priceSummaryLocale } from '../../../../locale/index.js';
|
|
7
|
+
import styles from './styles.module.css';
|
|
8
|
+
export function PeriodDropdown({ period, onPeriodChanged = () => { }, periodOptions }) {
|
|
9
|
+
const { t } = priceSummaryLocale.useTranslations();
|
|
10
|
+
const formatPeriod = usePeriodFormat();
|
|
11
|
+
const actions = periodOptions
|
|
12
|
+
.filter(item => item !== period)
|
|
13
|
+
.map(item => ({
|
|
14
|
+
id: item,
|
|
15
|
+
content: { label: formatPeriod(item) },
|
|
16
|
+
onClick: () => onPeriodChanged(item),
|
|
17
|
+
'data-test-id': PERIOD_OPTION_TEST_IDS[item],
|
|
18
|
+
}));
|
|
19
|
+
return (_jsxs("div", { className: styles.period, "data-single": actions.length === 0 ? true : undefined, children: [_jsx(Typography, { variant: VARIANT.body, size: SIZE.m, children: t('total') }), actions.length === 0 && (_jsx("div", { className: styles.single, children: _jsx(Typography, { variant: VARIANT.body, size: SIZE.m, children: formatPeriod(period) }) })), actions.length > 0 && (_jsx(ButtonDropdown, { size: 's', label: formatPeriod(period), items: actions, closeDroplistOnItemClick: true, "data-test-id": TEST_IDS.periodDropdown }))] }));
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PeriodDropdown.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PeriodDropdown.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.period{
|
|
2
|
+
display:flex;
|
|
3
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
4
|
+
align-items:center;
|
|
5
|
+
}
|
|
6
|
+
.period[data-single]{
|
|
7
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.single{
|
|
11
|
+
display:flex;
|
|
12
|
+
align-items:center;
|
|
13
|
+
min-height:var(--sn-primitive-dimension-32, 32px);
|
|
14
|
+
color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AppearanceState, PriceDeltaDetails, TotalSumType } from '../../../../types.js';
|
|
3
|
+
export type TotalValueBlockProps = {
|
|
4
|
+
value?: number;
|
|
5
|
+
valueDelta?: PriceDeltaDetails;
|
|
6
|
+
totalSumType?: TotalSumType;
|
|
7
|
+
hint?: string;
|
|
8
|
+
hintAppearance?: AppearanceState;
|
|
9
|
+
showHintTooltip?: boolean;
|
|
10
|
+
hintTooltipText?: ReactNode;
|
|
11
|
+
hintLink?: {
|
|
12
|
+
href?: string;
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
showHintLink?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare function TotalValueBlock({ value, totalSumType, hint, hintAppearance, showHintTooltip, hintTooltipText, hintLink, showHintLink, valueDelta, }: TotalValueBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link, ROLE_APPEARANCE } from '@cloud-ru/ds-link';
|
|
3
|
+
import { Tooltip } from '@cloud-ru/ds-tooltip';
|
|
4
|
+
import { SIZE, Typography, VARIANT, WEIGHT } from '@cloud-ru/ds-typography';
|
|
5
|
+
import { APPEARANCE_STATE } from '../../../../constants.js';
|
|
6
|
+
import { formatCurrency } from '../../../../helpers/index.js';
|
|
7
|
+
import { priceSummaryLocale } from '../../../../locale/index.js';
|
|
8
|
+
import { getAppearanceIcon } from '../../../../utils/index.js';
|
|
9
|
+
import styles from './styles.module.css';
|
|
10
|
+
export function TotalValueBlock({ value, totalSumType = 'equal', hint, hintAppearance = APPEARANCE_STATE.Default, showHintTooltip, hintTooltipText, hintLink, showHintLink, valueDelta, }) {
|
|
11
|
+
const { t } = priceSummaryLocale.useTranslations();
|
|
12
|
+
const totalSumPrefix = totalSumType === 'from' ? `${t('totalSumFromPrefix')} ` : '';
|
|
13
|
+
return (_jsxs("div", { className: styles.content, "data-appearance": hintAppearance, children: [_jsx(Typography, { variant: VARIANT.headline, size: SIZE.s, weight: WEIGHT.thin, children: value !== undefined
|
|
14
|
+
? `${totalSumPrefix}${formatCurrency(Number(value))}`
|
|
15
|
+
: t('notAvailable') }), valueDelta && (_jsx(Typography, { variant: VARIANT.body, size: SIZE.s, className: styles.valueDelta, children: `${t(`${valueDelta.type}Price`)} ${formatCurrency(valueDelta.value)}` })), _jsx(Tooltip, { open: showHintTooltip && hintTooltipText ? undefined : false, tip: hintTooltipText, placement: 'left-start', children: hint && (_jsxs("div", { className: styles.hint, "data-appearance": hintAppearance, children: [getAppearanceIcon(hintAppearance, styles.hintIcon), _jsx(Typography, { variant: VARIANT.body, size: SIZE.s, children: hint })] })) }), showHintLink && (_jsx(Link, { roleAppearance: ROLE_APPEARANCE.OnAccent, appearance: 'neutral', href: hintLink?.href, label: hintLink?.label, className: styles.link }))] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TotalValueBlock.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TotalValueBlock.js';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.content{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
text-align:start;
|
|
5
|
+
}
|
|
6
|
+
.content[data-appearance=userError]{
|
|
7
|
+
color:var(--sn-theme-color-red-text, var(--sn-primitive-color-red-45, #a93533));
|
|
8
|
+
}
|
|
9
|
+
.content[data-appearance=warning]{
|
|
10
|
+
color:var(--sn-theme-color-yellow-text, var(--sn-primitive-color-yellow-45, #ab7a08));
|
|
11
|
+
}
|
|
12
|
+
.content[data-appearance=systemError]{
|
|
13
|
+
color:var(--sn-theme-color-available-version-textDisabled, var(--sn-brand-color-text-version-disabled, rgba(65, 66, 78, 0.3490196078)));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.hint{
|
|
17
|
+
display:flex;
|
|
18
|
+
gap:var(--sn-primitive-dimension-2, 2px);
|
|
19
|
+
align-items:center;
|
|
20
|
+
color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
|
|
21
|
+
}
|
|
22
|
+
.hint[data-appearance=userError]{
|
|
23
|
+
color:var(--sn-theme-color-red-text, var(--sn-primitive-color-red-45, #a93533));
|
|
24
|
+
}
|
|
25
|
+
.hint[data-appearance=warning]{
|
|
26
|
+
color:var(--sn-theme-color-yellow-text, var(--sn-primitive-color-yellow-45, #ab7a08));
|
|
27
|
+
}
|
|
28
|
+
.hint[data-appearance=systemError]{
|
|
29
|
+
color:var(--sn-theme-color-available-version-textDisabled, var(--sn-brand-color-text-version-disabled, rgba(65, 66, 78, 0.3490196078)));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.hintIcon{
|
|
33
|
+
flex-shrink:0;
|
|
34
|
+
box-sizing:content-box;
|
|
35
|
+
}
|
|
36
|
+
.hintIcon[data-appearance=default]{
|
|
37
|
+
color:var(--sn-theme-color-neutral-accent, var(--sn-brand-color-neutral-55, var(--sn-primitive-color-gray-55, #8b8fa7)));
|
|
38
|
+
}
|
|
39
|
+
.hintIcon[data-appearance=userError]{
|
|
40
|
+
color:var(--sn-theme-color-red-accent, var(--sn-primitive-color-red-55, #d52e33));
|
|
41
|
+
}
|
|
42
|
+
.hintIcon[data-appearance=warning]{
|
|
43
|
+
color:var(--sn-theme-color-yellow-accent, var(--sn-primitive-color-yellow-55, #f3b917));
|
|
44
|
+
}
|
|
45
|
+
.hintIcon[data-appearance=systemError]{
|
|
46
|
+
color:var(--sn-theme-color-available-version-textDisabled, var(--sn-brand-color-text-version-disabled, rgba(65, 66, 78, 0.3490196078)));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.valueDelta{
|
|
50
|
+
color:var(--sn-theme-color-available-version-textSecondary, var(--sn-brand-color-text-version-secondary, rgba(65, 66, 78, 0.8)));
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PriceSummary.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PriceSummary.js';
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.acrylic{
|
|
3
|
+
pointer-events:none;
|
|
4
|
+
position:absolute;
|
|
5
|
+
inset:0;
|
|
6
|
+
border-radius:inherit;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.priceSummary{
|
|
10
|
+
position:relative;
|
|
11
|
+
box-sizing:border-box;
|
|
12
|
+
width:100%;
|
|
13
|
+
color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #41424e));
|
|
14
|
+
border-radius:var(--sn-block-anatomy-m-borderRadius, var(--sn-brand-anatomy-radius-block-m, var(--sn-primitive-dimension-4, 4px)));
|
|
15
|
+
padding:var(--sn-block-anatomy-m-padding, var(--sn-density-spacing-block-m-padding, var(--sn-primitive-dimension-24, 24px)));
|
|
16
|
+
border-width:var(--sn-block-anatomy-m-borderWidth, var(--sn-primitive-strokeWeight-strokeRegular, 1px));
|
|
17
|
+
}
|
|
18
|
+
.priceSummary[data-acrylic-appearance=primary][data-acrylic-level=default]{
|
|
19
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
20
|
+
}
|
|
21
|
+
.priceSummary[data-acrylic-appearance=primary][data-acrylic-level=default] .acrylic{
|
|
22
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
23
|
+
background:var(--sn-theme-color-primary-background, var(--sn-brand-color-primary-90, var(--sn-brandRole-color-brandA-90, var(--sn-primitive-color-brandA-90, #edf7f1))));
|
|
24
|
+
}
|
|
25
|
+
.priceSummary[data-acrylic-appearance=primary][data-acrylic-level="1Level"]{
|
|
26
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
27
|
+
}
|
|
28
|
+
.priceSummary[data-acrylic-appearance=primary][data-acrylic-level="1Level"] .acrylic{
|
|
29
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
30
|
+
background:var(--sn-theme-color-primary-background1Level, var(--sn-brand-color-primary-95, var(--sn-brandRole-color-brandA-95, var(--sn-primitive-color-brandA-95, #f5fdf8))));
|
|
31
|
+
}
|
|
32
|
+
.priceSummary[data-acrylic-appearance=primary][data-acrylic-level="2Level"]{
|
|
33
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
34
|
+
}
|
|
35
|
+
.priceSummary[data-acrylic-appearance=primary][data-acrylic-level="2Level"] .acrylic{
|
|
36
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
37
|
+
background:var(--sn-theme-color-primary-background2Level, var(--sn-brand-color-primary-99, var(--sn-brandRole-color-brandA-99, var(--sn-primitive-color-brandA-99, #fbfffc))));
|
|
38
|
+
}
|
|
39
|
+
.priceSummary[data-acrylic-appearance=neutral][data-acrylic-level=default]{
|
|
40
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
41
|
+
}
|
|
42
|
+
.priceSummary[data-acrylic-appearance=neutral][data-acrylic-level=default] .acrylic{
|
|
43
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
44
|
+
background:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-primitive-color-gray-90, #eeeff3)));
|
|
45
|
+
}
|
|
46
|
+
.priceSummary[data-acrylic-appearance=neutral][data-acrylic-level="1Level"]{
|
|
47
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
48
|
+
}
|
|
49
|
+
.priceSummary[data-acrylic-appearance=neutral][data-acrylic-level="1Level"] .acrylic{
|
|
50
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
51
|
+
background:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-primitive-color-gray-95, #fdfdfd)));
|
|
52
|
+
}
|
|
53
|
+
.priceSummary[data-acrylic-appearance=neutral][data-acrylic-level="2Level"]{
|
|
54
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
55
|
+
}
|
|
56
|
+
.priceSummary[data-acrylic-appearance=neutral][data-acrylic-level="2Level"] .acrylic{
|
|
57
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
58
|
+
background:var(--sn-theme-color-neutral-background2Level, var(--sn-brand-color-neutral-99, var(--sn-primitive-color-gray-99, #ffffff)));
|
|
59
|
+
}
|
|
60
|
+
.priceSummary[data-acrylic-appearance=red][data-acrylic-level=default]{
|
|
61
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
62
|
+
}
|
|
63
|
+
.priceSummary[data-acrylic-appearance=red][data-acrylic-level=default] .acrylic{
|
|
64
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
65
|
+
background:var(--sn-theme-color-red-background, var(--sn-primitive-color-red-90, #fee8e5));
|
|
66
|
+
}
|
|
67
|
+
.priceSummary[data-acrylic-appearance=red][data-acrylic-level="1Level"]{
|
|
68
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
69
|
+
}
|
|
70
|
+
.priceSummary[data-acrylic-appearance=red][data-acrylic-level="1Level"] .acrylic{
|
|
71
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
72
|
+
background:var(--sn-theme-color-red-background1Level, var(--sn-primitive-color-red-95, #fef5f1));
|
|
73
|
+
}
|
|
74
|
+
.priceSummary[data-acrylic-appearance=red][data-acrylic-level="2Level"]{
|
|
75
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
76
|
+
}
|
|
77
|
+
.priceSummary[data-acrylic-appearance=red][data-acrylic-level="2Level"] .acrylic{
|
|
78
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
79
|
+
background:var(--sn-theme-color-red-background2Level, var(--sn-primitive-color-red-99, #fffaf7));
|
|
80
|
+
}
|
|
81
|
+
.priceSummary[data-acrylic-appearance=orange][data-acrylic-level=default]{
|
|
82
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
83
|
+
}
|
|
84
|
+
.priceSummary[data-acrylic-appearance=orange][data-acrylic-level=default] .acrylic{
|
|
85
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
86
|
+
background:var(--sn-theme-color-orange-background, var(--sn-primitive-color-orange-90, #ffedcf));
|
|
87
|
+
}
|
|
88
|
+
.priceSummary[data-acrylic-appearance=orange][data-acrylic-level="1Level"]{
|
|
89
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
90
|
+
}
|
|
91
|
+
.priceSummary[data-acrylic-appearance=orange][data-acrylic-level="1Level"] .acrylic{
|
|
92
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
93
|
+
background:var(--sn-theme-color-orange-background1Level, var(--sn-primitive-color-orange-95, #fff6e5));
|
|
94
|
+
}
|
|
95
|
+
.priceSummary[data-acrylic-appearance=orange][data-acrylic-level="2Level"]{
|
|
96
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
97
|
+
}
|
|
98
|
+
.priceSummary[data-acrylic-appearance=orange][data-acrylic-level="2Level"] .acrylic{
|
|
99
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
100
|
+
background:var(--sn-theme-color-orange-background2Level, var(--sn-primitive-color-orange-99, #fffcf4));
|
|
101
|
+
}
|
|
102
|
+
.priceSummary[data-acrylic-appearance=yellow][data-acrylic-level=default]{
|
|
103
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
104
|
+
}
|
|
105
|
+
.priceSummary[data-acrylic-appearance=yellow][data-acrylic-level=default] .acrylic{
|
|
106
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
107
|
+
background:var(--sn-theme-color-yellow-background, var(--sn-primitive-color-yellow-90, #fdf4cc));
|
|
108
|
+
}
|
|
109
|
+
.priceSummary[data-acrylic-appearance=yellow][data-acrylic-level="1Level"]{
|
|
110
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
111
|
+
}
|
|
112
|
+
.priceSummary[data-acrylic-appearance=yellow][data-acrylic-level="1Level"] .acrylic{
|
|
113
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
114
|
+
background:var(--sn-theme-color-yellow-background1Level, var(--sn-primitive-color-yellow-95, #fffbe6));
|
|
115
|
+
}
|
|
116
|
+
.priceSummary[data-acrylic-appearance=yellow][data-acrylic-level="2Level"]{
|
|
117
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
118
|
+
}
|
|
119
|
+
.priceSummary[data-acrylic-appearance=yellow][data-acrylic-level="2Level"] .acrylic{
|
|
120
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
121
|
+
background:var(--sn-theme-color-yellow-background2Level, var(--sn-primitive-color-yellow-99, #fffef6));
|
|
122
|
+
}
|
|
123
|
+
.priceSummary[data-acrylic-appearance=green][data-acrylic-level=default]{
|
|
124
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
125
|
+
}
|
|
126
|
+
.priceSummary[data-acrylic-appearance=green][data-acrylic-level=default] .acrylic{
|
|
127
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
128
|
+
background:var(--sn-theme-color-green-background, var(--sn-primitive-color-green-90, #e4f5df));
|
|
129
|
+
}
|
|
130
|
+
.priceSummary[data-acrylic-appearance=green][data-acrylic-level="1Level"]{
|
|
131
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
132
|
+
}
|
|
133
|
+
.priceSummary[data-acrylic-appearance=green][data-acrylic-level="1Level"] .acrylic{
|
|
134
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
135
|
+
background:var(--sn-theme-color-green-background1Level, var(--sn-primitive-color-green-95, #f1faed));
|
|
136
|
+
}
|
|
137
|
+
.priceSummary[data-acrylic-appearance=green][data-acrylic-level="2Level"]{
|
|
138
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
139
|
+
}
|
|
140
|
+
.priceSummary[data-acrylic-appearance=green][data-acrylic-level="2Level"] .acrylic{
|
|
141
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
142
|
+
background:var(--sn-theme-color-green-background2Level, var(--sn-primitive-color-green-99, #fcfefa));
|
|
143
|
+
}
|
|
144
|
+
.priceSummary[data-acrylic-appearance=blue][data-acrylic-level=default]{
|
|
145
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
146
|
+
}
|
|
147
|
+
.priceSummary[data-acrylic-appearance=blue][data-acrylic-level=default] .acrylic{
|
|
148
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
149
|
+
background:var(--sn-theme-color-blue-background, var(--sn-primitive-color-blue-90, #e6f4fd));
|
|
150
|
+
}
|
|
151
|
+
.priceSummary[data-acrylic-appearance=blue][data-acrylic-level="1Level"]{
|
|
152
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
153
|
+
}
|
|
154
|
+
.priceSummary[data-acrylic-appearance=blue][data-acrylic-level="1Level"] .acrylic{
|
|
155
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
156
|
+
background:var(--sn-theme-color-blue-background1Level, var(--sn-primitive-color-blue-95, #f2f9ff));
|
|
157
|
+
}
|
|
158
|
+
.priceSummary[data-acrylic-appearance=blue][data-acrylic-level="2Level"]{
|
|
159
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
160
|
+
}
|
|
161
|
+
.priceSummary[data-acrylic-appearance=blue][data-acrylic-level="2Level"] .acrylic{
|
|
162
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
163
|
+
background:var(--sn-theme-color-blue-background2Level, var(--sn-primitive-color-blue-99, #fdfeff));
|
|
164
|
+
}
|
|
165
|
+
.priceSummary[data-acrylic-appearance=violet][data-acrylic-level=default]{
|
|
166
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
167
|
+
}
|
|
168
|
+
.priceSummary[data-acrylic-appearance=violet][data-acrylic-level=default] .acrylic{
|
|
169
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
170
|
+
background:var(--sn-theme-color-violet-background, var(--sn-primitive-color-violet-90, #f3edfc));
|
|
171
|
+
}
|
|
172
|
+
.priceSummary[data-acrylic-appearance=violet][data-acrylic-level="1Level"]{
|
|
173
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
174
|
+
}
|
|
175
|
+
.priceSummary[data-acrylic-appearance=violet][data-acrylic-level="1Level"] .acrylic{
|
|
176
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
177
|
+
background:var(--sn-theme-color-violet-background1Level, var(--sn-primitive-color-violet-95, #f9f5ff));
|
|
178
|
+
}
|
|
179
|
+
.priceSummary[data-acrylic-appearance=violet][data-acrylic-level="2Level"]{
|
|
180
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
181
|
+
}
|
|
182
|
+
.priceSummary[data-acrylic-appearance=violet][data-acrylic-level="2Level"] .acrylic{
|
|
183
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
184
|
+
background:var(--sn-theme-color-violet-background2Level, var(--sn-primitive-color-violet-99, #fdfdfd));
|
|
185
|
+
}
|
|
186
|
+
.priceSummary[data-acrylic-appearance=pink][data-acrylic-level=default]{
|
|
187
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
188
|
+
}
|
|
189
|
+
.priceSummary[data-acrylic-appearance=pink][data-acrylic-level=default] .acrylic{
|
|
190
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
191
|
+
background:var(--sn-theme-color-pink-background, var(--sn-primitive-color-pink-90, #fceaf0));
|
|
192
|
+
}
|
|
193
|
+
.priceSummary[data-acrylic-appearance=pink][data-acrylic-level="1Level"]{
|
|
194
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
195
|
+
}
|
|
196
|
+
.priceSummary[data-acrylic-appearance=pink][data-acrylic-level="1Level"] .acrylic{
|
|
197
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
198
|
+
background:var(--sn-theme-color-pink-background1Level, var(--sn-primitive-color-pink-95, #fff5f7));
|
|
199
|
+
}
|
|
200
|
+
.priceSummary[data-acrylic-appearance=pink][data-acrylic-level="2Level"]{
|
|
201
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
202
|
+
}
|
|
203
|
+
.priceSummary[data-acrylic-appearance=pink][data-acrylic-level="2Level"] .acrylic{
|
|
204
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
205
|
+
background:var(--sn-theme-color-pink-background2Level, var(--sn-primitive-color-pink-99, #fdfcfc));
|
|
206
|
+
}
|
|
207
|
+
.priceSummary[data-acrylic-appearance=transparent]{
|
|
208
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
209
|
+
}
|
|
210
|
+
.priceSummary[data-acrylic-appearance=transparent] .acrylic{
|
|
211
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
212
|
+
background:transparent;
|
|
213
|
+
}
|
|
214
|
+
.priceSummary[data-acrylic-appearance=decorTransparent]{
|
|
215
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
216
|
+
}
|
|
217
|
+
.priceSummary[data-acrylic-appearance=decorTransparent] .acrylic{
|
|
218
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
219
|
+
background:var(--sn-theme-color-neutral-decorTransparent, var(--sn-brand-color-neutral-transparent-forLightMode, rgba(124, 131, 182, 0.0784313725)));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.content{
|
|
223
|
+
position:relative;
|
|
224
|
+
display:flex;
|
|
225
|
+
flex-direction:column;
|
|
226
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
227
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LinkProps } from '@cloud-ru/ds-link';
|
|
2
|
+
import { WithSupportProps } from '@cloud-ru/ds-utils';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { ContentBlockProps } from '../ContentBlock/index.js';
|
|
5
|
+
export type PriceSummarySmallProps = WithSupportProps<ContentBlockProps & {
|
|
6
|
+
/** Итоговая сумма. */
|
|
7
|
+
value: number | undefined;
|
|
8
|
+
/** Function-ссылка внизу блока. */
|
|
9
|
+
docsLink?: {
|
|
10
|
+
href?: LinkProps['href'];
|
|
11
|
+
label?: LinkProps['label'];
|
|
12
|
+
};
|
|
13
|
+
/** Контент подсказки для иконки рядом с итоговой суммой. */
|
|
14
|
+
hintTooltipText?: ReactNode;
|
|
15
|
+
/** Дополнительный класс корневого контейнера. */
|
|
16
|
+
className?: string;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function PriceSummarySmall({ value, docsLink, hintTooltipText, loading, dataError, onRetry, className, ...rest }: PriceSummarySmallProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
3
|
+
import { NotifierInfoFilledSVG } from '@cloud-ru/ds-icons/interface/system';
|
|
4
|
+
import { BACKGROUND_PREDEFINED_FILL, backgroundPredefinedFillToAcrylic } from '@cloud-ru/ds-materials';
|
|
5
|
+
import { QuestionTooltip } from '@cloud-ru/ds-tooltip';
|
|
6
|
+
import { SIZE, Typography, VARIANT } from '@cloud-ru/ds-typography';
|
|
7
|
+
import { extractSupportProps } from '@cloud-ru/ds-utils';
|
|
8
|
+
import cn from 'classnames';
|
|
9
|
+
import { formatCurrency } from '../../helpers/index.js';
|
|
10
|
+
import { priceSummaryLocale } from '../../locale/index.js';
|
|
11
|
+
import { ContentBlock } from '../ContentBlock/index.js';
|
|
12
|
+
import styles from './styles.module.css';
|
|
13
|
+
export function PriceSummarySmall({ value = 0, docsLink, hintTooltipText, loading, dataError, onRetry, className, ...rest }) {
|
|
14
|
+
const { t } = priceSummaryLocale.useTranslations();
|
|
15
|
+
const { appearance, level } = backgroundPredefinedFillToAcrylic(BACKGROUND_PREDEFINED_FILL.NeutralBackground1Level);
|
|
16
|
+
return (_jsxs("div", { className: cn(styles.priceSummarySmall, className), "data-acrylic-appearance": appearance, "data-acrylic-level": level, ...extractSupportProps(rest), children: [_jsx("span", { className: styles.acrylic, "aria-hidden": true, "data-acrylic-background": true }), _jsxs("div", { className: styles.content, children: [_jsx(Typography, { variant: VARIANT.body, size: SIZE.m, children: t('total') }), _jsxs(ContentBlock, { loading: loading, dataError: dataError, onRetry: onRetry, children: [_jsxs("div", { className: styles.value, children: [hintTooltipText ? (_jsx(QuestionTooltip, { tip: hintTooltipText, children: _jsx(NotifierInfoFilledSVG, { size: 16, className: styles.icon }) })) : (_jsx(NotifierInfoFilledSVG, { size: 16, className: styles.icon })), _jsx(Typography, { variant: VARIANT.title, size: SIZE.m, children: formatCurrency(value) })] }), docsLink?.href && (_jsx(Button, { as: 'a', view: 'function', size: 'm', label: docsLink.label || t('costLink'), href: docsLink.href, target: '_blank', className: styles.docLink }))] })] })] }));
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PriceSummarySmall.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PriceSummarySmall.js';
|