Skip to content

Commit a667eaf

Browse files
committed
fix(ui-buttons): address PR review feedback
Remove v1 test files (only latest version needs tests) and simplify backgroundless button documentation section in v2 Button README.
1 parent 084d515 commit a667eaf

8 files changed

Lines changed: 23 additions & 1632 deletions

File tree

packages/ui-buttons/src/BaseButton/v1/__tests__/BaseButton.test.tsx

Lines changed: 0 additions & 448 deletions
This file was deleted.

packages/ui-buttons/src/Button/v1/__tests__/Button.test.tsx

Lines changed: 0 additions & 498 deletions
This file was deleted.

packages/ui-buttons/src/Button/v2/README.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,24 @@ type: example
2424
<Button color="secondary" margin="small">Secondary</Button>
2525
<Button color="success" margin="small">Success</Button>
2626
<Button color="danger" margin="small">Danger</Button>
27-
<Button color="primary-inverse" margin="small">Primary Inverse</Button>
2827
<Button color="ai-primary" margin="small">AI Primary</Button>
2928
<Button color="ai-secondary" margin="small">AI Secondary</Button>
3029
</View>
3130
```
3231

32+
### Primary Inverse
33+
34+
The `primary-inverse` color is designed for use on colored backgrounds. It provides adequate contrast when placed on colored surfaces.
35+
36+
```js
37+
---
38+
type: example
39+
---
40+
<View display="block" background="brand" padding="small">
41+
<Button color="primary-inverse" margin="small">Primary Inverse</Button>
42+
</View>
43+
```
44+
3345
### AI buttons
3446

3547
There is a specific need for `AI buttons`, which has an icon and gradient colors for `background` and `borders`. Here are the preset examples you can use. (the `IconButton` examples are also included for convenience)
@@ -39,12 +51,12 @@ There is a specific need for `AI buttons`, which has an icon and gradient colors
3951
type: example
4052
---
4153
<View display="block">
42-
<Button color="ai-primary" renderIcon={SparklesInstUIIcon} margin="small">AI Primary</Button>
43-
<Button color="ai-secondary" renderIcon={SparklesInstUIIcon} margin="small">AI Secondary</Button>
44-
<IconButton color="ai-primary" screenReaderLabel="AI button" margin="small"><SparklesInstUIIcon/></IconButton>
45-
<IconButton shape='circle' color="ai-secondary" screenReaderLabel="AI button" margin="small"><SparklesInstUIIcon/></IconButton>
46-
<IconButton shape='circle' color="ai-primary" screenReaderLabel="AI button" margin="small"><SparklesInstUIIcon/></IconButton>
47-
<IconButton color="ai-secondary" screenReaderLabel="AI button" margin="small"><SparklesInstUIIcon/></IconButton>
54+
<Button color="ai-primary" renderIcon={IgniteaiLogoInstUIIcon} margin="small">AI Primary</Button>
55+
<Button color="ai-secondary" renderIcon={IgniteaiLogoInstUIIcon} margin="small">AI Secondary</Button>
56+
<IconButton color="ai-primary" screenReaderLabel="AI button" margin="small"><IgniteaiLogoInstUIIcon/></IconButton>
57+
<IconButton shape='circle' color="ai-secondary" screenReaderLabel="AI button" margin="small"><IgniteaiLogoInstUIIcon/></IconButton>
58+
<IconButton shape='circle' color="ai-primary" screenReaderLabel="AI button" margin="small"><IgniteaiLogoInstUIIcon/></IconButton>
59+
<IconButton color="ai-secondary" screenReaderLabel="AI button" margin="small"><IgniteaiLogoInstUIIcon/></IconButton>
4860
</View>
4961
```
5062

@@ -72,7 +84,6 @@ type: example
7284
<View display="block">
7385
<Button size="condensedSmall" margin="small">Condensed Small</Button>
7486
<Button size="condensedMedium" margin="small">Condensed Medium</Button>
75-
<Button size="small" margin="small">Small</Button>
7687
</View>
7788
```
7889

@@ -184,16 +195,14 @@ type: example
184195

185196
### Rendering Buttons without backgrounds
186197

187-
Use backgroundless buttons for interfaces on dark backgrounds or when there is a need to deemphasize the button from another primary action on the page. Be sure to use border/text colors that meet the proper contrast ratios with whatever background they are placed on.
198+
Use backgroundless buttons when there is a need to deemphasize the button. Be sure to use border/text colors that meet the proper contrast ratios with whatever background they are placed on.
188199

189200
```js
190201
---
191202
type: example
192203
---
193204
<View display="block">
194-
<View display="inline-block" background="primary">
195-
<Button renderIcon={PlusInstUIIcon} withBackground={false} color="primary" margin="small">Click here</Button>
196-
</View>
205+
<Button renderIcon={PlusInstUIIcon} withBackground={false} color="secondary" margin="small">Click here</Button>
197206
</View>
198207
```
199208

packages/ui-buttons/src/CloseButton/v1/__tests__/CloseButton.test.tsx

Lines changed: 0 additions & 72 deletions
This file was deleted.

packages/ui-buttons/src/CondensedButton/v1/__tests__/CondensedButton.test.tsx

Lines changed: 0 additions & 186 deletions
This file was deleted.

0 commit comments

Comments
 (0)