@cloud-ru/ds-uikit-product-quota 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 (183) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +201 -0
  3. package/README.md +458 -0
  4. package/dist/cjs/components/QuotaWidget/QuotaIncreaseButton.d.ts +4 -0
  5. package/dist/cjs/components/QuotaWidget/QuotaIncreaseButton.js +15 -0
  6. package/dist/cjs/components/QuotaWidget/QuotaMobileHeader.d.ts +4 -0
  7. package/dist/cjs/components/QuotaWidget/QuotaMobileHeader.js +15 -0
  8. package/dist/cjs/components/QuotaWidget/QuotaWidget.d.ts +12 -0
  9. package/dist/cjs/components/QuotaWidget/QuotaWidget.js +44 -0
  10. package/dist/cjs/components/QuotaWidget/QuotaWidgetContent.d.ts +27 -0
  11. package/dist/cjs/components/QuotaWidget/QuotaWidgetContent.js +33 -0
  12. package/dist/cjs/components/QuotaWidget/components/ProjectHeader/ProjectHeader.d.ts +7 -0
  13. package/dist/cjs/components/QuotaWidget/components/ProjectHeader/ProjectHeader.js +19 -0
  14. package/dist/cjs/components/QuotaWidget/components/ProjectHeader/index.d.ts +1 -0
  15. package/dist/cjs/components/QuotaWidget/components/ProjectHeader/index.js +17 -0
  16. package/dist/cjs/components/QuotaWidget/components/ProjectHeader/styles.module.css +30 -0
  17. package/dist/cjs/components/QuotaWidget/index.d.ts +2 -0
  18. package/dist/cjs/components/QuotaWidget/index.js +18 -0
  19. package/dist/cjs/components/QuotaWidget/styles.module.css +49 -0
  20. package/dist/cjs/components/QuotaWidgetCard/QuotaWidgetCard.d.ts +13 -0
  21. package/dist/cjs/components/QuotaWidgetCard/QuotaWidgetCard.js +53 -0
  22. package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.d.ts +6 -0
  23. package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.js +23 -0
  24. package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/index.d.ts +1 -0
  25. package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/index.js +17 -0
  26. package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/styles.module.css +34 -0
  27. package/dist/cjs/components/QuotaWidgetCard/index.d.ts +1 -0
  28. package/dist/cjs/components/QuotaWidgetCard/index.js +17 -0
  29. package/dist/cjs/components/QuotaWidgetCard/styles.module.css +97 -0
  30. package/dist/cjs/components/QuotaWidgetMini/QuotaWidgetMini.d.ts +7 -0
  31. package/dist/cjs/components/QuotaWidgetMini/QuotaWidgetMini.js +27 -0
  32. package/dist/cjs/components/QuotaWidgetMini/index.d.ts +1 -0
  33. package/dist/cjs/components/QuotaWidgetMini/index.js +17 -0
  34. package/dist/cjs/components/QuotaWidgetMini/styles.module.css +15 -0
  35. package/dist/cjs/components/index.d.ts +3 -0
  36. package/dist/cjs/components/index.js +19 -0
  37. package/dist/cjs/constants.d.ts +17 -0
  38. package/dist/cjs/constants.js +20 -0
  39. package/dist/cjs/helperComponents/QuotaCardsGrid/QuotaCardsGrid.d.ts +6 -0
  40. package/dist/cjs/helperComponents/QuotaCardsGrid/QuotaCardsGrid.js +32 -0
  41. package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/Grid.d.ts +6 -0
  42. package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/Grid.js +30 -0
  43. package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.d.ts +6 -0
  44. package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.js +16 -0
  45. package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.d.ts +1 -0
  46. package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.js +17 -0
  47. package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/styles.module.css +10 -0
  48. package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/index.d.ts +1 -0
  49. package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/index.js +17 -0
  50. package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/styles.module.css +9 -0
  51. package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.d.ts +5 -0
  52. package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.js +12 -0
  53. package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/index.d.ts +1 -0
  54. package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/index.js +17 -0
  55. package/dist/cjs/helperComponents/QuotaCardsGrid/index.d.ts +1 -0
  56. package/dist/cjs/helperComponents/QuotaCardsGrid/index.js +17 -0
  57. package/dist/cjs/helperComponents/QuotaCardsGrid/styles.module.css +16 -0
  58. package/dist/cjs/index.d.ts +5 -0
  59. package/dist/cjs/index.js +21 -0
  60. package/dist/cjs/locale/index.d.ts +91 -0
  61. package/dist/cjs/locale/index.js +50 -0
  62. package/dist/cjs/package.json +3 -0
  63. package/dist/cjs/style.css +260 -0
  64. package/dist/cjs/types.d.ts +34 -0
  65. package/dist/cjs/types.js +2 -0
  66. package/dist/cjs/utils/checkIsExceeded.d.ts +2 -0
  67. package/dist/cjs/utils/checkIsExceeded.js +5 -0
  68. package/dist/cjs/utils/formatNumber.d.ts +1 -0
  69. package/dist/cjs/utils/formatNumber.js +6 -0
  70. package/dist/cjs/utils/getPercent.d.ts +2 -0
  71. package/dist/cjs/utils/getPercent.js +9 -0
  72. package/dist/cjs/utils/index.d.ts +3 -0
  73. package/dist/cjs/utils/index.js +19 -0
  74. package/dist/esm/components/QuotaWidget/QuotaIncreaseButton.d.ts +4 -0
  75. package/dist/esm/components/QuotaWidget/QuotaIncreaseButton.js +9 -0
  76. package/dist/esm/components/QuotaWidget/QuotaMobileHeader.d.ts +4 -0
  77. package/dist/esm/components/QuotaWidget/QuotaMobileHeader.js +9 -0
  78. package/dist/esm/components/QuotaWidget/QuotaWidget.d.ts +12 -0
  79. package/dist/esm/components/QuotaWidget/QuotaWidget.js +41 -0
  80. package/dist/esm/components/QuotaWidget/QuotaWidgetContent.d.ts +27 -0
  81. package/dist/esm/components/QuotaWidget/QuotaWidgetContent.js +27 -0
  82. package/dist/esm/components/QuotaWidget/components/ProjectHeader/ProjectHeader.d.ts +7 -0
  83. package/dist/esm/components/QuotaWidget/components/ProjectHeader/ProjectHeader.js +13 -0
  84. package/dist/esm/components/QuotaWidget/components/ProjectHeader/index.d.ts +1 -0
  85. package/dist/esm/components/QuotaWidget/components/ProjectHeader/index.js +1 -0
  86. package/dist/esm/components/QuotaWidget/components/ProjectHeader/styles.module.css +30 -0
  87. package/dist/esm/components/QuotaWidget/index.d.ts +2 -0
  88. package/dist/esm/components/QuotaWidget/index.js +2 -0
  89. package/dist/esm/components/QuotaWidget/styles.module.css +49 -0
  90. package/dist/esm/components/QuotaWidgetCard/QuotaWidgetCard.d.ts +13 -0
  91. package/dist/esm/components/QuotaWidgetCard/QuotaWidgetCard.js +47 -0
  92. package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.d.ts +6 -0
  93. package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.js +17 -0
  94. package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/index.d.ts +1 -0
  95. package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/index.js +1 -0
  96. package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/styles.module.css +34 -0
  97. package/dist/esm/components/QuotaWidgetCard/index.d.ts +1 -0
  98. package/dist/esm/components/QuotaWidgetCard/index.js +1 -0
  99. package/dist/esm/components/QuotaWidgetCard/styles.module.css +97 -0
  100. package/dist/esm/components/QuotaWidgetMini/QuotaWidgetMini.d.ts +7 -0
  101. package/dist/esm/components/QuotaWidgetMini/QuotaWidgetMini.js +21 -0
  102. package/dist/esm/components/QuotaWidgetMini/index.d.ts +1 -0
  103. package/dist/esm/components/QuotaWidgetMini/index.js +1 -0
  104. package/dist/esm/components/QuotaWidgetMini/styles.module.css +15 -0
  105. package/dist/esm/components/index.d.ts +3 -0
  106. package/dist/esm/components/index.js +3 -0
  107. package/dist/esm/constants.d.ts +17 -0
  108. package/dist/esm/constants.js +17 -0
  109. package/dist/esm/helperComponents/QuotaCardsGrid/QuotaCardsGrid.d.ts +6 -0
  110. package/dist/esm/helperComponents/QuotaCardsGrid/QuotaCardsGrid.js +26 -0
  111. package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/Grid.d.ts +6 -0
  112. package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/Grid.js +24 -0
  113. package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.d.ts +6 -0
  114. package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.js +10 -0
  115. package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.d.ts +1 -0
  116. package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.js +1 -0
  117. package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/styles.module.css +10 -0
  118. package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/index.d.ts +1 -0
  119. package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/index.js +1 -0
  120. package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/styles.module.css +9 -0
  121. package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.d.ts +5 -0
  122. package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.js +9 -0
  123. package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/index.d.ts +1 -0
  124. package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/index.js +1 -0
  125. package/dist/esm/helperComponents/QuotaCardsGrid/index.d.ts +1 -0
  126. package/dist/esm/helperComponents/QuotaCardsGrid/index.js +1 -0
  127. package/dist/esm/helperComponents/QuotaCardsGrid/styles.module.css +16 -0
  128. package/dist/esm/index.d.ts +5 -0
  129. package/dist/esm/index.js +5 -0
  130. package/dist/esm/locale/index.d.ts +91 -0
  131. package/dist/esm/locale/index.js +47 -0
  132. package/dist/esm/style.css +260 -0
  133. package/dist/esm/types.d.ts +34 -0
  134. package/dist/esm/types.js +1 -0
  135. package/dist/esm/utils/checkIsExceeded.d.ts +2 -0
  136. package/dist/esm/utils/checkIsExceeded.js +1 -0
  137. package/dist/esm/utils/formatNumber.d.ts +1 -0
  138. package/dist/esm/utils/formatNumber.js +3 -0
  139. package/dist/esm/utils/getPercent.d.ts +2 -0
  140. package/dist/esm/utils/getPercent.js +6 -0
  141. package/dist/esm/utils/index.d.ts +3 -0
  142. package/dist/esm/utils/index.js +3 -0
  143. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  144. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  145. package/package.json +63 -0
  146. package/src/components/QuotaWidget/QuotaIncreaseButton.tsx +21 -0
  147. package/src/components/QuotaWidget/QuotaMobileHeader.tsx +18 -0
  148. package/src/components/QuotaWidget/QuotaWidget.tsx +109 -0
  149. package/src/components/QuotaWidget/QuotaWidgetContent.tsx +91 -0
  150. package/src/components/QuotaWidget/components/ProjectHeader/ProjectHeader.tsx +59 -0
  151. package/src/components/QuotaWidget/components/ProjectHeader/index.ts +1 -0
  152. package/src/components/QuotaWidget/components/ProjectHeader/styles.module.scss +29 -0
  153. package/src/components/QuotaWidget/index.ts +2 -0
  154. package/src/components/QuotaWidget/styles.module.scss +52 -0
  155. package/src/components/QuotaWidgetCard/QuotaWidgetCard.tsx +127 -0
  156. package/src/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.tsx +48 -0
  157. package/src/components/QuotaWidgetCard/components/QuotaTooltip/index.ts +1 -0
  158. package/src/components/QuotaWidgetCard/components/QuotaTooltip/styles.module.scss +30 -0
  159. package/src/components/QuotaWidgetCard/index.ts +1 -0
  160. package/src/components/QuotaWidgetCard/styles.module.scss +97 -0
  161. package/src/components/QuotaWidgetMini/QuotaWidgetMini.tsx +93 -0
  162. package/src/components/QuotaWidgetMini/index.ts +1 -0
  163. package/src/components/QuotaWidgetMini/styles.module.scss +18 -0
  164. package/src/components/index.ts +3 -0
  165. package/src/constants.ts +17 -0
  166. package/src/helperComponents/QuotaCardsGrid/QuotaCardsGrid.tsx +54 -0
  167. package/src/helperComponents/QuotaCardsGrid/components/Grid/Grid.tsx +47 -0
  168. package/src/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.tsx +24 -0
  169. package/src/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.ts +1 -0
  170. package/src/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/styles.module.scss +15 -0
  171. package/src/helperComponents/QuotaCardsGrid/components/Grid/index.ts +1 -0
  172. package/src/helperComponents/QuotaCardsGrid/components/Grid/styles.module.scss +12 -0
  173. package/src/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.tsx +31 -0
  174. package/src/helperComponents/QuotaCardsGrid/components/QuotaError/index.ts +1 -0
  175. package/src/helperComponents/QuotaCardsGrid/index.ts +1 -0
  176. package/src/helperComponents/QuotaCardsGrid/styles.module.scss +16 -0
  177. package/src/index.ts +5 -0
  178. package/src/locale/index.ts +51 -0
  179. package/src/types.ts +35 -0
  180. package/src/utils/checkIsExceeded.ts +3 -0
  181. package/src/utils/formatNumber.ts +3 -0
  182. package/src/utils/getPercent.ts +9 -0
  183. package/src/utils/index.ts +3 -0
@@ -0,0 +1,260 @@
1
+ .header{
2
+ display:flex;
3
+ gap:var(--sn-primitive-dimension-8, 8px);
4
+ align-items:center;
5
+ width:100%;
6
+ }
7
+
8
+ .projectWrapper{
9
+ display:flex;
10
+ flex:1 0 0;
11
+ flex-direction:column;
12
+ align-items:flex-start;
13
+ min-width:0;
14
+ }
15
+
16
+ .titleLink{
17
+ gap:var(--sn-primitive-dimension-8, 8px);
18
+ }
19
+
20
+ .subtitle{
21
+ font-family:var(--sn-regular-body-s-fontFamily, var(--sn-brand-font-fontFamily-regular-body, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
22
+ font-weight:var(--sn-regular-body-s-fontWeight, var(--sn-theme-typography-fontWeight-regular-body-s, var(--sn-brand-font-fontWeight-light-regular-body-s, var(--sn-primitive-font-fontWeightValue-400, 400))));
23
+ line-height:var(--sn-regular-body-s-lineHeight, var(--sn-density-typography-roleBody-lineHeightS, var(--sn-primitive-font-lineHeight-by14, 20px)));
24
+ font-size:var(--sn-regular-body-s-fontSize, var(--sn-density-typography-roleBody-fontSizeS, var(--sn-primitive-font-fontSize-14, 14px)));
25
+ letter-spacing:var(--sn-regular-body-s-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
26
+ paragraph-spacing:var(--sn-regular-body-s-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize12, 6px));
27
+ width:100%;
28
+ margin:0;
29
+ color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
30
+ }
31
+ @charset "UTF-8";
32
+ .content{
33
+ display:flex;
34
+ flex-direction:column;
35
+ gap:var(--sn-primitive-dimension-16, 16px);
36
+ align-items:flex-start;
37
+ width:620px;
38
+ min-width:620px;
39
+ padding:var(--sn-primitive-dimension-12, 12px) var(--sn-primitive-dimension-16, 16px);
40
+ }
41
+ .content[data-mobile=true]{
42
+ width:100%;
43
+ min-width:0;
44
+ height:100%;
45
+ padding:0;
46
+ }
47
+ .increaseButton{
48
+ width:100%;
49
+ }
50
+ .mobileHeader{
51
+ display:flex;
52
+ flex-direction:column;
53
+ gap:var(--sn-primitive-dimension-2, 2px);
54
+ align-items:flex-start;
55
+ width:100%;
56
+ }
57
+
58
+ .mobileTitle{
59
+ font-family:var(--sn-regular-title-l-fontFamily, var(--sn-brand-font-fontFamily-regular-title, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
60
+ font-weight:var(--sn-regular-title-l-fontWeight, var(--sn-theme-typography-fontWeight-regular-title-l, var(--sn-brand-font-fontWeight-light-regular-title-l, var(--sn-primitive-font-fontWeightValue-600, 600))));
61
+ line-height:var(--sn-regular-title-l-lineHeight, var(--sn-density-typography-roleTitle-lineHeightL, var(--sn-primitive-font-lineHeight-by20, 28px)));
62
+ font-size:var(--sn-regular-title-l-fontSize, var(--sn-density-typography-roleTitle-fontSizeL, var(--sn-primitive-font-fontSize-20, 20px)));
63
+ letter-spacing:var(--sn-regular-title-l-letterSpacing, var(--sn-primitive-font-letterSpacing-l, 0.15px));
64
+ paragraph-spacing:var(--sn-regular-title-l-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize20, 10px));
65
+ margin:0;
66
+ color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #41424e));
67
+ }
68
+
69
+ .mobileSubtitle{
70
+ font-family:var(--sn-regular-body-m-fontFamily, var(--sn-brand-font-fontFamily-regular-body, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
71
+ font-weight:var(--sn-regular-body-m-fontWeight, var(--sn-theme-typography-fontWeight-regular-body-m, var(--sn-brand-font-fontWeight-light-regular-body-m, var(--sn-primitive-font-fontWeightValue-400, 400))));
72
+ line-height:var(--sn-regular-body-m-lineHeight, var(--sn-density-typography-roleBody-lineHeightM, var(--sn-primitive-font-lineHeight-by16, 24px)));
73
+ font-size:var(--sn-regular-body-m-fontSize, var(--sn-density-typography-roleBody-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px)));
74
+ letter-spacing:var(--sn-regular-body-m-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
75
+ paragraph-spacing:var(--sn-regular-body-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
76
+ width:100%;
77
+ margin:0;
78
+ color:var(--sn-theme-color-available-version-textSecondary, var(--sn-brand-color-text-version-secondary, rgba(65, 66, 78, 0.8)));
79
+ }
80
+ .content{
81
+ display:flex;
82
+ flex-direction:column;
83
+ row-gap:var(--sn-primitive-dimension-4, 4px);
84
+ align-items:stretch;
85
+ }
86
+
87
+ .lists{
88
+ display:flex;
89
+ flex-direction:column;
90
+ row-gap:var(--sn-primitive-dimension-4, 4px);
91
+ }
92
+
93
+ .row{
94
+ display:flex;
95
+ -moz-column-gap:var(--sn-primitive-dimension-8, 8px);
96
+ column-gap:var(--sn-primitive-dimension-8, 8px);
97
+ align-items:center;
98
+ justify-content:space-between;
99
+ }
100
+
101
+ .rowLabel,
102
+ .rowValue{
103
+ font-family:var(--sn-regular-body-m-fontFamily, var(--sn-brand-font-fontFamily-regular-body, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
104
+ font-weight:var(--sn-regular-body-m-fontWeight, var(--sn-theme-typography-fontWeight-regular-body-m, var(--sn-brand-font-fontWeight-light-regular-body-m, var(--sn-primitive-font-fontWeightValue-400, 400))));
105
+ line-height:var(--sn-regular-body-m-lineHeight, var(--sn-density-typography-roleBody-lineHeightM, var(--sn-primitive-font-lineHeight-by16, 24px)));
106
+ font-size:var(--sn-regular-body-m-fontSize, var(--sn-density-typography-roleBody-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px)));
107
+ letter-spacing:var(--sn-regular-body-m-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
108
+ paragraph-spacing:var(--sn-regular-body-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
109
+ }
110
+
111
+ .rowValue{
112
+ text-align:right;
113
+ }
114
+ @charset "UTF-8";
115
+ .tooltip{
116
+ display:flex;
117
+ width:100%;
118
+ max-width:100%;
119
+ }
120
+ .card{
121
+ display:flex;
122
+ flex:1 1 auto;
123
+ flex-direction:column;
124
+ row-gap:var(--sn-primitive-dimension-4, 4px);
125
+ box-sizing:border-box;
126
+ min-width:min(256px, 100%);
127
+ max-width:100%;
128
+ padding:var(--sn-primitive-dimension-8, 8px);
129
+ border-radius:var(--sn-card-anatomy-radius-s-container-borderRadius, var(--sn-brand-anatomy-radius-card-s, var(--sn-primitive-dimension-2, 2px)));
130
+ background-color:var(--sn-theme-color-neutral-decorTransparent, var(--sn-brand-color-neutral-transparent-forLightMode, rgba(124, 131, 182, 0.0784313725)));
131
+ backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
132
+ }
133
+ .card[data-exhausted=true]{
134
+ background-color:var(--sn-theme-color-red-background, var(--sn-primitive-color-red-90, #fee8e5));
135
+ }
136
+ .header{
137
+ display:flex;
138
+ gap:var(--sn-primitive-dimension-8, 8px);
139
+ align-items:flex-end;
140
+ justify-content:space-between;
141
+ width:100%;
142
+ }
143
+
144
+ .title{
145
+ flex:1 1 0;
146
+ min-width:0;
147
+ color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #41424e));
148
+ }
149
+
150
+ .percent{
151
+ font-family:var(--sn-thin-label-m-fontFamily, var(--sn-brand-font-fontFamily-thin-label, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
152
+ font-weight:var(--sn-thin-label-m-fontWeight, var(--sn-theme-typography-fontWeight-thin-label-m, var(--sn-brand-font-fontWeight-light-thin-label-m, var(--sn-primitive-font-fontWeightValue-450, 450))));
153
+ line-height:var(--sn-thin-label-m-lineHeight, var(--sn-density-typography-roleLabel-lineHeightM, var(--sn-primitive-font-lineHeight-by16, 24px)));
154
+ font-size:var(--sn-thin-label-m-fontSize, var(--sn-density-typography-roleLabel-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px)));
155
+ letter-spacing:var(--sn-thin-label-m-letterSpacing, var(--sn-primitive-font-letterSpacing-s, 0px));
156
+ paragraph-spacing:var(--sn-thin-label-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize12, 6px));
157
+ flex-shrink:0;
158
+ color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
159
+ }
160
+
161
+ .progressBar{
162
+ width:100%;
163
+ }
164
+
165
+ .info{
166
+ display:flex;
167
+ flex-direction:column;
168
+ row-gap:var(--sn-primitive-dimension-2, 2px);
169
+ width:100%;
170
+ }
171
+
172
+ .row{
173
+ display:flex;
174
+ -moz-column-gap:var(--sn-primitive-dimension-8, 8px);
175
+ column-gap:var(--sn-primitive-dimension-8, 8px);
176
+ align-items:center;
177
+ justify-content:space-between;
178
+ width:100%;
179
+ }
180
+
181
+ .label{
182
+ font-family:var(--sn-thin-label-s-fontFamily, var(--sn-brand-font-fontFamily-thin-label, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
183
+ font-weight:var(--sn-thin-label-s-fontWeight, var(--sn-theme-typography-fontWeight-thin-label-s, var(--sn-brand-font-fontWeight-light-thin-label-s, var(--sn-primitive-font-fontWeightValue-450, 450))));
184
+ line-height:var(--sn-thin-label-s-lineHeight, var(--sn-density-typography-roleLabel-lineHeightS, var(--sn-primitive-font-lineHeight-by14, 20px)));
185
+ font-size:var(--sn-thin-label-s-fontSize, var(--sn-density-typography-roleLabel-fontSizeS, var(--sn-primitive-font-fontSize-14, 14px)));
186
+ letter-spacing:var(--sn-thin-label-s-letterSpacing, var(--sn-primitive-font-letterSpacing-s, 0px));
187
+ paragraph-spacing:var(--sn-thin-label-s-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize11, 5px));
188
+ color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
189
+ }
190
+
191
+ .value{
192
+ font-family:var(--sn-thin-label-l-fontFamily, var(--sn-brand-font-fontFamily-thin-label, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
193
+ font-weight:var(--sn-thin-label-l-fontWeight, var(--sn-theme-typography-fontWeight-thin-label-l, var(--sn-brand-font-fontWeight-light-thin-label-l, var(--sn-primitive-font-fontWeightValue-450, 450))));
194
+ line-height:var(--sn-thin-label-l-lineHeight, var(--sn-density-typography-roleLabel-lineHeightL, var(--sn-primitive-font-lineHeight-by20, 28px)));
195
+ font-size:var(--sn-thin-label-l-fontSize, var(--sn-density-typography-roleLabel-fontSizeL, var(--sn-primitive-font-fontSize-20, 20px)));
196
+ letter-spacing:var(--sn-thin-label-l-letterSpacing, var(--sn-primitive-font-letterSpacing-s, 0px));
197
+ paragraph-spacing:var(--sn-thin-label-l-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
198
+ color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #41424e));
199
+ white-space:nowrap;
200
+ }
201
+
202
+ .unit{
203
+ font-family:var(--sn-thin-label-l-fontFamily, var(--sn-brand-font-fontFamily-thin-label, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
204
+ font-weight:var(--sn-thin-label-l-fontWeight, var(--sn-theme-typography-fontWeight-thin-label-l, var(--sn-brand-font-fontWeight-light-thin-label-l, var(--sn-primitive-font-fontWeightValue-450, 450))));
205
+ line-height:var(--sn-thin-label-l-lineHeight, var(--sn-density-typography-roleLabel-lineHeightL, var(--sn-primitive-font-lineHeight-by20, 28px)));
206
+ font-size:var(--sn-thin-label-l-fontSize, var(--sn-density-typography-roleLabel-fontSizeL, var(--sn-primitive-font-fontSize-20, 20px)));
207
+ letter-spacing:var(--sn-thin-label-l-letterSpacing, var(--sn-primitive-font-letterSpacing-s, 0px));
208
+ paragraph-spacing:var(--sn-thin-label-l-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
209
+ color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
210
+ }
211
+ .collapse{
212
+ width:304px;
213
+ }
214
+
215
+ .body{
216
+ display:flex;
217
+ flex-direction:column;
218
+ gap:var(--sn-primitive-dimension-16, 16px);
219
+ align-items:flex-start;
220
+ width:100%;
221
+ }
222
+
223
+ .button{
224
+ width:100%;
225
+ }
226
+ .card{
227
+ display:flex;
228
+ flex:1;
229
+ flex-direction:column;
230
+ row-gap:var(--sn-primitive-dimension-4, 4px);
231
+ min-width:0;
232
+ padding:var(--sn-primitive-dimension-8, 8px);
233
+ border-radius:var(--sn-card-anatomy-radius-s-container-borderRadius, var(--sn-brand-anatomy-radius-card-s, var(--sn-primitive-dimension-2, 2px)));
234
+ background-color:var(--sn-theme-color-neutral-decorTransparent, var(--sn-brand-color-neutral-transparent-forLightMode, rgba(124, 131, 182, 0.0784313725)));
235
+ }
236
+ .grid{
237
+ display:grid;
238
+ grid-template-columns:repeat(2, minmax(0, 1fr));
239
+ gap:var(--sn-primitive-dimension-4, 4px) var(--sn-primitive-dimension-4, 4px);
240
+ width:100%;
241
+ }
242
+ .grid[data-single=true]{
243
+ grid-template-columns:minmax(0, 1fr);
244
+ }
245
+ @charset "UTF-8";
246
+ .wrapper{
247
+ width:100%;
248
+ height:auto;
249
+ max-height:382px;
250
+ }
251
+ .wrapper[data-accordion=true]{
252
+ max-height:400px;
253
+ }
254
+ .wrapper{
255
+ }
256
+ .wrapper[data-mobile=true]{
257
+ flex:1 1 auto;
258
+ min-height:0;
259
+ max-height:none;
260
+ }
@@ -0,0 +1,34 @@
1
+ export type QuotaItem = {
2
+ /** Название квоты */
3
+ name: string;
4
+ /** Лимит квоты */
5
+ limit: number;
6
+ /** Потребление квоты */
7
+ usage: number;
8
+ /** Остаток квоты */
9
+ remains: number;
10
+ /** Единица измерения квоты */
11
+ unitDisplayName: string;
12
+ };
13
+ export type QuotaWidgetPropsBase = {
14
+ /** Список квот для отображения */
15
+ quotas: QuotaItem[];
16
+ /** Флаг отключения сортировки квот */
17
+ disableSorting?: boolean;
18
+ /** Флаг загрузки квот */
19
+ loading: boolean;
20
+ /** Флаг ошибки при загрузке квот */
21
+ error: boolean;
22
+ /** Колбек на обновление списка квот при ошибке */
23
+ onRefresh: () => void;
24
+ /** Название проекта, по которому отображаются квоты */
25
+ projectName: string;
26
+ /** Флаг наличия прав на редактирование квот */
27
+ canEditQuota: boolean;
28
+ /** Флаг скрытия кнопки увеличения квоты */
29
+ hideIncreaseQuotaButton?: boolean;
30
+ /** Колбек нажатия на кнопку увеличения квот */
31
+ onIncreaseQuotaClick?: () => void;
32
+ /** Колбек открытия виджета квот */
33
+ onWidgetOpen?: () => void;
34
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { QuotaItem } from '../types';
2
+ export declare const checkIsExceeded: (quota: QuotaItem) => boolean;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkIsExceeded = void 0;
4
+ const checkIsExceeded = (quota) => quota.remains <= 0;
5
+ exports.checkIsExceeded = checkIsExceeded;
@@ -0,0 +1 @@
1
+ export declare function formatNumber(value: number): string;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatNumber = formatNumber;
4
+ function formatNumber(value) {
5
+ return value.toLocaleString(undefined, { maximumFractionDigits: 2 });
6
+ }
@@ -0,0 +1,2 @@
1
+ import { QuotaItem } from '../types';
2
+ export declare function getPercent(quota: QuotaItem): number;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPercent = getPercent;
4
+ function getPercent(quota) {
5
+ if (quota.limit === 0) {
6
+ return 100;
7
+ }
8
+ return (quota.usage / quota.limit) * 100;
9
+ }
@@ -0,0 +1,3 @@
1
+ export * from './checkIsExceeded';
2
+ export * from './formatNumber';
3
+ export * from './getPercent';
@@ -0,0 +1,19 @@
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("./checkIsExceeded"), exports);
18
+ __exportStar(require("./formatNumber"), exports);
19
+ __exportStar(require("./getPercent"), exports);
@@ -0,0 +1,4 @@
1
+ /** Кнопка «Увеличить квоту» (outline, на всю ширину) — низ мобильного листа / footer-слот BottomSheet. */
2
+ export declare function QuotaIncreaseButton({ onClick }: {
3
+ onClick?: () => void;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button } from '@cloud-ru/ds-button';
3
+ import { quotaLocale } from '../../locale/index.js';
4
+ import styles from './styles.module.css';
5
+ /** Кнопка «Увеличить квоту» (outline, на всю ширину) — низ мобильного листа / footer-слот BottomSheet. */
6
+ export function QuotaIncreaseButton({ onClick }) {
7
+ const { t } = quotaLocale.useTranslations();
8
+ return (_jsx(Button, { className: styles.increaseButton, view: 'outline', appearance: 'neutral', label: t('increaseQuota'), size: 'm', fullWidth: true, onClick: onClick }));
9
+ }
@@ -0,0 +1,4 @@
1
+ /** Мобильная шапка квота-виджета (макет): заголовок «Квоты» + имя проекта, слева, без пиктограмм. */
2
+ export declare function QuotaMobileHeader({ projectName }: {
3
+ projectName: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { TruncateString } from '@cloud-ru/ds-truncate-string';
3
+ import { quotaLocale } from '../../locale/index.js';
4
+ import styles from './styles.module.css';
5
+ /** Мобильная шапка квота-виджета (макет): заголовок «Квоты» + имя проекта, слева, без пиктограмм. */
6
+ export function QuotaMobileHeader({ projectName }) {
7
+ const { t } = quotaLocale.useTranslations();
8
+ return (_jsxs("div", { className: styles.mobileHeader, children: [_jsx("h2", { className: styles.mobileTitle, children: t('quotas') }), _jsx("div", { className: styles.mobileSubtitle, children: _jsx(TruncateString, { maxLines: 1, text: projectName }) })] }));
9
+ }
@@ -0,0 +1,12 @@
1
+ import { ButtonProps } from '@cloud-ru/ds-button';
2
+ import { WithSupportProps } from '@cloud-ru/ds-utils';
3
+ import { QuotaWidgetPropsBase } from '../../types.js';
4
+ export type QuotaWidgetProps = WithSupportProps<QuotaWidgetPropsBase & {
5
+ /** Ссылка на страницу квот по проекту */
6
+ quotasUrl: string;
7
+ /** Колбек клика по ссылке на страницу квот по проекту */
8
+ onQuotasUrlClick?: () => void;
9
+ /** Свойства кнопки открытия виджета */
10
+ buttonProps?: Pick<ButtonProps, 'size' | 'className' | 'fullWidth' | 'label' | 'appearance' | 'disabled' | 'view'>;
11
+ }>;
12
+ export declare function QuotaWidget({ quotas, disableSorting, loading, error, onRefresh, projectName, quotasUrl, canEditQuota, hideIncreaseQuotaButton, onIncreaseQuotaClick, onWidgetOpen, onQuotasUrlClick, buttonProps, ...props }: QuotaWidgetProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isMobileLayout, useAdaptiveLayout } from '@cloud-ru/ds-adaptive';
3
+ import { Button } from '@cloud-ru/ds-button';
4
+ import { Dropdown } from '@cloud-ru/ds-dropdown';
5
+ import { ChevronDownSVG, ChevronUpSVG } from '@cloud-ru/ds-icons/interface/system';
6
+ import { useState } from 'react';
7
+ import { TEST_IDS } from '../../constants.js';
8
+ import { quotaLocale } from '../../locale/index.js';
9
+ import { checkIsExceeded } from '../../utils/index.js';
10
+ import { QuotaIncreaseButton } from './QuotaIncreaseButton.js';
11
+ import { QuotaMobileHeader } from './QuotaMobileHeader.js';
12
+ import { QuotaWidgetContent } from './QuotaWidgetContent.js';
13
+ export function QuotaWidget({ quotas, disableSorting, loading, error, onRefresh, projectName, quotasUrl, canEditQuota, hideIncreaseQuotaButton, onIncreaseQuotaClick, onWidgetOpen, onQuotasUrlClick, buttonProps, ...props }) {
14
+ const { t } = quotaLocale.useTranslations();
15
+ const [isOpen, setIsOpen] = useState(false);
16
+ const { layoutType } = useAdaptiveLayout();
17
+ const isMobile = isMobileLayout(layoutType);
18
+ const rootTestId = props['data-test-id'];
19
+ const useMatrixTestIds = Boolean(rootTestId && rootTestId !== TEST_IDS.quotaWidget.root);
20
+ const contentTestId = useMatrixTestIds && rootTestId ? `content-${rootTestId}` : TEST_IDS.quotaWidget.content;
21
+ const triggerTestId = useMatrixTestIds && rootTestId ? `trigger-${rootTestId}` : TEST_IDS.quotaWidget.trigger;
22
+ const handleOpenChange = (open) => {
23
+ setIsOpen(open);
24
+ if (open) {
25
+ onWidgetOpen?.();
26
+ }
27
+ };
28
+ const exhaustedCount = quotas.filter(checkIsExceeded).length;
29
+ // На мобилке лист full-height (snap `1`): шапку и кнопку выносим в pinned-слоты BottomSheet
30
+ // (`title` сверху, `footer` снизу), а карточки скроллятся в теле листа — как в макете.
31
+ const showMobileIncreaseButton = isMobile && canEditQuota && !error && !hideIncreaseQuotaButton;
32
+ return (_jsx(Dropdown, { ...props, placement: 'bottom-end',
33
+ // Mobile: лист на всю высоту экрана (число `1` = full-height snap; safe-area даёт сам BottomSheet).
34
+ snapPoints: [1], title: isMobile ? _jsx(QuotaMobileHeader, { projectName: projectName }) : undefined, footer: showMobileIncreaseButton ? _jsx(QuotaIncreaseButton, { onClick: onIncreaseQuotaClick }) : undefined, open: isOpen, onOpenChange: handleOpenChange, content: _jsx(QuotaWidgetContent, { quotas: quotas, disableSorting: disableSorting, loading: loading, error: error, onRefresh: onRefresh, projectName: projectName, quotasUrl: quotasUrl, canEditQuota: canEditQuota, hideIncreaseQuotaButton: hideIncreaseQuotaButton, onIncreaseQuotaClick: onIncreaseQuotaClick, onQuotasUrlClick: onQuotasUrlClick, hideMobileHeader: isMobile, hideMobileIncreaseButton: isMobile, "data-test-id": contentTestId }), children: _jsx(Button
35
+ // На мобилке триггер бордюрный (`outline` — как в макете кнопки квот),
36
+ // на desktop — плоский `function`. Переопределяется через `buttonProps.view`.
37
+ , {
38
+ // На мобилке триггер бордюрный (`outline` — как в макете кнопки квот),
39
+ // на desktop — плоский `function`. Переопределяется через `buttonProps.view`.
40
+ view: isMobile ? 'outline' : 'function', label: t('quotas'), appearance: 'neutral', iconPosition: 'after', icon: isOpen ? _jsx(ChevronUpSVG, {}) : _jsx(ChevronDownSVG, {}), counter: exhaustedCount > 0 ? { value: exhaustedCount, appearance: 'red' } : undefined, size: 'm', "data-test-id": triggerTestId, ...buttonProps }) }));
41
+ }
@@ -0,0 +1,27 @@
1
+ import { WithSupportProps } from '@cloud-ru/ds-utils';
2
+ import { QuotaWidgetPropsBase } from '../../types.js';
3
+ export type QuotaWidgetContentProps = WithSupportProps<QuotaWidgetPropsBase & {
4
+ /** Ссылка на страницу квот по проекту */
5
+ quotasUrl: string;
6
+ /** Колбек клика по ссылке на страницу квот по проекту */
7
+ onQuotasUrlClick?: () => void;
8
+ /**
9
+ * Не рендерить мобильную шапку (её выносят в pinned-`title` контейнера, напр. BottomSheet).
10
+ * На desktop не влияет.
11
+ */
12
+ hideMobileHeader?: boolean;
13
+ /**
14
+ * Не рендерить мобильную кнопку расширения (её выносят в pinned-`footer` контейнера).
15
+ * На desktop не влияет.
16
+ */
17
+ hideMobileIncreaseButton?: boolean;
18
+ }>;
19
+ /**
20
+ * Голый контент квота-виджета: шапка проекта + карточки + кнопка расширения — без триггера,
21
+ * дропдауна и аккордеона. Используется внутри `QuotaWidget` (в дропдауне/BottomSheet) и напрямую,
22
+ * когда контейнер-раскрытие даёт кто-то снаружи (напр. `sideBlock` формы уже открывает BottomSheet).
23
+ *
24
+ * На full-height BottomSheet шапка/кнопка уезжают в pinned-слоты `title`/`footer` (см. `QuotaWidget`),
25
+ * а сюда остаются только карточки — тогда `hideMobileHeader`/`hideMobileIncreaseButton` = true.
26
+ */
27
+ export declare function QuotaWidgetContent({ quotas, disableSorting, loading, error, onRefresh, projectName, quotasUrl, canEditQuota, hideIncreaseQuotaButton, onIncreaseQuotaClick, onQuotasUrlClick, hideMobileHeader, hideMobileIncreaseButton, ...props }: QuotaWidgetContentProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { isMobileLayout, useAdaptiveLayout } from '@cloud-ru/ds-adaptive';
3
+ import { TEST_IDS } from '../../constants.js';
4
+ import { QuotaCardsGrid } from '../../helperComponents/QuotaCardsGrid/index.js';
5
+ import { ProjectHeader } from './components/ProjectHeader/index.js';
6
+ import { QuotaIncreaseButton } from './QuotaIncreaseButton.js';
7
+ import { QuotaMobileHeader } from './QuotaMobileHeader.js';
8
+ import styles from './styles.module.css';
9
+ /**
10
+ * Голый контент квота-виджета: шапка проекта + карточки + кнопка расширения — без триггера,
11
+ * дропдауна и аккордеона. Используется внутри `QuotaWidget` (в дропдауне/BottomSheet) и напрямую,
12
+ * когда контейнер-раскрытие даёт кто-то снаружи (напр. `sideBlock` формы уже открывает BottomSheet).
13
+ *
14
+ * На full-height BottomSheet шапка/кнопка уезжают в pinned-слоты `title`/`footer` (см. `QuotaWidget`),
15
+ * а сюда остаются только карточки — тогда `hideMobileHeader`/`hideMobileIncreaseButton` = true.
16
+ */
17
+ export function QuotaWidgetContent({ quotas, disableSorting, loading, error, onRefresh, projectName, quotasUrl, canEditQuota, hideIncreaseQuotaButton, onIncreaseQuotaClick, onQuotasUrlClick, hideMobileHeader = false, hideMobileIncreaseButton = false, ...props }) {
18
+ const { layoutType } = useAdaptiveLayout();
19
+ const isMobile = isMobileLayout(layoutType);
20
+ const contentTestId = props['data-test-id'] ?? TEST_IDS.quotaWidget.content;
21
+ const showMobileIncreaseButton = isMobile && !hideMobileIncreaseButton && canEditQuota && !error && !hideIncreaseQuotaButton;
22
+ return (_jsxs("div", { className: styles.content, "data-mobile": isMobile, "data-test-id": contentTestId, children: [isMobile ? (
23
+ // Мобильная шапка (макет): «Квоты» + имя проекта, без пиктограммы/ссылки/подзаголовка «Остаток…».
24
+ !hideMobileHeader && _jsx(QuotaMobileHeader, { projectName: projectName })) : (
25
+ // Desktop-popover: полная шапка проекта (с пиктограммой, ссылкой и кнопкой расширения).
26
+ _jsx(ProjectHeader, { projectName: projectName, quotasUrl: quotasUrl, canEditQuota: canEditQuota, error: error, onIncreaseQuotaClick: onIncreaseQuotaClick, hideIncreaseQuotaButton: hideIncreaseQuotaButton, onQuotasUrlClick: onQuotasUrlClick })), _jsx(QuotaCardsGrid, { quotas: quotas, disableSorting: disableSorting, loading: loading, error: error, onRefresh: onRefresh }), showMobileIncreaseButton && _jsx(QuotaIncreaseButton, { onClick: onIncreaseQuotaClick })] }));
27
+ }
@@ -0,0 +1,7 @@
1
+ import { QuotaWidgetPropsBase } from '../../../../types.js';
2
+ type ProjectHeaderProps = Pick<QuotaWidgetPropsBase, 'projectName' | 'canEditQuota' | 'error' | 'hideIncreaseQuotaButton' | 'onIncreaseQuotaClick'> & {
3
+ quotasUrl: string;
4
+ onQuotasUrlClick?: () => void;
5
+ };
6
+ export declare function ProjectHeader({ projectName, quotasUrl, canEditQuota, error, onIncreaseQuotaClick, hideIncreaseQuotaButton, onQuotasUrlClick, }: ProjectHeaderProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from '@cloud-ru/ds-button';
3
+ import { QuotaSVG } from '@cloud-ru/ds-icons/interface/product';
4
+ import { TitleClickable } from '@cloud-ru/ds-uikit-product-title-clickable';
5
+ import { TEST_IDS } from '../../../../constants.js';
6
+ import { quotaLocale } from '../../../../locale/index.js';
7
+ import styles from './styles.module.css';
8
+ const RUSSIAN_CHARS_REGEXP = /[А-Яа-яЁё]/;
9
+ export function ProjectHeader({ projectName, quotasUrl, canEditQuota, error, onIncreaseQuotaClick, hideIncreaseQuotaButton, onQuotasUrlClick, }) {
10
+ const { t } = quotaLocale.useTranslations();
11
+ const widgetTitle = RUSSIAN_CHARS_REGEXP.test(projectName) ? 'widgetTitle.quotes' : 'widgetTitle.noQuotes';
12
+ return (_jsxs("div", { className: styles.header, "data-test-id": TEST_IDS.quotaWidget.projectHeader, children: [_jsxs("div", { className: styles.projectWrapper, children: [_jsx(TitleClickable, { className: styles.titleLink, title: t(widgetTitle, { project: projectName }), href: quotasUrl, target: '_blank', icon: _jsx(QuotaSVG, {}), onClick: onQuotasUrlClick }), _jsx("p", { className: styles.subtitle, children: t('widgetSubtitle') })] }), canEditQuota && !error && !hideIncreaseQuotaButton && (_jsx(Button, { view: 'outline', appearance: 'neutral', label: t('increaseQuota'), size: 'm', onClick: onIncreaseQuotaClick }))] }));
13
+ }
@@ -0,0 +1 @@
1
+ export * from './ProjectHeader.js';
@@ -0,0 +1 @@
1
+ export * from './ProjectHeader.js';
@@ -0,0 +1,30 @@
1
+ .header{
2
+ display:flex;
3
+ gap:var(--sn-primitive-dimension-8, 8px);
4
+ align-items:center;
5
+ width:100%;
6
+ }
7
+
8
+ .projectWrapper{
9
+ display:flex;
10
+ flex:1 0 0;
11
+ flex-direction:column;
12
+ align-items:flex-start;
13
+ min-width:0;
14
+ }
15
+
16
+ .titleLink{
17
+ gap:var(--sn-primitive-dimension-8, 8px);
18
+ }
19
+
20
+ .subtitle{
21
+ font-family:var(--sn-regular-body-s-fontFamily, var(--sn-brand-font-fontFamily-regular-body, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
22
+ font-weight:var(--sn-regular-body-s-fontWeight, var(--sn-theme-typography-fontWeight-regular-body-s, var(--sn-brand-font-fontWeight-light-regular-body-s, var(--sn-primitive-font-fontWeightValue-400, 400))));
23
+ line-height:var(--sn-regular-body-s-lineHeight, var(--sn-density-typography-roleBody-lineHeightS, var(--sn-primitive-font-lineHeight-by14, 20px)));
24
+ font-size:var(--sn-regular-body-s-fontSize, var(--sn-density-typography-roleBody-fontSizeS, var(--sn-primitive-font-fontSize-14, 14px)));
25
+ letter-spacing:var(--sn-regular-body-s-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
26
+ paragraph-spacing:var(--sn-regular-body-s-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize12, 6px));
27
+ width:100%;
28
+ margin:0;
29
+ color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
30
+ }
@@ -0,0 +1,2 @@
1
+ export * from './QuotaWidget.js';
2
+ export * from './QuotaWidgetContent.js';
@@ -0,0 +1,2 @@
1
+ export * from './QuotaWidget.js';
2
+ export * from './QuotaWidgetContent.js';
@@ -0,0 +1,49 @@
1
+ @charset "UTF-8";
2
+ .content{
3
+ display:flex;
4
+ flex-direction:column;
5
+ gap:var(--sn-primitive-dimension-16, 16px);
6
+ align-items:flex-start;
7
+ width:620px;
8
+ min-width:620px;
9
+ padding:var(--sn-primitive-dimension-12, 12px) var(--sn-primitive-dimension-16, 16px);
10
+ }
11
+ .content[data-mobile=true]{
12
+ width:100%;
13
+ min-width:0;
14
+ height:100%;
15
+ padding:0;
16
+ }
17
+ .increaseButton{
18
+ width:100%;
19
+ }
20
+ .mobileHeader{
21
+ display:flex;
22
+ flex-direction:column;
23
+ gap:var(--sn-primitive-dimension-2, 2px);
24
+ align-items:flex-start;
25
+ width:100%;
26
+ }
27
+
28
+ .mobileTitle{
29
+ font-family:var(--sn-regular-title-l-fontFamily, var(--sn-brand-font-fontFamily-regular-title, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
30
+ font-weight:var(--sn-regular-title-l-fontWeight, var(--sn-theme-typography-fontWeight-regular-title-l, var(--sn-brand-font-fontWeight-light-regular-title-l, var(--sn-primitive-font-fontWeightValue-600, 600))));
31
+ line-height:var(--sn-regular-title-l-lineHeight, var(--sn-density-typography-roleTitle-lineHeightL, var(--sn-primitive-font-lineHeight-by20, 28px)));
32
+ font-size:var(--sn-regular-title-l-fontSize, var(--sn-density-typography-roleTitle-fontSizeL, var(--sn-primitive-font-fontSize-20, 20px)));
33
+ letter-spacing:var(--sn-regular-title-l-letterSpacing, var(--sn-primitive-font-letterSpacing-l, 0.15px));
34
+ paragraph-spacing:var(--sn-regular-title-l-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize20, 10px));
35
+ margin:0;
36
+ color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #41424e));
37
+ }
38
+
39
+ .mobileSubtitle{
40
+ font-family:var(--sn-regular-body-m-fontFamily, var(--sn-brand-font-fontFamily-regular-body, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
41
+ font-weight:var(--sn-regular-body-m-fontWeight, var(--sn-theme-typography-fontWeight-regular-body-m, var(--sn-brand-font-fontWeight-light-regular-body-m, var(--sn-primitive-font-fontWeightValue-400, 400))));
42
+ line-height:var(--sn-regular-body-m-lineHeight, var(--sn-density-typography-roleBody-lineHeightM, var(--sn-primitive-font-lineHeight-by16, 24px)));
43
+ font-size:var(--sn-regular-body-m-fontSize, var(--sn-density-typography-roleBody-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px)));
44
+ letter-spacing:var(--sn-regular-body-m-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
45
+ paragraph-spacing:var(--sn-regular-body-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
46
+ width:100%;
47
+ margin:0;
48
+ color:var(--sn-theme-color-available-version-textSecondary, var(--sn-brand-color-text-version-secondary, rgba(65, 66, 78, 0.8)));
49
+ }