Skip to content

Commit

Permalink
Merge pull request #17 from MysticalMike60t/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
MysticalMike60t authored Sep 10, 2024
2 parents 7772e9b + b508812 commit dd1636f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "caden",
"version": "1.0.14",
"version": "1.0.15",
"description": "UI Npm Package",
"main": "lib/index.js",
"files": [
Expand Down
24 changes: 22 additions & 2 deletions src/components/UI/Buttons/Submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,31 @@ const getButtonStyles = (type) => {
const Submit = ({
className = "submit-button",
type = "button",
uniLabel,
useInput = false,
children,
...props
}) => {
const style = getButtonStyles(type);

return (
<button type={type} className={className} style={style} {...props}>
return useInput ? (
<input
type={type}
className={className}
style={style}
aria-label={uniLabel}
title={uniLabel}
{...props}
/>
) : (
<button
type={type}
className={className}
style={style}
aria-label={uniLabel}
title={uniLabel}
{...props}
>
<span className="button-content">{children}</span>
</button>
);
Expand All @@ -55,6 +73,8 @@ const Submit = ({
Submit.propTypes = {
className: PropTypes.string,
type: PropTypes.oneOf(["button", "submit", "reset"]),
uniLabel: PropTypes.string,
useInput: PropTypes.bool,
children: PropTypes.node.isRequired,
};

Expand Down
3 changes: 0 additions & 3 deletions src/styles/css/index.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
body {
background: red !important;
}
.submit-button {
background: var(--primary-background);
color: var(--primary-color);
Expand Down
2 changes: 1 addition & 1 deletion testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "testing",
"version": "0.1.0",
"version": "1.0.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
Expand Down
21 changes: 4 additions & 17 deletions testing/src/App.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
import logo from './logo.svg';
import './App.css';
import { UI } from "caden";
import "caden/lib/styles/css/index.css";

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<div>
<UI.Buttons.Submit>Submit</UI.Buttons.Submit>
</div>
);
}
Expand Down

0 comments on commit dd1636f

Please sign in to comment.