Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

ADAPT-000: Add Identity Bar, Logo, Global Footer, SR only Text, Button #4

Merged
merged 79 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
7335bbc
Playing around with an idea.
sherakama Feb 5, 2021
20692d8
Playing around some more.
sherakama Feb 5, 2021
79fe464
added twin.
sherakama Feb 5, 2021
80c55b5
Wip.
sherakama Feb 9, 2021
5facb78
Wip.
sherakama Feb 9, 2021
ca7cd0b
Demo code.
sherakama Feb 10, 2021
31e6fac
WIP IdentityBar.js; install Classnames and uninstall TW classnames
yvonnetangsu Feb 10, 2021
c4f9aee
fixup
yvonnetangsu Feb 10, 2021
5483a11
remove active link class
yvonnetangsu Feb 10, 2021
117c020
fix path and run build
yvonnetangsu Feb 10, 2021
bb8a732
wip!
sherakama Feb 10, 2021
c175ffb
Merge branch 'variants' into variants-yt
yvonnetangsu Feb 10, 2021
a7cbb3a
moar.better.
sherakama Feb 10, 2021
00d4389
switch.
sherakama Feb 10, 2021
e645ac2
Moar updates.
sherakama Feb 11, 2021
20f6b4b
Merge branch 'variants' into variants-yt
yvonnetangsu Feb 11, 2021
d481a2a
Add identity bar levers and stories files; use case convention and fo…
yvonnetangsu Feb 11, 2021
76ed592
fixup
yvonnetangsu Feb 11, 2021
c285ae0
fixup! progress.
sherakama Feb 11, 2021
77cebec
Remove css file.
sherakama Feb 11, 2021
1b4e15d
Merge branch 'variants' into variants-yt
yvonnetangsu Feb 11, 2021
5b2081c
Add SrOnlyLabel component; WIP Global footer
yvonnetangsu Feb 11, 2021
79a8848
fixup! wip.
sherakama Feb 12, 2021
2ec89b3
Merge branch 'variants' into variants-yt
yvonnetangsu Feb 12, 2021
a45bcab
fixup! wip.
sherakama Feb 12, 2021
604d5d5
fixup! wip.
sherakama Feb 12, 2021
2801ac9
Merge branch "variants" into "variants-yt"
yvonnetangsu Feb 12, 2021
4a7eef4
Finish global footer styles
yvonnetangsu Feb 12, 2021
ceb9c85
fixup! wip.
sherakama Feb 12, 2021
7ad735b
Merge branch 'variants' into variants-yt
yvonnetangsu Feb 12, 2021
eb7460a
Fixup! more stuff.
sherakama Feb 12, 2021
7d9b097
Element stories.
sherakama Feb 12, 2021
4824840
fixup! stories.
sherakama Feb 13, 2021
280095b
Merge branch 'variants' into variants-yt
yvonnetangsu Feb 13, 2021
bb6f4da
Identity bar fixup
yvonnetangsu Feb 13, 2021
ec2c2d6
Add global footer to storybook WIP
yvonnetangsu Feb 13, 2021
156ccca
Add basefont 20 class to global footer wrapper so logo doesn't scale …
yvonnetangsu Feb 14, 2021
61a764d
Merge branch 'main' into variants-yt
yvonnetangsu Feb 16, 2021
b46a777
Temporary quick test to avoid build error because of failed test
yvonnetangsu Feb 16, 2021
96fc369
Some paragraph stuff and start some button stuff
yvonnetangsu Feb 16, 2021
ad49001
Prep work for the button component
yvonnetangsu Feb 16, 2021
5363da7
dupe vibrate() policy
sherakama Feb 17, 2021
d2bc47c
Update src/Button/Button.js
yvonnetangsu Feb 17, 2021
005a0e3
Update src/Button/Button.js
yvonnetangsu Feb 17, 2021
d87134d
button WIP
yvonnetangsu Feb 17, 2021
8c0f643
clean up identity bar code to use new convention
yvonnetangsu Feb 17, 2021
8126dad
Fix hilarity caused by capitalizing PropTypes; fix hilarity caused by…
yvonnetangsu Feb 17, 2021
cd92a4b
Add minimal button style for buttons that doesn't look like a rectang…
yvonnetangsu Feb 17, 2021
783c24b
Add buttonTypes as levers; sizes fixups
yvonnetangsu Feb 17, 2021
dbdb258
button styles
yvonnetangsu Feb 17, 2021
19a7f93
Alert examples tweaks
yvonnetangsu Feb 17, 2021
f980b13
Minor fixes and suggestions. (#6)
sherakama Feb 17, 2021
7cf9bf0
Update src/Button/Button.js
yvonnetangsu Feb 17, 2021
0dc76cc
Add disabled button styles
yvonnetangsu Feb 17, 2021
c78b922
add disabled button attribute and on click action
yvonnetangsu Feb 17, 2021
3160f37
Add logo component
yvonnetangsu Feb 17, 2021
2c7a011
Have Identity Bar use Logo component
yvonnetangsu Feb 17, 2021
00084ba
Global Footer SR Only Label subcomponent fixup
yvonnetangsu Feb 17, 2021
7a3b917
Stories for identity bar, footer and logo
yvonnetangsu Feb 17, 2021
f818b9f
export Logo
yvonnetangsu Feb 17, 2021
9e01eb9
Update src/Logo/Logo.js
yvonnetangsu Feb 17, 2021
540b7fd
Use Logo component for global footer
yvonnetangsu Feb 17, 2021
1f155d7
Add SrOnlyText to storybook
yvonnetangsu Feb 17, 2021
46abba0
Add same color border to disabled button so everything will be same h…
yvonnetangsu Feb 17, 2021
2cf3470
fixup! node_modules.
sherakama Feb 17, 2021
7d7c12d
All the dirs.
sherakama Feb 17, 2021
3abb597
Fixup! minor bugs.
sherakama Feb 17, 2021
bdaba64
fixup! stuff.
sherakama Feb 17, 2021
98f75d2
Use dedupe
sherakama Feb 17, 2021
4000aad
fixup! stuff. (#8)
sherakama Feb 17, 2021
2bf3071
Update src/GlobalFooter/GlobalFooter.js
yvonnetangsu Feb 17, 2021
eb1ee7a
dedupe setting for button tweak
yvonnetangsu Feb 17, 2021
5d9b6da
fixup! tests.
sherakama Feb 17, 2021
cc76c56
setup testing.
sherakama Feb 17, 2021
6ec2b34
Update src/IdentityBar/IdentityBar.stories.js
yvonnetangsu Feb 17, 2021
ecd626d
Update src/Logo/Logo.stories.js
yvonnetangsu Feb 17, 2021
9c8cf4d
Merge branch 'variants-yt' of github.com:SU-SWS/decanter-react into v…
yvonnetangsu Feb 17, 2021
1faab2c
Merge branch 'moar-suggestions' into variants-yt
yvonnetangsu Feb 17, 2021
e49c5ed
ADAPT-000: Automagically run tests (#10)
sherakama Feb 17, 2021
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
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"react/jsx-handler-names": 0,
"react/jsx-fragments": 0,
"react/no-unused-prop-types": 0,
"import/export": 0
"import/export": 0,
"semi": [1, "always"] // 1 is for warning
}
}
8 changes: 7 additions & 1 deletion .storybook/stories/Paragraph.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ Intro.args = {

export const Big = Template.bind({})
Big.args = {
...Short.args,
...Default.args,
className: 'su-big-paragraph'
}

export const Card = Template.bind({})
Card.args = {
...Default.args,
className: 'su-card-paragraph'
}
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
X-Content-Type-Options = "nosniff"
Referrer-Policy = "origin-when-cross-origin"
Strict-Transport-Security = "max-age=2592000"
Permissions-Policy = "vibrate=(), geolocation=(), midi=(), notifications=(), push=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=(), vibrate=(), fullscreen=()"
Permissions-Policy = "vibrate=(), geolocation=(), midi=(), notifications=(), push=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=()"
27 changes: 20 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"test:coverage": "jest --coverage",
"test:gen": "jest --json --outputFile=./.storybook/.jest-test-results.json",
"predev": "npm run test:gen",
"dev": "start-storybook -p 6006",
"storybook": "npm run dev"
"dev": "start-storybook -p 6006"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -85,6 +84,7 @@
"js",
"jsx",
"json"
]
],
"moduleDirectories": ["node_modules", "src"]
}
}
124 changes: 65 additions & 59 deletions src/Alert/Alert.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import propTypes from 'prop-types'
import PropTypes from 'prop-types'
import { alertTypes, lightText, darkText } from './Alert.levers'
import { Button } from '../Button/Button'
import Icon from 'react-hero-icon'
Expand Down Expand Up @@ -84,12 +84,14 @@ export const Alert = ({ classes = {}, children, ref, ...props }) => {
const DefaultDismiss = (
<Button
className={classnames(
'su-p-0 su-text-17 su-bg-transparent hover:su-bg-transparent focus:su-bg-transparent su-uppercase su-font-bold su-inline-block su-tracking-widest',
'su-text-17 su-uppercase su-font-bold su-inline-block su-tracking-widest',
levers.dismiss,
classes.dismiss
)}
aria-label='Dismiss Alert'
onClick={() => { setDismissed(true) }}
variant='none'
size='minimal'
>
Dismiss <Icon icon='x-circle' type='solid' className={classnames('su-inline-block su--mt-3 su-h-25 su-w-25')} />
</Button>
Expand Down Expand Up @@ -169,78 +171,82 @@ export const Alert = ({ classes = {}, children, ref, ...props }) => {

Alert.propTypes = {
// Nodes and content.
children: propTypes.oneOfType([
propTypes.node,
propTypes.element,
propTypes.string
children: PropTypes.oneOfType([
PropTypes.node,
PropTypes.element,
PropTypes.string
]),
dismissBtn: PropTypes.element,
icon: PropTypes.element,
label: PropTypes.string,
heading: PropTypes.string,
footer: PropTypes.oneOfType([
PropTypes.node,
PropTypes.element,
PropTypes.string
]),
dismissBtn: propTypes.element,
icon: propTypes.element,
label: propTypes.string,
heading: propTypes.string,
footer: propTypes.node,

// State and Levers.
type: propTypes.oneOf(alertTypes),
isLargeIcon: propTypes.bool,
isLabelTop: propTypes.bool,
isIconTop: propTypes.bool,
hasDismiss: propTypes.bool,
hasIcon: propTypes.bool,
hasLabel: propTypes.bool,
type: PropTypes.oneOf(alertTypes),
isLargeIcon: PropTypes.bool,
isLabelTop: PropTypes.bool,
isIconTop: PropTypes.bool,
hasDismiss: PropTypes.bool,
hasIcon: PropTypes.bool,
hasLabel: PropTypes.bool,

// The CSS Classname property
classes: propTypes.shape(
classes: PropTypes.shape(
{
wrapper: propTypes.oneOfType([
propTypes.string,
propTypes.object,
propTypes.array
wrapper: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
PropTypes.array
]),
container: propTypes.oneOfType([
propTypes.string,
propTypes.object,
propTypes.array
container: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
PropTypes.array
]),
dismissWrapper: propTypes.oneOfType([
propTypes.string,
propTypes.object,
propTypes.array
dismissWrapper: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
PropTypes.array
]),
headerWrapper: propTypes.oneOfType([
propTypes.string,
propTypes.object,
propTypes.array
headerWrapper: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
PropTypes.array
]),
headerIcon: propTypes.oneOfType([
propTypes.string,
propTypes.object,
propTypes.array
headerIcon: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
PropTypes.array
]),
label: propTypes.oneOfType([
propTypes.string,
propTypes.object,
propTypes.array
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
PropTypes.array
]),
bodyWrapper: propTypes.oneOfType([
propTypes.string,
propTypes.object,
propTypes.array
bodyWrapper: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
PropTypes.array
]),
bodyHeading: propTypes.oneOfType([
propTypes.string,
propTypes.object,
propTypes.array
bodyHeading: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
PropTypes.array
]),
body: propTypes.oneOfType([
propTypes.string,
propTypes.object,
propTypes.array
body: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
PropTypes.array
]),
footerWrapper: propTypes.oneOfType([
propTypes.string,
propTypes.object,
propTypes.array
footerWrapper: PropTypes.oneOfType([
PropTypes.string,
PropTypes.object,
PropTypes.array
])
}
)
Expand Down
22 changes: 10 additions & 12 deletions src/Alert/Alert.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ const AlertTemplate = ({ children, ...rest }) => {
// /////////////////////////////////////////////////////////////////////////////
export const Default = AlertTemplate.bind({})
Default.args = {
children: textMixed,
heading: 'Alert Lorem Ipsum'
children: textMixed
}
Default.parameters = {
jest: ['Alert.test.js']
Expand All @@ -55,7 +54,6 @@ Default.parameters = {
export const Info = AlertTemplate.bind({})
Info.args = {
children: textMixed,
heading: 'Alert Lorem Ipsum',
type: 'info'
}

Expand All @@ -71,8 +69,8 @@ Info.parameters = {
export const Error = AlertTemplate.bind({})
Error.args = {
children: textMixed,
heading: 'Alert Lorem Ipsum',
type: 'error'
type: 'error',
label: 'error'
}
Error.parameters = {
docs: {
Expand All @@ -85,8 +83,8 @@ Error.parameters = {
export const Warning = AlertTemplate.bind({})
Warning.args = {
children: textMixed,
heading: 'Alert Lorem Ipsum',
type: 'warning'
type: 'warning',
label: 'warning'
}
Warning.parameters = {
docs: {
Expand All @@ -99,8 +97,8 @@ Warning.parameters = {
export const Success = AlertTemplate.bind({})
Success.args = {
children: textMixed,
heading: 'Alert Lorem Ipsum',
type: 'success'
type: 'success',
label: 'success'
}
Success.parameters = {
docs: {
Expand All @@ -113,7 +111,6 @@ Success.parameters = {
export const LabelsOnTop = AlertTemplate.bind({})
LabelsOnTop.args = {
children: textMixed,
heading: 'Alert Lorem Ipsum',
isIconTop: true,
isLabelTop: true
}
Expand All @@ -135,8 +132,9 @@ BigIcon.args = {
}
BigIcon.storyName = 'Big Icon + No Label'

export const NoHeader = AlertTemplate.bind({})
NoHeader.args = {
export const WithHeader = AlertTemplate.bind({})
WithHeader.args = {
heading: 'Alert Lorem Ipsum',
children: textMixed,
isLabelTop: true,
isLargeIcon: true
Expand Down
Loading