summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-csv.js
blob: f918f084e74437bf7e67d143c8b8677c3930eedf (plain)
1
2
3
4
5
6
// https://tools.ietf.org/html/rfc4180

Prism.languages.csv = {
  value: /[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,
  punctuation: /,/,
};
x */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* 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 {
  forwardRef,
  ForwardRefRenderFunction,
  MouseEventHandler,
  ReactNode,
} from 'react';
import styles from './buttons.module.scss';

export type ButtonProps = {
  /**
   * Button accessible label.
   */
  'aria-label'?: string;
  /**
   * Indicates the current "pressed" state of a toggle button.
   */
  'aria-pressed'?: boolean | 'mixed';
  /**
   * The button body.
   */
  children: ReactNode;
  /**
   * Set additional classnames to the button wrapper.
   */
  className?: string;
  /**
   * Button state. Default: false.
   */
  disabled?: boolean;
  /**
   * Button kind. Default: secondary.
   */
  kind?: 'primary' | 'secondary' | 'tertiary' | 'neutral';
  /**
   * A callback function to handle click.
   */
  onClick?: MouseEventHandler<HTMLButtonElement>;
  /**
   * Button shape. Default: rectangle.
   */
  shape?: 'circle' | 'rectangle' | 'square' | 'initial';
  /**
   * Button type attribute. Default: button.
   */
  type?: 'button' | 'reset' | 'submit';
};

/**
 * Button component
 *
 * Use a button as call to action.
 */
const Button: ForwardRefRenderFunction<HTMLButtonElement, ButtonProps> = (
  {
    className = '',
    children,
    disabled = false,
    kind = 'secondary',
    shape = 'rectangle',
    type = 'button',
    ...props
  },
  ref
) => {
  const kindClass = styles[`btn--${kind}`];
  const shapeClass = styles[`btn--${shape}`];

  return (
    <button
      className={`${styles.btn} ${kindClass} ${shapeClass} ${className}`}
      disabled={disabled}
      ref={ref}
      type={type}
      {...props}
    >
      {children}
    </button>
  );
};

export default forwardRef(Button);