diff --git a/webapp/src/app/ui/input/input.component.html b/webapp/src/app/ui/input/input.component.html deleted file mode 100644 index 8694176e..00000000 --- a/webapp/src/app/ui/input/input.component.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/webapp/src/app/ui/input/input.component.ts b/webapp/src/app/ui/input/input.component.ts deleted file mode 100644 index 57683265..00000000 --- a/webapp/src/app/ui/input/input.component.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Component, computed, input, output } from '@angular/core'; -import type { ClassValue } from 'clsx'; -import { VariantProps } from 'class-variance-authority'; -import { cn } from 'app/utils'; -import { cva } from 'app/storybook.helper'; - -const [inputVariants, args, argTypes] = cva( - 'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', - { - variants: { - size: { - default: 'h-10 px-4 py-2', - sm: 'h-9 px-2 py-1', - lg: 'h-11 px-4 py-3', - }, - }, - defaultVariants: { - size: 'default', - }, - }, -); - -export { args, argTypes }; - -interface InputVariants extends VariantProps {} - -@Component({ - selector: 'app-input', - standalone: true, - templateUrl: './input.component.html', -}) -export class AppInputComponent { - class = input(''); - type = input('text'); - placeholder = input(''); - size = input('default'); - disabled = input(false); - value = input(''); - id = input(''); - - valueChange = output(); - - onInput(event: Event) { - const inputValue = (event.target as HTMLInputElement).value; - this.valueChange.emit(inputValue); - } - - computedClass = computed(() => - cn(inputVariants({ size: this.size() }), this.class()), - ); -} diff --git a/webapp/src/app/ui/input/input.stories.ts b/webapp/src/app/ui/input/input.stories.ts deleted file mode 100644 index 8beb17ce..00000000 --- a/webapp/src/app/ui/input/input.stories.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { - argsToTemplate, - moduleMetadata, - type Meta, - type StoryObj, -} from '@storybook/angular'; -import { AppInputComponent, args, argTypes } from './input.component'; -import { action } from '@storybook/addon-actions'; -import { AppButtonComponent } from '@app/ui/button/button/button.component'; -import { AppLabelComponent } from '@app/ui/label/label.component'; - -const meta: Meta = { - title: 'UI/Input', - component: AppInputComponent, - tags: ['autodocs'], - args: { - ...args, - value: '', - disabled: false, - size: 'default', - }, - argTypes: { - ...argTypes, - disabled: { - control: 'boolean', - }, - onInput: { - action: 'onInput', - }, - }, - decorators: [ - moduleMetadata({ - imports: [AppButtonComponent, AppLabelComponent], - }), - ], -}; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - render: (args) => ({ - props: args, - template: ``, - }), -}; - -export const Disabled: Story = { - args: { - disabled: true, - }, - render: (args) => ({ - props: args, - template: ``, - }), -}; - -export const WithLabel: Story = { - render: (args) => ({ - props: args, - template: ` -
- Label - -
- `, - }), -}; - -export const WithButton: Story = { - render: (args) => ({ - props: { - args, - userInput: '', - onButtonClick(value: string) { - action('Button Clicked')(`Input Value: ${value}`); - }, - }, - template: ` -
- - Submit -
- `, - }), -}; diff --git a/webapp/src/app/ui/label/label.component.html b/webapp/src/app/ui/label/label.component.html deleted file mode 100644 index 3eed1b2c..00000000 --- a/webapp/src/app/ui/label/label.component.html +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/webapp/src/app/ui/label/label.component.ts b/webapp/src/app/ui/label/label.component.ts deleted file mode 100644 index 013d6cb8..00000000 --- a/webapp/src/app/ui/label/label.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component, computed, input } from '@angular/core'; -import type { ClassValue } from 'clsx'; -import { VariantProps } from 'class-variance-authority'; -import { cn } from 'app/utils'; -import { cva } from 'app/storybook.helper'; - -const [labelVariants, args, argTypes] = cva('text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'); - -export { args, argTypes }; - -interface LabelVariants extends VariantProps {} - -@Component({ - selector: 'app-label', - standalone: true, - templateUrl: './label.component.html', -}) -export class AppLabelComponent { - class = input(''); - for = input(''); - - computedClass = computed(() => - cn(labelVariants({}), this.class()), - ); -} diff --git a/webapp/src/app/ui/label/label.stories.ts b/webapp/src/app/ui/label/label.stories.ts deleted file mode 100644 index 7d9dd734..00000000 --- a/webapp/src/app/ui/label/label.stories.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { argsToTemplate, type Meta, type StoryObj } from '@storybook/angular'; -import { AppLabelComponent, args, argTypes } from './label.component'; - -const meta: Meta = { - title: 'UI/Label', - component: AppLabelComponent, - tags: ['autodocs'], - args: { - ...args, - for: 'example-input', - }, - argTypes: { - ...argTypes, - }, -}; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - render: (args) => ({ - props: args, - template: `Label`, - }), -};