flowbite-vue icon indicating copy to clipboard operation
flowbite-vue copied to clipboard

feat: Indicator components

Open ogzcode opened this issue 1 year ago • 6 comments

Hi, I completed the issue opened for the Indicator component. #209

Details:

  1. The component was coded according to the style codes found in Flowbite.
  2. Documentation file has been created for the component.
  3. Examples have been added for the component doc file. I only added examples for type and alignment, I can update them if there are any missing examples.

I hope it turned out the way you wanted. I'll be waiting for your feedback. Good luck

@Sqrcz @cogor @zoltanszogyenyi @robert1508

Summary by CodeRabbit

  • New Features

    • Introduced the FwbIndicator component for customizable visual indicators, supporting multiple color themes.
    • Added documentation for the FwbIndicator component and examples demonstrating different use cases.
    • Included the FwbIndicatorPositionExample component to showcase positioning variations for indicators.
  • Bug Fixes

    • Enhanced component documentation to ensure clarity and usability for developers.
  • Documentation

    • Comprehensive guides created for the new FwbIndicator component and its examples.

ogzcode avatar Aug 02 '24 14:08 ogzcode

[!IMPORTANT]

Review skipped

Auto reviews are limited to specific labels.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces the new FwbIndicator component to enhance the visual representation of information in applications. Accompanied by comprehensive documentation and examples, developers can easily implement various indicators with different styles and positions. The changes facilitate better UI flexibility, enabling users to effectively convey statuses and counts within their applications.

Changes

Files Change Summary
docs/.vitepress/config.mts Added "Indicator" to the getComponents function, expanding available components for reference.
docs/components/indicator.md Created documentation for the FwbIndicator component, detailing usage and examples.
docs/components/indicator/examples/*.vue Introduced examples showcasing FwbIndicator in different colors and positions for clear implementation guidance.
src/components/FwbIndicator/FwbIndicator.vue Added FwbIndicator component with customizable styles based on types defined in IIndicatorProps.
src/index.ts Exported FwbIndicator from the main index file for improved accessibility in imports.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant FwbIndicator

    User->>App: Requests status indicator
    App->>FwbIndicator: Render indicator with type
    FwbIndicator-->>App: Return styled indicator
    App-->>User: Display indicator

🐇 In a meadow bright and fair,
A new indicator's in the air!
Colors dance, and statuses twirl,
Come see the magic, give it a whirl!
With styles and grace, it shines so fine,
Hop along, dear friends, it's indicator time! 🌈✨


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.

coderabbitai[bot] avatar Aug 02 '24 14:08 coderabbitai[bot]

Deploy Preview for sensational-seahorse-8635f8 ready!

Name Link
Latest commit e3a64a529e88c95ed7ccbecf936c0a787d679091
Latest deploy log https://app.netlify.com/sites/sensational-seahorse-8635f8/deploys/66aceab30562bf00080fcd96
Deploy Preview https://deploy-preview-314--sensational-seahorse-8635f8.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Aug 02 '24 14:08 netlify[bot]

@ogzcode

This one is a bit tricky... 🙈

We already have status and total props for avatars doing this thing... we're missing something like that for buttons... but indicator as component on it's own... I'm not sure if it's needed... maybe as an internal component that we can use in avatars, buttons and other things that need that kind of feature.

Another thing that makes this component "hard" to use is that it can't influence it's parent CSS position setting... so it would require adding class="relative" to every parent of that... and even then... it may not be exactly what user needs as parent's slot may not be the same as the outer tag with added class.

It may be OK in pure HTML/CSS components library... but in library of dynamic components... it may be batter as part of "bigger things" rather on it's own.

Before moving on with the review and potential code changes....

Please convince me that this component makes sense on it's own... ;) especially by giving examples of use with different components.... because now adding this to a button or an avatar is not working as expected and I'm not sure how do you see it being used.

Sqrcz avatar Aug 02 '24 23:08 Sqrcz

@Sqrcz

This component is not meaningful on its own, I agree with you on this issue. Also, having to have relative content in the parent component and requiring extra code for positioning is not good for developer experience.

But if used in another situation, it can reduce code duplication. And it allows the developer to have a more accessible component.

So the user does not have to copy and paste the following code every time and the code base becomes more readable.

<span class="flex w-3 h-3 me-3 bg-blue-600 rounded-full"></span>

I can also style the component required for placement through a props, but this may also restrict the user.

Example:

<fwb-indicator position="top" type="green" />

These are what come to my mind right now. I can't give more detailed examples :) because this is a small component.

I opened this PR because the issue was also open. If you don't think it's necessary, I can turn it off.

Thank you for your feedback. I will be waiting for your reply. Have a nice day.

ogzcode avatar Aug 06 '24 06:08 ogzcode

Hey,

Yes... it will be hard to use on it's own... we could refactor avatars and buttons to use this internally but I'm not sure if it's worth the effort for now.

I've taken over maintaining this project only recently... ant there are a lot of outdated things that I need to clean.

If you want to pick something to help... there is a long list of things that we can improve: https://github.com/themesberg/flowbite-vue/discussions/236 ;)

Thank you for your input 🙏

Sqrcz avatar Aug 06 '24 08:08 Sqrcz

Then we need to think a little more about this component. I won't close PR, maybe someone will need it.

I'll take a look at #236 and would be happy to contribute. Thank you, have a nice day

ogzcode avatar Aug 06 '24 09:08 ogzcode