aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/collapsible/collapsible.stories.tsx
blob: 7cac64d778081baa66af5ca1d9cea454e35d3022 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<
import type { ComponentMeta, ComponentStory } from '@storybook/react';
import { Heading } from '../../atoms';
import { Collapsible } from './collapsible';

/**
 * HeadingButton - Storybook Meta
 */
export default {
  title: 'Molecules/Collapsible',
  component: Collapsible,
  argTypes: {
    heading: {
      control: {
        type: 'text',
      },
      description: 'Define the collapsible heading.',
      type: {
        name: 'function',
        required: true,
      },
    },
    isCollapsed: {
      control: {
        type: 'boolean',
      },
      description: 'Define if the component should be collapsed or expanded.',
      table: {
        category: 'Options',
        defaultValue: { summary: false },
      },
      type: {
        name: 'boolean',
        required: true,
      },
    },
  },
} as ComponentMeta<typeof Collapsible>;

const Template: ComponentStory<typeof Collapsible> = ({ heading, ...args }) => (
  <Collapsible
    {...args}
    heading={
      <Heading isFake level={3}>
        {heading}
      </Heading>
    }
  />
);

const heading = 'Your title';
const body =
  'Eius et eum ex voluptas laboriosam aliquid quas necessitatibus. Molestiae eius voluptatem qui voluptas eaque et totam. Ut ipsum ea sit. Quos molestiae id est consequatur. Suscipit illo at. Omnis non suscipit. Qui itaque laboriosam quos ut est laudantium. Iusto recusandae excepturi quia labore voluptatem quod recusandae. Quod ducimus ut rem dolore et.';

/**
 * Collapsible Stories - Collapsed
 */
export const Collapsed = Template.bind({});
Collapsed.args = {
  children: body,
  heading,
  isCollapsed: true,
};

/**
 * Collapsible Stories - Expanded
 */
export const Expanded = Template.bind({});
Expanded.args = {
  children: body,
  heading,
  isCollapsed: false,
};
|seven|six|ten|three|twelve|two))\b(?!-)/i, lookbehind: !0, }, verb: { pattern: /(^|[^-])\b(?:answering|applying to|are|asking|attacking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:ing|s)?|consulting|contain(?:ing|s)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:s|ve|ving)|hold(?:ing|s)?|impl(?:ies|y)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:ing|s)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:ing|s)?|setting|showing|singing|sleeping|smelling|squeezing|support(?:ing|s)?|swearing|switching|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:ing|s)?|var(?:ies|y|ying)|waiting|waking|waving|wear(?:ing|s)?)\b(?!-)/i, lookbehind: !0, alias: 'operator', }, keyword: { pattern: /(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|the story|unless)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i, lookbehind: !0, }, property: { pattern: /(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: off| on)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i, lookbehind: !0, alias: 'symbol', }, position: { pattern: /(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i, lookbehind: !0, alias: 'keyword', }, type: { pattern: /(^|[^-])\b(?:actions?|activit(?:ies|y)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i, lookbehind: !0, alias: 'variable', }, punctuation: /[.,:;(){}]/, }), (Prism.languages.inform7.string.inside.substitution.inside.rest = Prism.languages.inform7), (Prism.languages.inform7.string.inside.substitution.inside.rest.text = { pattern: /\S(?:\s*\S)*/, alias: 'comment', });