@arbor-education/design-system.components 4.7.1 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/components/fileUpload/FileList.d.ts +7 -0
  3. package/dist/components/fileUpload/FileList.d.ts.map +1 -0
  4. package/dist/components/fileUpload/FileList.js +29 -0
  5. package/dist/components/fileUpload/FileList.js.map +1 -0
  6. package/dist/components/fileUpload/FileList.stories.d.ts +47 -0
  7. package/dist/components/fileUpload/FileList.stories.d.ts.map +1 -0
  8. package/dist/components/fileUpload/FileList.stories.js +136 -0
  9. package/dist/components/fileUpload/FileList.stories.js.map +1 -0
  10. package/dist/components/fileUpload/FileList.test.d.ts +2 -0
  11. package/dist/components/fileUpload/FileList.test.d.ts.map +1 -0
  12. package/dist/components/fileUpload/FileList.test.js +147 -0
  13. package/dist/components/fileUpload/FileList.test.js.map +1 -0
  14. package/dist/components/fileUpload/FileUpload.d.ts +14 -3
  15. package/dist/components/fileUpload/FileUpload.d.ts.map +1 -1
  16. package/dist/components/fileUpload/FileUpload.js +8 -25
  17. package/dist/components/fileUpload/FileUpload.js.map +1 -1
  18. package/dist/components/fileUpload/FileUpload.stories.d.ts +16 -1
  19. package/dist/components/fileUpload/FileUpload.stories.d.ts.map +1 -1
  20. package/dist/components/fileUpload/FileUpload.stories.js +51 -0
  21. package/dist/components/fileUpload/FileUpload.stories.js.map +1 -1
  22. package/dist/components/fileUpload/FileUpload.test.js +42 -0
  23. package/dist/components/fileUpload/FileUpload.test.js.map +1 -1
  24. package/dist/components/heading/Heading.d.ts +2 -387
  25. package/dist/components/heading/Heading.d.ts.map +1 -1
  26. package/dist/components/heading/Heading.js +12 -4
  27. package/dist/components/heading/Heading.js.map +1 -1
  28. package/dist/components/heading/Heading.stories.d.ts +12 -387
  29. package/dist/components/heading/Heading.stories.d.ts.map +1 -1
  30. package/dist/components/heading/Heading.stories.js +19 -0
  31. package/dist/components/heading/Heading.stories.js.map +1 -1
  32. package/dist/components/heading/Heading.test.js +24 -0
  33. package/dist/components/heading/Heading.test.js.map +1 -1
  34. package/dist/components/table/Table.d.ts +2 -0
  35. package/dist/components/table/Table.d.ts.map +1 -1
  36. package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.d.ts +1 -0
  37. package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.d.ts.map +1 -1
  38. package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.js +4 -0
  39. package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.js.map +1 -1
  40. package/dist/components/table/cellRenderers/CheckboxCellRenderer.test.js +7 -0
  41. package/dist/components/table/cellRenderers/CheckboxCellRenderer.test.js.map +1 -1
  42. package/dist/components/table/cellRenderers/InlineTextCellRenderer.d.ts +1 -0
  43. package/dist/components/table/cellRenderers/InlineTextCellRenderer.d.ts.map +1 -1
  44. package/dist/components/table/cellRenderers/InlineTextCellRenderer.js +2 -2
  45. package/dist/components/table/cellRenderers/InlineTextCellRenderer.js.map +1 -1
  46. package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.d.ts +14 -0
  47. package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.d.ts.map +1 -1
  48. package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.js +12 -0
  49. package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.js.map +1 -1
  50. package/dist/components/table/cellRenderers/InlineTextCellRenderer.test.d.ts +2 -0
  51. package/dist/components/table/cellRenderers/InlineTextCellRenderer.test.d.ts.map +1 -0
  52. package/dist/components/table/cellRenderers/InlineTextCellRenderer.test.js +28 -0
  53. package/dist/components/table/cellRenderers/InlineTextCellRenderer.test.js.map +1 -0
  54. package/dist/components/table/cellRenderers/NumberInputCellRenderer.d.ts +1 -0
  55. package/dist/components/table/cellRenderers/NumberInputCellRenderer.d.ts.map +1 -1
  56. package/dist/components/table/cellRenderers/NumberInputCellRenderer.js +2 -2
  57. package/dist/components/table/cellRenderers/NumberInputCellRenderer.js.map +1 -1
  58. package/dist/components/table/cellRenderers/NumberInputCellRenderer.stories.d.ts +14 -0
  59. package/dist/components/table/cellRenderers/NumberInputCellRenderer.stories.d.ts.map +1 -1
  60. package/dist/components/table/cellRenderers/NumberInputCellRenderer.stories.js +12 -0
  61. package/dist/components/table/cellRenderers/NumberInputCellRenderer.stories.js.map +1 -1
  62. package/dist/components/table/cellRenderers/NumberInputCellRenderer.test.js +10 -0
  63. package/dist/components/table/cellRenderers/NumberInputCellRenderer.test.js.map +1 -1
  64. package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.js +1 -1
  65. package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.js.map +1 -1
  66. package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.d.ts +1 -0
  67. package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.d.ts.map +1 -1
  68. package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.js +4 -0
  69. package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.js.map +1 -1
  70. package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.test.js +9 -0
  71. package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.test.js.map +1 -1
  72. package/dist/index.css +23 -0
  73. package/dist/index.css.map +1 -1
  74. package/package.json +1 -1
  75. package/src/components/fileUpload/FileList.stories.tsx +145 -0
  76. package/src/components/fileUpload/FileList.test.tsx +190 -0
  77. package/src/components/fileUpload/FileList.tsx +125 -0
  78. package/src/components/fileUpload/FileUpload.stories.tsx +79 -0
  79. package/src/components/fileUpload/FileUpload.test.tsx +82 -0
  80. package/src/components/fileUpload/FileUpload.tsx +29 -108
  81. package/src/components/fileUpload/fileUpload.scss +8 -0
  82. package/src/components/heading/Heading.stories.tsx +23 -0
  83. package/src/components/heading/Heading.test.tsx +38 -0
  84. package/src/components/heading/Heading.tsx +27 -3
  85. package/src/components/heading/heading.scss +18 -0
  86. package/src/components/table/cellRenderers/CheckboxCellRenderer.stories.tsx +16 -0
  87. package/src/components/table/cellRenderers/CheckboxCellRenderer.test.tsx +8 -0
  88. package/src/components/table/cellRenderers/InlineTextCellRenderer.stories.tsx +22 -0
  89. package/src/components/table/cellRenderers/InlineTextCellRenderer.test.tsx +31 -0
  90. package/src/components/table/cellRenderers/InlineTextCellRenderer.tsx +4 -1
  91. package/src/components/table/cellRenderers/NumberInputCellRenderer.stories.tsx +24 -0
  92. package/src/components/table/cellRenderers/NumberInputCellRenderer.test.tsx +13 -1
  93. package/src/components/table/cellRenderers/NumberInputCellRenderer.tsx +4 -1
  94. package/src/components/table/cellRenderers/SelectDropdownCellRenderer.stories.tsx +19 -0
  95. package/src/components/table/cellRenderers/SelectDropdownCellRenderer.test.tsx +11 -0
  96. package/src/components/table/cellRenderers/SelectDropdownCellRenderer.tsx +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#305](https://github.com/arbor-education/design-system.components/pull/305) [`157ea72`](https://github.com/arbor-education/design-system.components/commit/157ea7200c54ad05ac53032d739062fc96369e33) Thanks [@angusmglfraser](https://github.com/angusmglfraser)! - MIS-74654 ✨ Add error message support to FileUpload and FileList
8
+
9
+ ## 4.8.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#293](https://github.com/arbor-education/design-system.components/pull/293) [`11a1f4d`](https://github.com/arbor-education/design-system.components/commit/11a1f4dfbc498cecdf26aa56c83d8007a2b6ff52) Thanks [@MarkFrancisArbor](https://github.com/MarkFrancisArbor)! - MIS-76030 Added error message prop to Heading component
14
+
15
+ - [#292](https://github.com/arbor-education/design-system.components/pull/292) [`1b09078`](https://github.com/arbor-education/design-system.components/commit/1b09078a1d9e4ce5740e8a8ba4dae92fa9d8a3bd) Thanks [@MarkFrancisArbor](https://github.com/MarkFrancisArbor)! - MIS-76022 Added hasError states to cell renderers
16
+
17
+ - [#302](https://github.com/arbor-education/design-system.components/pull/302) [`e82e4ac`](https://github.com/arbor-education/design-system.components/commit/e82e4ac54374c3d9a4f2ec9294dbed55056ee01d) Thanks [@angusmglfraser](https://github.com/angusmglfraser)! - MIS-73774 ✨ FileList extracted from FileUpload for use as a standalone component
18
+
3
19
  ## 4.7.1
4
20
 
5
21
  ### Patch Changes
@@ -0,0 +1,7 @@
1
+ import type { UploadedFile } from '../fileUpload/FileUpload.js';
2
+ export type FileListProps = {
3
+ uploadedFiles: UploadedFile[];
4
+ onEditFile?: (index: number) => void;
5
+ };
6
+ export declare const FileList: (props: FileListProps) => import("react").JSX.Element;
7
+ //# sourceMappingURL=FileList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileList.d.ts","sourceRoot":"","sources":["../../../src/components/fileUpload/FileList.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGrE,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAAC;AAcF,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,gCAkG5C,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ import { Button } from '../button/Button.js';
4
+ import { Card } from '../card/Card.js';
5
+ import { Icon } from '../icon/Icon.js';
6
+ import { Progress } from '../progress/Progress.js';
7
+ import { Separator } from '../separator/Separator.js';
8
+ const renderFileLink = ({ href = '', linkProps, renderLink }, children) => {
9
+ const className = 'ds-file-upload__file-link';
10
+ if (renderLink) {
11
+ return renderLink({ href, className, children, linkProps });
12
+ }
13
+ return (_jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer", className: className, ...linkProps, children: children }));
14
+ };
15
+ export const FileList = (props) => {
16
+ const { uploadedFiles, onEditFile, } = props;
17
+ return (_jsx(Card, { className: "ds-file-upload__file-list", children: uploadedFiles.map((file, index) => {
18
+ const { fileName, fileSize, fileType, href, onEdit, onDelete, onDownload, hasUploadFailed, progressPercentage, errorMessage, } = file;
19
+ const icon = file.icon ?? (href ? 'link' : 'file');
20
+ const nameNode = _jsx("span", { className: "ds-file-upload__file-name", children: fileName });
21
+ return (_jsxs("div", { className: "ds-file-upload__file-outer", children: [_jsxs("span", { className: "ds-file-upload__file", children: [_jsx("span", { className: "ds-file-upload__icon-wrapper", children: _jsx(Icon, { size: 24, name: icon, color: "var(--color-brand-600)" }) }), _jsxs("span", { className: "ds-file-upload__file-details", children: [href ? renderFileLink(file, nameNode) : nameNode, hasUploadFailed || errorMessage
22
+ ? (_jsxs("span", { className: "ds-file-upload__upload-failed", children: [_jsx(Icon, { name: "circle-alert" }), ' ', errorMessage ?? 'Upload failed'] }))
23
+ : _jsx("span", { className: "ds-file-upload__file-meta", children: href ?? `${fileType}, ${fileSize}` })] }), href && (_jsx(Button, { variant: "secondary", isRound: true, onClick: () => navigator.clipboard.writeText(href), children: _jsx(Icon, { name: "copy", screenReaderText: "Copy link" }) })), href && onEditFile && onEdit && (_jsx(Button, { variant: "secondary", isRound: true, onClick: () => onEditFile(index), children: _jsx(Icon, { name: "pencil", screenReaderText: "Edit link" }) })), onDownload && (_jsx(Button, { variant: "secondary", isRound: true, onClick: onDownload, children: _jsx(Icon, { name: "download", screenReaderText: "Download file" }) })), onDelete && (_jsx(Button, { variant: "secondary", isRound: true, onClick: onDelete, children: _jsx(Icon, { name: "trash", screenReaderText: href ? 'Delete link' : 'Delete file' }) }))] }), typeof progressPercentage === 'number' && progressPercentage < 100
24
+ && (_jsx(Progress, { value: progressPercentage, className: "ds-file-upload__progress-bar", "aria-label": "Upload progress bar", indicatorClassName: classNames('ds-file-upload__progress-bar-indicator', {
25
+ 'ds-file-upload__progress-bar-indicator--failed': hasUploadFailed,
26
+ }) })), index < uploadedFiles.length - 1 && _jsx(Separator, {})] }, fileName));
27
+ }) }));
28
+ };
29
+ //# sourceMappingURL=FileList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileList.js","sourceRoot":"","sources":["../../../src/components/fileUpload/FileList.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAS3D,MAAM,cAAc,GAAG,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,EAAE,UAAU,EAAgB,EAAE,QAAmB,EAAE,EAAE;IACjG,MAAM,SAAS,GAAG,2BAA2B,CAAC;IAC9C,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,CACL,YAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,EAAC,SAAS,EAAE,SAAS,KAAM,SAAS,YACzF,QAAQ,GACP,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;IAC/C,MAAM,EACJ,aAAa,EACb,UAAU,GACX,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,KAAC,IAAI,IAAC,SAAS,EAAC,2BAA2B,YACxC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACjC,MAAM,EACJ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,Q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O,QACP,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,YAEhC,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,gBAAgB,EAAC,WAAW,GAAG,GAC5C,CACV,EACA,UAAU,IAAI,CACb,KAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,OAAO,QACP,OAAO,EAAE,UAAU,YAEnB,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,EAAC,gBAAgB,EAAC,eAAe,GAAG,GAClD,CACV,EACA,QAAQ,IAAI,CACX,KAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,OAAO,QACP,OAAO,EAAE,QAAQ,YAEjB,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,GAAI,GACtE,CACV,IACI,EACN,OAAO,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,GAAG,GAAG;2BAC9D,CACD,KAAC,QAAQ,IACP,KAAK,EAAE,kBAAkB,EACzB,SAAS,EAAC,8BAA8B,gBAC7B,qBAAqB,EAChC,kBAAkB,EAAE,UAAU,CAAC,wCAAwC,EAAE;gCACvE,gDAAgD,EAAE,eAAe;6BAClE,CAAC,GACF,CACH,EACF,KAAK,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,SAAS,KAAG,KAnE1C,QAAQ,CAoEZ,CACP,CAAC;QACJ,CAAC,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: (props: import("./FileList.js").FileListProps) => import("react").JSX.Element;
5
+ tags: string[];
6
+ parameters: {
7
+ layout: string;
8
+ docs: {
9
+ description: {
10
+ component: string;
11
+ };
12
+ };
13
+ };
14
+ argTypes: {
15
+ uploadedFiles: {
16
+ description: string;
17
+ control: false;
18
+ table: {
19
+ type: {
20
+ summary: string;
21
+ };
22
+ };
23
+ };
24
+ onEditFile: {
25
+ description: string;
26
+ control: false;
27
+ table: {
28
+ type: {
29
+ summary: string;
30
+ };
31
+ };
32
+ };
33
+ };
34
+ args: {
35
+ uploadedFiles: never[];
36
+ onEditFile: import("vitest").Mock<(...args: any[]) => any>;
37
+ };
38
+ };
39
+ export default meta;
40
+ type Story = StoryObj<typeof meta>;
41
+ export declare const Default: Story;
42
+ export declare const WithLinks: Story;
43
+ export declare const UploadInProgress: Story;
44
+ export declare const FailedUpload: Story;
45
+ export declare const WithErrorMessage: Story;
46
+ export declare const LinkWithErrorMessage: Story;
47
+ //# sourceMappingURL=FileList.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileList.stories.d.ts","sourceRoot":"","sources":["../../../src/components/fileUpload/FileList.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCuB,CAAC;AAElC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAmBrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAiBvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAY9B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAa1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAoB9B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAYlC,CAAC"}
@@ -0,0 +1,136 @@
1
+ import { fn } from 'storybook/test';
2
+ import { FileList } from './FileList.js';
3
+ const meta = {
4
+ title: 'Components/FileUpload/FileList',
5
+ component: FileList,
6
+ tags: ['autodocs'],
7
+ parameters: {
8
+ layout: 'padded',
9
+ docs: {
10
+ description: {
11
+ component: 'Renders the list of files and links attached to a `FileUpload`. Use it on its own when the list is shown without the dropzone.',
12
+ },
13
+ },
14
+ },
15
+ argTypes: {
16
+ uploadedFiles: {
17
+ description: 'Files and links to display. Each entry is an `UploadedFile`. Rows with an `href` render as links.',
18
+ control: false,
19
+ table: {
20
+ type: { summary: 'UploadedFile[]' },
21
+ },
22
+ },
23
+ onEditFile: {
24
+ description: 'Called with the row index when the Edit link button is clicked. The button only renders for link rows that also provide `onEdit`.',
25
+ control: false,
26
+ table: {
27
+ type: { summary: '(index: number) => void' },
28
+ },
29
+ },
30
+ },
31
+ args: {
32
+ uploadedFiles: [],
33
+ onEditFile: fn(),
34
+ },
35
+ };
36
+ export default meta;
37
+ export const Default = {
38
+ args: {
39
+ uploadedFiles: [
40
+ {
41
+ fileName: 'spring-term-report-2024.pdf',
42
+ fileType: 'PDF',
43
+ fileSize: '1.2 MB',
44
+ onDownload: fn(),
45
+ onDelete: fn(),
46
+ },
47
+ {
48
+ fileName: 'attendance-summary-jan.xlsx',
49
+ fileType: 'XLSX',
50
+ fileSize: '348 KB',
51
+ onDownload: fn(),
52
+ onDelete: fn(),
53
+ },
54
+ ],
55
+ },
56
+ };
57
+ export const WithLinks = {
58
+ args: {
59
+ uploadedFiles: [
60
+ {
61
+ fileName: 'Behaviour policy',
62
+ href: 'https://example.com/behaviour-policy',
63
+ onEdit: fn(),
64
+ onDelete: fn(),
65
+ },
66
+ {
67
+ fileName: 'Pastoral handbook',
68
+ href: 'https://example.com/pastoral-handbook',
69
+ onEdit: fn(),
70
+ onDelete: fn(),
71
+ },
72
+ ],
73
+ },
74
+ };
75
+ export const UploadInProgress = {
76
+ args: {
77
+ uploadedFiles: [
78
+ {
79
+ fileName: 'year-7-photo-day.zip',
80
+ fileType: 'ZIP',
81
+ fileSize: '48 MB',
82
+ progressPercentage: 45,
83
+ onDelete: fn(),
84
+ },
85
+ ],
86
+ },
87
+ };
88
+ export const FailedUpload = {
89
+ args: {
90
+ uploadedFiles: [
91
+ {
92
+ fileName: 'year-7-photo-day.zip',
93
+ fileType: 'ZIP',
94
+ fileSize: '48 MB',
95
+ progressPercentage: 45,
96
+ hasUploadFailed: true,
97
+ onDelete: fn(),
98
+ },
99
+ ],
100
+ },
101
+ };
102
+ export const WithErrorMessage = {
103
+ args: {
104
+ uploadedFiles: [
105
+ {
106
+ fileName: 'oversized-photo.png',
107
+ fileType: 'PNG',
108
+ fileSize: '18 MB',
109
+ hasUploadFailed: true,
110
+ errorMessage: 'This file is larger than the 10 MB limit.',
111
+ onDelete: fn(),
112
+ },
113
+ {
114
+ fileName: 'spring-term-report-2024.pdf',
115
+ fileType: 'PDF',
116
+ fileSize: '1.2 MB',
117
+ onDownload: fn(),
118
+ onDelete: fn(),
119
+ },
120
+ ],
121
+ },
122
+ };
123
+ export const LinkWithErrorMessage = {
124
+ args: {
125
+ uploadedFiles: [
126
+ {
127
+ fileName: 'Behaviour policy',
128
+ href: 'https://example.com/behaviour-policy',
129
+ errorMessage: 'This link could not be reached. Check the URL and try again.',
130
+ onEdit: fn(),
131
+ onDelete: fn(),
132
+ },
133
+ ],
134
+ },
135
+ };
136
+ //# sourceMappingURL=FileList.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileList.stories.js","sourceRoot":"","sources":["../../../src/components/fileUpload/FileList.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,gCAAgC;IACvC,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,SAAS,EAAE,gIAAgI;aAC5I;SACF;KACF;IACD,QAAQ,EAAE;QACR,aAAa,EAAE;YACb,WAAW,EAAE,mG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"","sources":["../../../src/components/fileUpload/FileList.test.tsx"],"names":[],"mappings":"AAGA,OAAO,kCAAkC,CAAC"}
@@ -0,0 +1,147 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { describe, expect, test, vi } from 'vitest';
3
+ import { render, screen } from '@testing-library/react';
4
+ import userEvent from '@testing-library/user-event';
5
+ import '@testing-library/jest-dom/vitest';
6
+ import { FileList } from './FileList.js';
7
+ const baseFile = {
8
+ fileName: 'report.pdf',
9
+ fileType: 'PDF',
10
+ fileSize: '1.2 MB',
11
+ };
12
+ const linkFile = {
13
+ fileName: 'Pastoral policy',
14
+ href: 'https://example.com/policy',
15
+ };
16
+ describe('FileList', () => {
17
+ describe('file rows', () => {
18
+ test('renders file name with type and size', () => {
19
+ render(_jsx(FileList, { uploadedFiles: [baseFile] }));
20
+ expect(screen.getByText('report.pdf')).toBeInTheDocument();
21
+ expect(screen.getByText('PDF, 1.2 MB')).toBeInTheDocument();
22
+ });
23
+ test('renders every file in the list', () => {
24
+ render(_jsx(FileList, { uploadedFiles: [
25
+ baseFile,
26
+ { fileName: 'photo.jpg', fileType: 'JPEG', fileSize: '3.7 MB' },
27
+ ] }));
28
+ expect(screen.getByText('report.pdf')).toBeInTheDocument();
29
+ expect(screen.getByText('photo.jpg')).toBeInTheDocument();
30
+ });
31
+ test('does not render a link for file rows', () => {
32
+ render(_jsx(FileList, { uploadedFiles: [baseFile] }));
33
+ expect(screen.queryByRole('link')).not.toBeInTheDocument();
34
+ });
35
+ test('shows Upload failed in place of the file meta', () => {
36
+ render(_jsx(FileList, { uploadedFiles: [{ ...baseFile, hasUploadFailed: true }] }));
37
+ expect(screen.getByText('Upload failed')).toBeInTheDocument();
38
+ expect(screen.queryByText('PDF, 1.2 MB')).not.toBeInTheDocument();
39
+ });
40
+ });
41
+ describe('link rows', () => {
42
+ test('renders the name as an anchor opening in a new tab with the href as meta', () => {
43
+ render(_jsx(FileList, { uploadedFiles: [linkFile] }));
44
+ const anchor = screen.getByRole('link', { name: 'Pastoral policy' });
45
+ expect(anchor).toHaveAttribute('href', 'https://example.com/policy');
46
+ expect(anchor).toHaveAttribute('target', '_blank');
47
+ expect(anchor).toHaveAttribute('rel', 'noopener noreferrer');
48
+ expect(screen.getByText('https://example.com/policy')).toBeInTheDocument();
49
+ });
50
+ test('merges linkProps onto the anchor', () => {
51
+ render(_jsx(FileList, { uploadedFiles: [{ ...linkFile, linkProps: { target: '_self' } }] }));
52
+ expect(screen.getByRole('link', { name: 'Pastoral policy' })).toHaveAttribute('target', '_self');
53
+ });
54
+ test('passes href, className and children to renderLink', () => {
55
+ const renderLink = vi.fn(({ href, className, children }) => (_jsx("a", { href: href, className: className, children: children })));
56
+ render(_jsx(FileList, { uploadedFiles: [{ ...linkFile, renderLink }] }));
57
+ expect(renderLink).toHaveBeenCalledWith(expect.objectContaining({
58
+ href: 'https://example.com/policy',
59
+ className: 'ds-file-upload__file-link',
60
+ }));
61
+ expect(screen.getByRole('link', { name: 'Pastoral policy' })).toBeInTheDocument();
62
+ });
63
+ });
64
+ describe('progress', () => {
65
+ test('shows an accessible progress bar while the upload is in progress', () => {
66
+ render(_jsx(FileList, { uploadedFiles: [{ ...baseFile, progressPercentage: 40 }] }));
67
+ expect(screen.getByRole('progressbar', { name: 'Upload progress bar' })).toBeInTheDocument();
68
+ });
69
+ test('hides the progress bar once progressPercentage reaches 100', () => {
70
+ render(_jsx(FileList, { uploadedFiles: [{ ...baseFile, progressPercentage: 100 }] }));
71
+ expect(screen.queryByRole('progressbar')).not.toBeInTheDocument();
72
+ });
73
+ test('hides the progress bar when progressPercentage is not set', () => {
74
+ render(_jsx(FileList, { uploadedFiles: [baseFile] }));
75
+ expect(screen.queryByRole('progressbar')).not.toBeInTheDocument();
76
+ });
77
+ });
78
+ describe('error messages', () => {
79
+ test('replaces file meta with the errorMessage', () => {
80
+ render(_jsx(FileList, { uploadedFiles: [{ ...baseFile, errorMessage: 'This file is larger than the 10 MB limit.' }] }));
81
+ expect(screen.getByText('This file is larger than the 10 MB limit.')).toBeInTheDocument();
82
+ expect(screen.queryByText('PDF, 1.2 MB')).not.toBeInTheDocument();
83
+ });
84
+ test('shows the errorMessage instead of "Upload failed" when both are set', () => {
85
+ render(_jsx(FileList, { uploadedFiles: [{ ...baseFile, hasUploadFailed: true, errorMessage: 'File is corrupt.' }] }));
86
+ expect(screen.getByText('File is corrupt.')).toBeInTheDocument();
87
+ expect(screen.queryByText('Upload failed')).not.toBeInTheDocument();
88
+ });
89
+ test('shows the errorMessage for link rows and keeps the anchor', () => {
90
+ render(_jsx(FileList, { uploadedFiles: [{ ...linkFile, errorMessage: 'This link could not be reached.' }] }));
91
+ expect(screen.getByRole('link', { name: 'Pastoral policy' })).toHaveAttribute('href', 'https://example.com/policy');
92
+ expect(screen.getByText('This link could not be reached.')).toBeInTheDocument();
93
+ expect(screen.queryByText('https://example.com/policy')).not.toBeInTheDocument();
94
+ });
95
+ test('shows the file meta when errorMessage is an empty string', () => {
96
+ render(_jsx(FileList, { uploadedFiles: [{ ...baseFile, errorMessage: '' }] }));
97
+ expect(screen.getByText('PDF, 1.2 MB')).toBeInTheDocument();
98
+ });
99
+ });
100
+ describe('actions', () => {
101
+ test('calls onDelete from the Delete file button', async () => {
102
+ const onDelete = vi.fn();
103
+ render(_jsx(FileList, { uploadedFiles: [{ ...baseFile, onDelete }] }));
104
+ await userEvent.click(screen.getByRole('button', { name: 'Delete file' }));
105
+ expect(onDelete).toHaveBeenCalledOnce();
106
+ });
107
+ test('labels the delete button Delete link for link rows', () => {
108
+ render(_jsx(FileList, { uploadedFiles: [{ ...linkFile, onDelete: vi.fn() }] }));
109
+ expect(screen.getByRole('button', { name: 'Delete link' })).toBeInTheDocument();
110
+ });
111
+ test('calls onDownload from the Download file button', async () => {
112
+ const onDownload = vi.fn();
113
+ render(_jsx(FileList, { uploadedFiles: [{ ...baseFile, onDownload }] }));
114
+ await userEvent.click(screen.getByRole('button', { name: 'Download file' }));
115
+ expect(onDownload).toHaveBeenCalledOnce();
116
+ });
117
+ test('does not render a Download file button without onDownload', () => {
118
+ render(_jsx(FileList, { uploadedFiles: [baseFile] }));
119
+ expect(screen.queryByRole('button', { name: 'Download file' })).not.toBeInTheDocument();
120
+ });
121
+ test('copies the href to the clipboard for link rows', async () => {
122
+ const user = userEvent.setup();
123
+ render(_jsx(FileList, { uploadedFiles: [linkFile] }));
124
+ await user.click(screen.getByRole('button', { name: 'Copy link' }));
125
+ expect(await navigator.clipboard.readText()).toBe('https://example.com/policy');
126
+ });
127
+ test('does not render a Copy link button for file rows', () => {
128
+ render(_jsx(FileList, { uploadedFiles: [baseFile] }));
129
+ expect(screen.queryByRole('button', { name: 'Copy link' })).not.toBeInTheDocument();
130
+ });
131
+ test('calls onEditFile with the index of the edited link row', async () => {
132
+ const onEditFile = vi.fn();
133
+ render(_jsx(FileList, { uploadedFiles: [baseFile, { ...linkFile, onEdit: vi.fn() }], onEditFile: onEditFile }));
134
+ await userEvent.click(screen.getByRole('button', { name: 'Edit link' }));
135
+ expect(onEditFile).toHaveBeenCalledWith(1);
136
+ });
137
+ test('does not render an Edit link button without onEditFile', () => {
138
+ render(_jsx(FileList, { uploadedFiles: [{ ...linkFile, onEdit: vi.fn() }] }));
139
+ expect(screen.queryByRole('button', { name: 'Edit link' })).not.toBeInTheDocument();
140
+ });
141
+ test('does not render an Edit link button when the link has no onEdit', () => {
142
+ render(_jsx(FileList, { uploadedFiles: [linkFile], onEditFile: vi.fn() }));
143
+ expect(screen.queryByRole('button', { name: 'Edit link' })).not.toBeInTheDocument();
144
+ });
145
+ });
146
+ });
147
+ //# sourceMappingURL=FileList.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileList.test.js","sourceRoot":"","sources":["../../../src/components/fileUpload/FileList.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,E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CAAC,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAC3D,UAAU,EAAE,UAAU,GACtB,CACH,CAAC;YACF,MAAM,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;YACzE,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,wDAAwD,EAAE,GAAG,EAAE;YAClE,MAAM,CAAC,KAAC,QAAQ,IAAC,aAAa,EAAE,CAAC,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAI,CAAC,CAAC;YACxE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;QACtF,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,iEAAiE,EAAE,GAAG,EAAE;YAC3E,MAAM,CAAC,KAAC,QAAQ,IAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE,GAAI,CAAC,CAAC;YACrE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;QACtF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -2,9 +2,10 @@ import type { IconName } from '../icon/allowedIcons.js';
2
2
  import { type AnchorHTMLAttributes, type ReactElement, type ReactNode } from 'react';
3
3
  import type { WidgetRenderLinkArgs } from '../widget/types.js';
4
4
  import { type FileUploadLink } from './FileUploadLinkModal.js';
5
+ import { type FileListProps as ListProps } from './FileList.js';
5
6
  export type { FileUploadLink };
6
7
  type LinkAnchorProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'className' | 'children'>;
7
- type UploadedFile = {
8
+ export type UploadedFile = {
8
9
  fileName: string;
9
10
  icon?: IconName;
10
11
  fileType?: string;
@@ -14,9 +15,10 @@ type UploadedFile = {
14
15
  renderLink?: (args: WidgetRenderLinkArgs) => ReactElement;
15
16
  onEdit?: (link: FileUploadLink) => void;
16
17
  onDownload?: () => void;
17
- onDelete: () => void;
18
+ onDelete?: () => void;
18
19
  progressPercentage?: number;
19
20
  hasUploadFailed?: boolean;
21
+ errorMessage?: string;
20
22
  };
21
23
  export type FileUploadProps = {
22
24
  className?: string;
@@ -24,6 +26,15 @@ export type FileUploadProps = {
24
26
  uploadFiles: (files: File[]) => void;
25
27
  dropzoneContent?: ReactNode;
26
28
  onAddLink?: (link: FileUploadLink) => void;
29
+ errorMessage?: string;
27
30
  };
28
- export declare const FileUpload: (props: FileUploadProps) => import("react").JSX.Element;
31
+ export declare const FileUpload: {
32
+ (props: FileUploadProps): import("react").JSX.Element;
33
+ FileList: (props: ListProps) => import("react").JSX.Element;
34
+ };
35
+ export declare namespace FileUpload {
36
+ type Props = FileUploadProps;
37
+ type FileListProps = ListProps;
38
+ type File = UploadedFile;
39
+ }
29
40
  //# sourceMappingURL=FileUpload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/fileUpload/FileUpload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAY,KAAK,oBAAoB,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAuB,K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AAS,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAIF,eAAO,MAAM,UAAU;YAAW,eAAe;;CAiHhD,CAAC;AAIF,yBAAiB,UAAU,CAAC;IAC1B,KAAY,KAAK,GAAG,eAAe,CAAC;IACpC,KAAY,aAAa,GAAG,SAAS,CAAC;IACtC,KAAY,IAAI,GAAG,YAAY,CAAC;CACjC"}
@@ -3,20 +3,12 @@ import classNames from 'classnames';
3
3
  import { Button } from '../button/Button.js';
4
4
  import { Card } from '../card/Card.js';
5
5
  import { Icon } from '../icon/Icon.js';
6
- import { Separator } from '../separator/Separator.js';
7
6
  import { useState } from 'react';
8
7
  import Dropzone from 'react-dropzone';
9
- import { Progress } from '../progress/Progress.js';
10
8
  import { FileUploadLinkModal } from './FileUploadLinkModal.js';
11
- const renderFileLink = ({ href = '', linkProps, renderLink }, children) => {
12
- const className = 'ds-file-upload__file-link';
13
- if (renderLink) {
14
- return renderLink({ href, className, children, linkProps });
15
- }
16
- return (_jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer", className: className, ...linkProps, children: children }));
17
- };
9
+ import { FileList } from './FileList.js';
18
10
  export const FileUpload = (props) => {
19
- const { className, uploadedFiles, uploadFiles, onAddLink, } = props;
11
+ const { className, uploadedFiles, uploadFiles, onAddLink, errorMessage, } = props;
20
12
  const [linkPopup, setLinkPopup] = useState(null);
21
13
  const dropzoneContent = props.dropzoneContent ?? (_jsxs(_Fragment, { children: [_jsx("p", { children: onAddLink
22
14
  ? (_jsxs(_Fragment, { children: ["Drag and drop,", ' ', _jsx(Button, { variant: "text-link", onClick: (event) => {
@@ -24,25 +16,16 @@ export const FileUpload = (props) => {
24
16
  setLinkPopup({ mode: 'add' });
25
17
  }, children: "add a link" }), ' ', "or"] }))
26
18
  : 'Drag and drop or' }), _jsx(Button, { variant: "secondary", children: "Browse files" })] }));
27
- const editedFile = linkPopup?.mode === 'edit' ? uploadedFiles[linkPopup.index] : undefined;
19
+ const fileToEdit = linkPopup?.mode === 'edit' ? uploadedFiles[linkPopup.index] : undefined;
28
20
  return (_jsxs("div", { className: classNames('ds-file-upload', className), children: [_jsx(Dropzone, { onDrop: (acceptedFiles) => {
29
21
  uploadFiles(acceptedFiles);
30
- }, children: ({ getRootProps, getInputProps }) => (_jsx(Card, { children: _jsxs("div", { ...getRootProps(), className: "ds-file-upload__dropzone-input", children: [_jsx("input", { ...getInputProps({ 'aria-label': 'Upload files' }) }), _jsxs("div", { className: "ds-file-upload__dropzone-content", children: [_jsx("span", { className: "ds-file-upload__icon-wrapper", children: _jsx(Icon, { name: "cloud-upload", size: 24, color: "var(--color-brand-600)" }) }), _jsx("div", { className: "ds-file-upload__dropzone-text-wrapper", children: dropzoneContent })] })] }) })) }), linkPopup?.mode === 'add' && onAddLink && (_jsx(FileUploadLinkModal, { title: "Add URL attachment", submitLabel: "Add", onSubmit: (link) => {
22
+ }, children: ({ getRootProps, getInputProps }) => (_jsx(Card, { children: _jsxs("div", { ...getRootProps(), className: "ds-file-upload__dropzone-input", children: [_jsx("input", { ...getInputProps({ 'aria-label': 'Upload files' }) }), _jsxs("div", { className: "ds-file-upload__dropzone-content", children: [_jsx("span", { className: "ds-file-upload__icon-wrapper", children: _jsx(Icon, { name: "cloud-upload", size: 24, color: "var(--color-brand-600)" }) }), _jsx("div", { className: "ds-file-upload__dropzone-text-wrapper", children: dropzoneContent })] })] }) })) }), errorMessage && (_jsxs("span", { className: "ds-file-upload__error", children: [_jsx(Icon, { name: "alert-triangle" }), ' ', errorMessage] })), linkPopup?.mode === 'add' && onAddLink && (_jsx(FileUploadLinkModal, { title: "Add URL attachment", submitLabel: "Add", onSubmit: (link) => {
31
23
  onAddLink(link);
32
24
  setLinkPopup(null);
33
- }, onCancel: () => setLinkPopup(null) })), editedFile?.href && editedFile.onEdit && (_jsx(FileUploadLinkModal, { title: "Update URL attachment", submitLabel: "Update", initialLink: { url: editedFile.href, name: editedFile.fileName }, onSubmit: (link) => {
34
- editedFile.onEdit?.(link);
25
+ }, onCancel: () => setLinkPopup(null) })), fileToEdit?.href && fileToEdit.onEdit && (_jsx(FileUploadLinkModal, { title: "Update URL attachment", submitLabel: "Update", initialLink: { url: fileToEdit.href, name: fileToEdit.fileName }, onSubmit: (link) => {
26
+ fileToEdit.onEdit?.(link);
35
27
  setLinkPopup(null);
36
- }, onCancel: () => setLinkPopup(null) })), uploadedFiles.length > 0 && (_jsx(Card, { className: "ds-file-upload__file-list", children: uploadedFiles.map((file, index) => {
37
- const { fileName, fileSize, fileType, href, onEdit, onDelete, onDownload, hasUploadFailed, progressPercentage, } = file;
38
- const icon = file.icon ?? (href ? 'link' : 'file');
39
- const nameNode = _jsx("span", { className: "ds-file-upload__file-name", children: fileName });
40
- return (_jsxs("div", { className: "ds-file-upload__file-outer", children: [_jsxs("span", { className: "ds-file-upload__file", children: [_jsx("span", { className: "ds-file-upload__icon-wrapper", children: _jsx(Icon, { size: 24, name: icon, color: "var(--color-brand-600)" }) }), _jsxs("span", { className: "ds-file-upload__file-details", children: [href ? renderFileLink(file, nameNode) : nameNode, hasUploadFailed
41
- ? (_jsxs("span", { className: "ds-file-upload__upload-failed", children: [_jsx(Icon, { name: "circle-alert" }), ' ', "Upload failed"] }))
42
- : _jsx("span", { className: "ds-file-upload__file-meta", children: href ?? `${fileType}, ${fileSize}` })] }), href && (_jsx(Button, { variant: "secondary", isRound: true, onClick: () => navigator.clipboard.writeText(href), children: _jsx(Icon, { name: "copy", screenReaderText: "Copy link" }) })), href && onEdit && (_jsx(Button, { variant: "secondary", isRound: true, onClick: () => setLinkPopup({ mode: 'edit', index }), children: _jsx(Icon, { name: "pencil", screenReaderText: "Edit link" }) })), onDownload && (_jsx(Button, { variant: "secondary", isRound: true, onClick: onDownload, children: _jsx(Icon, { name: "download", screenReaderText: "Download file" }) })), onDelete && (_jsx(Button, { variant: "secondary", isRound: true, onClick: onDelete, children: _jsx(Icon, { name: "trash", screenReaderText: href ? 'Delete link' : 'Delete file' }) }))] }), typeof progressPercentage === 'number' && progressPercentage < 100
43
- && (_jsx(Progress, { value: progressPercentage, className: "ds-file-upload__progress-bar", "aria-label": "Upload progress bar", indicatorClassName: classNames('ds-file-upload__progress-bar-indicator', {
44
- 'ds-file-upload__progress-bar-indicator--failed': hasUploadFailed,
45
- }) })), index < uploadedFiles.length - 1 && _jsx(Separator, {})] }, fileName));
46
- }) }))] }));
28
+ }, onCancel: () => setLinkPopup(null) })), uploadedFiles.length > 0 && (_jsx(FileList, { uploadedFiles: uploadedFiles, onEditFile: index => setLinkPopup({ mode: 'edit', index }) }))] }));
47
29
  };
30
+ FileUpload.FileList = FileList;
48
31
  //# sourceMappingURL=FileUpload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileUpload.js","sourceRoot":"","sources":["../../../src/components/fileUpload/FileUpload.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAgE,MAAM,OAAO,CAAC;AAC/F,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAuB,MAAM,0BAA0B,CAAC;AA+BpF,MAAM,cAAc,GAAG,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,EAAE,UAAU,EAAgB,EAAE,QAAmB,EAAE,EAAE;IACjG,MAAM,SAAS,GAAG,2BAA2B,CAAC;IAC9C,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS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,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,EAChE,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;oBACjB,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;oBAC1B,YAAY,CAAC,IAAI,CAAC,CAAC;gBACrB,CAAC,EACD,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,GAClC,CACH,EACA,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,KAAC,QAAQ,IACP,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAC1D,CACH,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -3,7 +3,10 @@ import type { FileUploadProps } from './FileUpload.js';
3
3
  declare function FileUploadDocsPage(): import("react").JSX.Element;
4
4
  declare const meta: {
5
5
  title: string;
6
- component: (props: FileUploadProps) => import("react").JSX.Element;
6
+ component: {
7
+ (props: FileUploadProps): import("react").JSX.Element;
8
+ FileList: (props: import("./FileList.js").FileListProps) => import("react").JSX.Element;
9
+ };
7
10
  tags: string[];
8
11
  parameters: {
9
12
  layout: string;
@@ -42,6 +45,15 @@ declare const meta: {
42
45
  };
43
46
  };
44
47
  };
48
+ errorMessage: {
49
+ description: string;
50
+ control: "text";
51
+ table: {
52
+ type: {
53
+ summary: string;
54
+ };
55
+ };
56
+ };
45
57
  className: {
46
58
  description: string;
47
59
  control: "text";
@@ -67,6 +79,9 @@ export declare const WithoutDownloadButton: Story;
67
79
  export declare const UploadInProgress: Story;
68
80
  export declare const FailedUpload: Story;
69
81
  export declare const FailedDuringUpload: Story;
82
+ export declare const WithErrorMessage: Story;
83
+ export declare const ErrorMessageWithoutFiles: Story;
84
+ export declare const FileWithErrorMessage: Story;
70
85
  export declare const CustomDropzoneContent: Story;
71
86
  export declare const SimulatedUploadLifecycle: Story;
72
87
  //# sourceMappingURL=FileUpload.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileUpload.stories.d.ts","sourceRoot":"","sources":["../../../src/components/fileUpload/FileUpload.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAe5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA6GvD,iBAAS,kBAAkB,gCAmB1B;AAID,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDyB,CAAC;AAEpC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAkDnC,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAIF,eAAO,MAAM,iBAAiB,EAAE,KAsD/B,CAAC;AAIF,eAAO,MAAM,SAAS,EAAE,KA2DvB,CAAC;AAIF,eAAO,MAAM,UAAU,EAAE,KAgDxB,CAAC;AAIF,eAAO,MAAM,qBAAqB,EAAE,KA8DnC,CAAC;AAIF,eAAO,MAAM,gBAAgB,EAAE,KAmF9B,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,KAiE1B,CAAC;AAIF,eAAO,MAAM,kBAAkB,EAAE,KAuEhC,CAAC;AAIF,eAAO,MAAM,qBAAqB,EAAE,KAiDnC,CAAC;AA2FF,eAAO,MAAM,wBAAwB,EAAE,KAuGtC,CAAC"}
1
+ {"version":3,"file":"FileUpload.stories.d.ts","sourceRoot":"","sources":["../../../src/components/fileUpload/FileUpload.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAe5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA6GvD,iBAAS,kBA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