Skip to content

Commit

Permalink
button overview and guidance pages
Browse files Browse the repository at this point in the history
Signed-off-by: lakshya <[email protected]>
  • Loading branch information
lakshz committed Mar 4, 2024
1 parent 96ecf72 commit 0618dae
Show file tree
Hide file tree
Showing 8 changed files with 1,010 additions and 31 deletions.
655 changes: 632 additions & 23 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,22 @@
"prepare": "husky install"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@fullcalendar/daygrid": "^5.11.3",
"@fullcalendar/google-calendar": "^6.1.9",
"@fullcalendar/interaction": "^6.1.10",
"@fullcalendar/react": "^5.11.2",
"@layer5/meshery-design-embed": "^0.2.0",
"@layer5/sistent": "^0.14.13",
"@loadable/component": "^5.15.3",
"@mdx-js/mdx": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"@mui/material": "^5.15.11",
"@react-icons/all-files": "^4.1.0",
"@sideway/address": "^5.0.0",
"@svgr/webpack": "^8.0.1",
"@types/mui-datatables": "^4.3.12",
"axios": "^1.4.0",
"babel-plugin-styled-components": "^2.1.4",
"babel-preset-gatsby": "^2.22.0",
Expand Down Expand Up @@ -70,6 +75,7 @@
"joi": "^17.10.2",
"js-search": "^2.0.0",
"lodash": "^4.17.21",
"mui-datatables": "^4.3.0",
"prism-react-renderer": "^1.3.5",
"prop-types": "^15.7.2",
"react": "^17.0.2",
Expand Down
7 changes: 0 additions & 7 deletions src/sections/Projects/Sistent/components/button.js

This file was deleted.

5 changes: 5 additions & 0 deletions src/sections/Projects/Sistent/components/button/code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from "react";

export const ButtonCode = () => {
return <div>ButtonCode</div>;
};
139 changes: 139 additions & 0 deletions src/sections/Projects/Sistent/components/button/guidance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import React from "react";
import { Row } from "../../../../../reusecore/Layout";
import { Button, SistentThemeProvider } from "@layer5/sistent";

export const ButtonGuidance = () => {
return (
<div className="main-content">
<p>
For proper application, these buttons can be used for different purposes
to enable easier and consistent combination when guiding users across
digital experiences.
</p>
<a id="Function">
<h2>Function</h2>
</a>
<p>
The function of different buttons is what determines its usage and how
well suited it is to be applied in a given scenario to solve an existing
problem or complete a pending task. Functions or roles that can be
assigned to buttons in a particular design include:
</p>
<h3>Primary Button</h3>
<p>
Primary buttons are used for the most important actions on a page. It
should be the key button that helps the user navigate in a given flow or
while trying to perform a specific action. This could apply in cases
like when the user needs to submit a from, proceed to a new page, or
complete an action. The filled button serves as the primary button.
</p>
<Row Hcenter className="image-container">
<SistentThemeProvider>
<Button
variant="contained"
label="Primary"
color="primary"
size="medium"
/>
</SistentThemeProvider>
</Row>
<h3>Secondary Button</h3>
<p>
This is also used for important actions on a page, however, they mostly
used as a supporting action for a primary button in order to provide
options for users to select from. For instance, if the primary button
offers the key action to be taken on a page, the secondary button offers
a way to postpone that action or chose another which might either be of
equal or lower importance than the option which the primary button
highlights. The outlined button serves as the secondary button
</p>
<Row Hcenter className="image-container">
<SistentThemeProvider>
<Button
variant="outlined"
label="Secondary"
color="secondary"
size="medium"
/>
</SistentThemeProvider>
</Row>
<h3>Tertiary Button</h3>
<p>
The tertiary button is used for subtle actions that do not have the most
prominence in a given array of options for users to select from. They
can stand alone or be paired with a primary button to offer an option of
much less importance than the key action intended to be taken by the
user. The text button serves as the tertiary button.
</p>
<Row Hcenter className="image-container">
<SistentThemeProvider>
<Button variant="text" label="Tertiary" size="medium" />
</SistentThemeProvider>
</Row>
<h3>CTA (Call to Action) button</h3>
<p>
This button is used to point the user not necessarily in the direction
of their current flow, but possibly to an offering, feature, or product
that could be potentially useful in providing much needed solutions that
users desire which can be either new or already existing ones. They
usually stand out from the other button categories so for easy
identification and additional styling can be added to them to achieve
this necessary distinction.
</p>
<Row Hcenter className="image-container">
<SistentThemeProvider>
<Button color="warning" label="Call to Action" size="medium" />
</SistentThemeProvider>
</Row>
<h3>Danger Button</h3>
<p>
Danger buttons are used primarily to indicate crucial events. The key
role that they serve is to point out to the user that an irreversible
action is about to take place and as such confirmation is required in
order to proceed.
</p>
<Row Hcenter className="image-container">
<SistentThemeProvider>
<Button color="error" label="Danger" size="medium" />
</SistentThemeProvider>
</Row>

<a id="Labeling">
<h2>Labeling</h2>
</a>
<p>
While the styling of a button gives quick indicators as to how it is to
be used and what action it helps to complete, the key element that helps
to provide a complete scope of the purpose of a button is the text label
it contains. As such, button content should be concise and have as much
description as possible to inform users of what the next step is.
</p>
<h3>Case style</h3>
<p>
Different case styles can be applied to buttons to serve as readable
text that convey information. However, a rule of thumb is that all
buttons follow one specific case style to enhance consistency and reduce
distractions for the user. For all of our buttons, title case has been
used as text labels.
</p>
<h3>Font Weight</h3>
<p>
Font weight can be used to good effect to provide proper emphasis to
buttons as they convey the needed information. Chosen fonts should be
legible with clear and readable characters that do not distract or cause
difficulty while being read. Proper exploration should be carried out
with the intended typeface to ensure it passes muster before proceeding
to use it across all buttons.
</p>
<h3>Content</h3>
<p>
Characters in a button should not be full sentences. Instead, words or
phrases that summarize the purpose of a button could suffice. Total text
in a button is recommended to be an average of 20 characters long, The
language used in buttons should also be consistent. For instance, if a
button has a text label of 'Create Design', this convention should be
maintained and not changed to something like 'New Design' later on.
</p>
</div>
);
};
89 changes: 89 additions & 0 deletions src/sections/Projects/Sistent/components/button/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import React, { useState } from "react";
import SistentWrapper from "../../sistent.style";
import TOC from "../../../../../components/SistentNavigation";
import { Container } from "../../../../../reusecore/Layout";
import SistentPagination from "../../../../../components/SistentNavigation/pagination";
import TabButton from "../../../../../reusecore/Button";
import IntraPage from "../../../../../components/handbook-navigation/intra-page";

import { ButtonOverview } from "./overview";
import { ButtonGuidance } from "./guidance";
import { ButtonCode } from "./code";

const overviewContents = [
{ id: 0, link: "#Types", text: "Types" },
{ id: 1, link: "#Sizes", text: "Sizes" },
{ id: 2, link: "#Adding Icons", text: "Adding Icons" },
];

const guidanceContents = [
{ id: 0, link: "#Tonal Palettes", text: "Tonal Palettes" },
{ id: 1, link: "#Basic Colors", text: "Basic Colors" },
{ id: 2, link: "#Token Specification", text: "Token Specification" },
];

const codeContents = [
{ id: 0, link: "#Primitive Category", text: "Primitive Category" },
{ id: 1, link: "#Semantic Category", text: "Semantic Category" },
];

const SistentButton = () => {
const [activeTab, setActiveTab] = useState("overview");

const contents = () => {
if (activeTab === "overview") {
return overviewContents;
} else if (activeTab === "guidance") {
return guidanceContents;
} else if (activeTab === "code") {
return codeContents;
}
};

return (
<SistentWrapper>
<div className="page-header-section">
<h1>Button</h1>
</div>
<TOC />
<div className="page-section">
<Container>
<div className="content">
<a id="Identity">
<h2>Button</h2>
</a>
<p>
Colors when accurately applied can be a potent tool that enables
designers and developers to implement solutions with speed and
efficiency. Here are a couple of things to keep in mind.
</p>
<div className="filterBtns">
<TabButton
className={activeTab == "overview" ? "active" : ""}
onClick={() => setActiveTab("overview")}
title="Overview"
/>
<TabButton
className={activeTab == "guidance" ? "active" : ""}
onClick={() => setActiveTab("guidance")}
title="Guidance"
/>
<TabButton
className={activeTab == "code" ? "active" : ""}
onClick={() => setActiveTab("code")}
title="Code"
/>
</div>
{activeTab === "overview" && <ButtonOverview />}
{activeTab === "guidance" && <ButtonGuidance />}
{activeTab === "code" && <ButtonCode />}
</div>
<SistentPagination />
</Container>
<IntraPage contents={contents()} />
</div>
</SistentWrapper>
);
};

export default SistentButton;
Loading

0 comments on commit 0618dae

Please sign in to comment.