Skip to content

Commit

Permalink
Support updated high contrast themes (#1018)
Browse files Browse the repository at this point in the history
* add tooltip pattern

* control track border

* control track border

* Create quick-camels-promise.md

* github-actions[bot] Regenerated snapshots

---------

Co-authored-by: langermank <langermank@users.noreply.github.com>
  • Loading branch information
langermank and langermank authored Jul 30, 2024
1 parent 35624fa commit abe900a
Show file tree
Hide file tree
Showing 35 changed files with 159 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/quick-camels-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@primer/primitives": patch
---

- Minor changes to prepare for adding more borders to high contrast themes
- Adds tooltip pattern to allow for an inverse style in dark high contrast


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blob-report/report.zip
Binary file not shown.
53 changes: 53 additions & 0 deletions docs/storybook/stories/Color/Patterns/AllPatterns.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -725,3 +725,56 @@ export const Selection = () => {
</Table.Container>
)
}

export const Tooltip = () => {
const data = getTokensByName(colorTokens, 'tooltip').map(token => {
return {
id: token.name,
...token,
}
})
return (
<Table.Container>
<h1 className="sr-only" id="tooltip">
Tooltip
</h1>
<DataTable
aria-labelledby="tooltip"
data={data}
columns={[
{
header: 'Sample',
field: 'name',
rowHeader: true,
renderCell: row => {
return (
<ColorTokenSwatch
bgColor={row.name.includes('bgColor') || row.name.includes('iconColor') ? row.name : undefined}
textColor={row.name.includes('fgColor') ? row.name : undefined}
shadowColor={row.name.includes('shadow') ? row.name : undefined}
borderColor={row.name.includes('borderColor') ? row.name : undefined}
/>
)
},
},
{
header: 'Token',
field: 'name',
rowHeader: true,
renderCell: row => {
return <InlineCode value={row.name} copyClipboard />
},
},
{
header: 'Output value',
field: 'value',
rowHeader: true,
renderCell: row => {
return <p>{row.value}</p>
},
},
]}
/>
</Table.Container>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@
$type: 'color',
},
},
borderColor: {
rest: {
$value: '{borderColor.emphasis}',
$type: 'color',
},
},
},
button: {
primary: {
Expand Down Expand Up @@ -902,4 +908,14 @@
},
},
},
tooltip: {
bgColor: {
$value: '{bgColor.inverse}',
$type: 'color',
},
fgColor: {
$value: '{fgColor.onInverse}',
$type: 'color',
},
},
}
26 changes: 26 additions & 0 deletions src/tokens/functional/color/dark/patterns-dark.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3073,4 +3073,30 @@
},
},
},
tooltip: {
bgColor: {
$value: '{bgColor.emphasis}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
mode: 'dark',
group: 'component',
scopes: ['bgColor'],
},
},
},
fgColor: {
$value: '{fgColor.onEmphasis}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
mode: 'dark',
group: 'component',
scopes: ['fgColor'],
},
},
},
},
}
12 changes: 12 additions & 0 deletions src/tokens/functional/color/dark/primitives-dark.json5
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@
},
},
},
onInverse: {
$value: '{base.color.black}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
mode: 'dark',
group: 'semantic',
scopes: ['fgColor'],
},
},
},
white: {
$value: '{base.color.white}',
$type: 'color',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@
$type: 'color',
},
},
borderColor: {
rest: {
$value: '{borderColor.emphasis}',
$type: 'color',
},
},
},
button: {
default: {
Expand Down
26 changes: 26 additions & 0 deletions src/tokens/functional/color/light/patterns-light.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3070,4 +3070,30 @@
},
},
},
tooltip: {
bgColor: {
$value: '{bgColor.emphasis}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
mode: 'light',
group: 'component',
scopes: ['bgColor'],
},
},
},
fgColor: {
$value: '{fgColor.onEmphasis}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
mode: 'light',
group: 'component',
scopes: ['fgColor'],
},
},
},
},
}
12 changes: 12 additions & 0 deletions src/tokens/functional/color/light/primitives-light.json5
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
},
},
},
onInverse: {
$value: '{base.color.white}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
mode: 'light',
group: 'semantic',
scopes: ['fgColor'],
},
},
},
white: {
$value: '{base.color.white}',
$type: 'color',
Expand Down

0 comments on commit abe900a

Please sign in to comment.