@citizenplane/pimp 18.19.4 → 18.19.5
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/dist/components/CpAncillaryCategory.vue.d.ts.map +1 -1
- package/dist/components/CpAncillaryItem.vue.d.ts.map +1 -1
- package/dist/pimp.es.js +1598 -1598
- package/dist/pimp.umd.js +40 -40
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CpAncillaryCategory.vue +9 -1
- package/src/components/CpAncillaryItem.vue +37 -35
- package/src/stories/CpAncillaryCategory.stories.ts +16 -1
- package/src/stories/CpAncillaryItem.stories.ts +25 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="cpAncillaryCategory">
|
|
2
|
+
<div class="cpAncillaryCategory" :class="cpAncillaryCategoryDynamicClass">
|
|
3
3
|
<component
|
|
4
4
|
:is="headerTag"
|
|
5
5
|
v-bind="headerAttrs"
|
|
@@ -137,6 +137,10 @@ const fromPriceDynamicClass = computed(() => ({ 'cpAncillaryCategory__fromPrice-
|
|
|
137
137
|
|
|
138
138
|
const chevronDynamicClass = computed(() => ({ 'cpAncillaryCategory__chevron--isRotated': isOpen.value }))
|
|
139
139
|
|
|
140
|
+
const cpAncillaryCategoryDynamicClass = computed(() => ({
|
|
141
|
+
'cpAncillaryCategory--isOpen': isActuallyExpandable.value && isOpen.value,
|
|
142
|
+
}))
|
|
143
|
+
|
|
140
144
|
const handleHeaderClick = () => {
|
|
141
145
|
if (isActuallyExpandable.value) isOpen.value = !isOpen.value
|
|
142
146
|
}
|
|
@@ -198,6 +202,10 @@ const handleHeaderClick = () => {
|
|
|
198
202
|
@container (width < 30rem) {
|
|
199
203
|
justify-content: flex-start;
|
|
200
204
|
padding: 0;
|
|
205
|
+
|
|
206
|
+
.cpAncillaryCategory--isOpen & {
|
|
207
|
+
display: none;
|
|
208
|
+
}
|
|
201
209
|
}
|
|
202
210
|
}
|
|
203
211
|
|
|
@@ -216,41 +216,43 @@ const cpAncillaryItemDynamicClass = computed(() => ({
|
|
|
216
216
|
line-height: var(--cp-text-md-line-height);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
219
|
+
@include mx.media-query-min(48rem) {
|
|
220
|
+
&--isVertical {
|
|
221
|
+
.cpAncillaryItem__wrap {
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
align-items: center;
|
|
224
|
+
padding-bottom: var(--cp-spacing-lg);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.cpAncillaryItem__visual {
|
|
228
|
+
width: 100%;
|
|
229
|
+
height: fn.px-to-rem(128);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.cpAncillaryItem__image {
|
|
233
|
+
width: fn.px-to-rem(80);
|
|
234
|
+
height: fn.px-to-rem(80);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.cpAncillaryItem__content {
|
|
238
|
+
width: 100%;
|
|
239
|
+
align-items: center;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.cpAncillaryItem__name {
|
|
243
|
+
padding: 0 var(--cp-spacing-lg);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.cpAncillaryItem__title,
|
|
247
|
+
.cpAncillaryItem__description,
|
|
248
|
+
.cpAncillaryItem__subtitle {
|
|
249
|
+
text-align: center;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.cpAncillaryItem__quantity {
|
|
253
|
+
flex-direction: column;
|
|
254
|
+
gap: var(--cp-spacing-sm);
|
|
255
|
+
}
|
|
254
256
|
}
|
|
255
257
|
}
|
|
256
258
|
|
|
@@ -240,7 +240,7 @@ export const Mobile: Story = {
|
|
|
240
240
|
template: `
|
|
241
241
|
<div :style="galleryListStyle">
|
|
242
242
|
<div :style="galleryRowStyle">
|
|
243
|
-
<span :style="docLabelStyle">Expandable</span>
|
|
243
|
+
<span :style="docLabelStyle">Expandable (closed)</span>
|
|
244
244
|
<div style="width: 358px;">
|
|
245
245
|
<CpAncillaryCategory
|
|
246
246
|
title="Sport Equipments"
|
|
@@ -253,6 +253,21 @@ export const Mobile: Story = {
|
|
|
253
253
|
/>
|
|
254
254
|
</div>
|
|
255
255
|
</div>
|
|
256
|
+
<div :style="galleryRowStyle">
|
|
257
|
+
<span :style="docLabelStyle">Expandable (open, no trailing)</span>
|
|
258
|
+
<div style="width: 358px;">
|
|
259
|
+
<CpAncillaryCategory
|
|
260
|
+
title="Sport Equipments"
|
|
261
|
+
description="Travel with special or oversized items you need to bring along."
|
|
262
|
+
type="sportEquipments"
|
|
263
|
+
is-expandable
|
|
264
|
+
:from-price="5990"
|
|
265
|
+
currency="EUR"
|
|
266
|
+
>
|
|
267
|
+
<span :style="docLabelStyle">Body content</span>
|
|
268
|
+
</CpAncillaryCategory>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
256
271
|
<div :style="galleryRowStyle">
|
|
257
272
|
<span :style="docLabelStyle">Switch</span>
|
|
258
273
|
<div style="width: 358px;">
|
|
@@ -202,6 +202,31 @@ export const Vertical: Story = {
|
|
|
202
202
|
}),
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Below the tablet breakpoint the card is always horizontal, even when
|
|
207
|
+
* vertical is true: `vertical` only takes effect from tablet width up.
|
|
208
|
+
*/
|
|
209
|
+
export const VerticalOnMobile: Story = {
|
|
210
|
+
args: {
|
|
211
|
+
...Vertical.args,
|
|
212
|
+
},
|
|
213
|
+
globals: {
|
|
214
|
+
viewport: { value: '390-844', isRotated: false },
|
|
215
|
+
},
|
|
216
|
+
render: (args) => ({
|
|
217
|
+
components: { CpAncillaryItem },
|
|
218
|
+
setup() {
|
|
219
|
+
const quantity = ref(0)
|
|
220
|
+
return { args, quantity }
|
|
221
|
+
},
|
|
222
|
+
template: `
|
|
223
|
+
<div style="padding: 20px; min-width: 15rem;">
|
|
224
|
+
<CpAncillaryItem v-bind="args" v-model:quantity="quantity" />
|
|
225
|
+
</div>
|
|
226
|
+
`,
|
|
227
|
+
}),
|
|
228
|
+
}
|
|
229
|
+
|
|
205
230
|
/* -------------------------------------------------------------------------- */
|
|
206
231
|
/* Gallery */
|
|
207
232
|
/* -------------------------------------------------------------------------- */
|