aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/meta-list/meta-list.stories.tsx
blob: d73c5b948ec7f731000a54bea61e4d08dde4f473 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px;
import type { ComponentMeta, ComponentStory } from '@storybook/react';
import { Link } from '../../atoms';
import { MetaItem } from './meta-item';
import { MetaList } from './meta-list';

/**
 * MetaList - Storybook Meta
 */
export default {
  title: 'Molecules/MetaList',
  component: MetaList,
  argTypes: {
    items: {
      description: 'The meta items.',
      type: {
        name: 'object',
        required: true,
        value: {},
      },
    },
  },
} as ComponentMeta<typeof MetaList>;

const Template: ComponentStory<typeof MetaList> = (args) => (
  <MetaList {...args} />
);

const items = [
  { id: 'comments', label: 'Comments', value: 'No comments.' },
  {
    id: 'category',
    label: 'Category',
    value: <Link href="#cat1">Cat 1</Link>,
  },
  {
    id: 'tags',
    label: 'Tags',
    value: [
      { id: 'tag1', value: <Link href="#tag1">Tag 1</Link> },
      { id: 'tag2', value: <Link href="#tag2">Tag 2</Link> },
    ],
  },
  {
    hasBorderedValues: true,
    hasInlinedValues: true,
    id: 'technologies',
    label: 'Technologies',
    value: [
      { id: 'techno1', value: 'HTML' },
      { id: 'techno2', value: 'CSS' },
      { id: 'techno3', value: 'Javascript' },
    ],
  },
];

/**
 * MetaList Stories - Default
 */
export const Default = Template.bind({});
Default.args = {
  children: items.map(({ id, ...item }) => <MetaItem key={id} {...item} />),
};

/**
 * MetaList Stories - Inlined
 */
export const Inlined = Template.bind({});
Inlined.args = {
  children: items.map(({ id, ...item }) => <MetaItem key={id} {...item} />),
  isInline: true,
};
r || ''); } var r = RegExp( '\\b(?:' + ( 'Adj BigInt Bool Ctl Double false Int One Pauli PauliI PauliX PauliY PauliZ Qubit Range Result String true Unit Zero' + ' ' + 'Adjoint adjoint apply as auto body borrow borrowing Controlled controlled distribute elif else fail fixup for function if in internal intrinsic invert is let mutable namespace new newtype open operation repeat return self set until use using while within' ) .trim() .replace(/ /g, '|') + ')\\b' ), t = a('<<0>>(?:\\s*\\.\\s*<<0>>)*', ['\\b[A-Za-z_]\\w*\\b']), i = { keyword: r, punctuation: /[<>()?,.:[\]]/ }, s = '"(?:\\\\.|[^\\\\"])*"'; (e.languages.qsharp = e.languages.extend('clike', { comment: /\/\/.*/, string: [ { pattern: n('(^|[^$\\\\])<<0>>', [s]), lookbehind: !0, greedy: !0 }, ], 'class-name': [ { pattern: n('(\\b(?:as|open)\\s+)<<0>>(?=\\s*(?:;|as\\b))', [t]), lookbehind: !0, inside: i, }, { pattern: n('(\\bnamespace\\s+)<<0>>(?=\\s*\\{)', [t]), lookbehind: !0, inside: i, }, ], keyword: r, number: /(?:\b0(?:x[\da-f]+|b[01]+|o[0-7]+)|(?:\B\.\d+|\b\d+(?:\.\d*)?)(?:e[-+]?\d+)?)l?\b/i, operator: /\band=|\bor=|\band\b|\bnot\b|\bor\b|<[-=]|[-=]>|>>>=?|<<<=?|\^\^\^=?|\|\|\|=?|&&&=?|w\/=?|~~~|[*\/+\-^=!%]=?/, punctuation: /::|[{}[\];(),.:]/, })), e.languages.insertBefore('qsharp', 'number', { range: { pattern: /\.\./, alias: 'operator' }, }); var o = (function (e, n) { for (var r = 0; r < n; r++) e = e.replace(/<<self>>/g, function () { return '(?:' + e + ')'; }); return e.replace(/<<self>>/g, '[^\\s\\S]'); })(a('\\{(?:[^"{}]|<<0>>|<<self>>)*\\}', [s]), 2); e.languages.insertBefore('qsharp', 'string', { 'interpolation-string': { pattern: n('\\$"(?:\\\\.|<<0>>|[^\\\\"{])*"', [o]), greedy: !0, inside: { interpolation: { pattern: n('((?:^|[^\\\\])(?:\\\\\\\\)*)<<0>>', [o]), lookbehind: !0, inside: { punctuation: /^\{|\}$/, expression: { pattern: /[\s\S]+/, alias: 'language-qsharp', inside: e.languages.qsharp, }, }, }, string: /[\s\S]+/, }, }, }); })(Prism), (Prism.languages.qs = Prism.languages.qsharp);