2020-07-21 03:56:14 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import * as System from "~/components/system";
|
2020-06-22 14:00:51 +03:00
|
|
|
|
2020-07-21 03:56:14 +03:00
|
|
|
import SystemPage from "~/components/system/SystemPage";
|
|
|
|
import ViewSourceLink from "~/components/system/ViewSourceLink";
|
|
|
|
import CodeBlock from "~/components/system/CodeBlock";
|
2020-06-22 14:00:51 +03:00
|
|
|
|
|
|
|
export default class SystemPageButtons extends React.Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2020-07-28 23:27:53 +03:00
|
|
|
<SystemPage
|
|
|
|
title="SDS: Buttons"
|
|
|
|
description="..."
|
|
|
|
url="https://slate.host/system/buttons"
|
|
|
|
>
|
2020-06-22 14:15:04 +03:00
|
|
|
<System.H1>
|
2020-07-01 10:31:55 +03:00
|
|
|
Buttons <ViewSourceLink file="system/buttons.js" />
|
2020-06-22 14:15:04 +03:00
|
|
|
</System.H1>
|
2020-06-22 14:00:51 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
2020-06-24 05:02:55 +03:00
|
|
|
<System.P>
|
2020-07-21 03:56:14 +03:00
|
|
|
The Button component is used to trigger an action or event, such as
|
|
|
|
submitting a form or saving users information.
|
2020-06-24 05:02:55 +03:00
|
|
|
</System.P>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
2020-07-03 19:38:44 +03:00
|
|
|
<System.H2>Imports</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<System.P>Import React and the Button Components.</System.P>
|
2020-07-03 19:38:44 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<CodeBlock>
|
2020-07-28 23:27:53 +03:00
|
|
|
{`import * as React from "react";
|
2020-07-03 19:38:44 +03:00
|
|
|
import {
|
|
|
|
ButtonPrimary,
|
|
|
|
ButtonPrimaryFull,
|
|
|
|
ButtonSecondary,
|
|
|
|
ButtonSecondaryFull,
|
|
|
|
ButtonDisabled,
|
|
|
|
ButtonDisabledFull,
|
2020-07-28 23:27:53 +03:00
|
|
|
} from "slate-react-system";`}
|
2020-07-21 03:56:14 +03:00
|
|
|
</CodeBlock>
|
2020-07-03 19:38:44 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
2020-06-24 05:02:55 +03:00
|
|
|
<System.H2>Regular width</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
|
|
|
<System.P>
|
2020-07-21 03:56:14 +03:00
|
|
|
There are three variations of the regular width button component.
|
2020-07-01 10:31:55 +03:00
|
|
|
<br />
|
2020-06-24 05:02:55 +03:00
|
|
|
Primary, Secondary and Disabled.
|
|
|
|
</System.P>
|
|
|
|
<br />
|
|
|
|
<System.ButtonPrimary>Primary</System.ButtonPrimary>
|
|
|
|
<System.ButtonSecondary>Secondary</System.ButtonSecondary>
|
|
|
|
<System.ButtonDisabled>Disabled</System.ButtonDisabled>
|
|
|
|
<br />
|
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<CodeBlock>
|
|
|
|
{`class ExamplePrimary extends React.Component {
|
2020-07-28 23:27:53 +03:00
|
|
|
render() {
|
|
|
|
return <ButtonPrimary>Primary Button</ButtonPrimary>;
|
|
|
|
}
|
2020-07-04 08:05:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
class ExampleSecondary extends React.Component {
|
2020-07-28 23:27:53 +03:00
|
|
|
render() {
|
|
|
|
return <ButtonSecondary>Secondary Button</ButtonSecondary>;
|
|
|
|
}
|
2020-07-04 08:05:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
class ExampleDisabled extends React.Component {
|
2020-07-28 23:27:53 +03:00
|
|
|
render() {
|
|
|
|
return <ButtonDisabled>Disabled Button</ButtonDisabled>;
|
|
|
|
}
|
2020-07-03 19:38:44 +03:00
|
|
|
}`}
|
2020-07-21 03:56:14 +03:00
|
|
|
</CodeBlock>
|
2020-06-22 14:00:51 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
2020-06-24 05:02:55 +03:00
|
|
|
<System.H2>Full width</System.H2>
|
|
|
|
<hr />
|
2020-06-22 14:00:51 +03:00
|
|
|
<br />
|
2020-06-24 05:02:55 +03:00
|
|
|
<System.P>
|
2020-07-21 03:56:14 +03:00
|
|
|
There are three variations of the full width button component. <br />
|
2020-06-24 05:02:55 +03:00
|
|
|
Primary, Secondary and Disabled.
|
|
|
|
</System.P>
|
2020-06-22 14:00:51 +03:00
|
|
|
<br />
|
2020-07-03 19:38:44 +03:00
|
|
|
<System.ButtonPrimaryFull>Primary Button Full</System.ButtonPrimaryFull>
|
2020-06-22 14:00:51 +03:00
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<System.ButtonSecondaryFull>
|
|
|
|
Secondary Button Full
|
|
|
|
</System.ButtonSecondaryFull>
|
2020-06-22 14:00:51 +03:00
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<System.ButtonDisabledFull>
|
|
|
|
Disabled Button Full
|
|
|
|
</System.ButtonDisabledFull>
|
2020-06-22 14:00:51 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<CodeBlock>
|
|
|
|
{`class ExamplePrimaryFull extends React.Component {
|
2020-07-28 23:27:53 +03:00
|
|
|
render() {
|
|
|
|
return <ButtonPrimaryFull>Primary Button Full</ButtonPrimaryFull>;
|
|
|
|
}
|
2020-07-04 08:05:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
class ExampleSecondaryFull extends React.Component {
|
2020-07-28 23:27:53 +03:00
|
|
|
render() {
|
|
|
|
return <ButtonSecondaryFull>Secondary Button Full</ButtonSecondaryFull>;
|
|
|
|
}
|
2020-07-04 08:05:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
class ExampleDisabledFull extends React.Component {
|
2020-07-28 23:27:53 +03:00
|
|
|
render() {
|
|
|
|
return <ButtonDisabledFull>Disabled Button Full</ButtonDisabledFull>;
|
|
|
|
}
|
2020-07-03 19:38:44 +03:00
|
|
|
}`}
|
2020-07-21 03:56:14 +03:00
|
|
|
</CodeBlock>
|
2020-06-22 14:00:51 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
2020-06-24 05:02:55 +03:00
|
|
|
<System.H2>Labels</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
|
|
|
<System.P>
|
2020-07-21 03:56:14 +03:00
|
|
|
You can add the <i>type='label'</i> property to convert any of the
|
|
|
|
above buttons into a label.
|
2020-06-24 05:02:55 +03:00
|
|
|
</System.P>
|
|
|
|
<br />
|
2020-07-21 03:56:14 +03:00
|
|
|
<System.ButtonPrimary type="label">
|
|
|
|
Primary Label
|
|
|
|
</System.ButtonPrimary>{" "}
|
|
|
|
|
|
|
|
<System.ButtonSecondary type="label">
|
|
|
|
Secondary Label
|
|
|
|
</System.ButtonSecondary>{" "}
|
|
|
|
|
|
|
|
<System.ButtonDisabled type="label">
|
|
|
|
Disabled Label
|
|
|
|
</System.ButtonDisabled>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<CodeBlock>
|
|
|
|
{`class ExamplePrimaryLabel extends React.Component {
|
2020-07-28 23:27:53 +03:00
|
|
|
render() {
|
|
|
|
return <ButtonPrimary type="label">Primary Button Label</ButtonPrimary>;
|
|
|
|
}
|
2020-07-04 08:05:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
class ExampleSecondaryLabel extends React.Component {
|
2020-07-28 23:27:53 +03:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<ButtonSecondary type="label">Secondary Button Label</ButtonSecondary>
|
|
|
|
);
|
|
|
|
}
|
2020-07-04 08:05:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
class ExampleDisabledLabel extends React.Component {
|
2020-07-28 23:27:53 +03:00
|
|
|
render() {
|
|
|
|
return <ButtonDisabled type="label">Disabled Button Label</ButtonDisabled>;
|
|
|
|
}
|
2020-07-03 19:38:44 +03:00
|
|
|
}`}
|
2020-07-21 03:56:14 +03:00
|
|
|
</CodeBlock>
|
2020-06-22 14:00:51 +03:00
|
|
|
</SystemPage>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|