@citizenplane/pimp 18.23.6 → 18.24.0
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/CpAncillaryItem.vue.d.ts.map +1 -1
- package/dist/components/CpIllustration.vue.d.ts +10 -0
- package/dist/components/CpIllustration.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/constants/CpIllustrations.d.ts +55 -0
- package/dist/constants/CpIllustrations.d.ts.map +1 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/pimp.es.js +1849 -1773
- package/dist/pimp.umd.js +40 -40
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/illustrations/accessibility.webp +0 -0
- package/src/assets/illustrations/airplane-seat.webp +0 -0
- package/src/assets/illustrations/airport-experience.png +0 -0
- package/src/assets/illustrations/baggages.webp +0 -0
- package/src/assets/illustrations/boarding-pass-2.webp +0 -0
- package/src/assets/illustrations/boarding-pass.webp +0 -0
- package/src/assets/illustrations/boeing-787-dreamliner.webp +0 -0
- package/src/assets/illustrations/checkout.webp +0 -0
- package/src/assets/illustrations/clock.png +0 -0
- package/src/assets/illustrations/empty-basket.png +0 -0
- package/src/assets/illustrations/empty-result.webp +0 -0
- package/src/assets/illustrations/flip-clock.webp +0 -0
- package/src/assets/illustrations/frequent-flyer.webp +0 -0
- package/src/assets/illustrations/generic.webp +0 -0
- package/src/assets/illustrations/island.webp +0 -0
- package/src/assets/illustrations/miles.webp +0 -0
- package/src/assets/illustrations/name-change.png +0 -0
- package/src/assets/illustrations/passport.webp +0 -0
- package/src/assets/illustrations/payment-declined.png +0 -0
- package/src/assets/illustrations/pets.webp +0 -0
- package/src/assets/illustrations/plane.webp +0 -0
- package/src/assets/illustrations/sign-out.png +0 -0
- package/src/assets/illustrations/sport-equipments.webp +0 -0
- package/src/components/CpAncillaryCategory.vue +7 -7
- package/src/components/CpAncillaryItem.vue +25 -26
- package/src/components/CpIllustration.vue +44 -0
- package/src/components/index.ts +5 -0
- package/src/constants/CpIllustrations.ts +107 -0
- package/src/constants/index.ts +2 -0
- package/src/stories/CpIllustration.stories.ts +129 -0
- package/src/assets/images/ancillaries/checked-bag-size-2.png +0 -0
- package/src/assets/images/ancillary-categories/baggages.png +0 -0
- package/src/assets/images/ancillary-categories/name-change.png +0 -0
- package/src/assets/images/ancillary-categories/pets.png +0 -0
- package/src/assets/images/ancillary-categories/sport-equipments.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/airport-transfer.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/bicycle.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/cabin-bag.png +0 -0
- /package/src/assets/{images/ancillary-categories → illustrations}/carbon-offset.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/checked-bag-size-1.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/checked-bag-size-3.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/checked-bag.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/connectivity.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/diving-set.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/extra-weight.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/fast-track.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/firearm.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/fishing-rod.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/golf.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/hand-bag.png +0 -0
- /package/src/assets/{images/ancillary-categories → illustrations}/insurance.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/kite-surf.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/lounge-access.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/meet-and-greet.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/music.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/oversized.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/pet-in-cabin.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/pet-in-hold.png +0 -0
- /package/src/assets/{images/ancillary-categories → illustrations}/restricted.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/skis.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/special-meal.png +0 -0
- /package/src/assets/{images/ancillaries → illustrations}/standard-meal.png +0 -0
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -65,13 +65,13 @@ import CpIcon from '@/components/CpIcon.vue'
|
|
|
65
65
|
import CpSwitch from '@/components/CpSwitch.vue'
|
|
66
66
|
import CpTransitionExpand from '@/components/CpTransitionExpand.vue'
|
|
67
67
|
|
|
68
|
-
import BaggagesVisual from '@/assets/
|
|
69
|
-
import CarbonOffsetVisual from '@/assets/
|
|
70
|
-
import InsuranceVisual from '@/assets/
|
|
71
|
-
import NameChangeVisual from '@/assets/
|
|
72
|
-
import PetsVisual from '@/assets/
|
|
73
|
-
import RestrictedVisual from '@/assets/
|
|
74
|
-
import SportEquipmentsVisual from '@/assets/
|
|
68
|
+
import BaggagesVisual from '@/assets/illustrations/baggages.webp'
|
|
69
|
+
import CarbonOffsetVisual from '@/assets/illustrations/carbon-offset.png'
|
|
70
|
+
import InsuranceVisual from '@/assets/illustrations/insurance.png'
|
|
71
|
+
import NameChangeVisual from '@/assets/illustrations/name-change.png'
|
|
72
|
+
import PetsVisual from '@/assets/illustrations/pets.webp'
|
|
73
|
+
import RestrictedVisual from '@/assets/illustrations/restricted.png'
|
|
74
|
+
import SportEquipmentsVisual from '@/assets/illustrations/sport-equipments.webp'
|
|
75
75
|
import { CpAncillaryCategoryTypes, isSwitchCategory } from '@/constants/CpAncillaryCategoryTypes'
|
|
76
76
|
|
|
77
77
|
interface Props {
|
|
@@ -51,31 +51,30 @@ import CpButton from '@/components/CpButton.vue'
|
|
|
51
51
|
import CpIcon from '@/components/CpIcon.vue'
|
|
52
52
|
import CpQuantityCounter from '@/components/CpQuantityCounter.vue'
|
|
53
53
|
|
|
54
|
-
import AirportTransferImage from '@/assets/
|
|
55
|
-
import BicycleImage from '@/assets/
|
|
56
|
-
import CabinBagImage from '@/assets/
|
|
57
|
-
import CheckedBagImage from '@/assets/
|
|
58
|
-
import CheckedBagSize1Image from '@/assets/
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import
|
|
66
|
-
import
|
|
67
|
-
import
|
|
68
|
-
import
|
|
69
|
-
import
|
|
70
|
-
import
|
|
71
|
-
import
|
|
72
|
-
import
|
|
73
|
-
import
|
|
74
|
-
import
|
|
75
|
-
import
|
|
76
|
-
import
|
|
77
|
-
import
|
|
78
|
-
import StandardMealImage from '@/assets/images/ancillaries/standard-meal.png'
|
|
54
|
+
import AirportTransferImage from '@/assets/illustrations/airport-transfer.png'
|
|
55
|
+
import BicycleImage from '@/assets/illustrations/bicycle.png'
|
|
56
|
+
import CabinBagImage from '@/assets/illustrations/cabin-bag.png'
|
|
57
|
+
import CheckedBagImage from '@/assets/illustrations/checked-bag.png'
|
|
58
|
+
import CheckedBagSize1Image from '@/assets/illustrations/checked-bag-size-1.png'
|
|
59
|
+
import CheckedBagSize3Image from '@/assets/illustrations/checked-bag-size-3.png'
|
|
60
|
+
import ConnectivityImage from '@/assets/illustrations/connectivity.png'
|
|
61
|
+
import DivingSetImage from '@/assets/illustrations/diving-set.png'
|
|
62
|
+
import ExtraWeightImage from '@/assets/illustrations/extra-weight.png'
|
|
63
|
+
import FastTrackImage from '@/assets/illustrations/fast-track.png'
|
|
64
|
+
import FirearmImage from '@/assets/illustrations/firearm.png'
|
|
65
|
+
import FishingRodImage from '@/assets/illustrations/fishing-rod.png'
|
|
66
|
+
import GolfImage from '@/assets/illustrations/golf.png'
|
|
67
|
+
import HandBagImage from '@/assets/illustrations/hand-bag.png'
|
|
68
|
+
import KiteSurfImage from '@/assets/illustrations/kite-surf.png'
|
|
69
|
+
import LoungeAccessImage from '@/assets/illustrations/lounge-access.png'
|
|
70
|
+
import MeetAndGreetImage from '@/assets/illustrations/meet-and-greet.png'
|
|
71
|
+
import MusicImage from '@/assets/illustrations/music.png'
|
|
72
|
+
import OversizedImage from '@/assets/illustrations/oversized.png'
|
|
73
|
+
import PetInCabinImage from '@/assets/illustrations/pet-in-cabin.png'
|
|
74
|
+
import PetInHoldImage from '@/assets/illustrations/pet-in-hold.png'
|
|
75
|
+
import SkisImage from '@/assets/illustrations/skis.png'
|
|
76
|
+
import SpecialMealImage from '@/assets/illustrations/special-meal.png'
|
|
77
|
+
import StandardMealImage from '@/assets/illustrations/standard-meal.png'
|
|
79
78
|
import { CpAncillaryItemTypes } from '@/constants/CpAncillaryItemTypes'
|
|
80
79
|
|
|
81
80
|
interface Props {
|
|
@@ -114,7 +113,7 @@ const ancillaryImages: Partial<Record<CpAncillaryItemTypes, string>> = {
|
|
|
114
113
|
[CpAncillaryItemTypes.CABIN_BAG]: CabinBagImage,
|
|
115
114
|
[CpAncillaryItemTypes.CHECKED_BAG]: CheckedBagImage,
|
|
116
115
|
[CpAncillaryItemTypes.CHECKED_BAG_SIZE_1]: CheckedBagSize1Image,
|
|
117
|
-
[CpAncillaryItemTypes.CHECKED_BAG_SIZE_2]:
|
|
116
|
+
[CpAncillaryItemTypes.CHECKED_BAG_SIZE_2]: CheckedBagImage,
|
|
118
117
|
[CpAncillaryItemTypes.CHECKED_BAG_SIZE_3]: CheckedBagSize3Image,
|
|
119
118
|
[CpAncillaryItemTypes.CONNECTIVITY]: ConnectivityImage,
|
|
120
119
|
[CpAncillaryItemTypes.DIVING_SET]: DivingSetImage,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<img
|
|
3
|
+
alt=""
|
|
4
|
+
aria-hidden="true"
|
|
5
|
+
class="cpIllustration"
|
|
6
|
+
:class="nameClass"
|
|
7
|
+
:height="size"
|
|
8
|
+
:src="source"
|
|
9
|
+
:width="size"
|
|
10
|
+
/>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
import { computed } from 'vue'
|
|
15
|
+
|
|
16
|
+
import { type CpIllustrationName, CpIllustrations } from '@/constants'
|
|
17
|
+
|
|
18
|
+
export interface Props {
|
|
19
|
+
name: string
|
|
20
|
+
size?: number
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
24
|
+
size: 24,
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const resolvedName = computed<CpIllustrationName>(() => {
|
|
28
|
+
const name = props.name as CpIllustrationName
|
|
29
|
+
|
|
30
|
+
if (!CpIllustrations[name]) return 'generic'
|
|
31
|
+
|
|
32
|
+
return name
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const source = computed(() => CpIllustrations[resolvedName.value])
|
|
36
|
+
|
|
37
|
+
const nameClass = computed(() => `cpIllustration--${resolvedName.value}`)
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style lang="scss">
|
|
41
|
+
.cpIllustration {
|
|
42
|
+
object-fit: contain;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
package/src/components/index.ts
CHANGED
|
@@ -39,6 +39,7 @@ import CpDynamicDialog from './CpDynamicDialog.vue'
|
|
|
39
39
|
import CpFlightTabs from './CpFlightTabs.vue'
|
|
40
40
|
import CpHeading from './CpHeading.vue'
|
|
41
41
|
import CpIcon from './CpIcon.vue'
|
|
42
|
+
import CpIllustration from './CpIllustration.vue'
|
|
42
43
|
import CpInput from './CpInput.vue'
|
|
43
44
|
import CpItemActions from './CpItemActions.vue'
|
|
44
45
|
import CpLoader from './CpLoader.vue'
|
|
@@ -146,6 +147,7 @@ const Components = {
|
|
|
146
147
|
CpTable,
|
|
147
148
|
CpTableColumnEditor,
|
|
148
149
|
CpIcon,
|
|
150
|
+
CpIllustration,
|
|
149
151
|
CpTelInput,
|
|
150
152
|
CpTooltip,
|
|
151
153
|
CpTextMorph,
|
|
@@ -204,6 +206,7 @@ const Pimp: Plugin = {
|
|
|
204
206
|
export type { CpAncillaryFlightSelectionFlight } from '@/constants/CpAncillaryFlightSelectionTypes'
|
|
205
207
|
export type { CpBasketCategory, CpBasketGroup, CpBasketRow } from '@/constants/CpBasketTypes'
|
|
206
208
|
export type { CpFlightTabsFlight } from '@/constants/CpFlightTabsTypes'
|
|
209
|
+
export type { CpIllustrationName } from '@/constants/CpIllustrations'
|
|
207
210
|
export type { CpStepperStep } from '@/constants/CpStepperTypes'
|
|
208
211
|
export type {
|
|
209
212
|
CpSeatMapConfig,
|
|
@@ -228,6 +231,7 @@ export type {
|
|
|
228
231
|
|
|
229
232
|
export { CpAncillaryCategoryTypes, isSwitchCategory } from '@/constants/CpAncillaryCategoryTypes'
|
|
230
233
|
export { CpAncillaryItemTypes } from '@/constants/CpAncillaryItemTypes'
|
|
234
|
+
export { CpIllustrationNames, CpIllustrations } from '@/constants/CpIllustrations'
|
|
231
235
|
export {
|
|
232
236
|
CpSeatMapTransitionDirections,
|
|
233
237
|
DEFAULT_CP_SEAT_MAP_CONFIG,
|
|
@@ -265,6 +269,7 @@ export {
|
|
|
265
269
|
CpFlightTabs,
|
|
266
270
|
CpHeading,
|
|
267
271
|
CpIcon,
|
|
272
|
+
CpIllustration,
|
|
268
273
|
CpInput,
|
|
269
274
|
CpItemActions,
|
|
270
275
|
CpLoader,
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import AccessibilityIllustration from '@/assets/illustrations/accessibility.webp'
|
|
2
|
+
import AirplaneSeatIllustration from '@/assets/illustrations/airplane-seat.webp'
|
|
3
|
+
import AirportExperienceIllustration from '@/assets/illustrations/airport-experience.png'
|
|
4
|
+
import AirportTransferIllustration from '@/assets/illustrations/airport-transfer.png'
|
|
5
|
+
import BaggagesIllustration from '@/assets/illustrations/baggages.webp'
|
|
6
|
+
import BicycleIllustration from '@/assets/illustrations/bicycle.png'
|
|
7
|
+
import BoardingPassIllustration from '@/assets/illustrations/boarding-pass.webp'
|
|
8
|
+
import BoardingPass2Illustration from '@/assets/illustrations/boarding-pass-2.webp'
|
|
9
|
+
import Boeing787DreamlinerIllustration from '@/assets/illustrations/boeing-787-dreamliner.webp'
|
|
10
|
+
import CabinBagIllustration from '@/assets/illustrations/cabin-bag.png'
|
|
11
|
+
import CarbonOffsetIllustration from '@/assets/illustrations/carbon-offset.png'
|
|
12
|
+
import CheckedBagIllustration from '@/assets/illustrations/checked-bag.png'
|
|
13
|
+
import CheckedBagSize1Illustration from '@/assets/illustrations/checked-bag-size-1.png'
|
|
14
|
+
import CheckedBagSize3Illustration from '@/assets/illustrations/checked-bag-size-3.png'
|
|
15
|
+
import CheckoutIllustration from '@/assets/illustrations/checkout.webp'
|
|
16
|
+
import ClockIllustration from '@/assets/illustrations/clock.png'
|
|
17
|
+
import ConnectivityIllustration from '@/assets/illustrations/connectivity.png'
|
|
18
|
+
import DivingSetIllustration from '@/assets/illustrations/diving-set.png'
|
|
19
|
+
import EmptyBasketIllustration from '@/assets/illustrations/empty-basket.png'
|
|
20
|
+
import EmptyResultIllustration from '@/assets/illustrations/empty-result.webp'
|
|
21
|
+
import ExtraWeightIllustration from '@/assets/illustrations/extra-weight.png'
|
|
22
|
+
import FastTrackIllustration from '@/assets/illustrations/fast-track.png'
|
|
23
|
+
import FirearmIllustration from '@/assets/illustrations/firearm.png'
|
|
24
|
+
import FishingRodIllustration from '@/assets/illustrations/fishing-rod.png'
|
|
25
|
+
import FlipClockIllustration from '@/assets/illustrations/flip-clock.webp'
|
|
26
|
+
import FrequentFlyerIllustration from '@/assets/illustrations/frequent-flyer.webp'
|
|
27
|
+
import GenericIllustration from '@/assets/illustrations/generic.webp'
|
|
28
|
+
import GolfIllustration from '@/assets/illustrations/golf.png'
|
|
29
|
+
import HandBagIllustration from '@/assets/illustrations/hand-bag.png'
|
|
30
|
+
import InsuranceIllustration from '@/assets/illustrations/insurance.png'
|
|
31
|
+
import IslandIllustration from '@/assets/illustrations/island.webp'
|
|
32
|
+
import KiteSurfIllustration from '@/assets/illustrations/kite-surf.png'
|
|
33
|
+
import LoungeAccessIllustration from '@/assets/illustrations/lounge-access.png'
|
|
34
|
+
import MeetAndGreetIllustration from '@/assets/illustrations/meet-and-greet.png'
|
|
35
|
+
import MilesIllustration from '@/assets/illustrations/miles.webp'
|
|
36
|
+
import MusicIllustration from '@/assets/illustrations/music.png'
|
|
37
|
+
import NameChangeIllustration from '@/assets/illustrations/name-change.png'
|
|
38
|
+
import OversizedIllustration from '@/assets/illustrations/oversized.png'
|
|
39
|
+
import PassportIllustration from '@/assets/illustrations/passport.webp'
|
|
40
|
+
import PaymentDeclinedIllustration from '@/assets/illustrations/payment-declined.png'
|
|
41
|
+
import PetInCabinIllustration from '@/assets/illustrations/pet-in-cabin.png'
|
|
42
|
+
import PetInHoldIllustration from '@/assets/illustrations/pet-in-hold.png'
|
|
43
|
+
import PetsIllustration from '@/assets/illustrations/pets.webp'
|
|
44
|
+
import PlaneIllustration from '@/assets/illustrations/plane.webp'
|
|
45
|
+
import RestrictedIllustration from '@/assets/illustrations/restricted.png'
|
|
46
|
+
import SignOutIllustration from '@/assets/illustrations/sign-out.png'
|
|
47
|
+
import SkisIllustration from '@/assets/illustrations/skis.png'
|
|
48
|
+
import SpecialMealIllustration from '@/assets/illustrations/special-meal.png'
|
|
49
|
+
import SportEquipmentsIllustration from '@/assets/illustrations/sport-equipments.webp'
|
|
50
|
+
import StandardMealIllustration from '@/assets/illustrations/standard-meal.png'
|
|
51
|
+
|
|
52
|
+
export const CpIllustrations = {
|
|
53
|
+
accessibility: AccessibilityIllustration,
|
|
54
|
+
'airplane-seat': AirplaneSeatIllustration,
|
|
55
|
+
'airport-experience': AirportExperienceIllustration,
|
|
56
|
+
'airport-transfer': AirportTransferIllustration,
|
|
57
|
+
baggages: BaggagesIllustration,
|
|
58
|
+
bicycle: BicycleIllustration,
|
|
59
|
+
'boarding-pass-2': BoardingPass2Illustration,
|
|
60
|
+
'boarding-pass': BoardingPassIllustration,
|
|
61
|
+
'boeing-787-dreamliner': Boeing787DreamlinerIllustration,
|
|
62
|
+
'cabin-bag': CabinBagIllustration,
|
|
63
|
+
'carbon-offset': CarbonOffsetIllustration,
|
|
64
|
+
'checked-bag-size-1': CheckedBagSize1Illustration,
|
|
65
|
+
'checked-bag-size-3': CheckedBagSize3Illustration,
|
|
66
|
+
'checked-bag': CheckedBagIllustration,
|
|
67
|
+
checkout: CheckoutIllustration,
|
|
68
|
+
clock: ClockIllustration,
|
|
69
|
+
connectivity: ConnectivityIllustration,
|
|
70
|
+
'diving-set': DivingSetIllustration,
|
|
71
|
+
'empty-basket': EmptyBasketIllustration,
|
|
72
|
+
'empty-result': EmptyResultIllustration,
|
|
73
|
+
'extra-weight': ExtraWeightIllustration,
|
|
74
|
+
'fast-track': FastTrackIllustration,
|
|
75
|
+
firearm: FirearmIllustration,
|
|
76
|
+
'fishing-rod': FishingRodIllustration,
|
|
77
|
+
'flip-clock': FlipClockIllustration,
|
|
78
|
+
'frequent-flyer': FrequentFlyerIllustration,
|
|
79
|
+
generic: GenericIllustration,
|
|
80
|
+
golf: GolfIllustration,
|
|
81
|
+
'hand-bag': HandBagIllustration,
|
|
82
|
+
insurance: InsuranceIllustration,
|
|
83
|
+
island: IslandIllustration,
|
|
84
|
+
'kite-surf': KiteSurfIllustration,
|
|
85
|
+
'lounge-access': LoungeAccessIllustration,
|
|
86
|
+
'meet-and-greet': MeetAndGreetIllustration,
|
|
87
|
+
miles: MilesIllustration,
|
|
88
|
+
music: MusicIllustration,
|
|
89
|
+
'name-change': NameChangeIllustration,
|
|
90
|
+
oversized: OversizedIllustration,
|
|
91
|
+
passport: PassportIllustration,
|
|
92
|
+
'payment-declined': PaymentDeclinedIllustration,
|
|
93
|
+
'pet-in-cabin': PetInCabinIllustration,
|
|
94
|
+
'pet-in-hold': PetInHoldIllustration,
|
|
95
|
+
pets: PetsIllustration,
|
|
96
|
+
plane: PlaneIllustration,
|
|
97
|
+
restricted: RestrictedIllustration,
|
|
98
|
+
'sign-out': SignOutIllustration,
|
|
99
|
+
skis: SkisIllustration,
|
|
100
|
+
'special-meal': SpecialMealIllustration,
|
|
101
|
+
'sport-equipments': SportEquipmentsIllustration,
|
|
102
|
+
'standard-meal': StandardMealIllustration,
|
|
103
|
+
} as const
|
|
104
|
+
|
|
105
|
+
export type CpIllustrationName = keyof typeof CpIllustrations
|
|
106
|
+
|
|
107
|
+
export const CpIllustrationNames = Object.keys(CpIllustrations) as CpIllustrationName[]
|
package/src/constants/index.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
export type { CpIllustrationName } from './CpIllustrations'
|
|
1
2
|
export type { Colors } from './colors/Colors'
|
|
2
3
|
export type { ToggleColors } from './colors/ToggleColors'
|
|
3
4
|
export type { Sizes } from './Sizes'
|
|
4
5
|
|
|
5
6
|
export { CustomCpIcons } from './CpCustomIcons'
|
|
7
|
+
export { CpIllustrationNames, CpIllustrations } from './CpIllustrations'
|
|
6
8
|
export { RESERVED_KEYS, VISIBLE_ROWS_MAX } from './CpTableConfig'
|
|
7
9
|
export { Intent } from './Intent'
|
|
8
10
|
export { Position } from './Position'
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { Args, Meta, StoryObj } from '@storybook/vue3-vite'
|
|
2
|
+
|
|
3
|
+
import CpIllustration from '@/components/CpIllustration.vue'
|
|
4
|
+
|
|
5
|
+
import { CpIllustrationNames } from '@/constants'
|
|
6
|
+
import { docCellStyle, docLabelStyle, docRowWrapStyle } from '@/stories/documentationStyles'
|
|
7
|
+
import { copyableClass, copyableCopiedClass, useCopier } from '@/stories/tokenUtils'
|
|
8
|
+
|
|
9
|
+
const illustrationsOptions = [...CpIllustrationNames, 'unknown-illustration-name'].sort()
|
|
10
|
+
|
|
11
|
+
const illustrationSizes = [24, 48, 96] as const
|
|
12
|
+
|
|
13
|
+
const meta = {
|
|
14
|
+
title: 'Foundations/CpIllustration',
|
|
15
|
+
component: CpIllustration,
|
|
16
|
+
tags: ['!dev'],
|
|
17
|
+
argTypes: {
|
|
18
|
+
name: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: illustrationsOptions,
|
|
21
|
+
description: 'Name of the illustration to display. An unknown name falls back to `generic`.',
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
control: 'number',
|
|
25
|
+
description: 'Size of the illustration in pixels',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
} satisfies Meta<typeof CpIllustration>
|
|
29
|
+
|
|
30
|
+
export default meta
|
|
31
|
+
type Story = StoryObj<typeof meta>
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Default illustration. Use the controls to experiment with each prop in isolation.
|
|
35
|
+
*/
|
|
36
|
+
export const Default: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
name: 'generic',
|
|
39
|
+
size: 96,
|
|
40
|
+
},
|
|
41
|
+
render: (args: Args) => ({
|
|
42
|
+
components: { CpIllustration },
|
|
43
|
+
setup() {
|
|
44
|
+
return { args }
|
|
45
|
+
},
|
|
46
|
+
template: `
|
|
47
|
+
<div style="padding: 20px;">
|
|
48
|
+
<CpIllustration v-bind="args" />
|
|
49
|
+
</div>
|
|
50
|
+
`,
|
|
51
|
+
}),
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* -------------------------------------------------------------------------- */
|
|
55
|
+
/* Sizes */
|
|
56
|
+
/* -------------------------------------------------------------------------- */
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The illustration scales freely through the `size` prop (pixel value). Below are
|
|
60
|
+
* the sizes used across the design system.
|
|
61
|
+
*/
|
|
62
|
+
export const Sizes: Story = {
|
|
63
|
+
args: { name: 'island' },
|
|
64
|
+
parameters: { controls: { disable: true } },
|
|
65
|
+
render: (args: Args) => ({
|
|
66
|
+
components: { CpIllustration },
|
|
67
|
+
setup() {
|
|
68
|
+
return { args, illustrationSizes, docCellStyle, docLabelStyle, docRowWrapStyle }
|
|
69
|
+
},
|
|
70
|
+
template: `
|
|
71
|
+
<div :style="docRowWrapStyle">
|
|
72
|
+
<div v-for="size in illustrationSizes" :key="size" :style="docCellStyle">
|
|
73
|
+
<span :style="docLabelStyle">{{ size }}px</span>
|
|
74
|
+
<CpIllustration :name="args.name" :size="size" />
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
`,
|
|
78
|
+
}),
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* -------------------------------------------------------------------------- */
|
|
82
|
+
/* Catalog */
|
|
83
|
+
/* -------------------------------------------------------------------------- */
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Every available illustration, at 24 / 48 / 96 px. Click a name to copy it.
|
|
87
|
+
*/
|
|
88
|
+
export const AllIllustrations: Story = {
|
|
89
|
+
args: { name: 'generic' },
|
|
90
|
+
parameters: { controls: { disable: true } },
|
|
91
|
+
render: () => ({
|
|
92
|
+
components: { CpIllustration },
|
|
93
|
+
setup() {
|
|
94
|
+
const { copiedKey, copy } = useCopier()
|
|
95
|
+
return {
|
|
96
|
+
illustrations: CpIllustrationNames,
|
|
97
|
+
illustrationSizes,
|
|
98
|
+
copiedKey,
|
|
99
|
+
copy,
|
|
100
|
+
copyClass: copyableClass,
|
|
101
|
+
copiedClass: copyableCopiedClass,
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
template: `
|
|
105
|
+
<div style="padding: 20px; display: grid; grid-template-columns: repeat(3, minmax(200px, 1fr)); gap: 16px;">
|
|
106
|
+
<div
|
|
107
|
+
v-for="illustration in illustrations"
|
|
108
|
+
:key="illustration"
|
|
109
|
+
style="display: flex; flex-direction: column; align-items: center; border: 1px solid #eee; border-radius: 4px;"
|
|
110
|
+
>
|
|
111
|
+
<span
|
|
112
|
+
style="font-size: 12px; padding: 8px; word-break: break-word;"
|
|
113
|
+
:class="[copyClass, copiedKey === illustration ? copiedClass : '']"
|
|
114
|
+
role="button"
|
|
115
|
+
tabindex="0"
|
|
116
|
+
:title="'Click to copy ' + illustration"
|
|
117
|
+
@click="copy(illustration)"
|
|
118
|
+
@keydown.enter.prevent="copy(illustration)"
|
|
119
|
+
@keydown.space.prevent="copy(illustration)"
|
|
120
|
+
>{{ copiedKey === illustration ? 'Copied!' : illustration }}</span>
|
|
121
|
+
<hr style="width: 100%; background-color: #eee; height: 1px; border: 0;" />
|
|
122
|
+
<div style="padding: 20px; display: flex; align-items: flex-end; gap: 16px;">
|
|
123
|
+
<CpIllustration v-for="size in illustrationSizes" :key="size" :name="illustration" :size="size" />
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
`,
|
|
128
|
+
}),
|
|
129
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|