@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.
- package/CHANGELOG.md +8 -0
- package/LICENSE +201 -0
- package/README.md +458 -0
- package/dist/cjs/components/QuotaWidget/QuotaIncreaseButton.d.ts +4 -0
- package/dist/cjs/components/QuotaWidget/QuotaIncreaseButton.js +15 -0
- package/dist/cjs/components/QuotaWidget/QuotaMobileHeader.d.ts +4 -0
- package/dist/cjs/components/QuotaWidget/QuotaMobileHeader.js +15 -0
- package/dist/cjs/components/QuotaWidget/QuotaWidget.d.ts +12 -0
- package/dist/cjs/components/QuotaWidget/QuotaWidget.js +44 -0
- package/dist/cjs/components/QuotaWidget/QuotaWidgetContent.d.ts +27 -0
- package/dist/cjs/components/QuotaWidget/QuotaWidgetContent.js +33 -0
- package/dist/cjs/components/QuotaWidget/components/ProjectHeader/ProjectHeader.d.ts +7 -0
- package/dist/cjs/components/QuotaWidget/components/ProjectHeader/ProjectHeader.js +19 -0
- package/dist/cjs/components/QuotaWidget/components/ProjectHeader/index.d.ts +1 -0
- package/dist/cjs/components/QuotaWidget/components/ProjectHeader/index.js +17 -0
- package/dist/cjs/components/QuotaWidget/components/ProjectHeader/styles.module.css +30 -0
- package/dist/cjs/components/QuotaWidget/index.d.ts +2 -0
- package/dist/cjs/components/QuotaWidget/index.js +18 -0
- package/dist/cjs/components/QuotaWidget/styles.module.css +49 -0
- package/dist/cjs/components/QuotaWidgetCard/QuotaWidgetCard.d.ts +13 -0
- package/dist/cjs/components/QuotaWidgetCard/QuotaWidgetCard.js +53 -0
- package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.d.ts +6 -0
- package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.js +23 -0
- package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/index.d.ts +1 -0
- package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/index.js +17 -0
- package/dist/cjs/components/QuotaWidgetCard/components/QuotaTooltip/styles.module.css +34 -0
- package/dist/cjs/components/QuotaWidgetCard/index.d.ts +1 -0
- package/dist/cjs/components/QuotaWidgetCard/index.js +17 -0
- package/dist/cjs/components/QuotaWidgetCard/styles.module.css +97 -0
- package/dist/cjs/components/QuotaWidgetMini/QuotaWidgetMini.d.ts +7 -0
- package/dist/cjs/components/QuotaWidgetMini/QuotaWidgetMini.js +27 -0
- package/dist/cjs/components/QuotaWidgetMini/index.d.ts +1 -0
- package/dist/cjs/components/QuotaWidgetMini/index.js +17 -0
- package/dist/cjs/components/QuotaWidgetMini/styles.module.css +15 -0
- package/dist/cjs/components/index.d.ts +3 -0
- package/dist/cjs/components/index.js +19 -0
- package/dist/cjs/constants.d.ts +17 -0
- package/dist/cjs/constants.js +20 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/QuotaCardsGrid.d.ts +6 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/QuotaCardsGrid.js +32 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/Grid.d.ts +6 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/Grid.js +30 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.d.ts +6 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.js +16 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.d.ts +1 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.js +17 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/styles.module.css +10 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/index.d.ts +1 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/index.js +17 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/Grid/styles.module.css +9 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.d.ts +5 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.js +12 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/index.d.ts +1 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/components/QuotaError/index.js +17 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/index.d.ts +1 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/index.js +17 -0
- package/dist/cjs/helperComponents/QuotaCardsGrid/styles.module.css +16 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/locale/index.d.ts +91 -0
- package/dist/cjs/locale/index.js +50 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/style.css +260 -0
- package/dist/cjs/types.d.ts +34 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/utils/checkIsExceeded.d.ts +2 -0
- package/dist/cjs/utils/checkIsExceeded.js +5 -0
- package/dist/cjs/utils/formatNumber.d.ts +1 -0
- package/dist/cjs/utils/formatNumber.js +6 -0
- package/dist/cjs/utils/getPercent.d.ts +2 -0
- package/dist/cjs/utils/getPercent.js +9 -0
- package/dist/cjs/utils/index.d.ts +3 -0
- package/dist/cjs/utils/index.js +19 -0
- package/dist/esm/components/QuotaWidget/QuotaIncreaseButton.d.ts +4 -0
- package/dist/esm/components/QuotaWidget/QuotaIncreaseButton.js +9 -0
- package/dist/esm/components/QuotaWidget/QuotaMobileHeader.d.ts +4 -0
- package/dist/esm/components/QuotaWidget/QuotaMobileHeader.js +9 -0
- package/dist/esm/components/QuotaWidget/QuotaWidget.d.ts +12 -0
- package/dist/esm/components/QuotaWidget/QuotaWidget.js +41 -0
- package/dist/esm/components/QuotaWidget/QuotaWidgetContent.d.ts +27 -0
- package/dist/esm/components/QuotaWidget/QuotaWidgetContent.js +27 -0
- package/dist/esm/components/QuotaWidget/components/ProjectHeader/ProjectHeader.d.ts +7 -0
- package/dist/esm/components/QuotaWidget/components/ProjectHeader/ProjectHeader.js +13 -0
- package/dist/esm/components/QuotaWidget/components/ProjectHeader/index.d.ts +1 -0
- package/dist/esm/components/QuotaWidget/components/ProjectHeader/index.js +1 -0
- package/dist/esm/components/QuotaWidget/components/ProjectHeader/styles.module.css +30 -0
- package/dist/esm/components/QuotaWidget/index.d.ts +2 -0
- package/dist/esm/components/QuotaWidget/index.js +2 -0
- package/dist/esm/components/QuotaWidget/styles.module.css +49 -0
- package/dist/esm/components/QuotaWidgetCard/QuotaWidgetCard.d.ts +13 -0
- package/dist/esm/components/QuotaWidgetCard/QuotaWidgetCard.js +47 -0
- package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.d.ts +6 -0
- package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.js +17 -0
- package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/index.d.ts +1 -0
- package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/index.js +1 -0
- package/dist/esm/components/QuotaWidgetCard/components/QuotaTooltip/styles.module.css +34 -0
- package/dist/esm/components/QuotaWidgetCard/index.d.ts +1 -0
- package/dist/esm/components/QuotaWidgetCard/index.js +1 -0
- package/dist/esm/components/QuotaWidgetCard/styles.module.css +97 -0
- package/dist/esm/components/QuotaWidgetMini/QuotaWidgetMini.d.ts +7 -0
- package/dist/esm/components/QuotaWidgetMini/QuotaWidgetMini.js +21 -0
- package/dist/esm/components/QuotaWidgetMini/index.d.ts +1 -0
- package/dist/esm/components/QuotaWidgetMini/index.js +1 -0
- package/dist/esm/components/QuotaWidgetMini/styles.module.css +15 -0
- package/dist/esm/components/index.d.ts +3 -0
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/constants.d.ts +17 -0
- package/dist/esm/constants.js +17 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/QuotaCardsGrid.d.ts +6 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/QuotaCardsGrid.js +26 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/Grid.d.ts +6 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/Grid.js +24 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.d.ts +6 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.js +10 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.d.ts +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.js +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/styles.module.css +10 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/index.d.ts +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/index.js +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/Grid/styles.module.css +9 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.d.ts +5 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.js +9 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/index.d.ts +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/components/QuotaError/index.js +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/index.d.ts +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/index.js +1 -0
- package/dist/esm/helperComponents/QuotaCardsGrid/styles.module.css +16 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/locale/index.d.ts +91 -0
- package/dist/esm/locale/index.js +47 -0
- package/dist/esm/style.css +260 -0
- package/dist/esm/types.d.ts +34 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/utils/checkIsExceeded.d.ts +2 -0
- package/dist/esm/utils/checkIsExceeded.js +1 -0
- package/dist/esm/utils/formatNumber.d.ts +1 -0
- package/dist/esm/utils/formatNumber.js +3 -0
- package/dist/esm/utils/getPercent.d.ts +2 -0
- package/dist/esm/utils/getPercent.js +6 -0
- package/dist/esm/utils/index.d.ts +3 -0
- package/dist/esm/utils/index.js +3 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +63 -0
- package/src/components/QuotaWidget/QuotaIncreaseButton.tsx +21 -0
- package/src/components/QuotaWidget/QuotaMobileHeader.tsx +18 -0
- package/src/components/QuotaWidget/QuotaWidget.tsx +109 -0
- package/src/components/QuotaWidget/QuotaWidgetContent.tsx +91 -0
- package/src/components/QuotaWidget/components/ProjectHeader/ProjectHeader.tsx +59 -0
- package/src/components/QuotaWidget/components/ProjectHeader/index.ts +1 -0
- package/src/components/QuotaWidget/components/ProjectHeader/styles.module.scss +29 -0
- package/src/components/QuotaWidget/index.ts +2 -0
- package/src/components/QuotaWidget/styles.module.scss +52 -0
- package/src/components/QuotaWidgetCard/QuotaWidgetCard.tsx +127 -0
- package/src/components/QuotaWidgetCard/components/QuotaTooltip/QuotaTooltip.tsx +48 -0
- package/src/components/QuotaWidgetCard/components/QuotaTooltip/index.ts +1 -0
- package/src/components/QuotaWidgetCard/components/QuotaTooltip/styles.module.scss +30 -0
- package/src/components/QuotaWidgetCard/index.ts +1 -0
- package/src/components/QuotaWidgetCard/styles.module.scss +97 -0
- package/src/components/QuotaWidgetMini/QuotaWidgetMini.tsx +93 -0
- package/src/components/QuotaWidgetMini/index.ts +1 -0
- package/src/components/QuotaWidgetMini/styles.module.scss +18 -0
- package/src/components/index.ts +3 -0
- package/src/constants.ts +17 -0
- package/src/helperComponents/QuotaCardsGrid/QuotaCardsGrid.tsx +54 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/Grid.tsx +47 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/QuotaCardsSkeleton.tsx +24 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/index.ts +1 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/components/QuotaWidgetCardsSkeleton/styles.module.scss +15 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/index.ts +1 -0
- package/src/helperComponents/QuotaCardsGrid/components/Grid/styles.module.scss +12 -0
- package/src/helperComponents/QuotaCardsGrid/components/QuotaError/QuotaError.tsx +31 -0
- package/src/helperComponents/QuotaCardsGrid/components/QuotaError/index.ts +1 -0
- package/src/helperComponents/QuotaCardsGrid/index.ts +1 -0
- package/src/helperComponents/QuotaCardsGrid/styles.module.scss +16 -0
- package/src/index.ts +5 -0
- package/src/locale/index.ts +51 -0
- package/src/types.ts +35 -0
- package/src/utils/checkIsExceeded.ts +3 -0
- package/src/utils/formatNumber.ts +3 -0
- package/src/utils/getPercent.ts +9 -0
- 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 @@
|
|
|
1
|
+
export declare function formatNumber(value: number): string;
|
|
@@ -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,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,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,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
|
+
}
|