@muraldevkit/ui-toolkit 4.75.0 → 4.76.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 (40) hide show
  1. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.js +404 -0
  2. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.js.map +1 -0
  3. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.module.scss.js +8 -0
  4. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.module.scss.js.map +1 -0
  5. package/dist/cjs/components/file-upload/constants.js +48 -0
  6. package/dist/cjs/components/file-upload/constants.js.map +1 -0
  7. package/dist/cjs/components/file-upload/helpers.js +67 -0
  8. package/dist/cjs/components/file-upload/helpers.js.map +1 -0
  9. package/dist/cjs/index.js +37 -31
  10. package/dist/cjs/index.js.map +1 -1
  11. package/dist/cjs/version.js +1 -1
  12. package/dist/cjs/version.js.map +1 -1
  13. package/dist/components/file-upload/MrlFileUpload/MrlFileUpload.d.ts +154 -0
  14. package/dist/components/file-upload/MrlFileUpload/index.d.ts +1 -0
  15. package/dist/components/file-upload/constants.d.ts +35 -0
  16. package/dist/components/file-upload/helpers.d.ts +35 -0
  17. package/dist/components/file-upload/index.d.ts +2 -0
  18. package/dist/components/index.d.ts +1 -0
  19. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.js +379 -0
  20. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.js.map +1 -0
  21. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.module.scss.js +4 -0
  22. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.module.scss.js.map +1 -0
  23. package/dist/esm/components/file-upload/constants.js +44 -0
  24. package/dist/esm/components/file-upload/constants.js.map +1 -0
  25. package/dist/esm/components/file-upload/helpers.js +62 -0
  26. package/dist/esm/components/file-upload/helpers.js.map +1 -0
  27. package/dist/esm/index.js +2 -0
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/version.js +1 -1
  30. package/dist/esm/version.js.map +1 -1
  31. package/dist/styles/MrlFileUpload/module.scss +136 -0
  32. package/dist/styles/file-upload/variables.scss +13 -0
  33. package/dist/styles.css +1 -0
  34. package/dist/types/components/file-upload/MrlFileUpload/MrlFileUpload.d.ts +154 -0
  35. package/dist/types/components/file-upload/MrlFileUpload/index.d.ts +1 -0
  36. package/dist/types/components/file-upload/constants.d.ts +35 -0
  37. package/dist/types/components/file-upload/helpers.d.ts +35 -0
  38. package/dist/types/components/file-upload/index.d.ts +2 -0
  39. package/dist/types/components/index.d.ts +1 -0
  40. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.75.0\";"],"names":["TOOLKIT_VERSION"],"mappings":"AAAO,IAAMA,eAAe,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.76.0\";"],"names":["TOOLKIT_VERSION"],"mappings":"AAAO,IAAMA,eAAe,GAAG;;;;"}
@@ -0,0 +1,136 @@
1
+
2
+ @use '../file-upload.variables.scss';
3
+ .MrlFileUpload {
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: var(--mrl-file-upload-gap);
7
+ max-width: 100%;
8
+ min-width: 0;
9
+ width: var(--mrl-file-upload-width);
10
+ }
11
+ .MrlFileUpload-label {
12
+ color: var(--mrl-color-text-label);
13
+ font-family: var(--mrl-heading-font);
14
+ font-size: var(--mrl-font-size-03);
15
+ font-weight: var(--mrl-font-weight-02);
16
+ line-height: var(--mrl-line-height-03);
17
+ padding-inline: var(--mrl-spacing-01);
18
+ }
19
+ .MrlFileUpload-zone {
20
+ align-items: center;
21
+ background-color: var(--mrl-file-upload-background);
22
+ border: var(--mrl-file-upload-border-width) var(--mrl-file-upload-border-style)
23
+ var(--mrl-file-upload-border-color);
24
+ border-radius: var(--mrl-file-upload-radius);
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: var(--mrl-space-stack-related);
28
+ justify-content: center;
29
+ min-height: var(--mrl-file-upload-min-height);
30
+ padding: var(--mrl-space-inset-control);
31
+ text-align: center;
32
+ transition:
33
+ border-color var(--mrl-duration-02) ease,
34
+ background-color var(--mrl-duration-02) ease;
35
+ &:hover {
36
+ --mrl-file-upload-background: var(--mrl-color-background-emph-hover);
37
+ --mrl-file-upload-border-color: var(--mrl-color-line-hover);
38
+ }
39
+ }
40
+ .MrlFileUpload-zone--dragging {
41
+ &,
42
+ &:hover {
43
+ --mrl-file-upload-background: var(--mrl-color-background-decorative);
44
+ --mrl-file-upload-border-color: var(--mrl-color-accent);
45
+ --mrl-file-upload-border-width: var(--mrl-line-width-control);
46
+ }
47
+ }
48
+ .MrlFileUpload-zone--uploading {
49
+ &:hover {
50
+ --mrl-file-upload-background: var(--mrl-color-background-secondary);
51
+ --mrl-file-upload-border-color: var(--mrl-color-line);
52
+ }
53
+ }
54
+ .MrlFileUpload-zone--complete {
55
+ &,
56
+ &:hover {
57
+ --mrl-file-upload-border-color: rgba(var(--mrl-status-success), 1);
58
+ --mrl-file-upload-border-style: solid;
59
+ }
60
+ }
61
+ .MrlFileUpload-zone--error {
62
+ &,
63
+ &:hover {
64
+ --mrl-file-upload-background: var(--mrl-color-background-error-light);
65
+ --mrl-file-upload-border-color: rgba(var(--mrl-status-error), 1);
66
+ --mrl-file-upload-border-style: solid;
67
+ }
68
+ }
69
+ .MrlFileUpload-zone--disabled {
70
+ --mrl-file-upload-border-color: var(--mrl-color-line-disabled);
71
+ pointer-events: none;
72
+ p {
73
+ color: var(--mrl-color-text-disabled);
74
+ }
75
+ }
76
+ .MrlFileUpload-content,
77
+ .MrlFileUpload-preloader {
78
+ align-items: center;
79
+ display: flex;
80
+ flex-direction: column;
81
+ width: 100%;
82
+ }
83
+ .MrlFileUpload-preloader {
84
+ gap: var(--mrl-spacing-02);
85
+ }
86
+ .MrlFileUpload-heading {
87
+ color: var(--mrl-color-text);
88
+ font-family: var(--mrl-heading-font);
89
+ font-size: var(--mrl-font-size-03);
90
+ font-weight: var(--mrl-font-weight-04);
91
+ line-height: var(--mrl-line-height-03);
92
+ margin: 0;
93
+ }
94
+ .MrlFileUpload-heading--accent {
95
+ color: var(--mrl-color-accent);
96
+ }
97
+ .MrlFileUpload-heading--strong {
98
+ color: var(--mrl-color-text-heading);
99
+ }
100
+ .MrlFileUpload-icon {
101
+ display: block;
102
+ height: var(--mrl-spacing-08);
103
+ width: var(--mrl-spacing-08);
104
+ svg {
105
+ height: 100%;
106
+ width: 100%;
107
+ }
108
+ }
109
+ .MrlFileUpload-icon--accent {
110
+ color: var(--mrl-color-accent);
111
+ fill: var(--mrl-color-accent);
112
+ }
113
+ .MrlFileUpload-icon--success {
114
+ color: rgba(var(--mrl-status-success), 1);
115
+ fill: rgba(var(--mrl-status-success), 1);
116
+ }
117
+ .MrlFileUpload-progress {
118
+ max-width: 100%;
119
+ padding-block: var(--mrl-spacing-04) var(--mrl-spacing-03);
120
+ width: var(--mrl-file-upload-progress-width);
121
+ }
122
+ .MrlFileUpload-input {
123
+ border: 0;
124
+ clip-path: inset(50%);
125
+ height: 1px;
126
+ overflow: hidden;
127
+ padding: 0;
128
+ position: absolute;
129
+ white-space: nowrap;
130
+ width: 1px;
131
+ }
132
+ @media (prefers-reduced-motion: reduce) {
133
+ .MrlFileUpload-zone {
134
+ transition: none;
135
+ }
136
+ }
@@ -0,0 +1,13 @@
1
+
2
+ :root,
3
+ .MrlFileUpload {
4
+ --mrl-file-upload-background: var(--mrl-color-background-secondary);
5
+ --mrl-file-upload-border-color: var(--mrl-color-line);
6
+ --mrl-file-upload-border-style: dashed;
7
+ --mrl-file-upload-border-width: var(--mrl-line-width-border-fine);
8
+ --mrl-file-upload-gap: var(--mrl-spacing-02);
9
+ --mrl-file-upload-min-height: 10rem;
10
+ --mrl-file-upload-progress-width: 11rem;
11
+ --mrl-file-upload-radius: var(--mrl-border-radius-content-large);
12
+ --mrl-file-upload-width: 100%;
13
+ }
package/dist/styles.css CHANGED
@@ -1089,3 +1089,4 @@
1089
1089
  0px
1090
1090
  )*-1)}}@keyframes outline-animation--AuhQN{0%{outline:0 solid rgba(0,0,0,0);outline-offset:1px}50%{outline:4px solid var(--mrl-color-focus);outline-offset:1px}100%{outline:2px solid var(--mrl-color-focus);outline-offset:1px}}.MrlBreadcrumbItem--Yocns a:focus-visible::after{border-radius:var(--mrl-radii-03)}.MrlBreadcrumbItem--Yocns a:hover{color:var(--mrl-color-text-hover)}.MrlBreadcrumbItem--Yocns a--active{color:var(--mrl-color-text-selected);font-weight:var(--mrl-font-weight-04)}.MrlBreadcrumbItem--icon--gXFtv,.MrlBreadcrumbItem--separator--TqMuV{align-items:center;color:var(--mrl-color-text);height:.75rem;margin:0 var(--mrl-spacing-01);width:.75rem}
1091
1091
  .MrlBreadcrumbs--list--ap5b9{align-items:center;display:flex;justify-items:flex-start}
1092
+ :root,.MrlFileUpload--q42Jc{--mrl-file-upload-background: var(--mrl-color-background-secondary);--mrl-file-upload-border-color: var(--mrl-color-line);--mrl-file-upload-border-style: dashed;--mrl-file-upload-border-width: var(--mrl-line-width-border-fine);--mrl-file-upload-gap: var(--mrl-spacing-02);--mrl-file-upload-min-height: 10rem;--mrl-file-upload-progress-width: 11rem;--mrl-file-upload-radius: var(--mrl-border-radius-content-large);--mrl-file-upload-width: 100%}.MrlFileUpload--q42Jc{display:flex;flex-direction:column;gap:var(--mrl-file-upload-gap);max-width:100%;min-width:0;width:var(--mrl-file-upload-width)}.MrlFileUpload-label--fuqMG{color:var(--mrl-color-text-label);font-family:var(--mrl-heading-font);font-size:var(--mrl-font-size-03);font-weight:var(--mrl-font-weight-02);line-height:var(--mrl-line-height-03);padding-inline:var(--mrl-spacing-01)}.MrlFileUpload-zone--pB0EK{align-items:center;background-color:var(--mrl-file-upload-background);border:var(--mrl-file-upload-border-width) var(--mrl-file-upload-border-style) var(--mrl-file-upload-border-color);border-radius:var(--mrl-file-upload-radius);display:flex;flex-direction:column;gap:var(--mrl-space-stack-related);justify-content:center;min-height:var(--mrl-file-upload-min-height);padding:var(--mrl-space-inset-control);text-align:center;transition:border-color var(--mrl-duration-02) ease,background-color var(--mrl-duration-02) ease}.MrlFileUpload-zone--pB0EK:hover{--mrl-file-upload-background: var(--mrl-color-background-emph-hover);--mrl-file-upload-border-color: var(--mrl-color-line-hover)}.MrlFileUpload-zone--dragging--aZBH2,.MrlFileUpload-zone--dragging--aZBH2:hover{--mrl-file-upload-background: var(--mrl-color-background-decorative);--mrl-file-upload-border-color: var(--mrl-color-accent);--mrl-file-upload-border-width: var(--mrl-line-width-control)}.MrlFileUpload-zone--uploading--f0aUR:hover{--mrl-file-upload-background: var(--mrl-color-background-secondary);--mrl-file-upload-border-color: var(--mrl-color-line)}.MrlFileUpload-zone--complete--HeuVL,.MrlFileUpload-zone--complete--HeuVL:hover{--mrl-file-upload-border-color: rgba(var(--mrl-status-success), 1);--mrl-file-upload-border-style: solid}.MrlFileUpload-zone--error--f5DIT,.MrlFileUpload-zone--error--f5DIT:hover{--mrl-file-upload-background: var(--mrl-color-background-error-light);--mrl-file-upload-border-color: rgba(var(--mrl-status-error), 1);--mrl-file-upload-border-style: solid}.MrlFileUpload-zone--disabled--UgSP5{--mrl-file-upload-border-color: var(--mrl-color-line-disabled);pointer-events:none}.MrlFileUpload-zone--disabled--UgSP5 p{color:var(--mrl-color-text-disabled)}.MrlFileUpload-content--vybKc,.MrlFileUpload-preloader--Aib44{align-items:center;display:flex;flex-direction:column;width:100%}.MrlFileUpload-preloader--Aib44{gap:var(--mrl-spacing-02)}.MrlFileUpload-heading--J4xnq{color:var(--mrl-color-text);font-family:var(--mrl-heading-font);font-size:var(--mrl-font-size-03);font-weight:var(--mrl-font-weight-04);line-height:var(--mrl-line-height-03);margin:0}.MrlFileUpload-heading--accent--UCQja{color:var(--mrl-color-accent)}.MrlFileUpload-heading--strong--FRgxv{color:var(--mrl-color-text-heading)}.MrlFileUpload-icon--ZLxPa{display:block;height:var(--mrl-spacing-08);width:var(--mrl-spacing-08)}.MrlFileUpload-icon--ZLxPa svg{height:100%;width:100%}.MrlFileUpload-icon--accent--bav01{color:var(--mrl-color-accent);fill:var(--mrl-color-accent)}.MrlFileUpload-icon--success--G_dKs{color:rgba(var(--mrl-status-success), 1);fill:rgba(var(--mrl-status-success), 1)}.MrlFileUpload-progress--a6AlX{max-width:100%;padding-block:var(--mrl-spacing-04) var(--mrl-spacing-03);width:var(--mrl-file-upload-progress-width)}.MrlFileUpload-input--GCD8R{border:0;clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion: reduce){.MrlFileUpload-zone--pB0EK{transition:none}}
@@ -0,0 +1,154 @@
1
+ import * as React from 'react';
2
+ import { ProgressRange } from '../../loader/constants';
3
+ import { DataQa } from '../../../utils/dataQa';
4
+ import { MrlFileUploadState } from '../constants';
5
+ /**
6
+ * The resting half of the state contract: anything but a reported failure.
7
+ */
8
+ type MrlFileUploadRestingProps = {
9
+ /**
10
+ * Message for a failure the consumer is not currently reporting — kept across
11
+ * a retry, for instance. Rendered only in the error state.
12
+ */
13
+ errorMessage?: string;
14
+ /**
15
+ * The visual state of the zone, owned by the consumer. The component tracks
16
+ * drag state and local validation itself, but never starts, advances or
17
+ * completes an upload — pass 'uploading' with a `percent`, then 'complete'.
18
+ * Reporting 'error' requires an `errorMessage`, so it lives in the other half
19
+ * of this union.
20
+ *
21
+ * 'disabled' blocks all interaction: drag, drop and click handlers return
22
+ * early rather than relying on `pointer-events` alone. Because it is a value
23
+ * of this union rather than a separate flag, it replaces the lifecycle state
24
+ * rather than composing with it — a zone cannot be disabled *and* report
25
+ * progress at the same time.
26
+ */
27
+ state?: Exclude<MrlFileUploadState, 'error'>;
28
+ };
29
+ /**
30
+ * The failure half: reporting an error means saying what went wrong.
31
+ */
32
+ type MrlFileUploadErrorProps = {
33
+ /**
34
+ * Why the upload failed. Required alongside `state="error"`: the failure has
35
+ * to reach people who cannot see the border colour.
36
+ *
37
+ * A retry that fails with the identical message is announced only once — a
38
+ * live region re-set to the text it already holds says nothing, and the
39
+ * component cannot tell a retry from a re-render. Pass through a non-error
40
+ * state between attempts (back to 'idle', or 'uploading' while the retry is
41
+ * in flight) so the second failure is a genuine change.
42
+ */
43
+ errorMessage: string;
44
+ /**
45
+ * Reports a failed upload. A local validation failure supplies its own
46
+ * message and takes precedence over `errorMessage`.
47
+ */
48
+ state: 'error';
49
+ };
50
+ /**
51
+ * The zone's state and, when it reports a failure, the message that explains it.
52
+ *
53
+ * The two are a union rather than two independent props so that `state="error"`
54
+ * without an `errorMessage` does not compile. An errored zone with no text is
55
+ * signalled by border colour alone, which reaches neither assistive technology
56
+ * nor anyone who cannot distinguish the error hue. A consumer holding the state
57
+ * in a variable typed as the whole union has to narrow it before rendering —
58
+ * that is the point, not an accident.
59
+ */
60
+ export type MrlFileUploadStateProps = MrlFileUploadRestingProps | MrlFileUploadErrorProps;
61
+ export type MrlFileUploadProps = {
62
+ /**
63
+ * Accepted file types, in the same format as the native `accept` attribute
64
+ * (e.g. '.gif,.jpg,.jpeg,.png' or 'image/*'). Also enforced on drop, which
65
+ * the native attribute does not cover.
66
+ */
67
+ accept?: string;
68
+ /**
69
+ * Name of the file being uploaded, shown in the progress and completed copy
70
+ * and announced to assistive technology. Falls back to the name of the file
71
+ * the user last selected.
72
+ */
73
+ fileName?: string;
74
+ /**
75
+ * Headline inside the drop zone.
76
+ */
77
+ heading?: string;
78
+ /**
79
+ * Supporting line describing what is accepted.
80
+ */
81
+ helperText?: string;
82
+ /**
83
+ * Field label rendered above the drop zone, and the zone's accessible name.
84
+ */
85
+ label?: string;
86
+ /**
87
+ * Maximum accepted file size in bytes. Omit for no limit.
88
+ */
89
+ maxSizeBytes?: number;
90
+ /**
91
+ * Fired when the user cancels an upload in progress. The consumer owns the
92
+ * abort — the component only returns itself to its resting state.
93
+ */
94
+ onCancel?: () => void;
95
+ /**
96
+ * Fired when a file fails local validation, with the message shown to the
97
+ * user. Transport failures are reported by the consumer through
98
+ * `state="error"` instead.
99
+ */
100
+ onError?: (message: string, file: File) => void;
101
+ /**
102
+ * Fired when a file passes validation and is ready to upload. The consumer
103
+ * performs the upload and drives `state` and `percent` from its result.
104
+ */
105
+ onFilesSelected?: (file: File) => void;
106
+ /**
107
+ * Fired when the user removes a completed upload.
108
+ */
109
+ onRemove?: () => void;
110
+ /**
111
+ * Upload progress, 0–100. Only read while `state` is 'uploading'.
112
+ */
113
+ percent?: ProgressRange;
114
+ /**
115
+ * Shows `helperText` inside the drop zone.
116
+ */
117
+ showHelperText?: boolean;
118
+ /**
119
+ * Repeats `helperText` as an inline message below the drop zone. Off by
120
+ * default — with `showHelperText` on, enabling both prints the same sentence
121
+ * twice. A validation or upload error always renders below the zone
122
+ * regardless of this flag.
123
+ */
124
+ showInlineAlert?: boolean;
125
+ /**
126
+ * Additional validation, run after the built-in `accept` and `maxSizeBytes`
127
+ * checks and only if those pass. Return a message to reject the file — it is
128
+ * shown and reported exactly like a built-in failure — or `null` to accept it.
129
+ */
130
+ validate?: (file: File) => string | null;
131
+ /**
132
+ * Enables interaction tracking for this upload control. Provide a stable,
133
+ * non-PII id (e.g. 'workspace-logo-upload'). When omitted, the component
134
+ * emits no analytics.
135
+ *
136
+ * Note: file names, sizes and types are never emitted — only the fact of a
137
+ * selection and whether it was accepted.
138
+ */
139
+ eventId?: string;
140
+ } & MrlFileUploadStateProps & Omit<React.ComponentPropsWithoutRef<'div'>, 'onError'> & DataQa;
141
+ /**
142
+ * A drag-and-drop file upload zone with a keyboard-accessible browse button.
143
+ *
144
+ * The component owns presentation, drag tracking and local validation
145
+ * (`accept`, `maxSizeBytes`); the consumer owns the upload itself and drives
146
+ * `state` and `percent`. Drag and drop is pointer-only by nature, so the
147
+ * button inside the zone is the equivalent path for everyone else and is the
148
+ * affordance exposed to the accessibility tree.
149
+ *
150
+ * @param props - The component props.
151
+ * @returns The MrlFileUpload component.
152
+ */
153
+ export declare function MrlFileUpload(props: MrlFileUploadProps): React.ReactElement;
154
+ export {};
@@ -0,0 +1 @@
1
+ export { MrlFileUpload, type MrlFileUploadProps } from './MrlFileUpload';
@@ -0,0 +1,35 @@
1
+ export declare const allowedFileUploadValues: {
2
+ states: readonly ["idle", "uploading", "complete", "error", "disabled"];
3
+ };
4
+ /**
5
+ * The visual state of the drop zone, owned by the consumer.
6
+ *
7
+ * `dragging` is deliberately absent — a drag is transient pointer state the
8
+ * component tracks internally, not a state a consumer can meaningfully set.
9
+ */
10
+ export type MrlFileUploadState = (typeof allowedFileUploadValues.states)[number];
11
+ export interface FileUploadDefaults {
12
+ accept: string;
13
+ heading: string;
14
+ showHelperText: boolean;
15
+ showInlineAlert: boolean;
16
+ state: MrlFileUploadState;
17
+ }
18
+ /**
19
+ * Default values for props on the MrlFileUpload component;
20
+ * shared between the component and Storybook.
21
+ *
22
+ * `helperText` is absent on purpose: with no value from the consumer it is
23
+ * derived from the constraints actually enforced, so the copy cannot drift from
24
+ * what `accept` and `maxSizeBytes` reject.
25
+ */
26
+ export declare const fileUploadDefaults: FileUploadDefaults;
27
+ /**
28
+ * Shown when a consumer reports `state="error"` without an `errorMessage`.
29
+ *
30
+ * The types make that combination impossible, but a JavaScript consumer can
31
+ * still reach it — and an errored zone with no text is signalled by border
32
+ * colour alone, which reaches neither assistive technology nor anyone who
33
+ * cannot distinguish the error hue.
34
+ */
35
+ export declare const DEFAULT_ERROR_MESSAGE = "Upload failed";
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Matches a file against an `accept` string (extensions and/or MIME types).
3
+ *
4
+ * The native `accept` attribute only filters the file picker; a dropped file
5
+ * bypasses it entirely, so the same rules have to be applied in code.
6
+ *
7
+ * @param file - the file to test
8
+ * @param accept - native `accept` syntax, e.g. '.png,image/*'
9
+ * @returns whether the file matches the accept rules
10
+ */
11
+ export declare function isAccepted(file: File, accept: string): boolean;
12
+ /**
13
+ * Formats a byte count for display in a validation message.
14
+ *
15
+ * @param bytes - the size in bytes
16
+ * @returns a short human-readable size, e.g. '2.5 MB'
17
+ */
18
+ export declare function formatBytes(bytes: number): string;
19
+ /**
20
+ * Lists the file types an `accept` string permits, for display.
21
+ *
22
+ * @param accept - native `accept` syntax, e.g. '.png,image/*'
23
+ * @returns a comma-separated list, or an empty string if nothing is restricted
24
+ */
25
+ export declare function formatAcceptList(accept: string): string;
26
+ /**
27
+ * Describes the constraints the component actually enforces, for use as helper
28
+ * text. Deriving the sentence from `accept` and `maxSizeBytes` is what keeps it
29
+ * from contradicting what validation rejects.
30
+ *
31
+ * @param accept - native `accept` syntax, e.g. '.png,image/*'
32
+ * @param maxSizeBytes - the size limit in bytes, if there is one
33
+ * @returns a sentence describing what may be uploaded, or an empty string
34
+ */
35
+ export declare function describeConstraints(accept: string, maxSizeBytes?: number): string;
@@ -0,0 +1,2 @@
1
+ export * from './MrlFileUpload';
2
+ export * from './constants';
@@ -32,3 +32,4 @@ export * from './rovingTabindex';
32
32
  export * from './toolbar';
33
33
  export * from './filter';
34
34
  export * from './breadcrumb';
35
+ export * from './file-upload';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muraldevkit/ui-toolkit",
3
- "version": "4.75.0",
3
+ "version": "4.76.0",
4
4
  "description": "Mural's UI Toolkit",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",