diff --git a/src/components/SistentNavigation/content.js b/src/components/SistentNavigation/content.js index c07348e186b49..19a41b3b932d2 100644 --- a/src/components/SistentNavigation/content.js +++ b/src/components/SistentNavigation/content.js @@ -61,81 +61,85 @@ export const content = [ { id: 44, link: "/projects/sistent/components/dialog/guidance", text: "Dialog" }, { id: 45, link: "/projects/sistent/components/dialog/code", text: "Dialog" }, - { id: 46, link: "/projects/sistent/components/formcontrollabel", text: "FormControlLabel" }, - { id: 47, link: "/projects/sistent/components/formcontrollabel/guidance", text: "FormControlLabel" }, - { id: 48, link: "/projects/sistent/components/formcontrollabel/code", text: "FormControlLabel" }, + { id: 46, link: "/projects/sistent/components/divider", text: "Divider" }, + { id: 47, link: "/projects/sistent/components/divider/guidance", text: "Divider" }, + { id: 48, link: "/projects/sistent/components/divider/code", text: "Divider" }, - { id: 49, link: "/projects/sistent/components/grid", text: "Grid" }, - { id: 50, link: "/projects/sistent/components/grid/guidance", text: "Grid" }, - { id: 51, link: "/projects/sistent/components/grid/code", text: "Grid" }, + { id: 49, link: "/projects/sistent/components/formcontrollabel", text: "FormControlLabel" }, + { id: 50, link: "/projects/sistent/components/formcontrollabel/guidance", text: "FormControlLabel" }, + { id: 51, link: "/projects/sistent/components/formcontrollabel/code", text: "FormControlLabel" }, - { id: 52, link: "/projects/sistent/components/iconbutton", text: "IconButton" }, - { id: 53, link: "/projects/sistent/components/iconbutton/guidance", text: "IconButton" }, - { id: 54, link: "/projects/sistent/components/iconbutton/code", text: "IconButton" }, + { id: 52, link: "/projects/sistent/components/grid", text: "Grid" }, + { id: 53, link: "/projects/sistent/components/grid/guidance", text: "Grid" }, + { id: 54, link: "/projects/sistent/components/grid/code", text: "Grid" }, - { id: 55, link: "/projects/sistent/components/icons", text: "Icons" }, + { id: 55, link: "/projects/sistent/components/iconbutton", text: "IconButton" }, + { id: 56, link: "/projects/sistent/components/iconbutton/guidance", text: "IconButton" }, + { id: 57, link: "/projects/sistent/components/iconbutton/code", text: "IconButton" }, - { id: 56, link: "/projects/sistent/components/link", text: "Link" }, - { id: 57, link: "/projects/sistent/components/link/guidance", text: "Link" }, - { id: 58, link: "/projects/sistent/components/link/code", text: "Link" }, + { id: 58, link: "/projects/sistent/components/icons", text: "Icons" }, - { id: 59, link: "/projects/sistent/components/list", text: "List" }, - { id: 60, link: "/projects/sistent/components/list/guidance", text: "List" }, - { id: 61, link: "/projects/sistent/components/list/code", text: "List" }, + { id: 59, link: "/projects/sistent/components/link", text: "Link" }, + { id: 60, link: "/projects/sistent/components/link/guidance", text: "Link" }, + { id: 61, link: "/projects/sistent/components/link/code", text: "Link" }, - { id: 62, link: "/projects/sistent/components/modal", text: "Modal" }, - { id: 63, link: "/projects/sistent/components/modal/guidance", text: "Modal" }, - { id: 64, link: "/projects/sistent/components/modal/code", text: "Modal" }, + { id: 62, link: "/projects/sistent/components/list", text: "List" }, + { id: 63, link: "/projects/sistent/components/list/guidance", text: "List" }, + { id: 64, link: "/projects/sistent/components/list/code", text: "List" }, - { id: 65, link: "/projects/sistent/components/pagination", text: "Pagination" }, - { id: 66, link: "/projects/sistent/components/pagination/guidance", text: "Pagination" }, - { id: 67, link: "/projects/sistent/components/pagination/code", text: "Pagination" }, + { id: 65, link: "/projects/sistent/components/modal", text: "Modal" }, + { id: 66, link: "/projects/sistent/components/modal/guidance", text: "Modal" }, + { id: 67, link: "/projects/sistent/components/modal/code", text: "Modal" }, - { id: 68, link: "/projects/sistent/components/paper", text: "Paper" }, - { id: 69, link: "/projects/sistent/components/paper/guidance", text: "Paper" }, - { id: 70, link: "/projects/sistent/components/paper/code", text: "Paper" }, + { id: 68, link: "/projects/sistent/components/pagination", text: "Pagination" }, + { id: 69, link: "/projects/sistent/components/pagination/guidance", text: "Pagination" }, + { id: 70, link: "/projects/sistent/components/pagination/code", text: "Pagination" }, - { id: 71, link: "/projects/sistent/components/popper", text: "Popper" }, - { id: 72, link: "/projects/sistent/components/popper/guidance", text: "Popper" }, - { id: 73, link: "/projects/sistent/components/popper/code", text: "Popper" }, + { id: 71, link: "/projects/sistent/components/paper", text: "Paper" }, + { id: 72, link: "/projects/sistent/components/paper/guidance", text: "Paper" }, + { id: 73, link: "/projects/sistent/components/paper/code", text: "Paper" }, - { id: 74, link: "/projects/sistent/components/radiogroup", text: "RadioGroup" }, - { id: 75, link: "/projects/sistent/components/radiogroup/guidance", text: "RadioGroup" }, - { id: 76, link: "/projects/sistent/components/radiogroup/code", text: "RadioGroup" }, + { id: 74, link: "/projects/sistent/components/popper", text: "Popper" }, + { id: 75, link: "/projects/sistent/components/popper/guidance", text: "Popper" }, + { id: 76, link: "/projects/sistent/components/popper/code", text: "Popper" }, - { id: 77, link: "/projects/sistent/components/select", text: "Select" }, - { id: 78, link: "/projects/sistent/components/select/guidance", text: "Select" }, - { id: 79, link: "/projects/sistent/components/select/code", text: "Select" }, + { id: 77, link: "/projects/sistent/components/radiogroup", text: "RadioGroup" }, + { id: 78, link: "/projects/sistent/components/radiogroup/guidance", text: "RadioGroup" }, + { id: 79, link: "/projects/sistent/components/radiogroup/code", text: "RadioGroup" }, - { id: 80, link: "/projects/sistent/components/stack", text: "Stack" }, - { id: 81, link: "/projects/sistent/components/stack/guidance", text: "Stack" }, - { id: 82, link: "/projects/sistent/components/stack/code", text: "Stack" }, + { id: 80, link: "/projects/sistent/components/select", text: "Select" }, + { id: 81, link: "/projects/sistent/components/select/guidance", text: "Select" }, + { id: 82, link: "/projects/sistent/components/select/code", text: "Select" }, - { id: 83, link: "/projects/sistent/components/stepper", text: "Stepper" }, - { id: 84, link: "/projects/sistent/components/stepper/guidance", text: "Stepper" }, - { id: 85, link: "/projects/sistent/components/stepper/code", text: "Stepper" }, + { id: 83, link: "/projects/sistent/components/stack", text: "Stack" }, + { id: 84, link: "/projects/sistent/components/stack/guidance", text: "Stack" }, + { id: 85, link: "/projects/sistent/components/stack/code", text: "Stack" }, - { id: 86, link: "/projects/sistent/components/switch", text: "Switch" }, - { id: 87, link: "/projects/sistent/components/switch/guidance", text: "Switch" }, - { id: 88, link: "/projects/sistent/components/switch/code", text: "Switch" }, + { id: 86, link: "/projects/sistent/components/stepper", text: "Stepper" }, + { id: 87, link: "/projects/sistent/components/stepper/guidance", text: "Stepper" }, + { id: 88, link: "/projects/sistent/components/stepper/code", text: "Stepper" }, - { id: 89, link: "/projects/sistent/components/tabs", text: "Tabs" }, - { id: 90, link: "/projects/sistent/components/tabs/guidance", text: "Tabs" }, - { id: 91, link: "/projects/sistent/components/tabs/code", text: "Tabs" }, + { id: 89, link: "/projects/sistent/components/switch", text: "Switch" }, + { id: 90, link: "/projects/sistent/components/switch/guidance", text: "Switch" }, + { id: 91, link: "/projects/sistent/components/switch/code", text: "Switch" }, - { id: 92, link: "/projects/sistent/components/text-field", text: "Text Field" }, - { id: 93, link: "/projects/sistent/components/text-field/guidance", text: "Text Field" }, - { id: 94, link: "/projects/sistent/components/text-field/code", text: "Text Field" }, + { id: 92, link: "/projects/sistent/components/tabs", text: "Tabs" }, + { id: 93, link: "/projects/sistent/components/tabs/guidance", text: "Tabs" }, + { id: 94, link: "/projects/sistent/components/tabs/code", text: "Tabs" }, - { id: 95, link: "/projects/sistent/components/text-input", text: "Text Input" }, - { id: 96, link: "/projects/sistent/components/text-input/guidance", text: "Text Input" }, - { id: 97, link: "/projects/sistent/components/text-input/code", text: "Text Input" }, + { id: 95, link: "/projects/sistent/components/text-field", text: "Text Field" }, + { id: 96, link: "/projects/sistent/components/text-field/guidance", text: "Text Field" }, + { id: 97, link: "/projects/sistent/components/text-field/code", text: "Text Field" }, - { id: 98, link: "/projects/sistent/components/toolbar", text: "Toolbar" }, - { id: 99, link: "/projects/sistent/components/toolbar/guidance", text: "Toolbar" }, - { id: 100, link: "/projects/sistent/components/toolbar/code", text: "Toolbar" }, + { id: 98, link: "/projects/sistent/components/text-input", text: "Text Input" }, + { id: 99, link: "/projects/sistent/components/text-input/guidance", text: "Text Input" }, + { id: 100, link: "/projects/sistent/components/text-input/code", text: "Text Input" }, - { id: 101, link: "/projects/sistent/components/tooltip", text: "Tooltip" }, - { id: 102, link: "/projects/sistent/components/tooltip/guidance", text: "Tooltip" }, - { id: 103, link: "/projects/sistent/components/tooltip/code", text: "Tooltip" }, + { id: 101, link: "/projects/sistent/components/toolbar", text: "Toolbar" }, + { id: 102, link: "/projects/sistent/components/toolbar/guidance", text: "Toolbar" }, + { id: 103, link: "/projects/sistent/components/toolbar/code", text: "Toolbar" }, + + { id: 104, link: "/projects/sistent/components/tooltip", text: "Tooltip" }, + { id: 105, link: "/projects/sistent/components/tooltip/guidance", text: "Tooltip" }, + { id: 106, link: "/projects/sistent/components/tooltip/code", text: "Tooltip" }, ]; \ No newline at end of file diff --git a/src/sections/Projects/Sistent/components/content.js b/src/sections/Projects/Sistent/components/content.js index 8860957d2c0f3..fc1ae2e5a7f08 100644 --- a/src/sections/Projects/Sistent/components/content.js +++ b/src/sections/Projects/Sistent/components/content.js @@ -258,6 +258,14 @@ const componentsData = [ url: "/projects/sistent/components/accordion", src: "/accordion", }, + { + id: 34, + name: "Divider", + description: + "The Divider component visually separates content with a thin line, helping to organize sections and improve scannability in lists and layouts.", + url: "/projects/sistent/components/divider", + src: "/divider", + }, ]; module.exports = { componentsData }; diff --git a/src/sections/Projects/Sistent/components/divider/code.js b/src/sections/Projects/Sistent/components/divider/code.js new file mode 100644 index 0000000000000..2dc108cd228a6 --- /dev/null +++ b/src/sections/Projects/Sistent/components/divider/code.js @@ -0,0 +1,288 @@ +import React from "react"; +import { navigate } from "gatsby"; +import { useLocation } from "@reach/router"; +import TabButton from "../../../../../reusecore/Button"; +import { SistentLayout } from "../../sistent-layout"; +import { SistentThemeProvider, Divider, Box, List, ListItem, ListItemText, Chip, Stack } from "@sistent/sistent"; +import { CodeBlock } from "../button/code-block"; +import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; + +const codes = [ + ` + + + +`, + ` + + + + + +`, + ` + + Left + + Center + + Right + +`, + ` + + CENTER + LEFT + RIGHT + + + + +`, + ` + + + + + + + + + + + + + +`, + ` + + Section 1 + + Section 2 + + Section 3 + +`, + ` + + Bold + Italic + + Left + Center + Right + +`, +]; + +const DividerCode = () => { + const location = useLocation(); + const { isDark } = useStyledDarkMode(); + + return ( + +
+ +

Divider

+
+

+ The Divider component renders a thin line that separates content within lists, layouts, and sections, providing a subtle way to reinforce visual hierarchy. +

+
+ navigate("/projects/sistent/components/divider")} + title="Overview" + /> + + navigate("/projects/sistent/components/divider/guidance") + } + title="Guidance" + /> + navigate("/projects/sistent/components/divider/code")} + title="Code" + /> +
+
+

+ The Divider component is a thin, subtle line for separating content in your interface. +

+ + +

Basic Divider

+
+

+ By default, the Divider renders as a full-width horizontal line. +

+
+
+ + + + + +
+ +
+ + +

Variants

+
+

+ The Divider supports three variants: fullWidth (default), inset, and middle. +

+
+
+ + + Full Width: + + Inset: + + Middle: + + + +
+ +
+ + +

Vertical Divider

+
+

+ Use orientation="vertical" to render a vertical divider. The flexItem prop ensures proper height in flex containers. +

+
+
+ + + Left + + Center + + Right + + +
+ +
+ + +

Divider with Text

+
+

+ You can render text or other elements within the divider using children. Use textAlign to control alignment. +

+
+
+ + + CENTER + + LEFT + + RIGHT + + + + + + +
+ +
+ + +

List Divider

+
+

+ When using dividers in lists, set component="li" to ensure valid HTML structure. +

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + +

Section Separators

+
+

+ Use dividers to separate distinct sections in a layout, combined with proper spacing. +

+
+
+ + + Section 1 + + Section 2 + + Section 3 + + +
+ +
+ + +

Icon Grouping

+
+

+ Use vertical dividers with the middle variant to group related actions in toolbars. +

+
+
+ + + Bold + Italic + + Left + Center + Right + + +
+ +
+
+
+
+ ); +}; + +export default DividerCode; diff --git a/src/sections/Projects/Sistent/components/divider/guidance.js b/src/sections/Projects/Sistent/components/divider/guidance.js new file mode 100644 index 0000000000000..b252ea5ad739e --- /dev/null +++ b/src/sections/Projects/Sistent/components/divider/guidance.js @@ -0,0 +1,168 @@ +import React from "react"; +import { navigate } from "gatsby"; +import { useLocation } from "@reach/router"; +import TabButton from "../../../../../reusecore/Button"; +import { SistentLayout } from "../../sistent-layout"; +import { SistentThemeProvider, Divider, Box, Stack } from "@sistent/sistent"; +import { Row } from "../../../../../reusecore/Layout"; +import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; + +const DividerGuidance = () => { + const location = useLocation(); + const { isDark } = useStyledDarkMode(); + + return ( + +
+ +

Divider

+
+

+ The Divider component renders a thin line that separates content within lists, layouts, and sections, providing a subtle way to reinforce visual hierarchy and improve scannability. +

+
+ navigate("/projects/sistent/components/divider")} + title="Overview" + /> + + navigate("/projects/sistent/components/divider/guidance") + } + title="Guidance" + /> + navigate("/projects/sistent/components/divider/code")} + title="Code" + /> +
+
+ +

Best Practices

+
+ +

When to Use

+

+ Dividers work best when separating distinct groups of content in lists, menus, or sections. They help users scan and understand the structure of complex interfaces. +

+ + + + Section 1 + + Section 2 + + Section 3 + + + + +

Use Sparingly

+

+ Avoid overusing dividers. Too many lines can create visual clutter. Consider using whitespace, different background colors, or typography to create separation instead. +

+ +

Vertical Dividers for Toolbars

+

+ Use vertical dividers to separate groups of actions in toolbars or icon groups. The flexItem prop ensures proper height alignment. +

+ + + + Action A + Action B + + Action C + Action D + + + + + +

Accessibility

+
+

+ By default, Divider renders as an <hr> element with an implicit ARIA role of separator. Screen readers will announce it as "Horizontal Splitter" (or vertical when using orientation="vertical"). +

+ +

Decorative Dividers

+

+ If the divider is purely decorative, add aria-hidden="true" to prevent screen readers from announcing it. +

+ +

Dividers with Content

+

+ When wrapping content like text or chips, set component="div" and role="presentation" to maintain proper semantics. +

+ + +

Common Patterns

+
+ +

List Separators

+

+ When using dividers in lists, set component="li" to ensure valid HTML structure. +

+ +

Section Headers

+

+ Use dividers with text to create subtle section headers: +

+ + + + Personal Information + Content here... + Contact Details + Content here... + + + + +

Responsive Behavior

+

+ Consider how dividers appear on different screen sizes. Vertical dividers in horizontal layouts may need to switch to horizontal dividers on smaller screens. +

+ + +

Do's and Don'ts

+
+ +

Do's

+
    +
  • Use dividers to separate distinct groups of related content
  • +
  • Combine with appropriate spacing for better visual rhythm
  • +
  • Use variant="middle" or variant="inset" to reduce visual weight
  • +
  • Set proper ARIA attributes for accessibility
  • +
+ +

Don'ts

+
    +
  • Use dividers as the only method of creating separation
  • +
  • Overuse dividers—they can create visual noise
  • +
  • Rely on dividers to convey interactive functionality
  • +
  • Use dividers for decorative purposes without hiding them from screen readers
  • +
+
+
+
+ ); +}; + +export default DividerGuidance; diff --git a/src/sections/Projects/Sistent/components/divider/index.js b/src/sections/Projects/Sistent/components/divider/index.js new file mode 100644 index 0000000000000..965ece93cbdd3 --- /dev/null +++ b/src/sections/Projects/Sistent/components/divider/index.js @@ -0,0 +1,168 @@ +import React from "react"; +import { navigate } from "gatsby"; +import { useLocation } from "@reach/router"; + +import { Divider, SistentThemeProvider, Box, List, ListItem, ListItemText, Chip } from "@sistent/sistent"; +import TabButton from "../../../../../reusecore/Button"; +import { SistentLayout } from "../../sistent-layout"; +import { Row } from "../../../../../reusecore/Layout"; +import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; + +const SistentDivider = () => { + const location = useLocation(); + const { isDark } = useStyledDarkMode(); + + return ( + +
+ +

Divider

+
+

+ The Divider component renders a thin line that separates content within lists, layouts, and sections, providing a subtle way to reinforce visual hierarchy and improve scannability. +

+
+ navigate("/projects/sistent/components/divider")} + title="Overview" + /> + + navigate("/projects/sistent/components/divider/guidance") + } + title="Guidance" + /> + navigate("/projects/sistent/components/divider/code")} + title="Code" + /> +
+
+

+ Dividers help organize content and improve scannability by separating groups of related elements. Use them sparingly to maintain visual clarity without creating unnecessary noise. +

+ +

Variants

+
+

+ The Divider component supports three variants: fullWidth (default), inset, and middle. +

+

Full Width

+

+ The default variant spans the full width of its container. +

+ + + + + + + + +

Inset

+

+ The inset variant adds left padding, useful when aligning with indented list items. +

+ + + + + + + + +

Middle

+

+ The middle variant shortens the divider on both sides. +

+ + + + + + + + + +

Orientation

+
+

+ Use the orientation prop to render vertical dividers. Vertical dividers are useful for separating items in toolbars or button groups. +

+ + + + Left + + Center + + Right + + + + + +

Divider with Text

+
+

+ You can center an element between divider lines using children. Use the textAlign prop to align the content. +

+ + + + CENTER + LEFT + RIGHT + + + + + + + + +

List Divider

+
+

+ When using the Divider to separate items in a list, render it as an <li> using the component prop. +

+ + + + + + + + + + + + + + + + + +
+
+
+ ); +}; + +export default SistentDivider;