File tree Expand file tree Collapse file tree 8 files changed +90
-20
lines changed
src/@primer/gatsby-theme-doctocat
__tests__/deprecated/__snapshots__ Expand file tree Collapse file tree 8 files changed +90
-20
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @primer/react " : patch
3+ ---
4+
5+ Fixes layout bug with ButtonGroup by changing the ` display ` property from ` inline-block ` to ` inline-flex `
Original file line number Diff line number Diff line change @@ -7,16 +7,12 @@ storybook: '/react/storybook?path=/story/composite-components-button'
77description : Use button for the main actions on a page or form.
88---
99
10- import {Button , IconButton , LinkButton } from ' @primer/react'
11-
12- ## Usage
13-
14- ### Installation
15-
1610``` js
1711import {Button } from ' @primer/react'
1812```
1913
14+ ## Examples
15+
2016### Default button
2117
2218This is the default variant for the ` Button ` component.
@@ -122,7 +118,7 @@ Here's an example of a block button which takes 100% of available width. Checkou
122118< Button sx= {{width: ' 100%' }}> Block< / Button>
123119```
124120
125- ## API reference
121+ ## Props
126122
127123Native ` <button> ` HTML attributes are forwarded to the underlying React ` button ` component and are not listed below.
128124
@@ -165,7 +161,7 @@ Native `<button>` HTML attributes are forwarded to the underlying React `button`
165161 <PropsTableSxRow />
166162</PropsTable >
167163
168- ## Component status
164+ ## Status
169165
170166<ComponentChecklist
171167 items = { {
@@ -174,7 +170,7 @@ Native `<button>` HTML attributes are forwarded to the underlying React `button`
174170 adaptsToThemes: true ,
175171 adaptsToScreenSizes: true ,
176172 fullTestCoverage: true ,
177- usedInProduction: false ,
173+ usedInProduction: true ,
178174 usageExamplesDocumented: true ,
179175 designReviewed: false ,
180176 a11yReviewed: false ,
@@ -184,3 +180,7 @@ Native `<button>` HTML attributes are forwarded to the underlying React `button`
184180 hasFigmaComponent: false
185181 }}
186182/>
183+
184+ ## Related components
185+
186+ - [ ButtonGroup] ( /ButtonGroup )
Original file line number Diff line number Diff line change 1+ ---
2+ title : ButtonGroup
3+ componentId : button_group
4+ status : Alpha
5+ source : https://github.com/primer/react/tree/main/src/ButtonGroup
6+ ---
7+
8+ ``` js
9+ import {ButtonGroup } from ' @primer/react'
10+ ```
11+
12+ ## Examples
13+
14+ ### Default
15+
16+ ``` jsx live
17+ < ButtonGroup>
18+ < Button> Button 1 < / Button>
19+ < Button> Button 2 < / Button>
20+ < Button> Button 3 < / Button>
21+ < / ButtonGroup>
22+ ```
23+
24+ ### With icon buttons
25+
26+ ``` jsx live
27+ < ButtonGroup>
28+ < IconButton aria- label= " Zoom out" icon= {DashIcon} / >
29+ < IconButton aria- label= " Zoom in" icon= {PlusIcon} / >
30+ < / ButtonGroup>
31+ ```
32+
33+ ## Props
34+
35+ ### ButtonGroup
36+
37+ <PropsTable >
38+ <PropsTableSxRow />
39+ <PropsTableRefRow refType = " HTMLDivElement" />
40+ </PropsTable >
41+
42+ ## Status
43+
44+ <ComponentChecklist
45+ items = { {
46+ propsDocumented: true ,
47+ noUnnecessaryDeps: true ,
48+ adaptsToThemes: true ,
49+ adaptsToScreenSizes: true ,
50+ fullTestCoverage: true ,
51+ usedInProduction: false ,
52+ usageExamplesDocumented: true ,
53+ hasStorybookStories: false ,
54+ designReviewed: false ,
55+ a11yReviewed: false ,
56+ stableApi: false ,
57+ addressedApiFeedback: false ,
58+ hasDesignGuidelines: false ,
59+ hasFigmaComponent: false
60+ }}
61+ />
62+
63+ ## Related components
64+
65+ - [ Button] ( /Button )
Original file line number Diff line number Diff line change 5555 url : /Breadcrumbs
5656 - title : Button
5757 url : /Button
58+ - title : ButtonGroup
59+ url : /ButtonGroup
5860 - title : Checkbox
5961 url : /Checkbox
6062 - title : CheckboxGroup
Original file line number Diff line number Diff line change 11import styled from 'styled-components'
2- import Box from './Box'
32import { get } from './constants'
43import sx from './sx'
54import { ComponentProps } from './utils/types'
65
7- const ButtonGroup = styled ( Box ) `
6+ const ButtonGroup = styled . div `
7+ display: inline-flex;
88 vertical-align: middle;
99
1010 && > * {
@@ -47,9 +47,5 @@ const ButtonGroup = styled(Box)`
4747 ${ sx } ;
4848`
4949
50- ButtonGroup . defaultProps = {
51- display : 'inline-block'
52- }
53-
5450export type ButtonGroupProps = ComponentProps < typeof ButtonGroup >
5551export default ButtonGroup
Original file line number Diff line number Diff line change @@ -298,7 +298,10 @@ exports[`ButtonDanger renders correct disabled styles 1`] = `
298298
299299exports [` ButtonGroup renders consistently 1` ] = `
300300.c0 {
301- display : inline - block ;
301+ display : - webkit - inline - box ;
302+ display : - webkit - inline - flex ;
303+ display : - ms - inline - flexbox ;
304+ display : inline - flex ;
302305 vertical - align : middle ;
303306}
304307
@@ -344,7 +347,6 @@ exports[`ButtonGroup renders consistently 1`] = `
344347
345348<div
346349 className = " c0"
347- display = " inline-block"
348350/>
349351` ;
350352
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ export const NestedOverlays = () => {
249249 < div >
250250 primary overlay open: { String ( listOverlayOpen ) } , secondary overlay open: { String ( createListOverlayOpen ) }
251251 </ div >
252- < ButtonGroup display = "block" my = { 2 } >
252+ < ButtonGroup >
253253 < Button > Star</ Button >
254254 < Button
255255 aria-label = "Add this repository to a list"
@@ -332,7 +332,7 @@ export const MemexNestedOverlays = () => {
332332
333333 return (
334334 < div >
335- < ButtonGroup display = "block" my = { 2 } >
335+ < ButtonGroup >
336336 < Button > Add iteration</ Button >
337337 < Button
338338 aria-label = "Add custom iteration"
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export const closeButton = (args: ButtonStyleProps) => (
6666 < ButtonClose { ...args } onClick = { ( ) => alert ( 'button clicked.' ) } />
6767)
6868export const buttonGroup = ( args : StrictButtonStyleProps ) => (
69- < ButtonGroup display = "block" my = { 2 } >
69+ < ButtonGroup >
7070 < Button { ...args } > Button 1</ Button >
7171 < Button { ...args } > Button 2</ Button >
7272 < Button { ...args } > Button 3</ Button >
You can’t perform that action at this time.
0 commit comments