@citizenplane/pimp 8.14.1 → 8.15.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/package.json +1 -1
- package/src/components/atomic-elements/CpAirlineLogo.vue +41 -0
- package/src/components/atomic-elements/CpPartnerBadge.vue +97 -0
- package/src/components/icons/IconAirline.vue +7 -0
- package/src/components/icons/IconOta.vue +20 -0
- package/src/components/icons/IconSupplier.vue +10 -0
- package/src/components/icons/IconThirdParty.vue +25 -0
- package/src/stories/CpAirlineLogo.stories.ts +93 -0
- package/src/stories/CpPartnerBadge.stories.ts +161 -0
- package/src/utils/constants/index.js +2 -0
- package/src/utils/constants/src/PartnerTypes.js +6 -0
- package/src/utils/constants/src/Sizes.js +5 -0
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<figure :style="dynamicStyle" class="cpAirlineLogo" :title="dynamicTitle" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from 'vue'
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
iataCode: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: '1L',
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
type: [Number, String],
|
|
15
|
+
default: 32,
|
|
16
|
+
},
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const airlineLogoUrl = computed(() => `https://images.kiwi.com/airlines/64/${props.iataCode}.png?default=airline.png`)
|
|
20
|
+
|
|
21
|
+
const dynamicStyle = computed(() => {
|
|
22
|
+
const size = props.size === '100%' ? props.size : `${props.size}px`
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
backgroundImage: `url('${airlineLogoUrl.value}')`,
|
|
26
|
+
width: size,
|
|
27
|
+
height: size,
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const dynamicTitle = computed(() => `${props.iataCode} airline logo`)
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<style lang="scss">
|
|
35
|
+
.cpAirlineLogo {
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
border-radius: fn.px-to-rem(4);
|
|
38
|
+
background-repeat: no-repeat;
|
|
39
|
+
background-size: contain;
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="cpPartnerBadge" :class="componentDynamicClasses">
|
|
3
|
+
<slot name="icon">
|
|
4
|
+
<component :is="dynamicBadgeProps.icon" class="cpPartnerBadge__icon" />
|
|
5
|
+
</slot>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
import { computed } from 'vue'
|
|
11
|
+
|
|
12
|
+
import { PartnerTypes, Sizes } from '@/utils/constants'
|
|
13
|
+
|
|
14
|
+
import IconOta from '@/components/icons/IconOta.vue'
|
|
15
|
+
import IconAirline from '@/components/icons/IconAirline.vue'
|
|
16
|
+
import IconSupplier from '@/components/icons/IconSupplier.vue'
|
|
17
|
+
import IconThirdParty from '@/components/icons/IconThirdParty.vue'
|
|
18
|
+
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
size: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: false,
|
|
23
|
+
default: 'md',
|
|
24
|
+
validator(value) {
|
|
25
|
+
return Object.values(Sizes).includes(value)
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
type: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true,
|
|
31
|
+
validator(value) {
|
|
32
|
+
return Object.values(PartnerTypes).includes(value)
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const dynamicBadgeProps = computed(() => {
|
|
38
|
+
switch (props.type) {
|
|
39
|
+
case PartnerTypes.OTA:
|
|
40
|
+
return { classModifier: 'isOta', icon: IconOta }
|
|
41
|
+
case PartnerTypes.AIRLINE:
|
|
42
|
+
return { classModifier: 'isAirline', icon: IconAirline }
|
|
43
|
+
case PartnerTypes.SUPPLIER:
|
|
44
|
+
return { classModifier: 'isSupplier', icon: IconSupplier }
|
|
45
|
+
case PartnerTypes.THIRDPARTY:
|
|
46
|
+
default:
|
|
47
|
+
return { classModifier: 'isThirdParty', icon: IconThirdParty }
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const componentDynamicClasses = computed(() => {
|
|
52
|
+
return [`cpPartnerBadge--${props.size}`, `cpPartnerBadge--${dynamicBadgeProps.value.classModifier}`]
|
|
53
|
+
})
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss">
|
|
57
|
+
.cpPartnerBadge {
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
padding: sp.$space-xs;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
border-radius: fn.px-to-rem(4);
|
|
63
|
+
color: colors.$neutral-light;
|
|
64
|
+
|
|
65
|
+
&--isOta {
|
|
66
|
+
background-color: colors.$orange;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&--isAirline {
|
|
70
|
+
background-color: colors.$blue-1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&--isSupplier {
|
|
74
|
+
background-color: colors.$purple;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&--isThirdParty {
|
|
78
|
+
background-color: colors.$pink;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
> * {
|
|
82
|
+
width: fn.px-to-rem(20);
|
|
83
|
+
height: fn.px-to-rem(20);
|
|
84
|
+
aspect-ratio: 1/1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&--sm > * {
|
|
88
|
+
width: fn.px-to-rem(16);
|
|
89
|
+
height: fn.px-to-rem(16);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&--xs > * {
|
|
93
|
+
width: fn.px-to-rem(12);
|
|
94
|
+
height: fn.px-to-rem(12);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
|
3
|
+
<path
|
|
4
|
+
d="M10.1152 8.42326L10.1404 3.98405C10.1464 2.93184 11.0042 2.07886 12.0564 2.07886C13.1087 2.07886 13.9568 2.93184 13.9508 3.98405L13.9256 8.42326L19.7937 12.7402C20.0805 12.9512 20.2487 13.2867 20.2467 13.6437L20.2364 15.4465C20.2342 15.8357 19.8455 16.1062 19.4808 15.9723L13.8944 13.9217L13.8715 17.9399L15.1113 18.8728C15.3924 19.0843 15.5567 19.4164 15.5546 19.7691L15.5462 21.2515C15.5443 21.5964 15.2019 21.8378 14.8773 21.7231L11.9507 20.6891L9.01229 21.7231C8.68636 21.8378 8.34675 21.5964 8.34871 21.2515L8.35714 19.7691C8.35914 19.4164 8.52718 19.0843 8.81065 18.8728L10.0611 17.9399L10.0839 13.9217L4.47412 15.9723C4.10792 16.1062 3.72228 15.8357 3.72449 15.4465L3.73474 13.6437C3.73676 13.2867 3.90882 12.9512 4.19797 12.7402L10.1152 8.42326Z"
|
|
5
|
+
/>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
class="iconOta"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="currentColor"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
d="M14.5185 19.4762C14.4808 19.4317 14.4345 19.3951 14.3825 19.3684C14.3303 19.3418 14.2735 19.3257 14.215 19.3211H10.7464C10.6837 19.3233 10.6221 19.3382 10.5655 19.3649C10.5088 19.3915 10.4581 19.4294 10.4168 19.4762L8.59576 21.6558C8.55345 21.723 8.53101 21.8006 8.53101 21.8798C8.53101 21.9591 8.55345 22.0367 8.59576 22.1038C8.63272 22.1804 8.6925 22.2438 8.76696 22.2853C8.84143 22.327 8.92698 22.3447 9.01201 22.3364H15.9494C16.028 22.334 16.1044 22.3107 16.1711 22.2691C16.2376 22.2275 16.2917 22.169 16.328 22.0996C16.3642 22.0303 16.3811 21.9526 16.3771 21.8746C16.373 21.7966 16.3481 21.7211 16.3049 21.6558L14.5185 19.4762Z"
|
|
12
|
+
/>
|
|
13
|
+
<path
|
|
14
|
+
d="M21.5838 1.66168H3.37509C3.03013 1.66168 2.69932 1.79782 2.45541 2.04014C2.21149 2.28245 2.07446 2.6111 2.07446 2.9538V16.7364C2.07446 17.079 2.21149 17.4077 2.45541 17.65C2.69932 17.8923 3.03013 18.0285 3.37509 18.0285H21.5838C21.9287 18.0285 22.2596 17.8923 22.5034 17.65C22.7474 17.4077 22.8844 17.079 22.8844 16.7364V2.9538C22.8844 2.6111 22.7474 2.28245 22.5034 2.04014C22.2596 1.79782 21.9287 1.66168 21.5838 1.66168ZM21.1503 14.1521C21.1503 14.2663 21.1045 14.3759 21.0233 14.4567C20.9419 14.5374 20.8317 14.5828 20.7167 14.5828H4.24217C4.12719 14.5828 4.01691 14.5374 3.93561 14.4567C3.8543 14.3759 3.80863 14.2663 3.80863 14.1521V3.81521C3.80863 3.70098 3.8543 3.59143 3.93561 3.51065C4.01691 3.42988 4.12719 3.3845 4.24217 3.3845H20.7167C20.8317 3.3845 20.9419 3.42988 21.0233 3.51065C21.1045 3.59143 21.1503 3.70098 21.1503 3.81521V14.1521Z"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
d="M13.3937 7.3024L15.0225 6.36819C15.4085 6.14676 15.9028 6.27919 16.1264 6.66398C16.35 7.04877 16.2184 7.54022 15.8323 7.76165L14.2035 8.69585L13.9059 11.4457C13.8684 11.7925 13.6669 12.1002 13.3635 12.2742C13.0328 12.4639 12.6122 12.2678 12.5461 11.893L12.1862 9.85298L10.7119 10.6986L10.6867 10.91C10.6361 11.3348 10.3872 11.7106 10.015 11.924C9.81121 12.0409 9.5519 11.9219 9.50833 11.6914L9.2983 10.5804L8.43479 9.84418C8.25568 9.69147 8.28157 9.40886 8.48538 9.29196C8.85756 9.07849 9.30954 9.05223 9.70523 9.2211L9.90209 9.30512L11.3763 8.45953L9.77799 7.12983C9.48431 6.88552 9.52361 6.42565 9.85438 6.23592C10.1578 6.06191 10.5267 6.04246 10.8478 6.18355L13.3937 7.3024Z"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
|
3
|
+
<path
|
|
4
|
+
d="M13.8299 2C15.8212 2 17.4369 3.60517 17.4369 5.58345V9.20768H17.42C16.1002 9.20768 15.0302 10.2706 15.0302 11.5807V13.319C15.0302 13.6981 14.7211 14.0064 14.3383 14.0064H9.66617C9.28457 14.0064 8.97422 13.6981 8.97422 13.319V11.5807C8.97422 10.2706 7.90431 9.20768 6.58442 9.20768H6.56873V5.58345C6.56873 3.60517 8.18326 2 10.1746 2H13.8299Z"
|
|
5
|
+
/>
|
|
6
|
+
<path
|
|
7
|
+
d="M17.4343 10.3981C16.7665 10.3981 16.2267 10.9355 16.2267 11.5978V14.5178C16.2267 14.8933 15.92 15.1968 15.542 15.1968H8.45714C8.07917 15.1968 7.77365 14.8933 7.77365 14.5178V11.5978C7.77365 10.9355 7.23265 10.3981 6.56607 10.3981C5.89828 10.3981 5.35849 10.9355 5.35849 11.5978V15.7175C5.35849 16.7552 6.205 17.5962 7.24956 17.5962H9.50411C9.88208 17.5962 10.1888 17.9009 10.1888 18.2764V19.6596C10.1888 19.8456 10.0367 19.9955 9.84948 19.9955H8.78198C8.22528 19.9955 7.77365 20.4442 7.77365 20.9973C7.77365 21.5515 8.22528 22.0002 8.78198 22.0002H15.2184C15.7751 22.0002 16.2267 21.5515 16.2267 20.9973C16.2267 20.4442 15.7751 19.9955 15.2184 19.9955H14.1497C13.9625 19.9955 13.8116 19.8456 13.8116 19.6596V18.2764C13.8116 17.9009 14.1171 17.5962 14.495 17.5962H17.4343C17.7676 17.5962 18.0695 17.463 18.288 17.2459C18.5066 17.0275 18.6419 16.7276 18.6419 16.3965V11.5978C18.6419 10.9355 18.1009 10.3981 17.4343 10.3981Z"
|
|
8
|
+
/>
|
|
9
|
+
</svg>
|
|
10
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
d="M17.4 21C18.8912 21 20.1 19.7912 20.1 18.3C20.1 16.8088 18.8912 15.6 17.4 15.6C15.9088 15.6 14.7 16.8088 14.7 18.3C14.7 19.7912 15.9088 21 17.4 21Z"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
d="M6.59999 14.7C8.09116 14.7 9.29999 13.4912 9.29999 12C9.29999 10.5088 8.09116 9.3 6.59999 9.3C5.10883 9.3 3.89999 10.5088 3.89999 12C3.89999 13.4912 5.10883 14.7 6.59999 14.7Z"
|
|
18
|
+
/>
|
|
19
|
+
<path d="M8.931 13.359L15.078 16.941" />
|
|
20
|
+
<path
|
|
21
|
+
d="M17.4 8.4C18.8912 8.4 20.1 7.19117 20.1 5.7C20.1 4.20883 18.8912 3 17.4 3C15.9088 3 14.7 4.20883 14.7 5.7C14.7 7.19117 15.9088 8.4 17.4 8.4Z"
|
|
22
|
+
/>
|
|
23
|
+
<path d="M15.069 7.05901L8.931 10.641" />
|
|
24
|
+
</svg>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
|
|
3
|
+
import CpAirlineLogo from '@/components/atomic-elements/CpAirlineLogo.vue'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'CpAirlineLogo',
|
|
7
|
+
component: CpAirlineLogo,
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component:
|
|
12
|
+
'A component that displays airline logos using IATA codes. Fetches logos from Kiwi.com CDN and displays them with customizable sizes.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
iataCode: {
|
|
18
|
+
control: 'text',
|
|
19
|
+
description: 'The IATA airline code (e.g., "LH" for Lufthansa, "BA" for British Airways)',
|
|
20
|
+
table: {
|
|
21
|
+
type: { summary: 'string' },
|
|
22
|
+
defaultValue: { summary: '1L' },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
control: 'number',
|
|
27
|
+
description: 'The size of the logo in pixels',
|
|
28
|
+
table: {
|
|
29
|
+
type: { summary: 'number' },
|
|
30
|
+
defaultValue: { summary: '32' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
tags: ['autodocs'],
|
|
35
|
+
} satisfies Meta<typeof CpAirlineLogo>
|
|
36
|
+
|
|
37
|
+
export default meta
|
|
38
|
+
type Story = StoryObj<typeof meta>
|
|
39
|
+
|
|
40
|
+
const defaultTemplate = '<CpAirlineLogo v-bind="args" />'
|
|
41
|
+
const defaultRender = (args) => ({
|
|
42
|
+
components: { CpAirlineLogo },
|
|
43
|
+
setup() {
|
|
44
|
+
return { args }
|
|
45
|
+
},
|
|
46
|
+
template: defaultTemplate,
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
export const Default: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
iataCode: 'AF',
|
|
52
|
+
size: 32,
|
|
53
|
+
},
|
|
54
|
+
render: defaultRender,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const MultipleAirlines: Story = {
|
|
58
|
+
render: () => ({
|
|
59
|
+
components: { CpAirlineLogo },
|
|
60
|
+
template: `
|
|
61
|
+
<div style="display: flex; gap: 16px; align-items: center; flex-wrap: wrap;">
|
|
62
|
+
<CpAirlineLogo iataCode="1L" :size="32" />
|
|
63
|
+
<CpAirlineLogo iataCode="BA" :size="32" />
|
|
64
|
+
<CpAirlineLogo iataCode="EK" :size="32" />
|
|
65
|
+
<CpAirlineLogo iataCode="AA" :size="32" />
|
|
66
|
+
<CpAirlineLogo iataCode="AF" :size="32" />
|
|
67
|
+
<CpAirlineLogo iataCode="KL" :size="32" />
|
|
68
|
+
</div>
|
|
69
|
+
`,
|
|
70
|
+
}),
|
|
71
|
+
parameters: {
|
|
72
|
+
docs: {
|
|
73
|
+
description: {
|
|
74
|
+
story: 'Multiple airline logos displayed together.',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const EmptyIATACode: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
iataCode: '',
|
|
83
|
+
size: 32,
|
|
84
|
+
},
|
|
85
|
+
render: defaultRender,
|
|
86
|
+
parameters: {
|
|
87
|
+
docs: {
|
|
88
|
+
description: {
|
|
89
|
+
story: 'Shows the component with an empty IATA code.',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
|
|
3
|
+
import CpPartnerBadge from '@/components/atomic-elements/CpPartnerBadge.vue'
|
|
4
|
+
|
|
5
|
+
import { PartnerTypes, Sizes } from '@/utils/constants'
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'CpPartnerBadge',
|
|
9
|
+
component: CpPartnerBadge,
|
|
10
|
+
parameters: {
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
'A badge component that displays partner type icons with different background colors based on the partner type. Supports OTA, Airline, Supplier, and Third Party partner types.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
type: {
|
|
20
|
+
control: 'select',
|
|
21
|
+
options: Object.values(PartnerTypes),
|
|
22
|
+
description: 'The type of partner (determines icon and background color)',
|
|
23
|
+
table: {
|
|
24
|
+
type: { summary: 'string' },
|
|
25
|
+
defaultValue: { summary: 'ota' },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
control: 'select',
|
|
30
|
+
options: Object.values(Sizes),
|
|
31
|
+
description: 'The size of the badge',
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: 'string' },
|
|
34
|
+
defaultValue: { summary: 'md' },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
tags: ['autodocs'],
|
|
39
|
+
} satisfies Meta<typeof CpPartnerBadge>
|
|
40
|
+
|
|
41
|
+
export default meta
|
|
42
|
+
type Story = StoryObj<typeof meta>
|
|
43
|
+
|
|
44
|
+
const defaultTemplate = '<CpPartnerBadge v-bind="args" />'
|
|
45
|
+
const defaultRender = (args) => ({
|
|
46
|
+
components: { CpPartnerBadge },
|
|
47
|
+
setup() {
|
|
48
|
+
return { args }
|
|
49
|
+
},
|
|
50
|
+
template: defaultTemplate,
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
export const Default: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
type: PartnerTypes.OTA,
|
|
56
|
+
},
|
|
57
|
+
render: defaultRender,
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const OTA: Story = {
|
|
61
|
+
args: {
|
|
62
|
+
type: PartnerTypes.OTA,
|
|
63
|
+
},
|
|
64
|
+
render: defaultRender,
|
|
65
|
+
parameters: {
|
|
66
|
+
docs: {
|
|
67
|
+
description: {
|
|
68
|
+
story: 'Partner badge for Online Travel Agencies (OTA) with orange background and OTA icon.',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const Airline: Story = {
|
|
75
|
+
args: {
|
|
76
|
+
type: PartnerTypes.AIRLINE,
|
|
77
|
+
},
|
|
78
|
+
render: defaultRender,
|
|
79
|
+
parameters: {
|
|
80
|
+
docs: {
|
|
81
|
+
description: {
|
|
82
|
+
story: 'Partner badge for Airlines with blue background and airline icon.',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Supplier: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
type: PartnerTypes.SUPPLIER,
|
|
91
|
+
},
|
|
92
|
+
render: defaultRender,
|
|
93
|
+
parameters: {
|
|
94
|
+
docs: {
|
|
95
|
+
description: {
|
|
96
|
+
story: 'Partner badge for Suppliers with purple background and supplier icon.',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const ThirdParty: Story = {
|
|
103
|
+
args: {
|
|
104
|
+
type: PartnerTypes.THIRDPARTY,
|
|
105
|
+
},
|
|
106
|
+
render: defaultRender,
|
|
107
|
+
parameters: {
|
|
108
|
+
docs: {
|
|
109
|
+
description: {
|
|
110
|
+
story: 'Partner badge for Third Party partners with pink background and share icon.',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const AllTypes: Story = {
|
|
117
|
+
render: () => ({
|
|
118
|
+
components: { CpPartnerBadge },
|
|
119
|
+
setup() {
|
|
120
|
+
return { PartnerTypes }
|
|
121
|
+
},
|
|
122
|
+
template: `
|
|
123
|
+
<div style="display: flex; gap: 16px; align-items: center;">
|
|
124
|
+
<CpPartnerBadge :type="PartnerTypes.OTA" />
|
|
125
|
+
<CpPartnerBadge :type="PartnerTypes.AIRLINE" />
|
|
126
|
+
<CpPartnerBadge :type="PartnerTypes.SUPPLIER" />
|
|
127
|
+
<CpPartnerBadge :type="PartnerTypes.THIRDPARTY" />
|
|
128
|
+
</div>
|
|
129
|
+
`,
|
|
130
|
+
}),
|
|
131
|
+
parameters: {
|
|
132
|
+
docs: {
|
|
133
|
+
description: {
|
|
134
|
+
story: 'All partner badge types displayed together for comparison.',
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export const WithCustomIcon: Story = {
|
|
141
|
+
render: () => ({
|
|
142
|
+
components: { CpPartnerBadge },
|
|
143
|
+
setup() {
|
|
144
|
+
return { PartnerTypes }
|
|
145
|
+
},
|
|
146
|
+
template: `
|
|
147
|
+
<CpPartnerBadge :type="PartnerTypes.OTA">
|
|
148
|
+
<template #icon>
|
|
149
|
+
<cp-icon type="plus" />
|
|
150
|
+
</template>
|
|
151
|
+
</CpPartnerBadge>
|
|
152
|
+
`,
|
|
153
|
+
}),
|
|
154
|
+
parameters: {
|
|
155
|
+
docs: {
|
|
156
|
+
description: {
|
|
157
|
+
story: 'Partner badge with a custom icon using the icon slot.',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
}
|