diff --git a/src/assets/images/avatar-images/avatar.png b/src/assets/images/avatar-images/avatar.png new file mode 100644 index 000000000000..0a7d47cb0bea Binary files /dev/null and b/src/assets/images/avatar-images/avatar.png differ diff --git a/src/assets/images/avatar-images/avatar1.png b/src/assets/images/avatar-images/avatar1.png new file mode 100644 index 000000000000..b6e800c25fc8 Binary files /dev/null and b/src/assets/images/avatar-images/avatar1.png differ diff --git a/src/assets/images/avatar-images/avatar2.png b/src/assets/images/avatar-images/avatar2.png new file mode 100644 index 000000000000..71d63f928693 Binary files /dev/null and b/src/assets/images/avatar-images/avatar2.png differ diff --git a/src/assets/images/avatar-images/icon.webp b/src/assets/images/avatar-images/icon.webp new file mode 100644 index 000000000000..0bc2ac177c10 Binary files /dev/null and b/src/assets/images/avatar-images/icon.webp differ diff --git a/src/pages/projects/sistent/components/avatar/code.js b/src/pages/projects/sistent/components/avatar/code.js new file mode 100644 index 000000000000..b05629a59a3e --- /dev/null +++ b/src/pages/projects/sistent/components/avatar/code.js @@ -0,0 +1,8 @@ +import React from "react"; +import { AvatarCode } from "../../../../../sections/Projects/Sistent/components/avatar/code.js"; + +const AvatarCodePage = () => { + return ; +}; + +export default AvatarCodePage; diff --git a/src/pages/projects/sistent/components/avatar/guidance.js b/src/pages/projects/sistent/components/avatar/guidance.js new file mode 100644 index 000000000000..d57f99a4d55c --- /dev/null +++ b/src/pages/projects/sistent/components/avatar/guidance.js @@ -0,0 +1,8 @@ +import React from "react"; +import { AvatarGuidance } from "../../../../../sections/Projects/Sistent/components/avatar/guidance.js"; + +const AvatarGuidancePage = () => { + return ; +}; + +export default AvatarGuidancePage; diff --git a/src/pages/projects/sistent/components/avatar/index.js b/src/pages/projects/sistent/components/avatar/index.js new file mode 100644 index 000000000000..726ee616285b --- /dev/null +++ b/src/pages/projects/sistent/components/avatar/index.js @@ -0,0 +1,8 @@ +import React from "react"; +import SistentAvatar from "../../../../../sections/Projects/Sistent/components/avatar/index"; + +const SistentAvatarPage = () => { + return ; +}; + +export default SistentAvatarPage; diff --git a/src/sections/Projects/Sistent/components/avatar/code.js b/src/sections/Projects/Sistent/components/avatar/code.js new file mode 100644 index 000000000000..866e5a94c5d3 --- /dev/null +++ b/src/sections/Projects/Sistent/components/avatar/code.js @@ -0,0 +1,399 @@ +import React from "react"; +import { navigate } from "gatsby"; +import { useLocation } from "@reach/router"; +import { SistentThemeProvider, Avatar, AvatarGroup, styled, Badge } from "@layer5/sistent"; +import { CodeBlock } from "../button/code-block"; +import { SistentLayout } from "../../sistent-layout"; +import Image from "../../../../../assets/images/avatar-images/avatar.png"; +import Image1 from "../../../../../assets/images/avatar-images/avatar1.png"; +import Image2 from "../../../../../assets/images/avatar-images/avatar2.png"; +import TabButton from "../../../../../reusecore/Button"; +import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; + +const SmallAvatar = styled(Avatar)(({ theme }) => ({ + width: 22, + height: 22, + border: `2px solid ${theme.palette.background.paper}`, +})); + + +const CustomBadge = ({ children, }) => { + const badgeStyle = { + position: "relative", + display: "inline-block", + }; + + const dotStyle = { + position: "absolute", + bottom: "5%", + right: "5%", + width: "30%", + height: "30%", + backgroundColor: "#44b700", + borderRadius: "50%", + border: "2px solid #fff", + }; + + return ( +
+ {children} + +
+ ); +}; + +const codes = [ +` + +`, + +` + H +`, + +` + +`, + +` + + + + + `, + +` + + + + + + `, + +` + + + + + +`, + ` +import { styled, Badge } from "@layer5/sistent"; + +const CustomBadge = ({ children, smallAvatarSrc }) => { + const badgeStyle = { + position: "relative", + display: "inline-block", + }; + + const smallAvatarStyle = { + position: "absolute", + bottom: "-10%", + right: "-10%", + width: "35%", + height: "35%", + borderRadius: "50%", + border: "2px solid #fff", + overflow: "hidden", + }; + + const dotStyle = { + position: "absolute", + bottom: "5%", + right: "5%", + width: "30%", + height: "30%", + backgroundColor: "#44b700", + borderRadius: "50%", + border: "2px solid #fff", + }; + + return ( +
+ {children} + +
+ ); +}; + + + + + +`, + +` +import { Badge } from "@layer5/sistent"; + +const SmallAvatar = styled(Avatar)(({ theme }) => ({ + width: 22, + height: 22, + border: "2px solid ", +})); + + + + + } + > + + +`, + +` + +`, + +` + +`, + +` + + `, + +` + +`, + +]; + +export const AvatarCode = () => { + const location = useLocation(); + const { isDark } = useStyledDarkMode(); + + return ( + +
+ +

Avatar

+
+

+ An avatar is a visual component used to represent a user or entity, typically through images, text, or icons. It is versatile and can be used in various contexts, like user profiles, chat apps, or contact lists. +

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

+ Avatars serve as visual identifiers in a user interface, enhancing user recognition and engagement. They can be strategically positioned throughout the interface, often representing users, groups, or content sources. By incorporating avatars, applications can create a more personalized and interactive experience, guiding users through actions and interactions in a visually appealing manner. +

+ +

Types Of Avatars

+
+ {/*

If we do not pass anything as children in avatar then a default avatar comes

*/} +

Default Avatars

+

+ If we do not pass anything as children in avatar then a default avatar comes +

+
+
+ + + +
+ +
+

Letter Avatars

+

+ Letter avatars use initials or characters to represent users when images aren't available +

+
+
+ + H + +
+ +
+

Image Avatars

+

+ Image avatars are graphical representations, typically used to display user profiles or identities in applications +

+
+
+ + + +
+ +
+

Variants Avatars

+

+ Variant avatars allow flexibility in shape, often switching between circular, square, or rounded square designs. +

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

Grouped Avatars

+

+ Image avatars are graphical representations, typically used to display user profiles or identities in applications +

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

Total Avatars

+

+ If you need to control the total number of avatars not shown, you can use the total prop. +

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

Avatars with Dot Badge

+

+ A small dot indicates presence or status, enhancing visibility without clutter +

+
+
+ + + + + +
+ +
+

Avatars with Content Badge

+

+ Displays a small avatar or numerical value, providing additional context or information. +

+
+
+ + + } + > + + + +
+ +
+ +

Sizes

+
+

+ Avatars come in various sizes, making them adaptable to different contexts and design needs. The size you choose depends on the layout and user interface. +

+

Small

+

+ Usually 24x24 pixels, ideal for notifications or small UI elements +

+
+
+ + + +
+ +
+

Medium

+

+ Typically 40x40 pixels, commonly used in lists or chat interfaces +

+
+
+ + + +
+ +
+

Large

+

+ Generally 56x56 pixels, suitable for profile displays or main UI components +

+
+
+ + + +
+ +
+

Extra Large

+

+ Often 72x72 pixels or larger, used for profile pages or featured sections +

+
+
+ + + +
+ +
+ +

Adding Icons

+
+

+ Avatars are often used alongside labels to provide added visual cues for users, enhancing communication or reinforcing identity within an interface. Depending on the layout or context, avatars can be placed on the left or right side of the accompanying label +

+
+
+
+ ); +}; diff --git a/src/sections/Projects/Sistent/components/avatar/guidance.js b/src/sections/Projects/Sistent/components/avatar/guidance.js new file mode 100644 index 000000000000..a9d0d72d23cd --- /dev/null +++ b/src/sections/Projects/Sistent/components/avatar/guidance.js @@ -0,0 +1,172 @@ +import React from "react"; +import { navigate } from "gatsby"; +import { useLocation } from "@reach/router"; +import { Row } from "../../../../../reusecore/Layout"; +import { SistentThemeProvider, Avatar, } from "@layer5/sistent"; +import { SistentLayout } from "../../sistent-layout"; +import Image from "../../../../../assets/images/avatar-images/avatar.png"; +import Image1 from "../../../../../assets/images/avatar-images/avatar1.png"; +import Image2 from "../../../../../assets/images/avatar-images/avatar2.png"; +import TabButton from "../../../../../reusecore/Button"; +import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; + + +const CustomBadge = ({ children }) => { + const badgeStyle = { + position: "relative", + display: "inline-block", + }; + + const dotStyle = { + position: "absolute", + bottom: "5%", + right: "5%", + width: "15%", + height: "15%", + backgroundColor: "#44b700", + borderRadius: "50%", + border: "2px solid #fff", + }; + + return ( +
+ {children} + +
+ ); +}; + + +export const AvatarGuidance = () => { + const location = useLocation(); + const { isDark } = useStyledDarkMode(); + + return ( + +
+ +

Avatar

+
+

+ An avatar is a visual component used to represent a user or entity, typically through images, text, or icons. It is versatile and can be used in various contexts, like user profiles, chat apps, or contact lists. +

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

+ For proper application, avatars can be used in various contexts to help visually identify users or elements. They ensure a consistent and recognizable approach when representing entities across digital experiences. By providing immediate visual cues, avatars aid in enhancing user recognition, personalization, and context across different parts of a digital interface. This makes interactions smoother and more intuitive, supporting a cohesive user journey across the platform. +

+ +

Function

+
+

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

+

Primary Avatar

+

+ A primary avatar is the main visual identifier of a user or content. It’s typically used in profiles or lists to provide a recognizable image or symbol that users can associate with a person or entity. +

+ + + + + + +

Supporting Avatar

+

+ Supporting avatars may be used in group contexts, where multiple entities are involved. They act as secondary identifiers, supporting the primary avatar by providing additional context. +

+ + + + + + + + +

Notification Avatar

+

+ A notification avatar is used in alert-based components, offering visual cues related to important messages or changes. These avatars are typically smaller but maintain clarity and association with the user or content. +

+ + + + + + + + + + +

Labeling

+
+

+ The label of an avatar is essential in providing context and clarity. Avatar labels should be concise yet descriptive, giving users a clear understanding of the avatar’s purpose. +

+

Case style

+

+ Consistent case styles across all avatars enhance readability and reduce distractions. Title case or another uniform style should be applied to maintain visual consistency. +

+

Font Weight

+

+ Font weight should ensure legibility and clarity. Use readable fonts that are easy to interpret, without causing distractions or difficulty for users. +

+

Content

+

+ Avatar labels should be short and to the point, typically words or brief phrases that summarize the avatar’s role. Avoid long sentences to maintain clarity and uniformity. +

+ +
+
+
+ ); +}; diff --git a/src/sections/Projects/Sistent/components/avatar/index.js b/src/sections/Projects/Sistent/components/avatar/index.js new file mode 100644 index 000000000000..4136b8a70572 --- /dev/null +++ b/src/sections/Projects/Sistent/components/avatar/index.js @@ -0,0 +1,300 @@ +import React from "react"; +import { navigate } from "gatsby"; +import { useLocation } from "@reach/router"; + +import { SistentThemeProvider, Avatar, AvatarGroup, Badge, styled } 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 Image from "../../../../../assets/images/avatar-images/avatar.png"; +import Image1 from "../../../../../assets/images/avatar-images/avatar1.png"; +import Image2 from "../../../../../assets/images/avatar-images/avatar2.png"; + +// removing merge conflicts + +const SmallAvatar = styled(Avatar)(({ theme }) => ({ + width: 22, + height: 22, + border: `2px solid ${theme.palette.background.paper}`, +})); + +const CustomBadge = ({ children, }) => { + const badgeStyle = { + position: "relative", + display: "inline-block", + }; + + + const dotStyle = { + position: "absolute", + bottom: "5%", + right: "5%", + width: "30%", + height: "30%", + backgroundColor: "#44b700", + borderRadius: "50%", + border: "2px solid #fff", + }; + + return ( +
+ {children} + +
+ ); +}; + + +const SistentAvatar = () => { + const location = useLocation(); + const { isDark } = useStyledDarkMode(); + + return ( + +
+ +

Avatar

+
+

+ An avatar is a visual component used to represent a user or entity, typically through images, text, or icons. It is versatile and can be used in various contexts, like user profiles, chat apps, or contact lists. Avatars come in different sizes and shapes, such as circular or square, and can include badges or group displays. They help create a more personalized interface by visually identifying users or content sources in an application +

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

+ An avatar is a digital representation of a user or entity, commonly found in profiles, messaging apps, or directories. These can be images, initials, or symbols and come in various shapes, like circular or square. Avatars enhance user experience by offering visual cues for personalization and recognition, and may feature badges or group identifiers to create a more engaging interface. +

+ +

Avatar Attributes

+
+

+ Avatar attributes are customizable properties that enhance their appearance and functionality. Key attributes include: +

+
    +
  • src: The URL for an image avatar.
  • +
  • alt: Text displayed when the image fails to load.
  • +
  • sx: Custom styles for color, shape, and size.
  • +
  • children: Used in letter avatars to show initials or characters.
  • +
  • variant: Controls the avatar's shape (circular or square).
  • +
  • sizes: Adjusts avatar size (small, medium, large).
  • +
+

+ These attributes help avatars integrate into various UI designs and enhance personalization. +

+ +

Types

+
+

+ To improve user interaction, image avatars showcase photos or illustrations for easy recognition in social platforms, while letter avatars represent users with initials or characters, ideal when images are unavailable. Both types can feature distinct background colors, enhancing personalization and engagement within applications. This diversity in avatars streamlines navigation and fosters a more engaging user experience +

+

Default Avatars

+

+ If we do not pass anything as children in avatar then a default avatar comes +

+ + + + + +

Letter Avatars

+

+ Letter avatars use initials or characters to represent users when images aren't available. They are simple and can be customized with background colors, enhancing personalization and user recognition within the interface. +

+ + + H + + +

Image Avatars

+

+ Image avatars are graphical representations, typically used to display user profiles or identities in applications. They enhance user recognition and engagement, making interfaces more personalized. +

+ + + + + +

Variants Avatars

+

+ Variant avatars allow flexibility in shape, often switching between circular, square, or rounded square designs. This variation provides adaptability for different design needs and user interfaces. To use a variant avatar, you can pass a variant prop, which typically accepts values like "circle," "square," or "rounded" to define the avatar's shape. +

+ + + + + + + + +

Grouped Avatars

+

+ Grouped avatars show multiple users together, highlighting connections like teams or friends. They can be customized to display a specific number of avatars, making recognition easy within the interface. To create grouped avatars, you pass an array of images or initials, which effectively conveys relationships among users +

+ + + + + + + + + +

Total Avatars

+

+ If you need to control the total number of avatars not shown, you can use the total prop. +

+ + + + + + + + + +

Avatars with Badge

+

+ Avatars with badges enhance user recognition by combining visual identity with additional context, such as notifications or status indicators. Badges can display vital information like unread messages or online presence, making the interface more informative. These elements can be integrated easily, providing users with quick insights while maintaining a clean design. +

+
    +
  • + Dot Badge: A small dot indicates presence or status, enhancing visibility without clutter. + + + + + + + +
  • +
  • + Content Badge: Displays a small avatar or numerical value, providing additional context or information. + + + + } + > + + + + +
  • + +
+

Icon avatars

+

+ Icon avatars represent users or entities through symbols or icons rather than images or text. They are commonly used in apps or dashboards where space is limited, or images aren’t available. Icon avatars provide a sleek, minimalist approach to user representation. +

+ + + + + + + +

Sizes

+
+

+ Avatars come in various sizes, making them adaptable to different contexts and design needs. The size you choose depends on the layout and user interface. Larger avatars are often used for profile displays or in places where more visual emphasis is needed, while smaller avatars work well in compact areas, such as lists or notifications. You can easily adjust the size using style properties or predefined classes, ensuring consistency in your design +

+

Small

+

+ Usually 24x24 pixels, ideal for notifications or small UI elements +

+ + + + + +

Medium

+

+ Typically 40x40 pixels, commonly used in lists or chat interfaces +

+ + + + + +

Large

+

+ Generally 56x56 pixels, suitable for profile displays or main UI components +

+ + + + + + + + +

Extra Large

+

+ Often 72x72 pixels or larger, used for profile pages or featured sections +

+ + + + + + + +

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

+ +

Adding Icons

+
+

+ Avatars are often used alongside labels to provide added visual cues for users, enhancing communication or reinforcing identity within an interface. Depending on the layout or context, avatars can be placed on the left or right side of the accompanying label. There are no strict rules for avatar placement, but spacing and alignment are important to maintain a clean, readable design. For full-width elements, avatars should be centered alongside labels to ensure proper balance and clarity in the overall presentation. +

+
+
+
+ ); +}; + +export default SistentAvatar; diff --git a/src/sections/Projects/Sistent/components/index.js b/src/sections/Projects/Sistent/components/index.js index ca05b2d29792..65e89e9cf00f 100644 --- a/src/sections/Projects/Sistent/components/index.js +++ b/src/sections/Projects/Sistent/components/index.js @@ -58,7 +58,13 @@ const componentsData = [ "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", }, - + { + id: 8, + name: "Avatar", + description: + "A Avatar is an interactive element that triggers a specific action takes users where they need to go, and points out what happens next in a given flow.", + url: "/projects/sistent/components/avatar", + }, ]; const SistentComponents = () => {