From c5e937061debea344f21de61c27e11677703bf09 Mon Sep 17 00:00:00 2001 From: JpunktWpunkt <92968754+JpunktWpunkt@users.noreply.github.com> Date: Mon, 27 Nov 2023 11:27:24 +0100 Subject: [PATCH] feat(storybook): adds Icon Button Story --- .../buttons/icon-button/index.stories.ts | 295 +++++++++++++++++- 1 file changed, 281 insertions(+), 14 deletions(-) diff --git a/packages/ui-library/src/components/actions/buttons/icon-button/index.stories.ts b/packages/ui-library/src/components/actions/buttons/icon-button/index.stories.ts index ab8372ee3..4b7353bd8 100644 --- a/packages/ui-library/src/components/actions/buttons/icon-button/index.stories.ts +++ b/packages/ui-library/src/components/actions/buttons/icon-button/index.stories.ts @@ -1,50 +1,317 @@ /* eslint-disable no-console */ +import { html } from 'lit'; import { BlrIconButtonType, BlrIconButtonRenderFunction } from './index'; import { PureIconKeys } from '@boiler/icons'; import { ActionVariants, Sizes } from '../../../../globals/constants'; import { Themes } from '../../../../foundation/_tokens-generated/index.themes'; +// Shared Style inside the Stories +const sharedStyles = html` + +`; +//Main Showcase Storybook IconButton, main argType Table export default { - title: 'Design System/Web Components/Actions/Buttons/IconButton', + title: 'Design System/Web Components/Actions/Buttons/Icon Button', argTypes: { - icon: { - options: [undefined, ...PureIconKeys], + //Appearance + variant: { + name: 'variant', + description: 'Select variant of the component.', + options: ActionVariants, control: { type: 'select' }, + table: { + category: 'Appearance', + }, }, size: { + name: 'sizeVariant', + description: 'Choose size of the component.', options: Sizes, control: { type: 'select' }, - }, - variant: { - options: ActionVariants, - control: { type: 'select' }, + table: { + category: 'Appearance', + }, }, theme: { options: Themes, control: { type: 'select' }, + table: { + category: 'Appearance', + }, + }, + // Content / Settings + icon: { + name: 'icon', + description: 'Select the icon of the component.', + options: [undefined, ...PureIconKeys], + control: { type: 'select' }, + table: { + category: 'Content / Settings', + }, + }, + //States + disabled: { + name: 'disabled', + description: + 'Choose if component is disabled. Prevents the user to select or change the value of this component.', + defaultValue: false, + table: { + category: 'States', + }, + }, + loading: { + name: 'loading', + description: 'Choose if the component is loading.', + defaultValue: false, + table: { + category: 'States', + }, + }, + //Accessibility + arialabel: { + name: 'ariaLabel', + description: + 'Provides additional information about the elements purpose and functionality to assistive technologies, such as screen readers.', + table: { + category: 'Accessibility', + }, + }, + //Technical attributes + buttonId: { + name: 'buttonId', + description: 'Unique identifier for this component.', + table: { + category: 'Technical Attributes', + }, + }, + href: { + name: 'href', + description: "Enter the link's destination with the href attribute.", + table: { + category: 'Technical Attributes', + }, + }, + target: { + name: 'target', + description: 'Choose where to open the linked document with the target attribute.', + table: { + category: 'Technical Attributes', + }, + }, + // Events + onChange: { + name: 'onChange', + description: 'Fires when the value changes.', + action: 'onChange', + table: { + category: 'Events', + }, + }, + onFocus: { + name: 'onFocus', + description: 'Fires when the component is focused.', + action: 'onFocus', + table: { + category: 'Events', + }, + }, + onBlur: { + name: 'onBlur', + description: 'Fires when the component lost focus.', + action: 'onBlur', + table: { + category: 'Events', + }, }, }, parameters: { viewMode: 'docs', + docs: { + description: { + component: `
Text Button represents a clickable button that typically displays text rather than icons or symbols. The main feature of a Text Button is the text label, which communicates the button's action or function to the user. +
+ +