Skip to content

Commit 89996ee

Browse files
authored
Merge pull request #1220 from sonatype/RSC-1795_small-button
RSC-1795 add small button modifier class
2 parents 29124e2 + e64de82 commit 89996ee

118 files changed

Lines changed: 441 additions & 87 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gallery/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sonatype/react-shared-components-gallery",
3-
"version": "12.18.3",
3+
"version": "12.18.4",
44
"description": "Gallery application to demonstrate usage and look of Sonatype shared UI components",
55
"main": "src/main.ts",
66
"scripts": {

gallery/src/styles/NxBtn/NxBtnLinkExample.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
<a href="#/" class="nx-btn">Secondary</a>
1212
<a href="#/" class="nx-btn nx-btn--tertiary">Tertiary</a>
1313
<a href="#/" class="nx-btn nx-btn--error">Error</a>
14+
<a href="#/" class="nx-btn nx-btn--small">Small</a>
1415
</div>
1516
<div class="nx-btn-bar">
1617
<a href="#/" class="nx-btn nx-btn--primary disabled">Primary Disabled</a>
1718
<a href="#/" class="nx-btn disabled">Secondary Disabled</a>
1819
<a href="#/" class="nx-btn nx-btn--tertiary disabled">Tertiary Disabled</a>
1920
<a href="#/" class="nx-btn nx-btn--error disabled">Error Disabled</a>
2021
</div>
22+
<div class="nx-btn-bar">
23+
<a href="#/" class="nx-btn nx-btn--small disabled">Small Disabled</a>
24+
</div>

gallery/src/styles/NxBtn/NxBtnPage.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const nxBtnPrimaryCode = require('./NxBtnPrimaryExample.html'),
1414
nxBtnTertiaryCode = require('./NxBtnTertiaryExample.html'),
1515
nxBtnErrorCode = require('./NxBtnErrorExample.html'),
1616
nxBtnIconCode = require('./NxBtnIconExample.html'),
17-
nxBtnLinkCode = require('./NxBtnLinkExample.html');
17+
nxBtnLinkCode = require('./NxBtnLinkExample.html'),
18+
nxBtnSmallCode = require('./NxBtnSmallExample.html');
1819

1920
const NxBtnPage = () =>
2021
<>
@@ -62,6 +63,15 @@ const NxBtnPage = () =>
6263
<NxTable.Cell>Modifier on <NxCode>.nx-btn</NxCode></NxTable.Cell>
6364
<NxTable.Cell>Makes the button a "tertiary" button</NxTable.Cell>
6465
</NxTable.Row>
66+
<NxTable.Row>
67+
<NxTable.Cell><NxCode>nx-btn--small</NxCode></NxTable.Cell>
68+
<NxTable.Cell>Modifier on <NxCode>.nx-btn</NxCode></NxTable.Cell>
69+
<NxTable.Cell>
70+
Small Buttons are typically used in situations where patterns that contain a button are repeated
71+
(Tables, Cards, etc). This is done in order to reduce user overwhelm, as well as the page height
72+
used.
73+
</NxTable.Cell>
74+
</NxTable.Row>
6575
<NxTable.Row>
6676
<NxTable.Cell><NxCode>nx-btn--error</NxCode></NxTable.Cell>
6777
<NxTable.Cell>Modifier on <NxCode>.nx-btn</NxCode></NxTable.Cell>
@@ -145,6 +155,14 @@ const NxBtnPage = () =>
145155
error buttons. Note that the standard disabled styles override the error styles.
146156
</GalleryExampleTile>
147157

158+
<GalleryExampleTile title="Small"
159+
htmlExample={nxBtnSmallCode}
160+
codeExamples={nxBtnSmallCode}>
161+
A demonstration of buttons using the <NxCode>nx-btn--small</NxCode> modifier, which can be combined with any
162+
button variant (primary, secondary, tertiary, error, icon-only). This example shows various combinations including
163+
disabled states. Note that the standard disabled styles override the error styles.
164+
</GalleryExampleTile>
165+
148166
<GalleryExampleTile title="Buttons with Icons"
149167
htmlExample={nxBtnIconCode}
150168
codeExamples={nxBtnIconCode}>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
3+
Copyright (c) 2019-present Sonatype, Inc.
4+
This program and the accompanying materials are made available under
5+
the terms of the Eclipse Public License 2.0 which accompanies this
6+
distribution and is available at https://www.eclipse.org/legal/epl-2.0/.
7+
8+
-->
9+
<div id="nx-button-small-example">
10+
<div class="nx-btn-bar">
11+
<button class="nx-btn nx-btn--primary nx-btn--small">Primary button</button>
12+
<button class="nx-btn nx-btn--secondary nx-btn--small">Secondary button</button>
13+
<button class="nx-btn nx-btn--tertiary nx-btn--small">Tertiary button</button>
14+
<button class="nx-btn nx-btn--error nx-btn--small">Error button</button>
15+
<button class="nx-btn nx-btn--small" disabled>Small button disabled</button>
16+
</div>
17+
<div class="nx-btn-bar">
18+
<button class="nx-btn nx-btn--tertiary nx-btn--small" id="nx-button-small-icon-button">
19+
<span>Button with icon</span><!--
20+
--><svg class="nx-icon" style="height: 1em; width: 1em;" viewBox="-1 -1 2 2">
21+
<rect width="2" height="2" x="-1" y="-1"/>
22+
</svg>
23+
</button>
24+
</div>
25+
</div>
Lines changed: 3 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)