-
Notifications
You must be signed in to change notification settings - Fork 7
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
feature/update-label #282
feature/update-label #282
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
.a-label { | ||
@apply block; | ||
@apply mb-1; | ||
@apply text-gray-600 font-normal text-base font-sans leading-relaxed; | ||
@apply transition-none; | ||
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. Hmm.. do we need this line? |
||
} | ||
|
||
.a-label--inline { | ||
@apply mr-2; | ||
} | ||
|
||
.a-label--hidden { | ||
@apply sr-only; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
:is="tag" | ||
class="a-label" | ||
> | ||
<!-- @slot Slot for label content --> | ||
<slot /> | ||
</component> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
export default { | ||
props: { | ||
/** | ||
* Label tag | ||
* To use another tag instead of 'label' | ||
*/ | ||
tag: { | ||
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. IMO custom tag is unnecessary, WDYT is there any use case for custom tag? 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. not really, I'll change component to label |
||
type: String, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { select, text } from '@storybook/addon-knobs' | ||
|
||
import getClassKnobsConfig from '@utils/helpers/get-class-knobs-config.js' | ||
import selectorsConfig from './Label.selectors.json' | ||
|
||
import ALabel from './Label.vue' | ||
|
||
const classKnobsConfig = getClassKnobsConfig(selectorsConfig) | ||
|
||
export default { | ||
title: 'Atoms/Label', | ||
component: ALabel | ||
} | ||
|
||
export const Default = () => ({ | ||
components: { ALabel }, | ||
props: { | ||
classKnobs: { | ||
default: select('BEM Modifier', classKnobsConfig) | ||
}, | ||
textKnobs: { | ||
default: text('Text', 'Label') | ||
} | ||
}, | ||
template: ` | ||
<a-label :class="classKnobs"> | ||
{{ textKnobs }} | ||
</a-label> | ||
` | ||
}) | ||
|
||
export const CustomTag = () => ({ | ||
components: { ALabel }, | ||
props: { | ||
classKnobs: { | ||
default: select('BEM Modifier', classKnobsConfig) | ||
}, | ||
textKnobs: { | ||
default: text('Text', 'Custom tag label') | ||
}, | ||
tagKnob: { | ||
default: text('Html tag', 'span') | ||
} | ||
}, | ||
template: ` | ||
<a-label | ||
:tag="tagKnob" | ||
:class="classKnobs" | ||
> | ||
{{ textKnobs }} | ||
</a-label> | ||
` | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ export default { | |
} | ||
</script> | ||
|
||
<style lang="scss" src="./Label.scss" /> | ||
<style lang="css" src="./Label.css" /> | ||
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. please remove lang attr |
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.
remove this empty line. I will add some lint for this file