mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-22 11:45:59 +01:00
[CL-169] add bit-section component (#8062)
This commit is contained in:
parent
fa43d8c55e
commit
43d1174a06
@ -24,6 +24,7 @@ export * from "./popover";
|
|||||||
export * from "./progress";
|
export * from "./progress";
|
||||||
export * from "./radio-button";
|
export * from "./radio-button";
|
||||||
export * from "./search";
|
export * from "./search";
|
||||||
|
export * from "./section";
|
||||||
export * from "./select";
|
export * from "./select";
|
||||||
export * from "./table";
|
export * from "./table";
|
||||||
export * from "./tabs";
|
export * from "./tabs";
|
||||||
|
1
libs/components/src/section/index.ts
Normal file
1
libs/components/src/section/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from "./section.component";
|
14
libs/components/src/section/section.component.ts
Normal file
14
libs/components/src/section/section.component.ts
Normal 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 {}
|
35
libs/components/src/section/section.stories.ts
Normal file
35
libs/components/src/section/section.stories.ts
Normal 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>
|
||||||
|
`,
|
||||||
|
}),
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user