mirror of
https://github.com/bitwarden/browser
synced 2026-02-21 20:04:02 +00:00
add wrapped story
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
>
|
||||
@let title = titleComputed();
|
||||
@let icon = iconComputed();
|
||||
@let _truncate = truncate();
|
||||
|
||||
@if (icon) {
|
||||
<i
|
||||
@@ -13,17 +14,17 @@
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
}
|
||||
<div class="tw-flex tw-flex-col tw-gap-0.5" [ngClass]="truncate ? 'tw-truncate' : ''">
|
||||
<div class="tw-flex tw-flex-col tw-gap-0.5" [ngClass]="_truncate ? 'tw-truncate' : ''">
|
||||
@if (title) {
|
||||
<header
|
||||
id="{{ titleId }}"
|
||||
class="tw-text-base tw-font-semibold"
|
||||
[ngClass]="truncate ? 'tw-truncate' : ''"
|
||||
[ngClass]="_truncate ? 'tw-truncate' : ''"
|
||||
>
|
||||
{{ title }}
|
||||
</header>
|
||||
}
|
||||
<div bitTypography="body2" [ngClass]="truncate ? 'tw-truncate' : ''">
|
||||
<div bitTypography="body2" [ngClass]="_truncate ? 'tw-truncate' : ''">
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -123,6 +123,23 @@ export const WithTextButton: Story = {
|
||||
},
|
||||
};
|
||||
|
||||
export const WithWrappingContent: Story = {
|
||||
render: (args) => ({
|
||||
props: args,
|
||||
template: `
|
||||
<bit-callout ${formatArgsForCodeSnippet<CalloutComponent>(args)}>
|
||||
This is a really long callout that should wrap when it reaches the end of the container. This is a really long callout that should wrap when it reaches the end of the container.
|
||||
This is a really long callout that should wrap when it reaches the end of the container. This is a really long callout that should wrap when it reaches the end of the container.
|
||||
This is a really long callout that should wrap when it reaches the end of the container. This is a really long callout that should wrap when it reaches the end of the container.
|
||||
</bit-callout>
|
||||
`,
|
||||
}),
|
||||
args: {
|
||||
type: "default",
|
||||
icon: "bwi-globe",
|
||||
},
|
||||
};
|
||||
|
||||
export const Truncate: Story = {
|
||||
render: (args) => ({
|
||||
props: args,
|
||||
|
||||
Reference in New Issue
Block a user