Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ff21010
New Toast component
GomezIvann Aug 30, 2024
206aefc
Updates to the Toast
GomezIvann Sep 2, 2024
fe5d025
Adding animations, first try
GomezIvann Sep 3, 2024
d7899d2
useTimeout hook for better Toast behaviour
GomezIvann Sep 4, 2024
ef7d5a1
Toast animation & style updates
GomezIvann Sep 4, 2024
2eda5f3
Loading toast, styles updated & other fixes
GomezIvann Sep 5, 2024
014c64a
Updates to the Queued toast
GomezIvann Sep 5, 2024
6b72932
Stories added, simplified code & small type updates
GomezIvann Sep 6, 2024
7a21070
Responsive toasts & more stories
GomezIvann Sep 6, 2024
e9bb877
More visual test and custom hook name updated
GomezIvann Sep 10, 2024
00ca0c3
Restore app & introduction
GomezIvann Sep 10, 2024
a3cb896
Adding accessibility tests to toast
GomezIvann Sep 10, 2024
64cd840
Partial tests and project dependency updates
GomezIvann Sep 11, 2024
3e23331
More tests & improvements to the Toast
GomezIvann Sep 12, 2024
9a46b08
Code updates
GomezIvann Sep 12, 2024
099350d
Updated package-lock to fix PR
GomezIvann Sep 12, 2024
e484104
First iteration of the Toast Code page
GomezIvann Sep 13, 2024
6c60e14
Renamed useToast & Toast code page
GomezIvann Sep 16, 2024
584f3b4
Small doc updates
GomezIvann Sep 16, 2024
7e9b0f8
Updating props order
GomezIvann Sep 17, 2024
e1bce81
Toast Usage & Specs
GomezIvann Sep 17, 2024
f325914
Small update in Toast code page
GomezIvann Sep 17, 2024
0802d0b
Extracting Icons from Toast implementation
GomezIvann Sep 18, 2024
3ca04f5
Merge branch 'master' into gomezivann/toast
GomezIvann Sep 19, 2024
2074257
Merge branch 'master' into gomezivann/toast
GomezIvann Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"@cloudscape-design/components": "^3.0.706",
"@dxc-technology/halstack-react": "*",
"@radix-ui/react-popover": "^1.0.7",
"@types/styled-components": "5.1.29",
"cross-env": "^7.0.3",
"next": "14.2.10",
"raw-loader": "^4.0.2",
Expand All @@ -30,6 +29,7 @@
"@types/react": "^18",
"@types/react-color": "^3.0.6",
"@types/react-dom": "^18",
"@types/styled-components": "5.1.29",
"eslint": "^8",
"eslint-config-next": "14.2.4",
"typescript": "^5"
Expand Down
21 changes: 21 additions & 0 deletions apps/website/pages/components/toast/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Head from "next/head";
import type { ReactElement } from "react";
import ToastCodePage from "../../../screens/components/toast/code/ToastCodePage";
import ToastPageLayout from "../../../screens/components/toast/ToastPageLayout";

const Index = () => {
return (
<>
<Head>
<title>Toast — Halstack Design System</title>
</Head>
<ToastCodePage></ToastCodePage>
</>
);
};

Index.getLayout = function getLayout(page: ReactElement) {
return <ToastPageLayout>{page}</ToastPageLayout>;
};

export default Index;
21 changes: 21 additions & 0 deletions apps/website/pages/components/toast/specifications.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Head from "next/head";
import type { ReactElement } from "react";
import ToastSpecsPage from "../../../screens/components/toast/specs/ToastSpecsPage";
import ToastPageLayout from "../../../screens/components/toast/ToastPageLayout";

const Specifications = () => {
return (
<>
<Head>
<title>Toast Specs — Halstack Design System</title>
</Head>
<ToastSpecsPage></ToastSpecsPage>
</>
);
};

Specifications.getLayout = function getLayout(page: ReactElement) {
return <ToastPageLayout>{page}</ToastPageLayout>;
};

export default Specifications;
21 changes: 21 additions & 0 deletions apps/website/pages/components/toast/usage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Head from "next/head";
import type { ReactElement } from "react";
import ToastPageLayout from "../../../screens/components/toast/ToastPageLayout";
import ToastUsagePage from "../../../screens/components/toast/usage/ToastUsagePage";

const Usage = () => {
return (
<>
<Head>
<title>Toast Usage — Halstack Design System</title>
</Head>
<ToastUsagePage></ToastUsagePage>
</>
);
};

Usage.getLayout = function getLayout(page: ReactElement) {
return <ToastPageLayout>{page}</ToastPageLayout>;
};

export default Usage;
1 change: 0 additions & 1 deletion apps/website/screens/common/TabsPageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useRouter } from "next/router";
import { DxcNavTabs } from "@dxc-technology/halstack-react";
import React from "react";
import Link from "next/link";
import styled from "styled-components";

type TabsPageLayoutProps = {
tabs: { label: string; path: string }[];
Expand Down
1 change: 1 addition & 0 deletions apps/website/screens/common/componentsList.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"status": "stable"
},
{ "label": "Textarea", "path": "/components/textarea", "status": "stable" },
{ "label": "Toast", "path": "/components/toast", "status": "experimental" },
{
"label": "Toggle Group",
"path": "/components/toggle-group",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,26 @@ const sections = [
),
},
{
title: "Formatting",
subSections: [
{
title: "Anatomy",
content: (
<>
<Image src={accordionAnatomy} alt="Accordion anatomy" />
<DxcBulletedList type="number">
<DxcBulletedList.Item>Header</DxcBulletedList.Item>
<DxcBulletedList.Item>
Custom icon <em>(Optional)</em>
</DxcBulletedList.Item>
<DxcBulletedList.Item>Title</DxcBulletedList.Item>
<DxcBulletedList.Item>
Helper text <em>(Optional)</em>
</DxcBulletedList.Item>
<DxcBulletedList.Item>
Caret icon <em>(Expand/collapse)</em>
</DxcBulletedList.Item>
<DxcBulletedList.Item>Expanded panel</DxcBulletedList.Item>
</DxcBulletedList>
</>
),
},
],
title: "Anatomy",
content: (
<>
<Image src={accordionAnatomy} alt="Accordion anatomy" />
<DxcBulletedList type="number">
<DxcBulletedList.Item>Header</DxcBulletedList.Item>
<DxcBulletedList.Item>
Custom icon <em>(Optional)</em>
</DxcBulletedList.Item>
<DxcBulletedList.Item>Title</DxcBulletedList.Item>
<DxcBulletedList.Item>
Helper text <em>(Optional)</em>
</DxcBulletedList.Item>
<DxcBulletedList.Item>
Caret icon <em>(Expand/collapse)</em>
</DxcBulletedList.Item>
<DxcBulletedList.Item>Expanded panel</DxcBulletedList.Item>
</DxcBulletedList>
</>
),
},
{
title: "Design tokens",
Expand Down
10 changes: 5 additions & 5 deletions apps/website/screens/components/badge/usage/BadgeUsagePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const sections = [
the teams involved in the task, repositories, folders…).
</DxcBulletedList.Item>
<DxcBulletedList.Item>
Keep it concise: comprehensively use badges, only displaying essential information that adds value to the
Keep it concise. Comprehensively use badges, only displaying essential information that adds value to the
user experience.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
Expand Down Expand Up @@ -119,12 +119,12 @@ const sections = [
</DxcParagraph>
<DxcBulletedList>
<DxcBulletedList.Item>
Non-semantic categorization: used in instances where the badge does not carry semantic meaning, it can
be employed in any color from the available palette.
<strong>Non-semantic categorization:</strong> used in instances where the badge does not carry semantic
meaning, it can be employed in any color from the available palette.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
Semantic categorization: when the badge conveys semantic information, spacific semantic colors are
available:
<strong>Semantic categorization:</strong> when the badge conveys semantic information, specific semantic
colors are available:
<DxcBulletedList type="circle">
<DxcBulletedList.Item>
Green: positive actions, such as approved, completed, success…
Expand Down
25 changes: 14 additions & 11 deletions apps/website/screens/components/button/usage/ButtonUsagePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import variants from "./examples/variants";
import icons from "./examples/iconUsage";
import HeaderDescriptionCell from "@/common/HeaderDescriptionCell";
import Code from "@/common/Code";
import Image from "@/common/Image";
import semanticButtons from "./images/semantic_buttons.png";

const sections = [
{
Expand Down Expand Up @@ -141,7 +143,7 @@ const sections = [
</td>
<td>
Neutral action with no specific context. Typically used for general actions. Shown in the brand's
primary color. Use for neutral actions such as "Submit", "Save" or "Continue.”
primary color. Use for neutral actions such as "Submit", "Save" or "Continue.”.
</td>
</tr>
<tr>
Expand All @@ -152,18 +154,18 @@ const sections = [
</td>
<td>
Indicates a destructive action or highlights a critical issue. Styled in red. Use for actions like
"Delete", "Remove" or "Cancel Subscription.”
"Delete", "Remove" or "Cancel Subscription.”.
</td>
</tr>
<tr>
<td>
<DxcTypography color="#c26c0a" fontWeight="600">
Warning
<DxcTypography color="#0086e6" fontWeight="600">
Info
</DxcTypography>
</td>
<td>
Alerts the user to potential issues or actions that need caution. Styled in orange. Use for actions like
"Warning" or "Attention Needed.”
Provides additional information or context. Shown in blue, the brand's secondary color. Use for actions
like "More Info", "Details" or "Learn More.”.
</td>
</tr>
<tr>
Expand All @@ -174,22 +176,23 @@ const sections = [
</td>
<td>
Represents a positive action or confirms the completion of a task. Styled in green. Use for actions like
"Confirm", "Complete" or "Approve.”
"Confirm", "Complete" or "Approve.”.
</td>
</tr>
<tr>
<td>
<DxcTypography color="#0086e6" fontWeight="600">
Info
<DxcTypography color="#c26c0a" fontWeight="600">
Warning
</DxcTypography>
</td>
<td>
Provides additional information or context. Shown in blue, the brand's secondary color. Use for actions
like "More Info", "Details" or "Learn More.”
Alerts the user to potential issues or actions that need caution. Styled in orange. Use for actions like
"Warning" or "Attention Needed.”.
</td>
</tr>
</tbody>
</DxcTable>
<Image src={semanticButtons} alt="Semantic buttons based on their purpose" />
</>
),
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
24 changes: 17 additions & 7 deletions apps/website/screens/components/select/code/SelectCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ import uncontrolled from "./examples/uncontrolled";
import errorHandling from "./examples/errorHandling";
import groups from "./examples/groupedOptions";
import icons from "./examples/icons";
import TableCode from "@/common/TableCode";
import TableCode, { ExtendedTableCode } from "@/common/TableCode";
import StatusBadge from "@/common/StatusBadge";

const optionsType = `{
label: string;
value: string;
icon: string | Icon;
}`;

const sections = [
{
title: "Props",
Expand Down Expand Up @@ -74,11 +80,15 @@ const sections = [
</DxcFlex>
</td>
<td>
<TableCode>
{
"({ label: string, value: string, icon: (string | React.ReactNode & React.SVGProps <SVGSVGElement>) })[] | ({ label: string, options: Option[] })[]"
}
</TableCode>
<TableCode>{"Option[] | ({ label: string, options: Option[] })[]"}</TableCode>
<p>
being <Code>Option</Code> the following type:
</p>
<ExtendedTableCode>{optionsType}</ExtendedTableCode>
<p>
and <Code>Icon</Code>:
</p>
<TableCode>{`React.ReactNode & React.SVGProps<SVGSVGElement>`}</TableCode>
</td>
<td>
An array of objects representing the selectable options. Each object has the following properties
Expand Down Expand Up @@ -253,7 +263,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ const sections = [
<tr>
<td>ref</td>
<td>
<TableCode>{"React.Ref <HTMLDivElement>"}</TableCode>
<TableCode>{"React.Ref<HTMLDivElement>"}</TableCode>
</td>
<td>Reference to the component.</td>
<td>-</td>
Expand Down
Loading