-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(BaseStyles): remove unknown props from fallback when feature flag…
… is enabled (#5606) * refactor(storybook): add feature flags as outermost component * fix(FeatureFlags): merge scope with parent context scope * fix(BaseStyles): remove unknown props from fallback when feature flag is enabled * chore: add changeset * chore: fix eslint violation * test(vrt): update snapshots * chore: add stylelint disables * test(vrt): update snapshots * Revert "test(vrt): update snapshots" This reverts commit f127d0c. * fix(BaseStyles): add data-color-mode support for color-scheme * test(vrt): update snapshots --------- Co-authored-by: joshblack <joshblack@users.noreply.github.com> Co-authored-by: Jon Rohan <yes@jonrohan.codes>
- Loading branch information
1 parent
50ef6a4
commit f291e81
Showing
32 changed files
with
68 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
Update BaseStyles to no longer pass system props when feature flag is enabled |
Binary file modified
BIN
+537 Bytes
(100%)
...apshots/SelectPanel-With-Css-dark-colorblind-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+718 Bytes
(100%)
...s-snapshots/SelectPanel-With-Css-dark-dimmed-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+354 Bytes
(100%)
...hots/SelectPanel-With-Css-dark-high-contrast-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+537 Bytes
(100%)
....test.ts-snapshots/SelectPanel-With-Css-dark-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+537 Bytes
(100%)
...apshots/SelectPanel-With-Css-dark-tritanopia-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+410 Bytes
(100%)
...pshots/SelectPanel-With-Css-light-colorblind-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+293 Bytes
(100%)
...ots/SelectPanel-With-Css-light-high-contrast-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+410 Bytes
(100%)
...test.ts-snapshots/SelectPanel-With-Css-light-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+410 Bytes
(100%)
...pshots/SelectPanel-With-Css-light-tritanopia-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+537 Bytes
(100%)
.../SelectPanel-With-Sx-and-Css-dark-colorblind-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+709 Bytes
(100%)
...hots/SelectPanel-With-Sx-and-Css-dark-dimmed-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+353 Bytes
(100%)
...lectPanel-With-Sx-and-Css-dark-high-contrast-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+537 Bytes
(100%)
...s-snapshots/SelectPanel-With-Sx-and-Css-dark-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+537 Bytes
(100%)
.../SelectPanel-With-Sx-and-Css-dark-tritanopia-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+407 Bytes
(100%)
...SelectPanel-With-Sx-and-Css-light-colorblind-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+293 Bytes
(100%)
...ectPanel-With-Sx-and-Css-light-high-contrast-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+410 Bytes
(100%)
...-snapshots/SelectPanel-With-Sx-and-Css-light-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+410 Bytes
(100%)
...SelectPanel-With-Sx-and-Css-light-tritanopia-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-35 Bytes
(100%)
...napshots/SelectPanel-With-Sx-dark-colorblind-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+97 Bytes
(100%)
...ts-snapshots/SelectPanel-With-Sx-dark-dimmed-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-70 Bytes
(100%)
...shots/SelectPanel-With-Sx-dark-high-contrast-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-35 Bytes
(100%)
...l.test.ts-snapshots/SelectPanel-With-Sx-dark-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-29 Bytes
(100%)
...napshots/SelectPanel-With-Sx-dark-tritanopia-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-98 Bytes
(100%)
...apshots/SelectPanel-With-Sx-light-colorblind-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-165 Bytes
(100%)
...hots/SelectPanel-With-Sx-light-high-contrast-modern-action-list--true-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-98 Bytes
(100%)
....test.ts-snapshots/SelectPanel-With-Sx-light-modern-action-list--true-linux.png
Oops, something went wrong.
Binary file modified
BIN
-98 Bytes
(100%)
...apshots/SelectPanel-With-Sx-light-tritanopia-modern-action-list--true-linux.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import React, {useMemo} from 'react' | ||
import React, {useContext, useMemo} from 'react' | ||
import {FeatureFlagContext} from './FeatureFlagContext' | ||
import {FeatureFlagScope, type FeatureFlags} from './FeatureFlagScope' | ||
import {DefaultFeatureFlags} from './DefaultFeatureFlags' | ||
|
||
export type FeatureFlagsProps = React.PropsWithChildren<{ | ||
flags: FeatureFlags | ||
}> | ||
|
||
export function FeatureFlags({children, flags}: FeatureFlagsProps) { | ||
const parentFeatureFlags = useContext(FeatureFlagContext) | ||
const value = useMemo(() => { | ||
const scope = FeatureFlagScope.merge(DefaultFeatureFlags, FeatureFlagScope.create(flags)) | ||
const scope = FeatureFlagScope.merge(parentFeatureFlags, FeatureFlagScope.create(flags)) | ||
return scope | ||
}, [flags]) | ||
}, [parentFeatureFlags, flags]) | ||
return <FeatureFlagContext.Provider value={value}>{children}</FeatureFlagContext.Provider> | ||
} |