mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
* [PM-14426] Add hideIcon input to simple dialog component * [PM-14426] Introduce dark-image-source.directive.ts * [PM-14426] Tweaks to the Vault Carousel component - Create a Carousel NgModule so that the carousel component and carousel slide component are exported - Update barrel files - Adjust min height calculation logic to wait for ;hidden slides to finish rendering before calculating height * [PM-14426] Introduce at risk password getting started carousel component and images * [PM-14426] Refactor at-risk-password-page.service.ts to use the same state definition for banner and carousel dismissal * [PM-14426] Open the getting started carousel on page load * [PM-14426] Add tests * [PM-14426] Use booleanAttribute * [PM-14426] Fix failing type checking
116 lines
3.5 KiB
TypeScript
116 lines
3.5 KiB
TypeScript
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
|
|
import { Meta, moduleMetadata, StoryObj } from "@storybook/angular";
|
|
|
|
import { ButtonModule } from "../../button";
|
|
import { DialogModule } from "../dialog.module";
|
|
|
|
import { SimpleDialogComponent } from "./simple-dialog.component";
|
|
|
|
export default {
|
|
title: "Component Library/Dialogs/Simple Dialog",
|
|
component: SimpleDialogComponent,
|
|
decorators: [
|
|
moduleMetadata({
|
|
imports: [ButtonModule, NoopAnimationsModule, DialogModule],
|
|
}),
|
|
],
|
|
parameters: {
|
|
design: {
|
|
type: "figma",
|
|
url: "https://www.figma.com/design/Zt3YSeb6E6lebAffrNLa0h/Tailwind-Component-Library?node-id=21514-19247&t=b5tDKylm5sWm2yKo-4",
|
|
},
|
|
},
|
|
} as Meta;
|
|
|
|
type Story = StoryObj<SimpleDialogComponent & { useDefaultIcon: boolean }>;
|
|
|
|
export const Default: Story = {
|
|
render: (args) => ({
|
|
props: args,
|
|
template: `
|
|
<bit-simple-dialog>
|
|
<span bitDialogTitle>Alert Dialog</span>
|
|
<span bitDialogContent>Message Content</span>
|
|
<ng-container bitDialogFooter>
|
|
<button bitButton buttonType="primary">Yes</button>
|
|
<button bitButton buttonType="secondary">No</button>
|
|
</ng-container>
|
|
</bit-simple-dialog>
|
|
`,
|
|
}),
|
|
};
|
|
|
|
export const CustomIcon: Story = {
|
|
render: (args) => ({
|
|
props: args,
|
|
template: `
|
|
<bit-simple-dialog>
|
|
<i bitDialogIcon class="bwi bwi-star tw-text-3xl tw-text-success" aria-hidden="true"></i>
|
|
<span bitDialogTitle>Premium Subscription Available</span>
|
|
<span bitDialogContent> Message Content</span>
|
|
<ng-container bitDialogFooter>
|
|
<button bitButton buttonType="primary">Yes</button>
|
|
<button bitButton buttonType="secondary">No</button>
|
|
</ng-container>
|
|
</bit-simple-dialog>
|
|
`,
|
|
}),
|
|
};
|
|
|
|
export const HideIcon: Story = {
|
|
render: (args) => ({
|
|
props: args,
|
|
template: `
|
|
<bit-simple-dialog hideIcon>
|
|
<span bitDialogTitle>Premium Subscription Available</span>
|
|
<span bitDialogContent> Message Content</span>
|
|
<ng-container bitDialogFooter>
|
|
<button bitButton buttonType="primary">Yes</button>
|
|
<button bitButton buttonType="secondary">No</button>
|
|
</ng-container>
|
|
</bit-simple-dialog>
|
|
`,
|
|
}),
|
|
};
|
|
|
|
export const ScrollingContent: Story = {
|
|
render: (args) => ({
|
|
props: args,
|
|
template: `
|
|
<bit-simple-dialog>
|
|
<span bitDialogTitle>Alert Dialog</span>
|
|
<span bitDialogContent>
|
|
Message Content Message text goes here.<br />
|
|
<ng-container *ngFor="let _ of [].constructor(100)">
|
|
repeating lines of characters <br />
|
|
</ng-container>
|
|
end of sequence!
|
|
</span>
|
|
<ng-container bitDialogFooter>
|
|
<button bitButton buttonType="primary">Yes</button>
|
|
<button bitButton buttonType="secondary">No</button>
|
|
</ng-container>
|
|
</bit-simple-dialog>
|
|
`,
|
|
}),
|
|
args: {
|
|
useDefaultIcon: true,
|
|
},
|
|
};
|
|
|
|
export const TextOverflow: Story = {
|
|
render: (args) => ({
|
|
props: args,
|
|
template: `
|
|
<bit-simple-dialog>
|
|
<span bitDialogTitle>Alert Dialogdialogdialogdialogdialogdialogdialogdialogdialogdialogdialogdialogdialog</span>
|
|
<span bitDialogContent>Message Contentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontent</span>
|
|
<ng-container bitDialogFooter>
|
|
<button bitButton buttonType="primary">Yes</button>
|
|
<button bitButton buttonType="secondary">No</button>
|
|
</ng-container>
|
|
</bit-simple-dialog>
|
|
`,
|
|
}),
|
|
};
|