From 55ad3c15f5b5f2a93e6ef8a0b05f137ccdd400f5 Mon Sep 17 00:00:00 2001
From: nganphan123
Date: Sat, 21 Dec 2024 02:36:42 -0800
Subject: [PATCH 1/9] add select route
Signed-off-by: nganphan123
---
.../Projects/Sistent/components/content.js | 33 +++++++++++--------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/src/sections/Projects/Sistent/components/content.js b/src/sections/Projects/Sistent/components/content.js
index 388e34486f06..8e88c73a4805 100644
--- a/src/sections/Projects/Sistent/components/content.js
+++ b/src/sections/Projects/Sistent/components/content.js
@@ -3,7 +3,7 @@ const componentsData = [
id: 1,
name: "Button",
description:
- "A button is an interactive element that triggers a specific action and also lets users know what will happen next.",
+ "A button is an interactive element that triggers a specific action and also lets users know what will happen next.",
url: "/projects/sistent/components/button",
src: "/button",
},
@@ -11,7 +11,7 @@ const componentsData = [
id: 2,
name: "Text Input",
description:
- "A text input is made up of multiple elements that combine to form a component that helps users to read, write, and edit text in an interface.",
+ "A text input is made up of multiple elements that combine to form a component that helps users to read, write, and edit text in an interface.",
url: "/projects/sistent/components/text-input",
src: "/text-input",
},
@@ -19,7 +19,7 @@ const componentsData = [
id: 3,
name: "Modal",
description:
- "A text input is made up of multiple elements that combine to form a component that helps users to read, write, and edit text in an interface.",
+ "A text input is made up of multiple elements that combine to form a component that helps users to read, write, and edit text in an interface.",
url: "/projects/sistent/components/modal",
src: "/modal",
},
@@ -27,7 +27,7 @@ const componentsData = [
id: 4,
name: "Paper",
description:
- "The Paper component offers an elevated surface with shadow effects, following Material Design’s elevation system.",
+ "The Paper component offers an elevated surface with shadow effects, following Material Design’s elevation system.",
url: "/projects/sistent/components/paper",
src: "/paper",
},
@@ -35,7 +35,7 @@ const componentsData = [
id: 5,
name: "Popper",
description:
- "A popper is a tooltip that appears when a user interacts with an element.",
+ "A popper is a tooltip that appears when a user interacts with an element.",
url: "/projects/sistent/components/popper",
src: "/popper",
},
@@ -43,7 +43,7 @@ const componentsData = [
id: 6,
name: "Text Field",
description:
- "The TextField component is a versatile input field used to capture user input in forms and user interfaces.",
+ "The TextField component is a versatile input field used to capture user input in forms and user interfaces.",
url: "/projects/sistent/components/text-field",
src: "/text-field",
},
@@ -51,7 +51,7 @@ const componentsData = [
id: 7,
name: "Link",
description:
- "Links are essential and integral components of an interface. They are primarily used for navigation, guiding users to the next step in a journey or redirecting them to relevant sections or pages.",
+ "Links are essential and integral components of an interface. They are primarily used for navigation, guiding users to the next step in a journey or redirecting them to relevant sections or pages.",
url: "/projects/sistent/components/link",
src: "/link",
},
@@ -59,7 +59,7 @@ const componentsData = [
id: 8,
name: "Container",
description:
- "Containers align and center content, providing responsive layout options for different screen sizes.",
+ "Containers align and center content, providing responsive layout options for different screen sizes.",
url: "/projects/sistent/components/container",
src: "/container",
},
@@ -67,7 +67,7 @@ const componentsData = [
id: 9,
name: "ButtonGroup",
description:
- "ButtonGroup is a component that groups multiple buttons together.",
+ "ButtonGroup is a component that groups multiple buttons together.",
url: "/projects/sistent/components/button-group",
src: "/button-group",
},
@@ -75,7 +75,7 @@ const componentsData = [
id: 10,
name: "Box",
description:
- "Box is used as a flexible container for layout and styling, allowing quick customization and responsive design adjustments.",
+ "Box is used as a flexible container for layout and styling, allowing quick customization and responsive design adjustments.",
url: "/projects/sistent/components/box",
src: "/box",
},
@@ -83,7 +83,7 @@ const componentsData = [
id: 11,
name: "Tooltip",
description:
- "The Tooltip component is a small pop-up box that appears when a user hovers over an element.",
+ "The Tooltip component is a small pop-up box that appears when a user hovers over an element.",
url: "/projects/sistent/components/tooltip",
src: "/tooltip",
},
@@ -91,10 +91,17 @@ const componentsData = [
id: 12,
name: "Backdrop",
description:
- "Backdrop component overlays a dimmed screen to focus attention on foreground content.",
+ "Backdrop component overlays a dimmed screen to focus attention on foreground content.",
url: "/projects/sistent/components/backdrop",
src: "/backdrop",
},
+ {
+ id: 13,
+ name: "Select",
+ description: "Select desc",
+ url: "/projects/sistent/components/select",
+ src: "/select",
+ },
];
-module.exports = { componentsData };
\ No newline at end of file
+module.exports = { componentsData };
From 71814266dc5b6de5b108f252cae29f5aebde0e40 Mon Sep 17 00:00:00 2001
From: nganphan123
Date: Thu, 26 Dec 2024 00:12:06 -0800
Subject: [PATCH 2/9] add overview page
Signed-off-by: nganphan123
---
.../Sistent/components/select/index.js | 288 ++++++++++++++++++
1 file changed, 288 insertions(+)
create mode 100644 src/sections/Projects/Sistent/components/select/index.js
diff --git a/src/sections/Projects/Sistent/components/select/index.js b/src/sections/Projects/Sistent/components/select/index.js
new file mode 100644
index 000000000000..d63c01551bfe
--- /dev/null
+++ b/src/sections/Projects/Sistent/components/select/index.js
@@ -0,0 +1,288 @@
+import React from "react";
+import { navigate } from "gatsby";
+import { useLocation } from "@reach/router";
+
+import { SistentThemeProvider, Button } from "@layer5/sistent";
+import TabButton from "../../../../../reusecore/Button";
+import { SistentLayout } from "../../sistent-layout";
+import { Col, Row } from "../../../../../reusecore/Layout";
+import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
+import {
+ Container,
+ FormControl,
+ FormHelperText,
+ Grid,
+ InputLabel,
+ MenuItem,
+ Select,
+} from "@mui/material";
+
+const SistentSelect = () => {
+ const location = useLocation();
+ const { isDark } = useStyledDarkMode();
+
+ return (
+
+
+ The Select component is a versatile and customizable element
+ commonly used in forms and user interfaces. It is designed to
+ present a list of options for users to choose from, either as a
+ single selection or multiple selections. This component plays a
+ vital role in collecting user-provided information efficiently and
+ intuitively.
+
+ To accommodate various design styles and use cases, the select
+ component offers numerous customizable properties. Developers can
+ customize how the component display the labels or selected option to
+ improve user experience.
+
+
Outlined
+
+ The default style is "outlined," featuring a thin line around the
+ selection area. The label appears above the selection, and the
+ dropdown menu is displayed below it.
+
+
+
+
+ Age
+
+
+
+
+
Filled
+
+ Filled select feature a background color fill. Depending on the
+ theme or intended action, the color fill ican range from a primary
+ brand color to any other applicable color in a brand's color
+ palette.
+
+
+
+
+
+ Age
+
+
+
+
+
Standard
+
+ The standard style features a simple underline below the selection
+ area.
+
+ For buttons to be fully effective, they can be adjusted in size to
+ accommodate multiple use cases where they may apply. These size
+ changes are usually done to the height of the buttons and not the
+ width since buttons usually grow to contain their content. The
+ height that makes up the different sizes of our buttons are gotten
+ from our spacing system to retain space consistency. We have chosen
+ two different sizes of buttons to provide options and more sizes can
+ be added to fill the growing needs.
+
+
56px / 3.5rem
+
+ The 56px button is the first button size. It is currently the
+ largest button available for use and it is available for both mobile
+ and desktop resolutions, but it serves in different capacities
+ across these different resolutions.
+
+
+
+
+ Age
+
+
+
+
+
48px / 3rem
+
+ The 48px button is the second button size currently in use and it is
+ available from mobile to desktop resolutions, even though it serves
+ in different capacities across these screen sizes.
+
+
+
+
+
+
+
Full width
+
+ Full width buttons are more efficient in mobile designs and rightly
+ so in order to offer users with a wider touch area since the input
+ devices - the fingers, are a lot larger than the cursor on a desktop
+ or larger screen.
+
+
+
+
+
+
+
+
+
+ NOTE:
+
+
+ These sizes are being specified with numerical values because though
+ the same size is used across screen resolutions, they have different
+ roles. On desktop for instance, the 56px button is a the default
+ size, and 48px the small size, while on mobile, 56px is large and
+ 48px is the default size. Preferred button sizes (height) are
+ usually arrived at through exploration and proper consideration of
+ industry standards and best practices.
+
+ Sometimes, icons are used alongside labels in buttons to pass across
+ specific information or relay added information for a higher level
+ of understanding and better comprehension. Depending on the
+ information being conveyed, the icons can be placed on the left side
+ of the label text or on the right side of the label text. No
+ specific rules apply apart from spacing tips which may be considered
+ here. For full width buttons, if icons must be added, they should be
+ centered in the button alongside the label text.
+
+
+
+
+ );
+};
+
+export default SistentSelect;
From b0fd9cc47a52317b08b51bf5b46d40d6fa05dd4d Mon Sep 17 00:00:00 2001
From: nganphan123
Date: Thu, 26 Dec 2024 16:06:48 -0800
Subject: [PATCH 3/9] add component size
Signed-off-by: nganphan123
---
.../Sistent/components/select/index.js | 110 +++++++++++-------
1 file changed, 67 insertions(+), 43 deletions(-)
diff --git a/src/sections/Projects/Sistent/components/select/index.js b/src/sections/Projects/Sistent/components/select/index.js
index d63c01551bfe..cc8106b305fd 100644
--- a/src/sections/Projects/Sistent/components/select/index.js
+++ b/src/sections/Projects/Sistent/components/select/index.js
@@ -2,10 +2,10 @@ import React from "react";
import { navigate } from "gatsby";
import { useLocation } from "@reach/router";
-import { SistentThemeProvider, Button } from "@layer5/sistent";
+import { SistentThemeProvider } from "@layer5/sistent";
import TabButton from "../../../../../reusecore/Button";
import { SistentLayout } from "../../sistent-layout";
-import { Col, Row } from "../../../../../reusecore/Layout";
+import { Row } from "../../../../../reusecore/Layout";
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
import {
Container,
@@ -196,25 +196,19 @@ const SistentSelect = () => {
Sizes
- For buttons to be fully effective, they can be adjusted in size to
- accommodate multiple use cases where they may apply. These size
- changes are usually done to the height of the buttons and not the
- width since buttons usually grow to contain their content. The
- height that makes up the different sizes of our buttons are gotten
- from our spacing system to retain space consistency. We have chosen
- two different sizes of buttons to provide options and more sizes can
- be added to fill the growing needs.
-
-
56px / 3.5rem
-
- The 56px button is the first button size. It is currently the
- largest button available for use and it is available for both mobile
- and desktop resolutions, but it serves in different capacities
- across these different resolutions.
+ The select component can be adjusted in size to accommodate various
+ use cases. These size adjustments typically affect the height of the
+ component, while the width adjusts to fit the content. The height of
+ the select component is derived from our spacing system to maintain
+ consistency. We offer multiple sizes to meet different needs.
+
Auto width
+ {/*
+ The width of the component can scale
+
*/}
-
+ Age
-
48px / 3rem
-
+
Small
+ {/*
The 48px button is the second button size currently in use and it is
available from mobile to desktop resolutions, even though it serves
in different capacities across these screen sizes.
-
+
*/}
-
+
+ Age
+
+
Full width
-
+ {/*
Full width buttons are more efficient in mobile designs and rightly
so in order to offer users with a wider touch area since the input
devices - the fingers, are a lot larger than the cursor on a desktop
or larger screen.
-
+ */}
-
-
-
-
-
+
+
+ Age
+
+
+
-
+ {/*
NOTE:
@@ -265,20 +281,28 @@ const SistentSelect = () => {
48px is the default size. Preferred button sizes (height) are
usually arrived at through exploration and proper consideration of
industry standards and best practices.
-
- Sometimes, icons are used alongside labels in buttons to pass across
- specific information or relay added information for a higher level
- of understanding and better comprehension. Depending on the
- information being conveyed, the icons can be placed on the left side
- of the label text or on the right side of the label text. No
- specific rules apply apart from spacing tips which may be considered
- here. For full width buttons, if icons must be added, they should be
- centered in the button alongside the label text.
-
+ The width of the component can scale automatically to fit the
+ content it contains. This ensures that the select component is
+ appropriately sized based on the options available, providing a
+ better user experience.
+
- The 48px button is the second button size currently in use and it is
- available from mobile to desktop resolutions, even though it serves
- in different capacities across these screen sizes.
-
*/}
+
+ The small size select component is designed to fit into more compact
+ spaces within a user interface. It is particularly useful when you
+ need to conserve space or when the select component is part of a
+ form with other small-sized elements. This ensures a consistent and
+ visually appealing layout.
+
- Full width buttons are more efficient in mobile designs and rightly
+
+ Full width select are more efficient in mobile designs and rightly
so in order to offer users with a wider touch area since the input
devices - the fingers, are a lot larger than the cursor on a desktop
or larger screen.
-
- These sizes are being specified with numerical values because though
- the same size is used across screen resolutions, they have different
- roles. On desktop for instance, the 56px button is a the default
- size, and 48px the small size, while on mobile, 56px is large and
- 48px is the default size. Preferred button sizes (height) are
- usually arrived at through exploration and proper consideration of
- industry standards and best practices.
-
+ The multiple select component allows users to select more than one
+ option from the dropdown list. This is useful in scenarios where
+ multiple selections are required, such as selecting multiple tags,
+ categories, or items.
+
+ The select component can exhibit different behaviors based on the
+ context and user input. Since it is usually used within a form
+ component, these behaviors can act in response to the user input for
+ other components in the form.
+
+
Disabled
+
+ If the component is disabled, the dropdown menu won't display when
+ user clicks on the selection area. This behavior is useful when the
+ user is not allowed to select any option.
+
+
+
+
+ Age
+
+
+
+
+
Error
+
+ This behavior is used to indicate that the user has made an error or
+ the selection is not compatible with other form components.
+
+
+
+
+ Age
+
+
+
+
+
Required
+
+ If specified, the select component will be required to have an input
+ from the user. An asterisk will be displayed next to the label to
+ let the user know that the input is required.
+
+ Additional props can be added to the select component to customize
+ its label and dropdown menu to provide use with more context of
+ their selection.
+
+
Label and helper text
+
+ The label is optional. If provided, helper text is displayed below
+ the component to give the user more context about the component.
+
+
+
+
+
+ Age
+
+ With label + Helper text
+
+
+
+ Without label
+
+
+
+
Placeholder
+
+ Placeholder can be used to give more context about the selection.
+
+
+
+
+
+
+
+
+
Grouping
+
+ If the selection options are organized into groups, their groups can
+ be displayed within the dropdown menu to assist users in making
+ their selection.
+
+ The multiple select component allows users to select more than one
+ option from the dropdown list. This is useful in scenarios where
+ multiple selections are required, such as selecting multiple tags,
+ categories, or items.
+
+
+ );
+};
+
+export default SelectGuidance;
diff --git a/src/sections/Projects/Sistent/components/select/index.js b/src/sections/Projects/Sistent/components/select/index.js
index e22159e4ad60..68c13842d2a3 100644
--- a/src/sections/Projects/Sistent/components/select/index.js
+++ b/src/sections/Projects/Sistent/components/select/index.js
@@ -1,17 +1,10 @@
import React from "react";
-import { navigate } from "gatsby";
-import { useLocation } from "@reach/router";
-
import { SistentThemeProvider } from "@layer5/sistent";
-import TabButton from "../../../../../reusecore/Button";
import { SistentLayout } from "../../sistent-layout";
import { Row } from "../../../../../reusecore/Layout";
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
import {
- Container,
FormControl,
- FormHelperText,
- Grid,
InputLabel,
MenuItem,
Select,
@@ -21,7 +14,6 @@ import Header from "./header";
import SectionNav from "./section-nav";
const SistentSelect = () => {
- const location = useLocation();
const { isDark } = useStyledDarkMode();
const [multipleAges, setMultipleAges] = React.useState([]);
const handleMultiplSelect = (event) => {
@@ -58,9 +50,9 @@ const SistentSelect = () => {
selection area. The label appears above the selection, and the
dropdown menu is displayed below it.
-
+
-
+ Age
-
+
Filled
Filled select feature a background color fill. Depending on the
@@ -81,9 +73,8 @@ const SistentSelect = () => {
brand color to any other applicable color in a brand's color
palette.
-
-
-
+
+ Age
-
-
+
+
Standard
The standard style features a simple underline below the selection
@@ -121,48 +112,6 @@ const SistentSelect = () => {
-
-
- The multiple select component allows users to select more than one
- option from the dropdown list. This is useful in scenarios where
- multiple selections are required, such as selecting multiple tags,
- categories, or items.
-
+
Multiple select component allows users to select more than one.
+ To add a label to the select component, wrap it inside a FormControl
+ component. Add an InputLabel component and link it to the select
+ component using the labelId prop. Ensure the label prop in the
+ Select component matches the InputLabel text.
+
+
+
+
+
+ Age
+
+
+
+
+
+
+
+
+
+
+
Helper text
+
+
+
+
+
+
+
+
+
+ This is a helper text
+
+
+
+
+
+
Placeholder
+
+ To add a placeholder, use the renderValue prop to display a
+ placeholder text when no value is selected.
+
+ To group selection options, use the ListSubheader component to create
+ headers for each group within the dropdown menu. This helps users to
+ easily navigate and find the options they need.
+
+
+
+
+ Group 1
+
+
+ Group 2
+
+
+ Group 3
+
+
+
+
+
+
+
Additional props such as error, required, and disabled can be passed
to the select component to customize its behavior.
@@ -265,13 +448,30 @@ const ButtonCode = () => {
clarity.
- Placeholder can be used to give more context about the selection.
+ A placeholder is a short hint or description that is displayed
+ inside an input field or select component before the user enters a
+ value. It provides a clue to the user about what kind of information
+ is expected in the field. The placeholder text disappears when the
+ user starts typing or selects an option.
- The select component can exhibit different behaviors based on the
+ The select component can exhibit different state based on the
context and user input. Since it is usually used within a form
- component, these behaviors can act in response to the user input for
+ component, these states can act in response to the user input for
other components in the form.