-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hussam-i-am/preview-page' of https://github.com/primer/…
…react into hussam-i-am/preview-page
- Loading branch information
Showing
24 changed files
with
137 additions
and
239 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": minor | ||
--- | ||
|
||
Remove CSS modules feature flag from ButtonGroup |
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": minor | ||
--- | ||
|
||
Remove CSS modules feature flag from Details |
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": minor | ||
--- | ||
|
||
Remove CSS modules feature flag from Radio |
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": minor | ||
--- | ||
|
||
Remove the CSS module feature flag from Pagehead |
Binary file added
BIN
+6.72 KB
...nts/ButtonGroup.test.ts-snapshots/ButtonGroup-SX-Prop-dark-colorblind-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 added
BIN
+6.76 KB
...ponents/ButtonGroup.test.ts-snapshots/ButtonGroup-SX-Prop-dark-dimmed-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 added
BIN
+6.75 KB
.../ButtonGroup.test.ts-snapshots/ButtonGroup-SX-Prop-dark-high-contrast-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 added
BIN
+6.72 KB
...ots/components/ButtonGroup.test.ts-snapshots/ButtonGroup-SX-Prop-dark-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 added
BIN
+6.72 KB
...nts/ButtonGroup.test.ts-snapshots/ButtonGroup-SX-Prop-dark-tritanopia-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 added
BIN
+6.8 KB
...ts/ButtonGroup.test.ts-snapshots/ButtonGroup-SX-Prop-light-colorblind-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 added
BIN
+6.88 KB
...ButtonGroup.test.ts-snapshots/ButtonGroup-SX-Prop-light-high-contrast-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 added
BIN
+6.8 KB
...ts/components/ButtonGroup.test.ts-snapshots/ButtonGroup-SX-Prop-light-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 added
BIN
+6.8 KB
...ts/ButtonGroup.test.ts-snapshots/ButtonGroup-SX-Prop-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,42 +1,22 @@ | ||
import styled from 'styled-components' | ||
import React, {type ComponentProps} from 'react' | ||
import React from 'react' | ||
import {clsx} from 'clsx' | ||
import {get} from '../constants' | ||
import sx, {type SxProp} from '../sx' | ||
import {toggleStyledComponent} from '../internal/utils/toggleStyledComponent' | ||
import {type SxProp} from '../sx' | ||
import classes from './Pagehead.module.css' | ||
import {useFeatureFlag} from '../FeatureFlags' | ||
import {defaultSxProp} from '../utils/defaultSxProp' | ||
import Box from '../Box' | ||
|
||
const CSS_MODULES_FEATURE_FLAG = 'primer_react_css_modules_ga' | ||
|
||
/** | ||
* @deprecated | ||
*/ | ||
const StyledComponentPagehead = toggleStyledComponent( | ||
CSS_MODULES_FEATURE_FLAG, | ||
'div', | ||
styled.div<SxProp>` | ||
position: relative; | ||
padding-top: ${get('space.4')}; | ||
padding-bottom: ${get('space.4')}; | ||
margin-bottom: ${get('space.4')}; | ||
border-bottom: 1px solid ${get('colors.border.default')}; | ||
${sx}; | ||
`, | ||
) | ||
|
||
const Pagehead = ({className, ...rest}: PageheadProps) => { | ||
const enabled = useFeatureFlag(CSS_MODULES_FEATURE_FLAG) | ||
|
||
if (enabled) { | ||
return <StyledComponentPagehead className={clsx(classes.Pagehead, className)} {...rest} /> | ||
const Pagehead = ({className, sx: sxProp = defaultSxProp, ...rest}: PageheadProps) => { | ||
if (sxProp !== defaultSxProp || rest.as) { | ||
return <Box sx={sxProp} className={clsx(classes.Pagehead, className)} {...rest} /> | ||
} | ||
|
||
return <StyledComponentPagehead {...rest} /> | ||
return <div className={clsx(classes.Pagehead, className)} {...rest} /> | ||
} | ||
|
||
/** | ||
* @deprecated | ||
*/ | ||
export type PageheadProps = ComponentProps<typeof StyledComponentPagehead> & SxProp | ||
export type PageheadProps = SxProp & | ||
React.ComponentPropsWithoutRef<'div'> & { | ||
as?: React.ElementType | ||
} | ||
export default Pagehead |
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
Oops, something went wrong.