Skip to content

Commit

Permalink
FileUploader name change (#5347)
Browse files Browse the repository at this point in the history
  • Loading branch information
epfeiffe authored Aug 9, 2024
1 parent 18f01ef commit 1ca1da2
Show file tree
Hide file tree
Showing 71 changed files with 2,940 additions and 2,446 deletions.
144 changes: 73 additions & 71 deletions documentation-site/cheat-sheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,63 @@ const outlines = [
},
{
file: "src/file-uploader/types.ts",
definitions: [
{
name: "StyleProps",
lineStart: 15,
children: [
{ name: "$alt", lineStart: 16 },
{ name: "$color", lineStart: 17 },
{ name: "$fileCount", lineStart: 18 },
{ name: "$src", lineStart: 19 },
],
},
{
name: "FileUploaderOverrides",
lineStart: 22,
children: [
{ name: "CircleCheckFilledIcon", lineStart: 23 },
{ name: "CircleExclamationPointFilledIcon", lineStart: 24 },
{ name: "DeleteButtonComponent", lineStart: 25 },
{ name: "FileRow", lineStart: 26 },
{ name: "FileRowColumn", lineStart: 27 },
{ name: "FileRowContent", lineStart: 28 },
{ name: "FileRowFileName", lineStart: 29 },
{ name: "FileRowText", lineStart: 30 },
{ name: "FileRowUploadMessage", lineStart: 31 },
{ name: "FileRowUploadText", lineStart: 32 },
{ name: "FileRows", lineStart: 33 },
{ name: "Hint", lineStart: 34 },
{ name: "ImagePreviewThumbnail", lineStart: 35 },
{ name: "ItemPreviewContainer", lineStart: 36 },
{ name: "Label", lineStart: 37 },
{ name: "PaperclipFilledIcon", lineStart: 38 },
{ name: "ParentRoot", lineStart: 39 },
{ name: "TrashCanFilledIcon", lineStart: 40 },
],
},
{ name: "FileRow", lineStart: 43, children: [
{ name: "errorMessage", lineStart: 44 },
{ name: "file", lineStart: 45 },
{ name: "id", lineStart: 46 },
{ name: "fileInfo", lineStart: 49 },
{ name: "imagePreviewThumbnail", lineStart: 50 },
{ name: "status", lineStart: 52 },
] },
{ name: "FileUploaderProps", lineStart: 55, children: [
{ name: "fileRows", lineStart: 59 },
{ name: "hint", lineStart: 60 },
{ name: "itemPreview", lineStart: 61 },
{ name: "label", lineStart: 62 },
{ name: "maxFiles", lineStart: 63 },
{ name: "overrides", lineStart: 64 },
{ name: "processFileOnDrop", lineStart: 66 },
{ name: "setFileRows", lineStart: 67 },
] },
],
},
{
file: "src/file-uploader-basic/types.ts",
definitions: [
{
name: "StyleProps",
Expand All @@ -1452,7 +1509,7 @@ const outlines = [
],
},
{
name: "FileUploaderOverrides",
name: "FileUploaderBasicOverrides",
lineStart: 20,
children: [
{ name: "Root", lineStart: 21 },
Expand All @@ -1469,64 +1526,8 @@ const outlines = [
{ name: "ProgressBar", lineStart: 32 },
],
},
{ name: "FileUploaderProps", lineStart: 35, children: [] },
{ name: "DropFilesEventHandler", lineStart: 48, children: [] },
],
},
{
file: "src/file-uploader-beta/types.ts",
definitions: [
{
name: "StyleProps",
lineStart: 15,
children: [
{ name: "$alt", lineStart: 16 },
{ name: "$color", lineStart: 17 },
{ name: "$fileCount", lineStart: 18 },
{ name: "$src", lineStart: 19 },
],
},
{
name: "FileUploaderBetaOverrides",
lineStart: 22,
children: [
{ name: "AlertIcon", lineStart: 23 },
{ name: "CircleCheckFilledIcon", lineStart: 24 },
{ name: "FileRow", lineStart: 25 },
{ name: "FileRowColumn", lineStart: 26 },
{ name: "FileRowContent", lineStart: 27 },
{ name: "FileRowFileName", lineStart: 28 },
{ name: "FileRowText", lineStart: 29 },
{ name: "FileRowUploadMessage", lineStart: 30 },
{ name: "FileRowUploadText", lineStart: 31 },
{ name: "FileRows", lineStart: 32 },
{ name: "Hint", lineStart: 33 },
{ name: "ImagePreviewThumbnail", lineStart: 34 },
{ name: "ItemPreviewContainer", lineStart: 35 },
{ name: "Label", lineStart: 36 },
{ name: "PaperclipFilledIcon", lineStart: 37 },
{ name: "ParentRoot", lineStart: 38 },
{ name: "TrashCanFilledIcon", lineStart: 39 },
{ name: "TrashCanFilledIconContainer", lineStart: 40 },
],
},
{ name: "FileRow", lineStart: 43, children: [
{ name: "errorMessage", lineStart: 44 },
{ name: "file", lineStart: 45 },
{ name: "fileInfo", lineStart: 48 },
{ name: "imagePreviewThumbnail", lineStart: 49 },
{ name: "status", lineStart: 51 },
] },
{ name: "FileUploaderBetaProps", lineStart: 54, children: [
{ name: "fileRows", lineStart: 58 },
{ name: "hint", lineStart: 59 },
{ name: "itemPreview", lineStart: 60 },
{ name: "label", lineStart: 61 },
{ name: "maxFiles", lineStart: 62 },
{ name: "overrides", lineStart: 63 },
{ name: "processFileOnDrop", lineStart: 65 },
{ name: "setFileRows", lineStart: 66 },
] },
{ name: "FileUploaderBasicProps", lineStart: 35, children: [] },
{ name: "DropFilesEventHandler", lineStart: 52, children: [] },
],
},
{
Expand Down Expand Up @@ -2124,18 +2125,19 @@ const outlines = [
name: "Locale",
lineStart: 20,
children: [
{ name: "accordion", lineStart: 21 },
{ name: "breadcrumbs", lineStart: 22 },
{ name: "datepicker", lineStart: 23 },
{ name: "datatable", lineStart: 24 },
{ name: "buttongroup", lineStart: 25 },
{ name: "fileuploader", lineStart: 26 },
{ name: "menu", lineStart: 27 },
{ name: "modal", lineStart: 28 },
{ name: "drawer", lineStart: 29 },
{ name: "pagination", lineStart: 30 },
{ name: "select", lineStart: 31 },
{ name: "toast", lineStart: 32 },
{ name: "accordion", lineStart: 22 },
{ name: "breadcrumbs", lineStart: 23 },
{ name: "datepicker", lineStart: 24 },
{ name: "datatable", lineStart: 25 },
{ name: "buttongroup", lineStart: 26 },
{ name: "fileuploader", lineStart: 27 },
{ name: "fileuploaderbasic", lineStart: 28 },
{ name: "menu", lineStart: 29 },
{ name: "modal", lineStart: 30 },
{ name: "drawer", lineStart: 31 },
{ name: "pagination", lineStart: 32 },
{ name: "select", lineStart: 33 },
{ name: "toast", lineStart: 34 },
],
},
],
Expand Down
4 changes: 2 additions & 2 deletions documentation-site/components/gallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ const COMPONENTS = {
Component: thumbnails.SvgFileUploader,
},
{
href: "/components/file-uploader-beta",
Component: thumbnails.SvgFileUploaderBeta,
href: "/components/file-uploader-basic",
Component: thumbnails.SvgFileUploaderBasic,
},
{
href: "/components/menu",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LICENSE file in the root directory of this source tree.

import React from "react";

export default function SvgFileUploaderBeta(props) {
export default function SvgFileUploaderBasic(props) {
return (
<svg width={232} height={145} fill="none" {...props}>
<path fill={props.colors[0]} d="M48 37h137v72H48z" />
Expand Down
2 changes: 1 addition & 1 deletion documentation-site/components/thumbs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export { default as SvgTextarea } from "./components/Textarea.jsx";

// Pickers
export { default as SvgFileUploader } from "./components/FileUploader.jsx";
export { default as SvgFileUploaderBeta } from "./components/FileUploader.jsx";
export { default as SvgFileUploaderBasic } from "./components/FileUploaderBasic.jsx";
export { default as SvgMenu } from "./components/Menu.jsx";
export { default as SvgRating } from "./components/Rating.jsx";
export { default as SvgSelect } from "./components/Select.jsx";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/

import { FileUploaderBeta } from "baseui/file-uploader-beta";
import { FileUploaderBasic } from "baseui/file-uploader-basic";
import { PropTypes } from "react-view";
import type { TConfig } from "../types";
import iconConfig from "./icon";
import buttonConfig from "./button";

const changeHandlers = [
"onClick",
Expand All @@ -19,18 +19,21 @@ const changeHandlers = [
"onDragEnter",
"onDragOver",
"onDragLeave",
"onDrop",
"onDropAccepted",
"onDropRejected",
"onFileDialogCancel",
"onCancel",
"onRetry",
];

const FileUploaderBetaConfig: TConfig = {
componentName: "FileUploaderBeta",
const FileUploaderBasicConfig: TConfig = {
componentName: "FileUploaderBasic",
imports: {
"baseui/file-uploader-beta": { named: ["FileUploaderBeta"] },
"baseui/file-uploader-basic": { named: ["FileUploaderBasic"] },
},
scope: {
FileUploaderBeta,
FileUploaderBasic: FileUploaderBasic,
},
theme: [],
props: {
Expand All @@ -40,38 +43,6 @@ const FileUploaderBetaConfig: TConfig = {
description:
"Set accepted file types. See https://github.com/okonet/attr-accept for more information",
},
disabled: {
value: false,
type: PropTypes.Boolean,
description: "Renders component in disabled state.",
},
fileRows: {
value: "[]",
type: PropTypes.Array,
description: "Array of file objects.",
stateful: true,
},
hint: {
value: undefined,
type: PropTypes.String,
description: "Hint text to be displayed below the file rows.",
},
itemPreview: {
value: false,
type: PropTypes.Boolean,
description:
"Renders a file preview thumbnail. Works best with image files.",
},
label: {
value: undefined,
type: PropTypes.String,
description: "Label text to be displayed above the file uploader.",
},
maxFiles: {
value: undefined,
type: PropTypes.Number,
description: "Maximum number of files that can be uploaded.",
},
maxSize: {
value: undefined,
type: PropTypes.Number,
Expand All @@ -82,36 +53,28 @@ const FileUploaderBetaConfig: TConfig = {
type: PropTypes.Number,
description: "Minimum file size (in bytes).",
},
processFileOnDrop: {
value: undefined,
type: PropTypes.Function,
description:
"Application defined callback function that runs on file drop. Takes a File as input and returns a Promise<{ errorMessage: string | null; fileInfo?: any }>.",
},
setFileRows: {
value: "newFileRows => setFileRows(newFileRows)",
type: PropTypes.Function,
description: "Function to set file rows.",
},
multiple: {
value: undefined,
type: PropTypes.Boolean,
description:
"Allow drag n drop (or selection from the file dialog) of multiple files",
hidden: true,
},
disableClick: {
value: undefined,
type: PropTypes.Boolean,
description:
"Disallow clicking on the dropzone container to open file dialog.",
hidden: true,
},
disabled: {
value: false,
type: PropTypes.Boolean,
description: "Renders component in disabled state.",
},
errorMessage: {
value: undefined,
value: "",
type: PropTypes.String,
description: "Error message to be displayed.",
hidden: true,
stateful: true,
},
...changeHandlers.reduce((acc, current) => {
//@ts-ignore
Expand Down Expand Up @@ -141,29 +104,20 @@ const FileUploaderBetaConfig: TConfig = {
description: "Lets you customize all aspects of the component.",
custom: {
names: [
{ ...iconConfig, componentName: "AlertIcon" },
{ ...iconConfig, componentName: "CircleCheckFilledIcon" },
"FileRow",
"FileRowColumn",
"FileRowContent",
"FileRowFileName",
"FileRowText",
"FileRowUploadMessage",
"FileRowUploadText",
"FileRows",
"Hint",
"ImagePreviewThumbnail",
"ItemPreviewContainer",
"Label",
{ ...iconConfig, componentName: "PaperclipFilledIcon" },
"ParentRoot",
{ ...iconConfig, componentName: "TrashCanFilledIcon" },
"TrashCanFilledIconContainer",
{ ...buttonConfig, componentName: "ButtonComponent" },
{ ...buttonConfig, componentName: "CancelButtonComponent" },
{ ...buttonConfig, componentName: "RetryButtonComponent" },
"ContentMessage",
"ErrorMessage",
"FileDragAndDrop",
"HiddenInput",
"Spinner",
"ProgressBar",
],
sharedProps: {},
},
},
},
};

export default FileUploaderBetaConfig;
export default FileUploaderBasicConfig;
Loading

0 comments on commit 1ca1da2

Please sign in to comment.