Skip to content

Commit 09e0bf9

Browse files
authored
Merge branch 'main' into siddharth/actionlist-a11y
2 parents cfa94c4 + 26c7784 commit 09e0bf9

File tree

15 files changed

+74
-72
lines changed

15 files changed

+74
-72
lines changed

.changeset/funny-ears-add.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
Checkbox: `value` prop is now optional

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ jobs:
2929

3030
- name: Test
3131
run: npm run test
32+
33+
- name: Type check
34+
run: npm run test:type-check

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"lint:fix": "npm run lint -- --fix",
4545
"test": "jest",
4646
"test:update": "npm run test -- --updateSnapshot",
47+
"test:type-check": "tsc --noEmit",
4748
"release": "npm run build && changeset publish",
4849
"size": "size-limit",
4950
"prepare": "husky install"

src/Button/Button2.stories.tsx

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React, {useState, forwardRef} from 'react'
2-
import {Button, ButtonProps, IconButton, LinkButton} from '.'
3-
import {BaseStyles, ThemeProvider} from '..'
1+
import {EyeClosedIcon, EyeIcon, SearchIcon, TriangleDownIcon, XIcon} from '@primer/octicons-react'
42
import {Meta} from '@storybook/react'
5-
import {XIcon, SearchIcon, EyeIcon, EyeClosedIcon, TriangleDownIcon, TriangleRightIcon} from '@primer/octicons-react'
3+
import React, {useState} from 'react'
4+
import {Button, ButtonProps, IconButton} from '.'
5+
import {BaseStyles, ThemeProvider} from '..'
66
import Box from '../Box'
77

88
export default {
@@ -186,52 +186,52 @@ export const disabledButton = ({...args}: ButtonProps) => {
186186
)
187187
}
188188

189-
type ReactRouterLikeLinkProps = {to: string; children: React.ReactNode}
190-
const ReactRouterLikeLink = forwardRef<HTMLAnchorElement, ReactRouterLikeLinkProps>(
191-
({to, ...props}: {to: string; children: React.ReactNode}, ref) => {
192-
// eslint-disable-next-line jsx-a11y/anchor-has-content
193-
return <a ref={ref} href={to} {...props} />
194-
}
195-
)
189+
// type ReactRouterLikeLinkProps = {to: string; children: React.ReactNode}
190+
// const ReactRouterLikeLink = forwardRef<HTMLAnchorElement, ReactRouterLikeLinkProps>(
191+
// ({to, ...props}: {to: string; children: React.ReactNode}, ref) => {
192+
// // eslint-disable-next-line jsx-a11y/anchor-has-content
193+
// return <a ref={ref} href={to} {...props} />
194+
// }
195+
// )
196196

197-
export const linkButton = ({...args}: ButtonProps) => {
198-
return (
199-
<>
200-
<Box mb={2} display="flex">
201-
<LinkButton href="https://primer.style/" {...args}>
202-
Link to Primer
203-
</LinkButton>
204-
</Box>
205-
<Box mb={2} display="flex">
206-
<LinkButton href="https://primer.style/" variant="danger" {...args}>
207-
Link to Primer
208-
</LinkButton>
209-
</Box>
210-
<Box mb={2} display="flex">
211-
<LinkButton href="https://primer.style/" variant="primary" {...args}>
212-
Link to Primer
213-
</LinkButton>
214-
</Box>
215-
<Box mb={2} display="flex">
216-
<LinkButton href="https://primer.style/" variant="outline" {...args}>
217-
Link to Primer
218-
</LinkButton>
219-
</Box>
220-
<Box mb={2} display="flex">
221-
<LinkButton href="https://primer.style/" variant="invisible" {...args}>
222-
Link to Primer
223-
</LinkButton>
224-
</Box>
225-
<Box mb={2} display="flex">
226-
<LinkButton href="https://primer.style/" variant="primary" trailingIcon={TriangleRightIcon} {...args}>
227-
Link to Primer
228-
</LinkButton>
229-
</Box>
230-
<Box mb={2} display="flex">
231-
<LinkButton to="/dummy" as={ReactRouterLikeLink} variant="primary" trailingIcon={TriangleRightIcon} {...args}>
232-
Link to Primer
233-
</LinkButton>
234-
</Box>
235-
</>
236-
)
237-
}
197+
// export const linkButton = ({...args}: ButtonProps) => {
198+
// return (
199+
// <>
200+
// <Box mb={2} display="flex">
201+
// <LinkButton href="https://primer.style/" {...args}>
202+
// Link to Primer
203+
// </LinkButton>
204+
// </Box>
205+
// <Box mb={2} display="flex">
206+
// <LinkButton href="https://primer.style/" variant="danger" {...args}>
207+
// Link to Primer
208+
// </LinkButton>
209+
// </Box>
210+
// <Box mb={2} display="flex">
211+
// <LinkButton href="https://primer.style/" variant="primary" {...args}>
212+
// Link to Primer
213+
// </LinkButton>
214+
// </Box>
215+
// <Box mb={2} display="flex">
216+
// <LinkButton href="https://primer.style/" variant="outline" {...args}>
217+
// Link to Primer
218+
// </LinkButton>
219+
// </Box>
220+
// <Box mb={2} display="flex">
221+
// <LinkButton href="https://primer.style/" variant="invisible" {...args}>
222+
// Link to Primer
223+
// </LinkButton>
224+
// </Box>
225+
// <Box mb={2} display="flex">
226+
// <LinkButton href="https://primer.style/" variant="primary" trailingIcon={TriangleRightIcon} {...args}>
227+
// Link to Primer
228+
// </LinkButton>
229+
// </Box>
230+
// <Box mb={2} display="flex">
231+
// <LinkButton to="/dummy" as={ReactRouterLikeLink} variant="primary" trailingIcon={TriangleRightIcon} {...args}>
232+
// Link to Primer
233+
// </LinkButton>
234+
// </Box>
235+
// </>
236+
// )
237+
// }

src/Checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export type CheckboxProps = {
3030
* A unique value that is never shown to the user.
3131
* Used during form submission and to identify which checkbox inputs are selected
3232
*/
33-
value: string
33+
value?: string
3434
} & Exclude<InputHTMLAttributes<HTMLInputElement>, 'value'> &
3535
SxProp
3636

src/PageLayout/PageLayout.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {Meta, Story} from '@storybook/react'
22
import React from 'react'
3-
import {Box, BranchName, Heading, Link, SideNav, StateLabel, TabNav, Text} from '..'
4-
import {Button} from '../drafts'
3+
import {Box, BranchName, Heading, Link, SideNav, StateLabel, TabNav, Text, Button} from '..'
54
import {Placeholder} from '../Placeholder'
65
import {PageLayout} from './PageLayout'
76

src/Select.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import styled from 'styled-components'
33
import {get} from './constants'
44
import TextInputWrapper, {StyledWrapperProps} from './_TextInputWrapper'
55

6-
type SelectProps = Omit<
7-
Omit<React.HTMLProps<HTMLSelectElement>, 'size'> & Omit<StyledWrapperProps, 'variant'>,
6+
export type SelectProps = Omit<
7+
Omit<React.ComponentPropsWithoutRef<'select'>, 'size'> & Omit<StyledWrapperProps, 'variant'>,
88
'multiple' | 'hasLeadingVisual' | 'hasTrailingVisual' | 'as'
99
>
1010

@@ -42,7 +42,7 @@ const ArrowIndicator = styled(ArrowIndicatorSVG)`
4242
`
4343

4444
const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
45-
({children, disabled, placeholder, size, required, validationStatus, ref: _propsRef, ...rest}: SelectProps, ref) => (
45+
({children, disabled, placeholder, size, required, validationStatus, ...rest}: SelectProps, ref) => (
4646
<TextInputWrapper
4747
sx={{
4848
position: 'relative'

src/__tests__/LabelGroup.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const comp = (
1010
<LabelGroup>
1111
<Label>Default label</Label>
1212
<Label>Darker gray label</Label>
13-
<Label outline>Default outline label</Label>
1413
</LabelGroup>
1514
)
1615

src/__tests__/deprecated/Label.types.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import Label from '../deprecated/Label'
2+
import Label from '../../deprecated/Label'
33

44
export function shouldAcceptCallWithNoProps() {
55
return <Label />

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export {default as ProgressBar} from './ProgressBar'
111111
export type {ProgressBarProps} from './ProgressBar'
112112
export {default as RadioGroup} from './RadioGroup'
113113
export {default as Select} from './Select'
114+
export type {SelectProps} from './Select'
114115
export {SelectPanel} from './SelectPanel'
115116
export type {SelectPanelProps} from './SelectPanel'
116117
export {default as SideNav} from './SideNav'

0 commit comments

Comments
 (0)