@snack-uikit/attachment 0.1.28 → 0.1.29-preview-ba12ca94.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/dist/cjs/components/Attachment/Attachment.js +94 -0
- package/dist/cjs/components/Attachment/components/Emblem/Emblem.js +63 -0
- package/dist/cjs/components/Attachment/components/Emblem/index.js +25 -0
- package/dist/cjs/components/Attachment/components/index.js +25 -0
- package/dist/cjs/components/Attachment/index.js +25 -0
- package/dist/cjs/components/AttachmentSquare/AttachmentSquare.js +98 -0
- package/dist/cjs/components/AttachmentSquare/components/HoverContent/HoverContent.js +43 -0
- package/dist/cjs/components/AttachmentSquare/components/HoverContent/index.js +25 -0
- package/dist/cjs/components/AttachmentSquare/components/LoadingContent/LoadingContent.js +40 -0
- package/dist/cjs/components/AttachmentSquare/components/LoadingContent/index.js +25 -0
- package/dist/cjs/components/AttachmentSquare/components/MainContent/MainContent.js +60 -0
- package/dist/cjs/components/AttachmentSquare/components/MainContent/index.js +25 -0
- package/dist/cjs/components/AttachmentSquare/components/index.js +27 -0
- package/dist/cjs/components/AttachmentSquare/index.js +25 -0
- package/dist/cjs/components/index.js +26 -0
- package/dist/cjs/contexts.js +20 -0
- package/dist/cjs/helperComponents/Actions/Actions.js +88 -0
- package/dist/cjs/helperComponents/Actions/index.js +25 -0
- package/dist/cjs/helperComponents/Text/Text.js +40 -0
- package/dist/cjs/helperComponents/Text/index.js +25 -0
- package/dist/cjs/helperComponents/TextBlock/TextBlock.js +51 -0
- package/dist/cjs/helperComponents/TextBlock/index.js +25 -0
- package/dist/cjs/helperComponents/index.js +26 -0
- package/dist/cjs/helpers.js +25 -0
- package/dist/cjs/hooks.js +36 -0
- package/dist/cjs/index.js +25 -0
- package/dist/cjs/testIds.js +18 -0
- package/dist/cjs/types.js +5 -0
- package/dist/esm/components/Attachment/Attachment.d.ts +2 -0
- package/dist/esm/components/Attachment/components/Emblem/Emblem.d.ts +5 -0
- package/dist/esm/components/Attachment/components/Emblem/styled.module.css +15 -0
- package/dist/esm/components/Attachment/components/index.d.ts +1 -0
- package/dist/esm/components/Attachment/components/index.js +1 -0
- package/dist/esm/components/Attachment/index.js +1 -0
- package/dist/esm/components/Attachment/styles.module.css +15 -0
- package/dist/esm/components/AttachmentSquare/AttachmentSquare.d.ts +2 -0
- package/dist/esm/components/AttachmentSquare/components/HoverContent/HoverContent.d.ts +4 -0
- package/dist/esm/components/AttachmentSquare/components/HoverContent/index.js +1 -0
- package/dist/esm/components/AttachmentSquare/components/LoadingContent/LoadingContent.d.ts +1 -0
- package/dist/esm/components/AttachmentSquare/components/LoadingContent/index.js +1 -0
- package/dist/esm/components/AttachmentSquare/components/MainContent/MainContent.d.ts +6 -0
- package/dist/esm/components/AttachmentSquare/components/MainContent/index.js +1 -0
- package/dist/esm/components/AttachmentSquare/components/index.js +3 -0
- package/dist/esm/components/AttachmentSquare/components/styles.module.css +19 -0
- package/dist/esm/components/AttachmentSquare/index.js +1 -0
- package/dist/esm/components/AttachmentSquare/styles.module.css +28 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/contexts.d.ts +10 -0
- package/dist/esm/helperComponents/Actions/Actions.d.ts +7 -0
- package/dist/esm/helperComponents/Actions/index.js +1 -0
- package/dist/esm/helperComponents/Actions/styles.module.css +13 -0
- package/dist/esm/helperComponents/Text/Text.d.ts +7 -0
- package/dist/esm/helperComponents/Text/index.js +1 -0
- package/dist/esm/helperComponents/TextBlock/TextBlock.d.ts +5 -0
- package/dist/esm/helperComponents/TextBlock/index.js +1 -0
- package/dist/esm/helperComponents/TextBlock/styles.module.css +68 -0
- package/dist/esm/helperComponents/index.js +2 -0
- package/dist/esm/helpers.d.ts +3 -0
- package/dist/esm/hooks.d.ts +4 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/testIds.d.ts +11 -0
- package/dist/esm/types.d.ts +61 -0
- package/package.json +16 -12
- /package/dist/{components → cjs/components}/Attachment/Attachment.d.ts +0 -0
- /package/dist/{components → cjs/components}/Attachment/components/Emblem/Emblem.d.ts +0 -0
- /package/dist/{components → cjs/components}/Attachment/components/Emblem/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/Attachment/components/Emblem/styled.module.css +0 -0
- /package/dist/{components → cjs/components}/Attachment/components/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/Attachment/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/Attachment/styles.module.css +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/AttachmentSquare.d.ts +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/components/HoverContent/HoverContent.d.ts +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/components/HoverContent/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/components/LoadingContent/LoadingContent.d.ts +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/components/LoadingContent/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/components/MainContent/MainContent.d.ts +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/components/MainContent/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/components/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/components/styles.module.css +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/AttachmentSquare/styles.module.css +0 -0
- /package/dist/{components → cjs/components}/index.d.ts +0 -0
- /package/dist/{contexts.d.ts → cjs/contexts.d.ts} +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Actions/Actions.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Actions/index.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Actions/styles.module.css +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Text/Text.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Text/index.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/TextBlock/TextBlock.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/TextBlock/index.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/TextBlock/styles.module.css +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/index.d.ts +0 -0
- /package/dist/{helpers.d.ts → cjs/helpers.d.ts} +0 -0
- /package/dist/{hooks.d.ts → cjs/hooks.d.ts} +0 -0
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{testIds.d.ts → cjs/testIds.d.ts} +0 -0
- /package/dist/{types.d.ts → cjs/types.d.ts} +0 -0
- /package/dist/{components → esm/components}/Attachment/Attachment.js +0 -0
- /package/dist/{components → esm/components}/Attachment/components/Emblem/Emblem.js +0 -0
- /package/dist/{components/Attachment/components/Emblem/index.js → esm/components/Attachment/components/Emblem/index.d.ts} +0 -0
- /package/dist/{components/Attachment/components → esm/components/Attachment/components/Emblem}/index.js +0 -0
- /package/dist/{components/Attachment/index.js → esm/components/Attachment/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/AttachmentSquare/AttachmentSquare.js +0 -0
- /package/dist/{components → esm/components}/AttachmentSquare/components/HoverContent/HoverContent.js +0 -0
- /package/dist/{components/AttachmentSquare/components/HoverContent/index.js → esm/components/AttachmentSquare/components/HoverContent/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/AttachmentSquare/components/LoadingContent/LoadingContent.js +0 -0
- /package/dist/{components/AttachmentSquare/components/LoadingContent/index.js → esm/components/AttachmentSquare/components/LoadingContent/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/AttachmentSquare/components/MainContent/MainContent.js +0 -0
- /package/dist/{components/AttachmentSquare/components/MainContent/index.js → esm/components/AttachmentSquare/components/MainContent/index.d.ts} +0 -0
- /package/dist/{components/AttachmentSquare/components/index.js → esm/components/AttachmentSquare/components/index.d.ts} +0 -0
- /package/dist/{components/AttachmentSquare/index.js → esm/components/AttachmentSquare/index.d.ts} +0 -0
- /package/dist/{components/index.js → esm/components/index.d.ts} +0 -0
- /package/dist/{contexts.js → esm/contexts.js} +0 -0
- /package/dist/{helperComponents → esm/helperComponents}/Actions/Actions.js +0 -0
- /package/dist/{helperComponents/Actions/index.js → esm/helperComponents/Actions/index.d.ts} +0 -0
- /package/dist/{helperComponents → esm/helperComponents}/Text/Text.js +0 -0
- /package/dist/{helperComponents/Text/index.js → esm/helperComponents/Text/index.d.ts} +0 -0
- /package/dist/{helperComponents → esm/helperComponents}/TextBlock/TextBlock.js +0 -0
- /package/dist/{helperComponents/TextBlock/index.js → esm/helperComponents/TextBlock/index.d.ts} +0 -0
- /package/dist/{helperComponents/index.js → esm/helperComponents/index.d.ts} +0 -0
- /package/dist/{helpers.js → esm/helpers.js} +0 -0
- /package/dist/{hooks.js → esm/hooks.js} +0 -0
- /package/dist/{index.js → esm/index.js} +0 -0
- /package/dist/{testIds.js → esm/testIds.js} +0 -0
- /package/dist/{types.js → esm/types.js} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.content{
|
|
2
|
+
overflow:hidden;
|
|
3
|
+
display:flex;
|
|
4
|
+
flex:1;
|
|
5
|
+
flex-direction:column;
|
|
6
|
+
align-items:flex-start;
|
|
7
|
+
justify-content:flex-start;
|
|
8
|
+
}
|
|
9
|
+
.content[data-align=left]{
|
|
10
|
+
text-align:left;
|
|
11
|
+
}
|
|
12
|
+
.content[data-align=center]{
|
|
13
|
+
max-width:100%;
|
|
14
|
+
text-align:center;
|
|
15
|
+
}
|
|
16
|
+
.content[data-size=s] .title{
|
|
17
|
+
font-family:var(--sans-label-m-font-family, SB Sans Interface);
|
|
18
|
+
font-weight:var(--sans-label-m-font-weight, Semibold);
|
|
19
|
+
line-height:var(--sans-label-m-line-height, 16px);
|
|
20
|
+
font-size:var(--sans-label-m-font-size, 12px);
|
|
21
|
+
letter-spacing:var(--sans-label-m-letter-spacing, 0px);
|
|
22
|
+
paragraph-spacing:var(--sans-label-m-paragraph-spacing, 6.6px);
|
|
23
|
+
}
|
|
24
|
+
.content[data-size=s] .description,
|
|
25
|
+
.content[data-size=s] .error{
|
|
26
|
+
font-family:var(--sans-body-s-font-family, SB Sans Interface);
|
|
27
|
+
font-weight:var(--sans-body-s-font-weight, Regular);
|
|
28
|
+
line-height:var(--sans-body-s-line-height, 16px);
|
|
29
|
+
font-size:var(--sans-body-s-font-size, 12px);
|
|
30
|
+
letter-spacing:var(--sans-body-s-letter-spacing, 0.1px);
|
|
31
|
+
paragraph-spacing:var(--sans-body-s-paragraph-spacing, 6.6px);
|
|
32
|
+
}
|
|
33
|
+
.content[data-size=m] .title{
|
|
34
|
+
font-family:var(--sans-label-l-font-family, SB Sans Interface);
|
|
35
|
+
font-weight:var(--sans-label-l-font-weight, Semibold);
|
|
36
|
+
line-height:var(--sans-label-l-line-height, 20px);
|
|
37
|
+
font-size:var(--sans-label-l-font-size, 14px);
|
|
38
|
+
letter-spacing:var(--sans-label-l-letter-spacing, 0px);
|
|
39
|
+
paragraph-spacing:var(--sans-label-l-paragraph-spacing, 7.7px);
|
|
40
|
+
}
|
|
41
|
+
.content[data-size=m] .description,
|
|
42
|
+
.content[data-size=m] .error{
|
|
43
|
+
font-family:var(--sans-body-m-font-family, SB Sans Interface);
|
|
44
|
+
font-weight:var(--sans-body-m-font-weight, Regular);
|
|
45
|
+
line-height:var(--sans-body-m-line-height, 20px);
|
|
46
|
+
font-size:var(--sans-body-m-font-size, 14px);
|
|
47
|
+
letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
|
|
48
|
+
paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.title,
|
|
52
|
+
.description,
|
|
53
|
+
.error{
|
|
54
|
+
overflow:hidden;
|
|
55
|
+
width:100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.title{
|
|
59
|
+
color:var(--sys-neutral-text-main, #41424e);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.description{
|
|
63
|
+
color:var(--sys-neutral-text-light, #8b8e9b);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.error{
|
|
67
|
+
color:var(--sys-red-text-support, #ae514c);
|
|
68
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CardProps } from '@snack-uikit/card';
|
|
2
|
+
import { IconPredefinedProps } from '@snack-uikit/icon-predefined';
|
|
3
|
+
import { TruncateStringProps } from '@snack-uikit/truncate-string';
|
|
4
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
5
|
+
export type Size = 's' | 'm';
|
|
6
|
+
export type AttachmentSquareProps = WithSupportProps<{
|
|
7
|
+
/** Файл */
|
|
8
|
+
file?: File;
|
|
9
|
+
/** Колбек на клик по кнопке скачивания */
|
|
10
|
+
onDownload?(file?: File | undefined): void;
|
|
11
|
+
/** Колбек на клик по кнопке удаления */
|
|
12
|
+
onDelete?(file?: File | undefined): void;
|
|
13
|
+
/** Колбек на клик по кнопке повторения */
|
|
14
|
+
onRetry?(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Заголовок
|
|
17
|
+
* @default fileName
|
|
18
|
+
*/
|
|
19
|
+
title?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Описание
|
|
22
|
+
* @default fileExtension
|
|
23
|
+
*/
|
|
24
|
+
description?: string;
|
|
25
|
+
/** Сообщение об ошибке */
|
|
26
|
+
error?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Вариант обрезания строки:
|
|
29
|
+
* <br> - `End` - с конца;
|
|
30
|
+
* <br> - `Middle` - по середине
|
|
31
|
+
* */
|
|
32
|
+
truncateVariant?: TruncateStringProps['variant'];
|
|
33
|
+
/** Управление состоянием загрузки */
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Иконка для файла
|
|
37
|
+
* @defaultIcon FileSVG
|
|
38
|
+
*/
|
|
39
|
+
icon?: IconPredefinedProps['icon'];
|
|
40
|
+
/** Размер */
|
|
41
|
+
size?: Size;
|
|
42
|
+
}> & Pick<CardProps, 'checked' | 'disabled' | 'onClick' | 'className'>;
|
|
43
|
+
export type AttachmentProps = AttachmentSquareProps & {
|
|
44
|
+
truncate?: {
|
|
45
|
+
/**
|
|
46
|
+
* Максимальное кол-во строк заголовка
|
|
47
|
+
* @default 1
|
|
48
|
+
*/
|
|
49
|
+
title?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Максимальное кол-во строк описания
|
|
52
|
+
* @default 1
|
|
53
|
+
*/
|
|
54
|
+
description?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Максимальное кол-во строк ошибки
|
|
57
|
+
* @default 1
|
|
58
|
+
*/
|
|
59
|
+
error?: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
package/package.json
CHANGED
|
@@ -4,15 +4,18 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Attachment",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.29-preview-ba12ca94.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
11
11
|
"*.woff2"
|
|
12
12
|
],
|
|
13
13
|
"description": "",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"types": "./dist/esm/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"import": "./dist/esm/index.js",
|
|
17
|
+
"require": "./dist/cjs/index.js"
|
|
18
|
+
},
|
|
16
19
|
"homepage": "https://cloud-ru-tech.github.io/snack-uikit/packages/attachment",
|
|
17
20
|
"repository": {
|
|
18
21
|
"type": "git",
|
|
@@ -24,7 +27,8 @@
|
|
|
24
27
|
"Nikita Ershov <niershov@cloud.ru>"
|
|
25
28
|
],
|
|
26
29
|
"files": [
|
|
27
|
-
"dist",
|
|
30
|
+
"dist/cjs",
|
|
31
|
+
"dist/esm",
|
|
28
32
|
"src",
|
|
29
33
|
"./CHANGELOG.md",
|
|
30
34
|
"./LICENSE"
|
|
@@ -32,14 +36,14 @@
|
|
|
32
36
|
"license": "Apache-2.0",
|
|
33
37
|
"scripts": {},
|
|
34
38
|
"dependencies": {
|
|
35
|
-
"@snack-uikit/button": "0.17.
|
|
36
|
-
"@snack-uikit/card": "0.12.
|
|
37
|
-
"@snack-uikit/icon-predefined": "0.5.
|
|
38
|
-
"@snack-uikit/icons": "0.22.
|
|
39
|
-
"@snack-uikit/loaders": "0.5.
|
|
40
|
-
"@snack-uikit/truncate-string": "0.4.
|
|
41
|
-
"@snack-uikit/utils": "3.4.0",
|
|
39
|
+
"@snack-uikit/button": "0.17.6-preview-ba12ca94.0",
|
|
40
|
+
"@snack-uikit/card": "0.12.43-preview-ba12ca94.0",
|
|
41
|
+
"@snack-uikit/icon-predefined": "0.5.3-preview-ba12ca94.0",
|
|
42
|
+
"@snack-uikit/icons": "0.22.2-preview-ba12ca94.0",
|
|
43
|
+
"@snack-uikit/loaders": "0.5.4-preview-ba12ca94.0",
|
|
44
|
+
"@snack-uikit/truncate-string": "0.4.25-preview-ba12ca94.0",
|
|
45
|
+
"@snack-uikit/utils": "3.4.1-preview-ba12ca94.0",
|
|
42
46
|
"classnames": "2.3.2"
|
|
43
47
|
},
|
|
44
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "9ac0a3e5e530c09fa4dc050f9bc08d1849962129"
|
|
45
49
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{components → cjs/components}/AttachmentSquare/components/HoverContent/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/{components → cjs/components}/AttachmentSquare/components/LoadingContent/index.d.ts
RENAMED
|
File without changes
|
/package/dist/{components → cjs/components}/AttachmentSquare/components/MainContent/MainContent.d.ts
RENAMED
|
File without changes
|
/package/dist/{components → cjs/components}/AttachmentSquare/components/MainContent/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{components → esm/components}/AttachmentSquare/components/HoverContent/HoverContent.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{components → esm/components}/AttachmentSquare/components/MainContent/MainContent.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{components/AttachmentSquare/index.js → esm/components/AttachmentSquare/index.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{helperComponents/TextBlock/index.js → esm/helperComponents/TextBlock/index.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|