@propelinc/citrus-ui 1.0.5 → 1.3.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 (201) hide show
  1. package/README.md +39 -14
  2. package/dist/citrus-ui.cdn.css +1 -0
  3. package/dist/citrus-ui.css +1 -0
  4. package/dist/colors/colors.d.ts +31 -0
  5. package/dist/colors/theme.d.ts +3 -0
  6. package/dist/colors/util-classes.d.ts +11 -0
  7. package/dist/components/CAccordion.vue.d.ts +34 -0
  8. package/dist/components/CAccordionItem.vue.d.ts +39 -0
  9. package/dist/components/CAppBar.vue.d.ts +59 -0
  10. package/dist/components/CBadge.vue.d.ts +35 -0
  11. package/dist/components/CBottomSheet.vue.d.ts +90 -0
  12. package/dist/components/CButton/CButton.vue.d.ts +97 -0
  13. package/dist/components/CButton/types.d.ts +5 -0
  14. package/dist/components/CButtonStack.vue.d.ts +27 -0
  15. package/dist/components/CCard.vue.d.ts +53 -0
  16. package/dist/components/CCardFooter.vue.d.ts +20 -0
  17. package/dist/components/CCardHeader.vue.d.ts +22 -0
  18. package/dist/components/CCardSection.vue.d.ts +26 -0
  19. package/dist/components/CCheckbox.vue.d.ts +62 -0
  20. package/dist/components/CCol.vue.d.ts +30 -0
  21. package/dist/components/CDivider.vue.d.ts +9 -0
  22. package/dist/components/CDobField.vue.d.ts +60 -0
  23. package/dist/components/CDobSelect.vue.d.ts +50 -0
  24. package/dist/components/CEmailField.vue.d.ts +48 -0
  25. package/dist/components/CExpandTransition.vue.d.ts +29 -0
  26. package/dist/components/CFadeTransition.vue.d.ts +20 -0
  27. package/dist/components/CFileInput.vue.d.ts +50 -0
  28. package/dist/components/CFixedPageFooter.vue.d.ts +153 -0
  29. package/dist/components/CForm.vue.d.ts +44 -0
  30. package/dist/components/CFormFieldCounter.vue.d.ts +15 -0
  31. package/dist/components/CIconButton.vue.d.ts +97 -0
  32. package/dist/components/CLabel.vue.d.ts +36 -0
  33. package/dist/components/CListItem.vue.d.ts +56 -0
  34. package/dist/components/CListItemContent.vue.d.ts +27 -0
  35. package/dist/components/CListItemIcon.vue.d.ts +28 -0
  36. package/dist/components/CLoader.vue.d.ts +23 -0
  37. package/dist/components/CLogo.vue.d.ts +9 -0
  38. package/dist/components/CMaskedTextField.vue.d.ts +511 -0
  39. package/dist/components/CMenu.vue.d.ts +17 -0
  40. package/dist/components/CMenuItem.vue.d.ts +37 -0
  41. package/dist/components/CMenuLabel.vue.d.ts +20 -0
  42. package/dist/components/CModal.vue.d.ts +59 -0
  43. package/dist/components/CModalLoading.vue.d.ts +36 -0
  44. package/dist/components/CNotification.vue.d.ts +64 -0
  45. package/dist/components/CPhoneField.vue.d.ts +792 -0
  46. package/dist/components/CPill.vue.d.ts +41 -0
  47. package/dist/components/CPillGroup.vue.d.ts +39 -0
  48. package/dist/components/CPopup.vue.d.ts +37 -0
  49. package/dist/components/CProgressLinear.vue.d.ts +21 -0
  50. package/dist/components/CProgressRing.vue.d.ts +48 -0
  51. package/dist/components/CRadio.vue.d.ts +40 -0
  52. package/dist/components/CRadioGroup.vue.d.ts +54 -0
  53. package/dist/components/CRebrand.vue.d.ts +28 -0
  54. package/dist/components/CRow.vue.d.ts +41 -0
  55. package/dist/components/CSafeArea.vue.d.ts +18 -0
  56. package/dist/components/CSectionHeader.vue.d.ts +29 -0
  57. package/dist/components/CSelect.vue.d.ts +96 -0
  58. package/dist/components/CSkeleton.vue.d.ts +3 -0
  59. package/dist/components/CSkeletonLoaderCard.vue.d.ts +9 -0
  60. package/dist/components/CSkeletonLoaderCircle.vue.d.ts +3 -0
  61. package/dist/components/CSkeletonLoaderText.vue.d.ts +16 -0
  62. package/dist/components/CSlideFadeTransition.vue.d.ts +36 -0
  63. package/dist/components/CSplitInput.vue.d.ts +56 -0
  64. package/dist/components/CSquaredIcon.vue.d.ts +33 -0
  65. package/dist/components/CSsnField.vue.d.ts +798 -0
  66. package/dist/components/CStatusDot.vue.d.ts +10 -0
  67. package/dist/components/CSwitch.vue.d.ts +39 -0
  68. package/dist/components/CSwitchListItem.vue.d.ts +48 -0
  69. package/dist/components/CTextArea.vue.d.ts +96 -0
  70. package/dist/components/CTextField.vue.d.ts +129 -0
  71. package/dist/components/CTextLink.vue.d.ts +36 -0
  72. package/dist/components/CThirdPartyLogo.vue.d.ts +22 -0
  73. package/dist/components/CTimeago.vue.d.ts +12 -0
  74. package/dist/components/CToast.vue.d.ts +69 -0
  75. package/dist/components/CToastsList.vue.d.ts +3 -0
  76. package/dist/components/CValidationMessage.vue.d.ts +37 -0
  77. package/dist/components/CZipcodeField.vue.d.ts +796 -0
  78. package/dist/components/index.d.ts +66 -0
  79. package/dist/components/internal/CCloseButton.vue.d.ts +14 -0
  80. package/dist/composables/accessibility.d.ts +1 -0
  81. package/dist/composables/animation.d.ts +12 -0
  82. package/dist/composables/binding.d.ts +19 -0
  83. package/dist/composables/colors.d.ts +13 -0
  84. package/dist/composables/elements.d.ts +3 -0
  85. package/dist/composables/fields.d.ts +10 -0
  86. package/dist/composables/gestures.d.ts +53 -0
  87. package/dist/composables/i18n.d.ts +3 -0
  88. package/dist/composables/id.d.ts +11 -0
  89. package/dist/composables/input-mask.d.ts +18 -0
  90. package/dist/composables/router.d.ts +30 -0
  91. package/dist/composables/slots.d.ts +2 -0
  92. package/dist/composables/toast.d.ts +21 -0
  93. package/dist/composables/validations.d.ts +77 -0
  94. package/dist/icons.cdn.mjs +3 -0
  95. package/dist/icons.cdn.mjs.map +1 -0
  96. package/dist/icons.d.ts +1 -0
  97. package/dist/icons.mjs +6 -0
  98. package/dist/icons.mjs.map +1 -0
  99. package/dist/index.cdn.mjs +9328 -12875
  100. package/dist/index.cdn.mjs.map +1 -1
  101. package/dist/index.cdn2.mjs +55255 -0
  102. package/dist/index.cdn2.mjs.map +1 -0
  103. package/dist/index.d.ts +8 -0
  104. package/dist/index.mjs +3946 -0
  105. package/dist/index.mjs.map +1 -0
  106. package/dist/plugin.d.ts +3 -0
  107. package/dist/services/animation.d.ts +17 -0
  108. package/dist/services/directives/index.d.ts +2 -0
  109. package/dist/services/directives/scroll-into-view.d.ts +7 -0
  110. package/dist/services/directives/tap-animation.d.ts +6 -0
  111. package/dist/services/id.d.ts +22 -0
  112. package/dist/services/injections/accordions.d.ts +3 -0
  113. package/dist/services/injections/animations.d.ts +2 -0
  114. package/dist/services/injections/buttons.d.ts +4 -0
  115. package/dist/services/injections/forms.d.ts +6 -0
  116. package/dist/services/injections/icon-buttons.d.ts +3 -0
  117. package/dist/services/injections/pills.d.ts +4 -0
  118. package/dist/services/injections/radio.d.ts +10 -0
  119. package/dist/{styles/main.css → styles.css} +8 -6
  120. package/dist/theme/icons.d.ts +36 -0
  121. package/dist/types/CForm.d.ts +12 -0
  122. package/dist/types/font-awesome.d.ts +5 -0
  123. package/dist/types.d.ts +13 -0
  124. package/package.json +8 -3
  125. package/src/colors/colors.ts +8 -3
  126. package/src/components/CAccordion.vue +31 -24
  127. package/src/components/CAccordionItem.vue +46 -45
  128. package/src/components/CAppBar.vue +108 -101
  129. package/src/components/CBadge.vue +33 -25
  130. package/src/components/CBottomSheet.vue +212 -199
  131. package/src/components/CButton/CButton.vue +135 -147
  132. package/src/components/CButtonStack.vue +21 -13
  133. package/src/components/CCard.vue +72 -69
  134. package/src/components/CCardFooter.vue +5 -5
  135. package/src/components/CCardHeader.vue +9 -7
  136. package/src/components/CCardSection.vue +15 -8
  137. package/src/components/CCheckbox.vue +68 -69
  138. package/src/components/CCol.vue +21 -22
  139. package/src/components/CDivider.vue +9 -8
  140. package/src/components/CDobField.vue +114 -105
  141. package/src/components/CDobSelect.vue +162 -164
  142. package/src/components/CEmailField.vue +39 -27
  143. package/src/components/CExpandTransition.vue +14 -17
  144. package/src/components/CFadeTransition.vue +3 -3
  145. package/src/components/CFileInput.vue +57 -50
  146. package/src/components/CFixedPageFooter.vue +23 -17
  147. package/src/components/CForm.vue +67 -60
  148. package/src/components/CFormFieldCounter.vue +25 -28
  149. package/src/components/CIconButton.vue +84 -65
  150. package/src/components/CLabel.vue +19 -13
  151. package/src/components/CListItem.vue +67 -66
  152. package/src/components/CListItemContent.vue +14 -16
  153. package/src/components/CListItemIcon.vue +18 -14
  154. package/src/components/CLoader.vue +47 -56
  155. package/src/components/CLogo.vue +13 -12
  156. package/src/components/CMaskedTextField.vue +80 -64
  157. package/src/components/CMenu.vue +14 -6
  158. package/src/components/CMenuItem.vue +28 -22
  159. package/src/components/CMenuLabel.vue +6 -5
  160. package/src/components/CModal.vue +76 -71
  161. package/src/components/CModalLoading.vue +24 -15
  162. package/src/components/CNotification.vue +77 -28
  163. package/src/components/CPhoneField.vue +34 -25
  164. package/src/components/CPill.vue +92 -88
  165. package/src/components/CPillGroup.vue +30 -21
  166. package/src/components/CPopup.vue +46 -37
  167. package/src/components/CProgressLinear.vue +17 -11
  168. package/src/components/CProgressRing.vue +33 -33
  169. package/src/components/CRadio.vue +57 -57
  170. package/src/components/CRadioGroup.vue +85 -72
  171. package/src/components/CRow.vue +22 -20
  172. package/src/components/CSectionHeader.vue +20 -12
  173. package/src/components/CSelect.vue +89 -73
  174. package/src/components/CSkeletonLoaderCard.vue +9 -15
  175. package/src/components/CSkeletonLoaderCircle.vue +1 -9
  176. package/src/components/CSkeletonLoaderText.vue +17 -18
  177. package/src/components/CSlideFadeTransition.vue +12 -34
  178. package/src/components/CSplitInput.vue +46 -45
  179. package/src/components/CSquaredIcon.vue +39 -29
  180. package/src/components/CSsnField.vue +48 -36
  181. package/src/components/CStatusDot.vue +16 -16
  182. package/src/components/CSwitch.vue +31 -22
  183. package/src/components/CSwitchListItem.vue +27 -28
  184. package/src/components/CTextArea.vue +116 -83
  185. package/src/components/CTextField.vue +194 -198
  186. package/src/components/CTextLink.vue +28 -25
  187. package/src/components/CThirdPartyLogo.vue +30 -59
  188. package/src/components/CToast.vue +135 -132
  189. package/src/components/CToastsList.vue +2 -15
  190. package/src/components/CValidationMessage.vue +31 -24
  191. package/src/components/CZipcodeField.vue +40 -27
  192. package/src/composables/elements.ts +1 -1
  193. package/src/composables/fields.ts +4 -4
  194. package/src/composables/router.ts +6 -5
  195. package/src/icons.ts +6 -0
  196. package/src/services/injections/buttons.ts +1 -1
  197. package/src/styles/_core.scss +1 -2
  198. package/src/styles/_reset.scss +1 -1
  199. package/src/types.ts +2 -0
  200. package/dist/index.cdn.css +0 -1
  201. package/dist/styles/utils.css +0 -2709
@@ -39,12 +39,12 @@
39
39
  </sl-button>
40
40
  </template>
41
41
 
42
- <script lang="ts">
42
+ <script setup lang="ts">
43
43
  import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
44
44
  import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
45
45
  import '@shoelace-style/shoelace/dist/components/button/button.js';
46
- import type { PropType } from 'vue';
47
- import { computed, defineComponent, inject, ref, toRefs } from 'vue';
46
+ import type { VNode } from 'vue';
47
+ import { computed, inject, ref } from 'vue';
48
48
  import type { RouteLocationRaw } from 'vue-router';
49
49
 
50
50
  import type {
@@ -64,190 +64,178 @@ import { BLOCK, BOUNCE_AMOUNT, LARGE } from '@propelinc/citrus-ui/src/services/i
64
64
  * This mapping is used to translate the variant names to the correct Shoelace variant names
65
65
  * and apply it to the underlying Shoelace button component.
66
66
  */
67
- export const VARIANT_TO_SHOELACE_VARIANT: Record<ButtonVariant, ButtonShoelaceVariant> = {
67
+ const VARIANT_TO_SHOELACE_VARIANT: Record<ButtonVariant, ButtonShoelaceVariant> = {
68
68
  primary: 'primary',
69
69
  // Shoelace `default` is an outline style
70
70
  secondary: 'default',
71
71
  tertiary: 'text',
72
72
  };
73
73
 
74
- const BLOCK_BOUNCE_AMOUNT = 0.96;
75
- const BASE_BOUNCE_AMOUNT = 0.94;
76
-
77
- export default defineComponent({
78
- components: {
79
- FontAwesomeIcon,
80
- },
81
- props: {
74
+ const props = withDefaults(
75
+ defineProps<{
82
76
  /** Controls whether button appears as full-width */
83
- block: { type: Boolean, default: false },
77
+ block?: boolean;
84
78
  /** Controls whether button is disabled */
85
- disabled: { type: Boolean, default: false },
79
+ disabled?: boolean;
86
80
  /** Designates the button as an anchor and applies the href attribute */
87
- href: { type: String, default: undefined },
88
- /** Chooses an icon to render on the left side of the button */
89
- icon: {
90
- type: [String, Array, Object] as PropType<string | string[] | IconDefinition>,
91
- default: undefined,
92
- },
81
+ href?: string;
82
+ /** Chooses an icon to render next to the button text */
83
+ icon?: string | string[] | IconDefinition;
93
84
  /** Chooses whether to place the icon before or after the button text */
94
- iconPosition: {
95
- type: String as PropType<ButtonIconPosition>,
96
- default: 'prefix',
97
- validator: (value: string) => ['prefix', 'suffix'].includes(value),
98
- },
85
+ iconPosition?: ButtonIconPosition;
99
86
  /**
100
87
  * @deprecated use `size` prop instead
101
88
  * Controls whether button uses the large variant
102
89
  */
103
- large: { type: Boolean, default: false, deprecated: true },
90
+ large?: boolean;
104
91
  /** Controls the level of the button */
105
- level: {
106
- type: String as PropType<ButtonLevel>,
107
- default: 'normal',
108
- validator: (value: string) => ['normal', 'danger'].includes(value),
109
- },
92
+ level?: ButtonLevel;
110
93
  /** Controls whether button is loading */
111
- loading: { type: Boolean, default: false },
94
+ loading?: boolean;
112
95
  /**
113
96
  * @deprecated use `variant` prop instead
114
- * Controls whether button uses the secondary variant */
115
- secondary: { type: Boolean, default: false, deprecated: true },
97
+ * Controls whether button uses the secondary variant
98
+ */
99
+ secondary?: boolean;
116
100
  /**
117
101
  * Controls the size of the button
118
102
  * @default 'medium'
119
103
  */
120
- size: {
121
- type: String as PropType<ButtonSize>,
122
- default: 'medium',
123
- validator: (value: string) => ['medium', 'large'].includes(value),
124
- },
104
+ size?: ButtonSize;
125
105
  /** Designates the target attribute. Only use with the href prop. */
126
- target: { type: String, default: undefined },
106
+ target?: string;
127
107
  /**
128
108
  * @deprecated use `variant` prop instead
129
109
  * Controls whether button uses the tertiary variant
130
110
  */
131
- tertiary: { type: Boolean, default: false, deprecated: true },
111
+ tertiary?: boolean;
132
112
  /** Controls whether button functions as a router-link */
133
- to: { type: [Object, String] as PropType<RouteLocationRaw>, default: undefined },
113
+ to?: RouteLocationRaw;
134
114
  /**
135
115
  * Controls the styling of the button
136
116
  * @default 'primary'
137
117
  */
138
- variant: {
139
- type: String as PropType<ButtonVariant>,
140
- default: 'primary',
141
- validator: (value: string) => ['primary', 'secondary', 'tertiary'].includes(value),
142
- },
143
- },
144
- emits: ['click', 'focus', 'blur'],
145
- setup(props, { emit }) {
146
- const { block, to } = toRefs(props);
147
- const { href: routerDestination, navigate } = useRouterLink(to);
148
- const routerDestinationOrHref = computed(() => routerDestination.value ?? props.href);
118
+ variant?: ButtonVariant;
119
+ }>(),
120
+ {
121
+ block: false,
122
+ disabled: false,
123
+ href: undefined,
124
+ icon: undefined,
125
+ iconPosition: 'prefix',
126
+ large: false,
127
+ level: 'normal',
128
+ loading: false,
129
+ secondary: false,
130
+ size: 'medium',
131
+ target: undefined,
132
+ tertiary: false,
133
+ to: undefined,
134
+ variant: 'primary',
135
+ }
136
+ );
149
137
 
150
- const dataLoading = computed<true | undefined>(() => props.loading || undefined);
138
+ const emit = defineEmits<{
139
+ click: [event: MouseEvent];
140
+ focus: [event: Event];
141
+ blur: [event: Event];
142
+ }>();
151
143
 
152
- const injectedBlock = inject(BLOCK, undefined);
153
- const injectedOrPropBlock = computed(() => injectedBlock?.value ?? props.block);
154
- const dataBlock = computed<true | undefined>(() => injectedOrPropBlock.value || undefined);
144
+ defineSlots<{
145
+ icon?: () => VNode[];
146
+ default?: () => VNode[];
147
+ }>();
155
148
 
156
- const iconSlotHasContent = useSlotHasContent('icon');
157
- const hasIcon = computed(() => iconSlotHasContent.value || !!props.icon);
149
+ const BLOCK_BOUNCE_AMOUNT = 0.96;
150
+ const BASE_BOUNCE_AMOUNT = 0.94;
158
151
 
159
- /**
160
- * Handle the deprecated `secondary` and `tertiary` props.
161
- */
162
- const computedVariant = computed((): ButtonVariant => {
163
- if (props.secondary) {
164
- return 'secondary';
165
- }
152
+ const { href: routerDestination, navigate } = useRouterLink(() => props.to);
153
+ const routerDestinationOrHref = computed(() => routerDestination.value ?? props.href);
166
154
 
167
- if (props.tertiary) {
168
- return 'tertiary';
169
- }
155
+ const dataLoading = computed<true | undefined>(() => props.loading || undefined);
170
156
 
171
- return props.variant;
172
- });
157
+ const injectedBlock = inject(BLOCK, undefined);
158
+ const injectedOrPropBlock = computed(() => injectedBlock?.value ?? props.block);
159
+ const dataBlock = computed<true | undefined>(() => injectedOrPropBlock.value || undefined);
173
160
 
174
- /**
175
- * Map the computed variant to the Shoelace variant
176
- */
177
- const shoelaceVariant = computed(() => VARIANT_TO_SHOELACE_VARIANT[computedVariant.value]);
161
+ const iconSlotHasContent = useSlotHasContent('icon');
162
+ const hasIcon = computed(() => iconSlotHasContent.value || !!props.icon);
178
163
 
179
- /**
180
- * The deprecated `large` prop can be injected through a provider.
181
- */
182
- const injectedLarge = inject(LARGE, undefined);
183
- const injectedOrPropsLarge = computed(() => injectedLarge?.value ?? props.large);
184
- /**
185
- * Because we want the `size` prop to have a default, it's always supplied.
186
- * Thus, our only option to respect the deprecated `large` prop is to give it priority.
187
- */
188
- const computedSize = computed(() => {
189
- if (injectedOrPropsLarge.value) {
190
- return 'large';
191
- }
192
-
193
- return props.size;
194
- });
195
-
196
- function onClick(event: MouseEvent): void {
197
- /**
198
- * If the button is disabled or loading, do not take action.
199
- * This prevents double/extra clicks when an async operation is in progress.
200
- */
201
- if (props.disabled || props.loading) {
202
- return;
203
- }
204
-
205
- navigate(event);
206
- emit('click', event);
207
- }
208
-
209
- const button = ref<HTMLElement | null>(null);
210
- const injectedBounceAmount = inject(BOUNCE_AMOUNT, null);
211
- const bounceAmount = computed(() => {
212
- /**
213
- * If the button is disabled or loading, do not animate the button.
214
- */
215
- if (props.disabled || props.loading) {
216
- return 1;
217
- }
218
-
219
- if (injectedBounceAmount) {
220
- return injectedBounceAmount;
221
- }
222
-
223
- if (block.value) {
224
- return BLOCK_BOUNCE_AMOUNT;
225
- }
226
-
227
- return BASE_BOUNCE_AMOUNT;
228
- });
229
- const animationListeners = useTapAnimation({
230
- el: button,
231
- keyframes: {
232
- default: { transform: 'scale(1)' },
233
- pressed: { transform: `scale(${bounceAmount.value})` },
234
- },
235
- });
236
-
237
- return {
238
- animationListeners,
239
- button,
240
- computedSize,
241
- computedVariant,
242
- dataBlock,
243
- dataLoading,
244
- hasIcon,
245
- injectedOrPropBlock,
246
- injectedOrPropsLarge,
247
- onClick,
248
- routerDestinationOrHref,
249
- shoelaceVariant,
250
- };
164
+ /**
165
+ * Handle the deprecated `secondary` and `tertiary` props.
166
+ */
167
+ const computedVariant = computed((): ButtonVariant => {
168
+ if (props.secondary) {
169
+ return 'secondary';
170
+ }
171
+
172
+ if (props.tertiary) {
173
+ return 'tertiary';
174
+ }
175
+
176
+ return props.variant;
177
+ });
178
+
179
+ /**
180
+ * Map the computed variant to the Shoelace variant
181
+ */
182
+ const shoelaceVariant = computed(() => VARIANT_TO_SHOELACE_VARIANT[computedVariant.value]);
183
+
184
+ /**
185
+ * The deprecated `large` prop can be injected through a provider.
186
+ */
187
+ const injectedLarge = inject(LARGE, undefined);
188
+ const injectedOrPropsLarge = computed(() => injectedLarge?.value ?? props.large);
189
+ /**
190
+ * Because we want the `size` prop to have a default, it's always supplied.
191
+ * Thus, our only option to respect the deprecated `large` prop is to give it priority.
192
+ */
193
+ const computedSize = computed(() => {
194
+ if (injectedOrPropsLarge.value) {
195
+ return 'large';
196
+ }
197
+
198
+ return props.size;
199
+ });
200
+
201
+ function onClick(event: MouseEvent): void {
202
+ /**
203
+ * If the button is disabled or loading, do not take action.
204
+ * This prevents double/extra clicks when an async operation is in progress.
205
+ */
206
+ if (props.disabled || props.loading) {
207
+ return;
208
+ }
209
+
210
+ navigate(event);
211
+ emit('click', event);
212
+ }
213
+
214
+ const button = ref<HTMLElement | null>(null);
215
+ const injectedBounceAmount = inject(BOUNCE_AMOUNT, null);
216
+ const bounceAmount = computed(() => {
217
+ /**
218
+ * If the button is disabled or loading, do not animate the button.
219
+ */
220
+ if (props.disabled || props.loading) {
221
+ return 1;
222
+ }
223
+
224
+ if (injectedBounceAmount) {
225
+ return injectedBounceAmount;
226
+ }
227
+
228
+ if (props.block) {
229
+ return BLOCK_BOUNCE_AMOUNT;
230
+ }
231
+
232
+ return BASE_BOUNCE_AMOUNT;
233
+ });
234
+ const animationListeners = useTapAnimation({
235
+ el: button,
236
+ keyframes: {
237
+ default: { transform: 'scale(1)' },
238
+ pressed: { transform: `scale(${bounceAmount.value})` },
251
239
  },
252
240
  });
253
241
  </script>
@@ -4,23 +4,31 @@
4
4
  </component>
5
5
  </template>
6
6
 
7
- <script lang="ts">
8
- import { defineComponent, provide, ref, toRefs } from 'vue';
7
+ <script setup lang="ts">
8
+ import type { Ref, VNode } from 'vue';
9
+ import { provide, ref, toRef } from 'vue';
9
10
 
10
11
  import { BLOCK, LARGE } from '@propelinc/citrus-ui/src/services/injections/buttons';
11
12
 
12
- export default defineComponent({
13
- props: {
14
- tag: { type: String, default: 'div' },
15
- large: { type: Boolean, default: null },
16
- },
17
- setup(props) {
18
- const { large } = toRefs(props);
13
+ const props = withDefaults(
14
+ defineProps<{
15
+ tag?: string;
16
+ large?: boolean | null;
17
+ }>(),
18
+ {
19
+ tag: 'div',
20
+ large: null,
21
+ }
22
+ );
23
+
24
+ defineSlots<{
25
+ default?: () => VNode[];
26
+ }>();
27
+
28
+ const large = toRef(props, 'large') as Ref<boolean | null>;
19
29
 
20
- provide(BLOCK, ref(true));
21
- provide(LARGE, large);
22
- },
23
- });
30
+ provide(BLOCK, ref(true));
31
+ provide(LARGE, large);
24
32
  </script>
25
33
 
26
34
  <style scoped>
@@ -24,9 +24,9 @@
24
24
  </component>
25
25
  </template>
26
26
 
27
- <script lang="ts">
28
- import type { PropType } from 'vue';
29
- import { computed, defineComponent, toRefs } from 'vue';
27
+ <script setup lang="ts">
28
+ import type { VNode } from 'vue';
29
+ import { computed, useAttrs } from 'vue';
30
30
  import type { RouteLocationRaw } from 'vue-router';
31
31
 
32
32
  import CCardHeader from '@propelinc/citrus-ui/src/components/CCardHeader.vue';
@@ -40,80 +40,83 @@ export interface InternalCardConfig {
40
40
  isLink: boolean;
41
41
  }
42
42
 
43
- export default defineComponent({
44
- components: { CCardHeader },
45
- props: {
43
+ const props = withDefaults(
44
+ defineProps<{
46
45
  /** Sets the border color of the card */
47
- borderColor: { type: String, default: undefined },
48
-
46
+ borderColor?: string;
49
47
  /** Removes the border of the card */
50
- borderless: { type: Boolean, default: false },
51
-
48
+ borderless?: boolean;
52
49
  /** Sets the background color of the entire card */
53
- color: { type: String, default: undefined },
54
-
50
+ color?: string;
55
51
  /** Navigates externally on click */
56
- href: { type: String, default: undefined },
57
-
52
+ href?: string;
58
53
  /** Stretches the card vertically to fill the height of the parent container */
59
- stretch: { type: Boolean, default: false },
60
-
54
+ stretch?: boolean;
61
55
  /** Toggles a squared-off card style intended to fill the width of the page */
62
- tile: { type: Boolean, default: false },
63
-
56
+ tile?: boolean;
64
57
  /** Sets the title of the card */
65
- title: { type: String, default: undefined },
66
-
58
+ title?: string;
67
59
  /** Navigates within the app on click */
68
- to: { type: [Object, String] as PropType<RouteLocationRaw | undefined>, default: undefined },
69
- },
70
- setup(props, { attrs }) {
71
- const { href, to } = toRefs(props);
72
-
73
- const { cssColor: backgroundCssColor } = useCssColor(() => props.color);
74
- const { cssColor: borderCssColor } = useCssColor(() => props.borderColor);
75
-
76
- const routingVariant = computed<RoutingVariant>(() => {
77
- if (to.value) {
78
- return 'internal';
79
- }
80
-
81
- if (href.value) {
82
- return 'external';
83
- }
84
-
85
- return 'none';
86
- });
87
-
88
- const config = computed<InternalCardConfig>(() => {
89
- switch (routingVariant.value) {
90
- case 'internal':
91
- return {
92
- attrs,
93
- element: 'router-link',
94
- isLink: true,
95
- };
96
-
97
- case 'external':
98
- return {
99
- attrs: {
100
- ...attrs,
101
- role: 'link',
102
- tabindex: '0',
103
- target: '_blank',
104
- },
105
- element: 'a',
106
- isLink: true,
107
- };
108
-
109
- case 'none':
110
- default:
111
- return { attrs, element: 'div', isLink: false };
112
- }
113
- });
114
-
115
- return { config, backgroundCssColor, borderCssColor };
116
- },
60
+ to?: RouteLocationRaw;
61
+ }>(),
62
+ {
63
+ borderColor: undefined,
64
+ borderless: false,
65
+ color: undefined,
66
+ href: undefined,
67
+ stretch: false,
68
+ tile: false,
69
+ title: undefined,
70
+ to: undefined,
71
+ }
72
+ );
73
+
74
+ defineSlots<{
75
+ default?: () => VNode[];
76
+ }>();
77
+
78
+ const attrs = useAttrs();
79
+
80
+ const { cssColor: backgroundCssColor } = useCssColor(() => props.color);
81
+ const { cssColor: borderCssColor } = useCssColor(() => props.borderColor);
82
+
83
+ const routingVariant = computed<RoutingVariant>(() => {
84
+ if (props.to) {
85
+ return 'internal';
86
+ }
87
+
88
+ if (props.href) {
89
+ return 'external';
90
+ }
91
+
92
+ return 'none';
93
+ });
94
+
95
+ const config = computed<InternalCardConfig>(() => {
96
+ switch (routingVariant.value) {
97
+ case 'internal':
98
+ return {
99
+ attrs,
100
+ element: 'router-link',
101
+ isLink: true,
102
+ };
103
+
104
+ case 'external':
105
+ return {
106
+ attrs: {
107
+ ...attrs,
108
+ role: 'link',
109
+ tabindex: '0',
110
+ target: '_blank',
111
+ },
112
+ element: 'a',
113
+ isLink: true,
114
+ };
115
+
116
+ case 'none':
117
+ default:
118
+ return { attrs, element: 'div', isLink: false };
119
+ }
117
120
  });
118
121
  </script>
119
122
 
@@ -4,14 +4,14 @@
4
4
  </CButtonStack>
5
5
  </template>
6
6
 
7
- <script lang="ts">
8
- import { defineComponent } from 'vue';
7
+ <script setup lang="ts">
8
+ import type { VNode } from 'vue';
9
9
 
10
10
  import CButtonStack from '@propelinc/citrus-ui/src/components/CButtonStack.vue';
11
11
 
12
- export default defineComponent({
13
- components: { CButtonStack },
14
- });
12
+ defineSlots<{
13
+ default?: () => VNode[];
14
+ }>();
15
15
  </script>
16
16
 
17
17
  <style lang="scss" scoped>
@@ -10,16 +10,18 @@
10
10
  </div>
11
11
  </template>
12
12
 
13
- <script lang="ts">
14
- import { defineComponent, provide, ref } from 'vue';
13
+ <script setup lang="ts">
14
+ import type { VNode } from 'vue';
15
+ import { provide, ref } from 'vue';
15
16
 
16
17
  import { TERTIARY as TERTIARY_ICON_BUTTON } from '@propelinc/citrus-ui/src/services/injections/icon-buttons';
17
18
 
18
- export default defineComponent({
19
- setup() {
20
- provide(TERTIARY_ICON_BUTTON, ref(true));
21
- },
22
- });
19
+ defineSlots<{
20
+ default?: () => VNode[];
21
+ append?: () => VNode[];
22
+ }>();
23
+
24
+ provide(TERTIARY_ICON_BUTTON, ref(true));
23
25
  </script>
24
26
 
25
27
  <style lang="scss" scoped>
@@ -9,15 +9,22 @@
9
9
  </div>
10
10
  </template>
11
11
 
12
- <script lang="ts">
13
- import { defineComponent } from 'vue';
12
+ <script setup lang="ts">
13
+ import type { VNode } from 'vue';
14
14
 
15
- export default defineComponent({
16
- props: {
17
- /** Removes the padding from the section */
18
- fluid: { type: Boolean, default: false },
19
- },
20
- });
15
+ withDefaults(
16
+ defineProps<{
17
+ /** Removes the padding from the content */
18
+ fluid?: boolean;
19
+ }>(),
20
+ {
21
+ fluid: false,
22
+ }
23
+ );
24
+
25
+ defineSlots<{
26
+ default?: () => VNode[];
27
+ }>();
21
28
  </script>
22
29
 
23
30
  <style lang="scss" scoped>