-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(badge): add dismissable badge (#101)
## PR Checklist Please check if your PR fulfills the following requirements: <!--- [ ] Tests for the changes have been added (for bug fixes/features)--> - [x] Docs have been added/updated (for bug fixes/features) ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x". --> - [ ] Bugfix - [x] Feature - [ ] Code style update (formatting, local variables) - [ ] Refactoring (no functional changes, no API changes) - [ ] Build related changes - [ ] CI-related changes - [ ] Documentation content changes - [ ] Other... Please describe: ## Issue Number <!-- Bugs and features must be linked to an issue. --> Issue Number: #89 ## Does this PR introduce a breaking change? <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. --> - [ ] Yes - [x] No ## Other information <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Introduced dismissible badges with customizable colors and dismissal behavior. - Added a new Angular component for dismissible badges. - **Documentation** - Updated documentation to include a section for the dismissible badge component with examples. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
7 changed files
with
183 additions
and
2 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
apps/docs/docs/components/badge/_dismissable.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<flowbite-badge | ||
[isDismissable]="true" | ||
[onDismiss]="onDismiss"> | ||
Default | ||
</flowbite-badge> | ||
<flowbite-badge | ||
[isDismissable]="true" | ||
[onDismiss]="onDismiss" | ||
color="primary"> | ||
Primary | ||
</flowbite-badge> | ||
<flowbite-badge | ||
[isDismissable]="true" | ||
[onDismiss]="onDismiss" | ||
color="blue"> | ||
Blue | ||
</flowbite-badge> | ||
<flowbite-badge | ||
[isDismissable]="true" | ||
[onDismiss]="onDismiss" | ||
color="red"> | ||
Red | ||
</flowbite-badge> | ||
<flowbite-badge | ||
[isDismissable]="true" | ||
[onDismiss]="onDismiss" | ||
color="green"> | ||
Green | ||
</flowbite-badge> | ||
<flowbite-badge | ||
[isDismissable]="true" | ||
[onDismiss]="onDismiss" | ||
color="yellow"> | ||
Yellow | ||
</flowbite-badge> | ||
<flowbite-badge | ||
[isDismissable]="true" | ||
[onDismiss]="onDismiss" | ||
color="indigo"> | ||
Indigo | ||
</flowbite-badge> | ||
<flowbite-badge | ||
[isDismissable]="true" | ||
[onDismiss]="onDismiss" | ||
color="purple"> | ||
Purple | ||
</flowbite-badge> | ||
<flowbite-badge | ||
[isDismissable]="true" | ||
[onDismiss]="onDismiss" | ||
color="pink"> | ||
Pink | ||
</flowbite-badge> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { BadgeComponent } from 'flowbite-angular/badge'; | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'flowbite-demo-badge-dismissable', | ||
imports: [BadgeComponent], | ||
templateUrl: './_dismissable.component.html', | ||
host: { | ||
class: 'flex flex-wrap flex-row gap-3', | ||
}, | ||
}) | ||
export class FlowbiteDismissableComponent { | ||
onDismiss = () => alert('Badge have been dismissed'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters