-
Notifications
You must be signed in to change notification settings - Fork 91
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(peer-deps): extend styled-components
support to v6
#1978
Conversation
package.json
Outdated
"stylelint": "16.10.0", | ||
"stylelint-order": "6.0.4", | ||
"stylis": "4.3.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing this added dependency used anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The migration docs are misleading. 🤔 stylis
is a dependency of styled-component
. Therefore, this can be removed. Good catch. 💯
utils/build/styled.d.ts
Outdated
|
||
export const ThemeContext: React.Context<DefaultTheme>; | ||
export interface ThemeProviderProps<T extends object, U extends object = T> { | ||
children?: React.ReactNode | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
children?: React.ReactNode | undefined; | |
children?: ReactNode | undefined; |
...with import { ReactNode } from 'react';
${props.theme.rtl ? '-45deg' : '45deg'}, | ||
transparent, | ||
${getBackgroundColor}, | ||
transparent | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please restore indentation, if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've restored the indentation but extra whitespaces have to be accounted for when using toHaveStyleRule
with styled-components@v6
. Is that acceptable?
packages/notifications/src/elements/global-alert/GlobalAlert.tsx
Outdated
Show resolved
Hide resolved
… ze-flo/styled-components-v6
@@ -38,7 +39,9 @@ export const Breadcrumb = forwardRef<HTMLElement, HTMLAttributes<HTMLElement>>(( | |||
<> | |||
<StyledBreadcrumbItem>{child}</StyledBreadcrumbItem> | |||
<StyledCenteredBreadcrumbItem> | |||
<StyledChevronIcon /> | |||
<StyledChevronIcon> | |||
<ChevronRightStrokeIcon /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our SVGO config adds aria-hidden="true"
to svgs.
${props.theme.rtl ? '-45deg' : '45deg'}, | ||
transparent, | ||
${getBackgroundColor}, | ||
transparent | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've restored the indentation but extra whitespaces have to be accounted for when using toHaveStyleRule
with styled-components@v6
. Is that acceptable?
packages/theming/src/index.ts
Outdated
@@ -24,7 +24,7 @@ export { useWindow } from './utils/useWindow'; | |||
export { useText } from './utils/useText'; | |||
export { default as menuStyles } from './utils/menuStyles'; | |||
export { focusStyles, SELECTOR_FOCUS_VISIBLE } from './utils/focusStyles'; | |||
export { StyledBaseIcon } from './utils/StyledBaseIcon'; | |||
export { StyledBaseIcon, type IStyledBaseIconProps } from './utils/StyledBaseIcon'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with exporting this, but:
- I wouldn't expect us to reuse within other packages; in other words, it's for consumers-only
- it should be moved to the
type
export section below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fantastic work here 🎉
The work done in #1985 helped me identify props rendered as invalid attributes. 😌 refactor(modal header): use transient props fix: prevent invalid DOM attributes fix(splitter): prevent invalid DOM attrs In stories, HTML elements receiving theme colors render invalid This will be resolved in a future PR. |
[email protected]
styled-components
support to v6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the theming
package need its styled-components
range expanded?
Good call out. Fixed. ✅ |
902f12f
to
07ecb06
Compare
Description
This PR paves the way to making Garden compatible with
[email protected]
.Detail
Checklist
npm start
)⬅️ renders as expected with reversed (RTL) direction⚫ renders as expected in dark mode🤘 renders as expected with Bedrock CSS (?bedrock
)♿ tested for WCAG 2.1 AA accessibility compliance📝 tested in Chrome, Firefox, Safari, and Edge