@expcat/tigercat-vue 0.2.0 → 0.2.27

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 (87) hide show
  1. package/README.md +50 -0
  2. package/dist/{chunk-U6JCAP2C.js → chunk-4NOUPGLA.js} +2 -2
  3. package/dist/chunk-4QIOLPLB.mjs +380 -0
  4. package/dist/chunk-54IA7YWJ.js +175 -0
  5. package/dist/chunk-74PW5YAR.mjs +246 -0
  6. package/dist/{chunk-UF5MJ52T.js → chunk-E3FDI3Y5.js} +17 -5
  7. package/dist/{chunk-KVAQ7RXO.mjs → chunk-GO3JWOB6.mjs} +1 -1
  8. package/dist/chunk-I3Z247PO.js +250 -0
  9. package/dist/{chunk-BHFFQSYV.js → chunk-IK3ZLVPR.js} +43 -8
  10. package/dist/chunk-JQ73I2Q6.js +114 -0
  11. package/dist/chunk-LFIZI5Z4.mjs +96 -0
  12. package/dist/chunk-NTXRWISS.js +142 -0
  13. package/dist/chunk-OVFGETP7.mjs +138 -0
  14. package/dist/chunk-QVMU7OT7.mjs +172 -0
  15. package/dist/{chunk-W2CCYPSO.mjs → chunk-SSVIJWPS.mjs} +1 -1
  16. package/dist/chunk-SUZB7IAA.js +97 -0
  17. package/dist/chunk-TKTAGTDP.js +383 -0
  18. package/dist/chunk-W57RIOYG.mjs +111 -0
  19. package/dist/{chunk-LLSZZ6HH.mjs → chunk-XMBCYUDD.mjs} +17 -5
  20. package/dist/chunk-Y4KDPUTV.mjs +94 -0
  21. package/dist/{chunk-VIXWGRQT.js → chunk-ZLMJ3SZQ.js} +2 -2
  22. package/dist/components/Anchor.d.mts +186 -0
  23. package/dist/components/Anchor.d.ts +186 -0
  24. package/dist/components/Anchor.js +20 -0
  25. package/dist/components/Anchor.mjs +1 -0
  26. package/dist/components/AnchorLink.d.mts +69 -0
  27. package/dist/components/AnchorLink.d.ts +69 -0
  28. package/dist/components/AnchorLink.js +17 -0
  29. package/dist/components/AnchorLink.mjs +2 -0
  30. package/dist/components/AreaChart.js +5 -5
  31. package/dist/components/AreaChart.mjs +3 -3
  32. package/dist/components/BackTop.d.mts +88 -0
  33. package/dist/components/BackTop.d.ts +88 -0
  34. package/dist/components/BackTop.js +16 -0
  35. package/dist/components/BackTop.mjs +1 -0
  36. package/dist/components/BarChart.js +5 -5
  37. package/dist/components/BarChart.mjs +3 -3
  38. package/dist/components/Breadcrumb.d.mts +17 -1
  39. package/dist/components/Breadcrumb.d.ts +17 -1
  40. package/dist/components/Breadcrumb.js +4 -4
  41. package/dist/components/Breadcrumb.mjs +1 -1
  42. package/dist/components/BreadcrumbItem.js +4 -4
  43. package/dist/components/BreadcrumbItem.mjs +2 -2
  44. package/dist/components/Carousel.d.mts +247 -0
  45. package/dist/components/Carousel.d.ts +247 -0
  46. package/dist/components/Carousel.js +16 -0
  47. package/dist/components/Carousel.mjs +1 -0
  48. package/dist/components/Collapse.d.mts +162 -0
  49. package/dist/components/Collapse.d.ts +162 -0
  50. package/dist/components/Collapse.js +20 -0
  51. package/dist/components/Collapse.mjs +1 -0
  52. package/dist/components/CollapsePanel.d.mts +112 -0
  53. package/dist/components/CollapsePanel.d.ts +112 -0
  54. package/dist/components/CollapsePanel.js +17 -0
  55. package/dist/components/CollapsePanel.mjs +2 -0
  56. package/dist/components/DonutChart.js +5 -5
  57. package/dist/components/DonutChart.mjs +3 -3
  58. package/dist/components/LineChart.js +5 -5
  59. package/dist/components/LineChart.mjs +3 -3
  60. package/dist/components/Pagination.d.mts +5 -5
  61. package/dist/components/Pagination.d.ts +5 -5
  62. package/dist/components/Pagination.js +3 -3
  63. package/dist/components/Pagination.mjs +1 -1
  64. package/dist/components/PieChart.js +4 -4
  65. package/dist/components/PieChart.mjs +2 -2
  66. package/dist/components/RadarChart.js +4 -4
  67. package/dist/components/RadarChart.mjs +2 -2
  68. package/dist/components/ScatterChart.js +5 -5
  69. package/dist/components/ScatterChart.mjs +3 -3
  70. package/dist/index.d.mts +6 -0
  71. package/dist/index.d.ts +6 -0
  72. package/dist/index.js +132 -102
  73. package/dist/index.mjs +34 -28
  74. package/package.json +6 -2
  75. package/dist/chunk-QPP7BQN2.mjs +0 -61
  76. package/dist/{chunk-RMXQXTKG.js → chunk-6UA4JIUL.js} +2 -2
  77. package/dist/{chunk-24F6NL3G.js → chunk-7SKG4K5I.js} +2 -2
  78. package/dist/{chunk-IXFEBW6I.mjs → chunk-EPL6WG4P.mjs} +2 -2
  79. package/dist/{chunk-MBJYTGF3.mjs → chunk-IB3SFSX2.mjs} +2 -2
  80. package/dist/{chunk-6AZFL3WJ.js → chunk-JAXJJRNI.js} +1 -1
  81. package/dist/{chunk-Y4QBDL7S.mjs → chunk-JZJZZOSP.mjs} +1 -1
  82. package/dist/{chunk-BPXVB37Q.js → chunk-KUEU4TIL.js} +2 -2
  83. package/dist/{chunk-ESRO3KM3.mjs → chunk-NPHSPEAO.mjs} +2 -2
  84. package/dist/{chunk-GLI2DEV3.js → chunk-PTHYHJLS.js} +2 -2
  85. package/dist/{chunk-DPWYCNNS.mjs → chunk-QT6OIMZB.mjs} +1 -1
  86. package/dist/{chunk-FNWCU7HI.mjs → chunk-SULLIMS2.mjs} +2 -2
  87. package/dist/{chunk-ZFDUZQML.js → chunk-TSRGNIHX.js} +1 -1
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @expcat/tigercat-vue
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@expcat/tigercat-vue.svg)](https://www.npmjs.com/package/@expcat/tigercat-vue)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ Vue 3 UI components for [Tigercat](https://github.com/expcats/Tigercat) - A Tailwind CSS based component library.
7
+
8
+ ## 📖 Documentation
9
+
10
+ **[Live Demo & Docs →](https://expcat.github.io/Tigercat/vue/)**
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ pnpm add @expcat/tigercat-vue
16
+ # or
17
+ npm install @expcat/tigercat-vue
18
+ ```
19
+
20
+ **Requirements:** Vue ≥3.3, Tailwind CSS ≥3.4
21
+
22
+ ## Quick Start
23
+
24
+ ```vue
25
+ <script setup>
26
+ import { ConfigProvider, Button } from '@expcat/tigercat-vue'
27
+ </script>
28
+
29
+ <template>
30
+ <ConfigProvider>
31
+ <Button variant="primary">Click me</Button>
32
+ </ConfigProvider>
33
+ </template>
34
+ ```
35
+
36
+ ## Components
37
+
38
+ | Category | Components |
39
+ | -------------- | ------------------------------------------------------------------------------------- |
40
+ | **Basic** | Alert, Avatar, Badge, Button, Code, Divider, Icon, Link, Tag, Text |
41
+ | **Form** | Input, Select, Checkbox, Radio, Switch, Slider, DatePicker, TimePicker, Upload, Form |
42
+ | **Layout** | Card, Container, Grid (Row/Col), Layout, List, Descriptions, Skeleton, Space |
43
+ | **Navigation** | Menu, Tabs, Breadcrumb, Pagination, Steps, Dropdown, Tree |
44
+ | **Feedback** | Modal, Drawer, Message, Notification, Loading, Popconfirm, Popover, Tooltip, Progress |
45
+ | **Data** | Table, Timeline |
46
+ | **Charts** | BarChart, LineChart, AreaChart, PieChart, DonutChart, RadarChart, ScatterChart |
47
+
48
+ ## License
49
+
50
+ [MIT](https://opensource.org/licenses/MIT)
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkZFDUZQML_js = require('./chunk-ZFDUZQML.js');
3
+ var chunkTSRGNIHX_js = require('./chunk-TSRGNIHX.js');
4
4
  var vue = require('vue');
5
5
  var tigercatCore = require('@expcat/tigercat-core');
6
6
 
@@ -142,7 +142,7 @@ var DonutChart = vue.defineComponent({
142
142
  const handleSliceHover = (datum, index) => {
143
143
  emit("slice-hover", datum, index);
144
144
  };
145
- return () => vue.h(chunkZFDUZQML_js.PieChart, {
145
+ return () => vue.h(chunkTSRGNIHX_js.PieChart, {
146
146
  width: props.width,
147
147
  height: props.height,
148
148
  padding: props.padding,
@@ -0,0 +1,380 @@
1
+ import { defineComponent, ref, computed, watch, onMounted, onUnmounted, Comment, h, Fragment } from 'vue';
2
+ import { classNames, getCarouselContainerClasses, coerceClassValue, carouselTrackFadeClasses, carouselTrackScrollClasses, getScrollTransform, getCarouselDotsClasses, isPrevDisabled, isNextDisabled, clampSlideIndex, getPrevSlideIndex, getNextSlideIndex, getCarouselArrowClasses, carouselPrevArrowPath, carouselNextArrowPath, getCarouselDotClasses, carouselSlideBaseClasses } from '@expcat/tigercat-core';
3
+
4
+ // src/components/Carousel.ts
5
+ var Carousel = defineComponent({
6
+ name: "TigerCarousel",
7
+ props: {
8
+ /**
9
+ * Whether to enable automatic slide switching
10
+ * @default false
11
+ */
12
+ autoplay: {
13
+ type: Boolean,
14
+ default: false
15
+ },
16
+ /**
17
+ * Time interval for auto-play in milliseconds
18
+ * @default 3000
19
+ */
20
+ autoplaySpeed: {
21
+ type: Number,
22
+ default: 3e3
23
+ },
24
+ /**
25
+ * Whether to show navigation dots
26
+ * @default true
27
+ */
28
+ dots: {
29
+ type: Boolean,
30
+ default: true
31
+ },
32
+ /**
33
+ * Position of navigation dots
34
+ * @default 'bottom'
35
+ */
36
+ dotPosition: {
37
+ type: String,
38
+ default: "bottom"
39
+ },
40
+ /**
41
+ * Transition effect type
42
+ * @default 'scroll'
43
+ */
44
+ effect: {
45
+ type: String,
46
+ default: "scroll"
47
+ },
48
+ /**
49
+ * Whether to show prev/next arrows
50
+ * @default false
51
+ */
52
+ arrows: {
53
+ type: Boolean,
54
+ default: false
55
+ },
56
+ /**
57
+ * Whether to enable infinite loop
58
+ * @default true
59
+ */
60
+ infinite: {
61
+ type: Boolean,
62
+ default: true
63
+ },
64
+ /**
65
+ * Transition animation duration in milliseconds
66
+ * @default 500
67
+ */
68
+ speed: {
69
+ type: Number,
70
+ default: 500
71
+ },
72
+ /**
73
+ * Initial slide index (0-based)
74
+ * @default 0
75
+ */
76
+ initialSlide: {
77
+ type: Number,
78
+ default: 0
79
+ },
80
+ /**
81
+ * Whether to pause autoplay on hover
82
+ * @default true
83
+ */
84
+ pauseOnHover: {
85
+ type: Boolean,
86
+ default: true
87
+ },
88
+ /**
89
+ * Whether to pause autoplay on focus
90
+ * @default true
91
+ */
92
+ pauseOnFocus: {
93
+ type: Boolean,
94
+ default: true
95
+ },
96
+ /**
97
+ * Additional CSS classes
98
+ */
99
+ className: {
100
+ type: String,
101
+ default: void 0
102
+ },
103
+ /**
104
+ * Custom styles
105
+ */
106
+ style: {
107
+ type: Object,
108
+ default: void 0
109
+ }
110
+ },
111
+ emits: ["change", "before-change"],
112
+ setup(props, { slots, emit, attrs, expose }) {
113
+ const currentIndex = ref(props.initialSlide);
114
+ const isPaused = ref(false);
115
+ const slideCount = ref(0);
116
+ let autoplayTimer = null;
117
+ const containerClasses = computed(() => {
118
+ return classNames(getCarouselContainerClasses(props.className), coerceClassValue(attrs.class));
119
+ });
120
+ const trackClasses = computed(() => {
121
+ if (props.effect === "fade") {
122
+ return carouselTrackFadeClasses;
123
+ }
124
+ return carouselTrackScrollClasses;
125
+ });
126
+ const trackStyle = computed(() => {
127
+ if (props.effect === "scroll") {
128
+ return {
129
+ transform: getScrollTransform(currentIndex.value),
130
+ transitionDuration: `${props.speed}ms`
131
+ };
132
+ }
133
+ return {};
134
+ });
135
+ const getSlideClasses = (index) => {
136
+ const isActive = index === currentIndex.value;
137
+ if (props.effect === "fade") {
138
+ const positionClass = index === 0 ? "relative" : "absolute inset-0";
139
+ return classNames(
140
+ positionClass,
141
+ "w-full transition-opacity ease-in-out",
142
+ isActive ? "opacity-100 z-10" : "opacity-0 z-0"
143
+ );
144
+ }
145
+ return carouselSlideBaseClasses;
146
+ };
147
+ const getSlideStyle = () => {
148
+ return {
149
+ transitionDuration: `${props.speed}ms`
150
+ };
151
+ };
152
+ const dotsClasses = computed(() => {
153
+ return getCarouselDotsClasses(props.dotPosition);
154
+ });
155
+ const next = () => {
156
+ const nextIdx = getNextSlideIndex(currentIndex.value, slideCount.value, props.infinite);
157
+ if (nextIdx !== currentIndex.value) {
158
+ goTo(nextIdx);
159
+ }
160
+ };
161
+ const prev = () => {
162
+ const prevIdx = getPrevSlideIndex(currentIndex.value, slideCount.value, props.infinite);
163
+ if (prevIdx !== currentIndex.value) {
164
+ goTo(prevIdx);
165
+ }
166
+ };
167
+ const goTo = (index) => {
168
+ const clampedIndex = clampSlideIndex(index, slideCount.value);
169
+ if (clampedIndex === currentIndex.value) {
170
+ return;
171
+ }
172
+ emit("before-change", currentIndex.value, clampedIndex);
173
+ const prevIndex = currentIndex.value;
174
+ currentIndex.value = clampedIndex;
175
+ emit("change", clampedIndex, prevIndex);
176
+ };
177
+ const startAutoplay = () => {
178
+ if (!props.autoplay || autoplayTimer) return;
179
+ autoplayTimer = setInterval(() => {
180
+ if (!isPaused.value) {
181
+ next();
182
+ }
183
+ }, props.autoplaySpeed);
184
+ };
185
+ const stopAutoplay = () => {
186
+ if (autoplayTimer) {
187
+ clearInterval(autoplayTimer);
188
+ autoplayTimer = null;
189
+ }
190
+ };
191
+ const handleMouseEnter = () => {
192
+ if (props.pauseOnHover && props.autoplay) {
193
+ isPaused.value = true;
194
+ }
195
+ };
196
+ const handleMouseLeave = () => {
197
+ if (props.pauseOnHover && props.autoplay) {
198
+ isPaused.value = false;
199
+ }
200
+ };
201
+ const handleFocus = () => {
202
+ if (props.pauseOnFocus && props.autoplay) {
203
+ isPaused.value = true;
204
+ }
205
+ };
206
+ const handleBlur = () => {
207
+ if (props.pauseOnFocus && props.autoplay) {
208
+ isPaused.value = false;
209
+ }
210
+ };
211
+ const isPrevArrowDisabled = computed(
212
+ () => isPrevDisabled(currentIndex.value, slideCount.value, props.infinite)
213
+ );
214
+ const isNextArrowDisabled = computed(
215
+ () => isNextDisabled(currentIndex.value, slideCount.value, props.infinite)
216
+ );
217
+ watch(
218
+ () => props.autoplay,
219
+ (newVal) => {
220
+ if (newVal) {
221
+ startAutoplay();
222
+ } else {
223
+ stopAutoplay();
224
+ }
225
+ }
226
+ );
227
+ onMounted(() => {
228
+ if (props.autoplay) {
229
+ startAutoplay();
230
+ }
231
+ });
232
+ onUnmounted(() => {
233
+ stopAutoplay();
234
+ });
235
+ expose({
236
+ next,
237
+ prev,
238
+ goTo
239
+ });
240
+ return () => {
241
+ const defaultSlot = slots.default?.() || [];
242
+ const flattenSlots = (nodes) => {
243
+ return nodes.flatMap((node) => {
244
+ if (node.type === Fragment && Array.isArray(node.children)) {
245
+ return flattenSlots(node.children);
246
+ }
247
+ return node;
248
+ });
249
+ };
250
+ const slides = flattenSlots(defaultSlot).filter((child) => child.type !== Comment);
251
+ slideCount.value = slides.length;
252
+ const renderArrows = () => {
253
+ if (!props.arrows) return null;
254
+ const prevArrow = h(
255
+ "button",
256
+ {
257
+ type: "button",
258
+ class: getCarouselArrowClasses("prev", isPrevArrowDisabled.value),
259
+ onClick: prev,
260
+ disabled: isPrevArrowDisabled.value,
261
+ "aria-label": "Previous slide"
262
+ },
263
+ h(
264
+ "svg",
265
+ {
266
+ xmlns: "http://www.w3.org/2000/svg",
267
+ viewBox: "0 0 24 24",
268
+ fill: "none",
269
+ stroke: "currentColor",
270
+ "stroke-width": "2",
271
+ "stroke-linecap": "round",
272
+ "stroke-linejoin": "round",
273
+ class: "w-6 h-6"
274
+ },
275
+ h("path", { d: carouselPrevArrowPath })
276
+ )
277
+ );
278
+ const nextArrow = h(
279
+ "button",
280
+ {
281
+ type: "button",
282
+ class: getCarouselArrowClasses("next", isNextArrowDisabled.value),
283
+ onClick: next,
284
+ disabled: isNextArrowDisabled.value,
285
+ "aria-label": "Next slide"
286
+ },
287
+ h(
288
+ "svg",
289
+ {
290
+ xmlns: "http://www.w3.org/2000/svg",
291
+ viewBox: "0 0 24 24",
292
+ fill: "none",
293
+ stroke: "currentColor",
294
+ "stroke-width": "2",
295
+ "stroke-linecap": "round",
296
+ "stroke-linejoin": "round",
297
+ class: "w-6 h-6"
298
+ },
299
+ h("path", { d: carouselNextArrowPath })
300
+ )
301
+ );
302
+ return [prevArrow, nextArrow];
303
+ };
304
+ const renderDots = () => {
305
+ if (!props.dots || slides.length <= 1) return null;
306
+ const dots = slides.map(
307
+ (_, index) => h("button", {
308
+ type: "button",
309
+ key: index,
310
+ class: getCarouselDotClasses(index === currentIndex.value),
311
+ onClick: () => goTo(index),
312
+ "aria-label": `Go to slide ${index + 1}`,
313
+ "aria-current": index === currentIndex.value ? "true" : "false"
314
+ })
315
+ );
316
+ return h(
317
+ "div",
318
+ {
319
+ class: dotsClasses.value,
320
+ role: "tablist",
321
+ "aria-label": "Carousel navigation"
322
+ },
323
+ dots
324
+ );
325
+ };
326
+ const renderSlides = () => {
327
+ const slideElements = slides.map(
328
+ (slide, index) => h(
329
+ "div",
330
+ {
331
+ key: index,
332
+ class: getSlideClasses(index),
333
+ style: props.effect === "fade" ? getSlideStyle() : void 0,
334
+ role: "group",
335
+ "aria-roledescription": "slide",
336
+ "aria-label": `Slide ${index + 1} of ${slides.length}`,
337
+ "aria-hidden": index !== currentIndex.value
338
+ },
339
+ slide
340
+ )
341
+ );
342
+ if (props.effect === "fade") {
343
+ return h(
344
+ "div",
345
+ {
346
+ class: classNames(trackClasses.value, "h-full")
347
+ },
348
+ slideElements
349
+ );
350
+ }
351
+ return h(
352
+ "div",
353
+ {
354
+ class: trackClasses.value,
355
+ style: trackStyle.value
356
+ },
357
+ slideElements
358
+ );
359
+ };
360
+ return h(
361
+ "div",
362
+ {
363
+ class: containerClasses.value,
364
+ style: props.style,
365
+ role: "region",
366
+ "aria-roledescription": "carousel",
367
+ "aria-label": "Image carousel",
368
+ onMouseenter: handleMouseEnter,
369
+ onMouseleave: handleMouseLeave,
370
+ onFocusin: handleFocus,
371
+ onFocusout: handleBlur
372
+ },
373
+ [renderSlides(), renderArrows(), renderDots()]
374
+ );
375
+ };
376
+ }
377
+ });
378
+ var Carousel_default = Carousel;
379
+
380
+ export { Carousel, Carousel_default };
@@ -0,0 +1,175 @@
1
+ 'use strict';
2
+
3
+ var chunkNTXRWISS_js = require('./chunk-NTXRWISS.js');
4
+ var vue = require('vue');
5
+ var tigercatCore = require('@expcat/tigercat-core');
6
+
7
+ var CollapsePanel = vue.defineComponent({
8
+ name: "TigerCollapsePanel",
9
+ props: {
10
+ /**
11
+ * Unique key for the panel (required)
12
+ */
13
+ panelKey: {
14
+ type: [String, Number],
15
+ required: true
16
+ },
17
+ /**
18
+ * Panel header/title
19
+ */
20
+ header: {
21
+ type: String,
22
+ default: void 0
23
+ },
24
+ /**
25
+ * Whether the panel is disabled
26
+ * @default false
27
+ */
28
+ disabled: {
29
+ type: Boolean,
30
+ default: false
31
+ },
32
+ /**
33
+ * Whether to show arrow icon
34
+ * @default true
35
+ */
36
+ showArrow: {
37
+ type: Boolean,
38
+ default: true
39
+ },
40
+ /**
41
+ * Additional CSS classes
42
+ */
43
+ className: {
44
+ type: String,
45
+ default: void 0
46
+ },
47
+ /**
48
+ * Custom styles
49
+ */
50
+ style: {
51
+ type: Object,
52
+ default: void 0
53
+ }
54
+ },
55
+ setup(props, { slots, attrs }) {
56
+ const collapseContext = vue.inject(chunkNTXRWISS_js.CollapseContextKey);
57
+ if (!collapseContext) {
58
+ throw new Error("CollapsePanel must be used within a Collapse component");
59
+ }
60
+ const isActive = vue.computed(() => {
61
+ return tigercatCore.isPanelActive(props.panelKey, collapseContext.activeKeys);
62
+ });
63
+ const panelClasses = vue.computed(() => {
64
+ return tigercatCore.classNames(
65
+ tigercatCore.getCollapsePanelClasses(collapseContext.ghost, props.className),
66
+ tigercatCore.coerceClassValue(attrs.class)
67
+ );
68
+ });
69
+ const headerClasses = vue.computed(() => {
70
+ return tigercatCore.getCollapsePanelHeaderClasses(isActive.value, props.disabled);
71
+ });
72
+ const iconClasses = vue.computed(() => {
73
+ return tigercatCore.getCollapseIconClasses(isActive.value, collapseContext.expandIconPosition);
74
+ });
75
+ const handleClick = () => {
76
+ if (!props.disabled) {
77
+ collapseContext.handlePanelClick(props.panelKey);
78
+ }
79
+ };
80
+ const handleKeydown = (event) => {
81
+ if (props.disabled) {
82
+ return;
83
+ }
84
+ if (event.key === "Enter" || event.key === " ") {
85
+ event.preventDefault();
86
+ collapseContext.handlePanelClick(props.panelKey);
87
+ }
88
+ };
89
+ return () => {
90
+ const headerSlot = slots.header?.();
91
+ const extraSlot = slots.extra?.();
92
+ const arrowIcon = vue.h(
93
+ "svg",
94
+ {
95
+ class: iconClasses.value,
96
+ width: "16",
97
+ height: "16",
98
+ viewBox: "0 0 16 16",
99
+ fill: "none",
100
+ xmlns: "http://www.w3.org/2000/svg"
101
+ },
102
+ vue.h("path", {
103
+ d: "M6 12L10 8L6 4",
104
+ stroke: "currentColor",
105
+ "stroke-width": "2",
106
+ "stroke-linecap": "round",
107
+ "stroke-linejoin": "round"
108
+ })
109
+ );
110
+ const headerContent = [];
111
+ if (props.showArrow && collapseContext.expandIconPosition === "start") {
112
+ headerContent.push(arrowIcon);
113
+ }
114
+ headerContent.push(
115
+ vue.h(
116
+ "span",
117
+ {
118
+ class: tigercatCore.collapseHeaderTextClasses
119
+ },
120
+ headerSlot || props.header
121
+ )
122
+ );
123
+ if (extraSlot) {
124
+ headerContent.push(vue.h("span", { class: "ml-auto" }, extraSlot));
125
+ }
126
+ if (props.showArrow && collapseContext.expandIconPosition === "end") {
127
+ headerContent.push(arrowIcon);
128
+ }
129
+ const header = vue.h(
130
+ "div",
131
+ {
132
+ class: headerClasses.value,
133
+ role: "button",
134
+ tabindex: props.disabled ? -1 : 0,
135
+ "aria-expanded": isActive.value,
136
+ "aria-disabled": props.disabled,
137
+ onClick: handleClick,
138
+ onKeydown: handleKeydown
139
+ },
140
+ headerContent
141
+ );
142
+ const content = vue.h(
143
+ "div",
144
+ {
145
+ class: tigercatCore.collapsePanelContentWrapperClasses,
146
+ style: {
147
+ maxHeight: isActive.value ? "none" : "0",
148
+ opacity: isActive.value ? "1" : "0"
149
+ }
150
+ },
151
+ [
152
+ vue.h(
153
+ "div",
154
+ {
155
+ class: tigercatCore.collapsePanelContentBaseClasses
156
+ },
157
+ slots.default?.()
158
+ )
159
+ ]
160
+ );
161
+ return vue.h(
162
+ "div",
163
+ {
164
+ class: panelClasses.value,
165
+ style: props.style
166
+ },
167
+ [header, content]
168
+ );
169
+ };
170
+ }
171
+ });
172
+ var CollapsePanel_default = CollapsePanel;
173
+
174
+ exports.CollapsePanel = CollapsePanel;
175
+ exports.CollapsePanel_default = CollapsePanel_default;