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

docs: add default stories for IDE components #2398

Merged
merged 7 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions client/modules/IDE/components/About.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import About from './About';

export default {
title: 'IDE/About',
component: About
};

export const Default = {};
13 changes: 13 additions & 0 deletions client/modules/IDE/components/AssetPreview.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import AssetPreview from './AssetPreview';

export default {
title: 'IDE/AssetPreview',
component: AssetPreview
};

export const Default = {
args: {
url: 'https://p5js.org/assets/img/p5js.svg',
name: 'P5 Logo'
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add stories for audio and video files (can be done later).

12 changes: 12 additions & 0 deletions client/modules/IDE/components/AssetSize.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import AssetSize from './AssetSize';

export default {
title: 'IDE/AssetSize',
component: AssetSize
};

export const Default = {
args: {
totalSize: 123
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This story shows up with a control for the totalSize, but changing it doesn't do anything because the default export gets the size from Redux.

Once we get the styles working and once we get this using the args then it might be cool to have stories for empty vs. full vs. somewhere in the middle.

}
};
8 changes: 8 additions & 0 deletions client/modules/IDE/components/Console.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Console from './Console';

export default {
title: 'IDE/Console',
component: Console
};

export const Default = {};
8 changes: 8 additions & 0 deletions client/modules/IDE/components/ConsoleInput.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import ConsoleInput from './ConsoleInput';

export default {
title: 'IDE/ConsoleInput',
component: ConsoleInput
};

export const Default = {};
12 changes: 12 additions & 0 deletions client/modules/IDE/components/CopyableInput.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import CopyableInput from './CopyableInput';

export default {
title: 'IDE/CopyableInput',
component: CopyableInput
};

export const Default = {
args: {
value: 'Lorem Ipsum'
}
};
13 changes: 13 additions & 0 deletions client/modules/IDE/components/EditableInput.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import EditableInput from './EditableInput';

export default {
title: 'IDE/EditableInput',
component: EditableInput
};

export const Default = {
args: {
value: '[email protected]',
label: 'Example'
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't seeing the pencil icon here due to an issue with svgr. I think it's removing the viewbox. Just FYI, we can fix that later.

19 changes: 19 additions & 0 deletions client/modules/IDE/components/EditorAccessibility.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import EditorAccessibility from './EditorAccessibility';

export default {
title: 'IDE/EditorAccessibility',
component: EditorAccessibility
};

export const Default = {
args: {
lintMessages: [
{
severity: 'warn',
line: '10',
message: 'Warning Foo',
id: '123'
}
]
}
};
ofhope marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions client/modules/IDE/components/Feedback.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Feedback from './Feedback';

export default {
title: 'IDE/Feedback',
component: Feedback
};

export const Default = {};
8 changes: 8 additions & 0 deletions client/modules/IDE/components/FileUploader.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import FileUploader from './FileUploader';

export default {
title: 'IDE/FileUploader',
component: FileUploader
};

export const Default = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import FloatingActionButton from './FloatingActionButton';

export default {
title: 'IDE/FloatingActionButton',
component: FloatingActionButton
};

export const Default = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import KeyboardShortcutModal from './KeyboardShortcutModal';

export default {
title: 'IDE/KeyboardShortcutModal',
component: KeyboardShortcutModal
};

export const Default = {};
8 changes: 8 additions & 0 deletions client/modules/IDE/components/NewFileForm.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import NewFileForm from './NewFileForm';

export default {
title: 'IDE/NewFileForm',
component: NewFileForm
};

export const Default = {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NewFileForm is only used inside of the NewFileModal so it might be redundant to have stories for both. (the same for the NerFolderForm)

TBH we could consider combing the two component files as there's not much left in the NewFileModal after we made a common Modal component.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of having fewer Modals and reusing the generic one. I think thats capturing the layout primitives

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed NerFolderForm

8 changes: 8 additions & 0 deletions client/modules/IDE/components/NewFileModal.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import NewFileModal from './NewFileModal';

export default {
title: 'IDE/NewFileModal',
component: NewFileModal
};

export const Default = {};
8 changes: 8 additions & 0 deletions client/modules/IDE/components/NewFolderForm.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import NewFolderForm from './NewFolderForm';

export default {
title: 'IDE/NewFolderForm',
component: NewFolderForm
};

export const Default = {};
8 changes: 8 additions & 0 deletions client/modules/IDE/components/NewFolderModal.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import NewFolderModal from './NewFolderModal';

export default {
title: 'IDE/NewFolderModal',
component: NewFolderModal
};

export const Default = {};
8 changes: 8 additions & 0 deletions client/modules/IDE/components/ShareModal.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import ShareModal from './ShareModal';

export default {
title: 'IDE/ShareModal',
component: ShareModal
};

export const Default = {};
25 changes: 25 additions & 0 deletions client/modules/IDE/components/SketchList.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import SketchList from './SketchList';

export default {
title: 'IDE/SketchList',
component: SketchList
};

export const Default = {
args: {
user: {
username: 'Joe Blogs',
authenticated: true
},
username: 'Joe Blogs',
loading: false,
sketches: [
{
id: '1',
name: 'Play Sketch',
createdAt: Date.now().toString(),
updatedAt: Date.now().toString()
}
]
Comment on lines +16 to +23
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering why these sketches don't show up in the list. Again, it's because the component ignores this prop and gets the actual value from Redux.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh! I was wondering that myself but was unsure.

}
};
8 changes: 8 additions & 0 deletions client/modules/IDE/components/UploadFileModal.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import UploadFileModal from './UploadFileModal';

export default {
title: 'IDE/UploadFileModal',
component: UploadFileModal
};

export const Default = {};