Skip to content

Commit

Permalink
fix(toast): hidden tailwind css not being applied
Browse files Browse the repository at this point in the history
  • Loading branch information
dgonzalezr committed Jun 29, 2023
1 parent 24e7533 commit 156e13c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
11 changes: 10 additions & 1 deletion packages/bee-q/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export namespace Components {
*/
"time": number;
/**
* This method can be used to display notifications in a fixed-position element that allows for stacking multiple notifications vertically.
* This method can be used to display notifications in a fixed-position element that allows for stacking multiple notifications vertically
*/
"toast": () => Promise<void>;
/**
Expand Down Expand Up @@ -595,6 +595,9 @@ export namespace Components {
"value": string;
}
interface BqToast {
/**
* Method to be called to hide the toast component
*/
"hide": () => Promise<void>;
/**
* If true will hide toast icon
Expand All @@ -608,11 +611,17 @@ export namespace Components {
* Placement of toast
*/
"placement": TToastPlacement;
/**
* Method to be called to show the toast component
*/
"show": () => Promise<void>;
/**
* The length of time, in milliseconds, after which the toast will close itself
*/
"time": number;
/**
* This method can be used to display toasts in a fixed-position element that allows for stacking multiple toasts vertically
*/
"toast": () => Promise<void>;
/**
* Type of toast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ export class BqNotification {
this.handleShow();
}

/** This method can be used to display notifications in a fixed-position element
* that allows for stacking multiple notifications vertically. */
/** This method can be used to display notifications in a fixed-position element that allows for stacking multiple notifications vertically */
@Method()
async toast() {
if (notificationPortal.parentElement === null) {
Expand Down
3 changes: 1 addition & 2 deletions packages/bee-q/src/components/notification/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ Type: `Promise<void>`

### `toast() => Promise<void>`

This method can be used to display notifications in a fixed-position element
that allows for stacking multiple notifications vertically.
This method can be used to display notifications in a fixed-position element that allows for stacking multiple notifications vertically

#### Returns

Expand Down
10 changes: 4 additions & 6 deletions packages/bee-q/src/components/toast/bq-toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,19 @@ export class BqToast {
// Requires JSDocs for public API documentation.
// ===============================================

/** Method to be called to show the toast component */
@Method()
async show(): Promise<void> {
this.handleShow();
}

/** Method to be called to hide the toast component */
@Method()
async hide(): Promise<void> {
this.handleHide();
}

/** This method can be used to display toasts in a fixed-position element that allows for stacking multiple toasts vertically */
@Method()
async toast() {
if (toastPortal.parentElement === null) {
Expand Down Expand Up @@ -205,12 +208,7 @@ export class BqToast {

render() {
return (
<Host
class={{ '!hidden': !this.open }}
aria-hidden={!this.open ? 'true' : 'false'}
hidden={!this.open ? 'true' : 'false'}
role="status"
>
<Host aria-hidden={!this.open ? 'true' : 'false'} hidden={!this.open ? 'true' : 'false'} role="status">
<output class="bq-toast" part="wrapper">
<div class={{ [`bq-toast--icon ${this.type}`]: true, '!hidden': this.hideIcon }} part="icon">
<slot name="icon">
Expand Down
6 changes: 3 additions & 3 deletions packages/bee-q/src/components/toast/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

### `hide() => Promise<void>`


Method to be called to hide the toast component

#### Returns

Expand All @@ -38,7 +38,7 @@ Type: `Promise<void>`

### `show() => Promise<void>`


Method to be called to show the toast component

#### Returns

Expand All @@ -48,7 +48,7 @@ Type: `Promise<void>`

### `toast() => Promise<void>`


This method can be used to display toasts in a fixed-position element that allows for stacking multiple toasts vertically

#### Returns

Expand Down
6 changes: 5 additions & 1 deletion packages/bee-q/src/components/toast/scss/bq-toast.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
@import './bq-toast.variables';

:host {
@apply inline-block animate-slide-in will-change-transform;
@apply hidden animate-slide-in will-change-transform;
}

:host([open]) {
@apply inline-block;
}

.bq-toast {
Expand Down

0 comments on commit 156e13c

Please sign in to comment.