Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit 5c098e1

Browse files
committed
Updated css and synced radio and checkbox components
1 parent a47c701 commit 5c098e1

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

docs/components/checkbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The custom checkbox and it's states.
1414
## Props
1515
Name | Type | Description | Default | Required
1616
---------- | -------- | ----------- | ------- | --------
17-
id | [String, Number] | Unique identifier | | true
17+
id | [String, Number] | Unique identifier | | false
1818
Name | String | Name of input element | | false
1919
label | [String, Number] | Label text | | true
2020
value, v-model | any | The model that the checkbox value syncs to. **If you are not using `v-model`, you should listen for the `input` event and update value.** | | true

docs/components/radio.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The custom radio and it's states.
33

44
## Example
55
<div class="p-3 border rounded-2 my-3 flex">
6-
<v-radio :checked="true" id="radio1" label="Radio 1" name="radio-group1" v-model="radio1" true-value="radio1-value" />
6+
<v-radio id="radio1" label="Radio 1" name="radio-group1" v-model="radio1" true-value="radio1-value" />
77
</div>
88

99
```html
@@ -20,7 +20,7 @@ The custom radio and it's states.
2020
## Props
2121
Name | Type | Description | Default | Required
2222
---------- | ----------------- | ----------------- | ------- | --------
23-
id | [String, Number] | Unique identifier | None | true
23+
id | [String, Number] | Unique identifier | None | false
2424
Name | [String, Number] | The name attribute of the radio input element | None | true
2525
Label | [String, Number] | The radio label | None | true
2626

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"test:unit": "vue-cli-service test:unit"
1919
},
2020
"devDependencies": {
21-
"@modulist/css": "0.0.5",
21+
"@modulist/css": "0.0.7",
2222
"@vue/cli-plugin-babel": "^3.5.0",
2323
"@vue/cli-plugin-eslint": "^3.5.0",
2424
"@vue/cli-plugin-unit-jest": "^3.5.0",

src/components/Checkbox/main.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="checkbox" :class="{ 'checkbox--indeterminate' : indeterminate }">
2+
<label :for="id" class="checkbox" :class="{ 'checkbox--indeterminate' : indeterminate }">
33
<input
44
:id="id"
55
:name="name"
@@ -16,8 +16,9 @@
1616
@focus="onFocus"
1717
@change="onChange"
1818
>
19-
<label :for="id" class="checkbox__label" v-text="label"></label>
20-
</div>
19+
<span class="checkbox__mark"></span>
20+
<span class="checkbox__text" v-text="label"></span>
21+
</label>
2122
</template>
2223

2324
<script>
@@ -28,7 +29,6 @@ export default {
2829
props: {
2930
id: {
3031
type: [String, Number],
31-
required: true,
3232
},
3333
name: {
3434
type: String,

src/components/Radio/main.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="radio">
2+
<label class="radio" :for="id">
33
<input
44
class="radio__input"
55
type="radio"
@@ -16,8 +16,9 @@
1616
@focus="onFocus"
1717

1818
>
19-
<label class="radio__label" :for="id">{{ label }}</label>
20-
</div>
19+
<span class="radio__circle"></span>
20+
<span class="radio__text">{{ label }}</span>
21+
</label>
2122
</template>
2223

2324
<script>
@@ -26,7 +27,6 @@ export default {
2627
props: {
2728
id: {
2829
type: [String, Number],
29-
required: true,
3030
},
3131
name: {
3232
type: String,

0 commit comments

Comments
 (0)