icgc-argo / uikit Goto Github PK
View Code? Open in Web Editor NEWRe-usable React Components for ICGC-ARGO sites
License: GNU Affero General Public License v3.0
Re-usable React Components for ICGC-ARGO sites
License: GNU Affero General Public License v3.0
Make SVGs into named exports i.e. so they can be used in Next components.
some usage of older emotion api - emotion/core
didn't break build because its a dependency of storybook
Steps to reproduce the behaviour:
A clear and concise description of what you expected to happen.
recompose, color, url-join are all prod dependencies for minor usage which can be adjusted to remove dep
I may be wrong, but react
and react-dom
may still need to be peer deps, so that React doesn't throw mismatching versions for hooks.
That's happened to me while using npm/yarn link
.
Originally posted by @caravinci in #33 (comment)
also breaking dev ci
While resolving: @icgc-argo/[email protected]
npm ERR! Found: @emotion/[email protected]
npm ERR! node_modules/@emotion/styled
npm ERR! peer @emotion/styled@"^11.6.0" from the root project
npm ERR! @emotion/styled@"^10.0.17" from @storybook/[email protected]
npm ERR! node_modules/@storybook/addon-info/node_modules/@storybook/theming
npm ERR! @storybook/theming@"5.3.21" from @storybook/[email protected]
npm ERR! node_modules/@storybook/addon-info
npm ERR! dev @storybook/addon-info@"^5.3.21" from the root project
npm ERR! @storybook/theming@"5.3.21" from @storybook/[email protected]
npm ERR! node_modules/@storybook/addon-info/node_modules/@storybook/api
npm ERR! @storybook/api@"5.3.21" from @storybook/[email protected]
npm ERR! node_modules/@storybook/addon-info/node_modules/@storybook/addons
npm ERR! @storybook/addons@"5.3.21" from @storybook/[email protected]
npm ERR! node_modules/@storybook/addon-info
npm ERR! 1 more (@storybook/components)
npm ERR! 1 more (@storybook/theming)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @emotion/styled@"^11.6.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @emotion/[email protected]
npm ERR! node_modules/@emotion/styled
npm ERR! peer @emotion/styled@"^11.6.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/runner/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-03-22T21_04_50_693Z-debug-0.log
Error: Process completed with exit code 1.
does the theme system allow for the theme to be disabled -> missing, or overwritten with a custom theme that has an entirely different shape?
in that case these chains may fail with cannot find X of undefined
.
theme?.uikit?.typography?.paragraph
covers that, but could also use having a fallback/default value if it the chain ever fails.
Originally posted by @caravinci in #33 (comment)
sure we could do theme?.uikit?.button?.md?.color but then we're just posing as the Riddler.
maybe have a local of css`` which does a check for theme
On the File entity page (Rakesh is working on) https://platform-ui.qa.argo.cancercollaboratory.org/file/00095e36-49f6-520d-bb3a-a0ae8c31eb7e
And the donor entity page (Sam is working on)
In the titlebar, there is a "Legend" button that we will need to build to help researchers know what the missing data means.
For now, let's build this in storybook and then Rakesh and Sam can bring it into their pages.
Closed button: https://zpl.io/an8jpLl
Opened button: https://zpl.io/adodrp1
Platform UI's File Entity page requires an "Open Lock" icon for files with "Open" access.
icgc-argo/platform-ui#2090
To prevent forking changes between repos, the icon has not been added to the previous UIKit. Once this repo is ready, the icon will be added and a follow-up ticket in platform-ui will be created to use the new icon there.
Icon file is attached in the zip below:
icon-unlock.svg.zip
React Table must be updated from 6 to 8 for compatibility with React 18.
Additionally, when this is completed, update the version in platform-UI and remove the warning suppression in next.config.js.
Update exports during Platform-UI integration
uikit changes in v2 branch were headed towards making uikit entirely reusable across projects.
this is incorrect. we want to keep it ARGO specific.
there are still some changes which are applicable.
consuming projects will need to update. breaking changes because the import structure of components will be completely different.
storybook default inference of prop types using react-docgen-typescript is broken
storybook docs lack prop details unless explicitly written in argTypes
Steps to reproduce the behaviour:
A clear and concise description of what you expected to happen.
UI kit Export colours as an object so we can use them outside of components.
Several components prohibit styling due to missing props.
There are conflicting usages of how we are styling which need to be made consistent.
Some rough edges to address also eg. need all colour codes defined.
styled
over inline css
Storybook has stopped working in Uikit
Accessibility is important.
In particular we want to be able to use this library in projects that have to meet a certain WCAG guidelines
@mistryrn has lots of expertise
Since UI Kit reorganization is complete(not all tickets in the epic are finished, as we decided to only make UIkit reusable for ARGO), next step is to ensure it integrates with platform u, daco ui, argo-doc and other projects.
There may be some minor tweaks needed eg. React dependency version or a certain export is missing from uikit.
storybook has some difficulties working with emotion v11
Steps to reproduce the behaviour:
A clear and concise description of what you expected to happen.
Components are handling events in various ways
Icons require too much manual tweaking
@caravinci has some input on this too... will update as soon as I find it on slack
svgs should be centered automatically
Implement Consistent Event Handling
Steps required:
As a continuation to this ticket: icgc-argo/platform-ui#2032, add all of the improvements to the button component in regards to the spinner.
Which included:
Export SVGs used by platform UI so they can be used as Next images rather than Uikit components.
Purpose: Update useEffect in <Textarea> to make rendering work when clearing contents using useState.
Issue: <Textarea> won't render properly when using useState to clear content.
See Ciaran's Explaination:
Textarea is not re-rendering because it's state is not changing. The value prop is only used to set the initial state of internalValue .
To fix, we can add value prop to the dependency array of the useEffect on line 130. This makes the function run every time the value prop changes, not just on component mounting, which is what an empty dependency array does [ ]
We also use the already existing functionality of applyChanges so nothing should break and it can reconcile any changes needed internally.
useEffect(() => {
value && applyChanges(value);
}, [value]);
Now if you try this it's still broken... but our state is being passed correctly like you said. Well, empty string '' is a falsey JS value so the shorthand of value && applyChanges(value) means applyChanges is never run. But empty string is a valid value for our textarea. So we can fix the conditional like so:
useEffect(() => {
(value || value === '') && applyChanges(value);
}, [value]);
Locate <Textarea> in src/form
and update line 127-130 to:
useEffect(() => {
(value || value === '') && applyChanges(value);
}, [value]);
Or Justin suggests to:
useEffect(() => {
(value !== internalValue) && applyChanges(value);
}, [value]);
Reason of this slight change is so that we don't need to keep adding conditions in the future.
Both cases work for the filter modal textarea.
components taking a color prop ie. Pipe takes a fill prop
should be able to take a theme color OR any valid color
currently TS will complain if color is not in theme
Write readme with examples for the new Uikit tables. Using stories for this feature is tricky due to nested components.
Button loading behaviour needs a custom loader component passed into it.
Storybook is not running correctly limited dev ability to work in this sandbox
Theming responsibility should be delegated to the consuming project for 3 reasons:
Currently we get around Emotion lib integration issues by creating our own context in uikit and exporting useTheme
with our own ThemeProvider
This works because context is shared.
css={(theme) => {...}}
this should work but Emotion uses it's own jsx runtime which in turn uses its own theme context, so our theme will always be empty object
suggestion is to move theming out of UIKit and have the consuming project decide the process
we can still export a default theme that is compatible with an Emotion theme provider
Types are too tightly coupled to the defaultTheme. Extending the theme in a project will cause type errors.
no reason for reactivity of theme provider. can just use normal object
if a project wants reactivity eg. for a dark mode
it can be added to its project
Certain components still have hardcoded features which hinder use as a reusable lib
Component: Header
Description: Logo
Component: Footer
Description: Logo
keep only the uikit section from root level, adding section from src directory
Currently consuming projects need to transpile the npm package to use svgs eg. in Icons
Shouldn't be needed...
move the src/.npmrc file to root directory and update necessary references to it
Result: Take stock of where we are and where we would like to go. Wiki will be the result, with a breakdown of tasks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.