@citizenplane/pimp 18.6.2 → 18.8.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/biome.json +178 -0
- package/dist/components/BaseInputLabel.vue.d.ts.map +1 -1
- package/dist/components/BaseSelectClearButton.vue.d.ts.map +1 -1
- package/dist/components/CpAccordion.vue.d.ts.map +1 -1
- package/dist/components/CpAlert.vue.d.ts.map +1 -1
- package/dist/components/CpBadge.vue.d.ts.map +1 -1
- package/dist/components/CpButton.vue.d.ts.map +1 -1
- package/dist/components/CpButtonToggle.vue.d.ts +1 -1
- package/dist/components/CpButtonToggle.vue.d.ts.map +1 -1
- package/dist/components/CpCalendar.vue.d.ts.map +1 -1
- package/dist/components/CpCheckbox.vue.d.ts.map +1 -1
- package/dist/components/CpContextualMenu.vue.d.ts.map +1 -1
- package/dist/components/CpDate.vue.d.ts.map +1 -1
- package/dist/components/CpDatepicker.vue.d.ts.map +1 -1
- package/dist/components/CpInput.vue.d.ts.map +1 -1
- package/dist/components/CpItemActions.vue.d.ts +2 -0
- package/dist/components/CpItemActions.vue.d.ts.map +1 -1
- package/dist/components/CpMenu.vue.d.ts.map +1 -1
- package/dist/components/CpMenuItem.vue.d.ts.map +1 -1
- package/dist/components/CpMultiselect.vue.d.ts.map +1 -1
- package/dist/components/CpRadio.vue.d.ts.map +1 -1
- package/dist/components/CpRadioGroup.vue.d.ts.map +1 -1
- package/dist/components/CpRadioNew.vue.d.ts.map +1 -1
- package/dist/components/CpSelect.vue.d.ts.map +1 -1
- package/dist/components/CpSelectMenu.vue.d.ts.map +1 -1
- package/dist/components/CpSelectableButton.vue.d.ts +1 -1
- package/dist/components/CpSelectableButton.vue.d.ts.map +1 -1
- package/dist/components/CpSwitch.vue.d.ts.map +1 -1
- package/dist/components/CpTable.vue.d.ts.map +1 -1
- package/dist/components/CpTelInput.vue.d.ts.map +1 -1
- package/dist/components/CpTooltip.vue.d.ts +2 -0
- package/dist/components/CpTooltip.vue.d.ts.map +1 -1
- package/dist/components/CpTrip.vue.d.ts +48 -0
- package/dist/components/CpTrip.vue.d.ts.map +1 -0
- package/dist/components/CpTripTimeline.vue.d.ts +24 -0
- package/dist/components/CpTripTimeline.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/composables/useDynamicSize.d.ts +9 -0
- package/dist/composables/useDynamicSize.d.ts.map +1 -0
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/layout/Breakpoints.d.ts +9 -0
- package/dist/constants/layout/Breakpoints.d.ts.map +1 -0
- package/dist/constants/layout/Sizes.d.ts +2 -0
- package/dist/constants/layout/Sizes.d.ts.map +1 -0
- package/dist/constants/layout/index.d.ts +3 -0
- package/dist/constants/layout/index.d.ts.map +1 -0
- package/dist/helpers/functions.d.ts +1 -0
- package/dist/helpers/functions.d.ts.map +1 -1
- package/dist/libs/CoreDatepicker.vue.d.ts.map +1 -1
- package/dist/pimp.es.js +6797 -6461
- package/dist/pimp.umd.js +54 -54
- package/dist/style.css +1 -1
- package/package.json +14 -24
- package/src/assets/css/base.css +17 -11
- package/src/assets/css/colors.css +12 -22
- package/src/assets/css/dimensions.css +4 -0
- package/src/assets/css/shadows.css +0 -3
- package/src/assets/css/tokens.css +21 -65
- package/src/assets/css/typography.css +0 -17
- package/src/assets/main.css +7 -7
- package/src/assets/styles/helpers/_functions.scss +2 -2
- package/src/assets/styles/utilities/_index.scss +2 -3
- package/src/components/BaseInputLabel.vue +7 -11
- package/src/components/BaseSelectClearButton.vue +6 -7
- package/src/components/CpAccordion.vue +27 -28
- package/src/components/CpAccordionGroup.vue +2 -2
- package/src/components/CpAlert.vue +12 -11
- package/src/components/CpBadge.vue +4 -19
- package/src/components/CpButton.vue +23 -25
- package/src/components/CpButtonGroup.vue +2 -2
- package/src/components/CpButtonToggle.vue +22 -22
- package/src/components/CpCalendar.vue +30 -26
- package/src/components/CpCheckbox.vue +29 -33
- package/src/components/CpContextualMenu.vue +1 -2
- package/src/components/CpDate.vue +72 -76
- package/src/components/CpDatepicker.vue +2 -3
- package/src/components/CpDialog.vue +8 -8
- package/src/components/CpHeading.vue +6 -6
- package/src/components/CpIcon.vue +2 -2
- package/src/components/CpInput.vue +46 -48
- package/src/components/CpItemActions.vue +17 -16
- package/src/components/CpMenu.vue +8 -9
- package/src/components/CpMenuItem.vue +7 -7
- package/src/components/CpMenuList.vue +3 -3
- package/src/components/CpMultiselect.vue +29 -30
- package/src/components/CpRadio.vue +53 -59
- package/src/components/CpRadioGroup.vue +11 -12
- package/src/components/CpRadioNew.vue +56 -58
- package/src/components/CpSelect.vue +42 -42
- package/src/components/CpSelectMenu.vue +32 -32
- package/src/components/CpSelectableButton.vue +50 -51
- package/src/components/CpSwitch.vue +43 -44
- package/src/components/CpTable.vue +69 -81
- package/src/components/CpTableColumnEditor.vue +16 -16
- package/src/components/CpTableEmptyState.vue +4 -4
- package/src/components/CpTableFooter.vue +2 -2
- package/src/components/CpTableFooterDesktop.vue +2 -2
- package/src/components/CpTableFooterDetails.vue +2 -2
- package/src/components/CpTableFooterMobile.vue +4 -4
- package/src/components/CpTabs.vue +1 -1
- package/src/components/CpTelInput.vue +31 -32
- package/src/components/CpTextarea.vue +13 -13
- package/src/components/CpToast.vue +25 -24
- package/src/components/CpTooltip.vue +15 -13
- package/src/components/CpTransitionCounter.vue +1 -1
- package/src/components/CpTransitionExpand.vue +5 -5
- package/src/components/CpTransitionSize.vue +1 -1
- package/src/components/CpTrip.vue +190 -0
- package/src/components/CpTripTimeline.vue +272 -0
- package/src/components/index.ts +36 -34
- package/src/composables/useDynamicSize.ts +60 -0
- package/src/constants/index.ts +2 -2
- package/src/constants/layout/Breakpoints.ts +8 -0
- package/src/constants/layout/Sizes.ts +1 -0
- package/src/constants/layout/index.ts +3 -0
- package/src/directives/ClickOutside.ts +1 -1
- package/src/directives/ResizeSelect.ts +1 -1
- package/src/helpers/functions.ts +1 -1
- package/src/helpers/index.ts +1 -1
- package/src/libs/CoreDatepicker.vue +115 -134
- package/src/stories/Colors.stories.ts +2 -1
- package/src/stories/CpAccordion.stories.ts +2 -2
- package/src/stories/CpAccordionGroup.stories.ts +1 -2
- package/src/stories/CpButtonToggle.stories.ts +1 -2
- package/src/stories/CpCheckbox.stories.ts +1 -2
- package/src/stories/CpContextualMenu.stories.ts +1 -2
- package/src/stories/CpDate.stories.ts +1 -2
- package/src/stories/CpDatepicker.stories.ts +1 -2
- package/src/stories/CpDialog.stories.ts +1 -2
- package/src/stories/CpInput.stories.ts +1 -2
- package/src/stories/CpItemActions.stories.ts +10 -5
- package/src/stories/CpMenu.stories.ts +1 -2
- package/src/stories/CpMenuItem.stories.ts +1 -2
- package/src/stories/CpMultiselect.stories.ts +1 -2
- package/src/stories/CpRadio.stories.ts +1 -2
- package/src/stories/CpRadioGroup.stories.ts +1 -2
- package/src/stories/CpSelect.stories.ts +1 -2
- package/src/stories/CpSelectMenu.stories.ts +1 -2
- package/src/stories/CpSwitch.stories.ts +1 -2
- package/src/stories/CpTable.stories.ts +2 -3
- package/src/stories/CpTabs.stories.ts +1 -2
- package/src/stories/CpText.stories.ts +2 -1
- package/src/stories/CpTextarea.stories.ts +1 -2
- package/src/stories/CpToast.stories.ts +2 -3
- package/src/stories/CpTransitionCounter.stories.ts +1 -2
- package/src/stories/CpTransitionExpand.stories.ts +1 -2
- package/src/stories/CpTransitionListItems.stories.ts +1 -2
- package/src/stories/CpTransitionSize.stories.ts +1 -2
- package/src/stories/CpTransitionSlide.stories.ts +1 -2
- package/src/stories/CpTransitionTabContent.stories.ts +1 -2
- package/src/stories/CpTrip.stories.ts +323 -0
- package/src/stories/Dimensions.stories.ts +1 -0
- package/src/stories/Shadows.stories.ts +1 -0
- package/src/stories/Typography.stories.ts +1 -0
- package/src/vendors/ff-polyfill.ts +1 -1
- package/vitest.workspace.js +1 -1
- package/src/components/Pimp.vue +0 -10
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ref } from 'vue'
|
|
2
|
-
|
|
3
1
|
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
4
2
|
import type { MenuItem } from 'primevue/menuitem'
|
|
3
|
+
import { ref } from 'vue'
|
|
5
4
|
|
|
6
5
|
import CpItemActions from '@/components/CpItemActions.vue'
|
|
7
6
|
|
|
@@ -13,6 +12,11 @@ const meta = {
|
|
|
13
12
|
control: 'object',
|
|
14
13
|
description: 'The actions to display',
|
|
15
14
|
},
|
|
15
|
+
iconPosition: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: ['horizontal', 'vertical'],
|
|
18
|
+
description: 'The position of the icon',
|
|
19
|
+
},
|
|
16
20
|
},
|
|
17
21
|
} satisfies Meta<typeof CpItemActions>
|
|
18
22
|
|
|
@@ -27,8 +31,9 @@ type Story = StoryObj<typeof meta>
|
|
|
27
31
|
export const Default: Story = {
|
|
28
32
|
args: {
|
|
29
33
|
actions: [],
|
|
34
|
+
iconPosition: 'horizontal',
|
|
30
35
|
},
|
|
31
|
-
render: () => ({
|
|
36
|
+
render: (args) => ({
|
|
32
37
|
components: { CpItemActions },
|
|
33
38
|
setup() {
|
|
34
39
|
const actions = ref<MenuItem[]>([
|
|
@@ -61,7 +66,7 @@ export const Default: Story = {
|
|
|
61
66
|
|
|
62
67
|
const parentClick = () => alert('Parent clicked')
|
|
63
68
|
|
|
64
|
-
return { actions, listItemStyle, listItems, parentClick }
|
|
69
|
+
return { actions, listItemStyle, listItems, parentClick, args }
|
|
65
70
|
},
|
|
66
71
|
template: `
|
|
67
72
|
<div style="padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 400px;">
|
|
@@ -74,7 +79,7 @@ export const Default: Story = {
|
|
|
74
79
|
@click="parentClick"
|
|
75
80
|
>
|
|
76
81
|
<p>Item {{ index + 1 }}</p>
|
|
77
|
-
<CpItemActions size="xs" :actions="actions" />
|
|
82
|
+
<CpItemActions size="xs" :actions="actions" :icon-position="args.iconPosition" />
|
|
78
83
|
</li>
|
|
79
84
|
</ul>
|
|
80
85
|
</div>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { action } from 'storybook/actions'
|
|
2
|
-
import { ref, computed } from 'vue'
|
|
3
|
-
|
|
4
1
|
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
2
|
+
import { action } from 'storybook/actions'
|
|
3
|
+
import { computed, ref } from 'vue'
|
|
5
4
|
|
|
6
5
|
import CpTable from '@/components/CpTable.vue'
|
|
7
6
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import type { Args, Meta, StoryObj } from '@storybook/vue3-vite'
|
|
1
2
|
import { action } from 'storybook/actions'
|
|
2
3
|
import { ref } from 'vue'
|
|
3
4
|
|
|
4
|
-
import type { Args, Meta, StoryObj } from '@storybook/vue3-vite'
|
|
5
|
-
|
|
6
5
|
import CpTabs from '@/components/CpTabs.vue'
|
|
7
6
|
|
|
8
7
|
const meta = {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Args, Meta, StoryObj } from '@storybook/vue3-vite'
|
|
2
2
|
|
|
3
|
-
import CpText from '@/components/CpText.vue'
|
|
4
3
|
import type { CpTextSize, CpTextWeight } from '@/components/CpText.vue'
|
|
5
4
|
|
|
5
|
+
import CpText from '@/components/CpText.vue'
|
|
6
|
+
|
|
6
7
|
import { docLabelStyle } from '@/stories/documentationStyles'
|
|
7
8
|
|
|
8
9
|
const textSizes = [
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
1
2
|
import { useToast } from 'primevue/usetoast'
|
|
2
3
|
import { ref } from 'vue'
|
|
3
4
|
|
|
4
|
-
import
|
|
5
|
+
import CpToast from '@/components/CpToast.vue'
|
|
5
6
|
|
|
6
7
|
import { CpToastTypes } from '@/constants/CpToastTypes'
|
|
7
8
|
|
|
8
|
-
import CpToast from '@/components/CpToast.vue'
|
|
9
|
-
|
|
10
9
|
type CpToastPosition =
|
|
11
10
|
| 'bottom-center'
|
|
12
11
|
| 'bottom-left'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ref } from 'vue'
|
|
2
|
-
|
|
3
1
|
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
4
2
|
import type { MenuItem } from 'primevue/menuitem'
|
|
3
|
+
import { ref } from 'vue'
|
|
5
4
|
|
|
6
5
|
import CpButton from '@/components/CpButton.vue'
|
|
7
6
|
import CpIcon from '@/components/CpIcon.vue'
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import type { Args, Meta, StoryObj } from '@storybook/vue3-vite'
|
|
2
|
+
|
|
3
|
+
import CpTrip from '@/components/CpTrip.vue'
|
|
4
|
+
|
|
5
|
+
const directTrip = {
|
|
6
|
+
arrivalDate: {
|
|
7
|
+
formatted: 'Tue, 10 Jun 2026',
|
|
8
|
+
raw: '2026-06-10',
|
|
9
|
+
},
|
|
10
|
+
arrivalTime: '11:40',
|
|
11
|
+
labels: {
|
|
12
|
+
nonStop: 'Direct',
|
|
13
|
+
},
|
|
14
|
+
dayCountAfterDeparture: 0,
|
|
15
|
+
departureDate: {
|
|
16
|
+
formatted: 'Tue, 10 Jun 2026',
|
|
17
|
+
raw: '2026-06-10',
|
|
18
|
+
},
|
|
19
|
+
departureTime: '09:00',
|
|
20
|
+
destination: {
|
|
21
|
+
iataCode: 'JFK',
|
|
22
|
+
name: 'John F. Kennedy International Airport',
|
|
23
|
+
},
|
|
24
|
+
flightDuration: {
|
|
25
|
+
formatted: '8h 40m',
|
|
26
|
+
raw: 'PT8H40M',
|
|
27
|
+
},
|
|
28
|
+
airlines: [
|
|
29
|
+
{
|
|
30
|
+
iataCode: 'AF',
|
|
31
|
+
name: 'Air France',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
origin: {
|
|
35
|
+
iataCode: 'CDG',
|
|
36
|
+
name: 'Paris Charles de Gaulle Airport',
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const sampleTrip = {
|
|
41
|
+
arrivalDate: {
|
|
42
|
+
formatted: 'Wed, 11 Jun 2026',
|
|
43
|
+
raw: '2026-06-11',
|
|
44
|
+
},
|
|
45
|
+
arrivalTime: '14:25',
|
|
46
|
+
dayCountAfterDeparture: 1,
|
|
47
|
+
departureDate: {
|
|
48
|
+
formatted: 'Tue, 10 Jun 2026',
|
|
49
|
+
raw: '2026-06-10',
|
|
50
|
+
},
|
|
51
|
+
labels: {
|
|
52
|
+
stopCount: '1 stop',
|
|
53
|
+
layover: 'layover',
|
|
54
|
+
transfer: 'airport change',
|
|
55
|
+
},
|
|
56
|
+
hasSelfTransfer: true,
|
|
57
|
+
stops: [
|
|
58
|
+
{
|
|
59
|
+
duration: '2h 10m',
|
|
60
|
+
iata: 'MUC',
|
|
61
|
+
name: 'Munich',
|
|
62
|
+
selfTransferLabel: 'Self-transfer from Franz Josef Strauss (MUC) to Augsburg - Muehlhausen (AGB)',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
departureTime: '08:15',
|
|
66
|
+
destination: {
|
|
67
|
+
iataCode: 'JFK',
|
|
68
|
+
name: 'John F. Kennedy International Airport',
|
|
69
|
+
},
|
|
70
|
+
flightDuration: {
|
|
71
|
+
formatted: '12h 35m',
|
|
72
|
+
raw: 'PT12H35M',
|
|
73
|
+
},
|
|
74
|
+
airlines: [
|
|
75
|
+
{
|
|
76
|
+
iataCode: 'AF',
|
|
77
|
+
name: 'Air France',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
iataCode: 'KL',
|
|
81
|
+
name: 'KLM',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
origin: {
|
|
85
|
+
iataCode: 'CDG',
|
|
86
|
+
name: 'Paris Charles de Gaulle Airport',
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const oneStopTrip = {
|
|
91
|
+
arrivalDate: {
|
|
92
|
+
formatted: 'Tue, 10 Jun 2026',
|
|
93
|
+
raw: '2026-06-10',
|
|
94
|
+
},
|
|
95
|
+
arrivalTime: '11:40',
|
|
96
|
+
labels: {
|
|
97
|
+
stopCount: '1 stop',
|
|
98
|
+
layover: 'layover',
|
|
99
|
+
},
|
|
100
|
+
dayCountAfterDeparture: 0,
|
|
101
|
+
departureDate: {
|
|
102
|
+
formatted: 'Tue, 10 Jun 2026',
|
|
103
|
+
raw: '2026-06-10',
|
|
104
|
+
},
|
|
105
|
+
departureTime: '09:00',
|
|
106
|
+
destination: {
|
|
107
|
+
iataCode: 'JFK',
|
|
108
|
+
name: 'John F. Kennedy International Airport',
|
|
109
|
+
},
|
|
110
|
+
flightDuration: {
|
|
111
|
+
formatted: '8h 40m',
|
|
112
|
+
raw: 'PT8H40M',
|
|
113
|
+
},
|
|
114
|
+
airlines: [
|
|
115
|
+
{
|
|
116
|
+
iataCode: 'AF',
|
|
117
|
+
name: 'Air France',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
stops: [
|
|
121
|
+
{
|
|
122
|
+
duration: '4h 35m',
|
|
123
|
+
iata: 'AMS',
|
|
124
|
+
name: 'Amsterdam',
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
origin: {
|
|
128
|
+
iataCode: 'CDG',
|
|
129
|
+
name: 'Paris Charles de Gaulle Airport',
|
|
130
|
+
},
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const twoStopTrip = {
|
|
134
|
+
arrivalDate: {
|
|
135
|
+
formatted: 'Thu, 12 Jun 2026',
|
|
136
|
+
raw: '2026-06-12',
|
|
137
|
+
},
|
|
138
|
+
labels: {
|
|
139
|
+
stopCount: '2 stops',
|
|
140
|
+
layover: 'layover',
|
|
141
|
+
transfer: 'airport change',
|
|
142
|
+
},
|
|
143
|
+
arrivalTime: '18:50',
|
|
144
|
+
dayCountAfterDeparture: 2,
|
|
145
|
+
departureDate: {
|
|
146
|
+
formatted: 'Tue, 10 Jun 2026',
|
|
147
|
+
raw: '2026-06-10',
|
|
148
|
+
},
|
|
149
|
+
departureTime: '06:30',
|
|
150
|
+
destination: {
|
|
151
|
+
iataCode: 'LAX',
|
|
152
|
+
name: 'Los Angeles International Airport',
|
|
153
|
+
},
|
|
154
|
+
flightDuration: {
|
|
155
|
+
formatted: '22h 20m',
|
|
156
|
+
raw: 'PT22H20M',
|
|
157
|
+
},
|
|
158
|
+
hasSelfTransfer: true,
|
|
159
|
+
origin: {
|
|
160
|
+
iataCode: 'CDG',
|
|
161
|
+
name: 'Paris Charles de Gaulle Airport',
|
|
162
|
+
},
|
|
163
|
+
stops: [
|
|
164
|
+
{
|
|
165
|
+
duration: '4h 35m',
|
|
166
|
+
iata: 'AMS',
|
|
167
|
+
name: 'Amsterdam',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
duration: '2h 10m',
|
|
171
|
+
iata: 'MUC',
|
|
172
|
+
name: 'Munich',
|
|
173
|
+
selfTransferLabel: 'Self-transfer from Franz Josef Strauss (MUC) to Augsburg - Muehlhausen (AGB)',
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
airlines: [
|
|
177
|
+
{
|
|
178
|
+
iataCode: 'AF',
|
|
179
|
+
name: 'Air France',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
iataCode: 'KL',
|
|
183
|
+
name: 'KLM',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
iataCode: 'DL',
|
|
187
|
+
name: 'Delta Airlines',
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const fourStopTrip = {
|
|
193
|
+
...twoStopTrip,
|
|
194
|
+
labels: {
|
|
195
|
+
...twoStopTrip.labels,
|
|
196
|
+
stopCount: '4 stops',
|
|
197
|
+
},
|
|
198
|
+
stops: [
|
|
199
|
+
...twoStopTrip.stops,
|
|
200
|
+
{
|
|
201
|
+
duration: '4h 35m',
|
|
202
|
+
iata: 'AMS',
|
|
203
|
+
name: 'Amsterdam',
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
duration: '4h 35m',
|
|
207
|
+
iata: 'AMS',
|
|
208
|
+
name: 'Amsterdam',
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
airlines: [
|
|
212
|
+
...twoStopTrip.airlines,
|
|
213
|
+
{
|
|
214
|
+
iataCode: '1L',
|
|
215
|
+
name: 'CitizenPlane',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
iataCode: 'UA',
|
|
219
|
+
name: 'United Airlines',
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const meta = {
|
|
225
|
+
title: 'Business/CpTrip',
|
|
226
|
+
component: CpTrip,
|
|
227
|
+
argTypes: {
|
|
228
|
+
trip: {
|
|
229
|
+
control: 'object',
|
|
230
|
+
description: 'Flight trip data displayed in the row',
|
|
231
|
+
},
|
|
232
|
+
hideAirlines: {
|
|
233
|
+
control: 'boolean',
|
|
234
|
+
description: 'Hides airline logos in the timeline',
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
} satisfies Meta<typeof CpTrip>
|
|
238
|
+
|
|
239
|
+
export default meta
|
|
240
|
+
|
|
241
|
+
type Story = StoryObj<typeof meta>
|
|
242
|
+
|
|
243
|
+
const defaultRender = (args: Args) => ({
|
|
244
|
+
components: { CpTrip },
|
|
245
|
+
setup() {
|
|
246
|
+
return { args }
|
|
247
|
+
},
|
|
248
|
+
template: `
|
|
249
|
+
<div>
|
|
250
|
+
<CpTrip v-bind="args">
|
|
251
|
+
<template #header-trailing><CpBadge size="sm">Test</CpBadge></template>
|
|
252
|
+
<template #link><a href="#">Flight details</a></template>
|
|
253
|
+
</CpTrip>
|
|
254
|
+
</div>
|
|
255
|
+
`,
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Default trip row with all route fields populated. Use the controls to
|
|
260
|
+
* experiment with each prop in isolation.
|
|
261
|
+
*/
|
|
262
|
+
export const Default: Story = {
|
|
263
|
+
args: {
|
|
264
|
+
trip: sampleTrip,
|
|
265
|
+
},
|
|
266
|
+
render: defaultRender,
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Direct flight with no stops. The timeline shows "Direct" and a single
|
|
271
|
+
* flight number in the footer.
|
|
272
|
+
*/
|
|
273
|
+
export const DirectFlight: Story = {
|
|
274
|
+
args: {
|
|
275
|
+
trip: directTrip,
|
|
276
|
+
},
|
|
277
|
+
render: defaultRender,
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* One-stop itinerary with a single layover. The timeline shows "1 stop" with
|
|
282
|
+
* the stop IATA and a single flight number in the footer.
|
|
283
|
+
*/
|
|
284
|
+
export const OneStop: Story = {
|
|
285
|
+
args: {
|
|
286
|
+
trip: oneStopTrip,
|
|
287
|
+
},
|
|
288
|
+
render: defaultRender,
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Multi-stop itinerary with two layovers. The timeline shows "2 stop" with
|
|
293
|
+
* both stop IATAs and three flight numbers in the footer.
|
|
294
|
+
*/
|
|
295
|
+
export const TwoStops: Story = {
|
|
296
|
+
args: {
|
|
297
|
+
trip: twoStopTrip,
|
|
298
|
+
},
|
|
299
|
+
render: defaultRender,
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Multi-stop itinerary with four layovers. The timeline shows "4 stops" with
|
|
304
|
+
* all stop IATAs and flight numbers in the footer.
|
|
305
|
+
*/
|
|
306
|
+
export const FourStops: Story = {
|
|
307
|
+
args: {
|
|
308
|
+
trip: fourStopTrip,
|
|
309
|
+
},
|
|
310
|
+
render: defaultRender,
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Trip row with airline logos hidden in the timeline. Useful when airline
|
|
315
|
+
* branding is shown elsewhere on the page.
|
|
316
|
+
*/
|
|
317
|
+
export const HideAirlines: Story = {
|
|
318
|
+
args: {
|
|
319
|
+
trip: twoStopTrip,
|
|
320
|
+
hideAirlines: true,
|
|
321
|
+
},
|
|
322
|
+
render: defaultRender,
|
|
323
|
+
}
|
|
@@ -30,7 +30,7 @@ export default function ffPolyfill(): void {
|
|
|
30
30
|
d.removeEventListener('focusin', removePolyfill as EventListener, true)
|
|
31
31
|
d.removeEventListener('focusout', removePolyfill as EventListener, true)
|
|
32
32
|
}
|
|
33
|
-
setTimeout(
|
|
33
|
+
setTimeout(() => {
|
|
34
34
|
d.removeEventListener('focusin', removePolyfill as EventListener, true)
|
|
35
35
|
d.removeEventListener('focusout', removePolyfill as EventListener, true)
|
|
36
36
|
})
|
package/vitest.workspace.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin'
|
|
2
1
|
import path from 'node:path'
|
|
3
2
|
import { fileURLToPath } from 'node:url'
|
|
3
|
+
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin'
|
|
4
4
|
import { defineWorkspace } from 'vitest/config'
|
|
5
5
|
|
|
6
6
|
const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url))
|
package/src/components/Pimp.vue
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg fill="none" height="88" viewBox="0 0 88 88" width="88" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
-
<path
|
|
4
|
-
clip-rule="evenodd"
|
|
5
|
-
d="M23.3155 1.33384C11.7696 2.66096 2.66096 11.7696 1.33384 23.3155L0.981172 26.3838C-0.327057 37.7654 -0.327057 49.2594 0.981172 60.641L1.33384 63.7092C2.36493 72.6797 8.09325 80.179 16.0124 83.7006L16.0124 43.6567C16.0238 28.586 28.2869 16.328 43.3608 16.328C58.4408 16.328 70.7092 28.5963 70.7092 43.6764C70.7092 54.5957 64.276 64.0389 55.0001 68.4197L55.0094 68.3815L54.5074 68.6469C51.1007 70.1736 47.3284 71.0238 43.3608 71.0238C43.3406 71.0238 43.3205 71.0235 43.3004 71.0232C43.2802 71.023 43.2601 71.0227 43.2399 71.0227L38.9718 71.0217L38.9955 66.3765L43.2399 66.3455C43.2601 66.3455 43.2802 66.3458 43.3004 66.346C43.3205 66.3463 43.3406 66.3465 43.3608 66.3465C55.8616 66.3465 66.032 56.1761 66.032 43.6764C66.032 31.1756 55.8616 21.0052 43.3608 21.0052C30.8662 21.0052 20.701 31.1653 20.6906 43.6567V85.2476C21.5495 85.44 22.4253 85.5886 23.3155 85.6909L26.3838 86.0436C27.6029 86.1837 28.8234 86.3088 30.0449 86.4189V43.6575H30.0428C30.0532 36.3225 36.0236 30.3583 43.3607 30.3583C50.7039 30.3583 56.6785 36.3329 56.6785 43.6771C56.6785 51.0204 50.7039 56.995 43.3607 56.995C43.3528 56.995 43.3449 56.9947 43.3371 56.9944C43.3297 56.9942 43.3223 56.9939 43.3152 56.9939H38.9995V52.3167L43.3152 52.3157C43.3223 52.3157 43.3297 52.3162 43.3372 52.3167C43.3399 52.3169 43.3427 52.3171 43.3455 52.3172C43.3505 52.3175 43.3556 52.3178 43.3607 52.3178C48.1246 52.3178 52.0013 48.4411 52.0013 43.6771C52.0013 38.9121 48.1246 35.0355 43.3607 35.0355C38.6029 35.0355 34.7314 38.9018 34.72 43.6575H34.7221V86.767C43.3612 87.2741 52.0332 87.033 60.641 86.0436L63.7092 85.6909C75.2551 84.3638 84.3638 75.2551 85.6909 63.7092L86.0436 60.641C87.3518 49.2594 87.3518 37.7654 86.0436 26.3838L85.6909 23.3155C84.3638 11.7696 75.2551 2.66096 63.7092 1.33384L60.641 0.981172C49.2594 -0.327057 37.7654 -0.327057 26.3838 0.981172L23.3155 1.33384Z"
|
|
6
|
-
fill="#3E3E5B"
|
|
7
|
-
fill-rule="evenodd"
|
|
8
|
-
/>
|
|
9
|
-
</svg>
|
|
10
|
-
</template>
|