tide-design-system 2.1.0 → 2.1.2
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/.storybook/preview.ts +0 -1
- package/dist/IconAttachMoney-1360c507.js +16 -0
- package/dist/IconAttachMoney-6d3087ab.cjs +2 -0
- package/dist/IconHandshake-33b452a7.cjs +2 -0
- package/dist/IconHandshake-7c9f1e84.js +16 -0
- package/dist/IconThumbUp-722d3c77.cjs +2 -0
- package/dist/IconThumbUp-72caf64e.js +16 -0
- package/dist/IconTrendingDown-3da4b7d4.cjs +2 -0
- package/dist/IconTrendingDown-ff3969c7.js +16 -0
- package/dist/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +24 -4
- package/dist/tide-design-system.esm.js +472 -439
- package/package.json +1 -1
- package/src/assets/svg/icons/IconAttachMoney.svg +4 -0
- package/src/assets/svg/icons/IconHandshake.svg +3 -0
- package/src/assets/svg/icons/IconThumbUp.svg +3 -0
- package/src/assets/svg/icons/IconTrendingDown.svg +5 -0
- package/src/components/TideCarousel.vue +122 -83
- package/src/components/TideImage.vue +1 -1
- package/src/stories/TideCarousel.stories.ts +55 -27
- package/src/types/Icon.ts +4 -0
package/package.json
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
+
<path
|
|
3
|
+
d="M10.7 21.5v-2.15a5.09 5.09 0 0 1-2.287-1.15C7.77 17.633 7.3 16.833 7 15.8l1.85-.75c.25.8.62 1.408 1.113 1.825.491.417 1.137.625 1.937.625.683 0 1.262-.154 1.737-.462.476-.309.713-.788.713-1.438 0-.583-.183-1.046-.55-1.387-.367-.342-1.217-.73-2.55-1.163-1.433-.45-2.417-.988-2.95-1.613-.533-.624-.8-1.387-.8-2.287 0-1.083.35-1.925 1.05-2.525.7-.6 1.417-.942 2.15-1.025V3.5h2v2.1c.833.133 1.52.438 2.063.913A4.187 4.187 0 0 1 15.95 8.25l-1.85.8c-.2-.533-.483-.933-.85-1.2-.367-.267-.867-.4-1.5-.4-.733 0-1.292.162-1.675.487-.383.325-.575.73-.575 1.213 0 .55.25.983.75 1.3.5.317 1.367.65 2.6 1 1.15.333 2.02.863 2.613 1.588.591.724.887 1.562.887 2.512 0 1.183-.35 2.083-1.05 2.7-.7.617-1.567 1-2.6 1.15v2.1h-2Z"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
+
<path d="M11.88 20.5a.58.58 0 0 0 .34-.15l8.2-8.2c.2-.2.35-.42.44-.67a2.17 2.17 0 0 0 0-1.52 1.65 1.65 0 0 0-.44-.63l-4.25-4.25a1.65 1.65 0 0 0-.63-.44 2.13 2.13 0 0 0-1.52 0c-.25.09-.47.24-.67.44l-.28.27 1.85 1.88c.25.23.44.5.55.8a2.6 2.6 0 0 1-.53 2.7 2.4 2.4 0 0 1-1.77.72 2.7 2.7 0 0 1-.96-.17 2.28 2.28 0 0 1-.81-.53L9.52 8.9l-4.37 4.38a.47.47 0 0 0-.15.35c0 .13.05.25.15.36a.44.44 0 0 0 .55.11.58.58 0 0 0 .15-.1l3.4-3.4 1.4 1.4-3.38 3.4a.47.47 0 0 0-.14.35c0 .13.05.25.15.35.1.1.21.15.35.15a.58.58 0 0 0 .35-.15l3.4-3.38 1.4 1.4-3.38 3.4a.3.3 0 0 0-.11.16.57.57 0 0 0-.04.2c0 .13.05.25.15.35a.48.48 0 0 0 .7 0l3.4-3.38 1.4 1.4-3.4 3.4a.47.47 0 0 0 .01.7c.11.1.23.15.37.15Zm-.03 2a2.44 2.44 0 0 1-1.64-.61 2.39 2.39 0 0 1-.84-1.54 2.46 2.46 0 0 1-1.42-.7 2.46 2.46 0 0 1-.7-1.42 2.37 2.37 0 0 1-1.41-.72 2.54 2.54 0 0 1-.69-1.41 2.38 2.38 0 0 1-1.55-.82 2.54 2.54 0 0 1 .13-3.42l5.8-5.78 3.27 3.27a.3.3 0 0 0 .15.11.57.57 0 0 0 .2.04c.15 0 .28-.05.38-.14.1-.09.15-.21.15-.36a.57.57 0 0 0-.04-.2.3.3 0 0 0-.12-.15L9.96 5.07a1.65 1.65 0 0 0-.64-.43 2.13 2.13 0 0 0-1.51 0c-.25.09-.48.24-.68.44L3.6 8.62a2.1 2.1 0 0 0-.58 1.13 1.89 1.89 0 0 0 .2 1.2L1.78 12.4a3.98 3.98 0 0 1-.62-1.26 3.93 3.93 0 0 1 .2-2.75c.2-.44.47-.84.82-1.19L5.7 3.67a4.22 4.22 0 0 1 1.34-.87 3.98 3.98 0 0 1 3.02 0c.5.2.93.5 1.31.88l.28.27.28-.28a4.22 4.22 0 0 1 1.33-.87 3.98 3.98 0 0 1 3.03 0c.49.2.93.5 1.31.88l4.22 4.22A4.07 4.07 0 0 1 23 10.75a3.98 3.98 0 0 1-1.18 2.83l-8.2 8.17a2.6 2.6 0 0 1-.8.55c-.32.13-.64.2-.97.2Z"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
+
<path d="M18 20.5H7v-13l7-7 1.25 1.25a1.64 1.64 0 0 1 .4 1.05v.35l-1.1 4.35H21c.53 0 1 .2 1.4.6.4.4.6.87.6 1.4v2c0 .12-.02.24-.05.38l-.1.37-3 7.05c-.15.33-.4.62-.75.85-.35.23-.72.35-1.1.35Zm-9-2h9l3-7v-2h-9L13.35 4 9 8.35V18.5Zm-2-11v2H4v9h3v2H2v-13h5Z"/>
|
|
3
|
+
</svg>
|
|
@@ -7,27 +7,34 @@
|
|
|
7
7
|
import { CSS } from '@/types/Styles';
|
|
8
8
|
|
|
9
9
|
type Props = {
|
|
10
|
+
isFloating?: boolean;
|
|
11
|
+
isHideawayButtons?: boolean;
|
|
10
12
|
isTouchscreen?: boolean;
|
|
11
|
-
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
title?: string;
|
|
12
15
|
};
|
|
13
16
|
|
|
14
17
|
const props = withDefaults(defineProps<Props>(), {
|
|
15
|
-
|
|
18
|
+
isFloating: false,
|
|
19
|
+
isHideawayButtons: true,
|
|
20
|
+
isTouchscreen: undefined,
|
|
21
|
+
subtitle: undefined,
|
|
22
|
+
title: undefined,
|
|
16
23
|
});
|
|
17
24
|
|
|
18
25
|
const emit = defineEmits(['change']);
|
|
19
26
|
|
|
20
|
-
let contentWidth = ref();
|
|
21
|
-
let frameWidth = ref();
|
|
22
|
-
let hasOverflow = ref();
|
|
23
|
-
let lastPosition = ref();
|
|
24
|
-
|
|
25
27
|
const contentRef = ref();
|
|
26
28
|
const frameRef = ref();
|
|
27
|
-
const showButtons = ref();
|
|
28
|
-
const currentSlide = ref(0);
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const contentRightEdge = ref();
|
|
31
|
+
const contentWidth = ref();
|
|
32
|
+
const currentSlide = ref(0);
|
|
33
|
+
const frameWidth = ref();
|
|
34
|
+
const hasOverflow = ref();
|
|
35
|
+
const isLastSlide = ref();
|
|
36
|
+
const lastPosition = ref();
|
|
37
|
+
const showButtons = ref();
|
|
31
38
|
|
|
32
39
|
/**
|
|
33
40
|
* Measure the current slide based on the scroll
|
|
@@ -36,24 +43,25 @@
|
|
|
36
43
|
* the frame.
|
|
37
44
|
*/
|
|
38
45
|
const measureCurrentSlide = () => {
|
|
39
|
-
//
|
|
46
|
+
// Get left offset of each slide.
|
|
40
47
|
const slideOffsets = Array.from(contentRef.value.children).map((slide: any) => slide.offsetLeft);
|
|
41
48
|
|
|
42
49
|
if (slideOffsets.length === 0) return;
|
|
43
50
|
|
|
44
|
-
//
|
|
51
|
+
// Get closest offset to current scroll position.
|
|
45
52
|
const closestSlideOffset = slideOffsets.reduce((prev, curr) => {
|
|
46
53
|
return Math.abs(curr - frameRef.value.scrollLeft) < Math.abs(prev - frameRef.value.scrollLeft) ? curr : prev;
|
|
47
54
|
});
|
|
48
55
|
|
|
49
|
-
// set current slide to index of closest slide
|
|
50
56
|
currentSlide.value = slideOffsets.indexOf(closestSlideOffset);
|
|
51
57
|
};
|
|
52
58
|
|
|
53
59
|
const measureDom = () => {
|
|
60
|
+
contentRightEdge.value = frameRef.value.scrollLeft + frameRef.value.clientWidth;
|
|
54
61
|
contentWidth.value = contentRef.value.scrollWidth;
|
|
55
62
|
frameWidth.value = frameRef.value.clientWidth;
|
|
56
63
|
hasOverflow.value = contentWidth.value > frameWidth.value;
|
|
64
|
+
isLastSlide.value = contentRightEdge.value === contentWidth.value;
|
|
57
65
|
lastPosition.value = frameRef.value.scrollWidth - frameRef.value.clientWidth;
|
|
58
66
|
showButtons.value = hasOverflow.value && !props.isTouchscreen;
|
|
59
67
|
|
|
@@ -65,12 +73,6 @@
|
|
|
65
73
|
measureDom();
|
|
66
74
|
};
|
|
67
75
|
|
|
68
|
-
/**
|
|
69
|
-
* Scrolls to the slide at the given index, or
|
|
70
|
-
* to the first or last slide if the given index
|
|
71
|
-
* is out of bounds.
|
|
72
|
-
* @param slideIndex The index of the slide to scroll to
|
|
73
|
-
*/
|
|
74
76
|
const scrollToSlide = (slideIndex: number) => {
|
|
75
77
|
frameRef.value.scrollTo({
|
|
76
78
|
behavior: 'smooth',
|
|
@@ -79,34 +81,22 @@
|
|
|
79
81
|
};
|
|
80
82
|
|
|
81
83
|
const showNextSlide = () => {
|
|
82
|
-
|
|
83
|
-
const contentRightEdge = frameRef.value.scrollLeft + frameRef.value.clientWidth;
|
|
84
|
-
|
|
85
|
-
if (contentRightEdge > contentWidth) {
|
|
84
|
+
if (contentRightEdge.value > contentWidth.value) {
|
|
86
85
|
frameRef.value.scrollTo({
|
|
87
86
|
behavior: 'smooth',
|
|
88
87
|
left: contentWidth,
|
|
89
88
|
});
|
|
90
|
-
} else {
|
|
91
|
-
|
|
92
|
-
const isLastSlide = contentRightEdge === contentWidth;
|
|
93
|
-
const nextSlide = isLastSlide ? 0 : isFirstSlideWithOffset ? 2 : currentSlide.value + 1;
|
|
94
|
-
|
|
95
|
-
scrollToSlide(nextSlide);
|
|
89
|
+
} else if (!isLastSlide.value) {
|
|
90
|
+
scrollToSlide(currentSlide.value + 1);
|
|
96
91
|
}
|
|
97
92
|
};
|
|
98
93
|
|
|
99
94
|
const showPreviousSlide = () => {
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
: isFirstSlide
|
|
106
|
-
? 0
|
|
107
|
-
: currentSlide.value - 1;
|
|
108
|
-
|
|
109
|
-
scrollToSlide(previousSlide);
|
|
95
|
+
const isFirstSlide = currentSlide.value === 0;
|
|
96
|
+
|
|
97
|
+
if (!isFirstSlide) {
|
|
98
|
+
scrollToSlide(currentSlide.value - 1);
|
|
99
|
+
}
|
|
110
100
|
};
|
|
111
101
|
|
|
112
102
|
onMounted(() => {
|
|
@@ -129,59 +119,108 @@
|
|
|
129
119
|
|
|
130
120
|
<template>
|
|
131
121
|
<section
|
|
132
|
-
:class="['tide-carousel', CSS.
|
|
122
|
+
:class="['tide-carousel', CSS.DISPLAY.FLEX, CSS.FLEX.DIRECTION.COLUMN, CSS.GAP.TWO, CSS.WIDTH.MAX_FULL]"
|
|
133
123
|
ref="carouselRef"
|
|
134
124
|
>
|
|
135
|
-
<
|
|
136
|
-
:class="[CSS.
|
|
137
|
-
|
|
138
|
-
@scroll="handleScroll"
|
|
125
|
+
<section
|
|
126
|
+
:class="[CSS.DISPLAY.FLEX, props.title ? CSS.AXIS1.BETWEEN : CSS.AXIS1.END, CSS.AXIS2.CENTER, CSS.WIDTH.FULL]"
|
|
127
|
+
v-if="!props.isFloating && (showButtons || props.title)"
|
|
139
128
|
>
|
|
140
|
-
<
|
|
141
|
-
:class="[
|
|
142
|
-
|
|
129
|
+
<div
|
|
130
|
+
:class="[CSS.DISPLAY.FLEX, CSS.AXIS2.CENTER, CSS.GAP.ONE]"
|
|
131
|
+
v-if="props.title || props.subtitle"
|
|
143
132
|
>
|
|
144
|
-
<
|
|
145
|
-
:class="[CSS.
|
|
146
|
-
|
|
147
|
-
|
|
133
|
+
<div
|
|
134
|
+
:class="[CSS.FONT.ROLE.DISPLAY_1]"
|
|
135
|
+
v-if="props.title"
|
|
136
|
+
>
|
|
137
|
+
{{ props.title }}
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div
|
|
141
|
+
:class="[CSS.FONT.ROLE.LABEL_2, CSS.FONT.COLOR.SURFACE.VARIANT]"
|
|
142
|
+
v-if="props.subtitle"
|
|
143
|
+
>
|
|
144
|
+
{{ props.subtitle }}
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div
|
|
149
|
+
:class="[CSS.DISPLAY.FLEX, CSS.AXIS2.CENTER, CSS.GAP.ONE]"
|
|
150
|
+
v-if="showButtons"
|
|
151
|
+
>
|
|
152
|
+
<TideButtonIcon
|
|
153
|
+
:disabled="currentSlide === 0"
|
|
154
|
+
:icon="ICON.CHEVRON_LEFT"
|
|
155
|
+
:priority="PRIORITY.TERTIARY"
|
|
156
|
+
@click="showPreviousSlide"
|
|
157
|
+
/>
|
|
158
|
+
|
|
159
|
+
<TideButtonIcon
|
|
160
|
+
:disabled="isLastSlide"
|
|
161
|
+
:icon="ICON.CHEVRON_RIGHT"
|
|
162
|
+
:priority="PRIORITY.TERTIARY"
|
|
163
|
+
@click="showNextSlide"
|
|
148
164
|
/>
|
|
165
|
+
</div>
|
|
166
|
+
</section>
|
|
149
167
|
|
|
150
|
-
|
|
168
|
+
<slot name="misc" />
|
|
151
169
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
170
|
+
<div :class="[CSS.POSITION.RELATIVE]">
|
|
171
|
+
<div
|
|
172
|
+
:class="[CSS.SCROLLBAR.OFF, CSS.SNAP.ON, CSS.OVERFLOW.X.SCROLL, CSS.WIDTH.FULL]"
|
|
173
|
+
ref="frameRef"
|
|
174
|
+
@scroll="handleScroll"
|
|
175
|
+
>
|
|
176
|
+
<ul
|
|
177
|
+
:class="[CSS.DISPLAY.FLEX, CSS.GAP.ONE, CSS.LIST_BULLETS.OFF]"
|
|
178
|
+
ref="contentRef"
|
|
179
|
+
>
|
|
180
|
+
<slot />
|
|
181
|
+
</ul>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<div
|
|
185
|
+
:class="[
|
|
186
|
+
'tide-carousel-button-overlay',
|
|
187
|
+
CSS.POSITION.ABSOLUTE,
|
|
188
|
+
CSS.DISPLAY.FLEX,
|
|
189
|
+
CSS.AXIS1.BETWEEN,
|
|
190
|
+
CSS.AXIS2.CENTER,
|
|
191
|
+
CSS.WIDTH.FULL,
|
|
192
|
+
CSS.HEIGHT.FULL,
|
|
193
|
+
CSS.POINTER_EVENTS.OFF,
|
|
194
|
+
props.isHideawayButtons ? 'hideaway' : '',
|
|
195
|
+
]"
|
|
196
|
+
v-if="isFloating && showButtons"
|
|
197
|
+
>
|
|
198
|
+
<TideButtonIcon
|
|
199
|
+
:class="[CSS.MARGIN.LEFT.ONE, CSS.POINTER_EVENTS.ON]"
|
|
200
|
+
:disabled="currentSlide === 0"
|
|
201
|
+
:icon="ICON.CHEVRON_LEFT"
|
|
202
|
+
:priority="PRIORITY.QUATERNARY"
|
|
203
|
+
@click="showPreviousSlide"
|
|
156
204
|
/>
|
|
157
|
-
</ul>
|
|
158
|
-
</div>
|
|
159
205
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
CSS.POINTER_EVENTS.OFF,
|
|
169
|
-
]"
|
|
170
|
-
v-if="showButtons"
|
|
171
|
-
>
|
|
172
|
-
<TideButtonIcon
|
|
173
|
-
:class="[CSS.MARGIN.LEFT.ONE, CSS.POINTER_EVENTS.ON]"
|
|
174
|
-
:icon="ICON.CHEVRON_LEFT"
|
|
175
|
-
:priority="PRIORITY.QUATERNARY"
|
|
176
|
-
@click="showPreviousSlide"
|
|
177
|
-
/>
|
|
178
|
-
|
|
179
|
-
<TideButtonIcon
|
|
180
|
-
:class="[CSS.MARGIN.RIGHT.ONE, CSS.POINTER_EVENTS.ON]"
|
|
181
|
-
:icon="ICON.CHEVRON_RIGHT"
|
|
182
|
-
:priority="PRIORITY.QUATERNARY"
|
|
183
|
-
@click="showNextSlide"
|
|
184
|
-
/>
|
|
206
|
+
<TideButtonIcon
|
|
207
|
+
:class="[CSS.MARGIN.RIGHT.ONE, CSS.POINTER_EVENTS.ON]"
|
|
208
|
+
:disabled="isLastSlide"
|
|
209
|
+
:icon="ICON.CHEVRON_RIGHT"
|
|
210
|
+
:priority="PRIORITY.QUATERNARY"
|
|
211
|
+
@click="showNextSlide"
|
|
212
|
+
/>
|
|
213
|
+
</div>
|
|
185
214
|
</div>
|
|
186
215
|
</section>
|
|
187
216
|
</template>
|
|
217
|
+
|
|
218
|
+
<style scoped>
|
|
219
|
+
.tide-carousel-button-overlay.hideaway {
|
|
220
|
+
opacity: 0;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.tide-carousel:hover .tide-carousel-button-overlay.hideaway {
|
|
224
|
+
opacity: 1;
|
|
225
|
+
}
|
|
226
|
+
</style>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
<img
|
|
63
63
|
:alt="alt"
|
|
64
|
-
:class="[CSS.WIDTH.FULL, CSS.OBJECT.CENTER, CSS.OBJECT.COVER]"
|
|
64
|
+
:class="[CSS.WIDTH.FULL, CSS.HEIGHT.FULL, CSS.OBJECT.CENTER, CSS.OBJECT.COVER]"
|
|
65
65
|
:fetchpriority="isLazy ? undefined : 'high'"
|
|
66
66
|
:loading="props.isLazy ? 'lazy' : 'eager'"
|
|
67
67
|
ref="tideImage"
|
|
@@ -11,17 +11,19 @@ const formatSnippet = (code: string, context: StoryContext) => {
|
|
|
11
11
|
|
|
12
12
|
const argsWithValues: string[] = [];
|
|
13
13
|
|
|
14
|
+
if (args.isHideawayButtons !== undefined) argsWithValues.push(`:is-hideaway-buttons="${args.isHideawayButtons}"`);
|
|
14
15
|
if (args.isTouchscreen !== undefined) argsWithValues.push(`:is-touchscreen="${args.isTouchscreen}"`);
|
|
15
|
-
if (args.
|
|
16
|
-
if (args.
|
|
16
|
+
if (args.subtitle !== undefined) argsWithValues.push(`subtitle="${args.subtitle}"`);
|
|
17
|
+
if (args.title !== undefined) argsWithValues.push(`title="${args.title}"`);
|
|
18
|
+
if (args.handleChange) argsWithValues.push(`@change="${args.handleChange}"`);
|
|
19
|
+
|
|
20
|
+
const slotContentMsic = args.misc === '' ? '' : `${tab}<template #misc>${args.misc}</template>${lineBreak}`;
|
|
17
21
|
|
|
18
22
|
return (
|
|
19
23
|
`<TideCarousel ${argsWithValues.join(' ')}>${lineBreak}` +
|
|
20
|
-
`${
|
|
21
|
-
`${tab}
|
|
22
|
-
`${tab}${tab}
|
|
23
|
-
`${tab}>${lineBreak}` +
|
|
24
|
-
`${tab}${tab}<TideCard class="tide-padding-1">Card {{ index + 1 }}</TideCard>${lineBreak}` +
|
|
24
|
+
`${slotContentMsic}` +
|
|
25
|
+
`${tab}<li v-for="(_child, index) in new Array(12)">${lineBreak}` +
|
|
26
|
+
`${tab}${tab}<div class="tide-shrink-none">${args.default}</div>${lineBreak}` +
|
|
25
27
|
`${tab}</li>${lineBreak}` +
|
|
26
28
|
`</TideCarousel>`
|
|
27
29
|
);
|
|
@@ -41,7 +43,7 @@ const render = (args: any) => ({
|
|
|
41
43
|
components: { TideCard, TideCarousel },
|
|
42
44
|
methods: {
|
|
43
45
|
doSomething,
|
|
44
|
-
handleChange: (
|
|
46
|
+
handleChange: (index: number) => {
|
|
45
47
|
action(`Current slide ${index}`)(index);
|
|
46
48
|
|
|
47
49
|
try {
|
|
@@ -56,13 +58,20 @@ const render = (args: any) => ({
|
|
|
56
58
|
},
|
|
57
59
|
},
|
|
58
60
|
setup: () => ({ args }),
|
|
59
|
-
template: `<TideCarousel @change="handleChange" v-bind="args"><li
|
|
61
|
+
template: `<TideCarousel @change="handleChange" v-bind="args"><template #misc>${args.misc}</template><li class="tide-shrink-none tide-border-1 tide-border tide-padding-1" v-for="(_child, index) in new Array(12)">{{ args.default }}</li></TideCarousel>`,
|
|
60
62
|
});
|
|
61
63
|
|
|
62
64
|
export default {
|
|
63
65
|
argTypes: {
|
|
64
66
|
change: disabledArgType,
|
|
65
|
-
default:
|
|
67
|
+
default: {
|
|
68
|
+
control: 'text',
|
|
69
|
+
description: 'Dynamic card content',
|
|
70
|
+
table: {
|
|
71
|
+
defaultValue: { summary: 'None' },
|
|
72
|
+
type: { summary: 'HTML' },
|
|
73
|
+
},
|
|
74
|
+
},
|
|
66
75
|
handleChange: {
|
|
67
76
|
...change,
|
|
68
77
|
table: {
|
|
@@ -70,42 +79,61 @@ export default {
|
|
|
70
79
|
type: { summary: '(currentSlide: number) => void' },
|
|
71
80
|
},
|
|
72
81
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
description: 'Demonstrates the box shadow',
|
|
77
|
-
name: 'Has Padding',
|
|
82
|
+
isFloating: {
|
|
83
|
+
...argTypeBooleanUnrequired,
|
|
84
|
+
description: 'Determines whether to display on-page or floating carousel',
|
|
78
85
|
table: {
|
|
79
86
|
defaultValue: { summary: 'False' },
|
|
80
|
-
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
isHideawayButtons: {
|
|
90
|
+
...argTypeBooleanUnrequired,
|
|
91
|
+
description: 'Determines whether on-page buttons should be hidden until hover',
|
|
92
|
+
table: {
|
|
93
|
+
defaultValue: { summary: 'True' },
|
|
81
94
|
},
|
|
82
95
|
},
|
|
83
96
|
isTouchscreen: {
|
|
84
97
|
...argTypeBooleanUnrequired,
|
|
85
|
-
description: 'Determines button and/or swipe control scheme
|
|
98
|
+
description: 'Determines button and/or swipe control scheme',
|
|
99
|
+
table: {
|
|
100
|
+
defaultValue: { summary: 'None' },
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
misc: {
|
|
104
|
+
control: 'text',
|
|
105
|
+
description: 'Content to display between the title/buttons and carousel content',
|
|
86
106
|
table: {
|
|
87
107
|
defaultValue: { summary: 'None' },
|
|
108
|
+
type: { summary: 'HTML' },
|
|
88
109
|
},
|
|
89
110
|
},
|
|
90
|
-
|
|
91
|
-
control:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
111
|
+
subtitle: {
|
|
112
|
+
control: 'text',
|
|
113
|
+
description: 'Determines the text displayed to the right of the title',
|
|
114
|
+
if: { arg: 'isFloating', neq: true },
|
|
115
|
+
table: {
|
|
116
|
+
defaultValue: { summary: 'None' },
|
|
96
117
|
},
|
|
97
|
-
|
|
118
|
+
},
|
|
119
|
+
title: {
|
|
120
|
+
control: 'text',
|
|
121
|
+
description: 'Determines the title text displayed above the carousel',
|
|
122
|
+
if: { arg: 'isFloating', neq: true },
|
|
98
123
|
table: {
|
|
99
124
|
defaultValue: { summary: 'None' },
|
|
100
|
-
type: { summary: 'number (px)' },
|
|
101
125
|
},
|
|
102
126
|
},
|
|
103
127
|
},
|
|
104
128
|
args: {
|
|
129
|
+
default: 'Card',
|
|
105
130
|
handleChange: 'doSomething',
|
|
106
|
-
|
|
131
|
+
isFloating: undefined,
|
|
132
|
+
isHideawayButtons: undefined,
|
|
107
133
|
isTouchscreen: undefined,
|
|
108
|
-
|
|
134
|
+
misc: '',
|
|
135
|
+
subtitle: '',
|
|
136
|
+
title: 'Demo',
|
|
109
137
|
},
|
|
110
138
|
component: TideCarousel,
|
|
111
139
|
parameters,
|
package/src/types/Icon.ts
CHANGED
|
@@ -11,6 +11,7 @@ export const ICON = {
|
|
|
11
11
|
ARROW_FORWARD: 'arrow-forward',
|
|
12
12
|
ARROW_RIGHT: 'arrow-right',
|
|
13
13
|
ASSIGNMENT: 'assignment',
|
|
14
|
+
ATTACH_MONEY: 'attach-money',
|
|
14
15
|
AWARD_STAR: 'award-star',
|
|
15
16
|
BED: 'bed',
|
|
16
17
|
BOOKMARK: 'bookmark',
|
|
@@ -43,6 +44,7 @@ export const ICON = {
|
|
|
43
44
|
GOOGLE: 'google',
|
|
44
45
|
GOOGLE_PAY: 'google-pay',
|
|
45
46
|
GRID: 'grid',
|
|
47
|
+
HANDSHAKE: 'handshake',
|
|
46
48
|
HEIGHT: 'height',
|
|
47
49
|
HELP: 'help',
|
|
48
50
|
INFO: 'info',
|
|
@@ -81,6 +83,8 @@ export const ICON = {
|
|
|
81
83
|
STAR: 'star',
|
|
82
84
|
SWAP_VERT: 'swap-vert',
|
|
83
85
|
THREE_D_ROTATION: 'three-d-rotation',
|
|
86
|
+
THUMB_UP: 'thumb-up',
|
|
87
|
+
TRENDING_DOWN: 'trending-down',
|
|
84
88
|
TROPHY: 'trophy',
|
|
85
89
|
TUNE: 'tune',
|
|
86
90
|
TWITTER: 'twitter',
|