From 87b4d0f1af2410cf98f8563aedd6f3868c9fd4a7 Mon Sep 17 00:00:00 2001 From: Marcus Kernohan <135075821+mkernohanbc@users.noreply.github.com> Date: Mon, 3 Feb 2025 10:36:06 -0800 Subject: [PATCH] Add Heading and Text components (#510) * implement RAC Text * scaffolding Text docs * WIP on implementing BCDS typescale * React Aria library update to 1.5.0 * Add Accordion and AccordionGroup components (#499) * staging Accordion and AccordionGroup file structure * bump RAC to 1.4.0 * basic shape of Accordion component * tweak props import * add story wireframe for Accordion * styling accordion * styling * additional styling and alternative icon implementation * refining button styling * scaffolding AccordionGroup * add title prop and styling to AccordionGroup * continuing work on Accordion and AccordionGroup styling * fix focus state for accordions inside accordiongroup * fleshing out argTypes * scaffolding accordion docs * add examples to vite kitchen sink * fleshing out examples on vite * expanding stories and docs * stories and docs * typo * renaming CSS classes to bcds-react-aria-* to match convention * typo * add comments to accordion group props * remove unused CSS class * bump RAC to 1.5.0 * update RAC imports * Refactor Select to use ListBoxSection (#504) * bump RAC to 1.5.0 * replace Section with ListBoxSection * Revert "bump RAC to 1.5.0" This reverts commit 75e05e7ae1045a707e7bf73621a6533b07fd5a3f. * Reapply "bump RAC to 1.5.0" This reverts commit 0edc443c769193cf05e97596a2e6de850c32562d. * storybook library update to 8.4.7 * add TextProps, refining styling * add missing CSS import * fork Heading styles into new component * add vite page for dev and testing * demo content * add text colour prop * wireframing storybook docs * add isUnstyled prop to Heading and Text * docs and stories * add color prop to Heading and flesh out docs * add ARIA attribute to fix accessibility violation * add explicit default elementType * add missing elementType declaration * docs edits --------- Co-authored-by: Arora Co-authored-by: Supriya-Arora <101464129+Supriya-Arora@users.noreply.github.com> --- packages/react-components/src/App.tsx | 2 + .../src/components/Heading/Heading.css | 44 +++++++ .../src/components/Heading/Heading.tsx | 32 ++++++ .../src/components/Heading/index.ts | 2 + .../src/components/Text/Text.css | 64 +++++++++++ .../src/components/Text/Text.tsx | 41 +++++++ .../src/components/Text/index.ts | 2 + .../react-components/src/components/index.ts | 2 + .../src/pages/TextPage/TextPage.tsx | 55 +++++++++ .../src/pages/TextPage/index.ts | 3 + packages/react-components/src/pages/index.ts | 2 + .../react-components/src/stories/Heading.mdx | 61 ++++++++++ .../src/stories/Heading.stories.tsx | 107 ++++++++++++++++++ .../react-components/src/stories/Text.mdx | 66 +++++++++++ .../src/stories/Text.stories.tsx | 104 +++++++++++++++++ 15 files changed, 587 insertions(+) create mode 100644 packages/react-components/src/components/Heading/Heading.css create mode 100644 packages/react-components/src/components/Heading/Heading.tsx create mode 100644 packages/react-components/src/components/Heading/index.ts create mode 100644 packages/react-components/src/components/Text/Text.css create mode 100644 packages/react-components/src/components/Text/Text.tsx create mode 100644 packages/react-components/src/components/Text/index.ts create mode 100644 packages/react-components/src/pages/TextPage/TextPage.tsx create mode 100644 packages/react-components/src/pages/TextPage/index.ts create mode 100644 packages/react-components/src/stories/Heading.mdx create mode 100644 packages/react-components/src/stories/Heading.stories.tsx create mode 100644 packages/react-components/src/stories/Text.mdx create mode 100644 packages/react-components/src/stories/Text.stories.tsx diff --git a/packages/react-components/src/App.tsx b/packages/react-components/src/App.tsx index 10c81c60..67a08db6 100644 --- a/packages/react-components/src/App.tsx +++ b/packages/react-components/src/App.tsx @@ -18,6 +18,7 @@ import { RadioGroupPage, SelectPage, TagGroupPage, + TextPage, TextAreaPage, TextFieldPage, SwitchPage, @@ -169,6 +170,7 @@ function App() { +