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

chore: add minimal storybook config #90

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

devjoaov
Copy link
Contributor

@devjoaov devjoaov commented Aug 3, 2024

Summary by CodeRabbit

  • New Features

    • Introduced Storybook configurations for various UI components, enhancing documentation and testing capabilities.
    • Added a theming system and global styles to support dark and light modes.
  • Improvements

    • Expanded ESLint configuration to include Storybook recommended practices.
    • Updated .gitignore to streamline repository management by ignoring unnecessary log files.
  • Development Tools

    • Added new scripts to package.json for easier Storybook development and builds.
    • Integrated additional Storybook addons for enhanced functionality.
  • Style

    • Implemented a comprehensive Tailwind CSS setup for consistent theming and responsive design.

Copy link

coderabbitai bot commented Aug 3, 2024

Walkthrough

The recent updates enhance the development and testing environment by integrating Storybook into the UI component library. Key improvements include new configurations for Storybook, enriched component stories, and better organization through enhanced linting and styling practices. The addition of various new UI component stories promotes interactive documentation, and the updates to configuration files streamline the overall workflow, ensuring a more cohesive development experience.

Changes

File(s) Change Summary
.eslintrc.js Added "plugin:storybook/recommended" to extends for improved linting with Storybook.
.gitignore Added entry to ignore *storybook.log files.
.storybook/* Introduced new Storybook configuration files (main.ts, preview.tsx, themes.ts) for managing stories, addons, and theming in a React environment.
package.json Added scripts for starting and building Storybook, and new dependencies for various Storybook addons.
src/stories/* Created stories for multiple UI components (Avatar, Badge, Button, etc.) to enhance documentation and showcase different states and configurations.
src/stories/demo/* Added demo components to illustrate usage of Checkbox and DataTable.
src/storybook.css Introduced styles for Tailwind CSS, defining themes and utility classes, including responsive design adjustments.
tailwind.config.js Expanded content paths to include story files for better Tailwind class scanning and enabled Tailwind's preflight for consistent base styles.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Storybook
    participant UI Component

    Developer->>Storybook: Add new stories and configurations
    Storybook-->>UI Component: Load component stories
    UI Component-->>Storybook: Render different states
    Storybook-->>Developer: Display interactive UI
Loading

🐇 In a garden where stories bloom,
New tales of buttons lift the gloom.
With badges bright and avatars fair,
We hop through tales without a care!
🥕 Let’s celebrate this joyful spree,
As Storybook brings all fun to me! ✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@devjoaov devjoaov marked this pull request as ready for review August 9, 2024 12:30
Copy link

vercel bot commented Aug 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bleu-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2024 2:18pm

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5d711cf and 2dfd858.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (27)
  • .eslintrc.js (1 hunks)
  • .gitignore (1 hunks)
  • .storybook/main.ts (1 hunks)
  • .storybook/preview.tsx (1 hunks)
  • .storybook/themes.ts (1 hunks)
  • package.json (7 hunks)
  • src/stories/Avatar.stories.tsx (1 hunks)
  • src/stories/Badge.stories.tsx (1 hunks)
  • src/stories/Button.stories.ts (1 hunks)
  • src/stories/CheckboxDemo.stories.ts (1 hunks)
  • src/stories/DataTableDemo.stories.tsx (1 hunks)
  • src/stories/FormBuilderDemo.stories.tsx (1 hunks)
  • src/stories/Input.stories.tsx (1 hunks)
  • src/stories/Label.stories.tsx (1 hunks)
  • src/stories/Select.stories.tsx (1 hunks)
  • src/stories/SelectScrollable.stories.tsx (1 hunks)
  • src/stories/Separator.stories.tsx (1 hunks)
  • src/stories/Skeleton.stories.tsx (1 hunks)
  • src/stories/Switch.stories.tsx (1 hunks)
  • src/stories/TableDemo.stories.ts (1 hunks)
  • src/stories/Tooltip.stories.tsx (1 hunks)
  • src/stories/demo/CheckboxDemo.tsx (1 hunks)
  • src/stories/demo/DataTableDemo.tsx (1 hunks)
  • src/stories/demo/FormBuilderDemo.tsx (1 hunks)
  • src/stories/demo/TableDemo.tsx (1 hunks)
  • src/storybook.css (1 hunks)
  • tailwind.config.js (1 hunks)
Files skipped from review due to trivial changes (5)
  • .eslintrc.js
  • src/stories/DataTableDemo.stories.tsx
  • src/stories/Label.stories.tsx
  • src/stories/TableDemo.stories.ts
  • src/stories/demo/TableDemo.tsx
Files skipped from review as they are similar to previous changes (16)
  • .gitignore
  • .storybook/main.ts
  • .storybook/preview.tsx
  • .storybook/themes.ts
  • package.json
  • src/stories/Badge.stories.tsx
  • src/stories/Button.stories.ts
  • src/stories/CheckboxDemo.stories.ts
  • src/stories/FormBuilderDemo.stories.tsx
  • src/stories/Input.stories.tsx
  • src/stories/Skeleton.stories.tsx
  • src/stories/demo/CheckboxDemo.tsx
  • src/stories/demo/DataTableDemo.tsx
  • src/stories/demo/FormBuilderDemo.tsx
  • src/storybook.css
  • tailwind.config.js
Additional context used
Biome
src/stories/Switch.stories.tsx

[error] 17-17: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

src/stories/Tooltip.stories.tsx

[error] 28-28: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

src/stories/Avatar.stories.tsx

[error] 18-18: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

src/stories/Select.stories.tsx

[error] 35-35: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

src/stories/Separator.stories.tsx

[error] 29-29: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

src/stories/SelectScrollable.stories.tsx

[error] 80-80: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

Additional comments not posted (3)
src/stories/Select.stories.tsx (1)

1-44: LGTM!

The Storybook story for the Select component is well-structured and follows best practices for component isolation and documentation.

Tools
Biome

[error] 35-35: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

src/stories/Separator.stories.tsx (1)

1-59: LGTM!

The Storybook story for the Separator component is well-structured and demonstrates different orientations effectively.

Tools
Biome

[error] 29-29: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

src/stories/SelectScrollable.stories.tsx (1)

1-88: LGTM!

The Storybook story for the SelectScrollable component is comprehensive and effectively demonstrates the component's functionality with various time zones.

Tools
Biome

[error] 80-80: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

parameters: {
layout: "centered",
},
} satisfies Meta<{}>;
Copy link

Choose a reason for hiding this comment

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

Avoid using '{}' as a type.

Define an explicit object shape for better type safety and clarity.

-} satisfies Meta<{}>;
+} satisfies Meta<typeof SelectRoot>;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} satisfies Meta<{}>;
} satisfies Meta<typeof SelectRoot>;
Tools
Biome

[error] 35-35: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

parameters: {
layout: "centered",
},
} satisfies Meta<{}>;
Copy link

Choose a reason for hiding this comment

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

Avoid using '{}' as a type.

Define an explicit object shape for better type safety and clarity.

-} satisfies Meta<{}>;
+} satisfies Meta<typeof Separator>;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} satisfies Meta<{}>;
} satisfies Meta<typeof Separator>;
Tools
Biome

[error] 29-29: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

parameters: {
layout: "centered",
},
} satisfies Meta<{}>;
Copy link

Choose a reason for hiding this comment

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

Avoid using {} as a type.

The use of {} as a type is discouraged because it means "any non-nullable value." Define a more specific type for better type safety.

-} satisfies Meta<{}>;
+} satisfies Meta<typeof Switch>;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} satisfies Meta<{}>;
} satisfies Meta<typeof Switch>;
Tools
Biome

[error] 17-17: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

parameters: {
layout: "centered",
},
} satisfies Meta<{}>;
Copy link

Choose a reason for hiding this comment

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

Avoid using '{}' as a type.

Define an explicit object shape for better type safety and clarity.

-} satisfies Meta<{}>;
+} satisfies Meta<typeof SelectRoot>;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} satisfies Meta<{}>;
} satisfies Meta<typeof SelectRoot>;
Tools
Biome

[error] 80-80: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

parameters: {
layout: "centered",
},
} satisfies Meta<{}>;
Copy link

Choose a reason for hiding this comment

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

Avoid using {} as a type.

The use of {} as a type is discouraged because it means "any non-nullable value." Define a more specific type for better type safety.

-} satisfies Meta<{}>;
+} satisfies Meta<typeof TooltipRoot>;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} satisfies Meta<{}>;
} satisfies Meta<typeof TooltipRoot>;
Tools
Biome

[error] 28-28: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

parameters: {
layout: "centered",
},
} satisfies Meta<{}>;
Copy link

Choose a reason for hiding this comment

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

Avoid using {} as a type.

The use of {} as a type is discouraged because it means "any non-nullable value." Define a more specific type for better type safety.

-} satisfies Meta<{}>;
+} satisfies Meta<typeof Avatar>;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} satisfies Meta<{}>;
} satisfies Meta<typeof Avatar>;
Tools
Biome

[error] 18-18: Don't use '{}' as a type.

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

(lint/complexity/noBannedTypes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants