Commit Graph

69 Commits

Author SHA1 Message Date
Nathan Vasse
90feb4ba4a 🌐(react) add i18n
We need to be able to use localized texts for various components, like for
accessible labels. We decided to setup a lightweight implementation of
localizable to avoid relying on an existing heavy library.
The Provider includes by default full translations for english, and it is
also made to be able to load easily any custom locale directly from the
Provider.
2023-03-28 12:00:27 +02:00
Nathan Vasse
1df3b82571 (react) add a temporary TextInput
Even if we haven't started to work on a complete set of inputs
we need a generic Input to implement the "goto" feature on the
Pagination component. This component is not intended to be used
in by the librarie's dependent, so we mark it as "WIP" for the
moment.
2023-03-28 12:00:27 +02:00
Nathan Vasse
980c80c784 (react) add material icons
We need some icons to implement the Pagination and the DataGrid.
2023-03-28 12:00:27 +02:00
Nathan Vasse
05242ffbcd (react) add button sizes
Add two sizes for the Button component: small and medium. They
are present on the new delivered sketches concerning pagination
but dont exists yet.
2023-03-28 12:00:27 +02:00
Nathan Vasse
f3e3b568fc (react) add active state on button
Previously we had no way of forcing a button to render in
an active state.
2023-03-28 12:00:27 +02:00
jbpenrath
8bf13ae3ad ️(react) add aria-label property to the only icon button story
As this button has no label only an icon, the a11y checker reports us
that there is no accessible label for this component.
2023-02-28 10:29:23 +01:00
jbpenrath
0274534234 (react) install storybook-a11y-addon
We need to ensure that our components are accessible. In order to ease
this task, we decide to install this package to display an a11y report
for each component into the storybook interface. In this way, developer
can check if the component it is developing violates or miss so a11y
rules.
2023-02-28 10:29:23 +01:00
Nathan Vasse
8ad95945a8 🔖(release) version packages
Bump cunningham-demo to 0.0.1
Bump @openfun/cunningham-react to 0.1.1
Bump @openfun/cunningham-tokens to 0.1.1
2023-02-21 18:32:04 +01:00
Nathan Vasse
2a5acea4a4 (tokens) css utility classes are now optionnal
Previously, when using the cunningham bin to build tokens, the CSS
file always included utility classes, resulting in duplicated CSS
utility classes on the consumer side if no specific CSS optimizer
is defined ( its local cunningham-tokens.css + the one from the
react package ). Now, this new feature introduces a param named
--utility-classes that must be provided to generate those classes.
This params is henceforth only provided to the bin inside the tokens
package.
2023-02-21 09:29:24 +01:00
Nathan Vasse
cd88e46537 ♻️(react) split fonts in a seperate CSS file
Fonts were de-facto included in the bundled dist/style.css file which
wasn't convenient in situations were consumers wanted to import fonts
by themselves.
2023-02-21 09:29:24 +01:00
ALC Consulting
479e0777b6 🐛(tokens) fix windows generate tokens
The tokens generation was failing on windows because
of the path separator.
This commit fixes this issue.
2023-02-20 11:29:36 +01:00
Nathan Vasse
722b66b3ae (react) add button with icon only
Previously using Button with only an icon made it render with an
internal offset, that wasn't really nice-looking. Now we force the
button to be squared.
2023-02-15 16:00:14 +01:00
Nathan Vasse
89138e0a5a 🔖(release) version packages
Bump @openfun/cunningham-tokens to 0.1.0
Bump @openfun/cunningham-react to 0.1.0
2023-01-31 16:19:10 +01:00
Nathan Vasse
63118d0f3e 📝(doc) update docs to install published packages + contributing guide
Updated various parts of existing documentations to make a clean path
to learn how to install the library. I let the most complicated part in
the tokens's README.md file, which is referenced from the Storybook.
2023-01-30 17:47:34 +01:00
Nathan Vasse
4ebbf168e2 🔊(changelog) migrate existing changelog entries to changeset
The entries were dispatched in matching packages, but some of them that
were about the overall monorepo's architecture (like "setup circleci"
were delete thrown away because they were not matching any specific
package.
2023-01-30 17:47:34 +01:00
Nathan Vasse
e2204a1234 👷(ci) add changeset to handle package releases and changelog
We needed a tool to automate the handling of monorepo's changelogs and
packages publishing. We want to make the CI responsible to automatically
publish bumped packages and create associated tags.
2023-01-30 17:47:34 +01:00
Nathan Vasse
1529a5b5e7 📝(doc) fixing things in doc
During the keynote we saw some things to fix in the documentation.
2023-01-25 10:37:37 +01:00
Nathan Vasse
31d29d8cbf 📝(doc) fixing typo in colors doc
So it has not more typos.
2023-01-23 13:54:02 +01:00
Nathan Vasse
9658979f54 📝(readme) update readme.md to include figma and storybook links
Things are getting nice.
2023-01-20 17:26:06 +01:00
Nathan Vasse
c032e2e951 (react) publish storybook to github pages
In order to make the storybook visible to everyone. Some changes
had to be made to make index.scss compiled with the rest of the
codebase, it had to be imported from preview.js, not directly from
preview.html.
2023-01-20 17:26:06 +01:00
Nathan Vasse
9bd7317796 📝(doc) sort docs in the Storybook's sidebar
Previously the docs order was defined by the default behavior of
Storybook: discovery order. But, in our situation we want the
"Getting Started" part to appear above "Components", and "Doc"
above any other stories. So we needed to create a custom sort callback.
In order to make this storySort callback to be taken into account by Storybook
it was needed to rename the file to preview.js. Strange but .. meh.
2023-01-20 17:00:31 +01:00
Nathan Vasse
dd2a93ffdf 📝(doc) create a global category for Components
This way we ensure that the main categories of the Storybook docs
are well separated, improving readability.
2023-01-20 17:00:31 +01:00
Nathan Vasse
54fd376e91 📝(doc) create docs for utility classes
In order to showcase the utility classes, we needed to create
beautiful tokens-based docs !
2023-01-20 17:00:31 +01:00
Nathan Vasse
b908136224 (tokens) generate css utility classes
These were the missing parts in order to use every design tokens
of Cunningham. Including: spacing, font weight, size, family, and
colors. In order to be really versatile and to allow users to
define new design tokens I had to re-organize the way those tokens
are sub divided in sub objects in cunningham.ts file. That's why
sub division are created for theme.typ.sizes for instance.
2023-01-20 17:00:31 +01:00
Nathan Vasse
3bb74d8594 🔧(demo) update demo app to customize official tokens
Showcase how to customize an official design token.
2023-01-18 11:29:33 +01:00
Nathan Vasse
ba65b195b5 👷(ci) fix symlink to Cunningham when turbo cache is on
Had the situation where the symlink to the cunningham bin was not
created on yarn build due to the fact that the tokens repo was
not updated. The turbo just replayed logs output, but doing this
prevent the symlink to be created from the package.json's build script.
So, in order to make sure that the symlink always exists, I added it
to the CI build job.
2023-01-18 11:29:33 +01:00
Nathan Vasse
b07f9cc869 (react) add danger color to Button
We adding do's and don't to the documentation I realized that the
danger button was really important in some cases even if the style
was not delivered by designers. Example: Delete buttons.
2023-01-18 11:29:33 +01:00
Nathan Vasse
163bb1f9c8 📝(react) add do's and don't to Button doc
Based on the work delivered by designers, we simply replicates those
in the storybook documentation in order to centralize everything
related to the Button component.
2023-01-18 11:29:33 +01:00
Nathan Vasse
05f9252029 (react) add icon to Button
The DS does not offer an icons set yet but it seems important to
already provide a support for external icons in Button.
2023-01-18 11:29:33 +01:00
Nathan Vasse
9fa0ff8ad3 📝(react) add documentation for Button component
Let's leverage the power of Storybook ! Use MDX file to create a
top notch documentation.
2023-01-18 11:29:33 +01:00
Nathan Vasse
7b6d130d7d (react) implement Button with official tokens
Now that we have all the official design tokens we can use them
to build the button component in various colors matching the
design system's ones.
2023-01-18 11:29:33 +01:00
Nathan Vasse
8f5e546f04 ⬆️(react) upgrade package to use official tokens
... and install user-event library. Setting the stage for
the implementation of real tokens in the Button component.
2023-01-18 11:29:33 +01:00
Nathan Vasse
e5c1693454 (tokens) add official default theme tokens
Due to the recent delivery of the design system document from
designers we are now able to define official design tokens.
2023-01-18 11:29:33 +01:00
Nathan Vasse
b0f5b94834 ♻️(tokens) transform cunningham.dist.js to cunningham.ts
As of now configuration file can use the .ts extension so it
seemed more homogeneous as the bin own source code is using
Typescript.
2023-01-18 11:29:33 +01:00
Nathan Vasse
3e10a58482 📝(changelog) update CHANGELOG.md
Update the changelog to match state of art of the repo.
2023-01-11 11:01:56 +01:00
Nathan Vasse
0311ea69d6 📝(tokens) update tokens package doc for ts and js generators
Add example and more details regarding the -g bin's option.
2023-01-11 11:01:56 +01:00
Nathan Vasse
60be194c47 ⬆️(deps) update yarn.lock
Multiple deps were added, so it's the occasion to update yarn.lock
versions to their latest peer deps.
2023-01-11 11:01:56 +01:00
Nathan Vasse
335365f910 🙈(git) update .gitignore file
Vite can sometimes leave compiled js files as scories.
2023-01-11 11:01:56 +01:00
Nathan Vasse
f48dac79c0 🔧(demo) update demo app to ts config file, customize one token
Showcase a situation where we want to customize a component's design token.
2023-01-11 11:01:56 +01:00
Nathan Vasse
be1c9d000b (react) add tokens.ts files handling
These files will be used to define the custom design tokens per components.
They are automatically aggregated by the packages/react/cunningham.ts file,
this is why handling typescript config file was important.
2023-01-11 11:01:56 +01:00
Nathan Vasse
67dd0048d0 ♻️(tokens) expose default tokens in a lib and various config
This allow to use the default tokens from Typescript or Javascript file
of dependents repos. For instance this wîll be used by packages/react
to aggregate components tokens files.
2023-01-11 11:01:56 +01:00
Nathan Vasse
be2f220624 (tokens) mock default tokens in tests
If we don't do that we will have to update all tests each time the
default value of a token is changed.
2023-01-11 11:01:56 +01:00
Nathan Vasse
2457a93ebf (tokens) add the support for Typescript config file
Add the support to load cunningham.ts local config file based on ts-node.
Those files will be loaded as CommonJS to preserve to coherence regarding
the way the cunningham bin is ran by node.
2023-01-11 11:01:56 +01:00
Nathan Vasse
56da7dde48 (tokens) add -cwd, --working-dir options to the bin
This allows to modify the working dir of the bin. This will be
particularly useful when running tests, this is not especially
intended to be vastly used by end-users.
2023-01-11 11:01:56 +01:00
Nathan Vasse
66e6aad84d (tokens) add TS generator and re-organize the repo
Add TS Generator which is a lot based on JS Generator.
2023-01-11 11:01:56 +01:00
Nathan Vasse
2876d29025 (tokens) add JS generator and re-organize the repo
Added JsGenerator which to implied to reorganize a bit the
repo in order to extract generator-specific test into specific
standalone files.
2023-01-11 11:01:56 +01:00
Nathan Vasse
3e98429d04 ♻️(typescript) move tokens sources to absolute import
Relatives import are quite ugly and reduces readability, but
hard to say that Typescript handles it very well for compilation
time, but nothing for runtime. That's why I had to add tsc-alias
to the build script. Please see this issue for more details.
https://github.com/Microsoft/TypeScript/issues/15479
Furthermore, some configuration was needed for Jest to work well.
2023-01-11 11:01:56 +01:00
Nathan Vasse
7a61402d4e 👷(ci) update gitmojis json url
The repostiory containing the list of valid emojis just got transformed
into a monorepo causing the old url to be obsolete.
2023-01-05 15:08:19 +01:00
Nathan Vasse
fa46237e05 ⬆️(dependencies) update yarn.lock
Do a fresh update of the yarn.lock file.
2023-01-05 14:24:28 +01:00
renovate[bot]
8ff8aec39f ⬆️(dependencies) update js dependencies 2023-01-05 14:24:28 +01:00