From 4f21428abaabefceeb52430b31bff24a29337d71 Mon Sep 17 00:00:00 2001 From: Enrique Moreno Date: Mon, 3 Feb 2025 16:16:13 +0100 Subject: [PATCH 1/8] First version (missing bullet height token) --- .../lib/src/bulleted-list/BulletedList.tsx | 154 +++++++++--------- 1 file changed, 78 insertions(+), 76 deletions(-) diff --git a/packages/lib/src/bulleted-list/BulletedList.tsx b/packages/lib/src/bulleted-list/BulletedList.tsx index 1a8139358c..b53536313a 100644 --- a/packages/lib/src/bulleted-list/BulletedList.tsx +++ b/packages/lib/src/bulleted-list/BulletedList.tsx @@ -6,6 +6,84 @@ import BulletedListPropsType, { BulletedListItemPropsType } from "./types"; import DxcIcon from "../icon/Icon"; import HalstackContext from "../HalstackContext"; +const ListContainer = styled.div` + ul, + ol { + margin: 0; + padding: 0; + } +`; + +const Bullet = styled.div` + align-items: center; + align-self: center; + display: flex; +`; + +const GeneralContent = styled.div` + align-items: center; + display: grid; + gap: var(--spacing-gap-s); + grid-template-columns: auto 1fr; +`; + +const Icon = styled.div` + align-content: center; + font-size: var(--height-xxs); + height: var(--height-xxs); + width: 16px; + svg { + /* PENDING TOKEN */ + /* height: ${(props) => props.theme.bulletHeight}; + width: ${(props) => props.theme.bulletWidth}; */ + } +`; + +const Number = styled.div` + align-self: flex-start; + box-sizing: border-box; + display: flex; + min-width: 0; + user-select: none; +`; + +const Square = styled.div` + background-color: var(--color-fg-neutral-dark); + /* PENDING TOKEN */ + /* height: ${(props) => props.theme.bulletHeight}; + width: ${(props) => props.theme.bulletWidth}; */ +`; + +const Circle = styled.div` + border-color: var(--color-fg-neutral-dark); + border-radius: 50%; + border: 1px solid; + /* PENDING TOKEN */ + /* height: ${(props) => props.theme.bulletHeight}; + width: ${(props) => props.theme.bulletWidth}; */ +`; + +const Disc = styled.div` + background-color: var(--color-fg-neutral-dark); + border-radius: 50%; + /* PENDING TOKEN */ + /* height: ${(props) => props.theme.bulletHeight}; + width: ${(props) => props.theme.bulletWidth}; */ +`; + +const ListItem = styled.li` + color: var(--color-fg-neutral-dark); + display: flex; + font-family: var(--typography-font-family); + font-size: var(--typography-body-m); + font-style: normal; + font-weight: var(--typography-body-regular); + line-height: normal; + list-style: none; + margin: 0px; + padding: var(--spacing-padding-none); +`; + const BulletedListItem = ({ children }: BulletedListItemPropsType): JSX.Element => <>{children}; const DxcBulletedList = ({ children, type = "disc", icon = "" }: BulletedListPropsType): JSX.Element => { @@ -51,80 +129,4 @@ const DxcBulletedList = ({ children, type = "disc", icon = "" }: BulletedListPro DxcBulletedList.Item = BulletedListItem; -const ListContainer = styled.div` - ul, - ol { - padding: 0; - margin: 0; - } -`; - -const Bullet = styled.div` - display: flex; - align-self: flex-start; - align-items: center; - height: 1.5rem; -`; - -const GeneralContent = styled.div` - display: grid; - grid-template-columns: auto 1fr; - align-items: center; -`; - -const Icon = styled.div` - height: 1.5rem; - width: auto; - margin-right: ${(props) => props.theme.bulletMarginRight}; - align-content: center; - color: ${(props) => props.theme.fontColor}; - - font-size: ${(props) => props.theme.bulletIconHeight}; - svg { - height: ${(props) => props.theme.bulletIconHeight}; - width: ${(props) => props.theme.bulletIconWidth}; - } -`; - -const Number = styled.div` - user-select: none; - margin-right: ${(props) => props.theme.bulletMarginRight}; - display: flex; - box-sizing: border-box; - align-self: flex-start; - min-width: 0; -`; - -const Square = styled.div` - background-color: ${(props) => props.theme.fontColor}; - height: ${(props) => props.theme.bulletHeight}; - width: ${(props) => props.theme.bulletWidth}; - margin-right: ${(props) => props.theme.bulletMarginRight}; -`; - -const Circle = styled.div` - height: ${(props) => props.theme.bulletHeight}; - width: ${(props) => props.theme.bulletWidth}; - border-radius: 50%; - border: 1px solid; - border-color: ${(props) => props.theme.fontColor}; - margin-right: ${(props) => props.theme.bulletMarginRight}; -`; - -const Disc = styled.div` - background-color: ${(props) => props.theme.fontColor}; - height: ${(props) => props.theme.bulletHeight}; - width: ${(props) => props.theme.bulletWidth}; - border-radius: 50%; - margin-right: ${(props) => props.theme.bulletMarginRight}; -`; - -const ListItem = styled.li` - display: flex; - margin: 0px; - padding: 0px; - list-style: none; - font-size: 1em; -`; - export default DxcBulletedList; From 88ee0a1e250127da798addfe344d2cc43856bb60 Mon Sep 17 00:00:00 2001 From: Enrique Moreno Date: Mon, 3 Feb 2025 16:19:37 +0100 Subject: [PATCH 2/8] Uncomment index.ts --- packages/lib/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lib/src/index.ts b/packages/lib/src/index.ts index fd0fc86ca5..3ded437d20 100644 --- a/packages/lib/src/index.ts +++ b/packages/lib/src/index.ts @@ -1,5 +1,5 @@ import "./styles/fonts.css"; -// import "./styles/variables.css"; +import "./styles/variables.css"; export { default as DxcAccordion } from "./accordion/Accordion"; export { default as DxcAccordionGroup } from "./accordion-group/AccordionGroup"; From bd7bd6533b30c3c36ed9335e572c762dd85df824 Mon Sep 17 00:00:00 2001 From: Enrique Moreno Date: Wed, 5 Feb 2025 13:48:33 +0100 Subject: [PATCH 3/8] Removed comments and changed symbol size --- .../lib/src/bulleted-list/BulletedList.tsx | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/packages/lib/src/bulleted-list/BulletedList.tsx b/packages/lib/src/bulleted-list/BulletedList.tsx index b53536313a..58949d04e9 100644 --- a/packages/lib/src/bulleted-list/BulletedList.tsx +++ b/packages/lib/src/bulleted-list/BulletedList.tsx @@ -33,9 +33,8 @@ const Icon = styled.div` height: var(--height-xxs); width: 16px; svg { - /* PENDING TOKEN */ - /* height: ${(props) => props.theme.bulletHeight}; - width: ${(props) => props.theme.bulletWidth}; */ + height: 4px; + width: 4px; } `; @@ -49,26 +48,23 @@ const Number = styled.div` const Square = styled.div` background-color: var(--color-fg-neutral-dark); - /* PENDING TOKEN */ - /* height: ${(props) => props.theme.bulletHeight}; - width: ${(props) => props.theme.bulletWidth}; */ + height: 4px; + width: 4px; `; const Circle = styled.div` border-color: var(--color-fg-neutral-dark); border-radius: 50%; border: 1px solid; - /* PENDING TOKEN */ - /* height: ${(props) => props.theme.bulletHeight}; - width: ${(props) => props.theme.bulletWidth}; */ + height: 4px; + width: 4px; `; const Disc = styled.div` background-color: var(--color-fg-neutral-dark); border-radius: 50%; - /* PENDING TOKEN */ - /* height: ${(props) => props.theme.bulletHeight}; - width: ${(props) => props.theme.bulletWidth}; */ + height: 4px; + width: 4px; `; const ListItem = styled.li` From 16f581e7ceb1de4fc608777d50c6273cf5795250 Mon Sep 17 00:00:00 2001 From: Enrique Moreno Date: Wed, 5 Feb 2025 16:20:31 +0100 Subject: [PATCH 4/8] Fixed preview for storybook --- packages/lib/.storybook/preview-head.html | 1 - packages/lib/.storybook/preview.tsx | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lib/.storybook/preview-head.html b/packages/lib/.storybook/preview-head.html index e28cb145ff..4e1ea405ff 100644 --- a/packages/lib/.storybook/preview-head.html +++ b/packages/lib/.storybook/preview-head.html @@ -2,7 +2,6 @@ rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap&family=Material+Symbols+Outlined:FILL@0..1" /> -