1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-24 17:11:55 +01:00

[CL-169] add bit-section component (#8062)

This commit is contained in:
Will Martin 2024-02-23 10:51:17 -05:00 committed by GitHub
parent fa43d8c55e
commit 43d1174a06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 51 additions and 0 deletions

View File

@ -24,6 +24,7 @@ export * from "./popover";
export * from "./progress";
export * from "./radio-button";
export * from "./search";
export * from "./section";
export * from "./select";
export * from "./table";
export * from "./tabs";

View File

@ -0,0 +1 @@
export * from "./section.component";

View File

@ -0,0 +1,14 @@
import { CommonModule } from "@angular/common";
import { Component } from "@angular/core";
@Component({
selector: "bit-section",
standalone: true,
imports: [CommonModule],
template: `
<section class="tw-mb-12">
<ng-content></ng-content>
</section>
`,
})
export class SectionComponent {}

View File

@ -0,0 +1,35 @@
import { Meta, StoryObj, componentWrapperDecorator, moduleMetadata } from "@storybook/angular";
import { TypographyModule } from "../typography";
import { SectionComponent } from "./section.component";
export default {
title: "Component Library/Section",
component: SectionComponent,
decorators: [
moduleMetadata({
imports: [TypographyModule],
}),
componentWrapperDecorator((story) => `<div class="tw-text-main">${story}</div>`),
],
} as Meta;
type Story = StoryObj<SectionComponent>;
/** Sections are simple containers that apply a bottom margin. They often contain a heading. */
export const Default: Story = {
render: (args) => ({
props: args,
template: `
<bit-section>
<h2 bitTypography="h2">Foo</h2>
<p bitTypography="body1">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae congue risus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nunc elementum odio nibh, eget pellentesque sem ornare vitae. Etiam vel ante et velit fringilla egestas a sed sem. Fusce molestie nisl et nisi accumsan dapibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Sed eu risus ex. </p>
</bit-section>
<bit-section>
<h2 bitTypography="h2">Bar</h2>
<p bitTypography="body1">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae congue risus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nunc elementum odio nibh, eget pellentesque sem ornare vitae. Etiam vel ante et velit fringilla egestas a sed sem. Fusce molestie nisl et nisi accumsan dapibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Sed eu risus ex. </p>
</bit-section>
`,
}),
};