Skip to content

Commit

Permalink
Merge pull request #214 from fedspendingtransparency/mod/11104
Browse files Browse the repository at this point in the history
DEV-11104 updated styles for dtui button
  • Loading branch information
brianpetway authored Jul 11, 2024
2 parents fba97ae + 2b3d67e commit a3db2e2
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 23 deletions.
28 changes: 19 additions & 9 deletions components/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import React from 'react';
import PropTypes from "prop-types";

require('../styles/components/_buttons.scss');

const propTypes = {
Expand Down Expand Up @@ -159,28 +160,37 @@ const Button = (props) => {
<a aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onKeyUp={props.onKeyUp} onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }} target="_blank" rel="noopener noreferrer" href={props.to}>{props.copy}</a>
);
}
else if (classNameList.includes('left-icon')) {
if (classNameList.includes('left-icon')) {
return (
<button aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }}>{props.image}{props.copy}</button>
<button type="button" aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }}>
{props.image}
{props.copy}
</button>
);
}
else if (classNameList.includes('right-icon')) {
if (classNameList.includes('right-icon')) {
return (
<button aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }}>{props.copy}{props.image}</button>
<button type="button" aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }}>
{props.copy}
{props.image}
</button>
);
}
else if (classNameList.includes('stacked-icon')) {
if (classNameList.includes('stacked-icon')) {
return (
<button aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }}><div className="stacked-button__only-image">{props.image}</div><div className="stacked-button__only-text">{props.copy}</div></button>
<button type="button" aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }}>
<div className="stacked-button__only-image">{props.image}</div>
<div className="stacked-button__only-text">{props.copy}</div>
</button>
);
}
else if (classNameList.includes('icon-light') || classNameList.includes('icon-dark')) {
if (classNameList.includes('icon-light') || classNameList.includes('icon-dark')) {
return (
<button aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }}>{props.image}</button>
<button type="button" aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }}>{props.image}</button>
);
}
return (
<button aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }}>{props.copy}</button>
<button type="button" aria-label={props.buttonTitle} className={classNameList} tabIndex="0" onClick={props.onClick} disabled={props.disabled} style={{ maxWidth: props.maxWidth }}>{props.copy}</button>
);
};

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/485.76410a82.iframe.bundle.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/485.e7f45bd1.iframe.bundle.js

This file was deleted.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
/* eslint-enable object-shorthand */
})
);
};</script><link href="main.a339a42cbe0f798dcecb.css" rel="stylesheet"><style>#root[hidden],
};</script><link href="main.92ec3f92d8fb49a7feca.css" rel="stylesheet"><style>#root[hidden],
#docs-root[hidden] {
display: none !important;
}</style></head><body><div class="sb-preparing-story sb-wrapper"><div class="sb-loader"></div></div><div class="sb-preparing-docs sb-wrapper"><div class="sb-previewBlock"><div class="sb-previewBlock_header"><div class="sb-previewBlock_icon"></div><div class="sb-previewBlock_icon"></div><div class="sb-previewBlock_icon"></div><div class="sb-previewBlock_icon"></div></div><div class="sb-previewBlock_body"><div class="sb-loader"></div></div></div><table aria-hidden="true" class="sb-argstableBlock"><thead class="sb-argstableBlock-head"><tr><th><span>Name</span></th><th><span>Description</span></th><th><span>Default</span></th><th><span>Control</span></th></tr></thead><tbody class="sb-argstableBlock-body"><tr><td><span>propertyName</span><span title="Required">*</span></td><td><div><span>This is a short description</span></div><div class="sb-argstableBlock-summary"><div><span class="sb-argstableBlock-code">summary</span></div></div></td><td><div><span class="sb-argstableBlock-code">defaultValue</span></div></td><td><button>Set string</button></td></tr><tr><td><span>propertyName</span><span>*</span></td><td><div><span>This is a short description</span></div><div class="sb-argstableBlock-summary"><div><span class="sb-argstableBlock-code">summary</span></div></div></td><td><div><span class="sb-argstableBlock-code">defaultValue</span></div></td><td><button>Set string</button></td></tr><tr><td><span>propertyName</span><span>*</span></td><td><div><span>This is a short description</span></div><div class="sb-argstableBlock-summary"><div><span class="sb-argstableBlock-code">summary</span></div></div></td><td><div><span class="sb-argstableBlock-code">defaultValue</span></div></td><td><button>Set string</button></td></tr></tbody></table></div><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script>window['CONFIG_TYPE'] = "PRODUCTION";
Expand All @@ -361,4 +361,4 @@



window['STORIES'] = [{"titlePrefix":"","directory":"./.storybook","files":"**/stories/*.stories.@(mdx|js)","importPathMatcher":"^\\.[\\\\/](?:\\.storybook(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)stories[\\\\/](?!\\.)(?=.)[^\\\\/]*?\\.stories\\.(mdx|js))$"}];</script><script src="runtime~main.868a37cc.iframe.bundle.js"></script><script src="485.e7f45bd1.iframe.bundle.js"></script><script src="main.ddbcd588.iframe.bundle.js"></script></body></html>
window['STORIES'] = [{"titlePrefix":"","directory":"./.storybook","files":"**/stories/*.stories.@(mdx|js)","importPathMatcher":"^\\.[\\\\/](?:\\.storybook(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)stories[\\\\/](?!\\.)(?=.)[^\\\\/]*?\\.stories\\.(mdx|js))$"}];</script><script src="runtime~main.868a37cc.iframe.bundle.js"></script><script src="485.76410a82.iframe.bundle.js"></script><script src="main.9d30d29d.iframe.bundle.js"></script></body></html>
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@



window['DOCS_MODE'] = false;</script><script src="runtime~main.8ac9679e5b3555cd15a8.manager.bundle.js"></script><script src="9.2ea4b4363700694a72a8.manager.bundle.js"></script><script src="main.291306767fc68e9e39cb.manager.bundle.js"></script></body></html>
window['DOCS_MODE'] = false;</script><script src="runtime~main.8ac9679e5b3555cd15a8.manager.bundle.js"></script><script src="9.eef9e4cabd109ad744df.manager.bundle.js"></script><script src="main.291306767fc68e9e39cb.manager.bundle.js"></script></body></html>
Loading

0 comments on commit a3db2e2

Please sign in to comment.