Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"pedalboard:test": "turbo run test --filter='./packages/discovery-provider/plugins/pedalboard/apps/*' --filter='./packages/discovery-provider/plugins/pedalboard/packages/*'"
},
"devDependencies": {
"@emotion/eslint-plugin": "11.11.0",
"@types/keyv": "4.2.0",
"@typescript-eslint/eslint-plugin": "5.48.2",
"@typescript-eslint/parser": "5.48.2",
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-audius/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"test": "echo \"Error: run tests from root\" && exit 1"
},
"peerDependencies": {
"@emotion/eslint-plugin": "11.11.0",
"@typescript-eslint/eslint-plugin": "5.48.2",
"@typescript-eslint/parser": "5.48.2",
"eslint": "8.25.0",
Expand Down
10 changes: 9 additions & 1 deletion packages/eslint-config-audius/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: ['react', 'react-hooks', '@typescript-eslint', 'jest', 'import'],
plugins: [
'react',
'react-hooks',
'@typescript-eslint',
'@emotion',
'jest',
'import'
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
Expand Down Expand Up @@ -75,6 +82,7 @@ module.exports = {
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/no-unknown-property': ['error', { ignore: ['css'] }],

'prettier/prettier': ['error', require('../.prettierrc')],

Expand Down
19 changes: 1 addition & 18 deletions packages/harmony/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
module.exports = {
env: {
browser: true,
es6: true
},
extends: ['audius'],
// settings: {
// 'import/resolver': {
// // NOTE: sk - These aliases are required for the import/order rule.
// // We are using the typescript baseUrl to do absolute import paths
// // relative to /src, which eslint can't tell apart from 3rd party deps
// alias: {
// map: [
// ['components', './src/components'],
// ],
// extensions: ['.ts', '.tsx', '.js', '.jsx', '.json']
// }
// }
// },
extends: ['audius']
}
3 changes: 3 additions & 0 deletions packages/harmony/.storybook/preview-body.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
#storybook-docs .sbdocs-wrapper {
padding: var(--harmony-spacing-3xl);
}
#configuration-options {
margin-bottom: var(--harmony-spacing-2xl);
}
</style
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@
&:focus {
outline: none !important;
}
&:active {
&:hover,
&.hover {
transform: scale(1.04);
}
&:active,
&.active {
transform: scale(0.98);
}
&:hover {
transform: scale(1.04);
/* .hover and .active are for visual representation only in storybook */
&.hover,
&.active {
pointer-events: none;
Comment on lines +27 to +30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh. Is this for a built-in storybook thing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i added a .active class and prop, hiding it with @ignore js-doc purely for storybook purposes, would be cool to go over together tomorrow

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(
children,
'aria-label': ariaLabelProp,
asChild,
_isHovered,
_isPressed,
...other
} = props
const { isMatch: isTextHidden } = useMediaQueryListener(
Expand All @@ -54,7 +56,9 @@ export const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(
styles.button,
{
[baseStyles.disabled]: disabled || isLoading,
[baseStyles.fullWidth]: fullWidth
[baseStyles.fullWidth]: fullWidth,
[baseStyles.hover]: _isHovered,
[baseStyles.active]: _isPressed
},
className
)}
Expand Down
43 changes: 42 additions & 1 deletion packages/harmony/src/components/button/Button/Button.mdx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the MDX structure. Looks very easy to build and keep consistent

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,48 @@ Fixed height: 32px, 48px, 64px
<Story of={ButtonStories.Sizes} />
</Canvas>

<Stories />
### States

Hover: transform scale: 1.04x, ease-out curve, 120ms
Pressed: transform scale: 0.98x, ease-out curve, 120ms

<Canvas>
<Story of={ButtonStories.States} />
</Canvas>

### Disabled

<Canvas>
<Story of={ButtonStories.Disabled} />
</Canvas>

### Icons

<Canvas>
<Story of={ButtonStories.Icons} />
</Canvas>

### Loading state

<Canvas>
<Story of={ButtonStories.LoadingState} />
</Canvas>

### Color Prop Applied

Generate the colors for primary button states using colored overlays rather than distinct hex values for each state.

<Canvas>
<Story of={ButtonStories.ColorPropApplied} />
</Canvas>

### Link

A link that looks like a button. Useful for buttons that trigger navigation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end with . for consistency


<Canvas>
<Story of={ButtonStories.Link} />
</Canvas>

## Use cases and examples

Expand Down
24 changes: 16 additions & 8 deletions packages/harmony/src/components/button/Button/Button.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@
.primary {
--text-color: var(--harmony-static-white);
--base-color: var(--harmony-primary);
&:hover {
&:hover,
&.hover {
--overlay-color: var(--harmony-static-white);
--overlay-opacity: 20%;
box-shadow: var(--harmony-shadow-mid);
}
&:active {
&:active,
&.active {
--overlay-color: var(--harmony-static-black);
--overlay-opacity: 20%;
box-shadow: none;
Expand All @@ -115,15 +117,17 @@
--text-color: var(--harmony-text-default);
background: transparent;
box-shadow: none;
&:hover {
&:hover,
&.hover {
--base-color: var(--harmony-primary);
--text-color: var(--harmony-static-white);
background-color: var(--button-color);
--overlay-color: var(--harmony-static-white);
--overlay-opacity: 20%;
box-shadow: var(--harmony-shadow-mid);
}
&:active {
&:active,
&.active {
--base-color: var(--harmony-primary);
--text-color: var(--harmony-static-white);
background-color: var(--button-color);
Expand All @@ -143,13 +147,15 @@
/* Don't use opacity prop as it affects the text too */
background-color: rgb(255, 255, 255, 0.85);
backdrop-filter: blur(6px);
&:hover {
&:hover,
&.hover {
--base-color: var(--harmony-border-strong);
box-shadow: var(--harmony-shadow-mid);
background-color: var(--harmony-bg-white);
backdrop-filter: none;
}
&:active {
&:active,
&.active {
--base-color: var(--harmony-border-strong);
background-color: var(--harmony-bg-surface-2);
box-shadow: none;
Expand All @@ -167,13 +173,15 @@
--text-color: var(--harmony-red);
background: transparent;
box-shadow: none;
&:hover {
&:hover,
&.hover {
Comment on lines +176 to +177

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dang what a pain

--base-color: var(--harmony-red);
--text-color: var(--harmony-static-white);
background-color: var(--button-color);
box-shadow: var(--harmony-shadow-mid);
}
&:active {
&:active,
&.active {
--base-color: var(--harmony-red);
--text-color: var(--harmony-static-white);
--overlay-color: var(--harmony-static-black);
Expand Down
Loading