Skip to content

Commit

Permalink
Merge branch 'develop' into chore/migrate-passport-github
Browse files Browse the repository at this point in the history
  • Loading branch information
catarak authored Sep 23, 2021
2 parents 64eab11 + 2bc7e59 commit f68f62c
Show file tree
Hide file tree
Showing 53 changed files with 1,805 additions and 413 deletions.
43 changes: 35 additions & 8 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,51 @@
# p5.js Code of Conduct
## [p5.js community statement](http://p5js.org/community/)

p5.js is a community interested in exploring the creation of art and design with technology.

We are a community of, and in solidarity with, people from every gender identity and expression, sexual orientation, race, ethnicity, language, neuro-type, size, disability, class, religion, culture, subculture, political opinion, age, skill level, occupation, and background. We acknowledge that not everyone has the time, financial means, or capacity to actively participate, but we recognize and encourage involvement of all kinds. We facilitate and foster access and empowerment. We are all learners.

We like these hashtags: #noCodeSnobs (because we value community over efficiency), #newKidLove (because we all started somewhere), #unassumeCore (because we don't assume knowledge), and #BlackLivesMatter (because of course).

In practice:
* We are not code snobs. We do not assume knowledge or imply there are things that somebody should know.
* We insist on actively engaging with requests for feedback regardless of their complexity.
* We welcome newcomers and prioritize the education of others. We strive to approach all tasks with the enthusiasm of a newcomer. Because we believe that newcomers are just as valuable in this effort as experts.
* We consistently make the effort to actively recognize and validate multiple types of contributions.
* We are always willing to offer help or guidance.

In times of conflict:
* We listen.
* We clearly communicate while acknowledging other's feelings.
* We admit when we're wrong, apologize, and accept responsibility for our actions.
* We are continuously seeking to improve ourselves and our community.
* We keep our community respectful and open.
* We make everyone feel heard.
* We are mindful and kind in our interactions.

In the future:
* The future is now.


## p5.js Code of Conduct

* **Be mindful of your language.** Any of the following behavior is unacceptable:
* Offensive comments related to gender identity and expression, sexual orientation, race, ethnicity, language, neuro-type, size, ability, class, religion, culture, subculture, political opinion, age, skill level, occupation, or background
* Threats of violence
* Deliberate intimidation
* Sexually explicit or violent material
* Sexually explicit or violent material that is not contextualized and preceded by a considerate warning
* Unwelcome sexual attention
* Stalking or following
* Or any other kinds of harassment

Use your best judgement. If it will possibly make others uncomfortable, do not post it.

* **Be respectful.** Disagreement is not an opportunity to attack someone else's thoughts or opinions. Although views may differ, remember to approach every situation with patience and care.
* **Be considerate.** Think about how your contribution will affect others in the community.
* **Be respectful.** Disagreement is not an opportunity to attack someone else's thoughts or opinions. Although views may differ, remember to approach every situation with patience and care.
* **Be considerate.** Think about how your contribution will affect others in the community.
* **Be open minded.** Embrace new people and new ideas. Our community is continually evolving and we welcome positive change.

If you believe someone is violating the code of conduct, we ask that you report it by emailing [[email protected]](mailto:[email protected]). Please include your name and a description of the incident, and we will get back to you ASAP.

Participants asked to stop any harassing behavior are expected to comply immediately. If a participant engages in harassing behavior, the p5.js Team may take any action they deem appropriate, up to and including expulsion from all p5.js spaces and identification of the participant as a harasser to other p5.js members or the general public.

## Also
Sometimes, participants violating the Code of Conduct are unaware that their behavior is harmful, and an open conversation clears things up to move forward. However, if a participant continues with the behavior, the p5.js team may take any action they deem appropriate, up to and including expulsion from all p5.js spaces and identification of the participant as a harasser to other p5.js members or the general public.

* You can read our [community statement](http://p5js.org/community/) on our website.
---
This statement is licensed under a [Creative Commons license](https://creativecommons.org/licenses/by-sa/4.0/). Please feel free to share and remix with attribution.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
node_modules/
npm-debug.log
dump.rdb
public/*
static/dist/
static/css/app.min.css
dist/
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ENV APP_HOME=/usr/src/app \
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
EXPOSE 8000
EXPOSE 8002

FROM base as development
ENV NODE_ENV development
Expand All @@ -15,6 +16,7 @@ COPY ./webpack ./webpack
COPY client ./client
COPY server ./server
COPY translations/locales ./translations/locales
COPY public ./public
CMD ["npm", "start"]

FROM development as build
Expand Down
95 changes: 65 additions & 30 deletions client/common/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ import { Link } from 'react-router';
import { remSize, prop } from '../theme';

const kinds = {
primary: 'primary',
secondary: 'secondary'
};

const displays = {
block: 'block',
icon: 'icon',
inline: 'inline'
};

Expand All @@ -16,52 +20,57 @@ const kinds = {
// general global styles
const StyledButton = styled.button`
&&& {
font-weight: bold;
display: flex;
justify-content: center;
align-items: center;
width: max-content;
text-decoration: none;
color: ${prop('Button.default.foreground')};
background-color: ${prop('Button.default.background')};
color: ${({ kind }) => prop(`Button.${kind}.default.foreground`)};
background-color: ${({ kind }) =>
prop(`Button.${kind}.default.background`)};
cursor: pointer;
border: 2px solid ${prop('Button.default.border')};
border: 2px solid ${({ kind }) => prop(`Button.${kind}.default.border`)};
border-radius: 2px;
padding: ${remSize(8)} ${remSize(25)};
line-height: 1;
svg * {
fill: ${prop('Button.default.foreground')};
fill: ${({ kind }) => prop(`Button.${kind}.default.foreground`)};
}
&:hover:not(:disabled) {
color: ${prop('Button.hover.foreground')};
background-color: ${prop('Button.hover.background')};
border-color: ${prop('Button.hover.border')};
color: ${({ kind }) => prop(`Button.${kind}.hover.foreground`)};
background-color: ${({ kind }) =>
prop(`Button.${kind}.hover.background`)};
border-color: ${({ kind }) => prop(`Button.${kind}.hover.border`)};
svg * {
fill: ${prop('Button.hover.foreground')};
fill: ${({ kind }) => prop(`Button.${kind}.hover.foreground`)};
}
}
&:active:not(:disabled) {
color: ${prop('Button.active.foreground')};
background-color: ${prop('Button.active.background')};
color: ${({ kind }) => prop(`Button.${kind}.active.foreground`)};
background-color: ${({ kind }) =>
prop(`Button.${kind}.active.background`)};
svg * {
fill: ${prop('Button.active.foreground')};
fill: ${({ kind }) => prop(`Button.${kind}.active.foreground`)};
}
}
&:disabled {
color: ${prop('Button.disabled.foreground')};
background-color: ${prop('Button.disabled.background')};
border-color: ${prop('Button.disabled.border')};
color: ${({ kind }) => prop(`Button.${kind}.disabled.foreground`)};
background-color: ${({ kind }) =>
prop(`Button.${kind}.disabled.background`)};
border-color: ${({ kind }) => prop(`Button.${kind}.disabled.border`)};
cursor: not-allowed;
svg * {
fill: ${prop('Button.disabled.foreground')};
fill: ${({ kind }) => prop(`Button.${kind}.disabled.foreground`)};
}
}
Expand Down Expand Up @@ -108,35 +117,38 @@ const StyledIconButton = styled.button`
height: ${remSize(32)}px;
text-decoration: none;
color: ${prop('Button.default.foreground')};
background-color: ${prop('Button.hover.background')};
color: ${({ kind }) => prop(`Button.${kind}.default.foreground`)};
background-color: ${({ kind }) => prop(`Button.${kind}.hover.background`)};
cursor: pointer;
border: 1px solid transparent;
border-radius: 50%;
padding: ${remSize(8)} ${remSize(25)};
line-height: 1;
&:hover:not(:disabled) {
color: ${prop('Button.hover.foreground')};
background-color: ${prop('Button.hover.background')};
color: ${({ kind }) => prop(`Button.${kind}.hover.foreground`)};
background-color: ${({ kind }) =>
prop(`Button.${kind}.hover.background`)};
svg * {
fill: ${prop('Button.hover.foreground')};
fill: ${({ kind }) => prop(`Button.${kind}.hover.foreground`)};
}
}
&:active:not(:disabled) {
color: ${prop('Button.active.foreground')};
background-color: ${prop('Button.active.background')};
color: ${({ kind }) => prop(`Button.${kind}.active.foreground`)};
background-color: ${({ kind }) =>
prop(`Button.${kind}.active.background`)};
svg * {
fill: ${prop('Button.active.foreground')};
fill: ${({ kind }) => prop(`Button.${kind}.active.foreground`)};
}
}
&:disabled {
color: ${prop('Button.disabled.foreground')};
background-color: ${prop('Button.disabled.background')};
color: ${({ kind }) => prop(`Button.${kind}.disabled.foreground`)};
background-color: ${({ kind }) =>
prop(`Button.${kind}.disabled.background`)};
cursor: not-allowed;
}
Expand All @@ -151,10 +163,12 @@ const StyledIconButton = styled.button`
*/
const Button = ({
children,
display,
href,
kind,
iconBefore,
iconAfter,
iconOnly,
'aria-label': ariaLabel,
to,
type,
Expand All @@ -170,16 +184,19 @@ const Button = ({
);
let StyledComponent = StyledButton;

if (kind === kinds.inline) {
if (display === displays.inline) {
StyledComponent = StyledInlineButton;
} else if (kind === kinds.icon) {
}

if (iconOnly) {
StyledComponent = StyledIconButton;
}

if (href) {
return (
<StyledComponent
kind={kind}
display={display}
as="a"
aria-label={ariaLabel}
href={href}
Expand All @@ -194,6 +211,7 @@ const Button = ({
return (
<StyledComponent
kind={kind}
display={display}
as={Link}
aria-label={ariaLabel}
to={to}
Expand All @@ -205,7 +223,13 @@ const Button = ({
}

return (
<StyledComponent kind={kind} aria-label={ariaLabel} type={type} {...props}>
<StyledComponent
kind={kind}
display={display}
aria-label={ariaLabel}
type={type}
{...props}
>
{content}
</StyledComponent>
);
Expand All @@ -214,16 +238,19 @@ const Button = ({
Button.defaultProps = {
children: null,
disabled: false,
display: displays.block,
iconAfter: null,
iconBefore: null,
kind: kinds.block,
iconOnly: false,
kind: kinds.primary,
href: null,
'aria-label': null,
to: null,
type: 'button'
};

Button.kinds = kinds;
Button.displays = displays;

Button.propTypes = {
/**
Expand All @@ -235,6 +262,10 @@ Button.propTypes = {
If the button can be activated or not
*/
disabled: PropTypes.bool,
/**
* The display type of the button—inline or block
*/
display: PropTypes.string,
/**
* SVG icon to place after child content
*/
Expand All @@ -243,6 +274,10 @@ Button.propTypes = {
* SVG icon to place before child content
*/
iconBefore: PropTypes.element,
/**
* If the button content is only an SVG icon
*/
iconOnly: PropTypes.bool,
/**
* The kind of button - determines how it appears visually
*/
Expand Down
4 changes: 2 additions & 2 deletions client/common/Button.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const ButtonWithIconAfter = () => (
);

export const InlineButtonWithIconAfter = () => (
<Button iconAfter={<DropdownArrowIcon />} kind={Button.kinds.inline}>
<Button iconAfter={<DropdownArrowIcon />} display={Button.displays.inline}>
File name
</Button>
);
Expand All @@ -68,6 +68,6 @@ export const InlineIconOnlyButton = () => (
<Button
aria-label="Add to collection"
iconBefore={<PlusIcon />}
kind={Button.kinds.inline}
display={Button.displays.inline}
/>
);
6 changes: 3 additions & 3 deletions client/components/Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ const DropdownWrapper = styled.ul`
}
& li:hover {
background-color: ${prop('Button.hover.background')};
color: ${prop('Button.hover.foreground')};
background-color: ${prop('Button.primary.hover.background')};
color: ${prop('Button.primary.hover.foreground')};
* {
color: ${prop('Button.hover.foreground')};
color: ${prop('Button.primary.hover.foreground')};
}
}
Expand Down
13 changes: 13 additions & 0 deletions client/components/RootPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import styled from 'styled-components';
import { prop } from '../theme';

const RootPage = styled.div`
min-height: 100%;
display: flex;
flex-direction: column;
color: ${prop('primaryTextColor')};
background-color: ${prop('backgroundColor')};
height: ${({ fixedHeight }) => fixedHeight || 'initial'};
`;

export default RootPage;
Loading

0 comments on commit f68f62c

Please sign in to comment.