-
Notifications
You must be signed in to change notification settings - Fork 131
[C-3286] Finalize harmony button docs #6528
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| 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'] | ||
| } |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
|---|---|---|
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. end with |
||
|
|
||
| <Canvas> | ||
| <Story of={ButtonStories.Link} /> | ||
| </Canvas> | ||
|
|
||
| ## Use cases and examples | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
|
@@ -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); | ||
|
|
@@ -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; | ||
|
|
@@ -167,13 +173,15 @@ | |
| --text-color: var(--harmony-red); | ||
| background: transparent; | ||
| box-shadow: none; | ||
| &:hover { | ||
| &:hover, | ||
| &.hover { | ||
|
Comment on lines
+176
to
+177
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
|
||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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