@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,47 @@
1
+ import { defineLocale, defineMessages } from '@cloud-ru/ds-locale';
2
+ const QUOTA_MESSAGES = defineMessages({
3
+ 'en-GB': {
4
+ quotas: 'Quotas',
5
+ widgetTitle: {
6
+ withoutProject: 'Project quotas',
7
+ quotes: 'Project quotas «{{project}}»',
8
+ noQuotes: 'Project quotas {{project}}',
9
+ },
10
+ widgetSubtitle: 'Current quota balance',
11
+ increaseQuota: 'Increase quota',
12
+ cardAvailable: 'Available',
13
+ cardRemaining: 'Remaining',
14
+ tooltipAvailable: 'Available',
15
+ tooltipUsed: 'Used',
16
+ tooltipRemaining: 'Remaining',
17
+ tooltipExhaustedHint: {
18
+ first: 'Quota exhausted.',
19
+ second: 'To increase the quota, contact the quota or organization administrator.',
20
+ },
21
+ errorText: 'Failed to load data',
22
+ errorButton: 'Refresh',
23
+ },
24
+ 'ru-RU': {
25
+ quotas: 'Квоты',
26
+ widgetTitle: {
27
+ withoutProject: 'Квоты проекта',
28
+ quotes: 'Квоты проекта «{{project}}»',
29
+ noQuotes: 'Квоты проекта {{project}}',
30
+ },
31
+ widgetSubtitle: 'Остаток по квотам на текущий момент',
32
+ increaseQuota: 'Увеличить квоту',
33
+ cardAvailable: 'Доступно',
34
+ cardRemaining: 'Остаток',
35
+ tooltipAvailable: 'Доступно',
36
+ tooltipUsed: 'Использовано',
37
+ tooltipRemaining: 'Остаток',
38
+ tooltipExhaustedHint: {
39
+ first: 'Квота исчерпана.',
40
+ second: 'Чтобы увеличить квоту, обратитесь к администратору квот или организации.',
41
+ },
42
+ errorText: 'Не удалось загрузить данные',
43
+ errorButton: 'Обновить',
44
+ },
45
+ });
46
+ /** locale компонента Quota: `quotaLocale.useTranslations()` в коде, `quotaLocale.extend(...)` в сервисе. */
47
+ export const quotaLocale = defineLocale('@cloud-ru/ds-uikit-product-quota', QUOTA_MESSAGES);
@@ -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 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { QuotaItem } from '../types.js';
2
+ export declare const checkIsExceeded: (quota: QuotaItem) => boolean;
@@ -0,0 +1 @@
1
+ export const checkIsExceeded = (quota) => quota.remains <= 0;
@@ -0,0 +1 @@
1
+ export declare function formatNumber(value: number): string;
@@ -0,0 +1,3 @@
1
+ export function formatNumber(value) {
2
+ return value.toLocaleString(undefined, { maximumFractionDigits: 2 });
3
+ }
@@ -0,0 +1,2 @@
1
+ import { QuotaItem } from '../types.js';
2
+ export declare function getPercent(quota: QuotaItem): number;
@@ -0,0 +1,6 @@
1
+ export function getPercent(quota) {
2
+ if (quota.limit === 0) {
3
+ return 100;
4
+ }
5
+ return (quota.usage / quota.limit) * 100;
6
+ }
@@ -0,0 +1,3 @@
1
+ export * from './checkIsExceeded.js';
2
+ export * from './formatNumber.js';
3
+ export * from './getPercent.js';
@@ -0,0 +1,3 @@
1
+ export * from './checkIsExceeded.js';
2
+ export * from './formatNumber.js';
3
+ export * from './getPercent.js';