Skip to content

Commit

Permalink
Merge branch 'feature/update-label' into feature/update
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuza committed Jul 31, 2020
2 parents b5dcab4 + 546a486 commit 56f1e5c
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 112 deletions.
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 {}
File renamed without changes.
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" />

0 comments on commit 56f1e5c

Please sign in to comment.