From 609cbd12223bb7a6bb1295ebe474d4a5a24f43bd Mon Sep 17 00:00:00 2001 From: pixeledcode Date: Thu, 21 Dec 2023 12:20:28 +0530 Subject: [PATCH] add borders and elevations --- .../Foundations/Design Tokens.stories.tsx | 111 +++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/packages/opub-ui/docs/Foundations/Design Tokens.stories.tsx b/packages/opub-ui/docs/Foundations/Design Tokens.stories.tsx index c6338537..01e4b84e 100644 --- a/packages/opub-ui/docs/Foundations/Design Tokens.stories.tsx +++ b/packages/opub-ui/docs/Foundations/Design Tokens.stories.tsx @@ -49,7 +49,7 @@ const space = Object.values(spaceRaw).map((space: any) => { const exampleFormatSpace = (info: any) => { return (
; }, }; + +const borderRaw = { ...tokens.collections[2].modes[0].variables }; +const borders = Object.values(borderRaw).map((border: any) => { + const value = + typeof border.value === 'number' ? border.value : border.value.name; + + return { + name: border.name, + value: value, + example: + typeof border.value === 'number' + ? `${border.value}px` + : convertToCssVariable(value), + }; +}); + +const exampleFormatBorder = (info: any, type: 'radius' | 'width') => { + const isRadius = info.row.original.name.includes('radius'); + + if (isRadius) { + return ( +