@cloud-ru/uikit-product-price-summary 0.5.3
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 +833 -0
- package/LICENSE +201 -0
- package/README.md +8 -0
- package/package.json +60 -0
- package/src/components/ContentBlock/ContentBlock.tsx +39 -0
- package/src/components/ContentBlock/index.ts +1 -0
- package/src/components/ContentBlock/styles.module.scss +14 -0
- package/src/components/PriceSummary/PriceSummary.tsx +97 -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 +37 -0
- package/src/components/PriceSummary/components/DiscountPercentCell/index.ts +1 -0
- package/src/components/PriceSummary/components/DiscountPercentCell/styles.module.scss +5 -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 +35 -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/InvoiceBlock/InvoiceBlock.tsx +41 -0
- package/src/components/PriceSummary/components/InvoiceBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceBlock/styles.module.scss +20 -0
- package/src/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.tsx +48 -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 +62 -0
- package/src/components/PriceSummary/components/InvoiceItemBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceItemBlock/styles.module.scss +38 -0
- package/src/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.tsx +39 -0
- package/src/components/PriceSummary/components/InvoiceItemLabelCell/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.scss +14 -0
- package/src/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.tsx +48 -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 +104 -0
- package/src/components/PriceSummary/components/TotalValueBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/TotalValueBlock/styles.module.scss +63 -0
- package/src/components/PriceSummary/index.ts +1 -0
- package/src/components/PriceSummary/styles.module.scss +14 -0
- package/src/components/PriceSummarySmall/PriceSummarySmall.tsx +53 -0
- package/src/components/PriceSummarySmall/index.ts +1 -0
- package/src/components/PriceSummarySmall/styles.module.scss +25 -0
- package/src/components/index.ts +2 -0
- package/src/helpers/formatters.ts +12 -0
- package/src/helpers/index.ts +1 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/usePeriodFormat.ts +25 -0
- package/src/hooks/usePriceTotalValueFormatter.ts +14 -0
- package/src/index.ts +3 -0
- package/src/types/index.ts +49 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { QuestionTooltipProps } from '@cloud-ru/uikit-product-mobile-tooltip';
|
|
2
|
+
|
|
3
|
+
export enum PricePeriod {
|
|
4
|
+
Year = 'year',
|
|
5
|
+
Month = 'month',
|
|
6
|
+
Day = 'day',
|
|
7
|
+
Hour = 'hour',
|
|
8
|
+
Minute = 'minute',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type TotalSumType = 'equal' | 'from';
|
|
12
|
+
|
|
13
|
+
export type DiscountItem = {
|
|
14
|
+
value: number;
|
|
15
|
+
percent?: number;
|
|
16
|
+
tooltip?: QuestionTooltipProps['tip'];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type DiscountDetails = {
|
|
20
|
+
price: number;
|
|
21
|
+
discounts: DiscountItem[];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type PriceInvoiceItem = {
|
|
25
|
+
label: string;
|
|
26
|
+
discount?: DiscountItem;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type DiscountInvoiceItem = {
|
|
30
|
+
discount: DiscountItem;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type InvoiceItem = (PriceInvoiceItem | DiscountInvoiceItem) & {
|
|
34
|
+
labelTooltip?: QuestionTooltipProps['tip'];
|
|
35
|
+
price?: number;
|
|
36
|
+
hidePrice?: boolean;
|
|
37
|
+
labelMaxLines?: number;
|
|
38
|
+
quantity?: string | number;
|
|
39
|
+
primary?: boolean;
|
|
40
|
+
topDivider?: boolean;
|
|
41
|
+
bottomDivider?: boolean;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type InvoiceDetails = {
|
|
45
|
+
title?: string;
|
|
46
|
+
quantity?: string | number;
|
|
47
|
+
price?: number;
|
|
48
|
+
items: InvoiceItem[];
|
|
49
|
+
};
|