From 07fa9b4ccd94a1444963756b3bb6a528266f8ec2 Mon Sep 17 00:00:00 2001 From: Gabito Esmiapodo Date: Wed, 19 Jun 2024 18:13:59 -0300 Subject: [PATCH 1/9] feat: base examples list --- src/pageComponents/home/Examples/List.tsx | 41 ++++++++++++++++++++++ src/pageComponents/home/Examples/index.tsx | 11 +++--- src/styles/themes/light.tsx | 4 +-- 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 src/pageComponents/home/Examples/List.tsx diff --git a/src/pageComponents/home/Examples/List.tsx b/src/pageComponents/home/Examples/List.tsx new file mode 100644 index 00000000..cb545a3c --- /dev/null +++ b/src/pageComponents/home/Examples/List.tsx @@ -0,0 +1,41 @@ +import React, { HTMLAttributes } from 'react' +import styled from 'styled-components' + +const Wrapper = styled.div` + [data-theme='light'] & { + --theme-examples-list-background-color: #e2e0e766; + } + + [data-theme='dark'] & { + --theme-examples-list-background-color: #292b43; + } + + align-items: center; + background-color: var(--theme-examples-list-background-color); + border-radius: var(--base-border-radius-xl); + display: flex; + flex-direction: column; + max-width: 100%; + padding: calc(var(--base-gap) * 7); + row-gap: calc(var(--base-gap) * 5); + width: 1066px; +` + +const Title = styled.h2` + color: var(--theme-color-text-primary); + font-size: 3.6rem; + font-weight: 700; + line-height: 1.2; + margin: 0; +` + +const List: React.FC> = ({ ...restProps }) => { + return ( + + Built-in Features +

Here are some examples of how you can use the theme system.

+
+ ) +} + +export default List diff --git a/src/pageComponents/home/Examples/index.tsx b/src/pageComponents/home/Examples/index.tsx index 9b6c94af..1e235c1a 100644 --- a/src/pageComponents/home/Examples/index.tsx +++ b/src/pageComponents/home/Examples/index.tsx @@ -8,6 +8,7 @@ import Avatar from '@/src/pageComponents/home/Examples/Items/Avatar' import BigNumberInput from '@/src/pageComponents/home/Examples/Items/BigNumberInput' import EnsName from '@/src/pageComponents/home/Examples/Items/EnsName' import Hash from '@/src/pageComponents/home/Examples/Items/Hash' +import List from '@/src/pageComponents/home/Examples/List' const Wrapper = styled.section` background-color: var(--landing-page-main-background-color); @@ -29,10 +30,12 @@ const Examples: React.FC = ({ ...restProps }) => { return ( - - - - + + + + + + ) diff --git a/src/styles/themes/light.tsx b/src/styles/themes/light.tsx index ee94f8db..3bc9c80b 100644 --- a/src/styles/themes/light.tsx +++ b/src/styles/themes/light.tsx @@ -16,8 +16,8 @@ export const lightTheme = css` /* Text color */ --theme-color-text-primary: #2e3048; --theme-color-text: #4b4d60; - --theme-color-light: #4b4d60; - --theme-color-dark: #4b4d60; + --theme-color-light: #5f6178; + --theme-color-dark: #000; /* Danger / OK / warning */ --theme-color-danger: #800; From 4c4ea012cbaf50c983e9ea5b1c737b0b9c6d59f2 Mon Sep 17 00:00:00 2001 From: Gabito Esmiapodo Date: Wed, 19 Jun 2024 18:19:01 -0300 Subject: [PATCH 2/9] chore: rename folder --- src/pageComponents/home/Examples/List.tsx | 10 +++++++++- .../home/Examples/{Items => demos}/Avatar.test.tsx | 2 +- .../home/Examples/{Items => demos}/Avatar.tsx | 0 .../home/Examples/{Items => demos}/BigNumberInput.tsx | 0 .../home/Examples/{Items => demos}/EnsName.tsx | 0 .../home/Examples/{Items => demos}/Hash.tsx | 0 src/pageComponents/home/Examples/index.tsx | 8 ++++---- 7 files changed, 14 insertions(+), 6 deletions(-) rename src/pageComponents/home/Examples/{Items => demos}/Avatar.test.tsx (96%) rename src/pageComponents/home/Examples/{Items => demos}/Avatar.tsx (100%) rename src/pageComponents/home/Examples/{Items => demos}/BigNumberInput.tsx (100%) rename src/pageComponents/home/Examples/{Items => demos}/EnsName.tsx (100%) rename src/pageComponents/home/Examples/{Items => demos}/Hash.tsx (100%) diff --git a/src/pageComponents/home/Examples/List.tsx b/src/pageComponents/home/Examples/List.tsx index cb545a3c..979d69eb 100644 --- a/src/pageComponents/home/Examples/List.tsx +++ b/src/pageComponents/home/Examples/List.tsx @@ -29,11 +29,19 @@ const Title = styled.h2` margin: 0; ` +const Items = styled.div` + display: flex; + flex-direction: column; + max-width: 100%; + row-gap: calc(var(--base-gap) * 2); + width: 100%; +` + const List: React.FC> = ({ ...restProps }) => { return ( Built-in Features -

Here are some examples of how you can use the theme system.

+ asdasd
) } diff --git a/src/pageComponents/home/Examples/Items/Avatar.test.tsx b/src/pageComponents/home/Examples/demos/Avatar.test.tsx similarity index 96% rename from src/pageComponents/home/Examples/Items/Avatar.test.tsx rename to src/pageComponents/home/Examples/demos/Avatar.test.tsx index 5026ce5a..0f825159 100644 --- a/src/pageComponents/home/Examples/Items/Avatar.test.tsx +++ b/src/pageComponents/home/Examples/demos/Avatar.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react' import { Mock, describe, expect, it, vi } from 'vitest' import { useEnsName, useEnsAvatar } from 'wagmi' -import Avatar from '@/src/pageComponents/home/Examples/Items/Avatar' +import Avatar from '@/src/pageComponents/home/Examples/demos/Avatar' // Mock wagmi hooks vi.mock('wagmi', () => ({ diff --git a/src/pageComponents/home/Examples/Items/Avatar.tsx b/src/pageComponents/home/Examples/demos/Avatar.tsx similarity index 100% rename from src/pageComponents/home/Examples/Items/Avatar.tsx rename to src/pageComponents/home/Examples/demos/Avatar.tsx diff --git a/src/pageComponents/home/Examples/Items/BigNumberInput.tsx b/src/pageComponents/home/Examples/demos/BigNumberInput.tsx similarity index 100% rename from src/pageComponents/home/Examples/Items/BigNumberInput.tsx rename to src/pageComponents/home/Examples/demos/BigNumberInput.tsx diff --git a/src/pageComponents/home/Examples/Items/EnsName.tsx b/src/pageComponents/home/Examples/demos/EnsName.tsx similarity index 100% rename from src/pageComponents/home/Examples/Items/EnsName.tsx rename to src/pageComponents/home/Examples/demos/EnsName.tsx diff --git a/src/pageComponents/home/Examples/Items/Hash.tsx b/src/pageComponents/home/Examples/demos/Hash.tsx similarity index 100% rename from src/pageComponents/home/Examples/Items/Hash.tsx rename to src/pageComponents/home/Examples/demos/Hash.tsx diff --git a/src/pageComponents/home/Examples/index.tsx b/src/pageComponents/home/Examples/index.tsx index 1e235c1a..5579dd31 100644 --- a/src/pageComponents/home/Examples/index.tsx +++ b/src/pageComponents/home/Examples/index.tsx @@ -4,11 +4,11 @@ import styled from 'styled-components' import { InnerContainer as Inner, ContainerPadding } from 'db-ui-toolkit' import { useAccount } from 'wagmi' -import Avatar from '@/src/pageComponents/home/Examples/Items/Avatar' -import BigNumberInput from '@/src/pageComponents/home/Examples/Items/BigNumberInput' -import EnsName from '@/src/pageComponents/home/Examples/Items/EnsName' -import Hash from '@/src/pageComponents/home/Examples/Items/Hash' import List from '@/src/pageComponents/home/Examples/List' +import Avatar from '@/src/pageComponents/home/Examples/demos/Avatar' +import BigNumberInput from '@/src/pageComponents/home/Examples/demos/BigNumberInput' +import EnsName from '@/src/pageComponents/home/Examples/demos/EnsName' +import Hash from '@/src/pageComponents/home/Examples/demos/Hash' const Wrapper = styled.section` background-color: var(--landing-page-main-background-color); From d92cd956a69f75d90fa4ae5ef58a52eb0a8c2109 Mon Sep 17 00:00:00 2001 From: Gabito Esmiapodo Date: Wed, 19 Jun 2024 19:29:47 -0300 Subject: [PATCH 3/9] feat: add mocked demos list --- src/pageComponents/home/Examples/index.tsx | 81 ++++++++++++++++++++-- 1 file changed, 75 insertions(+), 6 deletions(-) diff --git a/src/pageComponents/home/Examples/index.tsx b/src/pageComponents/home/Examples/index.tsx index 5579dd31..0944ac46 100644 --- a/src/pageComponents/home/Examples/index.tsx +++ b/src/pageComponents/home/Examples/index.tsx @@ -4,7 +4,16 @@ import styled from 'styled-components' import { InnerContainer as Inner, ContainerPadding } from 'db-ui-toolkit' import { useAccount } from 'wagmi' +import { Props as ItemProps } from '@/src/pageComponents/home/Examples/Item' import List from '@/src/pageComponents/home/Examples/List' +import ImgAvatar from '@/src/pageComponents/home/Examples/assets/Avatar' +import ImgHash from '@/src/pageComponents/home/Examples/assets/Hash' +import ImgIpfsImage from '@/src/pageComponents/home/Examples/assets/IPFSImage' +import ImgInputAddress from '@/src/pageComponents/home/Examples/assets/InputAddress' +import ImgSubgraph from '@/src/pageComponents/home/Examples/assets/Subgraph' +import ImgTokenInput from '@/src/pageComponents/home/Examples/assets/TokenInput' +import ImgTokenList from '@/src/pageComponents/home/Examples/assets/TokenList' +import ImgWallet from '@/src/pageComponents/home/Examples/assets/Wallet' import Avatar from '@/src/pageComponents/home/Examples/demos/Avatar' import BigNumberInput from '@/src/pageComponents/home/Examples/demos/BigNumberInput' import EnsName from '@/src/pageComponents/home/Examples/demos/EnsName' @@ -26,16 +35,76 @@ const InnerContainer = styled(Inner)` const Examples: React.FC = ({ ...restProps }) => { const { address = '0x87885AaEEdED51C7e3858a782644F5d89759f245' } = useAccount() + const items: ItemProps[] = [ + { + demo:
Wallet
, + href: '#', + icon: , + text: 'Authenticate using an OP Account', + title: 'Wallet connectivity', + }, + { + demo: , + href: '#', + icon: , + text: 'Validate address or transaction hash', + title: 'Input address', + }, + { + demo:
Token list
, + href: '#', + icon: , + text: 'Dynamic token list modal', + title: 'Token list', + }, + { + demo:
Token input
, + href: '#', + icon: , + text: 'Input with max, user balance, decimals', + title: 'Token input', + }, + { + demo: , + href: '#', + icon: , + text: 'Copy, open in explorer', + title: 'Hash component', + }, + { + demo: , + href: '#', + icon: , + text: 'Address blockie avatar image', + title: 'Avatar', + }, + { + demo:
Subgraph
, + href: '#', + icon: , + text: 'Support for connecting with subgraphs', + title: 'Subgraph', + }, + { + demo:
IPFS Image
, + href: '#', + icon: , + text: 'Immutable and decentralized file storage', + title: 'Image IPFS', + }, + { + demo: , + href: '#', + icon: , + text: 'Resolve ENS names', + title: 'ENS name', + }, + ] return ( - - - - - - + ) From 16a660dd7c7ce77fc40990683e5c8048f42bb175 Mon Sep 17 00:00:00 2001 From: Gabito Esmiapodo Date: Wed, 19 Jun 2024 19:30:28 -0300 Subject: [PATCH 4/9] feat: add demos icons --- .../home/Examples/assets/Avatar.tsx | 25 +++++++++++++++++++ .../home/Examples/assets/Hash.tsx | 25 +++++++++++++++++++ .../home/Examples/assets/IPFSImage.tsx | 25 +++++++++++++++++++ .../home/Examples/assets/InputAddress.tsx | 25 +++++++++++++++++++ .../home/Examples/assets/Subgraph.tsx | 25 +++++++++++++++++++ .../home/Examples/assets/TokenInput.tsx | 25 +++++++++++++++++++ .../home/Examples/assets/TokenList.tsx | 25 +++++++++++++++++++ .../home/Examples/assets/Wallet.tsx | 25 +++++++++++++++++++ 8 files changed, 200 insertions(+) create mode 100644 src/pageComponents/home/Examples/assets/Avatar.tsx create mode 100644 src/pageComponents/home/Examples/assets/Hash.tsx create mode 100644 src/pageComponents/home/Examples/assets/IPFSImage.tsx create mode 100644 src/pageComponents/home/Examples/assets/InputAddress.tsx create mode 100644 src/pageComponents/home/Examples/assets/Subgraph.tsx create mode 100644 src/pageComponents/home/Examples/assets/TokenInput.tsx create mode 100644 src/pageComponents/home/Examples/assets/TokenList.tsx create mode 100644 src/pageComponents/home/Examples/assets/Wallet.tsx diff --git a/src/pageComponents/home/Examples/assets/Avatar.tsx b/src/pageComponents/home/Examples/assets/Avatar.tsx new file mode 100644 index 00000000..5414eacc --- /dev/null +++ b/src/pageComponents/home/Examples/assets/Avatar.tsx @@ -0,0 +1,25 @@ +import React, { HTMLAttributes } from 'react' +import { styled } from 'styled-components' + +const Wrapper = styled.svg` + display: block; + flex-shrink: 0; +` + +const Icon: React.FC> = ({ ...restProps }) => ( + + + +) + +export default Icon diff --git a/src/pageComponents/home/Examples/assets/Hash.tsx b/src/pageComponents/home/Examples/assets/Hash.tsx new file mode 100644 index 00000000..8cec7f76 --- /dev/null +++ b/src/pageComponents/home/Examples/assets/Hash.tsx @@ -0,0 +1,25 @@ +import React, { HTMLAttributes } from 'react' +import { styled } from 'styled-components' + +const Wrapper = styled.svg` + display: block; + flex-shrink: 0; +` + +const Icon: React.FC> = ({ ...restProps }) => ( + + + +) + +export default Icon diff --git a/src/pageComponents/home/Examples/assets/IPFSImage.tsx b/src/pageComponents/home/Examples/assets/IPFSImage.tsx new file mode 100644 index 00000000..29856347 --- /dev/null +++ b/src/pageComponents/home/Examples/assets/IPFSImage.tsx @@ -0,0 +1,25 @@ +import React, { HTMLAttributes } from 'react' +import { styled } from 'styled-components' + +const Wrapper = styled.svg` + display: block; + flex-shrink: 0; +` + +const Icon: React.FC> = ({ ...restProps }) => ( + + + +) + +export default Icon diff --git a/src/pageComponents/home/Examples/assets/InputAddress.tsx b/src/pageComponents/home/Examples/assets/InputAddress.tsx new file mode 100644 index 00000000..0aea346e --- /dev/null +++ b/src/pageComponents/home/Examples/assets/InputAddress.tsx @@ -0,0 +1,25 @@ +import React, { HTMLAttributes } from 'react' +import { styled } from 'styled-components' + +const Wrapper = styled.svg` + display: block; + flex-shrink: 0; +` + +const Icon: React.FC> = ({ ...restProps }) => ( + + + +) + +export default Icon diff --git a/src/pageComponents/home/Examples/assets/Subgraph.tsx b/src/pageComponents/home/Examples/assets/Subgraph.tsx new file mode 100644 index 00000000..357aecea --- /dev/null +++ b/src/pageComponents/home/Examples/assets/Subgraph.tsx @@ -0,0 +1,25 @@ +import React, { HTMLAttributes } from 'react' +import { styled } from 'styled-components' + +const Wrapper = styled.svg` + display: block; + flex-shrink: 0; +` + +const Icon: React.FC> = ({ ...restProps }) => ( + + + +) + +export default Icon diff --git a/src/pageComponents/home/Examples/assets/TokenInput.tsx b/src/pageComponents/home/Examples/assets/TokenInput.tsx new file mode 100644 index 00000000..441c0ed1 --- /dev/null +++ b/src/pageComponents/home/Examples/assets/TokenInput.tsx @@ -0,0 +1,25 @@ +import React, { HTMLAttributes } from 'react' +import { styled } from 'styled-components' + +const Wrapper = styled.svg` + display: block; + flex-shrink: 0; +` + +const Icon: React.FC> = ({ ...restProps }) => ( + + + +) + +export default Icon diff --git a/src/pageComponents/home/Examples/assets/TokenList.tsx b/src/pageComponents/home/Examples/assets/TokenList.tsx new file mode 100644 index 00000000..307f0a6f --- /dev/null +++ b/src/pageComponents/home/Examples/assets/TokenList.tsx @@ -0,0 +1,25 @@ +import React, { HTMLAttributes } from 'react' +import { styled } from 'styled-components' + +const Wrapper = styled.svg` + display: block; + flex-shrink: 0; +` + +const Icon: React.FC> = ({ ...restProps }) => ( + + + +) + +export default Icon diff --git a/src/pageComponents/home/Examples/assets/Wallet.tsx b/src/pageComponents/home/Examples/assets/Wallet.tsx new file mode 100644 index 00000000..4796c63f --- /dev/null +++ b/src/pageComponents/home/Examples/assets/Wallet.tsx @@ -0,0 +1,25 @@ +import React, { HTMLAttributes } from 'react' +import { styled } from 'styled-components' + +const Wrapper = styled.svg` + display: block; + flex-shrink: 0; +` + +const Icon: React.FC> = ({ ...restProps }) => ( + + + +) + +export default Icon From 4ff7318631d29cb26cbbd456a30bd8804727f9f6 Mon Sep 17 00:00:00 2001 From: Gabito Esmiapodo Date: Wed, 19 Jun 2024 19:42:49 -0300 Subject: [PATCH 5/9] feat: add base example item component --- .../home/Examples/Item/index.tsx | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 src/pageComponents/home/Examples/Item/index.tsx diff --git a/src/pageComponents/home/Examples/Item/index.tsx b/src/pageComponents/home/Examples/Item/index.tsx new file mode 100644 index 00000000..0c50abe7 --- /dev/null +++ b/src/pageComponents/home/Examples/Item/index.tsx @@ -0,0 +1,93 @@ +import React, { HTMLAttributes } from 'react' +import styled from 'styled-components' + +const Wrapper = styled.div` + [data-theme='light'] & { + --theme-examples-item-background-color: #f7f7f7; + } + + [data-theme='dark'] & { + --theme-examples-item-background-color: #2e3048; + } + + background-color: var(--theme-examples-item-background-color); + border-radius: var(--base-border-radius); + display: flex; + gap: calc(var(--base-gap) * 2); + max-width: 100%; + padding: calc(var(--base-gap) * 2) calc(var(--base-gap) * 2) calc(var(--base-gap) * 2) + calc(var(--base-gap) * 4); +` + +const Info = styled.div` + display: flex; + flex-direction: column; + flex: 1; + padding: calc(var(--base-gap) * 2) 0 0; + row-gap: var(--base-gap); +` + +const Icon = styled.div` + --icon-size: 40px; + + align-items: center; + background-color: var(--theme-color-primary); + border-radius: 50%; + color: #fff; + display: flex; + height: var(--icon-size); + justify-content: center; + width: var(--icon-size); +` + +const Title = styled.h2` + color: var(--theme-color-text-primary); + font-size: 2.4rem; + font-weight: 700; + line-height: 1.4; + margin: 0; +` + +const Text = styled.p` + color: var(--theme-color-text-primary); + font-size: 1.6rem; + font-weight: 500; + line-height: 1.4; + margin: 0; +` + +const Demo = styled.div` + align-items: center; + background-color: var(--theme-examples-list-background-color); + border-radius: var(--base-border-radius); + display: flex; + flex-direction: column; + justify-content: center; + min-height: 205px; + padding: calc(var(--base-gap) * 3); + flex: 1; +` + +export interface Props extends HTMLAttributes { + demo: React.ReactNode + href: string + icon: React.ReactNode + text: string + title: string +} + +const Item: React.FC = ({ demo, href, icon, text, title, ...restProps }) => { + return ( + + + {icon} + {title} + {text} + Documentation + + {demo} + + ) +} + +export default Item From e5ea06cfd9348359a0ddb7ff999a5627a06a03a8 Mon Sep 17 00:00:00 2001 From: Gabito Esmiapodo Date: Wed, 19 Jun 2024 19:43:13 -0300 Subject: [PATCH 6/9] feat: add item list --- src/pageComponents/home/Examples/List.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pageComponents/home/Examples/List.tsx b/src/pageComponents/home/Examples/List.tsx index 979d69eb..abf43996 100644 --- a/src/pageComponents/home/Examples/List.tsx +++ b/src/pageComponents/home/Examples/List.tsx @@ -1,6 +1,8 @@ import React, { HTMLAttributes } from 'react' import styled from 'styled-components' +import Item, { Props as ItemProps } from '@/src/pageComponents/home/Examples/Item' + const Wrapper = styled.div` [data-theme='light'] & { --theme-examples-list-background-color: #e2e0e766; @@ -37,11 +39,19 @@ const Items = styled.div` width: 100%; ` -const List: React.FC> = ({ ...restProps }) => { +interface Props extends HTMLAttributes { + items: ItemProps[] +} + +const List: React.FC = ({ items, ...restProps }) => { return ( Built-in Features - asdasd + + {items.map((item) => ( + + ))} + ) } From b135747c6c95fd7c2f04c37c07f1568705f96ac4 Mon Sep 17 00:00:00 2001 From: Gabito Esmiapodo Date: Wed, 19 Jun 2024 19:54:48 -0300 Subject: [PATCH 7/9] feat: add demo badge --- .../home/Examples/Item/Badge.tsx | 24 +++++++++++++++++++ .../home/Examples/Item/index.tsx | 18 ++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/pageComponents/home/Examples/Item/Badge.tsx diff --git a/src/pageComponents/home/Examples/Item/Badge.tsx b/src/pageComponents/home/Examples/Item/Badge.tsx new file mode 100644 index 00000000..dc671e48 --- /dev/null +++ b/src/pageComponents/home/Examples/Item/Badge.tsx @@ -0,0 +1,24 @@ +import styled from 'styled-components' + +const Badge = styled.div.attrs({ children: <>Demo })` + [data-theme='light'] & { + --theme-examples-badge-background-color: #2e3048; + } + + [data-theme='dark'] & { + --theme-examples-badge-background-color: #4b4d60; + } + + align-items: center; + background-color: var(--theme-examples-badge-background-color); + border-radius: var(--base-border-radius-sm); + color: #fff; + display: flex; + font-size: 1.2rem; + font-weight: 500; + height: 20px; + line-height: 1; + padding: 0 var(--base-gap); +` + +export default Badge diff --git a/src/pageComponents/home/Examples/Item/index.tsx b/src/pageComponents/home/Examples/Item/index.tsx index 0c50abe7..af0e87aa 100644 --- a/src/pageComponents/home/Examples/Item/index.tsx +++ b/src/pageComponents/home/Examples/Item/index.tsx @@ -1,6 +1,8 @@ import React, { HTMLAttributes } from 'react' import styled from 'styled-components' +import BaseBadge from '@/src/pageComponents/home/Examples/Item/Badge' + const Wrapper = styled.div` [data-theme='light'] & { --theme-examples-item-background-color: #f7f7f7; @@ -62,10 +64,19 @@ const Demo = styled.div` border-radius: var(--base-border-radius); display: flex; flex-direction: column; + flex: 1; justify-content: center; min-height: 205px; padding: calc(var(--base-gap) * 3); - flex: 1; + position: relative; +` + +const Badge = styled(BaseBadge)` + --badge-gap: calc(var(--base-gap) + var(--base-gap-sm)); + + left: var(--badge-gap); + position: absolute; + top: var(--badge-gap); ` export interface Props extends HTMLAttributes { @@ -85,7 +96,10 @@ const Item: React.FC = ({ demo, href, icon, text, title, ...restProps }) {text} Documentation - {demo} + + + {demo} + ) } From 8834ec123182427b1147d7253129bc7e4a638d1e Mon Sep 17 00:00:00 2001 From: Gabito Esmiapodo Date: Wed, 19 Jun 2024 20:28:54 -0300 Subject: [PATCH 8/9] feat: add documentation button --- .../Examples/Item/DocumentationButton.tsx | 59 +++++++++++++++++++ .../home/Examples/Item/index.tsx | 9 +-- 2 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 src/pageComponents/home/Examples/Item/DocumentationButton.tsx diff --git a/src/pageComponents/home/Examples/Item/DocumentationButton.tsx b/src/pageComponents/home/Examples/Item/DocumentationButton.tsx new file mode 100644 index 00000000..8089902d --- /dev/null +++ b/src/pageComponents/home/Examples/Item/DocumentationButton.tsx @@ -0,0 +1,59 @@ +import styled from 'styled-components' + +import { ThemedButton } from 'db-ui-toolkit' + +const Icon = () => ( + + + +) + +const DocumentationButton = styled(ThemedButton).attrs({ + $cssVarRoot: '--theme-button-documentation', + children: ( + <> + Documentation + + ), +})` + [data-theme='light'] & { + --theme-button-documentation-background-color: transparent; + --theme-button-documentation-background-color-hover: transparent; + + --theme-button-documentation-border-color: #e2e0e7; + --theme-button-documentation-border-color-hover: #4b4d60; + + --theme-button-documentation-color: #4b4d60; + --theme-button-documentation-color-hover: #4b4d60; + + --theme-button-documentation-background-color-disabled: transparent; + --theme-button-documentation-border-color-disabled: #e2e0e7; + --theme-button-documentation-color-disabled: #4b4d60; + } + + [data-theme='dark'] & { + --theme-button-documentation-background-color: transparent; + --theme-button-documentation-background-color-hover: transparent; + + --theme-button-documentation-border-color: #c5c2cb; + --theme-button-documentation-border-color-hover: #fff; + + --theme-button-documentation-color: #c5c2cb; + --theme-button-documentation-color-hover: #fff; + + --theme-button-documentation-background-color-disabled: transparent; + --theme-button-documentation-border-color-disabled: #c5c2cb; + --theme-button-documentation-color-disabled: #c5c2cb; + } + + --base-button-height: 43px; + --base-button-font-size: 1.4rem; + + font-weight: 500; + max-width: fit-content; +` + +export default DocumentationButton diff --git a/src/pageComponents/home/Examples/Item/index.tsx b/src/pageComponents/home/Examples/Item/index.tsx index af0e87aa..96d4245f 100644 --- a/src/pageComponents/home/Examples/Item/index.tsx +++ b/src/pageComponents/home/Examples/Item/index.tsx @@ -2,6 +2,7 @@ import React, { HTMLAttributes } from 'react' import styled from 'styled-components' import BaseBadge from '@/src/pageComponents/home/Examples/Item/Badge' +import DocumentationButton from '@/src/pageComponents/home/Examples/Item/DocumentationButton' const Wrapper = styled.div` [data-theme='light'] & { @@ -26,7 +27,7 @@ const Info = styled.div` flex-direction: column; flex: 1; padding: calc(var(--base-gap) * 2) 0 0; - row-gap: var(--base-gap); + row-gap: calc(var(--base-gap) * 2); ` const Icon = styled.div` @@ -46,7 +47,7 @@ const Title = styled.h2` color: var(--theme-color-text-primary); font-size: 2.4rem; font-weight: 700; - line-height: 1.4; + line-height: 1.2; margin: 0; ` @@ -54,7 +55,7 @@ const Text = styled.p` color: var(--theme-color-text-primary); font-size: 1.6rem; font-weight: 500; - line-height: 1.4; + line-height: 1.2; margin: 0; ` @@ -94,7 +95,7 @@ const Item: React.FC = ({ demo, href, icon, text, title, ...restProps }) {icon} {title} {text} - Documentation + From 1fdb2022d8618650cf015efd6fe0e998014d73ab Mon Sep 17 00:00:00 2001 From: Gabito Esmiapodo Date: Wed, 19 Jun 2024 20:30:42 -0300 Subject: [PATCH 9/9] fix: add padding --- src/pageComponents/home/Examples/Item/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pageComponents/home/Examples/Item/index.tsx b/src/pageComponents/home/Examples/Item/index.tsx index 96d4245f..e8260574 100644 --- a/src/pageComponents/home/Examples/Item/index.tsx +++ b/src/pageComponents/home/Examples/Item/index.tsx @@ -68,7 +68,7 @@ const Demo = styled.div` flex: 1; justify-content: center; min-height: 205px; - padding: calc(var(--base-gap) * 3); + padding: calc(var(--base-gap) * 5) calc(var(--base-gap) * 3) calc(var(--base-gap) * 3); position: relative; `