classcard-ui 0.2.1518 → 0.2.1519
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classcard-ui.common.js +193 -142
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.css +1 -1
- package/dist/classcard-ui.umd.js +193 -142
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +4 -4
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/CCheckbox/CCheckbox.vue +28 -12
- package/src/icons.js +1 -0
- package/src/stories/CCheckbox.stories.js +7 -0
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div
|
|
3
|
+
<div
|
|
4
|
+
:class="['relative flex gap-3', icon ? 'items-center' : 'items-start']"
|
|
5
|
+
>
|
|
4
6
|
<div class="flex h-5 items-center">
|
|
5
7
|
<input
|
|
6
8
|
type="checkbox"
|
|
@@ -13,32 +15,45 @@
|
|
|
13
15
|
:disabled="isDisabled"
|
|
14
16
|
:indeterminate.prop="indeterminate"
|
|
15
17
|
:id="id"
|
|
18
|
+
:aria-labelledby="label ? `${id}-label` : null"
|
|
19
|
+
:aria-describedby="description ? `${id}-description` : null"
|
|
16
20
|
/>
|
|
17
21
|
</div>
|
|
18
22
|
<div
|
|
19
|
-
class="flex cursor-pointer items-center text-sm"
|
|
20
|
-
:class="[isDisabled ? 'pointer-events-none' : ''
|
|
21
|
-
:id="id"
|
|
23
|
+
class="flex cursor-pointer items-center gap-3 text-sm"
|
|
24
|
+
:class="[isDisabled ? 'pointer-events-none' : '']"
|
|
22
25
|
@click="changeValue"
|
|
23
26
|
>
|
|
24
27
|
<template v-if="showAvatar">
|
|
25
28
|
<c-avatar
|
|
26
|
-
class="mr-3"
|
|
27
29
|
v-if="avatarImage"
|
|
28
30
|
:size="description ? 'extrasmall' : 'extraextrasmall'"
|
|
29
31
|
:image="avatarImage"
|
|
30
32
|
:rounded="true"
|
|
31
33
|
></c-avatar>
|
|
32
34
|
<c-avatar
|
|
33
|
-
class="mr-3"
|
|
34
35
|
:size="description ? 'extrasmall' : 'extraextrasmall'"
|
|
35
36
|
:nameInitials="avatarNameInitials"
|
|
36
37
|
:rounded="true"
|
|
37
38
|
v-else
|
|
38
39
|
></c-avatar>
|
|
39
40
|
</template>
|
|
40
|
-
<
|
|
41
|
+
<template v-if="icon">
|
|
42
|
+
<div
|
|
43
|
+
class="flex h-10 w-10 items-center justify-center rounded-md border border-gray-200 bg-gray-50"
|
|
44
|
+
>
|
|
45
|
+
<c-icon
|
|
46
|
+
:name="icon.name"
|
|
47
|
+
:type="icon.type"
|
|
48
|
+
:viewBox="icon.viewBox || '0 0 20 20'"
|
|
49
|
+
class="h-5 w-5 text-gray-400"
|
|
50
|
+
cursorType="cursor-pointer"
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
<div class="flex flex-1 flex-col">
|
|
41
55
|
<label
|
|
56
|
+
:id="`${id}-label`"
|
|
42
57
|
:class="[
|
|
43
58
|
'cursor-pointer text-gray-900',
|
|
44
59
|
isDisabled ? 'opacity-50' : '',
|
|
@@ -57,6 +72,7 @@
|
|
|
57
72
|
</label>
|
|
58
73
|
<p
|
|
59
74
|
v-if="description"
|
|
75
|
+
:id="`${id}-description`"
|
|
60
76
|
:class="`mt-0.5 cursor-pointer text-gray-500 ${
|
|
61
77
|
isDisabled ? 'opacity-50' : ''
|
|
62
78
|
}`"
|
|
@@ -78,7 +94,11 @@ export default {
|
|
|
78
94
|
name: "CCheckbox",
|
|
79
95
|
props: {
|
|
80
96
|
label: { type: String },
|
|
81
|
-
id: { type: String },
|
|
97
|
+
id: { type: String, default: "c-checkbox" },
|
|
98
|
+
icon: {
|
|
99
|
+
type: Object,
|
|
100
|
+
required: false,
|
|
101
|
+
},
|
|
82
102
|
customLabelClass: {
|
|
83
103
|
type: String,
|
|
84
104
|
},
|
|
@@ -96,10 +116,6 @@ export default {
|
|
|
96
116
|
permanentIndeterminate: {
|
|
97
117
|
type: Boolean,
|
|
98
118
|
},
|
|
99
|
-
setMarginLeft: {
|
|
100
|
-
type: String,
|
|
101
|
-
default: "ml-3",
|
|
102
|
-
},
|
|
103
119
|
unCheckable: {
|
|
104
120
|
type: Boolean,
|
|
105
121
|
},
|
package/src/icons.js
CHANGED
|
@@ -881,4 +881,5 @@ export default {
|
|
|
881
881
|
"M11.47 4.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1-1.06 1.06L12 6.31 8.78 9.53a.75.75 0 0 1-1.06-1.06l3.75-3.75Zm-3.75 9.75a.75.75 0 0 1 1.06 0L12 17.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 0 1-1.06 0l-3.75-3.75a.75.75 0 0 1 0-1.06Z",
|
|
882
882
|
"arrow-uturn-left-solid-v2":
|
|
883
883
|
"M9.53 2.47a.75.75 0 0 1 0 1.06L4.81 8.25H15a6.75 6.75 0 0 1 0 13.5h-3a.75.75 0 0 1 0-1.5h3a5.25 5.25 0 1 0 0-10.5H4.81l4.72 4.72a.75.75 0 1 1-1.06 1.06l-6-6a.75.75 0 0 1 0-1.06l6-6a.75.75 0 0 1 1.06 0Z",
|
|
884
|
+
"exclaimation-circle-outline-v2":"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"
|
|
884
885
|
};
|
|
@@ -8,6 +8,7 @@ export default {
|
|
|
8
8
|
label: String,
|
|
9
9
|
description: String,
|
|
10
10
|
value: Number,
|
|
11
|
+
icon: Object,
|
|
11
12
|
preferredColor: {
|
|
12
13
|
control: {
|
|
13
14
|
type: "select",
|
|
@@ -25,6 +26,7 @@ const Template = (args, { argTypes }) => ({
|
|
|
25
26
|
|
|
26
27
|
export const Default = Template.bind({});
|
|
27
28
|
Default.args = {
|
|
29
|
+
id: "c-checkbox",
|
|
28
30
|
label: "Includes",
|
|
29
31
|
description: "Add subjects to include them in the package",
|
|
30
32
|
value: 1,
|
|
@@ -32,6 +34,11 @@ Default.args = {
|
|
|
32
34
|
showAvatar: false,
|
|
33
35
|
avatarNameInitials: "SA",
|
|
34
36
|
preferredColor: "indigo",
|
|
37
|
+
icon: {
|
|
38
|
+
type: "solid",
|
|
39
|
+
name: "clipboard-solid-v2",
|
|
40
|
+
viewBox: "0 0 24 24",
|
|
41
|
+
},
|
|
35
42
|
onChange() {
|
|
36
43
|
return;
|
|
37
44
|
},
|