@citizenplane/pimp 8.26.0 → 8.27.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.
Files changed (150) hide show
  1. package/dist/{IconAccompaniedMinorEach-DDeSlaA_.js → IconAccompaniedMinorEach-BJYaPpW3.js} +1 -1
  2. package/dist/{IconAccompaniedMinorNone-BKs1gk1K.js → IconAccompaniedMinorNone-D1JR2Qpd.js} +1 -1
  3. package/dist/{IconAccompaniedMinorOne-CpL8FNve.js → IconAccompaniedMinorOne-BJ3jzEDZ.js} +1 -1
  4. package/dist/{IconAddReceipt-DLH3pqjA.js → IconAddReceipt-BX_va94f.js} +1 -1
  5. package/dist/{IconAirportTerminal-Cc4CU6MC.js → IconAirportTerminal-Dzr98nfc.js} +1 -1
  6. package/dist/{IconArrival-CdtUsRVo.js → IconArrival-Ced9HrJH.js} +1 -1
  7. package/dist/{IconBroadcast-QjMZtFA9.js → IconBroadcast-BYX44Wak.js} +1 -1
  8. package/dist/{IconCabinBag-xVC6mOQF.js → IconCabinBag-D1Qs952U.js} +1 -1
  9. package/dist/{IconCheckedBaggage-I_1h49TJ.js → IconCheckedBaggage-Q4_SQL9l.js} +1 -1
  10. package/dist/{IconCheckedBaggage20-CyPcsqrn.js → IconCheckedBaggage20-DVH1-A0V.js} +1 -1
  11. package/dist/{IconCheckedBaggage30-s5htbUIA.js → IconCheckedBaggage30-DYOAf-7Z.js} +1 -1
  12. package/dist/{IconChild-DL43kbm1.js → IconChild-BeCLAr8Y.js} +1 -1
  13. package/dist/{IconContact-FdhTr03q.js → IconContact-B3r39fyI.js} +1 -1
  14. package/dist/{IconDeparture-DNR3OGPD.js → IconDeparture-BflKZUiE.js} +1 -1
  15. package/dist/{IconDistribution-Cl8L6177.js → IconDistribution-CBxQ7UWb.js} +1 -1
  16. package/dist/{IconDistributionClosed-DBT6wR78.js → IconDistributionClosed-BWp_k24K.js} +1 -1
  17. package/dist/{IconDistributionExclusivePair-CkRG6yNV.js → IconDistributionExclusivePair-erLbcLps.js} +1 -1
  18. package/dist/{IconDistributionSided-D_wdvDNf.js → IconDistributionSided-y000n4qB.js} +1 -1
  19. package/dist/{IconDistributionSupplySided-C3VcE8Dw.js → IconDistributionSupplySided-7kCvGwnz.js} +1 -1
  20. package/dist/{IconDynamicContent-Ct1HRd3s.js → IconDynamicContent-SwBxkPMB.js} +1 -1
  21. package/dist/{IconFares-dIGVrtE4.js → IconFares-DTm0Q_RI.js} +1 -1
  22. package/dist/{IconFaresOutlined-bd8kT44f.js → IconFaresOutlined-BFMo_x9Q.js} +1 -1
  23. package/dist/{IconFemale-CMeYHrDy.js → IconFemale-Ma0KeaEM.js} +1 -1
  24. package/dist/{IconFindConversation-BdN2Yd3R.js → IconFindConversation-CpsDYPgD.js} +1 -1
  25. package/dist/{IconFire-obwuluyJ.js → IconFire-DECrDnLM.js} +1 -1
  26. package/dist/{IconFlight-B_6tJxB3.js → IconFlight-D5M0A0CM.js} +1 -1
  27. package/dist/{IconFlightReturn-BEO97PwR.js → IconFlightReturn-CTvqEFME.js} +1 -1
  28. package/dist/{IconHandHeart-hs0yFSEL.js → IconHandHeart-ChgdfXQa.js} +1 -1
  29. package/dist/{IconHistory-CT-jOMRt.js → IconHistory-DpIXDYI5.js} +1 -1
  30. package/dist/{IconHourGlass-CF940vmy.js → IconHourGlass-CIRkFUSM.js} +1 -1
  31. package/dist/{IconIdCard-DKkU58Ix.js → IconIdCard-UD5VZsUi.js} +1 -1
  32. package/dist/{IconInfant-DIUT-6_4.js → IconInfant-CmLUvWpO.js} +1 -1
  33. package/dist/{IconItinerary-D7mOGUmj.js → IconItinerary-CY8irele.js} +1 -1
  34. package/dist/{IconLeave-BExl4uyV.js → IconLeave-C3bpPz6L.js} +1 -1
  35. package/dist/{IconMale-eHGH5XBz.js → IconMale-x4xdulWB.js} +1 -1
  36. package/dist/{IconMultiSegments-KkrKiZrK.js → IconMultiSegments-BhTMfvhQ.js} +1 -1
  37. package/dist/{IconNoPassport-PJ2QqqoI.js → IconNoPassport-_Xm76k6b.js} +1 -1
  38. package/dist/{IconNoRefund-W47AQisu.js → IconNoRefund-B78s0oyF.js} +1 -1
  39. package/dist/{IconNotion-CCnhatKK.js → IconNotion-C22PTLTU.js} +1 -1
  40. package/dist/{IconOffline-3wunTEJG.js → IconOffline-BDzikWE9.js} +1 -1
  41. package/dist/{IconOneWay-BQ5K41Bu.js → IconOneWay-DlTVxokv.js} +2 -2
  42. package/dist/{IconPaid-zwDwWzF8.js → IconPaid-DmGERe85.js} +1 -1
  43. package/dist/{IconPassport-IxhNLS8P.js → IconPassport-6VOlXjxJ.js} +1 -1
  44. package/dist/{IconPayout-BNSON3dj.js → IconPayout-abr6BXCd.js} +1 -1
  45. package/dist/{IconReceipt-DOosYtgi.js → IconReceipt-BnTaihcq.js} +1 -1
  46. package/dist/{IconRecurrence-B8i5kO2Q.js → IconRecurrence-C5TPG2ht.js} +1 -1
  47. package/dist/{IconRefund-DkjF9lEI.js → IconRefund-Ysv8pyMJ.js} +1 -1
  48. package/dist/{IconRoundTrip-BZvhS65z.js → IconRoundTrip-CIVDw8LK.js} +1 -1
  49. package/dist/{IconRouteNoStop-CeSlfnpx.js → IconRouteNoStop-DQrq4gW5.js} +1 -1
  50. package/dist/{IconRouteOneStop-aP1Mj-Bv.js → IconRouteOneStop-pzisj4i4.js} +1 -1
  51. package/dist/{IconScheduleChange-QQ4AMAMI.js → IconScheduleChange-BONs1AAT.js} +1 -1
  52. package/dist/{IconSeatEmpty-DgVBD165.js → IconSeatEmpty-CHij3aGA.js} +1 -1
  53. package/dist/{IconSeatSold-BGBwNZUa.js → IconSeatSold-QspS_zCh.js} +1 -1
  54. package/dist/{IconSeatTotal-Dq9uXccZ.js → IconSeatTotal-DTZ1TcAX.js} +1 -1
  55. package/dist/{IconTemplate-BgruEhjI.js → IconTemplate-BDmmr-9L.js} +1 -1
  56. package/dist/{IconTicket-BTaYnuPt.js → IconTicket--vVn61Ey.js} +1 -1
  57. package/dist/{IconTimer-CyJzne5T.js → IconTimer-CspKpwqZ.js} +1 -1
  58. package/dist/{IconTrafficControl-BeQtpwhK.js → IconTrafficControl-DBamcJNe.js} +1 -1
  59. package/dist/{index-B8RNa4cx.js → index-C3oHnZQk.js} +9152 -10064
  60. package/dist/pimp.es.js +1 -1
  61. package/dist/pimp.umd.js +17 -17
  62. package/dist/style.css +1 -1
  63. package/package.json +2 -1
  64. package/src/components/atomic-elements/CpAirlineLogo.vue +9 -10
  65. package/src/components/atomic-elements/CpBadge.vue +33 -41
  66. package/src/components/atomic-elements/CpDialog.vue +14 -9
  67. package/src/components/atomic-elements/CpPartnerBadge.vue +12 -20
  68. package/src/components/atomic-elements/CpTooltip.vue +12 -11
  69. package/src/components/buttons/CpButton.vue +63 -104
  70. package/src/components/core/BaseInputLabel.vue +9 -15
  71. package/src/components/core/BaseSelectClearButton.vue +1 -1
  72. package/src/components/date-pickers/CpCalendar.vue +154 -153
  73. package/src/components/date-pickers/CpDate.vue +202 -212
  74. package/src/components/date-pickers/CpDatepicker.vue +112 -138
  75. package/src/components/feedback-indicators/CpAlert.vue +16 -27
  76. package/src/components/feedback-indicators/CpLoader.vue +7 -8
  77. package/src/components/feedback-indicators/CpToaster.vue +197 -192
  78. package/src/components/helpers-utilities/TransitionExpand.vue +31 -33
  79. package/src/components/icons/IconOneWay.vue +1 -1
  80. package/src/components/index.ts +28 -40
  81. package/src/components/inputs/CpInput.vue +40 -57
  82. package/src/components/inputs/CpTextarea.vue +30 -50
  83. package/src/components/lists-and-table/CpTable.vue +165 -114
  84. package/src/components/lists-and-table/CpTableEmptyState.vue +5 -8
  85. package/src/components/selects/CpMultiselect.vue +58 -89
  86. package/src/components/selects/CpSelect.vue +70 -90
  87. package/src/components/selects/CpSelectMenu.vue +94 -96
  88. package/src/components/toggles/CpCheckbox.vue +45 -54
  89. package/src/components/toggles/CpRadio.vue +47 -58
  90. package/src/components/toggles/CpSwitch.vue +51 -67
  91. package/src/components/typography/CpHeading.vue +11 -31
  92. package/src/components/visual/CpIcon.vue +2 -1
  93. package/src/constants/{src/CpCustomIcons.ts → CpCustomIcons.ts} +1 -1
  94. package/src/constants/CpTableConfig.ts +12 -0
  95. package/src/constants/Heading.ts +8 -0
  96. package/src/{utils/constants/src/Intent.js → constants/Intent.ts} +1 -1
  97. package/src/constants/PartnerTypes.ts +6 -0
  98. package/src/constants/Position.ts +10 -0
  99. package/src/constants/Sizes.ts +5 -0
  100. package/src/constants/colors/Colors.ts +10 -0
  101. package/src/constants/colors/ToggleColors.ts +6 -0
  102. package/src/constants/index.ts +10 -5
  103. package/src/directives/ClickOutside.ts +17 -0
  104. package/src/directives/{ResizeSelect.js → ResizeSelect.ts} +3 -3
  105. package/src/helpers/{dom.js → dom.ts} +13 -9
  106. package/src/helpers/{index.js → index.ts} +13 -3
  107. package/src/helpers/object.ts +9 -0
  108. package/src/helpers/string/src/camelize.ts +6 -0
  109. package/src/helpers/string/src/{decamelize.js → decamelize.ts} +1 -1
  110. package/src/libs/CoreDatepicker.vue +4 -4
  111. package/src/plugins/toaster.ts +71 -0
  112. package/src/stories/BaseInputLabel.stories.ts +1 -0
  113. package/src/stories/CpAlert.stories.ts +1 -0
  114. package/src/stories/CpBadge.stories.ts +18 -0
  115. package/src/stories/CpCheckbox.stories.ts +3 -1
  116. package/src/stories/CpDate.stories.ts +3 -1
  117. package/src/stories/CpDatepicker.stories.ts +3 -1
  118. package/src/stories/CpDialog.stories.ts +2 -1
  119. package/src/stories/CpHeading.stories.ts +1 -0
  120. package/src/stories/CpIcon.stories.ts +2 -0
  121. package/src/stories/CpInput.stories.ts +3 -1
  122. package/src/stories/CpLoader.stories.ts +1 -0
  123. package/src/stories/CpMultiselect.stories.ts +2 -1
  124. package/src/stories/CpPartnerBadge.stories.ts +1 -1
  125. package/src/stories/CpRadio.stories.ts +3 -1
  126. package/src/stories/CpSelect.stories.ts +3 -1
  127. package/src/stories/CpSelectMenu.stories.ts +3 -1
  128. package/src/stories/CpSwitch.stories.ts +3 -1
  129. package/src/stories/CpTable.stories.ts +8 -1
  130. package/src/stories/CpTableEmptyState.stories.ts +1 -0
  131. package/src/stories/CpTextarea.stories.ts +3 -1
  132. package/src/stories/CpToaster.stories.ts +1 -0
  133. package/src/stories/CpTooltip.stories.ts +1 -0
  134. package/src/stories/TransitionExpand.stories.ts +3 -1
  135. package/src/types/luxon.d.ts +1 -0
  136. package/src/vendors/ff-polyfill.ts +38 -0
  137. package/vitest.workspace.js +1 -3
  138. package/src/constants/src/CpTableConfig.ts +0 -14
  139. package/src/constants/src/Position.ts +0 -10
  140. package/src/constants/src/colors/Colors.ts +0 -10
  141. package/src/constants/src/colors/ToggleColors.ts +0 -6
  142. package/src/directives/ClickOutside.js +0 -13
  143. package/src/helpers/object.js +0 -9
  144. package/src/helpers/string/src/camelize.js +0 -6
  145. package/src/plugins/toaster.js +0 -61
  146. package/src/utils/constants/index.js +0 -3
  147. package/src/utils/constants/src/PartnerTypes.js +0 -6
  148. package/src/utils/constants/src/Sizes.js +0 -5
  149. package/src/vendors/ff-polyfill.js +0 -36
  150. /package/src/helpers/string/{index.js → index.ts} +0 -0
@@ -4,7 +4,7 @@
4
4
  {{ capitalizedLabel }} <span v-if="isRequired" class="u-asterisk">*</span>
5
5
  <cp-tooltip v-if="tooltip" :content="tooltip">
6
6
  <button type="button" class="cpInput__tooltip">
7
- <cp-icon class="cpInput__tooltipIcon" type="cp-tooltip" />
7
+ <cp-icon class="cpInput__tooltipIcon" type="tooltip" />
8
8
  </button>
9
9
  </cp-tooltip>
10
10
  </base-input-label>
@@ -56,72 +56,55 @@
56
56
  </div>
57
57
  </template>
58
58
 
59
- <script setup>
59
+ <script setup lang="ts">
60
60
  import { ref, useAttrs, useSlots, computed, nextTick, onMounted, useId } from 'vue'
61
61
 
62
62
  import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
63
63
 
64
64
  import { randomString, capitalizeFirstLetter } from '@/helpers'
65
65
 
66
- const props = defineProps({
67
- modelValue: {
68
- type: [String, Number, Boolean],
69
- default: '',
70
- },
71
- tooltip: {
72
- type: String,
73
- default: '',
74
- },
75
- label: {
76
- type: String,
77
- default: '',
78
- },
79
- inputId: {
80
- type: String,
81
- default: null,
82
- },
83
- isInvalid: {
84
- type: Boolean,
85
- default: false,
86
- },
87
- errorMessage: {
88
- type: String,
89
- default: '',
90
- },
91
- mask: {
92
- type: [String, Object],
93
- default: null,
94
- },
95
- hideInvalidityIcon: {
96
- type: Boolean,
97
- default: false,
98
- },
99
- removeBorder: {
100
- type: Boolean,
101
- default: false,
102
- },
103
- isLarge: {
104
- type: Boolean,
105
- default: false,
106
- },
107
- isSearch: {
108
- type: Boolean,
109
- default: false,
110
- },
111
- help: {
112
- type: String,
113
- default: '',
114
- },
66
+ interface Props {
67
+ errorMessage?: string
68
+ help?: string
69
+ hideInvalidityIcon?: boolean
70
+ inputId?: string | null
71
+ isInvalid?: boolean
72
+ isLarge?: boolean
73
+ isSearch?: boolean
74
+ label?: string
75
+ mask?: string | Record<string, unknown> | null
76
+ modelValue?: string | number | boolean
77
+ removeBorder?: boolean
78
+ tooltip?: string
79
+ }
80
+
81
+ const props = withDefaults(defineProps<Props>(), {
82
+ modelValue: '',
83
+ tooltip: '',
84
+ label: '',
85
+ inputId: null,
86
+ isInvalid: false,
87
+ errorMessage: '',
88
+ mask: null,
89
+ hideInvalidityIcon: false,
90
+ removeBorder: false,
91
+ isLarge: false,
92
+ isSearch: false,
93
+ help: '',
115
94
  })
116
95
 
117
- const emit = defineEmits(['update:modelValue'])
96
+ interface Emits {
97
+ (e: 'update:modelValue', value: string | number | boolean): void
98
+ }
99
+
100
+ const emit = defineEmits<Emits>()
118
101
 
119
102
  defineOptions({ inheritAttrs: false })
120
103
 
121
104
  const attrs = useAttrs()
122
105
 
123
106
  // class is a reserved word, we can't remove 'class' property from attrs
124
- // eslint-disable-next-line
107
+
125
108
  const { ['class']: value, id, ...restAttributes } = attrs
126
109
 
127
110
  const inputIdentifier = ref(id || randomString())
@@ -135,7 +118,7 @@ const slots = useSlots()
135
118
 
136
119
  const capitalizedLabel = computed(() => capitalizeFirstLetter(props.label))
137
120
 
138
- const inputModel = defineModel({
121
+ const inputModel = defineModel<string | number | boolean>({
139
122
  type: [String, Number, Boolean],
140
123
  default: '',
141
124
  set(newValue) {
@@ -181,11 +164,11 @@ const iconInvalidityClasses = computed(() => {
181
164
  const DOMElement = computed(() => cpInputContainer.value.children.namedItem(inputIdentifier.value))
182
165
 
183
166
  const displayErrorMessage = computed(() => isInputInvalid.value && props.errorMessage.length)
184
- const isClearButtonVisible = computed(() => props.isSearch && inputModel.value.length)
167
+ const isClearButtonVisible = computed(() => props.isSearch && inputModel.value.toString().length)
185
168
 
186
169
  const displayHelp = computed(() => props.help?.length && !displayErrorMessage.value)
187
170
 
188
- const handleChange = (newValue) => {
171
+ const handleChange = (newValue: string | number | boolean) => {
189
172
  emit('update:modelValue', newValue)
190
173
  checkInputValidity()
191
174
  }
@@ -203,7 +186,7 @@ const checkInputValidity = () => {
203
186
  (DOMElement.value.validity && DOMElement.value.validity.valueMissing)
204
187
  }
205
188
 
206
- const checkAttribute = (attribute) => attrs[attribute] === '' || attrs[attribute] === true
189
+ const checkAttribute = (attribute: string) => attrs[attribute] === '' || attrs[attribute] === true
207
190
 
208
191
  const clearInputValue = () => emit('update:modelValue', '')
209
192
 
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  </template>
29
29
 
30
- <script setup>
30
+ <script setup lang="ts">
31
31
  import { ref, computed } from 'vue'
32
32
 
33
33
  import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
@@ -35,57 +35,37 @@ import TransitionExpand from '@/components/helpers-utilities/TransitionExpand.vu
35
35
 
36
36
  import { randomString, capitalizeFirstLetter } from '@/helpers'
37
37
 
38
- const props = defineProps({
39
- modelValue: {
40
- type: String,
41
- default: '',
42
- required: false,
43
- },
44
- label: {
45
- type: String,
46
- default: '',
47
- required: false,
48
- },
49
- placeholder: {
50
- type: String,
51
- default: '',
52
- required: true,
53
- },
54
- required: {
55
- type: Boolean,
56
- default: false,
57
- required: false,
58
- },
59
- inputId: {
60
- type: String,
61
- default: '',
62
- required: false,
63
- },
64
- disabled: {
65
- type: Boolean,
66
- default: false,
67
- required: false,
68
- },
69
- isInvalid: {
70
- type: Boolean,
71
- default: false,
72
- required: false,
73
- },
74
- errorMessage: {
75
- type: String,
76
- default: '',
77
- required: false,
78
- },
79
- height: {
80
- type: Number,
81
- default: 200,
82
- required: false,
83
- },
38
+ interface Props {
39
+ disabled?: boolean
40
+ errorMessage?: string
41
+ height?: number
42
+ inputId?: string
43
+ isInvalid?: boolean
44
+ label?: string
45
+ modelValue?: string
46
+ placeholder?: string
47
+ required?: boolean
48
+ }
49
+
50
+ const props = withDefaults(defineProps<Props>(), {
51
+ modelValue: '',
52
+ label: '',
53
+ placeholder: '',
54
+ required: false,
55
+ inputId: '',
56
+ disabled: false,
57
+ isInvalid: false,
58
+ errorMessage: '',
59
+ height: 200,
84
60
  })
85
61
 
86
- const emit = defineEmits(['update:modelValue'])
62
+ interface Emits {
63
+ (e: 'update:modelValue', value: string): void
64
+ }
65
+
66
+ const emit = defineEmits<Emits>()
87
67
 
88
- const textareaModel = defineModel({
68
+ const textareaModel = defineModel<string>({
89
69
  type: String,
90
70
  default: '',
91
71
  required: false,
@@ -101,7 +81,7 @@ const capitalizedLabel = computed(() => capitalizeFirstLetter(props.label))
101
81
 
102
82
  const displayErrorMessage = computed(() => props.isInvalid && props.errorMessage.length)
103
83
 
104
- const handleChange = (newValue) => emit('update:modelValue', newValue)
84
+ const handleChange = (newValue: string) => emit('update:modelValue', newValue)
105
85
  </script>
106
86
 
107
87
  <style lang="scss">