Skip to content

Commit

Permalink
chore: polish tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfrancois committed Sep 22, 2023
1 parent 7025700 commit 6cf507c
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 20 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions packages/design-docs/src/tokens/ColorComposition.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
position: relative;

display: inline-flex;
border-radius: var(--coral-radius-m, 0.8rem);
border-radius: tokens.$coral-radius-m;
min-height: 8.4rem;
}

.score {
position: absolute;
top: var(--coral-spacing-xs, 0.8rem);
left: var(--coral-spacing-xs, 0.8rem);
top: tokens.$coral-spacing-xs;
left: tokens.$coral-spacing-xs;
}

.grid {
Expand Down
38 changes: 28 additions & 10 deletions packages/design-docs/src/tokens/Mesures.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,37 @@ import { TokenList } from './TokenValue';
type="measure"
category="spacing"
>
<div
style={{
border: `${tokens.coralBorderSDashed} ${tokens.coralColorAccentBorder}`,
borderRadius: tokens.coralRadiusM,
backgroundColor: tokens.coralColorNeutralBackground,
width: '100%',
minHeight: '100%',
}}
/>
{token => (
<div
style={{
border: `${tokens.coralBorderSDashed} ${tokens.coralColorAccentBorder}`,
borderRadius: tokens.coralRadiusM,
backgroundColor: tokens.coralColorNeutralBackground,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: '100%',
minHeight: '100%',
}}
>
{token.value}
</div>
)}
</TokenList>

## Sizing

<TokenList style={token => ({})} type="measure" category="sizing">
{token => `${token.value}`}
{token => (
<div
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
minHeight: '100%',
}}
>
{token.value}
</div>
)}
</TokenList>
15 changes: 14 additions & 1 deletion packages/design-docs/src/tokens/Radius.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,17 @@ import { TokenList } from './TokenValue';
})}
type="radius"
sortOnValue
></TokenList>
>
{token => (
<div
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
minHeight: '100%',
}}
>
{token.value}
</div>
)}
</TokenList>
17 changes: 12 additions & 5 deletions packages/design-docs/src/tokens/TokenValue.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/* eslint-disable @talend/import-depth */
import { ReactNode, useState } from 'react';
import { SizedIcon, StackVertical, StackHorizontal, ButtonTertiary } from '@talend/design-system';
import {
SizedIcon,
StackVertical,
StackHorizontal,
ButtonTertiary,
Tooltip,
} from '@talend/design-system';
import tokens from '@talend/design-tokens';
import dictionary from '@talend/design-tokens/lib/light/dictionary';
import * as utils from './TokenFormatter';
Expand Down Expand Up @@ -95,10 +101,11 @@ export function TokenList({
>
{typeof children === 'function' ? children(token) : children}
</div>
<dl style={{ margin: 0 }}>
<dt>{utils.getDisplayName(token.name)}</dt>
<dd style={{ width: 300 }}>{token.description}</dd>
</dl>
<div style={{ width: tokens.coralSizingXxxl, paddingTop: tokens.coralSpacingL }}>
<Tooltip title={token.description}>
<span>{utils.getDisplayName(token.name)}</span>
</Tooltip>
</div>
<ul style={{ listStyleType: 'none' }}>
<li>
<TokenValue lang="SCSS">{utils.getScssName(token.name)}</TokenValue>
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/stories/messaging/Tooltip.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Otherwise, you’ll just add information pollution to your UI and waste the time
<Story story={Stories.Usage} />
</Canvas>

<ArgTypes story={Stories.Usage} />
<ArgTypes of={Stories.Usage} />

For more info about Tooltip props, refer to [documentation](https://reakit.io/docs/tooltip/) of Reakit.

Expand Down

0 comments on commit 6cf507c

Please sign in to comment.