diff --git a/src/sections/Projects/Sistent/components/select/guidance.js b/src/sections/Projects/Sistent/components/select/guidance.js new file mode 100644 index 000000000000..763c841dd183 --- /dev/null +++ b/src/sections/Projects/Sistent/components/select/guidance.js @@ -0,0 +1,241 @@ +import React from "react"; +import { Row } from "../../../../../reusecore/Layout"; +import { SistentThemeProvider } from "@layer5/sistent"; +import { SistentLayout } from "../../sistent-layout"; +import { + FormHelperText, + FormControl, + InputLabel, + Select, + MenuItem, + Grid, + ListSubheader, + OutlinedInput, +} from "@mui/material"; +import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; +import SectionNav from "./section-nav"; +import Header from "./header"; +const SelectGuidance = () => { + const { isDark } = useStyledDarkMode(); + const [selectedAge, setSelectedAge] = React.useState(""); + const [multipleAges, setMultipleAges] = React.useState([]); + const handleMultiplSelect = (event) => { + let agesList = event.target.value; + setMultipleAges(agesList); + }; + return ( + +
+
+ +
+ +

Behavior

+
+

+ 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. +

+ + + + Age + + + + + +

Customization

+
+

+ 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. +

+ + + + Age + + + + + +

Multiple select

+
+

+ 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. +

+ + + + Age + + + + +
+
+
+ ); +}; + +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 = () => { - -

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 - - -

Sizes

@@ -247,15 +196,10 @@ const SistentSelect = () => {

Multiple select

-

- 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.

- + Age