Skip to content

Commit

Permalink
NewButton -> Button2 (#1730)
Browse files Browse the repository at this point in the history
* Rename new button stuff

* Update tests

* Export Button component

* Change button2 storybook name

* Create fuzzy-meals-explain.md
  • Loading branch information
pksjce committed Dec 17, 2021
1 parent 4ab78a2 commit a9dc6f2
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-meals-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

NewButton -> Button2 file name changes
2 changes: 1 addition & 1 deletion src/NewButton/button.tsx → src/Button2/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {forwardRef} from 'react'
import {ButtonProps} from './types'
import ButtonBase from './button-base'
import ButtonBase from './ButtonBase'

const Button = forwardRef<HTMLButtonElement, ButtonProps>(({children, ...props}, forwardedRef): JSX.Element => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, {useState, forwardRef} from 'react'
import {NewButton as Button, NewButtonProps as ButtonProps, IconButton, ButtonLink} from '../NewButton'
import {Button, ButtonProps, IconButton, ButtonLink} from '.'
import {BaseStyles, ThemeProvider} from '..'
import {Meta} from '@storybook/react'
import {XIcon, SearchIcon, EyeIcon, EyeClosedIcon, TriangleDownIcon, TriangleRightIcon} from '@primer/octicons-react'
import Box from '../Box'

export default {
title: 'Composite components/New Button',
title: 'Composite components/Button2',

decorators: [
Story => {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {forwardRef} from 'react'
import {LinkButtonProps} from './types'
import ButtonBase, {ButtonBaseProps} from './button-base'
import ButtonBase, {ButtonBaseProps} from './ButtonBase'
import {ForwardRefComponent as PolymorphicForwardRefComponent} from '@radix-ui/react-polymorphic'

type MyProps = LinkButtonProps & ButtonBaseProps
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions src/Button2/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {Button as ButtonComponent} from './Button'
import {Counter} from './ButtonCounter'
import IconButton from './IconButton'
import ButtonLink from './ButtonLink'
import {ButtonProps, IconButtonProps} from './types'
// change this when moving to released state
export type {ButtonProps, IconButtonProps}
export const Button = Object.assign(ButtonComponent, {
Counter
})
export {IconButton, ButtonLink}
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions src/NewButton/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import {IconButton, NewButton as Button} from '../NewButton'
import {IconButton, Button} from '../Button2'
import {behavesAsComponent} from '../utils/testing'
import {render, cleanup, fireEvent} from '@testing-library/react'
import {axe, toHaveNoViolations} from 'jest-axe'
Expand Down
2 changes: 1 addition & 1 deletion src/drafts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

// Components
export * from './ActionList2'
export * from './NewButton'
export * from './Button2'
export * from './ActionMenu2'
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ export {
ButtonClose,
ButtonGroup
} from './Button'
export {NewButton} from './NewButton'
export type {NewButtonProps} from './NewButton'
export type {
ButtonProps,
ButtonDangerProps,
Expand Down

0 comments on commit a9dc6f2

Please sign in to comment.