@citizenplane/pimp 8.26.1 → 8.28.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.
Files changed (187) hide show
  1. package/dist/{IconAccompaniedMinorEach-CUq3oXbX.js → IconAccompaniedMinorEach-MkIJAypb.js} +1 -1
  2. package/dist/{IconAccompaniedMinorNone-nZ4eSfTj.js → IconAccompaniedMinorNone-DMb-bSCG.js} +1 -1
  3. package/dist/{IconAccompaniedMinorOne-CDMqq14b.js → IconAccompaniedMinorOne-C9ORHm66.js} +1 -1
  4. package/dist/{IconAddReceipt-DRpGiWBU.js → IconAddReceipt-CeJlKuX2.js} +1 -1
  5. package/dist/{IconAirportTerminal-8k-3lKjb.js → IconAirportTerminal-D3p4CRpN.js} +1 -1
  6. package/dist/{IconArrival-m6HnOVje.js → IconArrival-C3oPAqgQ.js} +1 -1
  7. package/dist/IconBaggageCabinNone-valcCKfd.js +22 -0
  8. package/dist/IconBaggageCheckedNone-oq4yx5cO.js +22 -0
  9. package/dist/IconBaggagePersonalNone-BovIoK0M.js +20 -0
  10. package/dist/{IconBroadcast-B13UworG.js → IconBroadcast-CqdgVQaO.js} +1 -1
  11. package/dist/{IconCabinBag-CNnzHz2B.js → IconCabinBag-CMrtn-s6.js} +1 -1
  12. package/dist/IconCalendar-DmUZ-Du1.js +30 -0
  13. package/dist/IconCalendarDelay-DHaiharm.js +22 -0
  14. package/dist/{IconCheckedBaggage-CkxUDHe9.js → IconCheckedBaggage-OeOjHxe7.js} +1 -1
  15. package/dist/{IconCheckedBaggage20-DEtphLSa.js → IconCheckedBaggage20-CXeWuJgc.js} +1 -1
  16. package/dist/{IconCheckedBaggage30-CmAddx5h.js → IconCheckedBaggage30-Cartaaei.js} +1 -1
  17. package/dist/{IconChild-OReHyUco.js → IconChild-ChjkS7Gd.js} +1 -1
  18. package/dist/{IconContact-D2N23RZ5.js → IconContact-CtOxYQIs.js} +1 -1
  19. package/dist/{IconDeparture-D10LaXRX.js → IconDeparture-DJxClL94.js} +1 -1
  20. package/dist/{IconDistribution-SpPiru9I.js → IconDistribution-BmCLzb9p.js} +1 -1
  21. package/dist/{IconDistributionClosed-Bzqe7nju.js → IconDistributionClosed-BMjqoyt9.js} +1 -1
  22. package/dist/{IconDistributionExclusivePair-CjPM-_R1.js → IconDistributionExclusivePair-D71kgwyk.js} +1 -1
  23. package/dist/{IconDistributionSided-DehjCN0D.js → IconDistributionSided-Du56cPXR.js} +1 -1
  24. package/dist/{IconDistributionSupplySided-DWCyXqd1.js → IconDistributionSupplySided-BY9ACIGQ.js} +1 -1
  25. package/dist/{IconDynamicContent-BvzbgXvW.js → IconDynamicContent-DoYbB86x.js} +1 -1
  26. package/dist/IconEndDate-CVABdl-P.js +22 -0
  27. package/dist/{IconFares-zARDpPNl.js → IconFares-BXnx8WJa.js} +1 -1
  28. package/dist/{IconFaresOutlined-DLFV8nwg.js → IconFaresOutlined-CjJhZUKX.js} +1 -1
  29. package/dist/{IconFemale-Ba4uoI-S.js → IconFemale-D4lMoNKt.js} +1 -1
  30. package/dist/{IconFindConversation-d0pP3wG9.js → IconFindConversation-CYdB5hW8.js} +1 -1
  31. package/dist/{IconFire-CXzWKoMB.js → IconFire-Bh3vQ1A3.js} +1 -1
  32. package/dist/{IconFlight-Cof8M5dO.js → IconFlight-RyDIRwoI.js} +1 -1
  33. package/dist/{IconFlightReturn-CA9iGMcW.js → IconFlightReturn-DN7K5zxX.js} +1 -1
  34. package/dist/IconFlightSchedule-DAX_cnvF.js +28 -0
  35. package/dist/{IconHandHeart-CCLKnMOm.js → IconHandHeart-C5jxr29k.js} +1 -1
  36. package/dist/{IconHistory-DI6WD_3J.js → IconHistory-CuJwcjfY.js} +1 -1
  37. package/dist/{IconHourGlass-BorNLEca.js → IconHourGlass-DyrZPbXz.js} +1 -1
  38. package/dist/{IconIdCard-DhbhBkul.js → IconIdCard-lBDLYRPq.js} +1 -1
  39. package/dist/{IconInfant-D4EztT9g.js → IconInfant-E19ozPuk.js} +1 -1
  40. package/dist/{IconItinerary-Bhj_lgG2.js → IconItinerary-5AEG0f9f.js} +1 -1
  41. package/dist/{IconLeave-BvpY7gdD.js → IconLeave-XuFJRd-0.js} +1 -1
  42. package/dist/{IconMale-RMd_9ZSg.js → IconMale-R2ZgQj0s.js} +1 -1
  43. package/dist/{IconMultiSegments-DROUj0t5.js → IconMultiSegments-DfiqdUEm.js} +1 -1
  44. package/dist/IconNoPassport-h-6DjTcc.js +22 -0
  45. package/dist/{IconNoRefund-yNAZr7uX.js → IconNoRefund-C5R_Zxke.js} +1 -1
  46. package/dist/IconNoSeat-C-XnWQk8.js +23 -0
  47. package/dist/{IconNotion-CpZhGILz.js → IconNotion-pdx45QBU.js} +1 -1
  48. package/dist/{IconOffline-Bf1mw_1N.js → IconOffline-EG6mJ-Fs.js} +1 -1
  49. package/dist/{IconOneWay-6oGoLo57.js → IconOneWay-CX6CckSB.js} +2 -2
  50. package/dist/{IconPaid-B3dvioAR.js → IconPaid-BJhBGPy9.js} +1 -1
  51. package/dist/IconPassport-C6THdLYf.js +37 -0
  52. package/dist/{IconPayout-b3TcXwjA.js → IconPayout-MS-qRRR0.js} +1 -1
  53. package/dist/IconPlug-yYpQdJgj.js +22 -0
  54. package/dist/IconPlugOff-DSGcBog-.js +23 -0
  55. package/dist/{IconReceipt-Dh454941.js → IconReceipt-ChU6nBry.js} +1 -1
  56. package/dist/IconRecurrence-DtwCmoXo.js +22 -0
  57. package/dist/{IconRefund-D-FNjukU.js → IconRefund-D1wQXsZj.js} +1 -1
  58. package/dist/{IconRoundTrip-BqVPrNwg.js → IconRoundTrip-DhPU15r6.js} +1 -1
  59. package/dist/{IconRouteNoStop-CZ_QeOIY.js → IconRouteNoStop-C5b0NI9V.js} +1 -1
  60. package/dist/{IconRouteOneStop-DGpLAQmQ.js → IconRouteOneStop-CDL4AJoN.js} +1 -1
  61. package/dist/IconScheduleChange-CasvbB9p.js +22 -0
  62. package/dist/{IconSeatEmpty-BwyVwYQZ.js → IconSeatEmpty-CUDMQzqk.js} +1 -1
  63. package/dist/{IconSeatSold-B_SNoTs-.js → IconSeatSold-mwtkmlhT.js} +1 -1
  64. package/dist/{IconSeatTotal-DUEF7k6I.js → IconSeatTotal-BPegCOjA.js} +1 -1
  65. package/dist/IconStartDate-DoPJpEly.js +22 -0
  66. package/dist/{IconTemplate-D1ACYaHI.js → IconTemplate-CQH8r3U7.js} +1 -1
  67. package/dist/{IconTicket-5Z4b83BP.js → IconTicket-mONYGHBg.js} +1 -1
  68. package/dist/{IconTimer-DbcddAPo.js → IconTimer-BxR1ymxu.js} +1 -1
  69. package/dist/{IconTrafficControl-CEzhRpZt.js → IconTrafficControl-AcQHu-Dm.js} +1 -1
  70. package/dist/{index-DbgX3-2I.js → index-CjeXy6n3.js} +17600 -18506
  71. package/dist/pimp.es.js +1 -1
  72. package/dist/pimp.umd.js +23 -23
  73. package/dist/style.css +1 -1
  74. package/package.json +2 -1
  75. package/src/components/{core/BaseInputLabel.vue → BaseInputLabel.vue} +9 -15
  76. package/src/components/{core/BaseSelectClearButton.vue → BaseSelectClearButton.vue} +2 -2
  77. package/src/components/{atomic-elements/CpAirlineLogo.vue → CpAirlineLogo.vue} +9 -10
  78. package/src/components/{feedback-indicators/CpAlert.vue → CpAlert.vue} +16 -27
  79. package/src/components/{atomic-elements/CpBadge.vue → CpBadge.vue} +27 -44
  80. package/src/components/{buttons/CpButton.vue → CpButton.vue} +63 -104
  81. package/src/components/{date-pickers/CpCalendar.vue → CpCalendar.vue} +157 -156
  82. package/src/components/{toggles/CpCheckbox.vue → CpCheckbox.vue} +45 -54
  83. package/src/components/{date-pickers/CpDate.vue → CpDate.vue} +202 -212
  84. package/src/components/CpDatepicker.vue +203 -0
  85. package/src/components/{atomic-elements/CpDialog.vue → CpDialog.vue} +14 -9
  86. package/src/components/{typography/CpHeading.vue → CpHeading.vue} +11 -31
  87. package/src/components/{visual/CpIcon.vue → CpIcon.vue} +2 -1
  88. package/src/components/{inputs/CpInput.vue → CpInput.vue} +41 -58
  89. package/src/components/{feedback-indicators/CpLoader.vue → CpLoader.vue} +7 -8
  90. package/src/components/{selects/CpMultiselect.vue → CpMultiselect.vue} +60 -91
  91. package/src/components/{atomic-elements/CpPartnerBadge.vue → CpPartnerBadge.vue} +12 -20
  92. package/src/components/{toggles/CpRadio.vue → CpRadio.vue} +47 -58
  93. package/src/components/{selects/CpSelect.vue → CpSelect.vue} +74 -94
  94. package/src/components/{selects/CpSelectMenu.vue → CpSelectMenu.vue} +94 -96
  95. package/src/components/{toggles/CpSwitch.vue → CpSwitch.vue} +51 -67
  96. package/src/components/{lists-and-table/CpTable.vue → CpTable.vue} +159 -113
  97. package/src/components/{lists-and-table/CpTableEmptyState.vue → CpTableEmptyState.vue} +5 -8
  98. package/src/components/{inputs/CpTextarea.vue → CpTextarea.vue} +32 -52
  99. package/src/components/CpToaster.vue +377 -0
  100. package/src/components/{atomic-elements/CpTooltip.vue → CpTooltip.vue} +12 -11
  101. package/src/components/TransitionExpand.vue +70 -0
  102. package/src/components/icons/IconBaggageCabinNone.vue +24 -0
  103. package/src/components/icons/IconBaggageCheckedNone.vue +25 -0
  104. package/src/components/icons/IconBaggagePersonalNone.vue +33 -0
  105. package/src/components/icons/IconCalendar.vue +17 -0
  106. package/src/components/icons/IconCalendarDelay.vue +21 -0
  107. package/src/components/icons/IconEndDate.vue +19 -0
  108. package/src/components/icons/IconFlightSchedule.vue +23 -0
  109. package/src/components/icons/IconNoPassport.vue +23 -24
  110. package/src/components/icons/IconNoSeat.vue +18 -0
  111. package/src/components/icons/IconOneWay.vue +1 -1
  112. package/src/components/icons/IconPassport.vue +15 -22
  113. package/src/components/icons/IconPlug.vue +17 -0
  114. package/src/components/icons/IconPlugOff.vue +18 -0
  115. package/src/components/icons/IconRecurrence.vue +17 -8
  116. package/src/components/icons/IconScheduleChange.vue +17 -26
  117. package/src/components/icons/IconStartDate.vue +19 -0
  118. package/src/components/index.ts +43 -55
  119. package/src/constants/{src/CpCustomIcons.ts → CpCustomIcons.ts} +13 -2
  120. package/src/constants/CpTableConfig.ts +12 -0
  121. package/src/constants/Heading.ts +8 -0
  122. package/src/{utils/constants/src/Intent.js → constants/Intent.ts} +1 -1
  123. package/src/constants/PartnerTypes.ts +6 -0
  124. package/src/constants/Position.ts +10 -0
  125. package/src/constants/Sizes.ts +5 -0
  126. package/src/constants/colors/Colors.ts +10 -0
  127. package/src/constants/colors/ToggleColors.ts +6 -0
  128. package/src/constants/index.ts +10 -5
  129. package/src/directives/ClickOutside.ts +17 -0
  130. package/src/directives/{ResizeSelect.js → ResizeSelect.ts} +3 -3
  131. package/src/helpers/{dom.js → dom.ts} +13 -9
  132. package/src/helpers/{index.js → index.ts} +13 -3
  133. package/src/helpers/object.ts +9 -0
  134. package/src/helpers/string/src/camelize.ts +6 -0
  135. package/src/helpers/string/src/{decamelize.js → decamelize.ts} +1 -1
  136. package/src/libs/CoreDatepicker.vue +4 -4
  137. package/src/plugins/toaster.ts +71 -0
  138. package/src/stories/BaseInputLabel.stories.ts +2 -1
  139. package/src/stories/CpAirlineLogo.stories.ts +1 -1
  140. package/src/stories/CpAlert.stories.ts +2 -1
  141. package/src/stories/CpBadge.stories.ts +1 -1
  142. package/src/stories/CpButton.stories.ts +1 -1
  143. package/src/stories/CpCheckbox.stories.ts +4 -2
  144. package/src/stories/CpDate.stories.ts +4 -2
  145. package/src/stories/CpDatepicker.stories.ts +4 -2
  146. package/src/stories/CpDialog.stories.ts +3 -2
  147. package/src/stories/CpHeading.stories.ts +2 -1
  148. package/src/stories/CpIcon.stories.ts +3 -1
  149. package/src/stories/CpInput.stories.ts +4 -2
  150. package/src/stories/CpLoader.stories.ts +2 -1
  151. package/src/stories/CpMultiselect.stories.ts +3 -2
  152. package/src/stories/CpPartnerBadge.stories.ts +2 -2
  153. package/src/stories/CpRadio.stories.ts +4 -2
  154. package/src/stories/CpSelect.stories.ts +4 -2
  155. package/src/stories/CpSelectMenu.stories.ts +4 -2
  156. package/src/stories/CpSwitch.stories.ts +4 -2
  157. package/src/stories/CpTable.stories.ts +9 -2
  158. package/src/stories/CpTableEmptyState.stories.ts +2 -1
  159. package/src/stories/CpTextarea.stories.ts +4 -2
  160. package/src/stories/CpToaster.stories.ts +2 -1
  161. package/src/stories/CpTooltip.stories.ts +2 -1
  162. package/src/stories/TransitionExpand.stories.ts +4 -2
  163. package/src/types/luxon.d.ts +1 -0
  164. package/src/vendors/ff-polyfill.ts +38 -0
  165. package/vitest.workspace.js +1 -3
  166. package/dist/IconNoPassport-DBmaQH_g.js +0 -18
  167. package/dist/IconPassport-5SwUf6_R.js +0 -20
  168. package/dist/IconRecurrence-CXVkBJ3i.js +0 -24
  169. package/dist/IconScheduleChange-CEIGEhU4.js +0 -19
  170. package/src/components/date-pickers/CpDatepicker.vue +0 -229
  171. package/src/components/feedback-indicators/CpToaster.vue +0 -372
  172. package/src/components/helpers-utilities/TransitionExpand.vue +0 -72
  173. package/src/constants/src/CpTableConfig.ts +0 -14
  174. package/src/constants/src/Position.ts +0 -10
  175. package/src/constants/src/colors/Colors.ts +0 -10
  176. package/src/constants/src/colors/ToggleColors.ts +0 -6
  177. package/src/directives/ClickOutside.js +0 -13
  178. package/src/helpers/object.js +0 -9
  179. package/src/helpers/string/src/camelize.js +0 -6
  180. package/src/plugins/toaster.js +0 -61
  181. package/src/utils/constants/index.js +0 -3
  182. package/src/utils/constants/src/PartnerTypes.js +0 -6
  183. package/src/utils/constants/src/Sizes.js +0 -5
  184. package/src/vendors/ff-polyfill.js +0 -36
  185. /package/src/components/{atomic-elements/CpDialogWrapper.vue → CpDialogWrapper.vue} +0 -0
  186. /package/src/components/{logo/Pimp.vue → Pimp.vue} +0 -0
  187. /package/src/helpers/string/{index.js → index.ts} +0 -0
@@ -1,9 +1,11 @@
1
- export const getKeyboardFocusableElements = (DOMElement = document) => {
2
- if (DOMElement === null) return []
1
+ export const getKeyboardFocusableElements = (DOMElement: Document | HTMLElement | null = document) => {
2
+ if (DOMElement === null) return [] as (HTMLElement | SVGElement)[]
3
3
 
4
- const focusableElements = [
5
- ...DOMElement.querySelectorAll('a, button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'),
6
- ]
4
+ const focusableElements = Array.from(
5
+ (DOMElement as Document | HTMLElement).querySelectorAll<HTMLElement | SVGElement>(
6
+ 'a, button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])',
7
+ ),
8
+ )
7
9
 
8
10
  if (!focusableElements.length) {
9
11
  return DOMElement instanceof HTMLElement ? [DOMElement] : []
@@ -11,7 +13,7 @@ export const getKeyboardFocusableElements = (DOMElement = document) => {
11
13
 
12
14
  return focusableElements.filter((element) => {
13
15
  const isElementDisabled = element.hasAttribute('disabled')
14
- const isElementVisible = element.offsetHeight !== 0 && element.offsetWidth !== 0
16
+ const isElementVisible = (element as HTMLElement).offsetHeight !== 0 && (element as HTMLElement).offsetWidth !== 0
15
17
 
16
18
  const isInputElement = element instanceof HTMLInputElement
17
19
  const isElementRadioNotChecked = isInputElement && element.type === 'radio' && element.checked === false
@@ -20,7 +22,9 @@ export const getKeyboardFocusableElements = (DOMElement = document) => {
20
22
  })
21
23
  }
22
24
 
23
- export const handleTrapFocus = (event, DOMElement) => {
25
+ export const handleTrapFocus = (event: KeyboardEvent, DOMElement?: HTMLElement) => {
26
+ if (!DOMElement) return
27
+
24
28
  const childFocusableElements = getKeyboardFocusableElements(DOMElement)
25
29
  const firstElement = childFocusableElements[0]
26
30
  const lastElement = childFocusableElements[childFocusableElements.length - 1]
@@ -32,10 +36,10 @@ export const handleTrapFocus = (event, DOMElement) => {
32
36
  // only TAB is pressed, not SHIFT simultaneously
33
37
  // Prevent default behavior of keydown on TAB (i.e. focus next element)
34
38
  event.preventDefault()
35
- firstElement.focus()
39
+ firstElement?.focus()
36
40
  } else if (tabBackwards) {
37
41
  // TAB and SHIFT are pressed simultaneously
38
42
  event.preventDefault()
39
- lastElement.focus()
43
+ lastElement?.focus()
40
44
  }
41
45
  }
@@ -1,10 +1,20 @@
1
1
  import { DateTime } from 'luxon'
2
2
 
3
- export const randomString = () => {
3
+ export const randomString = (): string => {
4
4
  return `_${Math.random().toString(36).substr(2, 9)}`
5
5
  }
6
6
 
7
- export const formatDates = function formatDates({ dateOne, dateTwo, format, locale }) {
7
+ export const formatDates = ({
8
+ dateOne,
9
+ dateTwo,
10
+ format,
11
+ locale,
12
+ }: {
13
+ dateOne?: string
14
+ dateTwo?: string
15
+ format: string
16
+ locale?: string
17
+ }): string => {
8
18
  let formattedDates = ''
9
19
 
10
20
  if (dateOne) {
@@ -17,7 +27,7 @@ export const formatDates = function formatDates({ dateOne, dateTwo, format, loca
17
27
  return formattedDates
18
28
  }
19
29
 
20
- export const capitalizeFirstLetter = (rawString) => {
30
+ export const capitalizeFirstLetter = (rawString: unknown): string => {
21
31
  if (typeof rawString !== 'string') return ''
22
32
  return rawString.charAt(0).toUpperCase() + rawString.slice(1)
23
33
  }
@@ -0,0 +1,9 @@
1
+ export const isObject = (value: unknown): value is Record<string, unknown> => {
2
+ return value !== null && typeof value === 'object'
3
+ }
4
+
5
+ export const isEmpty = (obj: unknown): boolean => {
6
+ if (!isObject(obj)) return true
7
+
8
+ return Reflect.ownKeys(obj).length === 0 && (obj as { constructor: unknown }).constructor === Object
9
+ }
@@ -0,0 +1,6 @@
1
+ export default function camelize(input: string): string {
2
+ return input.replace(/^[\w]|[A-Z]|\b\w|\s+/g, (match, index: number) => {
3
+ if (+match === 0) return ''
4
+ return index === 0 ? match.toLowerCase() : match.toUpperCase()
5
+ })
6
+ }
@@ -1,4 +1,4 @@
1
- export default function decamelize(camelCasedString, separator = ' ') {
1
+ export default function decamelize(camelCasedString: string, separator = ' '): string {
2
2
  return camelCasedString
3
3
  .replace(/([a-z\d])([A-Z])/g, `$1${separator}$2`)
4
4
  .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, `$1${separator}$2`)
@@ -126,13 +126,13 @@
126
126
  </transition>
127
127
  </template>
128
128
 
129
- <script>
129
+ <script lang="ts">
130
130
  import { DateTime, Info } from 'luxon'
131
131
 
132
- import { randomString } from '@/helpers'
133
- import ResizeSelect from '@/directives/ResizeSelect'
132
+ import CpIcon from '@/components/CpIcon.vue'
134
133
 
135
- import CpIcon from '@/components/visual/CpIcon.vue'
134
+ import ResizeSelect from '@/directives/ResizeSelect'
135
+ import { randomString } from '@/helpers'
136
136
 
137
137
  export default {
138
138
  name: 'CoreDatepicker',
@@ -0,0 +1,71 @@
1
+ import { App, h, render, VNode } from 'vue'
2
+
3
+ import CpToaster from '@/components/CpToaster.vue'
4
+
5
+ import { Intent } from '@/constants'
6
+
7
+ type MountOptions = {
8
+ app?: App | null
9
+ children?: unknown
10
+ element?: HTMLElement | null
11
+ props?: Record<string, unknown>
12
+ }
13
+
14
+ const createElement = () => (typeof document !== 'undefined' ? document.createElement('div') : null)
15
+
16
+ const mount = (component: unknown, { props, children, element, app }: MountOptions = {}) => {
17
+ let el: HTMLElement | null = element ? element : createElement()
18
+
19
+ // @ts-expect-error <comment on type error>
20
+ let vNode: VNode = h(component, props, children)
21
+ if (app && app._context) {
22
+ vNode.appContext = app._context
23
+ }
24
+
25
+ render(vNode, el as HTMLElement)
26
+
27
+ const destroy = () => {
28
+ if (el) {
29
+ render(null, el)
30
+ }
31
+ el = null
32
+ // @ts-expect-error explicit nulling for GC
33
+ vNode = null
34
+ }
35
+
36
+ return { vNode, destroy, el }
37
+ }
38
+
39
+ const createToaster = (globalOptions: Record<string, unknown> = {}) => {
40
+ return {
41
+ show(options: Record<string, unknown> = {}) {
42
+ const localOptions = { ...options }
43
+
44
+ mount(CpToaster, {
45
+ props: { ...globalOptions, ...localOptions },
46
+ })
47
+ },
48
+ unique(options: Record<string, unknown> = {}) {
49
+ options.isUnique = true
50
+ return this.show(options)
51
+ },
52
+ success(options: Record<string, unknown> = {}) {
53
+ options.type = Intent.SUCCESS.value
54
+ return this.show(options)
55
+ },
56
+ critical(options: Record<string, unknown> = {}) {
57
+ options.type = Intent.CRITICAL.value
58
+ return this.show(options)
59
+ },
60
+ info(options: Record<string, unknown> = {}) {
61
+ options.type = Intent.INFO.value
62
+ return this.show(options)
63
+ },
64
+ warning(options: Record<string, unknown> = {}) {
65
+ options.type = Intent.WARNING.value
66
+ return this.show(options)
67
+ },
68
+ }
69
+ }
70
+
71
+ export default createToaster
@@ -1,5 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
- import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
2
+
3
+ import BaseInputLabel from '@/components/BaseInputLabel.vue'
3
4
 
4
5
  const meta = {
5
6
  title: 'BaseInputLabel',
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
2
 
3
- import CpAirlineLogo from '@/components/atomic-elements/CpAirlineLogo.vue'
3
+ import CpAirlineLogo from '@/components/CpAirlineLogo.vue'
4
4
 
5
5
  const meta = {
6
6
  title: 'CpAirlineLogo',
@@ -1,5 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
- import CpAlert from '@/components/feedback-indicators/CpAlert.vue'
2
+
3
+ import CpAlert from '@/components/CpAlert.vue'
3
4
 
4
5
  const meta = {
5
6
  title: 'CpAlert',
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
2
 
3
- import CpBadge from '@/components/atomic-elements/CpBadge.vue'
3
+ import CpBadge from '@/components/CpBadge.vue'
4
4
 
5
5
  const meta = {
6
6
  title: 'CpBadge',
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
2
 
3
- import CpButton from '@/components/buttons/CpButton.vue'
3
+ import CpButton from '@/components/CpButton.vue'
4
4
 
5
5
  const meta = {
6
6
  title: 'CpButton',
@@ -1,6 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
- import CpCheckbox from '@/components/toggles/CpCheckbox.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpCheckbox from '@/components/CpCheckbox.vue'
4
6
 
5
7
  const meta = {
6
8
  title: 'CpCheckbox',
@@ -1,6 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
- import CpDate from '@/components/date-pickers/CpDate.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpDate from '@/components/CpDate.vue'
4
6
 
5
7
  const meta = {
6
8
  title: 'CpDate',
@@ -1,6 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
- import CpDatepicker from '@/components/date-pickers/CpDatepicker.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpDatepicker from '@/components/CpDatepicker.vue'
4
6
 
5
7
  const meta = {
6
8
  title: 'CpDatepicker',
@@ -1,7 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
2
 
4
- import CpDialog from '@/components/atomic-elements/CpDialog.vue'
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpDialog from '@/components/CpDialog.vue'
5
6
 
6
7
  const meta = {
7
8
  title: 'CpDialog',
@@ -1,5 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
- import CpHeading from '@/components/typography/CpHeading.vue'
2
+
3
+ import CpHeading from '@/components/CpHeading.vue'
3
4
 
4
5
  const meta = {
5
6
  title: 'CpHeading',
@@ -1,5 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
- import CpIcon from '@/components/visual/CpIcon.vue'
2
+
3
+ import CpIcon from '@/components/CpIcon.vue'
4
+
3
5
  import { CustomCpIcons } from '@/constants'
4
6
 
5
7
  const iconsOptions = [
@@ -1,6 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
- import CpInput from '@/components/inputs/CpInput.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpInput from '@/components/CpInput.vue'
4
6
 
5
7
  const meta = {
6
8
  title: 'CpInput',
@@ -1,5 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
- import CpLoader from '@/components/feedback-indicators/CpLoader.vue'
2
+
3
+ import CpLoader from '@/components/CpLoader.vue'
3
4
 
4
5
  const meta = {
5
6
  title: 'CpLoader',
@@ -1,7 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
2
 
4
- import CpMultiselect from '@/components/selects/CpMultiselect.vue'
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpMultiselect from '@/components/CpMultiselect.vue'
5
6
 
6
7
  const meta = {
7
8
  title: 'CpMultiSelect',
@@ -1,8 +1,8 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
2
 
3
- import CpPartnerBadge from '@/components/atomic-elements/CpPartnerBadge.vue'
3
+ import CpPartnerBadge from '@/components/CpPartnerBadge.vue'
4
4
 
5
- import { PartnerTypes, Sizes } from '@/utils/constants'
5
+ import { PartnerTypes, Sizes } from '@/constants'
6
6
 
7
7
  const meta = {
8
8
  title: 'CpPartnerBadge',
@@ -1,6 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
- import CpRadio from '@/components/toggles/CpRadio.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpRadio from '@/components/CpRadio.vue'
4
6
 
5
7
  const meta = {
6
8
  title: 'CpRadio',
@@ -1,6 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
- import CpSelect from '@/components/selects/CpSelect.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpSelect from '@/components/CpSelect.vue'
4
6
 
5
7
  const meta = {
6
8
  title: 'CpSelect',
@@ -1,6 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
- import CpSelectMenu from '@/components/selects/CpSelectMenu.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpSelectMenu from '@/components/CpSelectMenu.vue'
4
6
 
5
7
  const meta = {
6
8
  title: 'CpSelectMenu',
@@ -1,6 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
- import CpSwitch from '@/components/toggles/CpSwitch.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpSwitch from '@/components/CpSwitch.vue'
4
6
 
5
7
  const meta = {
6
8
  title: 'CpSwitch',
@@ -1,5 +1,8 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
- import CpTable from '@/components/lists-and-table/CpTable.vue'
2
+
3
+ import CpTable from '@/components/CpTable.vue'
4
+
5
+ import { PAGINATION_FORMATS } from '@/constants'
3
6
 
4
7
  const meta = {
5
8
  title: 'CpTable',
@@ -111,7 +114,7 @@ export const WithPagination: Story = {
111
114
  pagination: {
112
115
  enabled: true,
113
116
  limit: 3,
114
- format: 'pages',
117
+ format: PAGINATION_FORMATS.PAGES,
115
118
  },
116
119
  },
117
120
  }
@@ -190,22 +193,26 @@ export const WithCustomRowOptions: Story = {
190
193
  enableRowOptions: true,
191
194
  rowOptions: [
192
195
  {
196
+ id: 'see',
193
197
  label: 'see',
194
198
  icon: 'eye',
195
199
  action: () => console.log('See'),
196
200
  },
197
201
  {
202
+ id: 'edit',
198
203
  label: 'edit',
199
204
  icon: 'edit-2',
200
205
  action: () => console.log('Edit'),
201
206
  },
202
207
  {
208
+ id: 'disable',
203
209
  label: 'disable',
204
210
  icon: 'history',
205
211
  disabled: true,
206
212
  action: () => console.log('History'),
207
213
  },
208
214
  {
215
+ id: 'delete',
209
216
  label: 'delete',
210
217
  icon: 'trash',
211
218
  isCritical: true,
@@ -1,5 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
- import CpTableEmptyState from '@/components/lists-and-table/CpTableEmptyState.vue'
2
+
3
+ import CpTableEmptyState from '@/components/CpTableEmptyState.vue'
3
4
 
4
5
  const meta = {
5
6
  title: 'CpTableEmptyState',
@@ -1,6 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
- import CpTextarea from '@/components/inputs/CpTextarea.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import CpTextarea from '@/components/CpTextarea.vue'
4
6
 
5
7
  const meta = {
6
8
  title: 'CpTextarea',
@@ -1,5 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
- import CpToaster from '@/components/feedback-indicators/CpToaster.vue'
2
+
3
+ import CpToaster from '@/components/CpToaster.vue'
3
4
 
4
5
  const meta = {
5
6
  title: 'CpToaster',
@@ -1,5 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
- import CpTooltip from '@/components/atomic-elements/CpTooltip.vue'
2
+
3
+ import CpTooltip from '@/components/CpTooltip.vue'
3
4
 
4
5
  const meta = {
5
6
  title: 'CpTooltip',
@@ -1,6 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
- import TransitionExpand from '@/components/helpers-utilities/TransitionExpand.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import TransitionExpand from '@/components/TransitionExpand.vue'
4
6
 
5
7
  const meta = {
6
8
  title: 'TransitionExpand',
@@ -0,0 +1 @@
1
+ declare module 'luxon'
@@ -0,0 +1,38 @@
1
+ // Copy paste from https://gist.github.com/nuxodin/9250e56a3ce6c0446efa
2
+ export default function ffPolyfill(): void {
3
+ const w = window
4
+ const d = w.document
5
+
6
+ if (w.onfocus === undefined) {
7
+ d.addEventListener('focus', addPolyfill as EventListener, true)
8
+ d.addEventListener('blur', addPolyfill as EventListener, true)
9
+ d.addEventListener('focusin', removePolyfill as EventListener, true)
10
+ d.addEventListener('focusout', removePolyfill as EventListener, true)
11
+ }
12
+
13
+ function addPolyfill(e: FocusEvent) {
14
+ const type = e.type === 'focus' ? 'focusin' : 'focusout'
15
+ const event = new CustomEvent(type, {
16
+ bubbles: true,
17
+ cancelable: false,
18
+ })
19
+ // @ts-expect-error <comment on type error>
20
+ event.c1Generated = true
21
+ ;(e.target as HTMLElement).dispatchEvent(event)
22
+ }
23
+
24
+ function removePolyfill(e: FocusEvent) {
25
+ // @ts-expect-error <comment on type error>
26
+ if (!e.c1Generated) {
27
+ // focus after focusin, so chrome will the first time trigger tow times focusin
28
+ d.removeEventListener('focus', addPolyfill as EventListener, true)
29
+ d.removeEventListener('blur', addPolyfill as EventListener, true)
30
+ d.removeEventListener('focusin', removePolyfill as EventListener, true)
31
+ d.removeEventListener('focusout', removePolyfill as EventListener, true)
32
+ }
33
+ setTimeout(function () {
34
+ d.removeEventListener('focusin', removePolyfill as EventListener, true)
35
+ d.removeEventListener('focusout', removePolyfill as EventListener, true)
36
+ })
37
+ }
38
+ }
@@ -1,10 +1,8 @@
1
+ import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin'
1
2
  import path from 'node:path'
2
3
  import { fileURLToPath } from 'node:url'
3
-
4
4
  import { defineWorkspace } from 'vitest/config'
5
5
 
6
- import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin'
7
-
8
6
  const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url))
9
7
 
10
8
  // More info at: https://storybook.js.org/docs/writing-tests/test-addon
@@ -1,18 +0,0 @@
1
- import { createElementBlock as e, openBlock as o, createStaticVNode as r } from "vue";
2
- import { _ as p } from "./index-DbgX3-2I.js";
3
- const a = {}, C = {
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
- function d(n, t) {
11
- return o(), e("svg", C, t[0] || (t[0] = [
12
- r('<g id="feather-icon / no-passport"><g id="Vector"><path d="M2.25384 21.7458C1.90237 21.3943 1.90237 20.8244 2.25384 20.473L20.4726 2.25421C20.8241 1.90273 21.3939 1.90273 21.7454 2.25421C22.0969 2.60568 22.0969 3.17552 21.7454 3.527L3.52663 21.7458C3.17516 22.0972 2.60531 22.0972 2.25384 21.7458Z"></path><path d="M17.9167 3.99996H5.56675V19.651L3.56675 21.651V1.99996H17.9167C19.38 1.99996 20.5668 3.18339 20.5723 4.64534L18.5724 6.64532V4.6556C18.5724 4.2935 18.2788 3.99996 17.9167 3.99996Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M16.1418 9.07589L11.8441 13.3736C9.69208 13.256 7.99204 11.4648 7.99204 9.284C7.99204 7.02758 9.81201 5.18826 12.0695 5.18826C14.2572 5.18826 16.034 6.91557 16.1418 9.07589ZM12.0695 7.18826C10.9277 7.18826 9.99204 8.12096 9.99204 9.284C9.99204 10.447 10.9277 11.3797 12.0695 11.3797C13.2113 11.3797 14.147 10.447 14.147 9.284C14.147 8.12096 13.2113 7.18826 12.0695 7.18826Z"></path><path d="M9.77469 15.443L8.31061 16.9071C8.23781 16.7684 8.19663 16.6105 8.19663 16.443C8.19663 15.8907 8.64435 15.443 9.19663 15.443H9.77469Z"></path><path d="M10.3203 17.443L12.3203 15.443H14.802C15.3543 15.443 15.802 15.8907 15.802 16.443C15.802 16.9953 15.3543 17.443 14.802 17.443H10.3203Z"></path><path d="M7.76333 20H17.9167C18.2788 20 18.5724 19.7064 18.5724 19.3443V9.19091L20.5724 7.19091V19.3443C20.5724 20.811 19.3834 22 17.9167 22H5.76334L7.76333 20Z"></path></g></g>', 1)
13
- ]));
14
- }
15
- const s = /* @__PURE__ */ p(a, [["render", d]]);
16
- export {
17
- s as default
18
- };
@@ -1,20 +0,0 @@
1
- import { createElementBlock as e, openBlock as o, createStaticVNode as r } from "vue";
2
- import { _ as n } from "./index-DbgX3-2I.js";
3
- const C = {}, c = {
4
- width: "24",
5
- height: "24",
6
- viewBox: "0 0 24 24",
7
- fill: "currentColor",
8
- "fill-rule": "evenodd",
9
- "clip-rule": "evenodd",
10
- xmlns: "http://www.w3.org/2000/svg"
11
- };
12
- function p(s, t) {
13
- return o(), e("svg", c, t[0] || (t[0] = [
14
- r('<g id="feather-icon / passport"><g id="Vector"><path d="M17.9174 4H5.56738V20H17.9174C18.2795 20 18.573 19.7065 18.573 19.3444V4.65564C18.573 4.29354 18.2795 4 17.9174 4ZM3.56738 2V22H17.9174C19.384 22 20.573 20.811 20.573 19.3444V4.65564C20.573 3.18897 19.384 2 17.9174 2H3.56738Z"></path><path d="M12.0701 7.1883C10.9284 7.1883 9.99268 8.121 9.99268 9.28404C9.99268 10.4471 10.9284 11.3798 12.0701 11.3798C13.2119 11.3798 14.1476 10.4471 14.1476 9.28404C14.1476 8.121 13.2119 7.1883 12.0701 7.1883ZM7.99268 9.28404C7.99268 7.02762 9.81265 5.1883 12.0701 5.1883C14.3276 5.1883 16.1476 7.02762 16.1476 9.28404C16.1476 11.5405 14.3276 13.3798 12.0701 13.3798C9.81265 13.3798 7.99268 11.5405 7.99268 9.28404Z"></path><path d="M8.19727 16.443C8.19727 15.8908 8.64498 15.443 9.19727 15.443H14.8027C15.355 15.443 15.8027 15.8908 15.8027 16.443C15.8027 16.9953 15.355 17.443 14.8027 17.443H9.19727C8.64498 17.443 8.19727 16.9953 8.19727 16.443Z"></path></g></g>', 1)
15
- ]));
16
- }
17
- const i = /* @__PURE__ */ n(C, [["render", p]]);
18
- export {
19
- i as default
20
- };
@@ -1,24 +0,0 @@
1
- import { createElementBlock as t, openBlock as o, createElementVNode as C } from "vue";
2
- import { _ as r } from "./index-DbgX3-2I.js";
3
- const n = {}, l = {
4
- width: "24",
5
- height: "24",
6
- viewBox: "0 0 24 24",
7
- xmlns: "http://www.w3.org/2000/svg",
8
- fill: "currentColor"
9
- };
10
- function V(c, e) {
11
- return o(), t("svg", l, e[0] || (e[0] = [
12
- C("path", {
13
- "fill-rule": "evenodd",
14
- "clip-rule": "evenodd",
15
- d: "M13.9432 0.511841C14.4955 0.511841 14.9432 0.959556 14.9432 1.51184V2.27185H16.3431C17.9999 2.27185 19.3431 3.615 19.3431 5.27185V8.42388C19.3431 8.44533 19.3424 8.46663 19.3411 8.48776C19.3424 8.50888 19.3431 8.53018 19.3431 8.55164C19.3431 9.10392 18.8954 9.55164 18.3431 9.55164H3.50354V17.1114C3.50354 17.6637 3.95126 18.1114 4.50354 18.1114H6.11962C6.6719 18.1114 7.11962 18.5591 7.11962 19.1114C7.11962 19.6637 6.6719 20.1114 6.11962 20.1114H4.50354C2.84668 20.1114 1.50354 18.7682 1.50354 17.1114V5.27185C1.50354 3.61499 2.84669 2.27185 4.50354 2.27185H5.90344V1.51184C5.90344 0.959556 6.35116 0.511841 6.90344 0.511841C7.45573 0.511841 7.90344 0.959556 7.90344 1.51184V2.27185H12.9432V1.51184C12.9432 0.959556 13.391 0.511841 13.9432 0.511841ZM17.3431 5.27185V7.55164H3.50354V5.27185C3.50354 4.71957 3.95125 4.27185 4.50354 4.27185H5.90344V5.03174C5.90344 5.58402 6.35116 6.03174 6.90344 6.03174C7.45573 6.03174 7.90344 5.58402 7.90344 5.03174V4.27185H12.9432V5.03174C12.9432 5.58402 13.391 6.03174 13.9432 6.03174C14.4955 6.03174 14.9432 5.58402 14.9432 5.03174V4.27185H16.3431C16.8954 4.27185 17.3431 4.71957 17.3431 5.27185Z"
16
- }, null, -1),
17
- C("path", { d: "M18.3333 17.4153C17.781 17.4153 17.3333 17.863 17.3333 18.4153C17.3333 18.9676 17.781 19.4153 18.3333 19.4153H19.3088L18.4419 20.2299C18.4343 20.237 18.4268 20.2443 18.4194 20.2517C17.9119 20.7595 17.284 21.1304 16.5943 21.3299C15.9047 21.5294 15.1757 21.5509 14.4755 21.3925C13.7753 21.234 13.1266 20.9008 12.59 20.4239C12.0534 19.9469 11.6464 19.3418 11.4069 18.665C11.2226 18.1444 10.6512 17.8717 10.1306 18.0559C9.60993 18.2401 9.33721 18.8116 9.52145 19.3322C9.87365 20.3275 10.4722 21.2174 11.2614 21.9187C12.0505 22.6201 13.0044 23.1102 14.0342 23.3431C15.0639 23.5761 16.1359 23.5445 17.1501 23.2511C18.159 22.9593 19.0781 22.4179 19.8224 21.6771L20.8333 20.7272V21.9153C20.8333 22.4676 21.281 22.9153 21.8333 22.9153C22.3855 22.9153 22.8333 22.4676 22.8333 21.9153V18.4284C22.8366 18.1785 22.7468 17.927 22.5621 17.7305C22.4581 17.6198 22.3348 17.5381 22.2023 17.4856C22.0881 17.4402 21.9636 17.4153 21.8333 17.4153H18.3333Z" }, null, -1),
18
- C("path", { d: "M9 11.582C9.55229 11.582 10 12.0297 10 12.582V13.7701L11.011 12.8201C11.7553 12.0793 12.6743 11.538 13.6833 11.2461C14.6975 10.9528 15.7695 10.9211 16.7992 11.1541C17.8289 11.3871 18.7829 11.8771 19.572 12.5785C20.3611 13.2799 20.9597 14.1697 21.3119 15.165C21.4961 15.6857 21.2234 16.2571 20.7028 16.4413C20.1821 16.6256 19.6107 16.3529 19.4265 15.8322C19.187 15.1554 18.7799 14.5503 18.2433 14.0734C17.7067 13.5964 17.058 13.2632 16.3578 13.1048C15.6576 12.9463 14.9287 12.9679 14.239 13.1674C13.5494 13.3668 12.9215 13.7378 12.414 14.2455C12.4066 14.2529 12.3991 14.2602 12.3914 14.2674L11.5245 15.082H12.5C13.0523 15.082 13.5 15.5297 13.5 16.082C13.5 16.6343 13.0523 17.082 12.5 17.082H9C8.74912 17.082 8.51981 16.9896 8.34426 16.837C8.24102 16.7473 8.15638 16.6367 8.09685 16.5119C8.03476 16.3817 8 16.2359 8 16.082V12.582C8 12.0297 8.44772 11.582 9 11.582Z" }, null, -1)
19
- ]));
20
- }
21
- const s = /* @__PURE__ */ r(n, [["render", V]]);
22
- export {
23
- s as default
24
- };