-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into VanAnderson/migrate-tab-nav-to-tsx
- Loading branch information
Showing
18 changed files
with
167 additions
and
96 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/components": patch | ||
--- | ||
|
||
Migrate `CircleBadge` to TypeScript |
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/components": patch | ||
--- | ||
|
||
Migrate `CircleOcticon` to TypeScript |
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/components": patch | ||
--- | ||
|
||
Migrate `Position` to TypeScript |
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/components": patch | ||
--- | ||
|
||
Migrate `TextInput` to TypeScript |
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 @@ | ||
declare module '@styled-system/props' |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import Box from './Box' | ||
import {POSITION, SystemPositionProps} from './constants' | ||
import sx from './sx' | ||
import theme from './theme' | ||
import {ComponentProps} from './utils/types' | ||
|
||
type StyledPositionProps = {as?: React.ElementType} & SystemPositionProps | ||
|
||
const Position = styled(Box)<StyledPositionProps>` | ||
${POSITION}; | ||
${sx}; | ||
` | ||
|
||
Position.defaultProps = { | ||
theme | ||
} | ||
|
||
Position.propTypes = { | ||
...Box.propTypes, | ||
...POSITION.propTypes, | ||
theme: PropTypes.object, | ||
...sx.propTypes | ||
} | ||
|
||
export type PositionProps = ComponentProps<typeof Position> | ||
export default Position | ||
|
||
// Absolute | ||
export type AbsoluteProps = Omit<PositionProps, 'position'> | ||
export function Absolute(props: AbsoluteProps) { | ||
return <Position {...props} position="absolute" /> | ||
} | ||
Absolute.defaultProps = Position.defaultProps | ||
Absolute.propTypes = Position.propTypes | ||
|
||
// Fixed | ||
export type FixedProps = Omit<PositionProps, 'position'> | ||
export function Fixed(props: AbsoluteProps) { | ||
return <Position {...props} position="fixed" /> | ||
} | ||
Fixed.defaultProps = Position.defaultProps | ||
Fixed.propTypes = Position.propTypes | ||
|
||
// Relative | ||
export type RelativeProps = Omit<PositionProps, 'position'> | ||
export function Relative(props: RelativeProps) { | ||
return <Position {...props} position="relative" /> | ||
} | ||
Relative.defaultProps = Position.defaultProps | ||
Relative.propTypes = Position.propTypes | ||
|
||
// Sticky | ||
export type StickyProps = Omit<PositionProps, 'position'> | ||
export function Sticky(props: StickyProps) { | ||
return <Position {...props} position="sticky" /> | ||
} | ||
Sticky.defaultProps = {...Position.defaultProps, top: 0, zIndex: 1} | ||
Sticky.propTypes = Position.propTypes |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.