@designcrowd/fe-shared-lib 1.5.1 → 1.5.3-CarouselUpdatev0

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.
@@ -0,0 +1,263 @@
1
+ import PromoCard from './PromoCard.vue';
2
+
3
+ export default {
4
+ title: 'Components/PromoCard',
5
+ component: PromoCard,
6
+ };
7
+
8
+ export const Standard = {
9
+ render: (args) => {
10
+ return {
11
+ components: {
12
+ PromoCard,
13
+ },
14
+ setup() {
15
+ return { args };
16
+ },
17
+ template: `
18
+ <PromoCard
19
+ v-bind="args"
20
+ @button-clicked="handleButtonClick"
21
+ />
22
+ `,
23
+ methods: {
24
+ handleButtonClick() {
25
+ console.log('Button clicked!');
26
+ },
27
+ },
28
+ };
29
+ },
30
+ args: {
31
+ title: 'Special Offer',
32
+ description: 'Get 20% off your next purchase. Limited time offer!',
33
+ imageUrl: 'https://bcassetcdn.com/assets/images/promo/legalzoom-symbol.svg',
34
+ altText: 'Promotional image',
35
+ buttonLabel: 'Learn More',
36
+ horizontalLayout: false,
37
+ shouldShowImageOnTop: false,
38
+ },
39
+ };
40
+
41
+ export const HorizontalLayout = {
42
+ render: (args) => {
43
+ return {
44
+ components: {
45
+ PromoCard,
46
+ },
47
+ setup() {
48
+ return { args };
49
+ },
50
+ template: `
51
+ <PromoCard
52
+ v-bind="args"
53
+ @button-clicked="handleButtonClick"
54
+ />
55
+ `,
56
+ methods: {
57
+ handleButtonClick() {
58
+ console.log('Button clicked!');
59
+ },
60
+ },
61
+ };
62
+ },
63
+ args: {
64
+ title: 'Premium Package',
65
+ description: 'Upgrade to premium and unlock exclusive features today.',
66
+ imageUrl: 'https://bcassetcdn.com/assets/images/promo/brandpage-design-support.png',
67
+ altText: 'Premium package image',
68
+ buttonLabel: 'Upgrade Now',
69
+ horizontalLayout: true,
70
+ scaleImageDown: false,
71
+ imageWidthFull: false,
72
+ shouldShowImageOnTop: false,
73
+ },
74
+ };
75
+
76
+ export const ImageOnTop = {
77
+ render: (args) => {
78
+ return {
79
+ components: {
80
+ PromoCard,
81
+ },
82
+ setup() {
83
+ return { args };
84
+ },
85
+ template: `
86
+ <PromoCard
87
+ v-bind="args"
88
+ @button-clicked="handleButtonClick"
89
+ />
90
+ `,
91
+ methods: {
92
+ handleButtonClick() {
93
+ console.log('Button clicked!');
94
+ },
95
+ },
96
+ };
97
+ },
98
+ args: {
99
+ title: 'Mobile Friendly',
100
+ description: 'This layout works great on mobile devices with the image displayed on top.',
101
+ imageUrl: 'https://bcassetcdn.com/assets/images/promo/brandpage-design-support.png',
102
+ altText: 'Mobile friendly layout',
103
+ buttonLabel: 'Try It',
104
+ horizontalLayout: false,
105
+ scaleImageDown: false,
106
+ imageWidthFull: false,
107
+ shouldShowImageOnTop: true,
108
+ },
109
+ };
110
+
111
+ export const ScaledDownImage = {
112
+ render: (args) => {
113
+ return {
114
+ components: {
115
+ PromoCard,
116
+ },
117
+ setup() {
118
+ return { args };
119
+ },
120
+ template: `
121
+ <PromoCard
122
+ v-bind="args"
123
+ @button-clicked="handleButtonClick"
124
+ />
125
+ `,
126
+ methods: {
127
+ handleButtonClick() {
128
+ console.log('Button clicked!');
129
+ },
130
+ },
131
+ };
132
+ },
133
+ args: {
134
+ title: 'Logo Showcase',
135
+ description: 'Display your logo with proper spacing and scaling.',
136
+ imageUrl: 'https://via.placeholder.com/120x120',
137
+ altText: 'Logo showcase',
138
+ buttonLabel: 'View More',
139
+ horizontalLayout: false,
140
+ scaleImageDown: true,
141
+ imageWidthFull: false,
142
+ shouldShowImageOnTop: false,
143
+ },
144
+ };
145
+
146
+ export const FullWidthImage = {
147
+ render: (args) => {
148
+ return {
149
+ components: {
150
+ PromoCard,
151
+ },
152
+ setup() {
153
+ return { args };
154
+ },
155
+ template: `
156
+ <PromoCard
157
+ v-bind="args"
158
+ @button-clicked="handleButtonClick"
159
+ />
160
+ `,
161
+ methods: {
162
+ handleButtonClick() {
163
+ console.log('Button clicked!');
164
+ },
165
+ },
166
+ };
167
+ },
168
+ args: {
169
+ title: 'Full Width Banner',
170
+ description: 'Images that stretch to fill the available space.',
171
+ imageUrl: 'https://bcassetcdn.com/assets/images/promo/brandpage-design-support.png',
172
+ altText: 'Full width banner',
173
+ buttonLabel: 'Explore',
174
+ horizontalLayout: false,
175
+ scaleImageDown: false,
176
+ imageWidthFull: true,
177
+ shouldShowImageOnTop: false,
178
+ },
179
+ };
180
+
181
+ export const AllOptions = {
182
+ render: (args) => {
183
+ return {
184
+ components: {
185
+ PromoCard,
186
+ },
187
+ setup() {
188
+ return { args };
189
+ },
190
+ template: `
191
+ <div class="tw-space-y-4">
192
+ <div>
193
+ <h3 class="tw-mb-2 tw-font-bold">Standard Layout</h3>
194
+ <PromoCard
195
+ title="Standard Promo"
196
+ description="This is the default vertical layout with image on the left."
197
+ imageUrl="https://bcassetcdn.com/assets/images/promo/brandpage-design-support.png"
198
+ altText="Standard layout"
199
+ buttonLabel="Click Me"
200
+ @button-clicked="handleButtonClick"
201
+ />
202
+ </div>
203
+
204
+ <div>
205
+ <h3 class="tw-mb-2 tw-font-bold">Horizontal Layout</h3>
206
+ <PromoCard
207
+ title="Horizontal Promo"
208
+ description="This layout is better for desktop with content side by side."
209
+ imageUrl="https://bcassetcdn.com/assets/images/promo/brandpage-design-support.png"
210
+ altText="Horizontal layout"
211
+ buttonLabel="Click Me"
212
+ :horizontal-layout="true"
213
+ @button-clicked="handleButtonClick"
214
+ />
215
+ </div>
216
+
217
+ <div>
218
+ <h3 class="tw-mb-2 tw-font-bold">Image On Top</h3>
219
+ <PromoCard
220
+ title="Mobile Optimized"
221
+ description="Perfect for mobile views with image stacked on top."
222
+ imageUrl="https://bcassetcdn.com/assets/images/promo/brandpage-design-support.png"
223
+ altText="Image on top"
224
+ buttonLabel="Click Me"
225
+ :should-show-image-on-top="true"
226
+ @button-clicked="handleButtonClick"
227
+ />
228
+ </div>
229
+ </div>
230
+ `,
231
+ methods: {
232
+ handleButtonClick() {
233
+ console.log('Button clicked!');
234
+ },
235
+ },
236
+ };
237
+ },
238
+ args: {},
239
+ };
240
+
241
+ Standard.story = {
242
+ name: 'PromoCard - Standard',
243
+ };
244
+
245
+ HorizontalLayout.story = {
246
+ name: 'PromoCard - Horizontal Layout',
247
+ };
248
+
249
+ ImageOnTop.story = {
250
+ name: 'PromoCard - Image On Top',
251
+ };
252
+
253
+ ScaledDownImage.story = {
254
+ name: 'PromoCard - Scaled Down Image',
255
+ };
256
+
257
+ FullWidthImage.story = {
258
+ name: 'PromoCard - Full Width Image',
259
+ };
260
+
261
+ AllOptions.story = {
262
+ name: 'PromoCard - All Variants',
263
+ };
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <div class="tw-flex" :class="shouldShowImageOnTop ? 'tw-flex-col' : 'tw-flex-row'">
3
+ <div
4
+ class="tw-flex tw-justify-center tw-items-center tw-bg-grayscale-400 tw-w-60 tw-p-1 dcom-rounded-tl dcom-rounded-bl"
5
+ :class="{
6
+ 'tw-w-full tw-px-8 md:tw-px-12 lg:tw-px-20 tw-py-4': shouldShowImageOnTop,
7
+ 'tw-px-4': !shouldShowImageOnTop,
8
+ }"
9
+ >
10
+ <img class="tw-w-full" :src="imageUrl" :alt="altText" />
11
+ </div>
12
+ <div
13
+ class="tw-flex tw-bg-white tw-w-full tw-p-4 tw-grow dcom-rounded-tr dcom-rounded-br tw-flex-col tw-justify-between"
14
+ :class="{
15
+ 'sm:tw-flex-row sm:tw-items-center': horizontalLayout,
16
+ }"
17
+ >
18
+ <div class="tw-text-left tw-overflow-hidden tw-text-ellipsis tw-text-base" :class="lineClampStyle">
19
+ <div class="tw-font-bold tw-text-black tw-mb-0.5">
20
+ {{ title }}
21
+ </div>
22
+ <p>
23
+ {{ description }}
24
+ </p>
25
+ </div>
26
+ <Button
27
+ variant="primary"
28
+ size="small"
29
+ :full-width="fullwidthButton"
30
+ class="tw-text-left tw-mt-4"
31
+ :class="horizontalLayout ? 'tw-w-full tw-mr-2 sm:tw-mt-0 sm:tw-ml-2 sm:tw-w-auto' : ''"
32
+ :label="buttonLabel"
33
+ @on-click="buttonClicked"
34
+ />
35
+ </div>
36
+ </div>
37
+ </template>
38
+ <script setup lang="ts">
39
+ import { computed, defineEmits } from 'vue';
40
+ import { BREAKPOINTS } from '../../../experiences/mixins/mediaQueryMixin';
41
+ import Button from '../Button/Button.vue';
42
+
43
+ const props = defineProps({
44
+ title: {
45
+ type: String,
46
+ required: true,
47
+ },
48
+ description: {
49
+ type: String,
50
+ required: true,
51
+ },
52
+ imageUrl: { type: String, required: true },
53
+ altText: { type: String, default: '' },
54
+ buttonLabel: {
55
+ type: String,
56
+ required: true,
57
+ },
58
+ horizontalLayout: {
59
+ type: Boolean,
60
+ default: false,
61
+ },
62
+ shouldShowImageOnTop: {
63
+ type: Boolean,
64
+ default: false,
65
+ },
66
+ textLineClamp: {
67
+ type: Number,
68
+ default: 0, // 0 is infinite
69
+ },
70
+ });
71
+
72
+ const emits = defineEmits(['button-clicked']);
73
+ const buttonClicked = () => emits('button-clicked');
74
+
75
+ const lineClampStyle = computed(() => {
76
+ if (props.textLineClamp > 0) {
77
+ return `tw-line-clamp-${props.textLineClamp}`;
78
+ }
79
+ return 'tw-line-clamp-none';
80
+ });
81
+
82
+ const fullwidthButton = computed(() => !(props.horizontalLayout && window.innerWidth >= BREAKPOINTS.SMALL));
83
+ </script>
@@ -174,6 +174,42 @@ export const PublishedNoDomains = () => {
174
174
 
175
175
  PublishedNoDomains.loaders = [loadTranslationAsync];
176
176
 
177
+ export const PublishedWithContent = () => {
178
+ return {
179
+ components: {
180
+ PublishBrandPageModal,
181
+ },
182
+ data() {
183
+ return {
184
+ domains,
185
+ };
186
+ },
187
+ methods: {},
188
+ template: `
189
+ <PublishBrandPageModal
190
+ visible
191
+ is-design-com
192
+ is-published
193
+ should-publish
194
+ :domains="domains"
195
+ isSubsequentPublish="true"
196
+ showUpsellRotation="true"
197
+ brand-page-display-name='Website'
198
+ brand-page-slug='test-slug'
199
+ brand-page-base-url="https://brand.site"
200
+ radio-value="slug"
201
+ brand-page-url="https://brand.site/test-slug"
202
+ >
203
+ <template #upsell>
204
+ <div>Upsell container goes here 111111</div>
205
+ </template>
206
+ </PublishBrandPageModal>
207
+ `,
208
+ };
209
+ };
210
+
211
+ PublishedWithContent.loaders = [loadTranslationAsync];
212
+
177
213
  export const Free = () => {
178
214
  return {
179
215
  components: {