Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Input button size, stories update and small code refactors #1372

Merged
merged 2 commits into from Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/src/common/variables.js
Expand Up @@ -1455,6 +1455,7 @@ export const defaultTranslatedComponentLabels = {
dropAreaButtonLabelDefault: "Select",
multipleDropAreaLabelDefault: "or drop files",
singleDropAreaLabelDefault: "or drop a file",
deleteFileActionTitle: "Remove file",
},
footer: {
copyrightText: (year) => `© DXC Technology ${year}. All rights reserved.`,
Expand Down
44 changes: 38 additions & 6 deletions lib/src/file-input/FileInput.stories.tsx
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import DxcFileInput from "./FileInput";
import Title from "../../.storybook/components/Title";
import ExampleContainer from "../../.storybook/components/ExampleContainer";
import FileItem from "./FileItem";

export default {
title: "File input",
Expand Down Expand Up @@ -65,17 +66,48 @@ const filesExamples = [

export const Chromatic = () => (
<>
<Title title="File item states" theme="light" level={2} />
<ExampleContainer pseudoState="pseudo-hover">
<Title title="File item hovered" theme="light" level={4} />
<DxcFileInput value={fileExample} callbackFile={() => {}} />
<Title title="Hovered" theme="light" level={4} />
<FileItem
mode="dropzone"
multiple={true}
name="file"
showPreview={false}
numFiles={1}
preview={picPreview}
type="image/png"
onDelete={() => {}}
tabIndex={0}
/>
</ExampleContainer>
<ExampleContainer pseudoState="pseudo-focus">
<Title title="File item focused" theme="light" level={4} />
<DxcFileInput value={fileExample} callbackFile={() => {}} />
<Title title="Focused" theme="light" level={4} />
<FileItem
mode="dropzone"
multiple={true}
name="file"
showPreview={false}
numFiles={1}
preview={picPreview}
type="image/png"
onDelete={() => {}}
tabIndex={0}
/>
</ExampleContainer>
<ExampleContainer pseudoState="pseudo-active">
<Title title="File item actived" theme="light" level={4} />
<DxcFileInput value={fileExample} callbackFile={() => {}} />
<Title title="Actived" theme="light" level={4} />
<FileItem
mode="dropzone"
multiple={true}
name="file"
showPreview={false}
numFiles={1}
preview={picPreview}
type="image/png"
onDelete={() => {}}
tabIndex={0}
/>
</ExampleContainer>
<Title title="File" theme="light" level={2} />
<ExampleContainer>
Expand Down