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: transform state to corresponding css selector and data-attr #1979

Merged
merged 15 commits into from
Apr 11, 2022

Conversation

sebald
Copy link
Member

@sebald sebald commented Apr 11, 2022

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Apr 11, 2022

🦋 Changeset detected

Latest commit: c681b36

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@marigold/system Patch
@marigold/docs Patch
@marigold/components Patch
@marigold/icons Patch
@marigold/storybook-config Patch
@marigold/theme-b2b Patch
@marigold/theme-core Patch
@marigold/theme-unicorn Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the type:feature New feature or component label Apr 11, 2022
@sebald sebald requested a review from ti10le April 11, 2022 06:42
@sebald sebald mentioned this pull request Apr 11, 2022
3 tasks
* (e.g. `[data-hover]` and `[data-focus]`).
*/
export const useStateProps = (
states: { [key in ComponentState]?: boolean } = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

coverage has pointed out that there is no test when {} is specified without states. So the default. Then I asked myself, should I just add the test or check in the hook if states are specified and if not show an error message? Or why should you use the hook without specifying states? What do you mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's fine to pass an empty object. Even though this night never happen in the real world 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

But then fix coverage with a test for this, right? 😊

Copy link
Contributor

Choose a reason for hiding this comment

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

hm.. still saying line 27 is not tested. Whats the problem?

packages/system/src/components/Box/utils.test.ts Outdated Show resolved Hide resolved
@sebald sebald requested a review from ti10le April 11, 2022 11:38
@ti10le ti10le merged commit 424f170 into main Apr 11, 2022
@ti10le ti10le deleted the transform-pseudos branch April 11, 2022 12:26
sebald added a commit that referenced this pull request Apr 15, 2022
* main: (32 commits)
  refa: remove unsued elements from <Aspect> (#2000)
  refa: divider restructure (#1999)
  feat(comp): headline component (#1998)
  feat: New component <Content> (#1997)
  fix docu links and card (#1995)
  refa: card styles structur (#1994)
  feat: Update styles for input and texarea with hovers (#1993)
  refa: Link styles (#1992)
  refa: textarea restructure styles (#1991)
  refa: Input Component restyled and restructure (#1990)
  refa: Field Component restructure (#1988)
  docs: delete default variant in docs (#1986)
  fix: export useStateHook from system (#1985)
  refa: Image new styling solution (#1984)
  fix(docs): remove old Field component and replace with Textfield (#1983)
  feat: transform state to corresponding css selector and data-attr (#1979)
  refa: Badge uses new styling solution (#1982)
  refa: remove <ActionGroup>
  chore(deps): update dependency @types/react to v17.0.44 (#1974)
  fix(deps): update dependency @babel/core to v7.17.9 (#1975)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants