-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
171 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Overview | ||
description: Design tokens overview | ||
draft: false | ||
draft: true | ||
--- | ||
|
||
Overview |
2 changes: 1 addition & 1 deletion
2
...-foundations/1-design-tokens/2-colors.mdx → ...2-foundations/1-design-tokens/2-color.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Colours | ||
title: Colour | ||
description: Colour information | ||
draft: true | ||
status: in-development | ||
|
26 changes: 26 additions & 0 deletions
26
apps/docs/content/2-foundations/1-design-tokens/3-font.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: Font | ||
description: Font information | ||
draft: true | ||
status: in-development | ||
--- | ||
|
||
## Font family | ||
|
||
<FontFamilyTable /> | ||
|
||
## Font sizes | ||
|
||
<FontSizeTable /> | ||
|
||
## Font weights | ||
|
||
<FontWeightTable /> | ||
|
||
## Line heights | ||
|
||
<LineHeightTable /> | ||
|
||
## Letter spacing | ||
|
||
<LetterSpacingTable /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { cn } from '@/lib/cn'; | ||
|
||
export function Draft() { | ||
return ( | ||
<span | ||
className={cn( | ||
`px-lg py-xs text-sm font-semibold rounded`, | ||
'text-gray-700 bg-gray-100', | ||
)} | ||
> | ||
Draft | ||
</span> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
apps/docs/src/components/document/typography/font-family-table.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { meta } from '@govie-ds/theme-govie'; | ||
import { FontTable } from './font-table'; | ||
|
||
export function FontFamilyTable() { | ||
return ( | ||
<FontTable<string[]> | ||
name="font-family" | ||
tokens={meta.light.resolved.primitive.font.family} | ||
renderValue={(value) => value.join(', ')} | ||
renderExample={(value) => ( | ||
<span style={{ fontFamily: value.join(', ') }}>Sample text</span> | ||
)} | ||
/> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
apps/docs/src/components/document/typography/font-size-table.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { meta } from '@govie-ds/theme-govie'; | ||
import { FontTable } from './font-table'; | ||
|
||
export function FontSizeTable() { | ||
return ( | ||
<FontTable<string> | ||
name="font-size" | ||
tokens={meta.light.resolved.primitive.font.size} | ||
renderValue={(value) => value} | ||
renderExample={(value) => ( | ||
<span style={{ fontSize: value }}>Sample text</span> | ||
)} | ||
/> | ||
); | ||
} |
26 changes: 0 additions & 26 deletions
26
apps/docs/src/components/document/typography/font-sizes-table.tsx
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
apps/docs/src/components/document/typography/font-table.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Table, Td } from './table'; | ||
import { TokenName } from '../color/token-name'; | ||
import { objectKeys } from 'ts-extras'; | ||
|
||
export function FontTable<TValue>({ | ||
name, | ||
tokens, | ||
renderValue, | ||
renderExample, | ||
}: { | ||
name: string; | ||
tokens: Record<string, { $value: TValue }>; | ||
renderValue: (value: TValue) => React.ReactNode; | ||
renderExample: (value: TValue) => React.ReactNode; | ||
}) { | ||
return ( | ||
<Table | ||
headers={['Token', 'Value', 'Example']} | ||
ids={objectKeys(tokens)} | ||
renderRow={(id) => { | ||
const { $value: value } = tokens[id]; | ||
|
||
return ( | ||
<tr key={id}> | ||
<Td className="whitespace-nowrap w-[1px] text-sm"> | ||
<TokenName name={`${name}/${id}`} /> | ||
</Td> | ||
<Td className="text-sm">{renderValue(value)}</Td> | ||
<Td>{renderExample(value)}</Td> | ||
</tr> | ||
); | ||
}} | ||
/> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
apps/docs/src/components/document/typography/font-weight-table.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { meta } from '@govie-ds/theme-govie'; | ||
import { FontTable } from './font-table'; | ||
|
||
export function FontWeightTable() { | ||
return ( | ||
<FontTable<string> | ||
name="font-weight" | ||
tokens={meta.light.resolved.primitive.font.size} | ||
renderValue={(value) => value} | ||
renderExample={(value) => ( | ||
<span style={{ fontWeight: value }}>Sample text</span> | ||
)} | ||
/> | ||
); | ||
} |
28 changes: 0 additions & 28 deletions
28
apps/docs/src/components/document/typography/font-weights-table.tsx
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
apps/docs/src/components/document/typography/letter-spacing-table.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { meta } from '@govie-ds/theme-govie'; | ||
import { FontTable } from './font-table'; | ||
|
||
export function LetterSpacingTable() { | ||
return ( | ||
<FontTable<string> | ||
name="letter-spacing" | ||
tokens={meta.light.resolved.primitive.font.letterSpacing} | ||
renderValue={(value) => value} | ||
renderExample={(value) => ( | ||
<span style={{ letterSpacing: value }}>Sample text</span> | ||
)} | ||
/> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
apps/docs/src/components/document/typography/line-height-table.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { meta } from '@govie-ds/theme-govie'; | ||
import { FontTable } from './font-table'; | ||
|
||
export function LineHeightTable() { | ||
return ( | ||
<FontTable<number> | ||
name="line-height" | ||
tokens={meta.light.resolved.primitive.font.lineHeight} | ||
renderValue={(value) => value} | ||
renderExample={(value) => ( | ||
<span style={{ lineHeight: value }}>Sample text</span> | ||
)} | ||
/> | ||
); | ||
} |