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 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
6 changes: 0 additions & 6 deletions _src /atoms/label/Label.html

This file was deleted.

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

This file was deleted.

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.

13 changes: 13 additions & 0 deletions src/atoms/label/Label.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.a-label {
@apply block;
@apply mb-1;
@apply text-gray-600 leading-relaxed;
}

.a-label--inline {
@apply mr-2;
}

.a-label--hidden {
@apply sr-only;
}
6 changes: 6 additions & 0 deletions src/atoms/label/Label.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<label
class="a-label"
>
<!-- @slot Slot for label content -->
<slot />
</label>
2 changes: 2 additions & 0 deletions src/atoms/label/Label.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// @vue/component
export default {}
12 changes: 0 additions & 12 deletions _src /atoms/label/Label.spec.js → src/atoms/label/Label.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ describe('Label', () => {
expect(wrapper.classes().length).toBe(1)
})

it('renders custom root element', () => {
const wrapper = mount(ALabel, {
propsData: {
tag: 'span'
}
})

expect(wrapper.is('span')).toBe(true)
expect(wrapper.classes()).toContain('a-label')
expect(wrapper.classes().length).toBe(1)
})

it('renders slot text when passed', () => {
const wrapper = mount(ALabel, {
slots: {
Expand Down
30 changes: 30 additions & 0 deletions src/atoms/label/Label.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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>
`
})
3 changes: 1 addition & 2 deletions _src /atoms/label/Label.vue → src/atoms/label/Label.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import ALabel from './Label.js'

export default {
name: 'AlpacaLabel',

mixins: [ALabel]
}
</script>

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