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

feat(tokens, vital-demo): Storybook 2023 #2202

Open
wants to merge 47 commits into
base: main
Choose a base branch
from

Conversation

hvanyo
Copy link
Collaborator

@hvanyo hvanyo commented Aug 15, 2023

Changes

Updated: #1648

Test Instructions

Storybook (run from vital-demo)

  • cd sites/vital-demo-next
  • npm run storybook,
  • visit: http://localhost:6006/
  • test tokens on typography, font-size
  • some token combinations don't make sense, this is expected

Related Issues

wodenx added 30 commits April 6, 2022 06:12
);
this.add(tokens);
return this;
// TBD Conflict resolution
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@salikn --
Lines 59 - 62 was what was on MAIN a year ago.
Lines 64 - 66 was is on MAIN today. From what I can tell we update the token to HOCWithMEta to access token?.meta?
Chris replaced addCollection (lines 47-56)
that all seems to work.. and will delete all these lines but I think its useful to see and sets up for my question.

class TokenMap<P> {
protected map = new Map<string, HOC>();
const extractMeta = (token?: Token): TokenMeta => {
// TODO error TS2339: Property 'meta' does not exist on type 'HOC<{}, {}, {}>'.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@salikn
Line 25 gives type error in line 24 comment.
I played with switching token?: HOCWithMeta but it really messes up a lot of other things so not sure what was right move.
So not sure how to fix type error. Ideas?

And obviosuly I would delete line 26 once I fix type error.

// if (typeof token === 'function') return token?.meta || {};
if (typeof token === 'function') return {};
if (typeof token === 'string') return {};
return (token as TokenSpec<any, any>)?.Meta || {};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@salikn correct way to fix this type error?
(Typescript in javascript is not my expertise and I just find it PITA. )

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.

None yet

2 participants