Skip to content
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

Merged
merged 4 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
27 changes: 0 additions & 27 deletions _src /atoms/label/Label.scss

This file was deleted.

53 changes: 0 additions & 53 deletions _src /atoms/label/Label.stories.js

This file was deleted.

15 changes: 15 additions & 0 deletions src/atoms/label/Label.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

Copy link
Contributor

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

.a-label {
@apply block;
@apply mb-1;
@apply text-gray-600 font-normal text-base font-sans leading-relaxed;
@apply transition-none;
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Expand Up @@ -2,5 +2,6 @@
:is="tag"
class="a-label"
>
<!-- @slot Slot for label content -->
<slot />
</component>
2 changes: 1 addition & 1 deletion _src /atoms/label/Label.js → src/atoms/label/Label.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export default {
props: {
/**
* Label tag
* To use another tag instead of 'label'
*/
tag: {
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Author

Choose a reason for hiding this comment

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

not really, I'll change component to label

type: String,
Expand Down
File renamed without changes.
53 changes: 53 additions & 0 deletions src/atoms/label/Label.stories.js
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>
`
})
2 changes: 1 addition & 1 deletion _src /atoms/label/Label.vue → src/atoms/label/Label.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default {
}
</script>

<style lang="scss" src="./Label.scss" />
<style lang="css" src="./Label.css" />
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove lang attr