summaryrefslogtreecommitdiffstats
path: root/src/components/molecules/layout
ModeNameSize
-rw-r--r--branding.module.scss822logstatsplain
-rw-r--r--branding.stories.tsx1777logstatsplain
-rw-r--r--branding.test.tsx1553logstatsplain
-rw-r--r--branding.tsx1985logstatsplain
-rw-r--r--flipping-logo.module.scss1342logstatsplain
-rw-r--r--flipping-logo.stories.tsx1443logstatsplain
-rw-r--r--flipping-logo.test.tsx631logstatsplain
-rw-r--r--flipping-logo.tsx972logstatsplain
-rw-r--r--meta.stories.tsx1149logstatsplain
-rw-r--r--meta.test.tsx174logstatsplain
-rw-r--r--meta.tsx1502logstatsplain
f0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
import { ComponentMeta, ComponentStory } from '@storybook/react';
import { useState } from 'react';
import HeadingButtonComponent from './heading-button';

/**
 * HeadingButton - Storybook Meta
 */
export default {
  title: 'Molecules/Buttons/HeadingButton',
  component: HeadingButtonComponent,
  argTypes: {
    className: {
      control: {
        type: 'text',
      },
      description: 'Set additional classnames to the button.',
      table: {
        category: 'Styles',
      },
      type: {
        name: 'string',
        required: false,
      },
    },
    expanded: {
      control: {
        type: null,
      },
      description: 'Heading button state (plus or minus).',
      type: {
        name: 'boolean',
        required: true,
      },
    },
    level: {
      control: {
        type: 'number',
        min: 1,
        max: 6,
      },
      description: 'Heading level.',
      type: {
        name: 'number',
        required: true,
      },
    },
    setExpanded: {
      control: {
        type: null,
      },
      description: 'Callback function to set heading button state.',
      type: {
        name: 'function',
        required: true,
      },
    },
    title: {
      control: {
        type: 'text',
      },
      description: 'Heading title.',
      type: {
        name: 'string',
        required: true,
      },
    },
  },
} as ComponentMeta<typeof HeadingButtonComponent>;

const Template: ComponentStory<typeof HeadingButtonComponent> = ({
  expanded,
  setExpanded: _setExpanded,
  ...args
}) => {
  const [isExpanded, setIsExpanded] = useState<boolean>(expanded);

  return (
    <HeadingButtonComponent
      expanded={isExpanded}
      setExpanded={setIsExpanded}
      {...args}
    />
  );
};

/**
 * Heading Button Stories - Expanded
 */
export const Expanded = Template.bind({});
Expanded.args = {
  expanded: true,
  level: 2,
  title: 'Your title',
};

/**
 * Heading Button Stories - Collapsed
 */
export const Collapsed = Template.bind({});
Collapsed.args = {
  expanded: false,
  level: 2,
  title: 'Your title',
};