@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.
Files changed (51) hide show
  1. package/CHANGELOG.md +833 -0
  2. package/LICENSE +201 -0
  3. package/README.md +8 -0
  4. package/package.json +60 -0
  5. package/src/components/ContentBlock/ContentBlock.tsx +39 -0
  6. package/src/components/ContentBlock/index.ts +1 -0
  7. package/src/components/ContentBlock/styles.module.scss +14 -0
  8. package/src/components/PriceSummary/PriceSummary.tsx +97 -0
  9. package/src/components/PriceSummary/components/DiscountBlock/DiscountBlock.tsx +42 -0
  10. package/src/components/PriceSummary/components/DiscountBlock/index.ts +1 -0
  11. package/src/components/PriceSummary/components/DiscountBlock/styles.module.scss +17 -0
  12. package/src/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.tsx +37 -0
  13. package/src/components/PriceSummary/components/DiscountPercentCell/index.ts +1 -0
  14. package/src/components/PriceSummary/components/DiscountPercentCell/styles.module.scss +5 -0
  15. package/src/components/PriceSummary/components/Divider/Divider.tsx +5 -0
  16. package/src/components/PriceSummary/components/Divider/index.ts +1 -0
  17. package/src/components/PriceSummary/components/Divider/styles.module.scss +8 -0
  18. package/src/components/PriceSummary/components/HeaderBlock/HeaderBlock.tsx +35 -0
  19. package/src/components/PriceSummary/components/HeaderBlock/index.ts +1 -0
  20. package/src/components/PriceSummary/components/HeaderBlock/styles.module.scss +16 -0
  21. package/src/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.tsx +41 -0
  22. package/src/components/PriceSummary/components/InvoiceBlock/index.ts +1 -0
  23. package/src/components/PriceSummary/components/InvoiceBlock/styles.module.scss +20 -0
  24. package/src/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.tsx +48 -0
  25. package/src/components/PriceSummary/components/InvoiceDetailsBlock/index.ts +1 -0
  26. package/src/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.scss +18 -0
  27. package/src/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.tsx +62 -0
  28. package/src/components/PriceSummary/components/InvoiceItemBlock/index.ts +1 -0
  29. package/src/components/PriceSummary/components/InvoiceItemBlock/styles.module.scss +38 -0
  30. package/src/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.tsx +39 -0
  31. package/src/components/PriceSummary/components/InvoiceItemLabelCell/index.ts +1 -0
  32. package/src/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.scss +14 -0
  33. package/src/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.tsx +48 -0
  34. package/src/components/PriceSummary/components/PeriodDropdown/index.ts +1 -0
  35. package/src/components/PriceSummary/components/PeriodDropdown/styles.module.scss +18 -0
  36. package/src/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.tsx +104 -0
  37. package/src/components/PriceSummary/components/TotalValueBlock/index.ts +1 -0
  38. package/src/components/PriceSummary/components/TotalValueBlock/styles.module.scss +63 -0
  39. package/src/components/PriceSummary/index.ts +1 -0
  40. package/src/components/PriceSummary/styles.module.scss +14 -0
  41. package/src/components/PriceSummarySmall/PriceSummarySmall.tsx +53 -0
  42. package/src/components/PriceSummarySmall/index.ts +1 -0
  43. package/src/components/PriceSummarySmall/styles.module.scss +25 -0
  44. package/src/components/index.ts +2 -0
  45. package/src/helpers/formatters.ts +12 -0
  46. package/src/helpers/index.ts +1 -0
  47. package/src/hooks/index.ts +2 -0
  48. package/src/hooks/usePeriodFormat.ts +25 -0
  49. package/src/hooks/usePriceTotalValueFormatter.ts +14 -0
  50. package/src/index.ts +3 -0
  51. 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
+ };