-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BD-46] docs: refactoring Table on docs site #1859
[BD-46] docs: refactoring Table on docs site #1859
Conversation
Thanks for the pull request, @PKulkoRaccoonGang! When this pull request is ready, tag your edX technical lead. |
Codecov ReportBase: 90.41% // Head: 90.41% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## alpha #1859 +/- ##
=======================================
Coverage 90.41% 90.41%
=======================================
Files 192 192
Lines 3120 3120
Branches 746 746
=======================================
Hits 2821 2821
Misses 283 283
Partials 16 16 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
05ca9c9
to
ccedf4d
Compare
color: themeName, | ||
level: levels[index], | ||
}))} | ||
columns={[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be better to implement a custom cell component and use accessor
option of DataTable
, e.g.
const CodeCell = ({ value }) => (
<code style={{ fontSize: '16px' }}>
{value}
</code>
);
...
columns={[
{
Header: 'Use',
accessor: 'use',
Cell: CodeCell,
},
{
Header: 'Color',
accessor: 'color',
Cell: CodeCell,
},
{
Header: 'Level',
accessor: 'level',
Cell: CodeCell,
},
]}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
export interface IBoxShadowToolkit { | ||
id: number, | ||
updateBoxShadow: Function, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you be more specific here about what function it is? I mean what it expects as arguments and what it returns, see Declaration component for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thaks
const [boxShadows, setBoxShadows] = useState([{ id: 1, enabled: true, style: DEFAULT_BOX_SHADOW }]); | ||
|
||
const updateBoxShadow = (shadow, id) => { | ||
const updateBoxShadow = (shadow: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this IBoxShadowModel
interface defined above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it`s true
<strong>Levels</strong> | ||
<br /> | ||
<p>Box-shadows elevation levels</p> | ||
</td> | ||
<td> | ||
<td className="p-3" style={{ verticalAlign: 'baseline' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have .align-baseline
CSS utility class for this style, could we use it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, thanks
|
||
const linksClassesAndDescriptions = [ | ||
{ | ||
name: 'Standalone Link', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can wrap both name
and text
into span
tag or something else and just render it instead of using _dangerouslySetInnerHTML
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
<div className="mb-4"> | ||
<DataTable | ||
itemCount={2} | ||
data={bodyClassesAndDescriptions.map(({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to do .map
here, data={bodyClassesAndDescriptions}
should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done
<div className="mb-4"> | ||
<DataTable | ||
itemCount={3} | ||
data={linksClassesAndDescriptions.map(({ name, text }) => ({ name, text }))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to do .map
here, data={linksClassesAndDescriptions} should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, simplified
<div className="mb-4"> | ||
<DataTable | ||
itemCount={2} | ||
data={decorationAndEmphasisClassesAndDescriptions.map(({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to do .map
here, data={decorationAndEmphasisClassesAndDescriptions}
should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, simplified
<div className="mb-4"> | ||
<DataTable | ||
itemCount={2} | ||
data={alignmentClassesAndDescriptions.map(({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to do .map
here, data={alignmentClassesAndDescriptions}
should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, simplified
640b576
to
a80816a
Compare
refactor: refactoring tables refactor: fixed tsconfig parsing error and polised code refactor: refactoring after review refactor: refactoring tables refactor: refactoring Table on docs site
a80816a
to
ab3e6fd
Compare
@@ -245,45 +251,31 @@ export default function ColorsPage({ data }: IColorsPage) { | |||
<strong>theme-color(“gray”, 300)</strong>; | |||
</code> | |||
|
|||
<h3>CSS Class Utilties</h3> | |||
<h3>CSS Class Utilities</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@PKulkoRaccoonGang 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
🎉 This PR is included in version 21.0.0-alpha.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* build: switch base to trying a rebase (#2047) * build: pull from alpha before rebase master (#2049) * build: git checkout instead of git switch (#2051) * build: set base branch to alpha (#2053) * feat: alpha release of design tokens (#1770) * build: add alpha/beta to release CI workflow * feat: design tokens with style-dictionary BREAKING CHANGE: Introduces design tokens. * [BD-46] resolve bootstrap conflicts with design tokens (#1800) * feat: resolve some Bootstrap conflicts with design tokens Co-authored-by: Peter Kulko <93188219+PKulkoRaccoonGang@users.noreply.github.com> * feat: add ability to generate CSS utility classes through design tokens * docs: added background-color for color HEX values on CSS utility classes page * fix: add missed border utilities * docs: add ability to view CSS variables on CSS Utility Classes page * chore: remove unused import * feat: remove deprecated components BREAKING CHANGE: all of the deprecated components were removed from Paragon, these include `CheckBoxGroup`, `Checkbox`, `Fieldset`, `Input`, `InputSelect`, `InputText`, `ListBox`, `Modal`, `RadioButtonGroup`, `StatusAlert`, `Table`, `TextArea`, `ValidationFormGroup`, `Button.Deprecated`, `Tabs.Deprecated`, `Dropdown.Deprecated`. * chore: update tokens for Modal components * docs: display computed CSS variables on components' pages * refactor: update design tokens structure * feat: add CLI interface for design tokens (#1846) * fix: install dependencies in tokens module after installing Paragon * fix: remove package.json files from tokens module * refactor: update design tokens structure * refactor: replace old tables with `DataTable` on documentation site (#1859) * [BD-46] refactor: improve design tokens architecture (#1874) * refactor: update design tokens naming and add missing ones * feat: expose replace vars script to CLI Co-authored-by: Viktor Rusakov <vrusakov66@gmail.com> * build: add workflow_dispatch to alpha branch to trigger release * fix: trigger release * fix: added custom title for CSS output files (#1985) * feat: deleted value in reference design tokens (#1989) * fix: ensure design tokens have a valid type attribute (#1992) Adds `type` attribute to all design tokens per W3C design tokens spec. * fix: add missing tokens for Button component (#1924) * feat: add new tokens and cleanup after rebase * feat: alpha release of design tokens (#1770) * feat: design tokens with style-dictionary BREAKING CHANGE: Introduces design tokens. * [BD-46] resolve bootstrap conflicts with design tokens (#1800) * feat: resolve some Bootstrap conflicts with design tokens Co-authored-by: Peter Kulko <93188219+PKulkoRaccoonGang@users.noreply.github.com> * feat: add ability to generate CSS utility classes through design tokens * docs: added background-color for color HEX values on CSS utility classes page * fix: add missed border utilities * docs: add ability to view CSS variables on CSS Utility Classes page * chore: remove unused import * feat: remove deprecated components BREAKING CHANGE: all of the deprecated components were removed from Paragon, these include `CheckBoxGroup`, `Checkbox`, `Fieldset`, `Input`, `InputSelect`, `InputText`, `ListBox`, `Modal`, `RadioButtonGroup`, `StatusAlert`, `Table`, `TextArea`, `ValidationFormGroup`, `Button.Deprecated`, `Tabs.Deprecated`, `Dropdown.Deprecated`. * chore: update tokens for Modal components * refactor: update design tokens structure * feat: add CLI interface for design tokens (#1846) * fix: install dependencies in tokens module after installing Paragon * fix: remove package.json files from tokens module * refactor: update design tokens structure * [BD-46] refactor: improve design tokens architecture (#1874) * refactor: update design tokens naming and add missing ones * feat: expose replace vars script to CLI Co-authored-by: Viktor Rusakov <vrusakov66@gmail.com> * fix: trigger release * feat: deleted value in reference design tokens (#1989) * fix: ensure design tokens have a valid type attribute (#1992) Adds `type` attribute to all design tokens per W3C design tokens spec. * fix: add missing tokens for Button component (#1924) * Revert "chore(release): sync from master to alpha (#2040)" This reverts commit 14ba07c. * feat: add new tokens and cleanup after rebase --------- Co-authored-by: Adam Stankiewicz <agstanki@gmail.com> Co-authored-by: Viktor Rusakov <52399399+viktorrusakov@users.noreply.github.com> Co-authored-by: Peter Kulko <93188219+PKulkoRaccoonGang@users.noreply.github.com> Co-authored-by: Viktor Rusakov <vrusakov66@gmail.com>
Description
Guides
andFoundations
and update styles for tables;Tables
with existing ones in Paragon.Merge Checklist
example
app?wittjeff
andadamstankiewicz
as reviewers on this PR.Post-merge Checklist