Skip to content

Commit 0f07ead

Browse files
committed
version 0.3.1 with tertiary buttons
1 parent bead061 commit 0f07ead

File tree

10 files changed

+90
-12
lines changed

10 files changed

+90
-12
lines changed

dist/lite-react-ui.es.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lite-react-ui.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@mdx-js/react": "^1.6.18",
1212
"@next/mdx": "^9.1.1",
1313
"@tailwindcss/aspect-ratio": "^0.2.1",
14-
"lite-react-ui": "^0.3.0",
14+
"lite-react-ui": "^0.3.1",
1515
"next": "latest",
1616
"react": "^16.8.6",
1717
"react-dom": "^16.8.6",

docs/pages/buttons.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@ The button component by default renders with a button type of
1111

1212
<br/>
1313

14-
<div className="flex space-x-4">
14+
<div className="flex flex-col space-y-2 twr-bg-grey-400">
1515
<Button>
1616
Hello World 🌍
1717
</Button>
1818

1919
<Button buttonType="secondary">
2020
Hello World 🌍
2121
</Button>
22+
23+
<Button buttonType="tertiary">
24+
Hello World 🌍
25+
</Button>
26+
<div className="w-full bg-black py-3 px-1 rounded-lg">
27+
<Button className="w-full" inverted buttonType="tertiary">
28+
Hello World 🌍
29+
</Button>
30+
</div>
2231
</div>
2332

2433

@@ -31,6 +40,14 @@ The button component by default renders with a button type of
3140
<Button buttonType="secondary">
3241
Hello World 🌍
3342
</Button>
43+
44+
<Button buttonType="tertiary">
45+
Hello World 🌍
46+
</Button>
47+
48+
<Button inverted buttonType="tertiary">
49+
Hello World 🌍
50+
</Button>
3451
```
3552

3653
<br/>

docs/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,10 +2193,10 @@ lite-react-ui@^0.2.6:
21932193
react "^17.0.0"
21942194
react-dom "^17.0.0"
21952195

2196-
lite-react-ui@^0.3.0:
2197-
version "0.3.0"
2198-
resolved "https://registry.yarnpkg.com/lite-react-ui/-/lite-react-ui-0.3.0.tgz#8b8ed4075a570ab2320ed2e28c7ad1dc4f602356"
2199-
integrity sha512-7iJF7tSjmZ2C3t7gVGzptgnu2wqjS0CpLG5PQro7ytuEd4hDS9MbnDGcknXn/ceWCT1sCtapsTG8KcD30HyZGQ==
2196+
lite-react-ui@^0.3.1:
2197+
version "0.3.1"
2198+
resolved "https://registry.yarnpkg.com/lite-react-ui/-/lite-react-ui-0.3.1.tgz#6641e4503512fa3b03c0b3b900f9a352527374c4"
2199+
integrity sha512-sBIj4s9N/4Yv01+ZUaABeZLdyUdSavt2TKrtMjYOvLhP+/sfltu+XsifDW1jQlyzWLfv0Yb8QbM/9JfARw+vSg==
22002200
dependencies:
22012201
concurrently "^6.2.0"
22022202
lite-react-ui "^0.2.6"

example/main.jsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function App() {
2424
return (
2525
<div className="twr-p-10">
2626
<ul class="twr-space-y-5">
27-
<li className="twr-flex twr-space-x-4">
27+
<li className="twr-flex twr-flex-col twr-space-x-4 twr-space-y-2 twr-flex-wrap">
2828
<p className="">{`<Button> component:`}</p>
2929
<Button loading="true" className="twr-w-auto">
3030
Test
@@ -41,6 +41,23 @@ function App() {
4141
<Button buttonType="secondary" disabled className="twr-w-auto">
4242
Test
4343
</Button>
44+
<Button buttonType="tertiary" disabled className="twr-w-auto">
45+
Test
46+
</Button>
47+
<Button buttonType="tertiary" className="twr-w-auto">
48+
Test
49+
</Button>
50+
<Button buttonType="tertiary" loading className="twr-w-auto">
51+
Test
52+
</Button>
53+
<div className="twr-flex twr-space-x-2 twr-bg-black twr-rounded-lg twr-p-2">
54+
<Button inverted buttonType="tertiary" className="twr-w-auto">
55+
Test
56+
</Button>
57+
<Button inverted buttonType="tertiary" loading className="twr-w-auto">
58+
Test
59+
</Button>
60+
</div>
4461
</li>
4562
<li>
4663
<p>{`<Navigation> component:`}</p>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lite-react-ui",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"homepage": "htps://github.com/john-raymon/lite-react-UI-components",
55
"author": "john-raymon",
66
"repository": {

src/assets/styles/buttons.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,53 @@
66
twr-rounded-lg
77
twr-transition
88
twr-outline-none
9+
twr-items-center
10+
twr-justify-center
911
twr-text-center
1012
twr-text-black;
1113
box-shadow: 0px 0px 9px rgba(0, 0, 0, 0.1);
1214
padding: calc(1rem - 2px) calc(2rem - 2px) calc(1rem - 2px) calc(2rem - 2px);
15+
16+
&__tertiary {
17+
@apply twr-bg-transparent twr-text-black twr-outline-none twr-border-2 twr-border-black;
18+
19+
&--inverted {
20+
@apply twr-text-white twr-border-white;
21+
22+
&:hover:enabled {
23+
@apply twr-outline-none twr-text-black twr-bg-white twr-border-white;
24+
}
25+
26+
&:not(:active):focus:enabled {
27+
@apply twr-outline-none twr-text-black;
28+
background: rgba(248, 248, 248, 0.9);
29+
border: 2px solid #A9A9A9;
30+
}
31+
32+
&:active:enabled {
33+
@apply twr-outline-none twr-text-black;
34+
background: rgba(142, 142, 142, 0.73);
35+
border: 2px solid #B8B8B8;
36+
}
37+
}
38+
39+
&:not(&--inverted):not(:active):focus:enabled {
40+
@apply twr-outline-none twr-text-white;
41+
background: #414141;
42+
border: 2px solid #000000;
43+
}
44+
45+
&:not(&--inverted):active:enabled {
46+
@apply twr-outline-none twr-text-white;
47+
background: rgba(38, 38, 38, 0.93);
48+
border: 2px solid #000000;
49+
}
50+
51+
&:not(&--inverted):not(:focus):hover:enabled {
52+
@apply twr-outline-none twr-text-white twr-bg-black;
53+
border-color: #000000;
54+
}
55+
}
1356

1457
&__secondary {
1558
@apply twr-bg-black twr-text-white twr-outline-none twr-border-2 twr-border-black;

src/components/Button.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ export default function Button({
1212
loading = false,
1313
loadingText = 'Loading...',
1414
active = null, // for explicitlity forcing a focus state
15+
inverted = false,
1516
...otherProps
1617
}) {
1718
return (
1819
<button
1920
id={id}
20-
className={`twr-button twr-button__${buttonType} ${active ? `twr-button__${buttonType}--focus` : (active === null ? '' : `twr-button__${buttonType}--no-focus`)} ${className}`}
21+
className={`twr-button twr-button__${buttonType} ${inverted ? `twr-button__tertiary--inverted` : ''} ${active ? `twr-button__${buttonType}--focus` : (active === null ? '' : `twr-button__${buttonType}--no-focus`)} ${className}`}
2122
type={type}
2223
{...otherProps}
2324
>

0 commit comments

Comments
 (0)