@alfalab/core-components-file-upload-item 8.1.2 → 8.2.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/components/actions-control/actions-control.css +8 -8
- package/components/actions-control/actions-control.module.css.js +1 -1
- package/components/content/components/content-error/content-error.css +1 -1
- package/components/content/components/content-error/content-error.module.css.js +1 -1
- package/components/content/components/content-subtitle/content-subtitle.css +3 -3
- package/components/content/components/content-subtitle/content-subtitle.js +2 -2
- package/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/components/content/components/content-subtitle/content-subtitle.module.css.js +1 -1
- package/components/content/content.css +7 -7
- package/components/content/content.module.css.js +1 -1
- package/components/status-control/extension-icon/index.css +6 -6
- package/components/status-control/extension-icon/index.module.css.js +1 -1
- package/components/status-control/index.css +8 -8
- package/components/status-control/index.module.css.js +1 -1
- package/context/file-upload-item-context.d.ts +1 -1
- package/context/file-upload-item-context.js.map +1 -1
- package/context/use-context-value.js +3 -1
- package/context/use-context-value.js.map +1 -1
- package/cssm/components/content/components/content-subtitle/content-subtitle.js +2 -2
- package/cssm/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/cssm/context/file-upload-item-context.d.ts +1 -1
- package/cssm/context/file-upload-item-context.js.map +1 -1
- package/cssm/context/use-context-value.js +3 -1
- package/cssm/context/use-context-value.js.map +1 -1
- package/cssm/types/file-upload-item-props.d.ts +6 -0
- package/esm/components/actions-control/actions-control.css +8 -8
- package/esm/components/actions-control/actions-control.module.css.js +1 -1
- package/esm/components/content/components/content-error/content-error.css +1 -1
- package/esm/components/content/components/content-error/content-error.module.css.js +1 -1
- package/esm/components/content/components/content-subtitle/content-subtitle.css +3 -3
- package/esm/components/content/components/content-subtitle/content-subtitle.js +2 -2
- package/esm/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/esm/components/content/components/content-subtitle/content-subtitle.module.css.js +1 -1
- package/esm/components/content/content.css +7 -7
- package/esm/components/content/content.module.css.js +1 -1
- package/esm/components/status-control/extension-icon/index.css +6 -6
- package/esm/components/status-control/extension-icon/index.module.css.js +1 -1
- package/esm/components/status-control/index.css +8 -8
- package/esm/components/status-control/index.module.css.js +1 -1
- package/esm/context/file-upload-item-context.d.ts +1 -1
- package/esm/context/file-upload-item-context.js.map +1 -1
- package/esm/context/use-context-value.js +3 -1
- package/esm/context/use-context-value.js.map +1 -1
- package/esm/index.css +2 -2
- package/esm/index.module.css.js +1 -1
- package/esm/types/file-upload-item-props.d.ts +6 -0
- package/index.css +2 -2
- package/index.module.css.js +1 -1
- package/modern/components/actions-control/actions-control.css +8 -8
- package/modern/components/actions-control/actions-control.module.css.js +1 -1
- package/modern/components/content/components/content-error/content-error.css +1 -1
- package/modern/components/content/components/content-error/content-error.module.css.js +1 -1
- package/modern/components/content/components/content-subtitle/content-subtitle.css +3 -3
- package/modern/components/content/components/content-subtitle/content-subtitle.js +2 -2
- package/modern/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/modern/components/content/components/content-subtitle/content-subtitle.module.css.js +1 -1
- package/modern/components/content/content.css +7 -7
- package/modern/components/content/content.module.css.js +1 -1
- package/modern/components/status-control/extension-icon/index.css +6 -6
- package/modern/components/status-control/extension-icon/index.module.css.js +1 -1
- package/modern/components/status-control/index.css +8 -8
- package/modern/components/status-control/index.module.css.js +1 -1
- package/modern/context/file-upload-item-context.d.ts +1 -1
- package/modern/context/file-upload-item-context.js.map +1 -1
- package/modern/context/use-context-value.js +3 -1
- package/modern/context/use-context-value.js.map +1 -1
- package/modern/index.css +2 -2
- package/modern/index.module.css.js +1 -1
- package/modern/types/file-upload-item-props.d.ts +6 -0
- package/moderncssm/components/content/components/content-subtitle/content-subtitle.js +2 -2
- package/moderncssm/components/content/components/content-subtitle/content-subtitle.js.map +1 -1
- package/moderncssm/context/file-upload-item-context.d.ts +1 -1
- package/moderncssm/context/file-upload-item-context.js.map +1 -1
- package/moderncssm/context/use-context-value.js +3 -1
- package/moderncssm/context/use-context-value.js.map +1 -1
- package/moderncssm/types/file-upload-item-props.d.ts +6 -0
- package/package.json +1 -1
- package/src/components/content/components/content-subtitle/content-subtitle.tsx +12 -3
- package/src/context/file-upload-item-context.ts +1 -0
- package/src/context/use-context-value.ts +3 -0
- package/src/types/file-upload-item-props.ts +8 -0
- package/types/file-upload-item-props.d.ts +6 -0
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
:root {
|
|
7
7
|
--gap-4-neg: -4px;
|
|
8
8
|
}
|
|
9
|
-
.file-upload-
|
|
9
|
+
.file-upload-item__container_htuju {
|
|
10
10
|
position: relative;
|
|
11
11
|
}
|
|
12
|
-
.file-upload-
|
|
12
|
+
.file-upload-item__container_htuju.file-upload-item__clickable_htuju {
|
|
13
13
|
cursor: pointer;
|
|
14
14
|
}
|
|
15
|
-
.file-upload-
|
|
15
|
+
.file-upload-item__container_htuju .file-upload-item__progress_htuju {
|
|
16
16
|
position: absolute;
|
|
17
17
|
top: var(--gap-4-neg);
|
|
18
18
|
left: var(--gap-4-neg);
|
|
19
19
|
z-index: 1;
|
|
20
20
|
will-change: opacity;
|
|
21
21
|
}
|
|
22
|
-
.file-upload-
|
|
23
|
-
.file-upload-
|
|
22
|
+
.file-upload-item__container_htuju .file-upload-item__progress_htuju.file-upload-item__success_htuju,
|
|
23
|
+
.file-upload-item__container_htuju .file-upload-item__progress_htuju.file-upload-item__error_htuju {
|
|
24
24
|
transition: opacity 400ms ease-in;
|
|
25
25
|
opacity: 0;
|
|
26
26
|
}
|
|
27
|
-
.file-upload-
|
|
27
|
+
.file-upload-item__container_htuju .file-upload-item__progress_htuju.file-upload-item__success_htuju path {
|
|
28
28
|
stroke: var(--color-light-status-positive);
|
|
29
29
|
}
|
|
30
|
-
.file-upload-
|
|
30
|
+
.file-upload-item__container_htuju .file-upload-item__progress_htuju.file-upload-item__loading_htuju {
|
|
31
31
|
color: var(--color-light-neutral-500);
|
|
32
32
|
}
|
|
33
|
-
.file-upload-
|
|
33
|
+
.file-upload-item__container_htuju .file-upload-item__progress_htuju.file-upload-item__error_htuju path {
|
|
34
34
|
stroke: var(--color-light-status-negative);
|
|
35
35
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"container":"file-upload-
|
|
3
|
+
const styles = {"container":"file-upload-item__container_htuju","clickable":"file-upload-item__clickable_htuju","progress":"file-upload-item__progress_htuju","success":"file-upload-item__success_htuju","error":"file-upload-item__error_htuju","loading":"file-upload-item__loading_htuju"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FileUploadItemProps } from '../types/file-upload-item-props';
|
|
2
|
-
interface ContextType extends Pick<FileUploadItemProps, 'showRestore' | 'uploadStatus' | 'error' | 'title' | 'subtitle' | 'uploadDate' | 'size' | 'id' | 'onDownload' | 'onDelete' | 'onRestore' | 'downloadLink' | 'download' | 'disableButtons' | 'isClickable' | 'target' | 'showDelete' | 'customIcon' | 'iconStyle' | 'progressBar' | 'progressBarAvailable' | 'customContent' | 'truncate' | 'imageUrl' | 'backgroundColor' | 'reupload'> {
|
|
2
|
+
interface ContextType extends Pick<FileUploadItemProps, 'showRestore' | 'uploadStatus' | 'error' | 'title' | 'subtitle' | 'subtitleColor' | 'uploadDate' | 'size' | 'id' | 'onDownload' | 'onDelete' | 'onRestore' | 'downloadLink' | 'download' | 'disableButtons' | 'isClickable' | 'target' | 'showDelete' | 'customIcon' | 'iconStyle' | 'progressBar' | 'progressBarAvailable' | 'customContent' | 'truncate' | 'imageUrl' | 'backgroundColor' | 'reupload'> {
|
|
3
3
|
actionsPresent?: boolean;
|
|
4
4
|
}
|
|
5
5
|
export declare const FileUploadItemContext: import("react").Context<ContextType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload-item-context.js","sources":["../../src/context/file-upload-item-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\ninterface ContextType\n extends Pick<\n FileUploadItemProps,\n | 'showRestore'\n | 'uploadStatus'\n | 'error'\n | 'title'\n | 'subtitle'\n | 'uploadDate'\n | 'size'\n | 'id'\n | 'onDownload'\n | 'onDelete'\n | 'onRestore'\n | 'downloadLink'\n | 'download'\n | 'disableButtons'\n | 'isClickable'\n | 'target'\n | 'showDelete'\n | 'customIcon'\n | 'iconStyle'\n | 'progressBar'\n | 'progressBarAvailable'\n | 'customContent'\n | 'truncate'\n | 'imageUrl'\n | 'backgroundColor'\n | 'reupload'\n > {\n actionsPresent?: boolean;\n}\n\nexport const FileUploadItemContext = createContext<ContextType>({});\n\nexport const useFileUploadItemContext = (): ContextType => useContext(FileUploadItemContext);\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"file-upload-item-context.js","sources":["../../src/context/file-upload-item-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\ninterface ContextType\n extends Pick<\n FileUploadItemProps,\n | 'showRestore'\n | 'uploadStatus'\n | 'error'\n | 'title'\n | 'subtitle'\n | 'subtitleColor'\n | 'uploadDate'\n | 'size'\n | 'id'\n | 'onDownload'\n | 'onDelete'\n | 'onRestore'\n | 'downloadLink'\n | 'download'\n | 'disableButtons'\n | 'isClickable'\n | 'target'\n | 'showDelete'\n | 'customIcon'\n | 'iconStyle'\n | 'progressBar'\n | 'progressBarAvailable'\n | 'customContent'\n | 'truncate'\n | 'imageUrl'\n | 'backgroundColor'\n | 'reupload'\n > {\n actionsPresent?: boolean;\n}\n\nexport const FileUploadItemContext = createContext<ContextType>({});\n\nexport const useFileUploadItemContext = (): ContextType => useContext(FileUploadItemContext);\n"],"names":[],"mappings":";;MAsCa,qBAAqB,GAAG,aAAa,CAAc,EAAE;AAErD,MAAA,wBAAwB,GAAG,MAAmB,UAAU,CAAC,qBAAqB;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
const useContextValue = (props) => {
|
|
4
|
-
const { id = '0', title = '', isClickable = true, iconStyle = 'gray', progressBar = 0, progressBarAvailable = true, showRestore, uploadStatus, error, subtitle, uploadDate, size, onDownload, onDelete, onRestore, downloadLink, download, disableButtons, target, showDelete, customIcon, customContent, truncate, imageUrl, backgroundColor, reupload, } = props;
|
|
4
|
+
const { id = '0', title = '', isClickable = true, iconStyle = 'gray', progressBar = 0, progressBarAvailable = true, showRestore, uploadStatus, error, subtitle, subtitleColor = 'secondary', uploadDate, size, onDownload, onDelete, onRestore, downloadLink, download, disableButtons, target, showDelete, customIcon, customContent, truncate, imageUrl, backgroundColor, reupload, } = props;
|
|
5
5
|
const actionsPresent = Boolean(showRestore || downloadLink || showDelete || onDownload || reupload);
|
|
6
6
|
return useMemo(() => ({
|
|
7
7
|
showRestore,
|
|
@@ -9,6 +9,7 @@ const useContextValue = (props) => {
|
|
|
9
9
|
error,
|
|
10
10
|
title,
|
|
11
11
|
subtitle,
|
|
12
|
+
subtitleColor,
|
|
12
13
|
uploadDate,
|
|
13
14
|
size,
|
|
14
15
|
id,
|
|
@@ -37,6 +38,7 @@ const useContextValue = (props) => {
|
|
|
37
38
|
error,
|
|
38
39
|
title,
|
|
39
40
|
subtitle,
|
|
41
|
+
subtitleColor,
|
|
40
42
|
uploadDate,
|
|
41
43
|
size,
|
|
42
44
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-context-value.js","sources":["../../src/context/use-context-value.ts"],"sourcesContent":["import { type ContextType, useMemo } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\nimport { type FileUploadItemContext } from './file-upload-item-context';\n\ntype UseContextValueProps = Omit<FileUploadItemProps, 'className' | 'dataTestId' | 'children'>;\n\nexport const useContextValue = (\n props: UseContextValueProps,\n): ContextType<typeof FileUploadItemContext> => {\n const {\n id = '0',\n title = '',\n isClickable = true,\n iconStyle = 'gray',\n progressBar = 0,\n progressBarAvailable = true,\n showRestore,\n uploadStatus,\n error,\n subtitle,\n uploadDate,\n size,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n target,\n showDelete,\n customIcon,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n reupload,\n } = props;\n\n const actionsPresent = Boolean(\n showRestore || downloadLink || showDelete || onDownload || reupload,\n );\n\n return useMemo(\n () => ({\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n }),\n [\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n ],\n );\n};\n"],"names":[],"mappings":";;AAQa,MAAA,eAAe,GAAG,CAC3B,KAA2B,KACgB;AAC3C,IAAA,MAAM,EACF,EAAE,GAAG,GAAG,EACR,KAAK,GAAG,EAAE,EACV,WAAW,GAAG,IAAI,EAClB,SAAS,GAAG,MAAM,EAClB,WAAW,GAAG,CAAC,EACf,oBAAoB,GAAG,IAAI,EAC3B,WAAW,EACX,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,EACV,UAAU,EACV,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,QAAQ,GACX,GAAG,KAAK;AAET,IAAA,MAAM,cAAc,GAAG,OAAO,CAC1B,WAAW,IAAI,YAAY,IAAI,UAAU,IAAI,UAAU,IAAI,QAAQ,CACtE;AAED,IAAA,OAAO,OAAO,CACV,OAAO;QACH,WAAW;QACX,YAAY;QACZ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,UAAU;QACV,IAAI;QACJ,EAAE;QACF,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;QACX,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,cAAc;QACd,QAAQ;AACX,KAAA,CAAC,EACF;QACI,WAAW;QACX,YAAY;QACZ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,UAAU;QACV,IAAI;QACJ,EAAE;QACF,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;QACX,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,cAAc;QACd,QAAQ;AACX,KAAA,CACJ;AACL;;;;"}
|
|
1
|
+
{"version":3,"file":"use-context-value.js","sources":["../../src/context/use-context-value.ts"],"sourcesContent":["import { type ContextType, useMemo } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\nimport { type FileUploadItemContext } from './file-upload-item-context';\n\ntype UseContextValueProps = Omit<FileUploadItemProps, 'className' | 'dataTestId' | 'children'>;\n\nexport const useContextValue = (\n props: UseContextValueProps,\n): ContextType<typeof FileUploadItemContext> => {\n const {\n id = '0',\n title = '',\n isClickable = true,\n iconStyle = 'gray',\n progressBar = 0,\n progressBarAvailable = true,\n showRestore,\n uploadStatus,\n error,\n subtitle,\n subtitleColor = 'secondary',\n uploadDate,\n size,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n target,\n showDelete,\n customIcon,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n reupload,\n } = props;\n\n const actionsPresent = Boolean(\n showRestore || downloadLink || showDelete || onDownload || reupload,\n );\n\n return useMemo(\n () => ({\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n }),\n [\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n ],\n );\n};\n"],"names":[],"mappings":";;AAQa,MAAA,eAAe,GAAG,CAC3B,KAA2B,KACgB;AAC3C,IAAA,MAAM,EACF,EAAE,GAAG,GAAG,EACR,KAAK,GAAG,EAAE,EACV,WAAW,GAAG,IAAI,EAClB,SAAS,GAAG,MAAM,EAClB,WAAW,GAAG,CAAC,EACf,oBAAoB,GAAG,IAAI,EAC3B,WAAW,EACX,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,aAAa,GAAG,WAAW,EAC3B,UAAU,EACV,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,EACV,UAAU,EACV,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,QAAQ,GACX,GAAG,KAAK;AAET,IAAA,MAAM,cAAc,GAAG,OAAO,CAC1B,WAAW,IAAI,YAAY,IAAI,UAAU,IAAI,UAAU,IAAI,QAAQ,CACtE;AAED,IAAA,OAAO,OAAO,CACV,OAAO;QACH,WAAW;QACX,YAAY;QACZ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,aAAa;QACb,UAAU;QACV,IAAI;QACJ,EAAE;QACF,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;QACX,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,cAAc;QACd,QAAQ;AACX,KAAA,CAAC,EACF;QACI,WAAW;QACX,YAAY;QACZ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,aAAa;QACb,UAAU;QACV,IAAI;QACJ,EAAE;QACF,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;QACX,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,cAAc;QACd,QAAQ;AACX,KAAA,CACJ;AACL;;;;"}
|
package/modern/index.css
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
--gap-2: 2px;
|
|
3
3
|
--gap-12: 12px;
|
|
4
4
|
}
|
|
5
|
-
.file-upload-
|
|
5
|
+
.file-upload-item__component_c3o9i {
|
|
6
6
|
box-sizing: border-box;
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: flex-start;
|
|
9
9
|
width: 100%;
|
|
10
10
|
min-height: 48px;
|
|
11
11
|
}
|
|
12
|
-
.file-upload-
|
|
12
|
+
.file-upload-item__restore_c3o9i {
|
|
13
13
|
margin-left: var(--gap-12);
|
|
14
14
|
margin-top: var(--gap-2);
|
|
15
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"file-upload-
|
|
3
|
+
const styles = {"component":"file-upload-item__component_c3o9i","restore":"file-upload-item__restore_c3o9i"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ElementType, type HTMLAttributeAnchorTarget, type MouseEvent, type ReactNode } from 'react';
|
|
2
|
+
import { type Color } from '@alfalab/core-components-typography/modern';
|
|
2
3
|
import { type FileUploadItemStatus } from './status';
|
|
3
4
|
export interface FileUploadItemProps {
|
|
4
5
|
/**
|
|
@@ -17,6 +18,11 @@ export interface FileUploadItemProps {
|
|
|
17
18
|
* Подзаголовок файла
|
|
18
19
|
*/
|
|
19
20
|
subtitle?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Цвет подзаголовка (Typography Color)
|
|
23
|
+
* @default secondary
|
|
24
|
+
*/
|
|
25
|
+
subtitleColor?: Color;
|
|
20
26
|
/**
|
|
21
27
|
* Размер файла
|
|
22
28
|
*/
|
|
@@ -10,7 +10,7 @@ import { ContentError } from '../content-error/content-error.js';
|
|
|
10
10
|
import styles from './content-subtitle.module.css';
|
|
11
11
|
|
|
12
12
|
const ContentSubtitle = () => {
|
|
13
|
-
const { uploadStatus, subtitle, uploadDate, size, truncate, showRestore, error, progressBar } = useFileUploadItemContext();
|
|
13
|
+
const { uploadStatus, subtitle, subtitleColor, uploadDate, size, truncate, showRestore, error, progressBar, } = useFileUploadItemContext();
|
|
14
14
|
const shouldShownError = isErrorStatus(uploadStatus) || isError(error);
|
|
15
15
|
const showMeta = !showRestore && (isSuccessStatus(uploadStatus) || isUploadedStatus(uploadStatus));
|
|
16
16
|
// валидация progressBar (не должен превышать 100 и быть меньше 0)
|
|
@@ -39,7 +39,7 @@ const ContentSubtitle = () => {
|
|
|
39
39
|
}
|
|
40
40
|
return (React.createElement(TypographyText, { className: cn(styles.subtitle, {
|
|
41
41
|
[styles.truncate]: truncate,
|
|
42
|
-
}), view: 'primary-small', color:
|
|
42
|
+
}), view: 'primary-small', color: subtitleColor }, subtitle));
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
export { ContentSubtitle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-subtitle.js","sources":["../../../../../src/components/content/components/content-subtitle/content-subtitle.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { humanFileSize } from '@alfalab/core-components-shared';\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { MAX_PROGRESS_BAR_VALUE } from '../../../../const/progress-bar';\nimport { useFileUploadItemContext } from '../../../../context/file-upload-item-context';\nimport {\n isErrorStatus,\n isSuccessStatus,\n isUploadedStatus,\n isUploadingStatus,\n} from '../../../../utils';\nimport { isError } from '../../utils/isError';\nimport { ContentError } from '../content-error';\n\nimport styles from './content-subtitle.module.css';\n\nexport const ContentSubtitle = () => {\n const {
|
|
1
|
+
{"version":3,"file":"content-subtitle.js","sources":["../../../../../src/components/content/components/content-subtitle/content-subtitle.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { humanFileSize } from '@alfalab/core-components-shared';\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { MAX_PROGRESS_BAR_VALUE } from '../../../../const/progress-bar';\nimport { useFileUploadItemContext } from '../../../../context/file-upload-item-context';\nimport {\n isErrorStatus,\n isSuccessStatus,\n isUploadedStatus,\n isUploadingStatus,\n} from '../../../../utils';\nimport { isError } from '../../utils/isError';\nimport { ContentError } from '../content-error';\n\nimport styles from './content-subtitle.module.css';\n\nexport const ContentSubtitle = () => {\n const {\n uploadStatus,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n truncate,\n showRestore,\n error,\n progressBar,\n } = useFileUploadItemContext();\n\n const shouldShownError = isErrorStatus(uploadStatus) || isError(error);\n const showMeta =\n !showRestore && (isSuccessStatus(uploadStatus) || isUploadedStatus(uploadStatus));\n\n // валидация progressBar (не должен превышать 100 и быть меньше 0)\n const validProgressBar = Math.min(Math.max(progressBar ?? 0, 0), MAX_PROGRESS_BAR_VALUE);\n\n // uploading status\n if (isUploadingStatus(uploadStatus)) {\n return (\n <TypographyText view='primary-small' color='secondary'>\n Загружено{'\\u00A0'}\n {Math.floor(validProgressBar)}%\n </TypographyText>\n );\n }\n\n // error status\n if (shouldShownError) {\n return <ContentError />;\n }\n\n // success status\n if (showMeta) {\n return (\n <div>\n {size && (\n <TypographyText className={styles.size} view='primary-small' color='secondary'>\n {humanFileSize(size)}\n </TypographyText>\n )}\n {uploadDate && (\n <TypographyText view='primary-small' color='secondary'>\n {uploadDate}\n </TypographyText>\n )}\n </div>\n );\n }\n\n // restore status\n if (showRestore) {\n return (\n <TypographyText view='primary-small' color='tertiary'>\n Файл удален\n </TypographyText>\n );\n }\n\n return (\n <TypographyText\n className={cn(styles.subtitle, {\n [styles.truncate]: truncate,\n })}\n view='primary-small'\n color={subtitleColor}\n >\n {subtitle}\n </TypographyText>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAmBO,MAAM,eAAe,GAAG,MAAK;IAChC,MAAM,EACF,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,WAAW,GACd,GAAG,wBAAwB,EAAE;IAE9B,MAAM,gBAAgB,GAAG,aAAa,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC;AACtE,IAAA,MAAM,QAAQ,GACV,CAAC,WAAW,KAAK,eAAe,CAAC,YAAY,CAAC,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAAC;;AAGrF,IAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,sBAAsB,CAAC;;AAGxF,IAAA,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE;QACjC,QACI,KAAC,CAAA,aAAA,CAAA,cAAc,EAAC,EAAA,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EAAA;;YACxC,QAAQ;AACjB,YAAA,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC;AAChB,YAAA,GAAA,CAAA;;;IAKzB,IAAI,gBAAgB,EAAE;QAClB,OAAO,KAAA,CAAA,aAAA,CAAC,YAAY,EAAA,IAAA,CAAG;;;IAI3B,IAAI,QAAQ,EAAE;AACV,QAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;YACK,IAAI,KACD,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EAAA,EACzE,aAAa,CAAC,IAAI,CAAC,CACP,CACpB;AACA,YAAA,UAAU,KACP,KAAA,CAAA,aAAA,CAAC,cAAc,EAAC,EAAA,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,WAAW,EACjD,EAAA,UAAU,CACE,CACpB,CACC;;;IAKd,IAAI,WAAW,EAAE;AACb,QAAA,QACI,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,UAAU,EAAA,EAAA,+DAAA,CAEpC;;IAIzB,QACI,KAAC,CAAA,aAAA,CAAA,cAAc,EACX,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE;AAC3B,YAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;AAC9B,SAAA,CAAC,EACF,IAAI,EAAC,eAAe,EACpB,KAAK,EAAE,aAAa,EAEnB,EAAA,QAAQ,CACI;AAEzB;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FileUploadItemProps } from '../types/file-upload-item-props';
|
|
2
|
-
interface ContextType extends Pick<FileUploadItemProps, 'showRestore' | 'uploadStatus' | 'error' | 'title' | 'subtitle' | 'uploadDate' | 'size' | 'id' | 'onDownload' | 'onDelete' | 'onRestore' | 'downloadLink' | 'download' | 'disableButtons' | 'isClickable' | 'target' | 'showDelete' | 'customIcon' | 'iconStyle' | 'progressBar' | 'progressBarAvailable' | 'customContent' | 'truncate' | 'imageUrl' | 'backgroundColor' | 'reupload'> {
|
|
2
|
+
interface ContextType extends Pick<FileUploadItemProps, 'showRestore' | 'uploadStatus' | 'error' | 'title' | 'subtitle' | 'subtitleColor' | 'uploadDate' | 'size' | 'id' | 'onDownload' | 'onDelete' | 'onRestore' | 'downloadLink' | 'download' | 'disableButtons' | 'isClickable' | 'target' | 'showDelete' | 'customIcon' | 'iconStyle' | 'progressBar' | 'progressBarAvailable' | 'customContent' | 'truncate' | 'imageUrl' | 'backgroundColor' | 'reupload'> {
|
|
3
3
|
actionsPresent?: boolean;
|
|
4
4
|
}
|
|
5
5
|
export declare const FileUploadItemContext: import("react").Context<ContextType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload-item-context.js","sources":["../../src/context/file-upload-item-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\ninterface ContextType\n extends Pick<\n FileUploadItemProps,\n | 'showRestore'\n | 'uploadStatus'\n | 'error'\n | 'title'\n | 'subtitle'\n | 'uploadDate'\n | 'size'\n | 'id'\n | 'onDownload'\n | 'onDelete'\n | 'onRestore'\n | 'downloadLink'\n | 'download'\n | 'disableButtons'\n | 'isClickable'\n | 'target'\n | 'showDelete'\n | 'customIcon'\n | 'iconStyle'\n | 'progressBar'\n | 'progressBarAvailable'\n | 'customContent'\n | 'truncate'\n | 'imageUrl'\n | 'backgroundColor'\n | 'reupload'\n > {\n actionsPresent?: boolean;\n}\n\nexport const FileUploadItemContext = createContext<ContextType>({});\n\nexport const useFileUploadItemContext = (): ContextType => useContext(FileUploadItemContext);\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"file-upload-item-context.js","sources":["../../src/context/file-upload-item-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\ninterface ContextType\n extends Pick<\n FileUploadItemProps,\n | 'showRestore'\n | 'uploadStatus'\n | 'error'\n | 'title'\n | 'subtitle'\n | 'subtitleColor'\n | 'uploadDate'\n | 'size'\n | 'id'\n | 'onDownload'\n | 'onDelete'\n | 'onRestore'\n | 'downloadLink'\n | 'download'\n | 'disableButtons'\n | 'isClickable'\n | 'target'\n | 'showDelete'\n | 'customIcon'\n | 'iconStyle'\n | 'progressBar'\n | 'progressBarAvailable'\n | 'customContent'\n | 'truncate'\n | 'imageUrl'\n | 'backgroundColor'\n | 'reupload'\n > {\n actionsPresent?: boolean;\n}\n\nexport const FileUploadItemContext = createContext<ContextType>({});\n\nexport const useFileUploadItemContext = (): ContextType => useContext(FileUploadItemContext);\n"],"names":[],"mappings":";;MAsCa,qBAAqB,GAAG,aAAa,CAAc,EAAE;AAErD,MAAA,wBAAwB,GAAG,MAAmB,UAAU,CAAC,qBAAqB;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
const useContextValue = (props) => {
|
|
4
|
-
const { id = '0', title = '', isClickable = true, iconStyle = 'gray', progressBar = 0, progressBarAvailable = true, showRestore, uploadStatus, error, subtitle, uploadDate, size, onDownload, onDelete, onRestore, downloadLink, download, disableButtons, target, showDelete, customIcon, customContent, truncate, imageUrl, backgroundColor, reupload, } = props;
|
|
4
|
+
const { id = '0', title = '', isClickable = true, iconStyle = 'gray', progressBar = 0, progressBarAvailable = true, showRestore, uploadStatus, error, subtitle, subtitleColor = 'secondary', uploadDate, size, onDownload, onDelete, onRestore, downloadLink, download, disableButtons, target, showDelete, customIcon, customContent, truncate, imageUrl, backgroundColor, reupload, } = props;
|
|
5
5
|
const actionsPresent = Boolean(showRestore || downloadLink || showDelete || onDownload || reupload);
|
|
6
6
|
return useMemo(() => ({
|
|
7
7
|
showRestore,
|
|
@@ -9,6 +9,7 @@ const useContextValue = (props) => {
|
|
|
9
9
|
error,
|
|
10
10
|
title,
|
|
11
11
|
subtitle,
|
|
12
|
+
subtitleColor,
|
|
12
13
|
uploadDate,
|
|
13
14
|
size,
|
|
14
15
|
id,
|
|
@@ -37,6 +38,7 @@ const useContextValue = (props) => {
|
|
|
37
38
|
error,
|
|
38
39
|
title,
|
|
39
40
|
subtitle,
|
|
41
|
+
subtitleColor,
|
|
40
42
|
uploadDate,
|
|
41
43
|
size,
|
|
42
44
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-context-value.js","sources":["../../src/context/use-context-value.ts"],"sourcesContent":["import { type ContextType, useMemo } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\nimport { type FileUploadItemContext } from './file-upload-item-context';\n\ntype UseContextValueProps = Omit<FileUploadItemProps, 'className' | 'dataTestId' | 'children'>;\n\nexport const useContextValue = (\n props: UseContextValueProps,\n): ContextType<typeof FileUploadItemContext> => {\n const {\n id = '0',\n title = '',\n isClickable = true,\n iconStyle = 'gray',\n progressBar = 0,\n progressBarAvailable = true,\n showRestore,\n uploadStatus,\n error,\n subtitle,\n uploadDate,\n size,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n target,\n showDelete,\n customIcon,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n reupload,\n } = props;\n\n const actionsPresent = Boolean(\n showRestore || downloadLink || showDelete || onDownload || reupload,\n );\n\n return useMemo(\n () => ({\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n }),\n [\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n ],\n );\n};\n"],"names":[],"mappings":";;AAQa,MAAA,eAAe,GAAG,CAC3B,KAA2B,KACgB;AAC3C,IAAA,MAAM,EACF,EAAE,GAAG,GAAG,EACR,KAAK,GAAG,EAAE,EACV,WAAW,GAAG,IAAI,EAClB,SAAS,GAAG,MAAM,EAClB,WAAW,GAAG,CAAC,EACf,oBAAoB,GAAG,IAAI,EAC3B,WAAW,EACX,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,EACV,UAAU,EACV,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,QAAQ,GACX,GAAG,KAAK;AAET,IAAA,MAAM,cAAc,GAAG,OAAO,CAC1B,WAAW,IAAI,YAAY,IAAI,UAAU,IAAI,UAAU,IAAI,QAAQ,CACtE;AAED,IAAA,OAAO,OAAO,CACV,OAAO;QACH,WAAW;QACX,YAAY;QACZ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,UAAU;QACV,IAAI;QACJ,EAAE;QACF,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;QACX,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,cAAc;QACd,QAAQ;AACX,KAAA,CAAC,EACF;QACI,WAAW;QACX,YAAY;QACZ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,UAAU;QACV,IAAI;QACJ,EAAE;QACF,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;QACX,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,cAAc;QACd,QAAQ;AACX,KAAA,CACJ;AACL;;;;"}
|
|
1
|
+
{"version":3,"file":"use-context-value.js","sources":["../../src/context/use-context-value.ts"],"sourcesContent":["import { type ContextType, useMemo } from 'react';\n\nimport { type FileUploadItemProps } from '../types/file-upload-item-props';\n\nimport { type FileUploadItemContext } from './file-upload-item-context';\n\ntype UseContextValueProps = Omit<FileUploadItemProps, 'className' | 'dataTestId' | 'children'>;\n\nexport const useContextValue = (\n props: UseContextValueProps,\n): ContextType<typeof FileUploadItemContext> => {\n const {\n id = '0',\n title = '',\n isClickable = true,\n iconStyle = 'gray',\n progressBar = 0,\n progressBarAvailable = true,\n showRestore,\n uploadStatus,\n error,\n subtitle,\n subtitleColor = 'secondary',\n uploadDate,\n size,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n target,\n showDelete,\n customIcon,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n reupload,\n } = props;\n\n const actionsPresent = Boolean(\n showRestore || downloadLink || showDelete || onDownload || reupload,\n );\n\n return useMemo(\n () => ({\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n }),\n [\n showRestore,\n uploadStatus,\n error,\n title,\n subtitle,\n subtitleColor,\n uploadDate,\n size,\n id,\n onDownload,\n onDelete,\n onRestore,\n downloadLink,\n download,\n disableButtons,\n isClickable,\n target,\n showDelete,\n customIcon,\n iconStyle,\n progressBar,\n progressBarAvailable,\n customContent,\n truncate,\n imageUrl,\n backgroundColor,\n actionsPresent,\n reupload,\n ],\n );\n};\n"],"names":[],"mappings":";;AAQa,MAAA,eAAe,GAAG,CAC3B,KAA2B,KACgB;AAC3C,IAAA,MAAM,EACF,EAAE,GAAG,GAAG,EACR,KAAK,GAAG,EAAE,EACV,WAAW,GAAG,IAAI,EAClB,SAAS,GAAG,MAAM,EAClB,WAAW,GAAG,CAAC,EACf,oBAAoB,GAAG,IAAI,EAC3B,WAAW,EACX,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,aAAa,GAAG,WAAW,EAC3B,UAAU,EACV,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,MAAM,EACN,UAAU,EACV,UAAU,EACV,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,QAAQ,GACX,GAAG,KAAK;AAET,IAAA,MAAM,cAAc,GAAG,OAAO,CAC1B,WAAW,IAAI,YAAY,IAAI,UAAU,IAAI,UAAU,IAAI,QAAQ,CACtE;AAED,IAAA,OAAO,OAAO,CACV,OAAO;QACH,WAAW;QACX,YAAY;QACZ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,aAAa;QACb,UAAU;QACV,IAAI;QACJ,EAAE;QACF,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;QACX,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,cAAc;QACd,QAAQ;AACX,KAAA,CAAC,EACF;QACI,WAAW;QACX,YAAY;QACZ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,aAAa;QACb,UAAU;QACV,IAAI;QACJ,EAAE;QACF,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;QACX,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,WAAW;QACX,oBAAoB;QACpB,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,eAAe;QACf,cAAc;QACd,QAAQ;AACX,KAAA,CACJ;AACL;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ElementType, type HTMLAttributeAnchorTarget, type MouseEvent, type ReactNode } from 'react';
|
|
2
|
+
import { type Color } from '@alfalab/core-components-typography/moderncssm';
|
|
2
3
|
import { type FileUploadItemStatus } from './status';
|
|
3
4
|
export interface FileUploadItemProps {
|
|
4
5
|
/**
|
|
@@ -17,6 +18,11 @@ export interface FileUploadItemProps {
|
|
|
17
18
|
* Подзаголовок файла
|
|
18
19
|
*/
|
|
19
20
|
subtitle?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Цвет подзаголовка (Typography Color)
|
|
23
|
+
* @default secondary
|
|
24
|
+
*/
|
|
25
|
+
subtitleColor?: Color;
|
|
20
26
|
/**
|
|
21
27
|
* Размер файла
|
|
22
28
|
*/
|
package/package.json
CHANGED
|
@@ -18,8 +18,17 @@ import { ContentError } from '../content-error';
|
|
|
18
18
|
import styles from './content-subtitle.module.css';
|
|
19
19
|
|
|
20
20
|
export const ContentSubtitle = () => {
|
|
21
|
-
const {
|
|
22
|
-
|
|
21
|
+
const {
|
|
22
|
+
uploadStatus,
|
|
23
|
+
subtitle,
|
|
24
|
+
subtitleColor,
|
|
25
|
+
uploadDate,
|
|
26
|
+
size,
|
|
27
|
+
truncate,
|
|
28
|
+
showRestore,
|
|
29
|
+
error,
|
|
30
|
+
progressBar,
|
|
31
|
+
} = useFileUploadItemContext();
|
|
23
32
|
|
|
24
33
|
const shouldShownError = isErrorStatus(uploadStatus) || isError(error);
|
|
25
34
|
const showMeta =
|
|
@@ -76,7 +85,7 @@ export const ContentSubtitle = () => {
|
|
|
76
85
|
[styles.truncate]: truncate,
|
|
77
86
|
})}
|
|
78
87
|
view='primary-small'
|
|
79
|
-
color=
|
|
88
|
+
color={subtitleColor}
|
|
80
89
|
>
|
|
81
90
|
{subtitle}
|
|
82
91
|
</TypographyText>
|
|
@@ -20,6 +20,7 @@ export const useContextValue = (
|
|
|
20
20
|
uploadStatus,
|
|
21
21
|
error,
|
|
22
22
|
subtitle,
|
|
23
|
+
subtitleColor = 'secondary',
|
|
23
24
|
uploadDate,
|
|
24
25
|
size,
|
|
25
26
|
onDownload,
|
|
@@ -49,6 +50,7 @@ export const useContextValue = (
|
|
|
49
50
|
error,
|
|
50
51
|
title,
|
|
51
52
|
subtitle,
|
|
53
|
+
subtitleColor,
|
|
52
54
|
uploadDate,
|
|
53
55
|
size,
|
|
54
56
|
id,
|
|
@@ -78,6 +80,7 @@ export const useContextValue = (
|
|
|
78
80
|
error,
|
|
79
81
|
title,
|
|
80
82
|
subtitle,
|
|
83
|
+
subtitleColor,
|
|
81
84
|
uploadDate,
|
|
82
85
|
size,
|
|
83
86
|
id,
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
type ReactNode,
|
|
6
6
|
} from 'react';
|
|
7
7
|
|
|
8
|
+
import { type Color } from '@alfalab/core-components-typography';
|
|
9
|
+
|
|
8
10
|
import { type FileUploadItemStatus } from './status';
|
|
9
11
|
|
|
10
12
|
export interface FileUploadItemProps {
|
|
@@ -28,6 +30,12 @@ export interface FileUploadItemProps {
|
|
|
28
30
|
*/
|
|
29
31
|
subtitle?: string;
|
|
30
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Цвет подзаголовка (Typography Color)
|
|
35
|
+
* @default secondary
|
|
36
|
+
*/
|
|
37
|
+
subtitleColor?: Color;
|
|
38
|
+
|
|
31
39
|
/**
|
|
32
40
|
* Размер файла
|
|
33
41
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ElementType, type HTMLAttributeAnchorTarget, type MouseEvent, type ReactNode } from 'react';
|
|
2
|
+
import { type Color } from '@alfalab/core-components-typography';
|
|
2
3
|
import { type FileUploadItemStatus } from './status';
|
|
3
4
|
export interface FileUploadItemProps {
|
|
4
5
|
/**
|
|
@@ -17,6 +18,11 @@ export interface FileUploadItemProps {
|
|
|
17
18
|
* Подзаголовок файла
|
|
18
19
|
*/
|
|
19
20
|
subtitle?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Цвет подзаголовка (Typography Color)
|
|
23
|
+
* @default secondary
|
|
24
|
+
*/
|
|
25
|
+
subtitleColor?: Color;
|
|
20
26
|
/**
|
|
21
27
|
* Размер файла
|
|
22
28
|
*/
|