@bobbykim/mcl-collapse 0.2.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/CHANGELOG.md +13 -0
- package/LICENSE.md +9 -0
- package/README.md +21 -0
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/index.ts +4 -0
- package/lib/mcl-collapse-a/MclCollapseA.vue +158 -0
- package/lib/mcl-collapse-a/MclCollapseA.vue.d.ts +95 -0
- package/lib/mcl-collapse-b/MclCollapseB.vue +145 -0
- package/lib/mcl-collapse-b/MclCollapseB.vue.d.ts +89 -0
- package/package.json +27 -0
- package/tsconfig.json +9 -0
- package/tsconfig.vue.json +9 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# 0.2.0 (2024-02-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **mcl-collapse:** add mcl-collapse component library and add story for mcl-collapse-a ([397b63e](https://github.com/bobbykim89/manguito-component-library/commit/397b63e00b83801bdf1cd2c6710d0ba876c6bf87))
|
|
12
|
+
* **mcl-collapse:** add story for mcl-collapse-b ([6edbc56](https://github.com/bobbykim89/manguito-component-library/commit/6edbc569833aae3f1aef65634987157b38956f83))
|
|
13
|
+
* **stories:** add story for mcl-card-b ([7470f0d](https://github.com/bobbykim89/manguito-component-library/commit/7470f0ddee5b3ba3c9f5c37e52bd37f6a1a75202))
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Bobby Kim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @bobbykim/mcl-collapse
|
|
2
|
+
|
|
3
|
+
Add description
|
|
4
|
+
|
|
5
|
+
## Demo
|
|
6
|
+
|
|
7
|
+
[MCL Histoire Page](https://manguito-component-library.vercel.app/story/{%story-link%})
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
`import MclCollapse from "@bobbykim/mcl-collapse"`;
|
|
14
|
+
|
|
15
|
+
## Maintainer
|
|
16
|
+
|
|
17
|
+
- **Bobby Kim** - _Initial work_
|
|
18
|
+
|
|
19
|
+
## License
|
|
20
|
+
|
|
21
|
+
This project is licensed under the MIT License - see the [LICENSE.md](./LICENSE.md) file for details
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/index.ts
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, watch } from 'vue'
|
|
3
|
+
import generateClass, { Collapse, vCollapse } from '@bobbykim/manguito-theme'
|
|
4
|
+
import type { CollapseEvent } from '@bobbykim/manguito-theme'
|
|
5
|
+
import type { ColorPalette, HeadingSize } from '@bobbykim/manguito-theme'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(
|
|
8
|
+
defineProps<{
|
|
9
|
+
collapseId: string
|
|
10
|
+
borderColor?: ColorPalette
|
|
11
|
+
rounded?: boolean
|
|
12
|
+
displayHighlight?: boolean
|
|
13
|
+
highlightColor?: ColorPalette
|
|
14
|
+
title: string
|
|
15
|
+
titleSize?: HeadingSize
|
|
16
|
+
titleColor?: ColorPalette
|
|
17
|
+
visible?: boolean
|
|
18
|
+
iconColor?: ColorPalette
|
|
19
|
+
bgColor?: ColorPalette
|
|
20
|
+
slotBgColor?: ColorPalette
|
|
21
|
+
accordion?: string
|
|
22
|
+
}>(),
|
|
23
|
+
{
|
|
24
|
+
borderColor: 'light-4',
|
|
25
|
+
rounded: false,
|
|
26
|
+
displayHighlight: true,
|
|
27
|
+
highlightColor: 'secondary',
|
|
28
|
+
titleSize: 'sm',
|
|
29
|
+
titleColor: 'dark-3',
|
|
30
|
+
visible: false,
|
|
31
|
+
iconColor: 'dark-3',
|
|
32
|
+
bgColor: 'white',
|
|
33
|
+
slotBgColor: 'light-2',
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
const toggle = ref(props.visible)
|
|
38
|
+
const emit = defineEmits(['collapse-open', 'collapse-close'])
|
|
39
|
+
|
|
40
|
+
const toggleAction = (e: CollapseEvent): void => {
|
|
41
|
+
toggle.value = e.visible
|
|
42
|
+
if (e.visible === true) {
|
|
43
|
+
emit('collapse-open', { ...e, title: props.title })
|
|
44
|
+
} else {
|
|
45
|
+
emit('collapse-close', { ...e, title: props.title })
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const getBorderClass = (
|
|
50
|
+
bColor: ColorPalette,
|
|
51
|
+
dHl: boolean,
|
|
52
|
+
hlColor: ColorPalette
|
|
53
|
+
): string => {
|
|
54
|
+
/**
|
|
55
|
+
* @param {ColorPalette} bColor - borderColor
|
|
56
|
+
* @param {boolean} dHl - displayHighlight
|
|
57
|
+
* @param {ColorPalette} hlColor - highlightColor
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
const classArray: string[] = ['border', generateClass('BORDER', bColor)]
|
|
61
|
+
|
|
62
|
+
if (dHl) {
|
|
63
|
+
const borderArray: string[] = [generateClass('BORDERL', hlColor)]
|
|
64
|
+
borderArray.forEach((item) => {
|
|
65
|
+
classArray.push(item), classArray.push('border-l-8')
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return classArray.join(' ')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const getTitleClass = (size: HeadingSize, color: ColorPalette): string => {
|
|
73
|
+
/**
|
|
74
|
+
* @param {HeadingSize} size - titleSize
|
|
75
|
+
* @param {ColorPalette} color - titleColor
|
|
76
|
+
*/
|
|
77
|
+
const classArray: string[] = [
|
|
78
|
+
generateClass('H3', size),
|
|
79
|
+
generateClass('TEXTCOLOR', color),
|
|
80
|
+
]
|
|
81
|
+
return classArray.join(' ')
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
watch(
|
|
85
|
+
() => props.visible,
|
|
86
|
+
(newValue) => {
|
|
87
|
+
toggle.value = newValue
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<template>
|
|
93
|
+
<div
|
|
94
|
+
class="overflow-hidden w-full"
|
|
95
|
+
:class="[
|
|
96
|
+
rounded ? 'rounded-lg' : 'rounded-sm',
|
|
97
|
+
getBorderClass(borderColor, displayHighlight, highlightColor),
|
|
98
|
+
]"
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
class="py-xs px-sm cursor-pointer transition-[border] duration-500"
|
|
102
|
+
:class="[
|
|
103
|
+
toggle
|
|
104
|
+
? `border-b ${generateClass('BORDERB', borderColor)} ease-in`
|
|
105
|
+
: 'ease-out',
|
|
106
|
+
generateClass('BGCOLOR', bgColor),
|
|
107
|
+
]"
|
|
108
|
+
v-collapse:[collapseId]
|
|
109
|
+
>
|
|
110
|
+
<div class="flex justify-between items-center">
|
|
111
|
+
<h3 :class="getTitleClass(titleSize, titleColor)">
|
|
112
|
+
{{ title }}
|
|
113
|
+
</h3>
|
|
114
|
+
<div @click.stop class="cursor-default">
|
|
115
|
+
<slot name="tab"></slot>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="overflow-hidden" :class="generateClass('BGCOLOR', slotBgColor)">
|
|
120
|
+
<collapse
|
|
121
|
+
:id="collapseId"
|
|
122
|
+
:visible="visible"
|
|
123
|
+
class-name="py-sm px-xs"
|
|
124
|
+
@open="toggleAction"
|
|
125
|
+
@close="toggleAction"
|
|
126
|
+
:accordion="accordion"
|
|
127
|
+
>
|
|
128
|
+
<slot name="content"></slot>
|
|
129
|
+
</collapse>
|
|
130
|
+
</div>
|
|
131
|
+
<div
|
|
132
|
+
class="py-1.5 px-sm cursor-pointer transition-all duration-500 flex justify-center items-center border-t"
|
|
133
|
+
:class="[
|
|
134
|
+
generateClass('BGCOLOR', bgColor),
|
|
135
|
+
generateClass('BORDERT', borderColor),
|
|
136
|
+
]"
|
|
137
|
+
v-collapse:[collapseId]
|
|
138
|
+
>
|
|
139
|
+
<svg
|
|
140
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
141
|
+
viewBox="0 0 448 512"
|
|
142
|
+
class="h-xs"
|
|
143
|
+
:class="[
|
|
144
|
+
!toggle ? 'rotate-0' : 'rotate-180',
|
|
145
|
+
'transition-transform duration-300 ease-in',
|
|
146
|
+
generateClass('SVGFILL', iconColor),
|
|
147
|
+
]"
|
|
148
|
+
>
|
|
149
|
+
<!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. -->
|
|
150
|
+
<path
|
|
151
|
+
d="M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"
|
|
152
|
+
/>
|
|
153
|
+
</svg>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</template>
|
|
157
|
+
|
|
158
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { ColorPalette, HeadingSize } from '@bobbykim/manguito-theme';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
collapseId: string;
|
|
4
|
+
borderColor?: ColorPalette | undefined;
|
|
5
|
+
rounded?: boolean | undefined;
|
|
6
|
+
displayHighlight?: boolean | undefined;
|
|
7
|
+
highlightColor?: ColorPalette | undefined;
|
|
8
|
+
title: string;
|
|
9
|
+
titleSize?: HeadingSize | undefined;
|
|
10
|
+
titleColor?: ColorPalette | undefined;
|
|
11
|
+
visible?: boolean | undefined;
|
|
12
|
+
iconColor?: ColorPalette | undefined;
|
|
13
|
+
bgColor?: ColorPalette | undefined;
|
|
14
|
+
slotBgColor?: ColorPalette | undefined;
|
|
15
|
+
accordion?: string | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
borderColor: string;
|
|
18
|
+
rounded: boolean;
|
|
19
|
+
displayHighlight: boolean;
|
|
20
|
+
highlightColor: string;
|
|
21
|
+
titleSize: string;
|
|
22
|
+
titleColor: string;
|
|
23
|
+
visible: boolean;
|
|
24
|
+
iconColor: string;
|
|
25
|
+
bgColor: string;
|
|
26
|
+
slotBgColor: string;
|
|
27
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
"collapse-open": (...args: any[]) => void;
|
|
29
|
+
"collapse-close": (...args: any[]) => void;
|
|
30
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
31
|
+
collapseId: string;
|
|
32
|
+
borderColor?: ColorPalette | undefined;
|
|
33
|
+
rounded?: boolean | undefined;
|
|
34
|
+
displayHighlight?: boolean | undefined;
|
|
35
|
+
highlightColor?: ColorPalette | undefined;
|
|
36
|
+
title: string;
|
|
37
|
+
titleSize?: HeadingSize | undefined;
|
|
38
|
+
titleColor?: ColorPalette | undefined;
|
|
39
|
+
visible?: boolean | undefined;
|
|
40
|
+
iconColor?: ColorPalette | undefined;
|
|
41
|
+
bgColor?: ColorPalette | undefined;
|
|
42
|
+
slotBgColor?: ColorPalette | undefined;
|
|
43
|
+
accordion?: string | undefined;
|
|
44
|
+
}>, {
|
|
45
|
+
borderColor: string;
|
|
46
|
+
rounded: boolean;
|
|
47
|
+
displayHighlight: boolean;
|
|
48
|
+
highlightColor: string;
|
|
49
|
+
titleSize: string;
|
|
50
|
+
titleColor: string;
|
|
51
|
+
visible: boolean;
|
|
52
|
+
iconColor: string;
|
|
53
|
+
bgColor: string;
|
|
54
|
+
slotBgColor: string;
|
|
55
|
+
}>>> & {
|
|
56
|
+
"onCollapse-open"?: ((...args: any[]) => any) | undefined;
|
|
57
|
+
"onCollapse-close"?: ((...args: any[]) => any) | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
visible: boolean;
|
|
60
|
+
titleColor: ColorPalette;
|
|
61
|
+
borderColor: ColorPalette;
|
|
62
|
+
rounded: boolean;
|
|
63
|
+
displayHighlight: boolean;
|
|
64
|
+
highlightColor: ColorPalette;
|
|
65
|
+
titleSize: HeadingSize;
|
|
66
|
+
iconColor: ColorPalette;
|
|
67
|
+
bgColor: ColorPalette;
|
|
68
|
+
slotBgColor: ColorPalette;
|
|
69
|
+
}, {}>, {
|
|
70
|
+
tab?(_: {}): any;
|
|
71
|
+
content?(_: {}): any;
|
|
72
|
+
}>;
|
|
73
|
+
export default _default;
|
|
74
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
75
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
76
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
77
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
78
|
+
} : {
|
|
79
|
+
type: import('vue').PropType<T[K]>;
|
|
80
|
+
required: true;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
type __VLS_WithDefaults<P, D> = {
|
|
84
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
85
|
+
default: D[K];
|
|
86
|
+
}> : P[K];
|
|
87
|
+
};
|
|
88
|
+
type __VLS_Prettify<T> = {
|
|
89
|
+
[K in keyof T]: T[K];
|
|
90
|
+
} & {};
|
|
91
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
92
|
+
new (): {
|
|
93
|
+
$slots: S;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, watch } from 'vue'
|
|
3
|
+
import generateClass, { Collapse, vCollapse } from '@bobbykim/manguito-theme'
|
|
4
|
+
import type { CollapseEvent } from '@bobbykim/manguito-theme'
|
|
5
|
+
import type { ColorPalette, HeadingSize } from '@bobbykim/manguito-theme'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(
|
|
8
|
+
defineProps<{
|
|
9
|
+
collapseId: string
|
|
10
|
+
title: string
|
|
11
|
+
titleColor?: ColorPalette
|
|
12
|
+
titleSize?: HeadingSize
|
|
13
|
+
borderColor?: ColorPalette
|
|
14
|
+
bgColor?: ColorPalette
|
|
15
|
+
btnColor?: ColorPalette
|
|
16
|
+
iconColor?: ColorPalette
|
|
17
|
+
rounded?: boolean
|
|
18
|
+
displayShadow?: boolean
|
|
19
|
+
visible?: boolean
|
|
20
|
+
accordion?: string
|
|
21
|
+
}>(),
|
|
22
|
+
{
|
|
23
|
+
titleColor: 'light-1',
|
|
24
|
+
titleSize: 'md',
|
|
25
|
+
borderColor: 'light-3',
|
|
26
|
+
bgColor: 'light-1',
|
|
27
|
+
btnColor: 'primary',
|
|
28
|
+
iconColor: 'light-1',
|
|
29
|
+
rounded: true,
|
|
30
|
+
displayShadow: true,
|
|
31
|
+
visible: false,
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
const toggle = ref(props.visible)
|
|
36
|
+
const emit = defineEmits(['collapse-open', 'collapse-close'])
|
|
37
|
+
|
|
38
|
+
const toggleAction = (e: CollapseEvent): void => {
|
|
39
|
+
toggle.value = e.visible
|
|
40
|
+
if (e.visible === true) {
|
|
41
|
+
emit('collapse-open', { ...e, title: props.title })
|
|
42
|
+
} else {
|
|
43
|
+
emit('collapse-close', { ...e, title: props.title })
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const getBorderClass = (
|
|
48
|
+
bColor: ColorPalette,
|
|
49
|
+
bgColor: ColorPalette,
|
|
50
|
+
rounded: boolean,
|
|
51
|
+
dShadow: boolean
|
|
52
|
+
): string => {
|
|
53
|
+
/**
|
|
54
|
+
* @param {ColorPalette} bColor - borderColor
|
|
55
|
+
* @param {ColorPalette} bgColor - bgColor
|
|
56
|
+
* @param {boolean} rounded - rounded
|
|
57
|
+
* @param {boolean} dShadow - displayShadow
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
let borderInfo: string[] = [
|
|
61
|
+
'border',
|
|
62
|
+
generateClass('BORDER', bColor),
|
|
63
|
+
generateClass('BGCOLOR', bgColor),
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
if (dShadow) {
|
|
67
|
+
borderInfo.push('shadow-md')
|
|
68
|
+
}
|
|
69
|
+
if (rounded) {
|
|
70
|
+
borderInfo.push('rounded-2xl')
|
|
71
|
+
} else {
|
|
72
|
+
borderInfo.push('rounded-sm')
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return borderInfo.join(' ')
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const getTitleClass = (size: HeadingSize, color: ColorPalette): string => {
|
|
79
|
+
/**
|
|
80
|
+
* @param {HeadingSize} size - titleSize
|
|
81
|
+
* @param {ColorPalette} color - titleColor
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
const classArray: string[] = [
|
|
85
|
+
generateClass('H3', size),
|
|
86
|
+
generateClass('TEXTCOLOR', color),
|
|
87
|
+
]
|
|
88
|
+
return classArray.join(' ')
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
watch(
|
|
92
|
+
() => props.visible,
|
|
93
|
+
(newValue) => {
|
|
94
|
+
toggle.value = newValue
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<div
|
|
101
|
+
class="w-full overflow-hidden p-2xs"
|
|
102
|
+
:class="getBorderClass(borderColor, bgColor, rounded, displayShadow)"
|
|
103
|
+
>
|
|
104
|
+
<div
|
|
105
|
+
v-collapse:[collapseId]
|
|
106
|
+
class="flex justify-between items-center w-full px-4 py-2 cursor-pointer hover:bg-opacity-70 transition duration-200 ease-in"
|
|
107
|
+
:class="[
|
|
108
|
+
rounded ? 'rounded-lg' : 'rounded-sm',
|
|
109
|
+
generateClass('BGCOLOR', btnColor),
|
|
110
|
+
]"
|
|
111
|
+
>
|
|
112
|
+
<h3 :class="getTitleClass(titleSize, titleColor)">{{ title }}</h3>
|
|
113
|
+
<div class="flex justify-center items-center ml-xs md:ml-sm lg:ml-md">
|
|
114
|
+
<svg
|
|
115
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
116
|
+
viewBox="0 0 448 512"
|
|
117
|
+
class="h-xs transition-transform duration-300 ease-in"
|
|
118
|
+
:class="[
|
|
119
|
+
!toggle ? 'rotate-0' : 'rotate-180',
|
|
120
|
+
generateClass('SVGFILL', iconColor),
|
|
121
|
+
]"
|
|
122
|
+
>
|
|
123
|
+
<!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. -->
|
|
124
|
+
<path
|
|
125
|
+
d="M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"
|
|
126
|
+
/>
|
|
127
|
+
</svg>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="overflow-hidden">
|
|
131
|
+
<collapse
|
|
132
|
+
:id="collapseId"
|
|
133
|
+
:visible="visible"
|
|
134
|
+
class-name="px-xs pt-xs pb-2xs"
|
|
135
|
+
:accordion="accordion"
|
|
136
|
+
@open="toggleAction"
|
|
137
|
+
@close="toggleAction"
|
|
138
|
+
>
|
|
139
|
+
<slot></slot>
|
|
140
|
+
</collapse>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</template>
|
|
144
|
+
|
|
145
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { ColorPalette, HeadingSize } from '@bobbykim/manguito-theme';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
collapseId: string;
|
|
4
|
+
title: string;
|
|
5
|
+
titleColor?: ColorPalette | undefined;
|
|
6
|
+
titleSize?: HeadingSize | undefined;
|
|
7
|
+
borderColor?: ColorPalette | undefined;
|
|
8
|
+
bgColor?: ColorPalette | undefined;
|
|
9
|
+
btnColor?: ColorPalette | undefined;
|
|
10
|
+
iconColor?: ColorPalette | undefined;
|
|
11
|
+
rounded?: boolean | undefined;
|
|
12
|
+
displayShadow?: boolean | undefined;
|
|
13
|
+
visible?: boolean | undefined;
|
|
14
|
+
accordion?: string | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
titleColor: string;
|
|
17
|
+
titleSize: string;
|
|
18
|
+
borderColor: string;
|
|
19
|
+
bgColor: string;
|
|
20
|
+
btnColor: string;
|
|
21
|
+
iconColor: string;
|
|
22
|
+
rounded: boolean;
|
|
23
|
+
displayShadow: boolean;
|
|
24
|
+
visible: boolean;
|
|
25
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
|
+
"collapse-open": (...args: any[]) => void;
|
|
27
|
+
"collapse-close": (...args: any[]) => void;
|
|
28
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
29
|
+
collapseId: string;
|
|
30
|
+
title: string;
|
|
31
|
+
titleColor?: ColorPalette | undefined;
|
|
32
|
+
titleSize?: HeadingSize | undefined;
|
|
33
|
+
borderColor?: ColorPalette | undefined;
|
|
34
|
+
bgColor?: ColorPalette | undefined;
|
|
35
|
+
btnColor?: ColorPalette | undefined;
|
|
36
|
+
iconColor?: ColorPalette | undefined;
|
|
37
|
+
rounded?: boolean | undefined;
|
|
38
|
+
displayShadow?: boolean | undefined;
|
|
39
|
+
visible?: boolean | undefined;
|
|
40
|
+
accordion?: string | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
titleColor: string;
|
|
43
|
+
titleSize: string;
|
|
44
|
+
borderColor: string;
|
|
45
|
+
bgColor: string;
|
|
46
|
+
btnColor: string;
|
|
47
|
+
iconColor: string;
|
|
48
|
+
rounded: boolean;
|
|
49
|
+
displayShadow: boolean;
|
|
50
|
+
visible: boolean;
|
|
51
|
+
}>>> & {
|
|
52
|
+
"onCollapse-open"?: ((...args: any[]) => any) | undefined;
|
|
53
|
+
"onCollapse-close"?: ((...args: any[]) => any) | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
visible: boolean;
|
|
56
|
+
titleColor: ColorPalette;
|
|
57
|
+
borderColor: ColorPalette;
|
|
58
|
+
rounded: boolean;
|
|
59
|
+
titleSize: HeadingSize;
|
|
60
|
+
iconColor: ColorPalette;
|
|
61
|
+
bgColor: ColorPalette;
|
|
62
|
+
btnColor: ColorPalette;
|
|
63
|
+
displayShadow: boolean;
|
|
64
|
+
}, {}>, {
|
|
65
|
+
default?(_: {}): any;
|
|
66
|
+
}>;
|
|
67
|
+
export default _default;
|
|
68
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
69
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
70
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
71
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
72
|
+
} : {
|
|
73
|
+
type: import('vue').PropType<T[K]>;
|
|
74
|
+
required: true;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
type __VLS_WithDefaults<P, D> = {
|
|
78
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
79
|
+
default: D[K];
|
|
80
|
+
}> : P[K];
|
|
81
|
+
};
|
|
82
|
+
type __VLS_Prettify<T> = {
|
|
83
|
+
[K in keyof T]: T[K];
|
|
84
|
+
} & {};
|
|
85
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
86
|
+
new (): {
|
|
87
|
+
$slots: S;
|
|
88
|
+
};
|
|
89
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bobbykim/mcl-collapse",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "vue-tsc --project tsconfig.vue.json && tsc"
|
|
9
|
+
},
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Bobby Kim",
|
|
12
|
+
"url": "https://www.devbobbykim.com/"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://manguito-component-library.vercel.app/",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/bobbykim89/manguito-component-library.git"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@bobbykim/manguito-theme": "^0.14.0"
|
|
25
|
+
},
|
|
26
|
+
"gitHead": "4d94a8d34988d926c8d465891fd7aa535cffdf33"
|
|
27
|
+
}
|
package/tsconfig.json
ADDED