Skip to content

[SWP-714] Components library #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4f44fe6
Project setup and WIP of button component
iamjohnpeet Aug 20, 2019
982cfc1
Button and Secondary button styles added
iamjohnpeet Aug 20, 2019
67f8100
Click event added to buttons
iamjohnpeet Aug 20, 2019
6bb772f
Tags added and minor Button updates
iamjohnpeet Aug 20, 2019
6491b6c
Button reworked
iamjohnpeet Aug 21, 2019
9a4ab71
Tags reworked
iamjohnpeet Aug 21, 2019
93788aa
PostCSS setup
iamjohnpeet Aug 22, 2019
75dfd97
Linter added and base typography added too
iamjohnpeet Aug 22, 2019
1cb95ba
Input and Select fields added
iamjohnpeet Aug 22, 2019
bec4047
Select arrow added
iamjohnpeet Aug 27, 2019
d5238aa
Link added
iamjohnpeet Aug 27, 2019
e2a825f
Checkbox added
iamjohnpeet Aug 27, 2019
2602c96
WIP: Tables added
iamjohnpeet Aug 27, 2019
f94294f
Parent class added for Checkbox component
iamjohnpeet Aug 28, 2019
8314d95
Header partial added
iamjohnpeet Aug 28, 2019
330307d
Layout Container documented
iamjohnpeet Aug 28, 2019
dddae07
Toggle switch component added
iamjohnpeet Aug 29, 2019
96c1774
Minor edits to toggle switch
iamjohnpeet Aug 29, 2019
c83295b
Table data added
iamjohnpeet Aug 30, 2019
23e25d3
WIP: Typescript added
iamjohnpeet Sep 2, 2019
2d1ae91
Form component files changed to typescript
iamjohnpeet Sep 2, 2019
1967c58
All component files changed to typescript
iamjohnpeet Sep 2, 2019
0eaf0bf
Button disable style changed and Button description added
iamjohnpeet Sep 3, 2019
b0cb924
Form descriptions added
iamjohnpeet Sep 3, 2019
18e95b9
Readme and project description added
iamjohnpeet Sep 4, 2019
3270820
Minor prop name edit
iamjohnpeet Sep 4, 2019
7520a7d
Style lint added, other minor edits
iamjohnpeet Sep 12, 2019
7ad08aa
Index files added
iamjohnpeet Sep 13, 2019
f2be350
Table select moved to table component
iamjohnpeet Sep 13, 2019
7ba77bf
Select selected prop added
iamjohnpeet Sep 13, 2019
28d6b84
Remove Bootstrap App assets
iamjohnpeet Sep 20, 2019
23b8634
Minor edits
iamjohnpeet Sep 23, 2019
8041db5
Sentry added
iamjohnpeet Sep 30, 2019
a1d67c2
Add lint script and fix lint issues
iamjohnpeet Sep 30, 2019
91faf50
Travis added
iamjohnpeet Oct 1, 2019
9f5566a
Type packages needed to be added
iamjohnpeet Oct 1, 2019
aa959c4
Update travis file to use yarn instead of npm
iamjohnpeet Oct 2, 2019
7c7c94f
Travis yml fix
iamjohnpeet Oct 2, 2019
0f77823
Add packages to highest level
iamjohnpeet Oct 2, 2019
171ea96
Remove travis coverage script for now
iamjohnpeet Oct 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Select arrow added
  • Loading branch information
iamjohnpeet committed Sep 23, 2019
commit bec40470e68e613f5ed2efea0cebe1dd4f99bc04
5 changes: 2 additions & 3 deletions src/__docz__/forms/FormFields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Form components used to link internally
***disabled***
<InputField placeholder="Disabled field" disabled />


<!-- Select field -->
## Select Field
<Props of={ SelectField } />
Expand All @@ -55,8 +54,8 @@ Form components used to link internally
***label***
<SelectField data={ ['one', 'two', 'three'] } label="Label copy" />

***information***
<SelectField data={ ['one', 'two', 'three'] } message="Information copy" />
***message***
<SelectField data={ ['one', 'two', 'three'] } message="Message copy" />

***error***
<SelectField data={ ['one', 'two', 'three'] } message="Error message" error />
Expand Down
23 changes: 14 additions & 9 deletions src/components/forms/SelectField.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@ function SelectField({
return (
<>
<FieldLabel text={ label } />
<select
type="text"
class={ selectClasses }
placeholder={ placeholder }
disabled={ disabled }
onChange={ onChange }
>
{ data.map(option => <option>{ option }</option>) }
</select>
<div class="inline-block relative w-64">
<select
type="text"
class={ selectClasses }
placeholder={ placeholder }
disabled={ disabled }
onChange={ onChange }
>
{ data.map(option => <option>{ option }</option>) }
</select>
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="7" viewBox="0 0 13 7"><path d="M 12 1 L 1 1 L 6.5 6.5 L 12 1 L 6.5 6.5" fill="rgb(25, 25, 26)" stroke="rgb(25, 25, 26)" stroke-linecap="round" stroke-linejoin="round"></path></svg>
</div>
</div>
<FieldInformation text={ message } error={ error } />
</>
);
Expand Down
12 changes: 6 additions & 6 deletions src/styles/custom/typography.css
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
/* typography */
h1 {
@apply text-2xl;
@apply text-xl text-green-primary;
}

@screen md {
h1 {
@apply text-xl;
@apply text-2xl;
}
}

h2 {
@apply text-xl;
@apply text-lg;
}

@screen md {
h2 {
@apply text-lg;
@apply text-xl;
}
}

h3 {
@apply text-lg;
@apply text-base;
}

@screen md {
h3 {
@apply text-base;
@apply text-lg;
}
}

Expand Down
13 changes: 7 additions & 6 deletions src/styles/output.css
Original file line number Diff line number Diff line change
Expand Up @@ -4866,32 +4866,33 @@ body {
/* typography */

h1 {
font-size: 1.5rem;
font-size: 1.25rem;
color: #8FC043;
}

@media (min-width: 768px) {
h1 {
font-size: 1.25rem;
font-size: 1.5rem;
}
}

h2 {
font-size: 1.25rem;
font-size: 1.125rem;
}

@media (min-width: 768px) {
h2 {
font-size: 1.125rem;
font-size: 1.25rem;
}
}

h3 {
font-size: 1.125rem;
font-size: 1rem;
}

@media (min-width: 768px) {
h3 {
font-size: 1rem;
font-size: 1.125rem;
}
}

Expand Down