import MagnifyingGlass from '@components/atoms/icons/magnifying-glass'; import { ComponentMeta, ComponentStory } from '@storybook/react'; import { useState } from 'react'; import FlippingLabel from './flipping-label'; export default { title: 'Organisms/Forms/FlippingLabel', component: FlippingLabel, argTypes: { 'aria-label': { control: { type: 'text', }, description: 'An accessible name for the label.', table: { category: 'Accessibility', }, type: { name: 'string', required: false, }, }, children: { control: { type: null, }, description: 'An icon for the label front face.', type: { name: 'function', required: true, }, }, className: { control: { type: 'text', }, description: 'Set additional classnames to the label.', table: { category: 'Styles', }, type: { name: 'string', required: false, }, }, htmlFor: { control: { type: null, }, description: 'Bind the label to a field by id.', table: { category: 'Options', }, type: { name: 'string', required: false, }, }, isActive: { control: { type: 'boolean', }, description: 'Which side of the label should be displayed? True for the close icon.', type: { name: 'boolean', required: true, }, }, }, } as ComponentMeta; const Template: ComponentStory = ({ isActive, ...args }) => { const [active, setActive] = useState(isActive); return (
setActive(!active)}>
); }; export const Active = Template.bind({}); Active.args = { children: , isActive: true, }; export const Inactive = Template.bind({}); Inactive.args = { children: , isActive: false, }; com/log/public/prism/prism-openqasm.js'>
blob: bb868d14e0bcb8d438bbbf30e6ec6451c531dddb (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
// https://qiskit.github.io/openqasm/grammar/index.html

Prism.languages.openqasm = {
  comment: /\/\*[\s\S]*?\*\/|\/\/.*/,
  string: {
    pattern: /"[^"\r\n\t]*"|'[^'\r\n\t]*'/,
    greedy: true,
  },

  keyword:
    /\b(?:CX|OPENQASM|U|barrier|boxas|boxto|break|const|continue|ctrl|def|defcal|defcalgrammar|delay|else|end|for|gate|gphase|if|in|include|inv|kernel|lengthof|let|measure|pow|reset|return|rotary|stretchinf|while)\b|#pragma\b/,
  'class-name':
    /\b(?:angle|bit|bool|creg|fixed|float|int|length|qreg|qubit|stretch|uint)\b/,
  function: /\b(?:cos|exp|ln|popcount|rotl|rotr|sin|sqrt|tan)\b(?=\s*\()/,

  constant: /\b(?:euler|pi|tau)\b|ฯ€|๐œ|โ„‡/,
  number: {
    pattern:
      /(^|[^.\w$])(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:dt|ns|us|ยตs|ms|s)?/i,
    lookbehind: true,
  },
  operator: /->|>>=?|<<=?|&&|\|\||\+\+|--|[!=<>&|~^+\-*/%]=?|@/,
  punctuation: /[(){}\[\];,:.]/,
};

Prism.languages.qasm = Prism.languages.openqasm;