-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break KuiButton apart into KuiButton, KuiLinkButton, and KuiSubmitBut…
…ton.
- Loading branch information
Showing
10 changed files
with
759 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
169 changes: 169 additions & 0 deletions
169
ui_framework/components/button/__snapshots__/link_button.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`KuiLinkButton Baseline is rendered 1`] = ` | ||
<a | ||
className="kuiButton" | ||
onClick={[Function]} | ||
> | ||
<span /> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props children is rendered 1`] = ` | ||
<a | ||
className="kuiButton" | ||
onClick={[Function]} | ||
> | ||
<span> | ||
<span> | ||
Hello | ||
</span> | ||
</span> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props className renders the classes 1`] = ` | ||
<a | ||
className="kuiButton testClass1 testClass2" | ||
onClick={[Function]} | ||
> | ||
<span /> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props href is rendered 1`] = ` | ||
<a | ||
className="kuiButton" | ||
href="#" | ||
onClick={[Function]} | ||
> | ||
<span /> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props icon is rendered with children 1`] = ` | ||
<a | ||
className="kuiButton kuiButton--iconText" | ||
onClick={[Function]} | ||
> | ||
<span> | ||
Icon | ||
<span> | ||
Hello | ||
</span> | ||
</span> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props icon is rendered without children 1`] = ` | ||
<a | ||
className="kuiButton kuiButton--iconText" | ||
onClick={[Function]} | ||
> | ||
<span> | ||
Icon | ||
</span> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props isDisabled sets the disabled attribute 1`] = ` | ||
<a | ||
className="kuiButton" | ||
disabled={true} | ||
onClick={[Function]} | ||
> | ||
<span /> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props isIconOnRight moves the icon to the right 1`] = ` | ||
<a | ||
className="kuiButton kuiButton--iconText" | ||
onClick={[Function]} | ||
> | ||
<span> | ||
<span> | ||
Hello | ||
</span> | ||
Icon | ||
</span> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props isLoading doesn't render the icon prop 1`] = ` | ||
<a | ||
className="kuiButton kuiButton--iconText" | ||
onClick={[Function]} | ||
> | ||
<span> | ||
<KuiButtonIcon | ||
type="LOADING" | ||
/> | ||
</span> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props isLoading renders a spinner 1`] = ` | ||
<a | ||
className="kuiButton kuiButton--iconText" | ||
onClick={[Function]} | ||
> | ||
<span> | ||
<KuiButtonIcon | ||
type="LOADING" | ||
/> | ||
</span> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props target is rendered 1`] = ` | ||
<a | ||
className="kuiButton" | ||
onClick={[Function]} | ||
target="_blank" | ||
> | ||
<span /> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props testSubject is rendered 1`] = ` | ||
<a | ||
className="kuiButton" | ||
data-test-subj="test subject string" | ||
onClick={[Function]} | ||
> | ||
<span /> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props type basic renders the basic class 1`] = ` | ||
<a | ||
class="kuiButton kuiButton--basic" | ||
> | ||
<span /> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props type danger renders the danger class 1`] = ` | ||
<a | ||
class="kuiButton kuiButton--danger" | ||
> | ||
<span /> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props type hollow renders the hollow class 1`] = ` | ||
<a | ||
class="kuiButton kuiButton--hollow" | ||
> | ||
<span /> | ||
</a> | ||
`; | ||
|
||
exports[`KuiLinkButton Props type primary renders the primary class 1`] = ` | ||
<a | ||
class="kuiButton kuiButton--primary" | ||
> | ||
<span /> | ||
</a> | ||
`; |
72 changes: 72 additions & 0 deletions
72
ui_framework/components/button/__snapshots__/submit_button.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`KuiSubmitButton Baseline is rendered 1`] = ` | ||
<input | ||
className="kuiButton" | ||
onClick={[Function]} | ||
type="submit" | ||
/> | ||
`; | ||
|
||
exports[`KuiSubmitButton Props children is rendered as value 1`] = ` | ||
<input | ||
className="kuiButton" | ||
onClick={[Function]} | ||
type="submit" | ||
value="Hello" | ||
/> | ||
`; | ||
|
||
exports[`KuiSubmitButton Props className renders the classes 1`] = ` | ||
<input | ||
className="kuiButton testClass1 testClass2" | ||
onClick={[Function]} | ||
type="submit" | ||
/> | ||
`; | ||
|
||
exports[`KuiSubmitButton Props isDisabled sets the disabled attribute 1`] = ` | ||
<input | ||
className="kuiButton" | ||
disabled={true} | ||
onClick={[Function]} | ||
type="submit" | ||
/> | ||
`; | ||
|
||
exports[`KuiSubmitButton Props testSubject is rendered 1`] = ` | ||
<input | ||
className="kuiButton" | ||
data-test-subj="test subject string" | ||
onClick={[Function]} | ||
type="submit" | ||
/> | ||
`; | ||
|
||
exports[`KuiSubmitButton Props type basic renders the basic class 1`] = ` | ||
<input | ||
class="kuiButton kuiButton--basic" | ||
type="submit" | ||
/> | ||
`; | ||
|
||
exports[`KuiSubmitButton Props type danger renders the danger class 1`] = ` | ||
<input | ||
class="kuiButton kuiButton--danger" | ||
type="submit" | ||
/> | ||
`; | ||
|
||
exports[`KuiSubmitButton Props type hollow renders the hollow class 1`] = ` | ||
<input | ||
class="kuiButton kuiButton--hollow" | ||
type="submit" | ||
/> | ||
`; | ||
|
||
exports[`KuiSubmitButton Props type primary renders the primary class 1`] = ` | ||
<input | ||
class="kuiButton kuiButton--primary" | ||
type="submit" | ||
/> | ||
`; |
Oops, something went wrong.