From beb4dd81ceb127698c9271cd76fd885175f57cfb Mon Sep 17 00:00:00 2001 From: Bryan Cunningham Date: Mon, 13 Oct 2025 14:20:08 -0400 Subject: [PATCH] WIP --- .../chip-select/chip-select.component.html | 18 +- libs/components/src/chip/chip.component.css | 61 +++-- libs/components/src/chip/chip.component.html | 38 --- libs/components/src/chip/chip.component.ts | 15 -- libs/components/src/chip/chip.stories.ts | 225 ------------------ 5 files changed, 43 insertions(+), 314 deletions(-) delete mode 100644 libs/components/src/chip/chip.component.html delete mode 100644 libs/components/src/chip/chip.component.ts delete mode 100644 libs/components/src/chip/chip.stories.ts diff --git a/libs/components/src/chip-select/chip-select.component.html b/libs/components/src/chip-select/chip-select.component.html index a386f7f81d9..1c34384e41e 100644 --- a/libs/components/src/chip-select/chip-select.component.html +++ b/libs/components/src/chip-select/chip-select.component.html @@ -1,20 +1,14 @@
- - --> - -
- Chip component - - @if (isDismissible()) { - - } -
diff --git a/libs/components/src/chip/chip.component.ts b/libs/components/src/chip/chip.component.ts deleted file mode 100644 index 0fb9acf2094..00000000000 --- a/libs/components/src/chip/chip.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { input, Component, booleanAttribute } from "@angular/core"; - -import { SharedModule } from "../shared"; - -@Component({ - selector: "bit-chip", - templateUrl: "chip.component.html", - imports: [SharedModule], -}) -export class ChipComponent { - protected readonly isInteractive = input(booleanAttribute(false)); - protected readonly isDisabled = input(booleanAttribute(false)); - protected readonly isDismissible = input(booleanAttribute(false)); - protected readonly isSelected = input(booleanAttribute(false)); -} diff --git a/libs/components/src/chip/chip.stories.ts b/libs/components/src/chip/chip.stories.ts deleted file mode 100644 index 9119cff17a8..00000000000 --- a/libs/components/src/chip/chip.stories.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { FormsModule } from "@angular/forms"; -import { Meta, StoryObj, moduleMetadata } from "@storybook/angular"; - -import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; - -import { MenuModule } from "../menu"; -import { I18nMockService } from "../utils/i18n-mock.service"; - -import { ChipComponent } from "./chip.component"; - -import { formatArgsForCodeSnippet } from ".storybook/format-args-for-code-snippet"; - -export default { - title: "Component Library/Chip", - component: ChipComponent, - decorators: [ - moduleMetadata({ - imports: [MenuModule, FormsModule], - providers: [ - { - provide: I18nService, - useFactory: () => { - return new I18nMockService({ - viewItemsIn: (name) => `View items in ${name}`, - back: "Back", - backTo: (name) => `Back to ${name}`, - removeItem: (name) => `Remove ${name}`, - }); - }, - }, - ], - }), - ], - parameters: { - design: { - type: "figma", - url: "https://www.figma.com/design/Zt3YSeb6E6lebAffrNLa0h/Tailwind-Component-Library?node-id=16329-29548&t=b5tDKylm5sWm2yKo-4", - }, - }, - args: { - isSelected: false, - isDisabled: false, - isDismissible: false, - isInteractive: false, - }, -} as Meta; - -type Story = StoryObj; - -export const Default: Story = { - render: (args) => ({ - props: args, - template: /* html */ ` - - `, - }), -}; - -// export const MenuOpen: Story = { -// render: (args) => ({ -// props: { -// ...args, -// }, -// template: /* html */ ` -// -// `, -// }), -// args: { -// options: [ -// { -// label: "Foo", -// value: "foo", -// icon: "bwi-folder", -// }, -// { -// label: "Bar", -// value: "bar", -// icon: "bwi-exclamation-triangle tw-text-danger", -// }, -// { -// label: "Baz", -// value: "baz", -// disabled: true, -// }, -// ], -// }, -// play: async (context) => { -// const canvas = context.canvasElement; -// const buttons = getAllByRole(canvas, "button"); -// await userEvent.click(buttons[0]); -// }, -// }; - -// export const FullWidth: Story = { -// render: (args) => ({ -// props: { -// ...args, -// }, -// template: /* html */ ` -//
-// -//
-// `, -// }), -// args: { -// options: [ -// { -// label: "Foo", -// value: "foo", -// icon: "bwi-folder", -// }, -// { -// label: "Bar", -// value: "bar", -// icon: "bwi-exclamation-triangle tw-text-danger", -// }, -// { -// label: "Baz", -// value: "baz", -// disabled: true, -// }, -// ], -// }, -// }; - -// export const NestedOptions: Story = { -// ...Default, -// args: { -// options: [ -// { -// label: "Foo", -// value: "foo", -// icon: "bwi-folder", -// children: [ -// { -// label: "Foo1 very long name of folder but even longer than you thought", -// value: "foo1", -// icon: "bwi-folder", -// children: [ -// { -// label: "Foo2", -// value: "foo2", -// icon: "bwi-folder", -// children: [ -// { -// label: "Foo3", -// value: "foo3", -// }, -// ], -// }, -// ], -// }, -// ], -// }, -// { -// label: "Bar", -// value: "bar", -// icon: "bwi-folder", -// }, -// { -// label: "Baz", -// value: "baz", -// icon: "bwi-folder", -// }, -// ], -// value: "foo1", -// }, -// }; - -// export const TextOverflow: Story = { -// ...Default, -// args: { -// options: [ -// { -// label: "Fooooooooooooooooooooooooooooooooooooooooooooo", -// value: "foo", -// }, -// ], -// value: "foo", -// }, -// }; - -// export const Disabled: Story = { -// render: (args) => ({ -// props: { -// ...args, -// }, -// template: /* html */ ` -// -// -// `, -// }), -// args: { -// options: [ -// { -// label: "Foo", -// value: "foo", -// icon: "bwi-folder", -// }, -// ], -// value: "foo", -// }, -// };