From b6942606670429f6f496a6279fda70ff409a8e2c Mon Sep 17 00:00:00 2001 From: lakshya Date: Thu, 7 Mar 2024 15:07:19 +0530 Subject: [PATCH] button component page complete Signed-off-by: lakshya --- .../Sistent/components/button/code-block.js | 23 ++++ .../Sistent/components/button/code.js | 120 +++++++++++++++++- .../Sistent/components/button/index.js | 10 +- .../Projects/Sistent/sistent.style.js | 27 ++++ 4 files changed, 174 insertions(+), 6 deletions(-) create mode 100644 src/sections/Projects/Sistent/components/button/code-block.js diff --git a/src/sections/Projects/Sistent/components/button/code-block.js b/src/sections/Projects/Sistent/components/button/code-block.js new file mode 100644 index 000000000000..6851f07e56b9 --- /dev/null +++ b/src/sections/Projects/Sistent/components/button/code-block.js @@ -0,0 +1,23 @@ +import React, { useState } from "react"; + +export const CodeBlock = ({ name, code }) => { + const [showCode, setShowCode] = useState(false); + + const onChange = () => { + setShowCode((prev) => !prev); + }; + + return ( +
+ + + {showCode && ( +
+          {code}
+        
+ )} +
+ ); +}; diff --git a/src/sections/Projects/Sistent/components/button/code.js b/src/sections/Projects/Sistent/components/button/code.js index e662d7f2a90e..6b37e25a0d04 100644 --- a/src/sections/Projects/Sistent/components/button/code.js +++ b/src/sections/Projects/Sistent/components/button/code.js @@ -1,5 +1,123 @@ import React from "react"; +import { Button, SistentThemeProvider } from "@layer5/sistent"; +import { CodeBlock } from "./code-block"; +import { FaArrowRight } from "@react-icons/all-files/fa/FaArrowRight"; + +const codes = [ + ` + + `, + ` + + `, + ` + + `, + ` + + + `, + ` + + `, +]; export const ButtonCode = () => { - return
ButtonCode
; + return ( +
+

+ Buttons communicate actions to users and they can be placed at several + places throughout the user interface. +

+ +

Basic Button

+
+

The button comes in three types: Filled, Outlined, and Text.

+

Filled Button

+

+ Mostly used for high-emphasis actions and are primarily distinguished by + their fill. They are used to represent actions that are primary to the + solution. +

+
+
+ + + +
+ +
+

Outlined Button

+

Can be used for both medium and sometimes high-emphasis actions.

+
+
+ + + +
+ +
+

Text Button

+

+ Mostly used for less pronounced and very low emphasis actions. Can also + be used for text links as well. +

+
+
+ + + +
+ +
+ +

Sizes

+
+

+ For now, two different sizes of buttons exist: 56px height and 48px + height. +

+
+
+ + + + +
+ +
+ +

Adding Icons

+
+

+ Icons are mostly added to filled and outlined buttons and they are used + to better describe the information being passed across by the button’s + label. +

+
+
+ + + +
+ +
+
+ ); }; diff --git a/src/sections/Projects/Sistent/components/button/index.js b/src/sections/Projects/Sistent/components/button/index.js index a4921f21eed0..2eedbcf98bf4 100644 --- a/src/sections/Projects/Sistent/components/button/index.js +++ b/src/sections/Projects/Sistent/components/button/index.js @@ -17,14 +17,14 @@ const overviewContents = [ ]; 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" }, + { id: 0, link: "#Function", text: "Function" }, + { id: 1, link: "#Labeling", text: "Labeling" }, ]; const codeContents = [ - { id: 0, link: "#Primitive Category", text: "Primitive Category" }, - { id: 1, link: "#Semantic Category", text: "Semantic Category" }, + { id: 0, link: "#Basic Button", text: "Basic Button" }, + { id: 1, link: "#Sizes", text: "Sizes" }, + { id: 1, link: "#Adding Icons", text: "Adding Icons" }, ]; const SistentButton = () => { diff --git a/src/sections/Projects/Sistent/sistent.style.js b/src/sections/Projects/Sistent/sistent.style.js index f38acf50936a..1abc1da40112 100644 --- a/src/sections/Projects/Sistent/sistent.style.js +++ b/src/sections/Projects/Sistent/sistent.style.js @@ -303,6 +303,7 @@ const SistentWrapper = styled.div` .page-section { margin-top: -2rem; margin-left: 0rem; + padding: 1rem 1rem; } table { margin-left: -1.5rem; @@ -790,6 +791,32 @@ const SistentWrapper = styled.div` width: 20px; } } + + .showcase { + border: 1px solid ${(props) => props.theme.whiteToGreyE6E6E6}; + margin: 0.8rem 0 2.5rem 0; + border-radius: 10px; + .items { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + padding: 5rem; + } + + .show-code { + border-top: 1px solid ${(props) => props.theme.whiteToGreyE6E6E6}; + padding: 0.7rem 1rem; + } + + .code { + font-size: 0.9rem; + } + + .size-button { + margin-right: 1rem; + } + } `; export default SistentWrapper;