nuxt-hs-ui 1.0.1

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.
Files changed (54) hide show
  1. package/README.md +4 -0
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.mts +8 -0
  4. package/dist/module.d.ts +8 -0
  5. package/dist/module.json +9 -0
  6. package/dist/module.mjs +92 -0
  7. package/dist/runtime/components/hs-fc/btn/index.vue +508 -0
  8. package/dist/runtime/components/hs-fc/btn/line-loading.vue +125 -0
  9. package/dist/runtime/components/hs-fc/hoge +0 -0
  10. package/dist/runtime/components/hs-ui/accordion.vue +93 -0
  11. package/dist/runtime/components/hs-ui/aspect-box.vue +78 -0
  12. package/dist/runtime/components/hs-ui/block-loading.vue +210 -0
  13. package/dist/runtime/components/hs-ui/card-item.vue +136 -0
  14. package/dist/runtime/components/hs-ui/card.vue +48 -0
  15. package/dist/runtime/components/hs-ui/container.vue +46 -0
  16. package/dist/runtime/components/hs-ui/dialog/index.type.d.ts +48 -0
  17. package/dist/runtime/components/hs-ui/dialog/index.type.js +57 -0
  18. package/dist/runtime/components/hs-ui/dialog/index.vue +353 -0
  19. package/dist/runtime/components/hs-ui/modal/bg.vue +90 -0
  20. package/dist/runtime/components/hs-ui/modal/index.vue +203 -0
  21. package/dist/runtime/components/hs-ui/modal/use-ui-modal.d.ts +20 -0
  22. package/dist/runtime/components/hs-ui/modal/use-ui-modal.js +74 -0
  23. package/dist/runtime/components/hs-ui/toast/index.type.d.ts +24 -0
  24. package/dist/runtime/components/hs-ui/toast/index.type.js +7 -0
  25. package/dist/runtime/components/hs-ui/toast/index.vue +355 -0
  26. package/dist/runtime/components/hs-ui/window-loader.vue +185 -0
  27. package/dist/runtime/components/v-test.vue +57 -0
  28. package/dist/runtime/composables/use-hs-form-focus.d.ts +10 -0
  29. package/dist/runtime/composables/use-hs-form-focus.js +29 -0
  30. package/dist/runtime/composables/use-hs-multi-lang.d.ts +9 -0
  31. package/dist/runtime/composables/use-hs-multi-lang.js +21 -0
  32. package/dist/runtime/composables/use-hs-ui-dialog.d.ts +22 -0
  33. package/dist/runtime/composables/use-hs-ui-dialog.js +43 -0
  34. package/dist/runtime/composables/use-hs-ui-toast.d.ts +20 -0
  35. package/dist/runtime/composables/use-hs-ui-toast.js +55 -0
  36. package/dist/runtime/composables/use-hs-ui-window-loader.d.ts +11 -0
  37. package/dist/runtime/composables/use-hs-ui-window-loader.js +21 -0
  38. package/dist/runtime/lib/class-style.d.ts +8 -0
  39. package/dist/runtime/lib/class-style.js +59 -0
  40. package/dist/runtime/lib/com.d.ts +14 -0
  41. package/dist/runtime/lib/com.js +25 -0
  42. package/dist/runtime/lib/multi-lang.d.ts +9 -0
  43. package/dist/runtime/lib/multi-lang.js +75 -0
  44. package/dist/runtime/lib/number.d.ts +16 -0
  45. package/dist/runtime/lib/number.js +101 -0
  46. package/dist/runtime/lib/prefix.d.ts +2 -0
  47. package/dist/runtime/lib/prefix.js +19 -0
  48. package/dist/runtime/lib/theme.d.ts +2 -0
  49. package/dist/runtime/lib/theme.js +21 -0
  50. package/dist/runtime/server/tsconfig.json +3 -0
  51. package/dist/runtime/style.css +1 -0
  52. package/dist/types.d.mts +17 -0
  53. package/dist/types.d.ts +17 -0
  54. package/package.json +82 -0
@@ -0,0 +1,125 @@
1
+ <script setup lang="ts">
2
+ /* ----------------------------------------------------------------------------
3
+ src\runtime\components\hs-fc\btn\line-loading.vue
4
+ // ----------------------------------------------------------------------------
5
+ HsFcBtnLineLoading
6
+ HsFcBtnLineLoadingHsFcBtnLineLoading
7
+ ----------------------------------------------------------------------------- */
8
+
9
+ // [ vue ]
10
+ import { computed } from 'vue';
11
+ // // [ tailwind ]
12
+ import { extendTailwindMerge } from 'tailwind-merge';
13
+ import { type ClassType, ClassTypeToString } from '../../../lib/com';
14
+ import { GetPrefix, RemovePrefix } from '../../../lib/prefix';
15
+
16
+ // ----------------------------------------------------------------------------
17
+ const twMerge = extendTailwindMerge({
18
+ prefix: GetPrefix(),
19
+ });
20
+
21
+ // ----------------------------------------------------------------------------
22
+ interface Props {
23
+ class?: ClassType;
24
+ show: boolean;
25
+ height?: number | undefined;
26
+ speed?: number | undefined;
27
+ }
28
+ const props = withDefaults(defineProps<Props>(), {
29
+ height: 5,
30
+ speed: 1000,
31
+ class: '',
32
+ });
33
+ // ----------------------------------------------------------------------------
34
+ const baseClass = RemovePrefix([
35
+ //
36
+ 'absolute',
37
+ 'tw-absolute',
38
+ 'inset-0',
39
+ 'tw-inset-0',
40
+ 'bg-indigo-600/[0.6]',
41
+ 'tw-bg-indigo-600/[0.6]',
42
+ 'flex',
43
+ 'tw-flex',
44
+ 'justify-center',
45
+ 'tw-justify-center',
46
+ 'items-center',
47
+ 'tw-items-center',
48
+ 'transition-opacity',
49
+ 'tw-transition-opacity',
50
+ ]);
51
+ const classStyle = computed(() => {
52
+ return twMerge(baseClass, ClassTypeToString(props.class));
53
+ });
54
+ // ----------------------------------------------------------------------------
55
+ </script>
56
+ <template>
57
+ <div class="HsFcBtnLineLoading" :class="[classStyle, { show: props.show }]">
58
+ <!-- <div class="circleloader"></div> -->
59
+ <span
60
+ class="loader"
61
+ :style="`--HsFcBtnLineLoading-height:${props.height}px;--HsFcBtnLineLoading-speed:${props.speed}ms`"
62
+ />
63
+ </div>
64
+ </template>
65
+ <style scoped>
66
+ .HsFcBtnLineLoading {
67
+ opacity: 0;
68
+ pointer-events: none;
69
+ user-select: none;
70
+ padding: 0 10%;
71
+ }
72
+ .HsFcBtnLineLoading.show {
73
+ opacity: 1;
74
+ }
75
+
76
+ .loader {
77
+ width: 100%;
78
+ height: var(--HsFcBtnLineLoading-height);
79
+ display: inline-block;
80
+ position: relative;
81
+ background: rgba(255, 255, 255, 0.15);
82
+ overflow: hidden;
83
+ border-radius: calc(infinity * 1px);
84
+ }
85
+
86
+ .loader::after {
87
+ content: "";
88
+ width: 50%;
89
+ height: var(--HsFcBtnLineLoading-height);
90
+ background: #fff;
91
+ position: absolute;
92
+ border-radius: calc(infinity * 1px);
93
+ top: 0;
94
+ left: 0;
95
+ box-sizing: border-box;
96
+ animation: HsFcBtnLineLoading-anime var(--HsFcBtnLineLoading-speed) linear infinite;
97
+ }
98
+ </style>
99
+
100
+ <style lang="scss">
101
+ @keyframes HsFcBtnLineLoading-anime {
102
+ 0% {
103
+ opacity: 0;
104
+ left: 0;
105
+ transform: translateX(-200%);
106
+ }
107
+ 20% {
108
+ opacity: 1;
109
+ left: 0;
110
+ transform: translateX(-200%);
111
+ }
112
+ 80% {
113
+ opacity: 1;
114
+ left: 100%;
115
+ left: 0;
116
+ transform: translateX(200%);
117
+ }
118
+ 100% {
119
+ left: 100%;
120
+ left: 0;
121
+ transform: translateX(200%);
122
+ opacity: 0;
123
+ }
124
+ }
125
+ </style>
File without changes
@@ -0,0 +1,93 @@
1
+ <script setup lang="ts">
2
+ /* ----------------------------------------------------------------------------
3
+ src\runtime\components\hs-ui\accordion.vue
4
+ // ----------------------------------------------------------------------------
5
+ HsUiAccordion
6
+ HsUiAccordionHsUiAccordion
7
+ ----------------------------------------------------------------------------- */
8
+
9
+ // [ vue ]
10
+ import { computed, ref, watch, nextTick } from 'vue';
11
+ // [ tailwind ]
12
+ import { extendTailwindMerge } from 'tailwind-merge';
13
+ import { type ClassType, ClassTypeToString } from '../../lib/class-style';
14
+ import { GetPrefix, RemovePrefix } from '../../lib/prefix';
15
+
16
+ // ----------------------------------------------------------------------------
17
+
18
+ const twMerge = extendTailwindMerge({
19
+ prefix: GetPrefix(),
20
+ });
21
+ // ----------------------------------------------------------------------------
22
+ // [ Props ]
23
+ type Props = {
24
+ class?: ClassType | undefined;
25
+ open: boolean;
26
+ span?: number;
27
+ };
28
+ const props = withDefaults(defineProps<Props>(), {
29
+ class: '',
30
+ open: true,
31
+ span: 300,
32
+ });
33
+
34
+ const innerHidden = ref(!props.open);
35
+ watch(
36
+ () => props.open,
37
+ (v) => {
38
+ //
39
+ if (v) {
40
+ setTimeout(() => {
41
+ if (props.open) {
42
+ innerHidden.value = !v;
43
+ }
44
+ }, props.span);
45
+ } else {
46
+ nextTick(() => {
47
+ innerHidden.value = !v;
48
+ });
49
+ }
50
+ }
51
+ );
52
+
53
+ const baseClass = RemovePrefix([
54
+ //
55
+ 'w-full',
56
+ 'tw-w-full',
57
+ ]);
58
+
59
+ const classStyle = computed(() => {
60
+ return twMerge(baseClass, ClassTypeToString(props.class));
61
+ });
62
+ const classOverflow = RemovePrefix([
63
+ //
64
+ 'overflow-y-hidden',
65
+ 'tw-overflow-y-hidden',
66
+ ]);
67
+ const overflowClass = computed(() => {
68
+ if (innerHidden.value) return classOverflow;
69
+ return '';
70
+ });
71
+ // ----------------------------------------------------------------------------
72
+ </script>
73
+ <template>
74
+ <div
75
+ class="HsUiAccordion"
76
+ :class="[{ open: open }, classStyle]"
77
+ :style="`--hsui-accordion-span:${props.span}ms`"
78
+ :aria-hidden="!props.open"
79
+ >
80
+ <div :class="overflowClass"><slot/></div>
81
+ </div>
82
+ </template>
83
+
84
+ <style scoped>
85
+ .HsUiAccordion {
86
+ display: grid;
87
+ grid-template-rows: 0fr;
88
+ transition: grid-template-rows var(--hsui-accordion-span);
89
+ }
90
+ .HsUiAccordion.open {
91
+ grid-template-rows: 1fr;
92
+ }
93
+ </style>
@@ -0,0 +1,78 @@
1
+ <script setup lang="ts">
2
+ /* ----------------------------------------------------------------------------
3
+ src\runtime\components\hs-ui\aspect-box.vue
4
+ // ----------------------------------------------------------------------------
5
+ HsUiAspectBox
6
+ HsUiAspectBoxHsUiAspectBox
7
+ ----------------------------------------------------------------------------- */
8
+
9
+ // [ vue ]
10
+ import { computed } from 'vue';
11
+ // [ tailwind ]
12
+ import { extendTailwindMerge } from 'tailwind-merge';
13
+ import { type ClassType, ClassTypeToString } from '../../lib/class-style';
14
+ import { GetPrefix, RemovePrefix } from '../../lib/prefix';
15
+ // [ src > runtime > lib > * ]
16
+ import { Int } from '../../lib/number';
17
+ // ----------------------------------------------------------------------------
18
+ const twMerge = extendTailwindMerge({
19
+ prefix: GetPrefix(),
20
+ });
21
+ // ----------------------------------------------------------------------------
22
+ type Props = {
23
+ class?: ClassType | undefined;
24
+ /**
25
+ * Aspect ratio
26
+ * - Example:
27
+ * - 1:1
28
+ * - 3:2 <- Default
29
+ * - 4:3
30
+ * - 16:9
31
+ */
32
+ rate?: string;
33
+ };
34
+
35
+ const props = withDefaults(defineProps<Props>(), {
36
+ class: '',
37
+ rate: '3:2',
38
+ });
39
+ const aspectRate = computed(() => {
40
+ const left = Int(props.rate.replace(/^(\d*):(\d*)$/, '$1'));
41
+ const right = Int(props.rate.replace(/^(\d*):(\d*)$/, '$2'));
42
+ if (left === 0 || right === 0) return '100';
43
+ return ((right / left) * 100).toFixed(3);
44
+ });
45
+
46
+ const baseClass = RemovePrefix([
47
+ //
48
+ 'relative',
49
+ 'tw-relative',
50
+ ]);
51
+ const classStyle = computed(() => {
52
+ return twMerge(baseClass, ClassTypeToString(props.class));
53
+ });
54
+ </script>
55
+ <template>
56
+ <div class="HsUiAspectContainer" :class="classStyle" :style="` --aspect-rate: ${aspectRate}%;`">
57
+ <div>
58
+ <slot />
59
+ </div>
60
+ </div>
61
+ </template>
62
+
63
+ <style scoped>
64
+ .HsUiAspectContainer {
65
+ display: block;
66
+ --aspect-rate: 66.66%;
67
+ /* 3:2 */
68
+ }
69
+ .HsUiAspectContainer::before {
70
+ content: "";
71
+ display: block;
72
+ padding-top: var(--aspect-rate);
73
+ }
74
+ .HsUiAspectContainer > div {
75
+ position: absolute;
76
+ inset: 0 0 0 0;
77
+ }
78
+ </style>
@@ -0,0 +1,210 @@
1
+ <script setup lang="ts">
2
+ /* ----------------------------------------------------------------------------
3
+ src\runtime\components\hs-ui\block-loading.vue
4
+ // ----------------------------------------------------------------------------
5
+ HsUiBlockLoading
6
+ HsUiBlockLoadingHsUiBlockLoading
7
+ ----------------------------------------------------------------------------- */
8
+
9
+ // [ vue ]
10
+ import { computed } from 'vue';
11
+ // [ tailwind ]
12
+ import { extendTailwindMerge } from 'tailwind-merge';
13
+ import { type ClassType, ClassTypeToString } from '../../lib/class-style';
14
+ import { GetPrefix, RemovePrefix } from '../../lib/prefix';
15
+ // ----------------------------------------------------------------------------
16
+ const twMerge = extendTailwindMerge({
17
+ prefix: GetPrefix(),
18
+ });
19
+ // ----------------------------------------------------------------------------
20
+ type Props = {
21
+ class?: ClassType | undefined;
22
+ show: boolean;
23
+ message?: string;
24
+ };
25
+ const props = withDefaults(defineProps<Props>(), {
26
+ class: '',
27
+ show: false,
28
+ message: 'Loading',
29
+ });
30
+ const baseClass = RemovePrefix([
31
+ //
32
+ 'px-2',
33
+ 'tw-px-2',
34
+ 'pt-2',
35
+ 'tw-pt-2',
36
+ 'pb-1',
37
+ 'tw-pb-1',
38
+ 'absolute',
39
+ 'tw-absolute',
40
+ 'inset-0',
41
+ 'tw-inset-0',
42
+ 'h-full',
43
+ 'tw-h-full',
44
+ 'w-full',
45
+ 'tw-w-full',
46
+ 'overflow-hidden',
47
+ 'tw-overflow-hidden',
48
+ 'bg-[#13175C]/[0.5]',
49
+ 'tw-bg-[#43536E]/[0.5]',
50
+ 'flex',
51
+ 'tw-flex',
52
+ 'items-center',
53
+ 'tw-items-center',
54
+ 'justify-center',
55
+ 'tw-justify-center',
56
+ 'transition-opacity',
57
+ 'tw-transition-opacity',
58
+ ]);
59
+
60
+ const variableStyle = computed(() => {
61
+ if (props.show) {
62
+ return RemovePrefix([
63
+ //
64
+ 'pointer-events-auto',
65
+ 'tw-pointer-events-auto',
66
+ 'opacity-100',
67
+ 'tw-opacity-100',
68
+ ]);
69
+ }
70
+ return RemovePrefix([
71
+ //
72
+ 'pointer-events-none',
73
+ 'tw-pointer-events-none',
74
+ 'opacity-0',
75
+ 'tw-opacity-0',
76
+ ]);
77
+ });
78
+
79
+ const classStyle = computed(() => {
80
+ return twMerge(baseClass, variableStyle.value, ClassTypeToString(props.class));
81
+ });
82
+ </script>
83
+ <template>
84
+ <div class="HsUiBlockLoading" :class="[classStyle]">
85
+ <div class="loading-container">
86
+ <div class="loading-item">
87
+ <div class="loading-ball"/>
88
+ <div class="loading-ball"/>
89
+ <div class="loading-ball"/>
90
+ </div>
91
+ <div class="loading-text">{{ props.message }}</div>
92
+ </div>
93
+ </div>
94
+ </template>
95
+ <style scoped>
96
+ .loading-container {
97
+ width: 50%;
98
+ max-width: 200px;
99
+ max-height: min(90%, 160px);
100
+ }
101
+ .loading-container::before {
102
+ content: "";
103
+ display: block;
104
+ padding-top: 56.25%;
105
+ padding-top: 40%;
106
+ }
107
+
108
+ .loading-item {
109
+ position: absolute;
110
+ top: 0;
111
+ left: 0;
112
+ bottom: 20px;
113
+ right: 0;
114
+ display: flex;
115
+ justify-content: center;
116
+ align-items: center;
117
+ height: calc(100% - 20px);
118
+ }
119
+
120
+ .loading-ball {
121
+ height: 100%;
122
+ width: 40px;
123
+ max-width: 60px;
124
+ }
125
+ .loading-ball::before, .loading-ball::after {
126
+ left: 10px;
127
+ position: absolute;
128
+ content: "";
129
+ display: block;
130
+ border-radius: 50%;
131
+ background-color: red;
132
+ }
133
+ .loading-ball::before {
134
+ z-index: 1;
135
+ top: 0px;
136
+ width: 16px;
137
+ height: 16px;
138
+ border-radius: 50%;
139
+ background-color: rgb(255, 255, 255);
140
+ animation: HsUiBlockLoading-anime1 0.5s alternate infinite ease;
141
+ }
142
+ .loading-ball::after {
143
+ z-index: 0;
144
+ bottom: 0px;
145
+ width: 16px;
146
+ height: 4px;
147
+ border-radius: 50%;
148
+ background-color: rgb(35, 32, 55);
149
+ animation: HsUiBlockLoading-anime2 0.5s alternate infinite ease;
150
+ }
151
+ .loading-ball:nth-child(2)::before, .loading-ball:nth-child(2)::after {
152
+ animation-delay: 0.2s;
153
+ }
154
+ .loading-ball:nth-child(3)::before, .loading-ball:nth-child(3)::after {
155
+ animation-delay: 0.3s;
156
+ }
157
+
158
+ .loading-text {
159
+ position: absolute;
160
+ left: 0;
161
+ bottom: 0;
162
+ right: 0;
163
+ height: 20px;
164
+ display: flex;
165
+ justify-content: center;
166
+ align-items: center;
167
+ color: rgb(255, 255, 255);
168
+ -moz-user-select: none;
169
+ -webkit-user-select: none;
170
+ -ms-user-select: none;
171
+ user-select: none;
172
+ }
173
+ </style>
174
+
175
+ <style lang="scss">
176
+ @keyframes HsUiBlockLoading-anime1 {
177
+ 0% {
178
+ top: calc(100% - 4px);
179
+ height: 5px;
180
+ border-radius: 50% 50% 25% 25%;
181
+ transform: scaleX(1.4);
182
+ }
183
+
184
+ 40% {
185
+ height: 16px;
186
+ border-radius: 50%;
187
+ transform: scaleX(1);
188
+ }
189
+
190
+ 100% {
191
+ top: 0%;
192
+ }
193
+ }
194
+
195
+ @keyframes HsUiBlockLoading-anime2 {
196
+ 0% {
197
+ transform: scaleX(1.5);
198
+ }
199
+
200
+ 40% {
201
+ transform: scaleX(1);
202
+ opacity: 0.7;
203
+ }
204
+
205
+ 100% {
206
+ transform: scaleX(0.2);
207
+ opacity: 0.4;
208
+ }
209
+ }
210
+ </style>
@@ -0,0 +1,136 @@
1
+ <script setup lang="ts">
2
+ /* ----------------------------------------------------------------------------
3
+ src\runtime\components\hs-ui\card-item.vue
4
+ // ----------------------------------------------------------------------------
5
+ HsUiCardItem
6
+ HsUiCardItemHsUiCardItem
7
+ ----------------------------------------------------------------------------- */
8
+
9
+ // [ vue ]
10
+ import { computed } from 'vue';
11
+ // [ tailwind ]
12
+ import { extendTailwindMerge } from 'tailwind-merge';
13
+ import { type ClassType, ClassTypeToArray } from '../../lib/class-style';
14
+ import { GetPrefix, RemovePrefix } from '../../lib/prefix';
15
+
16
+ // ----------------------------------------------------------------------------
17
+ const twMerge = extendTailwindMerge({
18
+ prefix: GetPrefix(),
19
+ });
20
+ // ----------------------------------------------------------------------------
21
+
22
+ interface Props {
23
+ class?: ClassType | undefined;
24
+ variant?: 'header' | 'body' | 'footer';
25
+ accordion?: boolean | undefined;
26
+ // hasCloseBtn?: boolean | undefined;
27
+ isOpen?: boolean | undefined;
28
+ }
29
+ const props = withDefaults(defineProps<Props>(), {
30
+ class: '',
31
+ variant: 'body',
32
+ accordion: undefined,
33
+ isOpen: undefined,
34
+ // hasCloseBtn: undefined,
35
+ });
36
+ type Emits = {
37
+ ref: [e: HTMLElement];
38
+ 'update:isOpen': [value: boolean];
39
+ 'bg-click': [];
40
+ };
41
+ const emit = defineEmits<Emits>();
42
+
43
+ // ----------------------------------------------------------------------------
44
+
45
+ const baseClass = RemovePrefix([
46
+ //
47
+ 'relative',
48
+ 'tw-relative',
49
+ 'px-2',
50
+ 'tw-px-2',
51
+ 'py-1',
52
+ 'tw-py-1',
53
+ ]);
54
+
55
+ const baseClassHeaderFooter = RemovePrefix([
56
+ //,,
57
+ 'relative',
58
+ 'tw-relative',
59
+ // 'p-1',
60
+ // 'tw-p-1',
61
+ 'bg-[#FFFFFF]',
62
+ 'tw-bg-[#FFFFFF]',
63
+ 'flex',
64
+ 'tw-flex',
65
+ 'justify-between',
66
+ 'tw-justify-between',
67
+ 'items-center',
68
+ 'tw-items-center',
69
+ 'flex-none',
70
+ 'tw-flex-none',
71
+ ]);
72
+
73
+ const baseClassBody = RemovePrefix([
74
+ //
75
+ 'relative',
76
+ 'tw-relative',
77
+ // 'p-1',
78
+ // 'tw-p-1',
79
+ 'bg-[#FFFFFF]',
80
+ 'tw-bg-[#FFFFFF]',
81
+ 'flex-1',
82
+ 'tw-flex-1',
83
+ 'overflow-auto',
84
+ 'tw-overflow-auto',
85
+ ]);
86
+
87
+ const pe1 = RemovePrefix([
88
+ //
89
+ 'pe-1',
90
+ 'tw-pe-1',
91
+ ]);
92
+
93
+ const showBtnStyle = RemovePrefix([
94
+ //
95
+ 'border-[1px]',
96
+ 'tw-border-[1px]',
97
+ '!bg-transparent',
98
+ '!tw-bg-transparent',
99
+ ]);
100
+
101
+ const c = computed(() => {
102
+ if (props.variant === 'header' || props.variant === 'footer') {
103
+ return baseClassHeaderFooter;
104
+ }
105
+ return baseClassBody;
106
+ });
107
+
108
+ const classStyle = computed(() => {
109
+ return twMerge(baseClass, c.value, props.isOpen !== undefined ? pe1 : '', ClassTypeToArray(props.class));
110
+ });
111
+ </script>
112
+ <template>
113
+ <template v-if="props.isOpen !== undefined">
114
+ <div :ref="(e:any)=>emit('ref',e)" class="HsUiCardItem" :class="classStyle" @click.stop="emit('bg-click')">
115
+ <div class=""><slot /></div>
116
+ <div class="">
117
+ <HsFcBtn theme="white" :class="showBtnStyle" @click.stop="emit('update:isOpen', !props.isOpen)">
118
+ <i v-if="props.isOpen" class="fa-solid fa-chevron-up" />
119
+ <i v-else class="fa-solid fa-chevron-down" />
120
+ </HsFcBtn>
121
+ </div>
122
+ </div>
123
+ </template>
124
+ <template v-else-if="props.accordion === undefined">
125
+ <div :ref="(e:any)=>emit('ref',e)" class="HsUiCardItem" :class="classStyle">
126
+ <slot />
127
+ </div>
128
+ </template>
129
+ <template v-else>
130
+ <HsUiAccordion :open="props.accordion">
131
+ <div :ref="(e:any)=>emit('ref',e)" class="HsUiCardItem" :class="classStyle">
132
+ <slot />
133
+ </div>
134
+ </HsUiAccordion>
135
+ </template>
136
+ </template>
@@ -0,0 +1,48 @@
1
+ <script setup lang="ts">
2
+ /* ----------------------------------------------------------------------------
3
+ src\runtime\components\hs-ui\card.vue
4
+ // ----------------------------------------------------------------------------
5
+ HsUiCard
6
+ HsUiCardHsUiCard
7
+ ----------------------------------------------------------------------------- */
8
+
9
+ // [ vue ]
10
+ import { computed } from 'vue';
11
+ // [ tailwind ]
12
+ import { extendTailwindMerge } from 'tailwind-merge';
13
+ import { type ClassType, ClassTypeToString } from '../../lib/class-style';
14
+ import { GetPrefix, RemovePrefix } from '../../lib/prefix';
15
+ // ----------------------------------------------------------------------------
16
+ const twMerge = extendTailwindMerge({
17
+ prefix: GetPrefix(),
18
+ });
19
+ // ----------------------------------------------------------------------------
20
+ interface Props {
21
+ class?: ClassType | undefined;
22
+ }
23
+ const props = withDefaults(defineProps<Props>(), {
24
+ class: '',
25
+ });
26
+
27
+ const baseClass = RemovePrefix([
28
+ //
29
+ 'relative',
30
+ 'tw-relative',
31
+ 'flex',
32
+ 'tw-flex',
33
+ 'flex-col',
34
+ 'tw-flex-col',
35
+ 'border-2',
36
+ 'tw-border-2',
37
+ 'border-white',
38
+ 'tw-border-white',
39
+ ]);
40
+ const classStyle = computed(() => {
41
+ return twMerge(baseClass, ClassTypeToString(props.class));
42
+ });
43
+ </script>
44
+ <template>
45
+ <div :class="classStyle">
46
+ <slot />
47
+ </div>
48
+ </template>