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

Box block, VariantProps fix #162

Merged
merged 4 commits into from
Feb 14, 2023
Merged

Box block, VariantProps fix #162

merged 4 commits into from
Feb 14, 2023

Conversation

shawnbot
Copy link
Member

@shawnbot shawnbot commented Feb 9, 2023

Two things:

  1. I set display: block in the default styles for <Box>, which simplifies <Box as='a'> or any other element that isn't block-level by default.
  2. I replaced our broken VariantProps type with the one from Stitches. Let's see if this improves autocompletion and errors with the as prop in sfgov-next. 🤞

@shawnbot shawnbot temporarily deployed to sfgov-design-system-pr-162 February 9, 2023 18:23 Inactive
@shawnbot shawnbot temporarily deployed to sfgov-design-system-pr-162 February 9, 2023 18:57 Inactive
@github-actions
Copy link

github-actions bot commented Feb 9, 2023

Size Change: +104 B (0%)

Total Size: 277 kB

Filename Size Change
dist/react/index.js 61.9 kB +54 B (0%)
dist/react/index.mjs 60.8 kB +50 B (0%)
ℹ️ View Unchanged
Filename Size
dist/css/base.css 273 B
dist/css/components.css 878 B
dist/css/fonts.css 170 B
dist/css/icons.css 140 B
dist/css/overrides.css 104 B
dist/css/sfds.css 48.3 kB
dist/css/typography.css 557 B
dist/css/utilities.css 46.7 kB
dist/elements/index.js 28.7 kB
dist/elements/index.mjs 28.5 kB

compressed-size-action

Comment on lines +18 to +19
// FIXME[1.0]: remove this alias
export type FlexVariant = FlexProps
Copy link
Member Author

Choose a reason for hiding this comment

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

FlexVariant was a typo 😭 so I'm adding FlexProps and aliasing it to FlexVariant so that we don't have to release this as a breaking change. The FIXME[1.0] comment should remind us to remove the alias when we release 1.0.

@shawnbot shawnbot requested a review from joni-f-g February 9, 2023 19:01
import React, { Component, ComponentProps, ComponentType } from 'react'
import React, { ComponentProps, ComponentType } from 'react'

// XXX: export type { VariantProps } from '@stitches/react'

Choose a reason for hiding this comment

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

should we just delete this? also, I think I'm confused on whether the stitches VariantProps is working or causing issues. but down to merge this and see if it fixes the linting errors

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 don't know, tbh. It doesn't hurt to keep the comment around as a reminder that we could bring back the stitches type if/when it's fixed upstream, though.

Choose a reason for hiding this comment

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

sgtm!

@shawnbot shawnbot merged commit c332401 into main Feb 14, 2023
@shawnbot shawnbot deleted the fix/box-block branch February 14, 2023 18:11
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.

2 participants