-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate status page and status block
- Loading branch information
Showing
72 changed files
with
1,199 additions
and
353 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
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,39 @@ | ||
@use '~@talend/design-tokens/lib/tokens'; | ||
|
||
.legend { | ||
margin: tokens.$coral-spacing-m 0; | ||
padding: tokens.$coral-spacing-xs tokens.$coral-spacing-m; | ||
/* stylelint-disable-next-line declaration-no-important */ | ||
color: tokens.$coral-color-neutral-text-weak !important; | ||
background: tokens.$coral-color-neutral-background-medium; | ||
border-radius: tokens.$coral-radius-s; | ||
} | ||
|
||
.dl { | ||
display: grid; | ||
gap: 1ch; | ||
grid-template: auto / auto 1fr; | ||
|
||
dt { | ||
font: tokens.$coral-paragraph-m-bold; | ||
} | ||
} | ||
|
||
.table.table { | ||
overflow: auto; | ||
|
||
th { | ||
position: sticky; | ||
top: 0; | ||
} | ||
|
||
th + th, | ||
td + td { | ||
width: 20rem; | ||
} | ||
} | ||
|
||
.tag { | ||
padding: 0 tokens.$coral-spacing-xxs; | ||
border-radius: tokens.$coral-radius-s; | ||
} |
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,58 @@ | ||
import { Suspense } from 'react'; | ||
|
||
import theme from './StatusTable.module.scss'; | ||
|
||
import statuses from '@talend/design-system/src/stories/status.json'; | ||
import { Statuses, ComponentStatuses } from '@talend/storybook-docs'; | ||
|
||
function toTitleCase(value: string) { | ||
return value | ||
.replace(/([A-Z])/g, match => ` ${match}`) | ||
.replace(/^./, match => match.toUpperCase()) | ||
.trim(); | ||
} | ||
|
||
export function StatusTable() { | ||
return ( | ||
<> | ||
<div className={theme.legend}> | ||
<dl className={theme.dl}> | ||
<dt>Figma</dt> | ||
<dd> | ||
All use cases have been designed, Figma library is ready to be consumed by designers. | ||
</dd> | ||
<dt>Storybook</dt> | ||
<dd>The guidelines are exhaustive and all sections have been completed.</dd> | ||
<dt>React</dt> | ||
<dd>The component is ready to be used by developers in their project.</dd> | ||
<dt>i18n</dt> | ||
<dd> | ||
Wording have been checked and translated on each supported languages by translators. | ||
</dd> | ||
</dl> | ||
</div> | ||
<Suspense fallback={<span>Loading status...</span>}> | ||
<table className={theme.table}> | ||
<thead> | ||
<tr> | ||
<th>Component</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{Object.entries(statuses).map(([componentId, info]) => { | ||
return ( | ||
<tr key={componentId}> | ||
<td>{toTitleCase(componentId)}</td> | ||
<td> | ||
<ComponentStatuses {...(info as Statuses)} /> | ||
</td> | ||
</tr> | ||
); | ||
})} | ||
</tbody> | ||
</table> | ||
</Suspense> | ||
</> | ||
); | ||
} |
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,11 @@ | ||
import { Unstyled, Meta } from '@storybook/blocks'; | ||
import { Card, Grid, SearchBar } from '@talend/storybook-docs'; | ||
import { StatusTable } from './StatusTable'; | ||
|
||
<Meta title="Component status" /> | ||
|
||
# Component status | ||
|
||
<Unstyled> | ||
<StatusTable /> | ||
</Unstyled> |
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,9 @@ | ||
import statuses from './status.json'; | ||
import { Statuses, ComponentStatuses } from '@talend/storybook-docs'; | ||
|
||
type StatusesConfig = Record<string, Statuses>; | ||
|
||
export function Status({ id }: { id: string }) { | ||
const info = (statuses as StatusesConfig)[id]; | ||
return <ComponentStatuses {...info} />; | ||
} |
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
11 changes: 4 additions & 7 deletions
11
packages/design-system/src/stories/clickable/ButtonIcon.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
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
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
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
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
Oops, something went wrong.