Skip to content
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

Carbon v11 integration #1636

Closed
wants to merge 9 commits into from
Closed

Carbon v11 integration #1636

wants to merge 9 commits into from

Conversation

theetrain
Copy link
Collaborator

@theetrain theetrain commented Jan 23, 2023

Closes #1629
Closes #1616

⚠️ This should NOT be merged until all components have been converted to using v11 styles. Components should be converted one at a time and reviewed as PRs against the feat/carbon-v11 branch. We can make incremental releases to the next tag.

This PR is meant to track and discuss the progress in #1629.

Changes

General

  • Adopt @sveltejs/package for building the distributable package as ESM, which also precompiles TypeScript and SCSS
  • Upgrade routify to v2 for /docs

Button

  • feat: apply v11 styles to Button, ButtonSet, and ButtonSkeleton
  • feat: forward focus and blur events
  • fix: provide button role for custom elements using 'as'
  • BREAKING CHANGE: danger-tertiary and danger-ghost props were renamed to danger--tertiary and danger--ghost (two dashes instead of one)
  • BREAKING CHANGE: buttons now have a larger minimum width

@theetrain theetrain changed the title Feat/carbon v11 Carbon v11 integration Jan 23, 2023
@theetrain
Copy link
Collaborator Author

theetrain commented Jan 23, 2023

@metonym I've been trying to get sveld to generate an updated COMPONENT_API.json, but I can't seem to figure it out. Can you help checkout this feat/carbon-v11 branch and have a look?

I suppose sveld can derive documentation from the source files, even though I have it configured to read from /package/**.

@metonym
Copy link
Collaborator

metonym commented Jan 23, 2023

@theetrain I think import assertions require Node >=v17.5 since they're still an experimental feature.

I'm using v16 and had to run:

node --experimental-json-modules scripts/build-docs.js

The script ran with a sveld error:

Specify an entry point to your Svelte code in the "svelte" field of your package.json

I had to then manually specify a svelte value in package.json. I'll add an issue to allow an override for sveld.

+ "svelte": "src/carbon-components-svelte/index.js",

After these steps, the script ran successfully.

@theetrain
Copy link
Collaborator Author

theetrain commented Jan 26, 2023

That helped, thanks! I use Node 18, and took for granted this feature. Perhaps editing carbon-components-svelte can be done with Node 18, but we can allow users to use Node 16 when consuming the package?

I could also make these imports backwards-compatible using the tip here: https://stackoverflow.com/a/74504130/2545443

Other observations:

  • sveld doesn't recognize types from svelte/elements; we'll need to account for that when generating JSON documentation. All other typings work well.

- Configure as ES module
- Add svelte as peerDependency
- add Vite and vite-preprocess to inline imported SCSS
Support sass and typescript
Should be separate PRs
Update docs with sveld
Build npm package before testing
* feat(button): adopt v11 styles

- forward focus and blur events
- provide button role for custom elements using 'as'

BREAKING CHANGE: danger-tertiary and danger-ghost props were renamed to danger--tertiary and danger--ghost
BREAKING CHANGE: buttons now have a larger minimum width

* test: update button test
@v3ss0n
Copy link

v3ss0n commented Apr 17, 2023

Currently carbon Ui-Shell is totally broken , this PR will hopefully fix it. Please make carbon design usable.

@metonym metonym force-pushed the master branch 2 times, most recently from e7485c4 to 417102d Compare November 8, 2023 03:27
@theetrain
Copy link
Collaborator Author

Superseded by #1881

@theetrain theetrain closed this Jan 12, 2024
@theetrain theetrain deleted the feat/carbon-v11 branch January 12, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Carbon v11 style integration (component checklist) Typescript improvements
3 participants