@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.
Files changed (256) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +201 -0
  3. package/README.md +408 -0
  4. package/dist/cjs/components/ContentBlock/ContentBlock.d.ts +7 -0
  5. package/dist/cjs/components/ContentBlock/ContentBlock.js +24 -0
  6. package/dist/cjs/components/ContentBlock/index.d.ts +1 -0
  7. package/dist/cjs/components/ContentBlock/index.js +17 -0
  8. package/dist/cjs/components/ContentBlock/styles.module.css +12 -0
  9. package/dist/cjs/components/PriceSummary/PriceSummary.d.ts +22 -0
  10. package/dist/cjs/components/PriceSummary/PriceSummary.js +23 -0
  11. package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.d.ts +5 -0
  12. package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.js +16 -0
  13. package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/index.d.ts +1 -0
  14. package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/index.js +17 -0
  15. package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/styles.module.css +6 -0
  16. package/dist/cjs/components/PriceSummary/components/DiscountBlock/DiscountBlock.d.ts +5 -0
  17. package/dist/cjs/components/PriceSummary/components/DiscountBlock/DiscountBlock.js +17 -0
  18. package/dist/cjs/components/PriceSummary/components/DiscountBlock/index.d.ts +1 -0
  19. package/dist/cjs/components/PriceSummary/components/DiscountBlock/index.js +17 -0
  20. package/dist/cjs/components/PriceSummary/components/DiscountBlock/styles.module.css +16 -0
  21. package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.d.ts +5 -0
  22. package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.js +16 -0
  23. package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/index.d.ts +1 -0
  24. package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/index.js +17 -0
  25. package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/styles.module.css +5 -0
  26. package/dist/cjs/components/PriceSummary/components/Divider/Divider.d.ts +1 -0
  27. package/dist/cjs/components/PriceSummary/components/Divider/Divider.js +11 -0
  28. package/dist/cjs/components/PriceSummary/components/Divider/index.d.ts +1 -0
  29. package/dist/cjs/components/PriceSummary/components/Divider/index.js +17 -0
  30. package/dist/cjs/components/PriceSummary/components/Divider/styles.module.css +6 -0
  31. package/dist/cjs/components/PriceSummary/components/HeaderBlock/HeaderBlock.d.ts +8 -0
  32. package/dist/cjs/components/PriceSummary/components/HeaderBlock/HeaderBlock.js +17 -0
  33. package/dist/cjs/components/PriceSummary/components/HeaderBlock/constants.d.ts +4 -0
  34. package/dist/cjs/components/PriceSummary/components/HeaderBlock/constants.js +7 -0
  35. package/dist/cjs/components/PriceSummary/components/HeaderBlock/index.d.ts +1 -0
  36. package/dist/cjs/components/PriceSummary/components/HeaderBlock/index.js +17 -0
  37. package/dist/cjs/components/PriceSummary/components/HeaderBlock/styles.module.css +14 -0
  38. package/dist/cjs/components/PriceSummary/components/HeaderBlock/types.d.ts +3 -0
  39. package/dist/cjs/components/PriceSummary/components/HeaderBlock/types.js +2 -0
  40. package/dist/cjs/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.d.ts +6 -0
  41. package/dist/cjs/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.js +18 -0
  42. package/dist/cjs/components/PriceSummary/components/InvoiceBlock/index.d.ts +1 -0
  43. package/dist/cjs/components/PriceSummary/components/InvoiceBlock/index.js +17 -0
  44. package/dist/cjs/components/PriceSummary/components/InvoiceBlock/styles.module.css +13 -0
  45. package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.d.ts +5 -0
  46. package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.js +23 -0
  47. package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/index.d.ts +1 -0
  48. package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/index.js +17 -0
  49. package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.css +16 -0
  50. package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.d.ts +7 -0
  51. package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.js +27 -0
  52. package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/index.d.ts +1 -0
  53. package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/index.js +17 -0
  54. package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/styles.module.css +36 -0
  55. package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.d.ts +5 -0
  56. package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.js +19 -0
  57. package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/index.d.ts +1 -0
  58. package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/index.js +17 -0
  59. package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.css +14 -0
  60. package/dist/cjs/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.d.ts +7 -0
  61. package/dist/cjs/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.js +26 -0
  62. package/dist/cjs/components/PriceSummary/components/PeriodDropdown/index.d.ts +1 -0
  63. package/dist/cjs/components/PriceSummary/components/PeriodDropdown/index.js +17 -0
  64. package/dist/cjs/components/PriceSummary/components/PeriodDropdown/styles.module.css +15 -0
  65. package/dist/cjs/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.d.ts +17 -0
  66. package/dist/cjs/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.js +22 -0
  67. package/dist/cjs/components/PriceSummary/components/TotalValueBlock/index.d.ts +1 -0
  68. package/dist/cjs/components/PriceSummary/components/TotalValueBlock/index.js +17 -0
  69. package/dist/cjs/components/PriceSummary/components/TotalValueBlock/styles.module.css +51 -0
  70. package/dist/cjs/components/PriceSummary/index.d.ts +1 -0
  71. package/dist/cjs/components/PriceSummary/index.js +17 -0
  72. package/dist/cjs/components/PriceSummary/styles.module.css +227 -0
  73. package/dist/cjs/components/PriceSummarySmall/PriceSummarySmall.d.ts +18 -0
  74. package/dist/cjs/components/PriceSummarySmall/PriceSummarySmall.js +23 -0
  75. package/dist/cjs/components/PriceSummarySmall/index.d.ts +1 -0
  76. package/dist/cjs/components/PriceSummarySmall/index.js +17 -0
  77. package/dist/cjs/components/PriceSummarySmall/styles.module.css +242 -0
  78. package/dist/cjs/components/index.d.ts +2 -0
  79. package/dist/cjs/components/index.js +18 -0
  80. package/dist/cjs/constants.d.ts +34 -0
  81. package/dist/cjs/constants.js +37 -0
  82. package/dist/cjs/helpers/formatters.d.ts +2 -0
  83. package/dist/cjs/helpers/formatters.js +14 -0
  84. package/dist/cjs/helpers/index.d.ts +1 -0
  85. package/dist/cjs/helpers/index.js +17 -0
  86. package/dist/cjs/hooks/index.d.ts +1 -0
  87. package/dist/cjs/hooks/index.js +17 -0
  88. package/dist/cjs/hooks/usePeriodFormat.d.ts +5 -0
  89. package/dist/cjs/hooks/usePeriodFormat.js +21 -0
  90. package/dist/cjs/index.d.ts +5 -0
  91. package/dist/cjs/index.js +21 -0
  92. package/dist/cjs/locale/index.d.ts +107 -0
  93. package/dist/cjs/locale/index.js +58 -0
  94. package/dist/cjs/package.json +3 -0
  95. package/dist/cjs/style.css +673 -0
  96. package/dist/cjs/types.d.ts +79 -0
  97. package/dist/cjs/types.js +2 -0
  98. package/dist/cjs/utils/getAppearanceIcon.d.ts +2 -0
  99. package/dist/cjs/utils/getAppearanceIcon.js +25 -0
  100. package/dist/cjs/utils/index.d.ts +1 -0
  101. package/dist/cjs/utils/index.js +17 -0
  102. package/dist/esm/components/ContentBlock/ContentBlock.d.ts +7 -0
  103. package/dist/esm/components/ContentBlock/ContentBlock.js +18 -0
  104. package/dist/esm/components/ContentBlock/index.d.ts +1 -0
  105. package/dist/esm/components/ContentBlock/index.js +1 -0
  106. package/dist/esm/components/ContentBlock/styles.module.css +12 -0
  107. package/dist/esm/components/PriceSummary/PriceSummary.d.ts +22 -0
  108. package/dist/esm/components/PriceSummary/PriceSummary.js +17 -0
  109. package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.d.ts +5 -0
  110. package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.js +10 -0
  111. package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/index.d.ts +1 -0
  112. package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/index.js +1 -0
  113. package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/styles.module.css +6 -0
  114. package/dist/esm/components/PriceSummary/components/DiscountBlock/DiscountBlock.d.ts +5 -0
  115. package/dist/esm/components/PriceSummary/components/DiscountBlock/DiscountBlock.js +11 -0
  116. package/dist/esm/components/PriceSummary/components/DiscountBlock/index.d.ts +1 -0
  117. package/dist/esm/components/PriceSummary/components/DiscountBlock/index.js +1 -0
  118. package/dist/esm/components/PriceSummary/components/DiscountBlock/styles.module.css +16 -0
  119. package/dist/esm/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.d.ts +5 -0
  120. package/dist/esm/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.js +10 -0
  121. package/dist/esm/components/PriceSummary/components/DiscountPercentCell/index.d.ts +1 -0
  122. package/dist/esm/components/PriceSummary/components/DiscountPercentCell/index.js +1 -0
  123. package/dist/esm/components/PriceSummary/components/DiscountPercentCell/styles.module.css +5 -0
  124. package/dist/esm/components/PriceSummary/components/Divider/Divider.d.ts +1 -0
  125. package/dist/esm/components/PriceSummary/components/Divider/Divider.js +5 -0
  126. package/dist/esm/components/PriceSummary/components/Divider/index.d.ts +1 -0
  127. package/dist/esm/components/PriceSummary/components/Divider/index.js +1 -0
  128. package/dist/esm/components/PriceSummary/components/Divider/styles.module.css +6 -0
  129. package/dist/esm/components/PriceSummary/components/HeaderBlock/HeaderBlock.d.ts +8 -0
  130. package/dist/esm/components/PriceSummary/components/HeaderBlock/HeaderBlock.js +11 -0
  131. package/dist/esm/components/PriceSummary/components/HeaderBlock/constants.d.ts +4 -0
  132. package/dist/esm/components/PriceSummary/components/HeaderBlock/constants.js +4 -0
  133. package/dist/esm/components/PriceSummary/components/HeaderBlock/index.d.ts +1 -0
  134. package/dist/esm/components/PriceSummary/components/HeaderBlock/index.js +1 -0
  135. package/dist/esm/components/PriceSummary/components/HeaderBlock/styles.module.css +14 -0
  136. package/dist/esm/components/PriceSummary/components/HeaderBlock/types.d.ts +3 -0
  137. package/dist/esm/components/PriceSummary/components/HeaderBlock/types.js +1 -0
  138. package/dist/esm/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.d.ts +6 -0
  139. package/dist/esm/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.js +12 -0
  140. package/dist/esm/components/PriceSummary/components/InvoiceBlock/index.d.ts +1 -0
  141. package/dist/esm/components/PriceSummary/components/InvoiceBlock/index.js +1 -0
  142. package/dist/esm/components/PriceSummary/components/InvoiceBlock/styles.module.css +13 -0
  143. package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.d.ts +5 -0
  144. package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.js +17 -0
  145. package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/index.d.ts +1 -0
  146. package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/index.js +1 -0
  147. package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.css +16 -0
  148. package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.d.ts +7 -0
  149. package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.js +21 -0
  150. package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/index.d.ts +1 -0
  151. package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/index.js +1 -0
  152. package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/styles.module.css +36 -0
  153. package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.d.ts +5 -0
  154. package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.js +13 -0
  155. package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/index.d.ts +1 -0
  156. package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/index.js +1 -0
  157. package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.css +14 -0
  158. package/dist/esm/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.d.ts +7 -0
  159. package/dist/esm/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.js +20 -0
  160. package/dist/esm/components/PriceSummary/components/PeriodDropdown/index.d.ts +1 -0
  161. package/dist/esm/components/PriceSummary/components/PeriodDropdown/index.js +1 -0
  162. package/dist/esm/components/PriceSummary/components/PeriodDropdown/styles.module.css +15 -0
  163. package/dist/esm/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.d.ts +17 -0
  164. package/dist/esm/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.js +16 -0
  165. package/dist/esm/components/PriceSummary/components/TotalValueBlock/index.d.ts +1 -0
  166. package/dist/esm/components/PriceSummary/components/TotalValueBlock/index.js +1 -0
  167. package/dist/esm/components/PriceSummary/components/TotalValueBlock/styles.module.css +51 -0
  168. package/dist/esm/components/PriceSummary/index.d.ts +1 -0
  169. package/dist/esm/components/PriceSummary/index.js +1 -0
  170. package/dist/esm/components/PriceSummary/styles.module.css +227 -0
  171. package/dist/esm/components/PriceSummarySmall/PriceSummarySmall.d.ts +18 -0
  172. package/dist/esm/components/PriceSummarySmall/PriceSummarySmall.js +17 -0
  173. package/dist/esm/components/PriceSummarySmall/index.d.ts +1 -0
  174. package/dist/esm/components/PriceSummarySmall/index.js +1 -0
  175. package/dist/esm/components/PriceSummarySmall/styles.module.css +242 -0
  176. package/dist/esm/components/index.d.ts +2 -0
  177. package/dist/esm/components/index.js +2 -0
  178. package/dist/esm/constants.d.ts +34 -0
  179. package/dist/esm/constants.js +34 -0
  180. package/dist/esm/helpers/formatters.d.ts +2 -0
  181. package/dist/esm/helpers/formatters.js +10 -0
  182. package/dist/esm/helpers/index.d.ts +1 -0
  183. package/dist/esm/helpers/index.js +1 -0
  184. package/dist/esm/hooks/index.d.ts +1 -0
  185. package/dist/esm/hooks/index.js +1 -0
  186. package/dist/esm/hooks/usePeriodFormat.d.ts +5 -0
  187. package/dist/esm/hooks/usePeriodFormat.js +17 -0
  188. package/dist/esm/index.d.ts +5 -0
  189. package/dist/esm/index.js +5 -0
  190. package/dist/esm/locale/index.d.ts +107 -0
  191. package/dist/esm/locale/index.js +55 -0
  192. package/dist/esm/style.css +673 -0
  193. package/dist/esm/types.d.ts +79 -0
  194. package/dist/esm/types.js +1 -0
  195. package/dist/esm/utils/getAppearanceIcon.d.ts +2 -0
  196. package/dist/esm/utils/getAppearanceIcon.js +22 -0
  197. package/dist/esm/utils/index.d.ts +1 -0
  198. package/dist/esm/utils/index.js +1 -0
  199. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  200. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  201. package/package.json +61 -0
  202. package/src/components/ContentBlock/ContentBlock.tsx +41 -0
  203. package/src/components/ContentBlock/index.ts +1 -0
  204. package/src/components/ContentBlock/styles.module.scss +14 -0
  205. package/src/components/PriceSummary/PriceSummary.tsx +107 -0
  206. package/src/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.tsx +32 -0
  207. package/src/components/PriceSummary/components/CoveredByGrantLabel/index.ts +1 -0
  208. package/src/components/PriceSummary/components/CoveredByGrantLabel/styles.module.scss +8 -0
  209. package/src/components/PriceSummary/components/DiscountBlock/DiscountBlock.tsx +42 -0
  210. package/src/components/PriceSummary/components/DiscountBlock/index.ts +1 -0
  211. package/src/components/PriceSummary/components/DiscountBlock/styles.module.scss +17 -0
  212. package/src/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.tsx +30 -0
  213. package/src/components/PriceSummary/components/DiscountPercentCell/index.ts +1 -0
  214. package/src/components/PriceSummary/components/DiscountPercentCell/styles.module.scss +7 -0
  215. package/src/components/PriceSummary/components/Divider/Divider.tsx +5 -0
  216. package/src/components/PriceSummary/components/Divider/index.ts +1 -0
  217. package/src/components/PriceSummary/components/Divider/styles.module.scss +8 -0
  218. package/src/components/PriceSummary/components/HeaderBlock/HeaderBlock.tsx +41 -0
  219. package/src/components/PriceSummary/components/HeaderBlock/constants.ts +4 -0
  220. package/src/components/PriceSummary/components/HeaderBlock/index.ts +1 -0
  221. package/src/components/PriceSummary/components/HeaderBlock/styles.module.scss +16 -0
  222. package/src/components/PriceSummary/components/HeaderBlock/types.ts +5 -0
  223. package/src/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.tsx +37 -0
  224. package/src/components/PriceSummary/components/InvoiceBlock/index.ts +1 -0
  225. package/src/components/PriceSummary/components/InvoiceBlock/styles.module.scss +15 -0
  226. package/src/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.tsx +63 -0
  227. package/src/components/PriceSummary/components/InvoiceDetailsBlock/index.ts +1 -0
  228. package/src/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.scss +18 -0
  229. package/src/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.tsx +82 -0
  230. package/src/components/PriceSummary/components/InvoiceItemBlock/index.ts +1 -0
  231. package/src/components/PriceSummary/components/InvoiceItemBlock/styles.module.scss +42 -0
  232. package/src/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.tsx +37 -0
  233. package/src/components/PriceSummary/components/InvoiceItemLabelCell/index.ts +1 -0
  234. package/src/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.scss +16 -0
  235. package/src/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.tsx +54 -0
  236. package/src/components/PriceSummary/components/PeriodDropdown/index.ts +1 -0
  237. package/src/components/PriceSummary/components/PeriodDropdown/styles.module.scss +18 -0
  238. package/src/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.tsx +82 -0
  239. package/src/components/PriceSummary/components/TotalValueBlock/index.ts +1 -0
  240. package/src/components/PriceSummary/components/TotalValueBlock/styles.module.scss +54 -0
  241. package/src/components/PriceSummary/index.ts +1 -0
  242. package/src/components/PriceSummary/styles.module.scss +27 -0
  243. package/src/components/PriceSummarySmall/PriceSummarySmall.tsx +89 -0
  244. package/src/components/PriceSummarySmall/index.ts +1 -0
  245. package/src/components/PriceSummarySmall/styles.module.scss +42 -0
  246. package/src/components/index.ts +2 -0
  247. package/src/constants.ts +37 -0
  248. package/src/helpers/formatters.ts +12 -0
  249. package/src/helpers/index.ts +1 -0
  250. package/src/hooks/index.ts +1 -0
  251. package/src/hooks/usePeriodFormat.ts +30 -0
  252. package/src/index.ts +5 -0
  253. package/src/locale/index.ts +59 -0
  254. package/src/types.ts +93 -0
  255. package/src/utils/getAppearanceIcon.tsx +26 -0
  256. package/src/utils/index.ts +1 -0
@@ -0,0 +1,79 @@
1
+ import { QuestionTooltipProps } from '@cloud-ru/ds-tooltip';
2
+ import { ValueOf } from '@cloud-ru/ds-utils';
3
+ import { APPEARANCE_STATE, PRICE_PERIOD } from './constants.js';
4
+ export type PricePeriod = ValueOf<typeof PRICE_PERIOD>;
5
+ /** Префикс перед итоговой суммой: без префикса (`equal`) или «от» (`from`). */
6
+ export type TotalSumType = 'equal' | 'from';
7
+ /** Визуальное состояние подсказки и дельты общей суммы. */
8
+ export type AppearanceState = ValueOf<typeof APPEARANCE_STATE>;
9
+ export type DiscountItem = {
10
+ /** Сумма скидки в валюте (в UI выводится со знаком «−»). */
11
+ value: number;
12
+ /** Процент скидки для бейджа `−N%`. */
13
+ percent?: number;
14
+ /** Контент тултипа-пояснения к скидке. */
15
+ tooltip?: QuestionTooltipProps['tip'];
16
+ };
17
+ export type DiscountDetails = {
18
+ /** Базовая цена до применения скидок. */
19
+ price: number;
20
+ /** Список применённых скидок. */
21
+ discounts: DiscountItem[];
22
+ };
23
+ export type PriceInvoiceItem = {
24
+ /** Подпись строки детализации. */
25
+ label: string;
26
+ /** Скидка для строки с ценой. */
27
+ discount?: DiscountItem;
28
+ };
29
+ export type DiscountInvoiceItem = {
30
+ /** Скидка без собственной цены. */
31
+ discount: DiscountItem;
32
+ };
33
+ export type BaseInvoiceItem = (PriceInvoiceItem | DiscountInvoiceItem) & {
34
+ /** Тултип для label строки детализации. */
35
+ labelTooltip?: QuestionTooltipProps['tip'];
36
+ /** Цена строки в валюте. */
37
+ price?: number;
38
+ /** Цвет цены: обычный или акцент изменения. */
39
+ priceColor?: 'default' | 'changed';
40
+ /** Скрыть колонку цены вне зависимости от значения `price`. */
41
+ hidePrice?: boolean;
42
+ /** Ограничение количества строк в label. */
43
+ labelMaxLines?: number;
44
+ /** Количество рядом с title/label (например, `×2`). */
45
+ quantity?: string | number;
46
+ /** Показать верхний разделитель перед строкой. */
47
+ topDivider?: boolean;
48
+ /** Показать нижний разделитель после строки. */
49
+ bottomDivider?: boolean;
50
+ };
51
+ export type PrimaryInvoiceItem = BaseInvoiceItem & {
52
+ /** Явная отметка основной строки. */
53
+ primary: true;
54
+ /** Флаг покрытия позиции грантом (только для primary-строк). */
55
+ coveredByGrant?: boolean;
56
+ };
57
+ export type SecondaryInvoiceItem = BaseInvoiceItem & {
58
+ /** Secondary-строка (по умолчанию, если `primary` не задан). */
59
+ primary?: false;
60
+ coveredByGrant?: never;
61
+ };
62
+ /** Строка детализации заказа. */
63
+ export type InvoiceItem = PrimaryInvoiceItem | SecondaryInvoiceItem;
64
+ export type InvoiceDetails = {
65
+ /** Заголовок секции детализации. */
66
+ title?: string;
67
+ /** Количество рядом с заголовком секции. */
68
+ quantity?: string | number;
69
+ /** Цена секции детализации. */
70
+ price?: number;
71
+ /** Строки секции детализации. */
72
+ items: InvoiceItem[];
73
+ };
74
+ export type PriceDeltaDetails = {
75
+ /** Величина изменения цены. */
76
+ value: number;
77
+ /** Тип изменения: повышение или снижение. */
78
+ type: 'increased' | 'decreased';
79
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { AppearanceState } from '../types.js';
2
+ export declare function getAppearanceIcon(appearance: AppearanceState, className?: string): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CrossSVG, NotifierInfoFilledSVG, NotifierWarningFilledSVG, QuestionSVG } from '@cloud-ru/ds-icons/interface/system';
3
+ import { APPEARANCE_STATE } from '../constants.js';
4
+ export function getAppearanceIcon(appearance, className) {
5
+ let Component;
6
+ switch (appearance) {
7
+ case APPEARANCE_STATE.Warning:
8
+ Component = NotifierWarningFilledSVG;
9
+ break;
10
+ case APPEARANCE_STATE.UserError:
11
+ Component = CrossSVG;
12
+ break;
13
+ case APPEARANCE_STATE.SystemError:
14
+ Component = QuestionSVG;
15
+ break;
16
+ case APPEARANCE_STATE.Default:
17
+ default:
18
+ Component = NotifierInfoFilledSVG;
19
+ break;
20
+ }
21
+ return _jsx(Component, { size: 16, "data-appearance": appearance, className: className });
22
+ }
@@ -0,0 +1 @@
1
+ export * from './getAppearanceIcon.js';
@@ -0,0 +1 @@
1
+ export * from './getAppearanceIcon.js';