@redseed/redseed-ui-vue3 1.9.2 → 2.0.0
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/index.js +20 -111
- package/package.json +5 -5
- package/src/components/Badge/index.js +7 -0
- package/src/components/Button/ButtonDanger.vue +6 -12
- package/src/components/Button/ButtonDangerFull.vue +1 -7
- package/src/components/Button/ButtonDangerFullRounded.vue +1 -7
- package/src/components/Button/ButtonDangerRounded.vue +1 -7
- package/src/components/Button/ButtonPrimary.vue +6 -12
- package/src/components/Button/ButtonPrimaryFull.vue +1 -8
- package/src/components/Button/ButtonPrimaryFullRounded.vue +1 -8
- package/src/components/Button/ButtonPrimaryRounded.vue +1 -8
- package/src/components/Button/ButtonSecondary.vue +6 -12
- package/src/components/Button/ButtonSecondaryFull.vue +1 -8
- package/src/components/Button/ButtonSecondaryFullRounded.vue +1 -8
- package/src/components/Button/ButtonSecondaryRounded.vue +1 -8
- package/src/components/Button/ButtonSlot.vue +39 -98
- package/src/components/Button/ButtonTertiary.vue +6 -12
- package/src/components/Button/ButtonTertiaryFull.vue +1 -7
- package/src/components/Button/ButtonTertiaryFullRounded.vue +1 -7
- package/src/components/Button/ButtonTertiaryRounded.vue +1 -7
- package/src/components/Button/index.js +37 -0
- package/src/components/ButtonGroup/ButtonGroup.vue +2 -11
- package/src/components/ButtonGroup/ButtonGroupItem.vue +17 -25
- package/src/components/ButtonGroup/index.js +7 -0
- package/src/components/Card/Card.vue +21 -8
- package/src/components/Card/CardResource.vue +26 -0
- package/src/components/Card/index.js +7 -0
- package/src/components/DropdownMenu/DropdownMenu.vue +1 -6
- package/src/components/DropdownMenu/DropdownOption.vue +1 -1
- package/src/components/DropdownMenu/index.js +7 -0
- package/src/components/Form/index.js +13 -0
- package/src/components/FormField/FormFieldCheckbox.vue +1 -1
- package/src/components/FormField/FormFieldSearch.vue +1 -1
- package/src/components/FormField/FormFieldSelect.vue +209 -0
- package/src/components/FormField/FormFieldSlot.vue +8 -2
- package/src/components/FormField/index.js +23 -0
- package/src/components/Image/Image16By9.vue +7 -1
- package/src/components/Image/Image3By1.vue +7 -1
- package/src/components/Image/Image9By16.vue +7 -1
- package/src/components/Image/ImageCircle.vue +7 -1
- package/src/components/Image/index.js +13 -0
- package/src/components/Link/LinkPrimary.vue +19 -0
- package/src/components/Link/LinkSlot.vue +87 -0
- package/src/components/Link/index.js +7 -0
- package/src/components/List/List.vue +70 -0
- package/src/components/List/ListControl.vue +217 -0
- package/src/components/List/ListItem.vue +192 -0
- package/src/components/List/index.js +9 -0
- package/src/components/Logo/index.js +11 -0
- package/src/components/MessageBox/index.js +5 -0
- package/src/components/MetaInfo/MetaInfo.vue +2 -2
- package/src/components/MetaInfo/index.js +5 -0
- package/src/components/Modal/index.js +5 -0
- package/src/components/PageHeading/index.js +5 -0
- package/src/components/Pagination/Pagination.vue +275 -0
- package/src/components/Pagination/PaginationItem.vue +60 -0
- package/src/components/Pagination/PaginationItemCollapsed.vue +18 -0
- package/src/components/Pagination/PaginationItemNext.vue +17 -0
- package/src/components/Pagination/PaginationItemPrevious.vue +17 -0
- package/src/components/Pagination/index.js +13 -0
- package/src/components/Progress/index.js +5 -0
- package/src/components/Social/index.js +7 -0
- package/src/components/Sorting/Sorting.vue +79 -0
- package/src/components/Sorting/index.js +5 -0
- package/src/components/TwoColumnLayout/index.js +5 -0
package/index.js
CHANGED
|
@@ -1,111 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import ButtonGroupItem from './src/components/ButtonGroup/ButtonGroupItem.vue'
|
|
22
|
-
import Card from './src/components/Card/Card.vue'
|
|
23
|
-
import DropdownMenu from './src/components/DropdownMenu/DropdownMenu.vue'
|
|
24
|
-
import DropdownOption from './src/components/DropdownMenu/DropdownOption.vue'
|
|
25
|
-
import FormFieldCheckbox from './src/components/FormField/FormFieldCheckbox.vue'
|
|
26
|
-
import FormFieldEmail from './src/components/FormField/FormFieldEmail.vue'
|
|
27
|
-
import FormFieldHidden from './src/components/FormField/FormFieldHidden.vue'
|
|
28
|
-
import FormFieldPassword from './src/components/FormField/FormFieldPassword.vue'
|
|
29
|
-
import FormFieldPasswordToggle from './src/components/FormField/FormFieldPasswordToggle.vue'
|
|
30
|
-
import FormFieldSearch from './src/components/FormField/FormFieldSearch.vue'
|
|
31
|
-
import FormFieldsLogin from './src/components/Form/FormFieldsLogin.vue'
|
|
32
|
-
import FormFieldSlot from './src/components/FormField/FormFieldSlot.vue'
|
|
33
|
-
import FormFieldsRegister from './src/components/Form/FormFieldsRegister.vue'
|
|
34
|
-
import FormFieldText from './src/components/FormField/FormFieldText.vue'
|
|
35
|
-
import FormFieldTextSuffix from './src/components/FormField/FormFieldTextSuffix.vue'
|
|
36
|
-
import FormWrapperBuild from './src/components/Form/FormWrapperBuild.vue'
|
|
37
|
-
import FormWrapperLMS from './src/components/Form/FormWrapperLMS.vue'
|
|
38
|
-
import Image from './src/components/Image/Image.vue'
|
|
39
|
-
import Image3By1 from './src/components/Image/Image3By1.vue'
|
|
40
|
-
import Image9By16 from './src/components/Image/Image9By16.vue'
|
|
41
|
-
import Image16By9 from './src/components/Image/Image16By9.vue'
|
|
42
|
-
import ImageCircle from './src/components/Image/ImageCircle.vue'
|
|
43
|
-
import LogoRedSeedBuild from './src/components/Logo/LogoRedSeedBuild.vue'
|
|
44
|
-
import LogoRedSeedCoach from './src/components/Logo/LogoRedSeedCoach.vue'
|
|
45
|
-
import LogoRedSeedCourses from './src/components/Logo/LogoRedSeedCourses.vue'
|
|
46
|
-
import LogoRedSeedLMS from './src/components/Logo/LogoRedSeedLMS.vue'
|
|
47
|
-
import MessageBox from './src/components/MessageBox/MessageBox.vue'
|
|
48
|
-
import MetaInfo from './src/components/MetaInfo/MetaInfo.vue'
|
|
49
|
-
import Modal from './src/components/Modal/Modal.vue'
|
|
50
|
-
import PageHeading from './src/components/PageHeading/PageHeading.vue'
|
|
51
|
-
import ProgressCircle from './src/components/Progress/ProgressCircle.vue'
|
|
52
|
-
import SignInWithGoogle from './src/components/Social/SignInWithGoogle.vue'
|
|
53
|
-
import SignUpWithGoogle from './src/components/Social/SignUpWithGoogle.vue'
|
|
54
|
-
import TwoColumnLayout from './src/components/TwoColumnLayout/TwoColumnLayout.vue'
|
|
55
|
-
|
|
56
|
-
export {
|
|
57
|
-
BadgeSlot,
|
|
58
|
-
BadgeSuccess,
|
|
59
|
-
ButtonDanger,
|
|
60
|
-
ButtonDangerFull,
|
|
61
|
-
ButtonDangerFullRounded,
|
|
62
|
-
ButtonDangerRounded,
|
|
63
|
-
ButtonGroup,
|
|
64
|
-
ButtonGroupItem,
|
|
65
|
-
ButtonPrimary,
|
|
66
|
-
ButtonPrimaryFull,
|
|
67
|
-
ButtonPrimaryFullRounded,
|
|
68
|
-
ButtonPrimaryRounded,
|
|
69
|
-
ButtonSecondary,
|
|
70
|
-
ButtonSecondaryFull,
|
|
71
|
-
ButtonSecondaryFullRounded,
|
|
72
|
-
ButtonSecondaryRounded,
|
|
73
|
-
ButtonSlot,
|
|
74
|
-
ButtonTertiary,
|
|
75
|
-
ButtonTertiaryFull,
|
|
76
|
-
ButtonTertiaryFullRounded,
|
|
77
|
-
ButtonTertiaryRounded,
|
|
78
|
-
Card,
|
|
79
|
-
DropdownMenu,
|
|
80
|
-
DropdownOption,
|
|
81
|
-
FormFieldCheckbox,
|
|
82
|
-
FormFieldEmail,
|
|
83
|
-
FormFieldHidden,
|
|
84
|
-
FormFieldPassword,
|
|
85
|
-
FormFieldPasswordToggle,
|
|
86
|
-
FormFieldSearch,
|
|
87
|
-
FormFieldsLogin,
|
|
88
|
-
FormFieldSlot,
|
|
89
|
-
FormFieldsRegister,
|
|
90
|
-
FormFieldText,
|
|
91
|
-
FormFieldTextSuffix,
|
|
92
|
-
FormWrapperBuild,
|
|
93
|
-
FormWrapperLMS,
|
|
94
|
-
Image,
|
|
95
|
-
Image3By1,
|
|
96
|
-
Image9By16,
|
|
97
|
-
Image16By9,
|
|
98
|
-
ImageCircle,
|
|
99
|
-
LogoRedSeedBuild,
|
|
100
|
-
LogoRedSeedCoach,
|
|
101
|
-
LogoRedSeedCourses,
|
|
102
|
-
LogoRedSeedLMS,
|
|
103
|
-
MessageBox,
|
|
104
|
-
MetaInfo,
|
|
105
|
-
Modal,
|
|
106
|
-
PageHeading,
|
|
107
|
-
ProgressCircle,
|
|
108
|
-
SignInWithGoogle,
|
|
109
|
-
SignUpWithGoogle,
|
|
110
|
-
TwoColumnLayout,
|
|
111
|
-
}
|
|
1
|
+
export * from './src/components/Badge'
|
|
2
|
+
export * from './src/components/Button'
|
|
3
|
+
export * from './src/components/ButtonGroup'
|
|
4
|
+
export * from './src/components/Card'
|
|
5
|
+
export * from './src/components/DropdownMenu'
|
|
6
|
+
export * from './src/components/Form'
|
|
7
|
+
export * from './src/components/FormField'
|
|
8
|
+
export * from './src/components/Image'
|
|
9
|
+
export * from './src/components/Link'
|
|
10
|
+
export * from './src/components/List'
|
|
11
|
+
export * from './src/components/Logo'
|
|
12
|
+
export * from './src/components/MessageBox'
|
|
13
|
+
export * from './src/components/MetaInfo'
|
|
14
|
+
export * from './src/components/Modal'
|
|
15
|
+
export * from './src/components/PageHeading'
|
|
16
|
+
export * from './src/components/Pagination'
|
|
17
|
+
export * from './src/components/Progress'
|
|
18
|
+
export * from './src/components/Social'
|
|
19
|
+
export * from './src/components/Sorting'
|
|
20
|
+
export * from './src/components/TwoColumnLayout'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redseed/redseed-ui-vue3",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "RedSeed UI Vue 3 components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@heroicons/vue": "^2.1.
|
|
14
|
-
"@vueuse/components": "^10.
|
|
15
|
-
"@vueuse/core": "^10.
|
|
16
|
-
"vue": "^3.4.
|
|
13
|
+
"@heroicons/vue": "^2.1.5",
|
|
14
|
+
"@vueuse/components": "^10.11.0",
|
|
15
|
+
"@vueuse/core": "^10.11.0",
|
|
16
|
+
"vue": "^3.4.34"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -15,26 +15,20 @@ const buttonClass = computed(() => [
|
|
|
15
15
|
:class="buttonClass"
|
|
16
16
|
v-bind="$attrs"
|
|
17
17
|
>
|
|
18
|
-
<
|
|
19
|
-
<slot name="icon"></slot>
|
|
20
|
-
</template>
|
|
21
|
-
<template #label v-if="$slots.default">
|
|
22
|
-
<slot></slot>
|
|
23
|
-
</template>
|
|
18
|
+
<slot></slot>
|
|
24
19
|
</ButtonSlot>
|
|
25
20
|
</template>
|
|
26
21
|
<style lang="scss" scoped>
|
|
27
22
|
.rsui-button-danger {
|
|
28
23
|
// default colors
|
|
29
|
-
@apply bg-
|
|
24
|
+
@apply bg-danger-content text-danger ring-danger/30 border-danger/40;
|
|
30
25
|
// default hover state
|
|
31
|
-
@apply hover:
|
|
26
|
+
@apply hover:border-danger;
|
|
32
27
|
// default focus state
|
|
33
|
-
@apply focus-visible:border-
|
|
28
|
+
@apply focus-visible:border-danger/30;
|
|
34
29
|
// default active state
|
|
35
|
-
@apply active:
|
|
30
|
+
@apply active:border-danger active:bg-danger/10;
|
|
36
31
|
// default disabled state
|
|
37
|
-
@apply disabled:text-danger/
|
|
38
|
-
@apply disabled:active:ring-0 disabled:focus:ring-0;
|
|
32
|
+
@apply disabled:text-danger/10 disabled:border-danger/10 disabled:bg-danger-content;
|
|
39
33
|
}
|
|
40
34
|
</style>
|
|
@@ -11,13 +11,7 @@ defineOptions({
|
|
|
11
11
|
full
|
|
12
12
|
v-bind="$attrs"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
15
|
-
<slot name="icon"></slot>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<template #default v-if="$slots.default">
|
|
19
|
-
<slot></slot>
|
|
20
|
-
</template>
|
|
14
|
+
<slot></slot>
|
|
21
15
|
</ButtonDanger>
|
|
22
16
|
</template>
|
|
23
17
|
<style lang="scss" scoped>
|
|
@@ -12,13 +12,7 @@ defineOptions({
|
|
|
12
12
|
rounded
|
|
13
13
|
v-bind="$attrs"
|
|
14
14
|
>
|
|
15
|
-
<
|
|
16
|
-
<slot name="icon"></slot>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<template #default v-if="$slots.default">
|
|
20
|
-
<slot></slot>
|
|
21
|
-
</template>
|
|
15
|
+
<slot></slot>
|
|
22
16
|
</ButtonDanger>
|
|
23
17
|
</template>
|
|
24
18
|
<style lang="scss" scoped>
|
|
@@ -11,13 +11,7 @@ defineOptions({
|
|
|
11
11
|
rounded
|
|
12
12
|
v-bind="$attrs"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
15
|
-
<slot name="icon"></slot>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<template #default v-if="$slots.default">
|
|
19
|
-
<slot></slot>
|
|
20
|
-
</template>
|
|
14
|
+
<slot></slot>
|
|
21
15
|
</ButtonDanger>
|
|
22
16
|
</template>
|
|
23
17
|
<style lang="scss" scoped>
|
|
@@ -15,24 +15,18 @@ const buttonClass = computed(() => [
|
|
|
15
15
|
:class="buttonClass"
|
|
16
16
|
v-bind="$attrs"
|
|
17
17
|
>
|
|
18
|
-
<
|
|
19
|
-
<slot name="icon"></slot>
|
|
20
|
-
</template>
|
|
21
|
-
<template #label v-if="$slots.default">
|
|
22
|
-
<slot></slot>
|
|
23
|
-
</template>
|
|
18
|
+
<slot></slot>
|
|
24
19
|
</ButtonSlot>
|
|
25
20
|
</template>
|
|
26
21
|
<style lang="scss" scoped>
|
|
27
22
|
.rsui-button-primary {
|
|
28
23
|
// default colors
|
|
29
|
-
@apply bg-primary text-
|
|
30
|
-
// default
|
|
31
|
-
@apply
|
|
24
|
+
@apply bg-primary text-primary-content ring-primary/30 border-primary;
|
|
25
|
+
// default focus state
|
|
26
|
+
@apply focus-visible:border-primary/30;
|
|
32
27
|
// default active state
|
|
33
|
-
@apply active:
|
|
28
|
+
@apply active:border-primary active:bg-primary/80;
|
|
34
29
|
// default disabled state
|
|
35
|
-
@apply disabled:
|
|
36
|
-
@apply disabled:active:ring-0 disabled:focus:ring-0;
|
|
30
|
+
@apply disabled:text-primary-content disabled:border-transparent disabled:bg-primary/20;
|
|
37
31
|
}
|
|
38
32
|
</style>
|
|
@@ -11,14 +11,7 @@ defineOptions({
|
|
|
11
11
|
full
|
|
12
12
|
v-bind="$attrs"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
15
|
-
<slot name="icon"></slot>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<template #default v-if="$slots.default">
|
|
19
|
-
<slot></slot>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
14
|
+
<slot></slot>
|
|
22
15
|
</ButtonPrimary>
|
|
23
16
|
</template>
|
|
24
17
|
<style lang="scss" scoped>
|
|
@@ -12,14 +12,7 @@ defineOptions({
|
|
|
12
12
|
rounded
|
|
13
13
|
v-bind="$attrs"
|
|
14
14
|
>
|
|
15
|
-
<
|
|
16
|
-
<slot name="icon"></slot>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<template #default v-if="$slots.default">
|
|
20
|
-
<slot></slot>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
15
|
+
<slot></slot>
|
|
23
16
|
</ButtonPrimary>
|
|
24
17
|
</template>
|
|
25
18
|
<style lang="scss" scoped>
|
|
@@ -11,14 +11,7 @@ defineOptions({
|
|
|
11
11
|
rounded
|
|
12
12
|
v-bind="$attrs"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
15
|
-
<slot name="icon"></slot>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<template #default v-if="$slots.default">
|
|
19
|
-
<slot></slot>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
14
|
+
<slot></slot>
|
|
22
15
|
</ButtonPrimary>
|
|
23
16
|
</template>
|
|
24
17
|
<style lang="scss" scoped>
|
|
@@ -15,24 +15,18 @@ const buttonClass = computed(() => [
|
|
|
15
15
|
:class="buttonClass"
|
|
16
16
|
v-bind="$attrs"
|
|
17
17
|
>
|
|
18
|
-
<
|
|
19
|
-
<slot name="icon"></slot>
|
|
20
|
-
</template>
|
|
21
|
-
<template #label v-if="$slots.default">
|
|
22
|
-
<slot></slot>
|
|
23
|
-
</template>
|
|
18
|
+
<slot></slot>
|
|
24
19
|
</ButtonSlot>
|
|
25
20
|
</template>
|
|
26
21
|
<style lang="scss" scoped>
|
|
27
22
|
.rsui-button-secondary {
|
|
28
23
|
// default colors
|
|
29
|
-
@apply bg-secondary text-
|
|
30
|
-
// default
|
|
31
|
-
@apply
|
|
24
|
+
@apply bg-secondary text-secondary-content ring-secondary/30 border-secondary;
|
|
25
|
+
// default focus state
|
|
26
|
+
@apply focus-visible:border-secondary/30;
|
|
32
27
|
// default active state
|
|
33
|
-
@apply active:
|
|
28
|
+
@apply active:border-secondary active:bg-secondary/80;
|
|
34
29
|
// default disabled state
|
|
35
|
-
@apply disabled:
|
|
36
|
-
@apply disabled:active:ring-0 disabled:focus:ring-0;
|
|
30
|
+
@apply disabled:text-secondary-content disabled:border-transparent disabled:bg-secondary/20;
|
|
37
31
|
}
|
|
38
32
|
</style>
|
|
@@ -11,14 +11,7 @@ defineOptions({
|
|
|
11
11
|
full
|
|
12
12
|
v-bind="$attrs"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
15
|
-
<slot name="icon"></slot>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<template #default v-if="$slots.default">
|
|
19
|
-
<slot></slot>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
14
|
+
<slot></slot>
|
|
22
15
|
</ButtonSecondary>
|
|
23
16
|
</template>
|
|
24
17
|
<style lang="scss" scoped>
|
|
@@ -12,14 +12,7 @@ defineOptions({
|
|
|
12
12
|
rounded
|
|
13
13
|
v-bind="$attrs"
|
|
14
14
|
>
|
|
15
|
-
<
|
|
16
|
-
<slot name="icon"></slot>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<template #default v-if="$slots.default">
|
|
20
|
-
<slot></slot>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
15
|
+
<slot></slot>
|
|
23
16
|
</ButtonSecondary>
|
|
24
17
|
</template>
|
|
25
18
|
<style lang="scss" scoped>
|
|
@@ -11,14 +11,7 @@ defineOptions({
|
|
|
11
11
|
rounded
|
|
12
12
|
v-bind="$attrs"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
15
|
-
<slot name="icon"></slot>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<template #default v-if="$slots.default">
|
|
19
|
-
<slot></slot>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
14
|
+
<slot></slot>
|
|
22
15
|
</ButtonSecondary>
|
|
23
16
|
</template>
|
|
24
17
|
<style lang="scss" scoped>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { ref, computed } from 'vue'
|
|
3
3
|
|
|
4
4
|
defineOptions({
|
|
5
5
|
inheritAttrs: false,
|
|
6
6
|
})
|
|
7
7
|
|
|
8
|
-
const slots = useSlots()
|
|
9
|
-
|
|
10
8
|
const props = defineProps({
|
|
11
9
|
xs: {
|
|
12
10
|
type: Boolean,
|
|
@@ -32,14 +30,6 @@ const props = defineProps({
|
|
|
32
30
|
type: Boolean,
|
|
33
31
|
default: false,
|
|
34
32
|
},
|
|
35
|
-
light: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
default: false,
|
|
38
|
-
},
|
|
39
|
-
iconEnd: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: false,
|
|
42
|
-
},
|
|
43
33
|
submit: {
|
|
44
34
|
type: Boolean,
|
|
45
35
|
default: false,
|
|
@@ -48,10 +38,14 @@ const props = defineProps({
|
|
|
48
38
|
|
|
49
39
|
defineEmits(['click'])
|
|
50
40
|
|
|
51
|
-
const defaultSize = computed(() => !props.xs && !props.sm && !props.md && !props.lg)
|
|
52
|
-
|
|
53
41
|
const type = computed(() => props.submit ? 'submit' : 'button')
|
|
54
42
|
|
|
43
|
+
const buttonElement = ref(null)
|
|
44
|
+
|
|
45
|
+
const iconOnly = computed(() => buttonElement.value && !buttonElement.value.textContent)
|
|
46
|
+
|
|
47
|
+
const defaultSize = computed(() => !props.xs && !props.sm && !props.md && !props.lg)
|
|
48
|
+
|
|
55
49
|
const buttonSlotClass = computed(() => [
|
|
56
50
|
'rsui-button-slot',
|
|
57
51
|
{
|
|
@@ -60,80 +54,45 @@ const buttonSlotClass = computed(() => [
|
|
|
60
54
|
'rsui-button-slot--sm': props.sm,
|
|
61
55
|
'rsui-button-slot--md': props.md || defaultSize.value,
|
|
62
56
|
'rsui-button-slot--lg': props.lg,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
'rsui-button-slot--
|
|
66
|
-
'rsui-button-slot--
|
|
67
|
-
'rsui-button-slot--md--icon': (props.md || defaultSize.value) && !slots.label && slots.icon,
|
|
68
|
-
'rsui-button-slot--lg--icon': props.lg && !slots.label && slots.icon,
|
|
57
|
+
'rsui-button-slot--xs-icon': props.xs && iconOnly.value,
|
|
58
|
+
'rsui-button-slot--sm-icon': props.sm && iconOnly.value,
|
|
59
|
+
'rsui-button-slot--md-icon': (props.md || defaultSize.value) && iconOnly.value,
|
|
60
|
+
'rsui-button-slot--lg-icon': props.lg && iconOnly.value,
|
|
69
61
|
|
|
70
62
|
// button full width
|
|
71
63
|
'rsui-button-slot--full': props.full,
|
|
72
64
|
|
|
73
65
|
// button fully rounded
|
|
74
66
|
'rsui-button-slot--rounded': props.rounded,
|
|
75
|
-
|
|
76
|
-
// button light variant
|
|
77
|
-
'rsui-button-slot--light': props.light,
|
|
78
|
-
|
|
79
|
-
// display icon at the end
|
|
80
|
-
'rsui-button-slot--icon-end': props.iconEnd && slots.icon,
|
|
81
67
|
},
|
|
82
68
|
])
|
|
83
|
-
|
|
84
|
-
const buttonSlotIconClass = computed(() => [
|
|
85
|
-
'rsui-button-slot__icon',
|
|
86
|
-
{
|
|
87
|
-
// modifier for button icon to be displayed at the end
|
|
88
|
-
'rsui-button-slot__icon--end': props.iconEnd && slots.icon,
|
|
89
|
-
|
|
90
|
-
// modifier for button icon to be displayed without label
|
|
91
|
-
'rsui-button-slot__icon--only': !slots.label && slots.icon,
|
|
92
|
-
}
|
|
93
|
-
])
|
|
94
69
|
</script>
|
|
95
70
|
<template>
|
|
96
71
|
<button
|
|
72
|
+
ref="buttonElement"
|
|
97
73
|
:class="buttonSlotClass"
|
|
98
74
|
:type="type"
|
|
99
75
|
v-bind="$attrs"
|
|
100
76
|
@click="$emit('click', $event)"
|
|
101
77
|
>
|
|
102
|
-
<
|
|
103
|
-
:class="buttonSlotIconClass"
|
|
104
|
-
>
|
|
105
|
-
<slot name="icon"></slot>
|
|
106
|
-
</span>
|
|
107
|
-
<span v-if="$slots.label">
|
|
108
|
-
<slot name="label"></slot>
|
|
109
|
-
</span>
|
|
78
|
+
<slot></slot>
|
|
110
79
|
</button>
|
|
111
80
|
</template>
|
|
112
81
|
<style lang="scss" scoped>
|
|
113
82
|
.rsui-button-slot {
|
|
114
|
-
// default
|
|
115
|
-
@apply w-fit h-fit inline-flex items-center justify-center select-none outline-none
|
|
83
|
+
// default control
|
|
84
|
+
@apply w-fit h-fit inline-flex shrink-0 items-center justify-center select-none outline-none whitespace-nowrap;
|
|
85
|
+
// default shape
|
|
86
|
+
@apply font-semibold gap-1 rounded-md border transition;
|
|
116
87
|
// default colors
|
|
117
|
-
@apply bg-black
|
|
118
|
-
// default hover state
|
|
119
|
-
@apply hover:bg-black;
|
|
88
|
+
@apply bg-black text-white ring-black/20 border-black;
|
|
120
89
|
// default focus state
|
|
121
90
|
@apply focus-visible:ring-4;
|
|
122
91
|
// default active state
|
|
123
92
|
@apply active:ring-0 active:bg-black/80;
|
|
124
93
|
// default disabled state
|
|
125
|
-
@apply disabled:bg-black/
|
|
94
|
+
@apply disabled:bg-black/20 disabled:border-transparent;
|
|
126
95
|
@apply disabled:active:ring-0 disabled:focus-visible:ring-0;
|
|
127
|
-
|
|
128
|
-
// modifier light variant
|
|
129
|
-
&--light {
|
|
130
|
-
@apply bg-white text-black/80;
|
|
131
|
-
@apply hover:bg-white hover:text-black;
|
|
132
|
-
@apply focus-visible:border-transparent;
|
|
133
|
-
@apply active:ring-0 active:text-black/80;
|
|
134
|
-
@apply disabled:text-black/30 disabled:border-black/30 disabled:bg-white;
|
|
135
|
-
@apply disabled:active:ring-0 disabled:focus-visible:ring-0;
|
|
136
|
-
}
|
|
137
96
|
// modifier full width
|
|
138
97
|
&--full {
|
|
139
98
|
@apply w-full;
|
|
@@ -144,60 +103,42 @@ const buttonSlotIconClass = computed(() => [
|
|
|
144
103
|
}
|
|
145
104
|
// modifier xs size
|
|
146
105
|
&--xs {
|
|
147
|
-
@apply text-xs;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
@apply px-1.5 py-1.5;
|
|
106
|
+
@apply text-xs px-2 py-1;
|
|
107
|
+
&-icon {
|
|
108
|
+
@apply p-1;
|
|
151
109
|
}
|
|
152
|
-
|
|
153
|
-
@apply
|
|
110
|
+
:deep(svg) {
|
|
111
|
+
@apply size-4;
|
|
154
112
|
}
|
|
155
113
|
}
|
|
156
114
|
// modifier sm size
|
|
157
115
|
&--sm {
|
|
158
|
-
@apply text-sm;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
@apply px-2 py-2;
|
|
116
|
+
@apply text-sm px-3 py-2;
|
|
117
|
+
&-icon {
|
|
118
|
+
@apply p-2;
|
|
162
119
|
}
|
|
163
|
-
|
|
164
|
-
@apply
|
|
120
|
+
:deep(svg) {
|
|
121
|
+
@apply size-5;
|
|
165
122
|
}
|
|
166
123
|
}
|
|
167
124
|
// modifier md size
|
|
168
125
|
&--md {
|
|
169
|
-
@apply text-base;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
@apply px-2.5 py-2.5;
|
|
126
|
+
@apply text-base px-4 py-2;
|
|
127
|
+
&-icon {
|
|
128
|
+
@apply p-2;
|
|
173
129
|
}
|
|
174
|
-
|
|
175
|
-
@apply
|
|
130
|
+
:deep(svg) {
|
|
131
|
+
@apply size-6;
|
|
176
132
|
}
|
|
177
133
|
}
|
|
178
134
|
// modifier lg size
|
|
179
135
|
&--lg {
|
|
180
|
-
@apply text-lg;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
@apply px-3 py-3;
|
|
184
|
-
}
|
|
185
|
-
.button-slot__icon {
|
|
186
|
-
@apply w-5 h-5;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
// modifier icon at the end
|
|
190
|
-
&--icon-end {
|
|
191
|
-
@apply flex-row-reverse;
|
|
192
|
-
}
|
|
193
|
-
// button icon
|
|
194
|
-
&__icon {
|
|
195
|
-
@apply block w-4 h-4 mr-2;
|
|
196
|
-
&--end {
|
|
197
|
-
@apply ml-2 mr-0;
|
|
136
|
+
@apply text-lg px-4 py-3;
|
|
137
|
+
&-icon {
|
|
138
|
+
@apply p-3;
|
|
198
139
|
}
|
|
199
|
-
|
|
200
|
-
@apply
|
|
140
|
+
:deep(svg) {
|
|
141
|
+
@apply size-7;
|
|
201
142
|
}
|
|
202
143
|
}
|
|
203
144
|
}
|
|
@@ -15,26 +15,20 @@ const buttonClass = computed(() => [
|
|
|
15
15
|
:class="buttonClass"
|
|
16
16
|
v-bind="$attrs"
|
|
17
17
|
>
|
|
18
|
-
<
|
|
19
|
-
<slot name="icon"></slot>
|
|
20
|
-
</template>
|
|
21
|
-
<template #label v-if="$slots.default">
|
|
22
|
-
<slot></slot>
|
|
23
|
-
</template>
|
|
18
|
+
<slot></slot>
|
|
24
19
|
</ButtonSlot>
|
|
25
20
|
</template>
|
|
26
21
|
<style lang="scss" scoped>
|
|
27
22
|
.rsui-button-tertiary {
|
|
28
23
|
// default colors
|
|
29
|
-
@apply bg-
|
|
24
|
+
@apply bg-tertiary text-tertiary-content ring-tertiary-content/30 border-tertiary-content/40;
|
|
30
25
|
// default hover state
|
|
31
|
-
@apply hover:
|
|
26
|
+
@apply hover:border-tertiary-content;
|
|
32
27
|
// default focus state
|
|
33
|
-
@apply focus-visible:border-
|
|
28
|
+
@apply focus-visible:border-tertiary-content/30;
|
|
34
29
|
// default active state
|
|
35
|
-
@apply active:
|
|
30
|
+
@apply active:border-tertiary-content active:bg-tertiary-content/10;
|
|
36
31
|
// default disabled state
|
|
37
|
-
@apply disabled:text-tertiary/
|
|
38
|
-
@apply disabled:active:ring-0 disabled:focus:ring-0;
|
|
32
|
+
@apply disabled:text-tertiary-content/10 disabled:border-tertiary-content/10 disabled:bg-tertiary;
|
|
39
33
|
}
|
|
40
34
|
</style>
|