1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-25 20:53:22 +00:00
Files
browser/libs/components/src/navigation/nav-item.stories.ts
cd-bitwarden c3856ce821 [SM-896] When org is disabled disable the logic and show warning symbols (#6225)
* When org is disabled disable the logic and show warning symbols

* fixing org enabled logic

* removing unused code

* Adding route gaurd logic and new org suspended page

* fixing lint issue

* fixing issues

* Requested changes

* adding back code that was accidentally removed from organization-switcher

* Update bitwarden_license/bit-web/src/app/secrets-manager/shared/org-suspended.component.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Removing unused code and updating storybook to set enabled:true

* removing onDestroy

* Will's suggestions

* will's suggested change

* fix nav-item color in story

* Thomas Rittson's suggested changes

* adding back removed spaces

* Adding back white space

* updating guard

* Update bitwarden_license/bit-web/src/app/secrets-manager/guards/sm-org-enabled.guard.ts

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* removing ununsed data

* Updating incorrect messages

---------

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
Co-authored-by: William Martin <contact@willmartian.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-10-16 14:29:03 +00:00

104 lines
2.7 KiB
TypeScript

import { RouterTestingModule } from "@angular/router/testing";
import { StoryObj, Meta, moduleMetadata } from "@storybook/angular";
import { IconButtonModule } from "../icon-button";
import { NavItemComponent } from "./nav-item.component";
import { NavigationModule } from "./navigation.module";
export default {
title: "Component Library/Nav/Nav Item",
component: NavItemComponent,
decorators: [
moduleMetadata({
declarations: [],
imports: [RouterTestingModule, IconButtonModule, NavigationModule],
}),
],
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/Zt3YSeb6E6lebAffrNLa0h/Tailwind-Component-Library?node-id=4687%3A86642",
},
},
} as Meta;
type Story = StoryObj<NavItemComponent>;
export const Default: Story = {
render: (args) => ({
props: args,
template: `
<bit-nav-item text="${args.text}" [route]="['']" icon="${args.icon}"></bit-nav-item>
`,
}),
args: {
text: "Hello World",
icon: "bwi-filter",
},
};
export const WithoutIcon: Story = {
...Default,
args: {
text: "Hello World",
icon: "",
},
};
export const WithoutRoute: Story = {
render: (args: NavItemComponent) => ({
props: args,
template: `
<bit-nav-item text="Hello World" icon="bwi-collection"></bit-nav-item>
`,
}),
};
export const WithChildButtons: Story = {
render: (args: NavItemComponent) => ({
props: args,
template: `
<bit-nav-item text="Hello World" [route]="['']" icon="bwi-collection">
<button
slot="start"
class="tw-ml-auto"
[bitIconButton]="'bwi-clone'"
[buttonType]="'light'"
size="small"
aria-label="option 1"
></button>
<button
slot="end"
class="tw-ml-auto"
[bitIconButton]="'bwi-pencil-square'"
[buttonType]="'light'"
size="small"
aria-label="option 2"
></button>
<button
slot="end"
class="tw-ml-auto"
[bitIconButton]="'bwi-check'"
[buttonType]="'light'"
size="small"
aria-label="option 3"
></button>
</bit-nav-item>
`,
}),
};
export const MultipleItemsWithDivider: Story = {
render: (args: NavItemComponent) => ({
props: args,
template: `
<bit-nav-item text="Hello World" icon="bwi-collection"></bit-nav-item>
<bit-nav-item text="Hello World" icon="bwi-collection"></bit-nav-item>
<bit-nav-divider></bit-nav-divider>
<bit-nav-item text="Hello World" icon="bwi-collection"></bit-nav-item>
<bit-nav-item text="Hello World" icon="bwi-collection"></bit-nav-item>
`,
}),
};