diff --git a/apps/website/pages/components/resultset-table/code.tsx b/apps/website/pages/components/resultset-table/code.tsx new file mode 100644 index 0000000000..499a1bbce4 --- /dev/null +++ b/apps/website/pages/components/resultset-table/code.tsx @@ -0,0 +1,17 @@ +import Head from "next/head"; +import type { ReactElement } from "react"; +import ResultsetTablePageLayout from "screens/components/resultset-table/ResultsetTablePageLayout"; +import ResultsetTableCodePage from "screens/components/resultset-table/code/ResultsetTableCodePage"; + +const Code = () => ( + <> + + Resultset table code — Halstack Design System + + + +); + +Code.getLayout = (page: ReactElement) => {page}; + +export default Code; diff --git a/apps/website/pages/components/resultset-table/index.tsx b/apps/website/pages/components/resultset-table/index.tsx index dbb38ce2dd..f6b056991c 100644 --- a/apps/website/pages/components/resultset-table/index.tsx +++ b/apps/website/pages/components/resultset-table/index.tsx @@ -1,21 +1,17 @@ import Head from "next/head"; import type { ReactElement } from "react"; -import ResultsetTableCodePage from "screens/components/resultset-table/code/ResultsetTableCodePage"; +import ResultsetTableOverviewPage from "screens/components/resultset-table/overview/ResultsetTableOverviewPage"; import ResultsetTablePageLayout from "screens/components/resultset-table/ResultsetTablePageLayout"; -const Usage = () => { - return ( - <> - - Resultset Table — Halstack Design System - - - - ); -}; +const Index = () => ( + <> + + Resultset table — Halstack Design System + + + +); -Usage.getLayout = function getLayout(page: ReactElement) { - return {page}; -}; +Index.getLayout = (page: ReactElement) => {page}; -export default Usage; +export default Index; diff --git a/apps/website/pages/components/resultset-table/specifications.tsx b/apps/website/pages/components/resultset-table/specifications.tsx deleted file mode 100644 index 3d2d52498c..0000000000 --- a/apps/website/pages/components/resultset-table/specifications.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import Head from "next/head"; -import type { ReactElement } from "react"; -import ResultsetTableSpecsPage from "screens/components/resultset-table/specs/ResultsetTableSpecsPage"; -import ResultsetTablePageLayout from "screens/components/resultset-table/ResultsetTablePageLayout"; - -const Specifications = () => { - return ( - <> - - Resultset Table Specs — Halstack Design System - - - - ); -}; - -Specifications.getLayout = function getLayout(page: ReactElement) { - return {page}; -}; - -export default Specifications; diff --git a/apps/website/pages/components/resultset-table/usage.tsx b/apps/website/pages/components/resultset-table/usage.tsx deleted file mode 100644 index 0d8a55f660..0000000000 --- a/apps/website/pages/components/resultset-table/usage.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import Head from "next/head"; -import type { ReactElement } from "react"; -import ResultsetTablePageLayout from "screens/components/resultset-table/ResultsetTablePageLayout"; -import ResultsetTableUsagePage from "screens/components/resultset-table/usage/ResultsetTableUsagePage"; - -const Usage = () => { - return ( - <> - - ResultsetTable Usage — Halstack Design System - - - - ); -}; - -Usage.getLayout = function getLayout(page: ReactElement) { - return {page}; -}; - -export default Usage; diff --git a/apps/website/pages/components/table/code.tsx b/apps/website/pages/components/table/code.tsx new file mode 100644 index 0000000000..ac6664cdd5 --- /dev/null +++ b/apps/website/pages/components/table/code.tsx @@ -0,0 +1,17 @@ +import Head from "next/head"; +import type { ReactElement } from "react"; +import TablePageLayout from "screens/components/table/TablePageLayout"; +import TableCodePage from "screens/components/table/code/TableCodePage"; + +const Code = () => ( + <> + + Table code — Halstack Design System + + + +); + +Code.getLayout = (page: ReactElement) => {page}; + +export default Code; diff --git a/apps/website/pages/components/table/index.tsx b/apps/website/pages/components/table/index.tsx index 0bb3762be3..3691744b9a 100644 --- a/apps/website/pages/components/table/index.tsx +++ b/apps/website/pages/components/table/index.tsx @@ -1,21 +1,17 @@ import Head from "next/head"; import type { ReactElement } from "react"; -import TableCodePage from "screens/components/table/code/TableCodePage"; +import TableOverviewPage from "screens/components/table/overview/TableOverviewPage"; import TablePageLayout from "screens/components/table/TablePageLayout"; -const Index = () => { - return ( - <> - - Table — Halstack Design System - - - - ); -}; +const Index = () => ( + <> + + Table — Halstack Design System + + + +); -Index.getLayout = function getLayout(page: ReactElement) { - return {page}; -}; +Index.getLayout = (page: ReactElement) => {page}; export default Index; diff --git a/apps/website/pages/components/table/specifications.tsx b/apps/website/pages/components/table/specifications.tsx deleted file mode 100644 index 76009695c5..0000000000 --- a/apps/website/pages/components/table/specifications.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import Head from "next/head"; -import type { ReactElement } from "react"; -import TableSpecsPage from "screens/components/table/specs/TableSpecsPage"; -import TablePageLayout from "screens/components/table/TablePageLayout"; - -const Specifications = () => { - return ( - <> - - Table Specs — Halstack Design System - - - - ); -}; - -Specifications.getLayout = function getLayout(page: ReactElement) { - return {page}; -}; - -export default Specifications; diff --git a/apps/website/pages/components/table/usage.tsx b/apps/website/pages/components/table/usage.tsx deleted file mode 100644 index 41998e8dd3..0000000000 --- a/apps/website/pages/components/table/usage.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import Head from "next/head"; -import type { ReactElement } from "react"; -import TablePageLayout from "screens/components/table/TablePageLayout"; -import TableUsagePage from "screens/components/table/usage/TableUsagePage"; - -const Usage = () => { - return ( - <> - - Table Usage — Halstack Design System - - - - ); -}; - -Usage.getLayout = function getLayout(page: ReactElement) { - return {page}; -}; - -export default Usage; diff --git a/apps/website/screens/components/resultset-table/ResultsetTablePageLayout.tsx b/apps/website/screens/components/resultset-table/ResultsetTablePageLayout.tsx index ad67ada1c5..e244a14d88 100644 --- a/apps/website/screens/components/resultset-table/ResultsetTablePageLayout.tsx +++ b/apps/website/screens/components/resultset-table/ResultsetTablePageLayout.tsx @@ -6,26 +6,22 @@ import { ReactNode } from "react"; const ResultsetTablePageHeading = ({ children }: { children: ReactNode }) => { const tabs = [ - { label: "Code", path: "/components/resultset-table" }, - { label: "Usage", path: "/components/resultset-table/usage" }, - { - label: "Specifications", - path: "/components/resultset-table/specifications", - }, + { label: "Overview", path: "/components/resultset-table" }, + { label: "Code", path: "/components/resultset-table/code" }, ]; return ( - + Data table is a component with a high rate of usage within the applications. It allows to show the user a big amount of information in a simple and simplified way. All the information contained in the table has a grid structure, defining columns and rows to place the data and allow the users to scan, analyze, compare and filter that information. - + {children} diff --git a/apps/website/screens/components/resultset-table/code/ResultsetTableCodePage.tsx b/apps/website/screens/components/resultset-table/code/ResultsetTableCodePage.tsx index 0930fbc09e..546f4d2205 100644 --- a/apps/website/screens/components/resultset-table/code/ResultsetTableCodePage.tsx +++ b/apps/website/screens/components/resultset-table/code/ResultsetTableCodePage.tsx @@ -29,6 +29,7 @@ const cellTypeString = `{ displayValue: React.ReactNode; sortValue?: string | number | Date; }[]`; + const columnTypeString = `{ displayValue: React.ReactNode; isSortable?: boolean; @@ -290,15 +291,13 @@ const sections = [ }, ]; -const ResultsetTableCodePage = () => { - return ( - - - - - - - ); -}; +const ResultsetTableCodePage = () => ( + + + + + + +); export default ResultsetTableCodePage; diff --git a/apps/website/screens/components/table/usage/TableUsagePage.tsx b/apps/website/screens/components/resultset-table/overview/ResultsetTableOverviewPage.tsx similarity index 57% rename from apps/website/screens/components/table/usage/TableUsagePage.tsx rename to apps/website/screens/components/resultset-table/overview/ResultsetTableOverviewPage.tsx index 7e086ed838..82f18c1e5c 100644 --- a/apps/website/screens/components/table/usage/TableUsagePage.tsx +++ b/apps/website/screens/components/resultset-table/overview/ResultsetTableOverviewPage.tsx @@ -5,13 +5,13 @@ import DocFooter from "@/common/DocFooter"; const sections = [ { - title: "Usage", + title: "Introduction", content: ( Use the table component to compare information in rows and columns. Every table cell requires a logical column header/row header. - Don't use the table to create visual layout of the content of a page. + Don't use the table for create visual layout of the content of a page. Avoid truncating content, wrap instead. @@ -19,15 +19,13 @@ const sections = [ }, ]; -const TableUsagePage = () => { - return ( - - - - - - - ); -}; +const ResultsetTableOverviewPage = () => ( + + + + + + +); -export default TableUsagePage; +export default ResultsetTableOverviewPage; diff --git a/apps/website/screens/components/resultset-table/specs/ResultsetTableSpecsPage.tsx b/apps/website/screens/components/resultset-table/specs/ResultsetTableSpecsPage.tsx deleted file mode 100644 index e9a9dd2061..0000000000 --- a/apps/website/screens/components/resultset-table/specs/ResultsetTableSpecsPage.tsx +++ /dev/null @@ -1,799 +0,0 @@ -import { DxcTable, DxcParagraph, DxcBulletedList, DxcFlex, DxcLink } from "@dxc-technology/halstack-react"; -import Image from "@/common/Image"; -import Link from "next/link"; -import QuickNavContainer from "@/common/QuickNavContainer"; -import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; -import Figure from "@/common/Figure"; -import DocFooter from "@/common/DocFooter"; -import Code from "@/common/Code"; -import anatomyImage from "./images/table_anatomy.png"; -import specsImage from "./images/table_specs.png"; - -const sections = [ - { - title: "Specifications", - content: ( -
- Resultset table design specifications -
- ), - }, - { - title: "States", - content: ( - - Some other components defined in the Design System are used in the table component as the{" "} - - checkbox - - ,{" "} - - button - {" "} - or{" "} - - select - - . For concrete specifications about states, please, consider to see the documentation of each component. - - ), - }, - - { - title: "Anatomy", - content: ( - <> - Resultset table anatomy - - Header - Header title - Sorting action - Body - Cell - Cell value - Paginator - - - ), - }, - { - title: "Design tokens", - subSections: [ - { - title: "Color", - content: ( - - - - Component token - Element - Core token - Value - - - - - - dataBackgroundColor - - Cell - - color-white - - #ffffff - - - - dataFontColor - - Cell value - - color-black - - #000000 - - - - headerBackgroundColor - - Header - - color-purple-700 - - #5f249f - - - - headerFontColor - - Header title - - color-white - - #ffffff - - - - scrollBarThumbColor - - Scroll bar - - color-grey-700 - - #666666 - - - - scrollBarTrackColor - - Scroll bar - - color-grey-300 - - #cccccc - - - - sortIconColor - - Sort - - color-white - - #ffffff - - - - rowSeparatorColor - - Divider - - color-grey-300 - - #cccccc - - - - actionIconColor - - Actions cell - - color-purple-700 - - #5f249f - - - - disabledActionIconColor - - Actions cell - - color-grey-500 - - #999999 - - - - hoverActionIconColor - - Actions cell - - color-purple-700 - - #5f249f - - - - focusActionIconColor - - Actions cell - - color-purple-700 - - #5f249f - - - - activeActionIconColor - - Actions cell - - color-purple-700 - - #5f249f - - - - actionBackgroundColor - - Actions cell - - color-transparent - - transparent - - - - disabledActionBackgroundColor - - Actions cell - - color-transparent - - transparent - - - - hoverActionBackgroundColor - - Actions cell - - color-grey-100 - - #f2f2f2 - - - - focusActionBorderColor - - Actions cell - - color-blue-600 - - #0095ff - - - - activeActionBackgroundColor - - Actions cell - - color-grey-300 - - #cccccc - - - - ), - }, - { - title: "Typography", - content: ( - - - - Component token - Element - Core token - Value - - - - - - dataFontFamily - - Cell value - - font-family-sans - - 'Open Sans', sans-serif - - - - dataFontSize - - Cell value - - font-scale-02 - - 0.875rem / 14px - - - - dataFontStyle - - Cell value - - font-style-normal - - normal - - - - dataFontWeight - - Cell value - - font-weight-regular - - 400 - - - - dataFontTextTransform - - Cell value - - - none - - - - dataTextLineHeight - - Cell value - - - normal - - - - dataTextAlign - - Cell value - - - left - - - - headerFontFamily - - Header title - - font-family-sans - - 'Open Sans', sans-serif - - - - headerFontSize - - Header title - - font-scale-02 - - 0.875rem / 14px - - - - headerFontStyle - - Header title - - font-style-normal - - normal - - - - headerFontWeight - - Header title - - font-weight-regular - - 400 - - - - headerFontTextTransform - - Header title - - - none - - - - headerTextLineHeight - - Header title - - - normal - - - - headerTextAlign - - Header title - - - left - - - - ), - }, - { - title: "Border", - content: ( - - - - Component token - Element - Core token - Value - - - - - - rowSeparatorThickness - - Divider - - border-width-1 - - 1px - - - - rowSeparatorStyle - - Divider - - border-style-solid - - solid - - - - headerBorderRadius - - Header - - border-radius-medium - - 0.25rem / 4px - - - - ), - }, - { - title: "Spacing", - content: ( - - - - Component token - Element - Core token - Value - - - - - - dataPaddingTop - - Cell value - - spacing-16 - - 1rem / 16px - - - - dataPaddingBottom - - Cell value - - spacing-16 - - 1rem / 16px - - - - dataPaddingRight - - Cell value - - - 20px - - - - dataPaddingLeft - - Cell value - - - 20px - - - - dataPaddingTopReduced - - Cell value - - spacing-8 - - 0.5rem / 8px - - - - dataPaddingBottomReduced - - Cell value - - spacing-8 - - 0.5rem / 8px - - - - dataPaddingRightReduced - - Cell value - - spacing-16 - - 1rem / 16px - - - - dataPaddingLeftReduced - - Cell value - - spacing-16 - - 1rem / 16px - - - - firstChildPaddingLeft - - Cell value - - spacing-24 - - 1.5rem / 24px - - - - lastChildPaddingRight - - Cell value - - spacing-24 - - 1.5rem / 24px - - - - firstChildPaddingLeftReduced - - Cell value - - - 20px - - - - lastChildPaddingRightReduced - - Cell value - - - 20px - - - - dataPaddingBottomReduced - - Cell value - - spacing-8 - - 0.5rem / 8px - - - - dataPaddingRightReduced - - Cell value - - spacing-16 - - 1rem / 16px - - - - headerPaddingTop - - Header title - - spacing-16 - - 1rem / 16px - - - - headerPaddingBottom - - Header title - - spacing-16 - - 1rem / 16px - - - - headerPaddingRight - - Header title - - - 20px - - - - headerPaddingLeft - - Header title - - spacing-40 - - 2.5rem / 40px - - - - headerPaddingTopReduced - - Header title - - spacing-8 - - 0.5rem / 8px - - - - headerPaddingBottomReduced - - Header title - - spacing-8 - - 0.5rem / 8px - - - - headerPaddingRightReduced - - Header title - - spacing-16 - - 1rem / 16px - - - - headerPaddingLeftReduced - - Header title - - spacing-16 - - 1rem / 16px - - - - ), - }, - { - title: "Iconography", - content: ( - - - - Property - Element - Core token - Value - - - - - - width - - Sorting action - - - 14px - - - - height - - Sorting action - - - 14px - - - - ), - }, - ], - }, - { - title: "Accessibility", - subSections: [ - { - title: "WCAG", - content: ( - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 1.3.1: Info and Relationships - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 1.3.2: Meaningful Sequence - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 2.1.1: Keyboard - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 2.4.3: Focus Order - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 2.4.6: Headings and Labels - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 2.4.7: Focus Visible - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 4.1.2: Name, Role, Value - - - - ), - }, - { - title: "WAI-ARIA", - content: ( - - - WAI-ARIA Authoring Practices 1.2 -{" "} - - 3.23 Table - - - - WAI-ARIA Authoring Practices 1.2 -{" "} - - Sortable Table Example - - - - ), - }, - ], - }, -]; - -const ResultsetTableSpecsPage = () => { - return ( - - - - - - - ); -}; - -export default ResultsetTableSpecsPage; diff --git a/apps/website/screens/components/resultset-table/specs/images/table_anatomy.png b/apps/website/screens/components/resultset-table/specs/images/table_anatomy.png deleted file mode 100644 index ed9aba8ca8..0000000000 Binary files a/apps/website/screens/components/resultset-table/specs/images/table_anatomy.png and /dev/null differ diff --git a/apps/website/screens/components/resultset-table/specs/images/table_specs.png b/apps/website/screens/components/resultset-table/specs/images/table_specs.png deleted file mode 100644 index 6cb207fc24..0000000000 Binary files a/apps/website/screens/components/resultset-table/specs/images/table_specs.png and /dev/null differ diff --git a/apps/website/screens/components/resultset-table/usage/ResultsetTableUsagePage.tsx b/apps/website/screens/components/resultset-table/usage/ResultsetTableUsagePage.tsx deleted file mode 100644 index c65c3f5312..0000000000 --- a/apps/website/screens/components/resultset-table/usage/ResultsetTableUsagePage.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { DxcBulletedList, DxcFlex } from "@dxc-technology/halstack-react"; -import QuickNavContainer from "@/common/QuickNavContainer"; -import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; -import DocFooter from "@/common/DocFooter"; - -const sections = [ - { - title: "Usage", - content: ( - - Use the table component to compare information in rows and columns. - Every table cell requires a logical column header/row header. - - Don't use the table for create visual layout of the content of a page. - - Avoid truncating content, wrap instead. - - ), - }, -]; - -const ResultsetTableUsagePage = () => { - return ( - - - - - - - ); -}; - -export default ResultsetTableUsagePage; diff --git a/apps/website/screens/components/table/TablePageLayout.tsx b/apps/website/screens/components/table/TablePageLayout.tsx index 133db5ff4c..ca1e324913 100644 --- a/apps/website/screens/components/table/TablePageLayout.tsx +++ b/apps/website/screens/components/table/TablePageLayout.tsx @@ -6,9 +6,8 @@ import { ReactNode } from "react"; const TablePageHeading = ({ children }: { children: ReactNode }) => { const tabs = [ - { label: "Code", path: "/components/table" }, - { label: "Usage", path: "/components/table/usage" }, - { label: "Specifications", path: "/components/table/specifications" }, + { label: "Overview", path: "/components/table" }, + { label: "Code", path: "/components/table/code" }, ]; return ( @@ -22,7 +21,7 @@ const TablePageHeading = ({ children }: { children: ReactNode }) => { grid structure, defining columns and rows to place the data and allow the users to scan, analyze, compare and filter that information. - +
{children} diff --git a/apps/website/screens/components/table/code/TableCodePage.tsx b/apps/website/screens/components/table/code/TableCodePage.tsx index f71d4da936..94f0ff48dd 100644 --- a/apps/website/screens/components/table/code/TableCodePage.tsx +++ b/apps/website/screens/components/table/code/TableCodePage.tsx @@ -51,6 +51,17 @@ const sections = [ The center section of the table. Can be used to render custom content in this area. - + + margin + + 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | Margin + + + Size of the margin to be applied to the component. You can pass an object with 'top', 'bottom', 'left' and + 'right' properties in order to specify different margin sizes. + + - + @@ -76,17 +87,6 @@ const sections = [ 'default' - - margin - - 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | Margin - - - Size of the margin to be applied to the component. You can pass an object with 'top', 'bottom', 'left' and - 'right' properties in order to specify different margin sizes. - - - - ), @@ -170,15 +170,13 @@ const sections = [ }, ]; -const TableCodePage = () => { - return ( - - - - - - - ); -}; +const TableCodePage = () => ( + + + + + + +); export default TableCodePage; diff --git a/apps/website/screens/components/table/overview/TableOverviewPage.tsx b/apps/website/screens/components/table/overview/TableOverviewPage.tsx new file mode 100644 index 0000000000..f4c1f51066 --- /dev/null +++ b/apps/website/screens/components/table/overview/TableOverviewPage.tsx @@ -0,0 +1,27 @@ +import { DxcParagraph, DxcFlex } from "@dxc-technology/halstack-react"; +import QuickNavContainer from "@/common/QuickNavContainer"; +import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; +import DocFooter from "@/common/DocFooter"; + +const sections = [ + { + title: "Introduction", + content: ( + + The Table component is a powerful and flexible tool for displaying tabular data in a structured format. It + allows users to present information in rows and columns, making it easy to read and analyze large datasets. + + ), + }, +]; + +const TableOverviewPage = () => ( + + + + + + +); + +export default TableOverviewPage; diff --git a/apps/website/screens/components/table/specs/TableSpecsPage.tsx b/apps/website/screens/components/table/specs/TableSpecsPage.tsx deleted file mode 100644 index a14bdc749b..0000000000 --- a/apps/website/screens/components/table/specs/TableSpecsPage.tsx +++ /dev/null @@ -1,800 +0,0 @@ -import { DxcTable, DxcParagraph, DxcBulletedList, DxcFlex, DxcLink } from "@dxc-technology/halstack-react"; -import Image from "@/common/Image"; -import Link from "next/link"; -import QuickNavContainer from "@/common/QuickNavContainer"; -import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; -import Figure from "@/common/Figure"; -import DocFooter from "@/common/DocFooter"; -import Code from "@/common/Code"; -import anatomyImage from "./images/table_anatomy.png"; -import specsImage from "./images/table_specs.png"; - -const sections = [ - { - title: "Specifications", - content: ( -
- Table design specifications -
- ), - }, - { - title: "States", - content: ( - <> - - Some other components defined in the Design System are used in the table component as the{" "} - - checkbox - - ,{" "} - - button - {" "} - or{" "} - - select - - . For concrete specifications about states, please, consider to see the documentation of each component. - - - ), - }, - { - title: "Anatomy", - content: ( - <> - Table anatomy - - Header - Header title - Sorting action - Body - Cell - Cell value - Paginator - - - ), - }, - { - title: "Design tokens", - subSections: [ - { - title: "Color", - content: ( - - - - Component token - Element - Core token - Value - - - - - - dataBackgroundColor - - Cell - - color-white - - #ffffff - - - - dataFontColor - - Cell value - - color-black - - #000000 - - - - headerBackgroundColor - - Header - - color-purple-700 - - #5f249f - - - - headerFontColor - - Header title - - color-white - - #ffffff - - - - scrollBarThumbColor - - Scroll bar - - color-grey-700 - - #666666 - - - - scrollBarTrackColor - - Scroll bar - - color-grey-300 - - #cccccc - - - - sortIconColor - - Sort - - color-white - - #ffffff - - - - rowSeparatorColor - - Divider - - color-grey-300 - - #cccccc - - - - actionIconColor - - Actions cell - - color-purple-700 - - #5f249f - - - - disabledActionIconColor - - Actions cell - - color-grey-500 - - #999999 - - - - hoverActionIconColor - - Actions cell - - color-purple-700 - - #5f249f - - - - focusActionIconColor - - Actions cell - - color-purple-700 - - #5f249f - - - - activeActionIconColor - - Actions cell - - color-purple-700 - - #5f249f - - - - actionBackgroundColor - - Actions cell - - color-transparent - - transparent - - - - disabledActionBackgroundColor - - Actions cell - - color-transparent - - transparent - - - - hoverActionBackgroundColor - - Actions cell - - color-grey-100 - - #f2f2f2 - - - - focusActionBorderColor - - Actions cell - - color-blue-600 - - #0095ff - - - - activeActionBackgroundColor - - Actions cell - - color-grey-300 - - #cccccc - - - - ), - }, - { - title: "Typography", - content: ( - - - - Component token - Element - Core token - Value - - - - - - dataFontFamily - - Cell value - - font-family-sans - - 'Open Sans', sans-serif - - - - dataFontSize - - Cell value - - font-scale-02 - - 0.875rem / 14px - - - - dataFontStyle - - Cell value - - font-style-normal - - normal - - - - dataFontWeight - - Cell value - - font-weight-regular - - 400 - - - - dataFontTextTransform - - Cell value - - - none - - - - dataTextLineHeight - - Cell value - - - normal - - - - dataTextAlign - - Cell value - - - left - - - - headerFontFamily - - Header title - - font-family-sans - - 'Open Sans', sans-serif - - - - headerFontSize - - Header title - - font-scale-02 - - 0.875rem / 14px - - - - headerFontStyle - - Header title - - font-style-normal - - normal - - - - headerFontWeight - - Header title - - font-weight-regular - - 400 - - - - headerFontTextTransform - - Header title - - - none - - - - headerTextLineHeight - - Header title - - - normal - - - - headerTextAlign - - Header title - - - left - - - - ), - }, - { - title: "Border", - content: ( - - - - Component token - Element - Core token - Value - - - - - - rowSeparatorThickness - - Divider - - border-width-1 - - 1px - - - - rowSeparatorStyle - - Divider - - border-style-solid - - solid - - - - headerBorderRadius - - Header - - border-radius-medium - - 0.25rem / 4px - - - - ), - }, - { - title: "Spacing", - content: ( - - - - Component token - Element - Core token - Value - - - - - - dataPaddingTop - - Cell value - - spacing-16 - - 1rem / 16px - - - - dataPaddingBottom - - Cell value - - spacing-16 - - 1rem / 16px - - - - dataPaddingRight - - Cell value - - - 20px - - - - dataPaddingLeft - - Cell value - - - 20px - - - - dataPaddingTopReduced - - Cell value - - spacing-8 - - 0.5rem / 8px - - - - dataPaddingBottomReduced - - Cell value - - spacing-8 - - 0.5rem / 8px - - - - dataPaddingRightReduced - - Cell value - - spacing-16 - - 1rem / 16px - - - - dataPaddingLeftReduced - - Cell value - - spacing-16 - - 1rem / 16px - - - - firstChildPaddingLeft - - Cell value - - spacing-24 - - 1.5rem / 24px - - - - lastChildPaddingRight - - Cell value - - spacing-24 - - 1.5rem / 24px - - - - firstChildPaddingLeftReduced - - Cell value - - - 20px - - - - lastChildPaddingRightReduced - - Cell value - - - 20px - - - - dataPaddingBottomReduced - - Cell value - - spacing-8 - - 0.5rem / 8px - - - - dataPaddingRightReduced - - Cell value - - spacing-16 - - 1rem / 16px - - - - headerPaddingTop - - Header title - - spacing-16 - - 1rem / 16px - - - - headerPaddingBottom - - Header title - - spacing-16 - - 1rem / 16px - - - - headerPaddingRight - - Header title - - - 20px - - - - headerPaddingLeft - - Header title - - spacing-40 - - 2.5rem / 40px - - - - headerPaddingTopReduced - - Header title - - spacing-8 - - 0.5rem / 8px - - - - headerPaddingBottomReduced - - Header title - - spacing-8 - - 0.5rem / 8px - - - - headerPaddingRightReduced - - Header title - - spacing-16 - - 1rem / 16px - - - - headerPaddingLeftReduced - - Header title - - spacing-16 - - 1rem / 16px - - - - ), - }, - { - title: "Iconography", - content: ( - - - - Property - Element - Core token - Value - - - - - - width - - Sorting action - - - 14px - - - - height - - Sorting action - - - 14px - - - - ), - }, - ], - }, - { - title: "Accessibility", - subSections: [ - { - title: "WCAG", - content: ( - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 1.3.1: Info and Relationships - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 1.3.2: Meaningful Sequence - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 2.1.1: Keyboard - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 2.4.3: Focus Order - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 2.4.6: Headings and Labels - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 2.4.7: Focus Visible - - - - Understanding WCAG 2.2 -{" "} - - Success Criterion 4.1.2: Name, Role, Value - - - - ), - }, - { - title: "WAI-ARIA", - content: ( - - - WAI-ARIA Authoring Practices 1.2 -{" "} - - 3.23 Table - - - - WAI-ARIA Authoring Practices 1.2 -{" "} - - Sortable Table Example - - - - ), - }, - ], - }, -]; - -const TableSpecsPage = () => { - return ( - - - - - - - ); -}; - -export default TableSpecsPage; diff --git a/apps/website/screens/components/table/specs/images/table_anatomy.png b/apps/website/screens/components/table/specs/images/table_anatomy.png deleted file mode 100644 index ed9aba8ca8..0000000000 Binary files a/apps/website/screens/components/table/specs/images/table_anatomy.png and /dev/null differ diff --git a/apps/website/screens/components/table/specs/images/table_specs.png b/apps/website/screens/components/table/specs/images/table_specs.png deleted file mode 100644 index 6cb207fc24..0000000000 Binary files a/apps/website/screens/components/table/specs/images/table_specs.png and /dev/null differ diff --git a/packages/lib/src/action-icon/ActionIcon.tsx b/packages/lib/src/action-icon/ActionIcon.tsx index ed985e13ee..0b030632d2 100644 --- a/packages/lib/src/action-icon/ActionIcon.tsx +++ b/packages/lib/src/action-icon/ActionIcon.tsx @@ -6,36 +6,37 @@ import { Tooltip } from "../tooltip/Tooltip"; const ActionIcon = styled.button` all: unset; - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; + display: grid; + place-items: center; border-radius: var(--border-radius-xs); height: var(--height-s); width: 24px; - ${(props) => (props.disabled ? `cursor: not-allowed;` : `cursor: pointer;`)} - color: ${(props) => (props.disabled ? "var(--color-fg-neutral-medium)" : "var(--color-fg-neutral-dark)")}; + color: var(--color-fg-neutral-dark); + cursor: pointer; - ${(props) => - !props.disabled && - ` - &:focus, - &:focus-visible { - outline: var(--border-width-m) var(--border-style-default) var(--border-color-secondary-medium); - } - &:hover { - background-color: var(--color-bg-alpha-light); - } - `} + /* Icon sizing */ font-size: var(--height-xxs); > svg { height: var(--height-xxs); width: 16px; } + + &:disabled { + color: var(--color-fg-neutral-medium); + cursor: not-allowed; + } + &:focus:enabled, + &:focus-visible:enabled { + outline: var(--border-width-m) var(--border-style-default) var(--border-color-secondary-medium); + outline-offset: -2px; + } + &:hover:enabled { + background-color: var(--color-bg-alpha-light); + } `; export default forwardRef( - ({ disabled = false, title, icon, onClick, tabIndex }, ref) => ( + ({ disabled = false, icon, onClick, tabIndex, title }, ref) => ( ; -const actions: ActionsPropsType = [ +const actions: Action = [ { title: "icon", onClick: (value?) => { diff --git a/packages/lib/src/icon/Icon.tsx b/packages/lib/src/icon/Icon.tsx index cc2b977e6f..dc1e708fe2 100644 --- a/packages/lib/src/icon/Icon.tsx +++ b/packages/lib/src/icon/Icon.tsx @@ -1,14 +1,5 @@ import styled from "styled-components"; -const DxcIcon = ({ icon }: { icon: string }): JSX.Element => ( -