Skip to content

Instantly share code, notes, and snippets.

@happylinks
Created January 10, 2020 10:56
Show Gist options
  • Save happylinks/ecaea6a2f0741bf40a9574f365d194b0 to your computer and use it in GitHub Desktop.
Save happylinks/ecaea6a2f0741bf40a9574f365d194b0 to your computer and use it in GitHub Desktop.

Revisions

  1. happylinks created this gist Jan 10, 2020.
    83 changes: 83 additions & 0 deletions Reach.re
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,83 @@
    module Menu = {
    [@bs.module "@reach/menu-button"] [@react.component]
    external make:
    (~className: string=?, ~children: React.element) => React.element =
    "Menu";

    module Button = {
    [@bs.module "@reach/menu-button"] [@react.component]
    external make: (~children: React.element) => React.element = "MenuButton";
    };

    module List = {
    [@bs.module "@reach/menu-button"] [@react.component]
    external make: (~children: React.element) => React.element = "MenuList";
    };

    module Item = {
    [@bs.module "@reach/menu-button"] [@react.component]
    external make:
    (~children: React.element, ~onSelect: unit => unit) => React.element =
    "MenuItem";
    };

    module Link = {
    [@bs.module "@reach/menu-button"] [@react.component]
    external make:
    (~children: React.element, ~as_: string, ~href: string) => React.element =
    "MenuLink";
    };
    };

    module Dialog = {
    /* TODO: figure out ariaLabel */
    [@bs.module "@reach/dialog"] [@react.component]
    external make:
    (
    ~className: string=?,
    ~isOpen: bool,
    ~ariaLabel: string=?,
    ~ariaLabelledBy: string=?,
    ~onDismiss: unit => unit=?,
    ~children: React.element
    ) =>
    React.element =
    "Dialog";
    };

    module Tabs = {
    /* TODO: figure out ariaLabel */
    [@bs.module "@reach/tabs"] [@react.component]
    external make:
    (
    ~className: string=?,
    ~onChange: int => unit=?,
    ~defaultIndex: int=?,
    ~index: int=?,
    ~children: React.element
    ) =>
    React.element =
    "Tabs";

    module TabList = {
    [@bs.module "@reach/tabs"] [@react.component]
    external make: (~children: React.element) => React.element = "TabList";
    };

    module Tab = {
    [@bs.module "@reach/tabs"] [@react.component]
    external make:
    (~className: string=?, ~children: React.element) => React.element =
    "Tab";
    };

    module TabPanels = {
    [@bs.module "@reach/tabs"] [@react.component]
    external make: (~children: React.element) => React.element = "TabPanels";
    };

    module TabPanel = {
    [@bs.module "@reach/tabs"] [@react.component]
    external make: (~children: React.element) => React.element = "TabPanel";
    };
    };