classcard-ui 0.2.1518 → 0.2.1520
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 +171 -148
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.css +2 -2
- package/dist/classcard-ui.umd.js +171 -148
- 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/components/CButtonIcon/CButtonIcon.vue +6 -1
- package/src/components/CCheckbox/CCheckbox.vue +28 -12
- package/src/components/CConfirmActionModal/CConfirmActionModal.vue +4 -0
- package/src/icons.js +1 -0
- package/src/stories/CButtonIcon.stories.js +32 -9
- package/src/stories/CCheckbox.stories.js +7 -0
package/package.json
CHANGED
|
@@ -24,11 +24,12 @@
|
|
|
24
24
|
<button
|
|
25
25
|
v-else-if="type == 'rounded-hover'"
|
|
26
26
|
@click.prevent="$emit('action')"
|
|
27
|
-
class="flex h-9 w-9 cursor-pointer items-center justify-center rounded-full bg-white text-gray-500 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-
|
|
27
|
+
class="rounded-hover-button flex h-9 w-9 cursor-pointer items-center justify-center rounded-full bg-white text-gray-500 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
28
28
|
:class="[
|
|
29
29
|
isTransparent ? 'bg-transparent' : 'bg-white',
|
|
30
30
|
customButtonClasses,
|
|
31
31
|
]"
|
|
32
|
+
:style="computedStyles"
|
|
32
33
|
:disabled="disabled"
|
|
33
34
|
:id="id"
|
|
34
35
|
>
|
|
@@ -163,4 +164,8 @@ export default {
|
|
|
163
164
|
.white-button-classes:focus {
|
|
164
165
|
outline-color: var(--primary-ring-color);
|
|
165
166
|
}
|
|
167
|
+
|
|
168
|
+
.rounded-hover-button:focus {
|
|
169
|
+
outline-color: var(--primary-ring-color);
|
|
170
|
+
}
|
|
166
171
|
</style>
|
|
@@ -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
|
};
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
-
import CButtonIcon from
|
|
2
|
-
import
|
|
1
|
+
import CButtonIcon from "../components/CButtonIcon/CButtonIcon.vue";
|
|
2
|
+
import "./utils.css";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title:
|
|
5
|
+
title: "CButtonIcon",
|
|
6
6
|
component: CButtonIcon,
|
|
7
7
|
argTypes: {
|
|
8
|
-
type: {
|
|
8
|
+
type: {
|
|
9
|
+
control: {
|
|
10
|
+
type: "select",
|
|
11
|
+
options: [
|
|
12
|
+
"primary",
|
|
13
|
+
"secondary",
|
|
14
|
+
"white",
|
|
15
|
+
"danger",
|
|
16
|
+
"success",
|
|
17
|
+
"tertiary",
|
|
18
|
+
"secondary-gray",
|
|
19
|
+
"rounded-hover",
|
|
20
|
+
"dark-blue",
|
|
21
|
+
"white-plain",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
preferredColor: {
|
|
26
|
+
control: {
|
|
27
|
+
type: "select",
|
|
28
|
+
options: ["red", "indigo", "yellow", "green", "purple"],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
9
31
|
},
|
|
10
32
|
};
|
|
11
33
|
|
|
@@ -18,10 +40,11 @@ const Template = (args, { argTypes }) => ({
|
|
|
18
40
|
export const Default = Template.bind({});
|
|
19
41
|
Default.args = {
|
|
20
42
|
isLoading: false,
|
|
21
|
-
type:
|
|
43
|
+
type: "primary",
|
|
22
44
|
icon: {
|
|
23
|
-
name:
|
|
24
|
-
type:
|
|
25
|
-
class:
|
|
26
|
-
}
|
|
45
|
+
name: "check",
|
|
46
|
+
type: "solid",
|
|
47
|
+
class: "h-5 w-5",
|
|
48
|
+
},
|
|
49
|
+
preferredColor: "indigo",
|
|
27
50
|
};
|
|
@@ -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
|
},
|