@citizenplane/pimp 18.19.3 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citizenplane/pimp",
3
- "version": "18.19.3",
3
+ "version": "18.19.5",
4
4
  "scripts": {
5
5
  "dev": "storybook dev -p 8081",
6
6
  "build-storybook": "storybook build --output-dir ./docs",
@@ -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"
@@ -66,6 +66,7 @@ import CpTransitionExpand from '@/components/CpTransitionExpand.vue'
66
66
  import BaggagesVisual from '@/assets/images/ancillary-categories/baggages.png'
67
67
  import CarbonOffsetVisual from '@/assets/images/ancillary-categories/carbon-offset.png'
68
68
  import InsuranceVisual from '@/assets/images/ancillary-categories/insurance.png'
69
+ import NameChangeVisual from '@/assets/images/ancillary-categories/name-change.png'
69
70
  import PetsVisual from '@/assets/images/ancillary-categories/pets.png'
70
71
  import RestrictedVisual from '@/assets/images/ancillary-categories/restricted.png'
71
72
  import SportEquipmentsVisual from '@/assets/images/ancillary-categories/sport-equipments.png'
@@ -111,6 +112,7 @@ const categoryVisuals: Partial<Record<CpAncillaryCategoryTypes, string>> = {
111
112
  [CpAncillaryCategoryTypes.BAGGAGES]: BaggagesVisual,
112
113
  [CpAncillaryCategoryTypes.CARBON_OFFSET]: CarbonOffsetVisual,
113
114
  [CpAncillaryCategoryTypes.INSURANCE]: InsuranceVisual,
115
+ [CpAncillaryCategoryTypes.NAME_CHANGE]: NameChangeVisual,
114
116
  [CpAncillaryCategoryTypes.PETS]: PetsVisual,
115
117
  [CpAncillaryCategoryTypes.RESTRICTED]: RestrictedVisual,
116
118
  [CpAncillaryCategoryTypes.SPORT_EQUIPMENTS]: SportEquipmentsVisual,
@@ -135,6 +137,10 @@ const fromPriceDynamicClass = computed(() => ({ 'cpAncillaryCategory__fromPrice-
135
137
 
136
138
  const chevronDynamicClass = computed(() => ({ 'cpAncillaryCategory__chevron--isRotated': isOpen.value }))
137
139
 
140
+ const cpAncillaryCategoryDynamicClass = computed(() => ({
141
+ 'cpAncillaryCategory--isOpen': isActuallyExpandable.value && isOpen.value,
142
+ }))
143
+
138
144
  const handleHeaderClick = () => {
139
145
  if (isActuallyExpandable.value) isOpen.value = !isOpen.value
140
146
  }
@@ -196,6 +202,10 @@ const handleHeaderClick = () => {
196
202
  @container (width < 30rem) {
197
203
  justify-content: flex-start;
198
204
  padding: 0;
205
+
206
+ .cpAncillaryCategory--isOpen & {
207
+ display: none;
208
+ }
199
209
  }
200
210
  }
201
211
 
@@ -16,6 +16,7 @@
16
16
  v-model="quantity"
17
17
  class="cpAncillaryItem__counter"
18
18
  :decrease-label="decreaseLabel"
19
+ :disable-animation="disableAnimation"
19
20
  :increase-label="increaseLabel"
20
21
  :max="maxQuantity"
21
22
  />
@@ -63,6 +64,7 @@ import { CpAncillaryItemTypes } from '@/constants/CpAncillaryItemTypes'
63
64
  interface Props {
64
65
  currency?: string
65
66
  description: string
67
+ disableAnimation?: boolean
66
68
  locale?: string
67
69
  maxQuantity?: number | null
68
70
  maxQuantityLabel?: string
@@ -214,41 +216,43 @@ const cpAncillaryItemDynamicClass = computed(() => ({
214
216
  line-height: var(--cp-text-md-line-height);
215
217
  }
216
218
 
217
- &--isVertical {
218
- .cpAncillaryItem__wrap {
219
- flex-direction: column;
220
- align-items: center;
221
- padding-bottom: var(--cp-spacing-lg);
222
- }
223
-
224
- .cpAncillaryItem__visual {
225
- width: 100%;
226
- height: fn.px-to-rem(128);
227
- }
228
-
229
- .cpAncillaryItem__image {
230
- width: fn.px-to-rem(80);
231
- height: fn.px-to-rem(80);
232
- }
233
-
234
- .cpAncillaryItem__content {
235
- width: 100%;
236
- align-items: center;
237
- }
238
-
239
- .cpAncillaryItem__name {
240
- padding: 0 var(--cp-spacing-lg);
241
- }
242
-
243
- .cpAncillaryItem__title,
244
- .cpAncillaryItem__description,
245
- .cpAncillaryItem__subtitle {
246
- text-align: center;
247
- }
248
-
249
- .cpAncillaryItem__quantity {
250
- flex-direction: column;
251
- gap: var(--cp-spacing-sm);
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
+ }
252
256
  }
253
257
  }
254
258
 
@@ -3,6 +3,7 @@ export enum CpAncillaryCategoryTypes {
3
3
  BAGGAGES = 'baggages',
4
4
  CARBON_OFFSET = 'carbonOffset',
5
5
  INSURANCE = 'insurance',
6
+ NAME_CHANGE = 'nameChange',
6
7
  ON_BOARD = 'onBoard',
7
8
  PETS = 'pets',
8
9
  RESTRICTED = 'restricted',
@@ -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
  /* -------------------------------------------------------------------------- */