@citizenplane/pimp 8.14.1 → 8.15.1

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,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
+ }
@@ -1 +1,3 @@
1
1
  export { default as Intent } from './src/Intent'
2
+ export { default as Sizes } from './src/Sizes'
3
+ export { default as PartnerTypes } from './src/PartnerTypes'
@@ -0,0 +1,6 @@
1
+ export default {
2
+ OTA: 'ota',
3
+ AIRLINE: 'airline',
4
+ SUPPLIER: 'supplier',
5
+ THIRDPARTY: 'thirdParty',
6
+ }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ XS: 'xs',
3
+ SM: 'sm',
4
+ MD: 'md',
5
+ }